/* Крапки — notebook paper, ballpoint blue, red pen */
:root {
  --paper: #f7f8f5;
  --paper-deep: #eceee9;
  --sheet: #fbfcfa;
  --grid: #cad7e4;
  --grid-edge: #a3b6c9;
  --margin: #e7a1a7;
  --ink: #1f2833;
  --ink-soft: #5d6a79;
  --ink-faint: #8b97a5;
  --line: #dde3e8;
  --blue: #2a4fc4;
  --red: #c9343c;
  /* 0.1.38: the movement arrows need a third colour — up is not "not red" */
  --ok: #2e8b57;
  --fill-alpha: 0.14;
  --scrim: rgba(24, 32, 42, 0.32);
  --shadow: 0 -10px 40px rgba(31, 40, 51, 0.12);

  --f-display: "Unbounded", "SF Pro Rounded", ui-rounded, system-ui, -apple-system, sans-serif;
  --f-ui: "Onest", -apple-system, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151a20;
    --paper-deep: #0f1318;
    --sheet: #1a2028;
    --grid: #27313c;
    --grid-edge: #3d4b59;
    --margin: #6e3a42;
    --ink: #e7ebf0;
    --ink-soft: #a0abb8;
    --ink-faint: #6d7988;
    --line: #29323c;
    --blue: #7d9dff;
    --red: #ff7d7b;
    --ok: #4fd18b;
    --fill-alpha: 0.2;
    --scrim: rgba(0, 0, 0, 0.5);
    --shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151a20;
  --paper-deep: #0f1318;
  --sheet: #1a2028;
  --grid: #27313c;
  --grid-edge: #3d4b59;
  --margin: #6e3a42;
  --ink: #e7ebf0;
  --ink-soft: #a0abb8;
  --ink-faint: #6d7988;
  --line: #29323c;
  --blue: #7d9dff;
  --red: #ff7d7b;
  --ok: #4fd18b;
  --fill-alpha: 0.2;
  --scrim: rgba(0, 0, 0, 0.5);
  --shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* 0.2.31 (рішення Слави R1, O2): what players will not see — shown only to an admin with «Показувати сховане» on (html.pre-show) */
html:not(.pre-show) [data-pre] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body { position: fixed; inset: 0; }
button { font: inherit; color: inherit; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* 0.1.20: #shell holds the two screens (home and game); on a tablet or desktop it becomes a
   phone-shaped window — see the media query at the end of this file. */
#shell { position: absolute; inset: 0; }
#app {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}

/* ---------- Board ---------- */
.board-wrap { position: relative; min-height: 0; overflow: hidden; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }

.pill {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 14px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 15px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.pill .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--side-1, var(--blue)); box-shadow: 0 0 0 2px var(--paper); }
.pill .dot.red { background: var(--side-2, var(--red)); }
.pill b { font-family: var(--f-mono); font-weight: 500; }

/*
 * THE MESSAGE THAT NOBODY EVER SAW (0.1.37).
 *
 * The toast lived `position: absolute` with no z-index INSIDE the board wrapper, and sheets are
 * `position: fixed` at `z-index: 11`. So every message fired from a sheet — the championship's
 * whole screen — was written, shown, and painted UNDERNEATH it. That is how the form mark of
 * 0.1.35 came to be reported as doing nothing when tapped: it did exactly what it was told, into
 * a layer the sheet was covering. Measured rather than guessed: `elementFromPoint` at the toast's
 * own centre returned `sheet-champ`.
 *
 * It is now fixed to the viewport and above everything, which is what a toast is for. It also
 * wraps now: the old `white-space: nowrap` meant a long sentence ran off both edges of a phone.
 */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px);
  transform: translate(-50%, -8px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 14px; border-radius: 10px;
  background: var(--sheet); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px; text-align: center; line-height: 1.35;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/*
 * ---------- СЛІД НАВІГАЦІЇ (0.1.51) ----------
 *
 * Інструмент для запису екрана: два рядки вгорі, які кажуть, де людина в стеку і що щойно з ним
 * сталося. Тому вимоги в нього не такі, як у решти інтерфейсу.
 *
 * ЧИТАТИСЯ НА КАДРІ ВІДЕО. Запис екрана iPhone стискається, і тонкий сірий текст на світлому тлі
 * в ньому розмивається першим. Звідси чорна плашка з білим моноширинним текстом — однакова в обох
 * темах, навмисно: діагностика не має підлаштовуватись під оформлення, вона має лишатись тим
 * самим прямокутником, хай що під ним.
 *
 * НЕ ЗАВАЖАТИ. `pointer-events: none` — накладка над грою, яка перехоплює хоч один дотик, змінює
 * те, що вимірює. `z-index` вищий за аркуші (11) і за сповіщення (40), бо вада може статися саме
 * на аркуші — і саме там слід потрібен найбільше.
 *
 * НЕ ЗАЙМАТИ ЕКРАН. Рядок притиснутий до верху, вужчий за повідомлення, з переносом: довгий слід
 * у плей-оф не має ховати рахунок.
 */
#nav-trace {
  position: fixed; left: 0; right: 0; top: var(--safe-t);
  padding: 3px calc(var(--safe-l) + 8px) 4px calc(var(--safe-r) + 8px);
  background: rgba(8, 10, 13, 0.82);
  color: #fff;
  font-family: var(--f-mono); font-size: 10px; line-height: 1.3;
  letter-spacing: -0.01em;
  pointer-events: none;
  z-index: 60;
  overflow-wrap: anywhere;
}
#nav-trace b { display: block; font-weight: 600; }
/* другий рядок — історія, тож трохи тихіший за «де я зараз», але все ще білий: сірий у стисненому
   відео перетворюється на кашу */
#nav-trace i { display: block; font-style: normal; opacity: 0.8; }
#nav-trace i:empty { display: none; }
/* коли слід увімкнено, головний екран і шапка гри посуваються, щоб він нічого не накривав */
:root.tracing .home-bar, :root.tracing .game-head { margin-top: 26px; }

/* ---------- Sheets ---------- */
.scrim {
  position: fixed; inset: 0; background: var(--scrim);
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
  z-index: 10;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  max-width: 560px;
  max-height: calc(100% - var(--safe-t) - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--sheet);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  padding: 10px calc(var(--safe-r) + 20px) calc(var(--safe-b) + 22px) calc(var(--safe-l) + 20px);
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 11;
  -webkit-user-select: text; user-select: text;
}
.sheet.open { transform: translateY(0); }
/* 0.2.23: a CLOSED sheet waits 5 % below the screen — and its shadow (blur 40, lifted 10) did not. Fifteen of them, stacked,
 * drew a grey smear along the bottom edge of every screen (iPad 1180 × 820: 620 px wide; the phone: the whole width). The shadow
 * now belongs only to an open sheet; it fades in with the slide. */
.sheet { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease; }
.sheet:not(.open) { box-shadow: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 {
  font-family: var(--f-display); font-weight: 700; font-size: 22px;
  letter-spacing: -0.01em; margin: 4px 0 4px; text-wrap: balance;
}
.sheet .lead { color: var(--ink-soft); margin: 0 0 18px; line-height: 1.45; }
.sheet h3 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-faint); margin: 20px 0 8px;
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.close { margin: -4px -10px 0 0; }

.menu-list { display: grid; gap: 2px; margin-top: 8px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 14px 4px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent;
  text-align: left; font-size: 17px; cursor: pointer;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item small { color: var(--ink-faint); font-size: 13px; }
.menu-item:disabled { color: var(--ink-faint); cursor: default; }
.menu-item .chev { color: var(--ink-faint); }

/*
 * THE MENU OUTGREW THE SHEET (0.1.33).
 *
 * Ten items now, one added at a time since 0.1.16, and nobody measured the total. On a 375×667
 * phone the list asks for 720 px and the sheet has 643: the last two — «Встановити на iPhone»
 * and «Перевірити оновлення» — sat below the fold. The sheet does scroll, so they were reachable,
 * but nothing said so, and inside a bottom sheet on iOS a drag is just as likely to be read as
 * "close me". The item a player needs to move to a new build was the one that fell off.
 *
 * Two changes, both narrow:
 *   · the LIST scrolls, not the sheet — the title and the close button stay put, the scroll has
 *     its own momentum, and it no longer competes with the sheet's dismiss gesture;
 *   · on a short screen the rows get tighter, so on the phones the app is actually built for the
 *     list needs no scrolling at all. Measured: 720 → 618 px on 375×667, against 643 available.
 */
#sheet-menu { display: flex; flex-direction: column; }
#sheet-menu .menu-list {
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  min-height: 0;
}
@media (max-height: 740px) {
  #sheet-menu .lead { margin-bottom: 8px; }
  #sheet-menu .menu-item { padding: 10px 4px; font-size: 16px; }
}

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper-deep);
}
.seg button {
  border: 0; background: transparent; border-radius: 10px;
  padding: 10px 6px; font-size: 14px; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; min-height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg .sw { width: 11px; height: 11px; border-radius: 50%; }
.sw.blue { background: var(--blue); }
.sw.red { background: var(--red); }

.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.level {
  display: grid; justify-items: center; gap: 6px;
  padding: 10px 2px 9px;
  border: 1px solid var(--line); border-radius: 12px;
  background: transparent; cursor: pointer;
}
.level .stars { display: flex; gap: 2px; height: 10px; align-items: center; }
.level .stars i { display: block; width: 9px; height: 9px; color: var(--ink-faint); opacity: 0.45; }
.level .stars i.on { color: var(--ink); opacity: 1; }
.level .stars svg { display: block; width: 100%; height: 100%; fill: currentColor; }
/* 0.2.31 (K1): a team's strength in stars (js/championship/ui.js starsHtml) — half stars; golden for «Професійний» */
.team-stars { display: inline-flex; gap: 1px; align-items: center; vertical-align: -1px; }
.team-stars i { position: relative; display: block; width: 11px; height: 11px; color: var(--ink-faint); opacity: 0.4; }
.team-stars i.on, .team-stars i.half { opacity: 1; }
.team-stars i.on { color: var(--ink); }
.team-stars i.half { color: color-mix(in srgb, var(--ink-faint) 40%, transparent); }
.team-stars i.half b { position: absolute; inset: 0; color: var(--ink); clip-path: inset(0 50% 0 0); }
.team-stars svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.team-stars.gold i.on, .team-stars.gold i.half b { color: #c9961a; }
.big-stars { margin: 6px 0 4px; }
.big-stars .team-stars i { width: 26px; height: 26px; }
.big-stars .team-stars { gap: 3px; }
.level .num { font-family: var(--f-display); font-weight: 700; font-size: 18px; line-height: 1; }
.level .lname { font-size: 10.5px; color: var(--ink-soft); letter-spacing: 0.01em; }
.level .lrating { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.level[aria-pressed="true"] .lrating { color: var(--ink); }
.level[aria-pressed="true"] { border-color: var(--ink); background: var(--paper-deep); }
.level-note { font-size: 13px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.45; }
/* 0.2.22 (М5): eight levels in two rows of four; 6–8 golden (the network, «бета» until the shop); a level this device cannot
   carry is dimmed but still opens its note, which says why */
.levels.eight { grid-template-columns: repeat(4, 1fr); }
.level { --lv-gold: #c9961a; }
.level.gold .stars i { width: 10px; height: 10px; }
.level.gold .stars i.on { color: var(--lv-gold); }
.level.gold .num { color: var(--lv-gold); }
.level.gold[aria-pressed="true"] { border-color: var(--lv-gold); }
.level.off { opacity: 0.45; }

.primary {
  width: 100%; margin-top: 24px; height: 52px;
  border: 0; border-radius: 14px;
  background: var(--ink); color: var(--paper);
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.secondary {
  width: 100%; margin-top: 10px; height: 48px;
  border: 1px solid var(--line); border-radius: 14px;
  background: transparent; color: var(--ink);
  font-size: 15px; font-weight: 500; cursor: pointer;
}

/* an action that throws something away: outlined, never filled — it must not read as the thing
 * you press by default (0.1.25) */
.secondary.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 34%, transparent); }
.secondary.danger:active { background: color-mix(in srgb, var(--red) 8%, transparent); }
.secondary:disabled { opacity: 0.4; cursor: default; }

/* 0.1.83: the old address says where the game went — only in the build deployed to Netlify */
/* a fourth row in the home grid (bar · banner · hero · modes); the hero gives up its height first */
#home.moved-on { grid-template-rows: auto auto minmax(0, 1fr) auto; }
#home.moved-on .hero { overflow: hidden; }
#home.moved-on .mark, #home.moved-on .hero .glow { display: none; }   /* the banner takes the mark's place */
/* 0.1.83b: on a short window the banner takes the title's place too — a half-clipped «Крапки» under it said nothing */
@media (max-height: 760px) {
  #home.moved-on { grid-template-rows: auto auto minmax(min-content, 1fr); overflow-y: auto; }
  #home.moved-on .hero { display: none; }
  #home.moved-on .modes { align-self: end; }
}
.moved {
  margin: 4px 16px 8px; padding: 14px 16px; border-radius: 16px;
  background: var(--sheet); border: 1px solid var(--line); color: var(--ink);
  font-size: 14px; line-height: 1.4;
}
.moved strong { display: block; font-size: 16px; margin-bottom: 6px; }
.moved p { margin: 0 0 6px; color: var(--ink-soft); }
.moved .moved-note { font-size: 13px; margin: 10px 0 4px; }
.moved .moved-steps { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.moved .moved-steps li { margin: 2px 0; }
.moved-actions { display: flex; gap: 10px; margin-top: 4px; }
.moved-actions .primary, .moved-actions .secondary {
  flex: 1; margin: 0; height: 44px; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
}

.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row label { display: grid; gap: 3px; }
.row label small { color: var(--ink-faint); font-size: 13px; line-height: 1.35; }
.row .seg { min-width: 210px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--grid-edge); transition: background 0.2s; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.switch input:checked + span { background: #34a853; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 420px) { .row { flex-wrap: wrap; } .row .seg { min-width: 0; width: 100%; } }

.rules { line-height: 1.55; color: var(--ink); max-width: 62ch; }
.rules p { margin: 0 0 10px; }
.rules ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.rules b { font-weight: 600; }
.rules .coord { font-family: var(--f-mono); font-size: 13px; background: var(--paper-deep); padding: 1px 5px; border-radius: 5px; }

.result { text-align: center; padding: 8px 0 0; }
.result .big {
  font-family: var(--f-display); font-weight: 700;
  font-size: 56px; letter-spacing: -0.03em; line-height: 1; margin: 12px 0 6px;
  font-variant-numeric: tabular-nums;
}
.result .big .b { color: var(--blue); }
.result .big .r { color: var(--red); }
.result .big .c { color: var(--ink-faint); padding: 0 6px; }
.result h2 { font-size: 24px; }
.result p { color: var(--ink-soft); margin: 6px auto 0; max-width: 40ch; line-height: 1.45; }
/* 0.2.27 (задача 11, Р-548): online result — why the game ended and where the rematch stands, readable without searching */
#sheet-over.online-over #over-reason { font-size: 16px; color: var(--ink); }
#sheet-over.online-over #over-rating { font-size: 16px; color: var(--ink); font-weight: 600; margin-top: 10px; }

.hint { font-size: 13px; color: var(--ink-soft); line-height: 1.45; margin: 14px 0 0; }
/* 0.2.44a (A4, рішення Слави 02.11): «Купити набори можна в застосунку…» in the web — ordinary size, a blue edge, a phone glyph:
   the limit is seen at once, not found in a grey footnote */
.web-buy { font-size: 15px; line-height: 1.45; color: var(--ink); margin: 12px 0 0; padding: 10px 12px 10px 40px; position: relative;
  border-left: 3px solid var(--blue); border-radius: 8px; background: color-mix(in srgb, var(--blue) 8%, transparent); }
.web-buy::before { content: ""; position: absolute; left: 13px; top: 12px; width: 13px; height: 19px; box-sizing: border-box;
  border: 2px solid var(--blue); border-radius: 3px; }
.web-buy::after { content: ""; position: absolute; left: 17px; top: 26px; width: 5px; height: 2px; border-radius: 1px; background: var(--blue); }
.badge { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (max-width: 440px) {
  .levels { gap: 4px; }
  .level { padding: 9px 1px 8px; }
  .level .lname { font-size: 9.5px; letter-spacing: 0; }
}

/* ------------------------------------------------------------ championship (0.1.16) */
/* Two tokens the rest of the sheet never needed: a surface for pickable cards and a wash for the
   row that is yours. Derived from the existing palette so both themes follow automatically. */
:root { --card: var(--sheet); --press: rgba(125, 140, 160, 0.10); }
/* 0.1.22: the sheet the board is drawn on. The notebook skin keeps the page and the field the same
   colour, because there the whole screen IS the page; Air lifts the board out of the tinted field,
   which is what puts it inside its frame rather than behind it. */
:root { --board-bg: var(--paper); }
:root[data-skin="air"] { --board-bg: var(--sheet); }
/* 0.1.20: the same fix as the palette above — `:not([data-theme="light"])` alone matches the
   default page, so it belongs inside the media query. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --press: rgba(160, 175, 195, 0.12); } }
:root[data-theme="dark"] { --press: rgba(160, 175, 195, 0.12); }
.sheet.tall { max-height: 88vh; }

/*
 * A PANE IS A PLACE (0.1.55).
 *
 * A sheet is right for what you glance at and dismiss: a confirmation, a picker, the settings. The
 * championship is not that — five tabs, long tables, its own navigation, minutes at a time. So it
 * stops being a card lying on the home screen and becomes a screen: full height, square top, no
 * grabber, and its title row pinned above the content instead of scrolling away with it.
 *
 * `top: 0` with `height: 100%` rather than a `max-height`: a pane that stopped short of the top
 * edge would still show a strip of whatever is behind it, which is the very thing that makes a
 * sheet read as temporary.
 */
.sheet.pane {
  /* `top` and `bottom` rather than a height: `height: 100%` resolves against the containing block,
     and a transformed ancestor quietly made that 750 px of an 852 px screen — the home screen was
     seen through the last eighty pixels of the window. Two anchors cannot be argued with. */
  top: 0; bottom: 0; height: auto; max-height: none;
  border-radius: 0;
  padding-top: 0;
}
.sheet.pane .grabber { display: none; }
/*
 * The title row and the tabs are ONE pinned block, so the way out of the screen is always under
 * the thumb. Pinning them separately would need the height of the first as the offset of the
 * second — a number that changes with the notch — so they are pinned together instead.
 */
.pane-top {
  position: sticky; top: 0; z-index: 4;
  background: var(--sheet);
  padding-top: calc(var(--safe-t) + 12px);
  /* 0.1.82 (iPhone, Слава 02.10): the block is as wide as the SCREEN, not as the sheet's content.
   * It used to stop at the sheet's 20 px side padding, and the list scrolling underneath showed
   * through the two gutters beside the title — grey strips left and right of «Grupy» and the ×.
   * The tabs inside keep their own −20 px reach, which now ends exactly at the screen's edges. */
  margin-left: calc(-1 * (var(--safe-l) + 20px));
  margin-right: calc(-1 * (var(--safe-r) + 20px));
  padding-left: calc(var(--safe-l) + 20px);
  padding-right: calc(var(--safe-r) + 20px);
}
.head-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- the championship's own navigation (0.1.24) ----------
 * Five destinations, at the top, pinned while the body scrolls. The sheet is the scroll
 * container, so `sticky` here sticks to the sheet's top edge and the title scrolls away above it.
 */
/* the sheet's own top padding would leave a transparent strip above a `top: 0` sticky row, and
 * the list would be seen scrolling through it — so this one sheet pads from the grabber instead */
/* inside `.pane-top` the tabs travel with the title; the sticky here still serves the paper
   sheet, where the title scrolls away and the tabs alone stay */
.ch-tabs {
  position: sticky; top: 0; z-index: 3;
  display: flex; gap: 1px;
  margin: 4px calc(-1 * (var(--safe-r) + 20px)) 10px calc(-1 * (var(--safe-l) + 20px));
  padding: 6px calc(var(--safe-r) + 14px) 6px calc(var(--safe-l) + 14px);
  background: var(--sheet);
  box-shadow: 0 1px 0 var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.ch-tabs::-webkit-scrollbar { display: none; }
.ch-tabs button {
  flex: 1 1 auto; min-height: 34px; padding: 0 8px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
}
.ch-tabs button[aria-selected="true"] {
  background: var(--resume-bg); color: var(--ink); font-weight: 600;
}
.ch-tabs button:active { opacity: 0.7; }

/* team picker */

/* fixtures and ties */

/* the away side reads right-to-left: name, then flag, so the two flags frame the score */

/* 0.1.23: a row is a way into the match it names — every one of the 104, the simulated ones
 * included. It has to look like something you can press. */

/* ---------- the knockout as a tree (0.1.25) ----------
 * Five columns, left to right, to the final. The alignment is not hand-tuned: every column is the
 * same height and every tie takes an equal share of it, so a column of eight sits exactly at the
 * midpoints of a column of sixteen. The connectors are half-height borders on alternate slots,
 * which meet in the middle for the same reason.
 */
/*
 * 0.1.50: THE TREE SCROLLS SIDEWAYS ONLY.
 *
 * It used to scroll both ways inside a `max-height`, and the play-test found what that costs:
 * measured on a 393×852 screen, the tree's own box took 597 of the sheet's 750 px, so four fifths
 * of the screen belonged to the INNER scroller. The third-place match sits under the tree, one
 * pixel below the window edge (top 838 of 852), and the 72 px of sheet scroll that would bring it
 * up could only be started from the 26 px strip below the tree. That is why it appeared once and
 * could not be made to appear again — «я так і не зрозумів що я зробив».
 *
 * A bracket is wide, not tall: the horizontal axis is the one it needs. Give the vertical axis
 * back to the sheet and there is ONE vertical scroller on the screen, so a drag anywhere reaches
 * the bottom of the page. `overflow-y: hidden` clips nothing here because the height is no longer
 * capped — the box is exactly as tall as the tree.
 */

/* the stub out of every tie towards its pair's line */

/* half a vertical line each: odd slots downwards, even slots upwards — together, one bracket */

/* and the stub into the tie the pair feeds */

/* progress */

/* a back row at the TOP of a screen you drilled into — reached without scrolling past the
 * screen's whole content, which is the point of it (0.1.24, used by the group screen in 0.1.26) */

/*
 * 0.1.39: THE BACK ROW HAD TO BE FOUND BEFORE IT COULD BE PRESSED. It was a `secondary` button —
 * the same quiet grey as «Очистити журнал» — on a screen a person reaches by drilling in and
 * leaves immediately. The play-test called it «дуже непомітна», which is the right word for a
 * control that is the whole reason the screen has a top.
 *
 * It keeps its size (it must not compete with the content) and gains the one thing it lacked:
 * contrast, and a chevron that says which way it goes.
 */

/* a group heading that is a door (0.1.26) */
.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin: 20px 0 8px; padding: 0;
  border: 0; background: transparent; color: var(--ink-faint);
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; text-align: left; cursor: pointer;
}
.group-head .chev { font-style: normal; font-size: 18px; letter-spacing: 0; opacity: 0.6; }
.group-head:active { opacity: 0.6; }

/* form chip in a group table (0.1.18) */

/*
 * 0.1.38: the summary door on a bracket card. A corner mark rather than a chip — the card is
 * 100-odd pixels wide and a word does not fit — with a hit area grown by a pseudo-element, the
 * same trick the form mark uses, so the tree's geometry is untouched.
 */

/* ------------------------------------------------------------ the scouting report (0.1.38) */

/* the one number the screen exists for: what this opponent will actually play at */

/* the steps of the number, between the box and the table — with room, or the table's own top
 * border draws straight through the second line of it */

/* the last few results, as a strip of letters rather than a sentence */

/* a slot in the bracket or the calendar that has no team in it yet */
.tbd { font-style: normal; color: var(--ink-faint); opacity: .7; }

/* ============================================================ home screen (0.1.20)
 *
 * THE DESIGN CONTRACT.
 * ------------------------------------------------------------
 * The visual design for this screen comes from a prototype (Dots_Air_Prototype_v5), and more
 * prototypes will follow — one per screen. So the point of this block is not "the home screen's
 * CSS": it is a NAMED SET OF ROLES that every future prototype can be mapped onto mechanically,
 * instead of each new screen arriving with its own hex codes and quietly making the app into five
 * apps. A prototype's token → the role it fills here:
 *
 *   --bg          → --paper          the screen behind everything
 *   --bg-deep     → --paper-deep     the shade under the screen (rails, segmented track)
 *   --panel       → --panel          a translucent raised surface (the brand mark, the toast)
 *   --panel-solid → --sheet          an opaque raised surface (sheets, cards)
 *   --control     → --control        a translucent surface a finger presses (mode buttons)
 *   --text        → --ink
 *   --muted       → --ink-soft
 *   --faint       → --faint          hairline text and inactive marks
 *   --line        → --line
 *   --blue/--red  → --blue/--red     the two players; never decoration, always a side
 *   --shadow-*    → the three-step elevation scale below
 *   --r-*         → the three-step radius scale below
 *
 * WHICH PALETTE. The prototype is Apple-system grey-and-#1769ff; this app is notebook paper,
 * ballpoint blue and red pen, and the game screen — which 0.1.20 does not touch — is built on it.
 * A home screen in the prototype's palette would have made the first tap a change of app. So the
 * home screen takes the prototype's STRUCTURE, MOTION and COMPONENT PATTERNS, and wears the
 * game's own colours and typefaces.
 * The prototype's palette is kept, whole, as `data-skin="air"` — one attribute on <html>, a switch
 * in Settings. It is there so the choice can be made by eye on a real screen rather than argued
 * about in a report, and because it costs one block of variables to keep.
 */
:root {
  --panel: rgba(251, 252, 250, 0.82);
  --control: rgba(251, 252, 250, 0.76);
  --faint: var(--ink-faint);
  /*
   * A CARD FOR SOMETHING ALREADY UNDER WAY (0.1.20; re-coloured in 0.1.23).
   * 0.1.20 filled it with `--ink`: a black slab, which did the job of catching the eye and was
   * heavier than anything else on a screen whose whole point is calm. 0.1.23 makes it a raised
   * grey — still clearly filled rather than outlined, still the first thing the eye lands on,
   * but a shade of the page instead of its opposite. The text stays `--ink`, so contrast is the
   * page's own and does not have to be re-checked per skin.
   */
  --resume-bg: #dfe3e8;
  --resume-tag: rgba(31, 40, 51, 0.10);
  --shadow-1: 0 1px 3px rgba(31, 40, 51, 0.08);
  --shadow-2: 0 8px 22px rgba(31, 40, 51, 0.07), inset 0 0 0 1px var(--line);
  --shadow-3: 0 18px 48px rgba(31, 40, 51, 0.12);
  --r-1: 12px;
  --r-2: 18px;
  --r-3: 26px;
  /* 0.1.58 · чемпіонат (Д-01, Р-60): у зошиті сім токенів — посилання на наявні, тож зошит лишається
     зошитом. Air дає власні значення нижче. */
  --ch-clear: transparent; --ch-tint: var(--paper); --ch-glass: var(--sheet); --ch-edge: var(--line);
  --ch-selected: var(--resume-bg); --ch-action: var(--ink); --ch-shadow: var(--shadow-2);
}
/* The dark values go in twice, exactly as the palette above does it: once behind the media query
 * for "the system is dark and the player has not overridden it", and once for the explicit
 * choice. `:root:not([data-theme="light"])` on its own matches a page with no attribute at all —
 * which is the default — so outside the media query it would make every screen dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --panel: rgba(26, 32, 40, 0.84);
    --control: rgba(26, 32, 40, 0.78);
    --resume-bg: #38465a;
    --resume-tag: rgba(255, 255, 255, 0.16);
    --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 0 0 1px var(--line);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.45);
    --ch-clear: transparent; --ch-tint: var(--paper); --ch-glass: var(--sheet); --ch-edge: var(--line);
    --ch-selected: var(--resume-bg); --ch-action: var(--ink); --ch-shadow: var(--shadow-2);
  }
}
:root[data-theme="dark"] {
  --panel: rgba(26, 32, 40, 0.84);
  --control: rgba(26, 32, 40, 0.78);
  --resume-bg: #38465a;
  --resume-tag: rgba(255, 255, 255, 0.16);
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 0 0 1px var(--line);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.45);
  --ch-clear: transparent; --ch-tint: var(--paper); --ch-glass: var(--sheet); --ch-edge: var(--line);
  --ch-selected: var(--resume-bg); --ch-action: var(--ink); --ch-shadow: var(--shadow-2);
}
/* the prototype's own palette, kept whole so it can be compared on a real screen */
:root[data-skin="air"] {
  --paper: #f5f5f7; --paper-deep: #e9ebef; --sheet: #ffffff;
  --ink: #1d1d1f; --ink-soft: #6e6e73; --ink-faint: #98989d;
  --line: rgba(29, 29, 31, 0.10);
  --blue: #1769ff; --red: #ff453a; --ok: #23a45e;
  /* 0.1.28: the notebook's red margin rule belongs to the notebook. In Air the board sits in a
     glass frame on a white sheet, and the rule read as a stray red stripe down the right of the
     screen — reported from the play-test on the "Усе поле" scale, where it is most visible. */
  --margin: transparent;
  --panel: rgba(255, 255, 255, 0.84); --control: rgba(255, 255, 255, 0.80);
  --resume-bg: #e3e4e9; --resume-tag: rgba(29, 29, 31, 0.10);
  --scrim: rgba(20, 20, 24, 0.30);
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --f-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  /* 0.1.58 · чемпіонат (Д-01): значення макета, світла тема */
  --ch-clear: transparent; --ch-tint: #eef2f8; --ch-glass: rgba(255, 255, 255, 0.86);
  --ch-edge: rgba(255, 255, 255, 0.95); --ch-selected: #e7ecf3; --ch-action: #20252d;
  --ch-shadow: 0 9px 24px rgba(47, 66, 99, 0.065), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
@media (prefers-color-scheme: dark) {
  :root[data-skin="air"]:not([data-theme="light"]) {
    --paper: #000000; --paper-deep: #101114; --sheet: #1c1c1e;
    --ink: #f5f5f7; --ink-soft: #a1a1a6; --ink-faint: #737378;
    --line: rgba(255, 255, 255, 0.12);
    --blue: #5d8cff; --red: #ff6961; --ok: #4fd18b;
    --margin: transparent;
    --panel: rgba(28, 28, 30, 0.86); --control: rgba(28, 28, 30, 0.82);
    --resume-bg: #3a3a3c; --resume-tag: rgba(255, 255, 255, 0.18);
    --scrim: rgba(0, 0, 0, 0.58);
    --ch-clear: transparent; --ch-tint: #171a21; --ch-glass: rgba(45, 47, 54, 0.92);
    --ch-edge: rgba(255, 255, 255, 0.14); --ch-selected: #323742; --ch-action: #dbe2ed;
    --ch-shadow: 0 9px 24px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }
}
:root[data-skin="air"][data-theme="dark"] {
  --paper: #000000; --paper-deep: #101114; --sheet: #1c1c1e;
  --ink: #f5f5f7; --ink-soft: #a1a1a6; --ink-faint: #737378;
  --line: rgba(255, 255, 255, 0.12);
  --blue: #5d8cff; --red: #ff6961; --ok: #4fd18b;
  --margin: transparent;
  --panel: rgba(28, 28, 30, 0.86); --control: rgba(28, 28, 30, 0.82);
  --resume-bg: #3a3a3c; --resume-tag: rgba(255, 255, 255, 0.18);
  --scrim: rgba(0, 0, 0, 0.58);
  --ch-clear: transparent; --ch-tint: #171a21; --ch-glass: rgba(45, 47, 54, 0.92);
  --ch-edge: rgba(255, 255, 255, 0.14); --ch-selected: #323742; --ch-action: #dbe2ed;
  --ch-shadow: 0 9px 24px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ---------- screens ----------
 * Two screens now share the window: the home screen and the game. Both are absolutely positioned
 * and cross-fade, so the board keeps its size across the transition and does not re-layout. */
.screen {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transform: translateY(14px) scale(0.988);
  transition: opacity 0.30s cubic-bezier(0.2, 0.75, 0.25, 1), transform 0.40s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.screen.on { opacity: 1; pointer-events: auto; transform: none; }
.screen.leaving { opacity: 0; transform: scale(0.972); }

#home {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  overflow: hidden;
}

.home-bar {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: calc(var(--safe-t) + 6px) calc(var(--safe-r) + 10px) 0 calc(var(--safe-l) + 10px);
}
.home-bar .icon-btn { grid-column: 3; }
.hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 0;
  padding: 0 24px clamp(14px, 3.5vh, 32px);
  text-align: center;
}
/* the wash behind the mark: the blue of the game, at 12%, once */
.hero .glow {
  position: absolute; top: 46%; left: 50%;
  width: min(86vw, 380px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 12%, transparent), transparent 68%);
  filter: blur(10px);
  opacity: 0; pointer-events: none;
  animation: glow-in 0.9s 0.2s ease forwards;
}

/* THE MARK. Five by five nodes with the four dots of the starting cross in place — the position
 * every game begins from, which makes the logo the rules rather than a decoration. */
.mark {
  position: relative;
  display: grid; place-items: center;
  width: clamp(104px, 29vw, 124px); aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 31%;
  background: var(--panel);
  box-shadow: var(--shadow-3), inset 0 1px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  opacity: 0; transform: translateY(10px) scale(0.93);
  animation: mark-in 0.7s 0.09s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.mark .grid5 {
  display: grid;
  grid-template-columns: repeat(5, 7px); grid-template-rows: repeat(5, 7px);
  gap: clamp(6px, 1.9vw, 8px); place-content: center;
}
.mark i {
  width: 7px; height: 7px; border-radius: 50%;
  background: color-mix(in srgb, var(--faint) 52%, transparent);
  opacity: 0; transform: scale(0.15);
  animation: dot-in 0.34s cubic-bezier(0.2, 0.9, 0.25, 1.25) forwards;
}
/* the corners first, then inwards — the same ripple the prototype used */
.mark i:nth-child(1), .mark i:nth-child(5), .mark i:nth-child(21), .mark i:nth-child(25) { animation-delay: 0.21s; }
.mark i:nth-child(2), .mark i:nth-child(4), .mark i:nth-child(6), .mark i:nth-child(10),
.mark i:nth-child(16), .mark i:nth-child(20), .mark i:nth-child(22), .mark i:nth-child(24) { animation-delay: 0.28s; }
.mark i:nth-child(3), .mark i:nth-child(7), .mark i:nth-child(9), .mark i:nth-child(11),
.mark i:nth-child(15), .mark i:nth-child(17), .mark i:nth-child(19), .mark i:nth-child(23) { animation-delay: 0.35s; }
.mark i:nth-child(8), .mark i:nth-child(12), .mark i:nth-child(14), .mark i:nth-child(18) { animation-delay: 0.43s; }
.mark i:nth-child(13) { animation-delay: 0.51s; }
.mark i.b { background: var(--blue); }
.mark i.r { background: var(--red); }

.brand { position: relative; opacity: 0; transform: translateY(12px); animation: copy-in 0.6s 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.brand h1 {
  font-family: var(--f-display); font-weight: 700;
  margin: clamp(20px, 3.6vh, 32px) 0 8px;
  font-size: clamp(38px, 12vw, 52px); line-height: 0.95; letter-spacing: -0.045em;
}
.brand p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }
/* 0.2.44 (N1 = C): the game's name in the player's language under «Krapky» — bold, the tagline's size and colour */
.brand p.brand-sub { font-weight: 700; letter-spacing: 0.02em; margin: -2px 0 4px; }

/* ---------- the mode list ---------- */
.modes {
  display: grid; gap: 8px;
  padding: 0 calc(var(--safe-r) + 20px) calc(var(--safe-b) + 18px) calc(var(--safe-l) + 20px);
  opacity: 0; transform: translateY(16px);
  animation: modes-in 0.65s 0.78s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.mode {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 64px;
  padding: 11px 14px 11px 18px;
  border: 0; border-radius: var(--r-2);
  color: var(--ink); background: var(--control);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  text-align: left; cursor: pointer;
  transition: transform 0.13s ease, opacity 0.13s ease;
}
.mode:active { transform: scale(0.975); opacity: 0.8; }
/* A GAME IN PROGRESS IS THE ONE THING ON THIS SCREEN THAT IS NOT AN OFFER. It is filled, not
 * outlined, so the eye lands on it before it reads anything — a raised grey from 0.1.23, where it
 * was a black slab before; see --resume-bg. */
.mode.resume {
  color: var(--ink); background: var(--resume-bg);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ink) 9%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.mode .copy { display: grid; gap: 4px; flex: 1; min-width: 0; }
.mode .copy strong { font-size: 16px; line-height: 1.15; font-weight: 600; }
/* 0.1.86 (П1): «бета» beside «Грати з другом» — a quiet label, not a button */
.mode .copy strong .beta { display: inline-block; vertical-align: 2px; margin-left: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; line-height: 1.3; }
.mode .copy small { font-size: 12px; line-height: 1.25; opacity: 0.66; }
.mode .chev { flex: none; padding: 0 3px; font-size: 26px; line-height: 1; font-weight: 300; opacity: 0.42; }
.mode .tag {
  flex: none; padding: 5px 8px; border-radius: 999px;
  font-size: 10.5px; line-height: 1; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-soft); background: color-mix(in srgb, var(--faint) 14%, transparent);
}
.mode.resume .tag { color: var(--ink); background: var(--resume-tag); }
/* the second action on a card that resumes something: the tables, when the card itself resumes
 * the match. Small, quiet, and never the thing a thumb hits by accident. */
.mode .mini {
  flex: none; min-height: 30px; padding: 6px 11px;
  border: 0; border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--ink); background: var(--resume-tag); cursor: pointer;
}
.mode .mini:active { opacity: 0.7; }
.mode.soon { background: color-mix(in srgb, var(--control) 62%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); }
.mode.soon .copy { opacity: 0.6; }
.modes-head { margin: 8px 0 2px; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink); }
.text-btn {
  justify-self: center; min-height: 38px; padding: 8px 14px;
  border: 0; border-radius: var(--r-1); background: transparent;
  color: var(--ink-soft); font-size: 14px; font-weight: 500; cursor: pointer;
}
.text-btn:active { opacity: 0.6; }

@keyframes mark-in { to { opacity: 1; transform: none; } }
@keyframes dot-in { to { opacity: 1; transform: scale(1); } }
@keyframes copy-in { to { opacity: 1; transform: none; } }
@keyframes modes-in { to { opacity: 1; transform: none; } }
@keyframes glow-in { to { opacity: 0.9; } }

/* the switch in Settings: one class, and nothing on the screen animates in */
.still .mark, .still .brand, .still .modes, .still .glow, .still .mark i { animation: none !important; opacity: 1 !important; transform: none !important; }
.still .screen { transition: none !important; }

@media (max-height: 700px) {
  .mark { width: 92px; }
  .hero { padding-bottom: 10px; }
  .brand h1 { margin-top: 16px; font-size: 36px; }
  .brand p { font-size: 13.5px; }
  .modes { gap: 6px; padding-bottom: calc(var(--safe-b) + 10px); }
  .mode { min-height: 56px; padding-block: 8px; }
  .mode .copy { gap: 2px; }
  .mode .copy strong { font-size: 15px; }
  .mode .copy small { font-size: 11px; line-height: 1.15; }
  .text-btn { min-height: 34px; padding-block: 6px; }
}

/* A phone-shaped window on a tablet or a desktop: the layout is designed for one hand, and
 * stretched across 1400 px it stops being a design. */
/* ============================================================ BIGGER SCREENS (0.1.25)
 *
 * 0.1.20 gave anything wider than 620px a fixed 440×920 phone-shaped window in the middle of the
 * screen. On a desktop that was a reasonable way to preview a phone app. On an iPad it was the
 * wrong answer twice over: the game ignored most of the glass, and it ignored the rotation — the
 * same little rectangle held upright and on its side.
 *
 * The rule now is the one that should have been there from the start: the app fills the screen it
 * is on, whatever that screen is, and it re-lays itself out when the screen changes shape.
 *   · portrait, any size → the phone layout, with everything given more room
 *   · landscape and wide → the dock moves BESIDE the board instead of under it, because a board
 *     that is short and wide is the one thing this game cannot use. The board keeps the height.
 * The canvas follows automatically: a ResizeObserver on the frame already drives resize(), and
 * 0.1.25 makes that call re-fit the view when the frame's shape changes rather than only its size.
 */
@media (min-width: 700px) {
  .sheet { max-width: 620px; border-radius: var(--r-3) var(--r-3) 0 0; }
  /* the home screen keeps a readable column instead of stretching its cards to a metre wide */
  .modes { max-width: 560px; margin-inline: auto; width: 100%; }
  .modes-head, .text-btn { justify-self: center; }
  /* 0.1.83b: sized by the HEIGHT too. A wide but short window (a laptop at 150% scaling: 1280 × 574 CSS px,
   * Slava's Chrome 03.10) took the desktop sizes from this block — it comes after the max-height: 700px one and
   * wins — and the 86 px title pushed the tagline under the first card. min(…vw, …vh) leaves tall windows as
   * they were (the vw term is the smaller there) and shrinks the hero only where the height is short. */
  .brand h1 { font-size: clamp(36px, min(7vw, 9.5vh), 86px); }
  .mark { width: clamp(84px, min(15vw, 18vh), 168px); }
  .board-stage { padding: 4px clamp(10px, 3vw, 40px) 8px; }
  .score-pill { min-width: 240px; height: 54px; }
  .match-caption { font-size: 12.5px; }
}
/* 0.1.83b: wide and very short (a laptop window at 150%, a championship card on the home screen) — the hero gives up
 * the most: a smaller mark, a smaller title, less air between them */
@media (min-width: 700px) and (max-height: 620px) {
  .mark { width: 80px; }
  .brand h1 { margin-top: 10px; font-size: 42px; }
}
/* 0.1.86 (П1, задача 5 — поворот): an iPhone on its side is 852 × 393 (667 × 375 for an SE). Four cards and the links
 * take ~350 px of that, and the mark and the 36 px title drew UNDER the first card (Chromium, 852 × 393). Below 480 px
 * of height the hero keeps only the name, small; the mark, the wash and the tagline step aside. */
@media (max-height: 480px) {
  .hero .mark, .hero .glow, #home-tagline, .brand-sub { display: none; }
  .hero { padding-bottom: 4px; }
  .brand h1 { margin-top: 0; font-size: 22px; }
  .modes { gap: 5px; padding-bottom: calc(var(--safe-b) + 6px); }
  .mode { min-height: 50px; padding-block: 6px; }
  .text-btn { min-height: 30px; padding-block: 4px; }
}

/* 0.2.29 (P4 + home-fit): THE HERO MEASURES ITS OWN HEIGHT, not the window's. «Навчитися грати» added a card above the others,
 * and with a championship card too the cards took the room the window-height rules above had counted on: on 1280 × 720 … 1440 × 800
 * the mark slid under the top bar, on 320 × 568 the first card covered the tagline (that one already on 0.2.28b, never measured
 * at 320). The hero is the grid's 1fr row, so its height is exactly what the cards leave; it gives up the mark, then the tagline,
 * then size — by what is left, however many cards there are. */
#home .hero { container-type: size; container-name: hero; }
@container hero (max-height: 300px) {
  .hero .mark { width: 80px; }
  .hero .brand h1 { margin-top: 10px; font-size: 36px; }
}
@container hero (max-height: 220px) {
  .hero .mark, .hero .glow { display: none; }
  .hero .brand h1 { margin-top: 0; }
}
@container hero (max-height: 120px) {
  .hero #home-tagline, .hero .brand-sub { display: none; }
  .hero .brand h1 { font-size: 28px; }
}
@container hero (max-height: 70px) {
  .hero .brand h1 { font-size: 22px; }
}

/* A DESKTOP WINDOW is not a tablet: keep the reading column, but do not stretch the home screen
 * across an ultrawide monitor. The board is still free to use everything. */
@media (min-width: 1500px) {
  .modes { max-width: 620px; }
}
/* 0.2.30a (перевірка Слави L4, Chrome на комп'ютері: «вікно з'являється внизу екрана і повністю його не видно … складається
 * враження обрізаного повідомлення»). On a phone a sheet grows out of the bottom edge — the edge is the hand's. In a computer's
 * window the same sheet stood on the window's lower border with square bottom corners, and read as a card cut off by the screen.
 * With a mouse (hover + a fine pointer) and room to spare, a sheet FLOATS: lifted off the edge, every corner round. A closed one
 * waits below by its own height plus the lift — 105 % would leave a strip of a short sheet showing. A pane (the championship)
 * is a screen, not a card: untouched. The phone, the iPad without a mouse and short windows: untouched. */
@media (hover: hover) and (pointer: fine) and (min-width: 700px) and (min-height: 560px) {
  .sheet:not(.pane) { bottom: 32px; border-radius: var(--r-3); max-height: calc(100% - 64px); }
  .sheet.tall:not(.pane) { max-height: min(88vh, calc(100% - 64px)); }
  .sheet:not(.pane):not(.open) { transform: translateY(calc(100% + 48px)); }
}
/* 0.2.30b (перевірка Слави L4a: «вся інформація не влізла у вікно і справа з'явилась прокрутка … в Chrome на ПК екран великий,
 * можна все вкласти в одне вікно»). «Грати з другом» is the tallest ordinary sheet: the invitation form, the code and — for an
 * account — the bots. In a wide computer window it takes two columns: make an invitation | take one or play a bot; the bots'
 * list scrolls inside its column, so the sheet itself does not. Only the form (the waiting, joining and choosing states are short
 * and keep the usual width); `onl-wide` is set by onlineRenderSheet. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) and (min-height: 560px) {
  #sheet-online.onl-wide { max-width: 900px; }
  #sheet-online.onl-wide #onl-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; align-items: start; }
  #sheet-online.onl-wide #onl-col-join { display: flex; flex-direction: column; max-height: calc(100vh - 64px - 96px); }
  #sheet-online.onl-wide #onl-col-join > h3:first-child, #sheet-online.onl-wide #onl-col-make > .hint:first-child { margin-top: 0; }
  #sheet-online.onl-wide #onl-col-join > h3:first-child { margin-top: 2px; }
  #sheet-online.onl-wide #onl-bots { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
  #sheet-online.onl-wide #onl-bots[hidden] { display: none; }
  #sheet-online.onl-wide .onl-bot-list { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
}

/* ------------------------------------------------------------ statistics and profile (0.1.21) */
/* Three numbers side by side, big and unlabelled-until-you-look: the shape a person scans before
   deciding whether to read the table under it. */

/* 0.1.26: the calendar is a schedule — matchday headings, and the venue on every row */

/* the calendar reuses .fix, so a match looks the same wherever it is listed */
:is(#ch-filter, [data-gid="ch-filter"]) { margin-bottom: 12px; }
:is(#ch-filter, [data-gid="ch-filter"]) button:disabled { opacity: 0.4; }

/* ============================================================ the game screen (0.1.22)
 *
 * From the Air prototype. What is taken is the SURFACE LANGUAGE — glass panels that float over a
 * tinted field, a score pill instead of a header row, a framed board, a dock whose turn card
 * belongs to whoever is to move. What is NOT taken is the prototype's board: that one is a CSS
 * grid with absolutely positioned dots and two hand-drawn blobs for captures. Ours is a canvas
 * with the engine behind it, zoom, pan, rulers and real territory. The frame is new; what is
 * inside it is untouched.
 *
 * THE GLASS, AND WHY IT NEEDED A TOKEN. The prototype builds every panel out of
 * `color-mix(in srgb, white N%, ...)` — white highlights, white inner borders, white sheen. That
 * is correct for a light theme and wrong for a dark one, where it turns every panel into a grey
 * slab. So the tint is a variable: white in the light theme, and in the dark theme a light that is
 * far weaker and a shadow that is far stronger, which is what glass actually does against a dark
 * background.
 */
:root {
  --glass-tint: #ffffff;
  --glass-edge: 45%;          /* how much tint goes into a panel's border */
  --glass-top: 0.60;          /* the highlight along a panel's top edge */
  --glass-sheen: 0.20;        /* the diagonal sweep across a panel */
  --glass-drop: rgba(22, 27, 36, 0.09);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-tint: #b9c6d8;
    --glass-edge: 12%;
    --glass-top: 0.10;
    --glass-sheen: 0.05;
    --glass-drop: rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --glass-tint: #b9c6d8;
  --glass-edge: 12%;
  --glass-top: 0.10;
  --glass-sheen: 0.05;
  --glass-drop: rgba(0, 0, 0, 0.45);
}

/* one class, every floating panel */
.glass, .score-pill, .turn-card, .board-frame {
  border: 1px solid color-mix(in srgb, var(--glass-tint) var(--glass-edge), var(--line));
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--glass-tint) 26%, transparent), transparent 50%),
    color-mix(in srgb, var(--panel) 74%, transparent);
  box-shadow: 0 10px 28px var(--glass-drop),
    inset 0 1px rgba(255, 255, 255, var(--glass-top)),
    inset 0 -1px color-mix(in srgb, var(--line) 74%, transparent);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}

#app {
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--blue) 5%, transparent), transparent 48%),
    var(--paper);
}

/* ---------- head ---------- */
.game-head {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) 4px calc(var(--safe-l) + 12px);
}
/* the wash behind the pill; in a championship it takes both sides' colours */
.game-head::before {
  content: "";
  position: absolute; z-index: 0; left: 50%; bottom: -3px;
  width: min(76vw, 308px); height: 68px;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--blue) 12%, transparent), transparent 70%);
  filter: blur(17px); opacity: 0.46;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 0.32s ease;
}
#app.is-champ .game-head::before {
  background:
    radial-gradient(circle at 24% 50%, color-mix(in srgb, var(--blue) 25%, transparent), transparent 45%),
    radial-gradient(circle at 76% 50%, color-mix(in srgb, var(--red) 22%, transparent), transparent 45%);
  opacity: 0.72;
}
.game-head > * { position: relative; z-index: 1; }

/*
 * THE CAPTURE BANNER (0.1.39). It covers the score pill for a moment and carries the capturing
 * country's own flag as its background — the same bands the board's backdrop is drawn from, so
 * one reading of a flag serves both. The text sits on a scrim because a flag is not a background
 * anybody designed for words: white on Japan and black on Germany both have to stay readable, and
 * the only thing that is true of every flag is that a dark veil over it is dark.
 */
.capture-flash {
  position: absolute; z-index: 3;
  /* 0.1.39: measured, not eyeballed — a fixed 44px was two pixels shorter than the pill it is
     supposed to cover, so a sliver of the score showed under it. It now spans the header band
     between the two buttons, which covers the pill whatever the pill's own height turns out to be. */
  left: 52px; right: 52px; top: 3px; bottom: 3px;
  min-height: 44px; border-radius: 999px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background-color: var(--cf-side, var(--blue));
  background-size: cover; background-position: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
.capture-flash.plain { background-image: none; }
/* the scrim: drawn over the flag, under the words */
.capture-flash::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.42);
}
.capture-flash > * { position: relative; z-index: 1; color: #fff; }
.cf-who {
  font-family: var(--f-display); font-weight: 600; font-size: 14px;
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.cf-gain {
  font-family: var(--f-display); font-weight: 700; font-size: 16px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.capture-flash.in { animation: cf-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.capture-flash.out { animation: cf-out 0.26s ease-in both; }
@keyframes cf-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cf-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .capture-flash.in, .capture-flash.out { animation: none; opacity: 1; }
}

.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 12px;
  color: var(--ink-soft); cursor: pointer;
  transition: transform 0.13s ease, opacity 0.13s ease;
}
.icon-btn:active { transform: scale(0.95); opacity: 0.75; }
.icon-btn svg { width: 21px; height: 21px; }
/*
 * 0.1.41: «‹» and «×» are two different verbs and must not look alike — back goes one level, close
 * leaves the section. They live in the same corner and only one is ever shown (see `paintChrome`),
 * so the chevron is given the ink weight of a thing you are meant to press on the way through,
 * while × keeps the softer colour of a way out.
 */
.icon-btn.back { color: var(--ink); }
.icon-btn.back svg { width: 23px; height: 23px; }
.icon-btn[hidden] { display: none; }
.game-head .icon-btn { width: 48px; height: 48px; border-radius: 50%; color: var(--ink); }

.score-pill {
  justify-self: center;
  position: relative; isolation: isolate;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 190px; height: 48px;
  padding: 5px 14px;
  border-radius: 18px;
  overflow: hidden;
  transition: min-width 0.26s ease, padding 0.26s ease;
}
.score-pill::after {
  content: "";
  position: absolute; z-index: 0; inset: 0;
  background: linear-gradient(100deg, transparent 15%, rgba(255, 255, 255, var(--glass-sheen)) 44%, transparent 67%);
  pointer-events: none;
}
.score-pill > * { position: relative; z-index: 1; }
/* 0.1.37: the pill names the two teams in COLOUR order, so until the coin lands it would be
 * announcing the draw. `visibility` rather than `display`: the header must not change height
 * underneath the ceremony. */
.score-pill.undecided > * { visibility: hidden; }
/* 0.1.39: on a replay the pill opens the summary, and it says so by behaving like a control */
.score-pill.tappable { cursor: pointer; }
.score-pill.tappable::after {
  content: ''; position: absolute; inset: -4px; border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
  opacity: .8; pointer-events: none;
}
.score-pill.tappable:active { transform: scale(0.985); }
#app.is-champ .score-pill {
  min-width: 254px; padding-inline: 9px;
  background:
    radial-gradient(circle at 11% 125%, color-mix(in srgb, var(--blue) 22%, transparent), transparent 40%),
    radial-gradient(circle at 91% -20%, color-mix(in srgb, var(--red) 19%, transparent), transparent 42%),
    linear-gradient(145deg, color-mix(in srgb, var(--glass-tint) 30%, transparent), transparent 50%),
    color-mix(in srgb, var(--panel) 72%, transparent);
}

.score-side { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* 0.1.25: `--side-1` / `--side-2` are the two SIDES' colours. They are the game's blue and red
 * by default, and a championship match in team colours overwrites them on #app — so every place
 * that shows a side follows without knowing anything about flags. */
.score-side.blue { color: var(--side-1, var(--blue)); }
.score-side.red { color: var(--side-2, var(--red)); }
.score-dot {
  width: 8px; height: 8px; flex: none; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 11%, transparent);
  transition: box-shadow 0.22s ease;
}
/* whose turn it is, said twice: here and on the dock */
.score-side.active .score-dot { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 22%, transparent); }
.score-pill .pname {
  color: var(--ink-soft); font-size: 11.5px; line-height: 1; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 8ch;
}
/* 0.1.70: «Niebieskie» is ten letters — the one side name of a game «Удвох» that 8ch cut to
 * «Niebies…» (tests/l10n-screens.js, 393 px). A championship keeps its own 7ch below: team names
 * there are long in every language and the ellipsis is by design. */
#app:not(.is-champ) .score-pill .pname { max-width: 10.5ch; }
/* …except on a 320-px screen: there even 8ch («Niebies…» + «Czerwone») pushes the pill under the two
 * round buttons (pill 36…284 px, buttons end at 50 and start at 270) */
@media (max-width: 360px) {
  #app:not(.is-champ) .score-pill .pname { max-width: 8ch; }
  :root[lang="pl"] #app:not(.is-champ) .score-pill .pname { max-width: 6ch; }
}
#app.is-champ .score-pill .pname { color: var(--ink); font-size: 10.5px; max-width: 7ch; }
.score-pill .pscore {
  font-family: var(--f-display); color: var(--ink);
  font-size: 21px; line-height: 1; font-weight: 700;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.score-pill .vs { color: var(--faint); font-size: 15px; font-weight: 400; }

/* ---------- the flag ---------- */
.flag-slot { display: flex; flex: none; }
/*
 * A FLAG, NOT A BANNER (rectangular from 0.1.26).
 *
 * Apple draws the flag emoji as a piece of cloth: it waves, the top and bottom edges curve, and
 * in a row of eight it reads as eight different shapes. What a table wants is a rectangle.
 *
 * We still do not ship artwork — the device draws the flag, which is the whole argument of
 * flags.js — so the wave is CROPPED instead: the glyph is scaled up inside a fixed rectangle with
 * `overflow: hidden`, and the curved edges fall outside it. The scale is the smallest that clears
 * the wave on Apple's glyphs (about 1.22 vertically) and no more, because everything past that is
 * detail thrown away.
 */
.flag {
  position: relative;
  display: grid; place-items: center;
  width: 30px; height: 21px; flex: none;
  border-radius: 3px; overflow: hidden;
  font-size: 17px; line-height: 1;
  box-shadow: 0 2px 6px rgba(23, 29, 40, 0.16), inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent);
}
/* the glyph itself, blown up past the frame so the wavy edges are cut off by it */
.flag:not(.flag-plate) { text-indent: 0; }
.flag:not(.flag-plate)::first-line { line-height: 1; }
.flag > .fg {
  display: block; transform: scale(1.26, 1.34); transform-origin: center;
  line-height: 1; white-space: nowrap;
}
/*
 * THE TABLE-ROW FLAG (0.1.23). Same component, a third of the area: in a list of twelve rows a
 * flag is a bullet, not a picture, and at full size it would outweigh the name it belongs to.
 * The shadow goes too — a raised element per row is noise at this density.
 */
.flag-xs {
  width: 20px; height: 14px; border-radius: 3px; font-size: 12px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
.flag-xs.flag-plate { font-size: 6px; letter-spacing: 0; }
/* 0.2.0a: a play-off place — two flags, the second tucked under the first's edge, so the pair is one bullet wide-ish */
.flag-pair { display: inline-flex; align-items: center; flex: none; }
.flag-pair > .flag + .flag { margin-left: -6px; box-shadow: 0 0 0 1.5px var(--sheet, #fff), inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); }

/* the profile's own heading: the team, once, at a size worth looking at */

/* the fallback where the device draws no flag: the team's own two colours and its code */
.flag-plate {
  background: linear-gradient(105deg, var(--f1) 0 52%, var(--f2) 52% 100%);
  color: #fff;
  font-family: var(--f-ui); font-size: 8.5px; font-weight: 700; letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.match-caption {
  position: relative; z-index: 3;
  margin: 2px 0 6px;
  color: var(--ink-soft);
  font-size: 11px; line-height: 1.2; font-weight: 600; letter-spacing: 0.035em;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 16px;
}

/* ---------- the board, in a frame ---------- */
.board-stage {
  position: relative;
  display: grid; place-items: stretch;
  min-height: 0;
  padding: 2px 10px 6px;
}
.board-frame {
  position: relative;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
}
.board-frame #board { border-radius: 24px; }

/* ---------- dock ---------- */
.game-dock {
  position: relative; z-index: 3;
  display: grid; gap: 7px;
  padding: 6px calc(var(--safe-r) + 10px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 10px);
}
.turn-card {
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: 11px;
  min-width: 0; min-height: 50px;
  padding: 8px 13px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 6% 120%, color-mix(in srgb, var(--blue) 13%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--glass-tint) 24%, transparent), transparent 48%),
    color-mix(in srgb, var(--panel) 74%, transparent);
}
/* THE CARD CHANGES SIDES. When the engine is to move the card is tinted red, so "whose turn" is
   answered by the colour of the biggest object on the dock and not only by the words on it. */
.turn-card.theirs {
  background:
    radial-gradient(circle at 6% 120%, color-mix(in srgb, var(--red) 13%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--glass-tint) 24%, transparent), transparent 48%),
    color-mix(in srgb, var(--panel) 74%, transparent);
}
.turn-card > * { position: relative; z-index: 1; }
.turn-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.turn-copy strong { font-size: 15px; line-height: 1.15; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.turn-copy small {
  font-family: var(--f-mono); color: var(--ink-soft);
  font-size: 11px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 0.1.77: 60 and 40 half-moves before the whistle (or the Full format's minimum / ceiling) the
   counter lights up — the ink, not a side colour, so it never reads as «red is winning» */
.turn-copy small.lim-60 { color: var(--ink); font-weight: 600; }
.turn-copy small.lim-40 {
  color: var(--ink); font-weight: 700;
  justify-self: start; max-width: 100%;
  padding: 0 5px; border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 11%, transparent);
}
.turn-dot {
  position: relative; flex: none;
  width: 12px; height: 12px; border-radius: 50%;
  color: var(--side-1, var(--blue)); background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 11%, transparent);
  transition: color 0.22s ease;
}
.turn-dot.red { color: var(--side-2, var(--red)); }
.turn-dot::after {
  content: "";
  position: absolute; inset: -5px;
  border: 1px solid currentColor; border-radius: 50%;
  opacity: 0.28;
  animation: turn-pulse 1.8s ease-out infinite;
}
@keyframes turn-pulse { 0% { transform: scale(0.85); opacity: 0.32; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.still .turn-dot::after { animation: none; }

.thinking { display: inline-flex; gap: 3px; }
.thinking i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.25; animation: think 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: 0.18s; }
.thinking i:nth-child(3) { animation-delay: 0.36s; }
@keyframes think { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

.game-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.dock-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 0; min-height: 43px; padding: 0 10px;
  border-radius: 15px;
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: transform 0.13s ease, opacity 0.13s ease;
}
.dock-btn:active { transform: scale(0.975); opacity: 0.8; }
.dock-btn svg { width: 18px; height: 18px; flex: none; color: var(--ink-soft); }
.dock-btn:disabled { color: var(--faint); opacity: 0.42; }
.dock-btn:disabled svg { color: var(--faint); }
/* 0.1.80: undo not allowed now (limit used up, game over) — looks off, still answers a tap */
.dock-btn.is-off { color: var(--faint); opacity: 0.42; }
.dock-btn.is-off svg { color: var(--faint); }

/* ---------- the review bar (0.1.23) ----------
 * It replaces the two dock buttons while a finished match is being walked through. The board above
 * it is the ordinary board — same canvas, same gestures, same territory — so everything here is
 * transport controls and a place in the match. */
.review-bar { display: grid; gap: 8px; }
.review-line { display: flex; align-items: center; justify-content: center; gap: 6px; }
.rev-btn {
  min-width: 44px; min-height: 38px; padding: 0 10px;
  border: 0; border-radius: var(--r-1);
  background: var(--control); color: var(--ink);
  box-shadow: var(--shadow-1); font-size: 14px; cursor: pointer;
}
.rev-btn:active { opacity: 0.7; }
.rev-btn:disabled { opacity: 0.35; }
/* the play button is the one you reach for, so it is the one that looks like a button */
.rev-play {
  min-width: 56px; min-height: 44px;
  background: var(--ink); color: var(--paper); font-size: 16px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ink) 18%, transparent);
}
.rev-play.playing { background: var(--blue); color: #fff; }
.rev-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rev-count {
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
}
.rev-speed {
  min-height: 28px; padding: 0 10px;
  border: 0; border-radius: 999px;
  background: var(--control); color: var(--ink-soft);
  box-shadow: var(--shadow-1);
  font: inherit; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
/*
 * 0.1.39: the door to the summary is a WORD, not an abbreviation squeezed beside «×2». The
 * play-test asked for it wider and named for what it opens, and it was right: «Підсумок» next to
 * a speed control reads as another control, «Підсумок матчу» reads as a place to go.
 */
/* the same HEIGHT as the speed control beside it: the play-test asked for it longer, and a
 * taller review bar costs the board its space — at 320px it shrank the advertising band below
 * the size at which it is drawn at all, which the geometry check caught. */
.rev-sum {
  min-height: 28px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: var(--blue); color: #fff;
  box-shadow: var(--shadow-1);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.rev-sum:active { transform: translateY(1px); }
#rev-range { width: 100%; accent-color: var(--blue); }
.rev-note { margin: 0; text-align: center; font-size: 11px; color: var(--faint); }
/*
 * 0.1.39: on the narrowest screens the review bar takes the board's space, and the first thing
 * to go is the help line — three wrapped lines explaining ▶ and a slider, read once. Measured:
 * the 0.1.39 summary button cost the band about five pixels at 320×640, enough to drop the
 * advertising boards below the size at which they are drawn; the note gives back five times that.
 * The board is what the screen is for.
 */
@media (max-height: 700px), (max-width: 360px) {
  .rev-note { display: none; }
}

@media (max-height: 700px) {
  .game-head { padding-top: calc(var(--safe-t) + 6px); }
  .game-head .icon-btn { width: 44px; height: 44px; }
  .score-pill { height: 44px; min-width: 176px; }
  .match-caption { margin: 0 0 4px; }
  .turn-card { min-height: 46px; }
  .dock-btn { min-height: 40px; }
}
@media (max-width: 380px) {
  .game-head { grid-template-columns: 42px minmax(0, 1fr) 42px; padding-inline: 8px; }
  .game-head .icon-btn { width: 42px; height: 42px; }
  #app.is-champ .score-pill { min-width: 218px; padding-inline: 7px; }
  #app.is-champ .score-side { gap: 3px; }
  #app.is-champ .score-pill .pname { font-size: 9px; max-width: 6ch; }
  .flag { width: 25px; height: 18px; font-size: 14px; }
  /*
   * 0.1.28: the dock keeps its words on a narrow phone. Hiding them was harmless while both
   * buttons meant one fixed thing; now one of them is a TOGGLE whose whole job is to say where
   * it takes you — "Наблизити" or "Усе поле" — and an icon cannot say that. Found by shooting
   * the game at 325 px: two icons and no way to know what the second one would do.
   */
  .dock-btn { gap: 6px; padding-inline: 10px; }
  .dock-btn span { font-size: 11px; letter-spacing: -0.01em; }
  .dock-btn svg { width: 18px; height: 18px; }
}
@media (max-width: 300px) {
  /* below this even a short word will not fit beside the icon */
  .dock-btn span { display: none; }
}

/* ------------------------------------------------------------------ match summary (0.1.26)
 *
 * The football ending: the score between two flags, one line saying how the match went, three
 * two-sided bars, and the handful of moments that decided it. It lives at the bottom of the
 * result sheet, so a person sees the verdict first and the story when they scroll — never the
 * other way round.
 */
#over-story { margin: 18px 0 4px; text-align: left; }
#over-story h3 { margin: 18px 0 8px; }

/*
 * 0.1.40: the name WRAPS instead of being cut. «Боснія і Герцеговина» came out as
 * «Боснія і Герцег…» on the result screen — a country the player had just beaten, named half.
 * An ellipsis is the right answer in a table of twelve rows where every row must be the same
 * height; here there are two names and all the room the sheet needs. Two lines cost nothing and
 * say the whole word.
 */

.lead-chart { width: 100%; height: 72px; display: block; margin: 4px 0 12px; }
.lc-1 { fill: var(--side-1, var(--blue)); opacity: .26; }
.lc-2 { fill: var(--side-2, var(--red)); opacity: .26; }
.lc-line { fill: none; stroke: var(--ink); stroke-width: 1.4; opacity: .55; vector-effect: non-scaling-stroke; }
.lc-axis { stroke: var(--ink-soft); stroke-width: 1; opacity: .3; vector-effect: non-scaling-stroke; }

/* ---------- a tab that has nothing to show yet (0.1.26) ----------
 * The playoff bracket does not exist until the groups are played. One grey line of text made the
 * whole sheet shrink to that line's height, so the tab row jumped down the screen and back. The
 * sheet now keeps its height whenever the tournament's tabs are up, and the empty tab gets a
 * screen of its own rather than a footnote.
 *
 * 0.1.55: as a pane it is anchored top AND bottom, so it keeps its height by construction and this
 * line has nothing left to hold up. It stayed for one build too long and won on specificity —
 * `#sheet-champ.has-tabs` outranks `.sheet.pane` — which left eighty pixels of the home screen
 * showing under the window. A rule that outlives its reason is a rule that will win an argument
 * nobody remembers having.
 */
#sheet-champ.has-tabs:not(.pane) { height: 88vh; }

/* three empty slots, the shape of a bracket column that is waiting to be filled */

/* ---------- the result sheet arrives, it does not land (0.1.28) ----------
 * Every other sheet is something the player asked for by pressing a button, and 0.28 s is right
 * for that: the answer should feel immediate. The result sheet is the one nobody presses — it
 * appears on its own, over the move that just decided the match — so the same 0.28 s reads as
 * being shoved out of the way. This one takes almost twice as long, on a softer curve, and its
 * contents settle a beat behind the sheet itself.
 */
#sheet-over {
  transition: transform 0.52s cubic-bezier(0.16, 0.84, 0.28, 1);
}
#sheet-over.open > * {
  animation: over-settle 0.46s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  animation-delay: 0.12s;
}
#sheet-over.open > *:nth-child(3) { animation-delay: 0.18s; }
#sheet-over.open > *:nth-child(4) { animation-delay: 0.22s; }
#sheet-over.open > *:nth-child(5) { animation-delay: 0.26s; }
@keyframes over-settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* the scrim comes up with the sheet rather than snapping on ahead of it */
.scrim.open { transition: opacity 0.42s ease; }

@media (prefers-reduced-motion: reduce) {
  #sheet-over, .scrim.open { transition-duration: 0.01ms !important; }
  #sheet-over.open > * { animation: none !important; }
}

/* the name column takes whatever is left, and elides rather than pushing the numbers around.
 * 0.1.35: the cell is a flex row so the MARK keeps its own size and the NAME gives way — before,
 * both were inline and the name lost, which is how «Мексика» became «М..». */

/*
 * On the narrowest phones the numbers alone ask for 210px of a 280px table, and the name is left
 * with 43. Something has to go, and the DIFFERENCE is the one column that is not a fact of its
 * own: «З» and «‑З» are both on the row, and the table is already sorted by it. Dropping it, and
 * the flag with it, gives the name 100px instead of 43 — measured on a 320px screen.
 */

/* how hard the opponent is playing, on the same card (0.1.36) */

/* the toss, on the card that offers the match (0.1.32) */

/* ============================================================ the toss (0.1.36)
 *
 * A coin over the board, for the two seconds before the first move. It is an announcement, not a
 * decision: the seed settled who opens long before this ran. The stage covers the board and
 * nothing else, so the score pill and the dock stay readable behind it, and any tap ends it —
 * a ceremony you cannot skip stops being a ceremony by the third match.
 */
.toss-stage {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: color-mix(in srgb, var(--sheet) 72%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border-radius: inherit;
  animation: toss-in 0.22s ease-out both;
}
.toss-stage.out { animation: toss-out 0.3s ease-in both; }
@keyframes toss-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toss-out { from { opacity: 1; } to { opacity: 0; } }

/*
 * 0.1.37: the coin WAITS. It used to start spinning the moment the stage appeared, because the
 * answer was already known and there was nothing to wait for. Now the draw happens when the
 * player throws it, so the spin is a class that script adds at that instant — and the coin is a
 * real button, which is what makes it reachable by keyboard and by a screen reader.
 */
.coin {
  width: 96px; height: 96px; position: relative;
  transform-style: preserve-3d;
  padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease-out;
}
.coin.idle { animation: coin-wait 2.4s ease-in-out infinite; }
.coin.idle:active { transform: scale(0.94); }
.coin.spin { animation: coin-spin 1.15s cubic-bezier(0.25, 0.7, 0.3, 1) both; }
.coin[disabled] { cursor: default; }
/* a coin nobody has touched yet breathes, so it reads as "press me" rather than as a picture */
@keyframes coin-wait {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-4deg); }
}
.coin .face {
  position: absolute; inset: 0; border-radius: 50%;
  display: block; backface-visibility: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), inset 0 0 0 3px rgba(255, 255, 255, 0.55);
  background-size: cover; background-position: center;
}
.coin .face.b { transform: rotateY(180deg); }
/*
 * The face is a box that CENTRES its flag, and the flag is the ordinary component at coin size —
 * `.flag` brings its own width, height and crop, so the face must not try to lay it out as text.
 */
.coin .face {
  display: grid; place-items: center;
  background: var(--sheet);
}
.flag-coin { width: 66px; height: 46px; border-radius: 6px; font-size: 40px; }
/* the flags of the two sides are set as the faces from script, so the coin is THIS match's coin */
/*
 * WHICH FACE IT LANDS ON IS THE WHOLE POINT. The spin ends at `--land`, and that is a whole
 * number of turns when the home side opens and half a turn more when the guests do — so the face
 * you are left looking at is the team the verdict names. A coin that always shows the same side
 * is not a coin, and the first version of this did exactly that.
 */
.coin { --land: 1800deg; }
@keyframes coin-spin {
  0%   { transform: translateY(0) rotateY(0deg) scale(0.9); }
  45%  { transform: translateY(-38px) rotateY(calc(var(--land) / 2)) scale(1.06); }
  100% { transform: translateY(0) rotateY(var(--land)) scale(1); }
}
.coin.settled { transform: rotateY(var(--land)); }

/* the invitation, before the throw */
.toss-ask {
  margin: 0; font-size: 14px; color: var(--ink-soft); text-align: center;
}
/*
 * 0.1.39: the verdict is OPAQUE BY DEFAULT. It used to rest at `opacity: 0` and be made visible
 * by the `.said` animation — so anything that stopped that animation from running stopped the
 * sentence from existing, which is what the play-test saw. The animation now only slides it in;
 * whether the text is on the screen is no longer an animation's decision.
 */
.toss-verdict {
  margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 17px;
  text-align: center; text-wrap: balance;
  padding: 0 16px; min-height: 1.2em;
}
.toss-verdict:empty { min-height: 0; }
.toss-verdict.said { animation: toss-said 0.3s ease-out; }
@keyframes toss-said { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/*
 * 0.1.54: NOTHING IS WRITTEN WHILE THE COIN IS IN THE AIR.
 *
 * The invitation goes the instant the coin is thrown, and the sentence — already written into the
 * element, as 0.1.39 requires — waits out the 1.15 s spin before it is visible.
 *
 * `forwards`, and the last keyframe is `opacity: 1`: THE APPEARING IS THE ANIMATION'S OWN END, not
 * a class somebody has to remember to remove. If `.flipping` were left on for ever, or the timer
 * that removes it never ran, the sentence would still be on the screen a second later. That is the
 * 0.1.39 rule kept — an animation may decide WHEN the text shows, never WHETHER.
 *
 * The invitation is `display: none` rather than transparent so the caption block is one line tall
 * during the flip, which is the height it keeps afterwards: the coin does not move under the text.
 */
.toss-stage.flipping .toss-ask { display: none; }
.toss-stage.flipping .toss-verdict { animation: toss-hold 1.15s linear forwards; }
@keyframes toss-hold { 0%, 93% { opacity: 0; } 100% { opacity: 1; } }
/* the ask line wraps now that it is a sentence rather than two words */
.toss-ask { max-width: 17em; }

/*
 * «Розпочати гру» (0.1.37). The ceremony no longer dismisses itself after 2.4 seconds — the
 * play-test asked for the match to begin when the person says so. Until this is pressed the
 * engine has not been asked to think and no clock of any kind is running.
 */
.toss-go {
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 22px; border-radius: 12px; border: 0;
  background: var(--blue); color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  animation: toss-said 0.3s ease-out both;
}
.toss-go:active { transform: translateY(1px); }

@media (prefers-reduced-motion: reduce) {
  .coin, .coin.idle, .coin.spin, .coin.settled,
  .toss-verdict, .toss-verdict.said, .toss-go,
  .toss-stage, .toss-stage.out { animation: none; opacity: 1; }
  /* 0.1.54: with no spin there is nothing to wait for, so the sentence is simply there. Named
   * explicitly because `.toss-stage.flipping .toss-verdict` outranks the line above. */
  .toss-stage.flipping .toss-verdict { animation: none; opacity: 1; }
}

/* 0.1.41: a setting that exists but cannot act — the haptics switch on a platform with no
   Vibration API. Dimmed and inert rather than removed, because the native build will read it. */
.row.is-off { opacity: 0.45; }
.row.is-off .switch { pointer-events: none; }

/* ------------------------------------------------------------------ Як грати (0.1.42)
   The animation screen: our board and nothing around it — no ad bands, no flags, as asked.
   Everything here is sized from the sheet, so the canvas keeps its aspect on a phone in portrait
   and on a tablet without a second layout. */
.menu-item.big { align-items: flex-start; padding: 15px 16px; }
.menu-item.big .copy { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.menu-item.big .copy small { color: var(--ink-soft); font-size: 13px; line-height: 1.35; }

/* 0.2.29 (Д-26, D2): the first launch — one question in large type, two answers 56 px tall */
.first-ask h2 { margin: 8px 16px 18px; font: 600 26px/1.25 var(--f-ui); text-align: center; text-wrap: balance; }
.first-ask .primary, .first-ask .secondary { display: block; width: calc(100% - 32px); margin: 0 16px 10px; min-height: 56px; font-size: 19px; }
/* 0.2.29 (P4): «Навчитися грати» — a card like the others, marked by the accent so it is found first */
.learn-card { position: relative; }
.learn-card .mode.learn { width: 100%; padding-right: 52px; }
.learn-card .chev { display: none; }   /* the «×» stands where the chevron was; the whole card is the way in */
.learn-card .learn-x { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 44px; height: 44px; color: var(--ink-soft); }
.mode.learn { border-color: var(--accent, var(--blue)); }
.mode.learn strong { color: var(--accent, var(--blue)); }
/* 0.2.29 (Д-26, Р-586): THE LESSON A PERSON PLAYS. A square field as large as the sheet allows; the caption ≥ 20 px — the people
   it is for are 55+ and read slowly; «Далі» and the end buttons are full-width and 52 px tall. */
.lesson-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 16px 8px; }
.lesson-step { margin: 0; font: 500 13px/1.25 var(--f-ui); color: var(--ink-faint); letter-spacing: 0.02em; text-transform: uppercase; min-width: 0; }
.lesson-skip { flex: 0 0 auto; border: 0; background: none; color: var(--ink-soft); font: 500 15px/1 var(--f-ui); padding: 10px 4px; min-height: 44px; cursor: pointer; }
.lesson-stage {
  position: relative; margin: 0 12px; aspect-ratio: 1 / 1; max-height: min(52vh, 420px); max-width: 100%; align-self: center;
  border-radius: var(--r-2, 16px); overflow: hidden; touch-action: manipulation;
  background: var(--board-bg, var(--paper)); box-shadow: var(--shadow-1, 0 2px 10px rgba(0, 0, 0, 0.08));
}
.lesson-stage canvas { display: block; width: 100%; height: 100%; }
.lesson-score { margin: 10px 16px 0; font: 600 15px/1.2 var(--f-ui); color: var(--ink-soft); font-variant-numeric: tabular-nums; text-align: center; }
.lesson-say { margin: 8px 16px 12px; min-height: 4.05em; /* three lines, whatever the step says — the field must not move (K2) */ font: 500 21px/1.35 var(--f-ui); color: var(--ink); text-align: center; text-wrap: balance; }
.lesson-next { display: block; width: calc(100% - 32px); margin: 0 16px 8px; min-height: 52px; font-size: 18px; }
.lesson-next.wait { visibility: hidden; }
.lesson-end { display: flex; flex-direction: column; gap: 10px; margin: 0 16px 8px; }
.lesson-end .primary, .lesson-end .secondary { width: 100%; margin: 0; min-height: 52px; font-size: 18px; }
@media (max-height: 700px) { .lesson-stage { max-height: 44vh; } .lesson-say { font-size: 19px; } }

/* 0.1.43: the two text links under the mode cards. «Покупки» sits beside «Як грати» in the same
   weight, deliberately: the four cards above are about playing, and a shop is not one of them. */
/* 0.2.28: four links since «Мій шлях» (uk 87 + 83 + 92 + 87 px with 14 px sides — 403 px in 353 on a 393 pt phone): the
   sides go to 10 px and the gap to 0 — the buttons' own padding is the space between them; one line from 375 pt (uk, en, pl),
   two lines only on a 320 pt phone, never an overflow */
.home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin-top: 2px; }
.home-links .text-btn { margin: 0; padding-left: 10px; padding-right: 10px; }
/* 0.2.31 (задача 11, Р-601): on a 320 pt screen the four links broke into 3 + 1 — narrower gaps keep them on one line, three languages */
@media (max-width: 359px) { .home-links .text-btn { padding-left: 6px; padding-right: 6px; font-size: 13px; } }
/* 0.2.6 (Р-309): the one quiet line under the menu, in a browser tab only — the weight of a hint, not of a card */
.home-keep { margin: 0 16px; text-align: center; font: 400 12px/1.35 var(--f-ui); color: var(--ink-soft); }
/* the line takes the room of the menu's bottom padding rather than squeezing the hero (tests/home-fit.js); where the
 * window is too short for the hero, the cards and the line, the line steps aside — Settings still has «Вивантажити все» */
@media (min-height: 561px) { .modes:has(> .home-keep:not([hidden])) { padding-bottom: calc(var(--safe-b) + 4px); } }
@media (max-height: 560px) { .home-keep { display: none; } }

/* ================================================================ championship · Д-01 (0.1.58)
 *
 * THE EIGHT SCREENS IN THE DESIGN ACCEPTED IN Д-01. The rules below are the mock-up's own
 * `source/championship.css` and the ten added states' `add.css`, with three changes and nothing else:
 *
 *   1. SCOPED. Every selector sits under `.ch-content` — the <main> each screen is drawn into. The
 *      mock-up used bare names (`.primary`, `.flag`, `.section`, `.badge`) and this stylesheet
 *      already has four of them for other screens; scoped, the championship cannot restyle the
 *      home screen and the home screen cannot restyle the championship.
 *   2. NOT CARRIED OVER: the first six rules (`.sheet-head h2`, `.head-actions`, `.icon-btn…` —
 *      already here), `@font-face` and its fonts, `backdrop-filter` on `.ch-card` (Д-01 §2.4: the
 *      cards lie on a flat gradient, so the blur changed only text anti-aliasing, and it costs a
 *      compositing layer per card on a phone whose memory was already the problem, Р-51), the
 *      prototype's dialog and its drawn switch (the pick screen uses the app's real one).
 *   3. The seven `--ch-*` tokens live in the palette blocks at the top of this file (Р-60): Air
 *      gets the mock-up's values, the notebook gets references to its own tokens.
 *
 * Colour literals in this section: 0.
 */
.ch-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.ch-tabs button { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; padding: 0 2px; text-align: center; font-size: clamp(10px, 2.85vw, 12px); line-height: 1.2; }
.ch-content { position: relative; isolation: isolate; padding-top: 2px; color: var(--ink); font: 14px/1.45 var(--f-ui); }
.ch-content::before { content: ""; position: absolute; z-index: -1; inset: -10px -20px -62px; background: linear-gradient(140deg, var(--sheet), var(--ch-tint) 48%, var(--sheet)); pointer-events: none; }
.ch-content *, .ch-content *::before, .ch-content *::after { min-width: 0; }
/* 0.1.65: the story on the result sheet after the player's own match is the same D-01 markup as
 * «Підсумок матчу», so it lives under `.ch-content` too. The sheet already has a background of its
 * own; the championship page backdrop would paint past the sheet's edges. */
.ch-content.ch-sheet { margin-top: 6px; }
.ch-content.ch-sheet::before { content: none; }
#sheet-over.with-card .result .big, #sheet-over.with-card #over-title { display: none; }
#sheet-over.with-card .result { padding-top: 4px; }
.ch-content h2, .ch-content h3, .ch-content p { margin: 0; }
.ch-content h2 { font: 600 17px/1.35 var(--f-ui); letter-spacing: -.025em; }
.ch-content h3 { font: 600 15px/1.35 var(--f-ui); }
.ch-content a { color: var(--ink); text-decoration: none; }
.ch-content button, .ch-content select, .ch-content input { font: inherit; color: var(--ink); }
.ch-content button, .ch-content a { -webkit-tap-highlight-color: var(--ch-clear); }
.ch-content :is(p, h2, h3, a, button, label, summary, td, th, .team-name) { overflow-wrap: anywhere; }
.ch-content .ch-icon { width: 18px; height: 18px; flex: 0 0 18px; vertical-align: middle; fill: none; stroke: var(--ink-soft); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ch-content .ch-card { background: linear-gradient(145deg, var(--ch-glass), var(--control)); border: 1px solid var(--ch-edge); border-radius: var(--r-3); box-shadow: var(--ch-shadow); }
.ch-content .pad { padding: 16px; }
.ch-content .stack { display: grid; gap: 12px; }
.ch-content .section { margin-top: 22px; }
.ch-content .section-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 0 0 10px; }
.ch-content .section-head > * { flex-shrink: 1; }
.ch-content .section-head > :last-child:not(:first-child) { max-width: 145px; }
.ch-content .section-link { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12px; color: var(--ink-soft) !important; text-align: right; min-height: 32px; min-width: 0; }
.ch-content .section-head > .section-link { max-width: none; width: max-content; white-space: nowrap; }
.ch-content .subtle, .ch-content .muted { color: var(--ink-soft); }
.ch-content .small { font-size: 12px; line-height: 1.45; }
.ch-content .kicker { color: var(--ink-soft); font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.ch-content .small + .kicker { margin-top: 16px; }   /* 0.1.87: the level block under the match-length note */
.ch-content .mono, .ch-content .number { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.ch-content .big-number { font: 500 40px/1.12 var(--f-mono); letter-spacing: -.05em; }
.ch-content .status-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: 12px; margin-bottom: 12px; }
.ch-content .status-line .mono { white-space: nowrap; font-size: 12px; }
.ch-content .flag { display: inline-flex; width: 22px; height: 15px; flex: 0 0 22px; align-items: center; justify-content: center; line-height: 15px; font-size: 21px; vertical-align: middle; }
.ch-content .flag-case { display: inline-grid; place-items: center; padding: 6px; background: var(--ch-glass); border: 1px solid var(--ch-edge); box-shadow: var(--shadow-1); border-radius: 9px; flex: 0 0 auto; }
.ch-content .team-name { display: inline-flex; align-items: center; gap: 7px; }
.ch-content .ch-btn { min-height: 44px; padding: 11px 14px; display: flex; align-items: center; justify-content: center; gap: 9px; border-radius: 16px; border: 1px solid var(--ch-edge); background: var(--ch-glass); box-shadow: var(--ch-shadow); cursor: pointer; text-align: center; line-height: 1.35; width: 100%; }
.ch-content .ch-btn.primary { background: linear-gradient(145deg, var(--ink), var(--ch-action)); color: var(--sheet); border-color: var(--ch-action); font-weight: 600; box-shadow: var(--shadow-2); }
.ch-content .primary .ch-icon { stroke: var(--sheet); }
.ch-content .ch-btn:active { transform: translateY(1px); }
.ch-content .ch-btn[disabled] { opacity: .6; cursor: default; }
.ch-content .text-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; background: var(--ch-clear); color: var(--ink-soft); cursor: pointer; padding: 8px 10px; }
.ch-content .action-card { padding: 12px; }
.ch-content .action-card .kicker { text-transform: none; letter-spacing: 0; }
.ch-content .versus { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: center; margin: 8px 0; }
.ch-content .versus .side { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; text-align: center; font-weight: 600; font-size: 15px; line-height: 1.25; }
.ch-content .versus .separator { font-family: var(--f-mono); color: var(--ink-soft); }
.ch-content .action-meta { text-align: center; color: var(--ink-soft); font-size: 11px; line-height: 1.6; margin: 8px 0 10px !important; }
.ch-content .next-secondary { margin-top: 8px; font-size: 13px; }
.ch-content .table-card { padding: 6px 8px; border-radius: 20px; }
.ch-content .standings { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ch-content .standings th { font-weight: 400; color: var(--ink-soft); font-size: 10px; height: 24px; text-align: right; border-bottom: 1px solid var(--line); }
.ch-content .standings th.team-label { text-align: left; padding-left: 33px; }
.ch-content .standings td { padding: 7px 3px; text-align: right; font-family: var(--f-mono); font-size: 12px; }
.ch-content .standings td.name-cell { text-align: left; font-family: var(--f-ui); font-size: 13px; }
.ch-content .standings td.pos { text-align: center; width: 24px; color: var(--ink-soft); }
.ch-content .standings td.points { font-weight: 500; }
.ch-content .standings .team-col { width: auto; }
.ch-content .standings .pos-col { width: 24px; }
.ch-content .standings .num-col { width: 32px; }
.ch-content .team-row.is-human td { background: var(--ch-selected); }
.ch-content .team-row td:first-child { border-radius: 8px 0 0 8px; }
.ch-content .team-row td:last-child { border-radius: 0 8px 8px 0; }
.ch-content .standings .team-row.qualified .pos { color: var(--ok); font-weight: 500; }
.ch-content .standings .name-cell a { display: flex; gap: 7px; align-items: center; min-height: 23px; }
/* 0.2.12: the qualifiers' tables and matches — teams outside the championship, nothing to open */
.ch-content .standings .name-cell .team-plain { display: flex; gap: 7px; align-items: center; min-height: 23px; }
.ch-content .standings .name-cell .team-plain > span:last-child { flex: 1; }
.ch-content div.match-row { cursor: default; }
.ch-content .qual-view .pick-confs { margin-top: 10px; }
/* 0.2.13b: who went to the championship — the row tinted, «Q» beside the name, and the list above the stages */
/* 0.2.31 (В-31, рішення Слави B7 + Q1 «варіант А»): in the language of Air — no green. A team through: the quiet tint of the selected
 * and a bold name; «Q» — small and grey, no frame; the person's own team — a blue edge on the left, so «through» and «mine» never read alike */
.qual-view .team-row.qualified td { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.qual-view .team-row.qualified .team-name, .qual-view .team-row.qualified .team-name > span:last-child { font-weight: 650; }
/* 0.2.31b (F1): the tables of the qualifiers draw the name in .team-plain (no .team-name) — the bold reached nothing there */
.qual-view .team-row.qualified .name-cell .team-plain > span:last-child, .qual-view .team-row.qualified .name-cell a > span:last-child { font-weight: 650; }
.qual-view .team-row.qualified .q-mark { font-weight: 600; }
.qual-view .team-row.is-human td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.qual-view .team-row.qualified.is-human td { background: color-mix(in srgb, var(--ink) 6%, var(--ch-selected)); }
.ch-content .q-mark {
  display: inline-block; margin-left: 5px; padding: 0;
  font-family: var(--f-mono); font-size: 11px; font-weight: 600; line-height: 16px; letter-spacing: 0.02em;
  color: var(--ink-faint); border: 0; vertical-align: 1px;
}
.ch-content .q-card { margin-top: 10px; }
/* 0.2.31 (В-32): the ties of a path as a tree — semi-finals on the left, the final on the right, the ticket under it */
.ch-content .tie-tree { margin: 4px 0 12px; }
.ch-content .tie-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.ch-content .tie-semis, .ch-content .tie-final { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-content .tie-semis .match-item, .ch-content .tie-final .match-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.ch-content .tie-semis .match-item + .match-item { border-top: 1px solid var(--line); }
.ch-content .tie-semis .match-item.is-human, .ch-content .tie-final .match-item.is-human { background: var(--ch-selected); }
.ch-content .tie-semis { position: relative; padding-right: 8px; border-right: 2px solid var(--line); }
.ch-content .tie-through { margin: 2px 4px 0; font-size: 12px; color: var(--ink-soft); }
.ch-content .tie-through b { color: var(--ink); }
.ch-content .tie-cols .match-row { grid-template-columns: minmax(0,1fr); justify-items: start; gap: 2px; padding: 6px 8px; }
.ch-content .tie-cols .match-row .away { flex-direction: row; text-align: left; }
.ch-content .tie-cols .match-score { text-align: left; }
.ch-content .q-through { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.ch-content .q-through li { display: flex; align-items: center; min-width: 0; }
.ch-content .q-through li .team-name { min-width: 0; overflow: hidden; }
.ch-content .q-through li .team-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-content .q-through li .q-mark { flex: none; }
.ch-content .q-through li.is-human { font-weight: 600; }
.ch-content .q-through li.is-human { box-shadow: inset 3px 0 0 var(--blue); padding-left: 6px; border-radius: 2px; }   /* 0.2.31 (В-31) */
.ch-content .q-through li.host { grid-column: 1 / -1; }
.ch-content .standings .name-cell a > span:last-child { flex: 1; }
.ch-content .qual-note { display: flex; align-items: flex-start; gap: 6px; font-size: 11px; color: var(--ink-soft); padding: 7px 4px 0; }
.ch-content .qual-note .ch-icon { width: 14px; height: 14px; flex-basis: 14px; stroke: var(--ok); margin-top: 1px; }
.ch-content .legend { font-size: 11px; line-height: 1.5; color: var(--ink-soft); padding: 9px 12px 0; }
.ch-content .match-list { padding: 4px 6px; border-radius: 20px; }
.ch-content .match-item + .match-item { border-top: 1px solid var(--line); }
.ch-content .match-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 6px; align-items: center; padding: 10px 7px; min-height: 44px; font-size: 12px; border-radius: 10px; }
.ch-content .match-row.is-human { background: var(--ch-selected); }
/* 0.2.31 (В-27): the whole card of the person's match, not only the row of names; a gap between two such cards in a row */
.ch-content .match-item.is-human { background: var(--ch-selected); border-radius: 12px; }
.ch-content .match-item.is-human .match-row.is-human { background: transparent; }
.ch-content .match-item.is-human + .match-item, .ch-content .match-item + .match-item.is-human { border-top-color: transparent; }
.ch-content .match-item.is-human + .match-item.is-human { margin-top: 4px; }
.ch-content .match-item.is-human .match-meta, .ch-content .match-item.is-human .match-venue { padding-bottom: 6px; }
.ch-content .match-row .away { flex-direction: row-reverse; text-align: right; justify-content: flex-start; }
.ch-content .match-score { font: 500 12px/1.2 var(--f-mono); text-align: center; white-space: nowrap; min-width: 38px; }
.ch-content .match-row.scheduled .match-score { color: var(--ink-soft); font-weight: 400; }
.ch-content .match-meta { display: flex; justify-content: space-between; gap: 10px; padding: 0 8px 8px; color: var(--ink-soft); font-size: 10px; }
.ch-content .match-venue { padding: 0 9px 10px; font-size: 10px; color: var(--ink-soft); text-align: center; }
.ch-content.hub-compact .section { margin-top: 10px; }
.ch-content.hub-compact .section-head { margin-bottom: 5px; }
.ch-content.hub-compact .standings td { padding-top: 5px; padding-bottom: 5px; }
.ch-content.hub-compact .match-row { min-height: 29px; padding-top: 5px; padding-bottom: 5px; }
.ch-content.hub-compact .match-item + .match-item { border: 0; }
.ch-content.hub-compact .section-head h2 { font-size: 18px; }
.ch-content .service-actions { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ch-content .badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 4px 8px; color: var(--ink-soft); background: var(--resume-tag); font-size: 10px; font-weight: 500; }
.ch-content .pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ch-content .summary-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.ch-content .summary-line + .summary-line { border-top: 1px solid var(--line); }
.ch-content .summary-line strong { text-align: right; font-size: 13px; font-weight: 500; }
.ch-content .summary-line span { color: var(--ink-soft); font-size: 12px; }
.ch-content .metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.ch-content .metric { padding: 13px 7px; text-align: center; border-radius: 16px; }
.ch-content .metric strong { display: block; font: 500 23px/1.25 var(--f-mono); letter-spacing: -.03em; }
.ch-content .metric span { display: block; font-size: 10px; color: var(--ink-soft); margin-top: 5px; }
.ch-content .group-block { scroll-margin-top: 118px; }
.ch-content .group-block:first-of-type { margin-top: 16px; }
.ch-content .group-block + .group-block { margin-top: 18px; }
.ch-content .group-block .section-head { margin-bottom: 6px; }
.ch-content .group-block .section-head h2 { font-size: 16px; }
.ch-content .disclosure { margin-top: 12px; }
.ch-content .disclosure > summary { min-height: 44px; padding: 11px 2px; cursor: pointer; color: var(--ink-soft); font-size: 12px; }
.ch-content .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; }
.ch-content .full-table { min-width: 485px; }
.ch-content .full-table .num-col { width: 33px; }
.ch-content .full-table .name-cell { width: 170px; }
.ch-content .empty-state { padding: 24px 20px; text-align: center; }
.ch-content .empty-state .empty-symbol { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 18px; background: var(--ch-selected); border: 1px solid var(--ch-edge); }
.ch-content .empty-symbol .ch-icon { width: 28px; height: 28px; }
.ch-content .empty-state h2 { margin-bottom: 9px; }
.ch-content .empty-state p { font-size: 12px; color: var(--ink-soft); }
.ch-content .empty-state .ch-btn { margin-top: 18px; }
.ch-content .progress-track { display: block; width: 100%; height: 4px; background: var(--line); border-radius: 9px; margin-top: 13px; }
.ch-content .progress-track > span { display: block; height: 100%; width: var(--progress); background: var(--ink-soft); border-radius: inherit; }
.ch-content .round-steps { list-style: none; padding: 4px 0; margin: 0; }
.ch-content .round-steps li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 45px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.ch-content .round-steps li:last-child { border: 0; }
.ch-content .round-steps span { color: var(--ink-soft); font-size: 12px; }
.ch-content .segmented { padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--ch-selected); margin-bottom: 14px; }
.ch-content .segmented button { flex: 1; padding: 8px 6px; min-height: 36px; border: 0; border-radius: 10px; background: var(--ch-clear); color: var(--ink-soft); cursor: pointer; font-size: 12px; line-height: 1.25; }
.ch-content .segmented button[aria-pressed="true"] { background: var(--ch-glass); color: var(--ink); box-shadow: var(--shadow-1); }
.ch-content .filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ch-content .filter-row label { font-size: 11px; color: var(--ink-soft); }
.ch-content .filter-row select { max-width: 65%; border: 1px solid var(--line); background: var(--control); padding: 9px; border-radius: 10px; font-size: 12px; min-height: 40px; }
.ch-content .date-group { margin-top: 15px; }
.ch-content .date-head { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 11px; padding: 0 2px 7px; }
.ch-content .date-head h2 { flex: 1; color: var(--ink); font: 600 13px var(--f-ui); }
.ch-content .opponent-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; margin-bottom: 14px; }
.ch-content .opponent-head .team-name { display: flex; }
.ch-content .opponent-head h2 { font-size: 20px; }
.ch-content .strength-title { margin-top: 14px !important; font-size: 20px !important; }
.ch-content .strength-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; margin: 16px 0; }
.ch-content .strength-pair > div { display: grid; gap: 5px; }
.ch-content .strength-pair > div:last-child { text-align: right; }
.ch-content .strength-pair strong { font: 500 27px var(--f-mono); letter-spacing: -.045em; }
.ch-content .strength-pair span { font-size: 11px; color: var(--ink-soft); }
.ch-content .strength-bars { display: grid; gap: 6px; }
.ch-content .strength-track { height: 5px; background: var(--line); border-radius: 8px; overflow: hidden; }
.ch-content .strength-track span { display: block; height: 100%; width: var(--strength); background: var(--ink); border-radius: inherit; }
.ch-content .strength-track.opponent span { background: var(--ink-soft); }
.ch-content .strength-note { margin-top: 13px !important; color: var(--ink-soft); font-size: 12px; }
.ch-content .rating-list { list-style: none; padding: 4px 8px; margin: 0; }
.ch-content .rating-row { display: grid; grid-template-columns: 25px minmax(0,1fr) 55px; gap: 6px; align-items: center; min-height: 41px; padding: 7px 3px; border-bottom: 1px solid var(--line); }
.ch-content .rating-row:last-child { border: 0; }
.ch-content .rating-row.is-human { background: var(--ch-selected); border-radius: 8px; }
.ch-content .rating-row > .mono { color: var(--ink-soft); font-size: 11px; }
.ch-content .rating-row strong { text-align: right; font: 500 13px var(--f-mono); }
.ch-content .profile-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.ch-content .profile-head h2 { font-size: 22px; }
.ch-content .profile-head .flag-case { padding: 14px; border-radius: 16px; }
.ch-content .scoreboard { text-align: center; padding: 20px 14px; }
.ch-content .scoreboard .versus { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); margin: 18px 0; }
.ch-content .scoreboard .side { flex-direction: column; gap: 9px; font-size: 13px; font-weight: 500; }
.ch-content .scoreboard .score-main { font: 500 30px var(--f-mono); letter-spacing: -.07em; white-space: nowrap; }
.ch-content .scoreboard .result-label { font-size: 17px; font-weight: 600; margin-top: 10px; }
.ch-content .bracket-scroll { overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 0 16px; }
.ch-content .bracket-tree { display: flex; align-items: stretch; gap: 22px; width: max-content; padding-right: 18px; }
.ch-content .bracket-round { flex: 0 0 276px; width: 276px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; }
.ch-content .bracket-round h3 { font-size: 13px; padding: 0 3px; }
.ch-content .bracket-round .round-matches { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 14px; }
.ch-content .bracket-match { position: relative; border-radius: 15px; padding: 10px; }
.ch-content .bracket-match::after { content: ""; position: absolute; left: 100%; top: 50%; width: 23px; height: 1px; background: var(--line); }
.ch-content .bracket-round:last-child .bracket-match::after { display: none; }
.ch-content .bracket-match .team-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 0; }
.ch-content .bracket-match .team-line.winner { font-weight: 600; }
.ch-content .bracket-match .team-line .mono { min-width: 22px; text-align: right; }
.ch-content .bracket-match.is-human { border-color: var(--ink-soft); }
.ch-content .round-picker { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-top: 10px; }
.ch-content .round-picker a { min-height: 38px; flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 11px; background: var(--control); }
.ch-content .detail-back { min-height: 34px; display: flex; align-items: center; gap: 5px; color: var(--ink-soft) !important; font-size: 12px; margin-bottom: 10px; }
.ch-content .notice { padding: 12px 14px; border-radius: 16px; background: var(--ch-selected); font-size: 12px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .ch-content .ch-btn:active { transform: none; }
}
.ch-content .team-row.is-human .pos, .ch-content .rating-row.is-human > .mono, .ch-content .match-row.is-human .match-score { color: var(--ink); }
.ch-content .side-mark { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.ch-content .side-mark.s1 { background: var(--blue); }
.ch-content .side-mark.s2 { background: var(--red); }
.ch-content .side-caption { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.ch-content .lead-card { padding: 14px 14px 10px; }
.ch-content .lead-chart { display: block; width: 100%; height: 118px; overflow: visible; }
.ch-content .lead-chart .zero { stroke: var(--line); stroke-width: 1; }
.ch-content .lead-chart .up { fill: var(--blue); fill-opacity: var(--fill-alpha); }
.ch-content .lead-chart .down { fill: var(--red); fill-opacity: var(--fill-alpha); }
.ch-content .lead-chart .line { fill: none; stroke: var(--ink-soft); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.ch-content .lead-chart .tick { stroke: var(--ink-faint); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-content .lead-axis { display: flex; justify-content: space-between; margin-top: 6px; font: 10px var(--f-mono); color: var(--ink-soft); }
.ch-content .duel { display: grid; gap: 12px; }
.ch-content .duel-row { display: grid; grid-template-columns: 34px minmax(0,1fr) 34px; gap: 8px; align-items: center; }
.ch-content .duel-row b { font: 500 13px var(--f-mono); text-align: center; }
.ch-content .duel-row .lab { grid-column: 1 / -1; font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: -8px; }
.ch-content .duel-track { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--line); }
.ch-content .duel-track i { display: block; height: 100%; }
.ch-content .duel-track i.s1 { background: var(--blue); }
.ch-content .duel-track i.s2 { background: var(--red); }
.ch-content .event-list { list-style: none; margin: 0; padding: 2px 12px; }
.ch-content .event-list li { display: grid; grid-template-columns: 52px 12px minmax(0,1fr); gap: 8px; align-items: center; min-height: 42px; border-bottom: 1px solid var(--line); font-size: 12px; }
.ch-content .event-list li:last-child { border: 0; }
.ch-content .event-list .mono { color: var(--ink-soft); font-size: 11px; }
.ch-content .form-mark, .ch-content .lot-mark { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; padding: 1px 5px; border-radius: 6px; background: var(--resume-tag); color: var(--ink); font: 500 10px/1.5 var(--f-mono); white-space: nowrap; }
.ch-content .rating-row.wide { grid-template-columns: 22px 18px minmax(0,1fr) 44px 44px; }
.ch-content .rating-row.stars-col { grid-template-columns: 22px 18px minmax(0,1fr) auto; }   /* 0.2.31 (K1) */
.ch-content .rating-row.stars-col.head > span:last-child { text-align: right; }
.ch-content .rating-row.stars-col > a { cursor: pointer; }
.ch-content .rating-row.head { min-height: 28px; font-size: 10px; color: var(--ink-soft); }
.ch-content .rating-row.head span:nth-last-child(-n+2) { text-align: right; }
.ch-content .mv { font: 10px var(--f-mono); text-align: center; color: var(--ink-faint); }
.ch-content .mv.up { color: var(--ok); }
.ch-content .mv.down { color: var(--ink-soft); }
.ch-content .rating-row .lvl { text-align: right; font: 13px var(--f-mono); color: var(--ink-soft); }
.ch-content .wl { display: inline-flex; gap: 3px; vertical-align: middle; }
.ch-content .wl i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font: 500 10px var(--f-mono); font-style: normal; background: var(--ch-selected); color: var(--ink); }
.ch-content .run-card { padding: 12px 14px; }
.ch-content .run-card .status-line { margin: 0; }
.ch-content .run-card .progress-track { margin: 8px 0 12px; }
.ch-content .team-line.tbd span:not(.mono) { color: var(--ink-soft); font-style: italic; }
.ch-content .round-picker button { min-height: 38px; flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 11px; background: var(--control); cursor: pointer; }
.ch-content .round-picker button[aria-pressed="true"] { background: var(--ch-selected); color: var(--ink); }
.ch-content .service { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; }
.ch-content .service .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ch-content .pick-group { margin-top: 16px; }
.ch-content .pick-list { padding: 4px 8px; }
.ch-content .pick-team { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); background: var(--ch-clear); text-align: left; cursor: pointer; }
.ch-content .pick-team:last-child { border: 0; }
.ch-content .pick-team .mono { color: var(--ink-soft); font-size: 12px; }
.ch-content .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
/* ---- 0.1.58: what the game needs on top of the mock-up (tokens only, no colour literals) ---- */
.ch-content :is(a, button, summary, input, select, [role="button"]):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* no href anywhere (task 17): the tap targets are <a role="button"> and <button> — make both
   behave like the mock-up's links */
.ch-content [role="button"], .ch-content button { cursor: pointer; }
.ch-content button.detail-back { border: 0; background: var(--ch-clear); padding: 0; }
.ch-content .ch-btn { margin: 0; height: auto; font-size: 14px; color: var(--ink); }
.ch-content .ch-btn.primary { color: var(--sheet); }
.ch-content .ch-btn + .ch-btn, .ch-content .ch-btn + .text-btn { margin-top: 8px; }
.ch-content .text-btn { width: 100%; margin: 4px 0 0; font-size: 13px; }
.ch-content .action-card .next-secondary { margin-top: 10px; }
.ch-content .rule-card .muted { margin-top: 6px; }
.ch-content .legend.pick-lead { padding: 12px 2px 0; }
.ch-content .swipe-hint { margin-bottom: 4px; }
.ch-content .thirds-note { margin: -4px 0 10px; }
.ch-content .scoreboard .when { margin-top: 8px; }
.ch-content .notes { margin-top: 10px; }
.ch-content .scoreboard + .ch-btn { margin-top: 12px; }
/* the flag: the game's own component (flags.js) in the mock-up's 22×15 frame (task 20) */
.ch-content .flag { width: 22px; height: 15px; flex: 0 0 22px; border-radius: 3px; font-size: 13px; }
.ch-content .flag.flag-plate { font-size: 5.5px; letter-spacing: 0; }
.ch-content .team-name.tbd > span { color: var(--ink-soft); font-style: italic; }
/* a team name with a form or lot mark still wraps inside its cell, the marks do not */
.ch-content .standings .name-cell a { cursor: pointer; }
.ch-content .form-mark { cursor: pointer; position: relative; }
.ch-content .form-mark::after { content: ""; position: absolute; inset: -8px -4px; }
/* contrast (Д-01 §2.3): the qualified place number is ink; only the ✓ is green */
.ch-content .standings .team-row.qualified .pos { color: var(--ink); }
/* secondary text on a selected surface is ink (4,27 → 14,18 in Air light) */
.ch-content .segmented button { color: var(--ink); }
.ch-content .notice { color: var(--ink); }
/* the calendar's stage filter */
.ch-content .filter-row select { color: var(--ink); }
/* the whole row is the target for a match, the bracket card too */
.ch-content .match-row, .ch-content .bracket-match { display: grid; cursor: pointer; }
.ch-content .bracket-match { display: block; }
.ch-content .match-row:active, .ch-content .bracket-match:active { background: var(--ch-selected); }
.ch-content .match-row.is-human:active { background: var(--line); }
/* the pick screen reuses the app's own switch (Settings) — the mock-up's was a picture of one */
.ch-content .toggle-row { cursor: pointer; }
.ch-content .toggle-row .switch { flex: 0 0 51px; }
/* the third places: rank · team · group · points · ± · dots for (task 8) */
.ch-content .rating-row.third { grid-template-columns: 22px minmax(0, 1fr) 26px 26px 36px 30px; }
.ch-content .rating-row.third > :nth-child(n+3) { text-align: right; }
.ch-content .rating-row.third strong { font: 500 13px var(--f-mono); }
.ch-content .rating-row.third.head { min-height: 28px; font-size: 10px; color: var(--ink-soft); }
.ch-content .rating-row.third.through > .mono:first-child { color: var(--ok); }
.ch-content .rating-row.cut { display: block; min-height: 0; padding: 6px 3px; text-align: center; font-size: 10px;
  letter-spacing: .04em; color: var(--ink-soft); border-bottom: 1px dashed var(--ink-faint); }
.ch-content .rating-row.wide > a, .ch-content .rating-row.third > a { cursor: pointer; }
/* the rating list's movement mark sits in its own column */
.ch-content .rating-row .mv { white-space: nowrap; }
/* the lead graph's axis never wraps into the chart */
.ch-content .lead-axis span:nth-child(2) { text-align: center; }
@media (prefers-reduced-motion: reduce) { .ch-content .ch-btn:active { transform: none; } }
.ch-content .row2 > .ch-btn { margin-top: 0; }
/* `.sheet h3` is the small-caps label of the other sheets; inside the championship an h3 is a heading */
.ch-content h3 { text-transform: none; letter-spacing: normal; color: var(--ink); margin: 0; }
/* «move 100» is wider than «хід 100»: the move column takes what its words need, never wraps */
.ch-content .event-list li { grid-template-columns: minmax(52px, max-content) 12px minmax(0, 1fr); }
.ch-content .event-list .mono { white-space: nowrap; }
/*
 * 0.1.58a · two defects from the first look on an iPhone (Слава, 25.09).
 *
 * 1. A NUMBER NEVER BREAKS. «+176» came out as «+17» over «6»: the mock-up sized every number
 *    column for its own data (32 px), and a real group of three reaches four characters. Numbers
 *    stay on one line, and the ± column — the only one that reaches four — is wider.
 * 2. A LONG NAME WRAPS ITS WORDS, NOT ITS FLAG. «Саудівська Аравія» did not fit beside its flag,
 *    so the flag went up to a line of its own while the other side kept it inline: two different
 *    layouts in one card. The side no longer wraps; the name inside it does.
 */
.ch-content .standings td, .ch-content .standings th { white-space: nowrap; }
.ch-content .standings td.name-cell { white-space: normal; }
.ch-content .standings .diff-col { width: 42px; }
.ch-content .full-table { min-width: 540px; }
.ch-content .full-table .num-col { width: 38px; }
.ch-content .full-table .diff-col { width: 44px; }
.ch-content .versus .side { flex-wrap: nowrap; }
.ch-content .versus .side > span:not(.flag-case) { min-width: 0; }
.ch-content .rating-row.third { grid-template-columns: 22px minmax(0, 1fr) 26px 26px 42px 34px; }
.ch-content .rating-row > * { white-space: nowrap; }
.ch-content .rating-row > a { white-space: normal; }
.ch-content .metric strong { white-space: nowrap; }
.ch-content .metric.long strong { font-size: 18px; line-height: 1.6; }
/*
 * 0.1.58b · THE BRACKET AS A TREE AGAIN, AND ALL OF IT ON ONE SCREEN.
 *
 * Connectors (Слава's photo, 25.09): the mock-up's were 1 px stubs of `--line` — 10 % grey in Air —
 * sticking out of each card and joining nothing. Now every column has the same height (`--rows`
 * slots), a tie sits in the middle of its slot, and the joins are half-height borders: out of each
 * card to the middle of the gap, down (or up) to where its pair meets, and in to the next card —
 * which sits exactly there, because its slot is two of the previous column's. `--ink-faint`, 1.5 px:
 * an existing token, no new one.
 */
.ch-content .bracket-tree { --slot: 118px; --half: 11px; gap: calc(2 * var(--half)); }
.ch-content .bracket-round .round-matches { display: flex; flex-direction: column; justify-content: flex-start;
  gap: 0; flex: none; height: calc(var(--rows, 16) * var(--slot)); }
.ch-content .bracket-round .slot { position: relative; flex: 1 0 0; min-height: 0; display: flex; align-items: center; }
.ch-content .bracket-round .slot > .bracket-match { width: 100%; }
.ch-content .bracket-match::after { display: none; }
.ch-content .bracket-round:not(:last-child) .slot::after { content: ""; position: absolute; right: calc(-1 * var(--half));
  width: var(--half); height: 50%; border-right: 1.5px solid var(--ink-faint); box-sizing: border-box; }
.ch-content .bracket-round:not(:last-child) .slot:nth-child(odd)::after { top: 50%; border-top: 1.5px solid var(--ink-faint); border-top-right-radius: 6px; }
.ch-content .bracket-round:not(:last-child) .slot:nth-child(even)::after { top: 0; border-bottom: 1.5px solid var(--ink-faint); border-bottom-right-radius: 6px; }
.ch-content .bracket-round:not(:first-child) .slot::before { content: ""; position: absolute; left: calc(-1 * var(--half));
  top: calc(50% - 0.75px); width: var(--half); border-top: 1.5px solid var(--ink-faint); }
/* «Уся сітка»: compact cards, narrow columns, no snapping — champ.js scales the tree to the sheet */
.ch-content .bracket-tools { display: flex; justify-content: flex-end; margin: 10px 0 0; }
.ch-content .bracket-tools .ch-btn { width: auto; min-height: 38px; padding: 8px 14px; font-size: 12px; }
.ch-content .bracket-tools .ch-btn[aria-pressed="true"] { background: var(--ch-selected); }
.ch-content .bracket-scroll.overview { overflow: hidden; scroll-snap-type: none; }
.ch-content .bracket-tree.overview { --slot: 64px; --half: 8px; padding-right: 0; }
/* 0.1.65: once two fingers have set the scale, the tree scrolls freely both ways — snapping to a
 * round would fight the scale, and «Уся сітка» (overflow hidden) must scroll once it is enlarged */
.ch-content .bracket-scroll.pinched { overflow-x: auto; scroll-snap-type: none; touch-action: pan-x pan-y; }
.ch-content .bracket-tree.overview .bracket-round { flex: 0 0 112px; width: 112px; }
.ch-content .bracket-match.compact { padding: 5px 8px; border-radius: 10px; }
.ch-content .bracket-match.compact .team-line { padding: 2px 0; gap: 6px; font-size: 12px; }
.ch-content .bracket-match.compact .team-name { gap: 5px; }

/* ======================================================================================================
 * ONLINE (0.1.85, «Онлайн 2 · Онлайн у грі»)
 * ====================================================================================================== */

/* «Грати з другом»: the code is the thing a person reads aloud or types — big, monospaced, unbreakable */
#sheet-online .onl-lead { color: var(--ink-soft); margin: 4px 0 6px; line-height: 1.45; }
#sheet-online .onl-code {
  margin: 14px 0 0; text-align: center;
  font-family: var(--f-mono); font-size: 26px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums;
  user-select: all; -webkit-user-select: all;
}
/* 0.1.85a: the code is a button — one tap copies it (П2) */
#sheet-online button.onl-code {
  display: block; width: 100%; padding: 6px 0; border: 0; border-radius: 12px; background: transparent;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#sheet-online button.onl-code:active { background: var(--line); }
#sheet-online .onl-tap { text-align: center; margin-top: 2px; }
#sheet-online .onl-status { text-align: center; color: var(--ink-soft); font-size: 14px; margin: 16px 0 4px; min-height: 1.4em; }
#sheet-online .text-btn { display: block; margin: 8px auto 0; }
#sheet-online .onl-rtt { text-align: center; font-size: 12px; color: var(--ink-faint); margin-top: 18px; }
.onl-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.onl-code-row input {
  min-width: 0; height: 48px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink);
  font-family: var(--f-mono); font-size: 16px; letter-spacing: 0.04em; text-transform: uppercase;
}
.onl-code-row input::placeholder { color: var(--ink-faint); }
.onl-code-row .secondary { width: auto; margin-top: 0; padding: 0 16px; }
/* 0.2.20 «Боти-гравці»: the bots on «Грати з другом» — the rating table's rows, each a button; the mark «бот» everywhere it shows */
#sheet-online .onl-bot-list { list-style: none; margin: 4px 0 0; padding: 0; }
/* 0.2.30b (Слава 17.10: the underlined link «Правила онлайн-гри» «ніби випадково тут з'явилась»): a row in the game's own
 * vocabulary — the grey of the segmented controls above it, an «i» in a circle, the title and what is inside, «›» */
.rules-row {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 4px; padding: 11px 14px;
  border-radius: 14px; background: var(--paper-deep);
  color: var(--ink); text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.rules-row:hover { background: color-mix(in srgb, var(--paper-deep) 82%, var(--ink) 18%); }
.rules-row:active { background: var(--line); }
.rules-row:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rules-row .rules-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sheet); color: var(--ink-soft); }
.rules-row .rules-ico svg { width: 18px; height: 18px; }
.rules-row .copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rules-row .copy strong { font-weight: 600; font-size: 15px; }
.rules-row .copy small { color: var(--ink-faint); font-size: 13px; }
.rules-row .chev { color: var(--ink-faint); font-size: 20px; line-height: 1; }
#sheet-online .onl-bot-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 2px; box-sizing: border-box;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#sheet-online .onl-bot-list button:active { background: var(--line); }
#sheet-online .onl-bot-list button:disabled { opacity: 0.5; }
#sheet-online .onl-bot-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet-online .onl-bot-lv { flex: none; color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.bot-mark {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 11px; line-height: 1.4; letter-spacing: 0.03em; color: var(--ink-soft); vertical-align: 1px; font-weight: 400;
}

/* 0.2.7 «Онлайн 3 · Акаунти»: the sheet «Акаунт» — the fields are the online code field's family, without the monospace */
#sheet-account .onl-lead { color: var(--ink-soft); margin: 4px 0 10px; line-height: 1.45; }
#sheet-account .acc-form { display: grid; gap: 10px; margin-top: 12px; }
#sheet-account .acc-form input, #sheet-account .acc-row input {
  min-width: 0; height: 48px; padding: 0 12px; box-sizing: border-box; width: 100%;
  border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px;   /* 16 px: iOS does not zoom into the field */
}
#sheet-account .acc-row input { text-transform: none; letter-spacing: 0; font-family: inherit; }
#sheet-account input::placeholder { color: var(--ink-faint); }
#sheet-account #acc-r-invite { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; }
#sheet-account .acc-form .primary, #sheet-account .acc-form .secondary { margin-top: 4px; }
#sheet-account .text-btn { display: block; margin: 8px auto 0; }
#sheet-account .acc-nick { font-size: 26px; font-weight: 600; text-align: center; margin: 10px 0 0; word-break: break-word; }
#sheet-account .acc-email { text-align: center; margin-top: 2px; }
#sheet-account .acc-status { text-align: center; color: var(--ink-soft); font-size: 14px; margin: 16px 0 4px; min-height: 1.4em; }
#sheet-account .acc-status.bad { color: var(--red, #c0392b); }
#sheet-account button:disabled { opacity: 0.55; }
/* 0.2.7c: «показати пароль» — the eye inside the field; the password shows only while it is held (pointer or Space/Enter) */
#sheet-account .acc-pw { position: relative; }
#sheet-account .acc-pw input { padding-right: 52px; }
#sheet-account .acc-eye {
  position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-faint); cursor: pointer;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent;
}
#sheet-account .acc-eye svg { width: 24px; height: 24px; display: block; pointer-events: none; }
#sheet-account .acc-eye.on { color: var(--ink); }
#sheet-account .acc-eye:disabled { opacity: 0.4; }
/* the good news that arrives with a link opened on another device — at the top, where it is seen without scrolling */
#sheet-account .acc-note { margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; background: rgba(46, 160, 67, 0.12); color: var(--ink); line-height: 1.45; font-size: 15px; }
/* «Чекаємо підтвердження…» — a calm pulse, no spinner */
#sheet-account .acc-wait { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-soft); font-size: 14px; margin: 14px 0 6px; }
#sheet-account .acc-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: acc-pulse 1.4s ease-in-out infinite; }
@keyframes acc-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #sheet-account .acc-dot { animation: none; opacity: 0.6; } }

/* the line over the board, online: my clock · the format · theirs. The running clock is lit, under 30 s red. */
.match-caption.is-online {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: 0.02em; text-overflow: clip;
}
.match-caption .oc {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  color: var(--ink-soft); font-weight: 600;
}
.match-caption .oc i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: none; }
.match-caption .oc.red i { background: var(--red); }
.match-caption .oc b { font-family: var(--f-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.match-caption .oc.run { background: var(--paper-deep); color: var(--ink); }
.match-caption .oc.low b { color: var(--red); }
.match-caption .oc-mid { color: var(--ink-faint); font-weight: 500; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 380px) { .match-caption .oc-mid { display: none; } }
/* 0.2.13b: the price of an online game, under the scoreboard for the whole game */
.match-lines { position: relative; z-index: 3; min-width: 0; }
.match-price {
  margin: -4px 16px 6px; text-align: center; font-size: 12px; line-height: 1.35; font-weight: 500;
  color: var(--ink-soft); font-variant-numeric: tabular-nums; text-wrap: balance;
}

/* the undo button turned «Здатися» */
.dock-btn.is-resign span { color: var(--red); }
.dock-btn.is-resign svg { display: none; }

/* ---- 0.1.87: the picker over every FIFA member, and the draw on screen (Р-283, Р-284) ---- */
.ch-content .pick-search { width: 100%; min-height: 44px; margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--control); font-size: 15px; }
/* the continents wrap rather than scroll sideways: a chip off the edge is a chip nobody finds (champ-sweep) */
.ch-content .pick-confs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ch-content .pick-confs button { flex: 0 0 auto; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--ch-clear); color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.ch-content .pick-confs button[aria-pressed="true"] { background: var(--ch-action); color: var(--sheet); border-color: var(--ch-action); }
.ch-content .pick-side { display: inline-flex; align-items: center; gap: 8px; }
.ch-content .pick-tag { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.ch-content .pick-tag.in { color: var(--ink); }
.ch-content .card.section, .ch-content .ch-card.section { margin-top: 12px; }
.ch-content .draw-now { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 15px; margin: 6px 0 4px; }
.ch-content .draw-arrow { color: var(--ink-soft); }
.ch-content .draw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
@media (min-width: 620px) { .ch-content .draw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ch-content .draw-group { padding: 8px 10px; }
.ch-content .draw-group .kicker { margin-bottom: 4px; }
/* 0.2.2 (task 4): a long name WRAPS instead of losing its end — at 393 px «Півн. Македонія», «Republic of Ireland» and
 * «Korea Południowa» were cut with «…» (17 names in three languages; tests/fixes-022-ui.js measures all 210) */
.ch-content .draw-slot { display: flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 0; font-size: 13px; line-height: 1.2; }
.ch-content .draw-slot > span { min-width: 0; overflow-wrap: break-word; }
.ch-content .draw-slot .tbd { color: var(--ink-soft); }
.ch-content .draw-slot.new { font-weight: 600; animation: draw-in .45s ease-out; }
.ch-content .draw-slot.you { font-weight: 600; }
/* 0.2.2 (task 4): the play-off pair — the same weight as every other name, two lines of its own */
.ch-content .draw-slot.slot { min-height: 36px; }
/* 0.2.4c: the pair is a .pair like on the group screens (rules at the end of this file); here it only takes the rest of the slot */
.ch-content .draw-slot .draw-pair { flex: 1; row-gap: 0; line-height: 1.2; }
.ch-content .draw-slot .pair-part { gap: 6px; }
.ch-content .draw-slot .pair-part > span:last-child { overflow-wrap: break-word; min-width: 0; }
.ch-content .draw-po { margin: 6px 0; }
@keyframes draw-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ch-content .draw-slot.new { animation: none; } }


/* 0.2.1 «Бета-тест»: the policy link under the question and in Settings — the game's ink, not the browser's default blue */
.sheet .hint a.beta-policy { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

/* 0.2.4b: the place the play-off decides — each flag by its own name, «🇸🇪 Швеція / 🇺🇦 Україна» (ui.js pairInner).
 * In a match's away column the flags stand on the outer side of their names, as every away name does: «Швеція 🇸🇪 / Україна 🇺🇦». */
.ch-content .pair { display: inline-flex; flex-wrap: wrap; align-items: center; column-gap: 5px; row-gap: 2px; min-width: 0; }
.ch-content .pair-part { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.ch-content .pair-sep { color: var(--ink-soft); }
.ch-content .match-row .away .pair { justify-content: flex-end; }
.ch-content .match-row .away .pair-part { flex-direction: row-reverse; }

/* ======================================================================================================
 * 0.2.7d — THE AVATAR AND THE ACCOUNT ON THE HOME SCREEN (рішення Слави 07.10)
 * One round component everywhere (js/core/avatar.js): --ava is its diameter, everything inside follows it.
 * ====================================================================================================== */
.ava {
  --ava: 28px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--ava); height: var(--ava); border-radius: 50%; overflow: hidden;
  background: var(--ava-bg, var(--paper-deep)); color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
  vertical-align: middle;
}
.ava b { font: 600 calc(var(--ava) * 0.46) / 1 var(--f-ui, inherit); letter-spacing: 0; }
.ava-dots svg { width: 100%; height: 100%; display: block; }
.ava-flag .ava-fg { display: block; font-size: calc(var(--ava) * 1.1); line-height: 1; transform: scale(1.5); }
.ava-plate { background: linear-gradient(90deg, var(--f1) 0 50%, var(--f2) 50% 100%); }
.ava-plate b { font: 700 calc(var(--ava) * 0.24) / 1 var(--f-mono, monospace); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }

/* the chip on the home screen: in the top left corner (.acc-left on .home-bar — рішення Слави 07.10, 0.2.7e); without the class — next to the gear */
.home-bar .acc-chip { grid-column: 2; justify-self: end; margin-right: 4px; }
.home-bar.acc-left .acc-chip { grid-column: 1 / span 2; justify-self: start; margin-right: 0; }
.acc-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  height: 36px; padding: 0 12px 0 4px; border: 0; border-radius: 18px;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink);
  font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: transform 0.13s ease, opacity 0.13s ease;
}
.acc-chip:active { transform: scale(0.96); opacity: 0.8; }
.acc-chip .nm { overflow: hidden; text-overflow: ellipsis; max-width: 12em; font-weight: 600; }
.acc-chip.out { padding-left: 10px; color: var(--ink-soft); }
.acc-chip.out svg { width: 18px; height: 18px; }
.acc-chip em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }

/* in the sheet: the big avatar over the nickname, a pencil says it can be changed */
/* ---- 0.2.31 (задача 16, Слава 17.10: «Акаунт» у браузері — усе в одне вікно без прокрутки) ----
 * The groups: the head (avatar, nickname, mail), the two buttons (rating, sign out), the nickname and the password, the deletion.
 * A phone keeps the old order, one under another; a wide window turns the head and the buttons into one row and the forms
 * into two columns, and the sheet widens to 860 px — 1090 × 890 scrolled 147 px, a 1280 × 720 laptop 317 px (0.2.29c). */
#sheet-account #acc-in:not([hidden]) { display: flex; flex-direction: column; }
#sheet-account .acc-cols { display: contents; }
#sheet-account .acc-head { order: 0; }
#sheet-account .acc-cols > .acc-col:first-child { order: 1; }
#sheet-account .acc-acts { order: 2; }
#sheet-account .acc-cols > .acc-col:last-child { order: 3; }
@media (min-width: 760px) and (min-height: 480px) {
  #sheet-account:has(#acc-in:not([hidden])) { max-width: 860px; }
  #sheet-account #acc-in:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  #sheet-account .acc-head { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center; margin-top: 4px; }
  #sheet-account .acc-head .acc-ava-btn { grid-row: 1 / span 2; margin: 0; }
  #sheet-account .acc-head .ava { --ava: 64px !important; }
  #sheet-account .acc-head .acc-nick { margin: 0; text-align: left; align-self: end; font-size: 24px; }
  #sheet-account .acc-head .acc-email { margin: 2px 0 0; text-align: left; align-self: start; overflow-wrap: anywhere; }
  #sheet-account .acc-acts { grid-column: 2; grid-row: 1; align-self: center; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  #sheet-account .acc-acts .secondary { margin-top: 0; }
  #sheet-account .acc-cols > .acc-col:first-child { grid-column: 1; grid-row: 2; }
  #sheet-account .acc-cols > .acc-col:last-child { grid-column: 2; grid-row: 2; }
  #sheet-account .acc-col > h3:first-child { margin-top: 18px; }
  #sheet-account .acc-status { grid-column: 1 / -1; }
}
#sheet-account .acc-ava-btn { position: relative; display: block; margin: 8px auto 0; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
#sheet-account .acc-ava-btn i { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sheet, var(--paper)); color: var(--ink-soft);
  box-shadow: 0 1px 4px rgba(23, 29, 40, 0.2); }
#sheet-account .acc-ava-btn i svg { width: 14px; height: 14px; }
#sheet-account .acc-ava-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 10px; margin: 8px 0 12px; }
#sheet-account .acc-ava-grid button { display: grid; place-items: center; padding: 3px; border: 0; background: none; border-radius: 50%; cursor: pointer; }
#sheet-account .acc-ava-grid button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--blue); }
#sheet-account .acc-ava-grid.flags { max-height: 40vh; overflow-y: auto; padding: 4px; }
#sheet-account #acc-ava-q { height: 44px; width: 100%; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px;
  background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
#sheet-account .acc-ava-empty { grid-column: 1 / -1; color: var(--ink-soft); font-size: 14px; text-align: center; }

/* online, over the board: the nickname and avatar in each clock chip */
/* 0.2.7f (Слава, iPhone): ONE SCOREBOARD. Online, the names and avatars are on the pill — and the pill grows to carry them;
 * the line under it keeps only the two clocks (each under its own side) and the format. */
#app.is-online-match .score-pill { min-width: 262px; max-width: 100%; box-sizing: border-box; padding-inline: 10px; gap: 8px; }
#app.is-online-match .score-side { min-width: 0; flex: 0 1 auto; }
#app.is-online-match .score-pill .pname { flex: 0 1 auto; min-width: 2.5ch; }
#app.is-online-match .score-pill .pname { color: var(--ink); font-size: 13px; max-width: 9ch; }
#app.is-online-match .score-pill .flag-slot .ava { box-shadow: 0 0 0 1.5px var(--panel, #fff), 0 1px 4px rgba(23, 29, 40, 0.18); }
#app.is-online-match .score-side { gap: 5px; }
@media (max-width: 380px) {
  #app.is-online-match .score-pill { min-width: 0; padding-inline: 7px; gap: 5px; }
  #app.is-online-match .score-pill .pname { font-size: 11.5px; max-width: 7ch; }
  #app.is-online-match .score-side { gap: 3px; }
}
/* 0.2.21 «Годинник на хід» (Р-504, Н2·2 — макет Г1): the clock lives on the scoreboard, a line under each name.
 * The name stays level with the score in every state (Слава's correction): the side's items align to the top, the name and
 * the score share a 20-px line, and the time line (or the mark «бот») hangs under the name. The time line is always there —
 * empty when there is nothing to say — so the scoreboard has one height in every state: nothing jumps. */
.pnb { display: contents; }
.ptime { display: none; }
#app.is-online-match.clock-line .score-side { align-items: flex-start; }
#app.is-online-match.clock-line .pnb { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 0 1 auto; }
#app.is-online-match.clock-line .score-side.red .pnb { align-items: flex-end; }
#app.is-online-match.clock-line .score-pill .pname { line-height: 20px; max-width: 100%; }
#app.is-online-match.clock-line .score-pill .pscore,
#app.is-online-match.clock-line .score-pill .vs { line-height: 20px; }
#app.is-online-match.clock-line .score-pill .vs { align-self: flex-start; }
#app.is-online-match.clock-line .score-dot { margin-top: 6px; }
#app.is-online-match.clock-line .score-side .flag-slot { margin-top: -1px; }
#app.is-online-match.clock-line .score-pill { align-items: flex-start; }
#app.is-online-match.clock-line .ptime {
  display: flex; align-items: center; gap: 5px; min-height: 14px; line-height: 1.2;
  font-family: var(--f-mono); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--ink-faint); font-weight: 400;
}
.ptime .pt-mv { font-weight: 700; font-size: 12px; color: var(--ink); }
.ptime .pt-mv.hot { color: var(--red); }
.ptime .pt-res { display: inline-flex; align-items: center; gap: 2px; }
.ptime .pt-res.run { color: #b06a00; font-weight: 700; font-size: 12px; }
:root[data-theme="dark"] .ptime .pt-res.run { color: #f0b04a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ptime .pt-res.run { color: #f0b04a; } }
.ptime .pt-hg { width: 8px; height: 10px; flex: none; }
.ptime .bot-mark { margin-left: 0; padding: 0 4px; line-height: 12px; font-size: 10px; font-family: var(--f-ui); }
/* the caption under it says what the clock is doing — the format, «іде запас», «пауза» */
.match-caption.clock-warn { color: #b06a00; }
:root[data-theme="dark"] .match-caption.clock-warn { color: #f0b04a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .match-caption.clock-warn { color: #f0b04a; } }
/* the rule line sits under the price, in the same type; with the price there, the two keep together */
#match-price:not([hidden]) + #match-rule { margin-top: -6px; }

/* Settings: the account line carries the avatar too */
#set-account .ava { margin-right: 8px; }

/* 0.2.8 «Пауза за згодою»: four durations in a 2 × 2 grid; the turn card answers a tap while a pause is on */
.pause-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.pause-opts:empty { display: none; }
.pause-opts .secondary { margin: 0; width: 100%; }
#sheet-pause .pause-note { color: var(--ink-soft, inherit); }

/* 0.2.10 «Онлайн 4 · Рейтинг»: the line after a game, the opponent row of an online result, the sheet «Рейтинг» */
#sheet-over .over-points { color: var(--ink); font-weight: 600; }
.over-who { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.over-who .over-opp { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.over-who .text-btn { font-size: 14px; }
#sheet-rating .rt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
#sheet-rating .rt-head .hint { margin: 2px 0 0; }
#sheet-rating .rt-nick { margin: 0; font-weight: 600; font-size: 18px; word-break: break-word; }
#sheet-rating .rt-big { font-family: var(--f-display); font-size: 44px; line-height: 1.1; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
#sheet-rating .rt-place { font-family: var(--f-ui); font-size: 16px; color: var(--ink-soft); margin-left: 12px; vertical-align: middle; }
#sheet-rating .rt-line { margin: 0 0 8px; color: var(--ink-soft); }
#sheet-rating .rt-line b { color: var(--ink); font-weight: 600; }
#sheet-rating .rt-warn { margin: 6px 0; color: var(--red); }
#sheet-rating .rt-rows { list-style: none; margin: 0; padding: 0; }
#sheet-rating .rt-rows li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
#sheet-rating .rt-rows li.me { font-weight: 600; }
#sheet-rating .rt-pl { width: 2.2em; text-align: right; color: var(--ink-faint); font-variant-numeric: tabular-nums; flex: none; }
#sheet-rating .rt-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet-rating .rt-r { font-variant-numeric: tabular-nums; flex: none; }
#menu-rating[role="button"] { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
/* 0.2.10a «Рейтинг» — the section's root: the way to the table, then how the rating is counted */
/* 0.2.26b: «Правила онлайн-гри» in the game */
#sheet-online-rules .orules h2 { font-size: 17px; margin: 18px 0 6px; }
#sheet-online-rules .orules p { margin: 0 0 10px; color: var(--ink-soft); line-height: 1.45; }
#sheet-online-rules .orules a { color: inherit; }
#sheet-rating-home .rt-about { margin-top: 14px; }
/* 0.2.27 (А7): «Хочу грати в турнірах» */
#sheet-rating .tourney { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
#sheet-rating .tourney .hint { margin: 0; }
#sheet-rating-home .rt-about h3 { margin: 0 0 8px; }
#sheet-rating-home .rt-about p { margin: 0 0 10px; color: var(--ink-soft); line-height: 1.45; }
#sheet-rating-home .rt-mult { list-style: none; margin: 0 0 12px; padding: 0; }
#sheet-rating-home .rt-mult li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
#sheet-rating-home .rt-mult b { font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
/* 0.2.28b (Г5): the full method moved one page deeper — the same look there */
#sheet-rating-more .rt-about { margin-top: 14px; }
#sheet-rating-more .rt-about p { margin: 0 0 10px; color: var(--ink-soft); line-height: 1.45; }
#sheet-rating-more .rt-mult { list-style: none; margin: 0 0 12px; padding: 0; }
#sheet-rating-more .rt-mult li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
#sheet-rating-more .rt-mult b { font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
/* 0.2.28b (Г5): four rules and three counted examples */
#sheet-rating-home .rt-rules { margin: 0 0 14px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; line-height: 1.4; }
#sheet-rating-home .rt-examples { list-style: none; margin: 0 0 6px; padding: 0; }
#sheet-rating-home .rt-examples li { padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
/* 0.2.10b: the table's column heads, shown even while it is empty */
#sheet-rating .rt-cols { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }
#sheet-rating .rt-cols .rt-nm { padding-left: 38px; }
#sheet-rating .rt-empty { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }

/* 0.2.18e — рішення В2: «Оновіть застосунок» / «Оновіть сторінку» (js/app/app.js updateRequired) — above everything, once */
.update-req { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 2147483000; max-width: 460px; margin: 0 auto;
  background: var(--sheet, #fff); color: var(--ink); border: 1px solid var(--ink-faint); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.update-req p { margin: 0 0 10px; line-height: 1.4; }
.update-req .update-req-title { font-weight: 700; font-size: 1.05em; margin-bottom: 6px; }
.update-req-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ============================================================ LANDSCAPE (0.2.23) *//*

 * LANDSCAPE: THE BOARD TAKES THE WHOLE HEIGHT (0.2.23, «Інтерфейс: iPad і альбом», задачі 1–2; Р-299, C26 / Р-515).
 *
 * 0.1.25 put only the DOCK beside the board (from 860 px): the score pill and the caption stayed above it and ate ~90 px of
 * the height, and below 860 px — every iPhone on its side — the phone stack was kept, which left the board ~150 px tall
 * (замір 0.1.86, Р-277). Слава on the iPad (C26): «на горизонтальному розміщенні треба краще оптимізувати простір».
 *
 * Now, in any landscape window from 640 px wide, the screen is two columns: the board, as tall as the window, and a side
 * column that carries everything else — back and menu on top, the score pill under them, the caption, and the turn card with
 * the buttons at the BOTTOM, where the thumb of the hand holding a tablet or a phone on its side already is. The three
 * blocks keep their markup; only the grid places them (`grid-template-areas`), so nothing in the scripts changes.
 *
 * The side column: 240 px at least (the championship pill — two flags, two names, two scores — is 218 px in its compact form
 * of ≤ 380 px phones, used here; 254 px in its full one, measured by tests/landscape.js leaving the window), a fifth of
 * the width on a tablet (on an iPad the board is limited by its WIDTH: every pixel the column gives up is the board's), 320 at most. The notch: the board pads from the left inset, the column from the right.
 * 0.2.23a: the notch. On an iPhone on its side the camera takes ~59 px of one side (env(safe-area-inset-left/right)); the
 * column's own padding gave it up out of the 240 px, and the pill was left 165 px (tests/landscape.js, «+notch»). The column
 * is now its width PLUS the right inset, so what is inside it is the same with or without a notch.
 * The block sits at the END of the file: a media query adds no specificity, and the game screen's own rules come later than
 * the old 0.1.25 block did — they quietly won over its padding.
 */
@media (orientation: landscape) and (min-width: 640px) {
  #app {
    grid-template-columns: minmax(0, 1fr) calc(clamp(240px, 21vw, 320px) + var(--safe-r));
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "board head"
      "board cap"
      "board ."
      "board dock";
    column-gap: 0;
  }
  .game-head {
    grid-area: head;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    grid-template-areas: "back . menu" "pill pill pill";
    row-gap: 10px;
    padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 12px) 6px 4px;
  }
  .game-head > #btn-back { grid-area: back; }
  .game-head > #btn-menu { grid-area: menu; }
  .game-head > .score-pill { grid-area: pill; justify-self: stretch; min-width: 0; }
  /* the flash covered «the band between the two buttons»; here it covers the pill's own cell */
  .game-head > .capture-flash { grid-area: pill; position: relative; inset: auto; left: auto; right: auto; top: auto; bottom: auto; }
  .game-head::before { width: 100%; bottom: 0; }
  #app.is-online-match .score-pill { min-width: 0; }
  /* «Niebieskie : Czerwone» of a game «Удвох» in Polish needs every pixel of the 216 px pill: tighter gaps, no clipped names
   * (l10n-screens, pl, 852 × 393); the turn card's second line may take two lines rather than end in «…» */
  .score-pill { gap: 5px; padding-inline: 8px; }
  .turn-copy small { white-space: normal; text-overflow: clip; }
  /* the championship pill in the column: the compact form a ≤ 380 px phone uses (smaller names, tighter gaps), no fixed 254 px */
  #app.is-champ .score-pill { min-width: 0; padding-inline: 7px; }
  #app.is-champ .score-side { gap: 3px; }
  #app.is-champ .score-pill .pname { font-size: 9px; max-width: 6ch; }
  .match-lines { grid-area: cap; padding: 0 calc(var(--safe-r) + 12px) 0 4px; }
  .match-lines .match-caption, .match-lines .match-price { margin-left: 0; margin-right: 0; text-wrap: balance; }
  .board-stage {
    grid-area: board;
    padding: calc(var(--safe-t) + 8px) 12px calc(var(--safe-b) + 8px) calc(var(--safe-l) + 8px);
  }
  .game-dock {
    grid-area: dock;
    gap: 8px;
    padding: 6px calc(var(--safe-r) + 12px) calc(var(--safe-b) + 12px) 4px;
  }
  /* a tablet has the height and not the width: the two buttons one under the other, each with its icon and its whole label */
  .game-tools { grid-template-columns: minmax(0, 1fr); }
  .dock-btn { min-height: 46px; }
  .turn-card { min-height: 58px; }
  .review-bar { gap: 10px; }
  /* 0.2.23a: a toast over the game stands over the BOARD, not over the middle of the window — there it covered «назад» in the
   * column for 1.8 s (знімок 852 × 393, «Чемпіонат: Кабо-Верде – Саудівська Аравія»). Elsewhere (home, sheets) it stays centred. */
  body:has(#app.screen.on) .toast {
    left: calc((100% - clamp(240px, 21vw, 320px) - var(--safe-r) + var(--safe-l)) / 2);
    max-width: min(420px, calc(100vw - clamp(240px, 21vw, 320px) - var(--safe-r) - var(--safe-l) - 32px));
  }
  /* the replay bar in a 240–320 px column: five buttons share the width, the count, «Підсумок матчу» and the speed wrap onto
   * a second row rather than out of the window (tests/landscape.js, «review») */
  .review-line { gap: 4px; }
  .rev-btn { flex: 1 1 0; min-width: 0; padding: 0; }
  .rev-play { flex-grow: 1.4; }
  .rev-foot { flex-wrap: wrap; row-gap: 6px; }
  .rev-count { white-space: nowrap; }
}
/* a phone on its side: 375–430 px of height — every pixel of it is the board's; the pill and the card get a little smaller */
@media (orientation: landscape) and (min-width: 640px) and (max-height: 500px) {
  .game-head { row-gap: 6px; padding-top: calc(var(--safe-t) + 6px); }
  .game-head .icon-btn { width: 40px; height: 40px; }
  .game-head { grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .score-pill { height: 44px; }
  .board-stage { padding-top: calc(var(--safe-t) + 4px); padding-bottom: calc(var(--safe-b) + 4px); }
  .game-dock { gap: 6px; padding-bottom: calc(var(--safe-b) + 6px); }
  .turn-card { min-height: 48px; padding-block: 6px; }
  .game-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dock-btn { min-height: 40px; padding-inline: 6px; white-space: nowrap; }
  /* «Відмінити · 3» and «Наблизити» in 100 px each: the icons give way, the words do not wrap (0.2.23 замір 852 × 393) */
  .dock-btn svg { display: none; }
  .rev-note { display: none; }
  .rev-btn { min-height: 34px; }
  .rev-play { min-height: 38px; }
}

/*
 * THE HOME SCREEN ON A PHONE ON ITS SIDE (0.2.23, задача 2; Слава 04.10, прохід `[iphone-0.2.0]`, п. 6: «зникає логотип. Вигляд
 * головного екрану в альбомі мені взагалі не подобається»).
 *
 * 0.1.86 fitted the four cards under the name by hiding the mark, the wash and the tagline below 480 px of height (Р-277): the
 * stack was kept, the logo paid for it. Turned on its side, the screen has width to spare and no height, so it is two columns
 * instead: the mark, the name and the tagline on the left, at the size of a hero again; the cards on the right, as tall as the
 * window. The bar with the account and the settings stays across the top. The cards scroll inside their column if a person has
 * two games in progress and the «Почати нову гру» head — they never push the mark away again.
 * Not for the old address with the «переїхала» banner (`moved-on`): that build keeps its own layout.
 */
@media (orientation: landscape) and (min-width: 600px) and (max-height: 600px) {
  #home:not(.moved-on) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "bar bar" "hero modes";
  }
  #home:not(.moved-on) .home-bar { grid-area: bar; }
  #home:not(.moved-on) .hero { grid-area: hero; padding: 0 12px calc(var(--safe-b) + 18px) calc(var(--safe-l) + 24px); }
  #home:not(.moved-on) .hero .mark { display: grid; width: clamp(84px, 22vh, 112px); }
  #home:not(.moved-on) .hero .glow { display: block; width: min(40vw, 300px); }
  #home:not(.moved-on) #home-tagline, #home:not(.moved-on) .brand-sub { display: block; }
  #home:not(.moved-on) .brand h1 { margin-top: clamp(12px, 3.5vh, 20px); font-size: clamp(34px, 11vh, 46px); }
  #home:not(.moved-on) .modes {
    grid-area: modes;
    align-content: center;
    max-width: 460px; width: 100%; margin: 0;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 4px calc(var(--safe-r) + 20px) calc(var(--safe-b) + 10px) 8px;
  }
}

/*
 * THE CHAMPIONSHIP ON A WIDE SCREEN (0.2.23, задача 1: «широкі аркуші замість колонки ≤ 620 px; чемпіонат і сітка плей-оф на
 * всю ширину»; замір 0.1.86, Р-277).
 *
 * From 700 px the championship is a screen as wide as the window, not a 620 px card in the middle of an iPad: the pinned title
 * and the tabs run edge to edge, the content keeps a readable 1040 px column, and what is a LIST of equal things is laid out
 * in columns from 900 px — the twelve groups two by two, the tournament screen in two columns (the next match and what to do on the left,
 * the group or the path on the right). The bracket simply gets the width: more rounds side by side without scrolling.
 * Dialog sheets (settings, new game, the result) stay 620 px: they are read and closed, not lived in.
 */
/* from 700 px — where every other sheet becomes a 620 px card — the championship stays a whole screen: on a phone on its side
 * (852 × 393) a 620 px strip left the game's board showing on both sides of it */
@media (min-width: 700px) {
  .sheet.pane { max-width: none; }
  :is(#sheet-champ, .edge-ghost) .sheet-head, :is(#sheet-champ, .edge-ghost) :is(#ch-body, [data-gid="ch-body"]) { max-width: 1040px; margin-inline: auto; }
  :is(#sheet-champ, .edge-ghost) .ch-content { max-width: 760px; margin-inline: auto; }
  :is(#sheet-champ, .edge-ghost) .ch-content.bracket-view { max-width: none; }
  :is(#sheet-champ, .edge-ghost) .ch-content::before { left: calc(50% - 50vw); right: calc(50% - 50vw); }
}
@media (min-width: 900px) {
  :is(#sheet-champ, .edge-ghost) .ch-tabs { grid-template-columns: repeat(5, minmax(0, 168px)); justify-content: center; }
  :is(#sheet-champ, .edge-ghost) .ch-tabs button { font-size: 13px; }
  .ch-content.groups-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; align-items: start; }
  .ch-content.groups-view > * { grid-column: 1 / -1; }
  .ch-content.groups-view > .group-block { grid-column: auto; }
  /* the tournament screen: what to do now and the series / service on the left, the group or the path on the right; the right
   * column spans both rows, and if it is the taller one the slack goes under the service, not between the two left blocks */
  .ch-content.hub-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr;
    grid-template-areas: "line line" "a b" "c b"; column-gap: 24px; align-items: start; }
  .ch-content.hub-split > :first-child { grid-area: line; }
  .ch-content.hub-split > .hub-a { grid-area: a; }
  .ch-content.hub-split > .hub-b { grid-area: b; }
  .ch-content.hub-split > .hub-c { grid-area: c; }
  .ch-content.hub-split > .hub-b > .section:first-child { margin-top: 0; }
  /* lists of one thing after another (the calendar, statistics, a team, a match summary) keep a 760 px column — a row of
   * 1040 px puts the two teams of a match half a metre apart; the groups, the split tournament screen and the bracket take 1040 */
  :is(#sheet-champ, .edge-ghost) .ch-content { min-height: calc(100dvh - 150px); }
  :is(#sheet-champ, .edge-ghost) .ch-content.groups-view, :is(#sheet-champ, .edge-ghost) .ch-content.hub-split, :is(#sheet-champ, .edge-ghost) .ch-content.bracket-view { max-width: none; }
}

/* ------------------------------------------------------------------ 0.2.25 «Вміст для продажу» (Р-455)
   A locked golden level: the lock where «бета» stood; the offer modal — three sets, one picked, «Усе» marked. */
.level .lrating .lock { display: inline-block; width: 11px; height: 11px; vertical-align: -1px; }
.level .lrating .lock svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.level.gold.locked .lrating { color: var(--lv-gold); }
.segmented button.lv-net { position: relative; }
.segmented button .lock { position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; color: #b8860b; }
.segmented button .lock svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.offer-sets { display: grid; gap: 8px; margin: 4px 0 14px; }
.offer-set {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; align-items: start; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink);
  font: inherit; cursor: pointer;
}
.offer-set .dot { grid-row: 1 / span 2; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--ink-faint); }
.offer-set[aria-checked="true"] { border-color: var(--ink); background: var(--paper-deep); }
.offer-set[aria-checked="true"] .dot { border-color: var(--ink); box-shadow: inset 0 0 0 4px var(--sheet); background: var(--ink); }
.offer-set .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.offer-set .name { font-weight: 600; font-size: 15.5px; }
.offer-set .price { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-set .what { grid-column: 2 / span 2; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.offer-set .tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  color: #7a5a06; background: color-mix(in srgb, #c9961a 22%, transparent); }
.offer-set.gold .name { color: #a8790f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .offer-set .tag { color: #e8c35a; } :root:not([data-theme="light"]) .offer-set.gold .name { color: #e0b44a; } }
:root[data-theme="dark"] .offer-set .tag { color: #e8c35a; }
:root[data-theme="dark"] .offer-set.gold .name { color: #e0b44a; }
#sheet-offer .text-btn { display: block; margin: 6px auto 0; padding: 10px 14px; border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* 0.2.26a: «Покупки» — the sets as a list, each with its own button; no radio dot */
.store-sets .offer-set { grid-template-columns: 1fr auto; cursor: default; }
.store-sets .offer-set .what { grid-column: 1 / span 2; }
.store-sets .offer-set .buy { grid-column: 1 / span 2; justify-self: start; margin-top: 8px; font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; border: 0; background: var(--ink); color: var(--sheet); cursor: pointer; }
.store-sets .offer-set .buy:disabled { opacity: .5; cursor: default; }
.store-sets .offer-set .owned { font-weight: 600; font-size: 14px; color: var(--ok); white-space: nowrap; }
#sheet-store .text-btn { display: block; margin: 0 auto 6px; padding: 10px 14px; border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sale-own { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sale-chip { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); cursor: pointer; }
.sale-chip[aria-pressed="true"] { border-color: var(--ok); color: var(--ok); }
.champ-free { margin: 10px 0 0; }
/* 0.2.26b: the free-mode card on top of the championship's first screen */
.champ-free-card { margin-bottom: 12px; }
.champ-free-card .champ-free { margin: 4px 0 4px; font-weight: 600; }
.champ-free-card .ch-free-link { margin-top: 8px; padding: 8px 0; border: 0; background: transparent; color: inherit; font: inherit;
  font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ============================================================ 0.2.28 «Мій шлях» (Р-311; Ш3) — the rows reuse .menu-item.big */
.path-list .path-row strong { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 16px; }
.path-list .path-row.is-win strong { color: var(--ok); }
.path-list .path-row.is-partial strong { color: var(--ink-soft); font-weight: 500; }
.path-list .path-row:disabled { cursor: default; }
.path-empty { margin-top: 14px; }
/* 0.2.28b (Ш1) — «Мій шлях → Рейтинг»: the official rating's history */
.rp-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 6px 0 8px; color: var(--ink-soft); font-size: 14px; }
.rp-now b { font-family: var(--f-display); font-size: 38px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.rp-chart { display: block; width: 100%; height: auto; max-width: 560px; margin: 4px 0 6px; overflow: visible; }
.rp-axis { stroke: var(--line); stroke-width: 1; }
.rp-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.rp-tick, .rp-n { fill: var(--ink-soft); font-size: 10px; font-variant-numeric: tabular-nums; }
.rp-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.rp-open { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 4 4; }
.rp-dot { fill: var(--blue); }
.rp-dot.now { fill: var(--sheet); stroke: var(--blue); stroke-width: 2; }
.rp-dot.pre { fill: var(--sheet); stroke: var(--blue); stroke-width: 1.5; }   /* 0.2.48: before the 10th game — light */
.rp-list { list-style: none; margin: 10px 0 0; padding: 0; }
.rp-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rp-list li span { color: var(--ink-soft); }
.rp-list li b { font-variant-numeric: tabular-nums; font-weight: 600; }
.rp-list li.rp-champ span { color: var(--ink-faint); font-style: italic; }   /* 0.2.49 (CR3) */
.path-champ-head { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 10px; }
.path-champ-head > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.path-champ-head strong { font-size: 17px; font-weight: 600; }
.path-champ-head small { color: var(--ink-soft); font-size: 13px; }
#sheet-path-champ h3 { margin-top: 18px; }
.path-table.ch-content::before { display: none; }
/* 0.2.28 «Стерти все з пристрою» — the question stays on the page, beside the button that asked it */
.wipe-ask { display: grid; gap: 8px; margin: 4px 0 8px; padding: 12px; border: 1px solid color-mix(in srgb, var(--red) 34%, transparent); border-radius: 12px; }
.wipe-ask p { margin: 0; font-size: 14px; line-height: 1.4; }
/* 0.2.28b (Р3) — the reminder to a guest, a line under «Одна гра» on the home screen */
.home-guest { display: flex; align-items: center; gap: 8px; margin: -2px 0 2px; padding: 8px 6px 8px 14px; border-radius: var(--r-2);
  border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent); background: color-mix(in srgb, var(--blue) 6%, transparent); }
.home-guest[hidden] { display: none; }
.home-guest p { flex: 1; min-width: 0; margin: 0; font-size: 13px; line-height: 1.3; color: var(--ink); }
.home-guest-in { flex: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--blue); background: none; border: 0; padding: 8px 6px; cursor: pointer; }
.home-guest-x { flex: none; width: 34px; height: 34px; }

/* ---- 0.2.29a (Д-26, Р-588; P6, P7): the training game with «Учень» ----
 * The coach's line sits under the caption and keeps THREE lines of room for the whole game, said or not: a line that appears and
 * goes would move the board under the person's finger (the K2 jump of the lesson, 0.2.29). 17 px — the person is new and may be 55+. */
.coach-say {
  margin: -2px 14px 6px; padding: 7px 12px;
  min-height: calc(3 * 1.3em + 14px); box-sizing: border-box;
  border-radius: 14px;
  font: 500 17px/1.3 var(--f-ui); color: var(--ink); text-align: center; text-wrap: balance;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  display: flex; align-items: center; justify-content: center;
}
@media (max-height: 700px) { .coach-say { font-size: 15px; } }
/* «Підказка» beside «Відмінити» and «Усе поле» */
.game-tools.has-hint { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.learn-over h2 { margin: 8px 16px 6px; font: 600 26px/1.25 var(--f-ui); text-align: center; text-wrap: balance; }
.learn-over-score { margin: 0 0 6px; display: flex; justify-content: center; align-items: baseline; gap: 10px; font: 700 40px/1.1 var(--f-ui); font-variant-numeric: tabular-nums; }
.learn-over-score .b { color: var(--blue); }
.learn-over-score .r { color: var(--red); }
.learn-over-say { margin: 0 20px 16px; font-size: 17px; line-height: 1.4; text-align: center; color: var(--ink-soft); text-wrap: balance; }
.learn-over .primary, .learn-over .secondary { display: block; width: calc(100% - 32px); margin: 0 16px 10px; min-height: 56px; font-size: 19px; }
.coach-say[hidden] { display: none; }
/* the side column of a landscape screen stacks the dock's buttons — «Підказка» joins the stack there */
@media (orientation: landscape) and (min-width: 640px) { .game-tools.has-hint { grid-template-columns: minmax(0, 1fr); } }

/* 0.2.29b (Слава 17.10, знімки iPad і Safari): THE MARK SCALES AS ONE PICTURE. The dots and the gaps were set in pixels while
 * the tile shrank on short screens (76 px; 84 px on a wide one): the 5 × 5 grid stayed 65–77 px and its corner dots stood on
 * or outside the tile's rounded corner. Now they are fractions of the tile itself (container units), the proportions of the
 * phone's 114 px tile — the grid is 57 % of the tile at any size. A browser without container units keeps the pixels above. */
.mark { container-type: inline-size; }
.mark .grid5 { grid-template-columns: repeat(5, 6.2cqw); grid-template-rows: repeat(5, 6.2cqw); gap: 6.4cqw; }
.mark i { width: 6.2cqw; height: 6.2cqw; }

/* ---- 0.2.29c (Слава 17.10, макети «iPad · головний екран»: альбом — «поруч, великий», портрет — «+30 %») ----
 * On an iPad on its side the cards took the whole height: on an 11″ in Safari (1180 × 760) the mark disappeared and the name was
 * 36 px. Turned like a phone on its side — the mark, the name and the tagline on the left, big, the cards on the right — only on a
 * touch screen (a desktop window keeps its column). In portrait there is room above the cards: the mark and the name grow by a third. */
@media (orientation: landscape) and (min-width: 1000px) and (min-height: 601px) and (pointer: coarse) {
  #home:not(.moved-on) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "bar bar" "hero modes";
  }
  #home:not(.moved-on) .home-bar { grid-area: bar; }
  #home:not(.moved-on) .hero { grid-area: hero; container-type: normal; padding: 0 24px calc(var(--safe-b) + 40px) calc(var(--safe-l) + 40px); }
  /* 0.2.31 (задача 14, Р-622 — рішення Слави LB «поруч, середній»): mark 150–220 px (24 % of the height), the name 64–104 px */
  #home:not(.moved-on) .hero .mark { display: grid; width: clamp(150px, 24vh, 220px); }
  #home:not(.moved-on) .hero .glow { display: block; width: min(30vw, 340px); }
  #home:not(.moved-on) #home-tagline { display: block; font-size: 20px; margin-top: 10px; }
  #home:not(.moved-on) .hero .brand h1 { margin-top: clamp(14px, 2.6vh, 28px); font-size: clamp(64px, 11vh, 104px); }
  #home:not(.moved-on) .modes {
    grid-area: modes; align-content: center;
    max-width: 520px; width: 100%; margin: 0;
    overflow-y: auto; overscroll-behavior: contain;
    padding: 4px calc(var(--safe-r) + 40px) calc(var(--safe-b) + 16px) 8px;
  }
}
@media (min-width: 700px) and (orientation: portrait) {
  #home:not(.moved-on) .hero .mark { display: grid; width: clamp(120px, min(20vw, 17vh), 210px); }
  #home:not(.moved-on) .hero .glow { display: block; }
  #home:not(.moved-on) .hero .brand h1 { margin-top: clamp(16px, 2.4vh, 28px); font-size: clamp(56px, min(9.5vw, 8vh), 110px); }
  #home:not(.moved-on) #home-tagline { display: block; font-size: 20px; }
}

/* 0.2.31 (В-14, В-15): a set's own page — the theses */
.store-theses { margin: 6px 0 4px; padding-left: 20px; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.store-sets .offer-set .store-more { grid-column: 1 / -1; justify-self: start; margin: 2px 0 0; padding: 6px 0; min-height: 32px; font-size: 13px; }
/* 0.2.31 (В-21): the level's stars after the caption of a game with the AI — as on «Нова гра», a size smaller */
.match-caption .cap-stars { display: inline-flex; gap: 1.5px; align-items: center; margin-left: 6px; vertical-align: -1px; }
.match-caption .cap-stars i { display: block; width: 9px; height: 9px; color: var(--ink-faint); opacity: 0.45; }
.match-caption .cap-stars i.on { color: var(--ink-soft); opacity: 1; }
.match-caption .cap-stars.gold i.on { color: #c9961a; }   /* .level's --lv-gold — the same gold */
.match-caption .cap-stars svg { display: block; width: 100%; height: 100%; fill: currentColor; }
/* 0.2.31 (S4): «режим знімків» shows the App Store build — no «бета» tags (App Review 2.2: no betas in the store; the tags' fate
   in the build itself — the last package before submission, with the rest of «Сховане від гравців») */
html.shots .acc-chip em, html.shots .beta { display: none !important; }

/* 0.2.31b (F5): «Кольори збірних» beside «Завершити чемпіонат» — a compact switch in the right cell of the row */

/* 0.2.31b (N3): a team's name is its door — a pointer over it on a computer */
.ch-content [data-team] { cursor: pointer; }
/* 0.2.31b (Н-6, N6): two tinted rows in a row stay two — a 3 px gap of the card between them (the play-off rows of 0.2.31 В-27 do the same) */
.qual-view .team-row.qualified + .team-row.qualified td,
.qual-view .team-row.qualified + .team-row.is-human td,
.qual-view .team-row.is-human + .team-row.qualified td { border-top: 3px solid transparent; background-clip: padding-box; }

/* 0.2.31b (Н-7, N7): the qualifiers' ties — the bracket's card (a line per team, the score on the right, the winner bold) */
.ch-content .tie-cols .tie-match { padding: 6px 12px; margin: 0; }
.ch-content .tie-cols .tie-match .team-line { font-size: 13px; padding: 5px 0; }
.ch-content .tie-cols .tie-match .team-line .team-name { min-width: 0; }
.ch-content .tie-cols .tie-match.is-human { background: var(--ch-selected); }
/* 0.2.31b (Н-8, N8): room between one group's table and the next group's label */
.ch-content .table-card + .kicker { margin-top: 22px; }
/* 0.2.31b (Н-9, N9, Слава 17.10): the five tabs — each as wide as its word with the same padding, the same gap between every two.
 * Before: five equal cells (1796), so the gaps between the words and the grey of the selected one around its word differed by word. */
.ch-tabs, :is(#sheet-champ, .edge-ghost) .ch-tabs { display: flex; justify-content: space-between; gap: 4px; }
.ch-tabs button, :is(#sheet-champ, .edge-ghost) .ch-tabs button { flex: 0 0 auto; width: auto; padding: 0 10px; font-size: clamp(11px, 3.1vw, 13px); }
@media (min-width: 900px) { :is(#sheet-champ, .edge-ghost) .ch-tabs { justify-content: center; gap: 14px; } }

/* 0.2.31c (G2, G3, рішення Слави 18.10): the complaint — a reason to choose, a description across the whole sheet that grows with its text */
#sheet-who .who-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
#sheet-who .who-kinds button {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink-soft); font: inherit; font-size: 15px; cursor: pointer;
}
#sheet-who .who-kinds button[aria-checked="true"] { border-color: var(--ink); color: var(--ink); background: var(--sheet); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); font-weight: 600; }
#sheet-who #who-why {
  display: block; width: 100%; box-sizing: border-box; min-height: 96px; max-height: 50vh; resize: none; overflow-y: auto;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.4;   /* 16 px: iOS does not zoom into the field */
}
#sheet-who #who-why::placeholder { color: var(--ink-faint); }
#sheet-who .who-need { margin: 6px 0 12px; min-height: 1.3em; }
#sheet-who #who-go:disabled { opacity: 0.45; cursor: default; }
/* 0.2.31c (G6): the qualifiers' group headings — the size of «Група B» in the group stage (16 px, 600), not the small caps kicker */
.ch-content h3.q-group { font: 600 16px/1.35 var(--f-ui); letter-spacing: -.02em; margin: 0 0 8px; }
.ch-content .table-card + h3.q-group, .ch-content .q-group-more + h3.q-group { margin-top: 22px; }   /* 0.2.32 (E9): after «Матчі групи ›» too */
/* 0.2.31c (G4): «Кольори збірних» in Settings — two dots in the colours a championship match plays in */
#sheet-settings .tc-label { display: inline-flex; align-items: center; gap: 8px; }
#sheet-settings .tc-dots { display: inline-flex; gap: 3px; }
#sheet-settings .tc-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--side-1, var(--blue)); }
#sheet-settings .tc-dots i + i { background: var(--side-2, var(--red)); }
/* 0.2.31c (G7-В): the door to the qualifiers on «Турнір» — a title, the person's way in one line, a chevron */
.ch-content .qual-card .qual-door { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; text-decoration: none; cursor: pointer; }
.ch-content .qual-card .qd-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-content .qual-card .qd-title { font: 600 17px/1.3 var(--f-ui); letter-spacing: -.02em; }
.ch-content .qual-card .qd-sub { font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
/* 0.2.31c (G4-Ґ): the quiet line about the team colours, «Налаштування ›» */
.ch-content .tc-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 10px 2px 0; font-size: 13px; color: var(--ink-soft); }
.ch-content .tc-line .tc-dots { display: inline-flex; gap: 3px; }
.ch-content .tc-line .tc-dots i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ch-content .tc-line { flex-wrap: nowrap; }
.ch-content .tc-line > span:nth-child(2) { min-width: 0; }
.ch-content .tc-line .text-btn { margin: 0 0 0 auto; width: auto; flex: 0 0 auto; padding: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 13px; min-height: 32px; cursor: pointer; }
/* 0.2.31c (G7-Б): «Чемпіонат 2030 | Відбір 2030» on top of «Групи» */
.ch-content .groups-seg { margin-bottom: 12px; }
.ch-content .groups-seg button { font-size: 13px; }

/* ---------- 0.2.32 «Відгук» (Р-612; специфікація krapky-testers-program §3) ----------
 * Loud while the Google Play test lasts (FEEDBACK_LOUD in js/app/app.js): an amber pill on top of the home screen and an amber button
 * in the game's dock — amber is neither of the two players' colours, so it never reads as a part of the game. The text on it is the
 * ink (contrast ≥ 7:1 on #ffb340, ≥ 8:1 on #f5a524 — measured in the report of 0.2.32), never white on amber. */
:root { --fb: #f5a524; --fb-ink: #1d1d1f; }
.fb-loud {
  grid-column: 2; grid-row: 1; justify-self: end; margin-right: 6px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px 0 10px; border: 0; border-radius: 18px;
  background: var(--fb); color: var(--fb-ink); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--fb) 45%, transparent);
  transition: transform 0.13s ease, opacity 0.13s ease;
}
.fb-loud[hidden] { display: none; }
.fb-loud svg { width: 18px; height: 18px; flex: none; }
.fb-loud:active { transform: scale(0.96); opacity: 0.85; }
/* the gear stays on the same row (an item with a column but no row would go to the next free row) */
.home-bar:has(.fb-loud:not([hidden])) .acc-chip, .home-bar:has(.fb-loud:not([hidden])) .icon-btn { grid-row: 1; }
/* the account chip shares the row with it: its nickname gives way first (320 pt: chip + pill + gear = one row) */
.home-bar:has(.fb-loud:not([hidden])) .acc-chip { max-width: calc(100% - 142px); }
.home-bar:has(.fb-loud:not([hidden])) .acc-chip .nm { max-width: 7em; }
.home-bar:has(.fb-loud:not([hidden])) .acc-chip { overflow: hidden; }
/* a phone of 320–380 pt: «Sign in · BETA» + «Feedback» + the gear do not fit — the chip's «бета» gives way while the pill is there
   (tests/feedback-ui.js D, three languages, signed in and out) */
@media (max-width: 380px) { .home-bar:has(.fb-loud:not([hidden])) .acc-chip em { display: none; } }
.game-tools.has-fb { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.game-tools.has-fb.has-hint { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.fb-dock { box-shadow: inset 0 0 0 2px var(--fb); padding-inline: 12px; }
.fb-dock[hidden] { display: none; }
.fb-dock svg { color: var(--fb); }
/* a narrow phone: the dock button is its icon only (the label is its aria-label) — «Відмінити · 5» keeps its words */
@media (max-width: 400px) { .fb-dock span { display: none; } .fb-dock { padding-inline: 13px; } }
@media (orientation: landscape) and (min-width: 640px) {
  .game-tools.has-fb, .game-tools.has-fb.has-hint { grid-template-columns: minmax(0, 1fr); }
  .fb-dock span { display: inline; }
}
@media (orientation: landscape) and (min-width: 640px) and (max-height: 500px) {
  .game-tools.has-fb { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
  .fb-dock span { display: none; }
}
#sheet-feedback .fb-label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
#sheet-feedback .fb-select, #sheet-feedback .fb-text, #sheet-feedback #fb-name {
  display: block; width: 100%; margin: 0; box-sizing: border-box; padding: 11px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); background: var(--sheet); color: var(--ink); font: inherit; font-size: 16px;
}
#sheet-feedback .fb-text { resize: vertical; min-height: 96px; line-height: 1.35; }
#sheet-feedback .fb-text.small { min-height: 54px; }
#sheet-feedback .fb-verdict { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
#sheet-feedback .fb-verdict button {
  min-height: 56px; padding: 6px 4px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background: var(--sheet); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer; text-wrap: balance;
}
#sheet-feedback .fb-verdict button[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); color: var(--blue); }
#sheet-feedback .fb-verdict button[data-v="ok"][aria-pressed="true"] { border-color: var(--ok, #23a45e); box-shadow: inset 0 0 0 2px var(--ok, #23a45e); color: var(--ok, #23a45e); }
#sheet-feedback .fb-verdict button[data-v="fail"][aria-pressed="true"] { border-color: var(--red); box-shadow: inset 0 0 0 2px var(--red); color: var(--red); }
#sheet-feedback .fb-stars { display: flex; gap: 6px; margin: 0; }
#sheet-feedback .fb-stars button {
  width: 48px; height: 48px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: color-mix(in srgb, var(--ink) 25%, transparent); font-size: 26px; line-height: 1; cursor: pointer;
}
#sheet-feedback .fb-stars button.on { color: var(--fb); }
#sheet-feedback .fb-count { margin: 4px 0 0; min-height: 0; font-size: 12px; color: var(--ink-soft); text-align: right; }
#sheet-feedback .fb-count:empty { display: none; }
#sheet-feedback .fb-say { margin: 12px 0 0; color: var(--red); font-weight: 600; }
#sheet-feedback .fb-say[hidden] { display: none; }
#sheet-feedback #fb-send { margin-top: 14px; }
.fbl-list { list-style: none; margin: 0 0 16px; padding: 0; }
.fbl-list li { padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.fbl-head { margin: 0 0 4px; font-size: 13px; color: var(--ink-soft); }
.fbl-list li p:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }

/* 0.2.32 (Слава 18.10): «Як рахується рейтинг: докладно» — the table of multipliers (ratingMorePaint in js/app/app.js) */
#sheet-rating-more .rt-tw { overflow-x: auto; margin: 0 0 12px; }
#sheet-rating-more .rt-table { width: 100%; border-collapse: collapse; font-size: 15px; }
#sheet-rating-more .rt-table th, #sheet-rating-more .rt-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: middle; }
#sheet-rating-more .rt-table thead th { font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: normal; line-height: 1.2; vertical-align: bottom; }
#sheet-rating-more .rt-table th:first-child { text-align: left; padding-left: 0; }
#sheet-rating-more .rt-table td:last-child { padding-right: 0; }
#sheet-rating-more .rt-table tbody th { font-weight: 500; }
#sheet-rating-more .rt-table td:nth-child(3) { font-weight: 600; color: var(--ink); }
#sheet-rating-more .rt-lv { display: inline-flex; flex-direction: column; gap: 3px; align-items: flex-start; }
#sheet-rating-more .rt-stars { display: flex; gap: 2px; height: 9px; }
#sheet-rating-more .rt-stars i { display: block; width: 9px; height: 9px; color: var(--ink-faint); opacity: 0.45; }
#sheet-rating-more .rt-stars i.on { color: var(--ink); opacity: 1; }
#sheet-rating-more .rt-stars.gold i.on { color: var(--lv-gold); }
#sheet-rating-more .rt-stars svg { display: block; width: 100%; height: 100%; fill: currentColor; }
#sheet-rating-more .rt-note { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }
@media (max-width: 400px) {
  #sheet-rating-more .rt-table { font-size: 14px; }
  #sheet-rating-more .rt-table th, #sheet-rating-more .rt-table td { padding-inline: 3px; }
  #sheet-rating-more .rt-table thead th { font-size: 11px; }
  #sheet-rating-more .rt-table tbody th { font-size: 14px; white-space: normal; }
}
#sheet-rating-more { --lv-gold: #c9961a; }
@media (max-width: 340px) {
  #sheet-rating-more .rt-table, #sheet-rating-more .rt-table tbody th { font-size: 13px; }
  #sheet-rating-more .rt-table th, #sheet-rating-more .rt-table td { padding-inline: 2px; }
  #sheet-rating-more .rt-table thead th { font-size: 10px; letter-spacing: -0.01em; }
}

/* ===================================================================================================================
 * 0.2.32 «ЕКРАНИ БЛОКАМИ» (E1–E8, E10, E12-Б; рішення Слави 19.10, сторінка «Ескізи екранів 0.2.32»): the list screens as
 * iPhone settings are — a grey sheet, light cards with 12 pt corners, a coloured 29 pt square with our own glyph (dots joined
 * by lines, tools/glyphs.py → #gl-sprite) beside every row, the group's name above a card and its explanation under it.
 * Every control keeps its id: only the markup around it changed.
 * =================================================================================================================== */
:root { --gl-bg: var(--paper-deep); --gl-card: var(--sheet); --gl-press: rgba(125, 140, 160, 0.14); --gl-gold: #a8790f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gl-gold: #e0b44a; } }
:root[data-theme="dark"] { --gl-gold: #e0b44a; }
.sheet.gl-sheet { background: var(--gl-bg); padding-left: calc(var(--safe-l) + 16px); padding-right: calc(var(--safe-r) + 16px); }
.gl-sheet .grabber { background: var(--grid-edge); opacity: 0.5; }
.gl-sheet .icon-btn.close, .gl-sheet .icon-btn.back { background: var(--gl-card); border-radius: 50%; }
.sheet h3.gl-h { margin: 20px 16px 7px; }
.gl-sheet .sheet-head + h3.gl-h { margin-top: 10px; }
.gl { background: var(--gl-card); border-radius: 12px; overflow: hidden; }
.gl + .gl { margin-top: 14px; }
.gl-row {
  display: flex; align-items: center; gap: 12px; position: relative;
  width: 100%; min-height: 46px; padding: 0 14px; margin: 0;
  border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 16px; text-align: left;
}
button.gl-row, a.gl-row { cursor: pointer; text-decoration: none; }
button.gl-row:active, a.gl-row:active { background: var(--gl-press); }
button.gl-row:focus-visible, a.gl-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
button.gl-row:disabled { cursor: default; color: var(--ink-faint); }
.gl > .gl-row + .gl-row::before, .gl > .gl-row + .gl-col::before, .gl > .gl-col + .gl-row::before, .gl > .gl-col + .gl-col::before {
  content: ""; position: absolute; top: 0; right: 0; left: 55px; border-top: 1px solid var(--line);
}
.gl.ni > .gl-row + .gl-row::before, .gl > .gl-row.ni + .gl-row::before, .gl > .gl-row + .gl-row.ni::before { left: 14px; }
.gl-t { flex: 1; min-width: 0; padding: 11px 0; display: grid; gap: 2px; line-height: 1.3; }
.gl-t small { color: var(--ink-faint); font-size: 13px; line-height: 1.32; }
.gl-v { color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gl-ch { color: var(--ink-faint); font-size: 21px; line-height: 1; margin-left: -4px; flex: none; }
.gl-row.act .gl-t { color: var(--blue); }
.gl-row.danger .gl-t { color: var(--red); }
.gl-ic { width: 29px; height: 29px; border-radius: 7px; flex: 0 0 29px; display: grid; place-items: center; color: #fff; }
.gl-ic svg { width: 20px; height: 20px; overflow: visible; }
/* the glyphs are <use> clones of #gl-sprite: rules must match the ORIGINAL elements in the sprite (the clones take their styles) */
#gl-sprite symbol * { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#gl-sprite symbol .n, #gl-sprite symbol path[d$="z"] { fill: currentColor; stroke: none; }
.gl-ic.c-blue { background: #2f63d6; } .gl-ic.c-red { background: #d2414a; } .gl-ic.c-green { background: #2e9a5e; }
.gl-ic.c-orange { background: #e48a1c; } .gl-ic.c-gold { background: #c9961a; } .gl-ic.c-grey { background: #8a94a3; }
.gl-ic.c-violet { background: #6b5bd6; } .gl-ic.c-teal { background: #23999a; } .gl-ic.c-slate { background: #4f5b6b; }
.gl-ic.c-pink { background: #d6497b; }
.gl-ic.tc { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.gl-f { font-size: 13px; color: var(--ink-faint); line-height: 1.4; margin: 7px 16px 0; }
.gl-f:empty { display: none; }
.gl-f a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.gl-f.web-buy { font-size: 15px; color: var(--ink); margin: 10px 0 0; }   /* 0.2.44a (A4): the item page's note in the web */
#store-web { margin: 0 0 12px; }
.web-buy[hidden], .web-buy:empty { display: none; }
.gl-gap { height: 22px; }
/* a choice inside the card: the label row, the segmented control under it, aligned with the text (variant А, Слава 18.10 23:59) */
.gl-col { position: relative; padding: 0 14px 11px; }
.gl-col > .gl-row { padding: 0; }
.gl-col > .seg { margin-left: 41px; padding: 3px; border-radius: 10px; background: var(--gl-bg); }
.gl-col > .seg button { min-height: 34px; padding: 6px 4px; font-size: 14px; border-radius: 8px; }
.gl-col > .seg button[aria-pressed="true"] { background: var(--gl-card); }
.gl .switch { flex: none; }
.gl-row.is-off { opacity: 0.45; }
/* the account at the top, as the Apple ID card */
.gl-prof { min-height: 74px; gap: 14px; }
.gl-prof .gl-t b { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gl-ava { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--paper-deep); color: var(--ink-soft); }
.gl-ava .ava { width: 50px !important; height: 50px !important; }
.gl-ava svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; }
/* buttons and notes that stay inside a card (the wipe question, «Стерти надіслане») */
.gl-in { padding: 0 14px 12px 55px; margin-top: -4px; }
.gl-in .secondary { margin-top: 8px; }
.gl-in p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
@media (max-width: 360px) {
  .sheet.gl-sheet { padding-left: calc(var(--safe-l) + 10px); padding-right: calc(var(--safe-r) + 10px); }
  .gl-row { gap: 10px; padding: 0 12px; font-size: 15px; }
  .gl-col { padding: 0 12px 10px; }
  .gl-col > .seg { margin-left: 0; }
  .gl > .gl-row + .gl-row::before { left: 51px; }
}
.gl-dev { background: var(--gl-card); border-radius: 12px; padding: 2px 14px 14px; margin-top: 22px; }
.gl-dev h3 { margin-left: 0; }
#set-update .badge { margin-left: auto; }
.gl-tt { font-weight: 500; }
.gl-lone { margin-top: 22px; }
.gl-lone:not(:has(> :not([hidden]))) { display: none; }
/* 0.2.32 (E3): the rules — numbered in a circle, the dividers start after it */
ol.gl-rules { list-style: none; margin: 0; padding: 0; display: block; }
#sheet-rules .rules { max-width: none; }
ol.gl-rules > li.gl-row { display: block; padding: 11px 14px 11px 48px; font-size: 15px; line-height: 1.45; counter-increment: rr; }
ol.gl-rules > li.gl-row::after { content: counter(rr); position: absolute; left: 14px; top: 11px; width: 23px; height: 23px; border-radius: 50%;
  background: var(--gl-bg); color: var(--ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
ol.gl-rules > li.gl-row + li.gl-row::before { left: 48px; }
#sheet-rules .rules .gl-t { font-size: 15px; line-height: 1.45; display: block; }
/* 0.2.32 (E4–E6): the rating screens in cards */
#sheet-rating .rt-card .gl-prof .rt-nick { font-size: 18px; }
#sheet-rating .rt-num { padding: 0 14px 10px; }
#sheet-rating .rt-num .rt-big { margin: 0 0 4px; font-size: 40px; }
#sheet-rating .rt-num .rt-place { font-size: 13px; font-weight: 600; color: var(--ink); background: var(--gl-bg); padding: 3px 9px; border-radius: 10px; vertical-align: 8px; }
/* 0.2.48 (Р-753): «?» — preliminary until the 10th game; the same quiet weight as the place */
#sheet-rating .rt-pre { font-family: var(--f-ui); font-size: 0.55em; font-weight: 600; color: var(--ink-soft); margin-left: 4px; vertical-align: 0.5em; }
#sheet-rating .rt-pre-note { margin: 8px 4px 0; }
#sheet-rating .rt-num .rt-line { margin: 0; font-size: 14px; }
#sheet-rating .rt-num .hint { margin: 4px 0 0; }
#sheet-rating .rt-num:empty { display: none; }
#sheet-rating .rt-card > .gl-row + .rt-num, #sheet-rating .rt-num + .gl-row { position: relative; }
#sheet-rating .rt-num + .gl-row::before { content: ""; position: absolute; top: 0; right: 0; left: 55px; border-top: 1px solid var(--line); }
#sheet-rating #rating-table .rt-cols { padding: 8px 14px 6px; }
#sheet-rating #rating-table .rt-rows li { padding: 6px 14px; border-bottom: 0; position: relative; }
#sheet-rating #rating-table .rt-rows li + li::before { content: ""; position: absolute; top: 0; right: 0; left: calc(14px + 2.2em + 48px); border-top: 1px solid var(--line); }
/* 0.2.49 (Р-758, ескіз B «Острівець»): the own row — a rounded island in the blue tint, set in from the card's edges; no lines
   touch it, so the tint does not read as a hole in the table; the rating in blue */
#sheet-rating #rating-table .rt-rows li.me { background: color-mix(in srgb, var(--blue) 12%, transparent); margin: 2px 6px; padding-left: 8px; padding-right: 8px; border-radius: 10px; }
#sheet-rating #rating-table .rt-rows li.me::before, #sheet-rating #rating-table .rt-rows li.me + li::before { display: none; }
#sheet-rating #rating-table .rt-rows li.me .rt-r { color: var(--blue); }
#sheet-rating .rt-star { font-size: 0.72em; color: var(--ink-soft); margin-left: 1px; }
#sheet-rating #rating-table .rt-rows li.me .rt-star { color: inherit; }
#sheet-rating #rating-table .rt-empty { padding: 12px 14px; border-bottom: 0; }
#sheet-rating .rt-foot { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#sheet-rating .rt-foot .text-btn { padding: 0; min-height: 0; font-size: 13px; color: var(--blue); }
#sheet-rating .tourney { margin-top: 0; display: block; }
#sheet-rating-home .rt-examples { list-style: none; margin: 0; padding: 0; }
#sheet-rating-home .rt-examples li.gl-row { padding: 0 14px; border-bottom: 0; font-size: 15px; }
#sheet-rating-home .rt-examples .rt-pts { color: var(--ink); font-weight: 700; }
#sheet-rating-home #rating-about .gl-row .gl-t, #sheet-rating-more .gl-t { font-size: 15px; }
#sheet-rating-more .gl-lead { margin: 4px 16px 0; }
#sheet-rating-more .gl .rt-tw { margin: 0; }
#sheet-rating-more .gl .rt-table th:first-child { padding-left: 14px; }
#sheet-rating-more .gl .rt-table td:last-child { padding-right: 14px; }
#sheet-rating-more .gl .rt-table tbody tr:last-child th, #sheet-rating-more .gl .rt-table tbody tr:last-child td { border-bottom: 0; }
#sheet-rating-more .gl .rt-table tr.gold .rt-name { color: var(--lv-gold); }
@media (max-width: 400px) {
  #sheet-rating-more .gl .rt-table th:first-child { padding-left: 10px; }
  #sheet-rating-more .gl .rt-table td:last-child { padding-right: 10px; }
}
/* 0.2.32 (E8): «Покупки» */
#sheet-store .store-row .tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 9px; margin-left: 6px; vertical-align: 1px;
  background: color-mix(in srgb, #c9961a 18%, transparent); color: #9a6f0c; }
#sheet-store .store-row.gold .name { color: var(--gl-gold); }
#sheet-store .store-row .tag { color: var(--gl-gold); }
#sheet-store .store-row .price { color: var(--ink); font-weight: 600; }
#sheet-store .store-row .owned { color: var(--ok); font-weight: 600; font-size: 14px; }
#sheet-store .store-row .dev-note { color: var(--ink-soft); }
#sheet-store .gl-lead { margin: 2px 16px 0; }
#store-acct-move .gl-ic { background: transparent; }
/* 0.2.31e (HS2): «Історія серії» in a team's card — a championship per heading, a line of where it ended, its matches */
.ch-content .hist-line { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
.ch-content .hist-line b { color: var(--ink); font-weight: 600; }
.ch-content .match-list + h3.q-group, .ch-content .hist-line + h3.q-group { margin-top: 24px; }
.ch-content .hist-kicker { margin: 14px 0 6px; }
.ch-content .versus .side[data-team] { cursor: pointer; }
/* 0.2.32 (E9): a group of the qualifiers opens from its heading and from the line under its table */
.ch-content h3.q-group .q-group-link { all: unset; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: inherit; }
.ch-content h3.q-group .q-group-link .chev { color: var(--ink-faint); font-weight: 400; }
.ch-content h3.q-group .q-group-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.ch-content .q-group-more { display: flex; align-items: center; gap: 8px; width: 100%; margin: 6px 0 0; padding: 10px 14px; min-height: 44px;
  border: 0; border-radius: 12px; background: var(--ch-glass, var(--sheet)); box-shadow: var(--ch-shadow, none); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; text-align: left; }
.ch-content .q-group-more > span:first-child { flex: 1; }
.ch-content .q-group-more .chev { color: var(--ink-faint); font-size: 20px; line-height: 1; }
.ch-content .q-group-more:active { background: var(--gl-press); }
/* 0.2.32 (Слава 19.10 01:54): «Для розробника» → «Списки екранів: Плоско» — the same markup, close to the look before the blocks:
   no grey sheet, no cards, no glyphs, full-width lines between rows */
:root[data-lists="flat"] .sheet.gl-sheet { background: var(--sheet); padding-left: calc(var(--safe-l) + 20px); padding-right: calc(var(--safe-r) + 20px); }
:root[data-lists="flat"] .gl, :root[data-lists="flat"] .gl-dev { background: transparent; border-radius: 0; box-shadow: none; }
:root[data-lists="flat"] .gl-ic { display: none; }
:root[data-lists="flat"] .gl-row, :root[data-lists="flat"] .gl-col { padding-left: 0; padding-right: 0; }
:root[data-lists="flat"] .gl-col > .seg { margin-left: 0; background: var(--paper-deep); }
:root[data-lists="flat"] .gl > .gl-row + .gl-row::before, :root[data-lists="flat"] .gl > .gl-row + .gl-col::before,
:root[data-lists="flat"] .gl > .gl-col + .gl-row::before, :root[data-lists="flat"] .gl > .gl-col + .gl-col::before { left: 0; }
:root[data-lists="flat"] .gl-in { padding-left: 0; }
:root[data-lists="flat"] .sheet h3.gl-h { margin-left: 0; margin-right: 0; }
:root[data-lists="flat"] .gl-f { margin-left: 0; margin-right: 0; }
:root[data-lists="flat"] .gl-sheet .icon-btn.close, :root[data-lists="flat"] .gl-sheet .icon-btn.back { background: transparent; }
:root[data-lists="flat"] ol.gl-rules > li.gl-row { padding-left: 34px; }
:root[data-lists="flat"] ol.gl-rules > li.gl-row::after { left: 0; }
:root[data-lists="flat"] ol.gl-rules > li.gl-row + li.gl-row::before { left: 34px; }
:root[data-lists="flat"] #sheet-rating .rt-num { padding-left: 0; }
:root[data-lists="flat"] #sheet-rating #rating-table .rt-rows li { padding-left: 0; padding-right: 0; }
:root[data-lists="flat"] #sheet-rating-home .rt-examples li.gl-row { padding: 0; }
:root[data-lists="flat"] #sheet-rating-more .gl .rt-table th:first-child { padding-left: 0; }
:root[data-lists="flat"] #sheet-rating-more .gl .rt-table td:last-child { padding-right: 0; }
:root[data-lists="flat"] #sheet-store .gl-lead, :root[data-lists="flat"] #sheet-rating-more .gl-lead { margin-left: 0; margin-right: 0; }

/* 0.2.32a (C3): «Оновити» beside the table's name, as a pill you see */
.gl-hrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 20px 4px 7px 0; }
.gl-hrow h3.gl-h { margin: 0 0 0 16px; }
.gl-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px 0 10px; border: 0; border-radius: 17px;
  background: var(--gl-card); color: var(--blue); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.gl-pill svg { width: 18px; height: 18px; }
.gl-pill:active { background: var(--gl-press); }
.gl-pill:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gl-pill:disabled { opacity: .5; }
:root[data-lists="flat"] .gl-hrow h3.gl-h { margin-left: 0; }
/* 0.2.32a (перевірка Слави C1: «перемикачі погано реагують на дотик»): a tap is a tap — no double-tap zoom waiting on it — and the
   touch target reaches past the drawn switch (44 pt high, as iPhone asks). A guess from the code: not reproduced in Chromium (4 of 4
   taps toggled), so it is checked on the iPhone */
.switch, .switch input { touch-action: manipulation; }
/* 0.2.32b (C1b, iPhone Слави): a tap on the switch itself did nothing, a tap on the row's text (a <label for>) worked. So the
 * switch is now a <label> around its checkbox: the finger always lands on the label (the input takes no touches), and a label
 * is what demonstrably works on his iPhone. The hit area is a little larger than the drawn switch. */
label.switch { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
label.switch input { pointer-events: none; }
label.switch::before { content: ''; position: absolute; inset: -7px -8px -6px -10px; }

/* ===================================================================================================================
 * 0.2.33 «ЄДИНИЙ СТИЛЬ ЕКРАНІВ» (P1, S1–S7; рішення Слави 19.10, сторінка «Єдиний стиль екранів»): the rest of the list screens
 * in the blocks of 0.2.32 — the menu, «Нова гра», «Грати з другом», «Акаунт», «Відгук», the set's page, «На початковий екран»,
 * «Мій шлях» pages, «Поскаржитись», the online rules and the new «Політика конфіденційності»; the championship only aligned
 * (two rows of «Турнір»). Every id kept; the old classes stay beside the new ones where scripts or tests read them.
 * =================================================================================================================== */
.gl-f.gl-lead { margin: 2px 16px 12px; font-size: 14px; color: var(--ink-soft); }
.gl-f.gl-fs { display: grid; gap: 4px; }
.gl-f.gl-fs p { margin: 0; font-size: 13px; color: var(--ink-faint); line-height: 1.4; }
.gl-f.gl-fs p:empty, .gl-f.gl-fs p[hidden] { display: none; }
.gl-sheet .primary { margin-top: 18px; }
.gl-sheet h2.gl-h, .gl-doc h2.gl-h { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); margin: 20px 16px 7px; line-height: 1.3; }
.gl-doc > h2.gl-h:first-child { margin-top: 6px; }
.gl-tx { padding: 12px 14px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.gl-tx p { margin: 0 0 8px; } .gl-tx p:last-child { margin-bottom: 0; }
.gl-tx ul { margin: 0 0 8px; padding-left: 1.2em; } .gl-tx ul:last-child { margin-bottom: 0; }
.gl-tx li { margin: 0 0 4px; }
.gl-tx a { color: var(--blue); }
.gl-doc + .gl-lone { margin-top: 22px; }
#sheet-privacy, #sheet-online-rules { overflow-y: auto; }
/* the menu (S4): rows keep .menu-item (release-ui reads it) — its old flat look gives way to the row's */
.gl > .gl-row.menu-item { justify-content: flex-start; padding: 0 14px; border-bottom: 0; font-size: 16px; }
.gl > .gl-row.menu-item .gl-t small { color: var(--ink-faint); font-size: 13px; }
#sheet-menu .menu-list.gl-scroll { display: block; margin-top: 4px; }
#sheet-menu .gl-scroll > .gl + .gl { margin-top: 14px; }
#sheet-menu .sheet-head .lead { margin-bottom: 8px; }
@media (max-height: 740px) { #sheet-menu .gl > .gl-row.menu-item { padding: 0 14px; font-size: 15px; min-height: 42px; } #sheet-menu .gl-row .gl-t { padding: 8px 0; } }
/* «Нова гра» (S1): the level tiles in a card of their own */
.gl.gl-lv { padding: 10px; }
.gl.gl-lv .level { background: var(--gl-bg); border-color: transparent; }
.gl.gl-lv .level[aria-pressed="true"] { background: var(--gl-card); border-color: var(--ink); }
.gl.gl-lv .level.gold[aria-pressed="true"] { border-color: var(--lv-gold); }
#sheet-new .gl-f.gl-fs .level-note { margin: 0; font-size: 13px; color: var(--ink-soft); }
/* «Грати з другом» (S2) */
.gl > a.gl-row.rules-row { border-radius: 0; background: transparent; padding: 0 14px; gap: 12px; color: var(--ink); text-decoration: none; }
.gl > a.gl-row.rules-row:hover { background: transparent; }
.gl > a.gl-row.rules-row:active { background: var(--gl-press); }
.gl > .gl-row.onl-code-row { display: flex; gap: 12px; }
.gl > .gl-row.onl-code-row input { flex: 1; min-width: 0; height: 46px; border: 0; border-radius: 0; background: transparent; padding: 0; font-family: var(--f-mono); letter-spacing: 0.06em; font-size: 16px; color: var(--ink); }
.gl > .gl-row.onl-code-row input:focus { outline: none; }
.gl > .gl-row.onl-code-row:focus-within { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 12px; }   /* 0.2.34 (G2): outline, see #sheet-account below */
.gl > .gl-row .text-btn { margin: 0; width: auto; min-height: 40px; padding: 0 2px; color: var(--blue); font-weight: 600; flex: none; }
#sheet-online .gl > .gl-row.act { color: var(--blue); }
#sheet-online ul.onl-bot-list.gl { margin: 0; }
#sheet-online ul.onl-bot-list.gl li + li { border-top: 1px solid var(--line); }
#sheet-online ul.onl-bot-list.gl button { border-radius: 0; background: transparent; border: 0; }
#sheet-online.onl-wide #onl-col-make > .gl-lead:first-child { margin-top: 0; }
/* «Акаунт» and «Відгук» (S3): the fields are rows of a card */
#sheet-account .acc-fields { overflow: visible; }
#sheet-account .acc-fields .acc-field, #sheet-account form.gl .acc-field { gap: 12px; }
#sheet-account .acc-fields .acc-field input, #sheet-account form.gl .acc-field input {
  flex: 1; height: 46px; border: 0; border-radius: 0; padding: 0; background: transparent; }
#sheet-account .acc-fields .acc-field input:focus, #sheet-account form.gl .acc-field input:focus { outline: none; }
/* 0.2.34 (G2, перевірка 0.2.33a, Chrome): the ring was an inset shadow of the ROW, and the autofilled input's own inset shadow (the card colour,
   below) is painted over its parent's — the ring broke where the input lies. An outline is painted after the row's content, so it stays whole. */
#sheet-account .acc-fields .acc-field:focus-within, #sheet-account form.gl .acc-field:focus-within { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 12px; }
#sheet-account .acc-field.acc-pw { position: relative; }
#sheet-account .acc-field.acc-pw input { padding-right: 0; }
#sheet-account .acc-field .acc-eye { position: static; flex: none; margin-right: -10px; }
#sheet-account .acc-form { gap: 0; margin-top: 14px; }
#sheet-account .acc-form > .gl + .primary, #sheet-account .acc-form > .gl-f + .primary { margin-top: 14px; }
#sheet-account .acc-form > .primary + .gl { margin-top: 14px; }
#sheet-account .acc-form > .secondary { margin-top: 12px; }
#sheet-account #acc-tab { margin-top: 2px; }
#sheet-account .acc-head.gl { padding: 16px 14px 14px; text-align: center; }
#sheet-account .acc-acts.gl { display: block; margin-top: 14px; }
#sheet-account .acc-acts .gl-row.act .gl-t { color: var(--blue); }
#sheet-account form.gl.acc-row { margin-top: 0; }
#sheet-account .gl > .gl-row .text-btn { margin: 0; }
#sheet-account .gl-row.act .gl-t { color: var(--blue); }
@media (min-width: 700px) {
  #sheet-account .acc-head.gl { text-align: left; }
  #sheet-account .acc-acts.gl { display: block; margin-top: 0; }
}
#sheet-feedback .fb-label { display: block; margin: 20px 16px 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); }
#sheet-feedback .fb-text, #sheet-feedback #fb-name { border: 0; border-radius: 12px; background: var(--gl-card); }
#sheet-feedback .fb-topic-card { margin-top: 2px; }
#sheet-feedback .fb-topic-card .gl-row { gap: 12px; }
#sheet-feedback .fb-topic-card .fb-select { flex: 0 1 auto; max-width: 55%; width: auto; border: 0; background: transparent; color: var(--ink-faint); text-align: right; font: inherit; font-size: 16px; padding: 0 2px; }
#sheet-feedback .fb-verdict button { background: var(--gl-card); border-color: transparent; }
#sheet-feedback .fb-count { margin-right: 16px; }
.fbl-list.gl { padding: 0 14px; }
.fbl-list.gl li:last-child { border-bottom: 0; }
/* the set's page (S6) */
.gl-row.store-head { gap: 14px; }
.gl-ic.store-head-ic { width: 50px; height: 50px; flex-basis: 50px; border-radius: 12px; }
.gl-ic.store-head-ic svg { width: 32px; height: 32px; }
.gl-row.store-head b { font-size: 18px; font-weight: 600; }
ul.store-theses.gl { list-style: none; margin: 0; padding: 0; display: block; }
ul.store-theses.gl > li.gl-row { font-size: 15px; }
ul.store-theses.gl > li.gl-row::marker { content: none; }
ul.store-theses.gl .gl-t { line-height: 1.4; }
/* «Мій шлях» pages (P1): the lists are rows of a card, the glyph says how a game ended */
.gl.path-list { display: block; margin-top: 4px; }
.gl > .gl-row.menu-item.big { align-items: center; padding: 0 14px; }
.gl > .gl-row.menu-item.big .copy { padding: 10px 0; }
.gl.path-list + .gl-f { margin-top: 7px; }
#sheet-path-rating .rp-list { background: var(--gl-card); border-radius: 12px; padding: 4px 14px; }
/* «Поскаржитись» (P1): the reasons are rows, the chosen one ticked */
#sheet-who .who-kinds.gl { display: block; margin: 0; gap: 0; }
#sheet-who .who-kinds.gl button.gl-row { border: 0; border-radius: 0; background: transparent; box-shadow: none; font-weight: 400; justify-content: space-between; min-height: 46px; padding: 0 14px; color: var(--ink); }
#sheet-who .who-kinds.gl button.gl-row[aria-checked="true"]::after { content: "✓"; color: var(--blue); font-weight: 600; }
.gl.gl-area textarea { display: block; width: 100%; box-sizing: border-box; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 16px; padding: 12px 14px; resize: vertical; }
.gl.gl-area:has(> textarea[hidden]) { display: none; }
#sheet-who .who-need { margin: 7px 16px 0; }
/* the championship (S5): aligned, not redrawn — «Зіграти інші матчі» and the team colours are rows of a card */
.ch-content .ch-gl.gl { margin-top: 12px; background: var(--ch-glass, var(--gl-card)); border: 1px solid var(--ch-edge, transparent); box-shadow: var(--ch-shadow, none); }
.ch-content .ch-gl .gl-row { font-size: 15px; }
.ch-content .ch-gl .tc-line { display: flex; flex-wrap: nowrap; margin: 0; font-size: 15px; color: var(--ink); gap: 12px; cursor: pointer; }
.ch-content .ch-gl .tc-line .tc-dots i { width: 10px; height: 10px; }
.ch-content .ch-gl a.gl-row:active { background: var(--gl-press); }
.ch-content .ch-gl a.gl-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
/* the flat look (admin's «Блоки / Плоско») for the new screens */
:root[data-lists="flat"] .gl.gl-lv { padding: 0; }
:root[data-lists="flat"] .gl-f.gl-lead { margin-left: 0; margin-right: 0; }
:root[data-lists="flat"] .gl-tx { padding-left: 0; padding-right: 0; }
:root[data-lists="flat"] .gl-sheet h2.gl-h, :root[data-lists="flat"] .gl-doc h2.gl-h { margin-left: 0; margin-right: 0; }
:root[data-lists="flat"] .gl > .gl-row.menu-item { padding-left: 0; padding-right: 0; }
:root[data-lists="flat"] .ch-content .ch-gl.gl { border: 0; box-shadow: none; background: transparent; }
/* the two dots of a colour row — the same as in Settings, wherever a block row shows them */
.gl-ic.tc .tc-dots { display: inline-flex; gap: 3px; }
.gl-ic.tc .tc-dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--blue); }
.gl-ic.tc .tc-dots i + i { background: var(--red); }
#sheet-online-rules .orules h2.gl-h { font-size: 11px; margin: 20px 16px 7px; }
#sheet-online-rules .orules > h2.gl-h:first-child { margin-top: 6px; }
#sheet-online-rules .orules .gl-tx p { color: var(--ink); line-height: 1.5; margin: 0 0 8px; }
#sheet-online-rules .orules .gl-tx p:last-child { margin-bottom: 0; }
#sheet-online-rules .orules .gl-tx a { color: var(--blue); }
/* 0.2.33a (перевірка Слави, Chrome на Windows): the browser's autofill paints a filled field light blue over the card — the field takes
   the card's colour back (the inset shadow is the only paint autofill lets through) */
.gl .acc-field input:-webkit-autofill, .gl .acc-field input:-webkit-autofill:hover, .gl .acc-field input:-webkit-autofill:focus,
.gl .onl-code-row input:-webkit-autofill, #sheet-feedback #fb-name:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--gl-card) inset; box-shadow: 0 0 0 1000px var(--gl-card) inset;
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink); transition: background-color 600000s 0s;
}
/* 0.2.33a (C2, Слава 19.10: «параметр плавності… єдиний по всій грі для всіх екранів/меню/під-меню. Це ж iPhone»): ONE MOTION — every sheet's
   slide in and out, the scrim, the screens' cross-fade and the glide of a sheet's height when its content changes (app.js, sheetGlide) take
   these two values. 0.38 s on the curve iOS sheets use; the result sheet keeps only its content's settle (0.1.28), not a slower slide. */
:root { --motion-dur: 0.38s; --motion-ease: cubic-bezier(0.32, 0.72, 0, 1); }
.sheet { transition: transform var(--motion-dur) var(--motion-ease), box-shadow var(--motion-dur) ease; }
#sheet-over { transition: transform var(--motion-dur) var(--motion-ease); }
.scrim, .scrim.open { transition: opacity var(--motion-dur) ease; }
.screen { transition: opacity var(--motion-dur) var(--motion-ease), transform var(--motion-dur) var(--motion-ease); }
@media (prefers-reduced-motion: reduce) {
  .sheet, #sheet-over, .scrim, .scrim.open, .screen { transition-duration: 0.01ms !important; }
}

/* 0.2.33a: «‹» за пальцем, коли змах «назад» веде на попередній рівень того самого аркуша (аркуш не їде — див. wireBackSwipe) */
#edge-back {
  position: fixed; left: 4px; top: 50%; z-index: 30;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 600 28px/1 var(--f-display, system-ui); padding-bottom: 3px; box-sizing: border-box;
  color: var(--ink); background: var(--gl-card, var(--sheet)); box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  opacity: 0; pointer-events: none; transform: translate(0, -50%) scale(0.7);
}
#edge-back.ready { color: #fff; background: var(--blue); }

/* 0.2.36 (Р-649): «вже вийшла» / «вже вибула» while a group is still played (clinch.js). Through — the same quiet tint and bold name as a
 * team that went on (no «Q»: that one says «на чемпіонаті»); out — the row in the soft ink, the flag dimmed; the line under the table names them */
.qual-view .team-row.clinched td { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.qual-view .team-row.clinched .name-cell .team-plain > span:last-child, .qual-view .team-row.clinched .name-cell a > span:last-child { font-weight: 650; }
.qual-view .team-row.clinched.is-human td { background: color-mix(in srgb, var(--ink) 6%, var(--ch-selected)); }
.qual-view .team-row.clinched + .team-row.clinched td,
.qual-view .team-row.qualified + .team-row.clinched td,
.qual-view .team-row.clinched + .team-row.qualified td { border-top: 3px solid transparent; background-clip: padding-box; }
.ch-content .standings .team-row.out td, .ch-content .standings .team-row.out .name-cell a,
.ch-content .standings .team-row.out .name-cell .team-plain { color: var(--ink-soft); }   /* soft, not faint: ≥ 4,5 : 1 on the card */
.ch-content .standings .team-row.out .flag-xs, .ch-content .standings .team-row.out .flag-pair { opacity: .55; }

/* 0.2.36b (R2): in a championship group a team through — decided or already through — reads as through: the same quiet tint and bold name
 * as in the qualifiers, and «Q» (the place number alone, ink in Air, said nothing) */
.ch-content .standings .team-row.qualified td { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.ch-content .standings .team-row.qualified.is-human td { background: color-mix(in srgb, var(--ink) 6%, var(--ch-selected)); }
.ch-content .standings .team-row.qualified .name-cell a > span:last-child, .ch-content .standings .team-row.qualified .name-cell .team-plain > span:last-child { font-weight: 650; }
.ch-content .standings .team-row.qualified + .team-row.qualified td { border-top: 3px solid transparent; background-clip: padding-box; }
/*
 * 0.2.38a · «ПОВНА ТАБЛИЦЯ» — НА ЕКРАН, БЕЗ ПРОКРУТКИ, У СВОЇЙ РАМЦІ (Слава, iPhone 22.10: «не все поміщається на екран…
 * рамка трохи не до кінця доходить»).
 * 0.1.58a gave the eight columns 38 px each and the table 540 px; the card stayed the screen's width, so the table ran out
 * of it — scrolled sideways, and the frame stopped where the screen did. Now every number column is as wide as what it
 * can hold (one digit for І/В/Н/П, three for З/‑З, «−186» for ±, «Pkt» for points), the team takes the rest, its name
 * is the short one and wraps by words. tests/full-table-ui.js: 320–430 pt, uk/en/pl, the widest scores a group reaches.
 */
.ch-content .full-card { padding: 6px 6px; }
.ch-content .standings.full-table { min-width: 0; }
.ch-content .full-table .pos-col { width: 18px; }
.ch-content .full-table td.pos { width: auto; padding-left: 0; padding-right: 0; }
.ch-content .full-table th { padding: 0 1px; font-size: 10px; }
.ch-content .full-table th.team-label { padding-left: 27px; }
.ch-content .full-table td { padding: 7px 1px; font-size: 11.5px; letter-spacing: -.02em; }
.ch-content .full-table td.name-cell { font-size: 12.5px; letter-spacing: 0; padding-left: 2px; padding-right: 4px; overflow-wrap: break-word; }
.ch-content .full-table .name-cell a, .ch-content .full-table .name-cell .team-plain { gap: 5px; }
.ch-content .full-table .nm-code { display: none; font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; }
/* 360 pt and up — names (short ones; they wrap by words) */
.ch-content .full-table .k-played, .ch-content .full-table .k-won, .ch-content .full-table .k-drawn,
.ch-content .full-table .k-lost { width: 18px; }
.ch-content .full-table .k-for, .ch-content .full-table .k-against { width: 29px; }
.ch-content .full-table .k-diff { width: 34px; }
.ch-content .full-table .k-points { width: 23px; }
/* «Q» sits on the name's last line, never on a line of its own */
.ch-content .full-table .q-mark { display: inline; margin-left: 3px; }
@media (min-width: 375px) {
  .ch-content .full-card { padding: 6px 8px; }
  .ch-content .full-table .k-played, .ch-content .full-table .k-won, .ch-content .full-table .k-drawn,
  .ch-content .full-table .k-lost { width: 18px; }
  .ch-content .full-table .k-for, .ch-content .full-table .k-against { width: 30px; }
  .ch-content .full-table .k-diff { width: 36px; }
  .ch-content .full-table .k-points { width: 25px; }
}
@media (min-width: 400px) {
  .ch-content .full-table .k-played, .ch-content .full-table .k-won, .ch-content .full-table .k-drawn,
  .ch-content .full-table .k-lost { width: 20px; }
  .ch-content .full-table .k-for, .ch-content .full-table .k-against { width: 33px; }
  .ch-content .full-table .k-diff { width: 39px; }
  .ch-content .full-table .k-points { width: 27px; }
  .ch-content .full-table td { font-size: 12px; letter-spacing: 0; }
  .ch-content .full-table td.name-cell { font-size: 13px; }
}
/* below 360 pt (iPhone SE with «Збільшений» display, small Androids) — the FIFA code */
@media (max-width: 359.98px) {
  .ch-content .full-table .k-played, .ch-content .full-table .k-won, .ch-content .full-table .k-drawn,
  .ch-content .full-table .k-lost { width: 17px; }
  .ch-content .full-table .k-for, .ch-content .full-table .k-against { width: 28px; }
  .ch-content .full-table .k-diff { width: 33px; }
  .ch-content .full-table .k-points { width: 23px; }
  .ch-content .full-table .nm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ch-content .full-table .nm-code { display: inline; }
}
/* 0.2.38a (P2): «Рейтингова партія: дограйте до 29.10, інакше — поразка» — under the line of the game, full strength, not a red alarm */
.mode .copy small.mode-due { opacity: 1; color: var(--ink-soft); font-weight: 500; }
.mode .copy small.mode-due[hidden] { display: none; }
/* 0.2.38a (L2): «Партія триває на iPad · Грати тут» — above the turn card while another device of the account plays this game */
.live-bar {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 6px 6px 13px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-1);
}
.live-bar[hidden] { display: none; }
.live-bar .live-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; color: var(--ink); }
.live-bar .live-here {
  flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--ink); color: var(--paper); font: 600 13px/1 var(--f-ui);
}
.live-bar.flash { animation: live-flash .6s ease-out 1; }
@keyframes live-flash { 0% { transform: scale(1); } 35% { transform: scale(1.03); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .live-bar.flash { animation: none; } }
/* 0.2.38b (Слава, перевірка 0.2.38a, C1: «колонка О притиснута до рамки виділення… цифри треба зробити жирним — це головний
 * результат цієї таблиці»): очки — жирні в обох таблицях групи; між числом і правим краєм підсвітки — повітря */
.ch-content .standings td.points { font-weight: 700; padding-right: 7px; }
.ch-content .full-table .k-points { width: 29px; }
@media (min-width: 375px) { .ch-content .full-table .k-points { width: 31px; } }
@media (min-width: 400px) { .ch-content .full-table .k-points { width: 33px; } }
@media (max-width: 359.98px) { .ch-content .full-table .k-points { width: 28px; } }
/* below 360 pt the code («NOR») and «Q» stay on one line — three letters never need to wrap */
@media (max-width: 359.98px) { .ch-content .full-table td.name-cell { white-space: nowrap; } .ch-content .full-table .q-mark { margin-left: 2px; } }
/* the «О» / «Pts» heading stands over its bold number, not past it */
.ch-content .standings th:last-child { padding-right: 7px; }

/* 0.2.38d (Слава, D2 / D3): «Відбувається синхронізація гри з іншими пристроями…» — over the screen while another device's change comes */
.sync-wait {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, 0.28);
}
.sync-wait[hidden] { display: none; }
.sync-wait-card {
  display: flex; gap: 12px; align-items: center;
  max-width: min(360px, calc(100vw - 32px));
  padding: 16px 18px; border-radius: 14px;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 15px; line-height: 1.4;
}
.sync-wait-dot {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--ink);
  animation: sync-wait-spin 0.9s linear infinite;
}
@keyframes sync-wait-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-wait-dot { animation: none; border-top-color: var(--line); } }
/* 0.2.42b (П2, рішення Слави 31.10): «Видалити акаунт» — the password in a window over everything (above the sheets and the scrim) */
.del-ask {
  position: fixed; inset: 0; z-index: 75;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
  background: rgba(0, 0, 0, 0.42);
}
.del-ask[hidden] { display: none; }
.del-ask-card {
  width: min(400px, 100%); display: grid; gap: 12px;
  padding: 20px 18px 16px; border-radius: 18px;
  background: var(--sheet); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.del-ask-card h2 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 600; word-break: break-word; }
.del-ask-card > p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.del-ask-pw { position: relative; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--bg, transparent); }
.del-ask-pw:focus-within { outline: 2px solid var(--blue); outline-offset: -1px; }
.del-ask-pw input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; padding: 0 12px; }
.del-ask-pw input:focus { outline: none; }
.del-ask-pw input::placeholder { color: var(--ink-faint); }
.del-ask .acc-eye {
  flex: none; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-faint); cursor: pointer;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.del-ask .acc-eye svg { width: 24px; height: 24px; display: block; pointer-events: none; }
.del-ask .acc-eye.on { color: var(--ink); }
.del-ask-status { min-height: 1.4em; text-align: center; font-size: 14px; color: var(--ink-soft); }
.del-ask-status.bad { color: var(--red, #c0392b); }
.del-ask .text-btn { justify-self: center; margin: -4px 0 0; }
.del-ask-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.del-ask-acts button { margin: 0; }
.del-ask .primary.danger { background: var(--red, #c0392b); border-color: var(--red, #c0392b); color: #fff; }
.del-ask button:disabled { opacity: 0.55; }
/* 0.2.39 «Жест „назад“: як в iOS» (Р-654; app.js wireBackSwipe). `edge-ghost` — a still copy of the championship pane that takes the finger
   while the pane underneath draws the level «назад» leads to; it answers nothing (its ids are data-gid, the selectors above match it as
   the pane). `#edge-dim` — the shade over the uncovered level, lightening as it slides into place (iOS dims the page under the finger). */
.edge-ghost { pointer-events: none; }
#edge-dim { position: fixed; inset: 0; z-index: 12; background: #000; opacity: 0; pointer-events: none; display: none; }
/* 0.2.39 (задача 3): a step iOS has already shown with its own swipe (Safari, the icon from the home screen) — no second slide (app.js instantStep) */
:root.nav-instant .sheet, :root.nav-instant .scrim, :root.nav-instant .screen, :root.nav-instant #sheet-over { transition: none !important; }

/*
 * 0.2.40 «ЕКРАНИ СТАТИСТИКИ: ВЕРДИКТИ Д-31».
 * E1 — the strength of both sides of «Ваш матч» in stars, under each name (the line «Сила суперника: N» is gone).
 * G1, G2, G3b — the key to a table's columns, once per screen, under its first table.
 * S4 — a match named by its teams and score is a door to its summary. S5 — ten rows and yours, a gap between.
 */
.ch-content .versus .side:has(.side-stars) { flex-direction: column; gap: 4px; }
.ch-content .versus .side .side-row { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; }
.ch-content .versus .side .side-row > span:not(.flag-case) { min-width: 0; }
.ch-content .versus .side > span.side-stars { display: flex; justify-content: center; }
.ch-content .table-key { margin: 0; padding: 8px 12px 10px; font-size: 11px; line-height: 1.5; color: var(--ink-soft); border-top: 1px solid var(--line); }
.ch-content .standings th[data-colhint] { cursor: help; }
.ch-content .match-door { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; cursor: pointer; text-align: right; }
.ch-content .match-door svg { flex: none; width: 12px; height: 12px; opacity: 0.5; }
.ch-content .rating-row.gap { display: block; min-height: 0; padding: 2px 0 4px; text-align: center; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
.ch-content .fmt-line { padding-top: 12px; }
.ch-content .rating-row.stars-col.wide-head > span:first-child { grid-column: 1 / 4; }
/* N4 «Перебіг» — columns of 20 half-moves (blue up, red down), the two teams named in their colours, one sentence under it */
.ch-content .lead-bars .up { fill: var(--blue); fill-opacity: 1; }
.ch-content .lead-bars .down { fill: var(--red); fill-opacity: 1; }
.ch-content .lead-names { display: flex; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ch-content .lead-names.down { justify-content: flex-end; }
.ch-content .lead-names span { display: inline-flex; align-items: center; gap: 6px; }
.ch-content .lead-say { margin: 0; padding: 10px 12px 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
/* N1 «Ваш чемпіонат» — the way through the stages */
.ch-content .your-path { display: flex; gap: 4px; list-style: none; margin: 12px 0 4px; padding: 0; }
.ch-content .your-path li { flex: 1; text-align: center; padding: 5px 0; border-radius: 8px; font: 500 11px/1.2 var(--f-mono); color: var(--ink-faint); background: var(--press); }
.ch-content .your-path li.on { color: var(--ink); background: var(--resume-tag); }
.ch-content .your-best { margin-top: 12px; }
.ch-content .your-best .kicker { margin-bottom: 4px; }
.ch-content .your-best .small { margin: 4px 0 0; }
/* N2 «Сюжети турніру» — a strip of cards and the lists under it */
/* two columns, no sideways scroll (champ-sweep: nothing past the screen's edge); four columns on a wide screen */
.ch-content .plot-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 2px 0 10px; }
.ch-content .plot-card { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-3); background: linear-gradient(145deg, var(--ch-glass), var(--control)); border: 1px solid var(--ch-edge); box-shadow: var(--ch-shadow); color: var(--ink); text-decoration: none; cursor: pointer; }
.ch-content .plot-card.is-human { outline: 2px solid var(--resume-tag); }
.ch-content .plot-card .plot-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.ch-content .plot-card .plot-line b { font-size: 17px; }
.ch-content .plot-list > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ch-content .plot-list > summary .small { text-align: right; }
.ch-content .plot-lists { padding-top: 2px; padding-bottom: 2px; }
.ch-content .plot-lists .disclosure { margin-top: 0; border-bottom: 1px solid var(--line); }
.ch-content .plot-lists .disclosure:last-child { border-bottom: 0; }
.ch-content .plot-lists .disclosure > summary { color: var(--ink); font-size: 14px; list-style: none; }
.ch-content .plot-lists .disclosure > summary::-webkit-details-marker { display: none; }
.ch-content .plot-lists .disclosure > summary::after { content: "›"; color: var(--ink-faint); transition: transform .2s; }
.ch-content .plot-lists .disclosure[open] > summary::after { transform: rotate(90deg); }
.ch-content .plot-lists .match-list { margin-bottom: 10px; }
.ch-content .rating-row.stars-col.wide-head > span:first-child { text-align: left; }
.ch-content .plot-lists .disclosure > summary > span:first-child { flex: 1; }
.ch-content .plot-card .plot-line b { flex: none; white-space: nowrap; }
.ch-content .plot-card .plot-line .team-name { min-width: 0; }

/* ------------------------------------------------------------ 0.2.40a «Рік чемпіонату» (задача 13, Y1–Y4) */
:root { --yr-gold: #9a6f00; --yr-arch: #5b3fb0; --yr-arch-bg: rgba(91, 63, 176, 0.10); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --yr-gold: #e2b84a; --yr-arch: #b9a6ff; --yr-arch-bg: rgba(185, 166, 255, 0.14); } }
:root[data-theme="dark"] { --yr-gold: #e2b84a; --yr-arch: #b9a6ff; --yr-arch-bg: rgba(185, 166, 255, 0.14); }
.ch-content .year-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin: 0 0 12px; padding: 8px 12px 8px 14px; text-align: left; color: var(--ink); font: inherit; cursor: pointer;
  border-radius: var(--r-3); border: 1px solid var(--ch-edge); background: linear-gradient(145deg, var(--ch-glass), var(--control)); box-shadow: var(--ch-shadow); }
.ch-content .year-row .yr-l { display: flex; flex-direction: column; flex: none; }
.ch-content .year-row .yr-lbl { font-size: 12px; color: var(--ink-soft); }
.ch-content .year-row .yr-val { font: 600 15px/1.3 var(--f-ui); }
.ch-content .year-row .yr-champ { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
.ch-content .year-row .ch-icon { flex: none; width: 18px; height: 18px; stroke: var(--ink-faint); }
.yr-cp { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--yr-gold); font-weight: 600; }
.yr-cp > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yr-cp .flag-case { flex: none; }
svg.cup { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--yr-gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ch-content .arch-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 8px 8px 8px 12px; border-radius: 12px;
  background: var(--yr-arch-bg); color: var(--yr-arch); font-size: 13px; font-weight: 600; }
.ch-content .arch-strip .as-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-content .arch-strip .as-back { flex: none; min-height: 34px; padding: 6px 12px; border-radius: 10px; border: 1px solid currentColor; background: transparent; color: inherit; font: 600 13px/1 var(--f-ui); cursor: pointer; }
.ch-content .arch-strip .as-back::before { content: "‹ "; }
.ch-content .arch-card { border-left: 3px solid var(--yr-arch); }
.ch-content .arch-card .kicker { color: var(--yr-arch); }
.ch-content .arch-card .arch-champ { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px; color: var(--yr-gold); font-weight: 700; font-size: 15px; }
.ch-content .arch-card .arch-champ svg.cup { width: 18px; height: 18px; }
.ch-content .arch-card [data-summary] { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ch-content .arch-back { margin: 12px 0 16px; }
.ch-content .arch-back .ch-icon { stroke: var(--sheet); width: 18px; height: 18px; }
.years-layer { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim, rgba(0, 0, 0, 0.35)); }
.years-layer[hidden] { display: none; }
.years-layer .years-box { width: 100%; max-width: 560px; max-height: 78vh; overflow-y: auto; padding: 8px 16px calc(16px + var(--safe-b, 0px)); border-radius: 20px 20px 0 0;
  background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-3); font: 14px/1.4 var(--f-ui); }
.years-layer h3 { margin: 6px 0 2px; font: 600 17px/1.3 var(--f-ui); }
.years-layer .muted { color: var(--ink-soft); }
.years-layer .small { font-size: 13px; margin: 0 0 8px; }
.years-layer .yr-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin: 0; padding: 8px 10px;
  text-align: left; font: inherit; color: var(--ink); border: 0; border-top: 1px solid var(--line); background: transparent; cursor: pointer; border-radius: 0; }
.years-layer .yr-item[aria-current="true"] { background: var(--resume-tag); border-radius: 12px; border-top-color: transparent; }
.years-layer .yr-item[aria-current="true"] + .yr-item { border-top-color: transparent; }
.years-layer .yi-y { font: 700 17px/1 var(--f-mono, var(--f-ui)); }
.years-layer .yi-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.years-layer .yi-you { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.years-layer .yi-tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; color: var(--yr-arch); background: var(--yr-arch-bg); }
.years-layer .yi-tag.now { color: var(--ink); background: var(--resume-tag); }

/* 0.2.41a (Д-32, G3): four championship levels — «Професійний» did not fit a quarter of a phone (390 pt: «Професій-ний» in two lines).
   On a phone the four go 2 × 2: the two free on top, the two golden below; wider screens keep one row */
@media (max-width: 520px) {
  #ch-level { flex-wrap: wrap; }
  #ch-level button { flex: 1 1 calc(50% - 2px); white-space: nowrap; }
}

/* 0.2.49: a TestFlight build for the test server — a thin strip that stays on every screen (never in a store build) */
#srv-strip { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 2px); z-index: 9999;
  pointer-events: none; font: 600 11px/1.4 var(--f-ui, system-ui), sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: #c2410c; padding: 2px 10px; border-radius: 8px; opacity: 0.92; }
