body.has-side .player-tabs { display: none; }

/* ======================================================================== side navigation: an icon rail on a computer, a drawer opened from the top bar on a phone */
.t-side { display: none; flex-direction: column; gap: 6px; padding: 16px 12px 12px; background: var(--rail); color: var(--rail-ink); overflow-y: auto; }
.side-toggle { display: none; background: none; border: 0; color: inherit; padding: 8px; margin-right: 4px; cursor: pointer; border-radius: 4px; line-height: 0; }
.side-toggle:hover { background: rgba(255, 255, 255, 0.14); }
.side-backdrop { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #fff; text-decoration: none; padding: 4px 8px 10px; }
.side-portal { display: block; padding: 10px 12px; border-radius: 4px; border: 1px solid #29454E; background: transparent; color: #fff; text-decoration: none; }
.side-portal strong { display: block; font-size: 1rem; }
.side-portal small { color: var(--rail-ink); }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; flex: 1; }
.side-title { margin: 16px 10px 4px; font-size: 0.85rem; color: #7F9AA3; font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 4px; color: var(--rail-ink); text-decoration: none; font-size: 1rem; }
.side-link .ic { color: var(--rail-ink); }
.side-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.side-link.on { background: rgba(255, 255, 255, 0.07); color: #fff; font-weight: 600; box-shadow: inset 4px 0 0 var(--accent); }
.side-link.on .ic { color: var(--accent); }
.side-tournament { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 10px; border-radius: 4px; border: 1px solid #29454E; text-decoration: none; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.side-tournament img { width: 38px; height: 38px; object-fit: contain; border-radius: 4px; background: #fff; padding: 2px; flex-shrink: 0; }
.side-cta { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px; border-radius: 4px; border: 1px solid var(--accent); background: transparent; color: #fff; text-decoration: none; }
.side-cta strong { display: block; font-size: 1rem; }
.side-cta small { color: var(--rail-ink); }
@media (max-width: 999px) {
  body.has-side .side-toggle { display: inline-flex; }
  body.has-side .t-side { display: flex; position: fixed; top: 0; bottom: 0; left: 0; width: min(84vw, 320px); z-index: 3000; transform: translateX(-102%); transition: transform 0.25s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.45); }
  body.has-side.side-open .t-side { transform: none; }
  body.has-side.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 2990; }
}
@media (max-width: 720px) {
  .has-bottom-nav .side-toggle { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); margin: 0; }
}
@media (min-width: 1000px) {
  /* the rail: icons only; the names slide out while the pointer (or the keyboard) is on it */
  body.has-side .t-side { display: flex; position: fixed; top: 0; bottom: 0; left: 0; width: 72px; z-index: 1150; overflow-x: hidden; transition: width 0.18s ease, box-shadow 0.18s ease; }
  body.has-side .t-side:hover, body.has-side .t-side:focus-within { width: 264px; box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3); }
  body.has-side .topbar, body.has-side main.container, body.has-side footer { margin-left: 72px; }
  body.has-side .tn-portal { display: none; }
  body.has-side main.container { max-width: 1240px; margin-right: auto; padding-left: 32px; padding-right: 32px; }
  body.has-side .bottom-nav { display: none; }
  body.has-side .side-brand { display: none; }
  body.has-side .t-side:not(:hover):not(:focus-within) { padding-left: 8px; padding-right: 8px; }
  body.has-side .t-side:not(:hover):not(:focus-within) .side-link { justify-content: center; padding: 12px 0; gap: 0; }
  body.has-side .t-side:not(:hover):not(:focus-within) .side-link span,
  body.has-side .t-side:not(:hover):not(:focus-within) .side-portal,
  body.has-side .t-side:not(:hover):not(:focus-within) .side-tournament span,
  body.has-side .t-side:not(:hover):not(:focus-within) .side-cta span { display: none; }
  body.has-side .t-side:not(:hover):not(:focus-within) .side-title { height: 1px; margin: 8px 14px; padding: 0; font-size: 0; background: #29454E; overflow: hidden; }
  body.has-side .t-side:not(:hover):not(:focus-within) .side-tournament { justify-content: center; padding: 6px; margin: 8px 0 0; }
  body.has-side .t-side:not(:hover):not(:focus-within) .side-cta { justify-content: center; padding: 11px 0; }
}

/* ======================================================================== portal pages: hero, tiles, lists */
.t-hero { display: grid; grid-template-columns: 150px 1fr auto; gap: 24px; align-items: center; padding: 22px; margin-bottom: 18px; }
.t-hero-logo { width: 150px; height: 150px; border-radius: 4px; background: var(--card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--accent); }
.t-hero-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.t-hero-logo .ic { width: 56px; height: 56px; }
.t-hero:not(.has-cover) { background: var(--brand-50); }
.t-hero-main h1 { margin: 6px 0 4px; font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 1.15; }
.t-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.t-hero-date { text-align: center; padding-left: 22px; border-left: 1px solid var(--border); min-width: 150px; }
.t-hero-date small { display: block; font-size: 0.68rem; letter-spacing: 0.12em;  color: var(--muted); }
.t-hero-date strong { font-size: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 4px; border: 1px solid var(--border); font-size: 0.84rem; background: var(--card); }
.chips .ic { width: 16px; height: 16px; color: var(--muted); }
.t-hero .actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;  border: 1px solid var(--border); }
.pill .ic { width: 14px; height: 14px; }
.pill-live, .pill-ok { background: rgba(31, 156, 106, 0.16); color: var(--ok-fg); border-color: rgba(31, 156, 106, 0.5); }
.pill-soon, .pill-wait { background: rgba(240, 162, 2, 0.14); color: var(--warn-fg); border-color: rgba(240, 162, 2, 0.5); }
.pill-done, .pill-dim { background: rgba(138, 148, 163, 0.12); color: var(--muted); }
.pill-bad { background: rgba(214, 69, 69, 0.15); color: var(--bad-fg); border-color: rgba(214, 69, 69, 0.5); }
.pill-link { text-decoration: none; color: var(--text); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { border: 1px solid var(--border); background: var(--card); border-radius: 4px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile small { font-size: 0.68rem; letter-spacing: 0.12em;  color: var(--muted); font-weight: 700; }
.tile strong { font-size: 2rem; line-height: 1.1; }
.tile .unit { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.big-fish-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.fish-tile h3 { margin: 4px 0; }
.fish-tile .record { font-size: 2.4rem; font-weight: 800; line-height: 1.1; color: var(--warn-fg); }
.fish-tile .record span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.fish-tile .record.dim { color: var(--muted); }
.rule-mini { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.82rem; color: var(--muted); display: grid; gap: 2px; }
.top-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.top-list li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.top-list .rk { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.top-list .nm { flex: 1; min-width: 0; }
.year-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.chip { padding: 5px 14px; border-radius: 4px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 0.85rem; }
.chip.on { background: var(--accent); color: #1a1200; border-color: var(--accent); font-weight: 700; }
.comp-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.comp-card { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; padding: 14px 18px; }
.comp-date { text-align: center; border-right: 1px solid var(--border); padding-right: 14px; }
.comp-date strong { display: block; font-size: 1.7rem; line-height: 1; }
.comp-date span { font-size: 0.72rem; color: var(--muted); }
.comp-body h3 { margin: 6px 0 2px; }
.comp-top { display: flex; gap: 8px; }
.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feed-item { display: flex; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); border-left: 4px solid var(--border); }
.feed-item.state-counted { border-left-color: #1f9c6a; }
.feed-item.state-review { border-left-color: var(--accent-ink); }
.feed-item.state-rejected { border-left-color: #d64545; }
.feed-photo { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.feed-main { flex: 1; min-width: 0; }
.feed-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.feed-fish { display: flex; gap: 12px; align-items: baseline; margin-top: 4px; font-size: 1.05rem; }
.feed-pts { color: var(--ok-fg); font-weight: 700; }
.feed-reason { margin: 6px 0 0; font-size: 0.86rem; color: var(--bad-fg); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 12px; }
.gallery-item { padding: 0; overflow: hidden; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-body { padding: 10px 14px 14px; display: grid; gap: 4px; }
.gallery-item.state-rejected { border-color: rgba(214, 69, 69, 0.55); }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.partner { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; color: var(--text); background: #fff; }
.partner img { width: 100%; max-height: 120px; object-fit: contain; }
.partner strong { color: #16304c; }
.table-wrap { overflow-x: auto; }
.series-table th.col-t { min-width: 120px; font-size: 0.78rem; }
.series-table td.cell.dropped { opacity: 0.45; text-decoration: line-through; }
.refresh-note { color: var(--muted); }
@media (max-width: 760px) {
  .t-hero { grid-template-columns: 90px 1fr; gap: 14px; padding: 16px; }
  .t-hero-logo { width: 90px; height: 90px; border-radius: 4px; }
  .t-hero-date { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); padding: 10px 0 0; text-align: left; }
  .comp-actions { grid-column: 1 / -1; }
  .comp-actions .btn { width: 100%; }
  .feed-photo { width: 64px; height: 64px; }
}

/* the bell */
.topbar nav .bell { position: relative; display: inline-flex; align-items: center; }
.bell-count { position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 0.68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.bell-count[hidden] { display: none; }
.notes { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.note a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); text-decoration: none; color: var(--text); }
.note.unread a { border-color: var(--accent); }
.note-ic { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.note-ic.state-ok { background: rgba(31, 156, 106, 0.18); color: var(--ok-fg); }
.note-ic.state-wait { background: rgba(240, 162, 2, 0.16); color: var(--warn-fg); }
.note-ic.state-bad { background: rgba(214, 69, 69, 0.18); color: var(--bad-fg); }
.note-body { display: grid; gap: 2px; }
.note-reason { font-size: 0.85rem; color: var(--bad-fg); }
/* names in lists are plain text with a subtle link */
.top-list a, .feed-team a, .series-table a, .comp-body h3 a, .t-hero a:not(.btn):not(.pill-link) { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.series-table th a { border-bottom: 0; color: var(--muted); }
.series-table th, .series-table td { white-space: nowrap; }
.series-table td:nth-child(2) { white-space: normal; min-width: 150px; }
.series-table th:first-child, .series-table td:first-child { width: 44px; min-width: 44px; }

/* ---- the refresh button in the top bar, the floating light/dark switch, the snapshot badge */
.refresh-btn { margin-left: 6px; width: 40px; height: 40px; border-radius: 4px; border: 0; background: rgba(255,255,255,0.12); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.refresh-btn:hover { background: rgba(255,255,255,0.22); }
.refresh-btn.spin svg { animation: fc-spin 0.8s linear infinite; }
@keyframes fc-spin { to { transform: rotate(360deg); } }
.theme-fab { position: fixed; right: 16px; bottom: calc(16px + var(--sab)); z-index: 1050; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: 4px; border: 1px solid var(--border); background: var(--card); color: var(--text); box-shadow: var(--shadow);
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.theme-fab:hover { border-color: var(--brand-600); }
.theme-fab .i-moon { display: none; }
.theme-fab.to-dark .i-sun { display: none; }
.theme-fab.to-dark .i-moon { display: inline; }
.snap-badge { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 10px; border-radius: 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; 
  background: var(--brand-100); color: var(--brand-800); }
.snap-badge.live { background: var(--ok-bg, #1d3a24); color: var(--green); }
.snap-note { margin: 8px 0 12px; font-size: 0.85rem; }
.fc-toast { position: fixed; left: 50%; bottom: calc(76px + var(--sab)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 1200;
  padding: var(--s3) var(--s4); border-radius: 4px; background: var(--text); color: var(--bg); font-size: 0.85rem; font-weight: 600; transition: opacity .2s, transform .2s; }
.fc-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) {
  .has-bottom-nav .topbar { position: sticky; }
  .has-bottom-nav .refresh-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); margin: 0; }
  .theme-fab { bottom: calc(var(--nav-h) + 16px + var(--sab)); right: 12px; min-height: 40px; padding: 6px 12px; }
  .theme-fab .lbl { display: none; }
  .fc-toast { bottom: calc(var(--nav-h) + 72px + var(--sab)); }
}

/* ---- photo first: the biggest fish is the face of a tournament */
.t-hero.has-cover { position: relative; min-height: 320px; align-items: end; border: 0; color: #fff; overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 24, 15, 0.12) 0%, rgba(8, 24, 15, 0.82) 100%), var(--cover) center / cover no-repeat; }
.t-hero.has-cover h1, .t-hero.has-cover .t-hero-date strong { color: #fff; }
.t-hero.has-cover .muted, .t-hero.has-cover .t-hero-date small { color: rgba(255, 255, 255, 0.82); }
.t-hero.has-cover .chips li { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
.t-hero.has-cover .chips .ic { color: #fff; }
.t-hero.has-cover .t-hero-date { border-left-color: rgba(255, 255, 255, 0.3); }
.t-hero.has-cover .btn.secondary { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.t-hero.has-cover .pill { background: rgba(0, 0, 0, 0.35); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.t-hero-cap { position: absolute; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 4px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 0.8rem; font-weight: 600; }
.t-hero-cap .ic { width: 16px; height: 16px; }
.top-list li { gap: 12px; }
.tl-photo { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--brand-100); }
.tl-meta { display: block; font-size: 0.78rem; color: var(--muted); }
.comp-card { grid-template-columns: 168px 1fr auto; gap: 18px; padding: 0; overflow: hidden; align-items: stretch; }
.comp-cover { position: relative; min-height: 118px; background: var(--brand-100); display: flex; align-items: center; justify-content: center; color: var(--brand-700); }
.comp-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.comp-cover img.logo { object-fit: contain; background: #fff; padding: 10px; }
.comp-cover .ic { width: 40px; height: 40px; }
.comp-date { position: absolute; left: 8px; bottom: 8px; border: 0; padding: 4px 10px; border-radius: 4px; background: rgba(0, 0, 0, 0.62); color: #fff; text-align: left; display: flex; align-items: baseline; gap: 6px; }
.comp-date strong { font-size: 1.15rem; display: inline; }
.comp-date span { color: rgba(255, 255, 255, 0.85); font-size: 0.74rem; }
.comp-body { padding: 14px 0; }
.comp-actions { padding: 14px 18px 14px 0; display: flex; align-items: center; }
@media (max-width: 760px) {
  .t-hero.has-cover { min-height: 300px; grid-template-columns: 1fr; padding-top: 64px; }
  .t-hero.has-cover .t-hero-logo, .t-hero.has-cover .t-hero-date { display: none; }
  .comp-card { grid-template-columns: 1fr; gap: 0; }
  .comp-cover { min-height: 150px; }
  .comp-body { padding: 12px 16px 4px; }
  .comp-actions { padding: 8px 16px 16px; }
  .tl-photo { width: 48px; height: 36px; }
}

/* ---- the guide */
.man-hero { margin-bottom: 18px; }
.man-toc { margin-top: 14px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); }
.man-toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2; column-gap: 28px; }
.man-toc li { margin: 3px 0; break-inside: avoid; }
.man-sec { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; margin: 14px 0; scroll-margin-top: 70px; }
.man-sec h2 { margin-top: 0; display: flex; align-items: center; gap: 12px; }
.man-n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 4px; background: var(--brand-800); color: var(--card); font-family: var(--font-sans, inherit); font-size: 0.95rem; flex-shrink: 0; }
.man-steps, .man-list { padding-left: 22px; margin: 0; display: grid; gap: 8px; }
.man-faq dt { font-weight: 600; margin-top: 12px; color: var(--brand-800); }
.man-faq dd { margin: 2px 0 0; }
.man-tip { margin-top: 16px; padding: 14px 16px; border-radius: 4px; background: var(--brand-50); border: 1px solid var(--border); }
.man-tip ul { margin: 6px 0 0; padding-left: 20px; }
.man-shots { display: flex; gap: 14px; align-items: flex-start; }
.man-shots img { width: 190px; max-width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--border); box-shadow: var(--shadow); }
@media (max-width: 760px) {
  .man-sec { grid-template-columns: 1fr; }
  .man-shots { justify-content: center; flex-wrap: wrap; }
  .man-toc ol { columns: 1; }
}

.man-sec .man-body > h2 { margin: 0 0 14px; }


/* ---- tournament page (Mata): a title, a ruler of the rounds, the results as tapes, a log, a plate of numbers */
.th-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 6px 0 16px; }
.th-status { margin: 0 0 6px; color: var(--muted); }
.th-status b { color: var(--text); font-weight: 600; }
.th-head h1 { font: 700 clamp(3rem, 7vw, 5.2rem)/0.95 var(--font-display); margin: 0; }
.th-clock { text-align: right; }
.th-clock .lbl { color: var(--muted); }
.th-clock .t { font: 700 clamp(2.8rem, 5vw, 4rem)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.th-clock.waiting .t { color: var(--brand-700); }
.th-clock.done .t { color: var(--muted); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; }
.th-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.th-actions .btn { display: inline-flex; align-items: center; gap: 8px; }

.rl { display: flex; gap: 10px; margin: 4px 0 18px; }
.rl-seg { flex: var(--d) 1 0; min-width: 0; }
.rl-name { font-size: 0.9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-band { position: relative; height: 28px; margin-top: 2px; background-color: var(--accent);
  background-image: repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px calc(100% * 15 / var(--d))), repeating-linear-gradient(90deg, var(--tick) 0 2px, transparent 2px calc(100% * 60 / var(--d)));
  background-size: 100% 38%, 100% 72%; background-position: left bottom, left bottom; background-repeat: no-repeat; }
.rl-seg.past .rl-band { background-color: var(--border); }
.rl-lab { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 3px; }
.rl-now { position: absolute; top: -8px; bottom: -8px; width: 3px; margin-left: -1px; background: var(--red); font-style: normal; }
.rl-now.edge { left: -6px; }

.th-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); border-top: 1px solid var(--border); margin-top: 22px; }
.th-main { padding: 26px 32px 8px 0; border-right: 1px solid var(--border); }
.th-side { padding: 26px 0 8px 32px; }
.th-grid h2 { margin: 0 0 14px; }
.th-bars { list-style: none; margin: 0; padding: 0; }
.th-bars li { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--border); }
.th-bars li:first-child { border-top: 0; padding-top: 0; }
.th-bars .rk { font-size: 2.1rem; line-height: 1; padding-top: 2px; }
.th-bars .nm { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.th-bars .tp-name { font-weight: 600; font-size: 1.2rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.th-bars .tp-name a { color: inherit; text-decoration: none; border: 0; }
.th-bars .tp-name a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.th-bars .pts { font-size: 2.1rem; line-height: 1; }
.bar { position: relative; height: 10px; margin-top: 8px; background: var(--border); border-radius: 2px; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--brand-700); border-radius: 2px; }
.th-bars li.lead .bar > i { background: var(--accent); }
.th-bars .tl-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 0.95rem; }
.th-bars .proof { width: 76px; }
.th-bars .tl-photo { display: block; width: 76px; height: 76px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: var(--brand-100); }
.th-bars .proof span { display: block; margin-top: 3px; font-size: 1rem; line-height: 1.1; }
.th-more { margin: 18px 0 0; }
.th-log { margin-top: 34px; }
.jn { list-style: none; margin: 0; padding: 0; }
.jn li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); align-items: baseline; }
.jn time { font: 600 1.15rem var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted); }
.jn .jn-what strong { font-weight: 600; margin-right: 8px; }
.jn .jn-reason { display: block; font-size: 0.95rem; color: var(--bad-fg); font-weight: 600; }
.jn .jn-pts { font: 700 1.5rem var(--font-display); font-variant-numeric: tabular-nums; color: var(--ok-fg); }
.jn li.state-rejected .jn-pts { color: var(--bad-fg); }
.jn li.state-review .jn-pts { color: var(--warn-fg); }
.plate { display: grid; grid-template-columns: 1fr auto; border-top: 3px solid var(--text); }
.plate span { padding: 8px 0; border-bottom: 1px solid var(--border); }
.plate b { padding: 2px 0; border-bottom: 1px solid var(--border); font-size: 1.9rem; line-height: 1.2; text-align: right; }
.th-cover { margin: 28px 0 0; padding: 0; border: 0; background: transparent; gap: 0; }
.th-cover img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px 4px 0 0; }
.th-cover .mat { height: 26px; background-color: var(--accent); border-radius: 0 0 4px 4px;
  background-image: repeating-linear-gradient(90deg, var(--on-accent) 0 1px, transparent 1px 10px), repeating-linear-gradient(90deg, var(--on-accent) 0 2px, transparent 2px 50px);
  background-size: 100% 42%, 100% 72%; background-position: left bottom; background-repeat: no-repeat; }
.th-cover figcaption { padding: 10px 0 0; }
.th-cover figcaption small { display: block; color: var(--muted); font-size: 0.95rem; }
.th-cover figcaption strong { display: block; font-size: 1.8rem; line-height: 1.05; }
.sched { margin-top: 30px; }
.sched > div:not(:first-child) { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.sched .nowrow { font-weight: 600; box-shadow: inset 4px 0 0 var(--red); padding-left: 10px; margin-left: -14px; padding-right: 0; }
.sp-list { border-top: 3px solid var(--text); margin-bottom: 20px; }
.sp-row { display: grid; grid-template-columns: 200px 1.1fr 1.4fr; gap: 8px 24px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.sp-name h3 { margin: 0; font: 600 1.5rem/1.1 var(--font-display); }
.sp-name span { font-size: 0.95rem; }
.sp-rec .num { font-size: 2.2rem; line-height: 1; }
.sp-rule { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 999px) {
  .th-grid { grid-template-columns: 1fr; }
  .th-main { border-right: 0; padding-right: 0; }
  .th-side { padding-left: 0; border-top: 1px solid var(--border); }
  .th-clock { text-align: left; }
  .sp-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .th-bars li { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px 12px; }
  .th-bars .proof, .th-bars .tl-photo { width: 56px; } .th-bars .tl-photo { height: 56px; }
  .jn li { grid-template-columns: 1fr auto; } .jn time { grid-column: 1 / -1; }
}

.th-bars .pts { white-space: nowrap; flex: none; }
.th-bars .tp-name { overflow: hidden; }

/* the first three places carry a medal colour (gold, silver, bronze); the rest is a plain numeral */
.th-bars .rk { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 4px; font-size: 1.8rem; padding: 0; }
.th-bars li:nth-child(1) .rk { background: var(--medal-gold); color: #0E2A33; }
.th-bars li:nth-child(2) .rk { background: var(--medal-silver); color: #0E2A33; }
.th-bars li:nth-child(3) .rk { background: var(--medal-bronze); color: #0E2A33; }
.th-bars li:nth-child(-n+3) .tp-name { font-size: 1.35rem; }
.th-bars li { grid-template-columns: 46px minmax(0, 1fr) auto; }

/* ---- the heading of a series or a season: plain text under a heavy rule (the icon box only when there is a real logo) */
.t-hero:not(.has-cover) { display: block; background: transparent; border: 0; border-bottom: 3px solid var(--text); border-radius: 0; padding: 4px 0 20px; margin-bottom: 24px; }
.t-hero:not(.has-cover) .t-hero-logo:not(:has(img)) { display: none; }
.t-hero:not(.has-cover) .t-hero-logo { float: left; width: 80px; height: 80px; margin: 0 18px 0 0; border-radius: 4px; }
.t-hero:not(.has-cover) .t-hero-main h1 { font: 700 clamp(2.6rem, 6vw, 4.4rem)/0.98 var(--font-display); margin: 4px 0 8px; }
.t-hero:not(.has-cover) .t-hero-date { display: none; }
.t-hero:not(.has-cover) .chips { margin: 8px 0 14px; }
.t-hero:not(.has-cover) .chips li { border-radius: 3px; background: transparent; }

/* ---- the review of catches (a judge): on a computer the photo stays beside the form while you work, on a phone the decision buttons stay under the thumb */
.rv-keys { margin: 4px 0 12px; }
.rv-list { border-top: 3px solid var(--text); }
.rv { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); gap: 28px; padding: 24px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 76px; outline: none; }
.rv.current { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: -14px 0 0 color-mix(in srgb, var(--accent) 14%, transparent), -18px 0 0 var(--accent); }
.rv-photo { position: sticky; top: 76px; align-self: start; }
.rv-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: #000; }
.rv-body h3 { font: 700 2.1rem/1.05 var(--font-display); margin: 0 0 8px; }
.rv-body h3 .badge { vertical-align: middle; margin-left: 8px; }
.rv-notes { margin: 10px 0 14px; }
.rv-notes p { margin: 6px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--border); font-size: 1rem; }
.rv-notes p.scope-bad { border-left-color: var(--red); color: var(--bad-fg); }
.rv-notes .overlay-thumb { display: block; max-width: 100%; width: 360px; border-radius: 4px; margin: 8px 0; }
.rv .review-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rv .round-pick { display: block; margin-top: 12px; max-width: 420px; }
.rv-actions { display: flex; gap: 10px; margin-top: 14px; }
.rv-actions .btn { flex: 0 1 220px; min-height: 52px; font-size: 1.1rem; }
.rv .medal-form { margin-top: 14px; }
@media (hover: none), (pointer: coarse), (max-width: 700px) { .rv-keys { display: none; } }   /* keyboard keys mean nothing on a phone */
@media (max-width: 999px) {
  .rv { grid-template-columns: 1fr; gap: 14px; padding: 18px 0; }
  .rv-photo { position: static; }
  .rv-body h3 { font-size: 1.8rem; }
}
@media (max-width: 560px) {
  .rv .review-fields { grid-template-columns: 1fr; }
  .rv-actions { position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 20; padding: 10px 0; background: var(--bg); box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, 0.25); }
  .rv-actions .btn { flex: 1 1 0; min-height: 60px; font-size: 1.2rem; }
}

/* ---- teams and codes: a wide table on a computer (search, copy a code, print the codes), cards on a phone */
main.container[data-wide] { max-width: 1240px; }
.tm-tools { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; }
.tm-tools input[type="search"] { flex: 1 1 320px; max-width: 480px; margin: 0; }
.tm-hint { margin: 0 0 10px; font-size: 0.95rem; }
.teams-table { width: 100%; border-collapse: collapse; background: transparent; border: 0; border-top: 3px solid var(--text); }
.teams-table th { text-align: left; font-weight: 600; color: var(--muted); background: transparent; border-bottom: 1px solid var(--border); padding: 8px 10px; white-space: nowrap; }
.teams-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.teams-table td:first-child a { font: 600 1.35rem/1.1 var(--font-display); color: inherit; text-decoration: none; }
.teams-table td:first-child a:hover { text-decoration: underline; }
.teams-table .num-cell { font: 700 1.7rem/1 var(--font-display); text-align: right; white-space: nowrap; }
.teams-table .fish-cell { font-weight: 600; color: var(--muted); }
.teams-table .mail-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.teams-table code { font: 600 1rem ui-monospace, Consolas, "Courier New", monospace; background: var(--brand-100); color: var(--text); padding: 2px 8px; border-radius: 3px; cursor: copy; letter-spacing: 0.04em; }
.teams-table code:hover { background: var(--accent); }
.teams-table .btn { min-height: 0; padding: 6px 12px; font-size: 0.95rem; margin: 2px 4px 2px 0; }
.teams-table details.rule-edit summary { list-style: none; display: inline-block; cursor: pointer; }
@media (max-width: 899px) {
  .tm-tools { flex-wrap: wrap; }
  .teams-table { border-top: 0; }
  .teams-table .num-cell { text-align: left; font-size: 1.5rem; }
  .teams-table code { font-size: 1.1rem; padding: 4px 10px; }
  .teams-table .btn { min-height: 44px; font-size: 1rem; }
  .teams-table .mail-cell { max-width: none; white-space: normal; }
}
@media print {
  body.print-codes .topbar, body.print-codes .t-side, body.print-codes footer, body.print-codes .bottom-nav, body.print-codes .admin-tabs, body.print-codes .theme-fab, body.print-codes .fc-toast,
  body.print-codes .rule-form, body.print-codes .tm-tools, body.print-codes .tm-hint, body.print-codes main > p, body.print-codes h2, body.print-codes .teams-table ~ *, body.print-codes #fc-queue { display: none !important; }
  body.print-codes .teams-table th:nth-child(n+3), body.print-codes .teams-table td:nth-child(n+3) { display: none; }
  body.print-codes .teams-table td { border-bottom: 1px solid #999; padding: 10px 6px; }
  body.print-codes .teams-table tr { break-inside: avoid; }
  body.print-codes main.container { max-width: none; margin: 0; padding: 0; }
  body.print-codes { background: #fff; color: #000; }
}

.tm-tools input[type="search"] { min-height: 46px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--input-bg); color: var(--text); font: inherit; }
.tm-tools .btn { min-height: 46px; }

@media (max-width: 899px) { .teams-table .cell { text-align: left; } .teams-table .cell > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 3px 0; } }

/* ---- results and awards: a long page of settings. A computer gets a section list that follows the page; a phone gets a jump menu */
.rp-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 14px; }
.rp-nav { position: sticky; top: 76px; }
.rp-nav ul { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--text); }
.rp-nav li { border-bottom: 1px solid var(--border); }
.rp-nav a { display: block; padding: 11px 6px; color: var(--text); text-decoration: none; font-weight: 600; }
.rp-nav a:hover { background: var(--brand-100); }
.rp-off { display: none !important; }
.rp-tabbed .rp-main > h2:not(.rp-off), .rp-tabbed .rp-main section.doc:not(.rp-off) { margin-top: 0; }
.rp-tabbed .rp-main .doc + .doc { border-top: 0; padding-top: 0; }   /* one section at a time: no divider above it */
.rp-nav a.on { background: var(--brand-100); box-shadow: inset 4px 0 0 var(--accent); padding-left: 12px; }
.rp-jump { display: none; width: 100%; min-height: 48px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--text); border-radius: 4px; background: var(--card); color: var(--text); font: 600 1rem inherit; }
.rp-main { min-width: 0; max-width: 900px; }
.rp-main > .card, .rp-main > h2 { scroll-margin-top: 76px; }
.rp-main h2 { margin-top: 36px; }
.rp-main > .card:first-of-type h2 { margin-top: 0; }
@media (max-width: 999px) {
  .rp-layout { grid-template-columns: 1fr; gap: 0; }
  .rp-nav { display: none; }
  .rp-jump { display: block; position: sticky; top: 8px; z-index: 30; }
}

.card > h2:first-child, .card h2:first-child { margin-top: 0; }

.rp-main section[id], .rp-main details[id] { scroll-margin-top: 76px; }

/* ======================================================================== a computer is not a big phone
   With a mouse (hover + a fine pointer) the controls are denser, the content uses the width of the screen,
   forms run in columns and the tournaments are a grid of posters. A phone keeps the big touch targets and single columns. */
@media (hover: hover) and (pointer: fine) {
  :root { --tap: 38px; }
  body { font-size: 1rem; }
  form input, form select, form textarea { padding: 8px 12px; margin-top: 4px; font-size: 1rem; }
  .btn { padding: var(--s2) var(--s4); font-size: 1rem; }
  .btn-xl { min-height: 46px; }
  .card { padding: 16px 20px; }
  .data-table td, .data-table th { padding: 8px 10px; }
  .topbar nav a { min-height: 36px; padding: 6px 14px; font-size: 0.95rem; }
  .acc-side .acc-menu a, .acc-side .acc-menu button { padding: 10px 4px; }
}
@media (min-width: 1100px) {
  main.container { max-width: 1280px; }
  body.has-side main.container { max-width: 1240px; }
}
@media (min-width: 1500px) {
  main.container, main.container[data-wide] { max-width: 1440px; }
  body.has-side main.container { max-width: 1440px; }
}
@media (min-width: 1800px) {
  main.container, main.container[data-wide], body.has-side main.container { max-width: 1640px; }
}
/* forms in columns */
@media (min-width: 900px) {
  .rule-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 12px 20px; align-items: end; }
  .rule-form > p, .rule-form > button, .rule-form > .btn, .rule-form > .span-2, .rule-form > .rules-box, .rule-form > small, .rule-form > h2, .rule-form > h3,
  .rule-form > label:has(textarea), .rule-form > label.check { grid-column: 1 / -1; }
  .rule-form > button, .rule-form > .btn { justify-self: start; }
  .rule-form > label { margin: 0; }
  .rp-main { max-width: 1100px; }
  .rv .review-fields { grid-template-columns: 1fr 1fr 1fr; }
}
/* the tournaments as posters (a computer); a phone keeps one row per tournament */
@media (min-width: 1000px) {
  .comp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; border-top: 0; }
  .comp-card { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--card); overflow: hidden; }
  .comp-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .comp-body { padding: 14px 18px 4px; }
  .comp-body h3 { font: 600 1.5rem/1.1 var(--font-display); }
  .comp-actions { padding: 8px 18px 18px; }
  .comp-actions .btn { width: 100%; }
}

/* ---- the organiser's list of tournaments: the list first, the form for a new one beside it on a computer (below it on a phone) */
.at-layout { display: grid; gap: 32px; margin-top: 6px; }
.at-list h2, .at-new h2 { margin-top: 0; }
.at-rows { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--text); }
.at-row { display: grid; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.at-row h3 { margin: 0 0 4px; font: 700 1.9rem/1.05 var(--font-display); }
.at-row h3 .badge { vertical-align: middle; margin-left: 8px; }
.at-row p { margin: 2px 0; }
.at-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.at-new { min-width: 0; }
.at-new .rule-form { border: 1px solid var(--border); border-radius: 4px; background: var(--card); padding: 18px 20px; }
@media (min-width: 1200px) {
  .at-layout { grid-template-columns: minmax(0, 1fr) 560px; gap: 48px; }
}

.comp-card.card { padding: 0; }
.group-h { text-transform: none; letter-spacing: 0; font: 600 1.6rem var(--font-display); color: var(--text); }

/* Super-admin contact messages: Mark as spam / Delete per row, the Spam list folded below */
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin: 0; }
.msg-actions .btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; white-space: nowrap; }
.spam-box { margin: var(--s4, 16px) 0 0; }
.spam-box > summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 8px 0; }
.spam-box[open] > summary { color: var(--text); }
.cv-scope { margin: 8px 0 0; font-weight: 600; }
