html, body {
    height: 100%; 
    margin: 0;
    padding: 0; 
    font-family: sans-serif;
    background-color: #f0f0f0;
}

/* Target the main jsPsych display element for horizontal centering */
#jspsych-display {
    display: flex;         /* Make it a flex container */
    flex-direction: column; /* Stack its children (like hub-container) vertically */
    align-items: center;   /* Center its children horizontally */
    width: 100%;           /* Ensure it takes full width */
    /* DO NOT set min-height: 100vh here, as we want content to flow from the top */
}

.game-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 20px;
}

#canvas-container {
    border: 2px solid #333;
}

.game-sidebar {
    width: 200px;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.game-sidebar h3 {
    text-align: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-top: 0;
}

#toolbox button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 5px;
    text-transform: capitalize;
    cursor: pointer;
    border: 1px solid #aaa;
    background-color: #fff;
}

#toolbox button:hover {
    background-color: #eee;
}

.game-sidebar .action-buttons {
    margin-top: top; /* Pushes the start/reset buttons to the bottom */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-sidebar .action-buttons button {
    padding: 15px;
    font-size: 16px;
    cursor: pointer;
}

/* Unified Completion Screen Styles */
.game-complete-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    z-index: 10000;
}

.game-complete-card {
    background: white;
    padding: 50px 40px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: fadeInUp 0.6s ease-out;
}

.game-complete-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.game-complete-title {
    color: #2c3e50;
    font-size: 32px;
    font-weight: bold;
    margin: 0 0 15px 0;
}

.game-complete-subtitle {
    color: #34495e;
    font-size: 20px;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.game-complete-message {
    color: #7f8c8d;
    font-size: 18px;
    margin: 0 0 25px 0;
    line-height: 1.4;
}

.game-complete-redirect {
    background: rgba(52, 152, 219, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.game-complete-countdown {
    color: #3498db;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
}

.countdown-timer {
    font-weight: bold;
    color: #2980b9;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}