:root {
  --sky: oklch(0.92 0.04 205);
  --sky2: oklch(0.86 0.05 215);
  --snow: oklch(0.975 0.008 200);
  --paper: oklch(0.955 0.012 190);
  --ink: oklch(0.25 0.04 170);
  --ink2: oklch(0.38 0.04 175);
  --forest: oklch(0.42 0.08 158);
  --forest-d: oklch(0.3 0.06 165);
  --meadow: oklch(0.8 0.1 128);
  --rock: oklch(0.6 0.06 300);
  --rock-d: oklch(0.42 0.07 295);
  --red: oklch(0.57 0.2 27);
  --red-d: oklch(0.47 0.18 27);
  --blue: oklch(0.52 0.15 245);
  --black: oklch(0.22 0.02 250);
  --gold: oklch(0.83 0.15 85);
  --gold-d: oklch(0.62 0.13 80);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: 'Tilt Warp', 'Familjen Grotesk', system-ui, sans-serif;
  --text: 'Familjen Grotesk', system-ui, sans-serif;
  --mono: 'Red Hat Mono', ui-monospace, monospace;
  --r: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font-family: var(--text); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--sky); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.tnum, td, .num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--snow); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.02; margin: 0; text-wrap: balance; letter-spacing: -0.005em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 8px; border: 2px solid var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms;
}
.btn:active { transform: translateY(2px); box-shadow: none !important; }
.btn-ink { background: var(--ink); color: var(--snow); box-shadow: 0 3px 0 var(--forest-d); }
.btn-ink:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--forest-d); }
.btn-red { background: var(--red); color: var(--snow); border-color: var(--red-d); box-shadow: 0 4px 0 var(--red-d); }
.btn-red:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--red-d); }
.btn-red[disabled], .btn-red[aria-busy="true"] { opacity: 0.75; cursor: default; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: oklch(0.25 0.04 170 / 0.08); }
.btn.big { width: 100%; min-height: 52px; font-size: 1.08rem; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 24px;
  background: oklch(0.975 0.008 200 / 0.92); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.3rem; }
.routes { display: flex; gap: 4px; }
.routes a { text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 6px; }
.routes a:hover { background: oklch(0.25 0.04 170 / 0.07); }
.routes a[aria-current="page"] { background: var(--ink); color: var(--snow); }
.bar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.chip {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 8px;
  border: 2px solid var(--ink); background: var(--snow);
}
.chip:hover { background: var(--paper); }
.chip-sym { font-family: var(--display); }
.chip-price { font-family: var(--mono); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.chip-chg { font-family: var(--mono); font-size: 0.8rem; font-weight: 600; }
.up { color: oklch(0.45 0.13 150); } .down { color: var(--red-d); }

/* coin sheet */
.sheet { position: fixed; inset: 0; z-index: 60; background: oklch(0.25 0.04 170 / 0.35); display: flex; justify-content: flex-end; align-items: flex-start; padding: 72px 20px 20px; }
.sheet[hidden] { display: none; }
.sheet-card { width: min(380px, 100%); background: var(--snow); border: 2px solid var(--ink); border-radius: 12px; padding: 18px; box-shadow: 0 8px 0 oklch(0.25 0.04 170 / 0.25); animation: drop 240ms var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sheet-head img { border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); object-fit: cover; }
.sheet-head div { display: flex; flex-direction: column; line-height: 1.2; }
.sheet-head span { color: var(--ink2); font-size: 0.9rem; }
.x { margin-left: auto; width: 36px; height: 36px; border-radius: 8px; border: 2px solid var(--ink); background: transparent; font-size: 1.3rem; line-height: 1; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0; }
.kv div { display: flex; flex-direction: column; }
.kv span { font-size: 0.8rem; color: var(--ink2); }
.kv b { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 56px; display: block; margin: 6px 0 12px; }
.ca { display: flex; align-items: center; gap: 8px; border: 2px dashed var(--ink2); border-radius: 8px; padding: 6px 6px 6px 10px; margin-bottom: 12px; }
.ca code { font-family: var(--mono); font-size: 0.85rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { min-height: 32px; padding: 0 10px; border-radius: 6px; border: 2px solid var(--ink); background: var(--snow); font-weight: 700; font-size: 0.85rem; }
.copy.done { background: var(--meadow); }
.sheet-note { font-size: 0.92rem; color: var(--ink2); margin: 0 0 12px; }

/* ---------- stage ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 64px); border-bottom: 2px solid var(--ink); }
.hill-wrap { position: relative; overflow: hidden; background: linear-gradient(180deg, oklch(0.88 0.05 215) 0%, var(--sky) 45%, oklch(0.95 0.03 170) 100%); min-height: 560px; }
.hill { position: absolute; inset: 0; }
.hill-svg { width: 100%; height: 100%; display: block; }
.hill-over { position: absolute; inset: 0; }
.log-list li.ghost { color: var(--ink2); }
.log-list li.ghost .disc { background: transparent; border-style: dashed; box-shadow: none; }
.log-list li.ghost .w { font-family: var(--text); font-size: 0.88rem; }
.recent-note { margin: -8px 0 18px; color: var(--ink2); font-size: 0.95rem; max-width: 70ch; }
.hud { position: absolute; left: 32px; top: 28px; max-width: 420px; z-index: 2; pointer-events: none; }
.rule { font-size: clamp(2.1rem, 3.6vw, 3.6rem); color: var(--ink); }
.rule-sub { margin: 12px 0 0; font-size: 1.02rem; max-width: 34ch; color: var(--ink); }
.signpost { position: absolute; right: 28px; top: 28px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 2; }
.signpost::before { content: ''; position: absolute; right: 22px; top: 8px; bottom: -40px; width: 7px; background: oklch(0.32 0.05 60); border-radius: 2px; z-index: -1; }
.sign { display: flex; align-items: baseline; gap: 10px; padding: 6px 14px 7px 12px; border: 2px solid var(--ink); border-radius: 4px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-right: 24px; }
.sign-k { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }
.sign-v { font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.sign-red { background: var(--red); color: var(--snow); }
.sign-ink { background: var(--black); color: var(--snow); }
.sign-ink .sign-v { font-size: 2.2rem; min-width: 3.2ch; text-align: right; }
.sign-gold { background: var(--gold); color: var(--ink); }
.clock-hot .sign-ink { background: var(--red-d); }

/* bubbles (svg) */
.bub { cursor: pointer; outline: none; }
.bub-body { transform-box: fill-box; transform-origin: center; transition: transform 180ms var(--ease); }
.bub:hover .bub-body, .bub:focus-visible .bub-body { transform: scale(1.12); }
.bub-ring { fill: var(--snow); stroke: var(--ink); stroke-width: 2.5; }
.bub-disc { stroke: var(--snow); stroke-width: 2; }
.bub[data-tier="blue"] .bub-disc { fill: var(--blue); }
.bub[data-tier="red"] .bub-disc { fill: var(--red); }
.bub[data-tier="black"] .bub-disc { fill: var(--black); }
.bub-txt { font-family: var(--mono); font-weight: 600; fill: var(--snow); pointer-events: none; }
.bub-tag { font-family: var(--text); font-weight: 700; font-size: 17px; fill: var(--ink); paint-order: stroke; stroke: var(--snow); stroke-width: 5px; stroke-linejoin: round; pointer-events: none; }
.bub-crown { fill: var(--gold); stroke: var(--ink); stroke-width: 2; display: none; }
.bub.is-king .bub-ring { fill: var(--gold); stroke-width: 3; }
.bub.is-king .bub-crown { display: block; }
.bub.is-selected .bub-ring { stroke: var(--red); stroke-width: 4; }
.bub:focus-visible .bub-ring { stroke: var(--red); stroke-width: 5; }
.bub.is-leaving { opacity: 0.3; transition: opacity 600ms; pointer-events: none; }
.sv-sign { font-family: var(--display); font-size: 15px; fill: var(--snow); }
.sv-summit { font-family: var(--display); font-size: 16px; fill: var(--ink); }
.summit.flare .pennant { animation: wave 900ms var(--ease); transform-box: fill-box; transform-origin: left center; }
@keyframes wave { 0% { transform: scaleX(0.2); } 100% { transform: scaleX(1); } }

.empty-hill { position: absolute; left: 50%; bottom: 20%; transform: translateX(-50%); background: var(--snow); border: 2px solid var(--ink); border-radius: 8px; padding: 10px 16px; text-align: center; display: flex; flex-direction: column; z-index: 2; box-shadow: 0 4px 0 oklch(0.25 0.04 170 / 0.2); }
.empty-hill[hidden] { display: none; }
.empty-hill span { color: var(--ink2); }

.kingcard { position: relative; margin-top: 22px; pointer-events: auto; z-index: 3; width: min(320px, 100%); background: var(--snow); border: 2px solid var(--ink); border-radius: 10px; padding: 14px 16px; box-shadow: 0 5px 0 oklch(0.25 0.04 170 / 0.22); }
.kingcard:empty { display: none; }
.kc-top { display: flex; align-items: center; gap: 10px; }
.kc-badge { font-family: var(--display); font-size: 0.95rem; padding: 3px 9px; border-radius: 4px; background: var(--gold); border: 2px solid var(--ink); }
.kc-badge.r { background: var(--paper); }
.kc-when { margin-left: auto; font-size: 0.85rem; color: var(--ink2); }
.kc-amt { font-family: var(--display); font-size: 2.3rem; line-height: 1.05; margin: 8px 0 4px; }
.kc-amt small { font-size: 1.1rem; }
.kc-row { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; flex-wrap: wrap; }
.kc-row code { font-family: var(--mono); }
.kc-row a { font-weight: 600; }
.kc-gap { margin-top: 8px; font-size: 0.9rem; color: var(--ink2); }
.tag-sample { font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--meadow); color: var(--ink); }

.stamp { position: absolute; left: 50%; top: 36%; z-index: 5; transform: translate(-50%, -50%) rotate(-8deg) scale(1.6); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; padding: 12px 26px; border: 5px solid var(--red); border-radius: 10px; color: var(--red); background: oklch(0.975 0.008 200 / 0.9); }
.stamp span { font-weight: 700; font-size: 0.9rem; letter-spacing: 0.06em; text-transform: uppercase; }
.stamp b { font-family: var(--display); font-size: 3rem; line-height: 1; font-weight: 400; }
.stamp em { font-style: normal; font-family: var(--mono); font-weight: 600; color: var(--ink); }
.stamp.on { animation: stamp 2600ms var(--ease) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1.6); } 12% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }

/* ---------- side ---------- */
.side { background: var(--snow); border-left: 2px solid var(--ink); display: flex; flex-direction: column; min-width: 0; }
.climb { padding: 22px 22px 20px; border-bottom: 2px solid var(--ink); background: linear-gradient(180deg, var(--snow), var(--paper)); }
.climb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.climb-head h2 { font-size: 1.7rem; }
.climb-note { font-size: 0.85rem; color: var(--ink2); }
.lbl { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.amt { display: flex; align-items: center; border: 2px solid var(--ink); border-radius: 8px; background: var(--snow); overflow: hidden; }
.amt input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 8px; font-family: var(--display); font-size: 1.8rem; text-align: right; outline: none; }
.amt:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.unit { font-weight: 700; padding-right: 10px; }
.step { width: 48px; align-self: stretch; border: 0; background: var(--paper); font-size: 1.4rem; font-weight: 700; }
.step:first-child { border-right: 2px solid var(--ink); }
.step:last-child { border-left: 2px solid var(--ink); }
.step:hover { background: var(--meadow); }
.quick { display: flex; gap: 6px; margin: 10px 0 12px; flex-wrap: wrap; }
.quick button { min-height: 34px; padding: 0 12px; border-radius: 6px; border: 2px solid var(--ink); background: var(--snow); font-weight: 700; font-family: var(--mono); font-size: 0.9rem; }
.quick button:hover { background: var(--paper); }
.quick #beatBtn { background: var(--gold); font-family: var(--text); }
.predict { margin: 0 0 14px; font-size: 1rem; min-height: 3em; }
.predict b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.formerr { margin: 10px 0 0; color: var(--red-d); font-weight: 600; font-size: 0.92rem; }

.log { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.log-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 22px 8px; }
.log-head h2 { font-size: 1.3rem; }
.log-head span { font-size: 0.85rem; color: var(--ink2); }
.log-list { list-style: none; margin: 0; padding: 0 12px 16px; overflow-y: auto; max-height: 420px; }
.log-list li { display: grid; grid-template-columns: 30px 22px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.log-list li + li { border-top: 1px dashed oklch(0.25 0.04 170 / 0.18); }
.log-list li.me { background: oklch(0.83 0.15 85 / 0.25); }
.log-list li.fresh { animation: flash 1200ms var(--ease); }
@keyframes flash { from { background: oklch(0.83 0.15 85 / 0.6); } }
.log-list .rk { font-family: var(--display); font-size: 1.05rem; text-align: right; }
.log-list .w { font-family: var(--mono); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; }
.log-list .w small { display: block; font-family: var(--text); color: var(--ink2); font-size: 0.78rem; }
.log-list .a { font-family: var(--mono); font-weight: 600; text-align: right; }
.log-empty { padding: 18px 12px; color: var(--ink2); }
.disc { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--snow); flex: none; }
.disc.blue { background: var(--blue); } .disc.red { background: var(--red); } .disc.black { background: var(--black); } .disc.gold { background: var(--gold); }
.skel { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--paper), oklch(0.92 0.02 190), var(--paper)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- how ---------- */
.how { background: var(--forest-d); color: var(--snow); border-bottom: 2px solid var(--ink); position: relative; overflow: hidden; }
.how::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, oklch(1 0 0 / 0.025) 0 2px, transparent 2px 14px); pointer-events: none; }
.how-inner { position: relative; max-width: 1240px; margin: 0 auto; padding: 72px 32px; display: grid; grid-template-columns: 1fr 300px; gap: 24px 56px; }
.how h2 { grid-column: 1 / -1; font-size: clamp(2.2rem, 4.4vw, 4rem); color: var(--gold); }
.legend-map { position: relative; min-height: 300px; }
.lm-trail { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 220px; }
.steps { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { display: flex; flex-direction: column; gap: 6px; }
.steps li:nth-child(1) { margin-top: 180px; } .steps li:nth-child(2) { margin-top: 110px; }
.steps li:nth-child(3) { margin-top: 56px; } .steps li:nth-child(4) { margin-top: 0; }
.steps b { font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.05; color: var(--snow); }
.steps span:not(.stepdisc) { color: oklch(0.88 0.03 170); font-size: 0.95rem; max-width: 24ch; }
.stepdisc { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 1.3rem; background: var(--red); color: var(--snow); border: 3px solid var(--snow); box-shadow: 0 0 0 2px var(--ink); }
.stepdisc.g { background: var(--gold); color: var(--ink); }
.tiers { align-self: center; }
.tiers h3 { font-size: 1.4rem; margin-bottom: 12px; }
.tiers ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.tiers li { display: flex; gap: 10px; align-items: center; }
.tiers p { margin: 0; color: oklch(0.88 0.03 170); font-size: 0.95rem; }

/* ---------- money ---------- */
.money { background: linear-gradient(180deg, var(--sky2), var(--sky)); border-bottom: 2px solid var(--ink); }
.money-inner { max-width: 1240px; margin: 0 auto; padding: 72px 32px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px 48px; }
.money-copy { grid-column: 1 / -1; display: flex; gap: 32px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
.money-copy h2 { font-size: clamp(2.2rem, 4.4vw, 4rem); }
.money-copy p { max-width: 44ch; margin: 0; font-size: 1.05rem; }
.lift svg { width: 100%; height: auto; display: block; overflow: visible; }
.lf-t { font-family: var(--display); font-size: 24px; fill: var(--ink); }
.lf-s { font-family: var(--text); font-size: 16px; fill: var(--ink2); font-weight: 600; }
.lf-n { font-family: var(--mono); font-size: 17px; fill: var(--ink); font-weight: 600; }
.pot-panel { background: var(--snow); border: 2px solid var(--ink); border-radius: 12px; padding: 20px; }
.pot-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.pot-figs div { display: flex; flex-direction: column; }
.pot-figs span { font-size: 0.85rem; color: var(--ink2); font-weight: 600; }
.pot-figs b { font-family: var(--display); font-weight: 400; font-size: 1.8rem; line-height: 1.1; }
.pot-figs .wide { grid-column: 1 / -1; padding-bottom: 14px; border-bottom: 2px dashed oklch(0.25 0.04 170 / 0.25); }
.pot-figs .wide b { font-size: 2.8rem; color: var(--red-d); }
.pot-panel h3 { font-size: 1.15rem; margin-bottom: 8px; }
.spends { list-style: none; margin: 0; padding: 0; }
.spends li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed oklch(0.25 0.04 170 / 0.2); font-size: 0.92rem; flex-wrap: wrap; }
.spends li .amt2 { font-family: var(--mono); font-weight: 600; margin-left: auto; }
.spends .empty { color: var(--ink2); }

/* ---------- recent kings ---------- */
.recent { max-width: 1240px; margin: 0 auto; padding: 72px 32px 40px; }
.recent-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.recent-head h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); }
/* recent kings as a signpost cluster: two posts of arrow plates */
.kings-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 48px; position: relative; }
.kings-strip::before, .kings-strip::after { content: ''; position: absolute; top: -10px; bottom: -24px; width: 10px; background: oklch(0.32 0.05 60); border-radius: 2px; z-index: 0; }
.kings-strip::before { left: 26px; } .kings-strip::after { left: calc(50% + 50px); }
.kpost { position: relative; z-index: 1; display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 14px; min-height: 64px; padding: 8px 40px 8px 0; border: 2px solid var(--ink); border-radius: 4px;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 50%, calc(100% - 26px) 100%, 0 100%); background: var(--snow); }
.kpost.paid { background: var(--gold); }
.kpost:first-child { background: var(--red); color: var(--snow); }
.kpost:first-child a, .kpost:first-child .kp-b { color: var(--snow); }
.kpost .kp-r { font-family: var(--display); font-size: 1.3rem; text-align: center; align-self: stretch; display: grid; place-items: center; border-right: 2px solid currentColor; }
.kp-mid { display: flex; flex-direction: column; min-width: 0; }
.kpost .kp-w { font-family: var(--mono); font-size: 0.95rem; font-weight: 600; }
.kpost .kp-b { font-size: 0.86rem; color: var(--ink2); }
.kpost.paid .kp-b { color: var(--ink); }
.kpost .kp-p { font-family: var(--display); font-size: 1.35rem; white-space: nowrap; }
.kpost .kp-p a { text-decoration: none; }
.kpost .kp-p a:hover { text-decoration: underline; }
.sheet-img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper) center / cover no-repeat; flex: none; }
.brand img { flex: none; }
.ca code { min-width: 0; }
.foot-grid > * { min-width: 0; }
.me-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border: 2px solid var(--ink); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; background: oklch(0.83 0.15 85 / 0.3); }
.me-row b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.strip-empty { grid-column: 1 / -1; padding: 24px; border: 2px dashed var(--ink2); border-radius: 10px; color: var(--ink2); }

/* ---------- fine print ---------- */
.fine { max-width: 1240px; margin: 0 auto; padding: 40px 32px 80px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; }
.fine h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.faq details { border-top: 2px solid var(--ink); padding: 4px 0; }
.faq details:last-child { border-bottom: 2px solid var(--ink); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.08rem; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--display); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 0 0 14px; max-width: 62ch; }

/* ---------- kings page ---------- */
.kings-page { max-width: 1100px; margin: 0 auto; padding: 48px 32px 80px; }
.kp-head h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
.kp-head p { margin: 10px 0 20px; max-width: 56ch; font-size: 1.05rem; }
.kp-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.kp-stats .sign { clip-path: none; padding-right: 14px; }
.kp-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { flex: 1; min-width: 220px; }
.search input { width: 100%; min-height: 44px; border: 2px solid var(--ink); border-radius: 8px; padding: 0 14px; background: var(--snow); font-family: var(--mono); }
.search input::placeholder { color: oklch(0.45 0.03 175); }
.tabs { display: flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.tabs button { min-height: 40px; padding: 0 14px; border: 0; background: var(--snow); font-weight: 700; }
.tabs button + button { border-left: 2px solid var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--snow); }
.table-wrap { border: 2px solid var(--ink); border-radius: 10px; overflow: auto; background: var(--snow); max-height: 70vh; }
.kt { width: 100%; border-collapse: collapse; }
.kt th { position: sticky; top: 0; background: var(--paper); text-align: left; font-size: 0.88rem; padding: 10px 14px; border-bottom: 2px solid var(--ink); z-index: 1; }
.kt th button { border: 0; background: none; font-weight: 700; padding: 0; }
.kt th button::after { content: ' ↕'; color: var(--ink2); }
.kt th.num { text-align: right; }
.kt td { padding: 10px 14px; border-bottom: 1px dashed oklch(0.25 0.04 170 / 0.2); vertical-align: middle; }
.kt td.num { text-align: right; font-family: var(--mono); font-weight: 600; }
.kt td code { font-family: var(--mono); font-size: 0.9rem; }
.kt tr.me td { background: oklch(0.83 0.15 85 / 0.22); }
.kt .rd { font-family: var(--display); }
.kt .sub { display: block; color: var(--ink2); font-size: 0.8rem; }
.st { font-size: 0.8rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; border: 2px solid var(--ink); white-space: nowrap; }
.st.paid { background: var(--meadow); } .st.rolled { background: var(--paper); } .st.failed { background: oklch(0.9 0.06 27); }
.kt-empty td { padding: 28px; text-align: center; color: var(--ink2); }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: var(--snow); }
.foot-grid { max-width: 1240px; margin: 0 auto; padding: 40px 32px 48px; display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 24px 40px; }
.foot-brand { display: flex; gap: 12px; align-items: center; }
.foot-brand div { display: flex; flex-direction: column; }
.foot-brand strong { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.foot-brand span { color: oklch(0.85 0.02 170); font-size: 0.92rem; }
.foot nav { display: flex; flex-direction: column; gap: 6px; }
.foot nav a { text-decoration: none; font-weight: 600; }
.foot nav a:hover { text-decoration: underline; }
.foot-ca .ca { border-color: oklch(0.7 0.03 170); }
.foot-ca .copy { background: var(--snow); color: var(--ink); }
.foot-ca p { margin: 0; color: oklch(0.85 0.02 170); }
.foot-sched { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid oklch(1 0 0 / 0.15); color: oklch(0.85 0.02 170); font-size: 0.9rem; }

/* dock + toasts */
.dock { display: none; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 40px)); }
.toast { background: var(--snow); border: 2px solid var(--ink); border-radius: 10px; padding: 12px 14px; box-shadow: 0 4px 0 oklch(0.25 0.04 170 / 0.25); animation: drop 240ms var(--ease); font-size: 0.95rem; }
.toast.err { border-color: var(--red-d); }
.toast a { font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; }
  .side { border-left: 0; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; }
  .climb { border-bottom: 0; border-right: 2px solid var(--ink); }
  .hill-wrap { min-height: 620px; }
}
@media (max-width: 760px) {
  .bar { padding: 0 12px; gap: 8px; height: 58px; }
  .brand span, .hide-s { display: none; }
  .routes a { padding: 8px 10px; font-size: 0.95rem; }
  .chip { padding: 0 8px; gap: 6px; }
  .chip-price { display: none; }
  #connect { padding: 0 10px; }
  .stage { min-height: 0; }
  .hill-wrap { min-height: 0; display: flex; flex-direction: column; }
  .hud { display: contents; }
  .rule { order: 0; font-size: 2rem; padding: 18px 16px 0; }
  .rule-sub { order: 1; font-size: 0.95rem; margin: 8px 0 0; padding: 0 16px; max-width: none; }
  .hill { order: 2; position: relative; inset: auto; height: 440px; margin-top: -10px; }
  .signpost { order: 3; position: static; flex-direction: row; justify-content: space-between; align-items: stretch; gap: 6px; padding: 10px 12px 0; background: var(--meadow); }
  .signpost::before { display: none; }
  .sign { flex: 1; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 16px 7px 10px; }
  .sign-v { font-size: 1.15rem; }
  .sign-ink .sign-v { font-size: 1.5rem; text-align: left; }
  .kingcard { order: 4; margin: 0; width: auto; border-width: 2px 0 0; border-radius: 0; box-shadow: none; padding: 12px 16px 14px; background: var(--meadow); }
  .kc-amt { font-size: 1.8rem; margin: 4px 0 2px; }
  .kc-gap { margin-top: 4px; }
  .empty-hill { bottom: auto; top: 330px; width: max-content; max-width: calc(100% - 32px); }
  .stamp { top: 260px; }
  .kings-strip { grid-template-columns: 1fr; }
  .kings-strip::after { display: none; }
  .kpost { grid-template-columns: 64px 1fr auto; gap: 10px; padding-right: 34px; }
  .kpost .kp-p { font-size: 1.1rem; }
  .side { display: flex; }
  .climb { border-right: 0; border-bottom: 2px solid var(--ink); padding: 18px 16px; }
  .log-head { padding: 14px 16px 6px; }
  .log-list { max-height: none; padding: 0 6px 16px; }
  .how-inner, .money-inner { grid-template-columns: 1fr; padding: 52px 18px; }
  .legend-map { min-height: 0; }
  .lm-trail { display: none; }
  .steps { grid-template-columns: 1fr; gap: 20px; margin-left: 20px; padding-left: 0; background: repeating-linear-gradient(180deg, var(--red) 0 10px, transparent 10px 18px) 0 0 / 4px 100% no-repeat; }
  .steps li { margin-top: 0 !important; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; margin-left: -24px; }
  .steps li .stepdisc { grid-row: span 2; }
  .steps span:not(.stepdisc) { max-width: none; }
  .recent { padding: 52px 18px 28px; }
  .fine { grid-template-columns: 1fr; padding: 28px 18px 110px; gap: 16px; }
  .kings-page { padding: 32px 14px 110px; }
  .kt th, .kt td { padding: 9px 8px; }
  .kt .hide-s { display: none; }
  .foot-grid { grid-template-columns: 1fr; padding: 32px 18px 110px; }
  .dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; align-items: center; gap: 12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--snow); border-top: 2px solid var(--ink); }
  .dock-clock { font-family: var(--display); font-size: 1.5rem; background: var(--black); color: var(--snow); padding: 2px 10px; border-radius: 4px; }
  .dock-pot { font-family: var(--mono); font-weight: 600; font-size: 0.9rem; }
  .dock .btn { margin-left: auto; min-height: 44px; }
  .toasts { bottom: 80px; right: 12px; }
  .sheet { padding: 64px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  html { scroll-behavior: auto; }
}
