/* Tournaments, rebuilt for the Launch Cup (client/tournaments.ts): an event's page (.tnx-*) and the match screen (.tnr-*). */

/* ---------- the live pills in the page head ---------- */
.tn-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; min-width: 0; }

/* ---------- an event's page ---------- */
.tnx { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; min-width: 0; }
.tnx-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 4px; color: #f4e2b8;
  background: radial-gradient(ellipse at 18% 50%, color-mix(in srgb, var(--tc) 38%, transparent), transparent 60%), linear-gradient(180deg, #4a3520, #24180e);
  border: 1px solid color-mix(in srgb, var(--gold) 70%, #000); box-shadow: inset 0 1px 0 rgba(255,230,170,.2); }
.tnx-head .tn-emblem { width: 44px; height: 44px; flex: none; }
.tnx-head .bv-btn { flex: none; }
.tnx-ht { min-width: 0; }
.tnx-ht small { display: block; font: 600 11.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 55%, #f4e2b8); }
.tnx-ht h3 { margin: 0; display: flex; align-items: center; gap: 8px; color: #fff1cf; font-size: 21px; white-space: nowrap; }
.tnx-st { padding: 1px 7px; border-radius: 2px; font: 700 11px/1.5 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: #f4e2b8; border: 1px solid rgba(244,226,184,.4); }
.tnx-st.done { color: #2b1c0e; background: var(--gilt-hi, #f1cf7a); border-color: transparent; }
.tnx-facts { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; font: 500 13px var(--sans); color: rgba(244,226,184,.8); }
.tnx-facts b { color: #fff1cf; }
.tnx-champ b { color: var(--gilt-hi, #f1cf7a); }

/* Where you stand: one plaque. */
.tnx-stand { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); background: color-mix(in srgb, var(--tc) 9%, var(--panel-2)); min-width: 0; }
.tnx-sk { flex: none; padding: 2px 8px; border-radius: 2px; font: 700 12px/1.5 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: #fff; background: color-mix(in srgb, var(--tc) 80%, #000); }
.tnx-sv { flex: 1; min-width: 0; font-size: 15px; }
.tnx-sv small { display: block; font-size: 12.5px; color: var(--muted); }
.tnx-sc { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; margin: 0 4px; }
.tnx-stand .bv-btn { flex: none; }
.tnx-stand.now { border-color: var(--tc); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tc) 50%, transparent); }
.tnx-stand.bye .tnx-sk { background: var(--good); }
.tnx-stand.through .tnx-sk { background: var(--good); }
.tnx-stand.out .tnx-sk { background: #7d6a55; }
.tnx-stand.watch .tnx-sk { background: #6d5a45; }
.tnx-stand.watch.now .tnx-sk { background: var(--bad); }
.tnx-live { color: var(--bad); }
.tnx-stand.champ { background: linear-gradient(90deg, color-mix(in srgb, var(--gilt-hi, #f1cf7a) 35%, var(--panel-2)), var(--panel-2)); }
.tnx-stand.champ .tnx-sk { background: linear-gradient(#e7b74a, #a87a22); color: #2b1c0e; }

/* The rail of rounds: each with its start time; done, live now, or later. */
.tnx-rail { display: flex; gap: 4px; min-width: 0; }
.tnx-r { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 4px 4px; border: 1px solid var(--rule, var(--line)); border-radius: 3px; background: var(--vellum-hi, var(--panel-2)); color: var(--ink); cursor: pointer; font: inherit; position: relative; }
.tnx-r b { font: 700 13px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tnx-r small { font: 500 11.5px/1.2 var(--sans); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tnx-r .tnx-rs { display: none; }
.tnx-r.done b { color: var(--muted); }
.tnx-r.live { border-color: var(--bad); }
.tnx-r.live small::before { content: '● '; color: var(--bad); }
.tnx-r.you::after { content: ''; position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--tc); }
.tnx-r:hover { border-color: var(--gold); }
.tnx-r.on { background: linear-gradient(180deg, #5a4129, #3a2716); border-color: #1c120a; color: #fff1cf; }
.tnx-r.on b, .tnx-r.on small { color: #fff1cf; }

.tnx-pane { min-width: 0; min-height: 0; }
.tnx-note { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.tnx-wait { margin: 18px 0; text-align: center; color: var(--muted); font-style: italic; }

/* A match in the bracket. */
.tnx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 6px; }
.tnx-m { position: relative; display: grid; gap: 1px; width: 100%; min-width: 0; padding: 5px 8px 4px; text-align: left; font: inherit; color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); border-radius: 3px; background: var(--vellum-hi, var(--panel-2)); }
button.tnx-m { cursor: pointer; }
button.tnx-m:hover { border-color: var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.tnx-m.bye { opacity: .62; background: transparent; border-style: dashed; }
.tnx-m.tbd { opacity: .5; background: transparent; border-style: dashed; }
.tnx-m.me { border-color: var(--tc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 55%, transparent); background: color-mix(in srgb, var(--tc) 10%, var(--vellum-hi, var(--panel-2))); opacity: 1; }
.tnx-m.foe { border-color: color-mix(in srgb, var(--tc) 55%, transparent); }
.tnx-m.live { border-color: var(--bad); }
.tnx-p { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 13.5px; line-height: 1.35; }
.tnx-p b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tnx-p b i { font-weight: 400; color: var(--muted); }
.tnx-p small { display: none; }
.tnx-p em { flex: none; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 10px; text-align: right; }
.tnx-p.w b, .tnx-p.w em { font-weight: 800; }
.tnx-p.w b::after { content: ' ✓'; color: var(--good); }
.tnx-p.l { color: var(--muted); }
.tnx-p.l b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.tnx-p.me b { color: color-mix(in srgb, var(--tc) 70%, var(--ink)); }
.tnx-mt { position: absolute; top: -7px; right: 6px; padding: 0 5px; border-radius: 2px; font: 700 10px/14px var(--sans); font-style: normal; letter-spacing: .03em; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.tnx-mt.live { color: #fff; background: var(--bad); border-color: transparent; }

/* A Swiss event (shared/swiss.ts): the rail holds the table, every round by its number, then the knockout. */
.tnx-rail.sw .tnx-r { flex: 1.7 1 0; }
.tnx-rail.sw .tnx-r.num { flex: 1 1 0; }
.tnx-rw { font-style: normal; }
/* Its table: every trainer in order, the places that go through in gold. Pages instead of scrolling (data-fit). */
.tnx-tnote { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 14px; flex-wrap: wrap; }
.tnx-key { font-size: 12.5px; }
.tnx-key em { font-style: normal; font-weight: 600; color: color-mix(in srgb, var(--tc) 55%, var(--muted)); }
.tnx-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 4px 10px; min-width: 0; }
.tnx-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 24px; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 30px; padding: 0 8px 0 4px; text-align: left; font: inherit; font-size: 14px; color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent); border-radius: 3px; background: var(--vellum-hi, var(--panel-2)); }
button.tnx-row { cursor: pointer; }
button.tnx-row:hover { border-color: var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.tnx-row i { font: 700 12.5px/20px var(--sans); font-style: normal; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; border-radius: 2px; }
.tnx-row.top i { color: #2b1c0e; background: linear-gradient(#f1cf7a, #c99a3a); }
.tnx-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tnx-rec { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.tnx-row em { font-style: normal; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--tc) 55%, var(--muted)); }
.tnx-row.me { border-color: var(--tc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 55%, transparent); background: color-mix(in srgb, var(--tc) 12%, var(--vellum-hi, var(--panel-2))); }
.tnx-row.me b { color: color-mix(in srgb, var(--tc) 70%, var(--ink)); }
/* Your rounds on the match screen: a long Swiss run keeps to one row. */
.tnr-rds.many button { min-width: 0; padding: 7px 7px; }

/* The finals as a tree, ending on the champion. */
.tnx-tree { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0 18px; min-width: 0; }
.tnx-col { display: flex; flex-direction: column; min-width: 0; }
.tnx-col h5 { margin: 0 0 8px; text-align: center; font: 700 13px var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tnx-col h5 small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; }
.tnx-col h5.tnx-h2 { display: none; }
.tnx-ms { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.tnx-col:not(.tnx-cup) .tnx-m::after { content: ''; position: absolute; right: -19px; top: 50%; width: 18px; border-top: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); }
.tnx-final .tnx-m { padding: 8px 10px; }
.tnx-final .tnx-p { font-size: 15px; }
.tnx-crown { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 4px; text-align: center; background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--gilt-hi, #f1cf7a) 40%, transparent), transparent 70%); border: 1px solid var(--gold); }
.tnx-crown .tn-emblem { width: 52px; height: 52px; }
.tnx-crown b { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnx-crown b.tbd { color: var(--muted); }

/* A finished event: the podium. */
.tnx-results { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tnx-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); align-items: end; gap: 8px; width: 100%; justify-content: center; }
.tnx-step { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: 4px 4px 0 0; text-align: center; color: #f4e2b8; background: linear-gradient(180deg, #5a4129, #2a1c11); border: 1px solid #1c120a; min-width: 0; }
.tnx-step b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff1cf; }
.tnx-step b.me { color: var(--gilt-hi, #f1cf7a); text-decoration: underline; }
.tnx-step small { font-size: 11.5px; color: rgba(244,226,184,.75); }
.tnx-plc { font: 700 12px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgba(244,226,184,.8); }
.tnx-step.p1 { min-height: 150px; order: 2; background: linear-gradient(180deg, #8a6420, #3a2716); justify-content: center; }
.tnx-step.p1 b { font-size: 20px; color: #ffe7a6; }
.tnx-step.p1 .tnx-plc { color: #ffe7a6; }
.tnx-step.p2 { min-height: 112px; order: 1; justify-content: center; }
.tnx-step.p3 { min-height: 92px; order: 3; justify-content: center; }
.tnx-qf { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; justify-content: center; font-size: 13.5px; }
.tnx-qf span { font: 700 12px var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tnx-qf b.me { color: color-mix(in srgb, var(--tc) 70%, var(--ink)); text-decoration: underline; }
.tnx-qf small { flex-basis: 100%; text-align: center; color: var(--muted); }
.tnx-results .actions { justify-content: center; }

/* ---------- the match screen ---------- */
.tnr { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; min-width: 0; }
.tnr-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tnr-top .tn-emblem { width: 36px; height: 36px; flex: none; }
.tnr-top .bv-btn { flex: none; }
.tnr-t { flex: none; min-width: 0; }
.tnr-t small { display: block; font: 700 11px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--tc) 55%, var(--ink)); }
.tnr-t b { font-size: 17px; }
.tnr-score { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 12px; border-radius: 4px; color: #f4e2b8; background: linear-gradient(180deg, #4a3520, #2a1c11); border: 1px solid color-mix(in srgb, var(--gold) 70%, #000); }
.tnr-score > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tnr-score .b { justify-content: flex-end; }
.tnr-score > span > b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff1cf; }
.tnr-score .bv-pips i { background: #f4d488; }
.tnr-score .bv-pips i.out { background: rgba(244,226,184,.2); }
.tnr-mid b { font: 700 20px/1 var(--display, serif); font-variant-numeric: lining-nums tabular-nums; color: #fff1cf; white-space: nowrap; }
.tnr-mid b.good { color: #9fe0a2; }
.tnr-mid b.bad { color: #f0a090; }

/* The clock strip (bans, game 1-3) and the tabs on one line. */
.tnr-bar { display: flex; align-items: stretch; gap: 10px; min-width: 0; }
.tnr-ph { flex: 1; display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.tnr-ph li { flex: 1 1 0; min-width: 0; display: flex; }
.tnr-ph li > span, .tnr-ph li > button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 4px; border-radius: 3px; border: 1px solid var(--line); background: transparent; font: inherit; color: var(--ink); }
.tnr-ph b { font: 700 12.5px/1.25 var(--sans); white-space: nowrap; }
.tnr-ph small { font: 500 11.5px/1.2 var(--sans); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-variant-numeric: tabular-nums; }
.tnr-ph li.now > span { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
.tnr-ph li.now small { color: var(--ink); font-weight: 700; }
.tnr-ph li.done > span { color: var(--muted); }
.tnr-ph li.skip > span { opacity: .45; border-style: dashed; }
.tnr-ph li > button { cursor: pointer; background: var(--vellum-hi, var(--panel-2)); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.tnr-ph li > button:hover { border-color: var(--gold); }
.tnr-ph li.won > button { box-shadow: inset 0 -3px 0 var(--good); }
.tnr-ph li.lost > button { box-shadow: inset 0 -3px 0 var(--bad); }
.tnr-ph li.now > button { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
.tnr-ph li.on > button, .tnr-ph li.on > span { background: linear-gradient(180deg, #5a4129, #3a2716); color: #fff1cf; border-color: #1c120a; }
.tnr-ph li.on small { color: rgba(255,241,207,.8); }
.tnr-ph li.live small { color: #ffb4a2; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tnr-ph li.live small::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #ff6b57; animation: tnr-live 1.2s ease-in-out infinite; }
@keyframes tnr-live { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .tnr-ph li.live small::before { animation: none; } }
/* Beside the strip: both teams, and the way on once your match is won. */
.tnr-acts { flex: none; display: flex; align-items: stretch; gap: 8px; }
.tnr-tb { padding: 0 16px; border: 1px solid var(--rule, var(--line)); border-radius: 3px; background: var(--vellum-hi, var(--panel-2)); color: var(--ink); font: 700 13px var(--sans); cursor: pointer; white-space: nowrap; }
.tnr-tb:hover { border-color: var(--gold); }
.tnr-tb.on { background: linear-gradient(180deg, #5a4129, #3a2716); color: #fff1cf; border-color: #1c120a; }
.tnr-next { white-space: nowrap; }
.tnr-next.wait { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 12px; border: 1px dashed var(--line); border-radius: 3px; }
.tnr-next.wait b { font: 700 12.5px/1.25 var(--sans); }
.tnr-next.wait small { font: 500 11.5px/1.2 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
/* Your rounds in the event, beside the round's name. */
.tnr-rds { flex: none; display: flex; align-self: center; border: 1px solid var(--rule, var(--line)); border-radius: 3px; overflow: hidden; }
.tnr-rds button { min-width: 36px; padding: 7px 9px; border: 0; border-left: 1px solid var(--rule, var(--line)); background: var(--vellum-hi, var(--panel-2)); color: var(--ink); font: 700 12.5px/1.2 var(--sans); cursor: pointer; white-space: nowrap; }
.tnr-rds button:first-child { border-left: 0; }
.tnr-rds button:hover { background: color-mix(in srgb, var(--gold) 18%, var(--vellum-hi, var(--panel-2))); }
.tnr-rds button.won { box-shadow: inset 0 -3px 0 var(--good); }
.tnr-rds button.lost { box-shadow: inset 0 -3px 0 var(--bad); }
.tnr-rds button.on { background: linear-gradient(180deg, #5a4129, #3a2716); color: #fff1cf; }

.tnr-body { min-width: 0; min-height: 0; }

/* Plan: the board on the left, their six, yours and the lock-in on the right. */
.tnr-plan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 12px; align-items: start; min-width: 0; }
.tnr-stage { min-width: 0; }
.tnr-stage .bv { max-width: none; margin: 0; }
.tnr-stage .bv-frame { width: min(100%, max(530px, calc((100vh - 400px) * 16 / 9 + 10px))); margin: 0 auto; }
body[data-dock-room] .tnr-stage .bv-frame { width: min(100%, max(530px, calc((100vh - 480px) * 16 / 9 + 10px))); }
.tnr-aside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tnr-side h5 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; font-size: 15px; }
.tnr-side h5 small { font: 400 12px var(--sans); color: var(--muted); }
.tnr-side h5 .syn-chips { margin: 0; }
.tnr-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tnr-six .tn-cd { padding: 4px 3px 3px; }
.tnr-six .tn-cd img { width: 40px; height: 40px; }
.tnr-six .tn-cd small .tn-pw { display: none; }
.tnr-side.you .tnr-six { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.tnr-side.you .tn-cd { padding: 3px 1px 2px; }
.tnr-side.you .tn-cd img { width: 32px; height: 32px; }
.tnr-side.you .tn-cd b { font-size: 10.5px; }
.tnr-side.you .tn-cd small { display: none; }
.tnr-foot { padding-top: 6px; border-top: 1px solid var(--line); }

/* A game's replay. */
.tnr-replay { min-width: 0; }
.tnr-replay .bv-frame { width: min(100%, max(530px, calc((100vh - 430px) * 16 / 9 + 10px))); margin: 0 auto; }
/* The result line sits tight, so a finished game still fits a 768-high window. */
.tnr-replay .fb-log { padding: 0 10px; border-top: 0; }
.tnr-replay .fb-end { margin: 2px 0 6px; }
/* Every blow sits under the board's middle, clear of the chat bubble's corner. */
.tnr-replay .ar-log { width: fit-content; max-width: 100%; margin: 4px auto 0; }
.tnr-ph .tnr-tz { font-style: normal; }
@media (min-width: 761px) and (max-width: 989px) {
  .tnr-plan { grid-template-columns: minmax(0, 1fr) 236px; gap: 8px; }
  .tnr-side.them h5 small { display: none; }
  .tnr-six .tn-cd b { font-size: 11px; }
}
.tnr-note { margin: 0 0 4px; font-size: 12.5px; }

/* Teams: both open teams with their rolls. */
.tnr-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.tnr-teams h5 { margin: 0 0 4px; font-size: 15px; }
.tnr-teams .tn-sheet { margin: 0; }

/* ---------- smaller windows ---------- */
@media (max-width: 1100px) {
  .tnr-plan { grid-template-columns: minmax(0, 1fr) 280px; }
  .tnx-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 1100px) {
  .tnx-rw { display: none; }
}
@media (max-width: 900px) {
  .tnr-t { display: none; }
  .tnx-r .tnx-rl { display: none; }
  .tnx-r .tnx-rs { display: inline; }
  .tnx-table { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
@media (max-width: 760px) {
  .tnx { padding: 8px; gap: 8px; }
  .tnx-head { flex-wrap: wrap; gap: 8px; padding: 6px 8px; }
  .tnx-head .tn-emblem { width: 34px; height: 34px; }
  .tnx-ht h3 { font-size: 17px; }
  .tnx-facts { margin-left: 0; flex-basis: 100%; justify-content: flex-start; gap: 10px; font-size: 12px; }
  .tnx-stand { flex-wrap: wrap; gap: 6px 8px; padding: 6px 8px; }
  .tnx-sv { font-size: 14px; flex-basis: calc(100% - 90px); }
  .tnx-stand .bv-btn { flex-basis: 100%; }
  .tnx-r { padding: 4px 2px 3px; }
  .tnx-r b { font-size: 12px; }
  .tnx-r small { font-size: 10px; }
  .tnx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 6px; }
  /* A Swiss rail on a phone: the table, the round numbers alone (their times are on the round's page), the knockout. */
  .tnx-rail.sw { gap: 3px; }
  .tnx-rail.sw .tnx-r { flex: 2.2 1 0; justify-content: center; }
  .tnx-rail.sw .tnx-r.num { flex: 1 1 0; }
  .tnx-rail.sw .tnx-r small { display: none; }
  .tnx-rail.sw .tnx-r.you::after { top: 2px; right: 2px; width: 5px; height: 5px; }
  .tnx-table { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  /* One column: a line under the last place that goes through. */
  .tnx-row.cut { position: relative; margin-bottom: 8px; }
  .tnx-row.cut::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; border-bottom: 2px solid var(--gold); pointer-events: none; }
  .tnx-tnote { font-size: 12.5px; }
  .tnx-key { font-size: 11.5px; }
  .tnr-rds.many { flex-basis: 100%; order: 2; }
  .tnr-rds.many button { flex: 1 1 0; padding: 6px 2px; font-size: 11.5px; }
  .tnx-tree { gap: 0 10px; }
  .tnx-tree .tnx-cup { display: none; }
  .tnx-tree { --cols: 3 !important; }
  .tnx-col:not(.tnx-cup) .tnx-m::after { right: -11px; width: 10px; }
  .tnx-col .tnx-m { padding: 4px 5px 3px; }
  .tnx-p { font-size: 12px; gap: 3px; }
  .tnx-final .tnx-p { font-size: 13px; }
  .tnx-podium { gap: 4px; }
  .tnx-step { padding: 8px 4px; }
  .tnx-step b { font-size: 13px; }
  .tnx-step.p1 b { font-size: 16px; }
  .tnx-step small { font-size: 10.5px; }

  .tnr { padding: 8px; gap: 6px; }
  .tnr-top { flex-wrap: wrap; gap: 6px; }
  .tnr-top .tn-emblem { display: none; }
  .tnr-score { flex-basis: 100%; order: 3; padding: 5px 8px; }
  .tnr-score > span > b { font-size: 14px; }
  .tnr-t { display: block; }
  .tnr-bar { flex-direction: column; gap: 6px; }
  .tnr-ph b { font-size: 11.5px; }
  .tnr-ph small { font-size: 10.5px; }
  .tnr-acts > * { flex: 1; }
  .tnr-tb, .tnr-next { padding: 6px 4px; }
  .tnr-next.wait { flex-direction: row; gap: 6px; }
  .tnr.rds .tnr-t { display: none; }
  .tnr-ph .tnr-tz { display: none; }
  .tnr-rds button { min-width: 0; padding: 7px 7px; font-size: 12px; }
  .tnr-plan { grid-template-columns: 1fr; }
  .tnr-aside { display: contents; }
  .tnr-side.them { order: -1; }
  .tnr-stage .bv-frame, .tnr-replay .bv-frame { width: 100%; }
  .tnr-teams { grid-template-columns: 1fr; }
}
/* The tree's headings keep to one line on a phone ("Quarter-finals" broke at its hyphen). */
@media (min-width: 360px) and (max-width: 760px) { .tnx-col h5 { font-size: 11px; letter-spacing: .02em; white-space: nowrap; } }
/* A phone's tree boxes are too narrow for a tag (it sat on the score): the heading has the time, a live box its red edge. */
@media (max-width: 760px) { .tnx-tree .tnx-mt { display: none; } }
/* A Swiss event's page on a phone: the plaque's button sits beside the round, not under it, so the table keeps the room. */
@media (max-width: 760px) {
  .tnx.sw .tnx-stand { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; }
  .tnx.sw .tnx-sk { justify-self: start; grid-column: 1; }
  .tnx.sw .tnx-sv { grid-column: 1; }
  .tnx.sw .tnx-stand .bv-btn { grid-column: 2; grid-row: 1 / span 2; padding: 9px 12px; }
  .tnx-tnote > span:first-child { display: none; }
}
/* A short phone: the banner keeps to the cup's name, and the table to its rows. */
@media (max-width: 760px) and (max-height: 700px) {
  .tnx.sw .tnx-ht small, .tnx.sw .tnx-facts, .tnx-tnote { display: none; }
  .tnx-results { gap: 6px; }
  .tnx-step { padding: 6px 4px; }
  .tnx-step.p1 { min-height: 124px; }
  .tnx-step.p2 { min-height: 100px; }
  .tnx-step.p3 { min-height: 84px; }
}
/* A short window (the itch frame, 800x600): the same page drawn tighter, so the table shows more of itself. */
@media (min-width: 761px) and (max-height: 640px) {
  .tnx.sw { gap: 6px; padding: 8px 12px; }
  .tnx.sw .tnx-head { padding: 4px 10px; }
  .tnx.sw .tnx-head .tn-emblem { width: 32px; height: 32px; }
  .tnx.sw .tnx-ht h3 { font-size: 18px; }
  .tnx.sw .tnx-stand { padding: 4px 10px; }
  .tnx.sw .tnx-r { padding: 3px 4px 2px; }
  .tnx-tnote { display: none; }
  .tnx-table { gap: 3px 10px; }
  .tnx-row { height: 27px; }
  /* The rail keeps to one line (a round's time is on the plaque), and a round's boxes sit closer. */
  .tnx.sw .tnx-r small { display: none; }
  .tnx.sw .tnx-r { justify-content: center; padding: 4px 4px 3px; }
  .tnx.sw .tnx-grid { gap: 4px 8px; }
  .tnx.sw .tnx-grid .tnx-m { padding: 3px 8px 2px; }
  .tnx.sw .tnx-grid .tnx-p { font-size: 13px; line-height: 1.3; }
  .tnx-results { gap: 6px; }
  .tnx-step { padding: 6px 8px; }
  .tnx-step.p1 { min-height: 112px; }
  .tnx-step.p1 b { font-size: 18px; }
  .tnx-step.p2 { min-height: 92px; }
  .tnx-step.p3 { min-height: 78px; }
  /* The last eight from both sides, the final in the middle: two matches tall where four would run off the page. */
  .tnx-tree.t8 { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto auto auto; gap: 8px 12px; align-items: center; }
  .tnx-tree.t8 .tnx-col, .tnx-tree.t8 .tnx-ms { display: contents; }
  .tnx-tree.t8 .tnx-cup { display: none; }
  .tnx-tree.t8 h5 { grid-row: 1; margin: 0 0 2px; font-size: 11.5px; }
  .tnx-tree.t8 h5.tnx-h2 { display: block; }
  .tnx-tree.t8 .tnx-col:nth-child(1) h5 { grid-column: 1; }
  .tnx-tree.t8 .tnx-col:nth-child(1) h5.tnx-h2 { grid-column: 5; }
  .tnx-tree.t8 .tnx-col:nth-child(2) h5 { grid-column: 2; }
  .tnx-tree.t8 .tnx-col:nth-child(2) h5.tnx-h2 { grid-column: 4; }
  .tnx-tree.t8 .tnx-col:nth-child(3) h5 { grid-column: 3; }
  .tnx-tree.t8 .tnx-col:nth-child(1) .tnx-m:nth-child(1) { grid-area: 2 / 1; }
  .tnx-tree.t8 .tnx-col:nth-child(1) .tnx-m:nth-child(2) { grid-area: 3 / 1; }
  .tnx-tree.t8 .tnx-col:nth-child(1) .tnx-m:nth-child(3) { grid-area: 2 / 5; }
  .tnx-tree.t8 .tnx-col:nth-child(1) .tnx-m:nth-child(4) { grid-area: 3 / 5; }
  .tnx-tree.t8 .tnx-col:nth-child(2) .tnx-m:nth-child(1) { grid-area: 2 / 2 / span 2; }
  .tnx-tree.t8 .tnx-col:nth-child(2) .tnx-m:nth-child(2) { grid-area: 2 / 4 / span 2; }
  .tnx-tree.t8 .tnx-col:nth-child(3) .tnx-m { grid-area: 2 / 3 / span 2; }
  .tnx-tree.t8 .tnx-m { padding: 3px 7px 2px; }
  .tnx-tree.t8 .tnx-p { font-size: 13px; line-height: 1.3; }
  .tnx-tree.t8 .tnx-final .tnx-m { padding: 5px 8px 4px; }
  .tnx-tree.t8 .tnx-final .tnx-p { font-size: 14px; }
  .tnx-tree.t8 .tnx-col:not(.tnx-cup) .tnx-m::after { right: -13px; width: 12px; }
  .tnx-tree.t8 .tnx-col:nth-child(1) .tnx-m:nth-child(n+3)::after, .tnx-tree.t8 .tnx-col:nth-child(2) .tnx-m:nth-child(2)::after { right: auto; left: -13px; }
}
/* The replay's synergy rows are on the Plan tab already: the replay keeps to the board and its controls. */
.tnr-replay .bv-chips { display: none; }
.tnr-replay .fb-end { margin: 4px 0; }
/* A one-time event's chat badge in its prize lines: the coin beside the word. */
.tn2-badge { display: inline; white-space: nowrap; }
.tn2-badge img { display: inline; width: 15px; height: 15px; margin: -4px 0 -4px 1px; vertical-align: -3px; }

/* Phones: the banner art's cloud band runs right behind the kicker ("One time · Free entry") and read as a line
   struck through it. A soft dark plate behind the name block keeps the words clear of the clouds (star level thread, 11-28). */
@media (max-width: 760px) {
  /* The art lower in its frame, so its cloud band sits above the words; the plate covers what is left. */
  .tn2[data-tier] .tn2-hero { background-position: 0 0, 50% 48%; }
  .tn2-hero .tn2-name { position: relative; isolation: isolate; }
  .tn2-hero .tn2-name::before { content: ''; position: absolute; z-index: -1; inset: -9px -16px -4px -12px; border-radius: 50%; background: radial-gradient(ellipse at 50% 50%, rgba(12, 9, 6, .78) 0%, rgba(12, 9, 6, .62) 45%, rgba(12, 9, 6, 0) 78%); pointer-events: none; }
  .tn2-hero .tn2-kicker { text-shadow: 0 1px 0 #0c0906, 0 0 3px #0c0906, 0 0 6px rgba(12, 9, 6, .9); }
}

/* ---------- The tournament tag in the top bar and its herald (client/tourlive.ts) ---------- */
.appbar .evtag.tnlive { --tc: #f0883e; height: 30px; gap: 7px; padding: 0 12px 0 5px; border: 0; font-family: inherit; font-size: 13px; cursor: pointer; color: #f6ead2; background: linear-gradient(180deg, #3a1d24, #24121a); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 75%, #000), 0 0 0 2px color-mix(in srgb, var(--tc) 22%, transparent), 0 0 12px rgba(224, 72, 56, .35); animation: tl-glow 2.4s ease-in-out infinite; }
.appbar .evtag.tnlive:hover { background: linear-gradient(180deg, #4a252d, #2e1821); box-shadow: inset 0 0 0 1px var(--tc), 0 0 0 2px color-mix(in srgb, var(--tc) 40%, transparent), 0 0 14px rgba(224, 72, 56, .5); }
.appbar .evtag.tnlive .tl-live { display: inline-flex; align-items: center; height: 20px; padding: 0 7px 0 18px; margin-left: 0; border-radius: 999px; background: #c0392b; color: #fff; font: 700 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.appbar .evtag.tnlive .k { font-weight: 700; color: #fbe7b0; }
.appbar .evtag.tnlive em { color: #d9c7a3; opacity: 1; }
.appbar .evtag.tnlive em::before { content: '·'; margin-right: 6px; opacity: .6; }
.tl-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation: tl-ping 1.6s ease-out infinite; }
.appbar .evtag.tnlive > .tl-dot { margin-right: -19px; margin-left: 7px; position: relative; z-index: 1; }
@keyframes tl-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 70%, 100% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); } }
@keyframes tl-glow { 50% { box-shadow: inset 0 0 0 1px var(--tc), 0 0 0 3px color-mix(in srgb, var(--tc) 38%, transparent), 0 0 16px rgba(224, 72, 56, .55); } }
/* About to start: the same tag, calm, with the event's emblem and the time left. */
.appbar .evtag.tnlive.soon { padding: 0 11px 0 6px; gap: 6px; background: linear-gradient(180deg, #2c2433, #1b1620); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 70%, #000); animation: none; }
.appbar .evtag.tnlive.soon:hover { background: linear-gradient(180deg, #382d40, #231c29); box-shadow: inset 0 0 0 1px var(--tc); }
.appbar .evtag.tnlive .tn-emblem { flex: none; width: 21px; height: 18px; object-fit: contain; }
/* The bar asked for less (client/ui.ts fitTourTag): the round goes, then the name. */
.appbar .evtag.tnlive.t1:not(.soon) em, .appbar .evtag.tnlive.t2:not(.soon) em, .appbar .evtag.tnlive.t2 .k, .appbar .evtag.tnlive.soon.t1 .k { display: none; }
.appbar .evtag.tnlive.t2:not(.soon) { padding: 0 9px 0 5px; }
/* A laptop's bar shares its row with the links: there the tag is "Live" and the emblem alone, so it costs the bar one link at most. */
@media (min-width: 1201px) and (max-width: 1559px) {
  .appbar .evtag.tnlive .k, .appbar .evtag.tnlive:not(.soon) em { display: none; }
  .appbar .evtag.tnlive:not(.soon) { padding: 0 9px 0 5px; }
}
.appbar .evtag.tnlive.soon em { color: var(--tc); font-weight: 700; }
.appbar .evtag.tnlive.soon em::before { content: none; }
@media (max-width: 760px) {
  .appbar .evtag.tnlive { height: 28px; gap: 5px; padding: 0 9px 0 4px; font-size: 12px; }
  .appbar .evtag.tnlive em { display: none; }
  /* A phone's bar has no room for the event's name beside "Live": the time left stays on the calm tag. */
  .appbar .evtag.tnlive.soon { padding: 0 8px 0 5px; }
  .appbar .evtag.tnlive.soon em { display: inline; }
}
@media (max-width: 480px) {
  .appbar .evtag.tnlive .k { display: none; }
  .appbar .evtag.tnlive:not(.soon) { padding: 0 7px 0 4px; }
}
@media (prefers-reduced-motion: reduce) { .appbar .evtag.tnlive, .tl-dot { animation: none; } }

/* The herald: a plaque under the bar when an event begins. Over the page, never in it: nothing moves. */
.tl-herald { --tc: #f0883e; position: fixed; top: var(--tl-top, 60px); left: 50%; z-index: 58; display: flex; align-items: stretch; width: max-content; max-width: calc(100vw - 16px); translate: -50% 0; border-radius: 12px; background: linear-gradient(180deg, #2f2230, #19131d); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 75%, #000), 0 0 0 3px color-mix(in srgb, var(--tc) 20%, transparent), 0 14px 34px rgba(0, 0, 0, .55); color: #f6ead2; animation: tl-drop .35s cubic-bezier(.2, .9, .3, 1.15); }
.tl-herald.out { opacity: 0; translate: -50% -14px; transition: opacity .24s, translate .24s; }
@keyframes tl-drop { from { opacity: 0; translate: -50% -22px; } }
.tl-h-main { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.tl-h-main .tn-emblem { flex: none; width: 50px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.tl-h-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-h-tx small { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 18px; padding: 0 8px 0 7px; border-radius: 999px; background: #c0392b; color: #fff; font: 700 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.tl-h-tx b { font-family: var(--display, inherit); font-size: 19px; line-height: 1.15; color: #fbe7b0; white-space: nowrap; }
.tl-h-tx em { font-style: normal; font-size: 12.5px; color: #cbbd9f; white-space: nowrap; }
.tl-h-tx em b { font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; color: #fbe7b0; }
.tl-h-tx > b { max-width: min(46vw, 300px); overflow: hidden; text-overflow: ellipsis; }
.tl-h-go { flex: none; margin-left: 6px; padding: 9px 18px; border-radius: 9px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 88%, #fff), color-mix(in srgb, var(--tc) 78%, #000)); color: #1d1206; font-weight: 700; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .35); }
.tl-h-main:hover .tl-h-go { filter: brightness(1.08); }
.tl-h-x { flex: none; align-self: flex-start; width: 34px; height: 34px; margin: 2px 2px 0 0; border: 0; border-radius: 8px; background: none; color: #cbbd9f; font-size: 20px; line-height: 1; cursor: pointer; }
.tl-h-x:hover { color: #fff; background: rgba(255, 255, 255, .08); }
@media (max-width: 420px) {
  .tl-h-main { gap: 9px; padding: 9px 2px 9px 10px; }
  .tl-h-main .tn-emblem { width: 41px; height: 36px; }
  .tl-h-tx b { font-size: 16.5px; }
  .tl-h-go { margin-left: 2px; padding: 8px 13px; }
}
@media (prefers-reduced-motion: reduce) { .tl-herald { animation: none; } }
