/* Unshilled. One dark theme, system fonts, no external assets.
   Chart colours: "verified" is the one highlighted series (blue); "everyone" is the
   grey context series. Text always uses the text tokens, never a series colour. */

:root {
  color-scheme: dark;
  --plane: #0d0d0d;            /* page */
  --surface: #1a1a19;          /* cards, panels, chart surface */
  --surface-2: #242422;
  --hairline: rgba(255, 255, 255, 0.10);
  --axis: #383835;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #898781;
  --verified: #3987e5;
  --everyone: #898781;
  --accent: #256abf;           /* buttons: white text passes AA on this */
  --accent-hover: #1c5cab;
  --link: #86b6ef;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  --critical-text: #f0a3a3;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--plane); color: var(--text); font: 16px/1.55 var(--font); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: #b7d3f6; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
code { background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.92em; }
img { max-width: 100%; }
ul, ol { padding-left: 1.3em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; margin: 0 auto; }
main.wrap { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }
.muted { color: var(--muted); }
.lede { color: var(--text-2); font-size: 1.08rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.12em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
.empty { color: var(--muted); padding: 28px 0; }

/* --- sample-data banner ------------------------------------------------- */
.sample-banner { display: flex; gap: 8px; align-items: flex-start; justify-content: center; padding: 8px 20px; background: #2b2410; color: var(--text); font-size: 0.9rem; border-bottom: 1px solid var(--hairline); }
.sample-banner .icon { color: var(--warning); margin-top: 0.25em; }

/* --- header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--hairline); background: var(--plane); }
.site-header__row { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.logo { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.logo span { color: var(--verified); }
.logo:hover { color: var(--text); }
.search { flex: 1 1 200px; max-width: 360px; }
.search input { width: 100%; }
.nav { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; margin-left: auto; font-size: 0.95rem; }
.nav a { color: var(--text-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--verified); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav form { margin: 0; }
.nav__user { color: var(--text); font-weight: 600; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a.btn { color: #fff; }

/* --- form controls ------------------------------------------------------ */
input[type="search"], textarea, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--axis);
  border-radius: 8px; padding: 9px 12px;
}
textarea { width: 100%; resize: vertical; min-height: 6em; }
input::placeholder, textarea::placeholder { color: var(--muted); }
.field-label { display: block; font-weight: 600; margin: 16px 0 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--axis); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--danger { border-color: var(--critical); color: var(--critical-text); }
.btn--danger:hover { background: #3a1616; color: #fff; }
.btn--small { min-height: 32px; padding: 4px 12px; font-size: 0.9rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linklike:hover { color: var(--text); }
.linklike--danger { color: var(--critical-text); }

/* --- messages ----------------------------------------------------------- */
.flashes { margin-bottom: 20px; }
.flash { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; padding: 10px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--hairline); }
.flash .icon { margin-top: 0.3em; }
.flash--ok .icon { color: var(--good); }
.flash--info .icon { color: var(--link); }
.flash--error { border-color: var(--critical); }
.flash--error .icon { color: var(--critical-text); }

/* --- home --------------------------------------------------------------- */
.hero { padding: 28px 0 36px; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; margin-bottom: 0.4em; }
.hero h1 em { font-style: normal; text-decoration: underline; text-decoration-color: var(--verified); text-decoration-thickness: 4px; text-underline-offset: 6px; }
.hero p { color: var(--text-2); font-size: 1.1rem; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 0; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 8px 0 12px; }
.list-head h1, .list-head h2 { margin: 0; }
.list-head form { margin: 0; }
.list-note { margin: 0 0 16px; font-size: 0.95rem; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs--left { margin-bottom: 16px; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 0.92rem; border: 1px solid transparent; }
.tabs a:hover { color: var(--text); border-color: var(--axis); }
.tabs a[aria-current="true"] { background: var(--surface-2); color: var(--text); border-color: var(--axis); font-weight: 600; }

.game-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__link { color: var(--text); text-decoration: none; display: block; }
.card__link:hover .card__name { text-decoration: underline; }
.card .cover { border-radius: 0; }
.card__name { display: block; padding: 12px 14px 0; font-weight: 700; line-height: 1.3; }
.card__scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: auto 0 0; padding: 12px 14px 14px; }
.card__scores dt { font-size: 0.78rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.card__scores dd { margin: 2px 0 0; display: flex; flex-direction: column; }
.card__scores .num { font-size: 1.5rem; font-weight: 650; line-height: 1.15; }
.card__scores .count { font-size: 0.78rem; color: var(--muted); }
.none { color: var(--muted); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot--verified { background: var(--verified); }
.dot--everyone { background: var(--everyone); }

.cover { position: relative; display: block; aspect-ratio: 460 / 215; background: linear-gradient(135deg, #2a2a28, #1a1a19); border-radius: 8px; overflow: hidden; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; font-weight: 700; color: var(--text-2); font-size: 0.95rem; line-height: 1.2; }
.cover--noimg img { display: none; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 24px; }
.pager > :last-child { justify-self: end; }
.pager > :first-child { justify-self: start; }

/* --- game page ---------------------------------------------------------- */
.game-head { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 24px; align-items: center; margin-bottom: 24px; }
.game-head h1 { margin-bottom: 6px; }
.game-head p { margin-bottom: 6px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 20px; }
.tile__label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.95rem; }
.tile__value { font-size: 3rem; font-weight: 650; line-height: 1.1; margin: 6px 0 4px; letter-spacing: -0.02em; }
.tile__unit { font-size: 1.1rem; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.tile__meta { color: var(--muted); font-size: 0.88rem; }
.gap-note { margin: 16px 0 0; font-size: 1.05rem; }

.hists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.hist { margin: 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px 20px; }
.hist__title { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.9rem; margin-bottom: 6px; }
.hist__svg { display: block; width: 100%; max-width: 300px; height: auto; overflow: visible; border-radius: 4px; }
.hist__baseline { stroke: var(--axis); stroke-width: 1; }
.hist__bar { transition: opacity 0.12s; }
.hist--verified .hist__bar { fill: var(--verified); }
.hist--everyone .hist__bar { fill: var(--everyone); }
.hist__svg.has-active .hist__bar { opacity: 0.45; }
.hist__svg.has-active .is-active .hist__bar { opacity: 1; }
.hist__tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hist__label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.is-active .hist__tick { fill: var(--text); font-weight: 600; }
.hist__hit { fill: transparent; cursor: default; }
.hist__empty { margin: 8px 0 0; }
.hist__table { margin-top: 10px; font-size: 0.88rem; color: var(--text-2); }
.hist__table summary { cursor: pointer; color: var(--muted); }
.hist__table table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.hist__table th, .hist__table td { text-align: right; padding: 2px 14px 2px 0; font-weight: 400; }
.hist__table thead th { color: var(--muted); border-bottom: 1px solid var(--axis); }

.tip { position: absolute; z-index: 20; pointer-events: none; background: #000; color: var(--text); border: 1px solid var(--axis); border-radius: 6px; padding: 4px 9px; font-size: 0.82rem; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }

.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 20px; margin: 24px 0; }
.panel > :last-child { margin-bottom: 0; }
.panel--notice { border-color: #5a4a14; }
.proof-note { color: var(--text-2); }
.icon--verified { color: var(--verified); }

.picker { border: 0; margin: 0; padding: 0; }
.picker legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.picker__row { display: flex; gap: 6px; flex-wrap: wrap; }
.picker label { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--axis); background: var(--plane); font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; }
.picker label:hover { border-color: var(--link); }
.picker input:checked + label { background: var(--accent); border-color: var(--accent); color: #fff; }
.picker input:focus-visible + label { outline: 2px solid var(--link); outline-offset: 2px; }
.delete-form { margin-top: 14px; }

.review { border-top: 1px solid var(--hairline); padding: 18px 0; }
.review__head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.review__who { font-weight: 650; overflow-wrap: anywhere; }
.review__score { font-weight: 700; font-size: 1.1rem; }
.review__score span { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.review__body { margin: 10px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.review__foot { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; font-size: 0.85rem; }
.review__report { margin-left: auto; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.review__report:hover { color: var(--text); }

.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: var(--surface-2); }
.avatar--initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-2); font-size: 0.9rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--axis); color: var(--text-2); font-size: 0.8rem; white-space: nowrap; }
.badge--verified { border-color: var(--verified); color: var(--text); }
.badge--verified .icon { color: var(--verified); }
.badge--sample { border-color: #5a4a14; background: #2b2410; color: var(--text); }

/* --- library ------------------------------------------------------------ */
.lib { list-style: none; margin: 0; padding: 0; }
.lib__row { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hairline); }
.lib__cover { display: block; }
.lib__name { font-weight: 650; color: var(--text); text-decoration: none; }
.lib__name:hover { text-decoration: underline; }
.lib__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lib__hours { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-2); font-size: 0.9rem; }
.lib__rate { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; }
.lib__status { font-size: 0.82rem; min-height: 1.3em; margin: 0; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.quick button { width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--axis); background: var(--plane); color: var(--text); font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer; }
.quick button:hover { border-color: var(--link); }
.quick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.quick button:disabled { opacity: 0.6; cursor: progress; }

/* --- sign-in, rules, removals, moderation ------------------------------- */
.demo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.demo-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.demo-list form { margin: 0; }

.prose h2 { margin-top: 1.8em; }
.prose li { margin-bottom: 0.4em; }

.reason-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 12px; }
.reason-counts > div { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.reason-counts dt { color: var(--text-2); font-size: 0.85rem; }
.reason-counts dd { margin: 0; font-size: 1.6rem; font-weight: 650; line-height: 1.2; }
.reason-counts > .reason-counts__never { grid-column: 1 / -1; flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 10px; border-color: var(--verified); }
.reason-counts__never dt { color: var(--text); font-size: 1rem; }

.table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.table th, .table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.table thead th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.table form { margin: 0; }

.quoted { margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--axis); background: var(--surface); border-radius: 0 8px 8px 0; }
.quoted > :last-child { margin-bottom: 0; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choices legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.choices label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.choices input { accent-color: var(--verified); width: 18px; height: 18px; }

.case__reports { color: var(--text-2); font-size: 0.92rem; margin: 12px 0; }
.case__actions { display: flex; gap: 12px 20px; flex-wrap: wrap; align-items: center; }
.case__actions form { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }

.error-page { text-align: center; padding: 48px 0; }
.error-page__code { font-size: 4rem; font-weight: 800; color: var(--muted); margin: 0; line-height: 1; }
.error-page h1 { font-size: 1.4rem; margin: 12px 0 24px; }

.site-footer { border-top: 1px solid var(--hairline); padding: 24px 0 40px; font-size: 0.9rem; }
.site-footer p { margin: 0 0 6px; }

/* --- small screens ------------------------------------------------------ */
@media (max-width: 760px) {
  h1 { font-size: 1.6rem; }
  .site-header__row { gap: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .game-head { grid-template-columns: 1fr; gap: 14px; }
  .tiles, .hists { grid-template-columns: 1fr; }
  .tile__value { font-size: 2.5rem; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .lib__row { grid-template-columns: 96px minmax(0, 1fr); }
  .lib__rate, .lib__row > .lib__status { grid-column: 1 / -1; align-items: stretch; }
  .quick, .picker__row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .quick button, .picker label { width: auto; height: 42px; }
  .review__report { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
