/*
  Keep It Rollin' / MazeRunners
  Author: Ziming Dong (49286652)
  Purpose: Visual styling for the Keep It Rollin' browser showcase.
*/

@font-face {
  font-family: "NinjaNormal";
  src: url("assets/ninja-adventure/font/NormalFont.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #111313;
  --surface: #1b1d1b;
  --panel: #24231f;
  --panel-2: #302b24;
  --cardboard: #9f7441;
  --cardboard-light: #c3975c;
  --acrylic: rgba(126, 225, 232, 0.32);
  --acrylic-line: rgba(167, 245, 255, 0.72);
  --ink: #f5efe5;
  --muted: #b8aa96;
  --metal: #87909a;
  --wire: #222;
  --danger: #e33835;
  --green: #34c773;
  --blue: #4aa7ff;
  --orange: #ff9b31;
  --yellow: #f0cc47;
  --white: #f6f6ee;
  --border: rgba(255, 255, 255, 0.13);
  --shadow: rgba(0, 0, 0, 0.34);
  --font-game: "NinjaNormal", "Trebuchet MS", Arial, sans-serif;
  --ui-panel: url("assets/ninja-adventure/ui/theme-wood/nine_path_panel.png");
  --ui-panel-deep: url("assets/ninja-adventure/ui/theme-wood/nine_path_panel_2.png");
  --ui-panel-bright: url("assets/ninja-adventure/ui/theme-wood/nine_path_panel_3.png");
  --ui-button: url("assets/ninja-adventure/ui/theme-wood/button_normal.png");
  --ui-button-hover: url("assets/ninja-adventure/ui/theme-wood/button_hover.png");
  --ui-button-pressed: url("assets/ninja-adventure/ui/theme-wood/button_pressed.png");
  --ui-button-checked: url("assets/ninja-adventure/ui/theme-wood/button_checked.png");
  --modern-wall: url("assets/modern-exteriors/ui/external-wall-modular.png");
  --modern-control-box: url("assets/modern-exteriors/ui/control-box.png");
  --modern-control-pc: url("assets/modern-exteriors/ui/control-pc.png");
  --modern-control-monitor: url("assets/modern-exteriors/ui/control-big-monitor.png");
  --modern-control-small: url("assets/modern-exteriors/ui/control-small-monitor.png");
  --modern-green-button: url("assets/modern-exteriors/ui/elevator-green-button.png");
  --modern-red-button: url("assets/modern-exteriors/ui/elevator-red-button.png");
  --modern-arrow-sign: url("assets/modern-exteriors/ui/arrow-right-green-sign.png");
  --modern-toolbox: url("assets/modern-exteriors/ui/worksite-toolbox-full.png");
  --modern-stoplight: url("assets/modern-exteriors/ui/stoplight.png");
  --modern-air-duct: url("assets/modern-exteriors/ui/air-duct.png");
  --modern-shutter-dish: url("assets/modern-exteriors/ui/shutter-dish.png");
  --modern-solar-panel: url("assets/modern-exteriors/ui/solar-panel.png");
  --modern-electric-plate: url("assets/modern-exteriors/ui/electric-plate.png");
  --hud-shell: #242b33;
  --hud-panel: #303a43;
  --hud-panel-dark: #161d24;
  --hud-paper: #f8f0da;
  --hud-muted: #cbd5dc;
  --hud-frame: #87909a;
  --hud-orange: #ff7443;
  --hud-cyan: #8be6f4;
  --game-word-gap: 0.16em;
  --strip-red: #ff3434;
  --strip-orange: #ff5a1f;
  --strip-danger-orange: #ff9a24;
  --strip-green: #32ff68;
  --strip-blue: #55a0ff;
  --strip-white: #fffaf0;
  color-scheme: dark;
  font-family: var(--font-game);
  font-size: 16px;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(229, 184, 106, 0.055) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.2) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(circle at 22% 6%, rgba(158, 97, 45, 0.18), transparent 30rem),
    radial-gradient(circle at 82% 8%, rgba(78, 111, 83, 0.16), transparent 32rem),
    var(--bg);
  color: var(--ink);
  image-rendering: pixelated;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 6px solid transparent;
  border-image: var(--ui-button) 3 fill / 6px / 0 stretch;
  border-radius: 0;
  background: #5b4128;
  color: #fff2c9;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 4px 4px 0 #050605;
  image-rendering: pixelated;
  text-shadow: 2px 2px 0 #231208;
  text-transform: uppercase;
}

button:hover,
button:focus-visible {
  border-image-source: var(--ui-button-hover);
  outline: 2px solid transparent;
  transform: translate(-1px, -1px);
}

button:active {
  border-image-source: var(--ui-button-pressed);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #050605;
}

.system-console {
  width: min(1560px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.console-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 12px 0 18px;
}

.console-header > div {
  min-width: 0;
}

.console-header__main {
  grid-column: 1;
  min-width: 0;
}

.traffic-signal {
  --signal-glow: rgba(85, 160, 255, 0.7);
  grid-column: 2;
  justify-self: center;
  position: relative;
  width: 58px;
  min-height: 104px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  border: 3px solid #080b0e;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.1) 1px, transparent 1px) 0 0 / 9px 9px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 9px 9px,
    #151b1c;
  box-shadow:
    inset 0 0 0 2px rgba(139, 230, 244, 0.12),
    inset 0 0 18px rgba(0, 0, 0, 0.78),
    3px 3px 0 rgba(0, 0, 0, 0.42),
    0 0 18px var(--signal-glow);
  image-rendering: pixelated;
  overflow: hidden;
}

.traffic-signal::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(135, 144, 154, 0.34);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.72);
  pointer-events: none;
}

.traffic-signal__sprite {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 90px;
  background-image: var(--modern-stoplight);
  background-repeat: no-repeat;
  background-size: 330px 90px;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: grayscale(1) brightness(0.56) drop-shadow(0 0 8px var(--signal-glow));
  opacity: 0.62;
}

.traffic-signal__lamp {
  --lamp-color: var(--strip-red);
  --lamp-edge: #8a0000;
  --lamp-glow: rgba(255, 52, 52, 0.82);
  position: absolute;
  z-index: 2;
  left: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95) 0 14%, transparent 16%),
    radial-gradient(circle, var(--lamp-color) 0 64%, var(--lamp-edge) 100%);
  box-shadow:
    inset 0 0 3px rgba(0, 0, 0, 0.9);
  opacity: 0.15;
  transform: translateX(-50%);
  pointer-events: none;
}

.traffic-signal__lamp--red {
  top: 13px;
}

.traffic-signal__lamp--amber {
  --lamp-color: var(--strip-danger-orange);
  --lamp-edge: #9c4b00;
  --lamp-glow: rgba(255, 154, 36, 0.84);
  top: 39px;
}

.traffic-signal__lamp--green {
  --lamp-color: var(--strip-green);
  --lamp-edge: #007a24;
  --lamp-glow: rgba(50, 255, 104, 0.82);
  top: 65px;
}

.traffic-signal[data-signal="standby"] {
  --signal-glow: rgba(255, 250, 220, 0.72);
}

.traffic-signal[data-signal="standby"] .traffic-signal__lamp {
  opacity: 1;
  box-shadow:
    0 0 7px var(--lamp-glow),
    0 0 16px var(--lamp-glow),
    inset 0 0 2px rgba(255, 255, 255, 0.65);
}

.traffic-signal[data-signal="green"] {
  --signal-glow: rgba(50, 255, 104, 0.82);
}

.traffic-signal[data-signal="green"] .traffic-signal__lamp--green {
  opacity: 1;
  box-shadow:
    0 0 8px var(--lamp-glow),
    0 0 18px var(--lamp-glow),
    inset 0 0 2px rgba(255, 255, 255, 0.65);
}

.traffic-signal[data-signal="orange"] {
  --signal-glow: rgba(255, 154, 36, 0.84);
}

.traffic-signal[data-signal="orange"] .traffic-signal__lamp--amber {
  opacity: 1;
  box-shadow:
    0 0 8px var(--lamp-glow),
    0 0 18px var(--lamp-glow),
    inset 0 0 2px rgba(255, 255, 255, 0.65);
}

.traffic-signal[data-signal="red"] {
  --signal-glow: rgba(255, 52, 52, 0.88);
}

.traffic-signal[data-signal="red"] .traffic-signal__lamp--red {
  opacity: 1;
  box-shadow:
    0 0 8px var(--lamp-glow),
    0 0 18px var(--lamp-glow),
    inset 0 0 2px rgba(255, 255, 255, 0.65);
}

.traffic-signal[data-signal="off"] {
  --signal-glow: rgba(255, 52, 52, 0.08);
  opacity: 0.74;
}

.traffic-signal[data-signal="off"] .traffic-signal__lamp {
  opacity: 0;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.95);
}

.console-header h1 {
  margin: 0;
  font-size: clamp(1.48rem, 2.35vw, 2.26rem);
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 3px 3px 0 #090705;
}

.console-header p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.35vw, 1.12rem);
  line-height: 1.28;
  word-spacing: var(--game-word-gap);
}

.warning-marquee {
  --dot-size: 5px;
  --dot-gap: 1.2px;
  --dot-on: var(--strip-orange);
  --dot-off: rgba(86, 24, 0, 0.76);
  --dot-edge: #9a2600;
  --dot-glow: rgba(255, 90, 31, 0.74);
  max-width: min(760px, 100%);
  height: 42px;
  margin-top: 10px;
  border: 3px solid #0b0f12;
  background:
    linear-gradient(90deg, rgba(255, 90, 31, 0.12) 1px, transparent 1px) 0 0 / 12px 12px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 12px 12px,
    #151b1c;
  box-shadow:
    inset 0 0 0 2px rgba(139, 230, 244, 0.16),
    inset 0 0 22px rgba(0, 0, 0, 0.82),
    3px 3px 0 rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.warning-marquee.dot-urgent {
  --dot-on: var(--strip-red);
  --dot-off: rgba(88, 0, 0, 0.82);
  --dot-edge: #a00000;
  --dot-glow: rgba(255, 52, 52, 0.86);
}

.warning-marquee__viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.warning-marquee__track {
  display: flex;
  width: max-content;
  height: 100%;
  align-items: center;
  animation: warning-scroll 34s linear infinite;
  will-change: transform;
}

.warning-marquee__message {
  flex: 0 0 auto;
  padding-right: 64px;
}

@keyframes warning-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.mode-switch,
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.serial-buttons button {
  flex: 1 1 140px;
}

.mode-switch {
  grid-column: 3;
  justify-self: end;
  flex: 0 0 auto;
  padding: 6px;
  border: 8px solid transparent;
  border-image: var(--ui-panel-deep) 5 fill / 8px / 0 stretch;
  border-radius: 0;
  background: #283327;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.42);
}

.mode-button {
  min-width: 86px;
  box-shadow: none;
}

.mode-button.is-active {
  border-image-source: var(--ui-button-checked);
  background: #2ebf6b;
  color: #06140c;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

.integrated-exhibit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: stretch;
}

.scene-shell,
.system-hud,
.control-box,
.live-panel,
.event-log {
  border: 8px solid transparent;
  border-image: var(--ui-panel) 5 fill / 8px / 0 stretch;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(54, 61, 45, 0.94), rgba(21, 24, 20, 0.98));
  box-shadow: 0 18px 44px var(--shadow);
  image-rendering: pixelated;
}

.scene-shell {
  position: relative;
  align-self: start;
  min-height: 520px;
  overflow: hidden;
}

#mazeScene {
  display: block;
  width: 100%;
  height: min(72vh, 760px);
  min-height: 520px;
  background: #0d100d;
  cursor: grab;
  image-rendering: pixelated;
  touch-action: none;
}

.scene-shell.is-dragging #mazeScene {
  cursor: grabbing;
}

.scene-status {
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 8px solid transparent;
  border-image: var(--ui-panel-deep) 5 fill / 8px / 0 stretch;
  border-radius: 0;
  background: #273326;
  color: var(--ink);
  text-shadow: 2px 2px 0 #080604;
  font-size: 0.95rem;
  line-height: 1.18;
  word-spacing: var(--game-word-gap);
}

.scene-status span {
  min-width: 0;
}

#sceneState {
  flex: 0 0 auto;
  font-weight: 900;
}

#sceneLatest {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  text-align: right;
}

.mobile-quick-panel {
  display: none;
}

.timer-screen {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 8px solid transparent;
  border-image: var(--ui-panel-deep) 5 fill / 8px / 0 stretch;
  border-radius: 0;
  background: #111713;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.62),
    inset 0 0 0 1px rgba(199, 145, 75, 0.34),
    inset 0 0 34px rgba(0, 0, 0, 0.88);
  overflow: hidden;
}

.timer-screen[hidden] {
  display: none;
}

.timer-screen__bezel {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(199, 145, 75, 0.32);
  pointer-events: none;
}

.timer-screen__bezel::before,
.timer-screen__bezel::after {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #cbb98d, #333630 58%, #050505);
  content: "";
}

.timer-screen__bezel::before {
  left: -3px;
}

.timer-screen__bezel::after {
  right: -3px;
}

.timer-screen__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 18px 22px 10px;
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(240, 204, 71, 0.22);
}

.timer-screen__header strong {
  color: #34c773;
  font-size: 0.72rem;
}

.timer-screen__frame {
  position: relative;
  z-index: 1;
  display: block;
  width: calc(100% - 28px);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 14px 14px;
  border: 2px solid #4b4f4d;
  background: #0a1035;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.75),
    inset 0 0 22px rgba(0, 0, 0, 0.68);
}

.leaderboard-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: calc(100% - 28px);
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 14px 14px;
  padding: 12px;
  border: 2px solid #4b4f4d;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.07) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(180deg, rgba(14, 20, 18, 0.96), rgba(5, 8, 7, 0.98));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.75),
    inset 0 0 24px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

.leaderboard-panel::before {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 84px;
  height: 58px;
  background: var(--modern-control-monitor) center / contain no-repeat;
  content: "";
  opacity: 0.16;
  pointer-events: none;
}

.leaderboard-strip {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 6px solid transparent;
  border-image: var(--ui-panel-bright) 5 fill / 6px / 0 stretch;
  background: #273326;
  color: var(--yellow);
  font-size: 0.68rem;
  line-height: 1.1;
  text-shadow: 2px 2px 0 #090705;
  text-transform: uppercase;
}

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

.leaderboard-table {
  position: relative;
  z-index: 1;
  align-self: start;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0 6px;
  table-layout: fixed;
  font-size: 0.72rem;
  line-height: 1.12;
  text-transform: uppercase;
}

.leaderboard-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.leaderboard-table th {
  padding: 0 7px 2px;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 900;
  text-align: left;
  text-shadow: 1px 1px 0 #050505;
}

.leaderboard-table th:first-child,
.leaderboard-rank {
  width: 14%;
}

.leaderboard-table th:nth-child(2),
.leaderboard-team {
  width: 42%;
}

.leaderboard-table th:nth-child(3),
.leaderboard-time {
  width: 22%;
}

.leaderboard-table th:nth-child(4),
.leaderboard-score {
  width: 22%;
}

.leaderboard-table td {
  min-width: 0;
  padding: 8px 7px;
  border-top: 2px solid rgba(135, 144, 154, 0.46);
  border-bottom: 2px solid rgba(0, 0, 0, 0.64);
  background:
    linear-gradient(90deg, rgba(240, 204, 71, 0.08) 1px, transparent 1px) 0 0 / 9px 9px,
    linear-gradient(180deg, rgba(41, 49, 55, 0.98), rgba(16, 22, 24, 0.98));
  color: var(--ink);
  text-shadow: 2px 2px 0 #050505;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-table td:first-child {
  border-left: 2px solid rgba(135, 144, 154, 0.46);
  color: var(--yellow);
}

.leaderboard-table td:last-child {
  border-right: 2px solid rgba(135, 144, 154, 0.46);
}

.leaderboard-team {
  display: table-cell;
  word-spacing: var(--game-word-gap);
}

.leaderboard-team span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.leaderboard-team small {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid rgba(50, 255, 104, 0.62);
  background: rgba(50, 255, 104, 0.12);
  color: var(--green);
  font-size: 0.48rem;
  line-height: 1;
  text-shadow: none;
  vertical-align: middle;
}

.leaderboard-table tr.is-live .leaderboard-team span {
  max-width: calc(100% - 48px);
}

.leaderboard-time {
  color: var(--hud-cyan);
}

.leaderboard-score {
  color: var(--strip-green);
  text-shadow:
    0 0 7px rgba(50, 255, 104, 0.58),
    2px 2px 0 #050505;
}

.leaderboard-table tr.is-live td {
  border-color: rgba(240, 204, 71, 0.72);
  background:
    linear-gradient(90deg, rgba(50, 255, 104, 0.11) 1px, transparent 1px) 0 0 / 9px 9px,
    linear-gradient(180deg, rgba(49, 64, 42, 0.98), rgba(18, 29, 21, 0.98));
}

.timer-screen.is-compact .timer-screen__header {
  padding: 12px 14px 8px;
  font-size: 0.7rem;
}

.timer-screen.is-compact .timer-screen__frame {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
}

.timer-screen.is-compact .leaderboard-panel {
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  padding: 9px;
  gap: 7px;
}

.timer-screen.is-compact .leaderboard-strip {
  min-height: 29px;
  padding: 5px 7px;
  font-size: 0.58rem;
}

.timer-screen.is-compact .leaderboard-table {
  border-spacing: 0 4px;
  font-size: 0.6rem;
}

.timer-screen.is-compact .leaderboard-table td {
  padding: 6px 5px;
}

.tilt-step-grid,
.game-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tilt-step-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-hud {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(239, 207, 139, 0.045) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.18) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(180deg, rgba(65, 70, 50, 0.96), rgba(19, 23, 18, 0.98));
  image-rendering: pixelated;
}

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

.seven-box,
.control-group,
.player-pods,
.circuit-board,
.video-window,
.live-panel {
  border: 8px solid transparent;
  border-image: var(--ui-panel-deep) 5 fill / 8px / 0 stretch;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(239, 207, 139, 0.035) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(0deg, rgba(0, 0, 0, 0.16) 1px, transparent 1px) 0 0 / 16px 16px,
    rgba(31, 43, 31, 0.78);
  box-shadow:
    4px 4px 0 rgba(0, 0, 0, 0.38);
}

.seven-box {
  position: relative;
  padding: 11px 12px;
  overflow: hidden;
}

.seven-box::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 106, 0.08), transparent);
  opacity: 0.65;
  content: "";
  pointer-events: none;
}

.seven-box.is-pulsing {
  border-image-source: var(--ui-panel-bright);
  box-shadow:
    0 0 20px rgba(255, 75, 47, 0.38),
    4px 4px 0 rgba(0, 0, 0, 0.38);
}

.label,
.control-group label,
.state-grid span {
  display: block;
  color: #f0d896;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #080604;
}

.seven {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4px;
  color: #ff6749;
  font-family: var(--font-game);
  font-size: clamp(1.55rem, 4vw, 2.3rem);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 3px 3px 0 #120704, 0 0 10px rgba(255, 77, 53, 0.55);
}

.dot-matrix {
  --dot-size: 4px;
  --dot-gap: 1px;
  --dot-on: var(--strip-green);
  --dot-off: rgba(0, 82, 20, 0.72);
  --dot-edge: #007a24;
  --dot-glow: rgba(50, 255, 104, 0.72);
  line-height: 0;
}

.dot-matrix.dot-green {
  --dot-on: var(--strip-green);
  --dot-off: rgba(0, 82, 20, 0.72);
  --dot-edge: #007a24;
  --dot-glow: rgba(50, 255, 104, 0.72);
}

.dot-matrix.dot-orange {
  --dot-on: var(--strip-orange);
  --dot-off: rgba(86, 24, 0, 0.76);
  --dot-edge: #9a2600;
  --dot-glow: rgba(255, 90, 31, 0.74);
}

.dot-matrix.dot-yellow {
  --dot-on: var(--strip-danger-orange);
  --dot-off: rgba(88, 45, 0, 0.76);
  --dot-edge: #9c4b00;
  --dot-glow: rgba(255, 154, 36, 0.74);
}

.dot-matrix.dot-red {
  --dot-on: var(--strip-red);
  --dot-off: rgba(88, 0, 0, 0.82);
  --dot-edge: #a00000;
  --dot-glow: rgba(255, 52, 52, 0.82);
}

.dot-matrix.dot-blue {
  --dot-on: var(--strip-blue);
  --dot-off: rgba(0, 28, 86, 0.74);
  --dot-edge: #0042a2;
  --dot-glow: rgba(85, 160, 255, 0.84);
}

.dot-matrix.dot-white {
  --dot-on: var(--strip-white);
  --dot-off: rgba(82, 86, 88, 0.72);
  --dot-edge: #bcc4c8;
  --dot-glow: rgba(255, 250, 240, 0.82);
}

.dot-matrix.dot-urgent {
  --dot-on: var(--strip-red);
  --dot-off: rgba(88, 0, 0, 0.82);
  --dot-edge: #a00000;
  --dot-glow: rgba(255, 52, 52, 0.86);
}

.warning-marquee .dot-matrix {
  --dot-size: 5px;
  --dot-gap: 1.2px;
}

.warning-marquee.dot-urgent .dot-matrix {
  --dot-on: var(--strip-red);
  --dot-off: rgba(88, 0, 0, 0.82);
  --dot-edge: #a00000;
  --dot-glow: rgba(255, 52, 52, 0.86);
}

.dot-row {
  display: flex;
  height: calc(var(--dot-size) + var(--dot-gap));
}

.dot-cell {
  flex: 0 0 var(--dot-size);
  width: var(--dot-size);
  height: var(--dot-size);
  margin-right: var(--dot-gap);
  border-radius: 50%;
  background: var(--dot-off);
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.8);
}

.dot-cell.is-on {
  background:
    radial-gradient(circle at 36% 32%, rgba(255, 242, 201, 0.95) 0 10%, transparent 11%),
    radial-gradient(circle at 50% 50%, var(--dot-on) 0 68%, var(--dot-edge) 100%);
  box-shadow:
    0 0 4px var(--dot-glow),
    0 0 10px var(--dot-glow),
    inset 0 0 2px rgba(255, 236, 188, 0.55);
}

.seven.dot-matrix {
  display: block;
  min-height: 28px;
  width: max-content;
  max-width: 100%;
  margin: 9px auto 0;
  overflow: hidden;
  color: inherit;
  text-shadow: none;
}

.system-hud .seven.dot-matrix {
  position: absolute;
  left: 50%;
  top: calc(var(--display-top) + ((100% - var(--display-top) - var(--display-bottom)) / 2));
  z-index: 1;
  margin: 0;
  transform: translate(-50%, -50%);
}

.clock-box .seven.dot-matrix {
  --dot-size: 3.9px;
  --dot-gap: 0.95px;
}

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

.lamp {
  min-height: 58px;
  border: 6px solid transparent;
  border-image: var(--ui-button) 3 fill / 6px / 0 stretch;
  border-radius: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08), transparent 28px),
    rgba(0, 0, 0, 0.26);
  color: var(--muted);
  font-weight: 900;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18);
}

.lamp span {
  position: relative;
  z-index: 1;
}

.lamp.is-on {
  color: #08130d;
  border-image-source: var(--ui-button-checked);
  box-shadow:
    0 0 24px currentColor,
    inset 0 -8px 0 rgba(0, 0, 0, 0.18);
}

.lamp.rgb[data-color="blue"] { background: var(--blue); }
.lamp.rgb[data-color="green"] { background: var(--green); }
.lamp.rgb[data-color="orange"] { background: var(--orange); }
.lamp.rgb[data-color="yellow"] { background: var(--yellow); color: #191611; }
.lamp.rgb[data-color="red"] { background: var(--danger); }
.lamp.rgb[data-color="white"] { background: var(--white); color: #161616; }
.lamp.red.is-on { background: var(--danger); color: #fff; }
.lamp.start.is-on { background: var(--yellow); color: #191611; }

.control-group,
.player-pods {
  padding: 13px;
}

.control-group h2,
.player-pods h2,
.panel-heading h2,
.event-log h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
  color: #ffe66a;
  text-shadow: 3px 3px 0 #080604;
}

.control-group label {
  margin: 9px 0 5px;
}

.control-group output {
  float: right;
  color: var(--ink);
  font-family: var(--font-game);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.calibration-line,
.live-note,
.video-window p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.28;
  word-spacing: var(--game-word-gap);
}

.state-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 6px 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid rgba(117, 103, 79, 0.42);
}

.state-grid strong {
  font-size: 0.88rem;
  color: #f5efe5;
  text-align: right;
  text-shadow: 2px 2px 0 #080604;
}

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

.pod {
  min-height: 70px;
  padding: 10px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 6px solid transparent;
  border-image: var(--ui-button) 3 fill / 6px / 0 stretch;
  color: #101210;
  font-weight: 700;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.16), 3px 3px 0 #050605;
  transition: transform 90ms linear, box-shadow 90ms linear;
}

.pod span,
.pod b {
  display: block;
}

.pod.vibrating {
  animation: vibrate 80ms linear infinite;
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.7),
    inset 0 -10px 0 rgba(0, 0, 0, 0.16),
    3px 3px 0 #050605;
}

.red-pod { background: #e44b4b; }
.blue-pod { background: #4aa7ff; }
.yellow-pod { background: #f0cc47; }
.green-pod { background: #48c875; }

.system-hud {
  position: relative;
  gap: 12px;
  overflow: hidden;
  padding: 16px;
  border: 4px solid #0b0e12;
  border-image: none;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.08) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, rgba(46, 55, 64, 0.98), rgba(18, 24, 31, 0.99));
  box-shadow:
    inset 0 0 0 3px #59636d,
    inset 0 0 0 8px #202832,
    0 18px 44px var(--shadow);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.system-hud::before,
.system-hud::after {
  position: absolute;
  content: "";
  pointer-events: none;
  image-rendering: pixelated;
}

.system-hud::before {
  inset: 10px;
  background:
    var(--modern-wall) left top / 64px 208px repeat-y,
    var(--modern-wall) right top / 64px 208px repeat-y;
  opacity: 0.13;
}

.system-hud::after {
  top: 12px;
  right: 14px;
  width: 58px;
  height: 58px;
  background: var(--modern-control-pc) center / contain no-repeat;
  opacity: 0.5;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.45));
}

.system-hud > * {
  position: relative;
  z-index: 1;
}

.system-hud .seven-box,
.system-hud .control-group,
.system-hud .player-pods {
  position: relative;
  overflow: hidden;
  border: 3px solid #080b0e;
  border-image: none;
  background:
    linear-gradient(180deg, rgba(58, 70, 80, 0.96), rgba(35, 45, 55, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 -8px 0 rgba(0, 0, 0, 0.16),
    4px 4px 0 rgba(0, 0, 0, 0.45);
}

.system-hud .seven-box {
  --display-top: 48px;
  --display-side: 12px;
  --display-bottom: 12px;
  min-height: 112px;
  padding: 13px 14px 12px;
  background:
    linear-gradient(180deg, rgba(45, 53, 60, 0.98), rgba(26, 34, 42, 0.99));
}

.system-hud .seven-box::before {
  inset: auto 10px 10px auto;
  width: 40px;
  height: 40px;
  background: var(--modern-control-small) center / contain no-repeat;
  opacity: 0.42;
}

.system-hud .seven-box::after {
  position: absolute;
  inset: var(--display-top) var(--display-side) var(--display-bottom);
  z-index: 0;
  border: 2px solid rgba(139, 230, 244, 0.28);
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.12) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 14px 14px,
    rgba(9, 14, 18, 0.88);
  content: "";
}

.system-hud .label,
.system-hud .control-group label,
.system-hud .state-grid span {
  position: relative;
  z-index: 1;
  color: var(--hud-muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-shadow: 1px 1px 0 #050608;
}

.system-hud .seven {
  z-index: 1;
  margin-top: 10px;
  color: #ff5e3f;
  font-family: var(--font-game);
  font-size: clamp(1.82rem, 4.4vw, 2.55rem);
  text-shadow:
    3px 3px 0 #160707,
    0 0 14px rgba(255, 94, 63, 0.55);
}

.system-hud .lamp-strip {
  gap: 9px;
}

.system-hud .lamp {
  position: relative;
  min-height: 62px;
  justify-items: start;
  padding: 9px 9px 9px 43px;
  border: 3px solid #090c10;
  border-image: none;
  background: linear-gradient(180deg, #313b43, #1f2931);
  color: var(--hud-paper);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 -8px 0 rgba(0, 0, 0, 0.18);
  font-family: var(--font-game);
  text-shadow: 2px 2px 0 #050608;
  word-spacing: var(--game-word-gap);
}

.system-hud .lamp::before {
  position: absolute;
  left: 8px;
  top: 50%;
  width: 28px;
  height: 28px;
  background: var(--modern-green-button) center / contain no-repeat;
  content: "";
  image-rendering: pixelated;
  transform: translateY(-50%);
  filter: brightness(0.92) drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.35));
}

.system-hud .lamp.red::before {
  background-image: var(--modern-red-button);
}

.system-hud .lamp.start::before {
  background-image: var(--modern-arrow-sign);
}

.system-hud .lamp.is-on {
  color: #fff7de;
  border-color: #142027;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 0 16px rgba(139, 230, 244, 0.24);
}

.system-hud .lamp.rgb[data-color="blue"] { background: linear-gradient(180deg, var(--strip-blue), #063b8d); color: #f4f8ff; }
.system-hud .lamp.rgb[data-color="green"] { background: linear-gradient(180deg, var(--strip-green), #067a28); color: #061407; }
.system-hud .lamp.rgb[data-color="orange"] { background: linear-gradient(180deg, var(--strip-orange), #8a2600); color: #fff4ec; }
.system-hud .lamp.rgb[data-color="yellow"] { background: linear-gradient(180deg, var(--strip-danger-orange), #8d4600); color: #fff7e8; }
.system-hud .lamp.rgb[data-color="red"] { background: linear-gradient(180deg, var(--strip-red), #930000); color: #fff0f0; }
.system-hud .lamp.rgb[data-color="white"] { background: linear-gradient(180deg, var(--strip-white), #8b9294); color: #111820; text-shadow: none; }
.system-hud .lamp.rgb:not(.is-on) { background: linear-gradient(180deg, #313b43, #1f2931); color: var(--hud-paper); }
.system-hud .lamp.red.is-on { background: linear-gradient(180deg, var(--strip-red), #930000); }
.system-hud .lamp.start.is-on { background: linear-gradient(180deg, #b8952b, #68511c); }

.system-hud .control-group,
.system-hud .player-pods {
  padding: 15px;
}

.system-hud .control-group::before,
.system-hud .player-pods::before {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 54px;
  height: 54px;
  background: var(--modern-control-box) center / contain no-repeat;
  content: "";
  opacity: 0.33;
  pointer-events: none;
  image-rendering: pixelated;
}

.system-hud .run-panel::before {
  background-image: var(--modern-control-pc);
}

.system-hud .player-pods::before {
  background-image: var(--modern-control-monitor);
}

.system-hud .control-group h2,
.system-hud .player-pods h2 {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 62px);
  margin-bottom: 12px;
  padding: 3px 8px 4px;
  background: #111820;
  color: var(--hud-paper);
  font-family: var(--font-game);
  text-shadow: 2px 2px 0 #050608;
  word-spacing: var(--game-word-gap);
  box-shadow: inset 0 0 0 2px rgba(139, 230, 244, 0.16);
}

.system-hud .control-group output {
  color: #ffffff;
  font-family: var(--font-game);
  text-shadow: 2px 2px 0 #050608;
}

.system-hud input[type="range"] {
  height: 24px;
  accent-color: #40d784;
}

.system-hud .calibration-line {
  color: #d7d0bd;
  font-size: 0.82rem;
  text-shadow: 1px 1px 0 #050608;
}

.system-hud button {
  min-height: 42px;
  border: 3px solid #090c10;
  border-image: none;
  padding: 0 10px;
  background:
    linear-gradient(180deg, #ff8754, #e45d32 60%, #9d3b23);
  color: #fff8e7;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    3px 3px 0 #080b0e;
  font-family: var(--font-game);
  font-size: 0.78rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-shadow: 2px 2px 0 #5b1d12;
  word-spacing: var(--game-word-gap);
}

.system-hud button:hover,
.system-hud button:focus-visible {
  border-image: none;
  outline: 2px solid var(--hud-cyan);
  outline-offset: 2px;
  background: linear-gradient(180deg, #ff9a66, #ef673a 60%, #ad4228);
}

.system-hud button:active {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    1px 1px 0 #080b0e;
}

.system-hud .state-grid {
  border-top-color: rgba(139, 230, 244, 0.2);
  background: rgba(9, 14, 18, 0.24);
  padding: 10px;
}

.system-hud .state-grid strong {
  color: #ffffff;
  text-shadow: 1px 1px 0 #050608;
}

.system-hud .pod {
  min-height: 62px;
  border: 3px solid #090c10;
  border-image: none;
  color: #fff8e7;
  background: linear-gradient(180deg, #303a43, #1f2830);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.86rem;
  text-shadow: 1px 1px 0 #050608;
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.18),
    3px 3px 0 #080b0e;
}

.system-hud .pod b {
  font-family: var(--font-game);
  font-size: 0.9rem;
  text-shadow: 2px 2px 0 #050608;
}

.system-hud .red-pod { border-left: 8px solid #ff5b57; }
.system-hud .blue-pod { border-left: 8px solid #58b7ff; }
.system-hud .yellow-pod { border-left: 8px solid #f2cc47; }
.system-hud .green-pod { border-left: 8px solid #4fe287; }

.system-hud .pod.vibrating {
  box-shadow:
    0 0 18px rgba(139, 230, 244, 0.56),
    inset 0 -8px 0 rgba(0, 0, 0, 0.18),
    3px 3px 0 #080b0e;
}

.machine-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  margin-top: 16px;
}

.hardware-bay,
.terminal-panel,
.trace-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 4px solid #080b0e;
  border-image: none;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.06) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(180deg, rgba(45, 53, 60, 0.98), rgba(21, 28, 35, 0.99));
  box-shadow:
    inset 0 0 0 3px #59636d,
    inset 0 0 0 8px #202832,
    0 18px 44px var(--shadow);
  color: var(--hud-paper);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.hardware-bay::before,
.terminal-panel::before,
.trace-panel::before,
.hardware-bay::after,
.terminal-panel::after,
.trace-panel::after {
  position: absolute;
  content: "";
  pointer-events: none;
  image-rendering: pixelated;
}

.hardware-bay::before,
.terminal-panel::before,
.trace-panel::before {
  inset: 10px;
  background:
    var(--modern-wall) left top / 64px 208px repeat-y,
    var(--modern-wall) right top / 64px 208px repeat-y;
  opacity: 0.12;
}

.hardware-bay::after,
.terminal-panel::after,
.trace-panel::after {
  top: 12px;
  right: 14px;
  width: 58px;
  height: 58px;
  opacity: 0.5;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.45));
}

.hardware-bay::after {
  background: var(--modern-toolbox) center / contain no-repeat;
}

.terminal-panel::after {
  background: var(--modern-control-pc) center / contain no-repeat;
}

.trace-panel::after {
  background: var(--modern-stoplight) center / contain no-repeat;
}

.hardware-bay > *,
.terminal-panel > *,
.trace-panel > * {
  position: relative;
  z-index: 1;
}

.lower-drawer > summary {
  cursor: pointer;
  list-style: none;
}

.lower-drawer > summary::-webkit-details-marker {
  display: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.hardware-bay .panel-heading,
.terminal-panel .panel-heading,
.trace-panel > summary {
  min-height: 44px;
  padding: 6px 70px 6px 10px;
  border: 3px solid #080b0e;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.1), transparent 46%),
    linear-gradient(180deg, #18222b, #10161c);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    3px 3px 0 rgba(0, 0, 0, 0.38);
}

.hardware-bay .panel-heading h2,
.terminal-panel .panel-heading h2,
.trace-panel > summary h2 {
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: #ffe66a;
  font-family: var(--font-game);
  font-size: 0.98rem;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #050608;
  word-spacing: var(--game-word-gap);
}

.hardware-bay .panel-heading span,
.terminal-panel .panel-heading span {
  color: #54df89;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: right;
  text-shadow: 1px 1px 0 #050608;
}

.bay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: stretch;
}

.hardware-bay .circuit-board,
.hardware-bay .video-window {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  padding: 14px;
  border: 3px solid #080b0e;
  border-image: none;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.08) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(50, 62, 70, 0.98), rgba(24, 33, 40, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 -8px 0 rgba(0, 0, 0, 0.16),
    4px 4px 0 rgba(0, 0, 0, 0.42);
}

.hardware-bay .circuit-board::before,
.hardware-bay .video-window::before {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: var(--modern-electric-plate) center / contain no-repeat;
  content: "";
  opacity: 0.4;
  pointer-events: none;
  image-rendering: pixelated;
}

.hardware-bay .mechanical-card::before {
  background-image: var(--modern-shutter-dish);
}

.hardware-bay .evidence-window::before {
  background-image: var(--modern-control-monitor);
}

.board-title {
  width: max-content;
  max-width: calc(100% - 54px);
  margin: 0 0 12px;
  padding: 4px 8px;
  background: #111820;
  color: #ffffff;
  font-family: var(--font-game);
  font-size: 0.9rem;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #050608;
  word-spacing: var(--game-word-gap);
  box-shadow: inset 0 0 0 2px rgba(139, 230, 244, 0.16);
}

.circuit-board ul {
  margin: 0;
  padding-left: 20px;
  padding-right: 34px;
  color: #d9d2c0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
  text-shadow: none;
  overflow-wrap: anywhere;
}

.circuit-board li + li {
  margin-top: 7px;
}

.hardware-bay .video-window {
  padding: 12px;
}

.video-window video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid #080b0e;
  border-image: none;
  border-radius: 0;
  background: #000;
  box-shadow: 0 0 0 2px rgba(139, 230, 244, 0.18);
}

.video-window p,
.live-note {
  margin: 10px 0 0;
  color: #d9d2c0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: none;
}

.terminal-panel .serial-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.terminal-panel button {
  width: 100%;
  min-height: 54px;
  border: 3px solid #080b0e;
  border-image: none;
  background: linear-gradient(180deg, #ff8650, #e85c27);
  color: #fff9e8;
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.17),
    3px 3px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--font-game);
  font-size: 0.86rem;
  text-shadow: 2px 2px 0 #642313;
  word-spacing: var(--game-word-gap);
}

.terminal-panel button:hover,
.terminal-panel button:focus-visible {
  background: linear-gradient(180deg, #ff9f67, #f06f34);
  transform: translate(-1px, -1px);
}

.terminal-panel button:active {
  transform: translate(1px, 1px);
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.18);
}

.live-panel textarea {
  width: 100%;
  min-height: 190px;
  margin-top: 12px;
  resize: vertical;
  border: 3px solid #080b0e;
  border-image: none;
  border-radius: 0;
  padding: 12px;
  background:
    linear-gradient(90deg, rgba(84, 223, 137, 0.08) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 18px 18px,
    #0d1612;
  color: #e8fff0;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow:
    inset 0 0 0 2px rgba(84, 223, 137, 0.12),
    3px 3px 0 rgba(0, 0, 0, 0.42);
}

.event-log {
  margin-top: 16px;
}

.trace-panel {
  padding: 16px;
}

.trace-panel > summary {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.event-log ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-log li {
  position: relative;
  min-height: 72px;
  padding: 12px 12px 12px 48px;
  border: 3px solid #080b0e;
  border-image: none;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(47, 60, 68, 0.96), rgba(22, 30, 37, 0.98));
  color: #d9d2c0;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 -8px 0 rgba(0, 0, 0, 0.14);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 800;
}

.event-log li::before {
  position: absolute;
  left: 10px;
  top: 13px;
  width: 28px;
  height: 28px;
  background: var(--modern-control-small) center / contain no-repeat;
  content: "";
  opacity: 0.72;
  image-rendering: pixelated;
}

.event-log strong {
  display: block;
  color: #ffffff;
  font-family: var(--font-game);
  font-size: 0.86rem;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #050608;
  word-spacing: var(--game-word-gap);
}

.event-log span,
.event-log small {
  display: block;
}

.event-log span {
  margin-top: 4px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.event-log small {
  margin-top: 7px;
  color: #94f0c0;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  font-weight: 700;
}

.asset-credit {
  margin: 10px 2px 0;
  color: rgba(245, 239, 229, 0.64);
  font-size: 0.78rem;
  text-align: right;
  word-spacing: var(--game-word-gap);
}

@keyframes vibrate {
  0% { transform: translate(0, 0); }
  25% { transform: translate(1px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 1180px) {
  .integrated-exhibit,
  .machine-lower {
    grid-template-columns: 1fr;
  }

  .system-hud {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bay-grid {
    grid-template-columns: 1fr 1fr;
  }

  .video-window {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :root {
    font-size: 15px;
  }

  body {
    padding-bottom: 18px;
  }

  .system-console {
    width: 100%;
    padding: 8px 8px 18px;
  }

  .console-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 4px 0 10px;
  }

  .console-header__main,
  .traffic-signal,
  .mode-switch {
    grid-column: 1;
  }

  .traffic-signal {
    width: 54px;
    min-height: 96px;
    justify-self: center;
    order: 2;
  }

  .mode-switch {
    justify-self: end;
    order: 3;
  }

  .console-header h1 {
    max-width: 100%;
    font-size: clamp(1.36rem, 7.1vw, 1.78rem);
    line-height: 1.18;
    text-shadow: 2px 2px 0 #090705;
  }

  .console-header p {
    max-width: 35ch;
    margin-top: 6px;
    color: #d6c6aa;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }

  .warning-marquee {
    height: 36px;
    margin-top: 8px;
  }

  .warning-marquee .dot-matrix {
    --dot-size: 4px;
    --dot-gap: 1px;
  }

  .warning-marquee__track {
    animation-duration: 28s;
  }

  .warning-marquee__message {
    padding-right: 44px;
  }

  .integrated-exhibit,
  .machine-lower {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mode-switch {
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-top: 0;
    padding: 4px;
    border-width: 4px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.42);
  }

  .mode-button {
    min-width: 0;
    min-height: 42px;
    font-size: 0.82rem;
    box-shadow: none;
  }

  .scene-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-width: 4px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.42);
  }

  #mazeScene {
    min-height: 0;
    height: clamp(352px, 94vw, 430px);
    flex: 0 0 auto;
  }

  .scene-status {
    position: static;
    order: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
    align-items: flex-start;
    margin: 0 8px 8px;
    padding: 7px 8px;
    border-width: 4px;
    border-radius: 0;
    font-size: 0.78rem;
    line-height: 1.22;
    background: #18242c;
  }

  #sceneLatest {
    line-height: 1.28;
    text-align: left;
  }

  .timer-screen.is-mobile-dock {
    position: relative;
    left: auto !important;
    top: auto !important;
    order: 4;
    width: auto !important;
    height: clamp(252px, 70vw, 330px) !important;
    margin: 0 8px 8px;
    border-width: 4px;
    box-shadow:
      0 12px 24px rgba(0, 0, 0, 0.48),
      inset 0 0 0 1px rgba(199, 145, 75, 0.22);
  }

  .timer-screen.is-mobile-dock .timer-screen__bezel {
    inset: 5px;
  }

  .timer-screen.is-mobile-dock .timer-screen__header {
    padding: 10px 12px 7px;
    font-size: 0.68rem;
  }

  .timer-screen.is-mobile-dock .timer-screen__frame,
  .timer-screen.is-mobile-dock .leaderboard-panel {
    width: calc(100% - 16px);
    margin: 0 8px 8px;
  }

  .timer-screen.is-mobile-dock .leaderboard-panel {
    padding: 8px;
    gap: 7px;
  }

  .timer-screen.is-mobile-dock .leaderboard-strip {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 0.56rem;
  }

  .timer-screen.is-mobile-dock .leaderboard-table {
    border-spacing: 0 4px;
    font-size: 0.58rem;
  }

  .timer-screen.is-mobile-dock .leaderboard-table th {
    padding: 0 5px 1px;
    font-size: 0.48rem;
  }

  .timer-screen.is-mobile-dock .leaderboard-table td {
    padding: 6px 5px;
  }

  .mobile-quick-panel {
    position: static;
    z-index: 20;
    left: auto;
    right: auto;
    bottom: auto;
    order: 3;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 0 8px 8px;
    padding: 8px;
    border: 2px solid rgba(139, 230, 244, 0.45);
    border-radius: 6px;
    background:
      linear-gradient(180deg, rgba(30, 40, 48, 0.96), rgba(13, 19, 25, 0.98));
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(14px);
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body.quick-panel-hidden .mobile-quick-panel {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .quick-actions,
  .quick-dpad {
    display: grid;
    gap: 5px;
  }

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

  .quick-dpad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-quick-panel button {
    min-width: 0;
    min-height: 42px;
    padding: 4px 2px;
    box-shadow: none;
    font-size: 0.68rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
    text-shadow: 1px 1px 0 #1d0e06;
  }

  .mobile-quick-panel [data-mobile-action="start"] {
    background: linear-gradient(180deg, var(--green), #148849);
    color: #06140c;
  }

  .mobile-quick-panel [data-mobile-action="teleport"] {
    background: linear-gradient(180deg, var(--yellow), #c99613);
    color: #15120e;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
  }

  .system-hud {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 0;
    padding: 10px;
    border-width: 4px;
  }

  .system-hud::before {
    inset: 6px;
    background:
      var(--modern-wall) left top / 48px 156px repeat-y,
      var(--modern-wall) right top / 48px 156px repeat-y;
    opacity: 0.1;
  }

  .system-hud::after {
    width: 42px;
    height: 42px;
  }

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

  .system-hud .seven-box {
    --display-top: 42px;
    --display-side: 10px;
    --display-bottom: 10px;
    min-height: 88px;
    padding: 10px;
  }

  .system-hud .seven-box::after {
    inset: var(--display-top) var(--display-side) var(--display-bottom);
  }

  .system-hud .label,
  .system-hud .control-group label,
  .system-hud .state-grid span {
    font-size: 0.7rem;
  }

  .system-hud .seven {
    font-size: clamp(1.48rem, 9vw, 2rem);
  }

  .system-hud .seven.dot-matrix {
    --dot-size: 3.5px;
    --dot-gap: 0.85px;
    min-height: 25px;
  }

  .system-hud .clock-box .seven.dot-matrix {
    --dot-size: 3.2px;
    --dot-gap: 0.8px;
  }

  .lamp-strip {
    gap: 6px;
  }

  .system-hud .lamp {
    min-height: 48px;
    padding: 8px 6px 8px 34px;
    font-size: 0.72rem;
  }

  .system-hud .lamp::before {
    left: 6px;
    width: 24px;
    height: 24px;
  }

  .system-hud .control-group,
  .system-hud .player-pods {
    padding: 12px;
    border-width: 3px;
  }

  .system-hud .control-group::before,
  .system-hud .player-pods::before {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
  }

  .system-hud .control-group h2,
  .system-hud .player-pods h2 {
    max-width: calc(100% - 48px);
    margin-bottom: 10px;
    font-size: 0.84rem;
  }

  .system-hud input[type="range"] {
    height: 28px;
  }

  .tilt-step-grid,
  .game-button-grid {
    gap: 7px;
  }

  .system-hud button {
    min-height: 46px;
    padding: 5px 4px;
    font-size: 0.72rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .run-panel .game-button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-hud .state-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px 10px;
  }

  .pod-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .system-hud .pod {
    min-height: 58px;
    padding: 8px;
  }

  .machine-lower {
    margin-top: 10px;
  }

  .hardware-bay,
  .terminal-panel,
  .trace-panel {
    padding: 10px;
    border-width: 4px;
  }

  .hardware-bay::before,
  .terminal-panel::before,
  .trace-panel::before {
    inset: 6px;
    opacity: 0.08;
  }

  .hardware-bay::after,
  .terminal-panel::after,
  .trace-panel::after {
    width: 42px;
    height: 42px;
  }

  .lower-drawer > summary {
    position: relative;
  }

  .lower-drawer > summary::after {
    position: absolute;
    right: 12px;
    top: 50%;
    color: #94f0c0;
    content: "+";
    font-family: var(--font-game);
    font-size: 1rem;
    line-height: 1;
    text-shadow: 2px 2px 0 #050608;
    transform: translateY(-50%);
  }

  .lower-drawer[open] > summary::after {
    content: "-";
  }

  .lower-drawer:not([open]) > summary {
    margin-bottom: 0;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .hardware-bay .panel-heading,
  .terminal-panel .panel-heading,
  .trace-panel > summary {
    min-height: 50px;
    padding: 7px 52px 7px 10px;
  }

  .hardware-bay .panel-heading h2,
  .terminal-panel .panel-heading h2,
  .trace-panel > summary h2 {
    font-size: 0.82rem;
  }

  .hardware-bay .panel-heading span,
  .terminal-panel .panel-heading span {
    max-width: 100%;
    font-size: 0.72rem;
    text-align: left;
  }

  .bay-grid,
  .event-log ol {
    grid-template-columns: 1fr;
  }

  .hardware-bay .circuit-board,
  .hardware-bay .video-window {
    padding: 12px;
    border-width: 3px;
  }

  .hardware-bay .circuit-board::before,
  .hardware-bay .video-window::before {
    width: 34px;
    height: 34px;
  }

  .board-title {
    max-width: calc(100% - 42px);
    font-size: 0.78rem;
  }

  .circuit-board ul {
    padding-left: 18px;
    padding-right: 14px;
    font-size: 0.84rem;
    line-height: 1.48;
  }

  .video-window p,
  .live-note {
    font-size: 0.84rem;
  }

  .terminal-panel .serial-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .terminal-panel button {
    min-height: 48px;
    padding: 5px 4px;
    font-size: 0.68rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .live-panel textarea {
    min-height: 132px;
    font-size: 0.76rem;
  }

  .event-log li {
    min-height: 66px;
    padding: 10px 10px 10px 44px;
  }

  .asset-credit {
    margin-top: 8px;
    padding: 0 2px;
    font-size: 0.66rem;
    line-height: 1.25;
    text-align: left;
  }
}

@media (max-width: 430px) {
  .console-header h1 {
    font-size: clamp(1.28rem, 6.9vw, 1.58rem);
  }

  .console-header p {
    font-size: 0.8rem;
  }

  .warning-marquee {
    height: 32px;
  }

  .warning-marquee .dot-matrix {
    --dot-size: 3.4px;
    --dot-gap: 0.8px;
  }

  #mazeScene {
    height: clamp(342px, 93vw, 400px);
  }

  .timer-screen.is-mobile-dock {
    height: clamp(238px, 68vw, 292px) !important;
  }

  .timer-screen.is-mobile-dock .leaderboard-strip {
    font-size: 0.5rem;
  }

  .timer-screen.is-mobile-dock .leaderboard-table {
    font-size: 0.52rem;
  }

  .timer-screen.is-mobile-dock .leaderboard-team small {
    display: none;
  }

  .timer-screen.is-mobile-dock .leaderboard-table tr.is-live .leaderboard-team span {
    max-width: 100%;
  }

  .system-hud .seven {
    font-size: clamp(1.34rem, 8vw, 1.8rem);
  }

  .system-hud .seven.dot-matrix,
  .system-hud .clock-box .seven.dot-matrix {
    --dot-size: 2.8px;
    --dot-gap: 0.7px;
  }

  .system-hud button,
  .terminal-panel button {
    font-size: 0.66rem;
  }

  .mobile-quick-panel button {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Showcase redesign: public-facing project story layered over the existing console system. */
.showcase-page {
  width: min(1440px, calc(100% - 32px));
  padding: 18px 0 40px;
}

.showcase-page img {
  image-rendering: auto;
}

.showcase-page .eyebrow {
  margin: 0 0 10px;
  color: #94f0c0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: none;
}

.showcase-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr) 240px;
  gap: 20px;
  align-items: stretch;
  min-height: 540px;
  padding: 8px 0 12px;
}

.showcase-hero::before {
  position: absolute;
  inset: auto;
}

.hero-copy,
.hero-media,
.hero-status,
.showcase-band,
.demo-section {
  position: relative;
  border: 4px solid #080b0e;
  background:
    linear-gradient(90deg, rgba(139, 230, 244, 0.055) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, rgba(38, 48, 52, 0.96), rgba(16, 21, 23, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    inset 0 0 0 8px rgba(8, 11, 14, 0.38),
    0 18px 44px var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 2vw, 24px);
}

.showcase-hero .hero-copy h1 {
  margin: 0;
  max-width: 11ch;
  color: #fff7de;
  font-size: clamp(3rem, 5.2vw, 5.1rem);
  line-height: 0.92;
  text-shadow:
    4px 4px 0 #070605,
    0 0 28px rgba(255, 116, 67, 0.24);
}

.hero-lede {
  max-width: 61ch;
  margin: 18px 0 0;
  color: #efe4cf;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.showcase-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 3px solid #050605;
  background: #26322c;
  color: #fff2c9;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-shadow: 2px 2px 0 #231208;
  text-transform: uppercase;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    4px 4px 0 #050605;
  white-space: nowrap;
}

.showcase-button:hover,
.showcase-button:focus-visible {
  outline: 2px solid transparent;
  transform: translate(-1px, -1px);
  background: #334137;
}

.showcase-button--primary {
  background: #ff6d2d;
  color: #fff8dc;
  text-shadow: 2px 2px 0 #7a2609;
}

.showcase-page button {
  min-height: 44px;
}

.showcase-page input[type="range"] {
  min-height: 44px;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.hero-facts div {
  min-width: 0;
  padding: 8px;
  border: 2px solid rgba(139, 230, 244, 0.28);
  background: rgba(9, 13, 14, 0.42);
}

.hero-facts dt {
  color: var(--yellow);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 6px 0 0;
  color: #ffffff;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
}

.showcase-hero .warning-marquee {
  max-width: 100%;
  height: 34px;
  margin-top: 18px;
}

.hero-media {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  object-fit: cover;
  object-position: 47% center;
}

.hero-media figcaption,
.media-grid figcaption {
  color: #d9d2c0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
  text-shadow: none;
}

.hero-media figcaption {
  padding: 10px 14px;
  border-top: 3px solid #080b0e;
  background: rgba(13, 19, 25, 0.95);
}

.hero-status {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  min-width: 0;
}

.hero-status .traffic-signal {
  grid-column: auto;
  justify-self: center;
  align-self: center;
}

.hero-status .mode-switch {
  grid-column: auto;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.hero-status .mode-button {
  min-width: 0;
}

.hero-status p {
  margin: 0;
  color: #efe4cf;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.45;
  text-shadow: none;
}

.hero-status strong {
  color: #fff7de;
}

.showcase-band,
.demo-section {
  margin-top: 22px;
  padding: clamp(18px, 2.2vw, 28px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 18px;
}

.section-heading--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
  gap: 22px;
  max-width: none;
  align-items: end;
}

.section-heading h2 {
  margin: 0;
  color: #fff7de;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 3px 3px 0 #070605;
}

.section-heading p,
.explain-panel p,
.explain-panel li,
.flow-steps p,
.snapshot-grid p {
  color: #e2d8c6;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 750;
  line-height: 1.52;
  text-shadow: none;
}

.section-heading > p:last-child {
  margin: 12px 0 0;
}

.snapshot-grid,
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.snapshot-grid article,
.outcome-grid article,
.demo-script article,
.explain-panel,
.flow-steps li {
  border: 3px solid #080b0e;
  background:
    linear-gradient(90deg, rgba(240, 204, 71, 0.055) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(47, 60, 68, 0.96), rgba(22, 30, 37, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    inset 0 -8px 0 rgba(0, 0, 0, 0.16);
}

.snapshot-grid article {
  padding: 16px;
}

.outcome-grid article {
  min-height: 170px;
  padding: 18px 16px;
}

.snapshot-grid span,
.outcome-grid span,
.demo-script span {
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-grid h3,
.explain-panel h3,
.demo-guide h3 {
  margin: 8px 0 8px;
  color: #ffffff;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #050608;
}

.outcome-grid strong,
.demo-script strong {
  display: block;
  margin-top: 10px;
  color: #fff7de;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #050608;
}

.snapshot-grid p,
.outcome-grid p,
.flow-steps p,
.demo-script p {
  margin: 0;
  font-size: 0.94rem;
}

.outcome-grid p,
.demo-script p {
  margin-top: 10px;
  color: #e2d8c6;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 750;
  line-height: 1.48;
  text-shadow: none;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.flow-steps li {
  position: relative;
  min-height: 184px;
  padding: 18px 16px 16px;
}

.flow-steps li::before {
  counter-increment: flow;
  content: "0" counter(flow);
  display: block;
  margin-bottom: 28px;
  color: rgba(139, 230, 244, 0.6);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.flow-steps span {
  display: block;
  margin-bottom: 8px;
  color: #fff7de;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 1.08rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #050608;
}

.guided-demo__surface {
  grid-template-columns: minmax(0, 1fr) 380px;
  margin-top: 18px;
}

.demo-script {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.demo-script article {
  position: relative;
  min-height: 128px;
  padding: 14px 14px 16px;
  background:
    linear-gradient(90deg, rgba(255, 109, 45, 0.055) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(45, 57, 63, 0.96), rgba(18, 25, 30, 0.98));
}

.demo-script article::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 18px;
  width: 34px;
  height: 3px;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  box-shadow: 0 6px 0 rgba(255, 109, 45, 0.3);
}

.demo-script article:last-child::after {
  width: 14px;
  border-radius: 999px;
}

.demo-section .scene-shell {
  min-height: 540px;
}

.demo-section #mazeScene {
  height: min(64vh, 680px);
  min-height: 540px;
}

.demo-guide {
  padding: 14px;
  border: 3px solid #080b0e;
  background:
    linear-gradient(90deg, rgba(84, 223, 137, 0.08) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(20, 36, 31, 0.95), rgba(11, 18, 18, 0.98));
  box-shadow:
    inset 0 0 0 2px rgba(84, 223, 137, 0.12),
    4px 4px 0 rgba(0, 0, 0, 0.36);
}

.demo-guide ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #dff6e8;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.42;
}

.demo-guide li + li {
  margin-top: 5px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.footage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.72fr);
  gap: 14px;
  align-items: stretch;
}

.footage-card {
  min-width: 0;
  margin: 0;
  border: 3px solid #080b0e;
  background: rgba(13, 19, 25, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    0 14px 34px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.footage-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050608;
  object-fit: cover;
}

.footage-card--primary video {
  min-height: 360px;
}

.footage-card figcaption {
  padding: 12px 14px;
  border-top: 3px solid #080b0e;
  color: #d9d2c0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
  text-shadow: none;
}

.media-grid--two {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  align-items: stretch;
}

.media-grid figure {
  min-width: 0;
  margin: 0;
  border: 3px solid #080b0e;
  background: rgba(13, 19, 25, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    0 14px 34px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.media-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hardware-story .media-grid img[src*="system-evidence"] {
  object-fit: contain;
  background: #edf1f5;
}

.media-grid figcaption {
  padding: 12px 14px;
  border-top: 3px solid #080b0e;
}

.explain-panel {
  padding: 22px;
}

.explain-panel h3 {
  margin-top: 0;
  font-size: 1.22rem;
}

.explain-panel ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.explain-panel li + li {
  margin-top: 8px;
}

.hardware-story .machine-lower {
  margin-top: 14px;
}

.live-story .terminal-panel {
  margin-top: 16px;
}

.showcase-page .asset-credit {
  margin-top: 14px;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

@media (max-width: 1240px) {
  .showcase-hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  }

  .hero-status {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(220px, 320px) minmax(0, 1fr);
    align-items: center;
  }

  .hero-status .mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-grid,
  .outcome-grid,
  .demo-script,
  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .showcase-hero,
  .section-heading--split,
  .footage-grid,
  .media-grid,
  .media-grid--two,
  .guided-demo__surface {
    grid-template-columns: 1fr;
  }

  .showcase-hero {
    min-height: 0;
  }

  .hero-copy {
    min-height: 520px;
  }

  .hero-media img {
    max-height: 520px;
  }

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

  .hero-status p {
    grid-column: 1 / -1;
  }

  .demo-section .scene-shell {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .showcase-page {
    width: 100%;
    padding: 8px 8px 24px;
  }

  .showcase-hero {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 10px;
  }

  .hero-copy,
  .hero-media,
  .hero-status,
  .showcase-band,
  .demo-section {
    border-width: 3px;
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.06),
      0 12px 24px rgba(0, 0, 0, 0.36);
  }

  .hero-copy {
    min-height: auto;
    padding: 22px 16px;
  }

  .showcase-hero .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.85rem, 15vw, 4.2rem);
  }

  .hero-lede {
    margin-top: 14px;
    font-size: 0.92rem;
    line-height: 1.42;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 16px;
  }

  .showcase-button {
    width: 100%;
  }

  .hero-facts {
    display: none;
  }

  .showcase-hero .warning-marquee {
    display: none;
  }

  .hero-media img {
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .hero-media figcaption {
    padding: 9px 10px;
    font-size: 0.78rem;
  }

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

  .hero-status .traffic-signal {
    display: none;
  }

  .hero-status .mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-status p {
    display: none;
  }

  .showcase-band,
  .demo-section {
    margin-top: 10px;
    padding: 16px 12px;
  }

  .section-heading {
    margin-bottom: 14px;
  }

  .section-heading h2 {
    font-size: clamp(1.45rem, 9vw, 2rem);
  }

  .section-heading p,
  .explain-panel p,
  .explain-panel li,
  .outcome-grid p,
  .demo-script p,
  .flow-steps p,
  .snapshot-grid p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .snapshot-grid,
  .outcome-grid,
  .demo-script,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .snapshot-grid article,
  .outcome-grid article,
  .demo-script article,
  .flow-steps li,
  .explain-panel {
    padding: 14px;
  }

  .outcome-grid article,
  .demo-script article {
    min-height: auto;
  }

  .demo-script article::after {
    top: 16px;
  }

  .flow-steps li {
    min-height: auto;
  }

  .flow-steps li::before {
    margin-bottom: 14px;
    font-size: 1.5rem;
  }

  .demo-section #mazeScene {
    min-height: 0;
    height: clamp(350px, 92vw, 430px);
  }

  .demo-guide {
    padding: 12px;
  }

  .media-grid {
    gap: 10px;
  }

  .footage-grid {
    gap: 10px;
  }

  .footage-card--primary video {
    min-height: 0;
  }

  .media-grid img {
    aspect-ratio: 4 / 3;
  }

  .footage-card figcaption {
    padding: 10px 11px;
    font-size: 0.82rem;
  }

  .hardware-story .media-grid img[src*="system-evidence"] {
    aspect-ratio: 16 / 9;
  }

  .media-grid figcaption {
    padding: 10px 11px;
    font-size: 0.82rem;
  }
}
