/* tournaments area: styles for this area's pages only (loaded on every page, so every rule is scoped by an area class or a page-specific selector). */

/* ---- /tournaments and /tournaments/{id} ---- */
.area-tournaments .tn-intro { max-width: 72ch; margin: 0 0 0.5rem; }
.area-tournaments .tn-intro p { margin: 0 0 0.6rem; }
.area-tournaments .tn-section .section-head { margin: 2rem 0 0.6rem; }
.area-tournaments .tn-count { display: inline-block; min-width: 1.6rem; padding: 0 0.45rem; margin-left: 0.4rem; font: 600 0.8125rem/1.6 var(--font-mono); text-align: center; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 999px; vertical-align: 0.2em; }
.area-tournaments .tn-wrap { margin: 0; }
.area-tournaments .tn-name { font-weight: 650; color: var(--ink); }
.area-tournaments .tn-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem; margin-top: 0.3rem; }
.area-tournaments .tn-band { font-size: 0.8125rem; color: var(--ink-2); }
.area-tournaments .tag.err { white-space: normal; }
.area-tournaments .tn-count-down { font-family: var(--font-mono); font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.area-tournaments .tn-empty { text-align: left; padding: 1.1rem 1.25rem !important; }
.area-tournaments .tn-empty strong { display: inline; margin: 0 0.35rem 0 0; }
.area-tournaments .tn-table td.tn-title { min-width: 13rem; }
.area-tournaments .tn-table td.tn-go { text-align: right; }

/* status panel */
.area-tournaments .tn-status-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; }
.area-tournaments .tn-prize strong, .area-tournaments .tn-start-in strong { font-family: var(--font-head); }
.area-tournaments .tn-timeline { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; max-width: none; position: relative; }
.area-tournaments .tn-timeline li { position: relative; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 0.75rem 0 0; margin: 0; border-top: 2px solid var(--rule); max-width: none; font-size: 0.9375rem; }
.area-tournaments .tn-timeline li.done { border-top-color: var(--teal); }
.area-tournaments .tn-dot { position: absolute; top: -0.45rem; left: 0; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--sheet); border: 2px solid var(--rule-strong); }
.area-tournaments .tn-timeline li.done .tn-dot { background: var(--teal); border-color: var(--teal); }
.area-tournaments .tn-when { font-weight: 650; }
.area-tournaments .tn-timeline time { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-2); }
.area-tournaments .tn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; margin: 1.25rem 0 0.5rem; }
.area-tournaments .tn-stat { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.8rem 0.9rem; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-control); }
.area-tournaments .tn-stat strong { font-family: var(--font-head); font-size: 1.0625rem; }
.area-tournaments .tn-stat .muted { font-size: 0.8125rem; }
.area-tournaments progress.tn-bar { appearance: none; width: 100%; height: 0.45rem; border: 0; border-radius: 999px; background: var(--rule); overflow: hidden; }
.area-tournaments progress.tn-bar::-webkit-progress-bar { background: var(--rule); }
.area-tournaments progress.tn-bar::-webkit-progress-value { background: var(--teal); }
.area-tournaments progress.tn-bar::-moz-progress-bar { background: var(--teal); }

/* your bots */
.area-tournaments .tn-bots { margin-top: 2rem; }
.area-tournaments .tn-botlist { list-style: none; margin: 0.5rem 0 1rem; padding: 0; display: grid; gap: 0.6rem; max-width: none; }
.area-tournaments .tn-bot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.25rem; margin: 0; padding: 0.85rem 1rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); max-width: none; }
.area-tournaments .tn-bot-main { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; min-width: 0; }
.area-tournaments .tn-bot-name { font-weight: 700; overflow-wrap: anywhere; }
.area-tournaments .tn-bot-act form { margin: 0; }

/* how it works */
.area-tournaments .tn-how { margin-top: 2rem; }
.area-tournaments .tn-api h3 { margin-top: 0; }
.area-tournaments .tn-code { position: relative; }
.area-tournaments .tn-code pre { margin: 0.5rem 0; padding-right: 5rem; overflow-x: auto; }
.area-tournaments .tn-code button { position: absolute; top: 0.6rem; right: 0.6rem; }
.area-tournaments .tn-rules { display: grid; gap: 0.7rem; padding-left: 1.2rem; max-width: 80ch; margin: 1rem 0; }
.area-tournaments .tn-rules li { margin: 0; }
.area-tournaments tr.winner td { font-weight: 700; }
.area-tournaments .tn-details summary { cursor: pointer; padding: 0.6rem 0; font-weight: 600; min-height: 2.75rem; }

/* phones: each row is a card, the cells name themselves */
@media (max-width: 760px) {
  .area-tournaments .tn-wrap { overflow: visible; background: none; border: 0; }
  .area-tournaments .tn-table, .area-tournaments .tn-table tbody, .area-tournaments .tn-table tr, .area-tournaments .tn-table td { display: block; width: 100%; }
  .area-tournaments .tn-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .area-tournaments .tn-table tr { margin: 0 0 0.75rem; padding: 0.4rem 0.9rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); }
  .area-tournaments .tn-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); text-align: right; white-space: normal; }
  .area-tournaments .tn-table td:last-child { border-bottom: 0; }
  .area-tournaments .tn-table td::before { content: attr(data-label); flex: none; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; text-align: left; }
  .area-tournaments .tn-table td.tn-title { display: block; min-width: 0; text-align: left; padding-top: 0.6rem; }
  .area-tournaments .tn-table td.tn-title::before { content: none; }
  .area-tournaments .tn-table td.tn-title .tn-name { font-size: 1.0625rem; }
  .area-tournaments .tn-table td.tn-go { display: block; text-align: left; }
  .area-tournaments .tn-table td.tn-go::before { content: none; }
  .area-tournaments .tn-code pre { padding-right: 0; }
  .area-tournaments .tn-code button { position: static; }
  .area-tournaments .tn-bot { flex-direction: column; align-items: stretch; }
}
/* Above 720px the registrants are still a table, scrolled in its .table-wrap; at 720px and under they are cards (style.css). */
@media (min-width: 45.0625rem) and (max-width: 760px) {
  .area-tournaments .tn-reg { min-width: 38rem; }
}
@media (prefers-reduced-motion: reduce) {
  .area-tournaments * { transition: none !important; animation: none !important; }
}

/* ---- /games gallery extras and /games/{type} ---- */
.gallery-chips { display: inline-flex; gap: 0.3rem; flex: none; }
.area-game .gm-jump { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0 0 1rem; padding: 0.5rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.area-game .gm-jump a { padding: 0.3rem 0.65rem; border-radius: var(--r-control); color: var(--ink-2); font-weight: 600; font-size: 0.9375rem; text-decoration: none; }
.area-game .gm-jump a:hover { background: var(--hover); color: var(--ink); }
.area-game .gm-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 1.5rem; align-items: start; }
.area-game .gm-main, .area-game .gm-side { min-width: 0; }
.area-game .panel { scroll-margin-top: 1rem; }
.area-game .panel h2 { font-size: 1.25rem; }
.area-game details { margin: 0.5rem 0; }
.area-game details summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; }
.area-game pre { max-height: 22rem; overflow: auto; }
.area-game .actions .btn { min-height: 2.5rem; }
@media (max-width: 900px) { .area-game .gm-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- /practice ---- */
.area-practice .pr-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; margin: 1rem 0 0; padding: 0; max-width: none; }
.area-practice .pr-facts li { margin: 0; padding: 0.2rem 0.7rem; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 999px; max-width: none; }

/* ---- /fairness ---- */
.area-fairness .fr-jump, .area-docs .fr-jump { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 1.25rem 0 0; }
.area-fairness .fr-jump a, .area-docs .fr-jump a { padding: 0.3rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; text-decoration: none; }
.area-fairness .fr-jump a:hover, .area-docs .fr-jump a:hover { color: var(--ink); border-color: var(--rule-strong); background: var(--hover); }
.area-fairness h2 { margin-top: 2.5rem; scroll-margin-top: 1rem; }
.area-fairness .fr-chain { margin: 1.25rem 0; padding: 1rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sheet); }
.area-fairness .fr-svg { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; }
.area-fairness .fr-svg text { fill: var(--ink-2); font: 500 12.5px var(--font-mono); }
.area-fairness .fr-svg .fr-h { fill: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.area-fairness .fr-svg .fr-link { fill: var(--teal); }
.area-fairness .fr-svg .fr-note { fill: var(--ink-2); font-family: var(--font); font-size: 13px; }
.area-fairness .fr-svg .fr-card rect { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.5; }
.area-fairness .fr-svg .fr-arrow { stroke: var(--teal); stroke-width: 2; fill: none; }
.area-fairness .fr-svg .fr-head { fill: var(--teal); }
.area-fairness .fr-chain figcaption { margin-top: 0.6rem; font-size: 0.875rem; color: var(--ink-2); }
.area-fairness .fr-exit { max-width: 52rem; }
.area-fairness .fr-off .tag { margin-right: 0.4rem; }
.area-fairness .fair-cols .panel { margin: 0.75rem 0; }
@media (max-width: 760px) { .area-fairness .fair-cols { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---- /docs, /starter, /terms, error pages ---- */
.area-docs .dc-moves { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.4rem 1rem; padding: 0; max-width: none; }
.area-docs .dc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.area-docs .dc-moves li { margin: 0; padding: 0.5rem 0.8rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-control); max-width: none; display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.area-docs h2 { scroll-margin-top: 1rem; margin-top: 2.25rem; }
.area-docs pre { overflow-x: auto; }
.area-starter .st-note { max-width: 72ch; }
.area-starter table.starter td.summary { min-width: 14rem; }
.area-terms h2 { margin-top: 2rem; }
.area-error .page-head { margin-top: 3rem; }
.area-error .code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-2); }
/* games and game pages (verifier): recent games get the full width; phone tiles are a board beside the text */
.area-game .cols { grid-template-columns: minmax(0, 1fr); }
.area-games .gallery-counts a { gap: 0.25em; }      /* a touch screen's flex link (style.css) drops the space between "0" and "live" */
/* A phone (one tile a row from 600px, style.css): the board takes two fifths of the row and the name, pitch, counts and
   top bot the rest beside it, then Practice and Rules share the full width under both. A tile is its own grid here, not
   six rows of the gallery's (the subgrid lines up tiles side by side), so nothing is left in a narrow first column. */
@media (max-width: 600px) {
  .area-games .gallery-grid { gap: 1.5rem; }
  .area-games .gallery-tile { grid-row: auto; grid-template-rows: none; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0.3rem 0.85rem; align-items: start; }
  .area-games .gallery-tile > :first-child { grid-column: 1; grid-row: 1 / span 4; margin: 0; }
  .area-games .gallery-name, .area-games .gallery-tile .pitch, .area-games .gallery-counts, .area-games .gallery-top { grid-column: 2; grid-row: auto; }
  .area-games .gallery-name { align-self: start; }
  .area-games .gallery-tile .pitch { font-size: 0.875rem; line-height: 1.4; }
  .area-games .gallery-counts { gap: 0 0.9rem; }
  .area-games .gallery-actions { grid-column: 1 / -1; grid-row: auto; margin: 0.3rem 0 0; padding-top: 0; }
  .area-games .gallery-actions .btn { flex: 1 1 0; }
  .area-games .gallery-board > .wall-board { width: 100%; }   /* a size-contained board inside a flex link collapses to its padding */
}
/* /games/{type} on a phone: the three actions share the row, a table in a panel runs to the panel's edges, and Top 10
   and Recent games show each row as lines of labelled figures (the cells' data-label, _macros.html) instead of a
   table to scroll sideways: rank, bot and rating (the set and its start) first, then the rest as they fit. */
@media (max-width: 600px) {
  .area-game .page-head .actions { gap: 0.5rem; }
  .area-game .page-head .actions .btn { flex: 1 1 6rem; padding-inline: 0.5rem; }
  .area-game .panel .table-wrap { margin-inline: -0.85rem; border-inline: 0; border-radius: 0; }
  .area-game .table-wrap:has(> table.leaders, > table.sets) { overflow: visible; }
  .area-game :is(table.leaders, table.sets) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .area-game :is(table.leaders, table.sets), .area-game :is(table.leaders, table.sets) tbody { display: block; }
  .area-game :is(table.leaders, table.sets) tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.9rem; padding: 0.35rem 0.85rem 0.5rem; border-bottom: 1px solid var(--rule); }
  .area-game :is(table.leaders, table.sets) tbody tr:last-child { border-bottom: 0; }
  .area-game :is(table.leaders, table.sets) tbody tr:hover td { background: none; }
  .area-game :is(table.leaders, table.sets) td { order: 2; padding: 0; border: 0; text-align: left; }
  .area-game :is(table.leaders, table.sets) td[data-label]::before { content: attr(data-label); margin-right: 0.35em; font: 600 0.75rem var(--font); color: var(--ink-2); }
  .area-game :is(table.leaders, table.sets) td.empty { flex: 1 1 100%; text-align: center; }
  .area-game :is(table.leaders, table.sets) tr::after { content: ""; order: 1; flex-basis: 100%; }      /* ends the first line */
  .area-game table.leaders :is(td.rank, td:nth-child(2), td.rating), .area-game table.sets :is(td:first-child, td.ts) { order: 0; }
  .area-game table.leaders td:nth-child(2), .area-game table.sets td:first-child { flex: 1 1 0; min-width: 0; }
  .area-game table.sets td.ts::before { content: none; }
}

/* /starter: a row reached by /starter#<game> */
.area-starter tbody tr:target { outline: 2px solid var(--teal); outline-offset: -2px; }
.area-starter tbody tr[id] { scroll-margin-top: 5rem; }
.area-tournaments .tn-mine { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.area-starter .starter-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 0.5rem 0 0.75rem; }
.area-starter .starter-pick .field { margin: 0; }
.area-starter tr.chosen td { background: var(--hover); }
.area-starter .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.area-starter .starter-pick [hidden] { display: none; }

/* A cash-prize tournament's USDC box (core/cash.py). */
.area-tournaments .tn-cash { border-color: color-mix(in srgb, var(--usdc) 45%, var(--rule)); margin: 1.25rem 0; }
.area-tournaments .tn-cash h2 { margin: 0 0 0.6rem; font-size: 1.25rem; display: flex; align-items: center; gap: 0.6rem; }
.area-tournaments .tn-cash-facts { margin: 0 0 0.6rem; padding-left: 1.2rem; display: grid; gap: 0.25rem; }
.area-tournaments .tn-cash-todo { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
