/* The public pages (/, /account, /activate). The admin page has its own admin.css. Magenta on near-black, like the
   launcher; a light variant for light-mode browsers. */
:root {
    --bg: #faf7fb;
    --card: #ffffff;
    --text: #1c1520;
    --muted: #6d6373;
    --border: #e7dfeb;
    --accent: #b0209e;
    --accent-text: #ffffff;
    --accent-soft: #f6e3f3;
    --danger: #c73d3d;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e0b10;
        --card: #18131b;
        --text: #eee7f1;
        --muted: #a397a9;
        --border: #2c2330;
        --accent: #e14fd0;
        --accent-text: #120a12;
        --accent-soft: #2a1729;
        --danger: #f07474;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 16px/1.7 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ---- header ---- */

.site-header { border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.3rem; letter-spacing: .04em; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--text); }
.site-nav .nav-account { color: var(--accent); font-weight: 600; }

/* ---- buttons ---- */

.button, button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: .6em 1.2em; border-radius: 8px; border: 1px solid var(--accent);
    background: var(--accent); color: var(--accent-text);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover, button:hover { filter: brightness(1.08); }
.button.secondary, button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- content ---- */

main { padding: 40px 0 64px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.2; margin: 0 0 .3em; }
.hero p.lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.6em; max-width: 36em; }

.card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px 24px; margin: 24px 0;
}
.card h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.muted { color: var(--muted); }
.error { color: var(--danger); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2em 1fr; gap: 8px; }
.steps li::before {
    content: counter(step); width: 1.8em; height: 1.8em; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent); font-weight: 700;
    display: grid; place-items: center; font-size: .9rem; margin-top: .15em;
}

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pill { display: inline-block; padding: .1em .7em; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600; }

input[type="text"] {
    font: inherit; padding: .55em .8em; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); min-width: 0;
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.code {
    font: 700 clamp(1.5rem, 7vw, 2.2rem) ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .15em;
    padding: .3em .8em; border: 2px solid var(--accent); border-radius: 10px; display: inline-block; color: var(--accent);
}

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.site-footer .wrap { padding-top: 16px; padding-bottom: 24px; }

/* ---- stats page (/stats) ---- */

.small { font-size: .85rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 16px 0; }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: grid; }
.stat-tile strong { font-size: 1.6rem; line-height: 1.2; }
.stat-tile span { color: var(--muted); font-size: .85rem; }
.table-scroll { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.stats-table th, .stats-table td { padding: .45em .6em; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.stats-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table .win { color: var(--accent); font-weight: 700; }
.result-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.tabs-row { margin-bottom: 8px; }
