:root {
    --bg-dark: #05070e;
    --bg-card: rgba(15, 23, 42, 0.9);
    --border-neon: rgba(56, 189, 248, 0.4);
    --neon-cyan: #38bdf8;
    --neon-purple: #c084fc;
    --neon-green: #4ade80;
    --neon-red: #f43f5e;
    --neon-amber: #fbbf24;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: #f8fafc;
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.demo-banner {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
    color: #fff;
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.game-container {
    max-width: 680px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    text-align: center;
}

.game-title h1 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    font-family: var(--font-mono);
}

.accent-neon {
    background: linear-gradient(135deg, #38bdf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-arcade {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--neon-purple);
    font-weight: 700;
}

.score-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-neon);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}

.score-label { font-size: 0.65rem; color: #94a3b8; font-weight: 700; }
.score-val { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800; color: #fff; }
.highlight-high { color: var(--neon-amber); }

.canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 3 / 2;
    background: #090d16;
    border: 2px solid var(--border-neon);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
}

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

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 14, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    transition: opacity 0.3s ease;
}

.game-overlay.hidden {
    display: none;
}

.overlay-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-neon);
    padding: 1.75rem;
    border-radius: 14px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

.overlay-card h2 {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--neon-cyan);
}

.text-gameover { color: var(--neon-red) !important; }

.overlay-card p {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.4;
}

.controls-hint {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.btn-play {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #041324;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: var(--font-mono);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    transition: transform 0.15s ease;
}

.btn-play:hover {
    transform: scale(1.03);
}

.final-score-box {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.final-score-box strong {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: #fff;
}

.touch-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.touch-middle {
    display: flex;
    gap: 0.5rem;
}

.touch-btn {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-neon);
    color: #fff;
    font-size: 1.2rem;
    border-radius: 12px;
    touch-action: manipulation;
}

.touch-btn:active {
    background: var(--neon-cyan);
    color: #000;
}

.game-footer {
    font-size: 0.75rem;
    color: #64748b;
    font-family: var(--font-mono);
    text-align: center;
}

@media (max-width: 600px) {
    .touch-controls {
        display: flex;
    }
}
