:root {
  --bg: #f3f4f7;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f6f7f9;
  --ink: #12161c;
  --ink-2: #4a5361;
  --ink-3: #7c8594;
  --line: #d9dde4;
  --line-2: #e8ebf0;
  --accent: #e8480f;
  --accent-ink: #ffffff;
  --accent-soft: #fff0e9;
  --home: #0f7b4f;
  --home-soft: #e3f5ec;
  --live: #e11d48;
  --gold: #b7791f;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e13;
    --bg-2: #11151c;
    --card: #161b23;
    --card-2: #1c222c;
    --ink: #eef1f5;
    --ink-2: #aab3c0;
    --ink-3: #7a8494;
    --line: #2a313d;
    --line-2: #222833;
    --accent: #ff6a2b;
    --accent-ink: #160800;
    --accent-soft: #2b1710;
    --home: #34d399;
    --home-soft: #0f2a20;
    --live: #fb4b6e;
    --gold: #f2c14e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e13; --bg-2: #11151c; --card: #161b23; --card-2: #1c222c;
  --ink: #eef1f5; --ink-2: #aab3c0; --ink-3: #7a8494; --line: #2a313d; --line-2: #222833;
  --accent: #ff6a2b; --accent-ink: #160800; --accent-soft: #2b1710;
  --home: #34d399; --home-soft: #0f2a20; --live: #fb4b6e; --gold: #f2c14e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
img { display: block; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1560px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

/* Header ------------------------------------------------------------------ */
.top { background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); position: relative; flex: none;
  background-image:
    linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)),
    linear-gradient(var(--accent-ink), var(--accent-ink)), linear-gradient(var(--accent-ink), var(--accent-ink)),
    linear-gradient(var(--accent-ink), var(--accent-ink));
  background-size: 9px 2.5px, 9px 2.5px, 2.5px 11.5px, 7px 2.5px, 0 0;
  background-position: 6px 8px, 6px 19.5px, 14.5px 8px, 16px 14px, 0 0;
  background-repeat: no-repeat;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt strong { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 19px; letter-spacing: .3px; text-transform: uppercase; }
.brand-txt small { color: var(--ink-3); font-size: 12px; }
.tabs { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none;
  font-family: Oswald, Inter, sans-serif; font-weight: 600; font-size: 16px; letter-spacing: .5px;
}
.tab:hover { background: var(--card-2); color: var(--ink); }
.tab.on { background: var(--ink); color: var(--bg); }
.tab small { font-family: Inter, sans-serif; font-size: 10px; font-weight: 600; text-transform: uppercase; opacity: .6; letter-spacing: .3px; }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }
.icon-btn { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Status + games ------------------------------------------------------------ */
.status { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 16px 0 8px; }
.phase { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 13px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .3px; }
.chip.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.live { color: var(--live); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.chip.sync i { background: var(--accent); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

.games { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; }
.g { flex: none; min-width: 112px; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px; font-size: 12px; }
.g-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.g-row span { flex: 1; font-weight: 600; }
.g-row.w { color: var(--ink); }
.g-row.w b { color: var(--ink); }
.g-row b { font-weight: 700; color: var(--ink-2); }
.g-st { margin-top: 3px; color: var(--ink-3); font-size: 11px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.g.live { border-color: color-mix(in srgb, var(--live) 45%, var(--line)); }
.g.live .g-st { color: var(--live); font-weight: 600; }
.g-st i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; }

/* Controls ------------------------------------------------------------------ */
.controls { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 12px 0 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.ctl-main { display: flex; gap: 8px; flex-wrap: wrap; }
.controls .hint { margin: 0; flex: 1 1 260px; color: var(--ink-2); }
.controls .hint b { color: var(--accent); }
.ctl-sub { display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; width: 100%; font-size: 12.5px; }
.view-toggle { display: none; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.view-toggle button { border: 0; background: none; padding: 0 12px; height: 34px; font-weight: 700; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.legend .hm, .legend .lk { display: inline-flex; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; font-size: 13.5px;
}
.btn:hover:not([disabled]) { border-color: var(--ink-3); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover:not([disabled]) { filter: brightness(1.06); border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.ghost { background: none; }
.btn.primary span { white-space: nowrap; }

/* Matchup cards ------------------------------------------------------------- */
.m { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; z-index: 1; }
.m.spacer { visibility: hidden; }
.m-head { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px 4px; font-size: 10.5px; color: var(--ink-3); border-bottom: 1px solid var(--line-2); background: var(--card-2); white-space: nowrap; }
.m-head .rd { font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; }
.m-head .fmt { overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
.m-foot { padding: 3px 10px 5px; font-size: 10.5px; color: var(--ink-3); border-top: 1px solid var(--line-2); }

.t {
  display: flex; align-items: center; gap: 7px;
  width: 100%; min-height: 36px; padding: 5px 10px 5px 8px; border: 0; background: none; text-align: left;
  border-left: 3px solid transparent; transition: opacity .25s, background-color .25s;
}
.t > * { flex: none; }
.t .nm { flex: 1 1 auto; min-width: 0; }
.t + .t { border-top: 1px solid var(--line-2); }
button.t { cursor: pointer; }
button.t:hover { background: var(--card-2); }
button.t:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.t .seed { font-weight: 700; color: var(--ink-3); font-size: 12px; text-align: center; width: 26px; }
.t .logo { width: 22px; height: 22px; object-fit: contain; }
.t .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.t .nm .ab { display: none; }
.t .rec { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.t .rec.sc { font-size: 15px; font-weight: 800; color: var(--ink); min-width: 14px; text-align: right; display: inline-block; }
.tree .t .rec.sc { display: inline-block !important; }
.t .rec.sc.tick { animation: tick .32s ease-out; color: var(--accent); }
@keyframes tick { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }
.t .lk { color: var(--accent); display: inline-flex; }
.t .lk svg, .legend .lk svg { width: 12px; height: 12px; }
.t.locked { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent 75%); }

/* Simulation reveal */
.m.playing { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent), var(--shadow); }
.m.playing .t { opacity: 1 !important; }
.m.enter .t { animation: slide-in .32s cubic-bezier(.2, .8, .2, 1) both; }
.m.enter .t + .t { animation-delay: .06s; }
.col.rtl .m.enter .t { animation-name: slide-in-r; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes slide-in-r { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.m.decided .t.win { animation: win-pop .5s ease-out; }
@keyframes win-pop { 0% { background-color: color-mix(in srgb, var(--accent) 30%, transparent); } 100% { background-color: transparent; } }
.m.decided .t.lose { animation: lose-fade .5s ease-out; }
@keyframes lose-fade { from { opacity: 1; } to { opacity: .45; } }
body.simming .t { cursor: default; }
.champ-team.crowned img { animation: crown .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.champ-team.crowned strong { animation: slide-in .5s .15s ease-out both; }
@keyframes crown { from { transform: scale(.2) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.t .hm { display: inline-flex; align-items: center; gap: 3px; color: var(--home); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; min-width: 14px; }
.hm svg { width: 13px; height: 13px; }
.t.home { background: linear-gradient(90deg, var(--home-soft), transparent 70%); }
.t.lose { opacity: .45; }
.t.win .nm { font-weight: 800; }
.t.tbd { color: var(--ink-3); font-style: italic; font-size: 12.5px; }
.t.tbd .nm { font-weight: 500; }
.m.bye .byelbl { padding: 4px 10px 6px; font-size: 11px; color: var(--ink-3); border-top: 1px solid var(--line-2); text-transform: uppercase; letter-spacing: .3px; font-weight: 600; }

.tb { font-size: 9px; font-weight: 800; letter-spacing: .4px; padding: 1px 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); cursor: help; flex: none; }
.cl { font-size: 10px; font-weight: 800; color: var(--home); flex: none; }
.aq { font-size: 9px; font-weight: 800; letter-spacing: .4px; padding: 1px 4px; border-radius: 4px; background: var(--home-soft); color: var(--home); flex: none; cursor: help; }
.mv { font-size: 10px; font-weight: 800; flex: none; }
.mv.up { color: var(--home); }
.mv.down { color: var(--live); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.6s infinite; cursor: help; }

/* Prelims (Play-In / Wild Card) ------------------------------------------- */
.prelims-wrap { margin: 22px 0 0; }
.prelims-wrap summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 4px 0 10px; }
.prelims-wrap summary::-webkit-details-marker { display: none; }
.prelims-wrap summary::before { content: "▸"; color: var(--accent); font-size: 14px; transition: transform .15s; display: inline-block; }
.prelims-wrap[open] summary::before { transform: rotate(90deg); }
.prelims-wrap summary span { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; }
.prelims-wrap summary small { color: var(--ink-3); font-size: 12px; }
.prelims { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.prelim { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 12px; padding: 8px 10px 10px; }
.prelim h3 { font-size: 13px !important; }
.prelim .note { margin: 0 0 6px !important; font-size: 11px !important; }
.prelim .m-head { padding: 2px 8px; font-size: 10px; }
.prelim .t { min-height: 30px; padding-top: 3px; padding-bottom: 3px; }
.prelim .t .nm .full { display: none; }
.prelim .t .nm .ab { display: inline; }
.prelim h3, .bubble h3 { margin: 0; font-family: Oswald, Inter, sans-serif; font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.prelim .note, .bubble .note { margin: 2px 0 10px; color: var(--ink-3); font-size: 12px; }
.prelim-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

/* Bracket tree (desktop) ----------------------------------------------------- */
.tree-wrap { overflow-x: auto; padding-bottom: 8px; position: relative; }
.tree-size { position: relative; }
.tree { transform-origin: 0 0; }
.fit-btn { display: none; }
.tree {
  position: relative; display: grid; min-width: 1150px;
  grid-template-columns: repeat(3, minmax(148px, 1fr)) minmax(210px, 1.1fr) repeat(3, minmax(148px, 1fr));
  column-gap: 16px; min-height: 600px;
}
/* Inside the tree the column header carries round + format, so cards stay compact. */
.tree .m-head { display: none; }
.tree .m-head:has(.rd) { display: flex; }
.tree .m-head .fmt { display: none; }
.tree .t { gap: 5px; padding: 5px 8px 5px 5px; }
.tree .t .seed { width: 18px; }
.tree .t .logo { width: 20px; height: 20px; }
.tree .t .hm span { display: none; }
.champ .m-head { display: flex !important; }
.champ .m-head .fmt { display: block !important; }
.col { display: flex; flex-direction: column; min-width: 0; }
.col-h { font-family: Oswald, Inter, sans-serif; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); padding: 0 2px 10px; white-space: nowrap; }
.col-h div { overflow: hidden; text-overflow: ellipsis; }
.col-h small { white-space: normal; line-height: 1.3; }
.col-h small { display: block; font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.col-h span { color: var(--accent); }
.col.rtl .col-h { text-align: right; }
.col-b { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.col.center { justify-content: center; }
.lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.lines path { fill: none; stroke: var(--line); stroke-width: 1.5; }

.champ { display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.trophy { color: var(--gold); margin: 0 auto; width: 40px; height: 40px; }
.trophy svg { width: 100%; height: 100%; }
.champ-name { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .6px; }
.champ .m { text-align: left; border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.champ-team { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; text-align: left; }
.champ-team img { width: 56px; height: 56px; object-fit: contain; }
.champ-team small { display: block; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.champ-team strong { font-family: Oswald, Inter, sans-serif; font-size: 20px; font-weight: 600; line-height: 1.15; }

/* Stacked bracket (mobile) ------------------------------------------------- */
.stack { display: none; }
.stack-side { margin-bottom: 28px; }
.stack-side h2 { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 6px; }
.stack-side h4 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.stack-round { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.stack-side.final .champ { max-width: 420px; margin: 0 auto; }

/* Title odds ----------------------------------------------------------------- */
.odds { margin: 32px 0 8px; }
.odds h2 { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; margin: 0; }
.odds .note { margin: 2px 0 10px; color: var(--ink-3); font-size: 12px; max-width: 760px; }
.odds-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.odds table { width: 100%; border-collapse: collapse; font-size: 13px; }
.odds th { text-align: right; font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 9px 10px 6px; white-space: nowrap; }
.odds th:first-child { text-align: left; }
.odds td { padding: 6px 10px; border-top: 1px solid var(--line-2); text-align: right; white-space: nowrap; color: var(--ink-2); }
.odds td.tm { text-align: left; display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.odds td.tm .seed { color: var(--ink-3); font-size: 11px; font-weight: 700; min-width: 50px; }
.odds td.pw { color: var(--ink-3); }
.odds .z { color: var(--line); }
.odds .ck { color: var(--home); font-weight: 800; }
.odds .champ-col { min-width: 150px; color: var(--ink); }
.odds .cc { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.odds .bar { flex: 1; max-width: 110px; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; display: block; }
.odds .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.odds .cc b { min-width: 38px; text-align: right; }

/* Bubble ------------------------------------------------------------------- */
.bubble { margin: 32px 0 8px; }
.bubble h2 { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; margin: 0; }
.bubble-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bubble-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-x: auto; }
.bubble table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.bubble th { text-align: left; font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 4px 6px; }
.bubble td { padding: 6px; border-top: 1px solid var(--line-2); white-space: nowrap; }
.bubble td.seed { color: var(--ink-3); font-weight: 700; width: 36px; }
.bubble td.tm { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bubble td.gb { color: var(--ink-3); text-align: right; font-size: 12px; }
.bubble tr.out td { color: var(--ink-2); }
.bubble tr.cut td { padding: 0; border-top: 2px dashed var(--accent); height: 0; position: relative; }
.bubble tr.cut span { position: absolute; right: 0; top: -9px; background: var(--card); color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 0 4px; }
.lastin { color: var(--home); font-weight: 700; font-size: 11px; text-transform: uppercase; }

/* Tiebreaker scenarios ------------------------------------------------------- */
.tbs { margin-top: 14px; }
.tbs h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.tb-card { border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; background: var(--card-2); }
.tb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tb-head .vs { font-family: Oswald, Inter, sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .4px; }
.tb-head .vs i { font-style: normal; color: var(--ink-3); font-size: 12px; margin: 0 2px; }
.tb-head .chip { text-transform: none; letter-spacing: 0; }
.tb-say { margin: 6px 0 0; font-size: 13px; }
.tb-note { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.tb-none { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.tb-card details { margin-top: 6px; }
.tb-card summary { cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 600; }
.tb-steps { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.tb-steps th { text-align: right; font-size: 10.5px; color: var(--ink-3); padding: 3px 6px; text-transform: uppercase; }
.tb-steps th:first-child, .tb-steps td:first-child { text-align: left; }
.tb-steps td { padding: 4px 6px; border-top: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.tb-steps td:first-child { white-space: normal; }
.tb-steps td small { display: block; color: var(--ink-3); font-size: 10.5px; }
.tb-steps tr.dec td { font-weight: 700; background: var(--accent-soft); }
.tb-steps .mk { width: 18px; color: var(--accent); text-align: center; }

/* Misc ---------------------------------------------------------------------- */
.loading { padding: 80px 0; text-align: center; color: var(--ink-3); font-size: 15px; }
.loading.err { color: var(--ink-2); }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 0 40px; color: var(--ink-3); font-size: 12.5px; }
.foot p { margin: 0 0 6px; max-width: 820px; }
.fine { font-size: 11.5px; }
.foot a, .odds .note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 40px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
  transition: transform .25s, opacity .25s; max-width: calc(100% - 32px); z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1600px) {
  .tree .t .nm .full { display: none; }
  .tree .t .nm .ab { display: inline; }
}
@media (max-width: 1360px) {
  .tree .t .rec { display: none; }
}
@media (max-width: 1179px) {
  .view-toggle { display: inline-flex; }
  .legend { margin-left: 0; }
  /* List view */
  body[data-view="list"] .tree-wrap { display: none; }
  body[data-view="list"] .stack { display: block; }
  .stack .t .nm .full { display: inline; }
  .stack .t .nm .ab { display: none; }
  /* Bracket view: a compact tree you can scroll around (or fit to the screen) */
  body[data-view="bracket"] .tree-wrap {
    margin: 0 -16px; padding: 10px 16px 16px; overflow: auto; -webkit-overflow-scrolling: touch;
    background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  body[data-view="bracket"] .tree-wrap.fit { overflow: hidden; }
  .fit-btn {
    display: inline-flex; position: sticky; left: 0; top: 0; margin: 0 0 10px; z-index: 5;
    height: 30px; align-items: center; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
    background: var(--card); font-weight: 700; font-size: 12px; color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow);
  }
  .tree { min-width: 980px; grid-template-columns: repeat(3, minmax(124px, 1fr)) minmax(180px, 1.1fr) repeat(3, minmax(124px, 1fr)); column-gap: 12px; min-height: 540px; }
  .tree .t .rec:not(.sc) { display: none; }
  .tree .t { gap: 4px; padding: 4px 6px 4px 3px; min-height: 32px; }
  .tree .t .seed { width: 14px; font-size: 11px; }
  .tree .t .logo { width: 17px; height: 17px; }
  .tree .t .nm { font-size: 13px; min-width: 34px; overflow: visible; }
  .tree .t .tb, .tree .t .aq, .tree .t .cl, .tree .t .mv { display: none; }
  .tree .t .hm { min-width: 13px; }
  .tree .champ-team strong { font-size: 16px; }
  .tree .champ-team img { width: 40px; height: 40px; }
}
@media (max-width: 760px) {
  .prelims, .bubble-grid { grid-template-columns: 1fr; }
  .top-in { gap: 8px 12px; padding-top: 10px; padding-bottom: 6px; }
  .tabs { margin-left: -6px; width: calc(100% + 12px); order: 3; padding-bottom: 2px; }
  .icon-btn { margin-left: auto; order: 2; width: 34px; height: 34px; }
  .tab { padding: 6px 12px; font-size: 15px; }
  .brand-txt strong { font-size: 17px; }
  .hide-sm { display: none; }
  .stack-round { grid-template-columns: 1fr; }
  .bubble-side { padding: 10px; }
  .controls { gap: 8px 12px; padding: 10px 0 12px; }
  .controls .hint { font-size: 12px; flex-basis: 100%; order: 3; }
  .ctl-sub { order: 4; font-size: 11.5px; gap: 6px 14px; }
  .ctl-main .btn { height: 34px; padding: 0 12px; }
  .status { padding: 10px 0 4px; }
  .phase { font-size: 14px; }
  .prelims { gap: 10px; }
  .bubble th:nth-child(3), .bubble td:nth-child(3) { display: none; }
  .bubble td.gb { white-space: normal; min-width: 90px; }
}
