/* UolDT — "stadium at night": dark, mobile first. Design rules in docs/ux.md. */

:root {
  --bg: #0b0f0d;
  --surface: #121a16;
  --surface-2: #18231e;
  --surface-3: #1f2c26;
  --line: #22302a;
  --text: #e8efe9;
  --muted: #8fa39a;
  --brand: #22c55e;
  --brand-2: #16a34a;
  --brand-ink: #04210f;
  --good: #22c55e;
  --warn: #f5b40b;
  --bad: #ef4444;
  --info: #38bdf8;
  --gold: #f2c94c;
  --silver: #c7d0d8;
  --bronze: #d08a54;
  --pos-gk: #f5b40b;
  --pos-df: #38bdf8;
  --pos-mf: #22c55e;
  --pos-fw: #f87171;
  --pitch: #14532d;
  --pitch-2: #166534;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar: 64px;
  /* Spacing scale (4 px grid, docs/ux.md): gaps between cards, sections and inside cards. */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem;
  --gap-card: var(--space-4);
  --gutter: 1rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(11, 15, 13, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .inner { display: flex; align-items: center; gap: .75rem; max-width: 1180px; margin: 0 auto; padding: .6rem 1rem; }
.logo { font-weight: 900; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; display: inline-flex; align-items: center; gap: .35rem; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--brand); }
.club-chip { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; color: var(--text); font-weight: 600; }
.club-chip .meta { color: var(--muted); font-weight: 500; font-size: .85rem; white-space: nowrap; }
.club-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
.topbar .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 999px; color: var(--text); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn .dot {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center;
}
.live-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 999px; background: rgba(239, 68, 68, .15); color: #fca5a5; font-weight: 700; font-size: .8rem; }
.live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Navigation: bottom tab bar on phones, top bar on desktop ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(18, 26, 22, .97);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .72rem; font-weight: 600; position: relative;
}
.tabbar a:hover { text-decoration: none; color: var(--text); }
.tabbar a.active { color: var(--brand); }
.tabbar a .dot { position: absolute; top: 8px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.tabbar svg { width: 24px; height: 24px; }
@media (min-width: 900px) {
  .tabbar {
    position: sticky; top: 61px; inset: auto; height: auto; padding: 0; border-top: 0;
    border-bottom: 1px solid var(--line); display: flex; justify-content: center; gap: .25rem;
    background: var(--bg);
  }
  .tabbar a { flex-direction: row; gap: .5rem; padding: .7rem 1.1rem; font-size: .92rem; border-bottom: 2px solid transparent; }
  .tabbar a.active { border-bottom-color: var(--brand); }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar a .dot { top: 10px; left: 26px; }
}

/* Section sub-tabs */
.subtabs { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem 1rem; padding: 0 1rem; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a {
  flex: none; padding: .45rem .9rem; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .9rem;
}
.subtabs a:hover { text-decoration: none; color: var(--text); }
.subtabs a.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: var(--space-4) var(--gutter); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: .25rem 0 1rem; flex-wrap: wrap; }
/* A long subtitle wraps inside the title block: the "?" and the buttons stay at its side. */
.page-head > div:first-child { flex: 1 1 14rem; min-width: 0; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: .9rem; }
/* Layout grids never stretch a card to its tallest neighbour: a short card stays short
   (align-items), and a column never spreads its spare height among its cards (align-content). */
.stack { display: grid; gap: var(--gap-card); align-content: start; }
.grid { display: grid; gap: var(--gap-card); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.cols-2 { display: grid; gap: var(--gap-card); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .cols-2 { grid-template-columns: 2fr 1fr; } }
/* A board of small and large cards in balanced columns (settings): each `.board-col` is a column
   on desktop. On phones the columns melt into one list, in the order of `--o` on each card. */
.board { display: grid; gap: var(--gap-card); grid-template-columns: minmax(0, 1fr); align-items: start; }
.board-col { display: contents; }
.board-col > * { order: var(--o, 0); min-width: 0; }
@media (min-width: 900px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board.board-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .board-col { display: grid; gap: var(--gap-card); align-content: start; min-width: 0; }
}
/* Cards placed one after the other right in the page (outside a grid) keep the card gap. */
main > :is(.card, .panel) + :is(.card, .panel) { margin-top: var(--gap-card); }
.row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }

/* ---------- Cards ---------- */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.panel > h2:first-child, .card > h2:first-child { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.card.highlight { border-color: rgba(34, 197, 94, .5); background: linear-gradient(180deg, rgba(34, 197, 94, .08), var(--surface) 60%); }
.card.warn { border-color: rgba(245, 180, 11, .45); }
.card.bad { border-color: rgba(239, 68, 68, .5); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: .7rem .85rem; }
.kpi .label { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Buttons and forms ---------- */
button, .button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius-s); border: 1px solid transparent;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
button:hover, .button:hover, .btn:hover { background: var(--brand-2); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .button.secondary, .btn-quiet {
  background: transparent; color: var(--text); border-color: var(--line);
}
button.secondary:hover, .button.secondary:hover, .btn-quiet:hover { background: var(--surface-2); border-color: var(--surface-3); }
button.danger, .button.danger, .btn-danger { background: transparent; color: #fca5a5; border-color: rgba(239, 68, 68, .5); }
button.danger:hover, .btn-danger:hover { background: rgba(239, 68, 68, .12); }
button.link { background: none; border: 0; color: var(--brand); padding: 0; min-height: 0; font-weight: 600; }
button.link:hover { background: none; text-decoration: underline; }
.btn-block { width: 100%; }
form.inline { display: inline; }
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .6rem .75rem; min-height: 44px; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
textarea { width: 100%; min-height: 6rem; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 20px; height: 20px; accent-color: var(--brand); vertical-align: middle; }
input[type=color] { padding: 4px; width: 56px; }
.field { margin-bottom: .9rem; }
.field input, .field select { width: 100%; }
.check { display: flex; gap: .6rem; align-items: center; color: var(--text); font-weight: 500; font-size: 1rem; }

/* Segmented control (tactics, sizes) */
.segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  margin: 0; padding: .5rem .85rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.segmented input:checked + label { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.segmented input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.segmented input:disabled + label { opacity: .5; cursor: not-allowed; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding: .5rem; border-bottom: 1px solid var(--line); }
td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.me td { background: rgba(34, 197, 94, .08); font-weight: 700; }
tr.zone-up td:first-child { box-shadow: inset 3px 0 0 var(--good); }
tr.zone-down td:first-child { box-shadow: inset 3px 0 0 var(--bad); }

/* ---------- Badges, pills, meters ---------- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--text); white-space: nowrap; }
/* A badge never gets wider than its box; alone in a paragraph it is a sentence, so it wraps. */
.badge { max-width: 100%; }
p > .badge:only-child { white-space: normal; }
.badge.good { background: rgba(34, 197, 94, .15); color: #86efac; }
.badge.warn { background: rgba(245, 180, 11, .15); color: #fcd34d; }
.badge.bad { background: rgba(239, 68, 68, .15); color: #fca5a5; }
/* [D] The derby of each tournament (clásico): a warm badge and the match page banner. */
.badge.derby { background: rgba(249, 115, 22, .18); color: #fdba74; }
.match-line .mid .badge.derby { display: block; margin: .15rem auto 0; width: max-content; }
.derby-banner { margin: .25rem 0 .5rem; padding: .4rem .7rem; border-radius: 10px; background: rgba(249, 115, 22, .12); color: #fdba74; font-size: .9rem; }
.badge.gold { background: rgba(242, 201, 76, .18); color: var(--gold); }
.badge.silver { background: rgba(199, 208, 216, .16); color: var(--silver); }
.badge.bronze { background: rgba(208, 138, 84, .18); color: var(--bronze); }
.badge.pos { color: #0b0f0d; }
.pos-goalkeeper, .badge.pos.goalkeeper { background: var(--pos-gk); }
.pos-defender, .badge.pos.defender { background: var(--pos-df); }
.pos-midfielder, .badge.pos.midfielder { background: var(--pos-mf); }
.pos-forward, .badge.pos.forward { background: var(--pos-fw); }
.result { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-weight: 800; font-size: .8rem; color: #0b0f0d; }
.result.w { background: var(--good); } .result.d { background: var(--silver); } .result.l { background: var(--bad); color: #fff; }

.meter { --v: 50; display: inline-block; width: 100%; max-width: 160px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.meter > i { display: block; height: 100%; width: calc(var(--v) * 1%); background: var(--good); border-radius: inherit; }
.meter.mid > i { background: var(--warn); }
.meter.low > i { background: var(--bad); }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); }

/* ---------- Players ---------- */
.player-chip { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.player-chip .avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .75rem; color: #0b0f0d; }
.player-chip .who { min-width: 0; }
.player-chip .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.player-chip .who small { display: block; }
.player-list { display: grid; gap: .25rem; }
.player-row { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; padding: .55rem .6rem; border-radius: var(--radius-s); color: var(--text); }
.player-row:hover { background: var(--surface-2); text-decoration: none; }
.player-row .side { display: flex; gap: .75rem; align-items: center; }
.ovr { font-weight: 900; font-size: 1.1rem; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.group-title { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: 1rem .6rem .35rem; }
.medal { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: .65rem; font-weight: 900; color: #0b0f0d; }
.medal.gold { background: var(--gold); } .medal.silver { background: var(--silver); } .medal.bronze { background: var(--bronze); }

/* ---------- Pitch (lineup) ---------- */
.pitch {
  position: relative; aspect-ratio: 68 / 90; width: 100%; max-width: 520px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  background:
    repeating-linear-gradient(180deg, var(--pitch) 0 10%, var(--pitch-2) 10% 20%);
  border: 2px solid rgba(255, 255, 255, .15);
}
.pitch::before { /* markings */
  content: ""; position: absolute; inset: 4%; border: 2px solid rgba(255, 255, 255, .22); border-radius: 4px;
  background:
    linear-gradient(rgba(255, 255, 255, .22), rgba(255, 255, 255, .22)) center / 100% 2px no-repeat,
    radial-gradient(circle at center, transparent 11%, rgba(255, 255, 255, .22) 11.3%, transparent 11.8%);
}
.pitch .box-top, .pitch .box-bottom { position: absolute; left: 25%; width: 50%; height: 13%; border: 2px solid rgba(255, 255, 255, .22); }
.pitch .box-top { top: 4%; border-top: 0; } .pitch .box-bottom { bottom: 4%; border-bottom: 0; }
.slot {
  position: absolute; transform: translate(-50%, -50%); width: 25%; max-width: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0;
  padding: 0; min-height: 0; color: #fff; cursor: pointer; font-weight: 600;
}
.slot:hover { background: none; }
.slot .disc {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font-weight: 900; font-size: .85rem; color: #0b0f0d; box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
  border: 2px solid rgba(255, 255, 255, .85);
}
.slot .disc.empty { background: rgba(0, 0, 0, .35); color: #fff; border-style: dashed; }
.slot .disc .cap { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #0b0f0d; font-size: .65rem; display: grid; place-items: center; border: 2px solid #0b0f0d; }
.slot .disc .warn-dot { position: absolute; bottom: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.slot .label { max-width: 100%; font-size: .72rem; line-height: 1.15; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .fit { width: 36px; height: 4px; border-radius: 999px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.slot .fit i { display: block; height: 100%; background: var(--good); }
.slot.selected .disc { outline: 3px solid var(--warn); outline-offset: 2px; }
.bench { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; max-width: 520px; margin: .75rem auto 0; }
.bench .slot { position: static; transform: none; width: auto; max-width: none; color: var(--text); }
.bench .slot .label { text-shadow: none; }

/* ---------- Sheets (dialog) ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--surface); color: var(--text); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; margin: auto auto 0; max-height: 85vh; box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .6); }
@media (min-width: 900px) { dialog.sheet { border-radius: 20px; margin: auto; } }
.sheet-head { position: sticky; top: 0; background: var(--surface); padding: 1rem 1rem .5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-body { padding: .5rem 1rem 1rem; overflow-y: auto; max-height: calc(85vh - 64px); }
.pick { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; text-align: left; background: transparent; color: var(--text); border: 1px solid transparent; border-radius: var(--radius-s); padding: .55rem .6rem; min-height: 56px; font-weight: 500; }
.pick:hover { background: var(--surface-2); }
.pick[aria-current="true"] { border-color: var(--brand); background: rgba(34, 197, 94, .08); }
.pick:disabled { opacity: .45; }

/* Sticky action bar */
.actionbar {
  position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; gap: .6rem; padding: .75rem 1rem; margin: 1rem -1rem 0;
  background: rgba(11, 15, 13, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.actionbar > * { flex: 1; }
@media (min-width: 900px) { .actionbar { bottom: 0; margin: 1rem 0 0; border: 1px solid var(--line); border-radius: var(--radius); } }

/* ---------- Matches ---------- */
.scorecard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; }
.scorecard .team { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; font-weight: 700; min-width: 0; }
.scorecard .team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.scorecard .score { font-size: 2.2rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .02em; text-align: center; line-height: 1; }
.scorecard .score small { display: block; font-size: .8rem; font-weight: 600; margin-top: .35rem; }
.scoreboard { padding: 1.25rem 1rem; }
.scoreboard .score { font-size: 3rem; }
.match-line { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem; padding: .55rem .4rem; border-bottom: 1px solid var(--line); color: var(--text); }
.match-line:last-child { border-bottom: 0; }
.match-line:hover { text-decoration: none; background: var(--surface-2); }
.match-line .home { text-align: right; } .match-line .away { text-align: left; }
.match-line .mid { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.5rem; text-align: center; }
.match-line.mine { background: rgba(34, 197, 94, .07); font-weight: 700; }
.progress { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: .75rem; }
.progress > i { display: block; height: 100%; background: var(--bad); }

/* Commentary feed */
.feed, .commentary { list-style: none; margin: 0; padding: 0; }
.feed li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.commentary li { display: grid; grid-template-columns: 2.6rem 1.6rem 1fr; gap: .4rem; padding: .55rem .25rem; border-bottom: 1px solid var(--line); align-items: start; }
.commentary li .min { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.commentary li.goal { background: rgba(34, 197, 94, .1); border-radius: var(--radius-s); font-weight: 700; }
.commentary li.card { color: #fcd34d; }
.commentary li.red { color: #fca5a5; }
/* [D] Flavour lines (the flow of play): lighter than the big moments. */
.commentary li.flavour { color: var(--muted); font-style: italic; font-size: .92em; }
.statbar { display: grid; grid-template-columns: 3rem 1fr 3rem; gap: .5rem; align-items: center; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.statbar .label { grid-column: 1 / -1; text-align: center; font-size: .8rem; color: var(--muted); margin-bottom: -.3rem; }
.statbar .bars { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.statbar .bars .h { background: var(--brand); } .statbar .bars .a { background: var(--info); margin-left: auto; }

/* To-do list on the dashboard */
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.todo li a, .todo li > div { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: var(--radius-s); background: var(--surface-2); color: var(--text); }
.todo li a:hover { text-decoration: none; background: var(--surface-3); }
.todo .ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); }
.todo .ico.bad { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.todo .ico.warn { background: rgba(245, 180, 11, .18); color: #fcd34d; }
.todo .ico.good { background: rgba(34, 197, 94, .18); color: #86efac; }
.todo .go { margin-left: auto; color: var(--muted); }
.todo li.done { opacity: .55; }

/* Steps (onboarding) */
.steps { display: flex; gap: .4rem; margin-bottom: 1.25rem; }
.steps span { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-3); }
.steps span.on { background: var(--brand); }
details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; padding: .5rem 0; }

/* ---------- Flash toast ---------- */
.flash {
  position: fixed; left: 50%; transform: translateX(-50%); top: 72px; z-index: 40; width: min(92vw, 520px);
  padding: .8rem 1rem; border-radius: var(--radius-s); box-shadow: var(--shadow); font-weight: 600;
  animation: toast 5s forwards;
}
.flash.ok { background: #0f2e1b; border: 1px solid rgba(34, 197, 94, .6); color: #bbf7d0; }
.flash.error { background: #3a1212; border: 1px solid rgba(239, 68, 68, .6); color: #fecaca; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 6%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }

/* Empty states */
.empty { text-align: center; padding: 1.5rem 1rem; color: var(--muted); }
.empty .button { margin-top: .75rem; }

/* Hero (landing) */
.hero { display: grid; gap: 1.5rem; align-items: center; padding: 1.5rem 0 1rem; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 1fr; padding: 3rem 0 2rem; } }
.hero h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.05; letter-spacing: -.03em; }
.hero h1 b { color: var(--brand); }
.hero ul { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: grid; gap: .5rem; }
.hero ul:not(.commentary) li::before { content: "✓"; color: var(--brand); font-weight: 900; margin-right: .5rem; }
.auth { max-width: 420px; margin: 1.5rem auto; }

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem 1.5rem; }
.tab { display: inline-block; }

/* Match page tabs (CSS only) */
.match-tabs { display: grid; gap: .75rem; }
.match-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.match-tabs > label { display: inline-block; margin: 0 .25rem 0 0; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 700; cursor: pointer; }
.match-tabs { grid-template-columns: repeat(3, max-content); }
.match-tabs > section { grid-column: 1 / -1; display: none; }
#mt-stats:checked ~ .tab-stats, #mt-ratings:checked ~ .tab-ratings, #mt-feed:checked ~ .tab-feed { display: block; }
#mt-stats:checked + label, #mt-ratings:checked + label, #mt-feed:checked + label { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Color swatches (shirt colors) */
.swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches label { margin: 0; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatches input:checked + label { border-color: var(--text); box-shadow: 0 0 0 3px rgba(34, 197, 94, .55); }
.swatches input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Championship tabs and matchday picker */
.ch-tabs { grid-template-columns: repeat(4, max-content); }
#ct-table:checked ~ .tab-table, #ct-fixture:checked ~ .tab-fixture, #ct-scorers:checked ~ .tab-scorers, #ct-social:checked ~ .tab-social { display: block; }
#ct-table:checked + label, #ct-fixture:checked + label, #ct-scorers:checked + label, #ct-social:checked + label { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
@media (max-width: 480px) { .ch-tabs { grid-template-columns: repeat(2, 1fr); } .match-tabs > label { text-align: center; } }
.day-picker > input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker > label { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0 .2rem .3rem 0; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); font-weight: 700; cursor: pointer; }
.day-picker > input:checked + label { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day-picker .day { display: none; }
.chat { display: grid; gap: .5rem; }
.chat .bubble { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: .6rem .8rem; }
.chat .bubble p { margin: .2rem 0; white-space: pre-wrap; }

/* A kit (`ui.shirt`): the kit SVG, the sponsor logo on the chest (always an <img>). The SVG
   viewBox is 200 x 220; the chest is centered at x 50%, y 38%. */
.kit { position: relative; display: inline-block; flex: none; width: var(--size, 28px); height: calc(var(--size, 28px) * 1.1); vertical-align: middle; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.kit .kit-img { display: block; width: 100%; height: 100%; }
.kit .sponsor { position: absolute; left: 50%; top: 37%; width: 32%; height: 14%; transform: translate(-50%, -50%); object-fit: contain; pointer-events: none; }

/* Kit pickers: thumbnails in a grid of radio tiles (registration, kit editor). */
.kit-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .5rem; }
.kit-tiles label { margin: 0; display: grid; justify-items: center; gap: .2rem; padding: .4rem; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .72rem; color: var(--muted); text-align: center; }
.kit-tiles label img { width: 100%; max-width: 64px; height: auto; }
.kit-tiles input { position: absolute; opacity: 0; pointer-events: none; }
.kit-tiles input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(34, 197, 94, .35); color: var(--text); }
.kit-tiles input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.kit-tiles.small { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }

/* Kit editor (/club/kits). */
.kit-editor { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .kit-editor { grid-template-columns: 300px 1fr; align-items: start; } }
.kit-preview { display: grid; justify-items: center; gap: .75rem; }
/* Unsaved kit: a visible notice and a pulsing save button (kit_editor.js). */
.kit-unsaved { margin: 0; padding: .4rem .7rem; border-radius: 6px; background: #fff4d6; color: #7a4b00; border: 1px solid #f2c94c; font-size: .85rem; font-weight: 600; text-align: center; }
.kit-editor[data-dirty] :is(#kit-save, #crest-save) { animation: kit-save-pulse 1.6s ease-in-out infinite; }
@keyframes kit-save-pulse { 50% { box-shadow: 0 0 0 6px rgba(232, 89, 12, .28); } }
@media (prefers-reduced-motion: reduce) { .kit-editor[data-dirty] :is(#kit-save, #crest-save) { animation: none; box-shadow: 0 0 0 3px rgba(232, 89, 12, .4); } }
.kit-preview .kit-big { position: relative; width: 100%; max-width: 260px; aspect-ratio: 200 / 220; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .55)); }
.kit-preview .kit-big img { width: 100%; height: 100%; }
.kit-preview .kit-big .sponsor { position: absolute; left: 50%; top: 37%; width: 32%; height: 14%; transform: translate(-50%, -50%); object-fit: contain; }
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.color-row button.swatch { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.color-row input[type=color] { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: none; }

/* Admin (sponsors). */
.admin-logo { width: 96px; height: 48px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
/* A house sponsor always pays the house premium: no premium field while "house" is checked. */
.admin-sponsor-form:has(.admin-house input:checked) .admin-premium { display: none; }

/* Player row v2: position tag · name and chips · fitness · morale · rating */
.prow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .75rem; align-items: center;
  padding: .6rem .7rem; border-radius: var(--radius-s); color: var(--text); border: 1px solid transparent;
}
.prow + .prow { border-top-color: var(--line); border-radius: 0; }
.prow:hover { text-decoration: none; background: var(--surface-2); border-radius: var(--radius-s); }
.pos-tag {
  display: inline-grid; place-items: center; min-width: 44px; height: 26px; padding: 0 .4rem; border-radius: 7px;
  font-size: .72rem; font-weight: 900; letter-spacing: .03em; color: #0b0f0d;
}
.prow-main { min-width: 0; }
/* A player's name never ends in "…": it wraps (it is the information). */
.prow-name { display: block; font-size: 1rem; overflow-wrap: break-word; line-height: 1.1; }
.prow-meta { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.chip.bad { background: rgba(239, 68, 68, .16); color: #fca5a5; }
.chip.good { background: rgba(34, 197, 94, .16); color: #86efac; }
.chip.gold { background: rgba(242, 201, 76, .16); color: var(--gold); }
.chip.silver { background: rgba(199, 208, 216, .14); color: var(--silver); }
.chip.bronze { background: rgba(208, 138, 84, .16); color: var(--bronze); }
.prow-stat { display: grid; grid-template-columns: auto; gap: .1rem; width: 84px; font-size: .72rem; color: var(--muted); }
.prow-stat .prow-num { font-size: .95rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
/* Fitness in a word ("Algo cansado"), never a percent: smaller, and it may take two lines. */
.prow-stat .prow-word { font-size: .8rem; line-height: 1.1; }
.prow-stat .meter { max-width: none; }
.prow-wide { display: none; }
.rating {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 1.15rem; font-weight: 900;
  font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
}
.rating.bronze { background: linear-gradient(160deg, #e0a06e, #9a5b2f); color: #1b0e05; border-color: transparent; }
.rating.silver { background: linear-gradient(160deg, #eef2f5, #9aa6b1); color: #11161b; border-color: transparent; }
.rating.gold { background: linear-gradient(160deg, #fbe28a, #c99a1e); color: #241a00; border-color: transparent; }
/* Elite (90+, phase F12): a foil of gold, violet and teal, like the star card's frame. */
.rating.elite { background: linear-gradient(160deg, #fff4c2, #f2c94c 35%, #b38cff 70%, #44c7c0); color: #1a1030; border-color: transparent; box-shadow: 0 0 0 2px rgba(179, 140, 255, .35); }
@media (min-width: 700px) {
  .prow { grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 1.25rem; }
  .prow-wide { display: grid; }
}
@media (max-width: 420px) { .prow-stat { width: 64px; } .pos-tag { min-width: 38px; } }

/* ---------- Lineup: pitch with shirts, bench outside (docs/ux.md) ---------- */
.lineup-formations { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; }
.lineup-formations label { flex: none; }
.lineup { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .lineup { grid-template-columns: minmax(0, 540px) 1fr; align-items: start; } }
.lineup-pitch {
  position: relative; aspect-ratio: 68 / 100; width: 100%; max-width: 540px; margin: 0 auto; border-radius: 18px; overflow: hidden;
  background: repeating-linear-gradient(180deg, #15803d 0 8.33%, #166534 8.33% 16.66%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .18), 0 10px 30px rgba(0, 0, 0, .4);
}
.lineup-pitch .lines { position: absolute; inset: 3.5%; border: 2px solid rgba(255, 255, 255, .35); border-radius: 4px; }
.lineup-pitch .half { position: absolute; left: 3.5%; right: 3.5%; top: 50%; border-top: 2px solid rgba(255, 255, 255, .35); }
.lineup-pitch .circle { position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, .35); border-radius: 50%; }
.lineup-pitch .area { position: absolute; left: 22%; width: 56%; height: 15%; border: 2px solid rgba(255, 255, 255, .35); }
.lineup-pitch .area.top { top: 3.5%; border-top: 0; } .lineup-pitch .area.bottom { bottom: 3.5%; border-bottom: 0; }
.lineup-pitch .small { position: absolute; left: 37%; width: 26%; height: 6%; border: 2px solid rgba(255, 255, 255, .35); }
.lineup-pitch .small.top { top: 3.5%; border-top: 0; } .lineup-pitch .small.bottom { bottom: 3.5%; border-bottom: 0; }
.lineup-pitch .p {
  position: absolute; transform: translate(-50%, -50%); width: 22%; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 0; min-height: 0; color: #fff; cursor: pointer; transition: left .35s ease, top .35s ease;
}
.lineup-pitch .p:hover { background: none; }
.lineup-pitch .p .kit .cap { position: absolute; top: -4px; right: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #0b0f0d; font-size: .62rem; font-weight: 900; display: grid; place-items: center; border: 2px solid #0b0f0d; }
.lineup-pitch .p .kit .hurt { position: absolute; bottom: -2px; left: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; }
.lineup-pitch .p .name { font-size: .78rem; font-weight: 700; background: rgba(0, 0, 0, .6); border-radius: 6px; padding: 1px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lineup-pitch .p .role { font-size: .62rem; font-weight: 800; color: #d1fae5; text-transform: uppercase; letter-spacing: .04em; text-shadow: 0 1px 2px rgba(0, 0, 0, .9); }
.lineup-pitch .p.off .role { color: #fcd34d; } .lineup-pitch .p.off .role::after { content: " ⚠"; }
.lineup-pitch .p.out .name { background: rgba(127, 29, 29, .85); }
.jersey-empty { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, .7); color: #fff; font-size: 1.4rem; font-weight: 800; background: rgba(0, 0, 0, .25); }
.jersey-empty.small { width: 32px; height: 32px; font-size: 1.1rem; border-color: var(--line); color: var(--muted); }
.bench-card h2 { margin-bottom: .5rem; }
.bench-list { display: grid; gap: .4rem; }
@media (max-width: 899px) { .bench-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bench-item { display: flex; align-items: center; gap: .6rem; padding: .5rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-align: left; font-weight: 500; min-height: 52px; width: 100%; cursor: pointer; }
.bench-item:hover { background: var(--surface-3); }
.bench-item.reserve { cursor: default; opacity: .85; min-height: 0; }
.bench-item .info { min-width: 0; }
.bench-item .info b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-item .info small { color: var(--muted); }
.picker-current { display: flex; gap: .75rem; align-items: center; padding: .5rem 0; }
.pick .player-chip .kit { flex: none; }

/* Kit gallery (/kits): every shirt model in a grid of cards. */
.kit-gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kit-gallery-card { display: grid; justify-items: center; gap: .3rem; padding: .75rem .5rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); text-align: center; }
.kit-gallery-card img { width: 100%; max-width: 160px; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.kit-gallery-card b { font-size: .9rem; }
.kit-gallery-card code { font-size: .68rem; color: var(--muted); word-break: break-all; }

/* Public club profile */
.club-hero { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
@media (max-width: 480px) { .club-hero { grid-template-columns: 1fr; text-align: center; } .club-hero .row { justify-content: center; } }

/* Commentary rows use event classes ("card" = yellow card): never the .card component look. */
.commentary li.card, .commentary li.red, .commentary li.goal { border: 0; border-bottom: 1px solid var(--line); padding: .55rem .25rem; box-shadow: none; }
.commentary li.card, .commentary li.red { background: none; border-radius: 0; }
.commentary li.goal { border-radius: var(--radius-s); }

.spread > .match-line { flex: 1; }

/* ---------- Live match: TV pitch, live stats, AM radio, ticker and drama (static/js/match.js) ----------
   Panels use the theme variables; only the pitch picture and the radio have their own colours. */
.match-marks { margin-top: .75rem; align-items: start; font-size: .85rem; }
.match-marks > div:first-child { text-align: right; }
.match-ticker { display: flex; gap: .5rem; overflow-x: auto; margin: .9rem -1rem -.5rem; padding: .25rem 1rem .5rem; scrollbar-width: none; }
.match-ticker::-webkit-scrollbar { display: none; }
.match-ticker-row {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; min-height: 36px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: .8rem; white-space: nowrap;
}
.match-ticker-row:hover { text-decoration: none; border-color: var(--muted); }
.match-ticker-row i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.match-ticker-row span { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; }
.match-ticker-score { font-variant-numeric: tabular-nums; }
.match-ticker-state { color: var(--bad); font-weight: 700; }

/* Match tabs: a wrapping row of pills, then the open panel at full width (long commentary
   lines must not widen the pill columns). */
.match-live .match-tabs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.match-live .match-tabs > label { margin: 0; }
.match-live .match-tabs > section { flex: 1 0 100%; width: 100%; min-width: 0; }

/* The stage: the broadcast picture plus its controls. */
.match-stage { --match-home: var(--brand); --match-away: var(--muted); display: grid; gap: .6rem; padding: .6rem; overflow: hidden; }
.match-stage[hidden] { display: none; }
.match-stage-bar { display: flex; justify-content: space-between; gap: .5rem; }
.match-btn {
  min-height: 44px; padding: .4rem .95rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.match-btn:hover { background: var(--surface-3); color: var(--text); }
.match-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.match-stadium { position: relative; border-radius: calc(var(--radius) - 4px); overflow: hidden; background: var(--surface-2); aspect-ratio: 1000 / 620; }
.match-stage.is-strip .match-stadium { aspect-ratio: 1000 / 360; }
.match-stadium svg { display: block; width: 100%; height: 100%; }
.match-stadium text { font-family: "Barlow Condensed", "Oswald", var(--font); }
.match-bubble {
  position: absolute; transform: translate(-50%, calc(-100% - 14px)); max-width: 70%; padding: .25rem .6rem; pointer-events: none;
  border-radius: 8px; background: rgba(10, 12, 11, .82); color: #fff; font-size: .8rem; font-weight: 800; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.match-bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: rgba(10, 12, 11, .82); }
.match-bubble[hidden] { display: none; }
.match-disc { transition: opacity .6s; }
.match-disc.is-active .match-disc-body { stroke: #fff; stroke-width: 4; }
.match-disc.is-off { opacity: 0; }
.match-disc.is-pop .match-disc-body { animation: match-kit .3s ease-in-out 4 alternate; transform-box: fill-box; transform-origin: center; }
.match-flag { animation: match-wave 2.6s ease-in-out infinite alternate; }
.match-bowl { transform-box: fill-box; transform-origin: center bottom; }
.match-bowl.is-jumping { animation: match-jump .3s ease-in-out 10 alternate; }
.match-boards { animation: match-led 4s linear infinite; }
.match-net { transform-box: fill-box; transform-origin: center; }
.match-net.is-shaking { animation: match-shake .12s linear 7; }
.match-flash-layer.is-on { animation: match-flash-layer 1.4s ease-out; }
.kit.match-flash { animation: match-kit .4s ease-in-out 6 alternate; }
.match-caption { min-height: 1.4em; margin: 0; text-align: center; font-weight: 700; color: var(--muted); }
.match-caption.is-hot { color: var(--bad); animation: match-blink .8s ease-in-out infinite alternate; }

/* Momentum: legend, bar, graph with minute ticks. */
.match-momentum { display: grid; gap: .35rem; }
.match-momentum-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; font-size: .8rem; }
.match-legend { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--muted); }
.match-legend span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.match-momentum-head .match-legend:last-child { justify-content: flex-end; }
.match-legend > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.match-legend i { flex: none; width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.match-legend i.home { background: var(--match-home); }
.match-legend i.away { background: var(--match-away); }
.match-momentum-bar { height: 6px; border-radius: 999px; overflow: hidden; background: var(--match-away); }
.match-momentum-bar > i { display: block; width: 50%; height: 100%; background: var(--match-home); transition: width .8s ease; }
.match-momentum-graph svg { display: block; width: 100%; height: auto; }

.match-roll { display: inline-flex; flex-direction: column; height: 1em; overflow: hidden; line-height: 1; vertical-align: top; }
.match-roll i { font-style: normal; animation: match-roll .6s cubic-bezier(.2, .8, .2, 1) forwards; }

/* The AM radio: the newest commentary line. Wood body, cream dial, red needle, gold accents. */
.match-radio {
  position: relative; display: grid; gap: .7rem; margin: 0 0 .75rem; padding: .9rem .9rem .8rem; border-radius: 18px;
  background: linear-gradient(160deg, #6a4528, #3b2414 70%); border: 3px solid #2a190d;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14), inset 0 0 0 2px rgba(231, 184, 74, .35), 0 6px 16px rgba(0, 0, 0, .25);
}
.match-radio::before, .match-radio::after {
  content: "❦"; position: absolute; top: 4px; color: #e7b84a; font-size: .9rem; line-height: 1; opacity: .8;
}
.match-radio::before { left: 9px; }
.match-radio::after { right: 9px; transform: scaleX(-1); }
.match-dial {
  position: relative; display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 .6rem; border-radius: 8px;
  background: linear-gradient(#f3dfb0, #d9c08a); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45); overflow: hidden;
  font: 700 .72rem/1 "Barlow Condensed", "Oswald", var(--font); color: #6b4a1d; letter-spacing: .06em;
}
.match-needle { position: absolute; top: 2px; bottom: 2px; width: 3px; margin-left: -1px; border-radius: 2px; background: #c8102e; box-shadow: 0 0 6px rgba(200, 16, 46, .6); transition: left 1s ease; }
.match-radio-line { margin: 0; color: #f6ead0; font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.match-radio-line b { color: #e7b84a; font-family: "Barlow Condensed", "Oswald", var(--font); font-size: 1.3rem; margin-right: .2rem; }
.match-radio-line.goal { font-weight: 800; font-size: 1.25rem; }
.match-radio-line.goal span { color: #fff; text-shadow: 0 0 12px rgba(231, 184, 74, .55); }
.match-radio-line.red span { color: #ffb4b4; }
.match-radio-line.flavour span { font-weight: 500; font-style: italic; opacity: .85; }
/* [D] The relato: the booth and the three voices (relator, comentarista, the stands), each in
   its colour, with its portrait; the beats of a move in italics; a goal's long shout. */
.match-booth { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: 0 0 .6rem; font-size: .85rem; }
.mb-voice { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.mb-voice img { border-radius: 50%; background: var(--surface-2); object-fit: cover; border: 2px solid var(--voice); }
.mb-voice > span { display: grid; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.mb-voice b { color: var(--voice); }
.mb-voice small { color: var(--muted); }
.v-relator { --voice: #e7b84a; }
.v-comentarista { --voice: #7dd3fc; }
.v-tribuna { --voice: #f9a8d4; }
.rl-who { display: inline-grid; place-items: center; width: 22px; height: 22px; line-height: 1; }
.rl-who img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 2px solid var(--voice); background: var(--surface-2); }
.rl-name { color: var(--voice); font-weight: 700; }
.rl-body { min-width: 0; overflow-wrap: anywhere; }
.rl-body a { color: inherit; text-decoration: underline; text-decoration-color: var(--voice); text-underline-offset: 2px; }
.commentary li.rl { border-left: 3px solid var(--voice); }
.commentary li.v-comentarista { color: #bae6fd; font-size: .95em; }
.commentary li.v-tribuna { color: #fbcfe8; font-style: italic; font-size: .95em; }
.commentary li.beat { color: var(--muted); font-style: italic; font-size: .9em; padding-top: .3rem; padding-bottom: .3rem; }
.commentary li.cry .rl-body { font-size: 1.08em; }
.commentary li .share { margin-left: .2rem; vertical-align: middle; }
.match-radio-line .rl-who { vertical-align: -5px; margin-right: .3rem; }
.match-radio-line.v-comentarista .rl-body { color: #bae6fd; font-weight: 500; }
.match-radio-line.v-tribuna .rl-body { color: #fbcfe8; font-style: italic; font-weight: 500; }
.match-radio-line.beat .rl-body { color: #e7b84a; font-style: italic; animation: match-blink .8s ease-in-out infinite alternate; }
.rl-shout { display: block; margin: .1rem 0 .2rem; color: #fff; font: italic 900 clamp(1.9rem, 11vw, 3rem)/1.05 "Barlow Condensed", "Oswald", var(--font);
  letter-spacing: .02em; text-shadow: 0 0 14px rgba(231, 184, 74, .7); overflow-wrap: anywhere; }
.rl-shout.is-shouting { animation: rl-shout 1.6s cubic-bezier(.2, 1.2, .4, 1); transform-origin: left center; }
@keyframes rl-shout { 0% { letter-spacing: -.12em; transform: scale(.7); opacity: 0; } 35% { opacity: 1; transform: scale(1.06); } 100% { letter-spacing: .02em; transform: scale(1); } }
.match-grille { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; height: 22px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .45) 0 3px, transparent 3px 7px); }
.match-grille i { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f3dfb0, #a77b1f 70%); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

/* Overlays: goal, red card, woodwork, penalty, final whistle. */
.match-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 6, .6); overflow: hidden; }
.match-overlay[hidden] { display: none; }
.match-overlay-card {
  position: relative; z-index: 1; width: min(100%, 460px); display: grid; gap: .35rem; padding: 1.25rem 1rem; text-align: center;
  border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: match-pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
.match-overlay-card strong { font-size: clamp(1.8rem, 9vw, 3rem); font-weight: 900; line-height: 1.05; letter-spacing: .01em; }
.match-overlay-card span { font-weight: 700; }
.match-overlay.is-goal .match-overlay-card {
  width: calc(100% + 32px); border: 0; border-radius: 0; padding: 2rem 1rem; color: #fff;
  background: linear-gradient(100deg, var(--p) 0 55%, var(--s) 55% 100%);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 18px rgba(0, 0, 0, .6);
}
.match-overlay.is-goal .match-overlay-card strong { font-size: clamp(2.6rem, 15vw, 6rem); font-style: italic; }
.match-overlay.is-red { background: rgba(127, 29, 29, .55); animation: match-red .9s ease-out; }
.match-overlay.is-red .match-overlay-card { background: #b91c1c; border-color: #ef4444; color: #fff; }
.match-overlay.is-woodwork .match-overlay-card strong { color: var(--gold); }
.match-overlay.is-penalty .match-overlay-card { border-color: var(--warn); }
.match-overlay.is-penalty .match-overlay-card strong { color: var(--warn); }
.match-overlay.is-final .match-overlay-card strong { font-size: 1.6rem; }
.match-overlay.is-calm .match-overlay-card { animation: none; }
.match-mvp { display: grid; gap: .1rem; margin: .5rem 0 0; padding: .6rem; border-radius: var(--radius-s); background: var(--surface-2); }
.match-mvp b { color: var(--gold); font-size: 1.15rem; }
.match-actions { display: flex; justify-content: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.match-confetti { position: absolute; inset: 0; pointer-events: none; }
.match-confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px; animation: match-confetti 2.4s linear forwards; }

@keyframes match-blink { from { opacity: 1; } to { opacity: .55; } }
@keyframes match-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px) scaleY(1.06); } 75% { transform: translateX(3px) scaleY(.95); } }
@keyframes match-jump { to { transform: translateY(-4px); } }
@keyframes match-wave { from { transform: skewY(-3deg) scaleX(.96); } to { transform: skewY(3deg) scaleX(1.02); } }
@keyframes match-led { 0% { opacity: .5; } 50% { opacity: 1; } 100% { opacity: .5; } }
@keyframes match-flash-layer { 0% { opacity: .45; } 30% { opacity: .1; } 45% { opacity: .35; } 100% { opacity: 0; } }
@keyframes match-kit { to { transform: scale(1.18); filter: drop-shadow(0 0 10px rgba(255, 255, 255, .8)); } }
@keyframes match-roll { from { transform: translateY(0); } to { transform: translateY(-100%); } }
@keyframes match-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes match-red { from { background: rgba(239, 68, 68, .85); } }
@keyframes match-confetti { to { transform: translate(var(--drift, 0), 105vh) rotate(720deg); } }

@media (min-width: 900px) {
  .match-live.has-stage { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
  .match-live.has-stage > .scoreboard { grid-column: 1 / -1; }
  .match-live.has-stage > .match-stage { grid-column: 1; grid-row: 2; }
  .match-live.has-stage > .match-feed, .match-live.has-stage > .match-tabs { grid-column: 2; grid-row: 2; }
  .match-live.has-stage .match-feed .commentary { max-height: 52vh; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .match-stage *, .match-overlay, .match-overlay *, .match-radio *, .kit.match-flash { animation: none !important; transition: none !important; }
}

/* Mobile: grid columns may shrink below their content (a long name or table never widens the page). */
.stack, .grid, .cols-2, .lineup, .kpis { min-width: 0; }
.stack > *, .grid > *, .cols-2 > *, .lineup > *, .match-tabs > *, .card, .panel { min-width: 0; }
.cols-2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.lineup { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .lineup { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); } }
.stack { grid-template-columns: minmax(0, 1fr); }
.scorecard { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.match-line { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.match-line .home, .match-line .away { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { overflow-x: clip; }

/* Sponsors catalog: cards with the logo. */
.sponsor-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sponsor-card { display: grid; align-content: start; }
.sponsor-logo { height: 56px; display: grid; place-items: center start; }
.sponsor-logo img { max-height: 56px; max-width: 160px; object-fit: contain; }

/* ===================================================================================
   Market, club section (finances, fans, tribunal, messages, settings), rankings, news
   and the help center. Owned by the "screens" redesign; classes are prefixed per screen.
   =================================================================================== */

/* Contextual help: the "?" in a page head opens the guide of the screen. */
.help-q {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 800;
}
.help-q:hover { text-decoration: none; color: var(--brand); border-color: var(--brand); }

/* ---------- Market ---------- */
.market-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: var(--surface); font-size: .72rem; margin-left: .2rem; }
.market-filters { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding: 0 0 .25rem; margin-bottom: 1rem; align-items: center; }
.market-filters::-webkit-scrollbar { display: none; }
.market-filters select, .market-toggle {
  flex: none; min-height: 40px; border-radius: 999px; padding: .4rem 2rem .4rem .9rem; font-size: .9rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); max-width: 72vw;
}
.market-toggle { position: relative; display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding-right: .9rem; cursor: pointer; color: var(--text); }
.market-toggle input { position: absolute; inset: 0; opacity: 0; width: 1px; height: 1px; }
.market-toggle:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.market-toggle:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.market-go { flex: none; min-height: 40px; border-radius: 999px; }
.market-clear { flex: none; font-weight: 600; font-size: .9rem; padding: 0 .4rem; }
.market-note { margin: 0 0 1rem; gap: 1rem; flex-wrap: wrap; }
.market-results { padding: .5rem; }
.market-results .group-title { margin-top: .5rem; }
.market-row { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); }
.market-row:first-of-type { border-top: 0; }
.market-row .prow { border: 0; }
.market-act { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 0 .7rem .6rem; }
.market-price { font-size: .85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-price b { font-variant-numeric: tabular-nums; }
/* [D] Plan F6: a free agent's row says where he comes from on its own line. */
.market-act.free { flex-wrap: wrap; row-gap: .2rem; }
.market-act.free .market-source { order: -1; flex-basis: 100%; }
/* The resale lock: a sentence on its own line, inside the row. */
.market-act:has(> .badge.wrap) { flex-wrap: wrap; row-gap: .35rem; }
.market-act .badge.wrap { flex: 1 1 100%; }
.market-btn { min-height: 38px; padding: .35rem .9rem; font-size: .9rem; flex: none; }
@media (min-width: 900px) {
  .market-row { grid-template-columns: minmax(0, 1fr) 280px; align-items: center; }
  /* The value and the club on one line, the wage and the button under them (the narrow
     column cut the value: "US$ 5…"). */
  .market-act { padding: .6rem .7rem; flex-wrap: wrap; row-gap: .25rem; }
  .market-act:not(.free) .market-price { flex: 1 1 100%; }
  .market-wage { white-space: nowrap; }
}
.market-wide { width: 100%; }
.market-small { font-size: .82rem; margin: 0; }
/* [D] One shot per player: the locked-out agent's line under a disabled button, on its own
   line and wrapped (360px wide screens). */
.neg-locked { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; margin-top: .3rem; }
.market-offer input[type=range] { width: 100%; accent-color: var(--brand); min-height: 32px; padding: 0; border: 0; background: none; box-shadow: none; }
.market-offer-price { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.market-offer-price output { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
/* The price gauge (market/gauge.html): market value · delta, the allowed range below. */
.market-gauge { margin: 0; font-size: .88rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.market-gauge small { display: block; }
form:not(.stack) > .market-gauge { margin: .5rem 0 .75rem; }
.market-delta { color: var(--good); }
.market-delta.out { color: var(--bad); }
.market-inbox { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .market-inbox { grid-template-columns: 1fr 1fr; align-items: start; } }
.market-offer-card { display: grid; gap: .4rem; padding: .8rem; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); }
.market-offer-card + .market-offer-card { margin-top: .6rem; }
.market-offer-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: 0; }
.market-amount { font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.market-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.market-counter > summary { padding: .25rem 0; }
.market-counter form { margin-top: .4rem; }
.market-history { list-style: none; margin: 0; padding: 0; }
.market-history li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main deal chat" "main status status"; gap: .3rem .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.market-history li:last-child { border-bottom: 0; }
.market-history-main { min-width: 0; grid-area: main; }
.market-history li > .num { grid-area: deal; }
.market-history li > .market-small { grid-area: chat; }
/* The status of a deal sits under the price, as wide as its word: a chip, or the FIRMADO stamp. */
.market-history li > .badge, .market-history li > .mo-ink { grid-area: status; justify-self: end; align-self: start; }
.market-history li > .mo-ink { margin: .15rem .3rem .2rem 0; }
/* A phone: the names take the whole width; the price, the chat link and the status go under them. */
@media (max-width: 599px) {
  .market-history li { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "main main main" "deal chat status"; }
  .market-history li > .badge, .market-history li > .mo-ink { align-self: center; }
}
/* Names and clubs never end in "…": they wrap (they are the information). */
.market-history-main b, .market-history-main small { display: block; overflow-wrap: break-word; }
.market-ads { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.market-ad { display: grid; gap: .6rem; align-content: start; }
.market-ad-player { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; color: var(--text); }
.market-ad-player:hover { text-decoration: none; }
.market-ad-player b, .market-ad-player small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-ad-wanted { font-weight: 700; margin: 0; }
.market-ad-note { margin: 0; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }

/* [D] The offer desk (market/offer.html): the player, the seller's needs, the form, the
   buyer's accounts, the checklist and the other manager's view. */
.desk-head { margin: 0 0 var(--space-3); font-size: 1.25rem; }
.desk-head small { font-size: .85em; }
.desk .prow { border: 0; padding-left: 0; padding-right: 0; }
.desk-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); margin: var(--space-2) 0; }
.desk-facts > div { min-width: 0; }
.desk-facts dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.desk-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.desk-facts .badge { white-space: normal; }
.desk-lines, .desk-check-list, .desk-hint-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.desk-line { padding: var(--space-2) var(--space-3); border-left: 4px solid var(--line); background: var(--surface-2); border-radius: var(--radius-s); }
.desk-line.short { border-left-color: var(--bad); }
.desk-line.even { border-left-color: var(--warn, #c98a00); }
.desk-line.extra { border-left-color: var(--good); }
.desk-line-head { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; }
.desk-line-head .badge { margin-left: auto; }
.desk-names { margin: .25rem 0 0; font-size: .85rem; line-height: 1.5; }
.desk-names a.out { color: var(--bad); }
.desk-names a.him { font-weight: 700; text-decoration: line-through; }
.desk-names small { color: var(--muted); font-variant-numeric: tabular-nums; }
.desk-check-list li { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); gap: .3rem; font-size: .9rem; line-height: 1.35; }
.desk-check-list li > span { font-weight: 900; text-align: center; }
.desk-check-list li.ok > span { color: var(--good); }
.desk-check-list li.warn > span { color: #b07800; }
.desk-check-list li.bad { color: var(--bad); font-weight: 600; }
.desk-hint-list li { font-size: .9rem; line-height: 1.4; padding-left: .9rem; position: relative; }
.desk-hint-list li::before { content: "•"; position: absolute; left: 0; color: var(--brand); font-weight: 900; }
.desk-table th { background: none; color: var(--muted); font-size: .72rem; padding: .35rem .25rem; text-align: left; }
.desk-table thead th { text-align: right; }
.desk-table td { padding: .35rem .25rem; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.desk-table td.bad { color: var(--bad); font-weight: 700; }
.desk-swaps { border: 0; margin: 0; padding: 0; display: grid; gap: .3rem; min-width: 0; }
.desk-swaps legend { padding: 0; font-family: var(--condensed); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; margin-bottom: .2rem; }
.desk-short { color: var(--ink); font-weight: 600; }
.desk-swap-line { margin: var(--space-2) 0 0; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .4rem; border-bottom: 1px solid var(--line); padding-bottom: .1rem; }
.desk-swap { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .5rem; margin: 0; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer;
  font-family: var(--font); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text); font-size: .9rem; }
.desk-swap.none { grid-template-columns: auto minmax(0, 1fr); font-weight: 700; }
.desk-swap input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.desk-swap:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #fff3d6; }
.desk-swap.fits { border-left: 4px solid var(--good); }
.desk-swap.no { opacity: .55; cursor: not-allowed; }
.desk-swap .pos-tag { min-width: 40px; }
.desk-swap-main { min-width: 0; display: grid; }
.desk-swap-main a { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-swap-main small { font-size: .78rem; }
.desk-why { color: var(--bad); }
.desk-ovr { font-family: var(--condensed); font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* ---------- Finances ---------- */
.fin-balance { display: grid; gap: .4rem; }
.fin-big { font-size: 2.4rem; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fin-big-2 { font-size: 1.4rem; }
.fin-compare { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .35rem .6rem; align-items: center; font-size: .85rem; margin-top: .5rem; }
.fin-track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.fin-track i { display: block; height: 100%; border-radius: inherit; }
.fin-in-bar { background: var(--good); } .fin-out-bar { background: var(--warn); }
.fin-plus { color: var(--good); font-variant-numeric: tabular-nums; } .fin-minus { color: var(--bad); font-variant-numeric: tabular-nums; }
.fin-note { font-size: .85rem; margin: 0; }
.fin-kpis { margin-top: .5rem; }
.fin-alert { margin: 0; padding: .6rem .75rem; border-radius: var(--radius-s); background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--text); border-left: 3px solid var(--warn); font-weight: 600; font-size: .9rem; }
.fin-flow { display: flex; gap: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fin-in { color: var(--good); } .fin-out { color: var(--bad); }
.fin-ledger, .fin-debts, .fin-payroll { list-style: none; margin: 0; padding: 0; }
.fin-ledger li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.fin-ledger li:last-child { border-bottom: 0; }
.fin-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: .95rem; }
.fin-ico.good { background: color-mix(in srgb, var(--good) 18%, transparent); } .fin-ico.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); } .fin-ico.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.fin-what { min-width: 0; }
.fin-what b, .fin-what small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-debt { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.fin-debt:last-child { border-bottom: 0; }
.fin-debt > span { min-width: 0; }
.fin-debt b, .fin-debt small { display: block; }
.fin-pay { display: flex; gap: .4rem; }
.fin-pay input { width: 7.5rem; }
.fin-stepper { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .4rem; }
.fin-stepper input { width: 100%; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-stepper button, .fin-stepper .button { width: 44px; padding: 0; font-size: 1.2rem; }
.fin-stadium label { margin: 0; }
.fin-payroll li { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.fin-payroll li:last-child { border-bottom: 0; }

/* ---------- Fans ---------- */
.fans-lock { margin: .75rem 0; text-align: center; }
.fans-invite { display: flex; gap: .5rem; }
.fans-invite input { flex: 1; min-width: 0; }
.fans-help { font-size: .88rem; margin: 0; }
.fans-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.fans-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.fans-list li:last-child { border-bottom: 0; }
.fans-email { flex: 1 1 10rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fans-ticket { display: grid; gap: .5rem; padding: .9rem; border-radius: var(--radius-s); border: 2px dashed var(--line); background: var(--surface-2); }
.fans-ticket-page { max-width: 520px; margin: 1rem auto; text-align: center; display: grid; gap: .75rem; }
.fans-ticket-page h1 { margin: 0; font-size: 1.4rem; }
.fans-ticket-page .check { justify-content: center; }
.fans-ticket-kicker { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.fans-ticket-code { font-size: .85rem; margin: 0; }

/* ---------- Tribunal ---------- */
.trib-card { display: grid; gap: .5rem; }
.trib-note { margin: 0; font-size: .88rem; }
.trib-dots { display: inline-flex; gap: .3rem; align-items: center; }
.trib-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line); }
.trib-dots i.on { background: var(--good); border-color: transparent; }
.trib-dots.yellow i { border-radius: 3px; width: 12px; height: 16px; }
.trib-dots.yellow i.on { background: var(--warn); }
.trib-bar { margin: .2rem 0; }
.trib-yellows { list-style: none; margin: 0; padding: 0; }
.trib-yellows li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.trib-yellows li:last-child { border-bottom: 0; }
.trib-yellows a { flex: 1 1 8rem; min-width: 0; color: var(--text); font-weight: 600; }

/* ---------- Messages ---------- */
.msg-folders { margin-bottom: 1rem; }
.msg-folders a { padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: .9rem; }
.msg-folders a.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.msg-folders a:hover { text-decoration: none; }
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-list li > a, .msg-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: .6rem; align-items: center; color: var(--text); }
.msg-list li > a { padding: .65rem .4rem; border-radius: var(--radius-s); }
.msg-list li + li { border-top: 1px solid var(--line); }
.msg-list li > a:hover { background: var(--surface-2); text-decoration: none; }
.msg-list a.unread b, .msg-list a.unread small { color: var(--text); font-weight: 800; }
.msg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.msg-main { min-width: 0; }
.msg-main b, .msg-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-main small { color: var(--muted); }
.msg-time { font-size: .75rem; white-space: nowrap; }
.msg-thread { display: grid; gap: .6rem; margin-bottom: 1rem; }
.msg-bubble { max-width: 85%; padding: .6rem .85rem; border-radius: 14px 14px 14px 4px; background: var(--surface-2); justify-self: start; }
.msg-bubble.mine { justify-self: end; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--brand) 16%, var(--surface)); }
.msg-bubble.current { outline: 1px solid var(--brand); }
.msg-bubble p { margin: .2rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-subject { display: block; font-weight: 700; color: var(--muted); }
.msg-reply { border-top: 1px solid var(--line); padding-top: 1rem; }
.msg-reply label { margin: 0; }

/* ---------- Settings ---------- */
.set-link { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: var(--radius-s); background: var(--surface-2); color: var(--text); margin-bottom: 1rem; }
.set-link:hover { text-decoration: none; background: var(--surface-3); }
.set-link b, .set-link small { display: block; }
.set-link .go { margin-left: auto; color: var(--muted); }
.set-rival label { margin: 0; }
.set-note { margin: 0; font-size: .88rem; }

/* ---------- Rankings and news ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li.me { background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: var(--radius-s); font-weight: 700; }
.rank-pos { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-3); }
.rank-pos.gold { background: var(--gold); color: var(--brand-ink); } .rank-pos.silver { background: var(--silver); color: var(--brand-ink); } .rank-pos.bronze { background: var(--bronze); color: var(--brand-ink); }
.rank-name { min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name small { display: block; overflow: hidden; text-overflow: ellipsis; }
a.rank-name:hover { text-decoration: none; color: var(--brand); }
.rank-note { font-size: .85rem; margin: .75rem 0 0; }
.news-list { display: grid; gap: .6rem; }
.news-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; }
.news-item p { margin: 0 0 .2rem; }
.news-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); font-size: 1.1rem; }

/* ---------- Help center ---------- */
.help-search { margin-bottom: .75rem; }
.help-search input { width: 100%; border-radius: 999px; padding-left: 1.1rem; }
.help-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.help-tile { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .9rem; line-height: 1.2; }
.help-tile:hover { text-decoration: none; border-color: var(--brand); }
.help-tile[hidden], .help-guide[hidden] { display: none; }
.help-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-size: 1rem; }
.help-guide { padding: 0; scroll-margin-top: 130px; }
.help-guide > summary { display: flex; align-items: center; gap: .75rem; padding: 1rem; cursor: pointer; list-style: none; }
.help-guide > summary::-webkit-details-marker { display: none; }
.help-guide-head { min-width: 0; }
.help-guide-head b { display: block; font-size: 1.05rem; }
.help-guide-head small { display: block; color: var(--muted); }
.help-chev { margin-left: auto; color: var(--muted); font-size: 1.4rem; transition: transform .15s; }
.help-guide[open] > summary .help-chev { transform: rotate(90deg); }
.help-guide[open] > summary { border-bottom: 1px solid var(--line); }
.help-steps { list-style: none; margin: 0; padding: 1rem; display: grid; gap: 1.25rem; }
.help-step { display: grid; gap: .6rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .help-step { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 1.25rem; } }
.help-step-text { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; align-items: start; }
.help-step-text h3 { margin: .2rem 0 .25rem; }
.help-step-text p { margin: 0; color: var(--muted); }
.help-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 900; font-size: .85rem; }
.help-go { margin: 0 1rem 1rem; }
.help-rules { margin: 0 1rem 1rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.help-rule h3 { margin: .75rem 0 .35rem; }
.help-rule p { white-space: pre-line; color: var(--muted); margin: 0; }
.help-catalog { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .9rem; display: grid; gap: .3rem; }
/* The illustration: a small "screen" with the real components, not interactive. */
.help-ill {
  position: relative; display: grid; gap: .5rem; padding: .85rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line); box-shadow: inset 0 0 0 4px var(--surface); overflow: hidden;
  pointer-events: none; user-select: none; min-width: 0;
}
.help-ill .prow { padding: .4rem .3rem; }
.help-ill .button { min-height: 38px; font-size: .88rem; padding: .35rem .85rem; }
.help-ill .segmented label { font-size: .82rem; padding: .4rem .7rem; }
.help-ill .commentary li { font-size: .88rem; }
.help-ill .scorecard .score { font-size: 1.8rem; }
.help-ill .market-filters { margin: 0; }
.help-ill .market-row { border: 0; }
.help-pitch { max-width: 240px; aspect-ratio: 68 / 72; }
.help-pitch .p { width: 34%; }
.help-sheet { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.help-sheet .sheet-head { position: static; padding: .65rem .8rem; }
.help-sheet .sheet-head h2 { font-size: .92rem; }
.help-sheet .sheet-body { max-height: none; padding: .4rem .6rem .7rem; }
.help-off { opacity: .45; }
.help-small { font-size: .82rem; margin: 0; }
.help-center-text { text-align: center; margin: 0; }
.help-bar { display: flex; gap: .5rem; } .help-bar > * { flex: 1; }
.help-mt { margin-top: .4rem; justify-self: start; }
.help-meters { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .4rem .6rem; align-items: center; font-size: .85rem; }
.help-meters .meter { max-width: none; }
.help-mentor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .6rem; align-items: center; }
.help-arrow { color: var(--brand); font-weight: 900; text-align: center; }
.help-tiers { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem .6rem; align-items: center; }
.help-time { font-size: 1.3rem; }
.help-sponsor { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 0 .6rem; align-items: center; padding: .5rem .6rem; border-radius: var(--radius-s); background: var(--surface-2); }
.help-sponsor small { grid-row: 2; }
.help-sponsor > :last-child { grid-row: 1 / 3; grid-column: 2; }
.help-kit { position: relative; display: grid; place-items: center; padding: .4rem; }
.help-kit-brand { position: absolute; top: 46%; font-size: .8rem; font-weight: 900; color: var(--surface); text-shadow: 0 0 2px var(--text); letter-spacing: .04em; }
.help-results { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.help-table td { padding: .4rem; font-size: .88rem; }
.help-levels { display: flex; align-items: center; gap: .5rem; }
.help-code { font-size: .95rem; letter-spacing: .08em; }
.help-danger { display: grid; gap: .4rem; padding: .7rem; }

/* [D] Registration names: free text with suggestion chips; an error next to its field. */
.reg-names .field small { display: block; margin-top: .3rem; font-size: .82rem; }
.field-error { color: var(--bad); font-weight: 600; }
.field.has-error input { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.reg-dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; margin: 0 0 .9rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.reg-dt small { flex-basis: 100%; font-size: .82rem; }
.reg-suggest { display: flex; gap: .4rem; margin-top: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.reg-suggest::-webkit-scrollbar { display: none; }
.reg-suggest .chip { flex: 0 0 auto; min-height: 36px; padding: .3rem .75rem; font-size: .85rem; white-space: nowrap; }
@media (min-width: 640px) { .reg-suggest { flex-wrap: wrap; overflow: visible; } }

/* [D] Browser notifications: the dashboard card and the settings section (push.js). push.js
   shows one state at a time with `hidden`: it wins over the display of the classes. */
[data-push][hidden], [data-push] [hidden] { display: none !important; }
.push-card { border-left: 4px solid var(--brand); }
.push-card h2 { display: flex; align-items: center; gap: .4rem; }
.push-card p { margin: .25rem 0 .75rem; }
.push-card .row { flex-wrap: wrap; gap: .5rem; }
.push-browser { display: grid; gap: .4rem; margin: .75rem 0; }
.push-categories { margin-top: .75rem; }
.push-categories .check input { flex: none; }
.push-browsers { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .88rem; }

/* Admin: the activity page (admin/activity.html). The chart is an inline SVG drawn by the server. */
.act-section { margin-top: 1rem; }
.act-section h2 small { font-size: .8rem; font-weight: 500; }
.act-note { font-size: .85rem; margin: .8rem 0 0; }
.kpi.act-warn { border-color: var(--bad); }
.act-table td, .act-days td { white-space: nowrap; }
tr.act-inactive td { color: var(--muted); }
.act-figure { margin: 1rem 0; }
.act-figure figcaption { font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.act-chart { display: block; width: 100%; height: auto; max-height: 160px; overflow: visible; }
.act-chart .axis { stroke: var(--line); stroke-width: 1; }
.act-chart text { fill: var(--muted); font-size: 8px; font-variant-numeric: tabular-nums; }
.act-chart .val { fill: var(--text); font-weight: 700; }

/* Negotiations (plan F7, contracts/*.html): a chat with a player's agent. The club speaks on
   the right, the agent on the left, the newest at the bottom. He answers at once: a fresh
   answer shows three breathing dots for a moment, then pops in with the next step
   (negotiation.js: .neg-held hides it, .neg-pop shows it); an older one arrives once
   (motion.js). */
.neg-chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.neg-turn { width: min(100%, 36rem); padding: .7rem .85rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.neg-turn.club { align-self: flex-end; background: var(--surface-2); }
.neg-turn.agent { align-self: flex-start; box-shadow: 3px 3px 0 var(--ink); }
.neg-who-says { margin: 0 0 .35rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.neg-line { margin: 0 0 .4rem; font-style: italic; border-left: 3px solid var(--brand); padding-left: .55rem; }
.neg-outcome { margin: .4rem 0 0; font-weight: 700; }
.neg-climb { display: flex; flex-wrap: wrap; gap: .15rem .6rem; margin: .35rem 0 0; padding: .35rem .55rem; border-left: 3px solid var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border-radius: var(--radius-s); overflow-wrap: anywhere; }
.neg-climb s { color: var(--muted); }
.neg-climb small { flex-basis: 100%; color: var(--muted); }
.neg-pk { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .35rem .9rem; margin: .3rem 0; }
.neg-pk dt { font-size: .72rem; color: var(--muted); font-weight: 600; }
.neg-pk dd { margin: 0; overflow-wrap: anywhere; }
.neg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem .9rem; }
.neg-fields input, .neg-fields select, .neg-form > input { width: 100%; }
.neg-hints { margin: .4rem 0 0; padding-left: 1.1rem; }
.neg-hints li { margin: .15rem 0; }
.neg-card { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; color: inherit; }
.neg-card:hover { text-decoration: none; }
.neg-dots { display: inline-flex; gap: .2rem; vertical-align: middle; }
.neg-dots i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--brand); animation: neg-dot 1.2s ease-in-out infinite; }
.neg-dots i:nth-child(2) { animation-delay: .15s; }
.neg-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes neg-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.neg-turn.club { border-bottom-right-radius: 2px; }
.neg-turn.agent { border-bottom-left-radius: 2px; }
.neg-speech { margin: 0 0 .45rem; line-height: 1.45; }
.neg-turn.agent .neg-speech { font-style: italic; border-left: 3px solid var(--brand); padding-left: .55rem; }
.neg-typing { color: var(--muted); }
.neg-held { display: none !important; }
.neg-pop { animation: neg-pop .32s cubic-bezier(.2, .9, .3, 1.2) both; }
.neg-turn.club.neg-pop { transform-origin: bottom right; }
.neg-turn.agent.neg-pop { transform-origin: bottom left; }
@keyframes neg-pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .neg-dots i { animation: none; opacity: .7; } .neg-pop { animation: none; } }

/* [D] Tapping up ("sondeo", sondeos/*.html): the pitch as tappable cards that deal in, the
   agent's answer as a word badge, the club's tag in words, the suitor on a situation. */
.sondeo-pick { border: 0; margin: 0 0 .8rem; padding: 0; display: grid; gap: .45rem; }
.sondeo-pick legend { font-weight: 700; margin-bottom: .35rem; }
.sondeo-option { display: flex; align-items: center; gap: .55rem; padding: .6rem .75rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); cursor: pointer; animation: sondeo-deal .3s ease-out both; animation-delay: calc(var(--n, 0) * 60ms); }
.sondeo-option:has(input:checked) { background: var(--surface-2); box-shadow: 3px 3px 0 var(--brand); }
.sondeo-warn { margin: .2rem 0 .7rem; font-size: .85rem; font-weight: 600; }
.sondeo-club { display: inline-flex; align-items: center; gap: .3rem; }
.sondeo-cta { margin-top: .6rem; }
.badge.sondeo-cold { background: var(--bad); color: #fff; }
.badge.sondeo-listens { background: var(--warn); color: #1a1a1a; }
.badge.sondeo-loves { background: var(--good); color: #0b2a14; }
.chip.reputation.poacher { background: var(--bad); color: #fff; }
.chip.reputation.prowler { background: var(--warn); color: #1a1a1a; }
.sit-suitor { margin: .2rem 0 .5rem; }
.sit-suitor a { display: inline-flex; align-items: center; gap: .35rem; }
@keyframes sondeo-deal { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sondeo-option { animation: none; } }
