/* =========================================================================
   ClutchAlert — styles
   ========================================================================= */
:root {
  --bg: #07080d;
  --bg2: #0d0f17;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --solid: #12141e;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f4f5fa;
  --text-2: #a3a8bd;
  --text-3: #6b7088;
  --accent: #ff4d6d;
  --accent-2: #ff9f1c;
  --live: #ff3355;
  --blur: saturate(160%) blur(22px);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  /* tier colors */
  --t-must-1: #ff2e63; --t-must-2: #ff9f1c;
  --t-great: #ff7a3d;
  --t-good: #b6f23b;
  --t-decent: #3ec5ff;
  --t-meh: #5e6580;
  --c-upset: #b18cff;
  --c-rank: #ffcc33;
  --c-ot: #ff4fd8;
  --c-cold: #6f8bb3;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5fb;
  --bg2: #e9ebf5;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(15, 18, 40, 0.06);
  --solid: #ffffff;
  --border: rgba(15, 18, 40, 0.08);
  --border-2: rgba(15, 18, 40, 0.14);
  --text: #0d1020;
  --text-2: #4b5170;
  --text-3: #8b90a8;
  --shadow: 0 10px 30px -14px rgba(20, 24, 60, 0.25);
  --t-good: #6cbf00;
  --t-meh: #9aa0b8;
  --c-rank: #e0a800;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  font: 15px/1.4 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; }
.ic { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
h1, h2, h3, h4, .num, .score, .ring-num, .rank-no { font-family: 'Outfit', 'Inter', sans-serif; }

/* ---------- animated background ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(80px); opacity: .22; animation: drift 26s ease-in-out infinite alternate;
}
.bg-fx i:nth-child(1) { background: #ff2e63; top: -25vmax; left: -20vmax; }
.bg-fx i:nth-child(2) { background: #5b3cff; top: 30vh; right: -30vmax; animation-delay: -8s; opacity: .18; }
.bg-fx i:nth-child(3) { background: #ff9f1c; bottom: -35vmax; left: 10vw; animation-delay: -16s; opacity: .12; }
[data-theme="light"] .bg-fx i { opacity: .14; }
@keyframes drift { to { transform: translate(8vw, 6vh) scale(1.15); } }

/* ---------- app layout ---------- */
.app { max-width: 640px; margin: 0 auto; padding-bottom: calc(96px + var(--safe-b)); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(10px + var(--safe-t)) 16px 0;
  background: linear-gradient(to bottom, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 100%);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.brand-row { display: flex; align-items: center; gap: 10px; height: 44px; }
.brand { display: flex; align-items: center; gap: 9px; font: 800 21px/1 'Outfit', sans-serif; letter-spacing: -.02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2));
  box-shadow: 0 6px 18px -4px rgba(255, 46, 99, .6);
}
.brand-mark .ic { width: 19px; height: 19px; color: #fff; }
.brand em { font-style: normal; background: linear-gradient(90deg, var(--t-must-1), var(--t-must-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.updated { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); transition: transform .2s var(--spring), background .2s;
}
.icon-btn:active { transform: scale(.9); }
#refresh { position: relative; }
#refresh::before {
  content: ''; position: absolute; inset: -1px; border-radius: 12px; padding: 2px;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 360deg), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .7; transition: opacity .3s;
}
#refresh.spin .ic, .is-loading #refresh .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* date switcher */
.datebar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0 2px; }
.datebar button.arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.datebar button.arrow:disabled { opacity: .25; }
#day-label { font: 700 15px 'Outfit', sans-serif; padding: 6px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); min-width: 120px; }

/* league chips */
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 12px; margin: 0 -16px;
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chips.inline { margin: 0 0 12px; padding: 2px 0 6px; }
.chip {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  transition: all .25s var(--ease);
}
.chip.no-games { opacity: .5; }
.chip-emoji { font-size: 14px; filter: saturate(1.2); }
.chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2));
  box-shadow: 0 8px 20px -8px rgba(255, 46, 99, .7);
  opacity: 1;
}
.chip:active { transform: scale(.94); }
.chip-live {
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--live); color: #fff;
}
.chip.active .chip-live { background: rgba(255, 255, 255, .25); }

/* pull to refresh */
#ptr {
  position: fixed; top: calc(var(--safe-t) + 120px); left: 50%; z-index: 40; width: 40px; height: 40px; margin-left: -20px;
  border-radius: 50%; display: grid; place-items: center; background: var(--solid); border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  transform: translateY(calc(var(--pull, 0) * 1px - 60px)) rotate(calc(var(--pull, 0) * 3deg)); opacity: calc(var(--pull, 0) / 80);
  pointer-events: none;
}
#ptr.ready { color: var(--accent); }

/* ---------- view ---------- */
#view { padding: 4px 16px 0; min-height: 60vh; }
#view.view-in { animation: view-in .45s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateX(calc(var(--dir, 0) * 24px)) translateY(6px); } }

.sec { margin-top: 22px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.sec-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.sec-sub { font-size: 12px; color: var(--text-3); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255, 51, 85, .6); animation: ping 1.6s infinite; display: inline-block; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(255, 51, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 51, 85, 0); } }
.list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat {
  padding: 10px 6px; border-radius: 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
}
.stat b { display: block; font: 800 22px/1.1 'Outfit', sans-serif; color: var(--text-3); }
.stat span { font-size: 11px; color: var(--text-3); }
.stat.has b { color: var(--text); }
.stat-live.has b { color: var(--live); }
.stat-must.has b { background: linear-gradient(90deg, var(--t-must-1), var(--t-must-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-clutch.has b { color: var(--t-great); }
.stat-upset.has b { color: var(--c-upset); }
button.stat { font: inherit; color: inherit; cursor: pointer; transition: transform .25s var(--spring), border-color .25s, background .25s, box-shadow .25s; }
button.stat:disabled { cursor: default; opacity: .6; }
button.stat:not(:disabled):active { transform: scale(.94); }
.stat { --sc: var(--text-2); }
.stat-live { --sc: var(--live); } .stat-must { --sc: var(--t-must-1); } .stat-clutch { --sc: var(--t-great); } .stat-upset { --sc: var(--c-upset); }
.stat.on {
  border-color: var(--sc);
  background: color-mix(in srgb, var(--sc) 16%, var(--surface));
  box-shadow: 0 0 0 1px var(--sc), 0 8px 22px -10px var(--sc);
  transform: translateY(-2px);
}
.focus-bar {
  display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 4px 4px 4px 14px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2);
  animation: pop-in .3s var(--ease);
}
.focus-bar b { color: var(--text); }
.focus-bar .ic { width: 15px; height: 15px; }

/* ---------- hero ---------- */
.hero {
  position: relative; margin-top: 8px; padding: 18px 18px 16px; border-radius: 28px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border-2); isolation: isolate;
  animation: pop-in .6s var(--ease);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--c1) 55%, transparent), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--c2) 55%, transparent), transparent 60%),
    var(--solid);
}
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.35)); }
[data-theme="light"] .hero-bg::after { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.75)); }
.hero.tier-must { border-color: transparent; }
.hero.tier-must::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; z-index: 1; pointer-events: none;
  background: conic-gradient(from var(--angle), var(--t-must-1), var(--t-must-2), #ffe066, var(--t-must-1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rotate 4s linear infinite;
}
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes rotate { to { --angle: 360deg; } }
.hero-head { display: flex; justify-content: space-between; align-items: center; }
.hero-kicker { display: flex; align-items: center; gap: 6px; font: 700 12px 'Outfit'; text-transform: uppercase; letter-spacing: .12em; color: #fff; }
[data-theme="light"] .hero-kicker { color: var(--text); }
.hero-kicker .ic { color: var(--t-must-2); width: 16px; height: 16px; }
.hero-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin: 14px 0 10px; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.hero-team img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.hero-team span { font: 700 15px 'Outfit'; }
.hero-team strong { font: 800 34px/1 'Outfit'; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-team small { color: var(--text-2); }
.hero-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero-tier { font: 800 12px 'Outfit'; text-transform: uppercase; letter-spacing: .1em; }
.hero.tier-must .hero-tier { color: var(--t-must-2); }
.hero-foot { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.hero-tags:empty { display: none; }

/* ---------- card ---------- */
.card {
  position: relative; border-radius: var(--radius); padding: 12px 14px 12px; cursor: pointer; overflow: hidden; isolation: isolate;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--c1) 16%, transparent) 0%, transparent 38%, transparent 62%, color-mix(in srgb, var(--c2) 16%, transparent) 100%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .25s var(--spring), border-color .3s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card:active { transform: scale(.98); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.enter { animation: card-in .55s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }
.card.climbed { animation: climbed 1.4s var(--ease); }
@keyframes climbed { 0%, 40% { box-shadow: 0 0 0 2px var(--t-good), var(--shadow); } }

/* tier accents: left edge bar + glow */
.card::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--tier, var(--t-meh));
}
.tier-must  { --tier: linear-gradient(180deg, var(--t-must-1), var(--t-must-2)); --tier-c: var(--t-must-1); }
.tier-great { --tier: var(--t-great); --tier-c: var(--t-great); }
.tier-good  { --tier: var(--t-good); --tier-c: var(--t-good); }
.tier-decent{ --tier: var(--t-decent); --tier-c: var(--t-decent); }
.tier-meh   { --tier: var(--t-meh); --tier-c: var(--t-meh); }

.card.tier-must { border-color: color-mix(in srgb, var(--t-must-1) 45%, transparent); }
.card.tier-must .card-glow {
  position: absolute; inset: -40%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 40% at 85% 50%, color-mix(in srgb, var(--t-must-1) 35%, transparent), transparent 70%);
  animation: glow 3s ease-in-out infinite alternate;
}
@keyframes glow { from { opacity: .5; } to { opacity: 1; transform: scale(1.08); } }
.card.tier-great { border-color: color-mix(in srgb, var(--t-great) 30%, transparent); }
.card.is-followed { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-rank) 45%, transparent), var(--shadow); }

.card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); min-height: 26px; }
.rank-no { font-weight: 800; font-size: 13px; color: var(--text-3); min-width: 18px; }
.tier-must .rank-no { color: var(--t-must-1); }
.lg-badge {
  font: 700 10px 'Inter'; letter-spacing: .06em; padding: 3px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2); text-transform: uppercase;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 5px; font: 800 10px 'Inter'; letter-spacing: .08em;
  padding: 3px 7px; border-radius: 6px; background: color-mix(in srgb, var(--live) 18%, transparent); color: var(--live);
}
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.st { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st.final { color: var(--text-2); }
.tv { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv .ic { width: 13px; height: 13px; }
.follow-btn {
  margin-left: auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  color: var(--text-3); transition: transform .3s var(--spring), color .2s, background .2s;
}
.follow-btn .ic { width: 17px; height: 17px; }
.follow-btn.on { color: var(--c-rank); background: color-mix(in srgb, var(--c-rank) 15%, transparent); animation: ring-bell .6s var(--ease); }
@keyframes ring-bell { 20% { transform: rotate(-18deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }

.card-body { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.teams { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.team { display: flex; align-items: center; gap: 10px; transition: opacity .3s; }
.team.dim { opacity: .5; }
.logo-wrap {
  width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%);
}
.logo-wrap img { width: 28px; height: 28px; object-fit: contain; }
.logo-wrap b { font-size: 10px; }
.logo-wrap.lg { width: 64px; height: 64px; border-radius: 20px; }
.logo-wrap.lg img { width: 54px; height: 54px; }
.tname { flex: 1; min-width: 0; font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.rk { font: 700 11px 'Inter'; color: var(--c-rank); min-width: 12px; }
.fav-dot { color: var(--c-rank); display: inline-flex; }
.fav-dot .ic { width: 12px; height: 12px; }
.poss { width: 7px; height: 7px; border-radius: 50%; background: var(--t-good); box-shadow: 0 0 8px var(--t-good); flex: none; }
.rec { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.score { font: 800 22px/1 'Outfit'; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.score.bump { animation: bump .9s var(--spring); }
@keyframes bump { 0% { transform: scale(1); color: var(--text); } 30% { transform: scale(1.35); color: var(--t-good); text-shadow: 0 0 18px var(--t-good); } 100% { transform: scale(1); } }

.meter { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-left: 12px; border-left: 1px solid var(--border); }
.meter-label { font: 800 9px 'Inter'; letter-spacing: .12em; color: var(--text-3); display: flex; gap: 3px; align-items: center; }
.meter-label em { font-style: normal; font-size: 9px; }
.meter-label .up { color: var(--t-good); }
.meter-label .down { color: var(--text-3); }

/* ring gauge */
.ring { position: relative; width: var(--size); height: var(--size); display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg {
  stroke: var(--tier-c); stroke-linecap: round;
  animation: ring-fill 1.1s var(--ease) both;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--tier-c) 60%, transparent));
}
.ring.tier-must .ring-fg { stroke: url(#must-grad); }
@keyframes ring-fill { from { stroke-dashoffset: var(--circ); } }
.ring-num { font-weight: 800; font-size: calc(var(--size) * .36); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tier-must .ring-num { background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.card-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.situ { font-size: 12px; color: var(--text-2); font-weight: 600; margin-left: auto; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.progress i { display: block; height: 100%; background: var(--tier, var(--t-meh)); opacity: .8; border-radius: 0 3px 3px 0; transition: width 1s var(--ease); }

/* tags */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 8px;
  font: 700 11.5px 'Inter'; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.tag .ic { width: 13px; height: 13px; }
.tag-hot { background: color-mix(in srgb, var(--t-must-1) 16%, transparent); color: #ff5c80; }
.tag-upset { background: color-mix(in srgb, var(--c-upset) 18%, transparent); color: var(--c-upset); animation: upset-pulse 2s ease-in-out infinite; }
.tag-rank { background: color-mix(in srgb, var(--c-rank) 16%, transparent); color: var(--c-rank); }
.tag-ot { background: color-mix(in srgb, var(--c-ot) 16%, transparent); color: var(--c-ot); }
.tag-cold { background: color-mix(in srgb, var(--c-cold) 16%, transparent); color: var(--c-cold); }
[data-theme="light"] .tag-hot { color: #e01e4f; }
@keyframes upset-pulse { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-upset) 20%, transparent); } }

/* skeleton */
.skeleton { height: 112px; cursor: default; display: flex; flex-direction: column; gap: 10px; justify-content: center; animation: sk 1.4s ease-in-out infinite; }
.skeleton div { height: 12px; border-radius: 6px; background: var(--surface-2); }
.skeleton div:nth-child(1) { width: 40%; } .skeleton div:nth-child(2) { width: 75%; height: 18px; } .skeleton div:nth-child(3) { width: 65%; height: 18px; }
@keyframes sk { 50% { opacity: .45; } }

/* banner / panels */
.banner {
  position: relative; display: flex; gap: 12px; margin-top: 14px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--t-must-1) 18%, var(--solid)), color-mix(in srgb, #5b3cff 14%, var(--solid)));
  border: 1px solid var(--border-2); animation: pop-in .5s var(--ease);
}
.banner p { margin: 4px 0 12px; color: var(--text-2); font-size: 13.5px; }
.banner-ic, .perm-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2));
}
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; background: transparent; border: 0; color: var(--text-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: 14px;
  font-weight: 650; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: transform .2s var(--spring), filter .2s;
}
.btn:active { transform: scale(.95); }
.btn.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2)); box-shadow: 0 8px 22px -8px rgba(255, 46, 99, .7); }
.btn.ghost { background: transparent; }
.btn.on { color: var(--c-rank); border-color: color-mix(in srgb, var(--c-rank) 40%, transparent); background: color-mix(in srgb, var(--c-rank) 12%, transparent); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 11px; }

.empty { text-align: center; padding: 48px 20px; animation: pop-in .5s var(--ease); }
.empty-art {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 24px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--t-must-2);
}
.empty-art .ic { width: 32px; height: 32px; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px) rotate(8deg); } }
.empty h3 { margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 auto 18px; color: var(--text-2); max-width: 300px; font-size: 14px; }

/* ---------- my teams ---------- */
.mine-head h1, .page-head h1 { margin: 10px 0 2px; font-size: 30px; letter-spacing: -.02em; }
.mine-head p { margin: 0 0 12px; color: var(--text-2); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fav-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.fav-row.wrap { flex-wrap: wrap; overflow: visible; padding: 4px 0 12px; }
.fav-row::-webkit-scrollbar { display: none; }
.fav-chip {
  flex: none; display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px 0 6px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 22%, transparent), var(--surface)); border: 1px solid var(--border);
  font-weight: 650; font-size: 13.5px; animation: pop-in .4s var(--spring);
}
.fav-chip img { width: 28px; height: 28px; object-fit: contain; }
.fav-chip small { color: var(--text-3); font-size: 10.5px; font-weight: 700; }
.fav-chip .x { width: 14px; height: 14px; color: var(--text-3); }
.fav-chip.add { padding: 0 14px; color: var(--text-2); border-style: dashed; background: transparent; }

/* ---------- alerts ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; }
.panel.perm, .panel.install { display: flex; gap: 12px; padding: 16px; margin-bottom: 14px; }
.panel.perm p, .panel.install p { margin: 4px 0 10px; color: var(--text-2); font-size: 13.5px; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); animation: card-in .45s var(--ease) both;
}
.a-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.a-must .a-ic { background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2)); color: #fff; }
.a-clutch .a-ic { color: var(--t-great); background: color-mix(in srgb, var(--t-great) 18%, transparent); }
.a-upset .a-ic { color: var(--c-upset); background: color-mix(in srgb, var(--c-upset) 18%, transparent); }
.a-ot .a-ic { color: var(--c-ot); background: color-mix(in srgb, var(--c-ot) 18%, transparent); }
.a-start .a-ic, .a-final .a-ic { color: var(--c-rank); background: color-mix(in srgb, var(--c-rank) 15%, transparent); }
.a-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a-txt span { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-item time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* ---------- settings ---------- */
.group { margin-top: 18px; }
.group h3 { margin: 0 6px 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-family: 'Inter'; font-weight: 700; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 0; border-bottom: 1px solid var(--border); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row > span { display: flex; flex-direction: column; min-width: 0; }
.row small { color: var(--text-3); font-size: 12.5px; }
.row.danger { color: var(--live); font-weight: 650; justify-content: center; }
.slider-row { flex-wrap: wrap; }
.slider-row input { width: 100%; accent-color: var(--accent); }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; border-radius: 15px; position: relative; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-2); transition: background .25s;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .3s var(--spring);
}
.switch:checked { background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2)); border-color: transparent; }
.switch:checked::after { transform: translateX(20px); }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--surface-2); flex: none; }
.seg button { padding: 6px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: all .2s; }
.seg button.on { background: var(--solid); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.legend { padding: 12px 16px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.legend-row small { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }
.swatch { width: 26px; height: 8px; border-radius: 4px; background: var(--tier); }
.legend p { color: var(--text-2); font-size: 13px; line-height: 1.55; }
.fine { text-align: center; color: var(--text-3); font-size: 12px; margin: 22px 0; }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  width: min(420px, calc(100% - 24px)); height: 66px; padding: 6px; border-radius: 24px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--solid) 78%, transparent); border: 1px solid var(--border-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6);
}
.tabbar::before {
  content: ''; position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 4); border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t-must-1) 22%, transparent), color-mix(in srgb, var(--t-must-2) 16%, transparent));
  transform: translateX(calc(var(--idx, 0) * 100%)); transition: transform .45s var(--spring);
}
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 650; color: var(--text-3); transition: color .25s; }
.tabbar button .ic { width: 22px; height: 22px; transition: transform .35s var(--spring); }
.tabbar button.active { color: var(--text); }
.tabbar button.active .ic { transform: translateY(-1px) scale(1.08); color: var(--t-must-1); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--live); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
  animation: pop-in .4s var(--spring);
}

/* ---------- sheet ---------- */
#scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .35s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 70; width: min(640px, 100%); max-height: 92dvh; margin-left: max(-320px, -50%);
  display: flex; flex-direction: column; border-radius: 28px 28px 0 0; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border-2); border-bottom: 0;
  transform: translateY(105%); transition: transform .5s var(--ease); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
}
.sheet-open #scrim { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: translateY(0); }
.sheet-open { overflow: hidden; }
.sheet-grab { padding: 10px 0 4px; display: grid; place-items: center; cursor: grab; position: relative; }
.sheet-grab i { width: 40px; height: 5px; border-radius: 3px; background: var(--border-2); }
#sheet-close { position: absolute; right: 12px; top: 10px; width: 34px; height: 34px; }
#sheet-body { overflow-y: auto; padding: 0 18px calc(24px + var(--safe-b)); overscroll-behavior: contain; }

.sh-head { margin: 0 -18px; padding: 8px 18px 18px; background:
  radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--c1) 35%, transparent), transparent 60%),
  radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--c2) 35%, transparent), transparent 60%); }
.sh-meta { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; }
.sh-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; margin-top: 14px; gap: 6px; }
.sh-team { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sh-team b { font: 700 15px 'Outfit'; display: flex; gap: 4px; align-items: center; }
.sh-team small { color: var(--text-2); font-size: 12px; }
.star-btn { display: inline-flex; gap: 4px; align-items: center; margin-top: 4px; font-size: 11.5px; font-weight: 650; color: var(--text-3); padding: 4px 9px; border-radius: 9px; border: 1px solid var(--border); }
.star-btn .ic { width: 13px; height: 13px; }
.star-btn.on { color: var(--c-rank); border-color: color-mix(in srgb, var(--c-rank) 40%, transparent); }
.sh-score { display: flex; align-items: center; gap: 8px; font: 800 44px/1 'Outfit'; padding-top: 14px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.sh-score i { font-style: normal; color: var(--text-3); font-size: 28px; }
.sh-score .vs { font-size: 20px; color: var(--text-3); letter-spacing: .1em; }
.sh-headline { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 0; font-size: 13px; color: var(--c-rank); font-weight: 600; }
.sh-headline .ic { width: 15px; height: 15px; }

.sh-rating { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-top: 6px; }
.sh-rating h3 { margin: 2px 0 8px; font-size: 26px; letter-spacing: -.02em; }
.sh-rating.tier-must h3 { background: linear-gradient(90deg, var(--t-must-1), var(--t-must-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sh-rating .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kicker { font: 700 11px 'Inter'; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); }
.sh-actions { display: flex; gap: 8px; margin-top: 12px; }
.sh-actions .btn { flex: 1; }

.block { margin-top: 18px; }
.block h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-family: 'Inter'; }
.factor { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13.5px; }
.factor span { color: var(--text-2); }
.factor b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); border-radius: 4px; background: linear-gradient(90deg, var(--t-must-1), var(--t-must-2)); animation: grow .9s var(--ease) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.wp { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.wp span { width: var(--w); background: var(--tc); transition: width 1s var(--ease); }
.wp-lbl { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; }
.spark { width: 100%; height: 80px; display: block; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .grid { stroke: var(--border); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.spark .pt { fill: var(--accent); }
.last-play { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.linescore { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.linescore table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.linescore th, .linescore td { padding: 8px 8px; text-align: center; }
.linescore th { color: var(--text-3); font-weight: 600; font-size: 12px; background: var(--surface); }
.linescore td:first-child { text-align: left; font-weight: 700; padding-left: 12px; }
.linescore tr + tr td { border-top: 1px solid var(--border); }
.info { display: grid; gap: 1px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.info div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--surface); font-size: 13.5px; }
.info span { color: var(--text-3); }
.info b { text-align: right; font-weight: 600; }

/* picker */
.picker h2 { margin: 4px 0 12px; font-size: 22px; }
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px; }
.team-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.team-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; text-align: left; transition: background .2s; }
.team-item:active { background: var(--surface-2); }
.team-item > span:nth-child(2) { flex: 1; font-weight: 600; }
.team-item .star { color: var(--text-3); transition: transform .3s var(--spring); }
.team-item.on { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 18%, transparent), transparent); }
.team-item.on .star { color: var(--c-rank); transform: scale(1.15); }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: calc(var(--safe-t) + 10px); left: 50%; transform: translateX(-50%); z-index: 90; width: min(420px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; flex-direction: column; padding: 12px 16px; border-radius: 18px;
  background: color-mix(in srgb, var(--solid) 88%, transparent); border: 1px solid var(--border-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .55);
  animation: toast-in .5s var(--spring);
}
.toast span { color: var(--text-2); font-size: 13px; }
.toast.t-must { border-color: color-mix(in srgb, var(--t-must-1) 60%, transparent); }
.toast.t-upset { border-color: color-mix(in srgb, var(--c-upset) 60%, transparent); }
.toast.out { animation: toast-out .4s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-30px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-20px) scale(.95); } }

/* tab-specific chrome */
body[data-tab="alerts"] #filters, body[data-tab="settings"] #filters { display: none; }

@media (min-width: 700px) {
  .tname { font-size: 16px; }
  .hero-team img { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- full-game timeline ---------- */
.block h4 small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-3); }
.tl { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair;
  padding: 6px 4px 0; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.tl svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl .area { fill: url(#tlf); animation: tl-fade .8s var(--ease) both; }
.tl .ln { fill: none; stroke: url(#tls); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: tl-draw 1.4s var(--ease) forwards; }
.tl .wpl { fill: none; stroke-width: 1.4; stroke-dasharray: 3 3; opacity: .75; }
.tl .div { stroke: var(--border-2); stroke-dasharray: 2 4; }
.tl .band { stroke: color-mix(in srgb, var(--t-must-1) 30%, transparent); stroke-dasharray: 1 5; }
.tl .band-l { fill: var(--text-3); font: 600 8px 'Inter'; text-anchor: end; }
.tl .lbl { fill: var(--text-3); font: 700 9.5px 'Inter'; text-anchor: middle; }
.tl .future { fill: var(--surface-2); opacity: .5; }
.tl .peak-dot { fill: var(--bg2); stroke: var(--t-must-2); stroke-width: 2; }
.tl .now-dot { fill: var(--live); animation: blink 1.2s infinite; }
@keyframes tl-draw { to { stroke-dashoffset: 0; } }
@keyframes tl-fade { from { opacity: 0; } }
.tl .peak { position: absolute; transform: translate(-50%, -150%); font: 800 10.5px 'Outfit'; padding: 2px 6px; border-radius: 6px;
  background: linear-gradient(135deg, var(--t-must-1), var(--t-must-2)); color: #fff; white-space: nowrap; pointer-events: none; margin-top: 6px; }
.tl .scrub { position: absolute; top: 6px; bottom: 20px; width: 0; pointer-events: none; }
.tl .scrub i { position: absolute; top: 0; bottom: 0; left: -0.5px; width: 1px; background: var(--text-2); }
.tl .tip { position: absolute; top: 0; left: 8px; min-width: 120px; padding: 7px 9px; border-radius: 10px; font-size: 12px; line-height: 1.4;
  background: var(--solid); border: 1px solid var(--border-2); box-shadow: var(--shadow); white-space: nowrap; }
.tl .tip.flip { left: auto; right: 8px; }
.tl .tip b { font: 800 15px 'Outfit'; }
.tl .tip span { color: var(--text-3); }
.tl-legend { display: flex; gap: 14px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.tl-legend .muted { margin-left: auto; }
.tl-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw-w { background: linear-gradient(90deg, var(--t-must-1), var(--t-must-2)); }
.tl-loading { height: 150px; border-radius: 16px; display: grid; place-items: center; color: var(--text-3); font-size: 13px;
  background: var(--surface); border: 1px solid var(--border); animation: sk 1.4s ease-in-out infinite; }

/* ---------- betting line ---------- */
.odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.odds div { padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.odds span { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.odds b { font: 700 16px 'Outfit'; font-variant-numeric: tabular-nums; }
.odds b.ml { font-size: 13px; line-height: 1.35; }
.odds-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.oc { font: 700 12px 'Inter'; padding: 5px 10px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); }
.oc-fav, .oc-over { background: color-mix(in srgb, var(--t-good) 16%, transparent); color: var(--t-good); }
.oc-dog { background: color-mix(in srgb, var(--c-upset) 16%, transparent); color: var(--c-upset); }
.oc-under { background: color-mix(in srgb, var(--t-decent) 16%, transparent); color: var(--t-decent); }
.line-txt { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; }
.tl .peak.r { transform: translate(-100%, -150%); margin-left: 6px; }
.tl .peak.l { transform: translate(-6px, -150%); }
.tl .peak.below { margin-top: 30px; }
.tl .peak.r.below { transform: translate(-100%, -50%); margin-top: 18px; }

/* win probability panel inside the timeline */
.tl .wp-bg { fill: var(--surface); }
.tl .wp-mid { stroke: var(--border-2); stroke-dasharray: 3 3; }
.tl .wp-ln { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; opacity: .9; }
.tl .wp-t { font: 800 9.5px 'Inter'; letter-spacing: .04em; }
.tl .wp-v { font: 800 10px 'Outfit'; text-anchor: end; }
.tl .wp-h { fill: var(--text-3); font: 700 8px 'Inter'; letter-spacing: .14em; text-anchor: middle; }
.tl-legend .sw-p { width: 8px !important; height: 8px !important; border-radius: 50% !important; margin-right: 3px !important; }
