:root {
  --paper: #F3EDE2;
  --paper-2: #E8E0D1;
  --ink: #16130F;
  --ink-muted: #6E655A;
  --line: #D3C9B8;
  --accent: #FF5A1F;
  --danger: #B8352A;
  --sky-top: #1E2238;
  --sky-horizon: #5B6A8C;
  --ease: cubic-bezier(.2,.7,.1,1);
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --text: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --g: 24px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: linear-gradient(180deg, var(--sky-top) 0%, #343C5E 45%, var(--sky-horizon) 100%);
  color: var(--paper);
  font: 400 15px/1.4 var(--text);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; margin-right: 2px;
  font: 500 11px/16px var(--mono); text-align: center;
  color: var(--ink); background: var(--paper); border-bottom: 2px solid var(--line);
}

/* ---------- plate ---------- */
.plate { position: fixed; top: var(--g); left: var(--g); pointer-events: none; max-width: 70vw; }
.wordmark {
  font: 800 15px/1 var(--display); letter-spacing: -.01em; text-transform: uppercase;
  color: var(--ink); background: var(--paper); display: inline-block; padding: 7px 10px 6px;
}
.wordmark::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; background: var(--accent); }
.district { display: flex; flex-direction: column; margin-top: 18px; }
.district__label { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(243,237,226,.7); }
.district__name {
  font: 800 96px/.9 var(--display); letter-spacing: -.035em; color: var(--paper);
  margin-top: 6px; text-shadow: 0 2px 30px rgba(14,16,30,.35);
}
.district__name.is-in { animation: rise 480ms var(--ease); }
.district__blurb { font: 400 15px/1.3 var(--text); color: rgba(243,237,226,.82); margin-top: 8px; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- ticker ---------- */
.ticker {
  position: fixed; top: var(--g); right: var(--g); display: flex; align-items: stretch;
  max-width: min(380px, 36vw); background: var(--paper); color: var(--ink);
}
.ticker__tag { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: var(--ink); color: var(--paper); padding: 9px 10px; white-space: nowrap; display: flex; align-items: center; }
.ticker__text { font: 500 12px/1.2 var(--mono); padding: 8px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker.is-new .ticker__tag { background: var(--accent); color: var(--ink); transition: background 240ms var(--ease); }

/* ---------- labels ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; }
.label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  font: 500 11px/1 var(--mono); color: var(--ink); background: var(--paper);
  padding: 5px 7px; white-space: nowrap; will-change: transform;
}
.label b { font-weight: 500; }
.label i { font-style: normal; color: var(--ink-muted); margin-left: 6px; }
.label.is-hot { background: var(--accent); }
.label.is-hot i { color: var(--ink); }
.label::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 1px; height: 5px; background: var(--paper); }
.label.is-hot::after { background: var(--accent); }

/* ---------- prompt ---------- */
.prompt {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.prompt__main {
  border: 0; background: var(--paper); color: var(--ink); padding: 10px 14px;
  font: 600 15px/1 var(--text); display: flex; gap: 10px; align-items: center; white-space: nowrap;
}
.prompt__main:hover, .prompt__main:focus-visible { background: var(--accent); outline: none; }
.prompt__hold { width: 60px; height: 4px; background: rgba(22,19,15,.18); position: relative; }
.prompt__hold b { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.prompt__main:hover .prompt__hold b { background: var(--ink); }
.prompt__also {
  border: 0; background: rgba(22,19,15,.78); color: var(--paper); padding: 5px 8px;
  font: 500 11px/1 var(--mono); display: flex; gap: 6px; align-items: center; white-space: nowrap;
}
.prompt__also kbd { font-size: 10px; line-height: 13px; min-width: 16px; padding: 0 4px; border-bottom-width: 1px; }
.prompt__also-k { text-transform: uppercase; letter-spacing: .08em; color: rgba(243,237,226,.6); }
.prompt__also:hover, .prompt__also:focus-visible { background: var(--ink); outline: 1px solid var(--accent); }
body.is-driving .prompt { bottom: 150px; }
body.is-phone .prompt, body.is-intro .prompt { display: none; }

/* ---------- room hint: what to do in here ---------- */
.roomhint {
  position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: stretch; background: var(--paper); color: var(--ink);
  max-width: min(640px, calc(100vw - 2 * 290px)); pointer-events: none;
}
.roomhint b { background: var(--accent); font: 800 14px/1 var(--display); padding: 0 12px; display: flex; align-items: center; white-space: nowrap; }
.roomhint span { font: 600 13px/1.3 var(--text); padding: 9px 12px; }
.roomhint em { font: 500 11px/1.2 var(--mono); font-style: normal; color: var(--ink-muted); border-left: 1px dashed var(--line); padding: 0 12px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
body.is-inside .xpstack { bottom: 214px; }
@media (max-width: 700px) { .roomhint { left: 16px; right: 16px; transform: none; max-width: none; bottom: 200px; } .roomhint em { display: none; } }

/* ---------- keys ---------- */
.keys {
  position: fixed; left: var(--g); bottom: var(--g); display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font: 500 11px/1 var(--mono); color: rgba(243,237,226,.78); max-width: 420px; pointer-events: none;
}
.keys span { display: inline-flex; align-items: center; gap: 4px; }
.keys__all { display: flex; flex-wrap: wrap; gap: 6px 16px; transition: opacity 1.2s var(--ease), visibility 0s linear 1.2s; }
.keys.is-faded .keys__all { opacity: 0; visibility: hidden; }
.keys__min { color: rgba(243,237,226,.9); }
body.is-driving .keys, body.is-intro .keys { display: none; }
.searchbtn { display: none; }

/* ---------- minimap ---------- */
.minimap { position: fixed; right: var(--g); bottom: var(--g); width: 200px; height: 200px; border-radius: 50%; background: #1b2a55; border: 3px solid #16130F; box-shadow: 0 0 0 1.5px rgba(243,237,226,.55), 0 12px 30px -12px rgba(10,12,24,.7); }

/* ---------- stub (storefront) ---------- */
.stub {
  position: fixed; top: 84px; right: var(--g); width: 380px; max-height: calc(100vh - 84px - var(--g));
  background: var(--paper); color: var(--ink); overflow-y: auto; overflow-x: hidden; z-index: 5;
  transform: translateX(calc(100% + 40px)); transition: transform 240ms var(--ease);
  box-shadow: 0 18px 40px -18px rgba(10,12,24,.55);
  scrollbar-width: thin;
}
.stub.is-open { transform: none; }
.stub__close {
  position: absolute; top: 12px; right: 12px; border: 0; background: none;
  font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); padding: 6px;
}
.stub__close:hover, .stub__close:focus-visible { color: var(--ink); outline: 1px solid var(--ink); }
.stub section { padding: 20px 22px; position: relative; }
.stub section + section { border-top: 1px dashed var(--line); }
.stub section + section::before, .stub section + section::after {
  content: ""; position: absolute; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: #2E3550;
}
.stub section + section::before { left: -9px; }
.stub section + section::after { right: -9px; }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.coinhead { display: flex; gap: 14px; align-items: center; margin-top: 4px; }
.coinhead img { width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--ink); background: var(--paper-2); }
.coinhead h2 { margin: 0; font: 800 36px/1 var(--display); letter-spacing: -.03em; }
.coinhead p { margin: 4px 0 0; color: var(--ink-muted); font-size: 13px; }
.prize { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; margin-top: 12px; }
.prize img { width: 96px; height: 96px; object-fit: contain; background: #fff; border: 1px solid var(--ink); }
.prize h3 { margin: 0; font: 600 18px/1.2 var(--display); letter-spacing: -.01em; }
.prize .price { font: 500 13px/1 var(--mono); margin-top: 8px; display: block; }
.pct { display: flex; align-items: baseline; gap: 10px; }
.pct strong { font: 800 56px/1 var(--display); letter-spacing: -.04em; }
.pct span { color: var(--ink-muted); font-size: 13px; }
.bar { height: 10px; background: var(--paper-2); margin-top: 12px; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0; }
.facts div { padding: 10px 0; border-top: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 12px; }
.facts dt { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.facts dd { margin: 6px 0 0; font: 500 15px/1 var(--mono); }
.buy { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.buy button {
  border: 1px solid var(--ink); background: var(--paper); padding: 12px 0; border-radius: 2px;
  font: 500 13px/1 var(--mono); transition: background 120ms var(--ease);
}
.buy button:hover, .buy button:focus-visible { background: var(--accent); outline: none; }
.buy button:active { transform: translateY(1px); }
.buy button[disabled] { opacity: .45; cursor: progress; }
.note { font-size: 12px; color: var(--ink-muted); margin: 12px 0 0; }
.approve {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px;
  background: var(--ink); color: var(--paper); padding: 14px 16px; text-decoration: none; font-weight: 600;
}
.approve:hover, .approve:focus-visible { background: var(--accent); color: var(--ink); outline: none; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; }
.extlink { display: inline-block; margin-top: 14px; color: var(--ink); font: 500 12px/1 var(--mono); text-decoration: underline; text-underline-offset: 3px; }
.skel { height: 14px; background: var(--paper-2); margin: 10px 0; }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; background: rgba(18,20,36,.55); display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; }
.search[hidden] { display: none; }
.search__panel { width: min(560px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); }
.search input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 18px 20px; font: 600 22px/1 var(--display); color: var(--ink); outline: none; }
.search__list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow: auto; }
.search__list li { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.search__list li[aria-selected="true"] { background: var(--accent); }
.search__list .t { font: 500 13px/1.2 var(--mono); }
.search__list .p { font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search__list li[aria-selected="true"] .p { color: var(--ink); }
.search__list .d { font: 500 11px/1 var(--mono); color: var(--ink-muted); text-transform: uppercase; align-self: center; }
.search__empty { padding: 18px 20px; color: var(--ink-muted); }

/* ---------- boot + toast ---------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--sky-top); transition: opacity 480ms var(--ease); }
.boot span { font: 800 44px/1 var(--display); letter-spacing: -.03em; color: var(--paper); }
.boot span::after { content: ""; display: block; height: 4px; width: calc(var(--p, 0) * 100%); background: var(--accent); margin-top: 12px; transition: width 240ms var(--ease); }
@keyframes load { to { width: 100%; } }
.boot.is-done { opacity: 0; pointer-events: none; }
.boot.is-error span::after { animation: none; width: 100%; background: var(--danger); }
.toast { position: fixed; left: 50%; top: 200px; transform: translateX(-50%); background: var(--accent); color: var(--ink); padding: 10px 14px; font: 600 14px/1.2 var(--text); }

/* ---------- stick ---------- */
.stick { position: fixed; left: 28px; bottom: 40px; width: 120px; height: 120px; border-radius: 999px; border: 1px solid rgba(243,237,226,.5); background: rgba(243,237,226,.08); }
.stick__knob { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 999px; background: var(--paper); }

/* ---------- resident chip ---------- */
.me { position: fixed; top: 70px; right: var(--g); display: flex; align-items: stretch; background: var(--paper); color: var(--ink); min-width: 0; max-width: 46vw; }
.me__lvl { background: var(--ink); color: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 10px; }
.me__lvl b { font: 800 20px/1 var(--display); }
.me__lvl span { font: 500 10px/1 var(--mono); letter-spacing: .1em; margin-top: 3px; }
.me__main { padding: 6px 10px; flex: 1; min-width: 120px; max-width: 190px; }
.me__name { font: 600 14px/1.1 var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__name i { font: 500 10px/1 var(--mono); color: var(--ink-muted); font-style: normal; text-transform: uppercase; letter-spacing: .08em; margin-left: 4px; }
.me__bar { height: 4px; background: var(--paper-2); margin: 6px 0; position: relative; }
.me__bar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.me__nums { display: flex; gap: 12px; font: 500 11px/1 var(--mono); color: var(--ink-muted); }
.me__nums span:nth-child(2) { color: var(--ink); }
.me__wallet { border: 0; border-left: 1px dashed var(--line); background: none; padding: 0 12px; font: 600 12px/1 var(--text); }
.me__wallet:hover, .me__wallet:focus-visible { background: var(--accent); outline: none; }
.boardbtn { position: fixed; left: var(--g); top: 250px; border: 0; background: var(--accent); color: var(--ink); padding: 11px 14px; font: 600 15px/1 var(--text); display: flex; gap: 8px; align-items: center; }
.boardbtn kbd { background: var(--ink); color: var(--paper); border: 0; }
.boardbtn:hover, .boardbtn:focus-visible { background: var(--paper); outline: none; }
/* left-hand mission board reuses the stub */
.stub--left { left: var(--g); right: auto; transform: translateX(calc(-100% - 40px)); top: 84px; width: 420px; }
.stub--left.is-open { transform: none; }
.ms { list-style: none; margin: 10px 0 0; padding: 0; }
.ms li { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ms li > div b { font: 600 15px/1.2 var(--display); display: block; }
.ms li > div span { font-size: 12px; color: var(--ink-muted); display: block; margin-top: 2px; }
.ms em { font: 500 12px/1 var(--mono); font-style: normal; }
.ms i { font: 500 11px/1 var(--mono); font-style: normal; color: var(--ink-muted); white-space: nowrap; }
.ms button { grid-column: 1 / -1; justify-self: start; border: 1px solid var(--ink); background: var(--paper); padding: 7px 12px; border-radius: 2px; font: 500 12px/1 var(--mono); }
.ms button:hover, .ms button:focus-visible { background: var(--accent); outline: none; }
.lb { margin-top: 12px; border: 1px solid var(--ink); background: none; padding: 8px 12px; font: 500 12px/1 var(--mono); border-radius: 2px; }
.lbl { list-style: none; margin: 8px 0 0; padding: 0; }
.lbl li { display: grid; grid-template-columns: 24px 1fr auto auto; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font: 500 12px/1.2 var(--mono); }
.lbl em { font-style: normal; color: var(--ink-muted); }
.lbl b { font: 600 13px/1.2 var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* tracker */
.tracker { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; background: var(--paper); color: var(--ink); max-width: min(680px, calc(100vw - 2 * 300px)); }
body.is-running .ticker { display: none; }
.tracker > span { padding: 9px 12px; display: flex; align-items: center; white-space: nowrap; }
.tr__t { background: var(--accent); font: 800 15px/1 var(--display); }
.tr__g { font: 600 13px/1.2 var(--text); overflow: hidden; text-overflow: ellipsis; }
.tr__d, .tr__time { font: 500 13px/1 var(--mono); border-left: 1px dashed var(--line); }
.tracker.is-late .tr__time { background: var(--danger); color: var(--paper); }
.tracker button { border: 0; border-left: 1px dashed var(--line); background: none; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 0 12px; color: var(--ink-muted); }
.tracker button:hover { color: var(--ink); background: var(--paper-2); }
/* xp pops */
.xpstack { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.xp { display: flex; align-items: stretch; background: var(--paper); color: var(--ink); animation: xpup 3.2s var(--ease) forwards; }
.xp b { background: var(--accent); font: 800 18px/1 var(--display); padding: 8px 10px; }
.xp span { font: 600 13px/1 var(--text); padding: 8px 12px; display: flex; align-items: center; }
@keyframes xpup { 0% { transform: translateY(16px); opacity: 0; } 10% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-24px); opacity: 0; } }
/* proof */
.proof { padding: 20px 22px; position: relative; max-height: 80vh; overflow: auto; }
.proof h3 { font: 800 28px/1 var(--display); margin: 10px 0 6px; }
.pick { list-style: none; padding: 0; margin: 10px 0 0; }
.pick button { width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 0; font: 500 14px/1.2 var(--mono); }
.pick button span { display: block; font: 400 13px/1.3 var(--text); color: var(--ink-muted); }
.pick button:hover { background: var(--paper-2); }
.pstep { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pstep > span { font: 800 18px/1 var(--display); color: var(--accent); }
.pstep code { font: 500 12px/1.4 var(--mono); background: var(--paper-2); padding: 1px 4px; }
.pstep code.wrap { word-break: break-all; }
.ok { color: #1f7a45; } .bad { color: var(--danger); }

/* tiers, calendar, gold, wardrobe, draw night */
.me__tier { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; border-left: 1px dashed var(--line); }
.me__tier b { font: 800 14px/1 var(--display); }
.me__tier span { font: 500 10px/1 var(--mono); color: var(--ink-muted); margin-top: 4px; white-space: nowrap; }
.tier--resident b { color: #2d6a8a; } .tier--landlord b { color: #b0761e; } .tier--mayor b { color: var(--accent); }
.cal { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal li { border: 1px solid var(--line); padding: 10px 4px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.cal em { font: 500 10px/1 var(--mono); font-style: normal; color: var(--ink-muted); text-transform: uppercase; }
.cal b { font: 800 14px/1.1 var(--display); }
.cal .past { background: var(--paper-2); opacity: .6; }
.cal .now { background: var(--accent); border-color: var(--ink); }
.cal li:last-child b { color: #9a6a00; }
.cal .now:last-child b { color: var(--ink); }
.claim { width: 100%; border: 0; background: var(--ink); color: var(--paper); padding: 14px; font: 600 15px/1 var(--text); margin-top: 6px; }
.claim:hover:not([disabled]) { background: var(--accent); color: var(--ink); }
.claim[disabled] { opacity: .5; }
.claimlink { grid-column: 1 / -1; color: var(--ink); background: #F2C14E; padding: 8px 10px; font: 600 13px/1 var(--text); text-decoration: none; justify-self: start; }
.xp--gold b { background: #F2C14E; }
.xp--gold { box-shadow: 0 0 0 2px #F2C14E; }
.ward { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ward button { width: 100%; border: 1px solid var(--line); background: var(--paper); padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ward img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--paper-2); }
.ward b { font: 600 11px/1.1 var(--text); }
.ward span { font: 500 9px/1 var(--mono); color: var(--ink-muted); text-transform: uppercase; }
.ward button.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.ward button:hover:not([disabled]) { background: var(--paper-2); }
.ward button[disabled] { opacity: .45; cursor: not-allowed; }
.ward button[disabled] img { filter: grayscale(1) brightness(.6); }
.drawnight { position: fixed; top: 128px; right: var(--g); display: flex; background: var(--ink); color: var(--paper); animation: pulse 1.6s ease-in-out infinite; }
.drawnight b { background: var(--accent); color: var(--ink); font: 800 15px/1 var(--display); padding: 10px 12px; }
.drawnight span { font: 500 12px/1 var(--mono); padding: 10px 12px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,90,31,.45); } }

/* launchpad */
.shop__h { font: 800 34px/1 var(--display); letter-spacing: -.03em; margin: 8px 0 8px; }
.shelf { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shelf button { width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 100%; }
.shelf img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; }
.shelf b { font: 600 12px/1.25 var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf span { font: 500 12px/1 var(--mono); }
.shelf i { font-style: normal; color: #2f7fd6; }
.shelf button:hover, .shelf button:focus-visible { border-color: var(--ink); outline: none; }
.bp { background: #e3efff; border-left: 3px solid #2f7fd6; padding: 10px 12px; font-size: 13px; margin: 10px 0 0; }
.mintin { width: 100%; margin-top: 8px; border: 1px solid var(--line); background: #fff; padding: 10px; font: 500 12px/1 var(--mono); color: var(--ink); }

/* GPS marker: pin over the goal, or an arrow at the screen edge */
.navmark { position: fixed; left: 0; top: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; margin: -18px 0 0 -60px; width: 120px; will-change: transform; z-index: 3; }
.navmark__pin { width: 18px; height: 18px; background: var(--accent); transform: rotate(45deg); box-shadow: 0 0 0 3px var(--ink), 0 0 18px 4px rgba(255,90,31,.55); }
.navmark__arrow { display: none; width: 0; height: 0; border-top: 13px solid transparent; border-bottom: 13px solid transparent; border-left: 26px solid var(--accent); filter: drop-shadow(0 0 6px rgba(255,90,31,.7)) drop-shadow(0 0 0 #16130F); transform-origin: 50% 50%; }
.navmark.is-edge .navmark__arrow { display: block; }
.navmark.is-edge .navmark__pin { display: none; }
.navmark__d { font: 800 18px/1 var(--display); color: var(--ink); background: var(--paper); padding: 4px 8px; white-space: nowrap; }
.navmark__l { font: 500 10px/1 var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: .08em; color: var(--paper); background: var(--ink); padding: 4px 6px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.trackrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.trackrow .lb { margin-top: 0; }
.ms button + button { margin-left: 6px; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .district__name { font-size: 72px; }
}
/* ---------- mobile: its own layout ---------- */
@media (max-width: 760px), (pointer: coarse) {
  :root { --g: 16px; }
  .district { margin-top: 12px; }
  .district__name { font-size: 44px; }
  .district__blurb { display: none; }
  .ticker { top: auto; bottom: 178px; right: var(--g); left: auto; max-width: calc(100vw - 2 * var(--g) - 120px); }
  .keys { display: none; }
  .minimap { width: 112px; height: 112px; top: var(--g); bottom: auto; }
  .searchbtn {
    display: block; position: fixed; right: var(--g); bottom: 40px; border: 0; background: var(--paper); color: var(--ink);
    padding: 14px 16px; font: 600 15px/1 var(--text);
  }
  .prompt { bottom: 178px; left: var(--g); transform: none; }
  .me { top: auto; bottom: 228px; right: var(--g); min-width: 0; max-width: calc(100vw - 2 * var(--g)); }
  .me__nums { gap: 8px; }
  .boardbtn { top: auto; bottom: 108px; right: var(--g); left: auto; }
  .stub--left { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 76vh; transform: translateY(100%); }
  .stub--left.is-open { transform: none; }
  .tracker { top: 140px; max-width: calc(100vw - 2 * var(--g)); }
  .tr__g { display: none; }
  .stub {
    top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 72vh;
    transform: translateY(100%);
  }
  .stub.is-open { transform: none; }
  .stub section + section::before, .stub section + section::after { display: none; }
  .search { padding-top: 10vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------- multiplayer ---------- */
/* dock: one ticket strip left of the minimap */
.mp { position: fixed; right: calc(var(--g) + 212px); bottom: var(--g); display: flex; align-items: stretch; background: var(--paper); color: var(--ink); }
.mp > button { border: 0; background: none; padding: 9px 12px; display: flex; align-items: center; gap: 6px; font: 600 13px/1 var(--text); white-space: nowrap; }
.mp > button + button { border-left: 1px dashed var(--line); }
.mp > button:hover, .mp > button:focus-visible { background: var(--paper-2); outline: none; }
.mp__online i { width: 7px; height: 7px; background: #1f7a45; }
.mp.is-solo .mp__online i { background: var(--ink-muted); }
.mp.is-solo .mp__mic, .mp.is-solo .mp__snd { display: none; }
.mp__online b { font: 500 13px/1 var(--mono); }
.mp__online span { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.mp kbd { background: var(--paper-2); }
.mp__mic.is-live { background: var(--accent); }
.mp__mic.is-live:hover { background: var(--accent); }
.mp__mic.is-live.is-speaking { box-shadow: inset 0 -3px 0 var(--ink); }
.mp__snd[aria-pressed="true"] { color: var(--danger); }
.mp__dash { position: relative; font-family: var(--mono) !important; font-weight: 500 !important; font-size: 11px !important; letter-spacing: .08em; text-transform: uppercase; }
.mp__dash i { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(calc(1 - var(--cd, 0))); }
.mp__dash:not(.is-ready) { color: var(--ink-muted); }

/* player tags: same paper chip as building labels, smaller */
.ptag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: rgba(243,237,226,.92); color: var(--ink); font: 600 12px/1 var(--text); white-space: nowrap; will-change: transform; }
.ptag i { font: 500 10px/1 var(--mono); font-style: normal; color: var(--ink-muted); }
.ptag.is-hot { background: var(--accent); }
.ptag.is-hot i { color: var(--ink); }
.ptag__ring { width: 8px; height: 8px; border-radius: 999px; border: 1.5px solid var(--ink-muted); display: none; }
.ptag.is-speaking .ptag__ring { display: block; border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,31,.35); animation: ring 900ms ease-in-out infinite; }
.ptag.is-hot.is-speaking .ptag__ring { border-color: var(--ink); background: var(--ink); }
@keyframes ring { 50% { box-shadow: 0 0 0 6px rgba(255,90,31,0); } }
.ptag--self { background: none; padding: 0; }
.ptag--self .ptag__ring { width: 12px; height: 12px; }
.ptag__bubble { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 240px; white-space: normal; background: var(--paper); color: var(--ink); padding: 7px 9px; font: 400 13px/1.3 var(--text); border-bottom: 2px solid var(--accent); }
.ptag__bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 1px; height: 6px; background: var(--paper); }

/* chat log + input, bottom-left above the key hints */
.chatlog { position: fixed; left: var(--g); bottom: calc(var(--g) + 66px); width: min(380px, 40vw); list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.chatlog li { align-self: flex-start; max-width: 100%; background: rgba(22,19,15,.62); color: var(--paper); padding: 5px 8px; font: 400 13px/1.3 var(--text); transition: opacity 480ms var(--ease); overflow-wrap: anywhere; }
.chatlog li b { font-weight: 600; color: #FFB48A; margin-right: 4px; }
.chatlog li.is-sys { color: rgba(243,237,226,.7); font-family: var(--mono); font-size: 11px; }
.chatlog li.is-old { opacity: 0; }
.chatform { position: fixed; left: var(--g); bottom: calc(var(--g) + 26px); width: min(420px, calc(100vw - 2 * var(--g))); display: flex; align-items: center; gap: 10px; background: var(--paper); color: var(--ink); padding: 0 12px; z-index: 6; }
.chatform input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; font: 400 15px/1 var(--text); color: var(--ink); outline: none; }
.chatform__left { font: 500 11px/1 var(--mono); color: var(--ink-muted); }
body.is-chatting .keys { visibility: hidden; }

/* players panel reuses the storefront stub */
.stub--players .plist { list-style: none; padding: 0; margin: 14px 0 0; }
.plist li { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.plist li b { font: 600 14px/1.2 var(--text); display: block; }
.plist li span { font: 500 11px/1 var(--mono); color: var(--ink-muted); display: block; margin-top: 4px; }
.plist button, .game button { border: 1px solid var(--ink); background: var(--paper); padding: 7px 10px; border-radius: 2px; font: 500 12px/1 var(--mono); }
.plist button:hover:not([disabled]), .game button:hover, .plist button:focus-visible, .game button:focus-visible { background: var(--accent); outline: none; }
.plist button[disabled] { opacity: .4; cursor: not-allowed; }
.plist button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.plist__empty { display: block !important; color: var(--ink-muted); font-size: 13px; }
.game { padding: 12px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.game b { font: 800 22px/1 var(--display); letter-spacing: -.02em; }
.game p { margin: 6px 0 10px; font-size: 13px; color: var(--ink-muted); }

/* duel + tag strip sits under the mission tracker slot */
.pvpbar { z-index: 4; }
body.is-pvp .ticker { display: none; }
.pvpbar .tr__t { white-space: nowrap; }
.countdown { position: fixed; left: 50%; top: 34vh; transform: translateX(-50%); font: 800 160px/1 var(--display); letter-spacing: -.05em; color: var(--paper); text-shadow: 0 4px 40px rgba(14,16,30,.5); pointer-events: none; }
.countdown.is-in { animation: count 900ms var(--ease) forwards; }
@keyframes count { 0% { transform: translateX(-50%) scale(1.25); opacity: 0; } 15% { transform: translateX(-50%) scale(1); opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.invite { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); width: min(380px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); padding: 16px 18px; border-top: 4px solid var(--accent); z-index: 6; }
.invite p { margin: 8px 0 12px; font-size: 15px; }
.invite__row { display: flex; gap: 8px; }
.invite__row button { flex: 1; border: 1px solid var(--ink); background: var(--paper); padding: 11px; font: 600 14px/1 var(--text); border-radius: 2px; }
.invite__row button:first-child { background: var(--ink); color: var(--paper); }
.invite__row button:first-child kbd { background: var(--accent); }
.invite__row button:hover { background: var(--accent); color: var(--ink); }
.tagboard { position: fixed; right: var(--g); top: 128px; width: 250px; background: var(--paper); color: var(--ink); padding: 14px 16px; z-index: 3; }
.tb__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tb__clock { font: 500 13px/1 var(--mono); }
.tb__clock b { font-weight: 500; }
.tb__list { list-style: none; padding: 0; margin: 10px 0 0; }
.tb__list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font: 500 12px/1.2 var(--mono); }
.tb__list li em { font-style: normal; color: var(--ink-muted); }
.tb__list li b { font: 600 13px/1.2 var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb__list li.is-hot { background: var(--accent); margin: 0 -6px; padding: 6px; }
.tb__list li.is-me b { text-decoration: underline; text-underline-offset: 3px; }
.tb__btn { width: 100%; margin-top: 12px; border: 0; background: var(--ink); color: var(--paper); padding: 10px; font: 600 13px/1 var(--text); }
.tb__btn:hover { background: var(--accent); color: var(--ink); }
.consent__row { display: flex; gap: 8px; margin-top: 14px; }
.consent__row .claim { flex: 1; margin: 0; }
.consent__no { border: 1px solid var(--ink); background: var(--paper); padding: 0 18px; font: 600 15px/1 var(--text); }
#consent h3 + p { font-size: 14px; line-height: 1.5; }
body.is-pvp .drawnight { display: none; }

@media (max-width: 1100px) {
  .mp__online span, .mp__online kbd, .mp__mic kbd { display: none; }
}
@media (max-width: 760px), (pointer: coarse) {
  .mp { right: auto; left: 160px; bottom: 40px; flex-direction: column; }
  .mp > button + button { border-left: 0; border-top: 1px dashed var(--line); }
  .mp > button { padding: 10px 12px; }
  .mp__dash { padding: 16px 12px !important; font-size: 13px !important; }
  .chatlog { bottom: 200px; width: calc(100vw - 2 * var(--g)); }
  .chatform { bottom: auto; top: 140px; }
  .tagboard { top: auto; bottom: 300px; right: var(--g); width: 220px; }
  .pvpbar { top: 140px; }
  .countdown { font-size: 110px; }
  .invite { bottom: 240px; }
}
