/* ==========================================================================
   Cartesian Clash — 2D Pixel-Art Tactical Arcade Dashboard
   Authentic Risograph Paper & Ink Palette with Dual-Mode Light & Dark
   ========================================================================== */

/* Colours come from theme.css alone (--paper, --ink, --blue, --flo, --gold,
   --play-yellow, --border-ink, --card-bg and the --gw-* tokens behind them),
   in both themes. Only the short font names are aliased here. */
:root {
  --font-display: var(--gw-font-display);
  --font-mono: var(--gw-font-mono);
  --font-pixel: var(--gw-font-pixel);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  image-rendering: pixelated;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Background Canvas (Pixelated Coordinate Grid & Stepped Parabola) */
.pixel-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#backdrop-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Main Dashboard Shell */
.dashboard-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 28px;
}

/* ========================================================== HEADER ===== */
/* Identity, economy, controls: three groups that wrap as groups. The profile
   chip is theme.css's .game-profile-chip, the same component the plate wears. */
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.header-identity,
.header-economy,
.header-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-economy { flex-wrap: wrap; }

.lobby-profile-chip {
  min-height: 44px;
  padding: 4px 14px 4px 6px;
  font-family: var(--font-mono);
}
.lobby-profile-chip .game-avatar-canvas {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.lobby-profile-chip .game-callsign { font-size: 13px; max-width: 160px; }

.lobby-rank {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--gw-ink-muted);
  white-space: nowrap;
}

.admin-badge {
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  color: var(--gw-on-accent);
  background: var(--gw-tier-dev);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-sm);
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 12px;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-md);
  box-shadow: var(--gw-press-rest);
}
.chip-icon.token-icon { color: var(--gw-gold-shadow); font-size: 15px; }
.chip-icon.star-icon { color: var(--gold); font-size: 14px; }
.chip-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.mode-toggle-box {
  display: flex;
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-md);
  overflow: hidden;
  box-shadow: var(--gw-press-rest);
}
.theme-toggle-btn {
  min-height: 36px;
  padding: 0 12px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--gw-ink-muted);
  background: var(--card-bg);
  border: 0;
  cursor: pointer;
}
.theme-toggle-btn + .theme-toggle-btn { border-left: 2px solid var(--border-ink); }
.theme-toggle-btn.is-active {
  color: var(--gw-on-yellow);
  background: var(--play-yellow);
}

.header-link-btn,
.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0 12px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-md);
  box-shadow: var(--gw-press-rest);
  cursor: pointer;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.header-icon-btn { padding: 0; }
.header-icon-btn .dock-pixel-icon { width: 24px; height: 24px; }
.header-link-btn:hover,
.header-icon-btn:hover { transform: translateY(-1px); box-shadow: var(--gw-press-hover); }
.header-link-btn:active,
.header-icon-btn:active { transform: translateY(2px); box-shadow: var(--gw-press-down); }

/* Every focusable thing in the lobby shows focus the same way. */
.dashboard-shell :is(button, a, input, [tabindex]):focus-visible,
.mode-drawer-overlay :is(button, a, input):focus-visible,
.settings-modal-overlay :is(button, a, input):focus-visible,
.login-modal-overlay :is(button, a, input, summary):focus-visible {
  outline: 2px solid var(--gw-border-focus);
  outline-offset: 3px;
}

/* ========================================================== STAGE ===== */
.dashboard-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  gap: 24px;
  align-items: center;
  margin: 10px 0;
  min-height: 0;
}

/* Side Docks (Left and Right) */
.side-dock {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-dock--left {
  align-items: flex-start;
}

.side-dock--right {
  align-items: flex-end;
}

/* Chunky Retro Dock Buttons */
.dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 84px;
  background: var(--card-bg);
  border: 3px solid var(--border-ink);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--gw-press-rest);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

.dock-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--gw-press-hover);
}

.dock-btn:active {
  transform: translateY(2px);
  box-shadow: var(--gw-press-down);
}

/* The dock button for the mode PLAY will start wears the card's blue. */
.dock-btn.is-current {
  border-color: var(--blue);
  box-shadow: 0 3px 0 var(--blue);
}

.dock-btn__icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-btn__icon {
  font-size: 28px;
}

.dock-btn__badge {
  position: absolute;
  top: -8px;
  right: -14px;
  background: var(--flo);
  color: var(--gw-on-accent);
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--border-ink);
  white-space: nowrap;
}

.dock-btn__label {
  font-family: var(--font-pixel);
  font-size: 8px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: 0.05em;
  text-align: center;
}

/* Locked Dock Buttons ("In the Future") */
.dock-btn--locked {
  background: var(--paper-deep);
  opacity: 0.88;
}

.dock-btn--locked .lock-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #475569;
  color: #fff;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1.5px solid var(--border-ink);
}

/* Season Pass Card at Bottom Left */
.season-pass-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 130px;
  background: var(--card-bg);
  border: 3px solid var(--border-ink);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 0 var(--border-ink);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.season-pass-card:hover {
  transform: translateY(-2px);
}

.pass-icon-badge {
  font-size: 22px;
}

.pass-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pass-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pass-name {
  font-family: var(--font-pixel);
  font-size: 7px;
  font-weight: 700;
  color: var(--ink);
}

.pass-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--flo);
}

.pass-bar-track {
  width: 100%;
  height: 8px;
  background: var(--paper-deep);
  border: 1.5px solid var(--border-ink);
  border-radius: 4px;
  overflow: hidden;
}

.pass-bar-fill {
  height: 100%;
  background: var(--gold);
}

/* ========================================================== CENTER STAGE ===== */
.center-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}

/* Character Viewport & Shadow */
.character-viewport {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 340 / 400;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pixel-operator-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  z-index: 3;
}

.dock-pixel-icon {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  display: block;
}

.pixel-ground-shadow {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 24px;
  background: var(--gw-rule);
  border-radius: 50%;
  z-index: 2;
}

/* Arena balloon: CREATE ROOM and JOIN, and the code box JOIN opens. */
.room-ready-balloon {
  position: absolute;
  top: 18px;
  right: -25px;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-lg);
  padding: 6px 8px 6px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  box-shadow: var(--gw-press-rest);
  z-index: 10;
  max-width: 280px;
}

.room-ready-balloon::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 18px;
  border-width: 9px 8px 0;
  border-style: solid;
  border-color: var(--border-ink) transparent;
  display: block;
  width: 0;
}

.balloon-status-dot {
  width: 8px;
  height: 8px;
  background: var(--gw-status-live);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--border-ink);
}

.balloon-text {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink);
  letter-spacing: 0.05em;
}

.balloon-actions {
  display: flex;
  gap: 6px;
}

.balloon-btn {
  min-height: 32px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
  background: var(--paper-deep);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-sm);
  padding: 0 8px;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 2px 0 var(--border-ink);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}
.balloon-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--border-ink); }
.balloon-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--border-ink); }
.balloon-btn[aria-expanded="true"] { background: var(--play-yellow); color: var(--gw-on-yellow); }

.join-popover {
  flex-basis: 100%;
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 2px dashed var(--gw-border-hairline);
}
.join-popover[hidden] { display: none; }
.join-popover__label {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink);
}
.join-popover__row { display: flex; gap: 6px; }
.join-popover__input {
  width: 7ch;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  user-select: text;
  -webkit-user-select: text;
}
.join-popover__input[aria-invalid="true"] { border-color: var(--gw-status-danger); }
.join-popover__go { width: auto; min-height: 36px; padding: 0 12px; font-size: 9px; }
.join-popover__error {
  min-height: 1em;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gw-status-danger);
}
.join-popover__error:empty { display: none; }

/* Quick Skin Switcher Bar */
.skin-selector-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 3px solid var(--border-ink);
  border-radius: 30px;
  padding: 6px 18px;
  box-shadow: 0 4px 0 var(--border-ink);
  z-index: 5;
  margin-top: -10px;
}

.skin-arrow-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--blue);
  cursor: pointer;
  padding: 2px 6px;
  transition: transform 0.1s ease;
}

.skin-arrow-btn:hover { transform: translateY(-1px); color: var(--ink); }
.skin-arrow-btn { min-width: 36px; min-height: 36px; }

.skin-selector-pill.is-locked {
  border-style: dashed;
  box-shadow: 0 3px 0 var(--gw-ink-subtle);
}

.skin-title-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 150px;
}

.skin-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.skin-tier-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--flo);
  margin-top: 2px;
}

/* ========================================================== FOOTER ===== */
.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 10px;
}

/* Mode Selector Card: which mode PLAY starts. It is a button, and a change of
   mode runs one ink sweep along its bottom edge so the change is seen. */
.mode-selector-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card-bg);
  border: 3px solid var(--border-ink);
  border-radius: var(--gw-radius-lg);
  padding: 10px 18px;
  min-width: min(380px, 100%);
  box-shadow: var(--gw-press-rest);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out;
}

.mode-selector-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--gw-press-hover);
}

.mode-selector-card:active {
  transform: translateY(2px);
  box-shadow: var(--gw-press-down);
}

.mode-selector-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
}
.mode-selector-card.is-switched::after {
  animation: modeSweep 420ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes modeSweep {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.mode-diagram-box {
  width: 48px;
  height: 48px;
  flex: none;
  background: var(--paper-deep);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mode-text-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mode-event-countdown {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gw-team-1-text);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.mode-headline {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--ink);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.mode-subline {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 4px;
}

.mode-dropdown-caret {
  font-size: 12px;
  color: var(--ink-soft);
}

/* PLAY: the one big arcade key. The same bevel grammar as every button, one
   size deeper, and its ink stays dark on both papers like every yellow chip. */
.pixel-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 64px;
  background: var(--play-yellow);
  border: 3px solid var(--gw-on-yellow);
  border-radius: var(--gw-radius-lg);
  cursor: pointer;
  box-shadow: 0 5px 0 var(--play-shadow), 0 7px 0 var(--border-ink);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, background-color 0.1s ease-out;
}

.pixel-play-btn:hover {
  background: var(--gw-yellow-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--play-shadow), 0 8px 0 var(--border-ink);
}

.pixel-play-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--play-shadow), 0 3px 0 var(--border-ink);
}

.play-text {
  font-family: var(--font-pixel);
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--gw-on-yellow);
}

@media (prefers-reduced-motion: reduce) {
  .mode-selector-card.is-switched::after { animation: none; transform: scaleX(1); }
  .pixel-play-btn, .mode-selector-card, .dock-btn { transition: none; }
}

/* ========================================================== MODALS ===== */
.mode-drawer-overlay,
.cosmetics-modal-overlay,
.settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--gw-bg-overlay);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out;
}

.mode-drawer-overlay[hidden],
.cosmetics-modal-overlay[hidden],
.settings-modal-overlay[hidden] {
  display: none;
}

.mode-drawer-card,
.cosmetics-modal-card,
.settings-modal-card {
  width: 90%;
  max-width: 580px;
  background: var(--paper);
  border: 4px solid var(--border-ink);
  border-radius: 12px;
  box-shadow: 0 12px 0 var(--border-ink);
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--border-ink);
}

.drawer-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border-ink);
}

.drawer-close-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* Mode Options List */
.mode-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-md);
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: var(--gw-press-rest);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, border-color 0.1s ease-out;
}

.mode-option:hover {
  transform: translateY(-1px);
  box-shadow: var(--gw-press-hover);
}
.mode-option:active { transform: translateY(2px); box-shadow: var(--gw-press-down); }

.tier-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: -2px 0 4px 44px;
}
.tier-btn {
  min-height: 36px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 2px solid var(--border-ink);
  border-radius: var(--gw-radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border-ink);
}
.tier-btn[aria-pressed="true"] { color: var(--gw-on-yellow); background: var(--play-yellow); }
.tier-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--border-ink); }

.mode-option.is-selected {
  background: var(--paper-deep);
  border-color: var(--blue);
  box-shadow: 0 3px 0 var(--blue);
}

.mode-opt-num {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--blue);
}

.mode-opt-body {
  flex: 1;
}

.mode-opt-name {
  display: block;
  font-family: var(--font-pixel);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
}

.mode-opt-desc {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.mode-opt-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--gw-on-accent);
  background: var(--flo);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1.5px solid var(--border-ink);
}

/* Cosmetics Modal Tabs */
.modal-header-tabs {
  display: flex;
  gap: 10px;
}

.modal-tab-btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--card-bg);
  border: 2.5px solid var(--border-ink);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border-ink);
}

.modal-tab-btn.is-active {
  background: var(--blue);
  color: var(--gw-on-accent);
  box-shadow: 0 3px 0 var(--border-ink);
}

.skins-grid,
.tracers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.skin-item-card,
.tracer-item-card {
  background: var(--card-bg);
  border: 2.5px solid var(--border-ink);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.12s ease;
}

.skin-item-card:hover,
.tracer-item-card:hover {
  transform: translateY(-2px);
}

.skin-item-card.is-equipped,
.tracer-item-card.is-equipped {
  border-color: var(--blue);
  box-shadow: 0 4px 0 var(--blue);
  background: var(--paper-deep);
}

.skin-item-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1.5px solid var(--border-ink);
  margin-top: 6px;
  /* The fill is the skin's own colour and does not change with the theme, so
     the ink is picked per badge (paintBadge in dashboard.js) and fixed too. */
  background: var(--badge-fill, var(--gw-blue));
  color: var(--gw-on-yellow);
}
.skin-item-badge.is-on-dark { color: var(--locker-ink-on-dark); }

.skin-item-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 8px;
}

.skin-item-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* Settings Rows */
.settings-content-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--border-ink);
}

.setting-label {
  display: flex;
  flex-direction: column;
}

.setting-name {
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink);
}

.setting-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.setting-toggle-btn,
.setting-action-link {
  font-family: var(--font-pixel);
  font-size: 8px;
  font-weight: 700;
  padding: 8px 14px;
  background: var(--paper-deep);
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 2px 0 var(--border-ink);
  text-decoration: none;
}

.setting-toggle-btn.is-active {
  background: var(--blue);
  color: var(--gw-on-accent);
}

/* Retro Pixel Toast Notification */
.retro-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.retro-toast {
  /* An inverted slip of the page's own ink, so it reads on either paper. */
  background: var(--ink);
  color: var(--paper);
  border: 3px solid var(--flo);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 0 var(--flo);
  animation: toastPop 0.2s cubic-bezier(0.16, 1, 0.3, 1), toastFade 0.3s ease 2.2s forwards;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes toastPop {
  0% { transform: translateY(-20px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastFade {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Player Identity & Auth Switcher Button */
.chip-unit {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-soft);
  margin-left: 2px;
}

/* Midnight UTC Daily Match Cap Meter */
.daily-match-meter {
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--paper-deep);
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  padding: 3px 10px;
  min-width: 145px;
}
.meter-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}
.meter-label {
  color: var(--ink-soft);
  font-size: 8px;
}
.meter-val {
  color: var(--flo);
  font-weight: 800;
}
.meter-countdown {
  font-size: 8px;
  color: var(--blue);
}
.meter-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-ink);
}
.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #F59E0B, #FF4A18);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Dock Badge Variants */
.dock-btn__badge--accent {
  background: var(--gold) !important;
  color: var(--gw-on-yellow) !important;
}
.dock-btn__badge--subtle {
  background: var(--paper-deep) !important;
  color: var(--ink) !important;
}

/* Cosmetics Modal Header Token Badge */
.modal-header-token-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-deep);
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--gold);
}

/* Skin Locker Price Tags & Unlock */
.skin-item-price-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-ink);
  color: var(--ink);
}
.skin-unlock-btn {
  font-family: var(--font-pixel);
  font-size: 8px;
  font-weight: 700;
  margin-top: 8px;
  padding: 6px 12px;
  background: var(--gold);
  color: var(--gw-on-yellow);
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border-ink);
  transition: transform 0.1s ease;
}
.skin-unlock-btn--equip {
  background: var(--gw-blue);
  color: var(--gw-on-accent);
}
.skin-unlock-btn--admin {
  background: var(--gw-flo);
  color: var(--gw-on-accent);
}
/* Armed: the second press spends. Vermilion, and a heavier ink edge, so it
   cannot be mistaken for the UNLOCK it was a moment ago. */
.skin-unlock-btn.is-armed {
  background: var(--gw-flo);
  color: var(--gw-on-accent);
  box-shadow: 0 3px 0 var(--border-ink);
}
.skin-unlock-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.skin-item-state {
  font-family: var(--font-pixel);
  font-size: 8px;
  margin-top: 8px;
  color: var(--ink-soft);
}
.skin-item-state.is-equipped { color: var(--gw-blue); }
.skin-card-thumb {
  width: 44px;
  height: 44px;
  display: block;
  margin: 0 auto;
  image-rendering: pixelated;
  border: 2px solid var(--border-ink);
  border-radius: 6px;
  background: var(--gw-bg-deep);
}
.tracer-swatch {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--swatch, var(--gw-ink));
  border: 2px solid var(--border-ink);
  box-shadow: 0 2px 0 var(--border-ink);
}
.tracer-item-name { margin-top: 8px; }
.skin-unlock-btn:hover {
  filter: brightness(1.1);
}
.skin-unlock-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--border-ink);
}
.skin-item-card.is-dev-only {
  border-color: var(--flo) !important;
  box-shadow: 0 3px 0 var(--flo) !important;
}

/* The login sheet itself is theme.css's, the same on the plate. The lobby adds
   the callsign rule line and the admin sign-in under the tabs. */
.auth-field-rule {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gw-ink-muted);
}
.auth-text-input { user-select: text; -webkit-user-select: text; }
.auth-text-input[aria-invalid="true"] { border-color: var(--gw-status-danger); }

.admin-signin {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 2px dashed var(--gw-border-hairline);
}
.admin-signin__summary {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--gw-ink-muted);
  cursor: pointer;
  width: max-content;
}
.admin-signin__form,
.admin-signin__on {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.admin-signin__form[hidden],
.admin-signin__on[hidden] { display: none; }
.admin-signin__status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  min-height: 1em;
}

/* ================================================================ RESPONSIVE */
/* Up to 1100px: the docks turn into icon rails and the header wraps. */
@media (max-width: 1100px) {
  .dashboard-shell { padding: 16px 20px; }
  .dashboard-stage { grid-template-columns: 96px 1fr 96px; gap: 16px; }
  .dock-btn { width: 76px; height: 76px; }
  .room-ready-balloon { right: -8px; }
}

/* Up to 768px: one column. The stage first, the docks as a row that scrolls
   sideways under it, then the mode card and PLAY full width. */
@media (max-width: 768px) {
  .dashboard-shell { padding: 12px 16px 20px; gap: 12px; justify-content: flex-start; }
  .dashboard-header { justify-content: flex-start; }
  .header-right-actions { margin-left: auto; }
  .header-economy { order: 3; flex-basis: 100%; }
  .daily-match-meter { flex: 1 1 200px; }

  .dashboard-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }
  .center-stage { order: -1; }
  .side-dock {
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 2px 8px;
    scroll-snap-type: x proximity;
  }
  .side-dock--left, .side-dock--right { align-items: stretch; }
  .dock-btn { flex: none; width: 76px; height: 76px; scroll-snap-align: start; }

  /* The balloon leaves the stage's corner and sits above the figure, so the
     viewport stacks instead of laying the two side by side. */
  .character-viewport {
    width: min(260px, 72vw);
    aspect-ratio: auto;
    flex-direction: column;
  }
  #pixel-operator-canvas { height: auto; aspect-ratio: 340 / 420; }
  .room-ready-balloon {
    position: static;
    max-width: none;
    margin-bottom: 8px;
    justify-content: center;
  }
  .room-ready-balloon::after { display: none; }

  .dashboard-footer { flex-direction: column; align-items: stretch; gap: 14px; }
  .mode-selector-card { min-width: 0; width: 100%; }
  .pixel-play-btn { width: 100%; }
}

/* Up to 420px: the smallest phones. */
@media (max-width: 420px) {
  .lobby-rank { display: none; }
  .lobby-profile-chip .game-callsign { max-width: 110px; }
  .header-link-btn { display: none; }
  .tier-row { margin-left: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-headline { font-size: 11px; }
}

/* ---------- Locker inspection stage ---------- */
/* The one fixed light ink in the locker: text on a skin's own dark fill, or on
   a calling card's dark gradient. Those fills do not follow the theme, so
   neither can the ink on them. */
.cosmetics-modal-overlay { --locker-ink-on-dark: #EDEFE9; }
.inspect-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--card-bg);
  border: 2.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--border-ink);
}
.inspect-stage__canvas {
  width: 100%;
  height: 190px;
  display: block;
  border: 2px solid var(--border-ink);
  border-radius: 6px;
}
.inspect-stage__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.inspect-stage__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  color: var(--ink);
}
.stance-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.stance-toggle__btn {
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--border-ink);
  border-radius: 5px;
  box-shadow: 0 2px 0 var(--border-ink);
  cursor: pointer;
}
.stance-toggle__btn[aria-pressed="true"] {
  background: var(--blue);
  color: var(--gw-on-accent);
}
.stance-toggle__btn:focus-visible,
.inspect-stage__action:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.inspect-stage__action[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.skin-item-card.is-inspected {
  outline: 3px dashed var(--blue);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .inspect-stage { grid-template-columns: 1fr; }
  .inspect-stage__canvas { height: 170px; }
}
@media (max-width: 520px) {
  /* The two tabs, the balance and the close button do not fit one phone row. */
  .cosmetics-modal-card .drawer-header { flex-wrap: wrap; gap: 8px; }
  .cosmetics-modal-card .modal-header-tabs { order: 3; width: 100%; }
  .cosmetics-modal-card .modal-tab-btn { flex: 1; }
}

/* ---------- Calling cards tab ---------- */
.banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.banner-item-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px;
  text-align: left;
  color: var(--ink);
  background: var(--card-bg);
  border: 2.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--border-ink);
  cursor: pointer;
}
.banner-item-card.is-equipped {
  border-color: var(--blue);
  box-shadow: 0 4px 0 var(--blue);
}
.banner-item-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.banner-item-strip {
  display: block;
  padding: 8px 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--locker-ink-on-dark);
  border: 2px solid;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-item-state {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink-soft);
}
.banner-item-card.is-equipped .banner-item-state { color: var(--blue); }

/* ---------- First-visit walkthrough card ---------- */
.newcomer-card {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 560px;
  margin: 0 auto 12px;
  background: var(--card-bg);
  border: 2.5px solid var(--border-ink);
  border-radius: 8px;
  box-shadow: var(--gw-press-rest, 0 3px 0 var(--border-ink));
}
.newcomer-card[hidden] { display: none; }
.newcomer-card__go {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
}
.newcomer-card__eyebrow {
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.4;
  color: var(--gw-team-1-text, var(--ink));
}
.newcomer-card__line {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
}
.newcomer-card__close {
  min-width: 44px;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-left: 2px solid var(--border-ink);
  cursor: pointer;
}
.newcomer-card__go:focus-visible,
.newcomer-card__close:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- Locker: legibility and a steady frame (UX audit, 23 Sep) ---------- */
/* Gold on paper measured 1.35:1. The number is ink; the hexagon keeps the gold. */
.modal-header-token-badge { color: var(--ink); }
.modal-header-token-badge .token-icon { color: var(--gw-gold-shadow); }
/* The pixel face is unreadable under 10px, and the tabs must not wrap to three lines. */
.modal-tab-btn {
  font-size: 10px;
  line-height: 1.4;
  min-height: 44px;
}
.modal-tab-count { font-family: var(--font-mono); font-size: 11px; }
/* Anchored to the top rather than centred on its content, so switching tabs
   does not make the whole sheet jump up and down the screen. */
.cosmetics-modal-overlay {
  align-items: flex-start;
  padding-top: 6vh;
}
.cosmetics-modal-card { min-height: min(640px, 86vh); }
@media (max-width: 520px) {
  .cosmetics-modal-overlay { padding-top: 12px; }
  .cosmetics-modal-card .modal-header-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .cosmetics-modal-card .modal-tab-btn { padding: 8px 4px; }
}

/* ---------- Contrast fixes (UX audit, 23 Sep) ---------- */
/* Small text on a colour: vermilion and the skin colours are fills, not inks.
   Text sits in the fixed dark ink on them, which reads in both themes. */
.dock-btn__badge,
.skin-unlock-btn--admin,
.skin-unlock-btn.is-armed,
.help-sheet__tour.is-armed { color: var(--gw-on-yellow); }
/* The daily-cap count and the reset line are words, so they are inks. */
.meter-val { color: var(--gw-team-1-text); }
.meter-countdown { color: var(--gw-team-0-text); font-size: 10px; }
/* The stage line under the skin name: ink text, the skin's colour as a bar. */
.skin-tier-tag {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.4;
  border-left: 4px solid var(--tier-accent, var(--blue));
  padding-left: 6px;
}
/* Unaffordable or equipped: said at full strength, marked by the frame
   rather than faded to 55%, which measured about 3:1. */
.skin-unlock-btn[disabled],
.inspect-stage__action[disabled] {
  opacity: 1;
  color: var(--ink);
  background: var(--card-bg);
  border-style: dashed;
  box-shadow: none;
}

/* ---------- Pixel-face floor and touch targets (UX audit, 23 Sep) ---------- */
/* Press Start 2P is drawn on an 8-unit grid; below 10px its letters close up
   and two-line labels ("AIM / ACADEMY") touch. 10px and 1.4 line-height is the
   floor everywhere it is used in the lobby. */
.lobby-rank, .admin-badge, .theme-toggle-btn, .header-link-btn, .header-icon-btn,
.dock-btn__label, .pass-name, .pass-tag, .balloon-text, .balloon-btn,
.join-popover__label, .tier-btn, .setting-action-link, .meter-label,
.skin-unlock-btn, .skin-item-state, .stance-toggle__btn, .banner-item-state {
  font-size: 10px;
  line-height: 1.4;
}
.dock-btn__label { letter-spacing: 0.02em; }
/* The arrows are glyphs; in the pixel face they would fall back to Arial. */
.skin-arrow-btn { font-family: var(--font-mono); font-weight: 700; }

/* A fingertip is about 44px. On a touch screen every lobby control reaches
   that, even where the desktop layout draws it smaller. */
@media (pointer: coarse), (max-width: 600px) {
  .theme-toggle-btn, .header-link-btn, .header-icon-btn, .balloon-btn,
  .skin-arrow-btn, .stance-toggle__btn, .tier-btn {
    min-height: 44px;
  }
  .header-icon-btn, .skin-arrow-btn { min-width: 44px; }
}

/* ---------- Arena: open a room ---------- */
.room-sheet-card { max-width: 460px; }
.room-sheet__note { margin: 0 0 14px; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.room-sheet__option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--card-bg);
  border: 2px solid var(--border-ink);
  border-radius: 8px;
  cursor: pointer;
}
.room-sheet__option input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gw-blue); flex: none; }
.room-sheet__option strong { display: block; font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.room-sheet__option em { font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.room-sheet__go { width: 100%; min-height: 48px; margin-top: 4px; }

/* The dock's labels are words to read, not display type: in the pixel face at
   10px "OPERATORS" is wider than its tile. Mono, bold, and it fits. */
.dock-btn__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (pointer: coarse), (max-width: 600px) {
  .drawer-close-btn { min-width: 44px; min-height: 44px; }
}

/* ---------- Accounts in the sign-in sheet ---------- */
.acct-form { display: flex; flex-direction: column; gap: 6px; }
.acct-form[hidden] { display: none; }
.acct-status { min-height: 1.2em; margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--gw-team-1-text); }
.acct-status--warn { padding: 8px 10px; color: var(--ink); background: var(--gw-yellow); border: 2px solid var(--border-ink); border-radius: 6px; }
.acct-panel { display: flex; flex-direction: column; gap: 10px; }
.acct-panel[hidden] { display: none; }
.acct-panel__who { margin: 0; font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.acct-verified { display: inline-block; padding: 0 6px; font-family: var(--font-mono); font-size: 12px; color: var(--gw-on-accent); background: var(--gw-green, var(--blue)); border: 1.5px solid var(--border-ink); border-radius: 4px; }
.acct-details summary { cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--ink); min-height: 32px; display: flex; align-items: center; }
.acct-details[open] summary { margin-bottom: 6px; }
.acct-forgot { font-size: 12px; }

/* ========================================================= LEGAL LINKS ===== */
/* The credit to the original game and the privacy / terms / contact links,
   one quiet mono line under the launch bar. */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 16px;
  padding-top: 12px;
  font-family: var(--gw-font-mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--gw-ink-muted);
  text-align: center;
}
.legal-links__nav { display: flex; gap: 14px; }
.legal-links a {
  color: var(--gw-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-links a:hover { text-decoration-thickness: 2px; }
