
:root {
    --bg: #FAFDF7;
    --text: #1C1917;
    --link: #059669;
    --section-bg: rgba(5, 150, 105, 0.04);
    --border: rgba(26, 46, 26, 0.1);
    --key-bg: #F0F5EE;
    --key-border: #BBD0B5;
    --key-text: var(--text);
    --title: #14532D;
    --score: #14532D;
    --score-bg: #DCFCE7;
    --frame: #059669;
    --grid: #059669;
    --tile: #064E3B;
    --num: #ECFDF5;
    --tile-blocked: #6A1B9A;
    --tile-blocked-border: #8E24AA;
    --blocked-num: #FFEBEE;
    --tile-eaten: #16A34A;
    --tile-eaten-border: #4ADE80;
    --eaten-num: #F0FDF4;
    --tile-wrong: #DC2626;
    --tile-wrong-border: #EF4444;
    --wrong-num: #FEF2F2;
    --game-score-bg: var(--score-bg);
    --game-board-frame: var(--frame);
    --game-text: var(--text);
}

:root[data-theme="dark"] {
    --bg: #0F160F;
    --text: #D6DDD4;
    --link: #34D399;
    --section-bg: rgba(52, 211, 153, 0.04);
    --border: rgba(52, 211, 153, 0.12);
    --key-bg: #1A261A;
    --key-border: #34D399;
    --key-text: var(--text);
    --title: #86EFAC;
    --score: #86EFAC;
    --score-bg: #0A2618;
    --frame: #34D399;
    --grid: #34D399;
    --tile: #065F46;
    --num: #D1FAE5;
    --tile-blocked: #BA68C8;
    --tile-blocked-border: #CE93D8;
    --blocked-num: #FCE4EC;
    --tile-eaten: #4ADE80;
    --tile-eaten-border: #86EFAC;
    --eaten-num: #F0FDF4;
    --tile-wrong: #EF4444;
    --tile-wrong-border: #F87171;
    --wrong-num: #FEF2F2;
    --game-score-bg: var(--score-bg);
    --game-board-frame: var(--frame);
    --game-text: var(--text);
}

/* Number Munchers page styling */
.game-body {
    background-color: var(--bg) !important;
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    overflow: hidden;
}

/* Main game layout - left/right split */
/* Game Over Modal */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.game-over-modal.hidden {
    display: none;
}

.game-over-content {
    background: linear-gradient(135deg, var(--bg) 0%, rgba(255,255,255,0.1) 100%);
    border: 3px solid var(--frame);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Game Layout - Now 2 columns */
.game-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    gap: 30px;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-layout.game-loaded {
    opacity: 1;
    transform: scale(1) translateY(0);
}



/* Loading state - game is visible immediately */
.game-loading {
    opacity: 1 !important;
    transform: none !important;
}

/* Staggered animation states */
.game-left-panel-ready {
    opacity: 1 !important;
}

.game-board-ready {
    opacity: 1 !important;
}

/* Left Panel - Levels & Progress */
.left-panel {
    width: 380px;
    background-color: var(--game-score-bg);
    border: 3px solid var(--game-board-frame);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.left-panel h2 {
    color: var(--game-text);
    font-size: 1.4rem;
    margin: 0;
    text-align: center;
    font-weight: bold;
}

.left-panel h3 {
    color: var(--game-text);
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

/* Progress Section */
.progress-section {
    border-top: 2px solid var(--game-board-frame);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Game Types Section */
.game-types-section {
    margin-bottom: 1rem;
}

.game-types-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-type-btn {
    padding: 12px 16px;
    border: 2px solid #22c55e;
    border-radius: 6px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.game-type-btn:hover:not(.locked) {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    border-color: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.game-type-btn.active {
    background: linear-gradient(135deg, #4ade80 0%, #22d55f 100%);
    border-color: #22d55f;
    color: white;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.5);
}

.game-type-btn.locked {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #a7f3d0;
    color: #059669;
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: 0 1px 4px rgba(167, 243, 208, 0.3);
}

/* Center - Game Area */
.game-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

/* Game Board Container */
.game-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

/* Stars progression display - In left panel */
.stars-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px 12px;
    background: linear-gradient(135deg, var(--game-score-bg) 0%, rgba(255,255,255,0.8) 100%);
    border: 3px solid var(--game-board-frame);
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.stars-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="sparkles" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="5" cy="5" r="1" fill="rgba(255,255,255,0.3)" opacity="0.6"><animate attributeName="opacity" values="0.3;1;0.3" dur="2s" repeatCount="indefinite"/></circle><circle cx="15" cy="15" r="0.5" fill="rgba(255,255,255,0.4)" opacity="0.8"><animate attributeName="opacity" values="0.8;0.3;0.8" dur="1.5s" repeatCount="indefinite"/></circle></pattern></defs><rect width="100" height="100" fill="url(%23sparkles)"/></svg>');
    pointer-events: none;
    z-index: 1;
}

.star {
    font-size: 2.6rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: grayscale(100%) opacity(0.4);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    line-height: 1;
    z-index: 2;
    animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(5deg); }
}

/* Stars Message */
.stars-message {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--title);
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, var(--bg) 100%);
    border-radius: 8px;
    border: 2px solid var(--frame);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    animation: messageGlow 2s ease-in-out infinite alternate;
}

@keyframes messageGlow {
    0% { box-shadow: 0 2px 8px rgba(0,160,160,0.2); }
    100% { box-shadow: 0 2px 8px rgba(0,160,160,0.4); }
}

.star.earned {
    filter: none;
    transform: scale(1.1);
    text-shadow: 0 0 15px rgba(255,215,0,0.8), 0 3px 6px rgba(0,0,0,0.3);
    animation: sparkle 2s ease-in-out infinite alternate;
}

/* Reset Progress Link */
.reset-progress-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.reset-progress-link {
    color: #888;
    font-size: 12px;
    padding: 14px 0;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.reset-progress-link:hover {
    opacity: 1;
    color: #666;
    text-decoration: underline;
}

/* Modal Buttons */
.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

.play-again-btn.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: 3px solid #495057;
}

.play-again-btn.secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4246 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(73, 80, 87, 0.4);
}

/* Star Attention Animation - First Play Only */
.star-attention {
    color: #FFD700 !important; /* Bright gold */
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)) !important;
    text-shadow: 0 0 35px rgba(255, 215, 0, 1) !important;
    animation: starAttentionBounce 0.8s ease-in-out 3 alternate !important;
    z-index: 10 !important;
}

@keyframes starAttentionBounce {
    0% {
        transform: scale(1.0) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
    }
    25% {
        transform: scale(1.4) rotate(-5deg);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.7));
    }
    50% {
        transform: scale(1.6) rotate(5deg);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.9));
    }
    75% {
        transform: scale(1.8) rotate(-3deg);
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1));
    }
    100% {
        transform: scale(1.2) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }
}

@keyframes sparkle {
    0% { filter: brightness(1) drop-shadow(0 0 5px rgba(255,215,0,0.5)); }
    100% { filter: brightness(1.2) drop-shadow(0 0 12px rgba(255,215,0,1)); }
}

.star:hover {
    transform: scale(1.3);
    filter: none;
    text-shadow: 0 0 20px rgba(255,215,0,0.9), 0 4px 8px rgba(0,0,0,0.4);
}

.star.locked:hover {
    filter: grayscale(100%) opacity(0.5);
    transform: scale(1.1);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Celebration screen */
.celebration-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--game-text);
    margin-bottom: 1rem;
    margin-top: 2rem;
    text-align: center;
    z-index: 1050;
    position: relative;
}

.celebration-message {
    font-size: 1.3rem;
    color: var(--game-text);
    margin-bottom: 2rem;
    margin-top: 1rem;
    text-align: center;
    z-index: 1050;
    position: relative;
    line-height: 1.4;
    padding: 0 1rem;
}

.celebration-content {
    margin-top: 8rem; /* Space for star animation above */
    position: relative;
    z-index: 1050;
}

/* Confetti animation */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--tile-eaten);
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Star Earning Animation */
.star-earning-animation {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1100;
    pointer-events: none;
    opacity: 0;
    animation: starEarningShow 0.5s ease forwards;
}

.star-burst {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
}

.star-center {
    font-size: 3rem;
    z-index: 2;
    position: relative;
    animation: starGlow 2s ease-in-out infinite alternate;
}

.star-rays {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rayRotate 3s linear infinite;
}

.ray {
    position: absolute;
    width: 4px;
    height: 60px;
    background: linear-gradient(to top, var(--tile-eaten), transparent);
    border-radius: 2px;
    transform-origin: bottom center;
}

.ray-1 { transform: rotate(0deg); }
.ray-2 { transform: rotate(60deg); }
.ray-3 { transform: rotate(120deg); }
.ray-4 { transform: rotate(180deg); }
.ray-5 { transform: rotate(240deg); }
.ray-6 { transform: rotate(300deg); }

.star-earned-text {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--title);
    margin-top: 0.5rem;
    animation: textPulse 1.5s ease-in-out infinite alternate;
}

@keyframes starEarningShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes starGlow {
    0% {
        filter: drop-shadow(0 0 10px var(--tile-eaten));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 30px var(--tile-eaten));
        transform: scale(1.1);
    }
}

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

@keyframes textPulse {
    0% {
        transform: scale(1);
        color: var(--title);
    }
    100% {
        transform: scale(1.1);
        color: var(--tile-eaten);
    }
}

/* Game board container */
.game-board {
    width: 500px;
    height: 500px;
    border: 4px solid var(--frame);
    background-color: var(--grid);
    border-radius: 8px;
    padding: 8px;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 3px;
    width: 100%;
    height: 100%;
    background-color: var(--grid);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.grid-cell {
    background-color: var(--tile);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-size: 2rem;
    font-weight: bold;
    color: var(--num);
    text-rendering: optimizeSpeed;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
}

/* Enhanced tile styling */
.tile {
    border: 3px solid var(--grid);
    box-shadow: 2px 2px 0 0 rgba(0,0,0,.08); /* pixel offset */
    border-radius: 2px; /* chunky corners */
}

.tile.blocked {
    background: var(--tile-blocked);
    border-color: var(--tile-blocked-border);
    color: var(--blocked-num);
}

.tile.eaten {
    background: var(--tile-eaten);
    border-color: var(--tile-eaten-border);
    color: var(--eaten-num);
}

.tile.wrong {
    background: var(--tile-wrong);
    border-color: var(--tile-wrong-border);
    color: var(--wrong-num);
}

/* Player cell styling */
.player-cell {
    background-color: var(--tile) !important;
}

/* Number Muncher Character */
.number-muncher {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 1;
    pointer-events: none;
}

.muncher-sprite {
    width: 80%;
    height: 80%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}












/* Game Header */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid var(--frame);
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    gap: 0.8rem;
}

.game-title {
    text-align: center;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--title);
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Lives Display - Below the title */
.lives-display {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mistakes-munchers {
    display: flex;
    gap: 0.5rem;
}

.mistake-muncher {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--tile);
    border: 2px solid var(--grid);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.mistake-muncher.lost {
    background-color: var(--tile-wrong);
    border-color: var(--tile-wrong-border);
    transform: scale(0.8);
    opacity: 0.3;
    animation: muncherFade 0.5s ease-out;
}

@keyframes muncherFade {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

.mistake-sprite {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: all 0.2s ease;
}

.mistake-muncher:not(.lost) .mistake-sprite {
    animation: muncherBounce 2s ease-in-out infinite;
}

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



.game-over-message {
    font-size: 1.1rem;
    color: var(--title);
    margin-bottom: 1rem;
    font-weight: bold;
    padding: 1rem;
    background-color: var(--score-bg);
    border-radius: 8px;
    border: 2px solid var(--frame);
}

/* Instructions Section */
.instructions {
    background-color: var(--bg);
    border: 3px solid var(--frame);
    border-radius: 12px;
    padding: 1.5rem;
}

.instructions h3 {
    margin: 0 0 1rem 0;
    color: var(--title);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.key {
    background-color: var(--tile);
    color: var(--num);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    border: 2px solid var(--frame);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.description {
    color: var(--title);
    font-weight: bold;
}

.goal {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--score-bg);
    border-radius: 8px;
    color: var(--title);
    font-weight: bold;
    text-align: center;
    border: 2px solid var(--frame);
}

.completion-rating {
    font-size: 1.1rem;
    color: var(--frame);
    margin-bottom: 1rem;
    font-weight: bold;
}



/* Game Over Screen in Right Panel */


.hidden {
    display: none;
}

.play-again-btn {
    background-color: var(--tile-wrong);
    color: var(--wrong-num);
    border: 2px solid var(--tile-wrong-border);
    padding: 0.75rem 1.5rem;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    text-rendering: optimizeSpeed;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.play-again-btn:hover {
    background-color: var(--tile-wrong-border);
    transform: translateY(-2px);
}

/* Let's Play Button */
.lets-play-btn {
    background-color: var(--tile);
    color: var(--num);
    border: 2px solid var(--num);
    padding: 1rem 2rem;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    text-rendering: optimizeSpeed;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.lets-play-btn:hover {
    background-color: var(--num);
    color: var(--frame);
    transform: translateY(-2px);
}

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

/* Eaten tile styling */
.grid-cell.eaten {
    background-color: var(--tile-eaten) !important;
    border: 1px solid var(--tile-eaten-border) !important;
    color: var(--eaten-num) !important;
}

/* Wrong answer feedback */
.grid-cell.wrong {
    background-color: var(--tile-wrong) !important;
    border: 1px solid var(--tile-wrong-border) !important;
    color: var(--wrong-num) !important;
    animation: wrongFlash 0.5s ease;
}



@keyframes wrongFlash {
    0%, 100% { background-color: var(--tile-wrong); }
    50% { background-color: color-mix(in srgb, var(--tile-wrong) 80%, white); }
}

/* Celebration/Loading Screen Styles */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: color-mix(in srgb, var(--bg) 95%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: 'Courier New', 'Monaco', 'Lucida Console', monospace;
}

.loading-screen.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    color: var(--num);
    padding: 2rem;
    background-color: var(--frame);
    border: 2px solid var(--tile);
    border-radius: 8px;
}


@media (max-width: 480px) {
    .loading-content {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .game-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 10px;
        gap: 20px;
    }

    .left-panel {
        width: 100%;
        padding: 1rem;
        order: 2;
    }

    .star {
        font-size: 2.2rem;
    }

    .stars-message {
        font-size: 0.75rem;
        padding: 0.4rem;
    }

    .star-attention {
        font-size: 2.4rem !important;
        animation: starAttentionBounceMobile 0.6s ease-in-out infinite alternate !important;
    }

    @keyframes starAttentionBounceMobile {
        0% {
            transform: scale(1.0) rotate(0deg);
            filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
        }
        25% {
            transform: scale(1.3) rotate(-4deg);
            filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.7));
        }
        50% {
            transform: scale(1.4) rotate(4deg);
            filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9));
        }
        75% {
            transform: scale(1.5) rotate(-2deg);
            filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1));
        }
        100% {
            transform: scale(1.1) rotate(0deg);
            filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
        }
    }

    .game-header {
        padding: 0.8rem 1.5rem;
        gap: 0.6rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .mistake-muncher {
        width: 35px;
        height: 35px;
    }

    .mistake-sprite {
        width: 25px;
        height: 25px;
    }

    .left-panel h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .left-panel h3 {
        font-size: 1rem;
        margin: 1rem 0 0.5rem 0;
    }

    .game-types-list {
        gap: 6px;
    }

    .game-type-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .game-section {
        padding: 1rem;
        order: 1;
    }

    .game-board {
        width: 90vw;
        height: 90vw;
        max-width: 400px;
        max-height: 400px;
    }

    .instructions {
        padding: 1rem;
    }

    .key {
        min-width: 50px;
        padding: 0.4rem 0.6rem;
    }
}
