/*
 The page's colours, made of one: the theme's background (the user's,
 --base-light / --base-dark, set by theme.js). OKLCH: lightness as the
 eye sees it, so the same steps read the same at every hue. The
 background's lightness is held in a band (the text on it always
 readable whatever colour is picked), its chroma held low (never
 garish); the text is the background's hue at a fixed lightness; muted
 text a mix of the text and the block, not transparency.
*/
:root,
:root.light {
    color-scheme: light;
    --background: oklch(from var(--base-light, #cccccc) clamp(0.78, l, 0.96) min(c, 0.08) h);
    --blockBackground: oklch(from var(--background) calc(l + 0.05) c h);
    --color: oklch(from var(--background) 0.2 min(c, 0.03) h);
    --muted: color-mix(in oklch, var(--color) 54%, var(--blockBackground));
    --link: oklch(from var(--background) 0.45 0.15 250);
}

:root.dark {
    color-scheme: dark;
    --background: oklch(from var(--base-dark, #18191a) clamp(0.14, l, 0.32) min(c, 0.06) h);
    --blockBackground: oklch(from var(--background) calc(l + 0.06) c h);
    --color: oklch(from var(--background) 0.93 min(c, 0.02) h);
    --muted: color-mix(in oklch, var(--color) 62%, var(--blockBackground));
    --link: oklch(from var(--background) 0.78 0.12 250);
}

:root {
    --gap: 16px;
    --width: 960px;
    --radius: 6px;
    font-family: system-ui, sans-serif;
    line-height: 1.5;
}

* {
    box-sizing: border-box;
}

html {
    color: var(--color);
    background-color: var(--background);
}

body {
    margin: 0;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.block {
    background-color: var(--blockBackground);
    border-radius: var(--radius);
}

.text-muted {
    color: var(--muted);
}

/* The top: the logo, the sections, the theme and the sign-in. */
.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--gap);
    padding: 10px var(--gap);
    background-color: var(--blockBackground);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--color);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
}

.nav a {
    color: var(--muted);
}

.nav a[aria-current] {
    color: var(--color);
    font-weight: 600;
}

.top-right {
    display: flex;
    align-items: center;
    gap: var(--gap);
    margin-left: auto;
}

button {
    font: inherit;
    color: inherit;
    background-color: var(--background);
    border: 1px solid var(--muted);
    border-radius: var(--radius);
    padding: 4px 12px;
    cursor: pointer;
}

button:disabled {
    color: var(--muted);
    cursor: default;
}

#page {
    max-width: var(--width);
    margin: 0 auto;
    padding: var(--gap);
}

.games {
    display: grid;
    gap: 8px;
}

.game {
    padding: 10px var(--gap);
}

.theme-form {
    display: grid;
    gap: 8px;
    padding: var(--gap);
    max-width: 320px;
}

.theme-form fieldset {
    border: none;
    padding: 0;
    display: grid;
    gap: 4px;
}
