/* Layout: BDST scoreboard — logo header, stat strip, one ranked deck board.
   Brand: the logo's black plate, white lettering and red edge; a single dark look by choice. */
:root {
  --bg: #0a0a0b;
  --surface: #151517;
  --ink: #f7f7f7;
  --muted: #a3a3ab;
  --line: #2c2c31;
  --red: #ff1418;                        /* BDST red: actions, bars, accents */
  --focus: #ffffff;
  --scrim: rgba(0, 0, 0, .78);
  --vig: #4f8fe0; --com: #3fae5e; --agg: #e8603f; --cun: #e6b93a; --her: #ece8da; --vil: #000000; --pip-ring: rgba(255, 255, 255, .5);
  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1000px; margin: 0 auto; padding-inline: 20px; padding-block: 28px 64px; display: grid; gap: 28px; }
h1, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; }
.eyebrow { font: 600 12px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
section { display: grid; gap: 14px; min-width: 0; }
button { font-family: var(--f-body); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Header + upload */
header { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; justify-content: space-between; }
header .titles { display: grid; gap: 8px; min-width: 0; flex: 1 1 320px; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand .logo { width: clamp(140px, 30vw, 200px); height: auto; display: block; }
.brand .eyebrow { line-height: 1.5; border-left: 2px solid var(--red); padding-left: 14px; }
h1 { font-size: clamp(34px, 6vw, 52px); font-weight: 800; font-style: italic; line-height: .95; letter-spacing: .01em; text-transform: uppercase; }
.evname { font: 600 22px/1.2 var(--f-display); letter-spacing: .02em; color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px dashed var(--line); padding: 2px 0; width: min(100%, 26rem); }
.evname::placeholder { color: var(--muted); }
.evname:hover { border-bottom-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; transition: border-color .15s; max-width: 100%; }
.drop:hover, .drop:focus-within, .drop.over { border-color: var(--ink); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { font-family: var(--f-display); font-size: 18px; letter-spacing: .03em; text-transform: uppercase; }
.drop small { display: block; color: var(--muted); font-size: 13px; }
.icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--ink); flex: none; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; border: 0; background: var(--red); color: #fff; font: italic 800 17px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn:hover { filter: brightness(1.08); }
.notice { font-size: 13px; color: var(--muted); }
.notice b { color: var(--ink); font-weight: 600; }
.notice.err { color: var(--agg); }

/* Stat strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.stat { padding: 16px 18px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .v { font: 700 34px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.stat .v.sm { font-size: 24px; line-height: 1.05; }
.stat .s { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Art + aspect pips */
.thumb { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; flex: none; background: var(--line); display: grid; place-items: center; font: 700 15px var(--f-display); color: var(--muted); }
.bthumb { width: 70px; height: 27px; border-radius: 5px; object-fit: cover; flex: none; background: var(--line); }
.bthumb.gen { display: grid; place-items: center; font: italic 800 12px/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.bthumb.gen.a-cunning { color: #141414; }
.pair { display: flex; gap: 6px; align-items: center; flex: none; }
.pips { display: inline-flex; gap: 3px; flex: none; }
.pip { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--pip-ring); display: inline-block; }
.a-vigilance { background: var(--vig); } .a-command { background: var(--com); } .a-aggression { background: var(--agg); }
.a-cunning { background: var(--cun); } .a-heroism { background: var(--her); } .a-villainy { background: var(--vil); }

/* Controls */
.bar-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { font: 600 13px/1 var(--f-body); color: var(--muted); background: none; border: 0; padding: 8px 12px; border-radius: 6px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.hint { margin: 0; color: var(--muted); font-size: 13px; max-width: 60ch; }

/* Deck board */
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 8px; display: grid; gap: 4px; min-width: 0; }
.board h3 { font-size: 24px; font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.board h3 small { font: 500 13px var(--f-body); font-style: normal; color: var(--muted); text-transform: none; letter-spacing: 0; }
.cols, details.row summary { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 4.4rem 4rem; gap: 12px; align-items: center; }
.cols { padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.cols span { font: 600 11px/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: right; }
.cols span:nth-child(2) { text-align: left; }
details.row { border-bottom: 1px solid var(--line); }
details.row:last-child { border-bottom: 0; }
details.row summary { list-style: none; cursor: pointer; padding: 10px 0; }
details.row summary::-webkit-details-marker { display: none; }
details.row summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.no { font: 600 14px/1 var(--f-data); color: var(--red); text-align: right; }
.who { min-width: 0; display: flex; gap: 12px; align-items: center; }
.who .info { min-width: 0; flex: 1; display: grid; gap: 6px; }
.who .nm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.who .nm b { font: 600 19px/1.1 var(--f-display); letter-spacing: .02em; min-width: 0; }
.who .nm em { font-style: normal; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 6rem; }
.track { height: 10px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.track div { height: 100%; background: var(--red); border-radius: 3px; }
.num { text-align: right; font: 600 17px/1 var(--f-data); font-variant-numeric: tabular-nums; }
.num.share { font-weight: 400; font-size: 15px; color: var(--muted); }
.pilots { margin: 0 0 12px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; font-size: 13px; }
.pilots li { padding: 5px 8px; border-radius: 6px; background: rgba(255, 255, 255, .04); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pilots .muted { color: var(--muted); }
.foot { font-size: 12px; color: var(--muted); max-width: 75ch; margin: 0; }

/* Collapsible sections */
.sec { display: grid; gap: 12px; min-width: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sec-toggle { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 2px 0; text-align: left; min-width: 0; flex-wrap: wrap; }
.sec-toggle .sec-title { font: italic 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.sec-toggle .sec-meta { font: 500 13px var(--f-body); color: var(--muted); }
.sec-toggle .chev { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: transform .18s ease; flex: none; }
.sec-toggle:hover .chev { color: var(--ink); border-color: var(--muted); }
.sec-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.sec-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .sec-toggle .chev { transition: none; } }

/* Live tournament */
.live-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.live-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.live.on .dot { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 20, 24, .2); }
.live-bar input { flex: 1 1 260px; min-width: 0; font: 15px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.live-bar input::placeholder { color: var(--muted); }
.live-bar .btn { padding: 9px 14px; font-size: 16px; }
.live-bar .btn[disabled] { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; color: var(--muted); font: 600 13px var(--f-body); text-decoration: underline; cursor: pointer; padding: 4px; }
.live-status { font-size: 13px; color: var(--muted); }
.live-status b { color: var(--ink); font-weight: 600; }
.live-status.err { color: var(--agg); }

/* Standings table */
.filter { font: 14px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; width: min(100%, 18rem); }
.tbl-wrap { overflow-x: auto; }
table.st { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
table.st th { font: 600 11px/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.st td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.st tr:last-child td { border-bottom: 0; }
table.st .r { text-align: right; }
table.st .rk { font: 600 14px var(--f-data); color: var(--red); width: 3rem; }
table.st .rec, table.st .pts { font: 600 14px var(--f-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.st .pl { font-weight: 600; }
table.st .deck { display: flex; align-items: center; gap: 10px; min-width: 0; }
table.st .deck .thumb { width: 32px; height: 32px; }
table.st .deck .bthumb { width: 52px; height: 20px; }
table.st .deck b { font: 600 16px/1.1 var(--f-display); letter-spacing: .02em; }
table.st .none { color: var(--muted); }
table.st tr.dropped td { opacity: .5; }
.tag { font: 600 10px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: 4px; background: rgba(255, 255, 255, .1); color: var(--muted); margin-left: 6px; }

/* Top 8 bracket */
.bracket { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 18px; }
.bcol { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; }
.bstack { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.bcol h4 { margin: 0; font: italic 800 15px/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.match { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.mrow { display: grid; grid-template-columns: 1.6rem 42px minmax(0, 1fr) 1.4rem; gap: 10px; align-items: center; padding: 8px 10px; }
.mrow + .mrow { border-top: 1px solid var(--line); }
.mrow.win { box-shadow: inset 4px 0 0 var(--red); }
.mrow.lose { opacity: .45; }
.mrow .seed { font: 600 13px var(--f-data); color: var(--red); text-align: right; }
.mrow .who2 { min-width: 0; display: grid; gap: 2px; }
.mrow .who2 b { font: 600 17px/1.1 var(--f-display); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .who2 span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow .score { font: 700 18px var(--f-data); text-align: right; }
.mrow.tbd .who2 b { color: var(--muted); font-style: italic; }
.champ { border: 1px solid var(--red); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; background: rgba(255, 20, 24, .08); }
.champ .thumb { width: 64px; height: 64px; }
.champ small { font: italic 800 13px/1 var(--f-display); letter-spacing: .08em; color: var(--red); text-transform: uppercase; }
.champ b { display: block; font: 700 22px/1.1 var(--f-display); }
.champ span { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .bracket { grid-template-columns: minmax(0, 1fr); } }

/* Player match history */
.plink { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.plink:hover { text-decoration-color: var(--red); }
.phead { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.phead .thumb { width: 64px; height: 64px; }
.phead b { display: block; font: italic 800 28px/1.05 var(--f-display); text-transform: uppercase; }
.phead span { font-size: 14px; color: var(--muted); }
.phead .rec { font: 600 14px var(--f-data); color: var(--red); }
.hist { list-style: none; margin: 0; padding: 0; display: grid; }
.hist li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.hist .rnd { font: 600 12px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hist .opp { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hist .opp .thumb { width: 36px; height: 36px; }
.hist .opp .bthumb { width: 52px; height: 20px; }
.hist .opp > div { min-width: 0; display: grid; gap: 2px; }
.hist .opp .plink { font: 600 17px/1.1 var(--f-display); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .opp small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist .none { color: var(--muted); font-style: italic; }
.res { font: 700 13px/1 var(--f-data); padding: 6px 8px; border-radius: 6px; white-space: nowrap; text-align: center; min-width: 4.6rem; }
.res.W { background: var(--red); color: #fff; }
.res.L { background: rgba(255, 255, 255, .08); color: var(--muted); }
.res.D { background: rgba(255, 255, 255, .18); color: var(--ink); }
.res.P { border: 1px dashed var(--line); color: var(--muted); }
@media (max-width: 480px) { .hist li { grid-template-columns: minmax(0, 1fr) auto; } .hist .rnd { grid-column: 1 / -1; } }

/* Share modal */
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 10; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; width: min(920px, 100%); max-height: calc(100% - 32px); overflow: auto; }
.sheet .hdr { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet h3 { font-size: 22px; font-style: italic; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.sheet img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }
.sheet p { margin: 0; font-size: 13px; color: var(--muted); }
.x { background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 6px; }

/* ---------- Tournament assistant additions ---------- */
.wrap { max-width: 1080px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 8px; }
.evname { font-size: clamp(26px, 4.4vw, 40px); font-style: italic; font-weight: 800; text-transform: uppercase; width: 100%; }
.sec-head > .sec-title { font: italic 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.sec-head > .sec-meta { font: 500 13px var(--f-body); color: var(--muted); margin-right: auto; }
.sec-head { flex-wrap: wrap; }
.sec-head .btn.sm, .btn.sm { padding: 7px 12px; font-size: 14px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
select, .selectl input { font: 14px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.selectl { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--f-body); color: var(--muted); }
.selectl input { width: 9rem; }
select:focus-visible, .selectl input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--f-body); color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track-sw { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.track-sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .track-sw { background: var(--red); }
.switch input:checked + .track-sw::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + .track-sw { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch:has(input:checked) { color: var(--ink); }

/* Live box extras */
.recent { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.recent button { font: 600 12px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.recent button:hover { border-color: var(--muted); }
.asof { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.organiser summary { cursor: pointer; font: 600 13px var(--f-body); color: var(--muted); width: max-content; }
.organiser summary:hover { color: var(--ink); }
.organiser[open] summary { color: var(--ink); margin-bottom: 10px; }
.org-body { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; }
.org-body p { margin: 0; font-size: 13px; color: var(--muted); max-width: 70ch; }
.org-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.org-row input { font: 14px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 14rem; }
.org-row .btn { padding: 8px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.org-state { font-size: 13px; color: var(--muted); }
.org-state.ok { color: var(--com); }
.org-msg { font-size: 13px; color: var(--muted); }
.org-msg.err { color: var(--agg); }
.replay { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 20, 24, .1); border: 1px solid rgba(255, 20, 24, .45); font-size: 14px; }
.replay b { font-weight: 700; }

/* Tabs */
.tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: var(--bg); padding: 8px 0; margin-block: -8px; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; font: italic 800 17px/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px 9px; cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
.tabs button .badge { font: 700 10px/1 var(--f-data); background: var(--red); color: #fff; border-radius: 999px; padding: 2px 5px; margin-left: 6px; vertical-align: 2px; font-style: normal; }
main { display: grid; }
.panel { display: grid; gap: 28px; min-width: 0; }
.needs-live { display: grid; gap: 12px; justify-items: start; padding: 28px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); }
.needs-live p { margin: 0; max-width: 60ch; }
.empty-note { color: var(--muted); font-size: 14px; padding: 10px 0; }

/* Decks: win rate column */
.has-win .cols, .has-win details.row summary { grid-template-columns: 2rem minmax(0, 1fr) 4.4rem 4rem 4.6rem; }
.wr { text-align: right; font: 600 14px/1 var(--f-data); }
.wr.hi { color: var(--red); }
.wr.na { color: var(--muted); font-weight: 400; }

/* Aspects */
.asp-split { display: flex; height: 30px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.asp-split div { display: flex; align-items: center; padding-inline: 10px; font: 700 14px/1 var(--f-display); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; min-width: 0; }
.asp-split .her { background: var(--her); color: #2a2a2e; }
.asp-split .vil { background: #000; color: #f1efe6; justify-content: flex-end; }
.asp-split .oth { background: var(--line); color: var(--muted); justify-content: center; }
.asp-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .asp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 460px) { .asp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.asp { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 8px; min-width: 0; }
.asp .t { display: flex; align-items: center; gap: 8px; font: 600 16px/1 var(--f-display); letter-spacing: .05em; text-transform: uppercase; }
.asp .t .pip { width: 16px; height: 16px; }
.asp .big { font: 700 30px/1 var(--f-display); }
.asp .s { font-size: 12px; color: var(--muted); }

/* Pairings */
.pairings { display: grid; gap: 10px; }
.pr { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) 4.6rem minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pr.team { box-shadow: inset 4px 0 0 var(--red); }
.pr .tbl { display: grid; gap: 4px; justify-items: center; font: 600 11px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pr .tbl b { font: 700 20px/1 var(--f-data); color: var(--ink); letter-spacing: 0; }
.pr .feat { font: italic 800 10px/1 var(--f-display); letter-spacing: .08em; color: var(--red); }
.pside { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pside.right { flex-direction: row-reverse; text-align: right; }
.pside .info { min-width: 0; display: grid; gap: 2px; }
.pside .plink { font: 600 18px/1.1 var(--f-display); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pside.right .plink { text-align: right; }
.pside small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pside small .r2 { font-family: var(--f-data); color: var(--ink); }
.pside.lost { opacity: .5; }
.pside .thumb { width: 40px; height: 40px; }
.pside .bthumb { display: none; }
.pscore { text-align: center; font: 700 22px/1 var(--f-data); }
.pscore.live { font: 600 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pr .bye { color: var(--muted); font-style: italic; }
@media (max-width: 680px) {
  .pr { grid-template-columns: 2.6rem minmax(0, 1fr) auto; grid-template-areas: "t a s" "t b s" "t x x"; row-gap: 8px; }
  .pr .tbl { grid-area: t; } .pr .pside:nth-of-type(1) { grid-area: a; } .pr .pscore { grid-area: s; } .pr .pside.right { grid-area: b; flex-direction: row; text-align: left; } .pr .pside.right .plink { text-align: left; } .pr .pimg { grid-area: x; justify-self: start; }
}

/* Top 8 race */
.race-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.race-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.race-chip b { font: 700 20px/1 var(--f-display); color: var(--ink); }
.st-chip { font: 700 11px/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 5px; white-space: nowrap; }
.st-chip.locked { background: var(--red); color: #fff; }
.st-chip.alive { background: rgba(255, 255, 255, .14); color: var(--ink); }
.st-chip.out { background: transparent; color: var(--muted); border: 1px solid var(--line); }
table.st tr.cutline td { border-bottom: 2px dashed var(--red); }
table.st tr.is-out td { opacity: .5; }
table.st tr.team td:first-child { box-shadow: inset 4px 0 0 var(--red); }

/* Matchups */
table.mx { border-collapse: separate; border-spacing: 3px; font-size: 13px; }
table.mx th { font: 600 12px/1.1 var(--f-display); letter-spacing: .02em; color: var(--muted); padding: 4px; text-align: center; vertical-align: bottom; max-width: 7rem; }
table.mx th.rowh { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 11rem; max-width: 14rem; }
table.mx th.rowh .deck { display: flex; align-items: center; gap: 8px; }
table.mx th.rowh .thumb { width: 28px; height: 28px; }
table.mx th.rowh b { font: 600 15px/1.1 var(--f-display); color: var(--ink); }
table.mx th.colh { height: 92px; }
table.mx th.colh span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 86px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-size: 13px; }
table.mx td { min-width: 3.6rem; height: 40px; text-align: center; border-radius: 6px; font: 600 12px/1.15 var(--f-data); cursor: pointer; background: rgba(255, 255, 255, .03); }
table.mx td small { display: block; font-weight: 400; opacity: .75; }
table.mx td.mirror { cursor: default; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 6px, transparent 6px 12px); color: var(--muted); }
table.mx td.empty { cursor: default; color: var(--line); }
table.mx td:focus-visible { outline: 2px solid var(--focus); }
table.mx td.sel { outline: 2px solid var(--ink); }
.mx-total { font-weight: 700; }
.mu-detail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.mu-detail h4 { margin: 0; font: italic 800 20px/1.1 var(--f-display); text-transform: uppercase; }
.mu-detail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.mu-detail li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mu-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 720px) { .mu-lists { grid-template-columns: minmax(0, 1fr); } }
.mu-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.mu-list h4 { margin: 0; font: italic 800 18px/1 var(--f-display); text-transform: uppercase; }
.mu-list ol { margin: 0; padding-left: 1.4rem; display: grid; gap: 6px; font-size: 14px; }
.mu-list ol b { font: 600 15px var(--f-display); letter-spacing: .02em; }
.mu-list .num2 { font-family: var(--f-data); color: var(--muted); font-size: 13px; }

/* Team */
.team-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
@media (max-width: 760px) { .team-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; }
.tcard .thumb { width: 56px; height: 56px; }
.tcard .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tcard .plink { font: italic 800 20px/1.05 var(--f-display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .rk { font: 700 14px var(--f-data); color: var(--red); white-space: nowrap; }
.tcard .meta { font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.tcard .meta .r2 { font-family: var(--f-data); color: var(--ink); }
.tcard .now { font-size: 13px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Season */
.season-events { display: grid; gap: 8px; }
.sev { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.sev b { font: 600 17px var(--f-display); letter-spacing: .02em; }
.sev .muted { color: var(--muted); font-size: 13px; }
.sev .spacer { margin-left: auto; }
.spark { display: block; }

/* Stream overlays (links) */
.overlays { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ovl { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; align-content: start; }
.ovl h4 { margin: 0; font: italic 800 19px/1 var(--f-display); text-transform: uppercase; }
.ovl p { margin: 0; font-size: 13px; color: var(--muted); }
.ovl code { font: 12px var(--f-data); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; user-select: all; }
.ovl .row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ovl a { color: var(--ink); font-size: 13px; }

/* Images modal */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: 600 13px/1 var(--f-body); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.shot-wrap { position: relative; }
.shot-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 11, .6); border-radius: 8px; font: italic 800 20px var(--f-display); text-transform: uppercase; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast button { background: var(--red); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font: italic 800 14px var(--f-display); text-transform: uppercase; cursor: pointer; }

/* Overlay mode (OBS browser source): transparent page, just the overlay */
body.overlay { background: transparent; }
body.overlay #app, body.overlay .modal, body.overlay .toast { display: none !important; }
#overlay { padding: 24px; display: grid; gap: 12px; color: #fff; }
.ov-card { background: rgba(10, 3, 5, .86); border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(6px); }
.ov-title { display: flex; align-items: center; gap: 12px; font: italic 800 22px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.ov-title img { height: 34px; width: auto; }
.ov-title small { font: 600 13px var(--f-body); color: #d9b9ba; text-transform: none; font-style: normal; letter-spacing: 0; margin-left: auto; }
.ov-list { display: grid; gap: 6px; margin-top: 10px; }
.ov-row { display: grid; grid-template-columns: 2.2rem 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ov-row .thumb { width: 38px; height: 38px; }
.ov-row .rk { font: 700 16px var(--f-data); color: var(--red); text-align: right; }
.ov-row b { font: 700 19px/1.05 var(--f-display); letter-spacing: .02em; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row span { font-size: 12px; color: #d9b9ba; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row .rec { font: 700 16px var(--f-data); }
.ov-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }
.ov-side { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ov-side.right { flex-direction: row-reverse; text-align: right; }
.ov-side .thumb { width: 84px; height: 84px; border-radius: 10px; }
.ov-side b { display: block; font: italic 800 30px/1 var(--f-display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-side span { display: block; font-size: 15px; color: #d9b9ba; }
.ov-side .r2 { font: 700 16px var(--f-data); color: #fff; }
.ov-mid { text-align: center; font: italic 800 34px/1 var(--f-display); color: var(--red); }
.ov-mid small { display: block; font: 600 12px var(--f-body); color: #d9b9ba; letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.ov-empty { font-size: 14px; color: #d9b9ba; }
.ov-side > div { min-width: 0; flex: 1; }
.ov-side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .ov-side .thumb { width: 56px; height: 56px; } .ov-side b { font-size: 22px; } .ov-mid { font-size: 26px; } }

/* Feature match banner (1920 × 1080 OBS canvas): tall at the ends, raking in to a thin centre strip.
   Every size is in --u (1/1920 of the width), so it scales with the browser source. */
#overlay.fm-mode { padding: 0; }
.fm { --u: calc(100vw / 1920); position: fixed; left: 0; right: 0; top: 0; height: calc(120 * var(--u)); color: #fff; }
.fm.bottom { top: auto; bottom: 0; }
.fm-shape { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(0, 0, 0, .45)); }
.fm.bottom .fm-shape { transform: scaleY(-1); }
.fm-side { position: absolute; top: 0; height: calc(116 * var(--u)); display: flex; align-items: center; gap: calc(12 * var(--u)); padding-inline: calc(14 * var(--u)) calc(8 * var(--u)); }
.fm.bottom .fm-side { top: auto; bottom: 0; }
.fm-side.left { left: 0; }
.fm-side.right { right: 0; flex-direction: row-reverse; text-align: right; padding-inline: calc(8 * var(--u)) calc(14 * var(--u)); }
.fm-art { position: relative; flex: none; width: calc(84 * var(--u)); height: calc(84 * var(--u)); border-radius: calc(10 * var(--u)); overflow: hidden; border: calc(2 * var(--u)) solid rgba(255, 255, 255, .25); background: #2a0a0c; }
.fm-art .fm-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.fm-strip { position: absolute; left: 0; right: 0; bottom: 0; height: calc(12 * var(--u)); background: #2a0a0c center / cover no-repeat; border-top: calc(2 * var(--u)) solid rgba(10, 3, 5, .9); }
.fm-info { flex: 1; min-width: 0; display: grid; gap: calc(4 * var(--u)); }
.fm-info b { font: italic 800 calc(30 * var(--u))/1 var(--f-display); text-transform: uppercase; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-deck { font: 600 calc(15 * var(--u))/1.15 var(--f-body); color: #e6cfd0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-rec { font: 700 calc(15 * var(--u))/1 var(--f-data); color: var(--red); }
.fm-pips { flex: none; display: flex; gap: calc(9 * var(--u)); }
.fm-side.right .fm-pips { flex-direction: row-reverse; }
.fm-pips i { width: calc(18 * var(--u)); height: calc(18 * var(--u)); border-radius: 50%; border: calc(3 * var(--u)) solid rgba(255, 255, 255, .5); box-sizing: border-box; }
.fm-pips i.on { background: var(--red); border-color: var(--red); box-shadow: 0 0 calc(10 * var(--u)) rgba(255, 20, 24, .7); }
.fm-mid { position: absolute; top: 0; height: calc(40 * var(--u)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: calc(12 * var(--u)); }
.fm.bottom .fm-mid { top: auto; bottom: 0; }
.fm-hp { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.fm-hp.right { justify-content: flex-end; }
.fm-hp b { font: 700 calc(30 * var(--u))/1 var(--f-data); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.fm-bsw { width: calc(30 * var(--u)); height: calc(16 * var(--u)); border-radius: calc(4 * var(--u)); background: #2a0a0c center / cover no-repeat; border: calc(2 * var(--u)) solid rgba(255, 255, 255, .3); }
.fm-round { text-align: center; font: italic 800 calc(16 * var(--u))/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.fm-round small { display: block; margin-top: calc(3 * var(--u)); font: 600 calc(11 * var(--u))/1 var(--f-body); letter-spacing: .1em; color: #d9b9ba; }
.fm-live { display: none; width: calc(8 * var(--u)); height: calc(8 * var(--u)); border-radius: 50%; margin-left: calc(6 * var(--u)); vertical-align: middle; background: #777; }
.fm-live[data-state="live"] { display: inline-block; background: #3fae5e; box-shadow: 0 0 calc(6 * var(--u)) #3fae5e; }
.fm-live[data-state="reconnecting"], .fm-live[data-state="stopped"] { display: inline-block; background: #e6b93a; }
.fm-hp.hit b { animation: fm-hit .6s ease-out; }
.fm-hp.low b { color: var(--red); }
@keyframes fm-hit { 0% { transform: scale(1.35); color: var(--red); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .fm-hp.hit b { animation: none; } }
.ovl.t30 { grid-column: 1 / -1; }
.ovl.t30 input[type="url"] { flex: 1 1 280px; min-width: 0; font: 14px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.t30-result { display: grid; gap: 6px; font-size: 13px; }
.t30-result p { margin: 0; }
.t30-result .ok { color: var(--com); }
.t30-result .ok b { color: var(--ink); }
.t30-result .err { color: var(--agg); }
.t30-result pre { max-height: 260px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 12px var(--f-data); white-space: pre-wrap; }
.t30-result summary { cursor: pointer; color: var(--muted); }
.overlays { margin-top: 12px; }
.fm-dmg { display: inline-flex; align-items: baseline; font-variant-numeric: tabular-nums; }
.fm-dmg b { font: 700 calc(30 * var(--u))/1 var(--f-data); display: inline-block; min-width: 0; }
.fm-dmg small { font: 600 calc(16 * var(--u))/1 var(--f-data); color: #d9b9ba; margin-left: calc(2 * var(--u)); }
.fm-hp.low .fm-dmg b, .fm-hp.low .fm-dmg small { color: var(--red); }

.fm-line { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.fm-side.right .fm-line { flex-direction: row-reverse; }
.fm-round { display: flex; align-items: baseline; justify-content: center; gap: calc(8 * var(--u)); }
.fm-round small { display: inline; margin-top: 0; }
.fm-mid { position: absolute; }
.fm-flash { position: absolute; inset: 0; display: grid; place-items: center; background: var(--red); color: #fff; font: italic 800 calc(26 * var(--u))/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; z-index: 2; clip-path: polygon(calc(18 * var(--u)) 0, calc(100% - 18 * var(--u)) 0, 100% 100%, 0 100%); }
.fm-flash.show { animation: fm-flash 4s ease-out forwards; }
@keyframes fm-flash { 0% { opacity: 0; transform: scaleY(.3); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fm-flash.show { animation: none; } }
.pr { grid-template-columns: 3.4rem minmax(0, 1fr) 4.6rem minmax(0, 1fr) auto; }
.pbtns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pr.live { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.pr .feat.on { background: var(--red); color: #fff; padding: 3px 5px; border-radius: 4px; }
.fp-now { margin: 0; font-size: 14px; }
.fp-now b { font-weight: 700; }
#feature-picker { display: grid; gap: 10px; }
#feature-picker select { max-width: 100%; }
@media (max-width: 680px) { .pbtns { grid-area: x; flex-direction: row; justify-self: start; } }
#feature-picker .row2 { display: grid; gap: 8px; }
#feature-picker .selectl { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; }
#feature-picker select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.ovl { min-width: 0; }
.overlays { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.team-cards { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.pilots { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.brand { min-width: 0; flex-wrap: wrap; }
.team-head { display: flex; align-items: center; gap: 14px; }
.team-head img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface); }
.team-head b { display: block; font: italic 800 26px/1.05 var(--f-display); text-transform: uppercase; }
.team-head span { font-size: 13px; color: var(--muted); }
.team-head a { color: var(--ink); }
.tcard .hri { font: 600 12px var(--f-data); color: var(--cun); }
#team-pick { max-width: min(24rem, calc(100vw - 110px)); min-width: 0; }
.hint a { color: var(--ink); }
.selectl { max-width: 100%; min-width: 0; flex-wrap: wrap; }
.selectl select, .selectl input { min-width: 0; max-width: min(24rem, calc(100vw - 110px)); text-overflow: ellipsis; }

/* Stream tab: swap sides and game wins for the match on stream */
.fp-show { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 12px 0 4px; padding: 12px; border: 1px solid var(--line, #333); border-radius: 8px; }
.fp-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fp-side:last-child { align-items: flex-end; text-align: right; }
.fp-side b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fp-pos { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .65; }
.fp-games { display: inline-flex; align-items: center; gap: 6px; }
.fp-games output { min-width: 1.4em; text-align: center; font-weight: 800; font-size: 18px; }
@media (max-width: 560px) { .fp-show { grid-template-columns: 1fr; } .fp-side:last-child { align-items: flex-start; text-align: left; } }

/* ---------- accounts and tournaments (js/account.js) ---------- */
.acct { display: flex; align-items: center; }
.acct-in svg { flex: none; }
.acct-menu { position: relative; }
.acct-me { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--f-body); cursor: pointer; max-width: 220px; }
.acct-me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-me img, .team-list img, .acct-av { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; }
.acct-av { display: inline-grid; place-items: center; background: var(--red); color: #fff; font: 800 14px/1 var(--f-display); }
.acct-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; display: grid; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.acct-pop[hidden] { display: none; }
.acct-pop button { text-align: left; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 500 14px/1.2 var(--f-body); cursor: pointer; }
.acct-pop button:hover, .acct-pop button:focus-visible { background: var(--surface); }

.hub { display: block; margin: 18px 0 0; }
.hub[hidden] { display: none; }
.hub h2 { margin: 0; font: italic 800 30px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: .01em; }
.hub h3 { margin: 0 0 8px; font: italic 800 19px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.hub p { margin: 8px 0; }
.hub-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 10px; background: var(--surface); }
.hub-strip > div:first-child { flex: 1 1 260px; }
.hub-strip-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 13px/1 var(--f-body); cursor: pointer; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.hub-card { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hub-title { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hub-login { max-width: 520px; margin: 24px auto; text-align: center; display: grid; justify-items: center; gap: 4px; }
.hub-logo { width: 160px; height: auto; margin-bottom: 8px; }
.hub-empty { padding: 28px 16px; text-align: center; border: 1.5px dashed var(--line); border-radius: 10px; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.t-card { display: grid; gap: 6px; text-align: left; padding: 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.t-card:hover, .t-card:focus-visible { border-color: var(--red); }
.t-card b { font: italic 800 20px/1.1 var(--f-display); text-transform: uppercase; }
.t-meta, .ev-meta { color: var(--muted); font-size: 13px; }
.t-role { justify-self: start; padding: 3px 8px; border-radius: 999px; font: 700 11px/1.2 var(--f-body); letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .08); color: var(--muted); white-space: nowrap; }
.t-role.owner { background: rgba(255, 20, 24, .16); color: #ff6b6e; }
.hub-form { display: grid; gap: 14px; max-width: 640px; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span { font: 600 13px/1.2 var(--f-body); color: var(--muted); }
.fld em { font-style: normal; color: var(--red); margin-left: 4px; }
.fld input, .fld select { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 15px/1.3 var(--f-body); }
.fld input:focus, .fld select:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.fld small { color: var(--muted); font-size: 13px; min-height: 1em; }
.fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.hub-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hint.err, .err { color: #ff6b6e; }
.ev-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.ev-box { display: block; align-self: start; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.copyline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.copyline code { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font: 12px/1.3 var(--f-mono); }
.copyline.inv small { flex-basis: 100%; color: var(--muted); }
.team-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.team-list li { display: flex; align-items: center; gap: 10px; }
.team-list .who { flex: 1; min-width: 0; display: grid; }
.team-list small { color: var(--muted); font-size: 12px; }
.danger { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger .linkbtn { color: #ff6b6e; }
/* Signed-in pages that aren't about the followed event hide the event view below */
body.on-hub-page #live, body.on-hub-page #replay, body.on-hub-page #tabs, body.on-hub-page #panels, body.on-hub-page .foot,
body.on-hub-page #evname, body.on-hub-page #notice, body.on-hub-page #drop, body.on-hub-page #share { display: none; }
body.on-hub-page header { align-items: center; }
@media (max-width: 560px) { .hub-card { padding: 16px; } .hub h2 { font-size: 24px; } }

/* ---------- Break screen overlay (?overlay=break): drawn at 1920 × 1080 and scaled to fit ---------- */
#overlay.brk-mode { padding: 0; }
.brk { position: fixed; left: 0; top: 0; width: 1920px; height: 1080px; transform: scale(var(--s, 1)); transform-origin: 0 0; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 700px at 85% 110%, rgba(255, 20, 24, .28), transparent 60%), radial-gradient(900px 600px at 0% 0%, rgba(255, 20, 24, .12), transparent 60%), #0a0a0b;
  display: grid; grid-template-rows: 150px 1fr 70px; padding: 0 90px; box-sizing: border-box; font-family: var(--f-body); }
.brk::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 46px, rgba(255, 255, 255, .018) 46px 48px); pointer-events: none; }
.brk-top { display: flex; align-items: center; gap: 36px; border-bottom: 3px solid var(--red); position: relative; }
.brk-top img { height: 86px; width: auto; }
.brk-ev { display: grid; gap: 6px; border-left: 3px solid var(--red); padding-left: 30px; min-width: 0; flex: 1; }
.brk-ev b { font: italic 800 46px/1 var(--f-display); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-ev small { font: 600 22px/1 var(--f-body); color: #d9b9ba; letter-spacing: .04em; }
.brk-back { font: italic 800 30px/1 var(--f-display); text-transform: uppercase; letter-spacing: .06em; padding: 14px 26px; background: var(--red); transform: skewX(-12deg); white-space: nowrap; }
.brk-stage { position: relative; min-height: 0; padding: 40px 0 24px; }
.brk-slide { height: 100%; display: grid; grid-template-rows: auto 1fr; gap: 28px; opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .45s ease; }
.brk-slide.in { opacity: 1; transform: none; }
.brk-h { display: flex; align-items: baseline; gap: 26px; }
.brk-h h1 { margin: 0; font: italic 800 78px/.9 var(--f-display); text-transform: uppercase; letter-spacing: .01em; }
.brk-h span { font: 600 26px/1 var(--f-body); color: #d9b9ba; }
.brk-body { min-height: 0; }
.brk-foot { display: flex; align-items: center; gap: 30px; position: relative; }
.brk-dots { display: flex; gap: 12px; }
.brk-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.brk-dots i.on { background: var(--red); }
.brk-bar { flex: 1; height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; }
.brk-bar i { display: block; height: 100%; width: 0; background: var(--red); }
@keyframes brk-bar { from { width: 0; } to { width: 100%; } }
.brk-empty { height: 100%; display: grid; place-content: center; text-align: center; gap: 16px; }
.brk-empty b { font: italic 800 110px/1 var(--f-display); text-transform: uppercase; }
.brk-empty span { font-size: 28px; color: #d9b9ba; }

.brk-art { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; background: #222; display: grid; place-items: center; font: 800 26px var(--f-display); color: #aaa; }
.brk-big { width: 300px; height: 300px; border-radius: 18px; object-fit: cover; flex: none; background: #222; display: grid; place-items: center; font: 800 80px var(--f-display); color: #aaa; box-shadow: 0 0 0 4px var(--red), 0 20px 60px rgba(0, 0, 0, .6); }
.brk-list { display: grid; gap: 10px; }
.brk-list.tight { gap: 8px; }
.brk-row { display: grid; grid-template-columns: 70px 72px minmax(0, 1fr) 170px 150px; gap: 26px; align-items: center; height: 82px; padding: 0 26px; background: rgba(255, 255, 255, .045); border-left: 5px solid transparent; }
.brk-list.tight .brk-row { height: 70px; }
.brk-list.tight .brk-art { width: 60px; height: 60px; }
.brk-row:first-child { border-left-color: var(--red); background: rgba(255, 20, 24, .12); }
.brk-row .rk { font: 700 34px var(--f-data); color: var(--red); text-align: right; }
.brk-row .nm { display: grid; gap: 4px; min-width: 0; }
.brk-row .nm b { font: italic 800 36px/1 var(--f-display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-row .nm span { font-size: 21px; color: #d9b9ba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-row .rec { font: 700 32px var(--f-data); text-align: right; }
.brk-row .pts { font: 700 32px var(--f-data); text-align: right; color: #fff; }
.brk-row .pts small { font: 600 16px var(--f-body); color: #d9b9ba; margin-left: 6px; }
.brk-row.deck .bar { display: block; height: 12px; background: rgba(255, 255, 255, .08); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.brk-row.deck .bar i { display: block; height: 100%; background: var(--red); border-radius: 6px; }
.brk-row.cut { box-shadow: inset 0 -3px 0 var(--red); }
.brk-row .st { font: 700 18px var(--f-body); text-transform: uppercase; letter-spacing: .08em; text-align: center; padding: 8px 0; border-radius: 6px; }
.brk-row .st.locked { background: #1f7a3a; } .brk-row .st.alive { background: #8a6d12; } .brk-row .st.out { background: #3a3a40; color: #aaa; }
.brk-race .brk-stats { display: flex; gap: 20px; margin-bottom: 20px; }
.brk-stats > div { flex: 1; display: flex; align-items: baseline; gap: 16px; padding: 14px 26px; background: rgba(255, 255, 255, .045); border-top: 5px solid #3a3a40; }
.brk-stats > .locked { border-top-color: #2fb35a; } .brk-stats > .alive { border-top-color: #e0b022; }
.brk-stats b { font: italic 800 60px/1 var(--f-display); }
.brk-stats span { font: 600 24px var(--f-body); color: #d9b9ba; text-transform: uppercase; letter-spacing: .06em; }

.brk-upnext { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 40px; }
.brk-p { display: flex; align-items: center; gap: 40px; min-width: 0; }
.brk-p.r { flex-direction: row-reverse; text-align: right; }
.brk-p > div { display: grid; gap: 12px; min-width: 0; }
.brk-p b { font: italic 800 64px/1 var(--f-display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-p span { font-size: 28px; color: #d9b9ba; }
.brk-p em { font: 700 30px var(--f-data); font-style: normal; }
.brk-vs { font: italic 800 120px/1 var(--f-display); color: var(--red); }

.brk-fit { height: 100%; display: grid; place-items: start center; overflow: hidden; }
.brk-fit .bracket { transform-origin: top center; width: 1500px; }

.brk-recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 40px; align-items: start; }
.brk-col h3 { margin: 0 0 18px; font: italic 800 34px/1 var(--f-display); text-transform: uppercase; color: var(--red); letter-spacing: .03em; }
.brk-col { display: grid; gap: 12px; align-content: start; }
.brk-mini { display: flex; align-items: center; gap: 18px; padding: 12px 18px; background: rgba(255, 255, 255, .045); min-width: 0; }
.brk-mini > div { display: grid; gap: 4px; min-width: 0; }
.brk-mini b { font: italic 800 30px/1 var(--f-display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brk-mini span { font-size: 20px; color: #d9b9ba; }
.brk-mini.up { border-left: 5px solid var(--red); padding: 18px 22px; }
.brk-mini.big { flex-direction: column; align-items: flex-start; background: none; padding: 0; }
.brk-mini.big .brk-big { width: 260px; height: 260px; }

.brk-asp { height: 100%; display: grid; grid-template-columns: repeat(6, 1fr); gap: 34px; align-items: end; }
.brk-asp > div { display: grid; grid-template-rows: 1fr auto auto; gap: 12px; height: 100%; text-align: center; }
.brk-asp .bar { position: relative; background: rgba(255, 255, 255, .05); border-radius: 10px 10px 0 0; overflow: hidden; }
.brk-asp .bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--asp, var(--red)); }
.brk-asp b { font: italic 800 64px/1 var(--f-display); }
.brk-asp > div > span:last-child { font: 700 24px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: #d9b9ba; }
.brk-asp .ba-vigilance { --asp: var(--vig); } .brk-asp .ba-command { --asp: var(--com); } .brk-asp .ba-aggression { --asp: var(--agg); }
.brk-asp .ba-cunning { --asp: var(--cun); } .brk-asp .ba-heroism { --asp: var(--her); } .brk-asp .ba-villainy { --asp: #6b6b75; }
.brk-pick { display: grid; gap: 6px; margin: 10px 0; }
.brk-pick .switch > span:last-child { display: grid; }
.brk-pick small { color: var(--muted); font-size: 12px; }
.sec-fld { max-width: 180px; }

/* Program link: fade between scenes; one-slide and holding-card scenes */
#overlay { transition: opacity .35s ease; }
#overlay.ov-out { opacity: 0; }
.brk.static .brk-foot { visibility: hidden; }
.brk.static .brk-back { visibility: hidden; }
.brk-hold { height: 100%; display: grid; place-content: center; justify-items: center; gap: 30px; text-align: center; }
.brk-hold b { font: italic 800 170px/.9 var(--f-display); text-transform: uppercase; letter-spacing: .01em; text-shadow: 0 10px 60px rgba(255, 20, 24, .35); }
/* Champion card */
.brk-champ { height: 100%; display: flex; align-items: center; justify-content: center; gap: 90px; }
.ch-txt { display: grid; justify-items: start; gap: 18px; max-width: 900px; }
.ch-trophy { font-size: 110px; line-height: 1; filter: drop-shadow(0 10px 40px rgba(255, 200, 40, .45)); }
.ch-txt b { font: italic 800 150px/.92 var(--f-display); text-transform: uppercase; letter-spacing: .01em; text-shadow: 0 10px 60px rgba(255, 20, 24, .35); overflow-wrap: anywhere; }
.ch-rec { font: 700 96px/1 var(--f-data); color: var(--red); font-variant-numeric: tabular-nums; }
.ch-deck { font: 700 44px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.ch-seed { font: 600 28px var(--f-body); color: #bbb; }
.ch-cards { display: flex; flex-direction: column; gap: 26px; align-items: center; }
.ch-card { margin: 0; display: grid; gap: 8px; justify-items: center; }
.ch-card figcaption { justify-self: stretch; font: 700 18px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: #d9b9ba; }
.ch-card img { max-height: 360px; max-width: 510px; border-radius: 16px; box-shadow: 0 0 0 4px var(--red), 0 20px 60px rgba(0, 0, 0, .6); }
.ch-card .fs-ph { width: 510px; height: 360px; }
.lc-btn:disabled { opacity: .45; cursor: not-allowed; }
.brk-hold .cd { font: 700 110px/1 var(--f-data); color: var(--red); min-height: 1em; font-variant-numeric: tabular-nums; }

/* Live control (tournament page) */
.live-ctl { margin-bottom: 14px; border-color: rgba(255, 20, 24, .45); }
.lc-onair { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--f-body); color: var(--muted); }
.lc-onair b { color: var(--ink); }
.lc-onair i { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 20, 24, .7); animation: lc-pulse 1.6s infinite; }
@keyframes lc-pulse { 70% { box-shadow: 0 0 0 8px rgba(255, 20, 24, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 20, 24, 0); } }
.lc-conn { margin-left: auto; font: 600 12px var(--f-body); color: var(--muted); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }
.lc-conn.ok { color: #6fdc8c; border-color: rgba(111, 220, 140, .4); }
.lc-main { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.lc-main.no-prev { grid-template-columns: 1fr; }
.lc-prev { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #1b1d22 0 14px, #17191d 14px 28px); }
.lc-cam { position: absolute; inset: 0; display: grid; place-items: center; font: italic 800 22px var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .12); pointer-events: none; }
.lc-slot { position: absolute; inset: 0; z-index: 1; }
.lc-slot iframe { width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; background: transparent; }
.lc-groups { display: grid; gap: 12px; }
.lc-group h4 { margin: 0 0 6px; font: 700 11px var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lc-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lc-btn { display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 14px/1.1 var(--f-body); cursor: pointer; min-height: 44px; }
.lc-btn small { font: 500 11px var(--f-body); color: var(--muted); }
.lc-btn:hover { border-color: var(--ink); }
.lc-btn[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.lc-btn[aria-pressed="true"] small { color: rgba(255, 255, 255, .8); }
.lc-timer { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--f-body); color: var(--muted); }
.lc-timer select { padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
@media (max-width: 760px) { .lc-main { grid-template-columns: 1fr; } }
.brk-hold, .brk-empty { grid-row: 1 / -1; align-self: stretch; }

/* Minimise arrows on the tournament page and Stream tab boxes */
.fold-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.fold-h { display: inline-flex; align-items: center; gap: 10px; padding: 2px 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.fold-h h3, .fold-h h4 { margin: 0; }
.fold-h small { font: 600 12px var(--f-body); color: var(--muted); padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.fold-h:hover .fold-chev, .fold-h:focus-visible .fold-chev { border-color: var(--ink); }
.fold-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; flex: none; }
.folded .fold-chev { transform: rotate(-45deg); }
.fold-b { margin-top: 12px; }
.fold.folded > .fold-b { display: none; }
.ev-box.fold, .ovl.fold { align-self: start; }
.live-ctl .fold-top { margin-bottom: 0; }
.ev-sub { margin: 14px 0 6px; font: 700 11px var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ev-sub:first-child { margin-top: 0; }
.lc-more { margin: 4px 0 0; }
.ev-head { margin-bottom: 16px; }
.ovl > .fold-b { display: grid; gap: 8px; margin-top: 4px; }
.ovl > .fold-b > .overlays { margin-top: 4px; }
.lc-replay { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: rgba(230, 185, 58, .12); border: 1px solid rgba(230, 185, 58, .5); font-size: 14px; }
.lc-replay[hidden] { display: none; }
.lc-replay span { flex: 1 1 260px; }
.live-ctl > .fold-b > .switch { margin-top: 6px; }

/* ---------- Feature match: side panels (default layout) ---------- */
.fs { --u: calc(100vw / 1920); position: fixed; inset: 0; color: #fff; pointer-events: none; }
.fs-col { position: absolute; top: 0; bottom: 0; box-sizing: border-box; display: flex; flex-direction: column; gap: calc(14 * var(--u)); padding: calc(20 * var(--u)) calc(22 * var(--u)) calc(22 * var(--u));
  background: linear-gradient(180deg, rgba(14, 4, 6, .97), rgba(8, 2, 4, .97)); overflow: hidden; }
.fs-col::after { content: ''; position: absolute; top: 0; bottom: 0; width: calc(4 * var(--u)); background: var(--red); box-shadow: 0 0 calc(18 * var(--u)) rgba(255, 20, 24, .55); }
.fs-col.left::after { right: 0; } .fs-col.right::after { left: 0; }
.fs-col.right { text-align: right; }
.fs-name { display: grid; gap: calc(8 * var(--u)); padding-bottom: calc(12 * var(--u)); border-bottom: calc(2 * var(--u)) solid rgba(255, 255, 255, .12); }
.fs-name b { font: italic 800 calc(42 * var(--u))/1 var(--f-display); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-line { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--u)); font: 700 calc(22 * var(--u))/1 var(--f-data); color: #d9b9ba; }
.fs-col.right .fs-line { flex-direction: row-reverse; }
.fs .fm-pips i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.fs-cam { flex: none; aspect-ratio: 16 / 9; border: calc(2 * var(--u)) solid rgba(255, 255, 255, .3); border-radius: calc(10 * var(--u)); background: transparent; }
/* With a player camera window, the panel is drawn around the window so the camera behind it shows through */
.fs.cams .fs-col { background: none; }
.fs.cams .fs-cam { box-shadow: 0 0 0 calc(1600 * var(--u)) rgba(10, 3, 5, .97); }
.fs.cams .fs-col > :not(.fs-cam) { position: relative; z-index: 1; }
.fs-cards { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: calc(12 * var(--u)); }
.fs-card { flex: 1; min-height: 0; margin: 0; display: flex; flex-direction: column; gap: calc(6 * var(--u)); align-items: center; }
.fs-card figcaption { align-self: stretch; font: 700 calc(15 * var(--u))/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: #d9b9ba; }
.fs-card img { flex: 1 1 auto; min-height: 0; max-width: 100%; width: auto; object-fit: contain; border-radius: calc(12 * var(--u)); box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(0, 0, 0, .6); }
.fs-ph { flex: 1; align-self: stretch; display: grid; place-items: center; padding: calc(12 * var(--u)); border-radius: calc(12 * var(--u)); background: rgba(255, 255, 255, .05); font: italic 800 calc(24 * var(--u))/1.1 var(--f-display); text-transform: uppercase; text-align: center; color: #d9b9ba; }
.fs-hp { flex: none; display: grid; justify-items: center; gap: calc(4 * var(--u)); padding: calc(10 * var(--u)) 0 calc(4 * var(--u)); border-top: calc(2 * var(--u)) solid rgba(255, 255, 255, .12); }
.fs-hp .fm-dmg b { font: italic 800 calc(88 * var(--u))/.9 var(--f-display); min-width: 2ch; text-align: right; }
.fs-hp .fm-dmg small { font: italic 800 calc(46 * var(--u))/1 var(--f-display); margin-left: calc(4 * var(--u)); }
.fs-hp-l { font: 700 calc(14 * var(--u))/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: #d9b9ba; }
.fs-top, .fs-bottom { position: absolute; display: flex; justify-content: center; }
.fs-top { top: 0; }
.fs-bottom { bottom: 0; }
.fs-plate { position: relative; display: inline-flex; align-items: center; gap: calc(14 * var(--u)); padding: calc(10 * var(--u)) calc(40 * var(--u)) calc(12 * var(--u)); background: rgba(10, 3, 5, .94);
  font: italic 800 calc(28 * var(--u))/1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; border-bottom: calc(3 * var(--u)) solid var(--red);
  clip-path: polygon(0 0, 100% 0, calc(100% - 22 * var(--u)) 100%, calc(22 * var(--u)) 100%); }
.fs-plate > i:not(.fm-live) { width: calc(6 * var(--u)); height: calc(6 * var(--u)); background: var(--red); transform: rotate(45deg); }
.fs-bottom .fs-plate { border-bottom: 0; border-top: calc(3 * var(--u)) solid var(--red); font-size: calc(20 * var(--u)); padding: calc(10 * var(--u)) calc(36 * var(--u));
  clip-path: polygon(calc(22 * var(--u)) 0, calc(100% - 22 * var(--u)) 0, 100% 100%, 0 100%); }
.fs-clock { font: 700 calc(28 * var(--u))/1 var(--f-data); font-style: normal; font-variant-numeric: tabular-nums; padding-left: calc(14 * var(--u)); border-left: calc(2 * var(--u)) solid rgba(255, 255, 255, .2); }
.fs-clock.low { color: #e6b93a; }
.fs-clock.over { color: var(--red); }
.fs-top .fm-flash { top: 100%; bottom: auto; inset-inline: calc(20% ); height: calc(52 * var(--u)); }
.fs-cards { justify-content: center; gap: calc(26 * var(--u)); }
.fs-card { flex: 0 1 auto; }
.fs-card img { flex: none; max-height: calc(300 * var(--u)); }
.fs.cams .fs-card img { max-height: calc(196 * var(--u)); }
.fs.cams .fs-cards { gap: calc(14 * var(--u)); }
.fs-card figcaption { text-align: center; }

/* Logos: upload box and overlays */
.logo-slots { display: grid; gap: 12px; }
.logo-slot { display: flex; gap: 14px; align-items: center; }
.logo-prev { width: 150px; height: 84px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); padding: 8px; box-sizing: border-box;
  background: repeating-conic-gradient(#202227 0 25%, #18191d 0 50%) 0 0 / 16px 16px; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-prev span { font-size: 12px; color: var(--muted); }
.logo-info { display: grid; gap: 4px; min-width: 0; }
.logo-info small { color: var(--muted); font-size: 12px; }
.logo-btns { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.logo-up { cursor: pointer; }
.fs-logo-row { flex: none; height: calc(84 * var(--u)); display: flex; align-items: center; justify-content: center; padding-top: calc(10 * var(--u)); border-top: calc(2 * var(--u)) solid rgba(255, 255, 255, .12); }
.fs-logo { max-height: 100%; max-width: 100%; object-fit: contain; }
.fs.cams .fs-logo-row { height: calc(64 * var(--u)); }
.brk-logos { display: flex; gap: 28px; align-items: center; }
.brk-logo { height: 50px; max-width: 260px; object-fit: contain; }
.brk-hold-logos { display: flex; gap: 70px; align-items: center; justify-content: center; margin-top: 30px; }
.brk-hold-logo { height: 130px; max-width: 460px; object-fit: contain; }
.fs-col.with-logo .fs-card img { max-height: calc(262 * var(--u)); }
.fs.cams .fs-col.with-logo .fs-card img { max-height: calc(160 * var(--u)); }
.fs-ph { flex: none; width: 100%; aspect-ratio: 520 / 372; max-height: calc(262 * var(--u)); box-sizing: border-box; }

/* Base damage plate in the base's colour */
.fs-hp { --bc: #4a4a52; --ink-on: #fff; margin: 0 calc(-6 * var(--u)); padding: calc(12 * var(--u)) 0 calc(10 * var(--u)); border-top: 0; border-radius: calc(12 * var(--u));
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .38)), var(--bc);
  box-shadow: 0 0 calc(24 * var(--u)) var(--bc), inset 0 0 0 calc(2 * var(--u)) rgba(255, 255, 255, .18); color: var(--ink-on); }
.fs-hp.tone-vigilance { --bc: #3f7fd6; }
.fs-hp.tone-command { --bc: #2f9a4f; }
.fs-hp.tone-aggression { --bc: #d8452a; }
.fs-hp.tone-cunning { --bc: #e6b93a; --ink-on: #1a1206; }
.fs-hp .fm-dmg b, .fs-hp .fm-dmg small, .fs-hp .fs-hp-l { color: var(--ink-on); }
.fs-hp .fm-dmg small, .fs-hp .fs-hp-l { opacity: .78; }
.fs-hp .fm-dmg b { text-shadow: 0 calc(3 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, .35); }
.fs-hp.tone-cunning .fm-dmg b { text-shadow: none; }
/* Close to defeat: the plate pulses instead of turning the numbers red (they'd vanish on a red base) */
.fs-hp.low .fm-dmg b, .fs-hp.low .fm-dmg small { color: var(--ink-on); }
.fs-hp.low { animation: fs-low 1.2s ease-in-out infinite; }
@keyframes fs-low { 50% { box-shadow: 0 0 calc(44 * var(--u)) var(--bc), inset 0 0 0 calc(5 * var(--u)) #fff; } }
@media (prefers-reduced-motion: reduce) { .fs-hp.low { animation: none; box-shadow: inset 0 0 0 calc(5 * var(--u)) #fff; } }
.fs-logo-row { gap: calc(18 * var(--u)); }
.fs-logo-row .fs-logo { max-width: calc(50% - 9 * var(--u)); }
.fs-col.left .fs-logo-row { border-top-color: rgba(255, 255, 255, .12); }
.fs-plate .fs-clock { padding-left: 0; border-left: 0; font-size: calc(32 * var(--u)); }
.fs-clock.idle { opacity: .6; }

/* Feature match box: Match / Decks tabs and hand-picked decks */
.fp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.fp-tabs button { padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 700 14px var(--f-body); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.fp-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.fp-badge { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/18px var(--f-body); text-align: center; }
.dk-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.3fr) minmax(160px, 1.1fr) auto; gap: 10px 12px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dk-who { display: flex; gap: 10px; align-items: center; min-width: 0; align-self: center; }
.dk-who > div { display: grid; min-width: 0; }
.dk-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-who small { color: var(--muted); font-size: 12px; }
.dk-who small.warn { color: #e6b93a; }
.dk-btns { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }
.dk-list { margin-top: 10px; font-size: 13px; color: var(--muted); }
.dk-list summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.dk-list ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
@media (max-width: 760px) { .dk-row { grid-template-columns: 1fr; } }

/* Event format choice (Premier / Limited) */
.fmt-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.fmt-pick button { display: grid; gap: 6px; text-align: left; padding: 14px 16px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.fmt-pick button b { font: italic 800 22px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.fmt-pick button small { font-size: 13px; line-height: 1.4; color: var(--muted); }
.fmt-pick button:hover { border-color: var(--ink); }
.fmt-pick button[aria-checked="true"] { border-color: var(--red); background: rgba(255, 20, 24, .08); box-shadow: inset 0 0 0 1px var(--red); }

/* Live data only through a tournament: no free "follow any event" box, no passcode unlock */
#melee-url, #follow, #unfollow, #recent { display: none !important; }
#organiser .org-row:first-of-type, #organiser .org-body > p:first-child { display: none; }

/* Wallpaper behind the full-screen scenes */
.brk.has-wall { background: linear-gradient(rgba(10, 10, 11, var(--dim, .55)), rgba(10, 10, 11, var(--dim, .55))), var(--wall) center / cover no-repeat, #0a0a0b; }
.brk.has-wall::before { opacity: .5; }
.wall-slot { align-items: flex-start; flex-wrap: wrap; }
.wall-prev { position: relative; width: 240px; height: 135px; padding: 0; overflow: hidden; }
.wall-prev img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.wall-prev .wall-dim { position: absolute; inset: 0; background: rgba(10, 10, 11, var(--dim, .55)); pointer-events: none; }
.wall-prev span { position: relative; z-index: 1; text-align: center; padding: 8px; }
.wall-dim-fld { margin-top: 8px; max-width: 280px; }
.wall-dim-fld input { padding: 0; accent-color: var(--red); }
/* Bigger logos on the starting/back soon cards */
.brk-hold-logos { gap: 120px; margin-top: 50px; }
.brk-hold-logo { height: 240px; max-width: 680px; }
/* Holding cards: logos pinned to the bottom corners */
.brk-hold { position: relative; }
.brk-hold-logo { position: absolute; bottom: 0; height: 200px; max-width: 560px; object-fit: contain; }
.brk-hold-logo.left { left: 0; object-position: left bottom; }
.brk-hold-logo.right { right: 0; object-position: right bottom; }
/* Holding cards: larger corner logos. They use the (hidden) footer strip too, and the title/countdown move up a little to make room */
.brk.hold .brk-hold { padding-bottom: 130px; box-sizing: border-box; }
.brk-hold-logo { height: 290px; max-width: 640px; bottom: -56px; }
.brk-hold .cd.done { font: italic 800 84px/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
