/* ============================================================
   ASTEROIDS — Vector Neon Space Theme
   Accent: #A0A0FF (Lavender Blue)
   ============================================================ */

:root {
    --ast-accent: #A0A0FF;
    --ast-accent-dim: #6060AA;
    --ast-accent-glow: rgba(160, 160, 255, 0.4);
    --ast-white: #E8E8FF;
    --ast-bg: #0A0A1A;
    --ast-bg-card: rgba(16, 16, 40, 0.92);
    --ast-border: rgba(160, 160, 255, 0.15);
    --ast-danger: #FF4466;
    --ast-gold: #FFD700;
    --ast-green: #44FF88;
}

/* ── Layout ── */
.ast-layout {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px 16px;
    min-height: 100vh;
    background: var(--ast-bg);
}

.ast-ad-slot {
    width: 160px;
    flex-shrink: 0;
}

.ast-ad-placeholder {
    background: var(--ast-bg-card);
    border: 1px dashed var(--ast-border);
    border-radius: 8px;
    color: var(--ast-accent-dim);
    font-size: 11px;
    text-align: center;
    padding: 12px 8px;
    letter-spacing: 2px;
}

.ast-ad-placeholder--vertical {
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#asteroids-app {
    width: 520px;
    max-width: 100%;
    position: relative;
}

/* ── Screen States ── */
.ast-screen {
    display: none;
    flex-direction: column;
    align-items: center;
}

.ast-screen.active {
    display: flex;
}

/* ── Menu Screen ── */
.ast-header {
    text-align: center;
    padding: 32px 0 16px;
    position: relative;
    overflow: hidden;
}

.ast-logo {
    font-family: 'Syne', 'JetBrains Mono', monospace;
    font-size: 52px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--ast-white);
    text-shadow:
        0 0 20px var(--ast-accent-glow),
        0 0 60px var(--ast-accent-glow);
    margin: 0;
    line-height: 1;
}

.ast-subtitle {
    font-family: 'DM Sans', sans-serif;
    color: var(--ast-accent-dim);
    font-size: 14px;
    margin-top: 12px;
    letter-spacing: 1px;
}

.ast-bestbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--ast-bg-card);
    border: 1px solid var(--ast-border);
    border-radius: 8px;
    margin: 16px auto;
}

.ast-bestbox__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ast-accent-dim);
    letter-spacing: 2px;
}

.ast-bestbox__score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--ast-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.ast-preview {
    margin: 12px auto;
}

.ast-preview canvas {
    display: block;
    margin: 0 auto;
}

/* ── Buttons ── */
.ast-btn {
    font-family: 'Syne', 'JetBrains Mono', monospace;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.ast-btn--primary {
    background: linear-gradient(135deg, var(--ast-accent), var(--ast-accent-dim));
    color: var(--ast-bg);
    padding: 12px 32px;
    font-size: 16px;
    box-shadow: 0 0 20px var(--ast-accent-glow);
}

.ast-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--ast-accent-glow);
}

.ast-btn--lg {
    padding: 16px 48px;
    font-size: 18px;
}

.ast-btn--outline {
    background: transparent;
    color: var(--ast-accent);
    border: 1px solid var(--ast-accent-dim);
    padding: 10px 24px;
    font-size: 13px;
}

.ast-btn--outline:hover {
    background: rgba(160, 160, 255, 0.08);
}

.ast-btn--ghost {
    background: transparent;
    color: var(--ast-accent-dim);
    padding: 8px 20px;
    font-size: 12px;
}

.ast-btn--ghost:hover {
    color: var(--ast-accent);
}

.ast-btn--sm {
    padding: 6px 14px;
    font-size: 11px;
}

.ast-menu-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.ast-controls-hint {
    text-align: center;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--ast-accent-dim);
    letter-spacing: 1px;
    opacity: 0.7;
}

/* ── HUD ── */
.ast-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--ast-bg-card);
    border: 1px solid var(--ast-border);
    border-radius: 8px;
    margin-bottom: 8px;
}

.ast-hud__left,
.ast-hud__center,
.ast-hud__right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ast-hud__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--ast-accent-dim);
    letter-spacing: 2px;
}

.ast-hud__value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--ast-white);
}

/* ── Canvas ── */
.ast-canvas-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    background: var(--ast-bg);
    border: 1px solid var(--ast-border);
    border-radius: 8px;
    overflow: hidden;
}

.ast-canvas-wrap canvas {
    display: block;
}

/* ── Touch Controls ── */
.ast-touch-controls {
    display: none;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    padding: 8px;
}

.ast-touch-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--ast-accent-dim);
    background: var(--ast-bg-card);
    color: var(--ast-accent);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ast-touch-btn:active,
.ast-touch-btn.pressed {
    background: var(--ast-accent-dim);
    color: var(--ast-bg);
}

.ast-touch-btn--fire {
    width: 72px;
    height: 72px;
    border-color: var(--ast-danger);
    color: var(--ast-danger);
    font-size: 14px;
    letter-spacing: 1px;
}

.ast-touch-btn--fire:active,
.ast-touch-btn--fire.pressed {
    background: var(--ast-danger);
    color: white;
}

/* ── Result Card ── */
.ast-result-card {
    background: var(--ast-bg-card);
    border: 1px solid var(--ast-border);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    margin-top: 40px;
    width: 380px;
    max-width: 100%;
    backdrop-filter: blur(12px);
}

.ast-result-title {
    font-family: 'Syne', monospace;
    font-size: 28px;
    font-weight: 800;
    color: var(--ast-danger);
    letter-spacing: 4px;
    margin: 0 0 20px;
    text-shadow: 0 0 20px rgba(255, 68, 102, 0.3);
}

.ast-result-scores {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.ast-result-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px;
    background: rgba(160, 160, 255, 0.04);
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--ast-accent-dim);
}

.ast-result-val {
    color: var(--ast-white);
    font-weight: 700;
}

.ast-nickname-row {
    margin-bottom: 16px;
}

.ast-nickname-row input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(160, 160, 255, 0.06);
    border: 1px solid var(--ast-border);
    border-radius: 6px;
    color: var(--ast-white);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.ast-nickname-row input:focus {
    border-color: var(--ast-accent-dim);
    box-shadow: 0 0 8px var(--ast-accent-glow);
}

.ast-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 12px;
}

.ast-save-msg {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--ast-green);
    margin-top: 8px;
    min-height: 18px;
}

/* ── Leaderboard ── */
.ast-lb-card {
    background: var(--ast-bg-card);
    border: 1px solid var(--ast-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-top: 40px;
    width: 400px;
    max-width: 100%;
}

.ast-lb-card h2 {
    font-family: 'Syne', monospace;
    font-size: 22px;
    color: var(--ast-accent);
    letter-spacing: 4px;
    margin: 0 0 16px;
}

.ast-lb-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    text-align: left;
}

.ast-lb-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ast-border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--ast-white);
}

.ast-lb-list li:first-child {
    color: var(--ast-gold);
}

.ast-lb-list li:nth-child(2) {
    color: #C0C0C0;
}

.ast-lb-list li:nth-child(3) {
    color: #CD7F32;
}

.ast-lb-list li .lb-rank {
    width: 28px;
    color: var(--ast-accent-dim);
}

.ast-lb-list li .lb-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ast-lb-list li .lb-score {
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}

/* ── Mobile ── */
@media (max-width: 800px) {
    .ast-ad-slot--left,
    .ast-ad-slot--right {
        display: none;
    }

    .ast-layout {
        padding: 8px;
    }

    #asteroids-app {
        width: 100%;
    }

    .ast-touch-controls {
        display: flex;
    }
}

@media (max-width: 520px) {
    .ast-logo {
        font-size: 36px;
        letter-spacing: 4px;
    }

    .ast-result-card,
    .ast-lb-card {
        padding: 20px 16px;
        width: 100%;
    }
}

/* ── Animations ── */
@keyframes ast-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ast-logo {
    animation: ast-pulse 3s ease-in-out infinite;
}
