:root {
  --ink: #eef4ff;
  --cyan: #61c9ff;
  --lime: #b8ff5b;
  --yellow: #ffd95f;
  --path: #62a95d;
  --path-dark: #3e7d40;
  --block: #62a95d;
  --grid-cols: 27;
  --grid-rows: 22;
  --walker-col: 2;
  --walker-row: 11;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 18%, #17304e 0%, #09111c 46%, #030507 86%),
    #020406;
  color: var(--ink);
  font-family: "VT323", monospace;
}

.page {
  max-width: 1260px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.hud {
  margin-bottom: 18px;
}

.hud h1 {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 1rem;
  font-family: "Press Start 2P", monospace;
  text-shadow: 0 0 14px rgba(255, 217, 95, 0.45);
}

.hud p {
  margin: 0;
  color: #a8dcff;
  font-size: 1.35rem;
}

.hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.hud-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 3px solid var(--cyan);
  background: linear-gradient(180deg, #173f60, #0c1c31);
  color: #fffce6;
  font-family: "Press Start 2P", monospace;
  font-size: 0.52rem;
  line-height: 1.3;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
  box-shadow:
    inset 0 0 0 3px rgba(97, 201, 255, 0.16),
    0 4px 0 #06101e;
}

.hud-button {
  appearance: none;
  -webkit-appearance: none;
}

.hud-link-button,
.hud-button {
  cursor: pointer;
}

.hud-link:hover,
.hud-link:focus-visible {
  background: linear-gradient(180deg, #1f5379, #113052);
}

.hud-button.is-active {
  border-color: var(--yellow);
  background: linear-gradient(180deg, #5f4710, #322103);
  box-shadow:
    inset 0 0 0 3px rgba(255, 217, 95, 0.14),
    0 4px 0 #1e1402;
}

.hud-link:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.map-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: min(100%, 1120px);
  margin: 0 auto;
  border: 4px solid var(--lime);
  background: linear-gradient(180deg, #0e1929, #070d14);
  padding: 14px;
  box-shadow:
    0 0 0 4px #10260d,
    0 20px 44px rgba(0, 0, 0, 0.35);
}

.view-panel {
  width: 100%;
}

.view-panel[hidden] {
  display: none;
}

.resume-city-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tech-stack-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.signal-sort-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.data-cleanup-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.view-heading h2 {
  margin: 0;
  color: #fff5c9;
  font-size: 0.82rem;
  font-family: "Press Start 2P", monospace;
  line-height: 1.4;
}

.view-kicker {
  margin: 0;
  color: var(--yellow);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.view-description {
  margin: 0;
  color: #a8dcff;
  font-size: 1.22rem;
}

.map-viewport {
  display: flex;
  justify-content: center;
  width: 100%;
}

.map {
  position: relative;
  flex: 1;
  min-height: 0;
  width: min(100%, 980px, calc((100vh - 280px) * 1.23));
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 27 / 22;
  border: 3px solid var(--cyan);
  overflow: hidden;
  image-rendering: pixelated;
  background: linear-gradient(var(--block), var(--block));
}

.map::before {
  content: none;
}

.map::after {
  content: none;
}

.road-network {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      var(--path) 0 calc((100% / var(--grid-cols)) * 2),
      transparent calc((100% / var(--grid-cols)) * 2) calc((100% / var(--grid-cols)) * 5)
    ),
    repeating-linear-gradient(
      180deg,
      var(--path) 0 calc((100% / var(--grid-rows)) * 2),
      transparent calc((100% / var(--grid-rows)) * 2) calc((100% / var(--grid-rows)) * 5)
    );
}

.road-network::before,
.road-network::after {
  content: "";
  position: absolute;
  inset: 0;
}

.road-network::before {
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc((100% / var(--grid-cols)) * 0.8),
      var(--path-dark) calc((100% / var(--grid-cols)) * 0.8) calc((100% / var(--grid-cols)) * 1.2),
      transparent calc((100% / var(--grid-cols)) * 1.2) calc((100% / var(--grid-cols)) * 5)
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 calc((100% / var(--grid-rows)) * 0.8),
      var(--path-dark) calc((100% / var(--grid-rows)) * 0.8) calc((100% / var(--grid-rows)) * 1.2),
      transparent calc((100% / var(--grid-rows)) * 1.2) calc((100% / var(--grid-rows)) * 5)
    );
  opacity: 0.5;
}

.road-network::after {
  inset: auto;
  left: calc((15 / 27) * 100% - 1px);
  top: calc((11.2 / 22) * 100%);
  width: calc((2 / 27) * 100% + 2px);
  height: calc((4.6 / 22) * 100%);
  background: linear-gradient(var(--block), var(--block));
}

.city-grid {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--grid-rows), minmax(0, 1fr));
}

.building {
  grid-column: var(--col) / span var(--w);
  grid-row: var(--row) / span var(--h);
  position: relative;
  margin: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: visible;
}

.building-park {
  margin: 0;
  background: linear-gradient(var(--block), var(--block));
}

.building::before {
  content: "";
  position: absolute;
  inset: 2% 2% 18%;
  background:
    var(--art) center / contain no-repeat;
  image-rendering: pixelated;
  mix-blend-mode: darken;
  filter:
    saturate(1.03)
    contrast(1.02)
    drop-shadow(0 6px 5px rgba(0, 0, 0, 0.28));
}

.building-popup {
  --bubble-left: 50%;
  --bubble-top: 50%;
  --bubble-tail-top: 50%;
  position: absolute;
  left: var(--bubble-left);
  top: var(--bubble-top);
  z-index: 4;
  width: clamp(180px, 31%, 320px);
  min-height: 112px;
  padding: 14px 36px 14px 16px;
  border: 3px solid #b97d14;
  background: linear-gradient(180deg, #ffe97d 0%, #ffd24f 100%);
  color: #442600;
  box-shadow:
    0 0 0 3px rgba(255, 242, 171, 0.45) inset,
    0 10px 22px rgba(0, 0, 0, 0.28);
  image-rendering: pixelated;
  transform: translate(0, -50%);
}

.building-popup[hidden] {
  display: none;
}

.building-popup::before,
.building-popup::after {
  content: "";
  position: absolute;
  top: var(--bubble-tail-top);
  width: 0;
  height: 0;
  transform: translateY(-50%);
}

.building-popup::before {
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
}

.building-popup::after {
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.building-popup.popup-right::before {
  left: -17px;
  border-right: 17px solid #b97d14;
}

.building-popup.popup-right::after {
  left: -11px;
  border-right: 11px solid #ffe36b;
}

.building-popup.popup-left {
  transform: translate(-100%, -50%);
}

.building-popup.popup-left::before {
  right: -17px;
  border-left: 17px solid #b97d14;
}

.building-popup.popup-left::after {
  right: -11px;
  border-left: 11px solid #ffe36b;
}

.building-popup h2 {
  margin: 0 0 10px;
  color: #704200;
  font-size: 0.58rem;
  font-family: "Press Start 2P", monospace;
  line-height: 1.4;
}

.building-popup p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.16;
  color: #4d2d00;
}

.building-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid #a86700;
  background: #ffef9d;
  color: #7a4600;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  line-height: 1;
}

.building-popup-close:hover,
.building-popup-close:focus-visible {
  background: #fff8c4;
}

.building-popup-close:focus-visible {
  outline: 3px solid #fff6cf;
  outline-offset: 2px;
}

.tech-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tech-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tech-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tech-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tech-stat-card,
.tech-info-card {
  border: 3px solid #ffcf5c;
  background: linear-gradient(180deg, rgba(33, 46, 77, 0.92), rgba(12, 18, 31, 0.92));
  box-shadow: inset 0 0 0 3px rgba(255, 217, 95, 0.08);
}

.tech-stat-card {
  padding: 10px 8px;
  text-align: center;
}

.tech-stat-card strong {
  display: block;
  margin-top: 6px;
  color: #fff7c8;
  font-size: 1.65rem;
  line-height: 1;
}

.tech-info-card {
  padding: 12px;
}

.tech-stat-label {
  display: inline-block;
  color: var(--yellow);
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
  line-height: 1.4;
}

.tech-label-readout,
.tech-controls-copy,
.tech-status {
  margin: 8px 0 0;
  color: #e9f6ff;
  font-size: 1.1rem;
  line-height: 1.12;
}

.tech-restart {
  width: 100%;
}

.tech-board-frame {
  display: flex;
  justify-content: center;
  padding: 14px;
  border: 3px solid var(--cyan);
  background:
    radial-gradient(circle at 50% 20%, rgba(97, 201, 255, 0.12), transparent 48%),
    linear-gradient(180deg, #091321, #050b13);
  box-shadow:
    inset 0 0 0 3px rgba(97, 201, 255, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.tech-board {
  --tech-cols: 10;
  --tech-rows: 18;
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: calc(var(--tech-cols) / var(--tech-rows));
  border: 4px solid #ffcf5c;
  background:
    linear-gradient(rgba(255, 217, 95, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 217, 95, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #13233d 0%, #0b1324 100%);
  background-size:
    calc(100% / var(--tech-cols)) calc(100% / var(--tech-rows)),
    calc(100% / var(--tech-cols)) calc(100% / var(--tech-rows)),
    100% 100%;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 4px rgba(255, 237, 171, 0.08),
    0 0 0 4px #21180b;
}

.tech-piece {
  position: absolute;
  pointer-events: none;
}

.tech-piece-cell {
  position: absolute;
  border: 2px solid rgba(255, 249, 219, 0.24);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.25);
}

.tech-piece.is-active .tech-piece-cell {
  filter:
    brightness(1.06)
    drop-shadow(0 0 8px rgba(255, 217, 95, 0.2));
}

.tech-piece-label {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #fffceb;
  font-family: "Press Start 2P", monospace;
  text-align: center;
  line-height: 1.08;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tech-piece.is-active .tech-piece-label {
  color: #fffce8;
}

.tech-touch-controls {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tech-control-button[data-tech-action="left"] {
  grid-area: left;
}

.tech-control-button[data-tech-action="rotate"] {
  grid-area: rotate;
}

.tech-control-button[data-tech-action="right"] {
  grid-area: right;
}

.tech-control-button[data-tech-action="down"] {
  grid-area: down;
}

.tech-control-button[data-tech-action="drop"] {
  grid-area: drop;
}

.tech-control-button {
  min-height: 48px;
  padding: 10px 8px;
  border: 3px solid #ffcf5c;
  background: linear-gradient(180deg, #5a4310, #302104);
  color: #fff9da;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 0.46rem;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
  box-shadow:
    inset 0 0 0 3px rgba(255, 217, 95, 0.12),
    0 4px 0 #1d1302;
}

.tech-control-button-wide {
  grid-column: span 4;
}

.tech-control-button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.signal-shell {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.signal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signal-stat-card,
.signal-progress-card,
.signal-card-stage,
.signal-feedback {
  border: 3px solid #ffcf5c;
  background: linear-gradient(180deg, rgba(33, 46, 77, 0.92), rgba(12, 18, 31, 0.92));
  box-shadow: inset 0 0 0 3px rgba(255, 217, 95, 0.08);
}

.signal-stat-card {
  padding: 10px 8px;
  text-align: center;
}

.signal-stat-card strong {
  display: block;
  margin-top: 6px;
  color: #fff7c8;
  font-size: 1.65rem;
  line-height: 1;
}

.signal-progress-card {
  padding: 12px;
}

.signal-progress-text {
  margin: 8px 0 0;
  color: #e9f6ff;
  font-size: 1.08rem;
  line-height: 1.14;
}

.signal-restart,
.signal-next {
  width: 100%;
}

.signal-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.signal-card-stage {
  padding: 14px;
}

.signal-card-header {
  margin-bottom: 10px;
}

.signal-card {
  min-height: 200px;
  padding: 18px;
  border: 3px solid #c48516;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 241, 185, 0.26), transparent 40%),
    linear-gradient(180deg, #ffe67c 0%, #ffcc48 100%);
  color: #4c2c00;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow:
    inset 0 0 0 3px rgba(255, 248, 215, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.signal-card p {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.2;
}

.signal-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.signal-lane-button {
  min-height: 72px;
  padding: 14px 16px;
  border: 3px solid #61c9ff;
  background: linear-gradient(180deg, #173f60, #0c1c31);
  color: #fffce6;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 0.56rem;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
  box-shadow:
    inset 0 0 0 3px rgba(97, 201, 255, 0.16),
    0 4px 0 #06101e;
}

.signal-lane-button:hover,
.signal-lane-button:focus-visible {
  background: linear-gradient(180deg, #1f5379, #113052);
}

.signal-lane-button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.signal-lane-button.is-locked {
  opacity: 0.55;
  cursor: default;
}

.signal-lane-button.is-correct {
  border-color: #8df09a;
  background: linear-gradient(180deg, #1f6433, #11341b);
  box-shadow:
    inset 0 0 0 3px rgba(141, 240, 154, 0.18),
    0 4px 0 #0b1f10;
}

.signal-lane-button.is-wrong {
  border-color: #ff8e9b;
  background: linear-gradient(180deg, #6b2733, #381119);
  box-shadow:
    inset 0 0 0 3px rgba(255, 142, 155, 0.16),
    0 4px 0 #22080d;
}

.signal-feedback {
  padding: 14px;
}

.signal-feedback-title,
.signal-feedback-text {
  margin: 0;
}

.signal-feedback-title {
  color: #fff4bf;
  font-family: "Press Start 2P", monospace;
  font-size: 0.56rem;
  line-height: 1.5;
}

.signal-feedback-text {
  margin-top: 10px;
  color: #dceeff;
  font-size: 1.08rem;
  line-height: 1.15;
}

.signal-feedback.is-success {
  border-color: #8df09a;
  box-shadow: inset 0 0 0 3px rgba(141, 240, 154, 0.08);
}

.signal-feedback.is-success .signal-feedback-title {
  color: #bbffd2;
}

.signal-feedback.is-error {
  border-color: #ff9aaa;
  box-shadow: inset 0 0 0 3px rgba(255, 154, 170, 0.08);
}

.signal-feedback.is-error .signal-feedback-title {
  color: #ffd0d6;
}

.signal-actions {
  display: flex;
  justify-content: flex-end;
}

.signal-next[disabled] {
  opacity: 0.45;
  cursor: default;
}

.cleanup-shell {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cleanup-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cleanup-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cleanup-stat-card,
.cleanup-info-card,
.cleanup-panel,
.cleanup-feedback {
  border: 3px solid #ffcf5c;
  background: linear-gradient(180deg, rgba(33, 46, 77, 0.92), rgba(12, 18, 31, 0.92));
  box-shadow: inset 0 0 0 3px rgba(255, 217, 95, 0.08);
}

.cleanup-stat-card {
  padding: 10px 8px;
  text-align: center;
}

.cleanup-stat-card strong {
  display: block;
  margin-top: 6px;
  color: #fff7c8;
  font-size: 1.65rem;
  line-height: 1;
}

.cleanup-info-card,
.cleanup-panel {
  padding: 14px;
}

.cleanup-copy,
.cleanup-feedback-text {
  margin: 8px 0 0;
  color: #e9f6ff;
  font-size: 1.08rem;
  line-height: 1.15;
}

.cleanup-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cleanup-desk-panel {
  padding-bottom: 20px;
}

.cleanup-panel-header {
  margin-bottom: 10px;
}

.cleanup-desk {
  position: relative;
  padding: 14px 12px 0;
  border: 3px solid rgba(97, 201, 255, 0.2);
  background:
    radial-gradient(circle at top, rgba(123, 88, 47, 0.22), transparent 44%),
    linear-gradient(180deg, rgba(90, 61, 27, 0.34), rgba(49, 31, 13, 0.18));
  box-shadow: inset 0 0 0 2px rgba(255, 226, 151, 0.08);
}

.cleanup-drop-stage {
  display: flex;
  justify-content: center;
  padding: 8px 0 8px;
}

.cleanup-file {
  width: min(100%, 540px);
  padding: 18px 18px 20px;
  border: 3px solid #61c9ff;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(22, 40, 66, 0.98), rgba(11, 19, 32, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(151, 217, 255, 0.12),
    0 14px 24px rgba(0, 0, 0, 0.28);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
  color: #eaf6ff;
  position: relative;
  overflow: hidden;
}

.cleanup-file::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 56px;
  height: 1px;
  background: rgba(97, 201, 255, 0.18);
}

.cleanup-file::after {
  content: none;
}

.cleanup-file:hover,
.cleanup-file:focus-visible {
  transform: translateY(-2px);
  border-color: #f0ca67;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 18px 30px rgba(0, 0, 0, 0.28);
}

.cleanup-file:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.cleanup-file.is-locked {
  cursor: default;
  opacity: 0.82;
}

.cleanup-file-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.cleanup-file-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 2px solid rgba(97, 201, 255, 0.28);
  background: rgba(18, 77, 121, 0.42);
  color: #aee7ff;
  font-family: "Press Start 2P", monospace;
  font-size: 0.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cleanup-object-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 12px;
  border: 2px solid rgba(165, 119, 255, 0.68);
  border-radius: 999px;
  background: rgba(101, 67, 178, 0.24);
  color: #f2eaff;
  font-family: "Press Start 2P", monospace;
  font-size: 0.38rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cleanup-object-badge.is-contact {
  border-color: rgba(255, 127, 201, 0.72);
  background: rgba(178, 73, 132, 0.24);
  color: #ffe6f4;
}

.cleanup-object-badge.is-account {
  border-color: rgba(165, 119, 255, 0.68);
  background: rgba(101, 67, 178, 0.24);
  color: #f2eaff;
}

.cleanup-record-title {
  margin: 2px 0 16px;
  color: #fff8d1;
  font-family: "Press Start 2P", monospace;
  font-size: 0.56rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.cleanup-record-grid {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.cleanup-record-row {
  display: grid;
  grid-template-columns: minmax(128px, 172px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(97, 201, 255, 0.16);
  background: rgba(7, 17, 31, 0.5);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.cleanup-record-row-missing {
  border-color: rgba(255, 127, 201, 0.35);
  background: linear-gradient(180deg, rgba(97, 22, 68, 0.62), rgba(61, 14, 42, 0.72));
}

.cleanup-record-row-flag {
  position: relative;
  padding-left: 12px;
  border: 2px solid rgba(255, 103, 103, 0.72);
  background: linear-gradient(180deg, rgba(103, 24, 33, 0.9), rgba(70, 15, 22, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255, 187, 187, 0.18),
    0 2px 0 rgba(122, 34, 47, 0.18);
}

.cleanup-record-label {
  color: #8db8d8;
  font-family: "Press Start 2P", monospace;
  font-size: 0.44rem;
  line-height: 1.5;
}

.cleanup-record-value {
  color: #f5fbff;
  font-size: 1.05rem;
  line-height: 1.22;
}

.cleanup-record-row-missing .cleanup-record-label {
  color: #ffc8e6;
}

.cleanup-record-row-missing .cleanup-record-value {
  color: #ffe3f2;
  font-weight: 700;
}

.cleanup-record-row-flag .cleanup-record-label {
  color: #ffbec4;
}

.cleanup-record-row-flag .cleanup-record-value {
  color: #ffe4e7;
  font-weight: 700;
}

.cleanup-drag-hint {
  margin: 6px 0 0;
  color: #a8dcff;
  font-size: 1rem;
  text-align: center;
}

.cleanup-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.cleanup-desk-folders {
  margin-top: 22px;
  padding: 18px 8px 6px;
  border-top: 3px solid rgba(255, 221, 138, 0.18);
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}

.cleanup-action-button {
  min-height: 126px;
  padding: 18px 12px 14px;
  border: 3px solid #d39f31;
  border-radius: 10px 10px 12px 12px;
  background:
    linear-gradient(180deg, rgba(255, 226, 151, 0.96), rgba(221, 171, 67, 0.96));
  color: #583b00;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 0.46rem;
  line-height: 1.35;
  text-align: left;
  text-shadow: none;
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 204, 0.55),
    0 6px 0 #8a6517;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
  position: relative;
  overflow: visible;
}

.cleanup-action-button:hover,
.cleanup-action-button:focus-visible {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255, 234, 176, 0.98), rgba(231, 182, 77, 0.98));
}

.cleanup-action-button.is-drop-target {
  border-color: #fff0b8;
  background: linear-gradient(180deg, rgba(255, 242, 200, 0.98), rgba(232, 189, 95, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 252, 233, 0.68),
    0 6px 0 #8a6517,
    0 0 0 4px rgba(255, 217, 95, 0.18);
}

.cleanup-action-button.is-correct {
  border-color: #9fd89f;
  background: linear-gradient(180deg, #d7f1c2, #9ece79);
  box-shadow:
    inset 0 0 0 2px rgba(241, 255, 233, 0.72),
    0 6px 0 #5f873e;
}

.cleanup-action-button.is-wrong {
  border-color: #de8d9a;
  background: linear-gradient(180deg, #ffd9df, #f1a0ae);
  box-shadow:
    inset 0 0 0 2px rgba(255, 241, 244, 0.72),
    0 6px 0 #9d5565;
}

.cleanup-action-button.is-locked {
  cursor: default;
}

.cleanup-action-title,
.cleanup-action-copy,
.cleanup-folder-tab {
  display: block;
}

.cleanup-action-title {
  color: #654300;
  line-height: 1.4;
}

.cleanup-action-copy {
  margin-top: 8px;
  color: #6c4d11;
  font-family: "VT323", monospace;
  font-size: 0.92rem;
  line-height: 1.05;
  text-transform: none;
  letter-spacing: 0;
}

.cleanup-folder-tab {
  position: absolute;
  top: -16px;
  left: 14px;
  min-width: 74px;
  padding: 6px 10px 5px;
  border: 3px solid #d39f31;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #ffe9a9, #f2c96b);
  color: #7a570b;
  font-family: "Press Start 2P", monospace;
  font-size: 0.34rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.cleanup-desk-folders .cleanup-action-button:nth-child(1),
.cleanup-desk-folders .cleanup-action-button:nth-child(3),
.cleanup-desk-folders .cleanup-action-button:nth-child(5) {
  margin-top: 12px;
}

.cleanup-desk-folders .cleanup-action-button:nth-child(2),
.cleanup-desk-folders .cleanup-action-button:nth-child(4),
.cleanup-desk-folders .cleanup-action-button:nth-child(6) {
  margin-top: 0;
}

.cleanup-feedback {
  padding: 14px;
  border-color: #8df09a;
  box-shadow: inset 0 0 0 3px rgba(141, 240, 154, 0.08);
}

.cleanup-feedback.is-success {
  border-color: #8df09a;
  box-shadow: inset 0 0 0 3px rgba(141, 240, 154, 0.08);
}

.cleanup-feedback.is-error {
  border-color: #ff8ea0;
  box-shadow: inset 0 0 0 3px rgba(255, 142, 160, 0.08);
}

.cleanup-feedback-title {
  margin: 0;
  color: #bbffd2;
  font-family: "Press Start 2P", monospace;
  font-size: 0.56rem;
  line-height: 1.5;
}

.cleanup-next-wrap {
  display: flex;
  justify-content: flex-end;
}

.cleanup-next {
  min-width: 180px;
}

.cleanup-next[disabled] {
  opacity: 0.45;
  cursor: default;
}

.building[data-id="hospital"]::before,
.building[data-id="park"]::before {
  mix-blend-mode: normal;
}

.building::after {
  content: none;
}

.building:hover,
.building:focus-visible,
.building.active {
  box-shadow: none;
}

.building:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.building.active::before,
.building:hover::before,
.building:focus-visible::before {
  filter:
    saturate(1.1)
    brightness(1.08)
    drop-shadow(0 0 8px rgba(255, 248, 179, 0.7))
    drop-shadow(0 0 18px rgba(255, 217, 95, 0.7))
    drop-shadow(0 0 30px rgba(255, 217, 95, 0.45))
    drop-shadow(0 6px 5px rgba(0, 0, 0, 0.3));
}

.building.active .building-label,
.building:focus-visible .building-label,
.building:hover .building-label {
  color: var(--yellow);
}

.building-label {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -4px;
  z-index: 1;
  color: #fffce6;
  font-family: "Press Start 2P", monospace;
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.95);
}

.building-park .building-label {
  font-size: 0.78rem;
}

.walker {
  position: absolute;
  left: calc((var(--walker-col) - 0.5) * (100% / var(--grid-cols)));
  top: calc((var(--walker-row) - 0.5) * (100% / var(--grid-rows)));
  width: 64px;
  height: 54px;
  translate: -50% -50%;
  z-index: 3;
  pointer-events: none;
  transition: left 150ms steps(2, end), top 150ms steps(2, end), transform 100ms linear;
}

.walker::before,
.walker::after {
  content: "";
  position: absolute;
}

.walker::before {
  left: 50%;
  bottom: 0;
  width: 100%;
  height: 100%;
  translate: -50% 0;
  background: url("assets/Cat-Sit.png?v=1") center bottom / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.38));
}

.walker::after {
  content: none;
}

.walker.is-walking::before {
  width: 170%;
  height: 170%;
  background-image: url("assets/cat-walking.gif?v=2");
  mix-blend-mode: darken;
  filter: none;
}

.walker.is-walking-up::before,
.walker.is-walking-down::before {
  width: 72%;
  height: 142%;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 500% 100%;
  mix-blend-mode: normal;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.32));
  animation: cheddar-walk-vertical 450ms linear infinite;
}

.walker.is-walking-up::before {
  background-image: url("assets/Cat-Walk-Up-Sheet.png?v=2");
}

.walker.is-walking-down::before {
  background-image: url("assets/Cat-Walk-Down-Sheet.png?v=1");
}

.mobile-controls {
  display: none;
}

.move-button {
  min-height: 48px;
  padding: 8px 10px;
  border: 3px solid var(--cyan);
  background: linear-gradient(180deg, #173f60, #0c1c31);
  color: #fffce6;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 0.48rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85);
  touch-action: manipulation;
  box-shadow:
    inset 0 0 0 3px rgba(97, 201, 255, 0.16),
    0 4px 0 #06101e;
}

.move-button:active {
  translate: 0 3px;
  box-shadow:
    inset 0 0 0 3px rgba(255, 217, 95, 0.18),
    0 1px 0 #06101e;
}

.move-button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.move-button-up {
  grid-area: up;
}

.move-button-left {
  grid-area: left;
}

.move-button-right {
  grid-area: right;
}

.move-button-down {
  grid-area: down;
}

@keyframes cheddar-walk-vertical {
  0%,
  19.999% {
    background-position: 0 0;
  }

  20%,
  39.999% {
    background-position: 25% 0;
  }

  40%,
  59.999% {
    background-position: 50% 0;
  }

  60%,
  79.999% {
    background-position: 75% 0;
  }

  80%,
  100% {
    background-position: 100% 0;
  }
}

@media (max-width: 900px) {
  .page {
    min-height: 100dvh;
    padding: 14px;
  }

  .hud p,
  .building-popup p {
    font-size: 1.05rem;
  }

  .view-description,
  .tech-label-readout,
  .tech-controls-copy,
  .tech-status {
    font-size: 1rem;
  }

  .map {
    width: min(100%, 900px, calc((100vh - 260px) * 1.23));
  }

  .tech-layout {
    grid-template-columns: 1fr;
  }

  .signal-shell {
    grid-template-columns: 1fr;
  }

  .cleanup-shell {
    grid-template-columns: 1fr;
  }

  .tech-sidebar {
    order: 3;
  }

  .tech-board-frame {
    order: 1;
  }

  .tech-touch-controls {
    order: 2;
  }

  .signal-sidebar {
    order: 2;
  }

  .signal-main {
    order: 1;
  }

  .cleanup-sidebar {
    order: 2;
  }

  .cleanup-main {
    order: 1;
  }

  .building {
    margin: 2px;
  }

  .building-label {
    font-size: 0.5rem;
  }
}

@media (hover: none), (max-width: 760px) {
  .mobile-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      ". up ."
      "left . right"
      ". down .";
    gap: 8px;
    width: min(250px, 100%);
    margin: 12px auto 0;
  }

  .tech-touch-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "left rotate right"
      "down drop drop";
    gap: 10px;
    width: min(100%, 420px);
    margin: -2px auto 0;
  }

  .tech-control-button {
    min-height: 56px;
    padding: 12px 8px;
    font-size: 0.5rem;
  }

  .tech-control-button-wide {
    grid-column: auto;
  }

  .signal-lanes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .signal-lane-button {
    min-height: 64px;
  }
}

@media (max-width: 640px) {
  body,
  .page {
    height: auto;
    min-height: 100dvh;
  }

  body {
    overflow: auto;
  }

  .page {
    padding: 10px;
  }

  .hud h1 {
    margin-bottom: 8px;
    font-size: 0.8rem;
  }

  .hud p,
  .building-popup p {
    font-size: 0.92rem;
  }

  .view-heading h2 {
    font-size: 0.7rem;
  }

  .view-kicker {
    font-size: 0.8rem;
  }

  .view-description,
  .tech-label-readout,
  .tech-controls-copy,
  .tech-status,
  .signal-progress-text,
  .signal-feedback-text {
    font-size: 0.92rem;
  }

  .building-popup {
    width: min(54vw, 250px);
    min-height: 96px;
    padding: 12px 30px 12px 12px;
  }

  .map-shell {
    flex: none;
    width: min(100%, 1120px);
    padding: 10px;
  }

  .map {
    flex: none;
    width: 100%;
  }

  .tech-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tech-stat-card strong {
    font-size: 1.4rem;
  }

  .tech-board-frame {
    padding: 10px;
  }

  .tech-touch-controls {
    gap: 8px;
    margin-top: 0;
  }

  .tech-control-button {
    min-height: 54px;
    font-size: 0.44rem;
    line-height: 1.15;
  }

  .signal-card {
    min-height: 170px;
    padding: 14px;
  }

  .signal-card p {
    font-size: 1.2rem;
  }

  .signal-lane-button {
    min-height: 58px;
    padding: 10px;
    font-size: 0.42rem;
    line-height: 1.28;
  }

  .cleanup-record-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cleanup-record-label {
    font-size: 0.4rem;
  }

  .cleanup-record-value,
  .cleanup-copy,
  .cleanup-feedback-text {
    font-size: 0.92rem;
  }

  .cleanup-file {
    padding: 14px;
  }

  .cleanup-record-title,
  .cleanup-action-title {
    text-align: left;
  }

  .cleanup-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cleanup-desk-folders .cleanup-action-button:nth-child(n) {
    margin-top: 0;
  }

  .cleanup-action-button {
    min-height: 92px;
    font-size: 0.46rem;
  }

  .cleanup-action-copy,
  .cleanup-drag-hint {
    font-size: 0.92rem;
  }

  .cleanup-folder-tab {
    font-size: 0.3rem;
  }

  .cleanup-feedback-title {
    font-size: 0.5rem;
  }

  .signal-feedback-title {
    font-size: 0.5rem;
  }

  .cleanup-desk {
    padding: 10px 8px 0;
  }

  .walker {
    width: 44px;
    height: 38px;
  }

  .building {
    margin: 1px;
  }

  .building::before {
    inset: 1% 1% 20%;
  }

  .building-label {
    font-size: 0.36rem;
  }

  .building-popup h2 {
    font-size: 0.48rem;
  }

  .building-popup-close {
    top: 6px;
    right: 6px;
  }
}
