:root {
    color-scheme: dark;
    --bg: #05060f;
    --panel: #0d1024;
    --panel-2: #161b3a;
    --primary: #22d3ee;
    --primary-2: #67e8f9;
    --text: #eef4ff;
    --muted: #8b93b8;
    --danger: #f87171;
    --grid: #1c2144;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #171d43 0, var(--bg) 55%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #03131a;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

button:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }

.game-shell {
    width: min(100%, 560px);
    min-height: 100vh;
    padding: 18px;
    display: grid;
    align-content: center;
    gap: 14px;
}

.scorebar {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(13, 16, 36, 0.88);
    padding: 12px;
}

.scorebar div { display: grid; gap: 2px; }

.label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.scorebar strong {
    font-size: clamp(16px, 4.5vw, 28px);
    line-height: 1;
}

#pauseButton { min-width: 90px; height: 42px; }
#muteButton {
    width: 42px;
    height: 42px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.board-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

canvas { display: block; width: 100%; height: 100%; }

.overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: rgba(5, 6, 15, 0.88);
}

.overlay[hidden] { display: none; }

.overlay h1 {
    margin: 0;
    font-size: clamp(30px, 8vw, 52px);
    line-height: 1;
}

.overlay p {
    max-width: 340px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.45;
}

.overlay button {
    justify-self: center;
    min-width: 150px;
    height: 48px;
}

.controls {
    display: none;
    justify-items: center;
    gap: 8px;
}

.controls .row { display: flex; gap: 8px; }

.controls button {
    width: 64px;
    height: 52px;
    font-size: 20px;
}

.controls button.fire {
    width: 96px;
    background: var(--danger);
    color: #2a0a0a;
}

@media (max-width: 720px) {
    .game-shell { align-content: start; }

    .scorebar { grid-template-columns: repeat(2, 1fr); }

    #pauseButton { grid-column: 1 / 2; width: 100%; }
    #muteButton { grid-column: 2 / 3; width: 100%; }

    .controls { display: grid; }
}
