/* ============================================================
   NINETY — Football Live Center
   Night-stadium design system · mobile first · no build step
   ============================================================ */

:root {
  --bg: #05070B;
  --bg-soft: #080C12;
  --surface: #0E141D;
  --surface-2: #131B26;
  --surface-3: #1A2432;
  --text: #EEF3EA;
  --text-dim: #B6C1CE;
  --muted: #7B8798;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .16);

  --lime: #C9FF3F;
  --lime-2: #93E400;
  --lime-soft: rgba(201, 255, 63, .14);
  --lime-glow: rgba(201, 255, 63, .34);
  --mint: #46F0C4;
  --violet: #7C5CFF;
  --live: #FF3B5C;
  --live-glow: rgba(255, 59, 92, .38);
  --ink: #08110A;

  --radius-lg: 26px;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .95);
  --tab-h: 68px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient stadium light — fixed, cheap, no animation. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 45% at 12% -8%, rgba(201, 255, 63, .16), transparent 62%),
    radial-gradient(60% 40% at 105% 8%, rgba(124, 92, 255, .18), transparent 62%),
    radial-gradient(80% 50% at 50% 108%, rgba(70, 240, 196, .10), transparent 65%),
    linear-gradient(180deg, #070B11 0%, #05070B 55%, #05070B 100%);
}

body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
img { max-width: 100%; }

h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
b, strong { font-weight: 800; }

::selection { background: var(--lime); color: var(--ink); }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -90px; z-index: 300;
  background: var(--lime); color: var(--ink); border-radius: 10px;
  padding: 12px 16px; font-weight: 800; font-size: 13px;
}
.skip-link:focus { top: 12px; }

.tiny { font-size: 11px; color: var(--muted); }
.muted-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.page-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 18px 4px 0; }
.inline-link { color: var(--lime); font-weight: 700; border-bottom: 1px solid rgba(201, 255, 63, .35); }

/* ------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top);
  background: rgba(5, 7, 11, .82);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 255, 63, .45), transparent);
  opacity: .7;
}
.topbar-in {
  height: 60px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-word { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.brand-word b {
  font-size: 16px; font-weight: 900; letter-spacing: .18em; line-height: 1;
}
.brand-word small {
  font-size: 8.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--lime); white-space: nowrap; opacity: .85;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.iconbtn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.iconbtn:active { transform: scale(.94); }
.iconbtn.lime { background: var(--lime); color: var(--ink); border-color: transparent; }
@media (hover: hover) {
  .iconbtn:hover { background: var(--surface-2); color: var(--text); }
}

.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 999px;
  background: rgba(255, 59, 92, .12);
  border: 1px solid rgba(255, 59, 92, .35);
  color: #FF8FA1;
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
}
.live-chip i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 0 var(--live-glow);
  animation: pulse 1.9s ease-out infinite;
}
.live-chip.off { background: var(--surface); border-color: var(--line); color: var(--muted); }
.live-chip.off i { background: var(--muted); animation: none; box-shadow: none; }

/* ------------------------------------------------------------------
   Search overlay
   ------------------------------------------------------------------ */
.search-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 24px;
  background: rgba(5, 7, 11, .94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.search-layer.open { display: block; animation: fadeIn .18s ease both; }
.search-top { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; }
.search-field {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.search-field:focus-within { border-color: rgba(201, 255, 63, .55); box-shadow: 0 0 0 4px rgba(201, 255, 63, .08); }
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 16px; color: var(--text);
}
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button { display: none; }

.search-clear {
  width: 28px; height: 28px; flex: none; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-3); color: var(--text-dim);
}
.search-hint {
  max-width: 720px; margin: 22px auto 0;
  color: var(--muted); font-size: 13px; line-height: 1.6;
}
.search-hint b { display: block; color: var(--text); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.search-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------ */
.layout { display: block; }

.sidebar { display: none; }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--tab-h) + 46px + env(safe-area-inset-bottom));
}

#app.fade { animation: pageIn .34s cubic-bezier(.22, .9, .3, 1) both; }

/* ------------------------------------------------------------------
   Page headers
   ------------------------------------------------------------------ */
.page-head { padding: 6px 2px 14px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--lime);
}
.eyebrow-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--lime);
  box-shadow: 0 0 12px 2px var(--lime-glow);
}
.page-head h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 900;
  letter-spacing: -.045em;
  background: linear-gradient(180deg, #FFFFFF 0%, #A9B6C6 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head .sub { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.live-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 8px 2px 16px;
}
.live-head h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 9vw, 42px); font-weight: 900; letter-spacing: -.045em;
  background: linear-gradient(180deg, #FFFFFF 0%, #A9B6C6 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.live-head .sub { margin-top: 7px; color: var(--muted); font-size: 12.5px; }
.live-counter {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 900; letter-spacing: .1em;
  color: #FFD3DA;
  background: rgba(255, 59, 92, .14);
  border: 1px solid rgba(255, 59, 92, .35);
}
.live-counter i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--live);
  animation: pulse 1.9s ease-out infinite;
}
.live-counter.off { color: var(--muted); background: var(--surface); border-color: var(--line); }
.live-counter.off i { background: var(--muted); animation: none; }

/* ------------------------------------------------------------------
   Stats strip
   ------------------------------------------------------------------ */
.statgrid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 16px;
}
.stat {
  position: relative; overflow: hidden;
  padding: 13px 12px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.stat::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px;
  border-radius: 2px; background: var(--lime); opacity: .5;
}
.stat.accent { background: linear-gradient(150deg, rgba(201, 255, 63, .16), rgba(201, 255, 63, .02) 70%); border-color: rgba(201, 255, 63, .28); }
.stat.live::after { background: var(--live); }
.stat b {
  display: block;
  font-size: 26px; font-weight: 900; letter-spacing: -.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block; margin-top: 6px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}

/* ------------------------------------------------------------------
   Ticker
   ------------------------------------------------------------------ */
.ticker {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ticker-badge {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 7px;
  background: var(--live); color: #fff;
  font-size: 9.5px; font-weight: 900; letter-spacing: .12em;
}
.ticker-view { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px 0 0; margin-right: 16px;
  border-right: 1px solid var(--line);
  font-size: 12px; white-space: nowrap; color: var(--text-dim);
}
.ticker-item b { color: var(--text); font-weight: 700; }
.ticker-item .tsc { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--lime); }
.ticker-item .tmin { font-size: 10px; font-weight: 800; color: var(--live); }

/* ------------------------------------------------------------------
   Hero (featured match)
   ------------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 16px 16px 14px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, #14201B 0%, #0B111A 46%, #141026 100%);
  border: 1px solid rgba(201, 255, 63, .16);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 70% at 50% -18%, rgba(201, 255, 63, .28), transparent 62%),
    radial-gradient(50% 60% at 105% 105%, rgba(124, 92, 255, .30), transparent 60%);
  animation: aura 9s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute; left: 50%; top: 54%;
  width: 220px; height: 220px; transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .07); border-radius: 50%;
  pointer-events: none; z-index: -1;
}
.hero.is-live { border-color: rgba(255, 59, 92, .26); }
.hero.is-live::before {
  background:
    radial-gradient(90% 70% at 50% -18%, rgba(255, 59, 92, .30), transparent 62%),
    radial-gradient(50% 60% at 105% 105%, rgba(124, 92, 255, .28), transparent 60%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-comp {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text-dim);
  text-transform: uppercase;
}
.hero-comp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 18px 0 16px;
}
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; }
.hero-side .badge { box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .9); }
.hero-name {
  font-size: 12.5px; font-weight: 800; line-height: 1.25; text-align: center;
  letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-score {
  text-align: center;
  font-size: clamp(40px, 13vw, 58px);
  font-weight: 900; letter-spacing: -.06em; line-height: .95;
  font-variant-numeric: tabular-nums;
  padding-top: 8px;
  white-space: nowrap;
  text-shadow: 0 8px 34px rgba(0, 0, 0, .6);
}
.hero-score i { font-style: normal; color: var(--muted); margin: 0 2px; font-size: .7em; }
.hero-score.kick { font-size: clamp(28px, 9vw, 38px); letter-spacing: -.04em; }
.hero-status {
  display: block; margin-top: 7px;
  font-size: 10px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim);
}
.hero-status.live { color: #FF8FA1; }
.hero-status.live::before {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px;
  border-radius: 50%; background: var(--live); vertical-align: middle;
  animation: pulse 1.9s ease-out infinite;
}
.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.hero-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-cta {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 12px;
  background: linear-gradient(135deg, var(--lime), #9FEC00);
  color: var(--ink); font-size: 12px; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 12px 26px -14px var(--lime-glow);
  transition: transform .12s ease;
}
.hero-cta:active { transform: scale(.96); }

/* ------------------------------------------------------------------
   Section headings
   ------------------------------------------------------------------ */
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 26px 2px 10px;
}
.section-head h2 {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 900; letter-spacing: -.01em;
}
.section-head h2::before {
  content: ""; width: 3px; height: 15px; border-radius: 3px;
  background: linear-gradient(180deg, var(--lime), rgba(201, 255, 63, .25));
}
.section-head .text-link, .text-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
  color: var(--lime);
}
.text-link:active { opacity: .7; }
.section-head-panel { margin: 22px 2px 10px; }

/* ------------------------------------------------------------------
   Match list
   ------------------------------------------------------------------ */
.mlist {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.group { margin-bottom: 16px; }
.group-head {
  display: flex; align-items: center; gap: 9px;
  padding: 0 4px 8px;
}
.group-name {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.group-count {
  margin-left: auto; flex: none;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 10px; font-weight: 800; color: var(--muted);
}

.mrow {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 9px 8px 9px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .16s ease, transform .12s ease;
  animation: rise .42s cubic-bezier(.22, .9, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.mrow:last-child { border-bottom: 0; }
.mrow:active { background: var(--surface-2); transform: scale(.995); }
.mrow.is-live {
  background: linear-gradient(90deg, rgba(255, 59, 92, .12), rgba(255, 59, 92, .02) 46%, transparent 72%);
  box-shadow: inset 2px 0 0 var(--live);
}
.mrow.is-demo { opacity: .92; }

.mstat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.mstat b { font-size: 12.5px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mstat b.stat-live { color: var(--live); }
.mstat small {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 8px; font-weight: 800; letter-spacing: .1em; color: var(--muted);
}
.mstat .live-note { color: #FF8FA1; }
.mstat .live-note i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--live);
  animation: pulse 1.9s ease-out infinite;
}
.mstat .sample-tag { color: #D9B44A; letter-spacing: .08em; }

.mteams { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.trow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tname {
  font-size: 13.5px; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trow.win .tname { font-weight: 800; color: #fff; }
.tscore {
  min-width: 18px; text-align: right;
  font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.tscore.live { color: var(--lime); }
.tscore.ft { color: var(--text); }
.tscore.demo { color: var(--muted); }
.tscore.blank { color: var(--muted); }

.mrow-actions { display: flex; justify-content: flex-end; }
.favbtn {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: #5E6A7B;
  transition: color .16s ease, background .16s ease, transform .12s ease;
}
.favbtn:active { transform: scale(.9); }
.favbtn.on { color: var(--lime); }
@media (hover: hover) { .favbtn:hover { background: var(--surface-2); } }

/* ------------------------------------------------------------------
   Badges
   ------------------------------------------------------------------ */
.badge {
  position: relative;
  width: 20px; height: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.badge img { width: 100%; height: 100%; object-fit: contain; }
.badge .fb {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 900; color: var(--text-dim);
  letter-spacing: -.02em;
}
.badge.nofm .fb { display: flex; }
.badge.nofm img { display: none; }
.badge.comp { background: rgba(201, 255, 63, .12); border: 1px solid rgba(201, 255, 63, .2); }
.badge.comp .fb { color: var(--lime); font-size: 7.5px; }
.badge.xs { width: 18px; height: 18px; border-radius: 5px; }
.badge.xs .fb { font-size: 7px; }
.badge.sm { width: 24px; height: 24px; border-radius: 7px; }
.badge.sm .fb { font-size: 8.5px; }
.badge.lg { width: 42px; height: 42px; border-radius: 13px; }
.badge.lg .fb { font-size: 13px; }
.badge.xl { width: 58px; height: 58px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); }
.badge.xl .fb { font-size: 18px; }
.hero .badge.xl { width: 62px; height: 62px; border-radius: 20px; }

/* ------------------------------------------------------------------
   Pills
   ------------------------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
}
.pill.live { color: #FFD3DA; background: rgba(255, 59, 92, .16); border: 1px solid rgba(255, 59, 92, .38); }
.pill.live i { width: 4px; height: 4px; border-radius: 50%; background: var(--live); animation: pulse 1.9s ease-out infinite; }
.pill.neutral { color: var(--muted); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.pill.sample { color: #E7C263; background: rgba(231, 194, 99, .10); border: 1px solid rgba(231, 194, 99, .28); }

/* ------------------------------------------------------------------
   Match board (match centre hero)
   ------------------------------------------------------------------ */
.board {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #101821 0%, #0B1119 60%, #12101F 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.board.is-live { border-color: rgba(255, 59, 92, .24); }
.board.is-live::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 50% -10%, rgba(255, 59, 92, .22), transparent 65%);
}
.b-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.b-comp {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim);
}
.b-comp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.board-fav {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; color: #63708A;
}
.board-fav.on { color: var(--lime); }
.b-main {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start; gap: 8px;
  margin: 20px 0 16px;
}
.b-team { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; }
.b-name {
  font-size: 13px; font-weight: 800; text-align: center; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.b-mid { text-align: center; padding-top: 6px; }
.b-score {
  display: block;
  font-size: clamp(40px, 13vw, 56px); font-weight: 900; letter-spacing: -.06em; line-height: .95;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.b-score i { font-style: normal; color: var(--muted); font-size: .68em; margin: 0 2px; }
.b-ko { display: block; font-size: clamp(26px, 8vw, 34px); font-weight: 900; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.b-sub { display: block; margin-top: 7px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.b-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.b-meta { font-size: 11px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-sample { font-style: normal; color: #E7C263; font-weight: 800; }
.b-demo { margin-top: 10px; font-size: 10.5px; color: #C9A85C; line-height: 1.5; }
.btn-lime {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px; border-radius: 11px;
  background: linear-gradient(135deg, var(--lime), #9FEC00);
  color: var(--ink); font-size: 12px; font-weight: 900;
}
.iconbtn.on-dark { background: rgba(255, 255, 255, .07); border-color: var(--line); color: var(--text); }

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px;
  border-radius: 13px;
  font-size: 13px; font-weight: 800;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: transform .12s ease, background .16s ease;
}
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 12px; border-radius: 11px; }
.btn-wide { width: 100%; }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--text-dim); }
.btn-dark { background: var(--lime); color: var(--ink); border-color: transparent; }

/* ------------------------------------------------------------------
   Filters
   ------------------------------------------------------------------ */
.chiprow {
  display: flex; gap: 8px;
  margin: 0 -16px 14px; padding: 0 16px 4px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 13px;
  display: inline-flex; align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip.active {
  background: var(--lime); border-color: transparent; color: var(--ink); font-weight: 900;
  box-shadow: 0 8px 22px -14px var(--lime-glow);
}

.seg {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.seg button {
  height: 34px; border-radius: 10px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  transition: background .18s ease, color .18s ease;
}
.seg button.active { background: var(--surface-3); color: var(--text); font-weight: 900; box-shadow: inset 0 0 0 1px var(--line); }

.filterbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.filterbar .seg { flex: 1; min-width: 0; }
.filterbar .btn { flex: none; }

.filter-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; padding: 10px 12px;
  border-radius: 12px;
  background: rgba(201, 255, 63, .07);
  border: 1px solid rgba(201, 255, 63, .2);
  font-size: 11.5px; color: var(--text-dim);
}
.filter-note b { color: var(--text); }
.filter-note .text-link { font-size: 11px; }

/* ------------------------------------------------------------------
   Date navigation
   ------------------------------------------------------------------ */
.datenav {
  display: flex; align-items: center; gap: 6px;
  margin: 0 -16px 14px; padding: 2px 16px;
}
.days {
  display: flex; gap: 7px; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.days::-webkit-scrollbar { display: none; }
.day {
  position: relative;
  flex: none; width: 48px; height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-dim);
  scroll-snap-align: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.day:active { transform: scale(.95); }
.day .dow { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day .num { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.day .dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.day.has .dot { background: rgba(201, 255, 63, .55); }
.day.active { background: var(--lime); border-color: transparent; color: var(--ink); box-shadow: 0 12px 26px -16px var(--lime-glow); }
.day.active .dow { color: rgba(8, 17, 10, .65); }
.day.active .dot { background: var(--ink); }
.datestep {
  flex: none; width: 34px; height: 62px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface);
}

/* ------------------------------------------------------------------
   Panels & content blocks
   ------------------------------------------------------------------ */
.panel {
  margin-bottom: 12px;
  padding: 15px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 13.5px; font-weight: 900; letter-spacing: -.01em; }
.panel-note { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.panel-actions { display: flex; flex-direction: column; gap: 8px; }

.infolist { display: flex; flex-direction: column; }
.info-row {
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.info-row:last-child { border-bottom: 0; }
.info-row dt { color: var(--muted); font-weight: 600; }
.info-row dd { color: var(--text); font-weight: 600; word-break: break-word; }

.form-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  padding: 8px 0;
}
.form-row + .form-row { border-top: 1px solid var(--line); }
.form-row .nm { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchips { display: flex; gap: 4px; flex: none; }
.fchip {
  width: 19px; height: 19px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 900;
}
.fchip.W { background: rgba(201, 255, 63, .16); color: var(--lime); border: 1px solid rgba(201, 255, 63, .3); }
.fchip.D { background: rgba(255, 255, 255, .07); color: var(--text-dim); border: 1px solid var(--line); }
.fchip.L { background: rgba(255, 59, 92, .14); color: #FF8FA1; border: 1px solid rgba(255, 59, 92, .3); }
.form-na { font-size: 11px; color: var(--muted); }
.mini-sample { font-style: normal; font-size: 8px; font-weight: 800; letter-spacing: .1em; color: #C9A85C; }

.date-label {
  margin: 18px 4px 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.date-label + .mlist { margin-top: 0; }

/* Standings */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.stbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.stbl th {
  padding: 0 6px 8px; text-align: right;
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.stbl th:nth-child(2) { text-align: left; }
.stbl td { padding: 9px 6px; text-align: right; border-top: 1px solid var(--line); color: var(--text-dim); }
.stbl td.rk { text-align: center; color: var(--muted); font-weight: 800; width: 22px; }
.stbl td.rk.rank-top { color: var(--lime); }
.stbl td.tteam {
  text-align: left; color: var(--text); font-weight: 700;
  display: flex; align-items: center; gap: 7px; min-width: 0;
}
.stbl td.tteam span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 132px; }
.stbl td.pts { color: var(--text); font-weight: 900; }
.table-note { margin-top: 10px; font-size: 10.5px; color: var(--muted); }

/* Lineups */
.xi-grid { display: grid; gap: 16px; }
.xi-col { min-width: 0; }
.xi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.xi-head b { font-size: 12.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xi-count { margin-left: auto; font-size: 10px; font-weight: 800; color: var(--muted); }
.xi { list-style: none; }
.xi li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px;
}
.xnum { font-size: 10.5px; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.xnm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xpos { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
details.subs { margin-top: 8px; }
details.subs summary {
  font-size: 11px; font-weight: 800; color: var(--lime); cursor: pointer;
  padding: 8px 0; list-style: none;
}
details.subs summary::-webkit-details-marker { display: none; }

/* Timeline */
.tl { list-style: none; position: relative; }
.tl::before {
  content: ""; position: absolute; left: 61px; top: 6px; bottom: 6px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}
.tl-item {
  position: relative;
  display: grid; grid-template-columns: 34px 26px minmax(0, 1fr);
  align-items: center; gap: 10px;
  padding: 9px 0;
}
.tl-min { font-size: 11.5px; font-weight: 900; color: var(--lime); text-align: right; font-variant-numeric: tabular-nums; }
.tl-ic {
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1px solid var(--line);
  color: var(--text-dim); z-index: 1;
}
.tl-ic.goal { background: rgba(201, 255, 63, .14); border-color: rgba(201, 255, 63, .3); color: var(--lime); }
.tl-ic.red { background: rgba(255, 59, 92, .16); border-color: rgba(255, 59, 92, .34); color: #FF6C85; }
.tl-ic.yellow { background: rgba(231, 194, 99, .14); border-color: rgba(231, 194, 99, .3); color: #E7C263; }
.tl-body { min-width: 0; }
.tl-body b { display: block; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-body span { display: block; font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scorers */
.scor { list-style: none; }
.srow {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.srow:first-child { border-top: 0; }
.srow .rk { font-size: 11px; font-weight: 900; color: var(--muted); text-align: center; }
.srow .snm { font-size: 12.5px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .stm { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }
.sgl { font-size: 15px; font-weight: 900; color: var(--lime); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   Tabs (match centre)
   ------------------------------------------------------------------ */
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px; margin: 14px 0 12px; padding: 4px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.tab-btn {
  height: 36px; border-radius: 10px;
  font-size: 12px; font-weight: 700; color: var(--muted);
  transition: background .18s ease, color .18s ease;
}
.tab-btn[aria-selected="true"] { background: var(--lime); color: var(--ink); font-weight: 900; }
.tab-panel { animation: pageIn .28s ease both; }

.backlink {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 36px; padding: 0 10px 0 6px; margin-bottom: 10px;
  border-radius: 10px; color: var(--text-dim); font-size: 12.5px; font-weight: 700;
}
.backlink:active { background: var(--surface-2); }

/* ------------------------------------------------------------------
   Leagues
   ------------------------------------------------------------------ */
.lgrid { display: grid; gap: 9px; }
.lcard {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .14s ease, border-color .18s ease;
}
.lcard:active { transform: scale(.985); }
.lcard::before {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 255, 63, .16), transparent 70%);
  pointer-events: none;
}
.lbody { min-width: 0; flex: 1; }
.lbody b { display: block; font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbody small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.lcount {
  flex: none; min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: rgba(201, 255, 63, .10);
  border: 1px solid rgba(201, 255, 63, .22);
  font-size: 11px; font-weight: 900; color: var(--lime);
  font-variant-numeric: tabular-nums;
}
.lchev { flex: none; color: var(--muted); }
.lsaved { flex: none; color: var(--lime); }

.league-head {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 2px 16px;
}
.league-head-body { min-width: 0; }
.league-head h1 {
  margin-top: 6px; font-size: clamp(24px, 7.5vw, 34px); font-weight: 900; letter-spacing: -.04em;
  overflow: hidden; text-overflow: ellipsis;
}
.league-head .sub { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* ------------------------------------------------------------------
   Empty, banner, toast
   ------------------------------------------------------------------ */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 30px 18px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, .035), transparent 70%);
  border: 1px dashed var(--line-strong);
}
.empty-ic {
  width: 52px; height: 52px; margin-bottom: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 18px;
  background: rgba(201, 255, 63, .10);
  border: 1px solid rgba(201, 255, 63, .22);
  color: var(--lime);
}
.empty b { font-size: 14px; font-weight: 800; }
.empty p { font-size: 12px; color: var(--muted); line-height: 1.55; max-width: 34ch; }
.empty-action { margin-top: 6px; }

.banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 14px; padding: 11px 12px;
  border-radius: 14px;
  background: rgba(231, 194, 99, .08);
  border: 1px solid rgba(231, 194, 99, .25);
}
.banner-ic { flex: none; color: #E7C263; margin-top: 1px; }
.banner-body { flex: 1; min-width: 0; }
.banner-body b { display: block; font-size: 12px; color: #F0D38C; }
.banner-body span { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.5; color: #B99F6B; }
.banner .btn { flex: none; align-self: center; }

#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom));
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: calc(100% - 32px); max-width: 380px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(20, 27, 38, .96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -22px #000;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  animation: toastIn .26s cubic-bezier(.22, .9, .3, 1) both;
}
.toast svg { color: var(--lime); }
.toast.out { animation: toastOut .3s ease forwards; }

/* ------------------------------------------------------------------
   Loading skeleton
   ------------------------------------------------------------------ */
.loading { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.skel {
  height: 62px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 38%, var(--surface) 56%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border: 1px solid var(--line);
}
.skel-head { height: 76px; }
.skel-board { height: 190px; border-radius: var(--radius-lg); }

/* ------------------------------------------------------------------
   Bottom tab bar
   ------------------------------------------------------------------ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.tabbar-in {
  pointer-events: auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px; padding: 7px;
  border-radius: 22px;
  background: rgba(14, 20, 29, .92);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.tab-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; border-radius: 16px;
  color: #6E7A8C;
  transition: color .18s ease, background .18s ease, transform .12s ease;
}
.tab-item:active { transform: scale(.94); }
.tab-item .tab-ico { position: relative; display: block; }
.tab-item .tab-label { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tab-item.active { color: var(--lime); background: rgba(201, 255, 63, .09); }
.tab-item.active .tab-label { color: var(--lime); }
.nav-dot {
  position: absolute; top: -2px; right: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 8px var(--live);
}

/* ------------------------------------------------------------------
   Desktop rail
   ------------------------------------------------------------------ */
.rail { display: none; }

/* ------------------------------------------------------------------
   Sheet (settings)
   ------------------------------------------------------------------ */
.sheet {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-back {
  position: absolute; inset: 0;
  background: rgba(3, 5, 8, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn .2s ease both;
}
.sheet-card {
  position: relative;
  width: 100%; max-width: 460px;
  max-height: 88vh; overflow-y: auto;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #131B26 0%, #0C121A 100%);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  box-shadow: 0 -20px 60px -20px #000;
  animation: sheetUp .32s cubic-bezier(.22, .9, .3, 1) both;
}
.sheet-card::before {
  content: "";
  display: block; width: 40px; height: 4px; margin: 2px auto 14px;
  border-radius: 4px; background: var(--line-strong);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.modal-head h2 { margin-top: 5px; font-size: 21px; font-weight: 900; letter-spacing: -.03em; }
.setting-block { display: flex; flex-direction: column; gap: 2px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.sl { font-size: 13px; font-weight: 700; min-width: 0; }
.sl small { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.source-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-dim); }
.source-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.source-dot.live { background: var(--lime); box-shadow: 0 0 8px var(--lime-glow); }
.source-dot.demo { background: #E7C263; box-shadow: 0 0 8px rgba(231, 194, 99, .4); }
.source-dot.idle { background: var(--muted); animation: pulse 2s ease-out infinite; }
.sel {
  height: 38px; padding: 0 10px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: 12px; font-weight: 700;
  -webkit-appearance: none; appearance: none;
}
.sel option { background: #131B26; color: var(--text); }
.modal-note { margin-top: 16px; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}
.brand-mini { display: inline-flex; align-items: center; gap: 8px; }
.brand-mini b { font-size: 12px; letter-spacing: .16em; }

/* ------------------------------------------------------------------
   Sidebar (desktop only)
   ------------------------------------------------------------------ */
.side-brand { padding: 6px 10px 22px; }
.side-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px; margin: 0 4px 18px;
  border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted);
}
.side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 13px; color: var(--text); }
.side-search input::placeholder { color: var(--muted); }
.side-label {
  padding: 0 12px 8px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-item {
  display: flex; align-items: center; gap: 11px;
  min-height: 44px; padding: 0 12px; border-radius: 12px;
  color: var(--text-dim); font-size: 13.5px; font-weight: 600;
  transition: background .16s ease, color .16s ease;
}
.side-item .nav-ico { display: inline-flex; color: #6E7A8C; }
.side-item:hover { background: var(--surface); }
.side-item.active { background: rgba(201, 255, 63, .10); color: var(--text); font-weight: 800; }
.side-item.active .nav-ico { color: var(--lime); }
.nav-count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--live); color: #fff; font-size: 10px; font-weight: 900;
}
.side-foot {
  margin-top: auto; padding: 14px 10px 4px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.side-settings {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 8px; border-radius: 10px;
  font-size: 12px; font-weight: 700; color: var(--text-dim);
}
.side-settings:hover { background: var(--surface); }

/* ------------------------------------------------------------------
   Error page
   ------------------------------------------------------------------ */
.error-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 32px 20px; text-align: center;
}
.error-brand { display: flex; align-items: center; gap: 10px; }
.error-card {
  width: 100%; max-width: 380px;
  padding: 30px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #14201B, #0B111A 55%, #141026);
  border: 1px solid rgba(201, 255, 63, .18);
  box-shadow: var(--shadow);
}
.error-code {
  display: block;
  font-size: 56px; font-weight: 900; letter-spacing: -.06em; line-height: 1;
  background: linear-gradient(180deg, var(--lime), rgba(201, 255, 63, .25));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-card h1 { margin-top: 6px; font-size: 24px; }
.error-card p { margin: 8px 0 20px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.error-note { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------------
   Tablet
   ------------------------------------------------------------------ */
@media (min-width: 620px) {
  .page { padding-left: 22px; padding-right: 22px; }
  .lgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .panel-actions { flex-direction: row; }
  .panel-actions .btn { flex: 1; }
  .hero { padding: 20px 20px 16px; }
  .hero-body { margin: 22px 0 18px; }
  .chiprow { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .datenav { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
}

/* ------------------------------------------------------------------
   Desktop
   ------------------------------------------------------------------ */
@media (min-width: 1000px) {
  .topbar { display: none; }
  .layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr) 310px;
    gap: 30px;
    max-width: 1360px;
    margin: 0 auto;
    padding: 26px 28px 60px;
    align-items: start;
  }
  .sidebar {
    display: flex; flex-direction: column;
    position: sticky; top: 26px;
    height: calc(100vh - 52px);
    padding: 8px 4px;
  }
  .tabbar { display: none; }
  .page { max-width: none; padding: 0; }
  .rail {
    display: block;
    position: sticky; top: 26px;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .page-head h1, .live-head h1 { font-size: 40px; }
  .section-head { margin-top: 30px; }
  .mrow { grid-template-columns: 46px minmax(0, 1fr) 44px; min-height: 66px; padding: 10px 10px 10px 14px; }
  .tname { font-size: 14px; }
  .tscore { font-size: 16px; }
  #toasts { left: auto; right: 28px; transform: none; bottom: 28px; }
  .lgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 22px 24px 18px; }
  .hero-name { font-size: 14px; }
  .hero-score { font-size: 60px; }
  .hero .badge.xl { width: 72px; height: 72px; border-radius: 22px; }
  .hero .badge.xl .fb { font-size: 21px; }
}

@media (min-width: 1240px) {
  .layout { grid-template-columns: 244px minmax(0, 1fr) 330px; gap: 34px; }
}

/* Rail cards */
.rail-card {
  padding: 15px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.rail-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.rail-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live-glow); }
.rail-dot.off { background: var(--muted); box-shadow: none; }
.rail-empty { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.rail-live {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line);
  cursor: pointer;
}
.rail-live:first-of-type { border-top: 0; }
.rl-teams { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rl-teams b { font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.rl-teams span { font-size: 11px; color: var(--muted); }
.rl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.rl-score { font-size: 13px; font-weight: 900; color: var(--lime); font-variant-numeric: tabular-nums; }
.rl-min { font-size: 9px; font-weight: 800; color: #FF8FA1; letter-spacing: .06em; }
.rail-comp {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-dim);
}
.rail-comp:first-of-type { border-top: 0; }
.rail-comp span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-comp b { color: var(--muted); font-size: 10.5px; }
.source-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text); }
.rail-source p { margin: 7px 0 11px; font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.rail-source .btn { width: 100%; }

/* ------------------------------------------------------------------
   Motion
   ------------------------------------------------------------------ */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 92, .5); opacity: 1; }
  70% { box-shadow: 0 0 0 6px rgba(255, 59, 92, 0); opacity: .85; }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0); opacity: 1; }
}
@keyframes aura {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .95; }
  to { transform: translate3d(0, -10px, 0) scale(1.06); opacity: 1; }
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
@keyframes shimmer {
  from { background-position: 140% 0; }
  to { background-position: -40% 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes pageIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.97); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translate3d(0, 10px, 0) scale(.97); }
}
@keyframes sheetUp {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none !important; }
}
