/* Single dark world, same tokens as the club site: navy grid, lime pixel type, orange accents. */
:root {
  --bg: #070b14; --panel: rgba(11, 18, 32, .92); --panel-solid: #0b1220; --line: #273347; --text: #e8eadf;
  --muted: #8f9cb3; --lime: #c9db4c; --orange: #e8833a; --gold: #e3b341; --red: #ef6b55;
  --mono: 'Courier New', Courier, 'Nimbus Mono PS', 'Liberation Mono', ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 var(--mono); overflow: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.px { display: inline-block; line-height: 0; }
.px svg { height: 1em; width: auto; display: block; }
#view { position: fixed; inset: 0; display: block; image-rendering: pixelated; touch-action: none; cursor: crosshair; }

/* ---------------------------------------------------------- gate */
#gate { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: rgba(7, 11, 20, .82); backdrop-filter: blur(2px);
  background-image: linear-gradient(rgba(110,130,165,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(110,130,165,.06) 1px, transparent 1px);
  background-size: 24px 24px; }
.gate-card { width: min(560px, 100%); background: var(--panel-solid); border: 1px solid var(--lime); padding: 22px 18px; }
.gate-card h1 { font-size: clamp(30px, 9vw, 48px); color: var(--lime); margin: 0 0 6px; font-weight: 400; }
.gate-card h2 { font-size: 22px; margin: 0 0 6px; font-weight: 400; }
.rule { height: 2px; background: var(--orange); width: 60%; margin: 16px 0; border: 0; }
.lede { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .03em; line-height: 1.9; margin: 0 0 16px; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: 12px; min-height: 0; }
.steps li { display: flex; gap: 10px; align-items: center; text-transform: uppercase; }
.steps li::before { content: ''; width: 10px; height: 10px; flex: none; border: 1px solid var(--line); }
.steps li.on::before { background: var(--orange); border-color: var(--orange); }
.steps li.done::before { background: var(--lime); border-color: var(--lime); }
.steps li.fail { color: var(--red); }
.steps li.fail::before { background: var(--red); border-color: var(--red); }
.lede-tight { margin: 8px 0 0; }
.gate-error { border: 1px solid var(--red); color: var(--red); padding: 10px 12px; font-size: 12px; margin: 0 0 14px; }
.gate-error a { color: var(--lime); }
.wallets { display: grid; gap: 8px; margin: 0 0 14px; }
.wallet { display: flex; align-items: center; gap: 12px; padding: 12px; background: #0e1727; border: 1px solid var(--line); cursor: pointer; min-height: 48px; font-weight: 700; text-align: left; }
.wallet:hover { border-color: var(--lime); }
.conn { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; gap: 16px; text-align: center; padding: 16px; background: rgba(7,11,20,.82); }
.conn p { margin: 0; color: var(--orange); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; max-width: 420px; }
.btn { appearance: none; border: 0; cursor: pointer; background: var(--lime); color: #0a0f05; font-weight: 700; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase; padding: 12px 18px; min-height: 44px; box-shadow: 4px 4px 0 var(--orange); width: 100%; }
.btn:hover:not(:disabled) { background: #d6e85e; }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--orange); }
.btn:disabled { background: var(--line); color: var(--muted); box-shadow: 4px 4px 0 #1b2535; cursor: wait; }
.fine { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.pcard { background: #0e1727; border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: stretch; cursor: pointer; text-align: left; }
.pcard .art { aspect-ratio: 1; background: #1b2535; display: grid; place-items: center; color: var(--muted); font-size: 34px; font-weight: 700; max-width: 100%; }
.pcard .art canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.pcard.sel { border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.pcard:hover:not(.locked) { border-color: var(--orange); }
.pcard.locked { cursor: not-allowed; opacity: .55; }
.pid { font-weight: 700; font-size: 13px; color: var(--lime); }
.pcard.locked .pid { color: var(--muted); }
.pst { font-size: 10px; color: var(--muted); letter-spacing: .05em; }

/* ---------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.top { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: space-between; padding: 10px 12px; background: linear-gradient(rgba(7,11,20,.9), rgba(7,11,20,0)); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { color: var(--lime); font-size: 16px; display: flex; align-items: center; gap: 10px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { background: var(--panel); border: 1px solid var(--line); padding: 4px 8px; font-size: 11px; letter-spacing: .05em; white-space: nowrap; }
.chip b { font-size: 13px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chip.wood b { color: var(--gold); } .chip.stone b { color: #c9d2e0; }
.chip.badge { color: var(--lime); border-color: var(--lime); font-weight: 700; }
.chip.clock { color: var(--orange); }
.chip.travel { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px; }
.chip.travel button { background: none; border: 0; color: var(--lime); font: inherit; font-weight: 700; padding: 4px 7px; min-height: 28px; cursor: pointer; }
.chip.travel button:disabled { color: var(--line); cursor: default; }
.chip.travel #dhome { border-left: 1px solid var(--line); }
.chip.travel #dname { padding: 0 2px; font-weight: 700; }
.tier { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 10px 0 0; }
.tier:empty { display: none; }
.tier b { color: var(--lime); }
.tier a { color: var(--orange); }
.bottom { position: absolute; left: 0; right: 0; bottom: env(safe-area-inset-bottom, 0px); padding: 10px 12px 12px; display: grid; gap: 8px;
  background: linear-gradient(rgba(7,11,20,0), rgba(7,11,20,.92) 35%); pointer-events: none; }
.bottom > * { pointer-events: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modes { display: flex; }
.modes button { background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 700; letter-spacing: .05em; }
.modes button + button { border-left: 0; }
.modes button.on { background: var(--lime); color: #0a0f05; border-color: var(--lime); }
.modes button.locked { color: var(--muted); }
.hint { font-size: 11px; color: var(--muted); letter-spacing: .03em; flex: 1; min-width: 0; }
.palette { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.piece { flex: none; background: var(--panel); border: 1px solid var(--line); padding: 6px 10px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; text-align: left; min-height: 44px; }
.piece b { grid-row: span 2; color: var(--muted); font-size: 11px; align-self: center; }
.piece .pn { font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.piece .pc { font-size: 10px; color: var(--muted); letter-spacing: .03em; }
.piece.sel { border-color: var(--lime); box-shadow: inset 0 -3px 0 var(--lime); }
.piece.poor .pn { color: var(--muted); }
.piece[data-piece="remove"].sel { border-color: var(--orange); box-shadow: inset 0 -3px 0 var(--orange); }
.rot { flex: none; background: var(--panel); border: 1px dashed var(--orange); color: var(--orange); padding: 6px 10px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 12px; }
.chat { display: flex; gap: 0; }
.chat input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; padding: 10px 12px; min-height: 42px; }
.chat input::placeholder { color: var(--muted); }
.chat button { background: var(--orange); color: #160a02; border: 0; font-weight: 700; padding: 0 14px; cursor: pointer; letter-spacing: .05em; }
.log { position: absolute; left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); width: min(360px, calc(100% - 24px)); pointer-events: none; display: grid; gap: 2px; }
.log p { margin: 0; font-size: 12px; background: rgba(7,11,20,.7); padding: 2px 8px; overflow-wrap: anywhere; }
.log b { color: var(--muted); } .log b.me { color: var(--lime); }
.zoom { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: grid; gap: 4px; }
.zoom button { width: 36px; height: 36px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-size: 18px; font-weight: 700; }
.toast { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--orange);
  color: var(--orange); padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-align: center; max-width: calc(100% - 32px); pointer-events: none; }
[hidden] { display: none !important; }
@media (min-width: 760px) {
  .log { bottom: calc(env(safe-area-inset-bottom, 0px) + 120px); }
    .bottom { grid-template-columns: auto 1fr; align-items: end; }
  .bottom .chat { grid-column: 1 / -1; max-width: 520px; }
}
@media (max-width: 520px) { .hint { display: none; } .brand small { display: none; } .toast { top: calc(env(safe-area-inset-top, 0px) + 118px); } }
