:root {
    --primary: #FF8C42;
    --secondary: #4361EE;
    --accent: #FFD166;
    --bg: #F8F9FA;
    --success: #06D6A0;
    --danger: #EF476F;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #eef2f3 0%, #8e9eab 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.welcome-text {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

.welcome-text h1 {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
}

.welcome-text p {
    font-size: clamp(1rem, 4vw, 1.5rem);
    font-weight: 700;
}

.stage {
    position: relative;
    width: 100%;
    min-height: 50vh;
    flex: 1;
    background: url('https://img.freepik.com/free-vector/laboratory-room-with-scientific-tools_1308-41076.jpg?w=1380&t=st=1706400000~exp=1706400600~hmac=...') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.stage::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.header {
    position: absolute;
    top: 20px;
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.nav-home {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    min-width: 80px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.2s;
}

.nav-home:hover {
    transform: scale(1.05);
    background: var(--bg);
}

.score-board {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}

.header-options {
    display: flex;
    gap: 10px;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
}

.header-options.show {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
}

.menu-toggle {
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    transition: all 0.3s;
    z-index: 101;
}

.menu-toggle:hover {
    transform: rotate(45deg) scale(1.1);
}

.menu-toggle.active {
    background: var(--primary);
    color: white;
}

/* Mobile Menu Logic */
@media (max-width: 768px) {
    .header-options {
        position: fixed;
        top: 80px;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 20px;
        border-radius: 20px 0 0 20px;
        flex-direction: column;
        width: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 100;
        transform: translateX(100%);
        /* Start off-screen on mobile */
    }

    .header-options.show {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
    }

    .header {
        position: relative;
        top: 0;
        padding: 10px;
        background: white;
        width: 100%;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
}

.voice-control,
.level-badge {
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 5px 15px;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid transparent;
}

.voice-control:hover,
.level-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.voice-control select,
.level-badge select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 10px 30px 10px 10px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--secondary);
    cursor: pointer;
    outline: none;
    position: relative;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%234361EE' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
}

.level-badge {
    background: var(--secondary);
    color: white;
}

.level-badge select {
    color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

.level-badge select option {
    color: #333;
    background: white;
}

.word-builder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.word-box {
    background: white;
    border-radius: 30px;
    padding: 15px 40px;
    width: 90%;
    max-width: 600px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.5rem, 10vw, 5rem);
    color: var(--secondary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), inset 0 -8px 0 rgba(0, 0, 0, 0.1);
    letter-spacing: clamp(4px, 2vw, 12px);
    position: relative;
    gap: 10px;
}

#puzzle-image {
    max-width: 90%;
    max-height: 200px;
    height: auto;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: none;
    /* Hidden by default until loaded */
    object-fit: contain;
}

#puzzle-image.show {
    display: block;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.keyboard-wrapper {
    width: 100%;
    min-height: 35vh;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.keyboard {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    overflow-y: auto;
}

.key {
    background: white;
    border: none;
    border-radius: 18px;
    padding: 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 #cbd5e1;
}

.key:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #cbd5e1;
}

.key.vowel {
    background: #fff5eb;
    color: var(--primary);
    box-shadow: 0 6px 0 #ffd1b3;
}

.key span.phoneme {
    font-size: 0.7rem;
    font-family: 'Quicksand', sans-serif;
    margin-top: 5px;
    color: #666;
    text-transform: lowercase;
}

.keyboard-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 5px 10px;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.keyboard-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 15px;
    border: none;
    background: none;
    font-family: 'Fredoka One', cursive;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    background: #f8fafc;
    color: var(--secondary);
}

.key:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.mascot {
    position: absolute;
    bottom: 20px;
    right: 40px;
    width: 120px;
    z-index: 6;
    animation: float 3s infinite ease-in-out;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom center;
}

.mascot svg path {
    transition: d 0.1s ease-in-out, stroke 0.2s;
}

.mascot:hover {
    transform: scale(1.1) rotate(5deg);
}

.mascot:active {
    transform: scale(0.9) translateY(10px);
}

.mascot.surprise {
    animation: surprise 0.5s ease-out;
}

.mascot.dance {
    animation: dance 0.8s ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes surprise {
    0% {
        transform: scale(1) translateY(0);
    }

    20% {
        transform: scale(1.2, 0.8) translateY(10px);
    }

    40% {
        transform: scale(0.8, 1.2) translateY(-20px);
    }

    100% {
        transform: scale(1) translateY(0);
    }
}

@keyframes dance {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    15% {
        transform: translate(0, -30px) scale(1.1);
    }

    /* Up */
    30% {
        transform: translate(0, 30px) scale(0.9);
    }

    /* Down */
    45% {
        transform: translate(-30px, 0) rotate(-10deg);
    }

    /* Left */
    60% {
        transform: translate(30px, 0) rotate(10deg);
    }

    /* Right */
    75% {
        transform: translate(0, -15px) scale(1.1);
    }
}

/* Hub Container & Card Styles */
.hub-container {
    max-width: 900px;
    width: 90%;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 50px 20px;
}

.hub-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 8px solid transparent;
}

.hub-card:hover {
    transform: translateY(-10px);
}

.hub-card.lab {
    border-color: var(--primary);
}

.hub-card.game {
    border-color: var(--success);
}

.hub-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    display: block;
}

.hub-title {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.hub-desc {
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Missing Success Modal & Sparkle Styles in style.css */
#word-reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    padding: 40px 80px;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 90%;
    max-width: 500px;
}

#word-reveal.show {
    transform: translate(-50%, -50%) scale(1);
}

#word-reveal h2 {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--secondary);
    margin-bottom: 20px;
}

.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkle 0.6s ease-out forwards;
    z-index: 100;
}

@keyframes sparkle {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

#game-instruction {
    background: var(--accent);
    color: #333;
    padding: 8px 25px;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.controls-row {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.control-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 15px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.btn-clear {
    background: #ff4d4d;
    color: white;
}

.btn-sound {
    background: var(--secondary);
    color: white;
}

.word-box span.blank {
    display: inline-block;
    min-width: 60px;
    border-bottom: 6px dashed var(--primary);
    color: transparent;
    margin: 0 5px;
}

.word-box span.filled {
    color: var(--secondary);
    border-bottom: 6px solid var(--success);
}

/* Topic Selector Styles */
.topic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.topic-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.topic-container {
    background: white;
    padding: 40px;
    border-radius: 40px;
    max-width: 800px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.topic-item {
    padding: 20px;
    border-radius: 20px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
    border: 4px solid transparent;
}

.topic-item:hover {
    transform: translateY(-5px);
    background: white;
    border-color: var(--secondary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.topic-item span {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

/* --- SPEAKING GAME STYLES --- */
.mic-btn {
    font-size: 3rem;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    box-shadow: 0 5px 0 #cbd5e1;
    transition: all 0.2s;
}

.mic-btn:active,
.mic-btn.active {
    background: #EF476F;
    color: white;
    transform: scale(0.95);
    box-shadow: 0 2px 0 #b91c1c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 71, 111, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(239, 71, 111, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 71, 111, 0);
    }
}

/* --- WORD DETECTIVE STYLES --- */
.detective-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 800px;
    text-align: center;
    border-top: 10px solid #118AB2;
    position: relative;
}

.mission-badge {
    background: #118AB2;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: 'Fredoka One';
    font-size: 1.2rem;
    display: inline-block;
    margin-bottom: 20px;
    transform: rotate(-2deg);
    box-shadow: 0 5px 15px rgba(17, 138, 178, 0.3);
}

.sentence-display {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: 'Quicksand', sans-serif;
    margin: 30px 0;
    line-height: 1.6;
}

.word-token {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: #f8fafc;
}

.word-token:hover {
    background: #e0faff;
    transform: scale(1.1);
    border-color: #118AB2;
}

.word-token.correct {
    background: #06D6A0;
    color: white;
    animation: bounce 0.5s;
    pointer-events: none;
}

.word-token.wrong {
    background: #EF476F;
    color: white;
    animation: shake 0.5s;
}

/* --- SENTENCE BUILDER STYLES --- */
.builder-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 900px;
    text-align: center;
    border-top: 10px solid #06D6A0;
    min-height: 300px;
}

.slot-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 20px;
    min-height: 100px;
    align-items: center;
}

.word-slot {
    width: 120px;
    /* Approx word width */
    height: 60px;
    background: #e2e8f0;
    border: 2px dashed #cbd5e1;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.word-slot:empty::before {
    content: '?';
    color: #94a3b8;
    font-size: 1.5rem;
    font-weight: bold;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    border-top: 2px solid #f1f5f9;
}

.draggable-word {
    background: white;
    padding: 15px 25px;
    border-radius: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: bold;
    font-size: 1.2rem;
    color: #475569;
    background: #fff;
    box-shadow: 0 4px 0 #cbd5e1;
    border: 1px solid #e2e8f0;
    cursor: grab;
    transition: all 0.1s;
    user-select: none;
}

.draggable-word:active {
    cursor: grabbing;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #cbd5e1;
}

.word-slot .draggable-word {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 1.5rem;
    color: #06D6A0;
}

.topic-item h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: #333;
}

/* Difficulty Selector */
.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    background: #f1f5f9;
    padding: 8px;
    border-radius: 20px;
    display: inline-flex;
}

.diff-btn {
    padding: 12px 25px;
    border: none;
    background: transparent;
    border-radius: 15px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.diff-btn.active {
    background: white;
    color: var(--secondary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.diff-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary);
}

/* --- RESPONSIVE QUERIES --- */

/* Tablet and Smaller Desktop */
@media (max-width: 1024px) {
    .hub-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .header {
        position: relative;
        top: 0;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        padding: 10px 15px;
        gap: 10px;
        justify-content: space-between;
        align-items: center;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }

    .header-options {
        position: fixed;
        top: 70px;
        /* Below the header */
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        padding: 20px;
        border-radius: 20px 0 0 20px;
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: auto;
        min-width: 200px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
        transform: translateX(120%);
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 99;
    }

    .header-options.show {
        transform: translateX(0);
        pointer-events: all;
    }

    .nav-home,
    .menu-toggle {
        width: 45px;
        height: 45px;
        min-width: 45px;
        /* Prevent crushing */
        padding: 0;
        font-size: 1.2rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        /* Override inline styles */
    }

    .nav-text {
        display: none;
    }

    /* Ensure the score board is visible in the row */
    .score-board {
        order: 2;
        padding: 5px 15px;
        font-size: 1rem;
        height: 45px;
    }

    .menu-toggle {
        order: 3;
    }

    .stage {
        padding: 10px;
        min-height: 35vh;
    }

    .word-box {
        font-size: clamp(2rem, 10vw, 3rem);
        min-height: 80px;
        padding: 10px;
        width: 100%;
        margin-top: 10px;
    }

    #puzzle-image {
        max-height: 150px;
        margin-bottom: 10px;
    }

    .word-box span.blank {
        min-width: 40px;
        border-bottom-width: 4px;
        margin: 0 2px;
    }

    .keyboard {
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
        gap: 6px;
        padding: 10px;
    }

    .key {
        font-size: 1.2rem;
        padding: 8px;
        border-radius: 10px;
    }

    .key span.phoneme {
        font-size: 0.6rem;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .mascot {
        width: 70px;
        right: 10px;
        bottom: 15px;
    }

    /* Topic Selector Mobile */
    .topic-container {
        padding: 25px 15px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .topic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 20px;
    }

    .topic-item {
        padding: 15px;
    }

    .topic-item span {
        font-size: 2.5rem;
    }

    .topic-item h3 {
        font-size: 1rem;
    }

    #word-reveal {
        padding: 30px 20px;
        width: 90%;
    }

    #word-reveal h2 {
        font-size: 2.5rem;
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .keyboard {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .key {
        font-size: 1.1rem;
        padding: 6px;
    }

    .welcome-text h1 {
        font-size: 2rem;
    }

    .topic-grid {
        grid-template-columns: 1fr;
        /* Single column for very small screens if needed, or keep 2 */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mascot Blinking Animation */
#mascot-eyes {
    transform-origin: center;
    transform-box: fill-box;
    animation: blink 4s infinite;
}

#pupil-left,
#pupil-right {
    transition: transform 0.1s ease-out;
}

@keyframes blink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

/* --- TENSE GAME STYLES --- */
.grammar-stage {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
}

.tense-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.tense-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, #FF9F1C, #FFBF69);
}

.sentence-box {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    color: #2D3436;
    margin-bottom: 40px;
    line-height: 1.4;
}

.blank-spot {
    border-bottom: 3px solid #EF476F;
    color: #EF476F;
    padding: 0 10px;
    display: inline-block;
    min-width: 100px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.option-btn {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    padding: 20px;
    border-radius: 20px;
    font-size: 1.5rem;
    font-family: 'Fredoka One', cursive;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    transform: translateY(-5px);
    background: white;
    border-color: #EF476F;
    color: #EF476F;
    box-shadow: 0 10px 20px rgba(239, 71, 111, 0.2);
}

.option-btn.correct {
    background: #06D6A0;
    color: white;
    border-color: #06D6A0;
}

.option-btn.wrong {
    background: #EF476F;
    color: white;
    border-color: #EF476F;
    animation: shake 0.5s;
}

.feedback {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #06D6A0;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
}

.feedback.show {
    opacity: 1;
}

.time-badge {
    background: #FFD166;
    color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 10px;
}