@font-face {
  font-family: "VCR OSD Mono Nova";
  src: url("/fonts/VCROSDMonoNova.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/press-start-2p.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DigitalNumbers";
  src: url("/fonts/DigitalNumbers-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM 029 Key Punch";
  src: url("/fonts/IBM029KeyPunch-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --million-cell-size: 22px;
  --million-cell-gap: 4px;
  --opened-hole-scale: 0.92;
  --panel: rgba(18, 18, 18, 0.82);
  --line: rgba(255, 255, 255, 0.48);
  --line-soft: rgba(255, 255, 255, 0.18);
  --open-border: rgba(120, 95, 60, 0.14);
  --game-plate-background: rgba(255, 255, 255, 0.34);
  --game-plate-border-color: rgba(255, 255, 255, 0.42);
  --text: rgba(255, 255, 255, 0.96);
  --muted: rgba(255, 255, 255, 0.68);
  --hot: #ff7a18;
  --danger: #ff3f24;
  --green: #61e294;
  --font-vcr: "VCR OSD Mono Nova", "IBM 029 Key Punch", monospace;
  --font-pixel: "Press Start 2P", monospace;
  --ui-gap-xs: 4px;
  --ui-gap-sm: 8px;
  --ui-gap-md: 12px;
  --ui-gap-lg: 16px;
  --panel-padding: 12px;
  --panel-border: 2px solid var(--line);
  --panel-radius: 0;
}

* {
  box-sizing: border-box;
  border-radius: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #000;
  color: var(--text);
}

body,
.event-shell,
.hero-panel,
.stats-strip,
.target-panel,
.side-panel,
.terminal-banner,
.board-plate,
.map-shell,
.top-navigation-hud,
.navigation-dock,
.map-controls,
.map-area-bar,
.breadcrumb,
.depth-indicator,
.scale-bar,
.navigation-hint,
.hover-area-readout,
.pixel-button,
.nav-input-tab,
button,
label {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input,
textarea,
[contenteditable="true"],
[contenteditable=""],
.navigation-form input,
.jump-form input,
.name-form input,
.floating-dev-panel .diagnostics-output {
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

body,
button,
input {
  font-family: var(--font-vcr);
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.event-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.74)),
    radial-gradient(circle at 70% 0%, rgba(255, 122, 24, 0.24), transparent 32rem),
    radial-gradient(circle at 20% 100%, rgba(116, 183, 255, 0.14), transparent 28rem),
    #050505;
  overflow-x: hidden;
}

.hero-panel,
.stats-strip,
.action-limit-card,
.side-panel,
.terminal-banner,
.board-plate {
  border: 2px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.48);
}

.hero-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.brand-title {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 22px;
  line-height: 1.15;
  text-shadow:
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000,
    2px 2px 0 #000;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
}

.title-hot {
  color: var(--hot);
  text-shadow:
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000,
    2px 2px 0 #000,
    0 0 10px rgba(255, 122, 24, 0.42);
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border: 0;
  image-rendering: pixelated;
  box-shadow: none;
}

.brand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  flex: 0 0 auto;
  min-width: 74px;
  border: 1px solid rgba(97, 226, 148, 0.46);
  background: rgba(0, 0, 0, 0.46);
}

.language-switcher button {
  min-width: 0;
  min-height: 30px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
  cursor: pointer;
}

.language-switcher button.active {
  background: rgba(97, 226, 148, 0.18);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(97, 226, 148, 0.38);
}

.language-switcher.compact {
  min-width: 56px;
}

.language-switcher.compact button {
  min-height: 30px;
  padding: 0 5px;
  font-size: 9px;
}

.hero-grid {
  display: none;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: end;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 980px;
  font-family: var(--font-pixel);
  font-size: 42px;
  line-height: 1.45;
  text-transform: uppercase;
  text-shadow:
    3px 0 0 #000,
    -3px 0 0 #000,
    0 3px 0 #000,
    0 -3px 0 #000,
    3px 3px 0 #000;
}

.hero-panel p {
  margin-top: 12px;
  color: #fff;
  font-size: 18px;
  text-shadow: 2px 2px 0 #000;
}

.hero-panel small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.sector-readout {
  display: grid;
  gap: 6px;
  justify-items: end;
  padding: 14px;
  border: 2px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.34);
}

.sector-readout span,
.sector-readout em,
.stats-strip span,
.stats-strip small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
}

.sector-readout strong {
  color: var(--hot);
  font-family: "DigitalNumbers", var(--font-vcr);
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(20px, 2.25vw, 28px);
  line-height: 1;
  text-align: right;
  text-overflow: clip;
}

.terminal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
}

.terminal-banner h2 {
  font-size: 18px;
}

.terminal-failed {
  border-color: rgba(255, 63, 36, 0.9);
}

.terminal-cleared {
  border-color: rgba(97, 226, 148, 0.9);
}

.stats-strip {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
  overflow: visible;
}

.stats-strip div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 1px 10px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 46px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.stats-strip div:last-child {
  min-width: 0;
}

.stats-strip strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-family: "DigitalNumbers", var(--font-vcr);
  font-size: 22px;
  line-height: 0.95;
  color: #fff;
  max-width: 100%;
  white-space: nowrap;
}

.stats-strip span,
.stats-strip small {
  min-width: 0;
}

#progressReadout {
  font-size: 20px;
}

.mission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.field-column,
.left-column,
.side-stack {
  min-width: 0;
}

.left-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 12px;
}

.zoom-controls {
  display: grid;
  grid-template-columns: 42px 42px;
  gap: 8px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 220px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
}

.jump-form {
  display: grid;
  grid-template-columns: 84px 84px auto;
  gap: 8px;
  min-width: 0;
}

.jump-form input,
.address-form input {
  min-width: 0;
  height: 42px;
  border: 2px solid var(--line);
  padding: 0 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.area-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
  border: 2px solid var(--line-soft);
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.36);
}

.area-status {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}

.area-status span {
  display: block;
  color: var(--green);
  font-size: 12px;
  line-height: 1.35;
  text-transform: uppercase;
}

.area-status strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
}

.breadcrumb button:hover {
  background: rgba(255, 122, 24, 0.35);
}

.address-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mode-switch button,
.pixel-button {
  min-height: 42px;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow:
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000;
}

.mode-switch button + button {
  border-left: 2px solid var(--line);
}

.mode-switch button.active,
.pixel-button.hot {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(255, 122, 24, 0.72);
}

.pixel-button {
  border: 2px solid var(--line);
  padding: 0 14px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.42);
}

.pixel-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.42);
}

.pixel-button:disabled,
button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.55;
}

.error-line {
  margin-bottom: 12px;
  border: 2px solid rgba(255, 63, 36, 0.72);
  padding: 10px 12px;
  background: rgba(90, 0, 0, 0.32);
  color: #ffd4cc;
}

.board-plate {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 40, 64, 0.12)),
    url("/assets/ordinary/ordinary-run-background.png") center center / cover no-repeat,
    var(--game-plate-background);
  border-color: var(--game-plate-border-color);
  -webkit-backdrop-filter: blur(9px) saturate(118%);
  backdrop-filter: blur(9px) saturate(118%);
  aspect-ratio: 1 / 1;
  max-height: 76vh;
}

.board-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 0;
}

.board-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.map-shell {
  position: relative;
  --map-bottom-dock: 120px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 8px 8px var(--map-bottom-dock);
  background: rgba(6, 18, 44, 0.2);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M2 1h3v2h2v2h2v2h2v2h2v2h-3v2h-2v3H6v3H4v-3H2z' fill='%23ff7a18'/%3E%3Cpath d='M0 0h6v2h2v2h2v2h2v2h2v4h-3v2H9v3H7v3H3v-3H1V1H0zM3 2v13h2v-3h2V9h3V8H8V6H6V4H4V2z' fill='%23000000'/%3E%3Cpath d='M3 2v13h2v-3h2V9h3V8H8V6H6V4H4V2z' fill='%23ff7a18'/%3E%3C/svg%3E") 2 1, pointer;
  touch-action: none;
}

.map-shell:active {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' shape-rendering='crispEdges'%3E%3Cpath d='M2 1h3v2h2v2h2v2h2v2h2v2h-3v2h-2v3H6v3H4v-3H2z' fill='%23ff7a18'/%3E%3Cpath d='M0 0h6v2h2v2h2v2h2v2h2v4h-3v2H9v3H7v3H3v-3H1V1H0zM3 2v13h2v-3h2V9h3V8H8V6H6V4H4V2z' fill='%23000000'/%3E%3Cpath d='M3 2v13h2v-3h2V9h3V8H8V6H6V4H4V2z' fill='%23ff7a18'/%3E%3C/svg%3E") 2 1, pointer;
}

.map-controls {
  position: static;
  z-index: 14;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: 22px 24px 24px 24px;
  gap: 5px;
  width: 100%;
  height: 112px;
  min-width: 0;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.42);
  padding: 8px;
  background: rgba(3, 5, 8, 0.78);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  cursor: default;
  pointer-events: auto;
  overflow: hidden;
}

.map-controls .mode-switch {
  display: none;
}

.control-coordinates {
  grid-column: 1 / -1;
  min-width: 0;
  border: 2px solid var(--line-soft);
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.54);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.map-controls .zoom-controls {
  display: grid;
  grid-column: 1 / 2;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  min-width: 0;
}

.quick-zoom-buttons {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
}

.quick-zoom-buttons button {
  min-width: 0;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0 2px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font-family: var(--font-vcr);
  font-size: 9px;
  line-height: 1;
  text-shadow: 1px 1px 0 #000;
}

.quick-zoom-buttons button.active {
  border-color: rgba(97, 226, 148, 0.78);
  background: rgba(97, 226, 148, 0.18);
  color: #fff;
}

.map-controls .jump-form {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  gap: 5px;
  min-width: 0;
}

.map-controls .pixel-button,
.map-controls input {
  min-height: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 9px;
}

.map-controls .hot {
  grid-column: 1 / -1;
}

.depth-indicator,
.navigation-hint,
.scale-bar {
  position: absolute;
  z-index: 12;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.88);
  pointer-events: none;
  text-shadow: 1px 1px 0 #000;
}

.depth-indicator {
  top: 10px;
  left: 10px;
  display: grid;
  gap: 4px;
  width: min(300px, calc(100% - 20px));
  padding: 7px 8px;
  font-size: 10px;
}

.depth-indicator strong {
  color: var(--green);
  font-weight: 400;
  text-transform: uppercase;
}

.depth-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
}

.depth-step {
  min-width: 0;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  padding-top: 3px;
  color: rgba(255, 255, 255, 0.54);
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.depth-step.active {
  border-color: var(--green);
  color: #fff;
}

.navigation-hint {
  left: 10px;
  top: 62px;
  bottom: auto;
  max-width: min(360px, calc(100% - 28px));
  padding: 7px 9px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  line-height: 1.3;
}

.scale-bar {
  left: 10px;
  top: 104px;
  bottom: auto;
  min-width: 130px;
  padding: 6px 8px 8px;
  font-size: 10px;
}

.scale-bar.quiet {
  opacity: 0.58;
}

.scale-bar-line {
  display: block;
  height: 7px;
  margin-top: 4px;
  border-left: 2px solid rgba(255, 255, 255, 0.82);
  border-right: 2px solid rgba(255, 255, 255, 0.82);
  border-bottom: 2px solid rgba(255, 255, 255, 0.82);
}

.field-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.map-corner-info {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 13;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: stretch;
  gap: 8px;
  width: min(calc(100% - 8px), 410px);
  pointer-events: none;
}

.map-zoom-hud {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 13;
  display: flex;
  pointer-events: none;
}

.map-zoom-hud span {
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.68);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  text-shadow: 1px 1px 0 #000;
}

.map-tooltip {
  position: absolute;
  z-index: 4;
  max-width: min(310px, calc(100% - 24px));
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: 9px 10px;
  background: rgba(0, 0, 0, 0.78);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.38;
  pointer-events: none;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.42);
  display: none;
}

.map-tooltip strong {
  display: block;
  color: #fff;
  font-weight: 400;
}

.minimap {
  position: static;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(0, 0, 0, 0.56);
  pointer-events: none;
  align-self: end;
  justify-self: end;
}

.board-scroll-layer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.board-transform-layer {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.board-scroll {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(33, 74, 126, 0.22);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) rgba(0, 0, 0, 0.14);
}

.sector-board {
  display: inline-grid;
  grid-template-columns: repeat(100, var(--million-cell-size));
  grid-auto-rows: var(--million-cell-size);
  width: max-content;
  min-width: max-content;
  height: max-content;
  min-height: max-content;
  gap: var(--million-cell-gap);
  padding: 10px;
  background: transparent;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--million-cell-size);
  height: var(--million-cell-size);
  min-width: var(--million-cell-size);
  min-height: var(--million-cell-size);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: url("/assets/ordinary/cell-closed.png") center / cover no-repeat;
  image-rendering: pixelated;
  color: #2f2417;
  font-size: 14px;
  font-weight: 800;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}

.cell:not(:disabled):hover {
  filter: brightness(1.2);
}

.cell:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 1;
}

.cell-content {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  white-space: pre;
  font-family: "IBM 029 Key Punch", "Montserrat", sans-serif;
  font-size: 6px;
  font-weight: 400;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(0, 0, 0, 0.22);
  transform: rotate(0deg);
  transform-origin: center;
  transition: transform 160ms ease-out;
  will-change: transform;
}

.cell-open {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.cell-open::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: calc(var(--million-cell-size) * var(--opened-hole-scale));
  height: calc(var(--million-cell-size) * var(--opened-hole-scale));
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(198, 224, 244, 0.3);
  pointer-events: none;
}

.cell-open.n-0::before {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
}

.cell-open.n-0 .cell-content {
  font-size: 0;
}

.cell-flagged {
  border-radius: 0;
  background: url("/assets/ordinary/cell-flag.png") center / cover no-repeat;
}

.cell-exploded {
  border-radius: 0;
  background: url("/assets/ordinary/cell-exploded-mine.png") center / cover no-repeat;
}

.cell-open.n-1,
.cell-open.n-2,
.cell-open.n-3,
.cell-open.n-4,
.cell-open.n-5,
.cell-open.n-6,
.cell-open.n-7,
.cell-open.n-8 {
  color: rgba(255, 255, 255, 0.9);
}

.side-stack {
  display: grid;
  gap: 14px;
}

.side-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.side-panel h2 {
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.7;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
}

.name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.name-form input {
  min-width: 0;
  height: 42px;
  border: 2px solid var(--line-soft);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.player-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.action-limit-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-height: 46px;
  border: 2px solid var(--line-soft);
  padding: 6px 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.44);
  overflow: hidden;
}

.action-limit-card span,
.action-limit-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
  text-transform: uppercase;
}

.action-limit-card strong {
  color: #fff;
  font-family: var(--font-vcr);
  font-size: 14px;
  line-height: 1.2;
  white-space: normal;
}

.action-limit-card strong.resting {
  color: var(--hot);
}

.action-limit-card small {
  white-space: pre-line;
}

.backup-rest-highlight {
  box-shadow:
    0 0 0 2px rgba(85, 255, 156, 0.36),
    0 0 18px rgba(85, 255, 156, 0.22);
}

.leaderboard {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.leaderboard li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.leaderboard span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard strong {
  color: var(--green);
}

.leaderboard em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.action-log {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.35;
}

.action-log p {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 7px;
}

.reset-button {
  width: 100%;
}

.dev-panel {
  display: grid;
}

.target-panel strong,
.target-panel span {
  display: block;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
}

.target-panel strong {
  color: #fff;
  font-size: 13px;
}

.target-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.35;
}

.target-label {
  margin-top: 2px;
  color: var(--green);
  text-transform: uppercase;
}

.target-panel span {
  color: var(--muted);
  font-size: 11px;
}

.hint-stack {
  display: grid;
  gap: 8px;
}

.hint-card {
  position: relative;
  border: 1px solid rgba(85, 255, 156, 0.42);
  padding: 10px 34px 10px 10px;
  background: rgba(0, 0, 0, 0.54);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.35;
}

.hint-card strong,
.hint-card span {
  display: block;
}

.hint-card strong {
  margin-bottom: 3px;
  color: var(--green);
}

.hint-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font: 12px/1 var(--font-vcr);
}

.diagnostics-output {
  max-height: 160px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line-soft);
  padding: 8px;
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.82);
  font: 10px/1.35 var(--font-vcr);
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  border: 2px solid var(--line);
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.86);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.46);
}

@media (max-width: 980px) {
  .event-shell {
    padding: 14px;
  }

  .hero-grid,
  .mission-layout {
    grid-template-columns: 1fr;
  }

  .sector-readout {
    justify-items: start;
  }

  .stats-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stats-strip div,
  .stats-strip div:last-child {
    min-width: 0;
    min-height: 46px;
    border: 2px solid var(--line-soft);
    padding: 6px 10px;
  }

  .stats-strip div:last-child {
    min-height: 46px;
  }

  .stats-strip strong {
    font-size: 22px;
    overflow-wrap: normal;
    white-space: nowrap;
  }

  #progressReadout {
    font-size: 20px;
  }

  .area-bar {
    margin-top: 0;
  }

  .area-status span,
  .area-status strong {
    line-height: 1.3;
  }
}

@media (max-width: 620px) {
  :root {
    --million-cell-size: 20px;
    --million-cell-gap: 4px;
  }

  .field-column {
    display: flex;
    flex-direction: column;
  }

  .left-column {
    display: contents;
  }

  .target-panel {
    order: 1;
  }

  .game-board-plate {
    order: 2;
  }

  .hint-stack {
    order: 3;
  }

  .stats-strip {
    order: 4;
  }

  .area-bar {
    order: 5;
  }

  .dev-panel {
    order: 6;
  }

  .hero-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px;
  }

  .brand-row {
    gap: 8px;
    font-size: 9px;
  }

  .brand-avatar {
    width: 24px;
    height: 24px;
  }

  .brand-title {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.15;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 16px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
  }

  .hero-panel,
  .side-panel {
    padding: 12px;
  }

  .toolbar,
  .terminal-banner {
    align-items: stretch;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .area-bar {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    width: 100%;
  }

  .zoom-controls {
    grid-template-columns: 1fr 1fr;
  }

  .jump-form {
    grid-template-columns: 1fr 1fr 58px;
  }

  .stats-strip {
    gap: 8px;
  }

  .stats-strip div {
    min-height: 44px;
  }

  .stats-strip strong {
    font-size: 20px;
  }

  #progressReadout {
    font-size: 17px;
  }

  .area-bar {
    padding: 8px;
  }

  .area-status span {
    font-size: 10px;
  }

  .area-status strong {
    font-size: 12px;
  }

  .board-scroll {
    max-height: none;
  }

  .cell-content {
    font-size: 5.35px;
  }

  .player-stats,
  .name-form {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .event-shell {
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    gap: 8px;
    height: 100vh;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .hero-panel,
  .stats-strip,
  .side-panel,
  .terminal-banner,
  .board-plate {
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  }

  .hero-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: 12px;
    min-height: 0;
    padding: 5px 10px;
    overflow: hidden;
  }

  .brand-row {
    gap: 8px;
    min-width: 0;
    font-size: 9px;
  }

  .brand-title {
    font-size: 22px;
  }

  .brand-avatar {
    width: 22px;
    height: 22px;
  }

  .hero-grid {
    display: none;
  }

  h1 {
    display: none;
  }

  .hero-panel p {
    display: none;
  }

  .hero-panel small {
    display: none;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .sector-readout {
    display: none;
  }

  .stats-strip {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 6px;
    margin-top: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .stats-strip div {
    width: auto;
    min-width: 0;
    min-height: 42px;
    aspect-ratio: auto;
    padding: 6px 9px;
    border: 2px solid var(--line-soft);
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.01)),
      rgba(0, 0, 0, 0.44);
  }

  .stats-strip div:last-child {
    min-width: 0;
    min-height: 42px;
  }

  .stats-strip span,
  .stats-strip small {
    font-size: 9px;
    line-height: 1.15;
  }

  .stats-strip strong {
    align-self: center;
    overflow-wrap: normal;
    font-size: clamp(17px, 1.55vw, 22px);
    line-height: 0.95;
    white-space: nowrap;
  }

  #progressReadout {
    font-size: clamp(16px, 1.35vw, 19px);
  }

  .mission-layout {
    display: grid;
    grid-template-columns: clamp(260px, 16vw, 304px) minmax(0, 1fr) clamp(292px, 18vw, 344px);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    margin-top: 0;
    align-items: stretch;
  }

  .field-column {
    display: contents;
  }

  .left-column {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto auto;
    gap: 8px;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
  }

  .left-column::-webkit-scrollbar {
    display: none;
  }

  .toolbar {
    grid-column: auto;
    grid-row: auto;
    align-self: start;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 0;
    border: 2px solid var(--line-soft);
    padding: 8px;
    background: rgba(0, 0, 0, 0.42);
    overflow: hidden;
  }

  .map-controls {
    position: static;
    left: auto;
    top: auto;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: 24px 28px 28px;
    gap: 5px;
    width: 100%;
    height: 112px;
    margin: 0;
    padding: 8px;
  }

  .map-controls .mode-switch {
    display: none;
  }

  .map-controls .zoom-controls {
    grid-template-columns: 1fr 1fr;
  }

  .map-controls .jump-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  }

  .mode-switch {
    width: 100%;
  }

  .zoom-controls {
    grid-template-columns: 1fr 1fr;
  }

  .jump-form {
    grid-template-columns: 1fr 1fr 48px;
  }

  .area-bar {
    grid-column: auto;
    grid-row: auto;
    align-self: start;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 0;
    padding: 8px;
    max-height: none;
    overflow: auto;
  }

  .toolbar,
  .area-bar {
    border-color: rgba(255, 255, 255, 0.34);
  }

  .area-status {
    gap: 5px;
  }

  .area-status strong {
    font-size: 12px;
    line-height: 1.25;
  }

  .area-status span,
  .breadcrumb,
  .address-form input {
    font-size: 10px;
  }

  .breadcrumb {
    gap: 3px;
    font-size: 11px;
  }

  .breadcrumb button {
    padding: 2px 5px;
  }

  .address-form {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .address-form input {
    padding: 0 7px;
  }

  .copy-row {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .copy-row .pixel-button {
    padding: 0 6px;
    font-size: 10px;
  }

  .pixel-button,
  .mode-switch button {
    white-space: normal;
    line-height: 1.12;
  }

  .jump-form input {
    font-size: 10px;
  }

  .error-line {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    z-index: 5;
    margin: 8px;
  }

  .board-plate {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    width: min(100%, calc(100vh - 66px));
    height: min(100%, calc(100vh - 66px));
    max-height: none;
    padding: 6px;
    background:
      url("/assets/ordinary/ordinary-run-background.png") center center / cover no-repeat,
      rgba(8, 18, 36, 0.2);
    border-color: rgba(255, 122, 24, 0.38);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .board-plate::after {
    display: none;
  }

  .map-shell {
    background: rgba(4, 13, 32, 0.2);
  }

  .map-hud {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 5px;
    flex-wrap: wrap;
  }

  .map-hud span {
    min-width: 0;
    padding: 5px 7px;
    font-size: 11px;
  }

  .minimap {
    width: 112px;
    height: 112px;
  }

.map-corner-info {
  left: 8px;
  right: 0;
  bottom: 8px;
    grid-template-columns: minmax(0, 1fr) 112px;
    align-items: stretch;
    gap: 8px;
    width: min(calc(100% - 8px), 410px);
  }

  .map-tooltip {
    max-width: min(360px, calc(100% - 20px));
  }

  .side-stack {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
  }

  .side-panel {
    min-width: 0;
    min-height: 0;
    padding: 8px;
    gap: 6px;
    overflow: auto;
    overflow-wrap: anywhere;
    scrollbar-width: none;
  }

  .side-panel::-webkit-scrollbar {
    display: none;
  }

  .side-panel h2 {
    font-size: 10px;
    line-height: 1.45;
  }

  .name-form {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .name-form input,
  .jump-form input,
  .address-form input {
    height: 31px;
  }

  .name-form input {
    font-size: 11px;
  }

  .name-form .pixel-button,
  .side-panel .pixel-button {
    min-width: 0;
    padding: 0 8px;
  }

  .mode-switch button,
  .pixel-button {
    min-height: 31px;
    font-size: 10px;
  }

  .player-stats {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 10px;
  }

  .leaderboard,
  .action-log {
    min-height: 0;
    max-height: none;
    overflow: auto;
    scrollbar-width: none;
  }

  .leaderboard::-webkit-scrollbar,
  .action-log::-webkit-scrollbar,
  .area-bar::-webkit-scrollbar {
    display: none;
  }

  .leaderboard li {
    min-width: 0;
    gap: 0 8px;
    padding-bottom: 6px;
    font-size: 11px;
  }

  .leaderboard span,
  .action-log p {
    min-width: 0;
  }

  .leaderboard em,
  .action-log {
    font-size: 10px;
  }

  .action-log {
    align-content: start;
    line-height: 1.28;
  }

  .action-log p {
    padding-bottom: 5px;
  }

  .dev-panel {
    grid-template-columns: 1fr 1fr;
    min-height: 76px;
  }

  .dev-panel h2 {
    grid-column: 1 / -1;
  }

  .terminal-banner {
    position: fixed;
    left: 50%;
    top: 94px;
    z-index: 20;
    width: min(640px, calc(100vw - 40px));
    transform: translateX(-50%);
    margin-top: 0;
  }
}

.floating-dev-panel {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 40;
  width: min(260px, calc(100vw - 28px));
  max-height: min(74vh, 680px);
  overflow: auto;
  resize: both;
  user-select: none;
}

.floating-dev-panel.collapsed {
  width: auto;
  max-height: none;
  overflow: visible;
  resize: none;
}

.floating-dev-panel.collapsed > :not(.dev-panel-handle) {
  display: none;
}

.floating-dev-panel.collapsed .dev-panel-handle {
  margin: 0;
  border: 1px solid var(--line-soft);
  padding: 7px 9px;
  background: rgba(3, 5, 8, 0.86);
}

.floating-dev-panel.collapsed:hover,
.floating-dev-panel.collapsed:focus-within {
  width: min(260px, calc(100vw - 28px));
  max-height: min(74vh, 680px);
  overflow: auto;
  resize: both;
}

.floating-dev-panel.collapsed:hover > :not(.dev-panel-handle),
.floating-dev-panel.collapsed:focus-within > :not(.dev-panel-handle) {
  display: block;
}

.floating-dev-panel .pixel-button,
.floating-dev-panel .diagnostics-output {
  user-select: text;
}

.dev-panel-handle {
  margin: -4px -4px 2px;
  border-bottom: 1px solid var(--line-soft);
  padding: 4px;
  cursor: move;
  color: var(--hot);
}

.floating-dev-panel.dragging {
  opacity: 0.92;
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.62);
}

.map-corner-info {
  left: 8px;
  right: 8px;
  bottom: 8px;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 360px) 112px;
  gap: 10px;
  width: auto;
  align-items: end;
  height: 112px;
  max-height: 112px;
}

.map-window {
  border: 2px solid rgba(255, 255, 255, 0.42);
  background: rgba(3, 5, 8, 0.78);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  cursor: default;
  pointer-events: auto;
}

.map-controls {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr);
  grid-template-rows: 18px 22px 22px 24px;
  height: 112px;
  min-height: 112px;
  max-height: 112px;
  gap: 3px;
  align-self: end;
  margin: 0;
  padding: 6px;
  overflow: hidden;
}

.map-area-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 24px 24px;
  gap: 3px;
  height: 112px;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.42);
  padding: 6px;
  background: rgba(3, 5, 8, 0.78);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  overflow: hidden;
  pointer-events: auto;
}

.map-area-bar .area-status {
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

.map-area-bar .area-status span {
  font-size: 8px;
  line-height: 1.1;
}

.map-area-bar .area-status strong {
  font-size: 10px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.map-area-bar .area-status em,
.map-area-bar .area-status small {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.66);
  font-size: 8px;
  font-style: normal;
  line-height: 1.05;
  text-overflow: clip;
  white-space: nowrap;
}

.map-area-bar .area-status small {
  color: rgba(97, 226, 148, 0.82);
}

.map-area-bar .breadcrumb {
  gap: 3px;
  font-size: 9px;
  max-height: 18px;
  overflow: hidden;
}

.map-area-bar .breadcrumb button {
  padding: 1px 4px;
}

.map-area-bar .address-form {
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 4px;
}

.map-area-bar .copy-row {
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.map-area-bar .address-form input,
.map-area-bar .pixel-button {
  height: 24px;
  min-height: 24px;
  font-size: 8px;
  padding: 0 5px;
}

.control-coordinates {
  grid-column: 1 / 3;
  grid-row: 1;
  height: 18px;
  border-width: 1px;
  padding: 3px 5px;
  font-size: 9px;
}

.control-zoom-readout {
  grid-column: 3;
  grid-row: 1;
  height: 18px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  padding: 3px 5px;
  background: rgba(0, 0, 0, 0.54);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
}

.map-controls .zoom-controls {
  grid-column: 1 / 2;
  grid-row: 2;
}

.map-controls .quick-zoom-buttons {
  grid-column: 2 / -1;
  grid-row: 2;
  gap: 3px;
}

.map-controls .jump-form {
  grid-column: 2 / -1;
  grid-row: 3;
}

.map-controls .hot {
  grid-column: 1 / -1;
  grid-row: 4;
}

.map-zoom-hud {
  display: none;
}

@media (max-width: 720px) {
  .map-corner-info {
    grid-template-columns: minmax(0, 1fr) 86px;
    grid-template-rows: auto auto;
    width: min(calc(100% - 8px), 100%);
    max-height: 214px;
  }

  .map-area-bar {
    grid-column: 1 / -1;
    height: 92px;
  }

  .map-controls {
    grid-column: 1;
    grid-row: 2;
    min-height: 112px;
    max-height: 112px;
  }

  .minimap {
    grid-column: 2;
    grid-row: 2;
    width: 86px;
    height: 112px;
  }

  .map-controls {
    grid-template-columns: 44px 44px minmax(0, 1fr);
    grid-template-rows: 20px 22px 22px 24px;
    padding: 6px;
    gap: 4px;
  }

.map-controls .pixel-button,
.map-controls input {
  height: 22px;
  min-height: 22px;
  font-size: 8px;
  padding: 0 4px;
}

.map-controls .zoom-controls .pixel-button,
.map-controls .jump-form .pixel-button {
  height: 22px;
  min-height: 22px;
}

.map-controls .hot {
  height: 24px;
  min-height: 24px;
  line-height: 1;
}

.quick-zoom-buttons button {
  height: 22px;
  font-size: 8px;
}

  .quick-zoom-buttons button {
    font-size: 8px;
  }

  .depth-indicator {
    width: min(260px, calc(100% - 20px));
    font-size: 9px;
  }

  .navigation-hint {
    display: none;
  }

  .scale-bar {
    display: none;
  }

  .floating-dev-panel {
    display: none !important;
  }
}

/* UX regrouping: mission column, social column, one navigation dock. */
.brand-subtitle {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mission-column {
  align-content: start;
}

.target-panel {
  border-color: rgba(255, 122, 24, 0.52);
}

.target-panel .pixel-button.hot {
  min-height: 46px;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.35;
}

.johnny-core-panel {
  gap: 10px;
  border-color: rgba(255, 207, 74, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 122, 24, 0.13), rgba(0, 0, 0, 0) 56%),
    rgba(0, 0, 0, 0.58);
}

.core-meter-readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.core-meter-readout strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-meter-readout span,
.core-recent-bang {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-transform: uppercase;
}

.core-progress {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.5);
}

.core-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background:
    linear-gradient(90deg, #61e294, #ffcf4a 58%, #ff7a18);
  transition: width 180ms ease;
}

.johnny-core-panel p,
.mobile-core-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.35;
}

.core-vote-options {
  display: grid;
  gap: 7px;
}

.core-vote-option {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(255, 207, 74, 0.35);
  padding: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.core-vote-option:hover,
.core-vote-option:focus-visible,
.core-vote-option.selected {
  border-color: rgba(255, 207, 74, 0.84);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 207, 74, 0.16);
}

.core-vote-option span {
  color: #ffcf4a;
  font-size: 10px;
  line-height: 1.25;
  text-transform: uppercase;
}

.core-vote-option strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.2;
}

.core-vote-option small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.hint-highlight {
  box-shadow:
    4px 4px 0 rgba(0, 0, 0, 0.42),
    0 0 0 2px rgba(97, 226, 148, 0.34),
    0 0 18px rgba(97, 226, 148, 0.18);
}

.moves-panel {
  gap: 8px;
}

.action-mode-switch {
  width: 100%;
}

.action-mode-switch button {
  min-height: 34px;
  font-size: 11px;
}

.player-panel #initialZeroButton {
  margin-top: 2px;
}

.map-shell {
  --map-bottom-dock: 144px;
}

.map-corner-info.navigation-dock-wrap {
  left: 8px;
  right: 8px;
  bottom: 8px;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  width: auto;
  height: auto;
  max-height: none;
  align-items: end;
}

.navigation-dock {
  display: grid;
  grid-template-rows: minmax(0, 46px) minmax(0, 70px);
  gap: 6px;
  min-width: 0;
  height: 126px;
  padding: 7px;
  overflow: hidden;
  pointer-events: auto;
}

.dock-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(126px, 178px);
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.navigation-dock .area-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 2px 8px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.navigation-dock .area-status span {
  color: var(--green);
  font-size: 9px;
  line-height: 1.05;
  text-transform: uppercase;
}

.navigation-dock .area-status strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  line-height: 1.05;
  text-overflow: clip;
  white-space: nowrap;
}

.navigation-dock .area-status em,
.navigation-dock .area-status small {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.66);
  font-size: 8px;
  font-style: normal;
  line-height: 1.05;
  text-overflow: clip;
  white-space: nowrap;
}

.navigation-dock .area-status small {
  color: rgba(97, 226, 148, 0.82);
}

.navigation-dock .breadcrumb {
  grid-column: 1 / -1;
  flex-wrap: nowrap;
  gap: 3px;
  max-width: 100%;
  max-height: 17px;
  overflow: hidden;
  font-size: 9px;
  white-space: nowrap;
}

.navigation-dock .breadcrumb button {
  flex: 0 0 auto;
  padding: 1px 4px;
}

.control-readouts {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.control-readouts span {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  padding: 4px 5px;
  background: rgba(0, 0, 0, 0.54);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.dock-action-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) 54px minmax(0, 1fr) 112px;
  grid-template-rows: 30px 34px;
  grid-template-areas:
    "form zoom quick quick"
    "copy copy copy backup";
  gap: 4px;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
}

.navigation-form {
  grid-area: form;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 42px;
  gap: 4px;
  min-width: 0;
}

.nav-input-tabs {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  min-width: 0;
}

.nav-input-tab {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0 3px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-family: var(--font-vcr);
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}

.nav-input-tab.active {
  border-color: rgba(97, 226, 148, 0.78);
  background: rgba(97, 226, 148, 0.18);
  color: #fff;
}

.navigation-form input,
.navigation-form .pixel-button,
.dock-action-row .pixel-button {
  min-height: 0;
  height: auto;
  padding: 0 5px;
  font-size: 9px;
  line-height: 1.05;
}

.coordinate-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
}

.navigation-form input {
  width: 100%;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.navigation-dock .zoom-controls {
  grid-area: zoom;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 0;
}

.navigation-dock .quick-zoom-buttons {
  grid-area: quick;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
}

.navigation-dock .quick-zoom-buttons button {
  height: auto;
  min-height: 0;
  font-size: 8px;
}

.navigation-dock .copy-row {
  grid-area: copy;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 0;
}

.navigation-dock #backupButton {
  grid-area: backup;
  min-width: 0;
  font-family: var(--font-pixel);
  font-size: 9px;
}

.navigation-dock-wrap .minimap {
  width: 112px;
  height: 126px;
}

.scale-bar {
  top: 64px;
}

.navigation-hint {
  top: 108px;
  max-width: min(460px, calc(100% - 24px));
  padding: 6px 8px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

@media (min-width: 981px) {
  .event-shell {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  .hero-panel {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  }

  .brand-subtitle {
    justify-self: end;
    max-width: 520px;
    font-size: 11px;
  }

  .left-column {
    grid-template-rows: auto auto auto;
  }

  .side-stack {
    grid-template-rows: auto auto minmax(0, 0.95fr) minmax(0, 0.9fr);
  }
}

@media (max-width: 980px) {
  .brand-subtitle {
    margin-left: 36px;
  }

  .mission-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-shell {
    --map-bottom-dock: 190px;
  }

  .map-corner-info.navigation-dock-wrap {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 8px;
  }

  .navigation-dock {
    grid-template-rows: minmax(0, 52px) minmax(0, 88px);
    height: 152px;
  }

  .dock-status-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .control-readouts {
    display: flex;
  }

  .control-readouts span {
    flex: 1 1 0;
  }

  .dock-action-row {
    grid-template-columns: minmax(160px, 1fr) 52px minmax(0, 0.9fr) 108px;
  }

  .navigation-dock-wrap .minimap {
    width: 96px;
    height: 152px;
  }
}

@media (max-width: 720px) {
  .map-shell {
    --map-bottom-dock: 248px;
  }

  .map-corner-info.navigation-dock-wrap {
    left: 6px;
    right: 6px;
    bottom: 6px;
    grid-template-columns: minmax(0, 1fr) 82px;
    grid-template-rows: auto auto;
    gap: 6px;
    width: auto;
    max-height: none;
  }

  .navigation-dock {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-rows: minmax(0, 58px) minmax(0, 126px);
    height: 198px;
    padding: 6px;
  }

  .dock-action-row {
    grid-template-columns: 54px minmax(0, 1fr) minmax(96px, 0.52fr);
    grid-template-rows: 30px 26px 30px 30px;
    grid-template-areas:
      "form form form"
      "zoom quick quick"
      "copy copy backup"
      "copy copy backup";
    gap: 4px;
  }

  .navigation-form {
    grid-area: form;
    grid-template-columns: 58px minmax(0, 1fr) 38px;
  }

  .navigation-dock .zoom-controls {
    grid-area: zoom;
  }

  .navigation-dock .quick-zoom-buttons {
    grid-area: quick;
    grid-template-columns: repeat(6, 48px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .navigation-dock .quick-zoom-buttons::-webkit-scrollbar {
    display: none;
  }

  .navigation-dock .copy-row {
    grid-area: copy;
    grid-template-columns: 1fr 1fr;
  }

  .navigation-dock #backupButton {
    grid-area: backup;
    font-size: 8px;
  }

  .navigation-dock-wrap .minimap {
    grid-column: 2;
    grid-row: 2;
    width: 82px;
    height: 82px;
  }

  .navigation-hint,
  .scale-bar {
    display: none;
  }
}

@media (max-width: 620px) {
  .event-shell {
    padding: 10px;
  }

  .brand-subtitle {
    margin-left: 32px;
    font-size: 9px;
    white-space: normal;
  }

  .mission-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .field-column {
    display: contents;
  }

  .left-column {
    display: contents;
  }

  .game-board-plate {
    order: 1;
  }

  .target-panel {
    order: 2;
  }

  .hint-stack {
    order: 3;
  }

  .stats-strip {
    order: 5;
  }

  .side-stack {
    order: 4;
    gap: 10px;
  }

  .player-panel {
    order: 2;
  }

  .moves-panel {
    order: 1;
  }

  .side-stack > .side-panel:not(.moves-panel):not(.player-panel) {
    order: 3;
  }

  .player-stats {
    grid-template-columns: 1fr 1fr;
  }

  .action-mode-switch {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .map-shell {
    --map-bottom-dock: 226px;
  }

  .navigation-dock {
    grid-template-rows: minmax(0, 58px) minmax(0, 110px);
    height: 180px;
  }

  .dock-action-row {
    grid-template-rows: 26px 22px 26px 26px;
  }

  .navigation-dock .area-status {
    grid-template-columns: minmax(0, 1fr);
  }

  .navigation-dock .area-status small {
    display: none;
  }

  .navigation-dock .breadcrumb {
    display: none;
  }

  .navigation-dock .quick-zoom-buttons {
    grid-template-columns: repeat(6, 44px);
  }

  .control-readouts span {
    font-size: 8px;
  }

  .navigation-form {
    grid-template-columns: 52px minmax(0, 1fr) 36px;
  }

  .nav-input-tab,
  .navigation-form input,
  .navigation-form .pixel-button,
  .dock-action-row .pixel-button {
    font-size: 8px;
  }

  .navigation-dock .copy-row {
    grid-template-columns: 1fr;
  }

  .navigation-dock-wrap .minimap {
    width: 64px;
    height: 64px;
  }
}

/* Navigation dock hierarchy pass. */
.map-shell {
  --map-bottom-dock: 150px;
}

.navigation-dock {
  position: relative;
  grid-template-rows: 40px 32px 34px;
  gap: 5px;
  height: 132px;
  padding: 8px;
}

.dock-status-row {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  grid-template-rows: 18px 17px;
  gap: 4px 7px;
  align-items: center;
  align-content: start;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.dock-mode,
.dock-readout {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.36);
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  line-height: 1;
  text-overflow: clip;
  text-shadow: 1px 1px 0 #000;
  text-transform: uppercase;
  white-space: nowrap;
}

.dock-mode {
  grid-column: 1;
  grid-row: 1;
  color: var(--green);
}

#coordReadout {
  grid-column: 2;
  grid-row: 1;
}

#zoomReadout {
  grid-column: 3;
  grid-row: 1;
}

.inside-status {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  text-shadow: 1px 1px 0 #000;
}

.inside-status strong {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.68);
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
}

.navigation-dock .breadcrumb {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 3px;
  min-width: 0;
  max-height: none;
  overflow: hidden;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.navigation-dock .breadcrumb span {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.38);
}

.navigation-dock .breadcrumb button {
  flex: 0 0 auto;
  min-width: 0;
  border: 0;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.navigation-dock .breadcrumb button:hover {
  background: rgba(255, 122, 24, 0.28);
}

.dock-view-readout {
  display: none !important;
}

.dock-hover-readout {
  position: absolute;
  left: 8px;
  top: 34px;
  z-index: 2;
  max-width: calc(100% - 16px);
  overflow: hidden;
  color: rgba(97, 226, 148, 0.64);
  font-size: 8px;
  line-height: 1;
  text-overflow: clip;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.dock-input-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) 56px minmax(150px, 0.8fr);
  gap: 5px;
  min-width: 0;
  min-height: 0;
}

.navigation-form {
  grid-area: auto;
  grid-template-columns: 66px minmax(0, 1fr) 44px;
}

.navigation-form .pixel-button {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(255, 122, 24, 0.48);
}

.nav-input-tabs {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.nav-input-tab {
  font-size: 8px;
}

.navigation-dock .zoom-controls,
.navigation-dock .quick-zoom-buttons,
.navigation-dock .copy-row,
.navigation-dock #backupButton {
  grid-area: auto;
}

.navigation-dock .zoom-controls {
  gap: 3px;
}

.navigation-dock .quick-zoom-buttons {
  gap: 2px;
  opacity: 0.88;
}

.navigation-dock .quick-zoom-buttons button {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.035);
  font-size: 8px;
}

.dock-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 168px);
  gap: 5px;
  min-width: 0;
  min-height: 0;
}

.navigation-dock .copy-row {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
}

.pixel-button.secondary {
  min-width: 92px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.38);
  font-size: 8px;
}

.navigation-dock #backupButton {
  min-width: 0;
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1.1;
}

.navigation-dock-wrap .minimap {
  height: 132px;
}

@media (max-width: 980px) {
  .map-shell {
    --map-bottom-dock: 182px;
  }

  .navigation-dock {
    grid-template-rows: 44px 34px 36px;
    height: 150px;
  }

  .dock-status-row {
    grid-template-columns: max-content minmax(0, 1fr);
    grid-template-rows: 20px 20px;
    gap: 4px 6px;
  }

  .dock-readout {
    font-size: 8px;
  }

  .dock-input-row {
    grid-template-columns: minmax(190px, 1fr) 54px minmax(136px, 0.8fr);
  }

  .navigation-dock-wrap .minimap {
    height: 150px;
  }
}

@media (max-width: 720px) {
  .map-shell {
    --map-bottom-dock: 226px;
  }

  .navigation-dock {
    grid-template-rows: 48px 64px 42px;
    height: 176px;
  }

  .dock-status-row {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-rows: 20px 20px;
  }

  .dock-mode {
    grid-column: 1;
  }

  .inside-status {
    grid-column: 1 / -1;
  }

  .dock-input-row {
    grid-template-columns: 54px minmax(0, 1fr);
    grid-template-rows: 30px 26px;
  }

  .navigation-form {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: 58px minmax(0, 1fr) 40px;
  }

  .navigation-dock .zoom-controls {
    grid-column: 1;
    grid-row: 2;
  }

  .navigation-dock .quick-zoom-buttons {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: repeat(6, 46px);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .dock-actions-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .navigation-dock .copy-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .navigation-dock #backupButton {
    font-size: 8px;
  }

  .navigation-dock-wrap .minimap {
    height: 72px;
  }
}

@media (max-width: 430px) {
  .map-shell {
    --map-bottom-dock: 214px;
  }

  .navigation-dock {
    grid-template-rows: 50px 62px 38px;
    height: 172px;
  }

  .dock-status-row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .dock-mode {
    max-width: 160px;
  }

  .inside-status strong {
    display: none;
  }

  .navigation-dock .breadcrumb button:nth-of-type(2),
  .navigation-dock .breadcrumb button:nth-of-type(3) {
    max-width: 34px;
  }

  .navigation-dock .breadcrumb span:nth-of-type(2),
  .navigation-dock .breadcrumb span:nth-of-type(3) {
    display: none;
  }

  .navigation-form {
    grid-template-columns: 54px minmax(0, 1fr) 38px;
  }

  .navigation-dock .quick-zoom-buttons {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
  }

  .dock-actions-row {
    grid-template-columns: minmax(0, 1fr) 98px;
    height: 38px;
    overflow: hidden;
  }

  .navigation-dock .copy-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 38px;
    overflow: hidden;
  }

  .pixel-button.secondary {
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0 3px;
    font-size: 7px;
  }

  .navigation-dock #backupButton {
    min-height: 0;
    height: auto;
    padding: 0 4px;
    font-size: 7px;
  }

  .navigation-dock .quick-zoom-buttons button {
    min-width: 0;
    font-size: 7px;
  }
}

/* Zoom navigation lives in the canvas HUD; the bottom dock is only status/input/share. */
.depth-indicator {
  pointer-events: auto;
  width: min(326px, calc(100% - 20px));
}

.depth-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.depth-title-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.depth-nudge-controls {
  display: grid;
  grid-template-columns: 22px 22px;
  gap: 3px;
}

.depth-nudge-controls button,
.depth-step {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-family: var(--font-vcr);
  text-shadow: 1px 1px 0 #000;
}

.depth-nudge-controls button {
  min-width: 0;
  min-height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0;
  font-size: 11px;
}

.depth-nudge-controls button:hover,
.depth-nudge-controls button:focus-visible {
  border-color: rgba(255, 122, 24, 0.7);
  background: rgba(255, 122, 24, 0.16);
  color: #fff;
}

.depth-step {
  min-height: 20px;
  border-top: 2px solid rgba(255, 255, 255, 0.18);
  padding: 3px 1px 0;
  font-size: 10px;
}

.depth-step:hover,
.depth-step:focus-visible {
  border-color: rgba(255, 122, 24, 0.72);
  background: rgba(255, 122, 24, 0.1);
  color: #fff;
  outline: none;
}

.depth-step.active {
  border-color: var(--green);
  background: rgba(97, 226, 148, 0.1);
  color: #fff;
}

.map-hover-readout {
  position: absolute;
  left: 10px;
  top: 78px;
  z-index: 12;
  max-width: min(326px, calc(100% - 20px));
  overflow: hidden;
  border: 1px solid rgba(97, 226, 148, 0.22);
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.46);
  color: rgba(97, 226, 148, 0.72);
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
  text-overflow: clip;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.scale-bar {
  top: 96px;
}

.navigation-hint {
  top: 138px;
  max-width: min(420px, calc(100% - 24px));
  padding: 6px 8px;
}

.navigation-dock {
  grid-template-rows: 38px 32px 34px;
  height: 126px;
}

.dock-input-row {
  grid-template-columns: minmax(0, 1fr);
}

.navigation-form {
  grid-template-columns: 66px minmax(0, 1fr) 44px;
}

.navigation-dock .zoom-controls,
.navigation-dock .quick-zoom-buttons {
  display: none !important;
}

.navigation-dock-wrap .minimap {
  height: 126px;
}

@media (max-width: 980px) {
  .map-shell {
    --map-bottom-dock: 170px;
  }

  .navigation-dock {
    grid-template-rows: 44px 32px 34px;
    height: 140px;
  }

  .dock-input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .navigation-dock-wrap .minimap {
    height: 140px;
  }
}

@media (max-width: 720px) {
  .map-shell {
    --map-bottom-dock: 200px;
  }

  .depth-indicator {
    width: min(292px, calc(100% - 20px));
  }

  .depth-step {
    font-size: 9px;
  }

  .scale-bar,
  .navigation-hint {
    display: block;
    top: 72px;
  }

  .scale-bar {
    min-width: 118px;
    padding: 4px 6px 6px;
    font-size: 8px;
  }

  .scale-bar-line {
    height: 5px;
    margin-top: 3px;
  }

  .navigation-hint {
    left: 148px;
    max-width: calc(100% - 158px);
    overflow: visible;
    padding: 5px 6px;
    font-size: 8px;
    line-height: 1.2;
    white-space: normal;
  }

  .navigation-dock {
    grid-template-rows: 50px 30px 38px;
    height: 148px;
  }

  .dock-input-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 30px;
  }

  .navigation-form {
    grid-column: auto;
    grid-row: auto;
  }

  .navigation-dock-wrap .minimap {
    height: 64px;
  }
}

@media (max-width: 430px) {
  .map-shell {
    --map-bottom-dock: 186px;
  }

  .depth-indicator {
    width: min(280px, calc(100% - 20px));
  }

  .depth-nudge-controls {
    grid-template-columns: 20px 20px;
  }

  .depth-step {
    min-height: 18px;
    padding-top: 3px;
    font-size: 8px;
  }

  .scale-bar,
  .navigation-hint {
    top: 68px;
  }

  .navigation-hint {
    left: 142px;
    max-width: calc(100% - 152px);
  }

  .navigation-dock {
    grid-template-rows: 50px 30px 38px;
    height: 146px;
  }

  .navigation-form {
    grid-template-columns: 54px minmax(0, 1fr) 38px;
  }
}

/* Navigation polish pass: unified HUD and aligned lower dock. */
.map-shell {
  --nav-gap: 6px;
  --nav-row-gap: 6px;
  --nav-panel-padding: 8px;
  --nav-left-column: minmax(160px, 0.42fr);
  --map-bottom-dock: 156px;
}

.top-navigation-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 12;
  display: grid;
  gap: 5px;
  width: calc(100% - 20px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.88);
  pointer-events: none;
  text-shadow: 1px 1px 0 #000;
}

.top-navigation-hud .depth-indicator,
.top-navigation-hud .scale-bar,
.top-navigation-hud .navigation-hint,
.top-navigation-hud .map-hover-readout {
  position: static;
  inset: auto;
  z-index: auto;
  width: auto;
  max-width: none;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.top-navigation-hud .depth-indicator {
  display: grid;
  gap: 4px;
}

.top-navigation-hud .depth-nudge-controls button,
.top-navigation-hud .depth-step {
  pointer-events: auto;
}

.top-navigation-hud .depth-step {
  min-height: 18px;
  padding-top: 2px;
  background: rgba(255, 255, 255, 0.035);
}

.top-navigation-hud .depth-step.active {
  background: rgba(97, 226, 148, 0.12);
}

.top-navigation-hud .scale-bar {
  display: grid;
  grid-template-columns: auto minmax(32px, 1fr);
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  line-height: 1;
}

.top-navigation-hud .scale-bar-line {
  display: block;
  border-color: rgba(255, 255, 255, 0.78);
  border-top: 0;
  max-width: 100%;
  height: 7px;
  margin: 0;
}

.top-navigation-hud .navigation-hint {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.74);
  font-size: 9px;
  line-height: 1.15;
  text-overflow: clip;
  white-space: nowrap;
}

.top-navigation-hud .map-hover-readout {
  overflow: hidden;
  color: rgba(97, 226, 148, 0.72);
  font-size: 8px;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.map-corner-info.navigation-dock-wrap {
  gap: var(--nav-gap);
}

.navigation-dock {
  grid-template-rows: 38px 30px 36px;
  gap: var(--nav-row-gap);
  height: 134px;
  padding: var(--nav-panel-padding);
}

.dock-status-row {
  grid-template-columns: max-content minmax(150px, 1fr) max-content;
  grid-template-rows: 18px 16px;
  gap: 4px var(--nav-gap);
}

#coordReadout {
  min-width: 0;
}

.dock-input-row {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--nav-gap);
}

.navigation-form {
  grid-template-columns: var(--nav-left-column) minmax(0, 1fr) 44px;
  gap: var(--nav-gap);
}

.nav-input-tabs {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: var(--nav-gap);
}

.nav-input-tab {
  text-align: center;
}

.dock-actions-row {
  grid-template-columns: var(--nav-left-column) minmax(0, 1fr);
  gap: var(--nav-gap);
}

.navigation-dock .copy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--nav-gap);
}

.pixel-button.secondary {
  min-width: 0;
}

.navigation-dock #backupButton {
  width: 100%;
  min-height: 0;
  font-size: 10px;
}

.navigation-dock-wrap .minimap {
  height: 134px;
}

.error-line {
  display: none !important;
}

@media (max-width: 980px) {
  .map-shell {
    --map-bottom-dock: 176px;
    --nav-left-column: minmax(150px, 0.45fr);
  }

  .navigation-dock {
    grid-template-rows: 42px 30px 36px;
    height: 144px;
  }

  .navigation-dock-wrap .minimap {
    height: 144px;
  }
}

@media (max-width: 720px) {
  .map-shell {
    --map-bottom-dock: 202px;
    --nav-left-column: minmax(132px, 0.46fr);
    --nav-gap: 5px;
  }

  .top-navigation-hud {
    width: min(316px, calc(100% - 20px));
    gap: 4px;
    padding: 6px 7px;
  }

  .top-navigation-hud .scale-bar {
    grid-template-columns: 108px minmax(26px, 1fr);
    gap: 6px;
    font-size: 8px;
  }

  .top-navigation-hud .scale-bar-line {
    height: 5px;
  }

  .top-navigation-hud .navigation-hint {
    font-size: 8px;
    white-space: normal;
  }

  .navigation-dock {
    grid-template-rows: 50px 30px 38px;
    height: 148px;
  }

  .dock-status-row {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-rows: 18px 24px;
  }

  #coordReadout {
    grid-column: 1;
    grid-row: 1;
  }

  #zoomReadout {
    grid-column: 2;
    grid-row: 1;
  }

  .dock-mode {
    display: none;
  }

  .inside-status {
    grid-row: 2;
  }

  .navigation-form {
    grid-template-columns: var(--nav-left-column) minmax(0, 1fr) 38px;
  }

  .navigation-dock-wrap .minimap {
    height: 64px;
  }
}

@media (max-width: 430px) {
  .map-shell {
    --map-bottom-dock: 190px;
    --nav-left-column: minmax(122px, 0.48fr);
  }

  .top-navigation-hud {
    width: min(300px, calc(100% - 20px));
  }

  .top-navigation-hud .depth-step {
    font-size: 8px;
  }

  .top-navigation-hud .scale-bar {
    grid-template-columns: 102px minmax(24px, 1fr);
  }

  .navigation-dock {
    height: 146px;
  }

  .navigation-form {
    grid-template-columns: var(--nav-left-column) minmax(0, 1fr) 36px;
  }

  .navigation-dock #backupButton {
    font-size: 9px;
  }
}

/* Mobile map-first IA. Desktop rules above remain the default. */
.mobile-only {
  display: none !important;
}

body.is-mobile,
body.is-mobile button,
body.is-mobile input {
  -webkit-tap-highlight-color: transparent;
}

body.is-mobile {
  overflow-x: hidden;
  background: #000;
}

body.is-mobile .mobile-only {
  display: flex !important;
}

body.is-mobile .event-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  min-height: 100svh;
  height: 100svh;
  padding: max(8px, env(safe-area-inset-top)) 8px calc(86px + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.82)),
    #050505;
}

body.is-mobile .hero-panel,
body.is-mobile .left-column,
body.is-mobile .side-stack,
body.is-mobile .hint-stack,
body.is-mobile .navigation-dock,
body.is-mobile .stats-strip {
  display: none !important;
}

body.is-mobile .mobile-top-bar {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  border: 2px solid var(--line-soft);
  padding: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015)),
    rgba(10, 10, 10, 0.86);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

body.is-mobile .mobile-brand-compact {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

body.is-mobile .mobile-brand-avatar {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

body.is-mobile .mobile-brand-compact strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: clip;
  text-shadow:
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000;
  text-transform: uppercase;
  white-space: nowrap;
}

body.is-mobile .mobile-top-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(97, 226, 148, 0.42);
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.48);
  color: var(--green);
  font-size: 10px;
  line-height: 1;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

body.is-mobile .mobile-icon-button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  padding: 0 9px;
  background: rgba(255, 122, 24, 0.28);
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #000;
}

body.is-mobile .terminal-banner {
  min-height: 0;
  margin: 0;
  padding: 8px;
}

body.is-mobile .mission-layout,
body.is-mobile .field-column {
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

body.is-mobile .field-column {
  height: 100%;
}

body.is-mobile .game-board-plate {
  width: 100%;
  height: min(78svh, calc(100svh - 142px - env(safe-area-inset-bottom)));
  min-height: 520px;
  max-height: none;
  aspect-ratio: auto;
  order: initial;
  padding: 7px;
  border-width: 2px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.52);
}

@media (max-height: 720px) {
  body.is-mobile .game-board-plate {
    min-height: 0;
    height: calc(100svh - 136px - env(safe-area-inset-bottom));
  }
}

body.is-mobile .board-shell,
body.is-mobile .map-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
}

body.is-mobile .map-shell {
  --map-bottom-dock: 8px;
  padding: 6px;
  touch-action: none;
}

body.is-mobile .top-navigation-hud {
  top: 8px;
  left: 8px;
  width: calc(100% - 16px);
  gap: 5px;
  border-color: rgba(255, 255, 255, 0.24);
  padding: 6px;
  background: rgba(0, 0, 0, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

body.is-mobile .top-navigation-hud .depth-title-row {
  grid-template-columns: minmax(0, 1fr);
}

body.is-mobile .top-navigation-hud .depth-title-row strong {
  font-size: 10px;
}

body.is-mobile .top-navigation-hud .depth-nudge-controls {
  display: none;
}

body.is-mobile .top-navigation-hud .depth-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  overflow-x: visible;
  padding-bottom: 1px;
  scrollbar-width: none;
}

body.is-mobile .top-navigation-hud .depth-steps::-webkit-scrollbar {
  display: none;
}

body.is-mobile .top-navigation-hud .depth-step {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 11px 5px 0;
  font-size: 9px;
}

body.is-mobile .top-navigation-hud .scale-bar {
  display: none !important;
}

body.is-mobile .top-navigation-hud .navigation-hint {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

body.is-mobile .map-hover-readout {
  display: none !important;
}

body.is-mobile .map-corner-info.navigation-dock-wrap {
  top: auto;
  right: 10px;
  bottom: 10px;
  left: auto;
  display: grid;
  width: auto;
  grid-template-columns: 72px;
  grid-template-rows: 36px 72px;
  gap: 5px;
  pointer-events: none;
}

body.is-mobile .mobile-minimap-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(0, 0, 0, 0.58);
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  text-transform: uppercase;
  pointer-events: auto;
}

body.is-mobile .navigation-dock-wrap .minimap {
  display: none;
  width: 72px;
  height: 72px;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.5);
}

body.is-mobile.mobile-minimap-open .navigation-dock-wrap .minimap {
  display: block;
}

body.is-mobile .mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 2px solid rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0.92), rgba(0, 0, 0, 0.96)),
    #050505;
  box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.55);
}

body.is-mobile .mobile-action-button {
  min-width: 0;
  min-height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  font-size: 10px;
  line-height: 1.05;
  overflow: hidden;
  text-transform: uppercase;
  text-shadow:
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    0 -2px 0 #000;
}

body.is-mobile .mobile-action-button.hot,
body.is-mobile .mobile-action-button.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02)),
    rgba(255, 122, 24, 0.74);
}

body.is-mobile .mobile-action-button.quiet {
  border-color: rgba(97, 226, 148, 0.34);
  color: var(--green);
  font-size: 9px;
}

body.is-mobile .mobile-mode-toggle {
  display: none;
  grid-column: 1 / 3;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

body.is-mobile.is-cell-zoom .mobile-mode-toggle {
  display: grid;
}

body.is-mobile.is-cell-zoom .mobile-action-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Desktop operator-panel polish. Scoped after mobile rules so the phone IA stays separate. */
body.is-desktop {
  height: 100svh;
  overflow: hidden;
}

body.is-desktop .event-shell {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr);
  gap: var(--ui-gap-md);
  height: 100svh;
  min-height: 0;
  padding: var(--ui-gap-md);
  overflow: hidden;
}

body.is-desktop .hero-panel {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(260px, 1fr);
  align-items: center;
  gap: var(--ui-gap-lg);
  min-height: 0;
  height: 52px;
  padding: 8px var(--ui-gap-md);
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.44);
}

body.is-desktop .brand-row {
  min-width: 0;
  gap: var(--ui-gap-sm);
}

body.is-desktop .brand-avatar {
  width: 28px;
  height: 28px;
}

body.is-desktop .brand-title {
  font-size: clamp(17px, 1.2vw, 22px);
  line-height: 1.1;
}

body.is-desktop .brand-subtitle {
  justify-self: end;
  max-width: min(42vw, 620px);
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  text-align: right;
}

body.is-desktop .mission-layout {
  display: grid;
  grid-template-columns: clamp(280px, 16vw, 336px) minmax(0, 1fr) clamp(320px, 18vw, 376px);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--ui-gap-md);
  min-height: 0;
  height: 100%;
  margin-top: 0;
  align-items: stretch;
}

body.is-desktop .field-column {
  display: contents;
}

body.is-desktop .left-column,
body.is-desktop .side-stack,
body.is-desktop .game-board-plate {
  min-width: 0;
  min-height: 0;
}

body.is-desktop .left-column {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(250px, auto) minmax(0, 1fr);
  gap: var(--ui-gap-md);
  height: 100%;
  overflow: hidden;
}

body.is-desktop .side-stack {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(116px, auto) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--ui-gap-md);
  height: 100%;
  overflow: hidden;
}

body.is-desktop .game-board-plate {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  padding: var(--ui-gap-sm);
  border-color: rgba(255, 122, 24, 0.48);
  box-shadow:
    5px 5px 0 rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(97, 226, 148, 0.12) inset;
}

body.is-desktop .board-shell,
body.is-desktop .map-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

body.is-desktop .map-shell {
  --map-bottom-dock: 172px;
  --nav-gap: var(--ui-gap-sm);
  --nav-row-gap: var(--ui-gap-sm);
  --nav-panel-padding: 10px;
  --nav-left-column: minmax(144px, 0.34fr);
  padding: var(--ui-gap-sm) var(--ui-gap-sm) var(--map-bottom-dock);
}

body.is-desktop .side-panel,
body.is-desktop .stats-strip,
body.is-desktop .action-limit-card {
  border: var(--panel-border);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.44);
}

body.is-desktop .side-panel {
  gap: var(--ui-gap-sm);
  min-height: 0;
  padding: var(--panel-padding);
  overflow: hidden;
}

body.is-desktop .johnny-core-panel {
  overflow: auto;
  scrollbar-width: thin;
}

body.is-desktop .side-panel h2 {
  font-size: 12px;
  line-height: 1.45;
}

body.is-desktop .stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-gap-sm);
  margin: 0;
  padding: var(--ui-gap-sm);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(0, 0, 0, 0.42);
}

body.is-desktop .stats-strip div {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.34);
}

body.is-desktop .stats-strip span {
  font-size: 9px;
}

body.is-desktop .stats-strip strong {
  font-size: clamp(18px, 1.15vw, 23px);
}

body.is-desktop #progressReadout {
  font-size: clamp(16px, 1vw, 20px);
}

body.is-desktop .target-panel {
  position: relative;
  align-content: start;
  gap: var(--ui-gap-sm);
  min-height: 0;
  border-color: rgba(255, 122, 24, 0.72);
  padding: var(--ui-gap-lg);
  background:
    linear-gradient(135deg, rgba(255, 122, 24, 0.16), rgba(255, 255, 255, 0.025)),
    rgba(0, 0, 0, 0.58);
  box-shadow:
    5px 5px 0 rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 122, 24, 0.12);
}

body.is-desktop .target-panel h2 {
  color: #fff;
  font-size: 13px;
}

body.is-desktop .target-panel p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.35;
}

body.is-desktop .target-label,
body.is-desktop #targetProgress {
  color: var(--green);
}

body.is-desktop #targetAddress {
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
}

body.is-desktop #targetOpened,
body.is-desktop #targetExplosions {
  display: inline-block;
  margin-right: var(--ui-gap-sm);
  color: rgba(255, 255, 255, 0.72);
}

body.is-desktop #targetGoButton,
body.is-desktop #backupButton {
  min-height: 46px;
  border-color: rgba(255, 122, 24, 0.9);
  background:
    linear-gradient(135deg, rgba(255, 122, 24, 0.38), rgba(255, 122, 24, 0.12)),
    rgba(0, 0, 0, 0.64);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.25;
  text-shadow: 2px 2px 0 #000;
}

body.is-desktop #targetCopyButton,
body.is-desktop .pixel-button.secondary,
body.is-desktop .name-form .pixel-button,
body.is-desktop #initialZeroButton {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.78);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.34);
}

body.is-desktop .hint-stack {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

body.is-desktop .hint-card {
  border-color: rgba(97, 226, 148, 0.28);
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.68);
}

body.is-desktop .player-panel {
  gap: var(--ui-gap-sm);
}

body.is-desktop .name-form {
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: var(--ui-gap-sm);
}

body.is-desktop .name-form input,
body.is-desktop .navigation-form input {
  min-height: 34px;
}

body.is-desktop .player-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-gap-xs) var(--ui-gap-sm);
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
}

body.is-desktop .moves-panel {
  border-color: rgba(97, 226, 148, 0.48);
  background:
    linear-gradient(135deg, rgba(97, 226, 148, 0.09), rgba(255, 255, 255, 0.02)),
    var(--panel);
}

body.is-desktop .action-limit-card {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

body.is-desktop .action-limit-card span,
body.is-desktop .action-limit-card small {
  font-size: 10px;
}

body.is-desktop .action-limit-card strong {
  color: #fff;
  overflow: hidden;
  font-size: clamp(17px, 1.05vw, 20px);
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

body.is-desktop .action-limit-card strong.resting {
  font-size: 15px;
  line-height: 1.15;
  white-space: normal;
}

body.is-desktop .leaderboard-panel,
body.is-desktop .action-feed-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

body.is-desktop .leaderboard,
body.is-desktop .action-log {
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 0;
  scrollbar-width: none;
}

body.is-desktop .leaderboard::-webkit-scrollbar,
body.is-desktop .action-log::-webkit-scrollbar {
  display: none;
}

body.is-desktop .leaderboard {
  align-content: start;
}

body.is-desktop .leaderboard li {
  gap: 2px var(--ui-gap-sm);
  padding-bottom: 7px;
  color: rgba(255, 255, 255, 0.74);
}

body.is-desktop .leaderboard em,
body.is-desktop .action-log {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

body.is-desktop .action-log p {
  margin: 0;
  padding-bottom: 7px;
}

body.is-desktop .map-corner-info.navigation-dock-wrap {
  left: var(--ui-gap-sm);
  right: var(--ui-gap-sm);
  bottom: var(--ui-gap-sm);
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: var(--ui-gap-sm);
  width: auto;
  align-items: stretch;
}

body.is-desktop .navigation-dock {
  grid-template-rows: 44px 34px 42px;
  gap: var(--ui-gap-sm);
  height: 154px;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.015)),
    rgba(0, 0, 0, 0.56);
}

body.is-desktop .dock-status-row {
  grid-template-columns: minmax(116px, 0.5fr) minmax(150px, 0.62fr) minmax(90px, 0.35fr);
  grid-template-rows: 18px 18px;
  gap: var(--ui-gap-xs) var(--ui-gap-sm);
  align-items: stretch;
}

body.is-desktop .dock-mode,
body.is-desktop .inside-status,
body.is-desktop .dock-readout,
body.is-desktop .dock-view-readout {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 7px;
  background: rgba(0, 0, 0, 0.38);
}

body.is-desktop .dock-mode {
  grid-column: 1;
  grid-row: 1;
}

body.is-desktop #coordReadout {
  grid-column: 2;
  grid-row: 1;
}

body.is-desktop #zoomReadout {
  grid-column: 3;
  grid-row: 1;
}

body.is-desktop .inside-status {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: var(--ui-gap-xs);
  overflow: hidden;
}

body.is-desktop .inside-status strong,
body.is-desktop .breadcrumb {
  min-width: 0;
}

body.is-desktop .breadcrumb {
  flex-wrap: nowrap;
  overflow: hidden;
}

body.is-desktop .dock-input-row {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-gap-sm);
}

body.is-desktop .navigation-form {
  grid-template-columns: minmax(132px, 0.24fr) minmax(0, 1fr) 58px;
  gap: var(--ui-gap-sm);
}

body.is-desktop .nav-input-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr;
  gap: var(--ui-gap-xs);
}

body.is-desktop .nav-input-tab {
  min-height: 34px;
  font-size: 8px;
}

body.is-desktop .dock-actions-row {
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: var(--ui-gap-sm);
}

body.is-desktop .navigation-dock .copy-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-gap-sm);
}

body.is-desktop .navigation-dock #backupButton {
  width: 100%;
  min-height: 42px;
  font-size: 9px;
}

body.is-desktop .navigation-dock-wrap .minimap {
  width: 132px;
  height: 154px;
}

body.is-desktop .top-navigation-hud {
  width: calc((100% - 20px) / 3);
  max-width: calc(100% - 20px);
}

body.is-desktop .floating-dev-panel {
  opacity: 0.82;
}

body.is-desktop:not(.is-local-dev) .floating-dev-panel {
  display: none !important;
}

@media (min-width: 1600px) {
  body.is-desktop .event-shell {
    padding: var(--ui-gap-lg);
    gap: var(--ui-gap-lg);
  }

  body.is-desktop .mission-layout {
    gap: var(--ui-gap-lg);
  }

  body.is-desktop .game-board-plate {
    padding: var(--ui-gap-md);
  }
}

@media (min-width: 769px) and (max-width: 1420px) {
  body.is-desktop .event-shell {
    grid-template-rows: 48px minmax(0, 1fr);
    gap: var(--ui-gap-sm);
    padding: var(--ui-gap-sm);
  }

  body.is-desktop .hero-panel {
    height: 48px;
    padding: 7px 10px;
  }

  body.is-desktop .mission-layout {
    grid-template-columns: 272px minmax(0, 1fr) 306px;
    gap: var(--ui-gap-sm);
  }

  body.is-desktop .brand-title {
    font-size: 16px;
  }

  body.is-desktop .brand-subtitle {
    max-width: 360px;
    font-size: 9px;
  }

  body.is-desktop .side-panel {
    padding: 10px;
  }

  body.is-desktop .target-panel {
    gap: 6px;
    padding: 10px;
  }

  body.is-desktop #targetGoButton {
    min-height: 42px;
  }

  body.is-desktop .johnny-core-panel {
    gap: 6px;
  }

  body.is-desktop .johnny-core-panel p {
    font-size: 10px;
    line-height: 1.25;
  }

  body.is-desktop .core-vote-options {
    gap: 5px;
  }

  body.is-desktop .core-vote-option {
    gap: 2px;
    padding: 6px;
  }

  body.is-desktop .core-vote-option span {
    font-size: 9px;
    line-height: 1.2;
  }

  body.is-desktop .core-vote-option strong {
    font-size: 11px;
    line-height: 1.15;
  }

  body.is-desktop .core-vote-option small {
    font-size: 8px;
    line-height: 1.2;
  }

  body.is-desktop .left-column,
  body.is-desktop .side-stack {
    gap: var(--ui-gap-sm);
  }

  body.is-desktop .stats-strip {
    gap: 6px;
    padding: 6px;
  }

  body.is-desktop .stats-strip div {
    min-height: 42px;
    padding: 5px 7px;
  }

  body.is-desktop .stats-strip strong {
    font-size: 18px;
  }

  body.is-desktop #targetAddress {
    font-size: 13px;
  }

  body.is-desktop .map-shell {
    --map-bottom-dock: 164px;
  }

  body.is-desktop .navigation-dock {
    grid-template-rows: 42px 32px 38px;
    height: 148px;
    padding: 8px;
  }

  body.is-desktop .navigation-dock-wrap .minimap {
    width: 116px;
    height: 148px;
  }

  body.is-desktop .map-corner-info.navigation-dock-wrap {
    grid-template-columns: minmax(0, 1fr) 116px;
  }
}

body.is-mobile.is-cell-zoom #mobileGoHelpButton {
  display: none;
}

body.is-mobile .mobile-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  z-index: 55;
  display: grid !important;
  max-height: min(72svh, 560px);
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-bottom: 0;
  padding: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.018)),
    rgba(7, 7, 7, 0.96);
  box-shadow: 0 -5px 0 rgba(0, 0, 0, 0.52);
  transform: translateY(calc(100% + 88px));
  transition: transform 160ms ease-out;
  pointer-events: none;
}

body.is-mobile.mobile-sheet-open .mobile-bottom-sheet {
  transform: translateY(0);
  pointer-events: auto;
}

body.is-mobile .mobile-sheet-handle {
  justify-self: center;
  width: 64px;
  height: 8px;
  min-height: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.34);
  padding: 0;
}

body.is-mobile .mobile-sheet-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 6px 2px 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
}

body.is-mobile .mobile-sheet-summary strong {
  color: var(--green);
  text-transform: uppercase;
}

body.is-mobile .mobile-sheet-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

body.is-mobile .mobile-sheet-tabs,
body.is-mobile .mobile-go-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

body.is-mobile .mobile-go-tabs {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 6px;
}

body.is-mobile .mobile-sheet-tabs button,
body.is-mobile .mobile-go-tabs button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  text-transform: uppercase;
}

body.is-mobile .mobile-sheet-tabs button.active,
body.is-mobile .mobile-go-tabs button.active {
  border-color: rgba(97, 226, 148, 0.74);
  background: rgba(97, 226, 148, 0.15);
  color: #fff;
}

body.is-mobile .mobile-sheet-body {
  min-height: 0;
  overflow: auto;
  padding: 8px 0 2px;
  -webkit-overflow-scrolling: touch;
}

body.is-mobile .mobile-tab-panel {
  display: none;
}

body.is-mobile .mobile-tab-panel.active {
  display: grid;
  gap: 10px;
}

body.is-mobile .mobile-target-card,
body.is-mobile .mobile-core-card,
body.is-mobile .mobile-moves-card,
body.is-mobile .mobile-go-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 10px;
  background: rgba(0, 0, 0, 0.42);
}

body.is-mobile .mobile-target-card span,
body.is-mobile .mobile-target-card small,
body.is-mobile .mobile-core-card span,
body.is-mobile .mobile-core-card small,
body.is-mobile .mobile-moves-card span,
body.is-mobile .mobile-moves-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

body.is-mobile .mobile-target-card strong,
body.is-mobile .mobile-core-card strong,
body.is-mobile .mobile-moves-card strong {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
}

body.is-mobile .mobile-target-card p,
body.is-mobile .mobile-core-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.35;
}

body.is-mobile .mobile-sheet-actions,
body.is-mobile .mobile-go-copy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

body.is-mobile .mobile-go-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
}

body.is-mobile .mobile-go-form input,
body.is-mobile .mobile-go-form .pixel-button,
body.is-mobile .mobile-go-copy-row .pixel-button,
body.is-mobile .mobile-sheet-actions .pixel-button,
body.is-mobile .mobile-tab-panel .pixel-button,
body.is-mobile .mobile-tab-panel input {
  min-height: 44px;
}

body.is-mobile .mobile-coordinate-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

body.is-mobile .mobile-go-form input,
body.is-mobile .mobile-tab-panel input {
  min-width: 0;
  border: 2px solid var(--line-soft);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
}

body.is-mobile .mobile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

body.is-mobile .mobile-list {
  max-height: 42svh;
  overflow: auto;
  padding-right: 2px;
}

body.is-mobile .mobile-hint-chip {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 54;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(97, 226, 148, 0.38);
  padding: 7px 8px;
  background: rgba(0, 0, 0, 0.76);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  line-height: 1.2;
  text-shadow: 1px 1px 0 #000;
  pointer-events: auto;
}

body.is-mobile .mobile-hint-chip.hidden,
body.is-mobile.mobile-sheet-open .mobile-hint-chip {
  display: none !important;
}

body.is-mobile .mobile-hint-chip button {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

body.is-mobile .floating-dev-panel {
  max-width: min(300px, calc(100vw - 16px));
  max-height: min(54svh, 420px);
  overflow: auto;
}

body.is-mobile:not(.is-local-dev) .floating-dev-panel {
  display: none !important;
}

@media (max-width: 768px), (pointer: coarse) {
  body:not(.is-desktop) .mobile-only {
    display: flex !important;
  }
}

@media (max-width: 420px) {
  body.is-mobile .event-shell {
    padding-left: 6px;
    padding-right: 6px;
  }

  body.is-mobile .mobile-brand-compact strong {
    font-size: 9px;
  }

  body.is-mobile .mobile-top-pill {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 9px;
  }

  body.is-mobile .mobile-action-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding-left: 6px;
    padding-right: 6px;
  }

  body.is-mobile .mobile-action-button {
    min-height: 46px;
    font-size: 9px;
  }

  body.is-mobile .top-navigation-hud {
    width: calc(100% - 16px);
  }

  body.is-mobile .top-navigation-hud .depth-step {
    min-width: 0;
    font-size: 8px;
  }
}

body.is-mobile .mobile-action-bar,
body.is-mobile .mobile-bottom-sheet,
body.is-mobile .mobile-mode-toggle,
body.is-mobile .mobile-sheet-tabs,
body.is-mobile .mobile-go-tabs,
body.is-mobile .mobile-go-form,
body.is-mobile .mobile-coordinate-inputs,
body.is-mobile .mobile-go-copy-row,
body.is-mobile .mobile-sheet-actions,
body.is-mobile .mobile-stat-grid,
body.is-mobile .mobile-target-card,
body.is-mobile .mobile-moves-card,
body.is-mobile .mobile-go-panel {
  display: grid !important;
}

body.is-mobile .mobile-mode-toggle,
body.is-mobile .mobile-go-panel.hidden,
body.is-mobile .mobile-coordinate-inputs.hidden,
body.is-mobile .mobile-address-input.hidden {
  display: none !important;
}

body.is-mobile.is-cell-zoom .mobile-mode-toggle,
body.is-mobile.mobile-sheet-open .mobile-go-panel:not(.hidden),
body.is-mobile .mobile-coordinate-inputs:not(.hidden) {
  display: grid !important;
}

body.is-mobile.is-cell-zoom .mobile-action-bar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
