/* Import pixel art font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Reset and base styles */
:root {
    --col-1: #b6c5a3; /* sage */
    --col-2: #b4d7de; /* sky */
    --col-3: #90dbbd; /* mint */
    --col-4: #8ba3dd; /* periwinkle */
    --col-5: #ba99d5; /* lavender */
    --ink: #2b2b2b;
    --ink-dark: #1f1f1f;
    --border: #3B291F;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: var(--col-2);
    min-height: 100vh;
    color: var(--ink);
    font-size: 11px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    overflow-x: hidden;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('game-core/assets/images/background.png') center/cover no-repeat fixed; /* apply background image */
}

/* Keep content within the image height; avoid overflow scroll when image ends */
.dashboard { padding-bottom: 24px; }

/* Pixel Art Container */
.pixel-container {
    /* Warm taupe panel (no green) */
    background: #8A6F5A;
    border: 4px solid #3B291F; /* dark brown */
    box-shadow: inset 0 0 0 2px #C4A27A; /* light sand bevel */
    position: relative;
}

/* Login Screen */
.login-container {
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
    position: relative;
}

.login-container h1 {
    margin-bottom: 2rem;
    color: #FFFFFF;
    font-size: 1.6rem; /* not too big */
    letter-spacing: 1px;
}

@keyframes glow {
    from { text-shadow: 2px 2px 0px #0a251c, 4px 4px 0px rgba(0, 255, 136, 0.3), 0 0 20px rgba(0, 255, 136, 0.4); }
    to { text-shadow: 2px 2px 0px #0a251c, 4px 4px 0px rgba(0, 255, 136, 0.3), 0 0 30px rgba(0, 255, 136, 0.8); }
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.auth-form input {
    padding: 1rem;
    border: 3px solid #3B291F;
    border-radius: 0;
    background: #7F5B45; /* darker for white text */
    color: #FFFFFF;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    image-rendering: pixelated;
}

.auth-form input::placeholder { color: #FFFFFF; opacity: 0.85; }

.auth-form input:focus {
    outline: none;
    border-color: #7F5B45; /* mid brown */
    background: #8A6F5A;
}

.auth-form button {
    padding: 1.2rem;
    border: 3px solid #00ff88;
    border-radius: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    box-shadow: 
        0 4px 0px #1a4a2e,
        0 8px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.1s ease;
    image-rendering: pixelated;
}

#login-btn, #signup-btn {
    background: var(--col-4) !important;
    color: white !important;
    border: 3px solid var(--border) !important;
    border-radius: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    padding: 1rem 2rem;
    box-shadow: 
        0 4px 0px var(--col-5),
        0 8px 20px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    transition: all 0.2s ease;
}

#login-btn:hover, #signup-btn:hover {
    background: var(--col-5) !important;
    transform: translateY(2px);
    box-shadow: 
        0 2px 0px var(--col-5),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

#google-login-btn {
    background: var(--col-1) !important;
    color: var(--ink-dark) !important;
    border: 3px solid var(--border) !important;
    border-radius: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    padding: 1rem 2rem;
    box-shadow: 
        0 4px 0px var(--col-3),
        0 8px 20px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    transition: all 0.2s ease;
}

#google-login-btn:hover {
    background: var(--col-3) !important;
    transform: translateY(2px);
    box-shadow: 
        0 2px 0px var(--col-3),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

.error-message {
    color: #e53e3e;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Dashboard */
.header {
    background: var(--col-1);
    border-bottom: 3px solid var(--border);
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-brand h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--ink-dark);
    margin: 0;
}

.header-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.nav-btn {
    background: transparent;
    border: 2px solid transparent;
    color: var(--ink-dark);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    background: var(--col-2);
    border-color: var(--border);
}

.nav-btn.active {
    background: var(--col-3);
    border-color: var(--border);
    border-bottom-width: 3px;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    color: var(--ink-dark);
    text-decoration: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-menu a:hover {
    border: 2px solid var(--border);
    background: var(--col-2);
    box-shadow: 0 2px 0 var(--ink-dark);
}

.nav-menu a:active {
    transform: translateY(2px);
    box-shadow: none;
}

.header h1 { 
    color: #FFFFFF; 
    font-size: 1.4rem; 
    letter-spacing: 1px; 
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px 0px var(--ink-dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
}

.user-info #user-display-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--ink-dark);
    padding: 0.5rem 1rem;
    background: var(--col-2);
    border: 2px solid var(--border);
}

/* VARK button in modals - simple 2D styling */
.vark-btn {
    background: var(--col-3) !important;
    border: 2px solid var(--border) !important;
    color: var(--ink-dark) !important;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vark-btn:hover {
    background: var(--col-4) !important;
}

#logout-btn {
    background: var(--col-5) !important; 
    border: 2px solid var(--border) !important; 
    color: white !important; 
    font-family: 'Press Start 2P', cursive; 
    font-size: 0.6rem; 
    padding: 0.5rem 1rem; 
    cursor: pointer; 
    border-radius: 0; 
    box-shadow: 
        0 3px 0px var(--ink-dark),
        0 6px 15px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    transition: all 0.2s ease;
}

#logout-btn:hover {
    background: var(--ink-dark) !important;
    transform: translateY(1px);
    box-shadow: 
        0 2px 0px var(--ink-dark),
        0 4px 10px rgba(0, 0, 0, 0.3);
}

#user-display-name {
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    text-shadow: 1px 1px 0px var(--ink-dark);
}

.user-info span {
    color: #4a7c59;
    font-size: 1.1rem;
    text-shadow: 1px 1px 0px #0a251c;
}

#logout-btn { background: #B65252; color: #fff; border: 3px solid #3B291F; padding: 0.6rem 1rem; font-family: 'Press Start 2P', cursive; font-size: 0.8rem; cursor: pointer; }

#logout-btn:hover { background: #9E3F3F; }

.dashboard { margin-top: 100px; padding: 2rem; display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 100px); }

/* Game Section */
.game-section { background: var(--col-3); border:4px solid var(--border); padding:2rem; max-width:780px; width:100%; box-shadow: inset 0 0 0 2px var(--col-1); }

.game-section::before { content:''; }

.game-section h2 { color: var(--ink-dark); font-size:1.4rem; text-align:center; margin-bottom:1.2rem; letter-spacing:1px; }

.game-section p { color: var(--ink-dark); font-size:0.9rem; text-align:center; margin-bottom:1.2rem; line-height:1.4; }

.game-btn {
    background: var(--col-4) !important;
    color: white !important;
    border: 4px solid var(--border) !important;
    padding: 2rem 3rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.6rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    border-radius: 0;
    margin: 0 auto;
    position: relative;
    box-shadow: 
        0 6px 0px #1a4a2e,
        0 12px 25px rgba(0, 0, 0, 0.4),
        inset 0 2px 0px rgba(0, 255, 136, 0.2);
    transition: all 0.1s ease;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-btn:hover {
    background: var(--col-5) !important;
    transform: translateY(2px);
    box-shadow: 
        0 4px 0px var(--border),
        0 8px 20px rgba(0, 0, 0, 0.4);
}

.game-btn:active {
    transform: translateY(2px) scale(1.02);
    box-shadow: 
        0 4px 0px #1a4a2e,
        0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Pixel Art Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(42, 90, 62, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(26, 74, 46, 0.3) 0%, transparent 50%),
        rgba(10, 37, 28, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

/* Hint modals should appear in front of challenge modal */
#visual-modal, #aural-modal, #read-modal, #kinesthetic-modal {
    z-index: 5000;
    background: 
        radial-gradient(circle at 30% 30%, rgba(217, 160, 102, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(139, 90, 54, 0.3) 0%, transparent 50%),
        rgba(217, 160, 102, 0.95);
}

#visual-modal .modal-content, #aural-modal .modal-content, #read-modal .modal-content, #kinesthetic-modal .modal-content {
    position: relative;
    z-index: 5001;
    background: #ABEBD2; /* Aural interface background color */
    border: 4px solid var(--border);
    box-shadow: 
        0 8px 0px var(--col-4),
        0 16px 30px rgba(0, 0, 0, 0.4),
        inset 0 2px 0px rgba(255, 255, 255, 0.1);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.modal-content {
    background: var(--col-2);
    border: 4px solid var(--border);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 
        0 12px 0px rgba(0,0,0,0.2),
        0 24px 50px rgba(0, 0, 0, 0.25),
        inset 0 2px 0px rgba(0,0,0,0.05);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ff88, #2a5a3e);
    z-index: -1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 3px solid var(--border);
    position: relative;
    z-index: 50;
    background: var(--col-1);
}

.modal-header h2 {
    color: var(--ink-dark);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
    letter-spacing: 1px;
}

/* Challenge modal specific header styling */
.challenge-modal-content .modal-header h2 {
    color: #3B291F; /* Brown color like reference */
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem; /* Smaller font size */
    margin: 0;
    text-shadow: 
        1px 1px 0px #8B5A36,
        2px 2px 0px rgba(59, 41, 31, 0.3);
    letter-spacing: 1px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Hint modal specific header styling */
#visual-modal .modal-header, #aural-modal .modal-header, #read-modal .modal-header, #kinesthetic-modal .modal-header {
    background: var(--col-1); /* Use our sage color */
    border-bottom: 3px solid var(--border);
    box-shadow: 0 2px 0px var(--col-4);
}

#visual-modal .modal-header h2, #aural-modal .modal-header h2, #read-modal .modal-header h2, #kinesthetic-modal .modal-header h2 {
    color: var(--ink-dark); /* Use our ink color */
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem; /* Smaller font size */
    margin: 0;
    text-shadow: 
        1px 1px 0px var(--col-4),
        2px 2px 0px rgba(59, 41, 31, 0.3);
    letter-spacing: 1px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.close-btn {
    background: linear-gradient(135deg, #4a2e2e 0%, #3c1616 50%, #4a2e2e 100%);
    border: 3px solid #ff4444;
    font-size: 2rem;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    color: #ff4444;
    padding: 0.8rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    position: relative;
    z-index: 100;
    box-shadow: 
        0 4px 0px #2e1a1a,
        0 8px 15px rgba(0, 0, 0, 0.3);
}

/* Hint modal close buttons */
#visual-modal .close-btn, #aural-modal .close-btn, #read-modal .close-btn, #kinesthetic-modal .close-btn {
    background: linear-gradient(135deg, #4a2e2e 0%, #3c1616 50%, #4a2e2e 100%);
    border: 3px solid #ff4444;
    font-size: 1.5rem; /* Smaller font size */
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    color: #ff4444;
    padding: 0.6rem; /* Smaller padding */
    width: 40px; /* Smaller size */
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
    position: relative;
    z-index: 100;
    box-shadow: 
        0 3px 0px #2e1a1a,
        0 6px 12px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.close-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #5a3e3e 0%, #4c2626 50%, #5a3e3e 100%);
    box-shadow: 
        0 6px 0px #2e1a1a,
        0 10px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 68, 68, 0.4);
}

.close-btn:active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0px #2e1a1a,
        0 4px 10px rgba(0, 0, 0, 0.3);
}

.modal-body {
    padding: 2.5rem;
    background: linear-gradient(135deg, #16423c 0%, #1a4a2e 50%, #16423c 100%);
    color: #00ff88;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Challenge modal specific body styling */
.challenge-modal-content .modal-body {
    padding: 1.5rem; /* Reduced padding */
    background: transparent; /* Let the container background show through */
    color: #3B291F;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem; /* Smaller font size */
    line-height: 1.4;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Hint modal specific body styling */
#visual-modal .modal-body, #aural-modal .modal-body, #read-modal .modal-body, #kinesthetic-modal .modal-body {
    padding: 1.5rem; /* Reduced padding */
    background: #ABEBD2; /* Aural interface background color */
    color: var(--ink-dark);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem; /* Smaller font size */
    line-height: 1.4;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Challenge Modal Specific Styles */
.challenge-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 0 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.exercise-container {
    margin-bottom: 2rem;
}

.exercise-question {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: #2d3748;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn { padding:0.9rem 1.2rem; border:3px solid #3B291F; background:#EDC9A0; color:#3B291F; cursor:pointer; transition:all 0.15s; text-align:left; font-size:0.9rem; }

.option-btn:hover { background:#F1D7AF; }

.option-btn.selected { border-color:#7F5B45; background:#EBC190; }

.option-btn.correct { border-color:#3B291F; background:#9AC389; color:#2a3b2a; }

.option-btn.incorrect { border-color:#3B291F; background:#E6A09A; color:#5c2323; }

.exercise-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem; /* Reduced margin */
    padding-top: 0.8rem; /* Reduced padding */
    border-top: 2px solid #3B291F; /* Thicker border for pixel art look */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Smaller font size */
    color: #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: #667eea;
    color: white;
}

.nav-btn.primary:hover:not(:disabled) {
    background: #5a67d8;
}

.nav-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.nav-btn.secondary:hover:not(:disabled) {
    background: #cbd5e0;
}

.challenge-complete {
    text-align: center;
    padding: 2rem;
}

.challenge-complete h3 {
    color: #48bb78;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.challenge-complete p {
    color: #4a5568;
    margin-bottom: 1.5rem;
}

/* Aural specific styles */
.question-btn {
    display: inline-block;
    width: auto;
    min-width: 120px;
    max-width: 200px;
    padding: 0.6rem 0.8rem; /* Smaller padding for compact boxes */
    margin: 0.3rem; /* Smaller margin for grid layout */
    background: #FFFFFF; /* Default white background */
    border: 2px solid #3B291F; /* Thinner border for small boxes */
    border-radius: 0; /* No border radius for pixel art look */
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem; /* Much smaller font size for compact boxes */
    color: #3B291F;
    box-shadow: 
        0 2px 0px #3B291F,
        0 4px 8px rgba(0, 0, 0, 0.2);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
}

/* Different colored question boxes using our palette */
.question-btn:nth-child(1) { background: var(--col-1); } /* Sage */
.question-btn:nth-child(2) { background: var(--col-2); } /* Sky */
.question-btn:nth-child(3) { background: var(--col-3); } /* Mint */
.question-btn:nth-child(4) { background: var(--col-4); } /* Periwinkle */
.question-btn:nth-child(5) { background: var(--col-5); } /* Lavender */
.question-btn:nth-child(6) { background: var(--col-1); } /* Sage */
.question-btn:nth-child(7) { background: var(--col-2); } /* Sky */
.question-btn:nth-child(8) { background: var(--col-3); } /* Mint */
.question-btn:nth-child(9) { background: var(--col-4); } /* Periwinkle */
.question-btn:nth-child(10) { background: var(--col-5); } /* Lavender */

.question-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 4px 0px #3B291F,
        0 8px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Add 3D effect to question boxes like floating blocks */
.question-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(0,0,0,0.1) 100%);
    z-index: -1;
    border: 2px solid #3B291F;
}

/* Add floating animation for some boxes */
.question-btn:nth-child(odd) {
    animation: float 3s ease-in-out infinite;
}

.question-btn:nth-child(even) {
    animation: float 3s ease-in-out infinite 1.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* Question input container */
.question-input-container {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--col-2);
    border: 3px solid var(--border);
    border-radius: 0;
}

#aural-question-input {
    width: 100%;
    min-height: 80px;
    padding: 0.8rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    line-height: 1.4;
    background: var(--col-1);
    border: 2px solid var(--border);
    border-radius: 0;
    color: var(--text-color);
    resize: vertical;
    box-sizing: border-box;
}

#aural-question-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.ask-btn {
    margin-top: 0.8rem;
    padding: 0.8rem 1.5rem;
    background: var(--accent);
    color: var(--text-color);
    border: 3px solid var(--border);
    border-radius: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 0 var(--border);
}

.ask-btn:hover {
    background: #e6ac00;
    transform: translateY(1px);
    box-shadow: 0 2px 0 var(--border);
}

.ask-btn:active {
    transform: translateY(3px);
    box-shadow: none;
}

.ask-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.interaction-counter {
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background: var(--col-3);
    border: 2px solid var(--border);
    border-radius: 0;
}

#interactions-remaining {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: var(--accent);
}

.suggested-questions {
    margin-top: 1.5rem;
}

.suggested-questions h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

/* Aural questions container for suggested questions */
#aural-questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
}

.suggestion-btn {
    padding: 0.6rem 0.8rem;
    background: var(--col-3);
    color: var(--text-color);
    border: 2px solid var(--border);
    border-radius: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.suggestion-btn:hover {
    background: var(--col-4);
    border-color: var(--accent);
    transform: translateX(2px);
}

.suggestion-btn:active {
    transform: translateX(0px);
    background: var(--accent);
}

.aural-pixi-container {
    display: none; /* hide to remove big blank area */
}

/* Always-visible HTML grid fallback (and default) */
.aural-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.aural-box {
    padding: 10px 12px;
    background: #FFFFFF;
    border: 2px solid #3B291F;
    color: #3B291F;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 0 #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.aural-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #3B291F;
}

#aural-questions h3 {
    color: #3B291F;
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 
        1px 1px 0px #8B5A36,
        2px 2px 0px rgba(59, 41, 31, 0.3);
}

#aural-answer {
    text-align: center;
    font-family: 'Press Start 2P', cursive;
}

#answer-text {
    background: #FFFFFF; /* White background */
    padding: 1rem; /* Reduced padding */
    border-radius: 0; /* No border radius for pixel art look */
    border: 3px solid #3B291F; /* Brown border */
    margin: 1rem 0;
    font-size: 0.9rem; /* Smaller font size */
    line-height: 1.4;
    color: #3B291F;
    font-family: 'Press Start 2P', cursive;
    box-shadow: 0 2px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#back-to-questions {
    background: #4A90E2; /* Blue color like reference */
    color: white;
    border: 3px solid #3B291F;
    padding: 0.6rem 1.2rem; /* Smaller padding */
    border-radius: 0; /* No border radius for pixel art look */
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Smaller font size */
    box-shadow: 0 2px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#back-to-questions:hover {
    background: #3A80D2;
    transform: translateY(-1px);
    box-shadow: 0 3px 0px #3B291F;
}

/* Document content */
.document-content {
    line-height: 1.4; /* Tighter line height */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem; /* Smaller font size */
    color: #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.document-content h3 {
    color: #3B291F; /* Brown color */
    margin-bottom: 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem; /* Smaller font size */
    text-shadow: 
        1px 1px 0px #8B5A36,
        2px 2px 0px rgba(59, 41, 31, 0.3);
}

.document-content p {
    margin-bottom: 1rem;
    color: #3B291F; /* Brown color */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Smaller font size */
}

.document-content em {
    color: #8B5A36; /* Lighter brown for emphasis */
    font-style: italic;
    font-family: 'Press Start 2P', cursive;
}

/* Visual Flyer Styles */
.visual-flyer {
    text-align: center;
    padding: 1rem;
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.flyer-header {
    font-size: 1.2rem; /* Smaller font size */
    color: #3B291F; /* Brown color like reference */
    margin-bottom: 1.5rem;
    font-weight: bold;
    text-shadow: 
        1px 1px 0px #8B5A36,
        2px 2px 0px rgba(59, 41, 31, 0.3);
}

.flyer-sections {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem; /* Smaller gap */
}

.flyer-section {
    background: #FFFFFF; /* White background like reference */
    border: 3px solid #3B291F; /* Brown border */
    border-radius: 0; /* No border radius for pixel art look */
    padding: 1rem; /* Reduced padding */
    width: 100%;
    max-width: 280px; /* Slightly smaller */
    text-align: center;
    box-shadow: 0 2px 0px #3B291F;
}

.section-icon {
    font-size: 2rem; /* Smaller icon */
    margin-bottom: 0.8rem;
}

.flyer-section h4 {
    color: #3B291F; /* Brown color */
    margin-bottom: 0.5rem;
    font-size: 0.9rem; /* Smaller font size */
    font-family: 'Press Start 2P', cursive;
}

.section-keyword {
    background: #4A90E2; /* Blue color like reference */
    color: white;
    padding: 0.4rem 0.8rem; /* Smaller padding */
    border-radius: 0; /* No border radius for pixel art look */
    font-weight: bold;
    margin: 0.5rem 0;
    display: inline-block;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem; /* Smaller font size */
    border: 2px solid #3B291F;
    box-shadow: 0 2px 0px #3B291F;
}

.section-phrase {
    color: #3B291F; /* Brown color */
    font-style: italic;
    margin-top: 0.5rem;
    font-size: 0.7rem; /* Smaller font size */
    font-family: 'Press Start 2P', cursive;
}

.section-arrow {
    font-size: 1.5rem; /* Smaller arrow */
    color: #3B291F; /* Brown color */
    margin: 0.5rem 0;
}

/* Visual hint image styles */
.visual-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    width: 100%;
    height: 100%;
}

.visual-hint-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border: 3px solid #3B291F;
    border-radius: 0;
    box-shadow: 0 4px 8px rgba(59, 41, 31, 0.3);
    background: white;
    padding: 0.5rem;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.visual-error {
    text-align: center;
    padding: 2rem;
    background: #ffdddd;
    border: 3px solid #cc0000;
    border-radius: 0;
    color: #cc0000;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    line-height: 1.8;
}

.visual-error p {
    margin-bottom: 1rem;
}

.visual-error strong {
    color: #990000;
}

.visual-fallback {
    text-align: center;
    padding: 2rem;
    background: #f0f0f0;
    border: 3px solid #3B291F;
    border-radius: 0;
    color: #3B291F;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    line-height: 1.8;
}

.visual-fallback p {
    margin-bottom: 1rem;
}

.visual-fallback strong {
    color: #8B5A36;
}

/* Reading Section Styles */
.reading-section {
    margin-bottom: 1.5rem; /* Reduced margin */
    padding: 1rem;
    background: #FFFFFF; /* White background like reference */
    border-radius: 0; /* No border radius for pixel art look */
    border: 3px solid #3B291F; /* Brown border */
    box-shadow: 0 2px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.reading-section h3 {
    color: #3B291F; /* Brown color */
    margin-bottom: 1rem;
    font-size: 1rem; /* Smaller font size */
    font-family: 'Press Start 2P', cursive;
    text-shadow: 
        1px 1px 0px #8B5A36,
        2px 2px 0px rgba(59, 41, 31, 0.3);
}

.reading-section p {
    line-height: 1.4; /* Tighter line height */
    color: #3B291F; /* Brown color */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Smaller font size */
}

/* Export Section Styles */
.export-section {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.export-section h3 {
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.export-btn {
    padding: 1rem;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.export-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.export-btn:active {
    transform: translateY(0);
}

.export-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    min-height: 20px;
}

.export-status.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.export-status.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.export-status.info {
    background: #bee3f8;
    color: #2a4365;
    border: 1px solid #90cdf4;
}

/* Exercise Navigation Styles */
.exercise-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
}

#exercise-counter {
    font-weight: 600;
    color: #4a5568;
}

/* Exercise Actions */
.exercise-actions {
    margin-top: 1rem;
    text-align: center;
}

/* Exercise Feedback - Pixel Art Style */

.exercise-feedback {
    margin-top: 2rem;
    padding: 1.5rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    font-weight: normal;
    text-align: center;
    border: 3px solid;
    box-shadow: 
        0 4px 0px,
        0 8px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.exercise-feedback.correct {
    background: linear-gradient(135deg, #2a5a3e 0%, #16423c 50%, #2a5a3e 100%);
    color: #00ff88;
    border-color: #00ff88;
    box-shadow: 
        0 4px 0px #1a4a2e,
        0 8px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 255, 136, 0.4);
}

.exercise-feedback.incorrect {
    background: linear-gradient(135deg, #4a2e2e 0%, #3c1616 50%, #4a2e2e 100%);
    color: #ff4444;
    border-color: #ff4444;
    box-shadow: 
        0 4px 0px #2e1a1a,
        0 8px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 68, 68, 0.4);
}

.exercise-feedback.incorrect-retry {
    background: linear-gradient(135deg, #4a3e2e 0%, #3c2e16 50%, #4a3e2e 100%);
    color: #ffaa00;
    border-color: #ffaa00;
    box-shadow: 
        0 4px 0px #2e241a,
        0 8px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 170, 0, 0.4);
}

.exercise-feedback.max-attempts {
    background: linear-gradient(135deg, #4a2e2e 0%, #3c1616 50%, #4a2e2e 100%);
    color: #ff4444;
    border-color: #ff4444;
    box-shadow: 
        0 4px 0px #2e1a1a,
        0 8px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 68, 68, 0.4);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Visual Fallback */
.visual-fallback {
    padding: 1.5rem; /* Reduced padding */
    text-align: center;
    color: #3B291F; /* Brown color */
    font-style: italic;
    background: #FFFFFF; /* White background */
    border-radius: 0; /* No border radius for pixel art look */
    border: 3px solid #3B291F; /* Brown border */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Smaller font size */
    box-shadow: 0 2px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Reading Section Styles */
.reading-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

.reading-section h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.reading-section p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

/* Reading Fallback */
.reading-fallback {
    padding: 1.5rem; /* Reduced padding */
    text-align: center;
    color: #3B291F; /* Brown color */
    font-style: italic;
    background: #FFFFFF; /* White background */
    border-radius: 0; /* No border radius for pixel art look */
    border: 3px solid #3B291F; /* Brown border */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Smaller font size */
    box-shadow: 0 2px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Kinesthetic Section Styles */
.kinesthetic-content {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.kinesthetic-instruction {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #e6f7ff;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.attempt-tracker {
    margin-bottom: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    color: #856404;
}

.kinesthetic-instruction h3 {
    color: #0050b3;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.kinesthetic-exercise {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #cbd5e0;
}

.kinesthetic-exercise h4 {
    color: #2d3748;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.exercise-description {
    color: #4a5568;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.kinesthetic-code-editor {
    width: 100%;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 2px solid #3B291F;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 1rem;
}

.expected-output {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    font-size: 0.9rem;
}

.expected-output code {
    background: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.kinesthetic-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.kinesthetic-run-btn,
.kinesthetic-reset-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #3B291F;
    background: #90dbbd;
    color: #1f1f1f;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 0px #3B291F;
}

.kinesthetic-run-btn:hover {
    background: #7cc9a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 0px #3B291F;
}

.kinesthetic-run-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cccccc;
}

.kinesthetic-run-btn:disabled:hover {
    transform: none;
    background: #cccccc;
}

.kinesthetic-solution-btn {
    background: #b4d7de;
}

.kinesthetic-solution-btn:hover {
    background: #9fc9d1;
    transform: translateY(-2px);
    box-shadow: 0 4px 0px #3B291F;
}

.kinesthetic-solution-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cccccc;
}

.kinesthetic-solution-btn:disabled:hover {
    transform: none;
    background: #cccccc;
}

.kinesthetic-output {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.kinesthetic-output.success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.kinesthetic-output.warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.kinesthetic-output.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.kinesthetic-section-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #8ba3dd;
}

.kinesthetic-section-item h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.kinesthetic-fallback {
    padding: 1.5rem;
    text-align: center;
    color: #3B291F;
    font-style: italic;
    background: #FFFFFF;
    border: 3px solid #3B291F;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    box-shadow: 0 2px 0px #3B291F;
}

.loading-message {
    padding: 2rem;
    text-align: center;
    color: #4a5568;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ==================== INTRO GAME CONTAINER ==================== */

#intro-game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #0a0a0a;
}

#intro-game-container canvas {
    display: block;
    margin: 0 auto;
}

/* ==================== CODE EXERCISE STYLES ==================== */

.code-exercise-container {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #cbd5e0;
}

.code-exercise-description {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #e6f7ff;
    border-left: 4px solid #1890ff;
    font-size: 0.85rem;
    line-height: 1.6;
}

.code-expected-output {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    font-size: 0.85rem;
}

.code-expected-output code {
    background: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.code-exercise-editor {
    width: 100%;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 2px solid #3B291F;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 1rem;
    min-height: 150px;
    line-height: 1.5;
}

.code-exercise-editor:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #2d2d2d;
}

.code-exercise-buttons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.code-run-btn,
.code-solution-btn {
    padding: 0.7rem 1.5rem;
    border: 2px solid #3B291F;
    background: #90dbbd;
    color: #1f1f1f;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 0px #3B291F;
}

.code-run-btn:hover,
.code-solution-btn:hover {
    background: #7cc9a8;
    transform: translateY(-2px);
    box-shadow: 0 4px 0px #3B291F;
}

.code-run-btn:disabled,
.code-solution-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cccccc;
}

.code-run-btn:disabled:hover,
.code-solution-btn:disabled:hover {
    transform: none;
    background: #cccccc;
}

.code-solution-btn {
    background: #b4d7de;
}

.code-solution-btn:hover {
    background: #9fc9d1;
}

.code-exercise-output {
    margin-top: 1rem;
}

.code-output-success,
.code-output-error {
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.code-output-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.code-output-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.code-output-success code,
.code-output-error code {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* ==================== AURAL DIALOGUE BOX ==================== */

/* Aural dialogue container */
.aural-dialogue {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 600px; /* Bigger size */
    margin: 1rem auto;
    padding: 0;
    background: transparent; /* No background box */
    border: none;
    box-shadow: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
}

/* Loading indicator styles */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-style: italic;
}

.loading-dots {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

.dots {
    animation: loading-dots 1.5s infinite;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error message styles */
.error-message {
    background: #ffebee;
    border: 2px solid #f44336;
    padding: 1rem;
    border-radius: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    line-height: 1.6;
}

.error-message p {
    margin: 0 0 0.5rem 0;
}

.error-message p:last-child {
    margin-bottom: 0;
}

/* Avatar section */
.dialogue-avatar {
    flex-shrink: 0;
    width: 80px; /* Bigger avatar size */
    height: 80px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border: 3px solid #3B291F;
    border-radius: 0; /* No border radius for pixel art look */
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 2px 0px #3B291F,
        inset 0 1px 0px rgba(255, 255, 255, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.avatar-circle canvas {
    width: 70px;
    height: 70px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Dialogue box */
.dialogue-box {
    flex: 1;
    position: relative;
}

.dialogue-inner {
    background: #FFFFFF; /* White background for better readability */
    border: 3px solid #3B291F;
    border-radius: 0; /* No border radius for pixel art look */
    padding: 1.2rem; /* More padding for bigger box */
    box-shadow: 
        0 2px 0px #3B291F,
        inset 0 1px 0px rgba(255, 255, 255, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.dialogue-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem; /* Bigger, more readable font size */
    line-height: 1.5; /* Better line spacing for readability */
    color: #3B291F;
    margin: 0;
    word-wrap: break-word;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Speech bubble tail/pointer */
.dialogue-box::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 12px solid #3B291F;
    z-index: 1;
}

.dialogue-box::after {
    content: '';
    position: absolute;
    left: -9px;
    top: 22px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 9px solid #FFFFFF;
    z-index: 2;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    .aural-dialogue {
        max-width: 400px; /* Bigger on mobile too */
        padding: 0.6rem;
        gap: 1rem;
    }
    
    .dialogue-avatar {
        width: 60px; /* Bigger avatar on mobile */
        height: 60px;
    }
    
    .avatar-circle {
        width: 60px;
        height: 60px;
    }
    
    .avatar-circle canvas {
        width: 50px;
        height: 50px;
    }
    
    .dialogue-text {
        font-size: 0.7rem; /* Still readable on mobile */
    }
}

/* Game Section Styles */
.game-section { 
    margin-top: 0; 
    padding: 2rem; 
    background: transparent; 
    border: 0; 
    text-align: center; 
    color: var(--ink-dark); 
    box-shadow: none; 
}
/* Game section headers and paragraphs removed from HTML */

/* ==================== VARK QUESTIONNAIRE ==================== */

/* VARK button styling moved to header section */

/* VARK modal should appear above game canvas */
#vark-modal {
    z-index: 6000 !important;
    background: 
        radial-gradient(circle at 30% 30%, rgba(42, 90, 62, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(26, 74, 46, 0.3) 0%, transparent 50%),
        rgba(10, 37, 28, 0.95);
}

.vark-modal-content {
    background: var(--col-2);
    border: 4px solid var(--border);
    box-shadow: 
        0 8px 0px var(--col-4),
        0 16px 30px rgba(0, 0, 0, 0.4),
        inset 0 2px 0px rgba(255, 255, 255, 0.1);
    image-rendering: pixelated;
    width: 90%;
    max-width: 800px;
    position: relative;
    z-index: 6001;
}

.vark-modal-content .modal-header {
    background: var(--col-1);
    border-bottom: 4px solid var(--border);
    box-shadow: 0 4px 0px var(--col-4);
    padding: 1.5rem;
}

.vark-modal-content .modal-header h2 {
    color: var(--ink-dark);
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
    image-rendering: pixelated;
}

.vark-progress {
    margin-bottom: 2rem;
    padding: 1rem;
}

#vark-question-counter {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--ink-dark);
    display: block;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--col-1);
    border: 3px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: var(--col-4);
    transition: width 0.3s ease;
    box-shadow: 
        0 0 10px rgba(139, 163, 221, 0.5),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.vark-question {
    padding: 1.5rem;
    background: var(--col-3);
    border: 3px solid var(--border);
    border-radius: 0;
    margin-bottom: 2rem;
    box-shadow: 
        0 4px 0px var(--col-4),
        0 8px 20px rgba(0, 0, 0, 0.2);
}

.vark-question h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--ink-dark);
    line-height: 1.4;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.3);
}

.vark-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vark-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
    padding: 1rem;
    background: var(--col-2);
    border: 2px solid var(--border);
    border-radius: 0;
    transition: all 0.2s ease;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    line-height: 1.3;
    box-shadow: 0 2px 0px var(--col-1);
}

.vark-option:hover {
    background: var(--col-1);
    transform: translateY(1px);
    box-shadow: 0 1px 0px var(--col-1);
}

.vark-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--col-4);
    flex-shrink: 0;
    margin-top: 2px;
}

.vark-option .option-text {
    color: var(--ink-dark);
    flex: 1;
    word-wrap: break-word;
}

.vark-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--col-1);
    border-top: 3px solid var(--border);
    margin-top: 1rem;
}

.vark-results {
    padding: 2rem;
    text-align: center;
}

.vark-results h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--ink-dark);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.3);
}

.vark-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.vark-results-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.score-item {
    background: var(--col-3);
    border: 3px solid var(--border);
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 
        0 4px 0px var(--col-4),
        0 8px 20px rgba(0, 0, 0, 0.2);
}

.vark-description {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--col-2);
    border: 2px solid var(--border);
    border-radius: 0;
    font-size: 0.9rem;
    color: var(--ink-dark);
    text-align: center;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    font-size: 1rem;
    color: var(--ink-dark);
}

.error-message {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: #e53e3e;
    background: #fee;
    border: 2px solid #fc8181;
    border-radius: 0;
    margin: 1rem;
}

.vark-no-profile {
    text-align: center;
    padding: 2rem;
    background: var(--col-2);
    border: 3px solid var(--border);
    border-radius: 8px;
    margin: 1rem;
}

.vark-no-profile p {
    font-size: 0.9rem;
    color: var(--ink-dark);
    margin: 0.5rem 0;
}

.score-label {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--ink-dark);
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.3);
}

.score-value {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    color: var(--col-5);
    text-shadow: 2px 2px 0px var(--ink-dark);
}

/* Responsive design for VARK */
@media (max-width: 768px) {
    .vark-modal-content {
        width: 95%;
        margin: 2rem auto;
    }
    
    .vark-question h3 {
        font-size: 0.7rem;
    }
    
    .vark-option {
        font-size: 0.55rem;
        padding: 0.8rem;
    }
    
    .vark-scores {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .vark-navigation {
        flex-direction: column;
        gap: 1rem;
    }
}

.game-section h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-section p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.game-btn { background: var(--col-4); border: 3px solid var(--border); padding: 12px 24px; font-size: 1.1rem; font-weight: 600; color: #fff; border-radius: 0; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 3px 0 var(--border); }

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.game-container { 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 85vw; 
    height: 85vh; 
    max-width: 1300px;
    max-height: 950px;
    padding: 0; 
    background: #000; 
    border: 4px solid var(--border); 
    z-index: 3000; 
    box-shadow: 
        0 8px 0px var(--col-4),
        0 16px 32px rgba(0,0,0,0.5);
    border-radius: 0;
}

#game-canvas { 
    position: relative;
    width: 100% !important; 
    height: 100% !important; 
    margin: 0; 
    border-radius: 0; 
    overflow: hidden; 
    display: block;
}

#game-canvas canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.game-controls { 
    position: absolute; 
    bottom: 8px; 
    left: 50%; 
    transform: translateX(-50%); 
    margin: 0; 
    padding: 6px 10px; 
    background: rgba(0,0,0,0.8); 
    border: 2px solid var(--border); 
    box-shadow: 0 2px 0 var(--border); 
    z-index: 3100; 
    border-radius: 4px;
}

.game-controls p { margin: 0; font-family: 'Press Start 2P', cursive; font-size: 0.65rem; color: #e6f2e6; text-align: center; text-shadow: 1px 1px 0px #000; letter-spacing: 0.5px; }

/* Game exit overlay for click-to-start */
.game-exit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    cursor: pointer;
}

.game-instructions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.game-exit-overlay p {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: #fff;
    text-align: center;
    text-shadow: 2px 2px 0px #000;
    letter-spacing: 1px;
    margin: 0;
}

.click-hint {
    animation: pulse 2s ease-in-out infinite;
    font-size: 1rem !important;
    opacity: 0.8;
}

.arrow-keys {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.arrow-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.arrow-key {
    width: 40px;
    height: 40px;
    background: var(--col-4);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: white;
    text-shadow: 1px 1px 0px #000;
    box-shadow: 0 3px 0px var(--border);
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Exit game button styles removed - now only accessible through in-game menu */

/* Hide header and prevent scroll during fullscreen game */
.game-active .header { display: none; }
.game-active, .game-active body { overflow: hidden; }

/* Challenge Modal Specific Styles */
.challenge-modal-content {
    max-width: 1000px;
    max-height: 90vh;
    background: var(--col-2);
    border: 4px solid var(--border);
    box-shadow: 0 8px 0px rgba(0,0,0,0.15), 0 16px 30px rgba(0, 0, 0, 0.25);
}

/* Challenge modal specific button styling */
.challenge-modal-content .nav-btn.primary {
    background: var(--col-4);
    color: white;
    border: 3px solid var(--border);
    border-radius: 0; /* No border radius for pixel art look */
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem; /* Smaller font size */
    padding: 0.8rem 1.5rem;
    box-shadow: 0 3px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.challenge-modal-content .nav-btn.primary:hover:not(:disabled) {
    background: #728ad6;
    transform: translateY(-1px);
    box-shadow: 0 4px 0px #3B291F;
}

/* Challenge modal navigation buttons */
.challenge-modal-content .nav-btn {
    padding: 0.6rem 1.2rem; /* Smaller padding */
    border: 3px solid var(--border);
    border-radius: 0; /* No border radius for pixel art look */
    cursor: pointer;
    font-size: 0.8rem; /* Smaller font size */
    font-family: 'Press Start 2P', cursive;
    transition: all 0.15s;
    box-shadow: 0 2px 0px #3B291F;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.challenge-modal-content .nav-btn.secondary {
    background: var(--col-1);
    color: var(--ink-dark);
}

.challenge-modal-content .nav-btn.secondary:hover:not(:disabled) {
    background: #B8926A;
    transform: translateY(-1px);
    box-shadow: 0 3px 0px #3B291F;
}

/* Challenge modal should appear above game canvas but behind hint modals */
#challenge-modal {
    z-index: 4000;
    background: 
        radial-gradient(circle at 30% 30%, rgba(217, 160, 102, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(139, 90, 54, 0.3) 0%, transparent 50%),
        rgba(217, 160, 102, 0.95);
}

.challenge-modal-content .modal-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFFFFF;
    border-bottom: 3px solid #3B291F;
    box-shadow: 0 2px 0px #8B5A36;
}

.challenge-hints {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.challenge-hints { display:flex; justify-content:center; gap:0.8rem; margin-bottom:1.5rem; padding:0.8rem; background: var(--col-1); border:3px solid var(--border); border-radius:0; }

.challenge-hints .hint-btn { background: var(--col-4); color:#FFFFFF; border:3px solid var(--border); padding:0.6rem 1rem; font-family:'Press Start 2P', cursive; font-size:0.7rem; cursor:pointer; letter-spacing:1px; box-shadow:0 2px 0 var(--border); border-radius:0; }

.challenge-hints .hint-btn:hover { 
    background:#6F4E3B; 
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #3B291F;
}

.challenge-exercises {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.exercise-container {
    background: var(--col-5);
    border: 3px solid var(--border);
    padding: 1.5rem; /* Reduced padding for smaller design */
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 4px 0px #3B291F,
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 0px rgba(255, 255, 255, 0.1);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.exercise-container h3 {
    color: var(--ink-dark);
    margin-bottom: 1rem; /* Reduced margin */
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem; /* Smaller font size */
    text-shadow: 
        1px 1px 0px #FFFFFF,
        2px 2px 0px rgba(59, 41, 31, 0.3);
    letter-spacing: 1px;
    border-bottom: 2px solid #3B291F;
    padding-bottom: 0.5rem;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.exercise-question {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--ink);
    font-weight: 500;
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    padding: 0.8rem 1rem; /* Smaller padding */
    border: 3px solid var(--border);
    border-radius: 0; /* No border radius for pixel art look */
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-size: 0.8rem; /* Smaller font size */
    font-family: 'Press Start 2P', cursive;
    color: var(--ink-dark);
    position: relative;
    box-shadow: 0 2px 0px var(--border);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.option-btn:hover {
    background: #F1D7AF; /* Light beige hover like reference */
    transform: translateY(-1px);
    box-shadow: 0 3px 0px #3B291F;
}

.option-btn.selected {
    background: #EBC190; /* Selected beige color like reference */
    border-color: #7F5B45;
    transform: translateY(-1px);
    box-shadow: 0 3px 0px #3B291F;
}

.option-btn.correct {
    border-color: #3B291F;
    background: #9AC389; /* Green for correct */
    color: #2a3b2a;
}

.option-btn.incorrect {
    border-color: #3B291F;
    background: #E6A09A; /* Red for incorrect */
    color: #5c2323;
}

.challenge-submit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 8px;
    border-top: 2px solid #e2e8f0;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn.primary {
    background: #667eea;
    color: white;
}

.nav-btn.primary:hover:not(:disabled) {
    background: #5a67d8;
}

.nav-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.nav-btn.secondary:hover:not(:disabled) {
    background: #cbd5e0;
}


/* Responsive design */
@media (max-width: 768px) {
    .action-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .primary-btn {
        grid-column: 1;
    }
    
    .header {
        padding: 0.8rem 1rem;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.8rem;
    }
    
    .header-brand h1 {
        font-size: 1rem;
        text-align: center;
    }
    
    .header-nav {
        grid-row: 2;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    
    .nav-btn {
        font-size: 0.5rem;
        padding: 0.6rem 1rem;
        flex: 1 1 calc(50% - 0.2rem);
        min-width: 120px;
    }
    
    .user-info {
        grid-row: 3;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .user-info #user-display-name {
        font-size: 0.6rem;
        padding: 0.5rem 0.8rem;
    }
    
    .user-info .primary-btn {
        font-size: 0.5rem;
        padding: 0.5rem 0.8rem;
    }
}

@media (max-width: 1024px) {
    .header-nav {
        gap: 0.4rem;
    }
    
    .nav-btn {
        font-size: 0.6rem;
        padding: 0.7rem 1.2rem;
    }
    
    .user-info .primary-btn {
        font-size: 0.55rem;
        padding: 0.6rem 1rem;
    }
}
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .challenge-progress {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-bar {
        margin: 0;
        width: 100%;
    }
}

/* Main Screen After Login */
#welcome-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #2c5530 0%, #1a332c 100%);
}

.main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid var(--border);
}

.main-header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--col-1);
    text-shadow: 2px 2px 0px var(--ink-dark);
}

.logout-btn {
    background: var(--col-4);
    color: var(--col-1);
    border: 2px solid var(--border);
    padding: 0.5rem 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
}

.logout-btn:hover {
    background: var(--col-5);
    transform: translateY(1px);
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.main-buttons {
    display: flex;
    gap: 4rem;
    align-items: center;
    justify-content: center;
}

.main-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: var(--col-1);
    border: 4px solid var(--border);
    border-radius: 0;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 0px var(--col-4),
        0 16px 30px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    min-height: 250px;
}

.main-btn:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 0px var(--col-4),
        0 20px 40px rgba(0, 0, 0, 0.4);
}

.main-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 4px 0px var(--col-4),
        0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-icon {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--col-2);
    border: 3px solid var(--border);
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.btn-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    image-rendering: pixelated;
    animation: btnAvatarFloat 2s ease-in-out infinite;
}

.arena-icon {
    font-size: 2rem;
    animation: btnIconBounce 2s ease-in-out infinite;
}

.btn-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--ink-dark);
    text-align: center;
}

@keyframes btnAvatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes btnIconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive design for main buttons */
@media (max-width: 768px) {
    .main-buttons {
        flex-direction: column;
        gap: 2rem;
    }
    
    .main-btn {
        min-width: 180px;
        min-height: 200px;
        padding: 1.5rem 1rem;
    }
    
    .btn-icon {
        width: 60px;
        height: 60px;
    }
    
    .btn-avatar {
        width: 45px;
        height: 45px;
    }
    
    .arena-icon {
        font-size: 1.5rem;
    }
    
    .btn-text {
        font-size: 0.8rem;
    }
    
    .main-header h1 {
        font-size: 1.2rem;
    }
    
    .logout-btn {
        font-size: 0.6rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Introduction Modal */
#intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.intro-modal-content {
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 600px;
    background: linear-gradient(135deg, #2c5530 0%, #1a332c 100%);
    border: 4px solid var(--border);
    border-radius: 0;
    box-shadow: 
        0 8px 0px var(--col-5),
        0 16px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

#intro-phaser-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Introduction Screen with Phaser Game */
#introduction-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #2c5530 0%, #1a332c 100%);
}

#intro-game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive adjustments for welcome screen */
@media (max-width: 768px) {
    .welcome-container {
        gap: 2rem;
        padding: 1rem;
    }
    
    .welcome-avatar-img {
        width: 120px;
        height: 120px;
    }
    
    .wave-indicator {
        font-size: 1.2rem;
    }
    
    .avatar-greeting span {
        font-size: 0.7rem;
    }
    
    .intro-modal-content {
        width: 95%;
        height: 90%;
    }
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--col-2);
    border: 4px solid var(--border);
    border-radius: 0;
    box-shadow: 
        0 4px 0px var(--col-4),
        0 8px 20px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 2rem auto;
}

.welcome-greeting {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
    color: var(--ink-dark);
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 0px var(--col-1);
}

.welcome-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--ink-mid);
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .welcome-greeting {
        font-size: 1.1rem;
    }
    
    .welcome-text {
        font-size: 0.7rem;
    }
    
    .welcome-section {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ==================== LOADING SPINNER ==================== */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--col-1);
    border-top: 3px solid var(--ink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    image-rendering: auto;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
}

.loading-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    color: var(--ink);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 43, 43, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--col-2);
    border: 4px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.loading-content .loading-text {
    font-size: 1rem;
    color: var(--ink);
    text-align: center;
}

/* Game Loading Overlay */
.game-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.game-loading-overlay .loading-text {
    font-size: 1.2rem;
    color: white;
    margin-top: 1rem;
    text-align: center;
}

/* ==================== RESEARCH CONSENT FORM MODAL ==================== */

.consent-modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

#consent-frame {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 4px;
}

.consent-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.consent-message {
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.consent-success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.consent-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.consent-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #bee5eb;
}

