/* ══ Settebello ══════════════════════════════════════════════════════════════
   Palio di Siena spotyka włoski plakat sportowy.
   Wszystkie kolory żyją w tokenach — komponenty nigdy nie sięgają po literały,
   dzięki czemu jasny i ciemny motyw są dwoma pełnymi zestawami, nie inwersją.
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  /* Tynk sieneński — neutralne przechylone w oliwkę, nie w róż. */
  --paper: #e7dfcb;
  --paper-deep: #dcd2ba;
  --surface: #f4eee0;
  --surface-raised: #fbf7ec;

  --ink: #211e15;
  --ink-soft: #57503f;
  --ink-faint: #8b8371;
  --line: #c9bea4;
  --line-soft: #ded4bc;

  --siena: #a8432b;
  --oro: #9d7016;
  --oro-glow: #d9b45e;
  --verde: #2c4330;
  --verde-deep: #223528;
  --vino: #6b1f2a;

  --on-verde: #eee7d4;
  --shadow: 0 1px 0 rgba(33, 30, 21, 0.04), 0 8px 24px -16px rgba(33, 30, 21, 0.35);

  --display: 'Bodoni 72', 'Bodoni MT', Didot, 'Didot LT STD', 'Hoefler Text', Garamond, 'Times New Roman', serif;
  --body: 'Avenir Next', Avenir, Optima, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --data: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 64ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #16170f;
    --paper-deep: #101109;
    --surface: #1f2119;
    --surface-raised: #262920;

    --ink: #ece5d2;
    --ink-soft: #b0a892;
    --ink-faint: #7d7663;
    --line: #383b30;
    --line-soft: #2b2e24;

    --siena: #d9704a;
    --oro: #d7a93f;
    --oro-glow: #f0cf7c;
    --verde: #7fa37f;
    --verde-deep: #1a2b1e;
    --vino: #c1697a;

    --on-verde: #e8e1ce;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -18px rgba(0, 0, 0, 0.9);
  }
}

:root[data-theme='dark'] {
  --paper: #16170f;
  --paper-deep: #101109;
  --surface: #1f2119;
  --surface-raised: #262920;

  --ink: #ece5d2;
  --ink-soft: #b0a892;
  --ink-faint: #7d7663;
  --line: #383b30;
  --line-soft: #2b2e24;

  --siena: #d9704a;
  --oro: #d7a93f;
  --oro-glow: #f0cf7c;
  --verde: #7fa37f;
  --verde-deep: #1a2b1e;
  --vino: #c1697a;

  --on-verde: #e8e1ce;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -18px rgba(0, 0, 0, 0.9);
}

/* ── Baza ─────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Klasy w rodzaju `.pill { display: inline-flex }` biją regułę [hidden] przeglądarki,
   więc ukryte elementy potrafią się pokazać. Ta reguła zamyka temat raz na zawsze. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
  line-height: 1.1;
}

p,
ul,
ol {
  margin: 0;
}

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

.plain-link {
  color: inherit;
  text-decoration: none;
}

.plain-link:hover {
  color: var(--siena);
}

:focus-visible {
  outline: 2px solid var(--siena);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.num {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
}

.lead {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hint {
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.hint--warn {
  color: var(--siena);
  font-weight: 600;
}

.scroll-x {
  overflow-x: auto;
}

/* ── Drappellone: pas barw wszystkich flag ────────────────────────────────── */

.drappellone {
  display: flex;
  height: 6px;
}

.drappellone span {
  flex: 1;
}

/* ── Głowica ──────────────────────────────────────────────────────────────── */

.masthead {
  background: var(--verde-deep);
  color: var(--on-verde);
  padding-block: clamp(1.5rem, 4.5vw, 2.75rem);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.masthead .eyebrow {
  color: var(--oro-glow);
}

.masthead h1 {
  font-size: clamp(2.25rem, 8vw, 4rem);
  letter-spacing: -0.02em;
  margin-block: 0.3rem 0.4rem;
}

.masthead__sub {
  color: var(--on-verde);
  opacity: 0.72;
  font-size: 0.9375rem;
  max-width: 42ch;
}

.masthead__meta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--on-verde) 28%, transparent);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill--admin {
  border-color: var(--oro-glow);
  color: var(--oro-glow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--oro-glow);
  flex: none;
}

.pill[data-live='on'] .dot {
  background: #7fbf7f;
  animation: pulse 2.4s ease-in-out infinite;
}

.pill[data-live='off'] .dot {
  background: var(--siena);
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

/* ── Nawigacja i stopka ───────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.9rem 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected='true'] {
  color: var(--ink);
  border-bottom-color: var(--siena);
}

.foot {
  border-top: 1px solid var(--line);
  padding-block: 1.5rem 2.5rem;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.foot a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Układ ────────────────────────────────────────────────────────────────── */

main {
  padding-block: clamp(1.5rem, 4vw, 2.5rem) 4rem;
  min-height: 60vh;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
}

.stack--tight {
  gap: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--ink);
}

.section-head h2 {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
}

.panels {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.panel__head h3 {
  font-size: 1.25rem;
}

.panel__hint {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  max-width: 46ch;
}

.panel--draw {
  border-color: var(--oro);
  border-left-width: 3px;
}

.panel--admin {
  border-style: dashed;
}

.panel--danger {
  border-color: color-mix(in srgb, var(--siena) 45%, var(--line));
}

/* ── Flagi i zawodnicy ────────────────────────────────────────────────────── */

.flag {
  position: relative;
  flex: none;
  width: 2.1rem;
  height: 1.5rem;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(90deg, var(--c1) 0 76%, var(--c2) 76%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
}

/* Monogram wyśrodkowany w polu barwy głównej — nie doklejony do krawędzi. */
.flag__mono {
  position: absolute;
  inset: 0 24% 0 0;
  display: grid;
  place-items: center;
  font-family: var(--data);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-ink);
}

.flag--lg {
  width: 3rem;
  height: 2.15rem;
}

.flag--lg .flag__mono {
  font-size: 0.875rem;
}

.flag--empty {
  display: grid;
  place-items: center;
  background: var(--line-soft);
  color: var(--ink-faint);
  font-family: var(--data);
  font-size: 0.625rem;
}

.who {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.who__name {
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.2;
  white-space: nowrap;
}

.who--muted {
  opacity: 0.55;
}

.flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

/* ── Drobne kontrolki ─────────────────────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-raised);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.chip[data-status='done'] {
  border-color: var(--verde);
  color: var(--verde);
}

.chip[data-status='live'] {
  border-color: var(--oro);
  color: var(--oro);
}

.chip[data-status='open'] {
  border-style: dashed;
  color: var(--ink-faint);
}

.btn {
  appearance: none;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.5rem 1rem;
  border-radius: 2px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--ink-soft);
  border-color: var(--ink-soft);
}

.btn--ghost {
  background: none;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn--ghost:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.btn--danger {
  background: none;
  color: var(--siena);
  border-color: color-mix(in srgb, var(--siena) 45%, transparent);
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--siena) 12%, transparent);
}

.btn--small {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.btn--tiny {
  padding: 0.22rem 0.5rem;
  font-size: 0.75rem;
  background: none;
  color: var(--ink-soft);
  border-color: var(--line);
}

.btn--tiny:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.btn--pad {
  padding: 0.45rem 0.2rem;
  font-family: var(--data);
  font-size: 0.9375rem;
  background: var(--surface-raised);
  color: var(--ink);
  border-color: var(--line);
  min-width: 2.5rem;
}

.btn--pad:hover {
  background: var(--verde-deep);
  color: var(--on-verde);
  border-color: var(--verde-deep);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  align-items: center;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  flex: none;
}

.segmented button {
  appearance: none;
  border: 0;
  background: var(--surface-raised);
  font: inherit;
  font-size: 0.75rem;
  color: var(--ink-soft);
  padding: 0.32rem 0.6rem;
  cursor: pointer;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button[aria-pressed='true'] {
  background: var(--verde-deep);
  color: var(--on-verde);
}

.segmented button:hover:not([aria-pressed='true']) {
  background: var(--paper-deep);
}

select,
.text-input,
.score-input {
  appearance: none;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.42rem 0.55rem;
  min-width: 0;
}

.text-input,
select {
  width: 100%;
}

.score-input {
  width: 3.2rem;
  text-align: center;
  font-family: var(--data);
}

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-field select {
  width: auto;
}

.login {
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* ── Klasyfikacja ─────────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}

/* Sztywny układ, bo przy automatycznym nadmiar szerokości rozdziela się
   proporcjonalnie do treści i kolumna z imionami zjada pół ekranu telefonu.
   Suma szerokości kolumn poniżej daje dokładnie te 34rem. */
table.standings {
  width: 100%;
  min-width: 34rem;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.standings th,
.standings td {
  padding: 0.55rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}

.standings thead th {
  font-family: var(--body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.standings tbody tr:last-child td {
  border-bottom: 0;
}

.col-rank {
  width: 3rem;
  font-family: var(--display);
  font-size: 1.125rem;
  color: var(--ink-faint);
}

/* Selektor musi być mocniejszy niż `.standings td`, inaczej centrowanie wygrywa
   i flagi rozjeżdżają się w każdym wierszu inaczej. */
.standings .col-who {
  position: sticky;
  left: 0;
  text-align: left;
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
  min-width: 10.5rem;
}

.standings thead .col-who {
  background: var(--paper-deep);
  z-index: 1;
}

.standings tbody tr:nth-child(even) .col-who {
  background: var(--surface-raised);
}

.standings tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-raised) 60%, var(--surface));
}

.col-disc {
  width: 3.2rem;
}

.col-disc__link {
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.col-disc__link:hover {
  color: var(--siena);
}

.col-disc__live {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--oro);
  margin-left: 0.25rem;
  vertical-align: middle;
}

.cell {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.cell[data-place='1'] {
  color: var(--oro);
  font-weight: 700;
}

.cell--provisional {
  font-style: italic;
  opacity: 0.8;
}

.cell--empty {
  color: var(--line);
}

.cell--out {
  color: var(--ink-faint);
  opacity: 0.55;
}

.col-total {
  font-size: 1.0625rem;
  font-weight: 700;
  border-left: 1px solid var(--line-soft);
  width: 4rem;
}

.standings tbody tr[data-leader='true'] .col-rank,
.standings tbody tr[data-leader='true'] .col-total {
  color: var(--oro);
}

/* ── Podium ───────────────────────────────────────────────────────────────── */

.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.podium__card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: 3px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow);
}

.podium__card[data-place='1'] {
  border-top-color: var(--oro);
}

.podium__card[data-place='2'] {
  border-top-color: var(--ink-faint);
}

.podium__card[data-place='3'] {
  border-top-color: var(--siena);
}

.podium__rank {
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--ink-faint);
}

.podium__card[data-place='1'] .podium__rank {
  color: var(--oro);
}

.podium__name {
  font-family: var(--display);
  font-size: 1.4rem;
}

.podium__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.podium__total {
  font-size: 1.0625rem;
  font-weight: 700;
}

/* ── Teraz gramy: skrót na planszę z ekranu głównego ─────────────────────── */

.now-playing {
  background: var(--verde-deep);
  color: var(--on-verde);
  border: 1px solid var(--oro);
  border-radius: 3px;
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.now-playing .eyebrow {
  color: var(--oro-glow);
}

.now-playing__row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid color-mix(in srgb, var(--on-verde) 18%, transparent);
}

.now-playing__row:first-of-type {
  border-top: 0;
}

.now-playing__row:hover .now-playing__name {
  color: var(--oro-glow);
}

.now-playing__roman {
  font-family: var(--display);
  font-size: 1.75rem;
  color: var(--oro-glow);
  width: 2.25rem;
  flex: none;
  line-height: 1;
}

.now-playing__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.now-playing__name {
  font-family: var(--display);
  font-size: 1.375rem;
}

.now-playing .hint {
  color: var(--on-verde);
  opacity: 0.72;
}

.now-playing__go {
  font-size: 1.25rem;
  color: var(--oro-glow);
}

/* ── Lista dyscyplin ──────────────────────────────────────────────────────── */

.disc-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface);
}

.disc-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}

.disc-card:last-child {
  border-bottom: 0;
}

.disc-card:hover {
  background: var(--surface-raised);
}

.disc-card__roman {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--siena);
  width: 2.25rem;
  flex: none;
}

.disc-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.disc-card__name {
  font-family: var(--display);
  font-size: 1.25rem;
}

.disc-card__facts,
.disc-card__lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.disc-card__go {
  color: var(--ink-faint);
  font-size: 1.25rem;
}

.disc-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--ink);
}

.disc-head__roman {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 0.9;
  color: var(--siena);
}

.disc-head h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.disc-head__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-top: 0.5rem;
}

/* ── Drabinka i mecze ─────────────────────────────────────────────────────── */

.bracket {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.bracket__col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 15rem;
  flex: 1;
}

.bracket__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.match {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 2px;
  background: var(--surface-raised);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.match[data-state='done'] {
  border-left-color: var(--verde);
}

.match[data-state='open'] {
  border-left-color: var(--oro);
}

.match[data-state='pending'] {
  opacity: 0.7;
}

.match__label {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.match__side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.match__side[data-winner='true'] .who__name {
  color: var(--oro);
}

.match__score {
  font-family: var(--data);
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.score-entry {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--line);
}

.score-entry__sep {
  color: var(--ink-faint);
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-list__label,
.group__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

/* ── Tabelki grup i tarczy ────────────────────────────────────────────────── */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.mini-table th,
.mini-table td {
  padding: 0.4rem 0.35rem;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}

.mini-table thead th {
  font-family: var(--body);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mini-table .mini-table__who {
  text-align: left;
  white-space: nowrap;
}

.mini-table tbody tr[data-through='true'] {
  background: color-mix(in srgb, var(--verde) 10%, transparent);
}

.mini-table--arrows {
  min-width: 34rem;
}

.arrow-cell {
  width: 1.9rem;
  color: var(--ink-soft);
}

.arrow-cell--empty {
  color: var(--line);
}

.arrow-cell[data-ten='true'] {
  color: var(--oro);
  font-weight: 700;
}

.mini-table [data-series-start='true'] {
  border-left: 1px solid var(--line);
}

.arrow-total {
  font-weight: 700;
  border-left: 1px solid var(--line);
}

.mini-table tbody tr[data-shooting='true'] {
  background: color-mix(in srgb, var(--oro) 14%, transparent);
}

/* ── Na linii: klawiatura punktów ─────────────────────────────────────────── */

.now {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.now--done {
  color: var(--verde);
}

.now__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.now__who .who__name {
  font-size: 1.5rem;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.6rem, 1fr));
  gap: 0.4rem;
}

/* Kosz: „0” zabiera cały dorobek, więc wygląda jak ostrzeżenie, nie jak zwykły punkt. */
.btn--zero {
  padding: 0.45rem 0.6rem;
  font-family: var(--data);
  font-size: 0.9375rem;
  background: none;
  color: var(--siena);
  border-color: color-mix(in srgb, var(--siena) 45%, var(--line));
  min-width: 2.5rem;
}

.btn--zero:hover {
  background: var(--siena);
  border-color: var(--siena);
  color: var(--paper);
}

.order-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}

.order-strip__item {
  display: inline-flex;
}

/* ── Heaty: liczniki ─────────────────────────────────────────────────────── */

.tally-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tally {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(4rem, 2fr) auto auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.tally__score {
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
}

.tally__buttons {
  display: flex;
  gap: 0.3rem;
}

.meter {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
}

.meter__fill {
  display: block;
  height: 100%;
  background: var(--oro);
  transition: width 0.25s ease;
}

@media (max-width: 34rem) {
  .tally {
    grid-template-columns: 1fr auto;
  }

  .tally__bar {
    grid-column: 1 / -1;
  }
}

.order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.order-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 2px;
}

.order-list__item[data-through='true'] {
  background: color-mix(in srgb, var(--verde) 12%, transparent);
}

.order-list__score {
  font-weight: 700;
  color: var(--ink-soft);
}

/* ── Water polo ──────────────────────────────────────────────────────────── */

.teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.team {
  border: 1px solid var(--line);
  border-top: 3px solid var(--verde);
  border-radius: 2px;
  background: var(--surface-raised);
  padding: 0.8rem;
}

.team[data-side='B'] {
  border-top-color: var(--siena);
}

.team__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.team__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.team__score {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
}

.team__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.team__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.team__goals {
  color: var(--oro);
  font-weight: 700;
  font-size: 0.875rem;
}

.team__buttons {
  margin-left: auto;
}

.pool {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pool__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--surface-raised);
}

.goal-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.goal-log__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.goal-log__no {
  color: var(--ink-faint);
  font-size: 0.75rem;
  width: 1.5rem;
}

/* ── Poker: stół ─────────────────────────────────────────────────────────── */

.seats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--oro);
  border-radius: 2px;
  background: var(--surface-raised);
}

.seat[data-out='true'] {
  border-left-color: var(--line);
  background: none;
}

.seat__place {
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ── Skład i kolejność ───────────────────────────────────────────────────── */

.pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.5rem;
}

.pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line-soft);
  border-radius: 2px;
}

.pick-row[data-playing='false'] {
  opacity: 0.55;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rank-list__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid var(--line-soft);
}

.rank-list__item:last-child {
  border-bottom: 0;
}

.rank-list__item[data-out='true'] {
  opacity: 0.6;
}

.rank-list__place {
  width: 2rem;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.rank-list__pts {
  margin-left: auto;
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.steps {
  margin: 0;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.history li {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  font-family: var(--data);
  flex-wrap: wrap;
}

/* ── Animacja losowania ──────────────────────────────────────────────────── */

.draw {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--verde-deep) 92%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.draw[data-show='true'] {
  opacity: 1;
}

.draw__card {
  text-align: center;
  color: var(--on-verde);
  padding: 2rem clamp(1.5rem, 6vw, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.draw__roman {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--oro-glow);
  line-height: 1;
}

.draw__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--oro-glow);
}

.draw__name {
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  color: var(--on-verde);
}

.draw__slot {
  min-height: 4.5rem;
  display: grid;
  place-items: center;
  margin-block: 0.75rem;
}

.draw__reel {
  display: flex;
  gap: 0.6rem;
  animation: jitter 0.085s steps(2) infinite;
}

.draw__done {
  font-family: var(--display);
  font-size: 1.75rem;
  color: var(--oro-glow);
}

.draw__hint {
  font-size: 0.8125rem;
  color: var(--on-verde);
  opacity: 0.7;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes jitter {
  50% {
    transform: translateY(-4px);
  }
}

/* ── Zasady ──────────────────────────────────────────────────────────────── */

.scale {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.scale__cell {
  flex: 1 1 4.5rem;
  background: var(--surface);
  padding: 0.65rem 0.4rem;
  text-align: center;
}

.scale__cell:first-child {
  background: color-mix(in srgb, var(--oro) 14%, var(--surface));
}

.scale__place {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.scale__pts {
  font-size: 1.25rem;
  font-weight: 700;
}

.creed {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}

.creed li {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.creed li:first-child {
  border-top: 0;
}

.discipline {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0 1.25rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.discipline:first-of-type {
  border-top: 0;
}

.discipline__roman {
  font-family: var(--display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 0.9;
  color: var(--siena);
}

.discipline__head h3 {
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
}

.discipline__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-top: 0.5rem;
}

.rules {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: var(--measure);
}

.rules li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--siena);
}

.note {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--oro);
  background: var(--surface-raised);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

@media (max-width: 34rem) {
  .discipline {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ── Komunikaty ──────────────────────────────────────────────────────────── */

.empty {
  padding: 2.25rem 1.25rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink-faint);
}

.empty strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  z-index: 120;
  max-width: min(30rem, calc(100vw - 2rem));
  padding: 0.7rem 1.1rem;
  border-radius: 3px;
  background: var(--verde-deep);
  color: var(--on-verde);
  border: 1px solid color-mix(in srgb, var(--on-verde) 22%, transparent);
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast[data-show='true'] {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-kind='error'] {
  background: var(--vino);
  color: #f6ecec;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pill[data-live='on'] .dot,
  .draw__reel {
    animation: none;
  }

  .toast,
  .draw,
  .meter__fill {
    transition: none;
  }
}
