/* Who's That Coin. Phone first; light and dark follow the device. The chart stage is the same deep indigo in both. */
:root {
  --bg: #F3F1FA; --card: #FFFFFF; --ink: #15132B; --muted: #5F5B7D; --line: #DAD6EC;
  --accent: #5B2EFF; --on-accent: #FFFFFF; --accent-soft: #ECE7FF;
  --ok: #0B8F6A; --near: #B77900; --bad: #C22B66;
  --stage: #14112B; --stage-text: #A9A5CE; --up: #2DD4BF; --down: #FF5D8F; --btc: #8F8AB8;
  --shadow: 0 10px 30px rgba(35, 25, 90, .10);
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0A1C; --card: #171431; --ink: #F1EFFF; --muted: #A5A1C6; --line: #2E2957;
    --accent: #A48BFF; --on-accent: #15132B; --accent-soft: #241D4F;
    --ok: #3DDC97; --near: #FFD43B; --bad: #FF7FAE;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums; overflow-x: hidden; touch-action: manipulation; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1180px; margin: 0 auto; padding: 12px 16px 6px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.mark { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.top nav { display: flex; gap: 2px; }
.top nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 9px; border-radius: 999px; }
.top nav a:hover { color: var(--ink); background: var(--accent-soft); }

main { max-width: 1180px; margin: 0 auto; padding: 0 16px 8px; }

/* the game */
.game { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.intro { padding-top: 6px; }
.kicker { display: flex; gap: 10px; align-items: baseline; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.kicker #day-date { color: var(--muted); font-weight: 600; letter-spacing: .04em; }
h1 { font-weight: 800; font-size: clamp(34px, 10vw, 60px); line-height: 1; letter-spacing: -.035em; margin-top: 4px; }
.lede { color: var(--muted); margin-top: 8px; font-size: 16px; max-width: 46ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fact { display: inline-block; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 13px; font-size: 14px; line-height: 1.25; color: var(--ink); }
.fact b { font-weight: 700; }
.fact-btn { border-color: var(--accent); }
.fact-btn { text-align: left; }
.fact-btn .more { color: var(--accent); font-weight: 700; margin-left: 8px; text-decoration: underline; text-underline-offset: 3px; }

.stage { background: var(--stage); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
.stage-inner { position: relative; }
#chart { display: block; width: 100%; height: clamp(230px, 66vw, 430px); }
.stage-msg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #D9D5F5; font-weight: 600; }
.stage-msg p { max-width: 34ch; }
.bar { width: min(220px, 60%); height: 8px; border-radius: 99px; background: #2B2652; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--up); border-radius: 99px; transition: width .4s; }
.stage figcaption { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; padding: 8px 14px 12px; color: var(--stage-text); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend b { color: #F1EFFF; font-weight: 700; }
.sw { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: currentColor; flex: none; }
.sw.candle { width: 10px; height: 12px; background: linear-gradient(90deg, var(--up) 0 45%, transparent 45% 55%, var(--down) 55% 100%); border-radius: 1px; }
.sw.btc { background: repeating-linear-gradient(90deg, var(--btc) 0 4px, transparent 4px 7px); }
.range { min-width: 0; }

.play { display: grid; gap: 12px; align-content: start; min-width: 0; }
.tries { display: flex; gap: 8px; }
.tries li { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--muted); flex: none; }
.tries li.now { border: 2.5px solid var(--accent); color: var(--accent); }
.tries li.used { border: 0; color: #15132B; background: var(--c, #C3CBD6); }
.tries li.skip { border: 0; background: var(--line); color: var(--muted); }
.tries li.hit { border: 0; background: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .tries li.hit { color: #0C0A1C; } }

.guess { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.field { position: relative; grid-column: 1 / -1; }
#guess { width: 100%; height: 52px; border-radius: 16px; border: 2px solid var(--ink); background: var(--card); padding: 0 16px; font-size: 17px; font-weight: 600; }
#guess::placeholder { color: var(--muted); font-weight: 500; }
#guess:disabled { border-color: var(--line); opacity: .7; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 58px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; max-height: 290px; overflow: auto; }
.suggest li { display: flex; gap: 10px; align-items: baseline; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.suggest li b { font-weight: 800; min-width: 56px; }
.suggest li span { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest li em { font-style: normal; color: var(--muted); font-size: 13px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-soft); }
.suggest .none { color: var(--muted); cursor: default; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; color: var(--muted); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.ghost-light { background: transparent; border-color: #5A5490; color: #F1EFFF; }
.btn:disabled { opacity: .45; cursor: default; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.note { min-height: 1.4em; color: var(--bad); font-weight: 600; font-size: 14.5px; }
.note:empty { display: none; }

.hints { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint { border: 1.5px dashed var(--line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.hint-k { font-weight: 700; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; }
.hint.open { border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--ink); }
.hint.open .hint-k { color: var(--accent); }
.hint.open .hint-v { font-weight: 700; font-size: 15px; }

.log { display: grid; gap: 6px; }
.log:empty { display: none; }
.log li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 9px 12px; }
.log .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--line)); }
.log .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .who b { font-weight: 800; }
.log .who span { color: var(--muted); font-size: 14px; }
.log .mv { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.log .fb { grid-column: 2 / -1; font-weight: 700; font-size: 14.5px; }
.log .fb.bigger, .log .fb.smaller { color: var(--accent); }
.log .fb.near { color: var(--near); }
.log .fb.hit { color: var(--ok); }
.log .fb.skip { color: var(--muted); font-weight: 600; }

.result { background: var(--card); border: 2px solid var(--accent); border-radius: 22px; padding: 16px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.result-kicker { font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.result.lost .result-kicker { color: var(--bad); }
.result h2 { font-size: clamp(26px, 7vw, 36px); line-height: 1.05; letter-spacing: -.02em; font-weight: 800; }
.result p { color: var(--muted); }
.sharetext { font: 600 15px/1.5 var(--font); background: var(--bg); border-radius: 14px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row .btn { flex: 1 1 140px; }
.next b { color: var(--ink); font-weight: 800; }

/* panels */
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 18px 16px; margin-top: 18px; }
.panel h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; margin-bottom: 12px; }
.panel h3 { font-size: 16px; font-weight: 800; margin: 16px 0 8px; }
.rules { display: grid; gap: 12px; }
.rules dt { font-weight: 800; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.rules dd { margin-top: 2px; max-width: 72ch; }
.fine { color: var(--muted); font-size: 14px; margin-top: 12px; }
.fine.prev { margin-top: 0; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-row div { display: grid; text-align: center; background: var(--bg); border-radius: 16px; padding: 10px 4px; }
.stat-row b { font-size: 26px; line-height: 1.1; font-weight: 800; }
.stat-row span { color: var(--muted); font-size: 12.5px; }
.dist { display: grid; gap: 5px; margin-top: 14px; }
.dist li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: center; font-weight: 700; font-size: 14px; }
.dist .barw { display: block; }
.dist i { display: block; min-width: 26px; height: 22px; border-radius: 99px; background: var(--line); color: var(--ink); font-style: normal; text-align: right; padding: 0 9px; font-size: 13px; line-height: 22px; }
.dist li.mine i { background: var(--accent); color: var(--on-accent); }

.token { border-color: var(--accent); }
.ticker { color: var(--accent); white-space: nowrap; }
.token-facts { font-size: 18px; font-weight: 700; line-height: 1.4; max-width: 60ch; }
.addr { display: grid; gap: 12px; margin-top: 14px; }
.addr dt { font-weight: 800; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.addr dd { margin-top: 4px; display: grid; gap: 8px; }
.addr code { font: 600 14px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; background: var(--bg); border-radius: 12px; padding: 9px 11px; display: block; }
.addr-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th, .ledger td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ledger th:last-child, .ledger td:last-child { text-align: right; }

.foot { max-width: 1180px; margin: 0 auto; padding: 18px 16px 34px; color: var(--muted); font-size: 13.5px; display: grid; gap: 6px; }
.noscript { max-width: 1180px; margin: 0 auto; padding: 0 16px 24px; font-weight: 700; }

/* the list */
.sheet { border: 0; padding: 16px; background: var(--card); color: var(--ink); width: 100%; max-width: 760px; max-height: 86vh; border-radius: 22px 22px 0 0; margin: auto auto 0; box-shadow: var(--shadow); }
.sheet::backdrop { background: rgba(12, 10, 28, .62); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: -16px; background: var(--card); padding: 6px 0 8px; margin-top: -6px; z-index: 1; }
.sheet h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.sheet .fine { margin-top: 0; }
.coins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 12px 0; }
.coins button { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 6px; text-align: left; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 7px 9px; line-height: 1.25; }
.coins button:hover { border-color: var(--accent); }
.coins .rk { grid-row: 1 / 3; color: var(--muted); font-size: 12.5px; font-weight: 700; align-self: center; }
.coins b { font-weight: 800; font-size: 15px; }
.coins span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coins button.tried { opacity: .45; text-decoration: line-through; }

@media (min-width: 620px) {
  .sheet { border-radius: 22px; margin: auto; }
  .panel { padding: 24px; }
  .rules { grid-template-columns: 1fr 1fr; gap: 16px 28px; }
}
@media (min-width: 980px) {
  .top { padding: 18px 24px 8px; }
  .brand { font-size: 19px; }
  main { padding: 0 24px 8px; }
  .game { grid-template-columns: minmax(0, 1.62fr) minmax(340px, 1fr); gap: 16px 22px; align-items: start; }
  .intro { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(340px, 1fr); gap: 0 22px; align-items: end; }
  .intro .kicker, .intro h1, .intro .lede { grid-column: 1; }
  .intro .facts { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin: 0; }
  #chart { height: 470px; }
  .foot { padding: 18px 24px 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .bar i { transition: none; } }
