/* ── P2 Computing — flight deck ─────────────────────────────────
   Palette (fixed): void #000, deep #3b0855, plum #852467,
   salmon #FD8083, pink #EE227D, steel #498099, teal #30C0B7
   + amber accents (#FFB03A / #FF7A1F) per the cockpit reference.
   Motion rule: slow breathes and sweeps only. Nothing strobes.  */

:root {
  --void:   #000000;
  --deep:   #3b0855;
  --plum:   #852467;
  --salmon: #FD8083;
  --pink:   #EE227D;
  --steel:  #498099;
  --teal:   #30C0B7;
  --amber:  #FFB03A;
  --ember:  #FF7A1F;

  --panel:  #12081c;
  --panel2: #1b0b28;
  --edge:   #3a1d4e;
  --screenb:#02060a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--void); }

body {
  min-height: 100vh;
  color: var(--teal);
  font-family: "Share Tech Mono", ui-monospace, Consolas, monospace;
  background: var(--void);
  overflow-x: hidden;
}

.mono { font-family: "Share Tech Mono", ui-monospace, Consolas, monospace; }

button { font-family: inherit; }
button:focus-visible { outline: 2px solid var(--salmon); outline-offset: 2px; }

/* CRT overlay: static scanlines + vignette (never animated) */
.crt {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background:
    repeating-linear-gradient(0deg,
      rgba(0,0,0,.14) 0px, rgba(0,0,0,.14) 1px,
      transparent 1px, transparent 3px),
    radial-gradient(ellipse 140% 140% at 50% 50%,
      transparent 62%, rgba(0,0,0,.5) 100%);
}

/* kept for 404.html */
.stars {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(253,128,131,.9), transparent 100%),
    radial-gradient(1px 1px at 78% 8%,  rgba(48,192,183,.9), transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 32%, rgba(255,255,255,.7), transparent 100%),
    radial-gradient(1px 1px at 32% 64%, rgba(73,128,153,.9), transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 55%, rgba(238,34,125,.8), transparent 100%),
    radial-gradient(1px 1px at 8% 88%,  rgba(255,255,255,.55), transparent 100%);
}

.cockpit { display: flex; flex-direction: column; min-height: 100vh; }

/* ── lamps (shared) — breathe, never blink ─────────────────── */

.lamp {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #1c1229; border: 1px solid #3c2a50;
}
.lamp.on        { background: var(--teal);  border-color: var(--teal);  box-shadow: 0 0 7px var(--teal), 0 0 16px var(--teal); }
.lamp.amber.on  { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 7px var(--amber), 0 0 16px var(--amber); }
.lamp.pink.on   { background: var(--pink);  border-color: var(--pink);  box-shadow: 0 0 7px var(--pink), 0 0 16px var(--pink); }

.beacon .lamp.on { animation: lampBreathe 4s ease-in-out infinite; }
@keyframes lampBreathe { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ── top frame ─────────────────────────────────────────────── */

.topframe {
  display: flex; align-items: center; gap: 12px;
  padding: 8px clamp(10px, 2vw, 26px);
  background: linear-gradient(180deg, #241031, #0d0415 80%);
  border-bottom: 1px solid var(--edge);
  box-shadow: 0 2px 14px rgba(0,0,0,.8), inset 0 -1px 0 rgba(238,34,125,.25);
}

.tf-plate {
  display: flex; gap: 8px; padding: 6px 10px;
  background: #0a0511; border: 1px solid var(--edge);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.tf-screen {
  flex: 1; text-align: center;
  padding: 5px 10px;
  font-size: .72rem; letter-spacing: .18em;
  color: var(--amber); text-shadow: 0 0 6px rgba(255,176,58,.7);
  background: #0a0602; border: 1px solid #4a3110;
  box-shadow: inset 0 0 12px rgba(255,122,31,.15);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.logo {
  font-family: "Orbitron", sans-serif; font-weight: 900;
  font-size: clamp(1rem, 2.6vw, 1.5rem); letter-spacing: .16em;
  color: #fff;
  text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 40px rgba(238,34,125,.5);
  white-space: nowrap;
}
.logo-sep { color: var(--teal); text-shadow: 0 0 8px var(--teal), 0 0 20px var(--teal); }

@media (max-width: 760px) { .tf-screen { display: none; } .topframe { justify-content: center; } }

/* ── viewport ──────────────────────────────────────────────── */

.viewport {
  position: relative;
  height: clamp(340px, 52vh, 640px);
  overflow: hidden;
  background: #000;
  border-bottom: 2px solid var(--plum);
  box-shadow: inset 0 -30px 60px rgba(0,0,0,.8);
}

.space { position: absolute; inset: 0; }

.starfield {
  position: absolute; left: 0; right: 0; top: -260px; bottom: -260px;
  background-repeat: repeat;
  background-size: 260px 260px;
  will-change: transform;
}
.sf1 {
  background-image:
    radial-gradient(1px 1px at 20px 30px,  rgba(255,255,255,.7), transparent 100%),
    radial-gradient(1px 1px at 90px 140px, rgba(73,128,153,.9), transparent 100%),
    radial-gradient(1px 1px at 160px 60px, rgba(255,255,255,.5), transparent 100%),
    radial-gradient(1px 1px at 220px 200px,rgba(253,128,131,.8), transparent 100%),
    radial-gradient(1px 1px at 60px 220px, rgba(255,255,255,.4), transparent 100%);
}
.sf2 {
  background-image:
    radial-gradient(1.6px 1.6px at 130px 40px, rgba(48,192,183,.95), transparent 100%),
    radial-gradient(1.6px 1.6px at 40px 170px, rgba(255,255,255,.85), transparent 100%),
    radial-gradient(1.6px 1.6px at 210px 120px,rgba(238,34,125,.85), transparent 100%);
}

/* the planet: a huge sphere whose upper arc crosses the glass */
.planet {
  position: absolute;
  left: 50%; top: 34%;
  width: 300vmax; height: 300vmax;
  transform: translateX(-50%);
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(140% 30% at 50% 0%, rgba(48,192,183,.30), transparent 60%),
    radial-gradient(60% 12% at 30% 1%,  rgba(73,128,153,.5), transparent 70%),
    radial-gradient(50% 10% at 68% 2%,  rgba(19,80,110,.65), transparent 70%),
    linear-gradient(180deg, #14495e 0%, #0d3448 4%, #072031 9%, #030b13 16%, #000 26%);
  box-shadow: 0 -4px 40px rgba(48,192,183,.35);
}

/* settlements glowing on the night side */
.planet .lights {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(3px 3px at 44% 2.4%, var(--amber), transparent 100%),
    radial-gradient(2px 2px at 46.5% 3.1%, rgba(255,176,58,.8), transparent 100%),
    radial-gradient(4px 4px at 52% 1.9%, var(--ember), transparent 100%),
    radial-gradient(2px 2px at 55% 3.4%, rgba(255,176,58,.7), transparent 100%),
    radial-gradient(3px 3px at 60% 2.2%, rgba(253,128,131,.85), transparent 100%),
    radial-gradient(2px 2px at 39% 3.6%, rgba(255,176,58,.6), transparent 100%),
    radial-gradient(5px 5px at 48.5% 4.2%, rgba(255,122,31,.5), transparent 100%),
    radial-gradient(2px 2px at 63% 3.9%, rgba(238,34,125,.6), transparent 100%),
    radial-gradient(3px 3px at 35% 2.1%, rgba(255,176,58,.55), transparent 100%),
    radial-gradient(2px 2px at 57.5% 5%, rgba(255,176,58,.45), transparent 100%);
}

/* cloud sheets, pre-blurred gradients only */
.planet .clouds {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(18% 3.5% at 42% 2.6%, rgba(255,255,255,.16), transparent 75%),
    radial-gradient(24% 4% at 58% 4.4%,   rgba(255,255,255,.11), transparent 75%),
    radial-gradient(14% 2.6% at 33% 4.8%, rgba(255,255,255,.13), transparent 75%),
    radial-gradient(30% 5% at 50% 7.5%,   rgba(200,225,255,.07), transparent 75%);
}

/* terminator: night falls to the right */
.planet .shade {
  position: absolute; inset: 0;
  background: linear-gradient(97deg, transparent 46%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.78) 76%);
}

/* nav overlay lat/lon grid (GRID switch) */
.planet-grid {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg,  rgba(48,192,183,.28) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(90deg, rgba(48,192,183,.22) 0 1px, transparent 1px 64px);
  -webkit-mask-image: linear-gradient(180deg, #000 0 12%, transparent 26%);
  mask-image: linear-gradient(180deg, #000 0 12%, transparent 26%);
}

/* atmosphere rim */
.atmo {
  position: absolute;
  left: 50%; top: 34%;
  width: 300vmax; height: 300vmax;
  transform: translateX(-50%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 -6px 28px rgba(127,231,222,.5),
    0 -22px 80px rgba(48,192,183,.35),
    0 -50px 160px rgba(238,34,125,.18);
}

/* ── HUD drawn on the glass ── */

.hud { position: absolute; inset: 0; pointer-events: none; }

.hud-corner {
  position: absolute; width: 26px; height: 26px;
  border: 2px solid rgba(48,192,183,.75);
  filter: drop-shadow(0 0 5px rgba(48,192,183,.8));
}
.c-tl { top: 14px; left: 78px;  border-right: none; border-bottom: none; }
.c-tr { top: 14px; right: 78px; border-left: none;  border-bottom: none; }
.c-bl { bottom: 14px; left: 78px;  border-right: none; border-top: none; }
.c-br { bottom: 14px; right: 78px; border-left: none;  border-top: none; }

.crosshair {
  position: absolute; left: 50%; top: 46%;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border: 1.5px solid rgba(48,192,183,.85);
  border-radius: 50%;
  filter: drop-shadow(0 0 6px rgba(48,192,183,.7));
  transition: transform .6s cubic-bezier(.2,1.4,.4,1);
}
.crosshair::before, .crosshair::after {
  content: ""; position: absolute; background: rgba(48,192,183,.85);
}
.crosshair::before { left: 50%; top: -12px; bottom: -12px; width: 1.5px; margin-left: -.75px; }
.crosshair::after  { top: 50%; left: -12px; right: -12px; height: 1.5px; margin-top: -.75px; }
.crosshair i {
  position: absolute; left: 50%; top: 50%; width: 4px; height: 4px;
  margin: -2px 0 0 -2px; border-radius: 50%; background: var(--pink);
  box-shadow: 0 0 6px var(--pink);
}

/* tracking reticles (amber, like the reference) */
.reticle {
  position: absolute; width: 108px; height: 108px;
  margin: -54px 0 0 -54px;
  background: none; border: none; cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 0 6px rgba(255,176,58,.55));
}
.ret-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px dashed var(--amber);
  animation: retSpin 26s linear infinite;
}
.ret-b .ret-ring { border-color: var(--pink); animation-duration: 34s; animation-direction: reverse; }
.ret-inner {
  position: absolute; inset: 22%; border-radius: 50%;
  border: 1.5px solid rgba(255,176,58,.9);
}
.ret-b .ret-inner { border-color: rgba(238,34,125,.9); }
.ret-id {
  position: absolute; left: 50%; top: 104%; transform: translateX(-50%);
  font-size: .62rem; letter-spacing: .2em; color: var(--amber);
  text-shadow: 0 0 5px rgba(255,176,58,.8);
}
.ret-b .ret-id { color: var(--pink); text-shadow: 0 0 5px rgba(238,34,125,.8); }
.reticle:hover .ret-inner { inset: 18%; }
@keyframes retSpin { to { transform: rotate(360deg); } }

.hud-data {
  position: absolute;
  font-size: .68rem; line-height: 1.7; letter-spacing: .14em;
  color: rgba(127,231,222,.9);
  text-shadow: 0 0 5px rgba(48,192,183,.7);
}
.hud-data b { font-weight: 400; color: #fff; }
.hd-tl { top: 22px; left: 96px; }
.hd-tr { top: 22px; right: 96px; text-align: right; }
.hd-bl { bottom: 22px; left: 96px; }
.hd-br { bottom: 22px; right: 96px; text-align: right; color: var(--amber); text-shadow: 0 0 5px rgba(255,176,58,.7); }

.target-card {
  position: absolute; z-index: 5;
  min-width: 190px; max-width: 240px;
  padding: 10px 12px;
  pointer-events: auto;
  background: rgba(2,6,10,.88);
  border: 1px solid var(--amber);
  box-shadow: 0 0 14px rgba(255,176,58,.35), inset 0 0 18px rgba(255,122,31,.08);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.target-card h3 { font-size: .72rem; letter-spacing: .25em; color: var(--amber); margin-bottom: 6px; }
.target-card p  { font-size: .68rem; line-height: 1.75; letter-spacing: .1em; color: var(--teal); white-space: pre-line; }
.tcard-x {
  position: absolute; top: 2px; right: 6px;
  background: none; border: none; color: var(--salmon);
  font-size: 1rem; cursor: pointer;
}

/* window struts */
.strut {
  position: absolute; top: 0; bottom: 0; width: 66px; z-index: 6;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 22px;
  background: linear-gradient(90deg, #241031, #0d0415 70%);
}
.strut-l { left: 0;  clip-path: polygon(0 0, 100% 7%, 100% 93%, 0 100%); border-right: 1px solid var(--edge); box-shadow: 8px 0 22px rgba(0,0,0,.65); }
.strut-r { right: 0; clip-path: polygon(0 7%, 100% 0, 100% 100%, 0 93%); border-left: 1px solid var(--edge); box-shadow: -8px 0 22px rgba(0,0,0,.65); }

.ind {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 44px; padding: 7px 0 5px;
  background: #0a0511; border: 1px solid var(--edge); border-radius: 4px;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.7);
}
.ind-lbl { font-size: .5rem; letter-spacing: .16em; color: var(--steel); }

/* ── master caution ── */

.caution {
  text-align: center;
  padding: 7px 10px;
  font-size: .78rem; letter-spacing: .32em;
  color: #140a00;
  background: linear-gradient(180deg, var(--amber), var(--ember));
  box-shadow: 0 0 18px rgba(255,150,40,.75), 0 0 48px rgba(255,122,31,.4);
  animation: cautionGlow 4s ease-in-out infinite;
}
@keyframes cautionGlow {  /* glow swells gently; the bar itself never blinks */
  0%,100% { box-shadow: 0 0 14px rgba(255,150,40,.55), 0 0 34px rgba(255,122,31,.3); }
  50%     { box-shadow: 0 0 26px rgba(255,150,40,.9), 0 0 70px rgba(255,122,31,.55); }
}

/* ── console ───────────────────────────────────────────────── */

.console {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(250px,1fr) minmax(430px,1.7fr) minmax(250px,1fr);
  gap: 14px;
  padding: 16px clamp(10px, 2vw, 28px) 12px;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(59,8,85,.5), transparent 70%),
    linear-gradient(180deg, #170822, #0a0310 55%, #000);
  border-top: 1px solid rgba(238,34,125,.35);
}

@media (max-width: 980px) {
  .console { grid-template-columns: 1fr; }
  .cluster.center { order: -1; }
}

.cluster { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* screens */
.screen {
  position: relative;
  background: var(--screenb);
  border: 1px solid #2d3f52;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 26px rgba(48,192,183,.1),
    0 0 12px rgba(0,0,0,.7),
    0 0 8px rgba(73,128,153,.2);
}
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,.12) 0 1px, transparent 1px 3px);
}
.screen-title {
  font-family: "Orbitron", sans-serif; font-weight: 700;
  font-size: .6rem; letter-spacing: .3em;
  color: var(--steel);
  padding: 6px 10px;
  border-bottom: 1px solid #1d2c3c;
  background: linear-gradient(90deg, rgba(73,128,153,.28), transparent 70%);
}
.screen-foot {
  font-size: .66rem; letter-spacing: .12em; color: var(--steel);
  padding: 6px 10px; border-top: 1px solid #16222e;
}

/* systems screen */
.sysbars { list-style: none; padding: 10px; }
.sysbars li {
  display: grid;
  grid-template-columns: 4.6em 1fr 2.6em auto;
  align-items: center; gap: 7px;
  margin-bottom: 8px;
  font-size: .7rem; letter-spacing: .08em;
}
.sys-lbl { color: var(--steel); }
.sys-val { text-align: right; color: var(--salmon); }
.sys-track { height: 9px; background: rgba(0,0,0,.7); border: 1px solid #24384a; overflow: hidden; }
.sys-fill {
  display: block; height: 100%;
  background-image: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px);
  transition: width .5s ease;
}
.f-teal   { color: var(--teal);   box-shadow: 0 0 7px var(--teal); }
.f-steel  { color: var(--steel);  box-shadow: 0 0 7px var(--steel); }
.f-pink   { color: var(--pink);   box-shadow: 0 0 7px var(--pink); }
.f-salmon { color: var(--salmon); box-shadow: 0 0 7px var(--salmon); }
.f-amber  { color: var(--amber);  box-shadow: 0 0 7px var(--amber); }
.sys-btns { display: flex; gap: 4px; }
.sys-btns button {
  width: 18px; height: 18px; line-height: 1;
  font-size: .7rem; color: var(--teal);
  background: #0a1420; border: 1px solid #2d3f52; border-radius: 3px;
  cursor: pointer;
}
.sys-btns button:hover { background: #13283a; }

/* main terminal */
.screen.main { display: flex; flex-direction: column; min-height: 280px; }
.bootlog {
  flex: 1;
  padding: 10px 12px 4px;
  font-size: .8rem; line-height: 1.55;
  color: var(--teal);
  text-shadow: 0 0 4px rgba(48,192,183,.7);
  white-space: pre-wrap; word-break: break-word;
  min-height: 9em; max-height: 260px; overflow-y: auto;
}
.bootlog .sys  { color: var(--steel); }
.bootlog .warn { color: var(--salmon); }
.bootlog .err  { color: var(--pink); }
.bootlog .amb  { color: var(--amber); }

.commsline {
  font-size: .64rem; letter-spacing: .1em;
  color: var(--plum);
  padding: 3px 12px;
  border-top: 1px dashed #1d2c3c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.commsline b { color: var(--pink); font-weight: 400; }

.cmdline {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid #1d2c3c;
  padding: 7px 12px;
}
.prompt { color: var(--pink); text-shadow: 0 0 6px var(--pink); }
#cmd {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--teal); font-size: .9rem; letter-spacing: .05em;
  text-shadow: 0 0 4px rgba(48,192,183,.7);
  text-transform: uppercase;
  caret-color: var(--pink);
}
#cmd::placeholder { color: rgba(73,128,153,.5); }

/* center rows */
.centert { display: flex; gap: 12px; align-items: stretch; }
.centert .screen.main { flex: 1; min-width: 0; }
.dialbox { display: flex; align-items: center; }

.dial {
  width: 108px;
  background: linear-gradient(180deg, var(--panel2), #0a0413);
  border: 1px solid var(--edge); border-radius: 8px;
  padding: 8px 6px 6px;
  cursor: pointer;
  box-shadow: inset 0 0 14px rgba(0,0,0,.7), 0 0 8px rgba(133,36,103,.3);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dial svg { width: 88px; height: 88px; }
.dial-face  { fill: #050208; stroke: #3a4f63; stroke-width: 1.5; }
.dial-ticks line { stroke: var(--steel); stroke-width: 2; }
.dial-red   { fill: none; stroke: var(--pink); stroke-width: 4; }
.needle line { stroke: var(--amber); stroke-width: 2.5; filter: drop-shadow(0 0 3px rgba(255,176,58,.8)); }
.needle { transform-origin: 50px 50px; transition: transform 1.1s cubic-bezier(.3,.9,.4,1); }
.dial-cap { fill: var(--pink); }
.dial-label { font-size: .6rem; letter-spacing: .3em; color: var(--steel); }
.dial-val   { font-size: .8rem; letter-spacing: .1em; color: var(--amber); text-shadow: 0 0 6px rgba(255,176,58,.7); }

.centerb {
  display: flex; gap: 14px;
  align-items: flex-end; justify-content: center;
  padding: 2px 4px;
}

/* joysticks */
.joystick {
  position: relative;
  width: 84px; height: 118px; flex: none;
  cursor: grab;
  touch-action: none;
  perspective: 260px;
}
.joystick:active { cursor: grabbing; }
.joybase {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 78px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #3d2b4e, #0d0714 75%);
  border: 1px solid #43305a;
  box-shadow: 0 5px 12px rgba(0,0,0,.8), inset 0 2px 4px rgba(255,255,255,.08);
}
.stick {
  position: absolute; bottom: 13px; left: 50%;
  width: 13px; height: 76px;
  margin-left: -6.5px;
  transform-origin: bottom center;
  background: linear-gradient(90deg, #6a5a7c, #191122 70%);
  border-radius: 7px;
  transition: transform .55s cubic-bezier(.2,1.5,.4,1);
  z-index: 2;
}
.ball {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #ff9ec4, var(--pink) 45%, #4c0a28 92%);
  box-shadow: 0 0 10px rgba(238,34,125,.5), 0 3px 6px rgba(0,0,0,.6);
}
.ball::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 5px var(--amber);
}
.ball-t { background: radial-gradient(circle at 35% 28%, #9fe8e2, var(--teal) 45%, #0a3a36 92%); box-shadow: 0 0 10px rgba(48,192,183,.5), 0 3px 6px rgba(0,0,0,.6); }
.ball-t::after { background: var(--pink); box-shadow: 0 0 5px var(--pink); }

/* keypad */
.keypad {
  background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px;
  padding: 9px;
  box-shadow: inset 0 0 14px rgba(0,0,0,.7);
}
.pad-readout {
  text-align: center;
  font-size: .95rem; letter-spacing: .5em; text-indent: .5em;
  color: var(--amber); text-shadow: 0 0 7px rgba(255,176,58,.8);
  background: #0a0602; border: 1px solid #4a3110;
  padding: 4px 2px; margin-bottom: 8px;
}
.pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pad-keys button {
  width: 40px; height: 30px;
  font-size: .72rem; letter-spacing: .08em;
  color: var(--teal);
  background: linear-gradient(180deg, #131c26, #05090d);
  border: 1px solid #2d3f52; border-radius: 4px;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.6);
  text-shadow: 0 0 4px rgba(48,192,183,.6);
}
.pad-keys button:hover  { background: #16232f; }
.pad-keys button:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.6); }

/* throttle */
.throttle {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px;
  padding: 9px 10px;
  box-shadow: inset 0 0 14px rgba(0,0,0,.7);
}
.thr-lbl { font-size: .58rem; letter-spacing: .3em; color: var(--steel); }
.thr-body { display: flex; gap: 8px; align-items: stretch; height: 110px; }
.engbar {
  width: 9px; border: 1px solid #4a3110; background: #0a0602;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
#engfill {
  display: block; width: 100%; height: 18%;
  background: linear-gradient(180deg, var(--amber), var(--ember));
  box-shadow: 0 0 8px rgba(255,140,40,.8);
  transition: height .25s ease;
}
#thr {
  appearance: none; -webkit-appearance: none;
  writing-mode: vertical-lr; direction: rtl;
  width: 26px; height: 110px;
  background: transparent; cursor: grab;
}
#thr::-webkit-slider-runnable-track {
  width: 8px; background: linear-gradient(180deg, #2d3f52, #0a0f16);
  border: 1px solid #3a4f63; border-radius: 4px;
}
#thr::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 16px; margin-left: -10px;
  background: linear-gradient(180deg, #ffd9a0, var(--amber) 55%, #7a4a10);
  border: 1px solid #a06a1c; border-radius: 3px;
  box-shadow: 0 0 8px rgba(255,176,58,.7);
}
#thr::-moz-range-track { width: 8px; background: #14202c; border: 1px solid #3a4f63; border-radius: 4px; }
#thr::-moz-range-thumb {
  width: 26px; height: 16px; border: 1px solid #a06a1c; border-radius: 3px;
  background: linear-gradient(180deg, #ffd9a0, var(--amber) 55%, #7a4a10);
  box-shadow: 0 0 8px rgba(255,176,58,.7);
}
.thr-val { font-size: .72rem; letter-spacing: .1em; color: var(--amber); text-shadow: 0 0 6px rgba(255,176,58,.7); }

/* radar */
.radar { width: min(190px, 68%); margin: 10px auto 4px; display: block;
         filter: drop-shadow(0 0 10px rgba(48,192,183,.3)); }
.sweep { transform-origin: 100px 100px; animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.blip  { animation: blipBreathe 5s ease-in-out infinite; cursor: pointer; }
.blip2 { animation-delay: -2.5s; }
@keyframes blipBreathe { 0%,100% { opacity: .95; } 50% { opacity: .35; } }

/* button matrices */
.matrix {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px;
  box-shadow: inset 0 0 16px rgba(0,0,0,.7);
}
.mkey {
  height: 30px;
  font-size: .55rem; letter-spacing: .06em;
  border-radius: 3px; cursor: pointer;
  border: 1px solid #3c2a50;
  background: #0d0714;
  color: var(--mc, var(--teal));
  opacity: .85;
  transition: box-shadow .25s ease, background .25s ease, color .25s ease;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.65);
}
.mkey.on {
  background: var(--mc, var(--teal));
  color: #0a0208;
  opacity: 1;
  box-shadow: 0 0 8px var(--mc, var(--teal)), 0 0 18px var(--mc, var(--teal)), inset 0 -3px 0 rgba(0,0,0,.25);
}

/* toggle switch banks */
.switchbank {
  display: flex; justify-content: space-around; gap: 8px;
  padding: 10px 8px;
  background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px;
  box-shadow: inset 0 0 16px rgba(0,0,0,.7);
}
.switch {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
}
.sw-slot {
  position: relative;
  width: 22px; height: 46px;
  background: #05030a; border: 1px solid #3c2a50; border-radius: 11px;
  transition: box-shadow .25s ease;
}
.sw-knob {
  position: absolute; left: 2px; width: 16px; height: 18px;
  border-radius: 8px; top: 25px;
  background: linear-gradient(180deg, #cfc6dc, #6d6280 60%, #2a2438);
  box-shadow: 0 2px 4px rgba(0,0,0,.7);
  transition: top .16s ease;
}
.switch[aria-checked="true"] .sw-knob { top: 3px; }
.switch[aria-checked="true"] .sw-slot {
  box-shadow: 0 0 8px var(--swc, var(--teal)), inset 0 0 6px var(--swc, var(--teal));
  border-color: var(--swc, var(--teal));
}
.sw-lbl { font-size: .55rem; letter-spacing: .18em; color: var(--steel); }

/* master row */
.masterrow { display: flex; gap: 12px; justify-content: center; }
.bigbtn {
  position: relative;
  width: 96px; padding: 14px 6px 10px;
  font-family: "Orbitron", sans-serif;
  font-size: .58rem; letter-spacing: .18em; line-height: 1.7;
  cursor: pointer;
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 100%, 0 100%);
}
.amberb {
  color: #ffe9c8;
  background: linear-gradient(180deg, rgba(255,176,58,.3), rgba(0,0,0,.8));
  border: 1px solid var(--amber);
  text-shadow: 0 0 5px rgba(255,176,58,.8);
  box-shadow: 0 0 8px rgba(255,176,58,.3), inset 0 0 10px rgba(255,122,31,.18);
}
body.caution-on .amberb {
  background: linear-gradient(180deg, rgba(255,176,58,.75), rgba(120,60,0,.85));
  color: #140a00; text-shadow: none;
  box-shadow: 0 0 16px rgba(255,150,40,.8), 0 0 40px rgba(255,122,31,.45);
}
.pinkb {
  color: #fff;
  background: linear-gradient(180deg, rgba(238,34,125,.32), rgba(0,0,0,.8));
  border: 1px solid var(--pink);
  text-shadow: 0 0 5px var(--pink);
  box-shadow: 0 0 8px rgba(238,34,125,.35), inset 0 0 10px rgba(238,34,125,.2);
}
.guard {
  position: absolute; inset: 0 0 58% 0;
  background: repeating-linear-gradient(-45deg,
    rgba(238,34,125,.8) 0 9px, rgba(0,0,0,.85) 9px 18px);
  border-bottom: 1px solid var(--pink);
  pointer-events: none;
}

/* cabin lights off */
body.dim .console,
body.dim .topframe,
body.dim footer { filter: brightness(.62) saturate(.85); }

/* ── footer ── */

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px;
  padding: 8px clamp(10px, 2vw, 28px) 12px;
  font-size: .62rem; letter-spacing: .18em;
  color: var(--plum);
  background: #000;
}
.dim { color: rgba(73,128,153,.7); }
.ok   { color: var(--teal);   text-shadow: 0 0 6px rgba(48,192,183,.8); }
.warn { color: var(--salmon); text-shadow: 0 0 6px rgba(253,128,131,.8); }

::selection { background: var(--pink); color: #000; }
* { scrollbar-width: thin; scrollbar-color: var(--plum) transparent; }

/* small screens: struts thin out, HUD text tucks in */
@media (max-width: 700px) {
  .strut { width: 44px; gap: 12px; }
  .ind { width: 36px; }
  .hd-tl, .hd-bl, .c-tl, .c-bl { left: 54px; }
  .hd-tr, .hd-br, .c-tr, .c-br { right: 54px; }
  .centert { flex-wrap: wrap; }
  .dialbox { order: 2; }
  .centerb { flex-wrap: wrap; align-items: center; }
}

/* ── motion safety: everything stills, nothing lost ── */

@media (prefers-reduced-motion: reduce) {
  .sweep, .blip, .ret-ring, .caution, .beacon .lamp.on { animation: none; }
  .crosshair, .stick, .needle { transition: none; }
}
