:root {
    --bg: #0e1116;
    --text: #e7ebf2;
    --text-muted: #8b95a6;
    --accent: #f1a208;
    --accent-soft: #4a3c1a;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
                 "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    height: 100vh;
}

.hidden { display: none !important; }

.screen {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

/* --- Splash --------------------------------------------------------- */

.splash {
    background: radial-gradient(circle at 50% 30%, #1a2230 0%, var(--bg) 70%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    text-align: center;
}

.splash-title {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

.splash-tag {
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 28px;
}

.splash-rules {
    margin: 0 0 32px;
    max-width: 320px;
    color: var(--text);
}

.primary-btn {
    background: var(--accent);
    color: #1a1407;
    border: none;
    border-radius: 14px;
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.primary-btn:active { transform: scale(0.97); }

.splash-tip {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 12px;
    min-height: 16px;
}

/* --- Game ----------------------------------------------------------- */

#game {
    display: block;
    width: 100vw;
    height: 100vh;
    background: #1a1f2a;
    image-rendering: pixelated;
}

.hud {
    position: fixed;
    top: env(safe-area-inset-top, 0);
    left: 0; right: 0;
    padding: 12px;
    pointer-events: none;
}

.hud-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hud-pill {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.hud-pill-muted {
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
}

.hud-bottom {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0);
    left: 0; right: 0;
    padding: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    flex-wrap: wrap;
}

.dbg {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
    font-size: 10px !important;
    max-width: 95vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Joystick fallback ---------------------------------------------- */

.joystick {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0));
    right: 24px;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    touch-action: none;
}

.joystick-stick {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: rgba(241, 162, 8, 0.85);
    box-shadow: var(--shadow);
    pointer-events: none;
}
