* { box-sizing: border-box; }

html, body.game-page {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: #0a1628;
    color: #e8eef9;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.game-fullscreen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: pointer;
}

.game-hud-float {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    pointer-events: none;
}

.game-title {
    margin: 0;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.game-hud-scores {
    display: flex;
    gap: 8px;
}

.game-score-pill {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px 14px;
    text-align: center;
    min-width: 64px;
    pointer-events: auto;
}

.game-score-pill span {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: #94a3b8;
    margin-bottom: 2px;
}

.game-score-pill strong {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.game-score-pill strong.score-pop {
    animation: scorePop 0.2s ease;
    color: #a5b4fc;
}

@keyframes scorePop {
    50% { transform: scale(1.15); }
}

.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 12, 24, 0.4);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.game-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.game-overlay.game-over {
    background: rgba(30, 8, 12, 0.5);
}

.game-overlay-text {
    text-align: center;
    padding: 1.5rem;
}

.game-overlay-text .overlay-title {
    display: block;
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    font-weight: 700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    animation: pulseTitle 1.6s ease-in-out infinite;
}

.game-overlay-text small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

@keyframes pulseTitle {
    50% { opacity: 0.85; transform: scale(1.02); }
}

/* Stealth login */
.stealth-login {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.stealth-login.d-none {
    display: none !important;
}

.stealth-login-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.stealth-login-card {
    position: relative;
    width: min(100%, 380px);
    background: linear-gradient(160deg, #1a2236 0%, #12182a 100%);
    border-radius: 18px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.stealth-login-card h2 { margin: 0 0 1rem; font-size: 1.25rem; }

.stealth-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    border: none;
    background: transparent;
    color: #8b9cb8;
    font-size: 1.5rem;
    cursor: pointer;
}

.stealth-form label { display: block; margin-bottom: 0.85rem; text-align: left; }
.stealth-form label span { display: block; font-size: 0.75rem; color: #8b9cb8; margin-bottom: 0.3rem; }
.stealth-form input[type="text"],
.stealth-form input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #2a3548;
    background: #0c1222;
    color: #fff;
    font: inherit;
}

.stealth-session { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1rem; font-size: 0.8rem; color: #aab4c8; }
.stealth-session-label { font-size: 0.72rem; font-weight: 600; color: #8b95a8; text-transform: uppercase; letter-spacing: 0.04em; }
.stealth-session label { display: flex; align-items: center; gap: 0.45rem; cursor: pointer; }

.stealth-submit {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.stealth-alert { padding: 0.6rem 0.75rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 0.85rem; }
.stealth-alert.error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.stealth-alert.ok { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.stealth-foot { margin: 1rem 0 0; font-size: 0.85rem; color: #8b9cb8; }
.stealth-foot a { color: #a5b4fc; }
