/* =============================================================================
   Survivor Fantasy 2.1 — themes
   Every color comes from the variables below. A theme is just a set of values;
   <html data-theme="…"> picks one (More → Appearance). Classic is the default.
   ============================================================================= */

:root {
  /* Shared across themes: meaning-carrying colors stay the same everywhere. */
  --gold: #f4c452;
  --silver: #c9ccd3;
  --bronze: #d08a54;
  --good: #52d38f;
  --bad: #ff6262;
  --warn: #f6b740;
  --grad-gold: linear-gradient(135deg, #ffe08a 0%, #f4c452 50%, #c8902a 100%);

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 50px rgba(0, 0, 0, 0.45);

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
  --content-w: 640px;

}
:root, [data-theme] {
  /* Built from the theme values, recomputed wherever a theme is applied */
  --line: rgba(var(--tint-rgb), 0.075);
  --line-2: rgba(var(--tint-rgb), 0.13);
  --line-3: rgba(var(--tint-rgb), 0.22);
  --text-2: rgba(var(--text-rgb), 0.70);
  --text-3: rgba(var(--text-rgb), 0.50);
  --text-4: rgba(var(--text-rgb), 0.34);
  --grad-card: linear-gradient(180deg, rgba(var(--tint-rgb), 0.050) 0%, rgba(var(--tint-rgb), 0.022) 100%);
  --glow-fire: 0 6px 26px rgba(var(--accent-rgb), 0.30);
  --glow-tide: 0 6px 26px rgba(var(--tide-rgb), 0.26);
}

/* Classic — graphite and gold. The 1.x look, refined. */
:root, [data-theme="classic"] {
  --bg: #101115; --bg-rgb: 16, 17, 21; --bg-2: #15171c;
  --surface: #181a20; --surface-2: #1f2229; --surface-3: #282b34; --surface-4: #31353f;
  --tint-rgb: 255, 255, 255;
  --text: #f2f3f6; --text-rgb: 242, 243, 246;
  --fire: #d9b65e; --fire-hi: #ecd08a; --ember: #b8913a; --fire-ink: #271c04;
  --accent-rgb: 217, 182, 94; --accent-hi-rgb: 236, 208, 138;
  --grad-fire: linear-gradient(135deg, #f0d89a 0%, #d9b65e 50%, #b8913a 100%);
  --boot: #ff7a59; --boot-hi: #ffa086; --boot-rgb: 255, 122, 89;
  --tide: #56c2f0; --tide-hi: #a6dcf7; --tide-rgb: 86, 194, 240; --tide-ink: #04202e;
  --grad-tide: linear-gradient(135deg, #a6dcf7 0%, #56c2f0 50%, #2a93c4 100%);
  --sheet-bg: linear-gradient(180deg, #23262e, #1a1c22 40%);
  --toast-bg: rgba(36, 38, 46, .97); --tabbar-bg: rgba(27, 29, 36, .86);
  --av-a: #363a46; --av-b: #1f2128; --option-bg: #1f2128;
  --info-ink: #f1e2b8; --tide-text: #c9ecfb;
  --font-display: "Inter", system-ui, sans-serif;
  --display-tracking: -0.035em;
}

/* Midnight — navy and periwinkle, like Tribal Council after dark. */
[data-theme="midnight"] {
  --bg: #0a0d18; --bg-rgb: 10, 13, 24; --bg-2: #0e1220;
  --surface: #121728; --surface-2: #182037; --surface-3: #202a45; --surface-4: #293554;
  --tint-rgb: 190, 205, 255;
  --text: #eef1fb; --text-rgb: 238, 241, 251;
  --fire: #8aa4ff; --fire-hi: #b4c4ff; --ember: #5f78ea; --fire-ink: #0a1230;
  --accent-rgb: 138, 164, 255; --accent-hi-rgb: 180, 196, 255;
  --grad-fire: linear-gradient(135deg, #c3cfff 0%, #8aa4ff 50%, #5f74e6 100%);
  --boot: #ff7d6e; --boot-hi: #ffa39a; --boot-rgb: 255, 125, 110;
  --tide: #3fd6c6; --tide-hi: #8ef0e5; --tide-rgb: 63, 214, 198; --tide-ink: #03211e;
  --grad-tide: linear-gradient(135deg, #8ef0e5 0%, #3fd6c6 50%, #1a9f93 100%);
  --sheet-bg: linear-gradient(180deg, #1a2238, #121728 40%);
  --toast-bg: rgba(26, 33, 54, .97); --tabbar-bg: rgba(18, 23, 40, .86);
  --av-a: #2a3450; --av-b: #161c30; --option-bg: #161c30;
  --info-ink: #d3dcff; --tide-text: #b9f3ec;
  --font-display: "Inter", system-ui, sans-serif;
  --display-tracking: -0.035em;
}

/* Jungle — deep green and gold, straight out of the logo. */
[data-theme="jungle"] {
  --bg: #0a110d; --bg-rgb: 10, 17, 13; --bg-2: #0e1611;
  --surface: #121c16; --surface-2: #18251d; --surface-3: #203026; --surface-4: #293b30;
  --tint-rgb: 215, 240, 220;
  --text: #eff5ec; --text-rgb: 239, 245, 236;
  --fire: #e0b54e; --fire-hi: #f0d283; --ember: #c0902c; --fire-ink: #241904;
  --accent-rgb: 224, 181, 78; --accent-hi-rgb: 240, 210, 131;
  --grad-fire: linear-gradient(135deg, #f3dc95 0%, #e0b54e 50%, #b98a2a 100%);
  --boot: #ff8b54; --boot-hi: #ffae85; --boot-rgb: 255, 139, 84;
  --tide: #4fd1c5; --tide-hi: #95ebe2; --tide-rgb: 79, 209, 197; --tide-ink: #03211e;
  --grad-tide: linear-gradient(135deg, #95ebe2 0%, #4fd1c5 50%, #1f9e92 100%);
  --sheet-bg: linear-gradient(180deg, #1b2a21, #121c16 40%);
  --toast-bg: rgba(28, 40, 32, .97); --tabbar-bg: rgba(19, 29, 23, .86);
  --av-a: #2c3d32; --av-b: #16211a; --option-bg: #16211a;
  --info-ink: #f3e5bd; --tide-text: #c2f2ec;
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --display-tracking: -0.02em;
}

/* Ember — warm black and torchlight. */
[data-theme="ember"] {
  --bg: #0d0b0a; --bg-rgb: 13, 11, 10; --bg-2: #141110;
  --surface: #191512; --surface-2: #211c18; --surface-3: #2b2520; --surface-4: #352e28;
  --tint-rgb: 255, 232, 210;
  --text: #f7f0e8; --text-rgb: 247, 240, 232;
  --fire: #ff8a3d; --fire-hi: #ffb35c; --ember: #e8552b; --fire-ink: #1d0e04;
  --accent-rgb: 255, 138, 61; --accent-hi-rgb: 255, 179, 92;
  --grad-fire: linear-gradient(135deg, #ffc760 0%, #ff8a3d 46%, #e8552b 100%);
  --boot: #ff8a3d; --boot-hi: #ffb35c; --boot-rgb: 255, 138, 61;
  --tide: #3fd3c3; --tide-hi: #8ceee4; --tide-rgb: 63, 211, 195; --tide-ink: #03211e;
  --grad-tide: linear-gradient(135deg, #8ceee4 0%, #3fd3c3 50%, #1b9f93 100%);
  --sheet-bg: linear-gradient(180deg, #241e1a, #1a1613 40%);
  --toast-bg: rgba(40, 33, 28, .97); --tabbar-bg: rgba(28, 23, 20, .84);
  --av-a: #3a312a; --av-b: #231d19; --option-bg: #1e1915;
  --info-ink: #ffd0a8; --tide-text: #b5f3ec;
  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --display-tracking: -0.02em;
}

/* --- Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-ui); font-size: 15px; line-height: 1.45; color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01";
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
/* Icons are sized by their container; this zero-specificity default stops an unsized one ballooning. */
:where(svg) { width: 18px; height: 18px; flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--fire-hi); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fire-hi); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(var(--accent-rgb), 0.35); }

.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(110% 55% at 50% -12%, rgba(var(--accent-rgb), 0.20), rgba(var(--accent-rgb), 0) 62%),
    radial-gradient(70% 45% at -10% 105%, rgba(var(--tide-rgb), 0.13), rgba(var(--tide-rgb), 0) 60%),
    radial-gradient(60% 40% at 110% 70%, rgba(var(--accent-rgb), 0.07), rgba(var(--accent-rgb), 0) 60%),
    var(--bg);
}
.ambient::after {
  content: ""; position: absolute; inset: 0; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Type ------------------------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: var(--display-tracking); line-height: 1.02; }
.h1 { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: var(--display-tracking); line-height: 1.05; margin: 0; }
.h2 { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: var(--display-tracking); line-height: 1.1; margin: 0; }
.h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.015em; line-height: 1.2; margin: 0; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.bignum { font-family: var(--font-display); font-weight: 800; letter-spacing: var(--display-tracking); line-height: 0.95; font-variant-numeric: tabular-nums; }
.fire-text { color: var(--fire-hi); }
.boot-text { color: var(--boot-hi); }
.tide-text { color: var(--tide-hi); }
.gold-text { color: var(--gold); }
.good-text { color: var(--good); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.grad-text { background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.center { text-align: center; }
.right { text-align: right; }
p { margin: 0; }

/* --- Layout helpers ---------------------------------------------------------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; }
.stack > * + * { margin-top: 14px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 22px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 22px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 2px 16px 4px; scroll-padding: 0 16px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* --- Splash / gate ------------------------------------------------------------- */
.splash { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 18px; background: transparent; transition: opacity .35s var(--ease); }
.splash.leaving { opacity: 0; pointer-events: none; }
.splash-mark { position: relative; width: 84px; height: 84px; }
.splash-mark img { width: 84px; height: 84px; border-radius: 50%; filter: drop-shadow(0 10px 40px rgba(var(--accent-rgb), .45)); animation: breathe 2.6s ease-in-out infinite; }
.splash-text { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.gate { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; padding: calc(var(--safe-top) + 28px) 18px calc(var(--safe-bottom) + 28px); }
.gate-inner { width: 100%; max-width: 440px; margin: auto 0; }
.gate-logo { width: 104px; height: 104px; margin: 0 auto; border-radius: 50%; filter: drop-shadow(0 18px 50px rgba(var(--accent-rgb), .45)); }
.gate-title { text-align: center; margin-top: 18px; }
.gate-sub { text-align: center; color: var(--text-2); margin-top: 6px; }

/* --- App frame --------------------------------------------------------------- */
.app { min-height: 100vh; min-height: 100dvh; }
.main { max-width: var(--content-w); margin: 0 auto; padding: 14px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 34px); }
.view { display: none; }
.view.active { display: block; animation: viewIn .32s var(--ease) both; }
.view.active.no-anim { animation: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar { position: sticky; top: 0; z-index: 40; padding-top: var(--safe-top); background: linear-gradient(180deg, rgba(var(--bg-rgb), .92), rgba(var(--bg-rgb), .78)); -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-inner { max-width: var(--content-w); margin: 0 auto; height: 58px; padding: 0 12px 0 16px; display: flex; align-items: center; gap: 10px; }
.topbar-back { margin-left: -8px; }
.topbar-titles { flex: 1; min-width: 0; }
.topbar-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.topbar-eyebrow:empty { display: none; }
.topbar-title { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: var(--display-tracking); line-height: 1.1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-me { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.live { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); }
.live.on .live-dot { background: var(--good); box-shadow: 0 0 0 0 rgba(82, 211, 143, .6); animation: pulse 2.4s infinite; }
.live.on { color: var(--text-2); }
.live.off .live-dot { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(82, 211, 143, .55); } 70% { box-shadow: 0 0 0 7px rgba(82, 211, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(82, 211, 143, 0); } }
.sync-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.sync-bar::after { content: ""; position: absolute; inset: 0; background: var(--grad-fire); transform-origin: left; animation: sync 1.1s var(--ease) infinite; }
@keyframes sync { 0% { transform: translateX(-100%) scaleX(.3); } 100% { transform: translateX(100%) scaleX(.6); } }

/* Bottom tab bar */
.tabbar { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-bottom)); width: min(calc(100% - 20px), 520px); height: var(--tabbar-h); display: flex; align-items: stretch; justify-content: space-around; padding: 6px; border-radius: 24px; background: var(--tabbar-bg); border: 1px solid var(--line-2); -webkit-backdrop-filter: saturate(1.5) blur(22px); backdrop-filter: saturate(1.5) blur(22px); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .05) inset; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 18px; color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: .01em; position: relative; transition: color .2s, background .25s; }
.tab svg { width: 22px; height: 22px; transition: transform .3s var(--spring); }
.tab.active { color: var(--text); background: rgba(255, 255, 255, .06); }
.tab.active svg { color: var(--fire-hi); transform: translateY(-1px) scale(1.06); }
.tab .tab-badge { position: absolute; top: 7px; right: calc(50% - 18px); min-width: 8px; height: 8px; border-radius: 99px; background: var(--fire); box-shadow: 0 0 0 2px var(--surface); }
.tab:active { transform: scale(.96); }

/* --- Surfaces ------------------------------------------------------------------- */
.card { position: relative; background: var(--grad-card), var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 18px; }
.row > .card + .card { margin-top: 0; }
.card.pad-lg { padding: 22px; }
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-body { padding: 14px 18px 18px; }
.card-foot { border-top: 1px solid var(--line); padding: 12px 18px; }
.card.hero { overflow: hidden; border-color: rgba(var(--accent-rgb), .20); background: radial-gradient(120% 90% at 100% 0%, rgba(var(--accent-rgb), .20), rgba(var(--accent-rgb), 0) 55%), radial-gradient(90% 80% at 0% 100%, rgba(var(--tide-rgb), .10), rgba(var(--tide-rgb), 0) 60%), var(--grad-card), var(--surface); box-shadow: var(--shadow-2); }
.card.glow-gold { border-color: rgba(244, 196, 82, .32); box-shadow: var(--shadow-1), 0 0 0 1px rgba(244, 196, 82, .06), 0 10px 40px rgba(244, 196, 82, .07); }
.card.tone-warn { border-color: rgba(246, 183, 64, .32); background: linear-gradient(180deg, rgba(246, 183, 64, .09), rgba(246, 183, 64, .03)), var(--surface); }
.card.tone-bad { border-color: rgba(255, 98, 98, .28); background: linear-gradient(180deg, rgba(255, 98, 98, .08), rgba(255, 98, 98, .02)), var(--surface); }
.card.tone-tide { border-color: rgba(var(--tide-rgb), .28); background: linear-gradient(180deg, rgba(var(--tide-rgb), .08), rgba(var(--tide-rgb), .02)), var(--surface); }
.card.tone-boot { border-color: rgba(var(--boot-rgb), .30); background: linear-gradient(180deg, rgba(var(--boot-rgb), .10), rgba(var(--boot-rgb), .03)), var(--surface); }
.card.tone-fire { border-color: rgba(var(--accent-rgb), .30); background: linear-gradient(180deg, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), .03)), var(--surface); }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.section-head .h3 { font-size: 17px; }
.section-head .link { font-size: 13px; font-weight: 650; color: var(--fire-hi); }
.inset { background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: var(--r-md); }

/* --- Buttons ------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: var(--r-md); font-weight: 700; font-size: 15px; letter-spacing: -.005em; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; user-select: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--grad-fire); color: var(--fire-ink); box-shadow: var(--glow-fire), 0 1px 0 rgba(255, 255, 255, .35) inset; }
.btn-tide { background: var(--grad-tide); color: var(--tide-ink); box-shadow: var(--glow-tide), 0 1px 0 rgba(255, 255, 255, .35) inset; }
.btn-gold { background: var(--grad-gold); color: #2a1a02; box-shadow: 0 6px 24px rgba(244, 196, 82, .25); }
.btn-secondary { background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.btn-danger { background: rgba(255, 98, 98, .14); color: #ff8b8b; border: 1px solid rgba(255, 98, 98, .30); }
.btn-danger.solid { background: #e04848; color: #fff; border-color: transparent; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn-md { height: 42px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 54px; font-size: 16px; border-radius: 16px; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--text-2); transition: background .2s, color .2s, transform .15s; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.boxed { background: var(--surface-2); border: 1px solid var(--line); }
.icon-btn.active { background: rgba(var(--accent-rgb), .14); color: var(--fire-hi); border-color: rgba(var(--accent-rgb), .3); }
.link-btn { color: var(--fire-hi); font-weight: 650; font-size: 13px; }

/* --- Chips / badges ------------------------------------------------------------ */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 650; background: rgba(255, 255, 255, .055); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.lg { height: 32px; padding: 0 13px; font-size: 13px; }
.chip.fire { background: rgba(var(--accent-rgb), .14); color: var(--fire-hi); border-color: rgba(var(--accent-rgb), .28); }
.chip.boot { background: rgba(var(--boot-rgb), .13); color: var(--boot-hi); border-color: rgba(var(--boot-rgb), .28); }
.chip.tide { background: rgba(var(--tide-rgb), .12); color: var(--tide-hi); border-color: rgba(var(--tide-rgb), .26); }
.chip.gold { background: rgba(244, 196, 82, .14); color: var(--gold); border-color: rgba(244, 196, 82, .3); }
.chip.good { background: rgba(82, 211, 143, .13); color: var(--good); border-color: rgba(82, 211, 143, .28); }
.chip.bad { background: rgba(255, 98, 98, .12); color: #ff8b8b; border-color: rgba(255, 98, 98, .26); }
.chip.warn { background: rgba(246, 183, 64, .13); color: var(--warn); border-color: rgba(246, 183, 64, .28); }
.chip.ghost { background: transparent; }
.chip-btn { cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s; }
.chip-btn:active { transform: scale(.96); }
.chip-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.badge-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--fire); color: var(--fire-ink); }
.you-tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fire-hi); background: rgba(var(--accent-rgb), .13); padding: 2px 6px; border-radius: 6px; }

/* --- Segmented control ----------------------------------------------------------- */
.seg { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 14px; }
.seg button { flex: 1; min-height: 38px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--text-3); display: flex; align-items: center; justify-content: center; gap: 7px; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--surface-4); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .06) inset; }
.seg.fire button.on { background: rgba(var(--accent-rgb), .18); color: var(--fire-hi); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.seg.big button { min-height: 54px; flex-direction: column; gap: 3px; font-size: 14px; }
.seg.big button .sub { font-size: 11px; font-weight: 600; color: var(--text-4); }
.seg button.on-fire { background: rgba(var(--accent-rgb), .16); color: var(--fire-hi); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45), 0 6px 20px rgba(var(--accent-rgb), .15); }
.seg button.on-boot { background: rgba(var(--boot-rgb), .15); color: var(--boot-hi); box-shadow: inset 0 0 0 1px rgba(var(--boot-rgb), .45), 0 6px 20px rgba(var(--boot-rgb), .14); }
.seg button.on-boot .sub { color: inherit; opacity: .75; }
.seg button.on-tide { background: rgba(var(--tide-rgb), .14); color: var(--tide-hi); box-shadow: inset 0 0 0 1px rgba(var(--tide-rgb), .45), 0 6px 20px rgba(var(--tide-rgb), .12); }
.seg button.on-fire .sub, .seg button.on-tide .sub { color: inherit; opacity: .75; }

/* --- Avatars ---------------------------------------------------------------------- */
.av { --s: 40px; --ring: transparent; position: relative; width: var(--s); height: var(--s); border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(145deg, var(--av-a), var(--av-b)); color: var(--text-2); font-weight: 800; font-size: calc(var(--s) * .38); font-family: var(--font-display); box-shadow: 0 0 0 2px var(--ring); overflow: hidden; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av.s20 { --s: 20px; } .av.s24 { --s: 24px; } .av.s28 { --s: 28px; } .av.s32 { --s: 32px; } .av.s36 { --s: 36px; } .av.s44 { --s: 44px; } .av.s52 { --s: 52px; } .av.s64 { --s: 64px; } .av.s76 { --s: 76px; } .av.s96 { --s: 96px; } .av.s120 { --s: 120px; }
.av.out img, .av.out .av-letter { filter: grayscale(1) brightness(.55) contrast(1.05); }
.av.out::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 46%, rgba(255, 98, 98, .55) 47%, rgba(255, 98, 98, .55) 53%, transparent 54%); }
.av.mgr { color: #fff; font-family: var(--font-display); background: var(--mc, #555); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), inset 0 -8px 16px rgba(0, 0, 0, .18); }
.av.mgr.soft { background: color-mix(in srgb, var(--mc, #555) 28%, var(--surface)); color: color-mix(in srgb, var(--mc, #555) 70%, white); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--mc, #555) 60%, transparent); }
.av-stack { display: flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av + .av { margin-left: -8px; }

/* --- Torch (lit / snuffed) ------------------------------------------------------- */
.torch { display: inline-block; width: 10px; height: 16px; position: relative; flex-shrink: 0; }
.torch::before { content: ""; position: absolute; left: 3.5px; bottom: 0; width: 3px; height: 8px; border-radius: 2px; background: #6b5139; }
.torch::after { content: ""; position: absolute; left: 1px; bottom: 6px; width: 8px; height: 10px; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff3c2 0 18%, #ffb347 40%, #ff6a2b 75%, rgba(255, 80, 30, 0) 76%); filter: drop-shadow(0 0 4px rgba(255, 140, 60, .8)); animation: flicker 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
.torch.out::after { background: radial-gradient(circle at 50% 70%, #4a3f38 0 40%, rgba(74, 63, 56, 0) 70%); filter: none; animation: none; opacity: .7; height: 6px; bottom: 7px; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); opacity: 1; } 25% { transform: scale(1.06, .94) rotate(2deg); } 50% { transform: scale(.95, 1.07) rotate(-1deg); opacity: .92; } 75% { transform: scale(1.03, .97) rotate(1.5deg); } }
.torch-flame { position: absolute; left: 50%; top: -18px; width: 18px; height: 26px; transform: translateX(-50%); border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 72%, #fff6cf 0 15%, #ffbf55 38%, #ff6a2b 72%, rgba(255, 80, 30, 0) 74%); filter: drop-shadow(0 0 10px rgba(255, 140, 60, .9)); animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 100%; opacity: 0; }
.torches { display: inline-flex; gap: 3px; align-items: flex-end; }

/* --- Rank badges -------------------------------------------------------------------- */
.rank { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--text-3); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); flex-shrink: 0; }
.rank.r1 { color: #3a2602; background: var(--grad-gold); border-color: transparent; box-shadow: 0 4px 16px rgba(244, 196, 82, .3); }
.rank.r2 { color: #24262b; background: linear-gradient(135deg, #f2f3f5, #b9bdc6); border-color: transparent; }
.rank.r3 { color: #2b1709; background: linear-gradient(135deg, #f0b588, #b8703e); border-color: transparent; }
.move { font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 1px; }
.move.up { color: var(--good); } .move.down { color: var(--bad); } .move.same { color: var(--text-4); }

/* --- Lists ----------------------------------------------------------------------------- */
.list > * + * { border-top: 1px solid var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 56px; width: 100%; text-align: left; }
button.list-row { transition: background .15s; }
button.list-row:hover { background: rgba(255, 255, 255, .02); }
button.list-row:active { background: rgba(255, 255, 255, .04); }
.list-row .chev { width: 18px; height: 18px; color: var(--text-4); flex-shrink: 0; }
.list-row .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--text-2); flex-shrink: 0; }
.list-row .ic svg { width: 20px; height: 20px; }
.list-row .ic.boot { background: rgba(var(--boot-rgb), .13); color: var(--boot-hi); }
.list-row .ic.fire { background: rgba(var(--accent-rgb), .13); color: var(--fire-hi); }
.list-row .ic.tide { background: rgba(var(--tide-rgb), .12); color: var(--tide-hi); }
.list-row .ic.gold { background: rgba(244, 196, 82, .13); color: var(--gold); }
.list-row .ic.bad { background: rgba(255, 98, 98, .12); color: #ff8b8b; }
.list-row .ic.good { background: rgba(82, 211, 143, .12); color: var(--good); }
.list-title { display: block; font-weight: 650; font-size: 15px; line-height: 1.25; }
.list-sub { display: block; font-size: 13px; color: var(--text-3); line-height: 1.3; margin-top: 2px; }
.list-sub.row { display: flex; }

/* --- Standings ---------------------------------------------------------------------------- */
.standing { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: left; position: relative; transition: background .15s; }
.standing:hover { background: rgba(255, 255, 255, .02); }
.standing.me { background: linear-gradient(90deg, rgba(var(--accent-rgb), .08), rgba(var(--accent-rgb), 0) 70%); }
.standing.me::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-fire); }
.standing-name { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.standing-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--text-3); }
.standing-meta .still-in { font-weight: 650; color: var(--text-4); }
.standing-name .move { margin-left: 2px; }
.standing-pts { text-align: right; }
.standing-pts .bignum { display: block; font-size: 26px; }
.standing-pts .gap { display: block; font-size: 11.5px; color: var(--text-4); font-weight: 600; margin-top: 3px; white-space: nowrap; }
.spark { display: block; width: 64px; height: 22px; overflow: visible; }

/* --- Hero / progress rail ---------------------------------------------------------- */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 14px; }
.rail-seg { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .08); position: relative; }
.rail-seg.done { background: var(--grad-fire); box-shadow: 0 0 10px rgba(var(--accent-rgb), .25); }
.rail-seg.open { background: rgba(var(--accent-hi-rgb), .22); box-shadow: inset 0 0 0 1.5px var(--fire-hi); animation: openPulse 2s ease-in-out infinite; }
.rail-seg.finale { background: rgba(244, 196, 82, .18); box-shadow: inset 0 0 0 1px rgba(244, 196, 82, .55); }
.rail-seg.finale.done { background: var(--grad-gold); }
.rail-seg.merge::before { content: ""; position: absolute; left: -3px; top: -5px; bottom: -5px; width: 2px; border-radius: 2px; background: var(--tide); }
@keyframes openPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.rail-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.countdown { display: inline-flex; gap: 6px; }
.countdown .cd { min-width: 46px; padding: 6px 8px; border-radius: 11px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); text-align: center; }
.countdown .cd b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown .cd span { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 12px; border-radius: var(--r-md); background: rgba(255, 255, 255, .03); border: 1px solid var(--line); min-width: 0; }
.stat .k { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-grid.four { gap: 6px; }
.stat-grid.four .stat { padding: 10px 9px; }
.stat-grid.four .k { font-size: 10px; letter-spacing: .03em; }
.stat-grid.four .v { font-size: 21px; }
.stat .v small { font-size: 12px; font-weight: 700; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }

/* --- Story cards (Storylines) --------------------------------------------------------- */
.story { width: 260px; min-height: 148px; padding: 16px; border-radius: var(--r-lg); background: var(--grad-card), var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.story .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .13); color: var(--fire-hi); }
.story .ic svg { width: 18px; height: 18px; }
.story .ic.tide { background: rgba(var(--tide-rgb), .12); color: var(--tide-hi); }
.story .ic.gold { background: rgba(244, 196, 82, .13); color: var(--gold); }
.story .ic.bad { background: rgba(255, 98, 98, .12); color: #ff8b8b; }
.story .label { font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.story .text { font-size: 14.5px; line-height: 1.42; color: var(--text); }

/* --- Recap --------------------------------------------------------------------------------- */
.recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.recap-tile { padding: 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .03); border: 1px solid var(--line); min-width: 0; }
.recap-tile.span2 { grid-column: span 2; }
.recap-person { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-width: 0; }
.recap-person + .recap-person { margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row + .bar-row { margin-top: 9px; }
.bar-track { height: 10px; border-radius: 0 5px 5px 0; background: rgba(255, 255, 255, .05); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0 5px 5px 0; transition: width .6s var(--ease); }

/* --- Heatmap table -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px 14px; scrollbar-width: thin; scrollbar-color: rgba(var(--tint-rgb), .22) transparent; }
.table-wrap::-webkit-scrollbar { height: 5px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; margin: 0 18px; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(var(--tint-rgb), .2); border-radius: 5px; }
table.heat { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; min-width: 100%; }
table.heat th { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 4px 2px; text-align: center; white-space: nowrap; }
table.heat th.name, table.heat td.name { --name-bg: color-mix(in srgb, var(--surface), rgb(var(--tint-rgb)) 3.5%); text-align: left; padding: 0 10px 0 4px; position: sticky; left: 0; z-index: 1; background: var(--name-bg);
  /* The first shadow paints the column's background out over the scroller's 18px side padding,
     so cells scrolled under the names don't peek out on their left. */
  box-shadow: -22px 0 0 2px var(--name-bg), 0 0 0 2px var(--name-bg), 8px 0 10px -8px rgba(0, 0, 0, .55); }
table.heat td { text-align: center; padding: 0; }
table.heat td .cell { min-width: 34px; height: 30px; display: grid; place-items: center; border-radius: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
table.heat td .cell.best { box-shadow: inset 0 0 0 1.5px var(--gold); }
table.heat td.total { font-family: var(--font-display); font-weight: 800; font-size: 15px; padding-left: 8px; text-align: right; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 11px 8px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; } table.data .c { text-align: center; }

/* --- Chart -------------------------------------------------------------------------------- */
.chart-box { position: relative; height: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* --- Castaway tiles (Pick'em) ------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 11px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1.5px solid var(--line); transition: transform .18s var(--ease), border-color .2s, background .2s, box-shadow .25s; min-width: 0; }
.tile:active:not(:disabled) { transform: scale(.95); }
.tile .av { --s: 68px; }
.tile .tile-name { font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.tile .tile-sub { font-size: 11px; font-weight: 600; color: var(--text-4); margin-top: -5px; }
.tile.tinted { border-color: color-mix(in srgb, var(--tc) 45%, transparent); background: color-mix(in srgb, var(--tc) 9%, transparent); }
.tile.tinted .av { box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 80%, transparent); }
.tile.sel-fire { border-color: var(--boot); background: rgba(var(--boot-rgb), .14); box-shadow: 0 8px 28px rgba(var(--boot-rgb), .22), inset 0 0 0 1px rgba(var(--boot-rgb), .35); }
.tile.sel-fire .tile-name { color: var(--boot-hi); }
.tile.sel-fire .av { box-shadow: 0 0 0 3px var(--boot); }
.tile.sel-tide { border-color: var(--tide); background: rgba(var(--tide-rgb), .12); box-shadow: 0 8px 28px rgba(var(--tide-rgb), .2), inset 0 0 0 1px rgba(140, 238, 228, .3); }
.tile.sel-tide .tile-name { color: var(--tide-hi); }
.tile.sel-tide .av { box-shadow: 0 0 0 3px var(--tide); }
.tile .check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--fire-ink); background: var(--boot-hi); transform: scale(0); transition: transform .3s var(--spring); }
.tile.sel-tide .check { background: var(--tide-hi); color: var(--tide-ink); }
.tile.sel-fire .check, .tile.sel-tide .check { transform: scale(1); }
.tile .check svg { width: 13px; height: 13px; }
.tile:disabled { opacity: .35; }

/* --- Scoring ------------------------------------------------------------------------------ */
.ep-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; }
.ep-strip::-webkit-scrollbar { display: none; }
.ep-chip { flex-shrink: 0; min-width: 52px; height: 52px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); color: var(--text-3); font-weight: 700; transition: background .2s, color .2s, border-color .2s; position: relative; }
.ep-chip .n { font-family: var(--font-display); font-size: 18px; line-height: 1; color: var(--text-2); }
.ep-chip .t { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
.ep-chip .st { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; }
.ep-chip .st.scored { background: var(--fire); }
.ep-chip .lock { position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; color: var(--text-4); }
.ep-chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.ep-chip.on .n { color: var(--bg); }
.ep-chip.now:not(.on) { border-color: rgba(var(--accent-hi-rgb), .5); }
.ep-chip.now .t { color: var(--fire-hi); }
.ep-chip.on.now .t { color: var(--ember); }

.ep-card { padding: 14px 14px 12px; }
.team-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 70%; padding: 0 12px 0 5px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-weight: 700; font-size: 14.5px; transition: background .2s; }
.team-btn:active { background: rgba(255, 255, 255, .09); }
.team-btn > svg { width: 16px; height: 16px; color: var(--text-3); }
.team-btn .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-4); }
.team-btn .ic svg { width: 16px; height: 16px; }
.ep-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.ep-nav .icon-btn { width: 44px; height: 44px; border-radius: 14px; }
.ep-nav .icon-btn:disabled { opacity: .3; }
.ep-title { text-align: center; min-width: 0; }
.ep-title .eyebrow { color: var(--fire-hi); }
.ep-title.post .eyebrow { color: var(--tide-hi); }
.ep-title .h1 { font-size: 32px; margin-top: 2px; }
.ep-rail { display: flex; gap: 3px; margin-top: 14px; }
.ep-rail button { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; position: relative; }
.ep-rail .bar { display: block; width: 100%; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .09); transition: height .25s var(--ease), background .25s, box-shadow .25s; }
.ep-rail .scored .bar { background: var(--grad-fire); opacity: .8; }
.ep-rail .now .bar { box-shadow: inset 0 0 0 1.5px var(--fire-hi); }
.ep-rail .finale:not(.scored) .bar { box-shadow: inset 0 0 0 1px rgba(244, 196, 82, .55); }
.ep-rail .merge::before { content: ""; position: absolute; left: -2.5px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--tide); }
.ep-rail .on .bar { height: 16px; opacity: 1; background: var(--text); box-shadow: 0 0 14px rgba(var(--tint-rgb), .35); }
.ep-card .rail-labels { margin-top: 4px; }
.nudge { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 8px 8px 9px; border-radius: 16px; background: rgba(var(--tide-rgb), .08); border: 1px solid rgba(var(--tide-rgb), .26); text-align: left; font-size: 14px; transition: transform .15s var(--ease); }
.nudge:active { transform: scale(.985); }
.nudge .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-tide); color: var(--tide-ink); flex-shrink: 0; }
.nudge .ic svg { width: 18px; height: 18px; }
.nudge .go { flex-shrink: 0; font-weight: 750; font-size: 13px; color: var(--tide-hi); padding: 7px 12px; border-radius: 10px; background: rgba(var(--tide-rgb), .14); }
.cast-tabs { position: sticky; top: calc(58px + var(--safe-top)); z-index: 20; margin: 0 -16px; padding: 10px 16px 10px; background: linear-gradient(180deg, rgba(var(--bg-rgb), .96) 70%, rgba(var(--bg-rgb), 0)); }
.cast-tabs .inner { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cast-tabs .inner::-webkit-scrollbar { display: none; }
.cast-tab { flex: 1 0 64px; max-width: 92px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px 7px; border-radius: 16px; border: 1px solid transparent; color: var(--text-3); transition: background .2s, border-color .2s, color .2s; }
.cast-tab .av { --s: 44px; }
.cast-tab .nm { font-size: 11.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-tab .pt { font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-4); }
.cast-tab .pt.pos { color: var(--good); } .cast-tab .pt.neg { color: var(--bad); }
.cast-tab.on { background: var(--surface-3); border-color: var(--line-2); color: var(--text); }
.cast-tab.on .av { box-shadow: 0 0 0 2.5px var(--ring, var(--fire)); }
.cast-tab.is-out { opacity: .6; }

.player-card { display: flex; align-items: center; gap: 14px; }
.player-card .bignum { font-size: 48px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; position: relative; transition: background .25s; }
.cat-row.scored { background: linear-gradient(90deg, rgba(82, 211, 143, .08), rgba(82, 211, 143, 0) 75%); }
.cat-row.scored-neg { background: linear-gradient(90deg, rgba(255, 98, 98, .08), rgba(255, 98, 98, 0) 75%); }
.cat-row.scored::before, .cat-row.scored-neg::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--good); }
.cat-row.scored-neg::before { background: var(--bad); }
.cat-name { font-weight: 650; font-size: 15px; line-height: 1.25; white-space: pre-line; }
.cat-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.cat-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.cat-meta .chip { height: 22px; font-size: 11px; padding: 0 8px; }
.stepper { display: flex; align-items: center; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 16px; padding: 3px; flex-shrink: 0; }
.stepper button { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--text-2); transition: background .15s, transform .12s, color .15s; }
.stepper button svg { width: 20px; height: 20px; }
.stepper button:active:not(:disabled) { transform: scale(.9); background: rgba(255, 255, 255, .08); }
.stepper button:disabled { opacity: .25; }
.stepper button.plus { color: var(--text); }
.stepper .val { min-width: 34px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--text-3); transition: color .2s; }
.stepper .val.pos { color: var(--good); } .stepper .val.neg { color: var(--bad); }
.stepper.locked { opacity: .5; }
.stepper.pos { background: rgba(74, 222, 128, .05); border-color: rgba(74, 222, 128, .13); }
.stepper.neg { background: rgba(244, 63, 94, .05); border-color: rgba(244, 63, 94, .12); }
.card.tint-pos { background: linear-gradient(180deg, rgba(74, 222, 128, .045), rgba(74, 222, 128, .015)), var(--surface); border-color: rgba(74, 222, 128, .12); }
.card.tint-neg { background: linear-gradient(180deg, rgba(244, 63, 94, .045), rgba(244, 63, 94, .015)), var(--surface); border-color: rgba(244, 63, 94, .12); }
.card.tint-pos .cat-row + .cat-row, .card.tint-neg .cat-row + .cat-row { border-top: 1px solid var(--line); }
.bump { animation: bump .45s var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.float-pts { position: fixed; z-index: 80; pointer-events: none; font-family: var(--font-display); font-weight: 800; font-size: 22px; animation: floatUp .9s var(--ease) forwards; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0) scale(.9); } to { opacity: 0; transform: translate(-50%, -48px) scale(1.15); } }

/* --- Roster cards (Team) ---------------------------------------------------------------------- */
.roster { display: grid; grid-template-columns: 1fr; gap: 10px; }
.roster-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--grad-card), var(--surface); border: 1px solid var(--line); width: 100%; text-align: left; transition: transform .15s var(--ease), border-color .2s; }
.roster-card:active { transform: scale(.985); }
.roster-card .bars { display: flex; align-items: flex-end; gap: 2px; height: 22px; margin-top: 7px; }
.roster-card .bars i { flex: 1; min-width: 3px; max-width: 10px; border-radius: 2px 2px 0 0; background: rgba(var(--accent-hi-rgb), .55); }
.roster-card .bars i.neg { background: rgba(255, 98, 98, .55); border-radius: 0 0 2px 2px; align-self: flex-start; }
.roster-card .bars i.zero { background: rgba(255, 255, 255, .08); height: 2px !important; }
.roster-card.out { opacity: .72; }

/* --- Forms -------------------------------------------------------------------------------------- */
.field { display: block; }
.field > .label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 0 2px 7px; }
.field > .hint { display: block; font-size: 12px; color: var(--text-3); margin: 6px 2px 0; }
.input, .select, .textarea { width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-md); background: rgba(0, 0, 0, .3); border: 1px solid var(--line-2); color: var(--text); font-size: 16px; font-weight: 500; transition: border-color .2s, box-shadow .2s, background .2s; }
.input::placeholder { color: var(--text-4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: rgba(var(--accent-hi-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .13); background: rgba(0, 0, 0, .4); }
.input.sm, .select.sm { height: 38px; font-size: 14px; border-radius: 11px; padding: 0 11px; }
.select.sm { padding-right: 30px; background-position: right 9px center; background-size: 14px; }
.input.bare { background: transparent; border-color: transparent; padding: 0 4px; height: 36px; }
.input.bare:focus { background: rgba(0, 0, 0, .3); border-color: var(--line-2); box-shadow: none; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8aea4' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.select option { background: var(--option-bg); }
.textarea { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input-error { color: #ff8b8b; font-size: 13px; font-weight: 600; margin-top: 8px; min-height: 18px; }
input[type="color"].swatch { width: 44px; height: 44px; padding: 3px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); cursor: pointer; flex-shrink: 0; }
input[type="color"].swatch::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].swatch::-webkit-color-swatch { border: 0; border-radius: 9px; }

.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; background: rgba(255, 255, 255, .12); flex-shrink: 0; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .35s var(--spring); }
.switch[aria-checked="true"] { background: var(--fire); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch.tide[aria-checked="true"] { background: var(--tide); }
.switch:disabled { opacity: .4; }
.setting { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting .txt { flex: 1; min-width: 0; }
.setting .t { font-weight: 650; font-size: 15px; }
.setting .d { font-size: 13px; color: var(--text-3); margin-top: 2px; line-height: 1.35; }
.mini-stepper { display: flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 13px; padding: 3px; flex-shrink: 0; }
.mini-stepper button { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.mini-stepper button:active:not(:disabled) { background: rgba(255, 255, 255, .08); }
.mini-stepper button:disabled { opacity: .3; }
.mini-stepper button svg { width: 16px; height: 16px; }
.mini-stepper .val { min-width: 30px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

/* --- Rules editor ------------------------------------------------------------------------------ */
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: transparent; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule .handle { padding: 8px 2px; color: var(--text-4); cursor: grab; touch-action: none; }
.rule .handle svg { width: 18px; height: 18px; }
.rule .input.pts { width: 64px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; padding: 0 6px; height: 44px; }
.rule .input.pts.pos { color: var(--good); } .rule .input.pts.neg { color: var(--bad); }
.rule.sortable-ghost { opacity: .35; }
.rule.sortable-chosen { background: var(--surface-3); border-radius: 12px; }

/* --- Sheet ------------------------------------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(var(--bg-rgb), .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.sheet-panel { position: absolute; left: 50%; bottom: 0; width: min(100%, 600px); max-height: 90vh; max-height: 90dvh; transform: translate(-50%, 100%); background: var(--sheet-bg); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -24px 80px rgba(0, 0, 0, .6); display: flex; flex-direction: column; transition: transform .42s var(--ease); }
.sheet.open .sheet-scrim { opacity: 1; }
.sheet.open .sheet-panel { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .18); margin: 10px auto 4px; flex-shrink: 0; }
.sheet-body { overflow-y: auto; padding: 10px 20px calc(24px + var(--safe-bottom)); overscroll-behavior: contain; }
.sheet-title { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; margin: 6px 0 4px; }
.sheet-sub { color: var(--text-2); font-size: 14px; margin-bottom: 16px; line-height: 1.45; }
@media (min-width: 700px) {
  .sheet-panel { bottom: auto; top: 50%; transform: translate(-50%, -46%) scale(.97); opacity: 0; border-radius: 26px; border-bottom: 1px solid var(--line-2); max-height: 82vh; transition: transform .35s var(--ease), opacity .25s; }
  .sheet.open .sheet-panel { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-handle { display: none; }
  .sheet-body { padding-top: 22px; }
}

/* --- Toasts ---------------------------------------------------------------------------------- */
.toasts { position: fixed; z-index: 85; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 22px); width: min(calc(100% - 24px), 460px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 16px; background: var(--toast-bg); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 14px; font-weight: 600; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: toastIn .42s var(--spring) both; }
.toast.leaving { animation: toastOut .25s var(--ease) both; }
.toast .ti { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; }
.toast .ti svg { width: 14px; height: 14px; }
.toast.ok .ti { background: rgba(82, 211, 143, .18); color: var(--good); }
.toast.err { border-color: rgba(255, 98, 98, .35); }
.toast.err .ti { background: rgba(255, 98, 98, .18); color: var(--bad); }
.toast.info .ti { background: rgba(var(--accent-rgb), .16); color: var(--fire-hi); }
.toast .tx { flex: 1; min-width: 0; line-height: 1.35; }
.toast .ta { flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 750; color: var(--fire-hi); background: rgba(var(--accent-rgb), .12); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* --- Cropper ------------------------------------------------------------------------------------ */
.cropper-modal { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 18px; background: rgba(var(--bg-rgb), .8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.cropper-card { width: min(100%, 520px); padding: 20px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.cropper-stage { max-height: 60vh; overflow: hidden; border-radius: 16px; background: #000; }
.cropper-stage img { max-width: 100%; }

/* --- Empty / skeleton -------------------------------------------------------------------------- */
.empty { text-align: center; padding: 36px 22px; }
.empty .em-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .1); color: var(--fire-hi); }
.empty .em-ic svg { width: 28px; height: 28px; }
.empty .h3 { margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 14px; max-width: 320px; margin: 0 auto; }
.skel { border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, .035) 25%, rgba(255, 255, 255, .07) 50%, rgba(255, 255, 255, .035) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Misc ---------------------------------------------------------------------------------------- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; line-height: 1.45; }
.callout svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.callout.warn { background: rgba(246, 183, 64, .09); border: 1px solid rgba(246, 183, 64, .26); color: #ffd98c; }
.callout.info { background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .22); color: var(--info-ink); }
.callout.tide { background: rgba(var(--tide-rgb), .08); border: 1px solid rgba(var(--tide-rgb), .24); color: var(--tide-text); }
.callout.bad { background: rgba(255, 98, 98, .08); border: 1px solid rgba(255, 98, 98, .24); color: #ffb4b4; }
.callout .grow b { color: var(--text); }
.cta-banner { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: var(--r-lg); text-align: left; transition: transform .15s var(--ease); }
.cta-banner:active { transform: scale(.985); }
.cta-banner .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.cta-banner .ic svg { width: 22px; height: 22px; }
.cta-banner > svg { width: 20px; height: 20px; color: var(--text-3); }
.cta-banner b { font-size: 15px; }
.cta-banner.fire { background: linear-gradient(100deg, rgba(var(--accent-rgb), .18), rgba(var(--accent-rgb), .06)); border: 1px solid rgba(var(--accent-rgb), .35); }
.cta-banner.fire .ic { background: var(--grad-fire); color: var(--fire-ink); box-shadow: var(--glow-fire); }
.cta-banner.tide { background: linear-gradient(100deg, rgba(var(--tide-rgb), .15), rgba(var(--tide-rgb), .05)); border: 1px solid rgba(var(--tide-rgb), .32); }
.cta-banner.tide .ic { background: var(--grad-tide); color: var(--tide-ink); }
.cta-banner.quiet { background: rgba(var(--tint-rgb), .04); border: 1px dashed var(--line-2); }
.cta-banner.quiet .ic { background: rgba(var(--tint-rgb), .08); color: var(--text-3); }
.vote-dots { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.voter { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; }
.voter .av { --s: 44px; }
.voter .state { position: absolute; }
.voter .nm { font-size: 12px; font-weight: 700; color: var(--text-2); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voter .st { font-size: 11px; font-weight: 700; }
.mark { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--surface); }
.mark svg { width: 10px; height: 10px; }
.mark.ok { background: var(--good); color: #052414; }
.mark.half { background: var(--warn); color: #2b1a00; font-size: 10px; font-weight: 900; }
.mark.no { background: var(--bad); color: #2b0606; }
.avw { position: relative; display: inline-block; }
.history-row { padding: 12px 0; }
.history-row + .history-row { border-top: 1px solid var(--line); }
.res-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; border: 1.5px solid var(--line-2); color: var(--text-4); }
.res-dot.ok { background: rgba(82, 211, 143, .16); border-color: rgba(82, 211, 143, .5); color: var(--good); }
.res-dot.miss { background: rgba(255, 255, 255, .04); color: var(--text-3); }
.res-dot.none { border-style: dashed; }
.res-dot.me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--fire); }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; }
.podium .p { text-align: center; }
.podium .base { margin-top: 10px; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.podium .p1 .base { height: 92px; background: linear-gradient(180deg, rgba(244, 196, 82, .32), rgba(244, 196, 82, .06)); color: var(--gold); border: 1px solid rgba(244, 196, 82, .35); }
.podium .p2 .base { height: 66px; background: linear-gradient(180deg, rgba(201, 204, 211, .22), rgba(201, 204, 211, .04)); color: var(--silver); border: 1px solid rgba(201, 204, 211, .25); }
.podium .p3 .base { height: 50px; background: linear-gradient(180deg, rgba(208, 138, 84, .25), rgba(208, 138, 84, .04)); color: var(--bronze); border: 1px solid rgba(208, 138, 84, .3); }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); }
.new-list li { margin: 0 0 12px; display: flex; gap: 12px; align-items: flex-start; }
.new-list { list-style: none; padding: 0; margin: 0; }
.new-list .ic { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: rgba(var(--accent-rgb), .13); color: var(--fire-hi); }
.new-list .ic svg { width: 18px; height: 18px; }
.new-list b { display: block; font-size: 15px; }
.new-list span { color: var(--text-2); font-size: 13.5px; line-height: 1.4; }
.footer-note { text-align: center; color: var(--text-4); font-size: 12px; margin-top: 26px; }

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

@media (min-width: 900px) {
  .main { padding-top: 22px; }
  .h1 { font-size: 34px; }
}

/* --- Appearance (theme picker) ----------------------------------------------------------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.theme-card { position: relative; text-align: left; border-radius: 20px; overflow: hidden; border: 2px solid transparent; background: var(--bg); color: var(--text); padding: 0; transition: transform .15s var(--ease), border-color .2s; }
.theme-card:active { transform: scale(.97); }
.theme-card.on { border-color: var(--text); }
.theme-card .tc-stage { position: relative; height: 150px; padding: 12px; overflow: hidden; background: radial-gradient(110% 60% at 50% -10%, rgba(var(--accent-rgb), .22), transparent 62%), radial-gradient(80% 50% at 0% 110%, rgba(var(--tide-rgb), .14), transparent 60%), var(--bg); }
.theme-card .tc-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--grad-card), var(--surface); border: 1px solid var(--line); }
.theme-card .tc-row + .tc-row { margin-top: 6px; }
.theme-card .tc-rank { width: 18px; height: 18px; border-radius: 6px; background: var(--grad-gold); }
.theme-card .tc-av { width: 20px; height: 20px; border-radius: 50%; }
.theme-card .tc-line { height: 6px; border-radius: 3px; background: rgba(var(--text-rgb), .55); flex: 1; }
.theme-card .tc-num { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: var(--display-tracking); }
.theme-card .tc-btn { margin-top: 10px; height: 26px; border-radius: 9px; background: var(--grad-fire); }
.theme-card .tc-info { padding: 10px 12px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.theme-card .tc-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: var(--display-tracking); }
.theme-card .tc-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.theme-card .tc-check { position: absolute; bottom: 14px; right: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); transform: scale(0); transition: transform .3s var(--spring); z-index: 2; }
.theme-card.on .tc-check { transform: scale(1); }
.theme-card .tc-check svg { width: 14px; height: 14px; }

/* --- Home hero (2.1.1) ---------------------------------------------------------------------- */
.hero2 { padding: 20px 20px 16px; }
.hero-title { font-family: var(--font-display); font-weight: 800; font-size: 38px; letter-spacing: var(--display-tracking); line-height: 1; margin: 10px 0 0; }
.hero-sub { color: var(--text-2); font-size: 15px; margin-top: 8px; }
.live-chip { background: rgba(255, 98, 98, .14); color: #ff9a9a; border-color: rgba(255, 98, 98, .3); }
.live-chip .dot { background: var(--bad); animation: pulse 1.6s infinite; box-shadow: 0 0 0 0 rgba(255, 98, 98, .6); }
.cd2 { display: flex; align-items: flex-start; gap: 6px; margin-top: 18px; }
.cd-u { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.cd-u b { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; letter-spacing: var(--display-tracking); font-variant-numeric: tabular-nums; }
.cd-u i { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.cd-sep { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.1; color: var(--text-4); }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.slot { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; padding: 12px; border-radius: 16px; text-align: left; background: rgba(var(--tint-rgb), .035); border: 1px solid var(--line-2); transition: transform .15s var(--ease), background .2s, border-color .2s; }
.slot:active { transform: scale(.97); }
.slot.boot { border-color: rgba(var(--boot-rgb), .28); }
.slot.imm { border-color: rgba(var(--tide-rgb), .28); }
.slot.boot.done { background: rgba(var(--boot-rgb), .10); border-color: rgba(var(--boot-rgb), .5); }
.slot.imm.done { background: rgba(var(--tide-rgb), .09); border-color: rgba(var(--tide-rgb), .45); }
.slot-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.slot-label svg { width: 13px; height: 13px; }
.slot.boot .slot-label { color: var(--boot-hi); }
.slot.imm .slot-label { color: var(--tide-hi); }
.slot-body { display: flex; align-items: center; gap: 10px; min-width: 0; }
.slot-empty { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; border: 1.5px dashed var(--line-3); color: var(--text-3); }
.slot-empty svg { width: 16px; height: 16px; }
.slot.boot .slot-empty { border-color: rgba(var(--boot-rgb), .55); color: var(--boot-hi); }
.slot.imm .slot-empty { border-color: rgba(var(--tide-rgb), .55); color: var(--tide-hi); }
.slot-name { font-weight: 700; font-size: 15.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-name.blank { color: var(--text-3); font-weight: 650; }
.voters-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.voters-row .mark { width: 15px; height: 15px; right: -4px; bottom: -3px; border-width: 1.5px; }
.voters-row .mark svg { width: 8px; height: 8px; }
.season-line { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sl-track { position: relative; height: 4px; border-radius: 2px; background: rgba(var(--tint-rgb), .09); }
.sl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--grad-fire); }
.sl-merge { position: absolute; top: -3px; width: 2px; height: 10px; border-radius: 1px; background: var(--tide); }
.sl-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }

/* --- Your season (2.1.1) -------------------------------------------------------------------- */
.your-season { padding: 16px; text-align: left; }
.ys-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: var(--display-tracking); line-height: 1.15; }
.ys-rank { font-family: var(--font-ui); font-size: 12px; font-weight: 750; letter-spacing: .02em; padding: 2px 7px; border-radius: 7px; vertical-align: 3px; margin-left: 4px; background: rgba(var(--accent-rgb), .14); color: var(--fire-hi); }
.ys-standing { font-size: 13.5px; color: var(--text-3); margin-top: 3px; }
.ys-total { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: var(--display-tracking); font-variant-numeric: tabular-nums; }
.ys-unit { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.ys-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ys-stat { padding: 11px 0; text-align: center; }
.ys-stat + .ys-stat { border-left: 1px solid var(--line); }
.ys-stat { padding-left: 4px; padding-right: 4px; }
.ys-stat .k { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.ys-stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: var(--display-tracking); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ys-stat .v small { font-size: 13px; color: var(--text-3); font-weight: 700; letter-spacing: 0; }
.ys-roster { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.ys-roster::-webkit-scrollbar { display: none; }
.ys-cast { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.ys-cast.out { color: var(--text-4); }

/* --- Scoring season bar: tribe phase + merged phase (2.1.1) -------------------------------------- */
.ep-rail2 { display: flex; gap: 12px; margin-top: 16px; }
.ep-phase { min-width: 0; display: flex; flex-direction: column; }
.ep-segs { display: flex; gap: 3px; }
.ep-segs button { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; }
.ep-segs .bar { display: block; width: 100%; height: 8px; border-radius: 4px; transition: height .25s var(--ease), background .25s, box-shadow .25s; }
.ep-phase.pre .bar { background: rgba(var(--accent-rgb), .15); }
.ep-phase.pre .scored .bar { background: var(--grad-fire); }
.ep-phase.pre .now .bar { box-shadow: inset 0 0 0 1.5px var(--fire-hi); }
.ep-phase.post .bar { background: rgba(var(--tide-rgb), .15); }
.ep-phase.post .scored .bar { background: var(--grad-tide); }
.ep-phase.post .now .bar { box-shadow: inset 0 0 0 1.5px var(--tide-hi); }
.ep-segs .finale:not(.scored) .bar { background: rgba(244, 196, 82, .12); box-shadow: inset 0 0 0 1.5px var(--gold); }
.ep-segs .on .bar { height: 16px; background: var(--text); box-shadow: 0 0 14px rgba(var(--text-rgb), .35); }
.ep-phase-label { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.ep-phase-label span:last-child { color: var(--text-4); font-weight: 600; }
.ep-phase.pre .ep-phase-label span:first-child { color: var(--fire-hi); }
.ep-phase.post .ep-phase-label span:first-child { color: var(--tide-hi); }
.ep-phase.narrow .ep-phase-label span:last-child { display: none; }

/* --- Player pill (top corner): who's playing + live status (2.1.1) ------------------------------ */
.me-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 46vw; padding: 0 10px 0 13px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--tint-rgb), .10), rgba(var(--tint-rgb), .035)); border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 18px rgba(0, 0, 0, .28); transition: transform .15s var(--ease), background .2s; }
.me-pill:active { transform: scale(.96); }
.me-name { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; letter-spacing: var(--display-tracking); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.me-pill > svg { width: 14px; height: 14px; color: var(--text-3); }
.me-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--warn); box-shadow: 0 0 0 3px rgba(246, 183, 64, .16); }
.me-pill.live .me-dot, .live-line.on .me-dot { background: var(--good); box-shadow: 0 0 0 3px rgba(82, 211, 143, .18); animation: pulse 2.4s infinite; }
.me-pill.guest .me-name { font-family: var(--font-ui); font-size: 14px; font-weight: 700; letter-spacing: 0; color: var(--fire-hi); }
/* Score: episode dropdown in the top-left, styled like the player pill */
.topbar-control { flex: 1; min-width: 0; display: flex; align-items: center; }
.topbar-control[hidden] { display: none; }
.ep-pill { position: relative; cursor: pointer; max-width: 100%; }
.ep-pill select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.ep-pill:focus-within { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .3); }
.live-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin: -8px 0 14px; }

/* Who's playing (start screen) */
.pick-player { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; text-align: left; transition: transform .15s var(--ease), border-color .2s; }
.pick-player:active { transform: scale(.985); border-color: var(--line-3); }
.pp-rank { width: 24px; text-align: center; flex-shrink: 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: var(--display-tracking); color: var(--text-4); }
.pp-rank.r1, .sr-rank.r1 { color: var(--gold); } .pp-rank.r2, .sr-rank.r2 { color: var(--silver); } .pp-rank.r3, .sr-rank.r3 { color: var(--bronze); }
.pp-name { display: block; font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: var(--display-tracking); line-height: 1.15; }
.pp-sub { display: block; font-size: 13px; color: var(--text-3); margin-top: 3px; }

/* Switch player sheet */
.switch-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; position: relative; transition: background .15s; }
.switch-row:active { background: rgba(var(--tint-rgb), .04); }
.switch-row.current { background: rgba(var(--accent-rgb), .07); }
.switch-row.current::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-fire); }
.sr-rank { width: 22px; text-align: center; flex-shrink: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: var(--display-tracking); color: var(--text-4); }
.sr-name { display: block; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: var(--display-tracking); }
.sr-sub { display: block; font-size: 13px; color: var(--text-3); margin-top: 2px; }
.sr-check { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--grad-fire); color: var(--fire-ink); }
.sr-check svg { width: 15px; height: 15px; }
.switch-row .chev { width: 18px; height: 18px; color: var(--text-4); }

/* Pick'em: who has voted, as name chips */
.voter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.voter-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 12px; background: rgba(var(--tint-rgb), .04); border: 1px solid var(--line); font-size: 14px; }
.voter-pill b { font-weight: 700; }
.voter-pill span { font-size: 12px; font-weight: 700; color: var(--text-3); }
.voter-pill svg { width: 14px; height: 14px; color: var(--good); }
.voter-pill.done { background: rgba(82, 211, 143, .09); border-color: rgba(82, 211, 143, .3); }
.voter-pill.done span { color: var(--good); }
.voter-pill.part { border-color: rgba(246, 183, 64, .32); }
.voter-pill.part span { color: var(--warn); }

/* --- Home: your season hero (2.1.1) ------------------------------------------------------------- */
.ys-hero { display: block; padding: 20px 20px 16px; text-align: left; }
.ys-who { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: var(--display-tracking); margin-top: 4px; }
.ys-big { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ys-place .n, .ys-points .n { display: block; font-family: var(--font-display); font-weight: 900; line-height: .86; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.ys-place .n { font-size: 84px; }
.ys-rankline { display: flex; align-items: flex-start; }
.ys-place .suf { font-family: var(--font-display); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin: 2px 0 0 4px; color: var(--text-2); }
.ys-place.r1 .suf { color: var(--gold); } .ys-place.r2 .suf { color: var(--silver); } .ys-place.r3 .suf { color: var(--bronze); }
.ys-points { text-align: right; }
.ys-points .n { font-size: 64px; }
.ys-lbl { display: block; margin-top: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.ys-place.r1 .n { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 28px rgba(244, 196, 82, .28)); }
.ys-place.r2 .n { background: linear-gradient(135deg, #ffffff, #c9ccd3 55%, #8f949e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ys-place.r3 .n { background: linear-gradient(135deg, #f6c7a0, #d08a54 55%, #9c5a2c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ys-gap { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 7px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; background: rgba(var(--tint-rgb), .06); border: 1px solid var(--line); color: var(--text-2); }
.ys-gap.lead { background: rgba(244, 196, 82, .12); border-color: rgba(244, 196, 82, .3); color: var(--gold); }
.ys-gap svg { width: 14px; height: 14px; }
.ys-hero .ys-stats { margin-top: 16px; }
