/* SLUICEBOX game page. One screen: the claim in the middle, the HUD around it. Tokens from BRIEF.md "Design tokens"
   (also defined in /shared/base.css; repeated here so the page renders before/without it). Dark plum + one amber accent;
   gold only for nuggets. Display = Silkscreen (pixel, caps, sparingly), body = Atkinson Hyperlegible, tabular numbers. */

@font-face { font-family: 'Silkscreen'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/silkscreen-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Silkscreen'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/silkscreen-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Atkinson Hyperlegible'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/atkinson-hyperlegible-latin-700.woff2') format('woff2'); }

:root {
  --rock: #1B1222; --rock-2: #120B18; --panel: #241A2E; --line: #3A2C47; --text: #F1E8DA; --dim: #A08FAD;
  --lamp: #FFB347; --lamp-2: #FFD27A; --gold: #F5C542; --wood: #8A5A3C; --water: #5FB8C7; --ok: #7CE38B; --bad: #FF6B5B;
  --lamp-ink: #2A1704; --lamp-soft: rgba(255, 179, 71, .12); --gold-soft: rgba(245, 197, 66, .14); --bad-soft: rgba(255, 107, 91, .12);
  --sb-display: 'Silkscreen', 'Press Start 2P', monospace;
  --sb-body: 'Atkinson Hyperlegible', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  --nav-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

html, body.game { height: 100%; background: var(--rock-2); }
body.game {
  margin: 0; color: var(--text); font: 400 14px/1.45 var(--sb-body); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
body.game *, body.game *::before, body.game *::after { box-sizing: border-box; }
.game button, .game input, .game output { font: inherit; color: inherit; }
.game button { cursor: pointer; background: none; border: 0; padding: 0; border-radius: 0; }
.game a { color: inherit; text-decoration: none; }
.game a:hover { color: var(--lamp); }
.game :focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.game ::selection { background: var(--lamp); color: var(--lamp-ink); }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.c-gold { color: var(--gold); }
.c-bad { color: var(--bad); }
.c-dim { color: var(--dim); }
.push { margin-left: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── type helpers ─────────────────────────────────────── */
.game .label {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font: 400 10px/1.2 var(--sb-display); text-transform: uppercase; letter-spacing: .08em; color: var(--dim);
}
.game .label b { color: var(--text); font-weight: 400; }
.game .label .push { font: 400 11px/1.2 var(--sb-body); text-transform: none; letter-spacing: 0; }
.game .readout { font: 400 26px/1 var(--sb-display); letter-spacing: -.01em; color: var(--text); margin: 8px 0 4px; display: flex; align-items: baseline; gap: 6px; }
.game .readout .unit { font: 400 10px/1 var(--sb-display); color: var(--dim); }
.game kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid var(--line); font: 400 9px/1 var(--sb-display); color: var(--dim); background: var(--rock-2); }

/* ── buttons / chips (scoped, so the page works with or without base.css) ── */
.game .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 700 13px/1 var(--sb-body); white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s, transform .08s;
}
.game .btn:hover { border-color: var(--dim); color: var(--text); }
.game .btn:active { transform: translateY(1px); }
.game .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.game .btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.game .btn-lg { height: 44px; padding: 0 20px; font-size: 14px; }
.game .btn-primary { background: var(--lamp); color: var(--lamp-ink); border-color: var(--lamp); }
.game .btn-primary:hover { background: var(--lamp-2); border-color: var(--lamp-2); color: var(--lamp-ink); }
.game .btn-primary[disabled] { background: var(--panel); color: var(--dim); border-color: var(--line); }
.game .icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); color: var(--dim); background: var(--panel); }
.game .icon-btn svg { width: 14px; height: 14px; }
.game .icon-btn:hover { color: var(--text); border-color: var(--dim); }
.game .chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; white-space: nowrap; }
.game .chip svg { width: 12px; height: 12px; color: var(--dim); }
.game .chip .sb-ca-k, .game .chip .mm-ca-k { font: 400 9px/1 var(--sb-display); color: var(--dim); }
.game .tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; font: 400 8px/1 var(--sb-display); text-transform: uppercase; letter-spacing: .08em; border: 1px solid currentColor; white-space: nowrap; font-style: normal; }
.tag-lamp { color: var(--lamp); background: var(--lamp-soft); }
.tag-dim { color: var(--dim); }
.lamp { display: inline-block; width: 8px; height: 8px; background: var(--line); flex: none; }
.lamp.on { background: var(--lamp); box-shadow: 0 0 0 2px var(--lamp-soft); }
.lamp.blink { animation: sb-blink 1.2s steps(2, jump-none) infinite; background: var(--lamp); }
@keyframes sb-blink { to { background: var(--line); } }

/* ── stage ────────────────────────────────────────────── */
.stage { position: fixed; inset: 0; height: 100dvh; overflow: hidden; background: var(--rock-2); }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; image-rendering: pixelated; }
#gl:active { cursor: grabbing; }
.fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.nogl-note { display: none; }
html.nogl #gl { display: none; }
html.nogl .fallback { display: block; }
html.gl-pending .hud, html.gl-pending .gate { opacity: 0; }

/* ── HUD grid ─────────────────────────────────────────── */
.hud {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid; grid-template-columns: 300px 1fr 324px; grid-template-rows: 1fr auto auto; gap: 12px 16px;
  padding: calc(var(--nav-h) + 12px) 16px 10px; transition: opacity .4s;
}
.hud > * { pointer-events: auto; min-width: 0; }
.hud .wlabels, .hud .banners, .hud .sign { pointer-events: none; }
.panel { background: rgba(36, 26, 46, .86); border: 1px solid var(--line); padding: 12px 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel.bump { animation: sb-bump .5s var(--ease); }
@keyframes sb-bump { 30% { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); } }
.hud-tl { grid-column: 1; grid-row: 1; align-self: start; }
.hud-tr { grid-column: 3; grid-row: 1; align-self: start; }
.hud-bl { grid-column: 1 / 3; grid-row: 2; align-self: end; }
.hud-bl > .label { max-width: 760px; }
.hud-br { grid-column: 3; grid-row: 2; align-self: end; max-height: 240px; display: flex; flex-direction: column; }
.strip { grid-column: 1 / 4; grid-row: 3; }

/* your dig */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 0 0; }
.stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stats dt { font-size: 11px; color: var(--dim); }
.stats dd { margin: 0; font: 400 15px/1.1 var(--sb-display); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 8ch; font-variant-numeric: tabular-nums; }
.stats dd .rej { color: var(--bad); font-size: 11px; margin-left: 4px; }
.status { margin: 8px 0 0; padding: 4px 8px; font-size: 11px; color: var(--lamp-2); background: var(--lamp-soft); border-left: 2px solid var(--lamp); }
.status::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: var(--lamp); animation: sb-blink 1.2s steps(2, jump-none) infinite; }
.reject { margin: 8px 0 0; padding: 4px 8px; font-size: 11px; color: var(--bad); background: var(--bad-soft); border-left: 2px solid var(--bad); }
.miner { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field .label { display: flex; }
.field input[type=text] {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); background: var(--rock-2); color: var(--text); font-size: 13px; letter-spacing: .01em;
  transition: border-color .15s;
}
.field input[type=text]::placeholder { color: var(--line); }
.field input[type=text]:focus { border-color: var(--lamp); outline: none; }
.field input.is-bad { border-color: var(--bad); }
.field input.is-ok { border-color: var(--ok); }
.field .msg { font-size: 11px; min-height: 14px; color: var(--dim); }
.field input.is-bad ~ .msg { color: var(--bad); }
.field input.is-ok ~ .msg { color: var(--ok); }
.field .hint { font-size: 11px; color: var(--dim); line-height: 1.35; }
.field.cpu output { color: var(--lamp); font-family: var(--sb-display); font-size: 10px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; background: var(--rock-2); border: 1px solid var(--line); }
input[type=range]::-moz-range-track { height: 6px; background: var(--rock-2); border: 1px solid var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; background: var(--lamp); border: 2px solid var(--lamp-ink); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; background: var(--lamp); border: 2px solid var(--lamp-ink); border-radius: 0; }
input[type=range]:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.miner .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.miner .row #start, .miner .row #stop { flex: 1; }
.disclose { margin: 0; font-size: 11px; line-height: 1.4; color: var(--dim); }
.hud.is-mining #start { display: none; }
.watching { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.watching p { margin: 0 0 10px; font-size: 12px; color: var(--dim); }
.hud[data-mode="watch"] .miner { display: none; }
.hud[data-mode="watch"] .watching { display: block; }
.hud[data-mode="gate"] .hud-tl, .hud[data-mode="gate"] .hud-tr, .hud[data-mode="gate"] .hud-bl, .hud[data-mode="gate"] .hud-br { opacity: 0; pointer-events: none; transform: translateY(-6px); }
.hud .hud-tl, .hud .hud-tr, .hud .hud-bl, .hud .hud-br { transition: opacity .4s var(--ease), transform .4s var(--ease); }

/* balance + round */
.sub { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 12px; }
.note { margin: 6px 0 0; font-size: 11px; line-height: 1.35; }
#bal-note { color: var(--text); opacity: .85; font-size: 11.5px; }
.round-h { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; }
.kv div { display: contents; }
.kv dt { font-size: 11px; color: var(--dim); }
.kv dd { margin: 0; text-align: right; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv dd .of { color: var(--dim); }
.kv dd a { color: var(--lamp); }
#rd-ends { font-family: var(--sb-display); font-size: 12px; min-width: 6ch; display: inline-block; }
#rd-ends.soon { color: var(--lamp); }
.live { margin: 8px 0 0; font-size: 11px; display: flex; gap: 6px; }

/* claim board */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; max-width: 760px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 9px 10px 8px; text-align: left; min-width: 0;
  background: rgba(36, 26, 46, .86); border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .15s, background .15s;
}
.card:hover { border-color: var(--dim); }
.card.is-active { border-color: var(--lamp); box-shadow: inset 0 0 0 1px var(--lamp); }
.card.is-out { opacity: .55; }
.card-h { display: flex; align-items: center; gap: 7px; font-size: 13px; flex-wrap: wrap; }
.card-h b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-h .tag { margin-left: auto; }
.card-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 0 6px; align-items: center; font-size: 11px; }
.card-row .k { color: var(--dim); }
.card-row .v { font-family: var(--sb-display); font-size: 10px; color: var(--text); text-align: right; }
.card-row .v.dots { display: flex; gap: 3px; justify-content: flex-start; }
.nug { display: inline-block; width: 7px; height: 7px; background: var(--gold); box-shadow: 0 0 0 1px var(--rock-2); }
.nug.found { background: var(--line); }
.nug.none { background: transparent; border: 1px dashed var(--line); }
html.dry .nug:not(.found) { background: #9A8A5C; }
.bar { display: block; height: 4px; background: var(--rock-2); border: 1px solid var(--line); }
.bar span { display: block; height: 100%; background: var(--lamp); transition: width .6s var(--ease); }
.card.is-out .bar span { background: var(--dim); }

/* feed */
.feed { list-style: none; margin: 8px 0 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.feed li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.feed li.is-new { animation: sb-in .4s var(--ease); }
@keyframes sb-in { from { opacity: 0; transform: translateY(-4px); } }
.feed .t { flex: none; width: 30px; font-size: 10px; color: var(--dim); font-family: var(--sb-display); }
.feed .m { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 6px; }
.feed .f-m { min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .f-a { flex: none; white-space: nowrap; }
.feed .tx { flex: none; }
.feed .you { color: var(--lamp); }
.feed .tx { color: var(--dim); font-size: 10px; margin-left: 4px; text-decoration: underline; text-underline-offset: 2px; }
.feed .tx:hover { color: var(--lamp); }
.feed .f-nugget .m b.c-gold { font-family: var(--sb-display); font-size: 11px; }

/* strip */
.strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.strip-cd { display: inline-flex; align-items: baseline; gap: 8px; height: 30px; padding: 0 10px; border: 1px solid var(--lamp); color: var(--lamp); background: var(--lamp-soft); font-size: 12px; align-items: center; }
.strip-cd .k, .sb-countdown .k, .mm-countdown .k { font: 400 9px/1 var(--sb-display); text-transform: uppercase; letter-spacing: .06em; }
.strip-cd .v, .sb-countdown .v { font: 400 12px/1 var(--sb-display); }
.strip-cd:empty { display: none; }
.strip-links { display: flex; gap: 14px; font-size: 12px; color: var(--dim); margin-left: 6px; }
.strip-about { font-size: 12px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); padding: 4px 2px; }
.strip-about:hover, .strip-about[aria-expanded="true"] { color: var(--lamp); }
.about { position: absolute; left: 16px; bottom: 56px; z-index: 6; width: min(92vw, 440px); padding: 16px 18px; background: rgba(27, 18, 34, .96); border: 1px solid var(--line); font-size: 13px; line-height: 1.5; pointer-events: auto; }
.about p { margin: 8px 0 0; }
.about nav { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.about nav a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.about .about-close { position: absolute; right: 10px; top: 10px; }
.strip-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.strip .legal { margin: 0 0 0 auto; font-size: 11px; color: var(--dim); max-width: 520px; text-align: right; line-height: 1.3; }
.game .strip-ca, .game .strip-buy { display: none; }
.strip-ca:empty { display: none !important; }

/* banners, sign, world labels, flight */
.banners { position: absolute; left: 0; right: 0; top: var(--nav-h); z-index: 4; display: flex; flex-direction: column; }
:root { --banner-h: 0px; }
html.has-banner { --banner-h: 34px; }
.hud { padding-top: calc(var(--nav-h) + var(--banner-h) + 12px); }
.bn { padding: 0 12px; height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; line-height: 1.3; text-align: center; border-bottom: 1px solid var(--line); background: rgba(36, 26, 46, .94); color: var(--text); pointer-events: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn[data-bn="demo"], .bn[data-bn="miner"] { height: 28px; font-size: 11px; }
.bn.is-dry { border-color: #7D6F48; color: var(--text); background: rgba(58, 48, 30, .9); }
.bn.is-warn { border-color: var(--lamp); color: var(--lamp-2); }
.bn.is-dim { color: var(--dim); font-size: 11px; }
.sign { grid-column: 2; grid-row: 1; place-self: center; text-align: center; max-width: 360px; padding: 20px 22px; background: rgba(27, 18, 34, .94); border: 1px solid var(--lamp); pointer-events: auto !important; }
.sign .sign-k { margin: 0 0 6px; font: 400 10px/1 var(--sb-display); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.sign h2 { margin: 0 0 8px; font: 400 22px/1.1 var(--sb-display); color: var(--lamp); text-transform: uppercase; }
.sign p { margin: 0 0 14px; font-size: 13px; color: var(--dim); }
.wlabels { position: absolute; inset: 0; overflow: hidden; }
.wlabel {
  position: absolute; left: 0; top: 0; padding: 4px 8px; white-space: nowrap; font-size: 12px; background: rgba(27, 18, 34, .92); border: 1px solid var(--line);
  color: var(--text); opacity: 0; will-change: transform, opacity;
}
.wlabel.mine { border-color: var(--lamp); }
.wlabel.soft { color: var(--dim); font-size: 11px; border-color: var(--line); background: rgba(27, 18, 34, .7); }
.wlabel .c-gold { font-family: var(--sb-display); font-size: 11px; }
.fly { position: fixed; z-index: 60; width: 14px; height: 14px; background: var(--gold); box-shadow: 0 0 0 2px var(--rock-2), 0 0 0 3px var(--gold); pointer-events: none; }
.fly.dry { background: #9A8A5C; box-shadow: 0 0 0 2px var(--rock-2); }

/* toast (stub + real site.js use .sb-toast / .mm-toast) */
.sb-toast, .mm-toast {
  position: fixed; left: 50%; top: calc(var(--nav-h) + var(--banner-h) + 10px); bottom: auto; z-index: 70; transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  padding: 9px 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 13px; max-width: min(92vw, 520px); text-align: center;
  transition: opacity .2s, transform .2s var(--ease);
}
.sb-toast.show, .mm-toast.show { opacity: 1; transform: translate(-50%, 0); }
.sb-toast.is-ok, .mm-toast.is-ok { border-color: var(--ok); }
.sb-toast.is-err, .mm-toast.is-err { border-color: var(--bad); }

/* ── the gate ─────────────────────────────────────────── */
.gate { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease); }
.gate.is-open { opacity: 1; }
.gate-head { position: absolute; left: 50%; top: calc(var(--nav-h) + var(--banner-h) + 22px); transform: translateX(-50%); width: min(92vw, 640px); text-align: center; pointer-events: auto; }
.gate-k { margin: 0 0 8px; font: 400 10px/1.3 var(--sb-display); text-transform: uppercase; letter-spacing: .1em; color: var(--lamp); }
.gate-title { margin: 0; font: 400 clamp(26px, 4.4vw, 44px)/1 var(--sb-display); text-transform: uppercase; letter-spacing: .01em; color: var(--text); text-shadow: 3px 3px 0 var(--rock-2); }
.gate-hint { margin: 10px 0 0; font-size: 14px; color: var(--dim); line-height: 1.45; }
.gate-zones { position: absolute; inset: 0; }
.zone { position: absolute; left: 0; top: 0; width: 100px; height: 100px; pointer-events: auto; cursor: pointer; transition: opacity .3s; outline-offset: 6px; }
.zone-box { position: absolute; inset: -6px; border: 1px dashed transparent; transition: border-color .15s, background .15s; }
.zone:hover .zone-box, .zone.is-over .zone-box { border-color: var(--lamp); background: var(--lamp-soft); }
.zone.is-planted .zone-box { border-style: solid; border-color: var(--lamp); }
.zone.is-out { cursor: not-allowed; opacity: .55; }
.zone-card { position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); width: max-content; min-width: 128px; max-width: 180px; padding: 8px 10px; background: rgba(36, 26, 46, .9); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.zone.is-over .zone-card, .zone:hover .zone-card { border-color: var(--lamp); }
.zone-card kbd { position: absolute; right: 8px; top: 8px; }
.zone-card b { font-size: 14px; font-weight: 700; }
.zone-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 11px; color: var(--dim); white-space: nowrap; }
.zone-stats i { font-style: normal; color: var(--text); font-family: var(--sb-display); font-size: 9px; }
.gate-foot { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 14px; pointer-events: auto; }
.stake { position: relative; width: 56px; height: 150px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, .45)); transition: filter .2s; animation: sb-hover 2.4s ease-in-out infinite; }
.stake svg { width: 100%; height: 100%; }
.stake:focus:not(:focus-visible) { outline: none; }
.stake:hover, .stake:focus-visible { filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, .45)) drop-shadow(0 0 0 var(--lamp)); }
.stake.is-drag { cursor: grabbing; animation: none; z-index: 5; filter: drop-shadow(10px 16px 0 rgba(0, 0, 0, .4)); }
.stake.is-planting { animation: none; pointer-events: none; }
.stake-label { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); font: 400 8px/1 var(--sb-display); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); white-space: nowrap; }
.stake.is-drag .stake-label, .stake.is-planting .stake-label { opacity: 0; }
@keyframes sb-hover { 50% { transform: translateY(-5px) rotate(-2deg); } }
.gate.is-dragging .zone-card { opacity: .9; }
.gate-skip { font-size: 12px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; padding: 6px 10px; }
.gate-skip:hover { color: var(--text); }
html.reduced .stake { animation: none; }

html.nogl .gate-zones { position: absolute; left: 50%; top: calc(var(--nav-h) + var(--banner-h) + 150px); bottom: auto; right: auto; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: min(94vw, 880px); }
html.nogl .zone { position: static; width: auto; height: auto; opacity: 1 !important; transform: none !important; }
html.nogl .zone-card { position: static; transform: none; width: 100%; max-width: none; gap: 8px; padding: 12px; }
html.nogl .zone-card .zone-stake { align-self: stretch; margin-top: 4px; }
html.nogl .zone-box, html.nogl .stake, html.nogl .gate-hint .kb, html.nogl .zone-card kbd { display: none; }
html.nogl .nogl-note { display: block; position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); margin: 0; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); color: var(--dim); font-size: 12px; max-width: 90vw; text-align: center; }
html.nogl .gate-foot { bottom: 50px; }
@media (max-width: 980px) { html.nogl .gate-zones { grid-template-columns: 1fr 1fr; top: calc(var(--nav-h) + var(--banner-h) + 120px); } html.nogl .nogl-note { bottom: auto; top: calc(var(--nav-h) + var(--banner-h) + 420px); } }

/* the shared nav (site.js) sits over the canvas */
.game #nav { position: fixed; left: 0; right: 0; top: 0; z-index: 10; }
.game .sb-nav { height: var(--nav-h); background: rgba(27, 18, 34, .82); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.game .sb-nav > .wrap { height: 100%; display: flex; align-items: center; gap: 18px; padding: 0 16px; }
.game .sb-logo { display: flex; align-items: center; gap: 10px; font: 400 15px/1 var(--sb-display); letter-spacing: .02em; }
.game .sb-logo svg { width: 24px; height: 24px; }
.game .sb-links { display: flex; gap: 16px; font-size: 13px; color: var(--dim); }
.game .sb-links a[aria-current] { color: var(--text); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--lamp); }
.game .sb-nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.game .sb-nav [data-countdown]:empty { display: none; }
.game .sb-countdown { display: inline-flex; gap: 8px; align-items: center; color: var(--lamp); font-size: 12px; margin-right: 6px; }


@media (max-width: 600px) {
  .gate-hint .kb, .stake { display: none; }
  .gate-foot { display: none; }
  .gate-skip.inline { display: inline; min-height: 0; padding: 0 4px; margin-left: 6px; color: var(--lamp); font-size: 12px; }
  .zone-card { padding: 5px 7px; gap: 2px; }
  .zone-card b { font-size: 12px; }
  .zone-stats { font-size: 10px; }
}

/* ── reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hud .hud-tl, .hud .hud-tr, .hud .hud-bl, .gate, .bar span, .sb-toast, .mm-toast { transition: none; }
  .feed li.is-new, .panel.bump, .lamp.blink, .stake { animation: none; }
}

/* ── short desktop viewports (≤ 760 px tall): keep the strip on screen ── */
@media (min-width: 981px) and (max-height: 780px) {
  .hud { gap: 8px 16px; }
  .panel { padding: 9px 12px; }
  .stats { gap: 5px 10px; margin-top: 6px; }
  .miner { margin-top: 8px; padding-top: 8px; gap: 7px; }
  .field .hint { display: none; }
  .disclose { font-size: 10px; }
  .hud-br { max-height: 150px; }
  .hud-tr .live, .hud-tr .note { display: none; }
  .round-h { margin-top: 8px; padding-top: 8px; }
}
@media (max-width: 1320px) {
  .zone-card { min-width: 112px; max-width: 150px; padding: 6px 8px; }
  .zone-card b { font-size: 13px; }
  .zone-stats { font-size: 10px; gap: 1px 8px; }
}

/* ── tablet / narrow desktop ──────────────────────────── */
@media (max-width: 1240px) {
  .hud { grid-template-columns: 270px 1fr 270px; }
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; }
  .strip .legal { max-width: 360px; }
}

/* ── phone ────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hud {
    grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr auto auto auto auto; gap: 8px; padding: calc(var(--nav-h) + var(--banner-h) + 8px) 10px 8px;
  }
  #p-dig { display: contents; }
  #p-dig > .label { grid-column: 1; grid-row: 1; display: none; }
  #p-dig > .stats { grid-column: 1; grid-row: 1; margin: 0; padding: 8px 10px; background: rgba(36, 26, 46, .86); border: 1px solid var(--line); grid-template-columns: 1fr 1fr; gap: 4px 8px; align-self: start; }
  .stats dt { font-size: 10px; }
  .stats dd { font-size: 11px; }
  #st-reject { grid-column: 1 / 3; grid-row: 2; margin: 0; }
  .hud-tr { grid-column: 2; grid-row: 1; padding: 8px 10px; align-self: start; }
  .hud-tr .readout { font-size: 16px; margin: 4px 0 2px; }
  .hud-tr .sub, .hud-tr .note, .hud-tr .kv div:nth-child(n+2), .hud-tr .live, .hud-tr > .label .push { display: none; }
  .hud-tr .round-h { margin-top: 6px; padding-top: 6px; }
  .hud-tr .kv { margin-top: 4px; }
  .bn { font-size: 11px; padding: 5px 8px; }
  .sign { grid-column: 1 / 3; grid-row: 3; padding: 14px; max-width: 300px; }
  .hud-br { grid-column: 1 / 3; grid-row: 4; max-height: none; padding: 6px 10px; }
  .hud-br .label { display: none; }
  .feed { margin: 0; gap: 0; max-height: 18px; }
  .feed li { font-size: 11px; }
  #feed-note { margin: 0; font-size: 11px; }
  .hud-bl { grid-column: 1 / 3; grid-row: 5; }
  .hud-bl .label { display: none; }
  .board { display: flex; gap: 6px; margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .board::-webkit-scrollbar { display: none; }
  .card { flex: 0 0 150px; padding: 7px 8px 6px; gap: 4px; align-self: stretch; }
  .card-h { flex-wrap: nowrap; }
  .card-h .tag { font-size: 7px; height: 16px; padding: 0 4px; }
  .card-h { font-size: 12px; }
  .card-row { font-size: 10px; }
  .miner, .watching { grid-column: 1 / 3; grid-row: 6; margin: 0; padding: 8px 10px; border: 1px solid var(--line); background: rgba(36, 26, 46, .9); gap: 6px; }
  .field .hint { display: none; }
  .disclose { font-size: 10px; line-height: 1.35; }
  .hud.is-mining .disclose { display: none; }
  .field { gap: 3px; }
  .field input[type=text] { height: 34px; font-size: 12px; }
  .miner .row .btn-lg { height: 38px; }
  .hud.is-mining .miner .field, .hud.is-mining .miner .msg { display: none; }
  .hud.is-mining .miner { flex-direction: row; align-items: center; }
  .hud.is-mining .miner .row { flex: 1; }
  .hud[data-mode="gate"] .miner, .hud[data-mode="gate"] .hud-br, .hud[data-mode="gate"] #p-dig > .stats { opacity: 0; pointer-events: none; }
  .strip { grid-column: 1 / 3; grid-row: 7; gap: 6px; min-height: 30px; }
  .strip { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'cd cd' 'ca buy' 'links about' 'legal legal'; gap: 6px 8px; align-items: center; }
  .strip-cd { grid-area: cd; justify-self: start; }
  .game .strip-ca { grid-area: ca; display: inline-flex; min-width: 0; }
  .strip-ca .chip { width: 100%; justify-content: space-between; min-width: 0; }
  .strip-ca .num { overflow: hidden; text-overflow: ellipsis; }
  .game .strip-buy { grid-area: buy; display: inline-flex; }
  .strip-links { grid-area: links; gap: 4px; font-size: 12px; margin-left: 0; }
  .strip-links a, .strip-about, .gate-skip { min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
  .strip-about { grid-area: about; font-size: 12px; margin-left: auto; }
  .strip .legal { grid-area: legal; display: block; margin: 0; max-width: none; text-align: left; font-size: 10px; line-height: 1.3; }
  .miner .row .btn-sm { min-height: 44px; }
  .about { left: 0; right: 0; top: var(--nav-h); bottom: 0; width: auto; font-size: 13px; overflow: auto; }
  .strip .btn { height: 36px; font-size: 11px; padding: 0 10px; }
  .strip .chip { height: 36px; font-size: 11px; }
  .strip-cd { height: 36px; font-size: 11px; }
  .gate-head { top: calc(var(--nav-h) + var(--banner-h) + 10px); }
  .bn { white-space: normal; height: auto; min-height: 30px; padding: 4px 10px; font-size: 11px; }
  .bn[data-bn="demo"], .bn[data-bn="miner"] { height: auto; }
  .gate-title { font-size: 24px; }
  .gate-k .kk { display: none; }
  .gate-hint { font-size: 12px; margin-top: 6px; }
  .zone-card { min-width: 0; max-width: 150px; padding: 6px 8px; top: calc(100% + 6px); }
  .zone-card b { font-size: 12px; }
  .zone-stats { font-size: 10px; gap: 0 8px; }
  .gate-foot { bottom: 158px; gap: 4px; }
  .stake { width: 40px; height: 106px; }
  .zone[data-zone="0"] .zone-card, .zone[data-zone="1"] .zone-card { top: auto; bottom: calc(100% + 6px); }
  .hud[data-mode="gate"] .strip-links, .hud[data-mode="gate"] .strip-about { opacity: 0; pointer-events: none; }
  .game .sb-links { display: none; }
  .game .sb-nav .sb-hide-sm, .game .sb-nav .mm-hide-sm { display: none; }
  .wlabel { font-size: 11px; }
}
@media (max-width: 980px) and (max-height: 700px) {
  .hud-br { display: none; }
}
