/* Phone-first dashboard: one column, cards stacked by importance; two columns on wide screens.
   Black and white like the brand; red only for bad news. */
:root {
  --bg: #0A0A0A; --surface: #141414; --line: #262626; --fg: #F5F5F5; --muted: #A3A3A3;
  --invert: #0A0A0A; --bad: #FF5A5A; --bad-bg: #2A1414;
  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #FAFAFA; --surface: #FFFFFF; --line: #E3E3E3; --fg: #0A0A0A; --muted: #595959; --invert: #FFFFFF; --bad: #D42A2A; --bad-bg: #FDECEC; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #FAFAFA; --surface: #FFFFFF; --line: #E3E3E3; --fg: #0A0A0A; --muted: #595959; --invert: #FFFFFF; --bad: #D42A2A; --bad-bg: #FDECEC; color-scheme: light; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
.app { max-width: 1040px; margin: 0 auto; padding-block: 20px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; }
h1, h2 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h2 { font-size: 18px; }
p { margin: 0; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 6px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 22px var(--font-display); letter-spacing: -0.02em; }
.mark { width: 32px; height: 32px; fill: var(--fg); }
.mark-line { fill: none; stroke: var(--fg); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.mark-mask { fill: var(--bg); }
.tag { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--muted); }
.controls { display: flex; gap: 8px; align-items: center; }
.select, .btn { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 0 14px; cursor: pointer; }
.btn-primary { background: var(--fg); color: var(--invert); border-color: var(--fg); font-weight: 600; }
.btn:hover { border-color: var(--fg); }
.status { font-size: 13px; color: var(--muted); }
.status.is-error { color: var(--bad); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } }

/* Grade */
.grade-head { display: flex; align-items: center; gap: 16px; }
.grade { width: 72px; height: 72px; flex: none; border-radius: 18px; background: var(--fg); color: var(--invert); display: grid; place-items: center; font: 700 38px var(--font-display); }
.grade.is-bad { background: var(--bad); color: #FFFFFF; }
.grade.is-none { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-size: 28px; }
.verdict { font: 700 24px/1.15 var(--font-display); }
.meta { font-size: 13px; color: var(--muted); }
.changes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .changes { grid-template-columns: minmax(0, 1fr); } }
.change { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.change-label { font-size: 12px; color: var(--muted); }
.change-pct { font: 600 20px var(--font-body); font-variant-numeric: tabular-nums; }
.change-detail { font: 500 12px var(--font-mono); color: var(--muted); }
.bad { color: var(--bad); }
.note { color: var(--muted); font-size: 15px; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: 12px; color: var(--muted); }
.tile-value { font: 700 26px/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile-sub { font-size: 12px; color: var(--muted); }

/* Bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar { width: 100%; max-width: 44px; background: var(--fg); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar-col:last-child .bar { background: var(--fg); }
.bar-col:not(:last-child) .bar { opacity: .45; }
.bar-num { font: 500 11px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-labels { display: flex; gap: 6px; }
.bar-labels span { flex: 1 1 0; min-width: 0; text-align: center; font: 500 11px var(--font-mono); color: var(--muted); }

/* Tables and lists */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 500; color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .name { min-width: 0; overflow-wrap: anywhere; }
.list .sub { display: block; font-size: 12px; color: var(--muted); }
.list .num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.err-msg { font: 500 13px/1.4 var(--font-mono); overflow-wrap: anywhere; }
.empty { color: var(--muted); font-size: 14px; }

/* Key screen */
.gate { max-width: 440px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.gate h1 { font-size: 34px; }
.gate label { font-size: 14px; color: var(--muted); }
.gate input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); padding: 0 14px; width: 100%; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sample-banner { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }

/* ---------- v2: tabs, lists, forms ---------- */
.app { padding-bottom: 0; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; }
body { overflow-x: clip; }
/* Sticky (not fixed): iPhone Safari moves fixed bars around when its toolbar shrinks while scrolling */
.tabbar {
  position: sticky; bottom: 0; z-index: 20; margin-top: auto;
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
.tabbar-inner { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.tab { min-height: 52px; border: 0; background: transparent; color: var(--muted); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; cursor: pointer; padding: 0; }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-on { color: var(--fg); font-weight: 600; }
.tab.is-on svg { stroke-width: 2.3; }

.page-title { font: 700 28px/1.1 var(--font-display); letter-spacing: -0.02em; }
.section-note { color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.is-live { color: var(--fg); border-color: var(--fg); }
.pill.is-bad { color: var(--bad); border-color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); }
@media (prefers-reduced-motion: no-preference) { .dot.pulse { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .25; } }

.live-num { font: 700 44px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.mark-good, .mark-bad { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.mark-good { background: var(--fg); color: var(--invert); }
.mark-bad { background: var(--bad); color: #fff; }
.mark-good svg, .mark-bad svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Horizontal bars (funnel, groups, countries) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.hbar-top .num { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--fg); border-radius: 5px; }
.hbar-fill.is-bad { background: var(--bad); }

.bars.small { height: 110px; gap: 2px; }
.bars.small .bar { border-radius: 3px 3px 1px 1px; }
.bars.small .bar-col .bar { opacity: .45; }
.bars.small .bar-col.is-peak .bar { opacity: 1; }
.bar-labels.small span { font-size: 10px; }

.group-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini { background: var(--bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-label { font-size: 13px; font-weight: 600; }
.mini-value { font: 700 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.mini-sub { font-size: 12px; color: var(--muted); }

.heat-wrap { position: relative; width: 100%; max-width: 560px; margin: 0 auto; }
.heat-wrap canvas { width: 100%; height: auto; display: block; border-radius: 12px; background: var(--bg); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
@media (max-width: 420px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; color: var(--muted); }
.input, .textarea { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); padding: 0 12px; }
.textarea { min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.msg { font-size: 14px; min-height: 1.4em; }
.msg.is-error { color: var(--bad); }
.code { font: 500 12.5px/1.5 var(--font-mono); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; white-space: pre; }
.kv { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding-block: 10px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv-name { font: 500 14px var(--font-mono); overflow-wrap: anywhere; min-width: 0; }
.kv-value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: 14px; cursor: pointer; }
.chip.is-on { background: var(--fg); color: var(--invert); border-color: var(--fg); font-weight: 600; }
.answer { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }
.note-text { font-size: 13px; color: var(--muted); white-space: normal; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; align-items: center; }

/* ---------- accounts ---------- */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--fg); text-decoration: underline; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; flex: none; }
.check a { color: var(--fg); }
.icon-btn { width: 44px; padding: 0; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn.is-on { border-color: var(--fg); }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.gate .code { overflow-wrap: anywhere; }
.form .code { white-space: normal; overflow-wrap: anywhere; }

/* ---------- menu ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); }
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(320px, 86vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line);
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) 18px;
  display: flex; flex-direction: column; gap: 18px;
}
.menu .brand { font-size: 20px; }
.menu-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.menu-title { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 4px; }
.menu-item { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 10px; color: var(--fg); text-decoration: none; font-size: 16px; }
.menu-item:hover { background: var(--bg); }
.menu-item.is-on { background: var(--bg); font-weight: 600; }
.icon-btn svg path { stroke: currentColor; }
.card[id] { scroll-margin-top: 16px; }

[hidden] { display: none !important; }

/* ---------- organized layout (v3) ---------- */
.tabbar-inner { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 560px; }
.tab { font-size: 12px; }
.tab svg { width: 24px; height: 24px; }
.top .brand { font-size: 20px; }
.controls { gap: 6px; }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-title { font-size: 30px; }
.page-sub { margin: 0; color: var(--muted); font-size: 15px; }
.page-head .status { margin-top: 4px; }
.back-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px 0 4px; margin-left: -4px; border: 0; background: none; color: var(--fg); font: 600 15px var(--font-body); cursor: pointer; border-radius: 10px; }
.back-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back-btn:hover { background: var(--surface); }

/* Segmented switch (Players / Money / Updates) */
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.seg { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 600 15px var(--font-body); cursor: pointer; }
.seg.is-on { background: var(--fg); color: var(--invert); }

/* List rows (Tools, Settings) */
.row-group { display: flex; flex-direction: column; gap: 8px; }
.row-title { font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 6px 4px 0; }
.row-list { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row-item { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); text-align: left; text-decoration: none; cursor: pointer; font: inherit; }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--bg); }
.row-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; }
.row-icon svg, .row-chev svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-text b { font-size: 16px; font-weight: 600; }
.row-text span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.row-chev { flex: none; color: var(--muted); }
.row-item.is-danger { color: var(--bad); }
.row-item.is-danger .row-icon { color: var(--bad); }
.help-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; }
.segmented { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg { font-size: 14px; }
.sub-h { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 6px; }

/* Connect with Roblox */
[data-action="rbx-oauth"].btn-primary { min-height: 48px; padding: 0 20px; font-size: 16px; gap: 10px; display: inline-flex; align-items: center; }
[data-action="rbx-oauth"] svg { width: 20px; height: 20px; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
details.more > summary { cursor: pointer; font-size: 15px; color: var(--muted); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more[open] > summary { margin-bottom: 12px; }

/* Scoreboard and goals */
.scoreboard h2 { margin: 0; }
.score-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.score-hero .live-num { font-size: 56px; margin: 2px 0 4px; }
.score-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 820px) { .score-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.score-tile { background: var(--bg); }
.score-tile .tile-value { font-size: 24px; overflow-wrap: anywhere; }
.goal { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.goal-track { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.score-tile .goal-track { background: var(--surface); border: 1px solid var(--line); }
.goal-fill { height: 100%; background: var(--fg); border-radius: 4px; transition: width .4s ease; }
.goal-text { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.goal.is-done .goal-text { color: var(--fg); font-weight: 700; }
.goals-form .muted { color: var(--muted); font-weight: 400; }

/* Plans and locks */
.is-locked .locked { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.lock-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--fg); }
.lock-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; align-self: flex-start; }
.toggle-btn { font: 500 14px var(--font-body); color: var(--muted); background: transparent; border: 0; border-radius: 999px; min-height: 36px; padding: 0 14px; cursor: pointer; }
.toggle-btn.is-on { background: var(--fg); color: var(--invert); }
.plan-boxes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 820px) { .plan-boxes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.plan-box.is-current { border-color: var(--fg); border-width: 2px; }
.plan-box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 18px; }
.plan-price { font: 700 22px var(--font-display); font-variant-numeric: tabular-nums; }
.plan-price .per { font: 400 13px var(--font-body); color: var(--muted); }
.plan-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.plan-perks li { display: flex; gap: 8px; align-items: flex-start; }
.plan-perks svg { width: 16px; height: 16px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.plan-box .btn { align-self: flex-start; }

/* Game switcher chip and team */
.game-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 14px var(--font-body); cursor: pointer; max-width: 100%; }
.game-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.game-chip span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item.is-current { border-color: var(--fg); }
.select-small { min-height: 36px; padding: 0 10px; width: auto; }
.team-list .check { font-size: 14px; }

/* A/B test results */
.ab-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ab-row { display: grid; grid-template-columns: 1.1fr repeat(4, 1fr); gap: 6px; padding: 8px 10px; font-size: 13px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
.ab-row:first-child { border-top: 0; }
.ab-head { color: var(--muted); font-size: 12px; background: var(--bg); }
.ab-row.is-lead { background: var(--bg); font-weight: 700; }
.mono { font-family: var(--font-mono); letter-spacing: .03em; }
.no-money .ab-row { grid-template-columns: 1.1fr repeat(3, 1fr); }

/* Tip, achievements, battles, Wrapped */
.tip { display: flex; gap: 14px; align-items: flex-start; }
.tip-emoji { font-size: 34px; line-height: 1; }
.tip .note { margin: 4px 0 8px; }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .badges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .badges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.badge { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); opacity: .55; min-width: 0; }
.badge.is-done { opacity: 1; border-color: var(--fg); background: var(--surface); }
.badge-emoji { font-size: 24px; filter: grayscale(1); }
.badge.is-done .badge-emoji { filter: none; }
.badge b { font-size: 14px; overflow-wrap: anywhere; }
.badge-sub { font-size: 12px; color: var(--muted); }
.badge-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 4px; }
.badge-bar span { display: block; height: 100%; background: var(--fg); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -40px; animation: fall 2.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
.unlock-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--fg); color: var(--invert); padding: 12px 18px; border-radius: 999px; font-weight: 700; z-index: 61; max-width: calc(100% - 32px); text-align: center; }
.battle-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.battle-list li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.battle-list li.is-me { border-color: var(--fg); }
.battle-list .name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.battle-list .sub { font-weight: 400; font-size: 13px; color: var(--muted); }
.battle-rank { width: 28px; text-align: center; font-weight: 700; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; max-width: 420px; width: 100%; max-height: 100%; overflow: auto; }
.modal-box img { width: 100%; border-radius: 12px; display: block; }

/* Rivals */
.good { color: var(--fg); font-weight: 600; }
.sub-title { font-size: 17px; font-weight: 700; margin: 18px 0 4px; }
.spark { flex: none; color: var(--fg); opacity: .8; }
.rival-list .name a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.rival-list .name a:hover { text-decoration: underline; }
.pill.is-hot { background: #FFF1E6; color: #A34100; border-color: #FFD3B0; font-size: 12px; padding: 2px 8px; vertical-align: middle; }
@media (max-width: 420px) { .rival-list .spark { display: none; } }

/* Getting started checklist */
.checklist { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; align-items: center; gap: 12px; }
.checklist .name { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.checklist .name a { color: inherit; }
.checklist .sub { font-weight: 400; font-size: 13px; color: var(--muted); }
.checklist li.is-done .name { color: var(--muted); font-weight: 400; }
.check-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.checklist li.is-done .check-dot { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* iPhone: the bar is placed by script at the bottom of the visible area (see pinTabbar) */
.pin-tabbar .tabbar { position: fixed; top: 0; left: 0; right: 0; bottom: auto; margin: 0; will-change: transform; transform: translate3d(0, var(--tab-y, calc(100vh - 84px)), 0); }
.pin-tabbar.keyboard-open .tabbar { visibility: hidden; }
.pin-tabbar .app { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
