/* Brand fonts, self-hosted (SIL Open Font License, see src/fonts/): Teko for display, Chakra Petch for text.
   Bundled with the game so it looks right offline and nothing loads from a third party. Latin subset. */
@font-face {
  font-family: 'Teko';
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/teko-500.woff') format('woff');
}
@font-face {
  font-family: 'Teko';
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/teko-600.woff') format('woff');
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/chakra-petch-400.woff') format('woff');
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/chakra-petch-600.woff') format('woff');
}
/* Cyber City Tactics · src/css/game.css — all styles for the page, menus and touch controls. */
/* Layout: one-screen arcade cabinet — canvas fills the stage, touch pad below (portrait) or over the stage (landscape). Single dark look by design. */
:root {
  --ink: #0c0a14;
  --panel: #17121f;
  --panel2: #1f1830;
  --line: #30283f;
  --text: #efe9ff;
  --muted: #a79dc2;
  --neon: #ff3d8b;
  --mana: #45d2ff;
  --gold: #ffc63d;
  --ok: #7dffb0;
  --karma: #b98cff;
  --font-display: 'Teko', Impact, 'Arial Narrow', sans-serif;
  --font-body: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif;
  --b: 58px;
  --b2: 48px;
  --s: 132px;
  color-scheme: dark;
}
body.size-s {
  --b: 50px;
  --b2: 42px;
  --s: 116px;
}
body.size-l {
  --b: 68px;
  --b2: 56px;
  --s: 152px;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
  overscroll-behavior: none;
}
body {
  -webkit-tap-highlight-color: transparent;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* The canvas fills the whole screen inside the notch-safe area; fit() in core/canvas.js sizes the view
   to match the screen's shape, and the touch controls float over it. */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  box-sizing: border-box;
  position: relative;
}
#stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game {
  display: block;
  background: #000;
}
#pauseBtn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  opacity: 0.85;
  border: 1px solid var(--line);
  background: rgba(23, 18, 31, 0.7);
  color: var(--text);
  font: 600 15px var(--font-body);
  cursor: pointer;
  z-index: 4;
}
button:focus-visible {
  outline: 2px solid var(--mana);
  outline-offset: 2px;
}

#ov {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 20, 0.9);
  z-index: 20;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}
#rotHint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--padH, 0px) + 8px);
  transform: translateX(-50%);
  z-index: 4;
  font: 600 12px var(--font-body);
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(23, 18, 31, 0.92);
  border: 1px solid var(--neon);
  border-radius: 20px;
  padding: 8px 14px;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  font: 600 12px var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
  min-height: 38px;
}
.seg button:first-child {
  border-left: 0;
}
.seg button[aria-pressed='true'] {
  background: var(--neon);
  color: #16040c;
}
.setrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.setrow > div {
  min-width: 0;
}
.setrow .ds {
  font-size: 12.5px;
  color: var(--muted);
}
.codebox textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0;
  padding: 8px;
  font:
    12px/1.35 ui-monospace,
    Menlo,
    Consolas,
    monospace;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  word-break: break-all;
}
.sync.on::before {
  content: '● ';
  color: var(--ok);
}
.sync.bad::before {
  content: '▲ ';
  color: var(--neon);
}
@media (pointer: coarse) {
  .btn {
    min-height: 44px;
  }
  .btn.sm {
    min-height: 38px;
    padding: 8px 12px;
  }
  .tab {
    min-height: 40px;
  }
}
.card {
  width: 100%;
  max-width: 640px;
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  animation: cardIn 0.2s ease-out;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
}
.card h1 {
  font: 600 clamp(48px, 11vw, 84px)/0.82 var(--font-display);
  margin: 0;
  letter-spacing: 0.01em;
  text-shadow:
    -3px 0 var(--neon),
    3px 0 var(--mana);
  text-wrap: balance;
}
/* The wordmark (brand book: Name and wordmark): CYBER CITY with the pink/cyan chromatic split, TACTICS knocked
   out of a Neon Pink bar. The bar is the brand's signature shape. */
.card h1.wordmark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.07em;
  text-transform: uppercase;
  text-shadow: none;
}
.wordmark .wm-city {
  text-shadow:
    -3px 0 var(--neon),
    3px 0 var(--mana);
}
/* First visit only: the sign powers on. CYBER CITY's split pulls into focus while the TACTICS bar
   stutters alight like a neon tube. Under a second, never blocks input, skipped for reduced motion. */
.wordmark.boot .wm-city {
  animation: wmFocus 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.wordmark.boot .wm-bar {
  animation: wmTube 0.9s steps(1, end) both;
}
@keyframes wmFocus {
  from {
    opacity: 0.4;
    text-shadow:
      -12px 0 var(--neon),
      12px 0 var(--mana);
  }
}
@keyframes wmTube {
  0% {
    opacity: 0.12;
  }
  10% {
    opacity: 1;
  }
  16% {
    opacity: 0.25;
  }
  28% {
    opacity: 1;
  }
  33% {
    opacity: 0.5;
  }
  42%,
  100% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark.boot .wm-city,
  .wordmark.boot .wm-bar {
    animation: none;
  }
}
.wordmark .wm-bar {
  background: var(--neon);
  color: var(--ink);
  font-size: 0.56em;
  line-height: 1;
  padding: 0.08em 0.24em 0;
  letter-spacing: 0.14em;
}
.card h2 {
  font: 600 clamp(32px, 7vw, 48px)/0.9 var(--font-display);
  margin: 0;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
.card h3 {
  font: 600 22px/1 var(--font-display);
  margin: 4px 0 0;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.card p {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
  max-width: 62ch;
}
.say {
  border-left: 2px solid var(--neon);
  padding: 4px 0 4px 12px;
  color: var(--text) !important;
  font-size: 15px;
}
.say b {
  color: var(--neon);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 12px;
  display: block;
  text-transform: uppercase;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  font: 600 13px var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--neon);
  background: var(--neon);
  color: #16040c;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn.sm {
  padding: 6px 10px;
  font-size: 11.5px;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.tab {
  font: 600 12px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tab[aria-selected='true'] {
  color: var(--text);
  border-color: var(--line);
  background: var(--panel2);
}
.tab .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-left: 6px;
  vertical-align: middle;
}
.keys {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 13px;
  color: var(--muted);
}
.keys b {
  color: var(--text);
  font-weight: 600;
}
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.cols > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.item > div {
  min-width: 0;
}
.item .nm {
  font-weight: 600;
}
.item .ds {
  font-size: 12.5px;
  color: var(--muted);
}
.item .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.r0 {
  color: #e6e1f2;
}
.r1 {
  color: #7dffb0;
}
.r2 {
  color: #45d2ff;
}
.up {
  color: var(--ok);
}
.down {
  color: var(--neon);
}
.wallet {
  font: 600 26px var(--font-display);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.attrs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.attr {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.attr .k {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.attr .v {
  font: 600 30px/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.attr .h {
  font-size: 11.5px;
  color: var(--muted);
}
.derived {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px 14px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.derived b {
  color: var(--text);
}
.meter {
  height: 6px;
  background: #2a2238;
  border-radius: 3px;
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--karma);
}
.job {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sharebox {
  user-select: text;
  -webkit-user-select: text;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--panel);
  overflow-wrap: anywhere;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
}
.stats b {
  display: block;
  font: 600 26px/1 var(--font-display);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stats span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.trk {
  position: relative;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0812;
  overflow: hidden;
  transition: box-shadow 0.1s;
}
.trk .zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(125, 255, 176, 0.28);
  border-left: 2px solid var(--ok);
  border-right: 2px solid var(--ok);
}
.trk .cur {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  margin-left: -1.5px;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
}
.trk[data-f='ok'] {
  box-shadow: 0 0 0 2px var(--ok);
}
.trk[data-f='bad'] {
  box-shadow: 0 0 0 2px var(--neon);
}
.btn.big {
  padding: 16px 34px;
  font-size: 16px;
  min-width: 150px;
}
.sk-tree {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
}
.sk-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.sk-link {
  height: 14px;
  width: 2px;
  margin: 0 auto;
  background: linear-gradient(var(--tc), transparent);
  opacity: 0.6;
}
.sk {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.2s;
}
.sk .sk-n {
  font: 600 15px var(--font-display);
  letter-spacing: 0.02em;
}
.sk .sk-d {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}
.sk .sk-l {
  font-size: 11.5px;
  color: var(--neon);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sk.own {
  border-color: var(--tc);
  box-shadow:
    inset 0 0 0 1px var(--tc),
    0 0 14px -6px var(--tc);
}
.sk.own .sk-n {
  color: var(--tc);
}
.sk.can {
  border-color: var(--gold);
  animation: skp 1.6s ease-in-out infinite;
}
.sk.can:hover {
  transform: translateY(-2px);
}
.sk.lock {
  opacity: 0.5;
  cursor: default;
}
.sk.pop {
  animation: skpop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes skp {
  50% {
    box-shadow: 0 0 0 3px rgba(255, 198, 61, 0.18);
  }
}
@keyframes skpop {
  0% {
    transform: scale(0.92);
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sk.can,
  .sk.pop {
    animation: none;
  }
}
.r3 {
  color: #b98cff;
}
.r4 {
  color: #ffa630;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--c1) 55%, var(--c2) 55%);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  color: #fff;
}
.swatch.on {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.swatch:disabled {
  opacity: 0.35;
  cursor: default;
}
@media (pointer: coarse) {
  .swatch {
    width: 32px;
    height: 32px;
  }
}
.job .st {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#pad {
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  position: absolute;
  z-index: 5;
  left: env(safe-area-inset-left, 0px);
  right: env(safe-area-inset-right, 0px);
  bottom: env(safe-area-inset-bottom, 0px);
  padding: 6px 12px 8px;
  pointer-events: none;
}
#pad > * {
  pointer-events: auto;
}
body.touch #pad {
  display: flex;
}
body.touch.lefty #pad {
  flex-direction: row-reverse;
}
#stick {
  width: calc(var(--s) * 1.25);
  height: calc(var(--s) * 1.12);
  flex: none;
  position: relative;
  touch-action: none;
}
#ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  border: 2px solid var(--line);
  background: rgba(23, 18, 31, 0.55);
  pointer-events: none;
}
#knob {
  position: absolute;
  left: 29%;
  top: 29%;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--muted);
  pointer-events: none;
}
#btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
body.lefty #btns {
  align-items: flex-start;
}
.urow,
.mrow,
.brow {
  display: flex;
  gap: 8px;
}
.tb {
  width: var(--b2);
  height: var(--b2);
  border-radius: 50%;
  border: 2px solid var(--neon);
  background: rgba(255, 61, 139, 0.14);
  color: var(--text);
  font: 600 10.5px/1.05 var(--font-body);
  letter-spacing: 0.03em;
  touch-action: none;
  padding: 0;
  flex: none;
}
.tb.big {
  width: var(--b);
  height: var(--b);
  font-size: 11.5px;
}
.tb small {
  display: block;
  font-size: 9.5px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.tb.on {
  background: rgba(255, 61, 139, 0.45);
}
.tb.dim {
  opacity: 0.4;
}
.urow .tb.spec {
  border-color: var(--gold);
  color: var(--gold);
  min-width: 64px;
}
.urow .tb.spec.ready {
  background: rgba(255, 198, 61, 0.35);
  color: var(--text);
  box-shadow: 0 0 12px rgba(255, 198, 61, 0.5);
}
.tb.gun {
  border-color: var(--gold);
  background: rgba(255, 198, 61, 0.12);
}
.tb.spell {
  border-color: var(--mana);
  background: rgba(69, 210, 255, 0.12);
}
.tb.move {
  border-color: var(--ok);
  background: rgba(125, 255, 176, 0.1);
}
.urow .tb {
  width: auto;
  min-width: var(--b2);
  height: 34px;
  border-radius: 17px;
  padding: 0 10px;
  border-color: var(--muted);
  background: rgba(167, 157, 194, 0.1);
}
@media (orientation: landscape) and (max-height: 460px) {
  body.touch {
    --b: 50px;
    --b2: 42px;
    --s: 110px;
  }
  body.touch.size-s {
    --b: 44px;
    --b2: 38px;
    --s: 96px;
  }
  body.touch.size-l {
    --b: 56px;
    --b2: 46px;
    --s: 124px;
  }
  .urow .tb {
    height: 30px;
  }
}
@media (orientation: portrait) {
  /* stick zone + 12px gap + three buttons must fit the phone width minus the 32px gutter */
  body.touch {
    --b: 60px;
    --b2: 50px;
    --s: min(128px, calc((100vw - 32px - 12px - 16px) * 0.38));
  }
  body.touch.size-s {
    --b: 52px;
    --b2: 44px;
    --s: min(112px, calc((100vw - 60px) * 0.36));
  }
  body.touch.size-l {
    --b: min(68px, calc((100vw - 60px) * 0.2));
    --b2: min(56px, calc((100vw - 60px) * 0.17));
    --s: min(140px, calc((100vw - 60px) * 0.36));
  }
  body.touch #stick {
    width: var(--s);
    height: calc(var(--s) * 1.15);
  }
  body.touch #pad {
    padding-bottom: 10px;
  }
}
@media (orientation: portrait) and (max-width: 360px) {
  body.touch:not(.size-l) {
    --b: 52px;
    --b2: 44px;
  }
}

/* ---------- Standalone page (GitHub Pages, installed app) ---------- */
body {
  margin: 0;
}
#app {
  background: var(--ink);
}

/* ---------- Update-ready bar (src/js/pwa.js) ---------- */
#updBar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px 8px 14px;
  background: var(--panel2);
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--text);
  font: 600 13px var(--font-body);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  max-width: calc(100% - 24px);
}
#updBar button {
  font: 600 12px var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 6px 10px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  cursor: pointer;
}
#updBar button[data-u='later'] {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

/* ---------- Controllers (src/js/core/input.js) ---------- */
/* A connected controller replaces the on-screen pad. */
body.gamepad #pad {
  display: none !important;
}
/* Focus ring for menu navigation with a controller: bold, gold, impossible to lose. */
body.pad-nav #ov :focus {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(255, 198, 61, 0.18);
}

/* ---------- Challenge seed box ---------- */
.seedin {
  font: 600 16px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  width: 11em;
  max-width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  user-select: text;
  -webkit-user-select: text;
}
.seedin:focus {
  outline: 2px solid var(--mana);
  outline-offset: 1px;
}

/* ---------- Online co-op codes (src/js/modes/net.js) ---------- */
.netcode {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font:
    12px/1.35 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  word-break: break-all;
  background: var(--ink);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
  user-select: text;
  -webkit-user-select: text;
}
.netcode.short {
  font: 600 22px var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  max-width: 12em;
  resize: none;
}
.roomcode {
  font:
    600 64px/1 Teko,
    Impact,
    sans-serif;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 198, 61, 0.35);
  margin: 4px 0 8px;
  user-select: all;
  -webkit-user-select: all;
}
.netmore summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0;
}
.netcode[readonly] {
  color: var(--muted);
}
.netcode:focus {
  outline: 2px solid var(--mana);
  outline-offset: 1px;
}

/* a locked bag item: a quiet gold edge, so keepers stand out in a long list */
.item.locked {
  border-color: rgba(255, 198, 61, 0.45);
}

/* NEW marker on gear you haven't looked at yet: small, gold, quiet */
.newtag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--gold);
  color: var(--ink);
  font: 600 10px/16px var(--font-body);
  vertical-align: 2px;
  letter-spacing: 0.04em;
}

/* ---------- accessibility (Settings) ---------- */
body.rm *,
body.rm *::before,
body.rm *::after {
  animation: none !important;
  transition: none !important;
}
body.hc {
  --muted: #d9d2f2;
  --line: #7a6e98;
  --panel: #0d0a14;
  --panel2: #15101f;
}
body.hc .btn.ghost,
body.hc .seg button,
body.hc .tab {
  border-color: #d9d2f2;
}
body.hc .ds,
body.hc .sk-d {
  color: #e6e0fa;
}
body.cb {
  --ok: #45d2ff;
  --neon: #ffa630;
}
.keymap {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(0, auto) minmax(0, auto);
  gap: 6px 10px;
  align-items: center;
  font-size: 13px;
}
.keymap kbd {
  white-space: nowrap; /* a key's name never breaks across lines */
  display: inline-block;
  margin: 1px 0;
  font: 600 12px var(--font-body);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--panel2);
}
.keymap .waiting {
  color: var(--gold);
}

.keymap .btn {
  white-space: normal;
  text-align: center;
}

/* ---------- the newer hacking minigames ---------- */
.hkgame {
  position: relative;
  margin: 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0812;
  padding: 10px;
}
.hkgame[data-f='bad'] {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px var(--neon) inset;
}
.hkgame[data-f='ok'] {
  border-color: var(--ok);
}
.hkpads {
  display: grid;
  gap: 6px;
  justify-content: center;
  margin: 8px 0;
}
/* a D-pad cross for four directions, a stacked pair for two */
.hkpads.cross {
  grid-template-columns: repeat(3, minmax(48px, 64px));
  grid-template-areas: '. up .' 'left . right' '. down .';
}
.hkpads.pair {
  grid-template-columns: minmax(64px, 96px);
  grid-template-areas: 'up' 'down';
}
.hkpad {
  min-height: 52px;
  font-size: 20px;
}
.hkpad.lit {
  background: var(--mana);
  color: #0a0812;
  box-shadow: 0 0 18px var(--mana);
}
.hkgrid {
  display: grid;
  grid-template-columns: repeat(var(--w), 1fr);
  gap: 4px;
}
.hkgrid i {
  aspect-ratio: 1;
  border-radius: 4px;
  background: #1f1830;
}
.hkgrid i.trail {
  background: #24405a;
}
.hkgrid i.ice {
  background: #5a1830;
  box-shadow: 0 0 6px #ff3d4a inset;
}
.hkgrid i.exit {
  background: #1d4a35;
  box-shadow: 0 0 8px var(--ok);
}
.hkgrid i.me {
  background: var(--mana);
  box-shadow: 0 0 10px var(--mana);
}
.hktime {
  height: 5px;
  margin-top: 8px;
  border-radius: 3px;
  background: #1f1830;
  overflow: hidden;
}
.hktime i {
  display: block;
  height: 100%;
  background: var(--gold);
}
.hklanes {
  position: relative;
  height: 96px;
  overflow: hidden;
  background: repeating-linear-gradient(#0a0812 0 31px, #1f1830 31px 32px);
}
.hklanes i {
  position: absolute;
  display: block;
}
.hklanes .sig {
  left: 12%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: var(--mana);
  box-shadow: 0 0 10px var(--mana);
}
.hklanes .blk {
  width: 18px;
  height: 22px;
  border-radius: 3px;
  background: #ff3d4a;
  box-shadow: 0 0 8px #ff3d4a;
}
body.cb .hkgrid i.ice,
body.cb .hklanes .blk {
  background: #ffa630;
  box-shadow: 0 0 8px #ffa630;
}
