.task-status {
  min-height: 1.35em;
  margin-top: 10px;
  color: var(--gold-light);
  font-size: .81rem;
  line-height: 1.4;
}
.task-controls { display: flex; justify-content: flex-end; gap: 7px; margin-top: 9px; }
.task-controls .button { min-height: 41px; }

.patch-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
  user-select: none;
}
.patch-board, .patch-tray {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  padding: 5px;
  border: 1px solid #66543c;
  border-radius: 7px;
  background: #1c211b;
}
.patch-board { gap: 1px; }
.patch-tray { background: #3b3023; }
.patch-slot, .patch-piece {
  position: relative;
  width: 100%;
  min-height: 44px;
  aspect-ratio: 4 / 3;
  padding: 0;
  touch-action: none;
  border: 1px dashed #ae9166;
  border-radius: 3px;
  background-color: #2a2a21;
  background-size: 200% 200%;
  background-position: var(--poster-x) var(--poster-y);
}
.patch-slot::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .23;
  pointer-events: none;
  background: url("./assets/packing-poster.svg") var(--poster-x) var(--poster-y) / 200% 200%;
}
.patch-slot:not(:disabled):hover { border-color: var(--gold-light); background-color: #3a3222; }
.patch-piece {
  cursor: grab;
  border: 1px solid #593a24;
  background-image: url("./assets/packing-poster.svg");
}
.patch-piece[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--gold-light); z-index: 1; }
.patch-piece.is-used { visibility: hidden; }
.patch-slot.is-placed { border-color: #aa8249; }
.patch-slot.is-placed::before { opacity: 1; animation: piece-snap .27s ease both; }
.patch-layout.is-complete .patch-board { animation: board-complete .55s ease both; }
.patch-piece.patch-ghost {
  position: fixed;
  z-index: 10;
  transform: translate(-50%, -50%) rotate(-4deg);
  box-shadow: 0 7px 20px #0008;
  pointer-events: none;
}
@keyframes piece-snap { 45% { transform: scale(1.06); filter: brightness(1.18); } }
@keyframes board-complete { 50% { box-shadow: 0 0 24px #f3c77a9c; } }

.circuit-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 260px);
  aspect-ratio: 1;
  margin: 14px auto 0;
  border: 2px solid #766646;
  border-radius: 8px;
  background: #18251f;
  user-select: none;
  touch-action: none;
}
.circuit-cell {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 1px solid #a8b69227;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  touch-action: none;
}
.circuit-cell:hover { background: #b9cd8916; }
.circuit-cell:focus-visible { z-index: 2; outline-offset: -2px; }
.circuit-cell[data-wire="amber"], .circuit-cell[data-terminal="amber"] { --wire-color: #f5c36a; }
.circuit-cell[data-wire="mint"], .circuit-cell[data-terminal="mint"] { --wire-color: #a3d7ad; }
.circuit-cell[data-wire="rose"], .circuit-cell[data-terminal="rose"] { --wire-color: #ee9eae; }
.terminal {
  display: grid;
  position: relative;
  z-index: 1;
  width: 63%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--wire-color);
  border-radius: 50%;
  background: #19231b;
  color: var(--wire-color);
  font-size: clamp(.78rem, 3vw, 1.03rem);
  pointer-events: none;
}
.cell-wires { position: absolute; inset: 0; pointer-events: none; }
.wire { position: absolute; background: var(--wire-color); box-shadow: 0 0 6px var(--wire-color); }
.wire-up, .wire-down { left: calc(50% - 2px); width: 4px; height: calc(50% + 2px); }
.wire-left, .wire-right { top: calc(50% - 2px); height: 4px; width: calc(50% + 2px); }
.wire-up { top: 0; }
.wire-down { bottom: 0; }
.wire-left { left: 0; }
.wire-right { right: 0; }
.circuit-board.is-complete { animation: board-complete .6s ease both; }

.press-screen {
  position: relative;
  display: grid;
  gap: 3px;
  overflow: hidden;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid #96794f;
  border-radius: 8px;
  background: linear-gradient(160deg, #523528, #2b241b);
}
.press-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 4px; align-items: center; }
.press-step {
  display: grid;
  min-height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid #89714d;
  border-radius: 5px;
  background: #302a1e;
  color: var(--gold-light);
  font-size: 1.17rem;
}
.press-step:hover:not(:disabled) { background: #675035; }
.press-step:disabled { opacity: .38; }
.press-well {
  position: relative;
  height: clamp(42px, 9vw, 51px);
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  border: 1px solid #a98b62;
  border-radius: 3px;
  background: #bba075;
}
.press-well::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 calc(50% - 1px);
  border-left: 2px dashed #fbe7b7b8;
  pointer-events: none;
}
.press-band {
  position: absolute;
  inset: 0;
  transform: translateX(calc(var(--offset) * 12%));
  background: #d8c49b var(--proof-image) center var(--band-y) / auto 300% no-repeat;
  transition: transform .17s ease;
  pointer-events: none;
}
.registration-pin {
  position: absolute;
  top: 5px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border: 1px solid #8c612c;
  border-radius: 50%;
  background: #f9ca68;
  box-shadow: 0 0 0 2px #251e17b8;
}
.press-row.is-aligned .press-well { border-color: #b8d39a; }
.press-row.is-aligned .registration-pin { background: #b8d39a; }
.press-screen.is-printed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, transparent 10%, #f5c4759c, transparent 90%);
  pointer-events: none;
  animation: press-sweep .68s ease both;
}
@keyframes press-sweep { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

.maze-hud { display: flex; justify-content: space-between; margin: 11px 0 6px; color: var(--gold-light); font: 700 .76rem var(--mono); }
.maze-clock.is-low { color: #ffaf9c; }
.maze-board {
  --tile-x: calc(100% / 11);
  --tile-y: calc(100% / 9);
  position: relative;
  width: 100%;
  aspect-ratio: 11 / 9;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  border: 2px solid #8f7552;
  border-radius: 8px;
  background: repeating-linear-gradient(0deg, #4d392a 0 7px, #513d2c 7px 8px);
}
.maze-tiles { display: grid; position: absolute; inset: 0; grid-template: repeat(9, minmax(0, 1fr)) / repeat(11, minmax(0, 1fr)); }
.maze-floor { border: 1px solid #dabc8316; }
.maze-wall {
  border: 1px solid #211d15;
  background: repeating-linear-gradient(135deg, #243329 0 7px, #28392e 7px 9px);
  box-shadow: inset 0 0 0 1px #a58f6730;
}
.maze-cat, .maze-tag, .maze-cart {
  position: absolute;
  inset: 0 auto auto 0;
  display: grid;
  width: var(--tile-x);
  height: var(--tile-y);
  place-items: center;
  transform: translate(calc(var(--column) * 100%), calc(var(--row) * 100%));
  pointer-events: none;
}
.maze-cat { z-index: 3; transition: transform .15s linear; }
.maze-cat img { width: 96%; filter: drop-shadow(0 2px 2px #070906bb); }
.maze-cat.face-left img { transform: scaleX(-1); }
.maze-cat.is-bumped { transition: none; animation: cat-blink .45s linear 3; }
@keyframes cat-blink { 50% { opacity: .32; } }
.maze-tag { color: #ffe2a3; font-size: clamp(.78rem, 4vw, 1.19rem); text-shadow: 0 0 7px #e1a855; }
.maze-tag::before {
  position: absolute;
  z-index: -1;
  width: 55%;
  aspect-ratio: 1;
  transform: rotate(15deg);
  border: 1px solid #e4b96e;
  border-radius: 2px;
  background: #8a5b30;
  content: "";
}
.maze-cart { z-index: 2; transition: transform .53s linear; }
.maze-cart::before {
  width: 68%;
  height: 50%;
  transform: rotate(-8deg);
  border: 1px solid #f1a685;
  border-radius: 3px 3px 5px 5px;
  background: #9a4f49;
  box-shadow: 0 2px 0 #2d2219, inset 0 -3px #532d2d;
  content: "";
}
.maze-cart::after {
  position: absolute;
  top: 35%;
  left: 39%;
  width: 23%;
  height: 13%;
  border-radius: 8px;
  background: #ffbd80;
  content: "";
}
.maze-board.is-complete { animation: board-complete .5s ease both; }
.maze-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; margin-top: 8px; }
.d-pad { display: flex; gap: 4px; }
.d-pad-key {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  touch-action: manipulation;
  border: 1px solid #8c7856;
  border-radius: 6px;
  background: #322d22;
  color: var(--gold-light);
  font-size: 1.16rem;
}
.d-pad-key:hover:not(:disabled), .d-pad-key:active { background: #59482e; }
.maze-controls .button { min-height: 44px; }

@media (max-width: 380px) {
  .patch-layout { gap: 5px; }
  .patch-board, .patch-tray { padding: 3px; }
  .press-row { grid-template-columns: 40px minmax(0, 1fr) 40px; }
}
