:root {
  --ink: #202b3b;
  --paper: #faf6ed;
  --accent: #f4a66a;
  --mint: #9cdbce;
  --line: #d7d7ce;
  --shadow: 0 6px 0 #26334118;
  font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
select {
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  padding: 10px 16px;
  color: var(--ink);
  background: #fffaf1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 #26334125;
  touch-action: manipulation;
}
button:active {
  transform: translateY(2px);
  box-shadow: none;
}
button:hover {
  background: #ffe5bb;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button[aria-pressed="true"] {
  background: var(--mint);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #176caa;
  outline-offset: 4px;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(18px, 2.5vw, 26px);
}
h2 {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -0.8px;
}
p {
  line-height: 1.55;
}
main {
  max-width: 1260px;
  margin: auto;
  padding: 20px 28px;
}
.top {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 2px solid var(--line);
  background: #fffaf2;
  flex-wrap: wrap;
}
.top h1 {
  margin-right: auto;
}
.brand {
  font-weight: 900;
  text-decoration: none;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 900;
}
.mission {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.mission p {
  margin-top: 8px;
  max-width: 650px;
}
.companion {
  display: flex;
  align-items: center;
  max-width: 260px;
  font-size: 14px;
  font-weight: 700;
}
.pip {
  width: 104px;
  min-width: 74px;
  animation: bob 4s ease-in-out infinite;
}
.eyes {
  transform-origin: 120px 102px;
  animation: blink 6s infinite;
}
.companion[data-mood="win"] .pip {
  animation: bob 0.6s ease-in-out 3;
}
.companion[data-mood="worried"] .mouth {
  transform: translateY(277px) scaleY(-1);
}
#notice {
  min-height: 28px;
  margin: 12px 0;
  font-weight: 700;
}
.footer-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.world-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.map-start {
  margin-bottom: 20px;
}
.map-start button {
  background: var(--mint);
}
.map-world {
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(135deg, #d8eee3, #f5efd5);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.world-1 {
  background: linear-gradient(135deg, #dae5f8, #efe3f2);
}
.world-2 {
  background: linear-gradient(135deg, #f7dfc3, #eff0df);
}
.world-3 {
  background: linear-gradient(135deg, #e4dcf8, #ddeee8);
}
.path {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 18px;
  position: relative;
  margin-top: 20px;
}
.node {
  width: 29%;
  padding: 10px 6px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
  min-height: 116px;
}
.node:nth-child(even) {
  transform: translateY(12px);
}
.node strong {
  border: 2px solid;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #fff;
}
.node span {
  font-size: 12px;
}
.node small {
  font-size: 11px;
}
.node.done {
  background: #bce3c4;
}
.panel {
  background: #fffaf2;
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(240px, 360px) minmax(
      170px,
      1fr
    );
  gap: 22px;
  align-items: start;
}
.panel h3 {
  margin-bottom: 12px;
}
.panel p {
  margin: 10px 0;
}
.modes,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.controls button {
  flex: 1;
  min-width: 64px;
}
.board-wrap {
  background: #27364a;
  padding: 12px;
  border-radius: 22px;
  box-shadow:
    0 8px 0 #172335,
    0 15px 28px #202b3b25;
  border: 3px solid #15243a;
}
.board-wrap canvas {
  width: 100%;
  display: block;
  border-radius: 9px;
  background: #132035;
  aspect-ratio: 1/2;
}
.board-caption {
  color: white;
  text-align: center;
  font-size: 12px;
  padding: 8px;
}
.meter {
  height: 12px;
  background: #d9ddd7;
  border-radius: 10px;
  overflow: hidden;
  margin: 6px 0 14px;
}
.meter span {
  display: block;
  height: 100%;
  background: #72b8ad;
}
.stat {
  font-size: 32px;
  font-weight: 900;
}
.tape {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tape span {
  border: 1px solid;
  border-radius: 5px;
  padding: 3px;
  font-size: 11px;
}
.tape .active {
  background: #ffc875;
}
.candidate {
  padding: 10px;
  margin: 8px 0;
  background: #e8eee8;
  border-radius: 10px;
}
.candidate:first-child {
  border: 2px solid #568b7e;
}
dialog {
  max-width: min(480px, calc(100vw - 24px));
  width: 440px;
  border: 3px solid var(--ink);
  border-radius: 25px;
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 20px 80px #0004;
}
dialog::backdrop {
  background: #15233599;
}
dialog p {
  margin: 15px 0;
}
dialog label {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}
dialog input {
  width: 24px;
  height: 24px;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.stars {
  font-size: 48px;
  color: #936000;
  margin: 14px 0;
}
.workbench {
  min-height: 340px;
  background: linear-gradient(#dce8e6 70%, #bfa284 70%);
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 22px;
}
.workbench .panel {
  margin-bottom: 15px;
}
.tiles {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.tiles button {
  max-width: 100%;
  text-align: left;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.log {
  background: #213345;
  color: #dcefe9;
  border-radius: 14px;
  padding: 18px;
  white-space: pre-wrap;
  line-height: 1.7;
  min-height: 90px;
  max-height: 280px;
  overflow: auto;
}
.mini-app {
  background: white;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  margin: 14px 0;
  min-height: 140px;
  overflow: auto;
}
.large-input {
  min-height: 48px;
  border: 2px solid;
  border-radius: 10px;
  padding: 8px;
  width: 100%;
  max-width: 240px;
}
.pad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 520px;
  margin: auto;
}
.memory-pad {
  height: 140px;
  font-size: 34px;
  background: #9cdbce;
}
.memory-pad:nth-child(2) {
  background: #ffc66d;
}
.memory-pad:nth-child(3) {
  background: #d7c2ec;
}
.memory-pad:nth-child(4) {
  background: #a9c9ed;
}
.memory-pad.lit {
  outline: 6px solid #202b3b;
  outline-offset: -12px;
  transform: scale(0.97);
  background: white;
}
.target-field {
  height: 330px;
  position: relative;
  border: 2px dashed #80968e;
  border-radius: 20px;
  background: #edf2e8;
  overflow: hidden;
}
.target {
  position: absolute;
  min-width: 64px;
  min-height: 64px;
  font-size: 22px;
  background: #a7dbbe;
}
.range-visual {
  display: flex;
  gap: 4px;
  min-height: 100px;
  align-items: center;
  overflow: hidden;
  margin: 16px 0;
}
.range-visual span {
  flex: 1;
  height: 60px;
  border: 1px solid var(--ink);
  background: #9cdbce;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.range-visual span.eliminated {
  opacity: 0.15;
}
.badge {
  padding: 7px 12px;
  border-radius: 20px;
  background: #e2eadf;
  display: inline-block;
}
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.evidence {
  min-height: 110px;
  text-align: left;
  background: #fff9d9;
}
.evidence[aria-pressed="true"] {
  outline: 3px solid #356b5c;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  padding: 10px;
  font-weight: 700;
}
.reduced * {
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
}
@keyframes bob {
  50% {
    transform: translateY(-5px);
  }
}
@keyframes blink {
  0%,
  44%,
  48%,
  100% {
    transform: scaleY(1);
  }
  46% {
    transform: scaleY(0.1);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 850px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  }
  .game-layout .brain {
    grid-column: 1/-1;
  }
  .world-map {
    grid-template-columns: 1fr;
  }
  .companion {
    max-width: 190px;
  }
  .top {
    gap: 8px;
    padding: 12px;
  }
  .brand {
    display: none;
  }
}
@media (max-width: 580px) {
  main {
    padding: 16px 12px;
  }
  .top h1 {
    order: -1;
    width: 100%;
  }
  .top button {
    padding: 8px 10px;
    font-size: 13px;
  }
  .mission {
    gap: 8px;
  }
  .companion {
    display: none;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .game-layout .left-rail {
    order: 2;
  }
  .game-layout .board-center {
    order: 1;
    width: min(100%, 310px);
    margin: auto;
  }
  .game-layout .brain {
    order: 3;
  }
  .board-wrap {
    padding: 8px;
  }
  .world-map {
    gap: 14px;
  }
  .map-world {
    padding: 16px;
  }
  .panel,
  .workbench {
    padding: 14px;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .evidence-grid {
    grid-template-columns: 1fr 1fr;
  }
  .memory-pad {
    height: 115px;
  }
  .controls {
    gap: 8px;
  }
  .controls button {
    padding: 8px;
    min-width: 70px;
  }
  .node {
    width: 28%;
  }
}

[hidden] {
  display: none !important;
}
/* World scenery stays outside the board and does not carry game information. */
#game[data-world="1"] {
  --accent: #b6a2e1;
  background:
    radial-gradient(ellipse at 85% 25%, #d9d2f888, transparent 45%),
    var(--paper);
}
#game[data-world="2"] {
  --accent: #edb06f;
  background:
    radial-gradient(ellipse at 15% 45%, #f3d6a488, transparent 45%),
    var(--paper);
}
#game[data-world="3"] {
  --accent: #85c9bd;
  background:
    radial-gradient(ellipse at 75% 40%, #afded488, transparent 45%),
    var(--paper);
}
.board-wrap {
  position: relative;
  background: linear-gradient(
    130deg,
    #577782,
    #243b50 30%,
    #324858 70%,
    #526f79
  );
  border-color: #203847;
}
.board-wrap:before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #cfdbd66b;
  border-radius: 15px;
  pointer-events: none;
}
#game[data-world="1"] .board-wrap {
  background: linear-gradient(130deg, #8174b4, #363a61 35%, #526088);
}
#game[data-world="2"] .board-wrap {
  background: linear-gradient(130deg, #c89d70, #584947 35%, #807157);
}
#game[data-world="3"] .board-wrap {
  background: linear-gradient(130deg, #7ac0aa, #274c51 35%, #548b88);
}
.map-world {
  position: relative;
}
.map-world:after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 45%;
  height: 45px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 12px,
    #ffffff45 12px 30px
  );
  pointer-events: none;
}
@media (max-width: 580px) {
  .game-layout .board-center {
    width: min(100%, 310px, max(210px, calc((100svh - 310px) / 2)));
  }
  .top button {
    flex: 1;
  }
  .top > a {
    font-size: 13px;
  }
  .top h1 {
    font-size: 20px;
  }
  .mission p {
    font-size: 14px;
  }
  .mission h2 {
    font-size: 22px;
  }
  .modes button {
    padding: 8px 11px;
    font-size: 13px;
  }
  .controls button {
    min-width: 65px;
    min-height: 48px;
    font-size: 12px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand .pip {
  width: 34px;
  min-width: 34px;
  animation: none;
}
.brand .eyes {
  animation: none;
}
@media (max-width: 850px) {
  .brand span {
    display: none;
  }
}
.repair-machine {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  margin: 8px 0 22px;
}
.repair-track {
  height: 26px;
  position: relative;
  flex: 1;
  background: repeating-linear-gradient(90deg, #739991 0 5px, #abc5ba 5px 12px);
  border: 2px solid;
  border-radius: 10px;
}
.repair-packet {
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 16px;
  background: #ffc66d;
  border: 2px solid;
  border-radius: 5px;
}
.instruction-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  min-height: 50px;
  border-left: 5px solid #bcd5ca;
  padding-left: 12px;
}
.instruction {
  text-align: left;
  font-weight: 500;
}
.repair-workbench .log {
  margin-top: 15px;
}
.detective-board {
  padding: 24px;
  border: 8px solid #a98258;
  border-radius: 22px;
  background: radial-gradient(#b9987233 1px, transparent 1px), #dcc6a0;
  background-size: 9px 9px;
  display: grid;
  gap: 20px;
}
.evidence-record {
  position: relative;
}
.evidence-record button {
  width: 100%;
  height: 100%;
}
.evidence-link {
  display: block;
  font-size: 12px;
  font-weight: 900;
  padding: 8px;
  color: #214c43;
}
.verdict-desk {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.verdict-desk select {
  max-width: 100%;
  white-space: normal;
}
.detective-board h3 {
  margin: 12px 0;
}
.evidence:before {
  content: "●";
  display: block;
  color: #805739;
  margin-bottom: 8px;
}
@media (max-width: 580px) {
  .detective-board {
    padding: 12px;
    border-width: 5px;
  }
  .evidence-grid {
    grid-template-columns: 1fr;
  }
  .evidence {
    min-height: 70px;
  }
}
.operations {
  background: linear-gradient(145deg, #cbded7, #dce2ee);
  border: 3px solid #273e4c;
  border-radius: 24px;
  padding: 24px;
  display: grid;
  gap: 20px;
}
.ops-scene {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
}
.ops-station {
  border: 3px solid #29404a;
  background: #f8efdc;
  border-radius: 16px;
  padding: 18px;
  font-size: 12px;
  text-align: center;
  max-width: 38%;
  box-shadow: 0 8px #5c7877;
}
.ops-station strong {
  display: block;
  font-size: 18px;
  margin-top: 10px;
}
.ops-wire {
  flex: 1;
  position: relative;
  border-top: 5px dashed #668e83;
}
.ops-packet {
  position: absolute;
  width: 14px;
  height: 14px;
  top: -10px;
  background: #e2a366;
  border: 2px solid;
  border-radius: 4px;
}
.ops-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.operations .tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 580px) {
  .operations {
    padding: 14px;
  }
  .operations .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ops-station {
    padding: 10px;
  }
  .ops-station strong {
    font-size: 14px;
  }
}
.debug-studio {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  padding: 20px;
  background: #d6e2df;
  border: 3px solid #35494c;
  border-radius: 24px;
}
.mini-app > * {
  margin: 8px 0;
}
.patch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #d7d7ce;
  flex-wrap: wrap;
}
.patch-row select {
  max-width: 100%;
}
.debug-studio .log {
  margin-top: 16px;
  font-size: 14px;
}
.debug-studio #run-tests {
  margin: 16px 0;
}
#test-results {
  line-height: 1.8;
  font-weight: 700;
}
@media (max-width: 700px) {
  .debug-studio {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}
.reduced .repair-packet,
.reduced .ops-packet {
  visibility: hidden;
}
.echo-console {
  background: linear-gradient(135deg, #d4e8de, #e6dcec);
  padding: 28px;
  border: 4px solid #324b50;
  border-radius: 32px;
  box-shadow: 0 10px #748782;
}
.echo-display {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  background: #283e45;
  color: #fff5df;
  padding: 18px;
  border-radius: 15px;
  margin-bottom: 24px;
}
.memory-pad {
  border-width: 3px;
  box-shadow: 0 8px #344c4c66;
}
.memory-pad small {
  display: block;
  font-size: 14px;
}
.echo-console > p {
  margin: 20px 0;
}
.night-console {
  background: #172b39;
  color: #f9f5e9;
}
.night-console button {
  color: #1a2c36;
}
.echo-console #replay {
  margin-top: 14px;
}
@media (max-width: 580px) {
  .echo-console {
    padding: 18px;
  }
  .pad-grid {
    gap: 14px;
  }
}
.panel,
.verdict-desk,
.detective-board > * {
  min-width: 0;
}
.verdict-desk label {
  display: block;
  min-width: 0;
}
.verdict-desk select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}
.tiles button {
  overflow-wrap: anywhere;
}
.reflex-console {
  padding: 24px;
  border: 4px solid #324b50;
  border-radius: 25px;
  background: linear-gradient(135deg, #e1e9cf, #d5e8e6);
}
.reflex-banner {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.reflex-banner strong {
  font-size: 28px;
  background: #243e44;
  color: #fff7df;
  border-radius: 14px;
  padding: 16px;
}
.reflex-banner strong.go {
  background: #285e46;
}
.reflex-banner strong.hold {
  background: #824736;
}
.reflex-hud {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 18px 0;
  font-weight: 700;
}
.reflex-console .target {
  max-width: 84px;
  font-size: 15px;
  min-width: 64px;
  padding: 8px;
}
.reflex-console > p {
  font-size: 14px;
}
@media (max-width: 580px) {
  .reflex-console {
    padding: 14px;
  }
  .reflex-banner strong {
    font-size: 23px;
  }
}
.search-world {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 3px solid #354c51;
  border-radius: 28px;
  background: linear-gradient(140deg, #d0e5da, #e5dfbf);
}
.search-radar {
  width: 200px;
  height: 200px;
  border: 4px solid #527b6c;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: repeating-radial-gradient(
    circle,
    transparent 0 27px,
    #91b7a7 28px 29px
  );
  position: relative;
}
.search-radar strong {
  font-size: 54px;
}
.search-radar > span:last-child {
  font-size: 12px;
  background: #d9e7ce;
  padding: 4px;
}
.search-desk .controls {
  margin-top: 16px;
}
.search-desk h3 {
  margin-top: 12px;
}
.range-visual span {
  min-width: 0;
}
@media (max-width: 650px) {
  .search-world {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .search-radar {
    width: 120px;
    height: 120px;
    margin: auto;
  }
  .search-radar strong {
    font-size: 34px;
  }
  .search-world .range-visual {
    gap: 2px;
  }
}
.piece-preview {
  display: inline-grid;
  gap: 2px;
  margin: 12px 8px 4px 0;
  vertical-align: middle;
}
.piece-preview i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: block;
}
.next-label {
  display: block;
}
.master-skin .board-wrap {
  background: linear-gradient(140deg, #ffd981, #ab8254, #ffe7a5);
  border-color: #876136;
}
.map-world .path {
  padding: 10px 0 20px;
  gap: 22px 14px;
  isolation: isolate;
}
.map-world .path:before {
  content: "";
  position: absolute;
  inset: 42px 12% 60px;
  border: 5px dashed #52796755;
  border-radius: 40%;
  z-index: -1;
}
.node {
  border-radius: 22px 22px 32px 32px;
  background: #fffaf1;
  box-shadow: 0 6px 0 #26334122;
}
.node strong {
  width: 42px;
  height: 42px;
  font-size: 19px;
}
.node:disabled {
  opacity: 0.62;
}
.node.done strong {
  background: #335c50;
  color: #fff;
}
.node:not(:disabled):not(.done) {
  outline: 3px solid #db9a43;
  outline-offset: 3px;
}
.node span {
  font-weight: 800;
  line-height: 1.25;
}
.node small {
  letter-spacing: 0.4px;
}
.world-1 .path:before {
  border-color: #8077ab66;
}
.world-2 .path:before {
  border-color: #9e795966;
}
.world-3 .path:before {
  border-color: #417e8466;
}
.repair-workbench {
  background:
    linear-gradient(transparent 0 88%, #ad8864 88%),
    repeating-linear-gradient(90deg, #d9e7de 0 68px, #cbded5 68px 71px);
  border-width: 4px;
  box-shadow: 0 10px #8b705b;
}
.repair-workbench .panel {
  border-color: #496762;
  background: #fffbed;
}
.repair-machine {
  min-height: 65px;
  padding: 12px;
  background: #49756f;
  color: #fff8e6;
  border: 3px solid #253e3a;
  border-radius: 15px;
  box-shadow: 0 6px #264b44;
}
.repair-machine > span:last-child {
  background: #e7b76d;
  color: #253e3a;
  border: 2px solid;
  padding: 10px;
  border-radius: 12px;
}
.repair-track {
  background: repeating-linear-gradient(90deg, #436359 0 5px, #83a99a 5px 12px);
}
.instruction {
  border-radius: 8px 18px 18px 8px;
  border-left: 10px solid #78aa99;
  box-shadow: 0 4px #4d76622a;
}
.instruction[aria-pressed="true"] {
  border-left-color: #ca8f39;
}
.instruction-rail:empty:after {
  content: "Empty instruction socket";
  border: 2px dashed #9cac9f;
  border-radius: 12px;
  padding: 18px;
  color: #536a60;
  font-size: 14px;
}
.repair-workbench #test-output {
  background: #f4c573;
}
.detective-board .evidence {
  border-radius: 3px 3px 18px 3px;
  box-shadow: 3px 6px 0 #7e64412b;
  background: linear-gradient(#fff4c9 0 24px, #fff9dc 24px);
  border-color: #6d654e;
}
.evidence-record:nth-child(3n + 1) {
  transform: rotate(-1deg);
}
.evidence-record:nth-child(3n + 2) {
  transform: rotate(1deg);
}
.evidence-record:has([aria-pressed="true"]):after {
  content: "";
  display: block;
  height: 22px;
  border-left: 3px solid #b76b58;
  position: absolute;
  left: 50%;
  top: 100%;
}
.detective-board .panel:first-child {
  border-top: 9px solid #778e84;
}
.detective-board .verdict-desk {
  border-top: 9px solid #b2936a;
}
.evidence-link {
  background: #f6dfb9;
  border-radius: 0 0 8px 8px;
  position: relative;
  z-index: 1;
}
.ops-station {
  background: #263f4b;
  color: #b7ebd6;
  border-color: #182c39;
  box-shadow:
    0 8px #748b81,
    inset 0 0 18px #a2d6ba22;
}
.ops-station strong {
  color: #e7f8df;
}
.operations .tool-grid button {
  min-height: 68px;
  background: #f8f3dc;
  border-radius: 12px;
  box-shadow: 0 5px #5d776b44;
  display: flex;
  align-items: center;
  gap: 12px;
}
.operations .tool-grid button > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid;
  border-radius: 9px;
  background: #b8dace;
  font-size: 21px;
  flex-shrink: 0;
}
.operations {
  background: repeating-linear-gradient(
    0deg,
    #cbded7 0 34px,
    #bfd3cc 34px 35px
  );
}
.operations .log {
  border: 6px solid #607c7a;
  box-shadow: inset 0 0 25px #071c3044;
}
.ops-stages .badge {
  border: 1px solid #64857b;
}
.debug-studio .mini-app {
  border-width: 2px;
  border-top-width: 24px;
  position: relative;
  box-shadow: 0 6px #30495333;
}
.debug-studio .mini-app:before {
  content: "● ● ●  preview.local";
  position: absolute;
  top: -21px;
  left: 8px;
  color: #f4d99b;
  font-size: 10px;
  letter-spacing: 2px;
}
.debug-studio .panel {
  background: #faf7e9;
}
.debug-studio #patch-fields {
  background: #e1ebdf;
  padding: 8px 14px;
  border-radius: 12px;
}
.debug-studio #run-tests {
  background: #aed4ba;
}
.reflex-console .target-field {
  background:
    radial-gradient(ellipse at 50% 110%, #b6d8a7, transparent 65%),
    repeating-linear-gradient(0deg, transparent 0 48px, #a8c3b533 48px 49px),
    repeating-linear-gradient(90deg, #edf2e8 0 48px, #a8c3b533 48px 49px);
  border: 3px solid #6e9382;
}
.reflex-console .target {
  border-radius: 50%;
  width: 76px;
  height: 76px;
  box-shadow: 0 6px #5d827744;
}
.search-world .range-visual span {
  border-radius: 4px 4px 0 0;
  box-shadow: inset -3px 0 #52786533;
}
.search-world .search-desk {
  border-top: 9px solid #668d7b;
}
@media (max-width: 580px) {
  .repair-machine {
    font-size: 9px;
    padding: 8px;
    gap: 6px;
  }
  .repair-machine > span:last-child {
    padding: 8px;
  }
  .operations .tool-grid button {
    font-size: 13px;
    gap: 6px;
    padding: 9px;
  }
  .operations .tool-grid button > span {
    width: 27px;
    height: 27px;
    font-size: 17px;
  }
  .node {
    border-radius: 18px;
  }
  .node strong {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
}
.search-tree {
  border: 2px solid #668d7b;
  border-radius: 16px;
  padding: 14px;
  margin: 16px 0;
  background: #edf2e8;
}
.tree-root {
  width: fit-content;
  margin: 12px auto;
  padding: 8px 20px;
  border: 2px solid #324b50;
  border-radius: 10px;
  background: #c5e1d3;
}
.tree-branches {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  text-align: center;
  align-items: center;
}
.tree-branches > span {
  border-top: 2px solid #668d7b;
  padding: 10px 2px;
  font-size: 13px;
}
.tree-branches button {
  padding: 8px 4px;
  font-size: 13px;
}
.search-tree p {
  font-size: 13px;
}
