/* Heistpad: a financial district at night. One screen: the 3D district fills the viewport, the HUD sits on its
   edges. Night green-black, bone text, vault amber for keeps and the one primary action, raid red only for raids.
   Tektur for the wordmark and names, Geist for text, Azeret Mono for every number. One border system: 1px
   concrete rules, square corners, bone corner ticks on panels, a 45deg cut on buttons. */
:root {
  --night: #0a110f; --tower: #18201d; --concrete: #2c3431; --concrete-2: #3a4541;
  --bone: #e8e3d6; --bone-2: rgba(232, 227, 214, .72); --bone-3: rgba(232, 227, 214, .5); --bone-4: rgba(232, 227, 214, .26); --bone-5: rgba(232, 227, 214, .08);
  --vault: #e2a23a; --vault-2: #c98c2e; --vault-3: rgba(226, 162, 58, .16);
  --raid: #c7432f; --raid-2: rgba(199, 67, 47, .18);
  --panel: rgba(10, 17, 15, .9); --panel-2: rgba(24, 32, 29, .92);
  --display: "Tektur", "Geist", system-ui, sans-serif; --ui: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1); --t-fast: .16s; --t: .32s; --t-slow: .6s;
  --gut: 16px; --cut: 10px;
  /* type scale 1.25 */
  --fs-1: 10.5px; --fs-2: 12px; --fs-3: 14px; --fs-4: 17.5px; --fs-5: 22px; --fs-6: 27px; --fs-7: 34px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--night); color: var(--bone); }
body { font: 400 var(--fs-3)/1.45 var(--ui); font-feature-settings: "tnum" 1; overflow: hidden; height: 100vh; height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; }
.mono, .v, kbd, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.skip { position: fixed; left: 8px; top: 8px; z-index: 99; background: var(--vault); color: var(--night); padding: 8px 12px; transform: translateY(-200%); }
.skip:focus { transform: none; }
:focus-visible { outline: 1px solid var(--bone); outline-offset: 3px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ the stage */
.stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; background: var(--night);
  background-image: radial-gradient(120% 90% at 60% 30%, #13201b 0%, var(--night) 60%); }
.stage:active { cursor: grabbing; }
/* quiet layer over the canvas: grain + a falloff that keeps the HUD corners readable */
.shade { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(90deg, rgba(10,17,15,.55) 0, rgba(10,17,15,0) 26%, rgba(10,17,15,0) 72%, rgba(10,17,15,.5) 100%),
    linear-gradient(180deg, rgba(10,17,15,.35) 0, rgba(10,17,15,0) 18%, rgba(10,17,15,0) 76%, rgba(10,17,15,.55) 100%); }
body:not(.gl) .stage { background-image: radial-gradient(90% 70% at 55% 38%, #16241f 0%, var(--night) 70%); }

/* ------------------------------------------------------------------ loader */
.loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--night); transition: opacity .7s var(--ease), visibility .7s; }
.loader img { opacity: .9; }
.loader-step { margin: 0; font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-3); min-height: 1em; }
.loader-bar { width: 160px; height: 1px; background: var(--concrete); position: relative; overflow: hidden; }
.loader-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--vault); transition: width .4s var(--ease); }
body.ready .loader { opacity: 0; visibility: hidden; pointer-events: none; }

/* ------------------------------------------------------------------ HUD panels: one border system */
.hud { position: fixed; z-index: 5; background: var(--panel); border: 1px solid var(--concrete); }
.hud::before, .hud::after { content: ""; position: absolute; width: 7px; height: 7px; pointer-events: none; border-color: var(--bone-3); border-style: solid; }
.hud::before { left: -1px; top: -1px; border-width: 1px 0 0 1px; }
.hud::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
.hud-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--concrete); }
.hud-head h2, .dlg-head h2 { margin: 0; white-space: nowrap; display: flex; align-items: center; gap: 10px; font: 600 var(--fs-1)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-2); }
.idx { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 4px; border: 1px solid var(--concrete-2); color: var(--bone-3); font: 500 9.5px/1 var(--mono); letter-spacing: .08em; }

body.booting .hud, body.booting .labels, body.booting .hints { opacity: 0; transform: translateY(6px); }
.hud, .labels, .hints { transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
body.ready .brand { transition-delay: .05s; } body.ready .stats { transition-delay: .15s; } body.ready .log { transition-delay: .25s; }
body.ready .vault { transition-delay: .3s; } body.ready .raidbar { transition-delay: .4s; } body.ready .dock, body.ready .ca, body.ready .topnav { transition-delay: .5s; }

/* ------------------------------------------------------------------ buttons: HUD slab, cut corner top-right */
.slab { --bg: var(--tower); --edge: var(--concrete-2); --fg: var(--bone); position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 18px; border: 0; background: var(--edge); color: var(--fg); text-decoration: none; white-space: nowrap;
  font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), filter var(--t-fast); }
.slab::before { content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--bg); transition: background var(--t-fast) var(--ease);
  clip-path: polygon(0 0, calc(100% - var(--cut) + .5px) 0, 100% calc(var(--cut) - .5px), 100% 100%, 0 100%); }
.slab:hover { --bg: #212b27; --edge: var(--bone-3); }
.slab:active { transform: translateY(1px); }
.slab:focus-visible { outline: none; --edge: var(--bone); }
.slab.primary { --bg: var(--vault); --edge: var(--vault); --fg: #120c02; }
.slab.primary:hover { --bg: var(--vault-2); --edge: var(--vault-2); }
.slab.ghost { --bg: var(--panel); }
.slab.danger { --bg: #1d1714; --edge: #5a2a22; padding-left: 26px; }
.slab.danger::after { content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: 8px; background: repeating-linear-gradient(-45deg, var(--raid) 0 4px, #1d1714 4px 8px); }
.slab.danger:hover { --bg: #261c18; --edge: var(--raid); }
.slab.sm { min-height: 32px; padding: 0 12px; font-size: 10.5px; --cut: 7px; }
.slab.danger.sm { padding-left: 20px; }
.slab.danger.sm::after { width: 6px; }
.slab[disabled], .slab[aria-disabled="true"] { cursor: not-allowed; filter: saturate(.3); opacity: .5; transform: none; }
.slab[data-state="busy"] { cursor: progress; }
.slab[data-state="busy"] > span { opacity: .55; }
.slab[data-state="busy"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; top: auto; width: auto; height: 2px; background: linear-gradient(90deg, transparent, var(--bone) 50%, transparent) 0 0 / 40% 100% no-repeat; animation: scan 1s linear infinite; }
.slab.primary[data-state="busy"]::after { background-image: linear-gradient(90deg, transparent, #120c02 50%, transparent); }
.slab[data-state="ok"] { --edge: var(--bone); }
.slab[data-state="err"] { --edge: var(--raid); animation: nudge .3s var(--ease); }
@keyframes scan { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes nudge { 30% { transform: translateX(-3px); } 60% { transform: translateX(2px); } }

/* ------------------------------------------------------------------ brand block (top left) */
.brand { top: var(--gut); left: var(--gut); width: 348px; padding: 16px 16px 16px; display: grid; gap: 10px; }
.brand-id { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; width: max-content; }
.wordmark { font: 800 26px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--bone); }
.brand-line { margin: 2px 0 0; font-size: var(--fs-4); line-height: 1.3; color: var(--bone); letter-spacing: -.01em; max-width: 30ch; }
.brand-status { margin: 0; display: flex; align-items: center; gap: 8px; font: 500 var(--fs-1)/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--bone-3); }
.st-dot { width: 7px; height: 7px; background: var(--concrete-2); flex: none; }
.brand-status.hot .st-dot { background: var(--raid); }
.brand-status.hot { color: var(--bone-2); }
.brand-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ------------------------------------------------------------------ top nav (top right) */
.topnav { top: var(--gut); right: var(--gut); display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 10px; }
.topnav a, .nav-mine { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 0; background: none; text-decoration: none;
  font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-2); transition: color var(--t-fast); }
.topnav a:hover, .nav-mine:hover { color: var(--bone); }
.topnav a b, .nav-mine b { font-weight: 500; color: var(--vault); }
.nav-mine b:empty { display: none; }
.topnav .wallet { margin-left: 6px; min-height: 36px; }

/* ------------------------------------------------------------------ stat strip (top centre) */
.stats { top: var(--gut); left: calc(348px + var(--gut) * 2); right: calc(var(--gut) * 2 + var(--nav-w, 360px)); max-width: 640px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 0; }
.stat { position: relative; display: grid; gap: 3px; padding: 10px 14px 11px; min-width: 0; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--concrete); }
.stat .k { font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); white-space: nowrap; }
.stat .v { font: 500 var(--fs-5)/1.1 var(--mono); letter-spacing: -.02em; color: var(--bone); white-space: nowrap; }
.stat .v.bump { animation: bump .5s var(--ease); }
.stat .s { font: 400 11px/1.25 var(--ui); color: var(--bone-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.amber .v { color: var(--vault); }
@keyframes bump { 0% { transform: translateY(0); } 30% { transform: translateY(-3px); color: var(--vault); } 100% { transform: translateY(0); } }

/* ------------------------------------------------------------------ raid log (left) */
.log .hud-head { flex-wrap: wrap; }
.log .seg { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
.log { left: var(--gut); top: 272px; bottom: 76px; width: 348px; display: flex; flex-direction: column; }
.seg { display: inline-flex; gap: 1px; background: var(--concrete); border: 1px solid var(--concrete); }
.seg button { min-height: 26px; padding: 0 7px; border: 0; background: var(--night); font: 500 9.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bone-3); transition: color var(--t-fast), background var(--t-fast); }
.seg button:hover { color: var(--bone); }
.seg button[aria-checked="true"] { background: var(--bone); color: var(--night); }
.log-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--concrete) transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 86%, transparent); mask-image: linear-gradient(180deg, #000 86%, transparent); }
.lg { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; padding: 8px 14px; border-left: 2px solid transparent; cursor: pointer; transition: background var(--t-fast); }
.lg:hover { background: var(--bone-5); }
.lg.new { animation: roll .6s var(--ease); transform-origin: 50% 0; }
@keyframes roll { from { opacity: 0; transform: perspective(900px) rotateX(40deg) translateY(-6px); } to { opacity: 1; transform: none; } }
.lg.k-raid { border-left-color: var(--raid); }
.lg.k-def { border-left-color: var(--bone-3); }
.lg.k-buy, .lg.k-loot { border-left-color: var(--vault); }
.lg-pic { width: 30px; height: 30px; border: 1px solid var(--concrete); background: var(--tower); object-fit: cover; }
.lg-pic.pair { position: relative; }
.lg-t { min-width: 0; }
.lg-t p { margin: 0; font-size: 13px; line-height: 1.3; color: var(--bone-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-t p b { color: var(--bone); font-weight: 600; }
.lg-t small { display: block; margin-top: 2px; font: 400 10.5px/1.2 var(--mono); color: var(--bone-3); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-v { text-align: right; font: 500 12px/1.2 var(--mono); color: var(--bone-2); white-space: nowrap; }
.lg-v small { display: block; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--bone-3); }
.lg.k-raid .lg-v { color: #e0735f; }
.lg.k-buy .lg-v, .lg.k-loot .lg-v { color: var(--vault); }
.invite { display: grid; gap: 12px; justify-items: start; padding: 22px 16px; }
.invite p { margin: 0; color: var(--bone-2); max-width: 32ch; }
.invite svg.ill { width: 64px; height: 64px; stroke: var(--concrete-2); stroke-width: 1; }

/* ------------------------------------------------------------------ selected vault (right) */
.vault { right: var(--gut); top: 76px; width: 360px; max-height: calc(100vh - 76px - 88px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--concrete) transparent; }
.vt-top { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border-bottom: 1px solid var(--concrete); }
.vt-pic { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--concrete-2); background: var(--tower); }
.vt-name { margin: 0; font: 700 var(--fs-4)/1.15 var(--display); letter-spacing: .02em; text-transform: uppercase; overflow-wrap: anywhere; }
.vt-sym { margin: 3px 0 0; display: flex; gap: 8px; align-items: center; font: 500 11px/1 var(--mono); color: var(--bone-3); }
.vt-sym button { border: 0; background: none; padding: 2px 0; color: var(--bone-3); font: inherit; text-decoration: underline; text-decoration-color: var(--concrete-2); text-underline-offset: 3px; }
.vt-sym button:hover { color: var(--bone); }
.vt-x { align-self: start; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--concrete); background: none; color: var(--bone-3); }
.vt-x:hover { color: var(--bone); border-color: var(--bone-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px; border: 1px solid var(--concrete-2); font: 500 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-2); white-space: nowrap; }
.chip.raid { border-color: var(--raid); color: #ec8a78; background: var(--raid-2); }
.chip.amber { border-color: rgba(226,162,58,.5); color: var(--vault); background: var(--vault-3); }
.vt-keep { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 14px; padding: 16px 14px 12px; }
.vt-keep .k { grid-column: 1 / -1; font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); }
.vt-keep .big { font: 500 var(--fs-7)/1 var(--mono); letter-spacing: -.03em; color: var(--vault); }
.vt-keep .big small { font-size: 13px; color: var(--bone-3); letter-spacing: .08em; margin-left: 6px; }
.floors { display: grid; grid-template-columns: repeat(12, 6px); gap: 2px; align-self: center; }
.floors i { height: 6px; background: var(--concrete); }
.floors i.on { background: var(--vault); }
.kv { margin: 0; display: grid; grid-template-columns: 1fr auto; }
.kv dt, .kv dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--bone-5); font-size: 12.5px; }
.kv dt { color: var(--bone-3); }
.kv dd { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--bone-2); }
.kv dd.pos { color: var(--vault); }
.kv dd.neg { color: #e0735f; }
.kv .sum { color: var(--bone); border-top-color: var(--concrete-2); }
.vt-sec { padding: 4px 14px 12px; }
.vt-sec h3 { margin: 10px 0 4px; font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); display: flex; justify-content: space-between; }
.vt-rec { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--concrete); }
.vt-rec div { padding: 8px 10px; display: grid; gap: 2px; }
.vt-rec div + div { border-left: 1px solid var(--concrete); }
.vt-rec b { font: 500 var(--fs-4)/1 var(--mono); }
.vt-rec span { font: 500 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-3); }
.vt-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--concrete); }
.vt-acts .wide { grid-column: 1 / -1; }
.vt-note { margin: 0; padding: 0 14px 14px; font-size: 12px; color: var(--bone-3); }
.vt-hold { margin: 0 14px 12px; padding: 10px 12px; border: 1px solid var(--concrete); display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--bone-2); }
.vt-hold b { font-family: var(--mono); font-weight: 500; color: var(--bone); }
.feed-state { display: flex; align-items: center; gap: 8px; font: 500 10.5px/1 var(--mono); color: var(--bone-3); }
.feed-state i { display: inline-grid; grid-template-columns: repeat(7, 5px); gap: 2px; }
.feed-state i b { height: 5px; background: var(--concrete); }
.feed-state i b.on { background: var(--bone-2); }

/* ------------------------------------------------------------------ raid bar (bottom centre) */
.raidbar { left: 50%; bottom: 72px; transform: translateX(-50%); width: min(640px, calc(100vw - 348px - 360px - var(--gut) * 6)); min-width: 460px; padding: 14px 16px 14px; }
body.booting .raidbar { transform: translate(-50%, 6px); }
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.rb-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 600 var(--fs-1)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-2); }
.rb-phase { font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); display: flex; gap: 10px; align-items: center; }
.rb-phase b { font-weight: 500; font-size: 13px; letter-spacing: .02em; color: var(--bone); }
.rb-phase.hot b { color: #ec8a78; }
.rb-demo { font: 500 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--night); background: var(--bone-2); padding: 4px 6px; }
.rb-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.rb-side { display: grid; gap: 4px; min-width: 0; }
.rb-side.def { text-align: right; justify-items: end; }
.rb-coin { display: flex; align-items: center; gap: 8px; font: 700 var(--fs-3)/1 var(--display); letter-spacing: .04em; text-transform: uppercase; min-width: 0; }
.rb-side.def .rb-coin { flex-direction: row-reverse; }
.rb-coin img { width: 24px; height: 24px; border: 1px solid var(--concrete-2); object-fit: cover; flex: none; }
.rb-coin span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-lab { font: 500 9.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-3); }
.rb-side.atk .rb-lab { color: #e0735f; }
.rb-pow { font: 500 var(--fs-5)/1 var(--mono); letter-spacing: -.02em; }
.rb-pow small { font-size: 11px; color: var(--bone-3); letter-spacing: .06em; margin-left: 4px; }
.rb-sub { font: 400 10.5px/1.2 var(--mono); color: var(--bone-3); white-space: nowrap; }
.rb-vs { font: 600 10px/1 var(--mono); letter-spacing: .16em; color: var(--bone-4); padding-bottom: 6px; }
.tug { position: relative; height: 10px; margin: 14px 0 20px; background: var(--tower); border: 1px solid var(--concrete); }
.tug i { position: absolute; top: 0; bottom: 0; transition: width .8s var(--ease), left .8s var(--ease); }
.tug .a { left: 0; background: var(--raid); }
.tug .d { right: 0; background: repeating-linear-gradient(90deg, var(--bone-2) 0 2px, transparent 2px 4px); }
.tug .need { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--bone); transition: left .8s var(--ease); }
.tug .need::after { content: attr(data-l); position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font: 500 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--bone-3); white-space: nowrap; }
.rb-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.rb-foot .rb-note { margin: 0; font-size: 12px; color: var(--bone-3); max-width: 44ch; }
.rb-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.rb-nav { display: inline-flex; align-items: center; gap: 4px; font: 500 10px/1 var(--mono); color: var(--bone-3); }
.rb-nav button { width: 26px; height: 26px; border: 1px solid var(--concrete); background: none; color: var(--bone-2); display: grid; place-items: center; }
.rb-nav button:hover { border-color: var(--bone-3); color: var(--bone); }
.rb-nav svg { width: 14px; height: 14px; }
.rb-quiet { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.rb-quiet p { margin: 0; color: var(--bone-2); }
.rb-quiet p b { display: block; font: 700 var(--fs-4)/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--bone); margin-bottom: 4px; }
.rb-result { font: 700 var(--fs-5)/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.rb-result.won { color: var(--vault); } .rb-result.lost { color: var(--bone); } .rb-result.fz { color: var(--bone-3); }

/* ------------------------------------------------------------------ dock + hints + CA (bottom) */
.dock { left: 50%; bottom: var(--gut); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; }
body.booting .dock { transform: translate(-50%, 6px); }
.dock-cams { display: flex; gap: 2px; }
.dock button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; min-width: 36px; padding: 0 12px; border: 1px solid transparent; background: none; color: var(--bone-3);
  font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; justify-content: center; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.dock button:hover { color: var(--bone); border-color: var(--concrete); }
.dock button[aria-checked="true"] { background: var(--bone); color: var(--night); }
.dock .dock-btn { padding: 0; width: 36px; }
.dock-sep { width: 1px; height: 22px; background: var(--concrete); margin: 0 6px; }
[data-sound][aria-pressed="false"] [data-snd-on], [data-sound][aria-pressed="true"] [data-snd-off] { display: none; }
[data-sound][aria-pressed="true"] { color: var(--vault); }
.hints { position: fixed; z-index: 4; left: var(--gut); bottom: 22px; margin: 0; font-size: 11px; color: var(--bone-3); display: flex; gap: 6px; align-items: center; }
kbd { font-size: 10px; padding: 2px 6px; border: 1px solid var(--concrete-2); color: var(--bone-2); }
kbd + kbd, .hints kbd:not(:first-child) { margin-left: 8px; }
.ca { right: var(--gut); bottom: var(--gut); display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; }
.ca-k { font: 500 9.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-3); }
.ca-v { min-height: 30px; padding: 0 10px; border: 1px solid var(--concrete); background: var(--night); font-size: 11px; color: var(--bone-2); }
.ca-v:not([disabled]):hover { border-color: var(--bone-3); color: var(--bone); }
.ca-v[disabled] { cursor: default; color: var(--bone-3); }
.ca-x { width: 30px; height: 30px; display: grid; place-items: center; color: var(--bone-2); border: 1px solid var(--concrete); }
.ca-x:hover { color: var(--bone); border-color: var(--bone-3); }
.ca-x svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ tower labels projected from 3D */
.labels { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; align-items: center; gap: 7px; padding: 4px 8px 4px 4px; border: 1px solid var(--concrete-2); background: rgba(10,17,15,.86);
  font: 500 10.5px/1 var(--mono); color: var(--bone-2); white-space: nowrap; cursor: pointer; transform: translate(-50%, -100%); transition: border-color var(--t-fast), color var(--t-fast), opacity var(--t); will-change: transform; }
.tag img { width: 18px; height: 18px; object-fit: cover; }
.tag b { font-weight: 600; color: var(--bone); letter-spacing: .04em; }
.tag em { font-style: normal; color: var(--vault); }
.tag::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 12px; background: var(--concrete-2); }
.tag:hover, .tag.sel { border-color: var(--bone-2); color: var(--bone); }
.tag.sel::after { background: var(--bone-2); }
.tag.hot { border-color: var(--raid); }
.tag.hot::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--raid); }
.tag.demo { border-style: dashed; }
.tag.off { opacity: 0; pointer-events: none; visibility: hidden; }
.tag-demo { position: fixed; z-index: 4; font: 500 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--night); background: var(--bone-2); padding: 5px 7px; }

/* ------------------------------------------------------------------ dialogs */
.dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--concrete-2); background: var(--panel-2); color: var(--bone); overflow: visible; }
.dlg.wide { width: min(720px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(5, 9, 8, .72); }
.dlg[open] { animation: dlgIn .32s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dlg-body { display: grid; gap: 0; max-height: calc(100vh - 34px); overflow-y: auto; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--concrete); position: sticky; top: 0; background: var(--panel-2); z-index: 2; }
.dlg-head h2 { color: var(--bone); }
.dlg-x { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--concrete); background: none; color: var(--bone-2); }
.dlg-x:hover { color: var(--bone); border-color: var(--bone-3); }
.dlg-note { margin: 0; padding: 12px 16px; font-size: 12.5px; color: var(--bone-3); border-top: 1px solid var(--concrete); }
.dlg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--concrete); position: sticky; bottom: 0; background: var(--panel-2); }
.dlg-err { font-size: 12.5px; color: #ec8a78; min-height: 1em; flex: 1; }
.dlg-sec { padding: 14px 16px; display: grid; gap: 12px; }
.dlg-sec + .dlg-sec { border-top: 1px solid var(--concrete); }
.fld { display: grid; gap: 6px; }
.fld > span, .picks legend, .lab { font: 500 var(--fs-1)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); }
.fld > span i { font-style: normal; letter-spacing: .04em; text-transform: none; }
.fld input:not([type=file]), .fld select { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--concrete-2); background: var(--night); color: var(--bone); font-size: 15px; border-radius: 0; }
.fld input:focus, .fld select:focus { outline: none; border-color: var(--bone-2); }
.fld input[aria-invalid="true"] { border-color: var(--raid); }
.fld.file { position: relative; }
.fld.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fld.file em { display: flex; align-items: center; min-height: 42px; padding: 0 12px; border: 1px dashed var(--concrete-2); font-style: normal; font-size: 12.5px; color: var(--bone-3); }
.fld.file:hover em, .fld.file:focus-within em { border-color: var(--bone-3); color: var(--bone-2); }
.picks { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.pick-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 1px; background: var(--concrete); border: 1px solid var(--concrete); }
.pick-row button { min-height: 40px; border: 0; background: var(--night); font: 500 12px/1 var(--mono); color: var(--bone-2); transition: background var(--t-fast), color var(--t-fast); }
.pick-row button:hover { color: var(--bone); background: var(--tower); }
.pick-row button[aria-checked="true"] { background: var(--bone); color: var(--night); }
.pick-row button[disabled] { color: var(--bone-4); cursor: not-allowed; }
.launch-grid { display: grid; grid-template-columns: 1fr 200px; gap: 18px; padding: 16px; }
.launch-fields { display: grid; gap: 12px; }
.launch-preview { border: 1px solid var(--concrete); padding: 14px; display: grid; gap: 4px; align-content: start; background: var(--night); }
.lp-tower { position: relative; width: 120px; height: 120px; border: 1px solid var(--concrete-2); background: var(--tower); margin-bottom: 8px; }
.lp-tower img { width: 100%; height: 100%; object-fit: cover; }
.lp-tower img:not([src]) { visibility: hidden; }
.lp-floors { position: absolute; right: -9px; bottom: -1px; width: 5px; height: 100%; background: repeating-linear-gradient(0deg, var(--vault) 0 3px, transparent 3px 6px); opacity: .6; }
.lp-name { margin: 0; font: 700 var(--fs-4)/1.15 var(--display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.lp-sym { margin: 0 0 8px; font-size: 11px; color: var(--bone-3); }
.launch-preview .kv dt, .launch-preview .kv dd { font-size: 11.5px; padding: 5px 0; }
.side-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--concrete); background: var(--night); text-align: left; transition: border-color var(--t-fast); }
.opt img { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--concrete-2); }
.opt b { display: block; font: 700 13px/1.2 var(--display); text-transform: uppercase; }
.opt small { font: 400 11px/1.2 var(--mono); color: var(--bone-3); }
.opt[aria-checked="true"] { border-color: var(--bone-2); background: var(--tower); }
.opt[disabled] { opacity: .45; cursor: not-allowed; }
.opt-list { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--concrete); }
.timeline div { padding: 10px; display: grid; gap: 4px; }
.timeline div + div { border-left: 1px solid var(--concrete); }
.timeline b { font: 500 var(--fs-4)/1 var(--mono); }
.timeline span { font: 500 9.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-3); }
.est { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px; padding: 12px; border: 1px solid var(--concrete); background: var(--night); }
.est .big { font: 500 var(--fs-6)/1 var(--mono); letter-spacing: -.02em; }
.est .lab { grid-column: 1 / -1; }
.warn { margin: 0; padding: 10px 12px 10px 18px; position: relative; font-size: 12.5px; color: var(--bone-2); background: #16110f; border: 1px solid #3b231d; }
.warn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(-45deg, var(--raid) 0 4px, #16110f 4px 8px); }
.ok-line { margin: 0; font-size: 12.5px; color: var(--bone-3); }

/* mine */
.mine-sum { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--concrete); }
.mine-sum div { padding: 14px 16px; display: grid; gap: 4px; }
.mine-sum div + div { border-left: 1px solid var(--concrete); }
.mine-sum b { font: 500 var(--fs-5)/1 var(--mono); }
.mine-sum span { font: 500 9.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-3); }
.mine-rows { list-style: none; margin: 0; padding: 0; }
.mr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--bone-5); }
.mr img { width: 34px; height: 34px; object-fit: cover; border: 1px solid var(--concrete-2); }
.mr p { margin: 0; font-size: 13px; color: var(--bone-2); }
.mr p b { color: var(--bone); }
.mr small { display: block; font: 400 10.5px/1.3 var(--mono); color: var(--bone-3); }
.mr .amt { font: 500 12.5px/1.2 var(--mono); text-align: right; white-space: nowrap; }
.mine-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }

/* toasts */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: 116px; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 14px 12px 16px; background: var(--panel-2); border: 1px solid var(--concrete-2); border-left: 3px solid var(--bone-3); font-size: 13px; color: var(--bone); animation: dlgIn .3s var(--ease); }
.toast.ok { border-left-color: var(--vault); }
.toast.err { border-left-color: var(--raid); }

/* wallet picker (kit) */
.wpick h2 { margin: 0; padding: 16px 16px 8px; font: 700 var(--fs-4)/1.2 var(--display); text-transform: uppercase; }
.wpick .dlg-x { position: absolute; right: 12px; top: 12px; }
.wpick { padding-bottom: 12px; }
.wp-list { display: grid; gap: 6px; padding: 8px 16px; }
.wp-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border: 1px solid var(--concrete); background: var(--night); text-align: left; }
.wp-item:hover { border-color: var(--bone-3); }
.wp-item img { width: 28px; height: 28px; }
.wp-dot { width: 28px; height: 28px; background: var(--vault); }
.wp-get { display: flex; gap: 14px; padding: 8px 16px; font-size: 12.5px; color: var(--bone-3); }
.wp-cur, .wp-none, .wp-err { margin: 0; padding: 4px 16px; font-size: 13px; color: var(--bone-2); }
.wp-err { color: #ec8a78; }
.wp-off { margin: 8px 16px 0; }

/* ------------------------------------------------------------------ narrower desktops */
@media (max-width: 1360px) {
  .brand, .log { width: 316px; }
  .stats { left: calc(316px + var(--gut) * 2); }
  .stat:nth-child(4) { display: none; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vault { width: 330px; }
  .raidbar { width: min(560px, calc(100vw - 316px - 330px - var(--gut) * 5)); min-width: 420px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .raidbar { left: calc(316px + var(--gut) * 2); transform: none; width: auto; right: calc(330px + var(--gut) * 2); min-width: 0; }
  body.booting .raidbar { transform: translateY(6px); }
  .stats { display: none; }
  .hints { display: none; }
}

/* ------------------------------------------------------------------ phone: panels stack over the fixed district */
@media (max-width: 900px) {
  body { overflow: auto; overflow-x: hidden; height: auto; }
  .stage { touch-action: pan-y; }
  .hud { position: relative; inset: auto; left: auto; right: auto; top: auto; bottom: auto; transform: none; width: auto; margin: 0 12px 10px; }
  body.booting .hud { transform: translateY(6px); }
  .page { position: relative; z-index: 5; padding-top: 12px; padding-bottom: 24px; display: flex; flex-direction: column; }
  .topnav { order: -1; }
  .brand { width: auto; }
  .topnav { justify-content: space-between; }
  .dock { display: none; }
  .stats { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { display: none; }
  .stat { padding: 10px 10px; }
  .stat .v { font-size: var(--fs-4); }
  .stat .s { display: none; }
  .scene-gap { height: 46vh; min-height: 300px; position: relative; z-index: 2; pointer-events: none; }
  .scene-tools { position: absolute; right: 12px; top: 10px; display: flex; gap: 6px; pointer-events: auto; }
  .scene-tools button { width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--concrete); color: var(--bone-2); }
  .raidbar { min-width: 0; width: auto; padding: 14px 12px; }
  .rb-sides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .rb-lab { font-size: 8.5px; letter-spacing: .12em; white-space: normal; line-height: 1.3; }
  .rb-sub { white-space: normal; font-size: 10px; }
  .rb-coin { font-size: 12px; }
  .rb-coin img { width: 20px; height: 20px; }
  .rb-vs { display: none; }
  .rb-pow { font-size: var(--fs-4); }
  .rb-foot { flex-direction: column; align-items: stretch; }
  .rb-acts .slab { flex: 1; }
  .rb-quiet { grid-template-columns: 1fr; }
  .log { width: auto; max-height: 520px; }
  .vault { width: auto; max-height: none; overflow: visible; }
  .hints { display: none; }
  .ca { justify-content: space-between; }
  .launch-grid { grid-template-columns: 1fr; }
  .launch-preview { grid-template-columns: 96px 1fr; column-gap: 14px; }
  .lp-tower { width: 96px; height: 96px; grid-row: span 3; }
  .launch-preview .kv { grid-column: 1 / -1; }
  .toasts { top: 12px; }
  .mine-sum { grid-template-columns: 1fr; }
  .mine-sum div + div { border-left: 0; border-top: 1px solid var(--concrete); }
  .mr { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .mr .slab { grid-column: 2 / -1; justify-self: start; }
  .side-pick { grid-template-columns: 1fr; }
  .wordmark { font-size: 24px; }
  .tag { font-size: 10px; }
}
@media (min-width: 901px) { .scene-gap { display: none; } .page { display: contents; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* rolling digits (adapted from 21st.dev "Animate Digits"): each digit is a 0-9 column behind a 1em window */
.dg { display: inline-block; height: 1.1em; overflow: hidden; vertical-align: top; }
.dg-c { display: flex; flex-direction: column; transition: transform .7s var(--ease); }
.dg-c i { font-style: normal; height: 1.1em; line-height: 1.1em; display: block; }
[data-roll], .stat .v { display: inline-flex; }
@media (prefers-reduced-motion: reduce) { .dg-c { transition: none; } }

/* loading skeletons (adapted from 21st.dev "Skeleton Loader"): a slow highlight, in the panel's own greys */
.skb { display: inline-block; height: 11px; background: linear-gradient(90deg, var(--tower) 0%, #22302b 40%, var(--tower) 80%) 0 0 / 250% 100%; animation: skel 1.6s linear infinite; }
.lg.sk { cursor: default; } .lg.sk .lg-pic { display: block; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -150% 0; } }
/* empty log (adapted from 21st.dev "Empty State with Marquee"): ghost rows drift up behind the invitation */
.invite.ghosted { position: relative; overflow: hidden; min-height: 380px; align-content: center; }
.ghost-rows { position: absolute; inset: 0; display: grid; align-content: start; gap: 18px; padding: 16px; opacity: .28; pointer-events: none; animation: drift 40s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 60%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 60%, transparent); }
.gr { display: grid; grid-template-columns: 30px 1fr 40px; gap: 10px; align-items: center; }
.gr i { height: 30px; border: 1px solid var(--concrete); }
.gr b { height: 8px; background: var(--tower); }
.gr em { height: 8px; background: var(--tower); }
.invite.ghosted > :not(.ghost-rows) { position: relative; z-index: 1; }
.invite.ghosted { background: linear-gradient(180deg, rgba(10,17,15,0) 0%, rgba(10,17,15,.0) 40%); }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.toast-link { display: inline-block; margin-top: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--vault); text-decoration: none; }
.toast-link:hover { text-decoration: underline; }
.toast { display: grid; }

/* log filter with a sliding thumb (adapted from 21st.dev "Segmented Tabs") */
.log .seg { position: relative; }
.log .seg::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--i, 0) * 20%); width: 20%; background: var(--bone); transition: left .32s var(--ease); z-index: 0; }
.log .seg button { position: relative; z-index: 1; background: transparent; }
.log .seg { background: var(--night); }
.log .seg button + button { box-shadow: -1px 0 0 var(--concrete); }
.log .seg button[aria-checked="true"] { background: transparent; color: var(--night); }

.brand-h { margin: 0; font: inherit; }
.ca { cursor: pointer; }
@media (max-width: 900px) { .tag { min-height: 32px; } .rb-nav button { width: 34px; height: 34px; } .rb-coin { min-height: 32px; } }

@media (max-height: 820px) and (min-width: 901px) { .hints { display: none; } .ca { right: auto; left: var(--gut); } }

.dlg .kv { grid-template-columns: 110px minmax(0, 1fr); column-gap: 16px; }
.dlg .kv dd { text-align: right; }
@media (max-width: 900px) {
  .seg button { min-height: 34px; }
  .rb-head { flex-wrap: wrap; row-gap: 8px; }
  .dlg-x, .vt-x { width: 36px; height: 36px; }
  .topnav .wallet { padding: 0 12px; }
}

/* ------------------------------------------------------------------ explainer film (dialog, never autoplays) */
.dlg.film { width: min(1120px, calc(100vw - 24px)); }
.film-v { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--night); border-bottom: 1px solid var(--concrete); }
.film-btn { width: 44px; padding: 0; }
.film-btn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
