/* RUN EARN — clean, Strava-like layout: white surfaces, bold numbers,
   round icon buttons and a floating tab bar. Lime is the brand accent. */
:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --text: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --accent: #a3e635;         /* lime — buttons, fills */
  --accent-strong: #3f7a0c;  /* text/lines on surfaces */
  --accent-soft: #eefbd5;
  --accent-ink: #0b0b0c;
  --route: #16a34a;
  --coin: #b78300;
  --coin-soft: #fff4d1;
  --good: #16a34a;
  --bad: #dc2626;
  --hr: #e11d48;
  --elev: #0d9488;
  --shadow: 0 4px 18px rgba(0, 0, 0, .10);
  --radius: 18px;
  --topbar: 64px;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #161618;
    --surface-2: #232326;
    --text: #f2f2f3;
    --muted: #9c9ba3;
    --line: #2b2b2f;
    --accent-strong: #a3e635;
    --accent-soft: #24310f;
    --route: #a3e635;
    --coin: #fbbf24;
    --coin-soft: #3a2c08;
    --hr: #fb7185;
    --elev: #2dd4bf;
    --shadow: 0 4px 18px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-top: calc(var(--topbar) + env(safe-area-inset-top));
  padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
button { font: inherit; color: inherit; }
svg { stroke-linecap: round; stroke-linejoin: round; }
.link { color: var(--accent-strong); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: calc(var(--topbar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.tb-left { justify-self: start; display: flex; gap: 8px; }
.tb-right { justify-self: end; display: flex; gap: 8px; align-items: center; }
.tb-title { font-size: 19px; font-weight: 800; text-align: center; white-space: nowrap; }
.logo { font-weight: 900; font-size: 22px; letter-spacing: -0.02em; }
.logo em { font-style: normal; color: var(--accent-strong); }
.logo .beta { font-size: 9px; font-weight: 800; letter-spacing: .06em; margin-left: 4px; padding: 2px 5px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); vertical-align: 6px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); border: 0; cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.wallet-chip { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 99px; background: var(--coin-soft); font-size: 14px; }
.wallet-chip:empty { display: none; }

/* ---------- floating tab bar ---------- */
.tabbar {
  position: fixed; z-index: 1000; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; height: var(--tabbar); padding: 6px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: var(--surface); border-radius: 99px; box-shadow: 0 6px 28px rgba(0, 0, 0, .14);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; }
.tabbar svg .fill { fill: currentColor; stroke: none; }
.tabbar a.active { background: var(--surface-2); color: var(--accent-strong); }

.rec-banner {
  position: fixed; z-index: 999; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar) + 22px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: var(--shadow); font-variant-numeric: tabular-nums;
}
.rec-banner[hidden] { display: none; }
.rec-banner .dot { width: 9px; height: 9px; border-radius: 50%; background: #dc2626; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Record screen is full-screen like Strava: no top bar or tab bar. */
body.immersive { padding: 0; }
body.immersive .topbar, body.immersive .tabbar { display: none; }

/* ---------- generic ---------- */
.page { max-width: 680px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.card h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.card-title { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 16px; font-weight: 700; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--surface-2); }
.btn.pill { border-radius: 99px; padding: 10px 20px; }
.btn.block { width: 100%; margin-top: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); }
.badge.neutral { background: var(--surface-2); color: var(--muted); }
.note { background: var(--surface); border-radius: 14px; padding: 14px 16px; font-size: 14px; color: var(--muted); }
.note.warn { background: var(--coin-soft); color: var(--text); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 4000;
  bottom: calc(var(--tabbar) + 28px + env(safe-area-inset-bottom));
  background: var(--text); color: var(--surface); padding: 11px 18px; border-radius: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); text-align: center;
}

/* ---------- avatar ---------- */
.avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: #c9c9c9; color: #fff; font-weight: 800; font-size: 18px;
}
.avatar.xl { width: 92px; height: 92px; font-size: 32px; }

/* ---------- home feed ---------- */
.feed { max-width: 680px; margin: 0 auto; display: grid; gap: 8px; }
.streak-card, .post { background: var(--surface); padding: 20px 20px 22px; }
.streak-card h3 { font-size: 19px; font-weight: 800; }
.streak-body { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; margin-top: 14px; }
.streak-body p { margin: 0; font-size: 16px; color: var(--muted); }
.streak-body .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 480px) { .streak-body { grid-template-columns: auto 1fr auto; } .streak-body .btn { grid-column: auto; } }
.streak-num { display: grid; justify-items: center; gap: 2px; font-weight: 700; color: var(--muted); font-size: 14px; }
.flame { position: relative; width: 48px; height: 60px; }
.flame svg { width: 100%; height: 100%; fill: #c9c9c9; }
.flame.on svg { fill: var(--accent); }
.flame b { position: absolute; inset: 22px 0 0; text-align: center; font-size: 20px; font-weight: 900; color: #fff; }
.flame.on b { color: var(--accent-ink); }

.post { padding-bottom: 0; }
.post-link { display: block; }
.post-head { display: flex; align-items: center; gap: 14px; }
.post-head b { display: block; font-size: 17px; }
.post-head span { display: block; color: var(--muted); font-size: 14px; }
.post-title { font-size: 28px; font-weight: 850; letter-spacing: -0.02em; margin: 20px 0 16px; }
.post-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.post-stats span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.post-stats b { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-earn { margin-top: 14px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.post-map { height: 220px; margin: 18px -20px 0; background: var(--surface-2); cursor: pointer; position: relative; z-index: 0; }
.post:not(:has(.post-map)) { padding-bottom: 22px; }
.route-thumb path { fill: none; stroke: var(--route); stroke-width: 3; vector-effect: non-scaling-stroke; }
.route-thumb.fallback { width: 100%; height: 100%; }
.post.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 40px 20px; }
.post.empty > svg { width: 56px; height: 56px; fill: none; stroke: var(--accent-strong); stroke-width: 1.6; }
.post.empty p { margin: 0; max-width: 340px; }

/* ---------- record ---------- */
.rec { position: relative; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.rec-map { flex: 1; min-height: 120px; z-index: 0; }
.rec-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 14px; z-index: 600; }
.gps-pill {
  position: absolute; top: calc(20px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 600;
  padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 700;
  background: var(--surface); box-shadow: var(--shadow); display: flex; gap: 7px; align-items: center; white-space: nowrap;
}
.gps-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.gps-pill.good i { background: var(--good); }
.gps-pill.weak i { background: #f59e0b; }
.gps-pill.bad i { background: var(--bad); }
.rec-sheet {
  position: relative; z-index: 500; margin-top: -22px; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 16px;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); max-width: 680px; width: 100%; margin-left: auto; margin-right: auto;
}
.sheet-handle { width: 44px; height: 5px; border-radius: 99px; background: var(--line); justify-self: center; }
.start-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; justify-items: center; gap: 8px; padding-top: 4px; }
.round-opt { display: grid; justify-items: center; gap: 8px; font-weight: 600; font-size: 15px; background: none; border: 0; cursor: pointer; padding: 0; }
.round-opt .round { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.round-opt .round.on { background: var(--accent-soft); color: var(--accent-strong); }
.round-opt .round svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2; }
.round-opt .round .sneaker-art.xs { width: 52px; }
.start-btn {
  display: grid; justify-items: center; gap: 10px; background: none; border: 0; cursor: pointer; padding: 0;
  font-weight: 800; font-size: 17px; color: var(--accent-strong);
}
.start-btn svg {
  width: 92px; height: 92px; padding: 25px 23px 25px 29px; border-radius: 50%;
  background: var(--accent); fill: var(--accent-ink); box-shadow: 0 8px 22px rgba(132, 204, 22, .45);
}
.start-btn svg .fill { fill: var(--accent-ink); }
.sheet-list { background: var(--surface-2); border-radius: 18px; overflow: hidden; }
.sheet-row {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 15px 16px; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer;
}
.sheet-row:first-child { border-top: 0; }
.sheet-row > svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sheet-row > svg:last-child { width: 20px; height: 20px; margin-left: auto; color: var(--muted); }
.sheet-row div { min-width: 0; }
.sheet-row b { display: block; font-size: 17px; font-weight: 600; }
.sheet-row span { display: block; color: var(--muted); font-size: 14px; }

.earn-status { text-align: center; font-size: 14px; font-weight: 700; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.earn-status.earning { background: var(--accent); color: var(--accent-ink); }
.earn-status.warn { background: var(--coin-soft); color: var(--text); }
.earn-status.bad { background: var(--bad); color: #fff; }
.live-big { text-align: center; }
.live-big > span, .live-grid > div > span, .live-mini > div > span { display: block; color: var(--muted); font-size: 14px; font-weight: 600; }
.live-big b { font-size: 64px; font-weight: 850; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.live-grid div + div { border-left: 1px solid var(--line); }
.live-grid b { font-size: 40px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.live-grid small { display: block; color: var(--muted); font-weight: 600; }
.live-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; gap: 4px; }
.live-mini b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-mini > div > span { font-size: 12px; }
.hr-val { color: var(--hr); }
.rec-controls { display: flex; justify-content: center; gap: 28px; padding-top: 4px; }
.ctl { display: grid; justify-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 0; font-weight: 800; font-size: 15px; }
.ctl svg { width: 84px; height: 84px; padding: 26px; border-radius: 50%; }
.ctl svg .fill { fill: currentColor; }
.ctl-pause svg { background: var(--text); color: var(--surface); }
.ctl-resume svg { background: var(--accent); color: var(--accent-ink); padding: 24px 22px 24px 28px; }
.ctl-finish svg { background: var(--text); color: var(--surface); }

/* ---------- run detail ---------- */
.detail { max-width: 680px; margin: 0 auto; }
.detail-top { background: var(--surface); padding: 20px; }
.detail-top .post-title { cursor: pointer; }
.detail-map { height: 300px; z-index: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; }
.stats-grid b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 170px; }
.chart-box.weeks { height: 200px; }
.splits { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.splits th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.splits td { padding: 7px 6px; border-top: 1px solid var(--line); }
.splits .bar { height: 10px; border-radius: 99px; background: var(--route); opacity: .75; }
.splits .bar.fast { opacity: 1; }
.earn-card { display: grid; gap: 12px; }
.earn-total { font-size: 30px; font-weight: 900; display: flex; align-items: baseline; gap: 8px; }
.earn-total small { font-size: 14px; color: var(--muted); }

/* ---------- profile ---------- */
.profile { max-width: 680px; margin: 0 auto; background: var(--surface); padding: 8px 20px 0; }
.prof-head { display: flex; align-items: center; gap: 22px; }
.prof-head h1 { font-size: 30px; font-weight: 850; letter-spacing: -0.02em; }
.prof-head span { color: var(--muted); font-size: 18px; }
.prof-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 18px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin: 0 -20px; padding: 0 20px; }
.tabs a { flex: 1; text-align: center; padding: 12px 0 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.streak-month { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; justify-items: center; }
.cal i { width: 18px; height: 18px; border-radius: 50%; }
.cal-h { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; width: auto !important; height: auto !important; }
.cal-d { background: var(--surface-2); }
.cal-d.ran { background: var(--text); }
.cal-d.today { box-shadow: 0 0 0 2px var(--text) inset; background: transparent; }
.cal-d.today.ran { background: var(--text); }
.run-list { padding: 4px 16px; }
.run-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.run-row:first-child { border-top: 0; }
.run-thumb { width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.run-thumb svg { width: 100%; height: 100%; }
.run-thumb > svg:not(.route-thumb) { width: 28px; height: 28px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.run-info { display: grid; min-width: 0; }
.run-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-stats { font-weight: 700; font-size: 14px; margin-top: 2px; }

/* ---------- settings ---------- */
.list-card { padding: 4px 18px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-of-type, .list-card .setting:first-child { border-top: 0; }
.setting .row > svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.setting > svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; flex: none; }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--surface); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- devices ---------- */
.drop {
  border: 2px dashed var(--line); border-radius: 16px; padding: 28px 16px; text-align: center;
  display: grid; gap: 8px; justify-items: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent-strong); background: var(--accent-soft); }
.drop > svg { width: 40px; height: 40px; fill: none; stroke: var(--accent-strong); stroke-width: 1.8; }
.import-log { display: grid; gap: 6px; margin-top: 12px; }
.import-log div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.import-log .ok { color: var(--good); font-weight: 700; }
.import-log .skip { color: var(--muted); font-weight: 700; }
.import-log .err { color: var(--bad); font-weight: 700; }
.hr-live { display: flex; align-items: baseline; gap: 6px; }
.hr-live b { font-size: 40px; font-weight: 800; color: var(--hr); font-variant-numeric: tabular-nums; }
.brands { display: grid; gap: 8px; }
.brands details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.brands summary { cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.brands summary::-webkit-details-marker { display: none; }
.brands summary::after { content: "+"; color: var(--muted); font-size: 18px; }
.brands details[open] summary::after { content: "–"; }
.brands ol { margin: 8px 0 2px; padding-left: 20px; color: var(--muted); }
.brands li { margin: 3px 0; }

/* ---------- coins & earn tab ---------- */
.coin-amt { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 800; }
.coin-ico { width: 1em; height: 1em; flex: none; }
.coin-ico circle { fill: var(--coin); }
.coin-ico path { fill: none; stroke: #1b1405; stroke-width: 1.8; }
.wallet { display: grid; gap: 16px; }
.wallet-amt { font-size: 34px; font-weight: 900; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 8px; }
.wallet-amt small { font-size: 14px; color: var(--muted); font-weight: 700; }
.energy-num { font-variant-numeric: tabular-nums; }
.energy-bar { display: flex; gap: 4px; margin: 6px 0; }
.energy-bar i { flex: 1; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) calc(var(--f) * 100%), var(--surface-2) 0); }

.sneaker-art { display: block; width: 100%; max-width: 300px; height: auto; margin: 4px auto; overflow: visible; }
.sneaker-art.sm { max-width: 132px; }
.sneaker-art.xs { width: 50px; max-width: 50px; margin: 0; }
.sneaker-art .sparkle { fill: #f5c518; animation: twinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sneaker-art .sparkle:nth-of-type(2n) { animation-delay: .6s; }
@keyframes twinkle { 50% { opacity: .25; } }
.badge.r-common { background: var(--surface-2); color: var(--muted); }
.badge.r-uncommon { background: #dcfce7; color: #166534; }
.badge.r-rare { background: #dbeafe; color: #1e40af; }
.badge.r-epic { background: #f3e8ff; color: #6b21a8; }
@media (prefers-color-scheme: dark) {
  .badge.r-uncommon { background: #14321f; color: #86efac; }
  .badge.r-rare { background: #172554; color: #93c5fd; }
  .badge.r-epic { background: #2e1065; color: #d8b4fe; }
}
.sneaker-hero { display: grid; gap: 12px; }
.sneaker-name { font-size: 22px; font-weight: 850; }
.sneaker-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sneaker-facts b { font-size: 15px; font-weight: 800; }
.attrs { display: grid; gap: 8px; }
.attr { display: grid; grid-template-columns: 84px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.attr b { text-align: right; font-variant-numeric: tabular-nums; }
.attr b em { font-style: normal; color: var(--accent-strong); font-size: 11px; margin-left: 3px; }
.attr.has-ctl { grid-template-columns: 84px 1fr 56px auto; }
.attr-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.attr-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.attr-bar i.add { background: var(--accent-strong); opacity: .55; border-radius: 0 99px 99px 0; }
.attr-bar.dur i { background: var(--good); }
.attr-bar.dur.low i { background: var(--bad); }
.points-banner { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); font-size: 14px; }
.points-banner b { font-size: 18px; }
.pt-ctl { display: inline-flex; gap: 4px; }
.pt-ctl button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 16px; cursor: pointer; line-height: 1; }
.pt-ctl button:disabled { opacity: .35; cursor: not-allowed; }
.sneaker-list, .listings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sneaker-tile, .listing { position: relative; display: grid; gap: 4px; justify-items: start; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.sneaker-tile { cursor: pointer; }
.sneaker-tile.on { border-color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent-strong) inset; }
.sneaker-tile .sneaker-art, .listing .sneaker-art { justify-self: center; }
.listing .row { width: 100%; }
.listing .btn { width: 100%; margin-top: 4px; white-space: nowrap; gap: 6px; padding: 6px 8px; }
.pt-dot { position: absolute; top: 8px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 11px; line-height: 20px; font-style: normal; text-align: center; }
.mint-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 12px; }
.mint-slot { display: grid; gap: 6px; justify-items: center; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.mint-slot select { width: 100%; font: inherit; font-size: 12px; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.mint-plus { font-size: 24px; font-weight: 900; color: var(--accent-strong); }
.mint-odds { display: grid; gap: 6px; margin-bottom: 12px; }
.mint-odds + .btn { width: 100%; }
.boxes { display: flex; gap: 10px; flex-wrap: wrap; }
.box { display: grid; justify-items: center; gap: 2px; width: 78px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-weight: 800; }
.box svg { width: 36px; height: 36px; fill: var(--coin); stroke: #1b1405; stroke-width: 1.5; }
.box.q3 svg, .box.q4 svg { fill: #60a5fa; }
.box.q5 svg { fill: #c084fc; }
.box small { color: var(--accent-strong); font-size: 11px; }
.ledger { display: grid; }
.ledger > div { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ledger > div:first-child { border-top: 0; }
.ledger > div > span { flex: 1; }
.ledger .pos { color: var(--good); }
.ledger .neg { color: var(--bad); }
.ledger a { color: var(--accent-strong); font-weight: 700; }

/* ---------- reveal popup ---------- */
.reveal { position: fixed; inset: 0; z-index: 3500; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); animation: fade .2s ease; }
.reveal.out, .onboard.out { animation: fade .18s ease reverse forwards; }
.reveal-card { width: min(380px, 100%); background: var(--surface); border-radius: 22px; padding: 24px 20px; display: grid; gap: 12px; text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.reveal-card h2 { font-size: 22px; font-weight: 850; }
.reveal-kicker { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.reveal-art { position: relative; }
.reveal-art::before { content: ""; position: absolute; inset: 10% 15%; border-radius: 50%; background: radial-gradient(var(--accent) 0, transparent 70%); opacity: .35; }
.reveal-art .sneaker-art { position: relative; animation: float 2.4s ease-in-out infinite; }
.reveal-coins { font-size: 34px; font-weight: 900; display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.reveal-coins small { font-size: 14px; color: var(--muted); }
.reveal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reveal-stats b { font-size: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-6px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal-card, .reveal-art .sneaker-art, .onboard, .rec-banner .dot, .sneaker-art .sparkle { animation: none !important; } }

/* ---------- onboarding ---------- */
body.no-scroll { overflow: hidden; }
.onboard { position: fixed; inset: 0; z-index: 3000; background: var(--surface); overflow-y: auto; animation: fade .25s ease; }
.ob-card { max-width: 520px; min-height: 100dvh; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.ob-top { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width .2s; }
.ob-dots i.on { width: 22px; background: var(--accent); }
.ob-body { flex: 1; display: grid; align-content: start; gap: 16px; }
.ob-next { width: 100%; min-height: 56px; font-size: 17px; border-radius: 99px; }
.ob-hero { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 24px 0 8px; }
.ob-hero img { border-radius: 22px; box-shadow: 0 10px 30px rgba(132, 204, 22, .3); }
.ob-hero h1 { font-size: 40px; font-weight: 900; letter-spacing: -0.02em; }
.ob-hero h1 em { font-style: normal; color: var(--accent-strong); }
.ob-tag { margin: 0; font-size: 17px; color: var(--muted); }
.ob-list, .ob-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ob-list li, .ob-steps li { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.ob-list span, .ob-steps span { color: var(--muted); font-size: 14px; }
.ob-title { font-size: 28px; font-weight: 850; letter-spacing: -0.02em; }
.ob-sub { margin: -8px 0 0; }
.ob-steps li { grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.ob-steps li div { display: grid; gap: 2px; }
.ob-steps i { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 900; font-size: 15px; line-height: 32px; font-style: normal; text-align: center; }
.ob-starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ob-starter { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.ob-starter.on { border-color: var(--accent-strong); background: var(--accent-soft); }
.ob-starter b { font-size: 16px; }
.ob-zone { font-weight: 800; color: var(--accent-strong); font-size: 13px; }
.ob-name { display: grid; gap: 6px; }
.ob-name input { font: inherit; font-size: 17px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); }
.ob-name input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.ob-setup { background: var(--surface-2); border-radius: 16px; padding: 4px 16px; }

.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px !important; }
@media (max-width: 380px) {
  .post-stats b { font-size: 20px; }
  .post-title { font-size: 24px; }
  .live-big b { font-size: 54px; }
  .live-grid b { font-size: 34px; }
  .start-btn svg { width: 82px; height: 82px; }
  .round-opt .round { width: 58px; height: 58px; }
}

/* ---------- account & wallet ---------- */
.wallet-id { display: grid; gap: 10px; }
.wallet-id.guest { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.wallet-id.guest b { font-size: 18px; }
.wallet-id.guest p { margin: 0; }
.wallet-id.guest .btn { justify-self: start; }
.addr-row { display: flex; align-items: center; gap: 12px; }
.addr { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; flex: 1; min-width: 0; }
.addr-avatar { display: inline-block; flex: none; border-radius: 50%; }
.addr-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--surface-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.prof-head > div > span { display: block; }
.ob-auth { display: grid; gap: 10px; justify-items: center; text-align: center; }
.ob-auth .btn { width: 100%; min-height: 56px; font-size: 17px; border-radius: 99px; }
.ob-signed { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 14px; text-align: center; }
.ob-sign-status { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
