/* =============================================
   VOID BREAKER — Dam Works Landing Game
   ============================================= */

:root {
    --bg-void: #020408;
    --cyan: #00e5ff;
    --cyan-dim: rgba(0, 229, 255, 0.3);
    --magenta: #ff006e;
    --magenta-dim: rgba(255, 0, 110, 0.3);
    --gold: #ffd600;
    --white: #f0f4ff;
    --white-dim: rgba(240, 244, 255, 0.5);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --danger: #ff3d3d;
    --warning: #ff9100;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-void);
    font-family: var(--font-display);
    color: var(--white);
    cursor: crosshair;
}

/* ---- Canvas ---- */
#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ---- HUD ---- */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#hud.visible {
    opacity: 1;
}

.hud-left,
.hud-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.hud-center {
    flex: 1;
    max-width: 320px;
    margin: 0 1.5rem;
}

.hud-logo {
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--white-dim);
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
}

.hud-score,
.hud-level {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--cyan);
    text-shadow: 0 0 12px var(--cyan-dim);
}

.hud-score span,
.hud-level span {
    font-weight: 700;
    font-size: 1.2rem;
    margin-left: 0.3rem;
}

.hud-lives {
    display: flex;
    gap: 6px;
}

.life-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--glass-border);
    transition: all 0.3s ease;
}

.life-icon.active {
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan), 0 0 20px var(--cyan-dim);
}

/* ---- Dam HP Bar ---- */
.dam-hp-bar-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dam-hp-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--white-dim);
    white-space: nowrap;
}

.dam-hp-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.dam-hp-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--cyan), #00b8d4);
    border-radius: 3px;
    transition: width 0.4s ease, background 0.5s ease;
    box-shadow: 0 0 8px var(--cyan-dim);
}

.dam-hp-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning), var(--gold));
    box-shadow: 0 0 8px rgba(255, 145, 0, 0.4);
}

.dam-hp-bar-fill.danger {
    background: linear-gradient(90deg, var(--danger), var(--magenta));
    box-shadow: 0 0 8px var(--magenta-dim);
    animation: hpPulse 0.6s ease infinite;
}

.dam-hp-value {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--cyan);
    min-width: 36px;
    text-align: right;
    transition: color 0.5s ease;
}

@keyframes hpPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ---- Overlay Screens ---- */
.overlay-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(2, 4, 8, 0.85) 0%, rgba(2, 4, 8, 0.97) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.5s ease;
}

.screen-content {
    text-align: center;
    max-width: 540px;
    padding: 2rem;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-mark {
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.25em;
    color: var(--white-dim);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.1);
}

.game-title,
.game-over-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.accent {
    background: linear-gradient(135deg, var(--cyan), var(--magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-tagline {
    font-size: 1.1rem;
    color: var(--white-dim);
    margin-bottom: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.instructions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.key-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--white-dim);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

kbd {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--cyan);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

/* ---- Glow Button ---- */
.glow-btn {
    position: relative;
    padding: 1rem 3rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: var(--bg-void);
    background: linear-gradient(135deg, var(--cyan), #00b8d4);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px var(--cyan-dim), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.glow-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--cyan), var(--magenta), var(--cyan));
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.glow-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px var(--cyan-dim), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.glow-btn:hover::before {
    opacity: 1;
}

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

.coming-soon {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: rgba(240, 244, 255, 0.25);
    font-style: italic;
}

.mobile-hint {
    display: none;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: rgba(240, 244, 255, 0.3);
}

.contact-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--cyan);
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.contact-link:hover {
    opacity: 1;
}

/* ---- Stats Row ---- */
.final-score,
.final-wave {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--cyan);
    margin-bottom: 0.3rem;
    text-shadow: 0 0 12px var(--cyan-dim);
}

.final-score span,
.final-wave span {
    font-weight: 700;
    font-size: 1.5rem;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-box {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-dim);
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--white-dim);
    text-transform: uppercase;
}

/* ---- Wave Announcement ---- */
.wave-announce {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    pointer-events: none;
}

.wave-text {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--white);
    text-shadow: 0 0 40px var(--cyan), 0 0 80px var(--cyan-dim);
    animation: waveFlash 1.5s ease forwards;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes waveFlash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    20% {
        opacity: 1;
        transform: scale(1.1);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #hud {
        padding: 0.6rem 0.8rem;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .hud-center {
        order: 3;
        max-width: 100%;
        margin: 0;
        width: 100%;
    }

    .hud-logo {
        font-size: 0.7rem;
    }

    .hud-score,
    .hud-level {
        font-size: 0.65rem;
    }

    .hud-score span,
    .hud-level span {
        font-size: 0.9rem;
    }

    .hud-left,
    .hud-right {
        gap: 0.8rem;
    }

    .instructions {
        gap: 0.8rem;
    }

    .mobile-hint {
        display: block;
    }

    .game-title,
    .game-over-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .stat-box {
        min-width: 80px;
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 480px) {
    .instructions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .key-hint {
        justify-content: center;
    }

    .stats-row {
        gap: 0.8rem;
    }
}