/* vdijken.nl — styling */

:root {
    --bg: #f7f8fb;
    --bg-glow-a: rgba(11, 95, 255, 0.16);
    --bg-glow-b: rgba(0, 200, 170, 0.14);
    --fg: #14161a;
    --muted: #5c6470;
    --accent: #0b5fff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: #ffffff;
    --border: rgba(20, 22, 26, 0.10);
    --shadow: 0 18px 50px -24px rgba(20, 22, 26, 0.35);
    --field: #101319;
    --field-line: rgba(255, 255, 255, 0.16);
    --paddle: #f2f4f8;
    --ball: #ffffff;
    --radius: 16px;
    --max-width: 940px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0f13;
        --bg-glow-a: rgba(111, 155, 255, 0.20);
        --bg-glow-b: rgba(0, 214, 178, 0.14);
        --fg: #eef1f5;
        --muted: #99a2ae;
        --accent: #7ba4ff;
        --surface: rgba(255, 255, 255, 0.045);
        --surface-solid: #171a20;
        --border: rgba(255, 255, 255, 0.10);
        --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
        --field: #0a0c10;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--fg);
    background: var(--bg);
    background-image:
        radial-gradient(60rem 40rem at 12% -10%, var(--bg-glow-a), transparent 60%),
        radial-gradient(48rem 36rem at 100% 4%, var(--bg-glow-b), transparent 62%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 8vw, 5rem) 1.25rem 4rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero { max-width: 34ch; }

.eyebrow {
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

h1 {
    margin: 0;
    font-size: clamp(1.85rem, 5.2vw, 3.1rem);
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.lead {
    margin: 1rem 0 0;
    max-width: 46ch;
    font-size: clamp(1rem, 2vw, 1.12rem);
    color: var(--muted);
}

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

.game { margin-top: clamp(2rem, 6vw, 3.25rem); }

.scoreboard {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: clamp(1rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.score { text-align: center; }

.score-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.score-value {
    display: block;
    font-variant-numeric: tabular-nums;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 650;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.score-sep { color: var(--border); font-size: 1.5rem; }

.canvas-wrap {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--field);
    box-shadow: var(--shadow);
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 560;
    touch-action: none;
    cursor: none;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.5rem;
    text-align: center;
    color: #f3f5f9;
    background: rgba(8, 10, 14, 0.72);
    backdrop-filter: blur(6px);
    transition: opacity 200ms ease, visibility 200ms ease;
}

.overlay[hidden] {
    display: flex;
    visibility: hidden;
    opacity: 0;
}

.overlay-title {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 650;
    letter-spacing: -0.01em;
}

.overlay-text {
    margin: 0;
    max-width: 32ch;
    color: rgba(243, 245, 249, 0.72);
}

.btn {
    margin-top: 1rem;
    padding: 0.65rem 1.5rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }

.btn:focus-visible,
canvas:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.hint {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

kbd {
    display: inline-block;
    padding: 0.1em 0.4em;
    margin: 0 0.1em;
    font: inherit;
    font-size: 0.85em;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    .btn, .overlay { transition: none; }
}
