/* Zombie Shooter Styles */

:root {
    /* Dark theme for this specific game - uses dark backgrounds for immersion */
    --color-bg: #0f0f1a;
    --color-bg-secondary: #1a1a2e;
    --color-player: #FFD93D;
    --color-text: #ffffff;
    --color-card-bg: rgba(255, 255, 255, 0.05);
    --color-border-light: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    overflow: hidden;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.home-link {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.home-link:hover {
    opacity: 1;
    transform: scale(1.1);
}

.home-logo {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 8px rgba(255, 217, 61, 0.3));
}

/* ========================================
   HUD (Heads-Up Display)
   ======================================== */
.hud {
    position: fixed;
    top: 16px;
    left: 70px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 50;
}

.hud-left, .hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-right {
    align-items: flex-end;
}

.health-bar {
    width: 180px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, #6ee7b7 0%, #10b981 50%, #059669 100%);
    transition: width 0.3s ease-out, background 0.3s;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.health-fill.mid {
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.health-fill.low {
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 50%, #dc2626 100%);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
    animation: healthPulse 0.5s ease-in-out infinite alternate;
}

@keyframes healthPulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.hud-score, .hud-wave {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.hud-wave {
    color: #a78bfa;
    font-size: 20px;
}

.hud-combo {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--color-player);
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.6), 0 2px 8px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s, transform 0.15s;
    letter-spacing: 1px;
}

.hud-combo.active {
    opacity: 1;
    transform: scale(1);
    animation: comboPop 0.2s ease-out;
}

@keyframes comboPop {
    0% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ========================================
   Overlays (Start, Wave, Game Over)
   ======================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 200;
    text-align: center;
    padding: 20px;
}

.overlay.hidden {
    display: none;
}

.overlay h1 {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 56px;
    font-weight: 800;
    color: var(--color-player);
    margin: 0 0 16px 0;
    text-shadow: 0 0 40px rgba(255, 217, 61, 0.5), 0 4px 12px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 40px rgba(255, 217, 61, 0.5), 0 4px 12px rgba(0, 0, 0, 0.8); }
    to { text-shadow: 0 0 60px rgba(255, 217, 61, 0.8), 0 4px 12px rgba(0, 0, 0, 0.8); }
}

.overlay h2 {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 72px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.8);
    animation: wavePopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes wavePopIn {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.instructions {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin: 8px 0;
    letter-spacing: 0.5px;
}

.mobile-hint {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .mobile-hint {
        display: block;
    }
    .instructions:not(.mobile-hint) {
        display: none;
    }
}

.start-btn {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 26px;
    font-weight: 700;
    padding: 18px 56px;
    margin-top: 28px;
    background: linear-gradient(180deg, #FFE566 0%, #FFD93D 50%, #e6c235 100%);
    color: #1a1a2e; /* Dark text on yellow button for contrast */
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 8px 30px rgba(255, 217, 61, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.start-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 217, 61, 0.6), 0 6px 20px rgba(0, 0, 0, 0.3);
}

.start-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.best-score {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 20px;
}

.final-score {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 28px;
    color: var(--color-text);
    margin: 12px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.new-best {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 24px;
    color: #4ade80;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
    animation: newBestPulse 0.6s ease-in-out infinite alternate;
}

@keyframes newBestPulse {
    from {
        opacity: 0.8;
        transform: scale(1);
    }
    to {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* ========================================
   Game Over Screen
   ======================================== */
.game-over-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    pointer-events: auto;
}

.game-over-buttons .start-btn,
.game-over-buttons .share-btn {
    pointer-events: auto;
}

.share-container {
    pointer-events: auto;
}

/* Share button styling for dark game background */
.share-container .share-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 0;
}

.share-container .share-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.game-over-buttons .start-btn {
    margin-top: 0;
}

/* ========================================
   Touch Controls (Mobile)
   ======================================== */
.touch-zone {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 10;
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .touch-zone {
        display: block;
    }
}

.left-zone {
    left: 0;
}

.right-zone {
    right: 0;
}

.joystick {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 3px solid rgba(255, 255, 255, 0.25);
    z-index: 15;
    pointer-events: none;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.joystick.hidden {
    display: none;
}

.joystick-knob {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ========================================
   SEO Content (Hidden During Gameplay)
   ======================================== */
.seo-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(180deg, transparent 0%, var(--color-bg-secondary) 20%);
    color: rgba(255, 255, 255, 0.7);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    z-index: 5;
    display: none;
}

.seo-content h2 {
    color: var(--color-text);
    font-size: 18px;
    margin: 0 0 8px 0;
}

.seo-content p {
    margin: 0 0 8px 0;
}

.seo-content a {
    color: var(--color-player);
    text-decoration: none;
}

.seo-content a:hover {
    text-decoration: underline;
}

body.show-seo .seo-content {
    display: block;
}

/* Hide SEO during gameplay */
body:not(.show-seo) .seo-content {
    display: none !important;
}
