/* =========================================================================
   LAN-ARENA — visual system  (polish pass v2: "broadcast")
   Dark competitive "arena" look (FACEIT DNA: near-black + ignition orange,
   angular shard/slash motifs, condensed technical display type, monospace
   scoreboard numerals) with a subtle CRT-scanline atmosphere as signature.
   Per-game skins override the accent set via --game* custom properties.
   Committed dark theme (no light mode) — matches the subject.

   v2 notes:
   - Display type leans on Bahnschrift's variable width axis (font-stretch)
     for a genuine condensed-esports voice — no external fonts (LAN rule).
   - The hub hero is a broadcast lockup: ghost "//" watermark, slash-plate
     lead word, lower-third leader plate, LED-segmented progress meter.
   - Every motion effect dies under prefers-reduced-motion (global kill).
   ========================================================================= */

:root {
  color-scheme: dark;

  /* --- surfaces --------------------------------------------------------- */
  --bg:        #0A0B0F;
  --bg-elev:   #101219;
  --surface:   #161922;
  --surface-2: #1E222E;
  --line:      #2A3040;
  --line-soft: #1F2430;

  /* --- ink -------------------------------------------------------------- */
  --ink:       #EEF2F8;
  --ink-dim:   #8B94A7;
  --ink-faint: #59616F;

  /* --- brand + signals -------------------------------------------------- */
  --accent:    #FF5A1A;   /* ignition orange — global chrome */
  --accent-2:  #FF8A3D;
  --accent-ink:#0A0B0F;
  --live:      #35E0FF;   /* electric cyan — live / links */
  --win:       #33E08A;
  --loss:      #FF4D5E;
  --gold:      #FFC53D;
  --silver:    #C8D2E0;
  --bronze:    #E0894B;

  /* --- per-game skin (overridden at runtime; defaults = brand) ---------- */
  --game:      var(--accent);
  --game-2:    var(--accent-2);
  --game-bg:   var(--bg);
  --game-hero: none;

  /* --- type ------------------------------------------------------------- */
  --f-display: "Bahnschrift", "Oswald", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-ui:      system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono:    ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --w-tight:   80%;       /* display lockups (Bahnschrift width axis)      */
  --w-label:   90%;       /* buttons, nav, eyebrows                        */

  /* --- shape ------------------------------------------------------------ */
  --r:    4px;
  --r-lg: 10px;
  --cut:  14px;          /* shard corner size */
  --tap:  50px;
  --maxw: 1120px;
  --shadow: 0 20px 55px -26px rgba(0,0,0,.85);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));  /* mobile dock */
  overflow-x: hidden;
}
@media (min-width: 860px) { body { padding-bottom: 0; } }

a { color: var(--live); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--live) 55%, transparent); }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* thin dark scrollbars on the few surfaces that scroll sideways */
.table-scroll, .bracket, .ticker { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.table-scroll::-webkit-scrollbar, .bracket::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb, .bracket::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.table-scroll::-webkit-scrollbar-track, .bracket::-webkit-scrollbar-track { background: transparent; }

/* --- CRT atmosphere: faint scanlines + vignette + one slow sweep --------
   No blend modes (kept cheap so it never janks on a beamer PC or a phone). */
.atmos {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.016) 0 1px, transparent 1px 3px),
    radial-gradient(130% 100% at 50% 0%, transparent 62%, rgba(0,0,0,.5) 100%);
}
.atmos::after {   /* ambient glow tinted by the current game accent */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(58% 42% at 50% -8%, color-mix(in srgb, var(--game) 15%, transparent), transparent 70%);
  transition: background .5s ease;
}
.atmos::before {  /* the signature: a slow CRT refresh line drifting down */
  content: ""; position: absolute; left: 0; right: 0; top: -160px; height: 140px;
  background: linear-gradient(180deg, transparent, rgba(53,224,255,.028) 45%, rgba(53,224,255,.05) 52%, transparent);
  animation: crt-sweep 13s linear infinite;
}
@keyframes crt-sweep { to { transform: translateY(calc(100vh + 320px)); } }

/* =========================================================================
   Type utilities
   ========================================================================= */
.display { font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-tight); letter-spacing: .02em; line-height: .98; }
.eyebrow {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label); text-transform: uppercase;
  letter-spacing: .2em; font-size: 12px; color: var(--ink-dim);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {   /* the slash marker — a skewed accent shard */
  content: ""; width: 20px; height: 11px; flex: none; background: var(--game);
  clip-path: polygon(28% 0, 100% 0, 72% 100%, 0 100%);
}
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }

/* =========================================================================
   Command bar (brand + desktop nav)
   ========================================================================= */
.cmdbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: calc(env(safe-area-inset-top) + 13px) clamp(14px, 4vw, 28px) 12px;
  background: color-mix(in srgb, #0C0E14 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.cmdbar::before {  /* signal line — recolors with the active game skin */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--game), var(--game-2) 34%, transparent 72%);
  transition: background .4s ease;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.brand__mark {
  width: 30px; height: 30px; flex: none; position: relative;
  background: var(--accent);
  clip-path: polygon(24% 0, 100% 0, 76% 100%, 0 100%);
}
.brand__mark::after {
  content: ""; position: absolute; right: -9px; bottom: 4px;
  width: 13px; height: 6px; background: var(--live);
}
.brand__word {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label); font-size: 20px;
  text-transform: uppercase; letter-spacing: .12em; line-height: 1;
}
.brand__word b { color: var(--accent); font-weight: 700; }
.cmdbar__spacer { flex: 1; }

.nav { display: none; gap: 4px; }
@media (min-width: 860px) { .nav { display: flex; } .dock { display: none !important; } }
.nav__item {
  position: relative; background: none; border: none; cursor: pointer;
  color: var(--ink-dim); font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .1em; font-size: 14px;
  padding: 9px 14px 8px; display: inline-flex; align-items: center; gap: 8px;
  transition: color .15s ease;
}
.nav__item:hover { color: var(--ink); }
.nav__item.is-active { color: var(--ink); }
.nav__item::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
  background: var(--accent); clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  transform: scaleX(0); transform-origin: left; transition: transform .18s ease, background .18s ease;
}
.nav__item:hover::after { transform: scaleX(1); background: var(--line); }
.nav__item.is-active::after { transform: scaleX(1); background: var(--accent); }
.nav__badge { color: var(--live); font-family: var(--f-mono); font-size: 12px; }

/* live status pill in the bar */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-dim);
  border: 1px solid var(--line); background: var(--surface);
  padding: 6px 11px; border-radius: 999px; font-family: var(--f-mono); white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); }
.status-pill.is-live { color: var(--ink); border-color: color-mix(in srgb, var(--live) 35%, var(--line)); }
.status-pill.is-live .dot { background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.8s infinite; }
.status-pill.is-offline .dot { background: var(--loss); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--live) 60%,transparent);} 70%{box-shadow:0 0 0 7px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }

/* =========================================================================
   Mobile dock
   ========================================================================= */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: color-mix(in srgb, #0C0E14 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.dock__item {
  flex: 1; background: none; border: none; cursor: pointer;
  color: var(--ink-faint); padding: 8px 0 6px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  position: relative; transition: color .15s ease;
}
.dock__item .ic { font-size: 19px; line-height: 1; transition: transform .15s ease; }
.dock__item.is-active { color: var(--ink); }
.dock__item.is-active .ic { transform: translateY(-1px); }
.dock__item.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; background: var(--accent);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

/* =========================================================================
   Stage / layout
   ========================================================================= */
.stage { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: clamp(16px, 3vw, 32px); }

/* quick entrance beat on every screen mount — fast enough to never drag */
.stage > * { animation: enter .26s cubic-bezier(.2,.7,.3,1) backwards; }
.stage > *:nth-child(2) { animation-delay: .04s; }
.stage > *:nth-child(3) { animation-delay: .08s; }
.stage > *:nth-child(4) { animation-delay: .12s; }
.stage > *:nth-child(n+5) { animation-delay: .15s; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }

.section { margin-bottom: 34px; }
.section__head {
  position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.section__head::after {   /* accent shard sitting on the hairline */
  content: ""; position: absolute; left: 0; bottom: -2px; width: 44px; height: 3px;
  background: var(--game); clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.panel .section__head { border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
.panel .section__head::after { content: none; }
.section__title {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-tight);
  font-size: clamp(21px, 3vw, 28px); text-transform: uppercase; letter-spacing: .04em; margin: 0;
}
.grid { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; }
.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; align-items: center; }

/* =========================================================================
   Panels / cards
   ========================================================================= */
.panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: clamp(14px, 2.4vw, 22px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.panel--flush { padding: 0; overflow: hidden; }
.panel--glow { box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.03); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  --b: var(--accent);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap); padding: 0 20px; width: 100%;
  border: none; cursor: pointer;
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label); font-size: 17px;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent-ink); background: var(--b);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  transition: transform .08s ease, filter .15s ease;
}
.btn::after {  /* light sweep on hover (primary buttons only) */
  content: ""; position: absolute; top: -4px; bottom: -4px; left: -45%; width: 34%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.3), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
@media (hover: hover) {
  .btn:hover { filter: brightness(1.08); }
  .btn:not(.btn--ghost):not(.btn--danger):hover::after { transform: skewX(-18deg) translateX(430%); transition: transform .55s ease; }
}
.btn--ghost::after, .btn--danger::after, .btn:disabled::after { display: none; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.btn--ghost {
  color: var(--ink); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--danger { color: var(--loss); background: #23151a; box-shadow: inset 0 0 0 1px #43222b; }
.btn--game { --b: var(--game); color: #0A0B0F; }
.btn--sm { min-height: 40px; font-size: 14px; padding: 0 15px; --cut: 10px; }
.btn--auto { width: auto; }

/* =========================================================================
   Forms
   ========================================================================= */
.field { display: block; }
.field__label {
  display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-dim); margin: 0 0 7px 1px; font-weight: 700;
  font-family: var(--f-display); font-stretch: var(--w-label);
}
.input {
  width: 100%; min-height: var(--tap);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--ink); font-size: 16px; padding: 0 14px;
  transition: border-color .15s ease, background .15s ease;
}
.input:hover { border-color: color-mix(in srgb, var(--ink-faint) 55%, var(--line)); }
.input:focus-visible { outline: 2px solid var(--game); outline-offset: -1px; background: color-mix(in srgb, var(--game) 4%, var(--bg)); }
.input.mono { font-family: var(--f-mono); }
textarea.input { min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

.stepper { display: inline-flex; align-items: center; gap: 14px; }
.stepper button {
  width: var(--tap); height: var(--tap); flex: none;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font-size: 26px; font-weight: 700; cursor: pointer; border-radius: var(--r);
  transition: border-color .15s ease, background .15s ease;
}
.stepper button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.stepper button:active { transform: scale(.94); }
.stepper .val { font-family: var(--f-display); font-stretch: 85%; font-size: 30px; font-weight: 700; min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 3px; }
.seg button {
  border: none; background: none; cursor: pointer; color: var(--ink-dim);
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .06em;
  font-size: 13px; padding: 9px 15px; border-radius: 3px;
  transition: color .15s ease, background .15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--game); color: #0A0B0F; }

/* =========================================================================
   Wizard steps
   ========================================================================= */
.steps { display: flex; gap: 8px; margin-bottom: 24px; }
.steps__item { flex: 1; display: flex; align-items: center; gap: 9px; color: var(--ink-faint); }
.steps__item::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); margin: 0 6px; }
.steps__item:last-child::after { content: none; }
.steps__num {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  font-family: var(--f-mono); font-weight: 700; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-dim);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}
.steps__item.is-active .steps__num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.steps__item.is-done .steps__num { background: var(--surface-2); color: var(--win); border-color: var(--line); }
.steps__label { font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.steps__item.is-active .steps__label { color: var(--ink); }
@media (max-width: 620px) { .steps__label { display: none; } }

/* =========================================================================
   Game picker (setup) + game cabinets (hub)
   ========================================================================= */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 13px; }
@media (min-width: 860px) { .gcards { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); } }
.gcard {
  position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  min-height: 148px; padding: 14px; color: var(--ink);
  background: var(--g-bg, var(--surface));
  isolation: isolate;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.gcard::before {   /* hero key-art band */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--g-hero, none); opacity: .92;
  transition: transform .35s ease, opacity .2s ease, filter .2s ease;
}
.gcard::after {    /* readability floor + faint scanlines over the art */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(5,6,9,.05) 26%, rgba(5,6,9,.88) 84%);
}
@media (hover: hover) {
  .gcard:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--g-accent, var(--accent)) 60%, var(--line));
    box-shadow: 0 16px 36px -20px color-mix(in srgb, var(--g-accent, var(--accent)) 50%, #000);
  }
  .gcard:hover::before { transform: scale(1.06); }
}
.gcard__ic { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.55)); }
.gcard__name {
  font-family: var(--f-display); font-weight: 700; font-stretch: 85%;
  text-transform: uppercase; letter-spacing: .04em; font-size: 21px; margin-top: auto;
  text-shadow: 0 1px 10px rgba(0,0,0,.85);
}
.gcard__mode { font-size: 12px; font-family: var(--f-mono); color: color-mix(in srgb, var(--g-accent, var(--accent)) 55%, var(--ink-dim)); text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.gcard__body { position: relative; height: 100%; min-height: 118px; display: flex; flex-direction: column; gap: 3px; }
.gcard__edge { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--g-accent, var(--accent)); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), 0 100%); }
.gcard.is-picked { border-color: var(--g-accent, var(--accent)); box-shadow: inset 0 0 0 1px var(--g-accent, var(--accent)), 0 10px 30px -18px color-mix(in srgb, var(--g-accent, var(--accent)) 55%, #000); }
.gcard.is-placeholder { opacity: .62; }

/* setup picker: unpicked games stand cold until chosen (arm/ignite) */
.gcard[data-game]:not(.is-picked):not(.is-placeholder)::before { opacity: .38; filter: grayscale(.55) brightness(.75); }
.gcard[data-game]:not(.is-picked):not(.is-placeholder) .gcard__edge { opacity: .4; }
@media (hover: hover) {
  .gcard[data-game]:not(.is-picked):not(.is-placeholder):hover::before { opacity: .7; filter: grayscale(.2) brightness(.9); }
}

.gcard__check {
  position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; z-index: 1;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--g-accent, var(--accent)); color: #0A0B0F; font-weight: 900; font-size: 14px;
  transform: scale(0); transition: transform .18s cubic-bezier(.2,1.6,.4,1);
}
.gcard.is-picked .gcard__check { transform: scale(1); }
.gcard__stat {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-dim);
  background: rgba(5,6,9,.62); border: 1px solid var(--line-soft);
  padding: 3px 8px; border-radius: 3px; letter-spacing: .04em;
}

/* =========================================================================
   Match rows + result sheet
   ========================================================================= */
.rounds { display: flex; flex-direction: column; gap: 8px; }
.round-head {
  display: flex; align-items: center; gap: 10px; margin: 24px 2px 10px;
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .14em;
  font-size: 12px; color: var(--ink-dim);
}
.round-head:first-child { margin-top: 0; }
.round-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.badge-now {
  font-family: var(--f-mono); font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--live); border: 1px solid color-mix(in srgb, var(--live) 45%, transparent);
  background: color-mix(in srgb, var(--live) 12%, transparent);
  padding: 2px 7px; border-radius: 3px;
  animation: now-pulse 2.4s ease-in-out infinite;
}
@keyframes now-pulse { 50% { box-shadow: 0 0 10px color-mix(in srgb, var(--live) 35%, transparent); } }

.match {
  --gc: var(--game);
  position: relative; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 4px solid var(--gc);
  border-radius: var(--r); padding: 11px 13px; cursor: pointer; min-height: var(--tap);
  transition: background .14s ease, transform .08s ease, border-color .14s ease;
}
@media (hover: hover) {
  .match:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--gc) 30%, var(--line-soft)); border-left-color: var(--gc); }
}
.match:active { transform: scale(.996); }
.match__ic {
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 19px;
  background: color-mix(in srgb, var(--gc) 12%, transparent);
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}
.match__body { min-width: 0; }
.match__teams { display: flex; align-items: center; gap: 9px; font-weight: 650; flex-wrap: wrap; }
.match__teams .vs {
  color: var(--ink-faint); font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em;
  background: rgba(255,255,255,.045); padding: 2px 7px;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
.match__teams .won { color: var(--ink); }
.match__teams .won b { color: var(--gc); }
.match__meta { font-size: 12px; color: var(--ink-dim); margin-top: 3px; font-family: var(--f-mono); }
.match__status {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .07em; font-size: 11px;
  padding: 5px 12px; white-space: nowrap;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.match__status.open { background: var(--surface-2); color: var(--ink-dim); box-shadow: inset 0 0 0 1px var(--line-soft); }
.match__status.done { background: color-mix(in srgb, var(--win) 15%, transparent); color: var(--win); }
.match__score { font-family: var(--f-mono); font-weight: 700; color: var(--gc); }

/* bottom sheet */
.sheet-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,5,8,.66);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-back.is-open { display: flex; }
.sheet {
  width: 100%; max-width: 560px; background: var(--bg-elev);
  border: 1px solid var(--line); border-bottom: none;
  border-top: 2px solid var(--game);
  border-radius: 16px 16px 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  animation: rise .22s ease; box-shadow: var(--shadow);
}
@media (min-width: 560px) { .sheet-back { align-items: center; } .sheet { border-radius: 12px; border-bottom: 1px solid var(--line); } }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grab { width: 42px; height: 5px; background: var(--line); border-radius: 999px; margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 3px; font-family: var(--f-display); font-weight: 700; font-stretch: 85%; font-size: 21px; text-transform: uppercase; letter-spacing: .03em; }
.sheet .sub { color: var(--ink-dim); font-size: 13px; margin-bottom: 16px; font-family: var(--f-mono); }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pick__btn {
  min-height: 68px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; padding: 8px; border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 650; text-align: center;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
@media (hover: hover) { .pick__btn:hover { border-color: color-mix(in srgb, var(--game) 45%, var(--line)); } }
.pick__btn small { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-faint); font-family: var(--f-display); font-stretch: var(--w-label); }
.pick__btn.sel {
  border-color: var(--game); background: color-mix(in srgb, var(--game) 14%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--game), 0 6px 18px -10px color-mix(in srgb, var(--game) 60%, transparent);
}
.pick__btn.sel small { color: var(--game); }
.score { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 16px; }
.score .input { width: 88px; text-align: center; font-family: var(--f-mono); font-size: 25px; font-weight: 700; }
.score .colon { font-family: var(--f-mono); font-size: 25px; color: var(--ink-faint); }
.sheet__actions { display: flex; gap: 10px; }
.sheet__actions .btn { flex: 1; }

/* =========================================================================
   Tables (scoreboard)
   ========================================================================= */
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th, .board td { padding: 12px 10px; text-align: center; }
.board th {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
}
.board td { border-bottom: 1px solid var(--line-soft); }
.board tr:last-child td { border-bottom: none; }
.board tbody tr { transition: background .12s ease; }
@media (hover: hover) { .board tbody tr:hover td { background: rgba(255,255,255,.024); } }
.board .c-rank { width: 44px; color: var(--ink-faint); font-family: var(--f-mono); }
.board .c-team { text-align: left; }
.board .c-pts { font-family: var(--f-mono); font-weight: 700; color: var(--game); font-size: 18px; }
.board .num { font-family: var(--f-mono); }
.board tr.is-cut td {   /* qualification cut — the line teams fight over */
  box-shadow: inset 3px 0 0 var(--game);
  border-bottom: 2px solid color-mix(in srgb, var(--game) 55%, transparent);
}
.board tr.top1 td { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.board tr.top2 td { background: color-mix(in srgb, var(--silver) 6%, transparent); }
.board tr.top3 td { background: color-mix(in srgb, var(--bronze) 8%, transparent); }
.table-scroll { overflow-x: auto; }

.team-cell { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label); font-size: 14px; color: #0A0B0F;
  background-color: var(--tc, var(--accent));
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), transparent 55%);
  clip-path: polygon(16% 0, 100% 0, 84% 100%, 0 100%);
}
.team-cell__name { font-weight: 650; line-height: 1.15; }
.team-cell__sub { font-size: 11px; color: var(--ink-dim); font-family: var(--f-mono); }
.rank-medal { font-size: 17px; }

/* =========================================================================
   Hub hero (broadcast-style live standings)
   ========================================================================= */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 13%, var(--line-soft));
  padding: clamp(20px, 4.5vw, 38px);
  background:
    linear-gradient(112deg, transparent 46%, color-mix(in srgb, var(--accent) 6%, transparent) 46.2% 60%, transparent 60.2%),
    radial-gradient(70% 90% at 0% 100%, color-mix(in srgb, var(--live) 7%, transparent), transparent 60%),
    radial-gradient(90% 130% at 100% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    linear-gradient(180deg, var(--surface), var(--bg-elev));
  margin-bottom: 30px;
}
.hero > * { position: relative; z-index: 1; }
.hero::before {    /* in-panel scanline field */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 4px);
}
.hero::after {     /* ghost slash watermark — the broadcast bug */
  content: "//" / ""; position: absolute; z-index: 0; right: -1%; top: -16%;
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-tight);
  font-size: clamp(170px, 32vw, 330px); line-height: 1; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: skewX(-8deg); pointer-events: none; user-select: none;
}
.hero__eyebrow { margin-bottom: 16px; }
.hero__title {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-tight);
  text-transform: uppercase; letter-spacing: .005em;
  font-size: clamp(37px, 8.5vw, 84px); line-height: .94; margin: 0 0 8px;
}
.hero__title .lead {   /* slash-plate lockup on the lead words */
  display: inline-block; color: var(--accent-ink);
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  padding: .03em .16em .06em .14em;
  clip-path: polygon(.14em 0, 100% 0, calc(100% - .14em) 100%, 0 100%);
}
.hero__sub { color: var(--ink-dim); font-family: var(--f-mono); font-size: 13.5px; }
.hero__leader {   /* lower-third plate for the current leader */
  display: flex; align-items: center; gap: 14px; margin-top: 22px; flex-wrap: wrap;
  padding: 12px 16px;
  background: color-mix(in srgb, #000 32%, transparent);
  border: 1px solid var(--line-soft); border-left: 3px solid var(--accent);
  border-radius: var(--r);
}
.hero__leader .avatar { width: 52px; height: 52px; font-size: 20px; }
.hero__leader-name { font-family: var(--f-display); font-weight: 700; font-stretch: 85%; text-transform: uppercase; letter-spacing: .03em; font-size: 25px; line-height: 1.05; }
.hero__leader-tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--live); }

.meter { position: relative; height: 10px; background: var(--bg); border: 1px solid color-mix(in srgb, var(--game) 22%, var(--line)); border-radius: 999px; overflow: hidden; margin-top: 20px; }
.meter > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--live));
  box-shadow: 0 0 10px color-mix(in srgb, var(--live) 30%, transparent);
  transition: width .5s ease;
}
.meter::after {   /* LED segmentation over the fill */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 21px, rgba(10,11,15,.85) 21px 24px);
}

.ticker { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 2px; margin-top: 16px; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.ticker__chip {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--tc, var(--accent));
  border-radius: var(--r); font-size: 13px; white-space: nowrap;
  transition: border-color .15s ease;
}
@media (hover: hover) { .ticker__chip:hover { border-color: color-mix(in srgb, var(--tc, var(--accent)) 40%, var(--line-soft)); } }
.ticker__chip .ic { font-size: 15px; }

/* =========================================================================
   Game page (skinned mini-landing)
   ========================================================================= */
.gpage__hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--game) 18%, var(--line-soft));
  padding: clamp(20px, 5vw, 40px);
  min-height: clamp(190px, 34vw, 300px);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  background: var(--game-bg); margin-bottom: 26px; isolation: isolate;
}
.gpage__hero::before {   /* the AI key-art, saturated and proud */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--game-hero); filter: saturate(1.05);
}
.gpage__hero::after {    /* cinematic grade: dark floor left/bottom, art breathes top-right */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px),
    linear-gradient(0deg, rgba(5,6,9,.88), rgba(5,6,9,.25) 46%, transparent 72%),
    linear-gradient(90deg, rgba(5,6,9,.72), rgba(5,6,9,.28) 46%, rgba(5,6,9,.06));
}
.gpage__badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: 12px; color: var(--ink);
  background: rgba(5,6,9,.55); border: 1px solid color-mix(in srgb, var(--game) 30%, var(--line));
  padding: 6px 11px; border-radius: 999px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.gpage__title {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-tight);
  text-transform: uppercase; letter-spacing: .01em;
  font-size: clamp(36px, 8.5vw, 72px); line-height: .92; margin: 14px 0 4px;
  text-shadow: 0 2px 24px rgba(0,0,0,.65);
}
.gpage__title::after {   /* skin-coloured slash underline */
  content: ""; display: block; width: 76px; height: 6px; margin-top: 12px;
  background: linear-gradient(90deg, var(--game), var(--game-2));
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.gpage__mode { font-family: var(--f-mono); color: var(--game); font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.gpage__ic { font-size: clamp(40px, 9vw, 68px); position: absolute; right: clamp(18px,5vw,40px); top: clamp(18px,5vw,40px); filter: drop-shadow(0 4px 14px rgba(0,0,0,.7)); }

.cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 780px) { .cols--2 { grid-template-columns: 1.1fr 1fr; align-items: start; } }

/* =========================================================================
   Bracket tree
   ========================================================================= */
.bracket { display: flex; gap: clamp(16px, 4vw, 48px); overflow-x: auto; padding: 6px 2px 14px; position: relative; }
.bracket__round { display: flex; flex-direction: column; justify-content: space-around; gap: 16px; min-width: 225px; }
.bracket__round-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--ink-dim); margin-bottom: 4px;
}
.bracket__round-title::before, .bracket__round-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.bmatch {
  position: relative; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  transition: border-color .15s ease, transform .12s ease;
}
@media (hover: hover) { .bmatch:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); } }
.bmatch.is-live {
  border-color: color-mix(in srgb, var(--live) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--live) 40%, transparent);
  animation: live-ring 2.6s ease-in-out infinite;
}
@keyframes live-ring { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--live) 25%, transparent), 0 0 18px -4px color-mix(in srgb, var(--live) 45%, transparent); } }
.bteam { display: flex; align-items: center; gap: 9px; padding: 10px 12px; font-weight: 650; }
.bteam + .bteam { border-top: 1px solid var(--line-soft); }
.bteam .seed { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); width: 16px; }
.bteam .sc { margin-left: auto; font-family: var(--f-mono); font-weight: 700; color: var(--ink-dim); }
.bteam.win { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.bteam.win .sc { color: var(--accent); }
.bteam.loss { color: var(--ink-dim); }
.bracket__champ { align-self: center; text-align: center; }
.champ-badge {
  font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-label);
  text-transform: uppercase; letter-spacing: .1em; color: var(--gold);
  text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 40%, transparent);
}

/* =========================================================================
   Podium / ceremony
   ========================================================================= */
.ceremony {
  text-align: center; padding: 8px 0;
  background: radial-gradient(46% 200px at 50% 36px, color-mix(in srgb, var(--gold) 9%, transparent), transparent 70%);
}
.ceremony__trophy { font-size: 54px; filter: drop-shadow(0 6px 22px color-mix(in srgb, var(--gold) 55%, transparent)); animation: trophy-float 3.6s ease-in-out infinite; }
@keyframes trophy-float { 50% { transform: translateY(-5px); } }
.ceremony__title { font-family: var(--f-display); font-weight: 700; font-stretch: var(--w-tight); text-transform: uppercase; letter-spacing: .02em; font-size: clamp(31px, 7vw, 56px); margin: 8px 0 2px; }
.ceremony__title .y { color: var(--gold); text-shadow: 0 0 26px color-mix(in srgb, var(--gold) 35%, transparent); }
.ceremony__sub { color: var(--ink-dim); margin-bottom: 28px; font-family: var(--f-mono); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; max-width: 470px; margin: 0 auto; }
.podium__col { flex: 1; display: flex; flex-direction: column; align-items: center; animation: pod-rise .55s cubic-bezier(.2,.8,.3,1) backwards; }
.podium__col.p2 { animation-delay: .08s; }
.podium__col.p1 { animation-delay: .22s; }
.podium__col.p3 { animation-delay: .36s; }
@keyframes pod-rise { from { opacity: 0; transform: translateY(22px); } }
.podium__who { font-weight: 700; font-size: 15px; margin-bottom: 7px; word-break: break-word; }
.podium__who .pts { display: block; font-family: var(--f-mono); font-size: 12px; color: var(--ink-dim); font-weight: 400; }
.podium__block {
  width: 100%; display: grid; place-items: start center;
  font-family: var(--f-mono); font-size: 30px; font-weight: 700;
}
.podium__col.p1 .podium__block {
  height: 142px; padding-top: 26px;
  clip-path: polygon(0 14px, 50% 0, 100% 14px, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb,var(--gold) 30%, #201c0c), #17140a);
  color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold);
}
.podium__col.p2 .podium__block {
  height: 106px; padding-top: 20px;
  clip-path: polygon(0 12px, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb,var(--silver) 22%, #1a1e26), #14171d);
  color: var(--silver); box-shadow: inset 0 0 0 1px var(--silver);
}
.podium__col.p3 .podium__block {
  height: 84px; padding-top: 20px;
  clip-path: polygon(0 0, 100% 12px, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb,var(--bronze) 26%, #221810), #17110b);
  color: var(--bronze); box-shadow: inset 0 0 0 1px var(--bronze);
}

.kings { display: grid; gap: 10px; margin-top: 26px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.king {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-soft); border-left: 4px solid var(--kc, var(--accent));
  border-radius: var(--r); padding: 12px 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--kc, var(--accent)) 7%, var(--surface)), var(--surface) 55%);
  text-align: left;
}
.king .ic { font-size: 24px; }
.king__title { font-family: var(--f-mono); font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em; }
.king__name { font-family: var(--f-display); font-weight: 700; font-stretch: 85%; font-size: 17px; text-transform: uppercase; letter-spacing: .02em; }

/* =========================================================================
   Stats
   ========================================================================= */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat { position: relative; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 16px; background: var(--surface); }
.stat::after {   /* corner shard tick */
  content: ""; position: absolute; top: 0; right: 0; width: 16px; height: 16px;
  background: color-mix(in srgb, var(--game) 26%, transparent);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.stat__k { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); }
.stat__v { font-family: var(--f-display); font-weight: 700; font-stretch: 85%; font-size: clamp(21px, 4vw, 31px); text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; overflow-wrap: anywhere; }
.stat__sub { font-family: var(--f-mono); font-size: 12px; color: var(--game); margin-top: 3px; }

/* =========================================================================
   Toasts, hints, empty
   ========================================================================= */
.toasts { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 860px) { .toasts { bottom: 24px; } }
.toast {
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-left: 3px solid var(--live);
  color: var(--ink); padding: 10px 15px; border-radius: var(--r); font-size: 14px;
  box-shadow: var(--shadow); animation: rise .2s ease;
}
.toast.err { border-left-color: var(--loss); }
.toast.ok { border-left-color: var(--win); }

.hint { font-size: 13px; color: var(--ink-dim); line-height: 1.55; margin: 8px 1px 0; }
.hint.err { color: var(--loss); }
.empty {
  text-align: center; color: var(--ink-dim); padding: 46px 16px;
  border: 1px dashed var(--line); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}
.empty .big { font-size: 42px; margin-bottom: 12px; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* =========================================================================
   Motion / a11y
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .atmos { background: radial-gradient(130% 100% at 50% 0%, transparent 60%, rgba(0,0,0,.5) 100%); }
  .atmos::before { display: none; }
}
:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
