/* Tourney: one family (Archivo, variable width), two side colors, nothing else.
   Blue and red only ever mean a team side. Actions are ink. */

:root {
  --paper: #f5f6f8;
  --surface: #ffffff;
  --ink: #141a2a;
  --mute: #646c80;
  --line: #d9dee7;
  --soft: #eceff4;
  --blue: #2a5bf6;
  --red: #e2434b;
  --blue-wash: #e8eeff;
  --red-wash: #fdebec;
  --ok: #1f8a4c;
  --warn: #b25e00;
  --radius: 6px;
  --f: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1322; --surface: #141b2e; --ink: #e9edf5; --mute: #8f98ae; --line: #263150;
    --soft: #1a2238; --blue: #5b84ff; --red: #ff6168; --blue-wash: #17234a; --red-wash: #3a1a22;
    --ok: #4cc27f; --warn: #f0a24a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1322; --surface: #141b2e; --ink: #e9edf5; --mute: #8f98ae; --line: #263150;
  --soft: #1a2238; --blue: #5b84ff; --red: #ff6168; --blue-wash: #17234a; --red-wash: #3a1a22;
  --ok: #4cc27f; --warn: #f0a24a; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 var(--f); font-variation-settings: 'wdth' 100;
  font-feature-settings: 'tnum' 1;
}
/* The signature: a split rule across the top of every page. */
body::before {
  content: ''; display: block; height: 5px;
  background: linear-gradient(90deg, var(--blue) 0 50%, var(--red) 50% 100%);
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 78rem; }

/* ---------- type ---------- */
.display, h1, h2, h3 { font-family: var(--f); margin: 0; line-height: 1.05; }
h1 { font-size: clamp(2.6rem, 9vw, 5.2rem); font-weight: 800; font-variation-settings: 'wdth' 125; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 750; font-variation-settings: 'wdth' 112; letter-spacing: -0.01em; margin-top: 3.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 .4rem; }
p { margin: 0 0 1rem; max-width: 62ch; }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink); max-width: 34rem; }
.mute { color: var(--mute); }
.small { font-size: .875rem; }
.condensed { font-variation-settings: 'wdth' 75; }

/* ---------- site header ---------- */
.site { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; flex-wrap: wrap; }
.mark { font-weight: 850; font-variation-settings: 'wdth' 125; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; }
.site nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site nav a { text-decoration: none; color: var(--mute); }
.site nav a:hover, .site nav a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 3.5rem 0 1rem; }
.hero h1 { margin-bottom: 1.4rem; }
.hero .when { display: flex; gap: 2rem; flex-wrap: wrap; margin: 2rem 0 2.2rem; }
.hero .when div { min-width: 9rem; }
.hero .when strong { display: block; font-size: 1.1rem; }
.hero .when span { color: var(--mute); font-size: .9rem; }
.hero .cta { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* ---------- buttons & forms ---------- */
.btn {
  appearance: none; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 650 .95rem/1 var(--f); padding: .8rem 1.15rem; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--soft); filter: none; }
.btn.small { padding: .45rem .7rem; font-size: .85rem; min-height: 34px; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

form.stack { display: grid; gap: 1.15rem; }
.field { display: grid; gap: .35rem; }
.field > span { font-weight: 600; font-size: .95rem; }
.field small { color: var(--mute); font-size: .85rem; }
.grid2 { display: grid; gap: 1.15rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: .65rem .75rem; min-height: 44px; width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--ink); }
.check { display: flex; gap: .65rem; align-items: flex-start; }
.check input { margin-top: .2rem; flex: none; }
.scale { display: flex; gap: .4rem; }
.scale label { flex: 1; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span {
  display: grid; place-items: center; height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-weight: 650; cursor: pointer;
}
.scale input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scale input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.notice { border-left: 3px solid var(--ink); padding: .7rem .9rem; background: var(--surface); margin: 1rem 0; }
.notice.bad { border-color: var(--red); }
.notice.good { border-color: var(--ok); }

/* ---------- lists & tables ---------- */
.schedule { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; margin: 0; }
.schedule dt { font-weight: 700; font-variation-settings: 'wdth' 85; }
.schedule dd { margin: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th { text-align: left; font-weight: 600; color: var(--mute); font-size: .85rem; padding: .5rem .6rem; border-bottom: 1.5px solid var(--ink); }
table.t td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td.num, table.t th.num { text-align: right; }
.scroll-x { overflow-x: auto; }
ol.prio { padding-left: 1.3rem; margin: 0; }
ol.prio li { margin-bottom: .5rem; padding-left: .3rem; }

.ability { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.ability .lv { font-weight: 850; font-variation-settings: 'wdth' 125; font-size: 1.6rem; line-height: 1; }
.ability .lv small { display: block; font-size: .7rem; font-weight: 600; color: var(--mute); font-variation-settings: 'wdth' 100; margin-top: .25rem; }
.ability h3 { margin: 0 0 .25rem; }
.ability p { margin: 0; color: var(--mute); }

.pill { display: inline-block; font-size: .78rem; font-weight: 650; padding: .15rem .5rem; border-radius: 99px; background: var(--soft); color: var(--ink); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: var(--red-wash); color: var(--red); }

.announce { border-left: 3px solid var(--ink); padding: .2rem 0 .2rem .9rem; margin-bottom: 1rem; }
.announce time { display: block; font-size: .8rem; color: var(--mute); }

footer.site-foot { margin: 5rem 0 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--mute); font-size: .875rem; }

/* ---------- games (shared by dashboard, console, screen) ---------- */
.game { margin: 1.25rem 0; }
.game-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.game-head h3 { margin: 0; font-variation-settings: 'wdth' 112; font-size: 1.15rem; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
@media (max-width: 520px) { .sides { grid-template-columns: 1fr; } }
.side { padding: .6rem .75rem .75rem; }
.side.blue { border-top: 4px solid var(--blue); }
.side.red { border-top: 4px solid var(--red); }
.side .side-name { font-size: .8rem; font-weight: 700; margin-bottom: .3rem; display: flex; justify-content: space-between; }
.side.blue .side-name { color: var(--blue); }
.side.red .side-name { color: var(--red); }
.side.won { background: color-mix(in srgb, var(--ok) 8%, transparent); }
.seat { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .5rem; align-items: baseline; padding: .32rem 0; border-top: 1px solid var(--soft); }
.seat:first-of-type { border-top: 0; }
.seat .role { font-size: .75rem; font-weight: 700; color: var(--mute); font-variation-settings: 'wdth' 80; }
.seat .who { font-weight: 600; overflow-wrap: anywhere; }
.seat .who .cap { white-space: nowrap; font-size: .7rem; font-weight: 700; color: var(--mute); margin-left: .3rem; }
.seat .fx { grid-column: 2 / -1; font-size: .82rem; color: var(--mute); }
.seat .fx b { color: var(--ink); font-weight: 650; }
.seat.me .who { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.seat .tag { font-size: .78rem; color: var(--mute); }
.bench { font-size: .9rem; color: var(--mute); margin-top: .5rem; }
