/* ═══════════════════════════════════════════════════════════
   OBED PAUL — FLIGHT MODE v1.0
   First-person cockpit · Three.js galaxy flight
   ═══════════════════════════════════════════════════════════ */

#flight-mode {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  background: #03040a;
  overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
}
#flight-mode.active { display: block; }
body.flight-active { overflow: hidden; }
body.flight-active #cursor-dot,
body.flight-active #cursor-ring { display: none; }

#flight-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: none;
}

/* ───────── COCKPIT CANOPY FRAME ───────── */
.cockpit-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  /* vignette / canopy glass */
  background:
    radial-gradient(120% 90% at 50% 42%, transparent 56%, rgba(3,4,10,0.55) 86%, rgba(3,4,10,0.92) 100%);
}
.cockpit-frame::before,
.cockpit-frame::after {
  content: '';
  position: absolute;
  width: 130px; height: 130px;
  border: 2px solid rgba(159,216,1,0.4);
  box-shadow: 0 0 18px rgba(159,216,1,0.15);
}
.cockpit-frame::before { top: 18px; left: 18px;  border-right: none; border-bottom: none; border-radius: 18px 0 0 0; }
.cockpit-frame::after  { top: 18px; right: 18px; border-left: none;  border-bottom: none; border-radius: 0 18px 0 0; }

.frame-corner {
  position: absolute;
  width: 130px; height: 90px;
  border: 2px solid rgba(159,216,1,0.4);
  box-shadow: 0 0 18px rgba(159,216,1,0.15);
  pointer-events: none;
  z-index: 4;
}
.frame-corner.bl { bottom: 150px; left: 18px;  border-right: none; border-top: none; border-radius: 0 0 0 18px; }
.frame-corner.br { bottom: 150px; right: 18px; border-left: none;  border-top: none; border-radius: 0 0 18px 0; }

/* ───────── ENGINE EXHAUST ───────── */
.exhaust {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 240px;
  pointer-events: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.exhaust span {
  display: block;
  width: 130px;
  height: 90px;
  margin: 0 40px;
  background: radial-gradient(ellipse at 50% 100%, rgba(159,216,1,0.55), rgba(0,170,255,0.25) 40%, transparent 72%);
  filter: blur(14px);
  opacity: 0.45;
  transform-origin: bottom center;
  animation: exhaustPulse 0.55s ease-in-out infinite alternate;
}
.exhaust span:nth-child(2) { width: 200px; height: 120px; animation-delay: 0.12s; opacity: 0.6; }
.exhaust span:nth-child(3) { animation-delay: 0.24s; }
@keyframes exhaustPulse {
  from { transform: scaleY(0.85) scaleX(0.95); opacity: 0.35; }
  to   { transform: scaleY(1.1) scaleX(1.05);  opacity: 0.6; }
}
#flight-mode.boosting .exhaust { height: 60%; }
#flight-mode.boosting .exhaust span {
  height: 300px;
  filter: blur(22px);
  opacity: 0.85;
  animation-duration: 0.18s;
}

/* ───────── WARP SPEED TUNNEL ───────── */
.warp-tunnel {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, transparent 8%, rgba(159,216,1,0.05) 30%, rgba(0,170,255,0.08) 60%, transparent 75%);
  transition: opacity 0.3s ease;
}
#flight-mode.boosting .warp-tunnel { opacity: 1; animation: warpZoom 0.6s linear infinite; }
@keyframes warpZoom { from { transform: scale(1); } to { transform: scale(1.15); } }

.warp-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.9), rgba(159,216,1,0.4) 40%, transparent 70%);
}
.warp-flash.fire { animation: warpFlashAnim 0.7s ease forwards; }
@keyframes warpFlashAnim { 0% { opacity: 0; } 30% { opacity: 0.95; } 100% { opacity: 0; } }

/* ───────── RETICLE ───────── */
.reticle {
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  transform: translate(-50%,-50%);
  pointer-events: none;
  z-index: 6;
}
.reticle::before, .reticle::after {
  content: '';
  position: absolute;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  opacity: 0.55;
}
.reticle::before { left: 50%; top: 0;  width: 1.5px; height: 100%; transform: translateX(-50%); }
.reticle::after  { top: 50%; left: 0;  height: 1.5px; width: 100%; transform: translateY(-50%); }
.reticle .dot {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); transform: translate(-50%,-50%);
  box-shadow: 0 0 10px var(--primary);
}

/* ───────── TOP HUD ───────── */
.hud-top {
  position: absolute;
  top: 26px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  z-index: 7;
  pointer-events: none;
}
.hud-chip {
  font-family: 'Orbitron', monospace;
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  color: var(--primary);
  background: rgba(11,13,27,0.6);
  border: 1px solid rgba(159,216,1,0.25);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
#hud-status.docking { color: #ffaa00; border-color: rgba(255,170,0,0.4); }
#hud-status.lightspeed { color: #fff; border-color: #fff; box-shadow: 0 0 14px rgba(255,255,255,0.5); }

.hud-btn {
  pointer-events: auto;
  font-family: 'Orbitron', monospace;
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  color: #03040a;
  background: var(--primary);
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 0 14px var(--primary-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hud-btn:hover { transform: translateY(-1px); box-shadow: 0 0 22px var(--primary-glow); }

/* ───────── SPEED GAUGE ───────── */
.hud-speed {
  position: absolute;
  left: 30px; top: 50%;
  transform: translateY(-50%);
  z-index: 7;
  pointer-events: none;
  width: 56px;
  text-align: center;
}
.speed-label, .speed-val {
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: var(--text-sec);
}
.speed-bar {
  height: 200px;
  width: 8px;
  margin: 0.5rem auto;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(159,216,1,0.2);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.speed-fill {
  width: 100%;
  height: 5%;
  background: linear-gradient(to top, var(--primary), #00aaff);
  box-shadow: 0 0 10px var(--primary-glow);
  transition: height 0.12s linear;
}
.speed-val { color: var(--primary); margin-top: 0.2rem; }

/* ───────── RADAR ───────── */
.hud-radar {
  position: absolute;
  right: 30px; top: 50%;
  transform: translateY(-50%);
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 1px solid rgba(159,216,1,0.3);
  background: radial-gradient(circle, rgba(159,216,1,0.06), transparent 70%);
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}
.hud-radar::before, .hud-radar::after {
  content: '';
  position: absolute;
  background: rgba(159,216,1,0.18);
}
.hud-radar::before { left: 50%; top: 0; width: 1px; height: 100%; }
.hud-radar::after  { top: 50%; left: 0; height: 1px; width: 100%; }
.radar-self {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; transform: translate(-50%,-50%);
  box-shadow: 0 0 6px #fff;
}
.radar-blip {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: left 0.1s linear, top 0.1s linear, opacity 0.2s;
}

/* ───────── BOTTOM DASHBOARD ───────── */
.dash {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 7;
  padding: 0 1rem 0.8rem;
}
/* sleek flat console bar — no more bulbous "pod" look */
.dash-curve {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background:
    linear-gradient(to top, rgba(6,8,18,0.97), rgba(6,8,18,0.82) 40%, rgba(6,8,18,0.35) 78%, transparent);
  border-top: 1px solid rgba(159,216,1,0.22);
  box-shadow: 0 -8px 36px rgba(0,0,0,0.65);
  z-index: -1;
}
/* animated scan accent across the top edge of the console */
.dash-curve::after {
  content: '';
  position: absolute;
  top: -1px; left: 0; height: 1px; width: 40%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.7;
  animation: dashScan 5s linear infinite;
}
@keyframes dashScan { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

.dash-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 960px;
  margin: 0 auto 0.55rem;
}
.dash-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: linear-gradient(180deg, rgba(20,24,46,0.55), rgba(10,12,26,0.65));
  border: 1px solid rgba(159,216,1,0.14);
  color: var(--text-sec);
  padding: 0.5rem 0.85rem 0.45rem;
  /* angled futuristic corners */
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  min-width: 70px;
  backdrop-filter: blur(10px);
}
/* indicator rail under each button */
.dash-btn::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 4px;
  width: 0; height: 2px;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}
.dash-btn .db-num {
  font-family: 'Orbitron', monospace;
  font-size: 0.5rem;
  opacity: 0.5;
  letter-spacing: 2px;
}
.dash-btn .db-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.dash-btn:hover {
  color: #fff;
  border-color: rgba(159,216,1,0.5);
  background: linear-gradient(180deg, rgba(159,216,1,0.12), rgba(10,12,26,0.65));
  transform: translateY(-2px);
}
.dash-btn:hover::after { width: 60%; }
.dash-btn.active {
  color: var(--primary);
  border-color: rgba(159,216,1,0.6);
}
.dash-btn.active::after { width: 80%; }
.dash-btn.active .db-num { color: var(--primary); opacity: 1; }
.dash-hint {
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-sec);
  opacity: 0.55;
}

/* ───────── DOCK PANEL (section content) ───────── */
.dock-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.9);
  width: min(880px, 92vw);
  max-height: 74vh;
  background: rgba(9,12,26,0.82);
  border: 1px solid rgba(159,216,1,0.35);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 40px rgba(159,216,1,0.12);
  backdrop-filter: blur(16px);
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2,0.9,0.3,1.3);
}
.dock-panel.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
.dock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.4rem;
  border-bottom: 1px solid rgba(159,216,1,0.18);
  background: rgba(159,216,1,0.05);
}
.dock-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--primary);
  text-shadow: 0 0 12px var(--primary-glow);
}
.dock-close {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: var(--primary);
  background: transparent;
  border: 1px solid rgba(159,216,1,0.4);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.dock-close:hover { background: var(--primary); color: #03040a; }
.dock-body {
  padding: 1.6rem 1.8rem 2rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}
.dock-body::-webkit-scrollbar { width: 7px; }
.dock-body::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 4px; }
.dock-body .section-header { margin-bottom: 1.5rem; }
.dock-body .skills-grid { width: max-content; }

/* dock welcome (home) */
.dock-welcome h2 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--primary);
  margin-bottom: 0.6rem;
  text-shadow: 0 0 20px var(--primary-glow);
}
.dock-welcome p { color: var(--text-sec); margin-bottom: 0.8rem; }

/* ───────── ENTER/EXIT TOGGLE (classic view) — lives inline in the nav bar ───────── */
.flight-toggle {
  font-family: 'Orbitron', monospace;
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  color: var(--primary);
  background: rgba(11,13,27,0.85);
  border: 1px solid var(--primary);
  padding: 0.5rem 0.95rem;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(159,216,1,0.2);
  transition: all 0.25s;
  animation: togglePulse 2.4s ease-in-out infinite;
}
.flight-toggle:hover {
  background: var(--primary);
  color: #03040a;
  transform: translateY(-1px);
  box-shadow: 0 0 26px var(--primary-glow);
}
@keyframes togglePulse {
  0%,100% { box-shadow: 0 0 16px rgba(159,216,1,0.2); }
  50%     { box-shadow: 0 0 26px rgba(159,216,1,0.45); }
}

/* ───────── INTRO HINT (first entry) ───────── */
.flight-intro {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.flight-intro.show { opacity: 1; }
.flight-intro h2 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  color: var(--primary);
  letter-spacing: 4px;
  text-shadow: 0 0 30px var(--primary-glow);
  margin-bottom: 1rem;
}
.flight-intro p {
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 1px;
  margin: 0.3rem 0;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
}
.flight-intro .keycap {
  display: inline-block;
  border: 1px solid var(--primary);
  border-radius: 5px;
  padding: 0.1rem 0.5rem;
  margin: 0 0.2rem;
  color: var(--primary);
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
}

/* ───────── ENTER PROMPT (approach a world) ───────── */
.enter-prompt {
  position: absolute;
  left: 50%; top: 58%;
  transform: translate(-50%, 0) scale(0.9);
  z-index: 7;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.enter-prompt.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.enter-prompt .ep-ring {
  display: block;
  width: 64px; height: 64px;
  margin: 0 auto 0.7rem;
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 18px var(--primary-glow), inset 0 0 18px rgba(159,216,1,0.2);
  animation: epPulse 1.3s ease-in-out infinite;
}
.enter-prompt .ep-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 12px rgba(0,0,0,0.9);
  text-transform: uppercase;
}
.enter-prompt b { color: var(--primary); }
.enter-prompt .ep-key {
  display: inline-block;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.05rem 0.5rem;
  border-radius: 5px;
  margin-right: 0.3rem;
}
@keyframes epPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 18px var(--primary-glow), inset 0 0 18px rgba(159,216,1,0.2); }
  50%     { transform: scale(1.15); box-shadow: 0 0 30px var(--primary-glow), inset 0 0 26px rgba(159,216,1,0.35); }
}

/* ───────── INTERIOR MODE (on-foot: declutter the cockpit HUD) ───────── */
#flight-mode.interior .hud-speed,
#flight-mode.interior .hud-radar,
#flight-mode.interior .exhaust,
#flight-mode.interior .warp-tunnel,
#flight-mode.interior .dash,
#flight-mode.interior .frame-corner,
#flight-mode.interior .hud-top,
#flight-mode.interior .enter-prompt { display: none; }
#flight-mode.interior .reticle { opacity: 0.5; }
#flight-mode.interior .cockpit-frame {
  background: radial-gradient(130% 100% at 50% 48%, transparent 64%, rgba(0,0,0,0.5) 92%, rgba(0,0,0,0.82) 100%);
}

/* on-foot bottom bar */
.interior-bar {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: none;
  align-items: center;
  gap: 1rem;
  background: rgba(8,10,22,0.72);
  border: 1px solid rgba(159,216,1,0.25);
  border-radius: 11px;
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  backdrop-filter: blur(8px);
}
#flight-mode.interior .interior-bar { display: flex; }
.ib-hint {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: var(--text-sec);
  text-transform: uppercase;
}
.ib-exit {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: #03040a;
  background: var(--primary);
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 0 14px var(--primary-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ib-exit:hover { transform: translateY(-1px); box-shadow: 0 0 22px var(--primary-glow); }

/* "press E to read" prompt */
.read-prompt {
  position: absolute;
  left: 50%; bottom: 96px;
  transform: translateX(-50%) scale(0.9);
  z-index: 7;
  opacity: 0;
  pointer-events: none;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
  text-transform: uppercase;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.read-prompt.show { opacity: 1; transform: translateX(-50%) scale(1); }
.read-prompt .ep-key {
  display: inline-block;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.05rem 0.55rem;
  border-radius: 5px;
  margin-right: 0.4rem;
  animation: epPulse 1.3s ease-in-out infinite;
}

/* ───────── THEMED DOCK PANELS ───────── */
/* TECH — digital screen */
.dock-panel.theme-tech {
  background: rgba(4,14,22,0.86);
  border-color: rgba(0,200,255,0.5);
  box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 50px rgba(0,200,255,0.16);
}
.dock-panel.theme-tech .dock-head { background: rgba(0,200,255,0.06); border-color: rgba(0,200,255,0.22); }
.dock-panel.theme-tech .dock-title { color: #38e0ff; text-shadow: 0 0 12px rgba(0,200,255,0.6); }
.dock-panel.theme-tech .dock-close { color: #38e0ff; border-color: rgba(0,200,255,0.45); }
.dock-panel.theme-tech .dock-close:hover { background: #38e0ff; color: #03040a; }
.dock-panel.theme-tech .dock-body { position: relative; }
.dock-panel.theme-tech .dock-body::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(transparent, transparent 3px, rgba(0,200,255,0.035) 3px, rgba(0,200,255,0.035) 4px);
}

/* ANCIENT — carved stone */
.dock-panel.theme-ancient {
  background: rgba(30,25,17,0.92);
  border-color: rgba(214,180,120,0.5);
  box-shadow: 0 0 60px rgba(0,0,0,0.75), 0 0 40px rgba(180,140,80,0.12);
}
.dock-panel.theme-ancient .dock-head { background: rgba(180,140,80,0.08); border-color: rgba(214,180,120,0.25); }
.dock-panel.theme-ancient .dock-title { color: #e8c98a; text-shadow: 0 1px 0 #000, 0 0 10px rgba(180,140,80,0.4); }
.dock-panel.theme-ancient .dock-body { color: #d8c7a8; }
.dock-panel.theme-ancient .dock-close { color: #e8c98a; border-color: rgba(214,180,120,0.45); }
.dock-panel.theme-ancient .dock-close:hover { background: #e8c98a; color: #1e1911; }

/* CAVE — dark rock + glowing runes */
.dock-panel.theme-cave {
  background: rgba(6,13,9,0.93);
  border-color: rgba(159,216,1,0.5);
  box-shadow: 0 0 70px rgba(0,0,0,0.85), 0 0 46px rgba(159,216,1,0.18);
}
.dock-panel.theme-cave .dock-head { background: rgba(159,216,1,0.06); }
.dock-panel.theme-cave .dock-title { color: #9fd801; text-shadow: 0 0 16px rgba(159,216,1,0.7); }

/* DESERT — parchment / skin scroll */
.dock-panel.theme-scroll {
  background: rgba(48,38,24,0.93);
  border-color: rgba(220,190,140,0.55);
  box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 40px rgba(200,150,80,0.14);
}
.dock-panel.theme-scroll .dock-head { background: rgba(200,150,80,0.1); border-color: rgba(220,190,140,0.3); }
.dock-panel.theme-scroll .dock-title { color: #f0d6a8; text-shadow: 0 1px 0 #000; }
.dock-panel.theme-scroll .dock-body { color: #e9dcc2; }
.dock-panel.theme-scroll .dock-close { color: #f0d6a8; border-color: rgba(220,190,140,0.5); }
.dock-panel.theme-scroll .dock-close:hover { background: #f0d6a8; color: #302618; }

/* ═══════════ MISSION SYSTEM ═══════════ */

/* dash button that is the current mission target */
.dash-btn.target {
  border-color: rgba(255,170,0,0.6);
  color: #ffd27a;
  background: linear-gradient(180deg, rgba(255,170,0,0.14), rgba(10,12,26,0.65));
}
.dash-btn.target::after {
  width: 80%;
  background: #ffaa00;
  box-shadow: 0 0 8px rgba(255,170,0,0.7);
  animation: targetPulse 1.3s ease-in-out infinite;
}
.dash-btn.target .db-num { color: #ffaa00; opacity: 1; }
@keyframes targetPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ── objective tracker (top-left) ── */
#mission-hud {
  position: absolute;
  top: 70px; left: 22px;
  z-index: 8;
  width: 268px; max-width: 42vw;
  padding: 0.7rem 0.85rem 0.75rem;
  background: rgba(8,11,24,0.74);
  border: 1px solid rgba(159,216,1,0.25);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 26px rgba(0,0,0,0.5), inset 0 1px 14px rgba(159,216,1,0.05);
  font-family: 'Space Grotesk', sans-serif;
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(.2,.9,.3,1), opacity 0.4s;
}
#mission-hud[aria-hidden="false"] { transform: translateX(0); opacity: 1; }
.mh-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.mh-eyebrow {
  font-family: 'Orbitron', monospace;
  font-size: 0.56rem; letter-spacing: 2px;
  color: var(--primary);
}
.mh-reset {
  pointer-events: auto;
  background: transparent;
  border: 1px solid rgba(159,216,1,0.3);
  color: var(--primary);
  width: 22px; height: 22px;
  border-radius: 6px;
  cursor: pointer; font-size: 0.85rem; line-height: 1;
  transition: transform 0.3s, background 0.2s;
}
.mh-reset:hover { background: rgba(159,216,1,0.15); transform: rotate(180deg); }
.mh-codename {
  font-family: 'Orbitron', monospace;
  font-size: 0.82rem; font-weight: 700;
  color: #fff; letter-spacing: 0.5px; line-height: 1.2;
  margin-bottom: 0.3rem;
}
.mh-brief { font-size: 0.72rem; line-height: 1.35; color: var(--text-sec); margin-bottom: 0.45rem; }
.mh-target { font-size: 0.66rem; letter-spacing: 0.5px; color: #ffd27a; margin-bottom: 0.55rem; }
.mh-target b { color: #ffaa00; }
.mh-progress { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.mh-dots { display: flex; gap: 5px; }
.mh-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(159,216,1,0.25);
  transition: all 0.3s;
}
.mh-dots span.on { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 8px var(--primary-glow); }
.mh-dots span.cur { background: #ffaa00; border-color: #ffaa00; box-shadow: 0 0 8px rgba(255,170,0,0.6); animation: targetPulse 1.4s infinite; }
.mh-xp {
  font-family: 'Orbitron', monospace;
  font-size: 0.66rem; font-weight: 700; color: var(--primary);
  letter-spacing: 1px; white-space: nowrap;
}

/* ── waypoint guidance arrow ── */
#mission-waypoint {
  position: absolute;
  top: 0; left: 0;
  z-index: 7;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  pointer-events: none;
  will-change: transform;
}
#mission-waypoint[aria-hidden="true"] { display: none; }
.wp-arrow {
  font-size: 1.5rem; line-height: 1;
  color: #ffaa00;
  text-shadow: 0 0 12px rgba(255,170,0,0.8);
  will-change: transform;
}
#mission-waypoint.locked .wp-arrow {
  font-size: 1.1rem;
  transform: none !important;
  animation: lockPulse 1.2s ease-in-out infinite;
}
@keyframes lockPulse { 0%,100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }
.wp-meta {
  display: flex; flex-direction: column; align-items: center;
  font-family: 'Orbitron', monospace;
  background: rgba(8,11,24,0.7);
  border: 1px solid rgba(255,170,0,0.4);
  border-radius: 6px;
  padding: 2px 7px;
  backdrop-filter: blur(4px);
}
.wp-meta b { font-size: 0.6rem; letter-spacing: 1px; color: #ffd27a; }
.wp-meta i { font-size: 0.54rem; font-style: normal; color: var(--text-sec); }

/* ── mission toast ── */
#mission-toast {
  position: absolute;
  top: 84px; left: 50%;
  transform: translate(-50%, -16px);
  z-index: 9;
  pointer-events: none;
  text-align: center;
  background: rgba(8,11,24,0.86);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 0.55rem 1.3rem;
  box-shadow: 0 0 30px var(--primary-glow);
  opacity: 0;
  transition: opacity 0.35s, transform 0.35s;
}
#mission-toast.show { opacity: 1; transform: translate(-50%, 0); }
#mission-toast b {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem; color: var(--primary);
  text-shadow: 0 0 14px var(--primary-glow);
}
#mission-toast span {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem; letter-spacing: 1px; color: #fff;
  text-transform: uppercase; margin-top: 2px;
}

/* ── campaign complete overlay ── */
#campaign-done {
  position: absolute; inset: 0;
  z-index: 20;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(159,216,1,0.1), rgba(3,4,10,0.92) 70%);
  backdrop-filter: blur(4px);
}
#campaign-done.show { display: flex; animation: cdFade 0.5s ease; }
@keyframes cdFade { from { opacity: 0; } to { opacity: 1; } }
.cd-card {
  text-align: center;
  padding: 2rem 2.4rem;
  background: rgba(9,12,26,0.9);
  border: 1px solid rgba(159,216,1,0.4);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(159,216,1,0.2);
  max-width: 92vw;
}
.cd-rank {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem; letter-spacing: 3px; color: var(--primary);
  text-shadow: 0 0 16px var(--primary-glow);
}
.cd-card h2 { font-family: 'Orbitron', monospace; color: #fff; margin: 0.8rem 0 0.5rem; font-size: 1.4rem; }
.cd-card p { color: var(--text-sec); font-size: 0.85rem; margin-bottom: 1.4rem; }
.cd-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }
.hud-btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); box-shadow: none; }
.hud-btn.ghost:hover { background: rgba(159,216,1,0.12); }
.flight-intro .fi-mission {
  color: #ffd27a !important;
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem; letter-spacing: 1px;
}

/* ── mobile touch controls ── */
#flight-touch { display: none; }
#flight-touch[aria-hidden="false"] { display: block; }
#flight-mode.interior #flight-touch .ft-thrust,
#flight-mode.interior #flight-touch .ft-boost { display: none; }
.ft-stick {
  position: absolute;
  left: 26px; bottom: 150px;
  width: 124px; height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159,216,1,0.08), transparent 70%);
  border: 1px solid rgba(159,216,1,0.3);
  z-index: 9;
  touch-action: none;
}
.ft-nub {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(159,216,1,0.25);
  border: 1px solid var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}
.ft-actions {
  position: absolute;
  right: 22px; bottom: 150px;
  z-index: 9;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.ft-btn {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(17,20,41,0.8);
  border: 1px solid rgba(159,216,1,0.35);
  color: var(--primary);
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  box-shadow: 0 0 14px rgba(0,0,0,0.4);
}
.ft-btn small { font-size: 0.42rem; letter-spacing: 1px; }
.ft-btn:active { background: rgba(159,216,1,0.22); }
.ft-action { width: 90px; height: 90px; font-size: 0.85rem; border-color: rgba(255,170,0,0.5); color: #ffd27a; opacity: 0.45; }
.ft-action.on { opacity: 1; border-color: #ffaa00; box-shadow: 0 0 20px rgba(255,170,0,0.45); }
.ft-boost { border-color: rgba(0,170,255,0.5); color: #39e6ff; }

#flight-mode.interior #mission-hud,
#flight-mode.interior #mission-waypoint { display: none; }

/* ───────── RESPONSIVE ───────── */
@media (max-width: 768px) {
  .hud-speed, .hud-radar { display: none; }
  .frame-corner.bl, .frame-corner.br { bottom: 170px; width: 80px; height: 60px; }
  .dash-btn { min-width: 54px; padding: 0.4rem 0.5rem; }
  .dash-btn .db-label { font-size: 0.65rem; }
  .dock-panel { width: 94vw; max-height: 78vh; }
  #mission-hud { top: 58px; left: 12px; width: 200px; padding: 0.55rem 0.6rem; }
  .mh-brief { display: none; }
  .ft-stick { bottom: 120px; left: 16px; width: 108px; height: 108px; }
  .ft-actions { bottom: 120px; right: 14px; }
}

/* ═══════════════════════ v4.0 — LIVING GALAXY GAME SYSTEMS ═══════════════════════ */

/* damage vignette */
#hud-damage {
  position: absolute; inset: 0;
  pointer-events: none; opacity: 0; z-index: 6;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(255,40,20,0.5) 100%);
}
#hud-damage.hit { animation: dmgFlash 0.55s ease-out; }
@keyframes dmgFlash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* hull integrity bar */
#hud-hull {
  position: absolute; top: 64px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  z-index: 7; pointer-events: none;
  font-family: 'Orbitron', monospace;
  font-size: 0.58rem; letter-spacing: 1.5px; color: var(--text-sec);
}
.hh-bar {
  width: 150px; height: 7px; border-radius: 4px;
  background: rgba(11,13,27,0.7); border: 1px solid rgba(159,216,1,0.3);
  overflow: hidden;
}
.hh-fill {
  height: 100%; width: 100%; border-radius: 3px;
  background: var(--primary); box-shadow: 0 0 8px var(--primary-glow);
  transition: width 0.25s ease, background 0.3s;
}
.hh-fill.low { background: #ffaa00; box-shadow: 0 0 8px rgba(255,170,0,0.6); }
.hh-fill.crit { background: #ff3b24; box-shadow: 0 0 10px rgba(255,60,30,0.8); animation: hullBlink 0.7s step-end infinite; }
@keyframes hullBlink { 50% { opacity: 0.45; } }
.hh-val { min-width: 34px; color: #fff; }
#flight-mode.interior #hud-hull { top: 20px; }

/* hazard warning chip */
#hud-warn {
  position: absolute; top: 96px; left: 50%;
  transform: translateX(-50%) scale(0.92);
  z-index: 7; pointer-events: none; opacity: 0;
  font-family: 'Orbitron', monospace;
  font-size: 0.68rem; letter-spacing: 2px; font-weight: 700;
  color: #ff7a3c; text-shadow: 0 0 12px rgba(255,90,30,0.8);
  background: rgba(30,8,2,0.65); border: 1px solid rgba(255,122,60,0.5);
  padding: 0.35rem 0.9rem; border-radius: 6px; white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#hud-warn.show { opacity: 1; transform: translateX(-50%) scale(1); }
#flight-mode.interior #hud-warn { top: 52px; }

/* trader hails / comms feed */
#comms-feed {
  position: absolute; left: 24px; bottom: 170px;
  max-width: 320px; z-index: 7; pointer-events: none; opacity: 0;
  font-family: 'Rajdhani', 'Orbitron', sans-serif;
  font-size: 0.85rem; letter-spacing: 0.5px; color: #cfe6f4;
  background: rgba(6,14,22,0.72); border-left: 3px solid #00aaff;
  padding: 0.5rem 0.8rem; border-radius: 0 8px 8px 0;
  transform: translateX(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#comms-feed.show { opacity: 1; transform: translateX(0); }
#comms-feed b { color: #38e0ff; font-family: 'Orbitron', monospace; font-size: 0.66rem; letter-spacing: 1.5px; }
#flight-mode.interior #comms-feed { display: none; }

/* NPC talk prompt (mirrors read-prompt) */
#npc-prompt {
  position: absolute; left: 50%; bottom: 96px;
  transform: translateX(-50%) scale(0.9);
  z-index: 7; opacity: 0; pointer-events: none;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 10px rgba(0,0,0,0.9); text-transform: uppercase;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#npc-prompt.show { opacity: 1; transform: translateX(-50%) scale(1); }
#npc-prompt .ep-key {
  display: inline-block; border: 1px solid var(--primary); color: var(--primary);
  padding: 0.05rem 0.55rem; border-radius: 5px; margin-right: 0.4rem;
  animation: epPulse 1.3s ease-in-out infinite;
}
#npc-prompt b { color: var(--primary); }

/* NPC dialogue card */
#npc-dialog {
  position: absolute; left: 50%; bottom: 140px;
  transform: translateX(-50%) translateY(8px);
  width: min(440px, 86vw); z-index: 8; opacity: 0; pointer-events: none;
  background: rgba(8,12,20,0.88); border: 1px solid rgba(159,216,1,0.35);
  border-radius: 10px; padding: 0.8rem 1rem;
  backdrop-filter: blur(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#npc-dialog.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#npc-dialog b {
  font-family: 'Orbitron', monospace; font-size: 0.66rem; letter-spacing: 2px;
  color: var(--primary);
}
#npc-dialog p {
  margin: 0.35rem 0 0.3rem; font-size: 0.95rem; line-height: 1.45; color: #e8f0e6;
}
#npc-dialog .nd-hint {
  font-family: 'Orbitron', monospace; font-size: 0.52rem; letter-spacing: 1.5px;
  color: var(--text-sec); text-transform: uppercase;
}

/* hull breach overlay */
#ship-down {
  position: absolute; inset: 0; z-index: 11;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,2,0,0.82); opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#ship-down.show { opacity: 1; }
.sd-card { text-align: center; animation: sdShake 0.4s ease-in-out 2; }
.sd-card h2 {
  font-family: 'Orbitron', monospace; font-size: 1.6rem; letter-spacing: 4px;
  color: #ff3b24; text-shadow: 0 0 24px rgba(255,60,30,0.9);
  margin-bottom: 0.5rem;
}
.sd-card p { color: #f0c8be; font-size: 0.95rem; letter-spacing: 1px; }
@keyframes sdShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

@media (max-width: 760px) {
  #hud-hull { top: 100px; }
  .hh-bar { width: 110px; }
  #comms-feed { bottom: 230px; max-width: 240px; font-size: 0.75rem; }
  #npc-dialog { bottom: 190px; }
}

/* ═══════════════════════ v4.1 — WORLD QUESTS ═══════════════════════ */

/* objective banner (interior) */
#quest-hud {
  position: absolute; left: 18px; top: 210px;
  max-width: 260px; z-index: 7; pointer-events: none;
  display: none; flex-direction: column; gap: 4px;
  background: rgba(8,12,20,0.72); border: 1px solid rgba(159,216,1,0.3);
  border-left: 3px solid var(--primary);
  padding: 0.55rem 0.75rem; border-radius: 0 8px 8px 0;
  backdrop-filter: blur(6px);
}
#quest-hud.show { display: flex; }
#quest-hud .qh-tag {
  font-family: 'Orbitron', monospace; font-size: 0.5rem; letter-spacing: 2.5px;
  color: var(--primary);
}
#quest-hud .qh-text { font-size: 0.82rem; line-height: 1.4; color: #dce8da; }
#quest-hud.half { border-left-color: #ffaa00; }
#quest-hud.half .qh-tag { color: #ffaa00; }
#quest-hud.done { border-left-color: #38e0ff; }
#quest-hud.done .qh-tag { color: #38e0ff; }

/* keeper dialogue: tavern tag, choice buttons, serious mode */
#npc-dialog .kd-tav {
  display: inline-block; margin-left: 0.6rem;
  font-family: 'Orbitron', monospace; font-size: 0.52rem; letter-spacing: 2px;
  color: var(--text-sec); text-transform: uppercase;
}
#npc-dialog .kd-tav.kd-serious { color: #ffaa00; }
#npc-dialog .kd-opts {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0.4rem 0 0.45rem;
  pointer-events: auto;
}
.kd-btn {
  font-family: 'Orbitron', monospace; font-size: 0.6rem; letter-spacing: 1px;
  color: var(--primary); background: rgba(159,216,1,0.08);
  border: 1px solid rgba(159,216,1,0.4); border-radius: 6px;
  padding: 0.4rem 0.7rem; cursor: pointer; text-align: left;
  transition: background 0.2s, transform 0.15s;
}
.kd-btn:hover { background: rgba(159,216,1,0.18); transform: translateY(-1px); }
.kd-btn.kd-ask { color: #ffaa00; border-color: rgba(255,170,0,0.45); background: rgba(255,170,0,0.07); }
.kd-btn.kd-ask:hover { background: rgba(255,170,0,0.16); }
#npc-dialog.show { pointer-events: auto; }
#npc-dialog.serious { border-color: rgba(255,170,0,0.55); box-shadow: 0 0 40px rgba(255,170,0,0.12); }
#npc-dialog.serious b { color: #ffaa00; }

@media (max-width: 760px) {
  #quest-hud { top: 178px; max-width: 210px; }
  #quest-hud .qh-text { font-size: 0.74rem; }
}

/* ═══════════════════════ v4.3 — POINTER LOCK & PAUSE ═══════════════════════ */
#pause-menu {
  position: absolute; inset: 0; z-index: 12;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,8,14,0.78); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
#pause-menu.show { opacity: 1; pointer-events: auto; }
.pm-card {
  text-align: center; min-width: 300px;
  background: rgba(8,14,22,0.9); border: 1px solid rgba(159,216,1,0.35);
  border-radius: 14px; padding: 1.6rem 2rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.pm-card h2 {
  font-family: 'Orbitron', monospace; font-size: 1.3rem; letter-spacing: 4px;
  color: var(--primary); text-shadow: 0 0 18px var(--primary-glow); margin-bottom: 0.1rem;
}
.pm-card p { color: var(--text-sec); font-size: 0.82rem; margin-bottom: 0.7rem; }
.pm-btn {
  font-family: 'Orbitron', monospace; font-size: 0.72rem; letter-spacing: 2px;
  color: var(--primary); background: rgba(159,216,1,0.08);
  border: 1px solid rgba(159,216,1,0.4); border-radius: 8px;
  padding: 0.7rem 1rem; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.pm-btn:hover { background: rgba(159,216,1,0.18); transform: translateY(-1px); }
.pm-btn.pm-exit { color: #ff7a5c; border-color: rgba(255,122,92,0.4); background: rgba(255,122,92,0.06); }
.pm-btn.pm-exit:hover { background: rgba(255,122,92,0.14); }

/* ═══════════════════════ v4.2 — SERVED DRINKS & SOUND ═══════════════════════ */
.kd-btn.kd-drink { color: #cf9c5a; border-color: rgba(207,156,90,0.45); background: rgba(207,156,90,0.07); }
.kd-btn.kd-drink:hover { background: rgba(207,156,90,0.16); }
#npc-dialog .kd-heal { color: #9fd801; font-style: normal; font-family: 'Orbitron', monospace; font-size: 0.62rem; letter-spacing: 1px; }
#npc-dialog em { font-style: italic; color: #b8c4c0; }

/* ═══════════════════════ v4.4 — QUEST NAVIGATION: COMPASS · MINIMAP · CACHES ═══════════════════════ */
/* guided compass waypoint (top-centre) */
#nav-way {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 8; pointer-events: none; display: none;
  align-items: center; gap: 0.6rem;
  background: rgba(6,12,16,0.74); border: 1px solid rgba(159,216,1,0.3);
  border-radius: 30px; padding: 0.4rem 0.9rem 0.4rem 0.55rem;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#nav-way.show { display: flex; }
#nav-way #nw-arrow {
  font-size: 1.15rem; line-height: 1; color: var(--primary);
  display: inline-block; transition: transform 0.12s linear;
  text-shadow: 0 0 10px currentColor;
}
#nav-way .nw-info { display: flex; flex-direction: column; line-height: 1.15; }
#nav-way #nw-label {
  font-family: 'Orbitron', monospace; font-size: 0.56rem; letter-spacing: 1.6px;
  color: #dce8da; text-transform: uppercase; white-space: nowrap;
}
#nav-way #nw-dist {
  font-family: 'Orbitron', monospace; font-size: 0.72rem; letter-spacing: 1px;
  color: var(--primary); font-weight: 700;
}
#nav-way.cache { border-color: rgba(255,207,138,0.5); }
#nav-way.cache #nw-arrow, #nav-way.cache #nw-dist { color: #ffcf8a; }
#nav-way.monument { border-color: rgba(56,224,255,0.5); }
#nav-way.monument #nw-arrow, #nav-way.monument #nw-dist { color: #38e0ff; }
#nav-way.near #nw-arrow { animation: nw-pulse 0.7s ease-in-out infinite; }
@keyframes nw-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.35); } }

/* per-region challenge countdown (desert sandstorm) */
#chal-timer {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  z-index: 8; pointer-events: none; display: none;
  font-family: 'Orbitron', monospace; font-size: 0.72rem; letter-spacing: 1.5px;
  color: #ffcf8a; background: rgba(20,10,4,0.8);
  border: 1px solid rgba(255,178,77,0.5); border-radius: 20px;
  padding: 0.3rem 0.85rem; text-transform: uppercase;
}
#chal-timer.show { display: block; }
#chal-timer.urgent { color: #ff5a3c; border-color: #ff5a3c; animation: ct-flash 0.5s steps(2) infinite; }
@keyframes ct-flash { 0% { opacity: 1; } 100% { opacity: 0.45; } }

/* retro minimap (bottom-right radar) */
#nav-map {
  position: absolute; right: 18px; bottom: 92px; width: 150px; height: 150px;
  z-index: 7; pointer-events: none; display: none;
  border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(159,216,1,0.35);
  box-shadow: 0 0 0 3px rgba(6,12,16,0.6), 0 6px 22px rgba(0,0,0,0.5);
}
#nav-map.show { display: block; }
#nav-map #nav-canvas { display: block; width: 150px; height: 150px; image-rendering: pixelated; }
#nav-map .nm-n {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  font-family: 'Orbitron', monospace; font-size: 0.5rem; letter-spacing: 1px;
  color: rgba(220,232,218,0.8);
}

/* discovery / narration card (bottom-centre) */
#lore-pop {
  position: absolute; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  z-index: 9; pointer-events: none; width: min(440px, 84vw);
  background: linear-gradient(180deg, rgba(10,16,22,0.94), rgba(6,10,14,0.94));
  border: 1px solid rgba(159,216,1,0.3); border-top: 3px solid var(--primary);
  border-radius: 10px; padding: 0.7rem 1rem 0.85rem;
  opacity: 0; transition: opacity 0.35s, transform 0.35s;
  box-shadow: 0 10px 34px rgba(0,0,0,0.55);
}
#lore-pop.show { opacity: 1; transform: translate(-50%, 0); }
#lore-pop .lp-tag {
  font-family: 'Orbitron', monospace; font-size: 0.5rem; letter-spacing: 2.5px;
  color: var(--primary); text-transform: uppercase;
}
#lore-pop h3 { margin: 0.2rem 0 0.25rem; font-size: 0.98rem; color: #f2f7ef; letter-spacing: 0.3px; }
#lore-pop p { margin: 0; font-size: 0.82rem; line-height: 1.45; color: #c4d0cc; }

@media (max-width: 640px) {
  #nav-map { width: 112px; height: 112px; bottom: 84px; right: 12px; }
  #nav-map #nav-canvas { width: 112px; height: 112px; }
  #nav-way { top: 10px; padding: 0.32rem 0.7rem 0.32rem 0.45rem; }
  #nav-way #nw-label { font-size: 0.5rem; }
  #lore-pop { bottom: 84px; padding: 0.6rem 0.85rem 0.7rem; }
  #lore-pop h3 { font-size: 0.88rem; }
  #lore-pop p { font-size: 0.76rem; }
}
