#game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: gameEnter 0.5s ease-out;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}
.game-logo{
    width: 200px;
    height: auto;
margin: 0 auto;
}
#game-overlay.active {
    display: flex;
}

@keyframes gameEnter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#game-canvas {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 3px solid var(--primary, #0066ff);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.3);
    animation: canvasGlow 2s ease-in-out infinite alternate;
}

@keyframes canvasGlow {
    from {
        box-shadow: 0 20px 40px rgba(0, 102, 255, 0.3);
    }
    to {
        box-shadow: 0 20px 60px rgba(0, 102, 255, 0.5);
    }
}

.game-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    z-index: 10001;
}

.game-score {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(135deg, #0066ff, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0, 102, 255, 0.5);
}

.game-lives {
    display: flex;
    gap: 10px;
    align-items: center;
}

.life-heart {
    font-size: 24px;
    color: #ef4444;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.5));
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    font-family: 'Inter', sans-serif;
    z-index: 10002;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #0066ff, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-instructions {
    font-size: 18px;
    margin-bottom: 30px;
    color: #cbd5e1;
    line-height: 1.6;
}

.game-btn {
    background: linear-gradient(135deg, #0066ff, #6366f1);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

.game-btn:active {
    transform: translateY(0);
}

.game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(15, 23, 42, 0.95);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--primary, #0066ff);
    color: white;
    z-index: 10003;
    display: none;
    backdrop-filter: blur(10px);
    animation: gameOverEnter 0.5s ease-out;
}

@keyframes gameOverEnter {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.game-over-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ef4444;
}

.final-score {
    font-size: 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #0066ff, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.high-score {
    font-size: 18px;
    margin-bottom: 30px;
    color: #10b981;
}

.floating-emoji {
    position: absolute;
    font-size: 30px;
    animation: float 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(-3deg); }
}

.combo-indicator {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: #10b981;
    font-size: 24px;
    font-weight: bold;
    z-index: 10001;
    display: none;
    animation: comboShow 1s ease-out;
}

@keyframes comboShow {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(1);
    }
}

.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    width: 90%;
    max-width: 400px;
}

.mobile-btn {
    background: rgba(0, 102, 255, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.mobile-btn:active {
    transform: scale(0.95);
    background: rgba(0, 102, 255, 1);
}

.mobile-touch-area {
    flex: 1;
    height: 60px;
    background: rgba(0, 102, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.mobile-touch-area:active {
    background: rgba(0, 102, 255, 0.4);
    transform: scale(0.98);
}

.touch-indicator {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    pointer-events: none;
}

@media (max-width: 768px) {
    #game-canvas {
        width: 95vw !important;
        height: 60vh !important;
    }
    
    .game-title {
        font-size: 32px;
    }
    
    .game-instructions {
        font-size: 16px;
    }
    
    .desktop-instructions {
        display: none;
    }
    
    .mobile-instructions {
        display: inline;
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .game-ui {
        font-size: 18px;
    }

    /* Mobile-responsive game-over-screen */
    .game-over-screen {
        padding: 20px;
        margin: 10px;
        border-radius: 15px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        width: auto;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
    }

    .game-over-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .final-score {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .high-score {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .game-btn {
        width: 100%;
        margin: 8px 0;
        padding: 12px 20px;
        font-size: 16px;
        min-height: 48px;
        display: block;
        box-sizing: border-box;
    }

    /* Mobile-responsive game-controls (start screen) */
    .game-controls {
        padding: 20px;
        max-width: calc(100vw - 40px);
        margin: 0 auto;
    }

    .game-controls .game-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .game-controls .game-instructions {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.5;
    }

    /* Mobile-responsive indicators */
    .combo-indicator {
        font-size: 18px;
        padding: 8px 16px;
        border-radius: 12px;
        max-width: calc(100vw - 40px);
        left: 50%;
        transform: translateX(-50%);
    }

    .power-up-indicator {
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 15px;
        max-width: calc(100vw - 40px);
        left: 50%;
        transform: translateX(-50%);
        top: 120px;
    }
}

@media (min-width: 769px) {
    .desktop-instructions {
        display: inline;
    }
    
    .mobile-instructions {
        display: none;
    }
}

@media (max-width: 480px) {
    .game-ui {
        font-size: 16px;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .game-score {
        font-size: 20px;
    }
    
    .life-heart {
        font-size: 20px;
    }

    /* Extra small screens - game-over-screen */
    .game-over-screen {
        padding: 15px;
        margin: 5px;
        border-radius: 12px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 60px);
        font-size: 14px;
    }

    .game-over-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .final-score {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .high-score {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .game-btn {
        padding: 10px 15px;
        font-size: 14px;
        min-height: 44px;
        margin: 6px 0;
    }

    /* Ensure game-over-screen doesn't get cut off */
    #game-overlay {
        padding: 10px;
    }

    /* Extra small screens - game-controls (start screen) */
    .game-controls {
        padding: 15px;
        max-width: calc(100vw - 20px);
        margin: 0 auto;
    }

    .game-controls .game-title {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .game-controls .game-instructions {
        font-size: 13px;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    /* Extra small screens - indicators */
    .combo-indicator {
        font-size: 16px;
        padding: 6px 12px;
        max-width: calc(100vw - 20px);
        border-radius: 10px;
    }

    .power-up-indicator {
        font-size: 12px;
        padding: 6px 12px;
        max-width: calc(100vw - 20px);
        border-radius: 12px;
        top: 100px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 896px) and (orientation: landscape) {
    .game-over-screen {
        padding: 12px;
        margin: 5px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        font-size: 13px;
    }

    .game-over-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .final-score {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .high-score {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .game-btn {
        padding: 8px 15px;
        font-size: 13px;
        min-height: 40px;
        margin: 4px 0;
    }

    /* Landscape - game-controls (start screen) */
    .game-controls {
        padding: 10px;
        max-width: calc(100vw - 20px);
        margin: 0 auto;
    }

    .game-controls .game-title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .game-controls .game-instructions {
        font-size: 12px;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    /* Landscape - indicators */
    .combo-indicator {
        font-size: 14px;
        padding: 4px 10px;
        top: 80px;
        max-width: calc(100vw - 20px);
    }

    .power-up-indicator {
        font-size: 11px;
        padding: 4px 10px;
        top: 110px;
        max-width: calc(100vw - 20px);
    }
}

/* Touch device optimizations for game-over-screen */
@media (pointer: coarse) {
    .game-over-screen .game-btn {
        min-height: 48px;
        padding: 12px 20px;
        margin: 8px 0;
        border: none;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .game-over-screen .game-btn:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #0052cc, #5753d1);
    }
}

.power-up-indicator {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    display: none;
    z-index: 10001;
    animation: powerUpShow 2s ease-out;
}

@keyframes powerUpShow {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
} 