/* ============================================================
   THE HULL — M88A2 Hercules interior
   steel · olive drab · amber instrument light · stencil
   ============================================================ */

@font-face { font-family: "Black Ops One"; src: url("../fonts/blackops.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("../fonts/specialelite.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("../fonts/sharetechmono.woff2") format("woff2"); font-display: swap; }

:root {
  --steel-0: #0e100b;       /* deepest hull shadow */
  --steel-1: #14160f;       /* base */
  --steel-2: #1b1e15;       /* raised plate */
  --steel-3: #24281b;       /* lit plate */
  --olive:   #3e4527;
  --olive-hi:#5a6242;
  --olive-edge:#6c7350;
  --amber:   #ffb02e;
  --amber-dim:#9a6f23;
  --amber-glow: rgba(255, 176, 46, .35);
  --cream:   #d6c496;
  --green:   #9fb86d;
  --red:     #d4452c;
  --red-deep:#7e2417;
  --txt:     #cfc9b4;
  --txt-dim: #7d7a66;
  --stencil: "Black Ops One", Impact, sans-serif;
  --mono: "Share Tech Mono", Consolas, monospace;
  --type: "Special Elite", "Courier New", monospace;
  --rivet: radial-gradient(circle at 35% 30%, #8a8d74, #44462f 60%, #23251a);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  background: var(--steel-1);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 15px;
  overflow-x: hidden;
}
/* faint background artwork plate */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url("../assets/bg_plate.jpg") center / cover no-repeat var(--steel-1);
}
/* hull texture: subtle diagonal tread + vignette */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    repeating-linear-gradient(135deg, transparent 0 22px, rgba(255,255,255,.012) 22px 24px),
    radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0,0,0,.55) 100%);
}

.mono { font-family: var(--mono); }
.stencil { font-family: var(--stencil); letter-spacing: .06em; color: var(--cream); font-weight: 400; }
.small { font-size: 13px; } .tiny { font-size: 11px; letter-spacing: .08em; }
.dim { color: var(--txt-dim); }
.error { color: var(--red); margin-top: 10px; }
.amber { color: var(--amber); }
.red { color: var(--red); }

/* ---------------- panels & hardware ---------------- */

.panel {
  background: linear-gradient(160deg, var(--steel-3), var(--steel-2) 55%, #171a11);
  border: 1px solid #0a0b07;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    inset 0 -2px 6px rgba(0,0,0,.5),
    0 4px 14px rgba(0,0,0,.55);
  border-radius: 6px;
}
.riveted { position: relative; }
.riveted::before, .riveted::after {
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--rivet); box-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.riveted::before { top: 7px; left: 7px; }
.riveted::after  { top: 7px; right: 7px; }

.stencil-tag {
  display: inline-block;
  font-family: var(--stencil);
  font-size: 12px; letter-spacing: .22em;
  color: var(--steel-1);
  background: var(--cream);
  padding: 3px 10px; border-radius: 2px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.stencil-tag.amber { background: var(--amber); }
.stencil-tag.red { background: var(--red); color: #fff; }

.field {
  width: 100%;
  background: #0c0e08;
  border: 1px solid #060704;
  border-radius: 4px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.05);
  color: var(--amber);
  padding: 11px 12px;
  font-size: 16px;
  caret-color: var(--amber);
  text-shadow: 0 0 6px var(--amber-glow);
}
.field:focus { outline: none; border-color: var(--amber-dim); box-shadow: inset 0 2px 8px rgba(0,0,0,.8), 0 0 0 1px var(--amber-dim), 0 0 14px rgba(255,176,46,.12); }
.field.sm { padding: 8px 10px; font-size: 13px; }

.btn-mech {
  font-family: var(--stencil); letter-spacing: .12em; font-size: 14px;
  color: var(--steel-1);
  background: linear-gradient(180deg, #ffc35b, var(--amber) 45%, #d9931f);
  border: 1px solid #6e4c0e;
  border-radius: 4px;
  padding: 11px 20px;
  cursor: pointer;
  box-shadow: 0 3px 0 #6e4c0e, 0 5px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .05s, box-shadow .05s, filter .15s;
  text-transform: uppercase;
}
.btn-mech:hover { filter: brightness(1.06); }
.btn-mech:active { transform: translateY(3px); box-shadow: 0 0 0 #6e4c0e, 0 2px 6px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-mech.sm { font-size: 11px; padding: 8px 13px; }
.btn-mech:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; }

.led { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #2c2f1f; box-shadow: inset 0 1px 2px rgba(0,0,0,.8); }
.led.on { background: var(--green); box-shadow: 0 0 8px rgba(159,184,109,.8), inset 0 0 2px rgba(255,255,255,.6); animation: led-idle 4s infinite; }
@keyframes led-idle { 0%,100% { opacity: 1; } 50% { opacity: .75; } }

/* ---------------- screens ---------------- */

.screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #181b10 0%, var(--steel-0) 75%);
  padding: 20px;
}

/* login */
.login-plate { width: min(420px, 94vw); padding: 34px 30px 22px; text-align: center; }
.hull-title {
  font-family: var(--stencil); font-size: clamp(46px, 12vw, 64px);
  color: var(--cream); letter-spacing: .04em; line-height: 1; margin: 14px 0 6px;
  text-shadow: 0 0 24px rgba(214,196,150,.18), 0 2px 0 #000;
}
#login-form { margin-top: 26px; display: grid; gap: 12px; text-align: left; }
#login-form label { color: var(--txt-dim); letter-spacing: .2em; }
.plate-foot { margin-top: 22px; opacity: .55; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(4px)} }

/* identity */
.identity-wrap { text-align: center; }
.identity-cards { display: flex; gap: 22px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.id-card {
  width: 180px; padding: 18px 14px 16px; cursor: pointer;
  display: grid; gap: 8px; justify-items: center;
  color: var(--txt); transition: transform .12s, box-shadow .12s;
}
.id-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.7), 0 0 0 1px var(--amber-dim), 0 0 24px rgba(255,176,46,.1); }
.id-card img { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; border: 3px solid var(--olive-hi); box-shadow: 0 0 0 2px #0a0b07, 0 4px 12px rgba(0,0,0,.6); }
.id-name { font-family: var(--stencil); font-size: 24px; color: var(--cream); letter-spacing: .1em; }

/* ---------------- ignition ---------------- */

.ignition-wrap { text-align: center; display: grid; gap: 34px; justify-items: center; }
.blink-slow { animation: blink-slow 2.4s infinite; letter-spacing: .25em; }
@keyframes blink-slow { 0%,100% { opacity: .85; } 50% { opacity: .25; } }

.switch-assembly { display: grid; gap: 16px; justify-items: center; }
.switch-base { width: 184px; height: 224px; position: relative; padding: 0; }
.switch-well {
  position: absolute; inset: 20px 40px;
  background: radial-gradient(ellipse at 50% 38%, #15170e 0%, #090a06 70%);
  border-radius: 10px;
  box-shadow: inset 0 6px 16px rgba(0,0,0,.95), inset 0 0 0 1px #000;
  z-index: 1;
}

/* the whole illuminated recess IS the button — a big, obvious target */
.toggle-lever {
  position: absolute; inset: 0;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: pointer; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.toggle-lever:disabled { cursor: default; }

/* the lever itself is drawn as a pseudo-element so it can pivot independently */
.toggle-lever::after {
  content: "";
  position: absolute; left: 50%; bottom: 50%; margin-left: -27px;
  width: 54px; height: 82px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 2px, transparent 2px 5px) top center / 90% 22px no-repeat,
    linear-gradient(180deg, #e6e0c9 0%, #b7b29a 16%, #6c6850 55%, #34321f 100%);
  border: 1px solid #11120b;
  box-shadow: 0 4px 12px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.4);
  transform-origin: bottom center;
  transform: rotate(180deg);            /* points down = OFF */
  transition: transform .26s cubic-bezier(.34, 1.4, .5, 1), background .26s, box-shadow .3s;
}
.toggle-lever.on::after {
  transform: rotate(0deg);              /* snaps up = ON */
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.3) 0 2px, transparent 2px 5px) top center / 90% 22px no-repeat,
    linear-gradient(180deg, #ffe2a0 0%, var(--amber) 24%, #9a6818 72%, #4a3209 100%);
  box-shadow: 0 4px 14px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.5), 0 0 26px var(--amber-glow);
}
/* once the cover is flipped, breathe an amber glow so the eye lands on the switch */
.toggle-lever.armed::after { animation: lever-armed 1.3s ease-in-out infinite; }
@keyframes lever-armed {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.4); }
  50%      { box-shadow: 0 4px 12px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.4), 0 0 22px var(--amber-glow); }
}

.switch-cover {
  position: absolute; inset: 13px 30px auto; height: 188px;
  background: linear-gradient(180deg, #d9512f, var(--red) 42%, var(--red-deep));
  border: 1px solid #3c0f06; border-radius: 9px 9px 5px 5px;
  cursor: pointer; z-index: 3;
  transform-origin: top center;
  transform: perspective(800px) rotateX(0deg);
  transition: transform .42s cubic-bezier(.22, .68, .3, 1);   /* clean hinge, no overshoot */
  box-shadow: 0 6px 16px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.28);
  backface-visibility: hidden;
}
.switch-cover::before {  /* lift-tab so it reads as a hinged lid */
  content: ""; position: absolute; top: 7px; left: 50%; margin-left: -22px;
  width: 44px; height: 6px; border-radius: 4px;
  background: rgba(0,0,0,.35); box-shadow: inset 0 1px 1px rgba(255,255,255,.2);
}
.switch-cover.open {
  transform: perspective(800px) rotateX(-105deg);
  box-shadow: 0 -8px 18px rgba(0,0,0,.5);
  pointer-events: none;                  /* stop the open lid from eating clicks */
}
.cover-stripes {
  position: absolute; inset: auto 0 0; height: 26px;
  background: repeating-linear-gradient(45deg, #d8c24a 0 12px, #1b1b14 12px 24px);
  border-radius: 0 0 3px 3px; opacity: .9;
}
.cover-stripes.red { background: repeating-linear-gradient(45deg, var(--red) 0 12px, #1b1b14 12px 24px); }

/* ---------------- boot sequence ---------------- */

.boot-dark { background: #000; flex-direction: column; gap: 30px; }
.boot-panels { display: grid; gap: 10px; width: min(440px, 92vw); }
.boot-cell {
  background: var(--steel-2); border: 1px solid #000; border-radius: 4px;
  padding: 10px 16px; font-size: 13px; letter-spacing: .1em;
  color: var(--amber); opacity: 0; text-shadow: 0 0 8px var(--amber-glow);
}
.boot-cell .bv { color: var(--green); }
.boot-cell.lit { animation: panel-flicker .5s forwards; }
@keyframes panel-flicker {
  0% { opacity: 0; } 12% { opacity: .9; } 22% { opacity: .1; }
  34% { opacity: .8; } 44% { opacity: .25; } 60% { opacity: 1; } 100% { opacity: 1; }
}
.boot-readout { color: var(--txt-dim); font-size: 12px; letter-spacing: .2em; min-height: 18px; }

.rumble { animation: rumble .12s infinite; }
@keyframes rumble {
  0% { transform: translate(0,0); } 25% { transform: translate(1px,-1px); }
  50% { transform: translate(-1px,1px); } 75% { transform: translate(1px,1px); } 100% { transform: translate(0,-1px); }
}

/* ---------------- letter ---------------- */

.letter-screen { background: #0b0c08; overflow-y: auto; display: block; padding: 0; }
.letter-scroll { min-height: 100%; display: grid; justify-items: center; padding: 7vh 18px 12vh; }
.letter-paper {
  width: min(680px, 100%);
  background: linear-gradient(175deg, #efe6cd, #e4d8b8 70%, #d9cca6);
  color: #2a2722;
  font-family: var(--type);
  font-size: 17px;
  line-height: 1.85;
  padding: clamp(28px, 6vw, 64px) clamp(22px, 6vw, 58px);
  border-radius: 2px;
  box-shadow: 0 10px 50px rgba(0,0,0,.8), inset 0 0 60px rgba(120,100,60,.12);
  white-space: pre-wrap;
  opacity: 0; transition: opacity 2.2s ease;
}
.letter-paper.shown { opacity: 1; }
.letter-paper p { margin: 0 0 1.5em; }
.letter-paper p:last-child { margin-bottom: 0; }
.letter-btn { margin-top: 34px; opacity: 0; transition: opacity 1.2s; }
.letter-btn.shown { opacity: 1; }

/* ---------------- app shell ---------------- */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px calc(10px);
  border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
}
.hdr-left { display: flex; align-items: center; gap: 12px; }
.hdr-title { font-family: var(--stencil); font-size: 22px; color: var(--cream); letter-spacing: .08em; cursor: pointer; user-select: none; }
.hdr-right { display: flex; align-items: center; gap: 12px; }
#zulu-clock { color: var(--green); text-shadow: 0 0 6px rgba(159,184,109,.4); }
.hdr-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--olive-hi); }

#main { flex: 1; width: min(860px, 100%); margin: 0 auto; padding: 18px 14px calc(86px + env(safe-area-inset-bottom)); }

/* dock */
.dock {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: linear-gradient(180deg, #20241730, transparent) , linear-gradient(180deg, #242819, #14160f);
  border-top: 1px solid #000;
  box-shadow: 0 -4px 18px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.dock-btn {
  background: none; border: 0; color: var(--txt-dim);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em;
  display: grid; justify-items: center; gap: 3px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; min-width: 56px;
}
.dock-ico { font-size: 19px; filter: grayscale(1) brightness(.85); transition: filter .2s; }
.dock-btn.active { color: var(--amber); text-shadow: 0 0 8px var(--amber-glow); }
.dock-btn.active .dock-ico { filter: grayscale(.2) sepia(.6) hue-rotate(-15deg) saturate(2.4) brightness(1.05); }

/* ---------------- comms ---------------- */

.station-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.st-tab {
  font-family: var(--stencil); font-size: 11px; letter-spacing: .1em; line-height: 1.35;
  color: var(--txt-dim);
  background: linear-gradient(180deg, var(--steel-3), var(--steel-2));
  border: 1px solid #000; border-bottom-width: 3px; border-radius: 5px;
  padding: 9px 4px; cursor: pointer; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: color .15s;
}
.st-tab.active { color: var(--amber); text-shadow: 0 0 10px var(--amber-glow); border-bottom-color: var(--amber-dim); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -10px 18px -12px var(--amber-glow); }
.st-tab.tab-em.active { color: var(--red); text-shadow: 0 0 10px rgba(212,69,44,.5); border-bottom-color: var(--red-deep); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -10px 18px -12px rgba(212,69,44,.45); }
.badge {
  position: absolute; top: -6px; right: -4px;
  background: var(--red); color: #fff; font-family: var(--mono);
  font-size: 10px; min-width: 17px; padding: 1px 4px; border-radius: 9px;
  box-shadow: 0 0 8px rgba(212,69,44,.6);
}
.station-desc { margin: 2px 2px 12px; letter-spacing: .15em; }

/* mayday console */
.mayday-console { padding: 18px; margin-bottom: 14px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.mayday-assembly { position: relative; width: 130px; height: 130px; }
.mayday-btn {
  position: absolute; inset: 15px;
  border-radius: 50%; border: 1px solid #3c0f06; cursor: pointer;
  font-family: var(--stencil); letter-spacing: .1em; font-size: 15px; color: #fff;
  background: radial-gradient(circle at 38% 30%, #ef6a4e, var(--red) 55%, var(--red-deep));
  box-shadow: 0 5px 0 var(--red-deep), 0 9px 20px rgba(0,0,0,.6), inset 0 2px 4px rgba(255,255,255,.35);
  transition: transform .06s, box-shadow .06s;
}
.mayday-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-deep), 0 4px 8px rgba(0,0,0,.6), inset 0 2px 4px rgba(255,255,255,.3); }
.mayday-btn:disabled { filter: brightness(.45) grayscale(.4); cursor: default; }
.mayday-btn.arming { animation: arming .25s infinite; }
@keyframes arming { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }
.mayday-cover {
  position: absolute; inset: 0; z-index: 2;
  border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(40,42,30,.92), rgba(24,26,17,.96));
  border: 1px solid #000;
  transform-origin: top center;
  transform: perspective(500px) rotateX(0);
  transition: transform .35s cubic-bezier(.5, -0.3, .3, 1.3);
  box-shadow: 0 6px 14px rgba(0,0,0,.7);
  overflow: hidden;
}
.mayday-cover.open { transform: perspective(500px) rotateX(-112deg); pointer-events: none; }
.mayday-cover .cover-stripes { height: 100%; opacity: .25; border-radius: 12px; }

/* feed */
.feed { display: grid; gap: 10px; margin-bottom: 14px; min-height: 120px; }
.feed-empty { text-align: center; color: var(--txt-dim); padding: 36px 0; letter-spacing: .2em; font-size: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--olive); flex: none; margin-top: 2px; }
.msg-bubble { padding: 9px 13px; border-radius: 6px; max-width: 78%; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-bubble { background: linear-gradient(160deg, #2c3019, #232715); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 3px 10px rgba(0,0,0,.45), inset 0 0 0 1px #3c4220; }
.msg-meta { font-size: 10px; color: var(--txt-dim); letter-spacing: .12em; margin-bottom: 4px; display: flex; gap: 8px; }
.msg-body { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--txt); }
.msg.mayday-msg .msg-bubble { box-shadow: inset 0 0 0 1px var(--red-deep), 0 0 14px rgba(212,69,44,.25), 0 3px 10px rgba(0,0,0,.45); }
.msg.mayday-msg .msg-meta { color: var(--red); }
.msg-att { margin-top: 8px; display: grid; gap: 6px; }
.msg-att img { max-width: 240px; max-height: 200px; border-radius: 4px; border: 1px solid #000; cursor: pointer; }
.msg-att audio { width: 240px; max-width: 100%; }
.att-chip {
  display: inline-flex; gap: 8px; align-items: center;
  background: #0d0f09; border: 1px solid #000; border-radius: 4px;
  padding: 6px 10px; color: var(--amber); text-decoration: none; font-size: 12px;
}
.att-chip:hover { box-shadow: 0 0 0 1px var(--amber-dim); }

/* composer */
.composer { padding: 10px; position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: none; max-height: 130px; flex: 1; }
.att-btn { color: var(--txt-dim); cursor: pointer; padding: 10px 6px; }
.att-btn:hover { color: var(--amber); }
.send-btn { flex: none; }
.att-strip { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.att-strip .att-chip .x { cursor: pointer; color: var(--red); margin-left: 4px; }

/* ---------------- sections shared ---------------- */

.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 26px; }
.section-head .tiny { margin-top: 4px; }
.subsection { margin-top: 26px; }
.sub-head { letter-spacing: .2em; color: var(--cream); border-bottom: 1px solid #000; box-shadow: 0 1px 0 rgba(255,255,255,.05); padding-bottom: 6px; margin-bottom: 12px; }

.upload-bar { display: flex; gap: 8px; align-items: center; padding: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.upload-bar .field { flex: 1; min-width: 140px; width: auto; }

/* map case */
.doc-list { display: grid; gap: 10px; }
.doc-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.doc-ico { font-size: 26px; flex: none; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { color: var(--cream); font-size: 14px; word-break: break-all; }
.doc-desc { color: var(--txt-dim); font-size: 12px; margin-top: 3px; }
.doc-meta { font-size: 10px; color: var(--txt-dim); letter-spacing: .1em; margin-top: 3px; }
.doc-get { flex: none; }

/* debrief */
.debrief-form { padding: 18px; display: grid; gap: 14px; margin-top: 14px; }
.debrief-q label { display: block; color: var(--amber); font-size: 12px; letter-spacing: .1em; margin-bottom: 6px; }
.debrief-q textarea { min-height: 64px; resize: vertical; }
.debrief-list { display: grid; gap: 14px; margin-top: 18px; position: relative; padding-left: 22px; }
.debrief-list::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--olive); }
.debrief-entry { position: relative; padding: 14px 16px; }
.debrief-entry::before { content: ""; position: absolute; left: -19px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber-glow); }
.debrief-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.debrief-head img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.debrief-qa { margin-top: 10px; }
.debrief-qa .q { color: var(--amber-dim); font-size: 11px; letter-spacing: .08em; }
.debrief-qa .a { font-size: 14px; line-height: 1.5; margin-top: 3px; white-space: pre-wrap; }

/* ---------------- music bay ---------------- */

.player { padding: 18px; display: grid; gap: 14px; }
.player-title { font-size: 19px; min-height: 24px; }
.vu { width: 100%; height: 48px; background: #0a0c07; border-radius: 4px; border: 1px solid #000; box-shadow: inset 0 2px 8px rgba(0,0,0,.8); }
.player-seek { display: flex; gap: 10px; align-items: center; }
.player-seek span { color: var(--green); min-width: 40px; text-align: center; }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; background: #0a0c07; border-radius: 3px; box-shadow: inset 0 1px 4px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.05); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px;
  border-radius: 3px; border: 1px solid #000;
  background: linear-gradient(180deg, #d9d4c0, #8e8a76 40%, #55523f);
  box-shadow: 0 2px 5px rgba(0,0,0,.7);
}
input[type=range]::-moz-range-track { height: 6px; background: #0a0c07; border-radius: 3px; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 3px; border: 1px solid #000; background: #8e8a76; }
.player-controls { display: flex; justify-content: space-between; align-items: center; }
.play-switch {
  width: 64px; height: 64px; border-radius: 50%; cursor: pointer;
  border: 1px solid #000; color: var(--steel-1); font-size: 22px;
  background: radial-gradient(circle at 38% 30%, #ffd98c, var(--amber) 55%, #b97c16);
  box-shadow: 0 4px 0 #6e4c0e, 0 8px 18px rgba(0,0,0,.6), inset 0 2px 4px rgba(255,255,255,.5);
  transition: transform .06s, box-shadow .06s;
}
.play-switch:active { transform: translateY(3px); box-shadow: 0 1px 0 #6e4c0e, 0 4px 8px rgba(0,0,0,.6); }
.vol-wrap { display: flex; gap: 8px; align-items: center; width: 150px; }

.playlist { display: grid; gap: 8px; }
.track {
  display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer;
  border-radius: 5px;
}
.track:hover { box-shadow: 0 0 0 1px var(--olive-hi); }
.track.playing { box-shadow: inset 0 0 0 1px var(--amber-dim), 0 0 16px rgba(255,176,46,.12); }
.track.playing .track-no { color: var(--amber); }
.track-no { color: var(--txt-dim); width: 22px; }
.track-name { flex: 1; color: var(--cream); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-desc { color: var(--txt-dim); font-size: 11px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.media-card { padding: 0; overflow: hidden; display: grid; }
.media-card img, .media-card video { width: 100%; height: 110px; object-fit: cover; cursor: pointer; background: #000; }
.media-card .mc-body { padding: 8px 10px; }
.mc-name { font-size: 11.5px; color: var(--cream); word-break: break-all; }
.mc-desc { font-size: 10.5px; color: var(--txt-dim); margin-top: 2px; }
.mc-icon { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 36px; background: #0d0f09; }

/* ---------------- gallery ---------------- */

.gallery-wall { display: grid; gap: 26px; margin-bottom: 22px; }
.gallery-piece { display: grid; gap: 10px; }
.gallery-piece img {
  width: 100%; border-radius: 3px; cursor: pointer;
  border: 1px solid #000;
  box-shadow: 0 8px 30px rgba(0,0,0,.65), 0 0 0 6px #20241a, 0 0 0 7px #000;
}
.gallery-piece.centerpiece img { box-shadow: 0 12px 44px rgba(0,0,0,.8), 0 0 0 8px #2b301e, 0 0 0 9px #000, 0 0 40px rgba(255,176,46,.07); }
.gallery-cap { text-align: center; color: var(--txt-dim); font-size: 12.5px; letter-spacing: .06em; line-height: 1.5; }
.gallery-cap .cap-title { color: var(--cream); font-family: var(--stencil); font-size: 14px; letter-spacing: .12em; display: block; margin-bottom: 2px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,6,3,.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.lightbox img { max-width: 96vw; max-height: 82vh; object-fit: contain; border-radius: 3px; }
.lightbox-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; background: none; border: 1px solid var(--txt-dim); color: var(--txt); padding: 7px 12px; border-radius: 4px; cursor: pointer; letter-spacing: .15em; }
.lightbox-cap { color: var(--txt-dim); text-align: center; max-width: 600px; }

/* plaque easter egg */
.plaque {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px);
  z-index: 90; padding: 16px 26px; text-align: center; display: grid; gap: 6px;
  opacity: 0; transition: opacity .4s, transform .4s; pointer-events: none;
}
.plaque.shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* riff flash easter egg */
.riff-flash {
  position: fixed; inset: 0; z-index: 95; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.82);
  font-family: var(--stencil); font-size: clamp(26px, 7vw, 60px);
  color: var(--amber); text-align: center; letter-spacing: .1em;
  text-shadow: 0 0 30px var(--amber-glow), 0 0 60px var(--amber-glow);
  animation: riff 2.6s forwards;
}
@keyframes riff { 0% { opacity: 0; transform: scale(.92); } 12% { opacity: 1; transform: scale(1.02); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 80; background: var(--steel-3); border: 1px solid var(--amber-dim);
  color: var(--amber); padding: 10px 18px; border-radius: 5px;
  font-size: 12px; letter-spacing: .12em;
  box-shadow: 0 6px 20px rgba(0,0,0,.7), 0 0 14px rgba(255,176,46,.12);
  animation: toast 3s forwards;
}
.toast.err { border-color: var(--red-deep); color: var(--red); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 8% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }

/* desktop refinements */
@media (min-width: 760px) {
  body { font-size: 15.5px; }
  .station-tabs { gap: 10px; }
  .st-tab { font-size: 12.5px; padding: 12px 6px; }
  .dock { left: 50%; transform: translateX(-50%); right: auto; width: 640px; border-radius: 12px 12px 0 0; border: 1px solid #000; border-bottom: 0; }
  .gallery-wall { gap: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .rumble, .blink-slow, .boot-cell.lit { animation: none !important; opacity: 1 !important; }
}
