:root {
    color-scheme: dark;
    --bg: #07140f;
    --panel: #10241c;
    --panel-2: #16372a;
    --primary: #00b37e;
    --primary-2: #47d18c;
    --text: #f3fff9;
    --muted: #9bb8ac;
    --danger: #f87171;
    --grid: #1d4937;
}

* {
    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, #174633 0, var(--bg) 48%);
    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: #03110c;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

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

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

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

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

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

.scorebar strong {
    font-size: clamp(24px, 6vw, 38px);
    line-height: 1;
}

#pauseButton {
    min-width: 96px;
    height: 42px;
}

.board-wrap {
    position: relative;
    width: min(100%, 560px);
    margin: 0 auto;
    aspect-ratio: 1;
    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.28);
}

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

.overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 14px;
    padding: 28px;
    text-align: center;
    background: rgba(7, 20, 15, 0.84);
}

.overlay[hidden] {
    display: none;
}

.overlay h1 {
    margin: 0;
    font-size: clamp(34px, 9vw, 62px);
    line-height: 1;
}

.overlay p {
    max-width: 360px;
    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 div {
    display: flex;
    gap: 8px;
}

.controls button {
    width: 58px;
    height: 48px;
    font-size: 22px;
}

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

    .scorebar {
        grid-template-columns: 1fr 1fr;
    }

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

    .controls {
        display: grid;
    }
}
