/* ---------- theme tokens: light is default ---------- */
:root {
  --bg: #ffffff;
  --panel: #f6f8fa;
  --panel-2: #eef1f4;
  --line: #e1e5ea;
  --line-hover: #c4cbd3;
  --text: #0f1720;
  --muted: #5d6b7a;
  --green: #16a34a;        /* text-safe green on white */
  --green-fill: #22c55e;   /* buttons, bars, badges */
  --on-green: #04130a;
  --red: #dc2626;
  --accent: #2563eb;
  --seg-on: #ffffff;
  --seg-on-shadow: 0 1px 2px rgba(15, 23, 32, .12);
  --hero-border: #bbe5c8;
  --hero-glow: rgba(34, 197, 94, .16);
  --skeleton-mid: #e9edf1;
  --track: #e5e9ee;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #22303d;
  --line: #262f3a;
  --line-hover: #3a4552;
  --text: #e6edf3;
  --muted: #8b96a3;
  --green: #22c55e;
  --green-fill: #22c55e;
  --on-green: #04130a;
  --red: #ef4444;
  --accent: #3b82f6;
  --seg-on: #22303d;
  --seg-on-shadow: none;
  --hero-border: #1f5135;
  --hero-glow: rgba(34, 197, 94, .22);
  --skeleton-mid: #1c2530;
  --track: #1d2630;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg); color: var(--text);
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background-color .2s ease, color .2s ease;
}
header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; letter-spacing: -.2px; }
.logo { width: 22px; height: 22px; display: block; }
.beta { font-size: 10px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; letter-spacing: .5px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { border-color: var(--line-hover); }
.icon-btn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- dark mode slider ---------- */
.theme-switch { position: relative; display: inline-flex; cursor: pointer; }
.theme-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-track {
  width: 50px; height: 26px; border-radius: 13px; position: relative;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 6px;
  font-size: 12px; line-height: 1; transition: background-color .2s ease, border-color .2s ease;
}
.theme-thumb {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.theme-switch input:checked + .theme-track .theme-thumb { transform: translateX(24px); }
.theme-switch input:focus-visible + .theme-track { outline: 2px solid var(--accent); outline-offset: 2px; }

nav { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.tab { flex: 1; background: none; border: 0; color: var(--muted); padding: 8px 0 9px; cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; font-size: 12.5px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--green-fill); }
.tab .count { background: var(--green-fill); color: var(--on-green); border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 3px; }

main { flex: 1; overflow-y: auto; }
.panel { display: none; padding: 10px 12px; }
.panel.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 12px; }
.list { display: flex; flex-direction: column; gap: 6px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.card.click { cursor: pointer; }
.card.click:hover { border-color: var(--line-hover); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.market { margin-top: 4px; }
.buy { color: var(--green); font-weight: 700; }
.sell { color: var(--red); font-weight: 700; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.actions { display: flex; gap: 10px; margin-top: 6px; }
.rank { color: var(--muted); width: 22px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; min-width: 0; flex: 1; }
.trades { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.trades .card { background: var(--bg); }

.row { display: flex; gap: 6px; margin-bottom: 10px; }
input, select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 7px 9px; font: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.row input { flex: 1; min-width: 0; }
.btn { background: var(--green-fill); color: var(--on-green); border: 0; border-radius: 6px; padding: 0 12px; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); padding: 4px 10px; font-weight: 600; }
.btn.ghost.on { border-color: var(--green); color: var(--green); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; font-size: 12px; }
.link-btn.danger { color: var(--red); }

.settings { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.settings input[type=number] { width: 80px; margin-left: 4px; padding: 4px 6px; }
.check { display: flex; align-items: center; gap: 6px; }
.check input { accent-color: var(--green-fill); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 4px 11px; cursor: pointer; font-size: 12px; }
.chip:hover { border-color: var(--line-hover); }
.chip.active { border-color: var(--green); color: var(--green); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.error { color: var(--red); }
footer { padding: 7px 12px; border-top: 1px solid var(--line); font-size: 10.5px; text-align: center; }

/* ---------- winners ---------- */
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 16px 0 8px; font-weight: 700; }
h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 4px 10px; border-radius: 5px; cursor: pointer; font: inherit; font-weight: 600; font-size: 12px; }
.seg button.on { background: var(--seg-on); color: var(--text); box-shadow: var(--seg-on-shadow); }

.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--hero-border); border-radius: 12px; padding: 14px;
  background: radial-gradient(120% 140% at 100% 0%, var(--hero-glow), transparent 55%), var(--panel);
}
.hero-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--green); }
.hero-main { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.hero-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-pnl { font-size: 28px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px; }
.hero-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }
.hero-best { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-best b { color: var(--text); }

.avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; border: 2px solid var(--green-fill); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.lead { display: flex; align-items: center; gap: 9px; }
.lead-body { flex: 1; min-width: 0; }
.lead-top { display: flex; justify-content: space-between; gap: 8px; }
.lead-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.lead-name:hover { text-decoration: underline; }
.bar { height: 4px; background: var(--track); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #15803d, var(--green-fill)); border-radius: 3px; }
.follow-mini { background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; flex-shrink: 0; font-weight: 700; }
.follow-mini.on { border-color: var(--green); color: var(--green); }

.win { display: flex; gap: 9px; align-items: flex-start; }
.win-amt { color: var(--green); font-weight: 800; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--on-green); background: var(--green-fill); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.skeleton { background: linear-gradient(90deg, var(--panel), var(--skeleton-mid), var(--panel)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* no transition flash on first paint */
.no-anim, .no-anim * { transition: none !important; }

/* ---------- web app layout ---------- */
body { font-size: 14px; -webkit-tap-highlight-color: transparent; }
.app {
  height: 100vh; height: 100dvh; max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
header { padding: 14px 16px 10px; }
.brand { font-size: 18px; }
.logo { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn { width: 32px; height: 32px; }
.panel { padding: 12px 16px 20px; }
.tab { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; padding: 10px 0 11px; }
.tab .ico { display: none; }
.card { padding: 11px 12px; border-radius: 10px; }
.hero-pnl { font-size: 32px; }
input, select { font-size: 16px; } /* stops iPhone zooming into inputs */
.settings input[type=number] { font-size: 15px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom));
  max-width: min(440px, calc(100% - 32px)); width: max-content;
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px;
  font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 10; cursor: pointer;
}

@media (min-width: 700px) and (max-width: 959px) {
  body { background: var(--panel); }
  .app { background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* phones: tabs move to a bottom bar with icons */
@media (max-width: 699px) {
  header { order: 1; }
  main { order: 2; }
  footer { order: 3; }
  nav {
    order: 4; border-bottom: 0; border-top: 1px solid var(--line); padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom); background: var(--bg);
  }
  .tab { flex-direction: column; gap: 1px; font-size: 10.5px; padding: 7px 0 6px; border-bottom: 0; border-top: 2px solid transparent; }
  .tab.active { border-top-color: var(--green-fill); }
  .tab .ico { display: block; font-size: 19px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
  .tab.active .ico { filter: none; opacity: 1; }
  .tab .count { margin-left: 2px; }
  footer { padding: 5px 12px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
.panel-head { gap: 12px; }
.panel-head > .muted:first-child { flex: 1; }

/* ---------- promos ---------- */
.promo-filters { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.promo-filters select { padding: 5px 8px; font-size: 14px; }
.promo-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.stat.good b { color: var(--green); }
.stat.wide { grid-column: 1 / -1; }
.stat.warn { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 10%, var(--panel)); }
.stat.warn span { color: var(--text); font-weight: 600; font-size: 12.5px; }
.promo-top { display: flex; gap: 10px; align-items: flex-start; }
.promo-ava { width: 34px !important; height: 34px !important; font-size: 15px !important; color: #fff !important; }
.promo-ava.sportsbook { background: #2563eb; }
.promo-ava.prediction { background: #7c3aed; }
.ptag { font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 6px; margin-left: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.ptag.sportsbook { color: #2563eb; border-color: color-mix(in srgb, #2563eb 35%, transparent); }
.ptag.prediction { color: #7c3aed; border-color: color-mix(in srgb, #7c3aed 35%, transparent); }
:root[data-theme="dark"] .ptag.sportsbook { color: #60a5fa; }
:root[data-theme="dark"] .ptag.prediction { color: #a78bfa; }
.offer { font-weight: 700; color: var(--green); margin-top: 3px; font-size: 14.5px; line-height: 1.3; }
.terms { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.terms.open { display: block; }
.promo-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.promo-actions .btn { padding: 7px 12px; }
.status-sel { margin-left: auto; padding: 6px 8px; font-size: 13px; font-weight: 600; }
.status-sel.s-signed { border-color: #f59e0b; color: #b45309; }
.status-sel.s-claimed, .status-sel.s-done { border-color: var(--green); color: var(--green); }
:root[data-theme="dark"] .status-sel.s-signed { color: #fbbf24; }
.expiry { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.date-in { padding: 4px 8px; font-size: 14px; }
.warn-text { color: #d97706; font-weight: 700; font-size: 12px; }
.card.promo.dim { opacity: .55; }
.rg { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 16px 2px 4px; }
.rg b { color: var(--text); }
@media (max-width: 699px) {
  .promo-summary { grid-template-columns: repeat(2, 1fr); }
  .tab { font-size: 10px; }
  .tab .ico { font-size: 18px; }
}

/* ---------- shared bits used by the desktop layout ---------- */
.page-head { display: none; }
.win-side h3.first { margin-top: 16px; }

/* ---------- desktop / laptop ---------- */
@media (min-width: 960px) {
  :root { --side: 256px; }
  body { background: var(--bg); font-size: 14.5px; }
  .app {
    max-width: none; height: 100vh;
    display: grid;
    grid-template-columns: var(--side) 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "header main" "nav main" "footer main";
  }

  /* sidebar */
  header, nav, footer { background: var(--panel); border-right: 1px solid var(--line); }
  header { grid-area: header; flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 18px 16px; }
  .brand { font-size: 18px; white-space: nowrap; }
  .logo { width: 32px; height: 32px; border-radius: 9px; }
  .header-actions { width: 100%; justify-content: space-between; }
  nav {
    grid-area: nav; flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 6px 10px; border-bottom: 0; overflow-y: auto;
  }
  .tab {
    flex: 0 0 auto; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; border: 0; border-radius: 9px;
    font-size: 15px; font-weight: 600; color: var(--muted); text-align: left;
  }
  .tab .ico { display: inline-block; width: 22px; text-align: center; font-size: 17px; filter: grayscale(1); opacity: .75; }
  .tab:hover { background: var(--panel-2); color: var(--text); }
  .tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(15,23,32,.08), inset 3px 0 0 var(--green-fill); }
  .tab.active .ico { filter: none; opacity: 1; }
  .tab .count { margin-left: 6px; }
  footer { grid-area: footer; text-align: left; padding: 14px 18px 18px; font-size: 11.5px; line-height: 1.5; border-top: 0; }

  /* content area */
  main { grid-area: main; overflow-y: auto; }
  .panel { max-width: 1240px; margin: 0 auto; padding: 30px 40px 48px; }
  .page-head { display: block; margin-bottom: 18px; }
  .page-head h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
  .page-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
  .panel-head { margin-bottom: 14px; }
  .card { padding: 13px 15px; border-radius: 12px; transition: border-color .15s, box-shadow .15s, transform .15s; }
  .card.click:hover, .card:hover { border-color: var(--line-hover); box-shadow: 0 4px 14px rgba(15,23,32,.06); }
  h3 { font-size: 12.5px; margin: 24px 0 10px; }

  /* winners: hero + leaderboard on the left, cashouts on the right */
  .win-grid { max-width: 760px; }
  .hero { padding: 22px 24px; border-radius: 16px; }
  .hero-main { gap: 18px; margin-top: 14px; }
  .avatar.lg { width: 68px; height: 68px; font-size: 26px; }
  .hero-name { font-size: 20px; }
  .hero-pnl { font-size: 44px; letter-spacing: -1px; }
  .hero-foot { margin-top: 16px; }
  .hero-best { font-size: 13.5px; }

  /* card grids */
  #board, #alert-list, #promo-list, #news-list { display: grid; gap: 12px; }
  #board { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  #alert-list { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
  #promo-list { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); align-items: start; }
  #news-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  #news-list .card { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; }
  .empty { grid-column: 1 / -1; }

  /* wallets: list on the left, settings card on the right */
  .wallet-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
  .wallet-grid .settings { margin-top: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  #add-form { max-width: 640px; }

  /* promos */
  .promo-summary { grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
  .stat { padding: 14px 16px; border-radius: 12px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 12.5px; }
  .promo-filters { margin-bottom: 16px; }
  .rg { max-width: 820px; }

  /* news */
  #news-form { max-width: 640px; }
  .chips { margin-bottom: 14px; }
  .chip { padding: 6px 14px; font-size: 13px; }

  .toast { bottom: 28px; left: calc(50% + var(--side) / 2); }
}

@media (min-width: 1240px) {
  .win-grid { max-width: none; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .win-side h3.first { margin-top: 0; }
}
@media (min-width: 1500px) {
  .panel { max-width: 1400px; }
}

/* ---------- news filters ---------- */
.news-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.news-filters select { padding: 6px 8px; font-size: 14px; max-width: 100%; }
.news-filters select:not([hidden]) { display: inline-block; }
#news-team { flex: 1 1 220px; }
.star-btn { padding: 6px 12px; white-space: nowrap; }
.star-btn.on { border-color: #f59e0b; color: #b45309; }
:root[data-theme="dark"] .star-btn.on { color: #fbbf24; }
.chip.fav { font-weight: 700; }
.news-count { margin: 2px 2px 8px; }
.team-tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 4px; padding: 0 5px; margin-right: 6px; }
@media (max-width: 699px) {
  .news-filters select { flex: 1 1 45%; }
  #news-team { flex: 1 1 100%; }
}
@media (min-width: 960px) {
  .news-filters { max-width: 900px; }
  #news-team { flex: 0 1 260px; }
}
@media (max-width: 699px) {
  #news .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 2px; scrollbar-width: none; }
  #news .chips::-webkit-scrollbar { display: none; }
  #news .chip { flex: 0 0 auto; }
  .news-filters select, .star-btn { font-size: 14px; padding: 6px 8px; }
  .star-btn { flex: 1 1 45%; }
}

/* ---------- notifications card ---------- */
.push-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); color: var(--text); }
.push-head { display: flex; justify-content: space-between; align-items: center; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.pill.on { background: var(--green-fill); color: var(--on-green); }
#push-status { margin: 6px 0 10px; line-height: 1.45; }
.push-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.push-actions .btn { padding: 8px 14px; }
.push-actions .btn:disabled { opacity: .6; }

/* ---------- install banner + guide ---------- */
.install-banner {
  display: flex; align-items: center; gap: 10px; margin: 10px 16px 0; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #f87171 45%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, #f87171 9%, var(--bg));
}
.install-banner[hidden] { display: none; }
.banner-logo { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.banner-text { flex: 1; font-weight: 600; font-size: 13px; line-height: 1.35; }
.install-banner .btn { padding: 7px 14px; flex-shrink: 0; }
.banner-x { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 2px; line-height: 1; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { position: relative; background: var(--bg); color: var(--text); border-radius: 16px; padding: 24px 22px 18px; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-card h2 { margin: 10px 0 6px; font-size: 20px; }
.modal-logo { width: 52px; height: 52px; border-radius: 12px; }
.modal-x { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 24px; color: var(--muted); cursor: pointer; }
.steps { padding-left: 20px; margin: 10px 0; line-height: 1.5; }
.steps li { margin-bottom: 8px; }
.btn.wide { width: 100%; padding: 11px; font-size: 15px; }
.get-app { font-size: inherit; font-weight: 700; }
footer .get-app + span::before { content: ' · '; }
@media (min-width: 960px) {
  .install-banner { margin: 20px auto 0; max-width: 1160px; }
  footer { display: flex; flex-direction: column; gap: 6px; }
  footer .get-app { text-align: left; font-size: 13px; }
  footer .get-app + span::before { content: none; }
}

/* ---------- launch screen ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 0%, #2a1416 0%, #0d1117 60%);
  color: #fff; text-align: center; transition: opacity .5s ease, visibility .5s ease;
}
.no-splash .splash { display: none; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-inner { max-width: 440px; animation: splash-in .7s ease both; }
.splash-logo { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 12px 40px rgba(248,113,113,.35); }
.splash-name { font-size: 30px; font-weight: 800; letter-spacing: -.6px; margin-top: 18px; }
.splash-tag { font-size: 18px; line-height: 1.45; color: #cbd5e1; margin: 12px 0 26px; font-weight: 500; }
.splash-tag { text-wrap: balance; }
.splash-bar { height: 4px; width: 160px; margin: 0 auto; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: linear-gradient(90deg, #f87171, #22c55e); animation: splash-load 1.1s ease-in-out infinite; }
@keyframes splash-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes splash-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ---------- header premium button ---------- */
.premium-btn {
  border: 0; border-radius: 8px; padding: 6px 11px; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #2b1700;
}
.premium-btn.on { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.desk-only { display: none !important; }
@media (min-width: 960px) {
  .tab.desk-only { display: flex !important; }
  .premium-btn { width: 100%; padding: 9px 12px; font-size: 14px; }
  .header-actions { flex-wrap: wrap; gap: 10px; }
  .header-actions .premium-btn { order: -1; flex-basis: 100%; }
}
@media (max-width: 420px) {
  .beta { display: none; }
  .brand { font-size: 16px; }
  .header-actions { gap: 6px; }
  .premium-btn { padding: 6px 9px; font-size: 12px; }
}

/* ---------- winners: views + win % ---------- */
.seg-big { display: flex; margin-bottom: 14px; }
.seg-big button { flex: 1; padding: 8px 10px; font-size: 13.5px; }
.lead-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lead-meta .bar { flex: 1; margin-top: 0; }
.hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.who-row { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.wr-chip {
  display: inline-flex; align-items: center; white-space: nowrap; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums;
}
.wr-chip.good { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 8%, var(--bg)); }
.wr-chip.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.wr-chip.loading { color: var(--muted); }
.wr-chip.locked { cursor: pointer; color: #b45309; border-color: color-mix(in srgb, #f59e0b 45%, transparent); background: color-mix(in srgb, #f59e0b 10%, var(--bg)); font: inherit; font-size: 11px; font-weight: 700; }
:root[data-theme="dark"] .wr-chip.locked { color: #fbbf24; }
.follow-limit { margin: -2px 2px 10px; }

/* ---------- alerts layout ---------- */
.alerts-grid { display: flex; flex-direction: column-reverse; gap: 14px; }
.alerts-grid .settings { margin-top: 0; padding-top: 0; border-top: 0; }
@media (min-width: 960px) {
  .alerts-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  .alerts-grid .settings { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  #alert-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* ---------- premium page ---------- */
.premium-reason { background: color-mix(in srgb, #f59e0b 12%, var(--bg)); border: 1px solid color-mix(in srgb, #f59e0b 45%, transparent); border-radius: 12px; padding: 10px 14px; font-weight: 600; margin-bottom: 14px; }
.premium-reason[hidden] { display: none; }
.premium-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel); margin-bottom: 14px; }
.premium-card.on { border-color: color-mix(in srgb, #f59e0b 50%, transparent); background: radial-gradient(120% 140% at 100% 0%, rgba(245,158,11,.14), transparent 55%), var(--panel); }
.premium-card.subtle { background: var(--bg); }
.premium-card.subtle p { margin: 4px 0 10px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pc-badge { font-weight: 800; font-size: 18px; }
.pc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pc-actions .btn { padding: 9px 14px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.plan { text-align: left; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); color: var(--text); cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px; }
.plan b { font-size: 16px; }
.plan.on { border-color: #f59e0b; box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 20%, transparent); }
.big-cta { width: 100%; padding: 13px; font-size: 16px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #2b1700; }
.big-cta:disabled { opacity: .7; }
.premium-cta { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #2b1700; }
.fine { font-size: 12px; margin: 10px 2px 0; line-height: 1.5; }
.fine a, footer a { color: var(--accent); }
.pf-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.pf { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.pf-ico { font-size: 22px; line-height: 1; }
.pf p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; }
.link-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.link-box[hidden] { display: none; }
.link-code { font-size: 32px; font-weight: 800; letter-spacing: 6px; margin: 8px 0; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) {
  #premium .premium-card, #premium .pf-grid, .premium-reason { max-width: 760px; }
  .pf-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- sponsors ---------- */
.sponsor-slot:empty { display: none; }
.sponsor { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; border: 1px dashed var(--line-hover); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--panel); }
.sponsor img, .sponsor-ico { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.sponsor-ico { display: grid; place-items: center; background: var(--panel-2); font-weight: 800; }
.sponsor-body { flex: 1; min-width: 0; }
.sponsor-top { display: flex; align-items: center; gap: 8px; }
.sponsor-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.sponsor .btn { padding: 6px 12px; white-space: nowrap; }
.is-premium .sponsor-slot { display: none; }
header { gap: 10px; }
.brand { min-width: 0; }
@media (max-width: 480px) {
  .pb-go { display: none; }
  .brand { font-size: 16px; gap: 7px; }
  .logo { width: 26px; height: 26px; border-radius: 7px; }
  .beta { display: none; }
  .header-actions { gap: 6px; }
  .theme-track { width: 46px; }
  .theme-switch input:checked + .theme-track .theme-thumb { transform: translateX(20px); }
  .icon-btn { width: 30px; height: 30px; }
}
