/* Misión Fastdator: one deliberate dark look (the inside of a ship), so no light theme. */
:root {
  color-scheme: dark;
  --bg: #010409;
  --text: #e6f1f4;
  --muted: #8ea6b0;
  --teal: #4ecdc4;
  --teal-dim: rgba(78, 205, 196, 0.35);
  --gold: #ffd166;
  --gold-deep: #e9a93a;
  --coral: #ff6b6b;
  --glass: rgba(4, 13, 20, 0.66);
  --glass-strong: rgba(3, 10, 16, 0.86);
  --line: rgba(120, 220, 214, 0.28);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --label: "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --tint: #ffcf8a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

.eyebrow {
  margin: 0;
  font-family: var(--label);
  font-weight: 600;
  font-size: 0.72em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

#space { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- cockpit ---------- */
#cockpit {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: transform;
}
body.in-ship #cockpit { opacity: 1; }
#cockpit-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#cockpit-light {
  position: absolute;
  inset: 0;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  background:
    radial-gradient(ellipse 60% 45% at 50% 18%, color-mix(in srgb, var(--tint) 55%, transparent), transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 62%, color-mix(in srgb, var(--tint) 30%, transparent), transparent 75%);
  mix-blend-mode: soft-light;
  opacity: 0.9;
  transition: background 2s ease;
}
body.warping #cockpit-light {
  background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(120, 200, 255, 0.85), transparent 75%);
  mix-blend-mode: screen;
  opacity: 0.35;
  animation: warp-pulse 0.35s ease-in-out infinite alternate;
}
@keyframes warp-pulse { from { opacity: 0.2; } to { opacity: 0.45; } }

#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 35%, #ffffff, #bfe9ff 40%, rgba(120, 200, 255, 0.6));
  opacity: 0;
}

/* ---------- window overlays ---------- */
#window-layer {
  position: fixed;
  pointer-events: none;
  font-size: var(--win-fs, 15px);
  opacity: 0;
  transition: opacity 0.8s ease;
}
body.in-ship #window-layer { opacity: 1; }
#window-layer > * { pointer-events: auto; }
.art-tag {
  position: absolute;
  right: 1.2em;
  bottom: 0.8em;
  margin: 0;
  font-family: var(--label);
  font-size: 0.66em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(230, 241, 244, 0.42);
  pointer-events: none !important;
}

.glass {
  background: linear-gradient(160deg, rgba(10, 30, 40, 0.72), var(--glass));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

.arrival {
  position: absolute;
  top: 1.6em;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1em;
  white-space: nowrap;
  font-family: var(--label);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.95em;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease, font-size 0.8s ease;
  pointer-events: none !important;
}
.arrival.show { opacity: 1; }
.arrival.big { font-size: 1.5em; top: 22%; }
.arrival-line { width: 4em; height: 1px; background: linear-gradient(90deg, transparent, var(--teal)); }
.arrival-line:last-child { transform: scaleX(-1); }
.arrival-text b { color: var(--teal); font-weight: 600; }

.fact {
  position: absolute;
  top: 1.4em;
  left: 1.4em;
  width: min(22em, 46%);
  padding: 1em 1.15em 0.9em;
  animation: card-in 0.6s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}
.fact::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(78, 205, 196, 0.22) 48%, transparent 52%);
  background-size: 100% 220%;
  animation: scan-sweep 1.1s ease-out 1;
  pointer-events: none;
}
@keyframes scan-sweep { from { background-position: 0 100%; } to { background-position: 0 -120%; } }
@keyframes card-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
.fact-head { display: flex; gap: 0.8em; align-items: center; }
.fact-swatch { flex: none; width: 2.6em; height: 2.6em; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), 0 0 18px rgba(78, 205, 196, 0.25); }
.fact-title { margin: 0.15em 0 0; font-family: var(--body); font-weight: 700; font-size: 1.18em; line-height: 1.2; text-wrap: balance; }
.fact-list { margin: 0.8em 0 0; padding: 0; list-style: none; display: grid; gap: 0.38em; }
.fact-list li { position: relative; padding-left: 1.1em; font-size: 0.92em; line-height: 1.35; color: #d3e3e8; }
.fact-list li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.fact-source { margin: 0.8em 0 0; font-size: 0.7em; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; font-family: var(--label); }

.narration {
  position: absolute;
  left: 50%;
  bottom: 1.2em;
  transform: translateX(-50%);
  width: min(40em, calc(100% - 2.4em));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9em;
  padding: 0.7em 1em 0.7em 0.75em;
  animation: card-in 0.5s ease;
}
.narration-play {
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  border: 1px solid var(--teal-dim);
  display: grid;
  place-items: center;
  background: rgba(78, 205, 196, 0.1);
}
.narration-play::before { content: ""; width: 0.75em; height: 0.85em; background: var(--text); clip-path: polygon(0 0, 100% 50%, 0 100%); margin-left: 0.15em; }
.narration.playing .narration-play::before { clip-path: polygon(0 0, 35% 0, 35% 100%, 0 100%, 0 0, 65% 0, 100% 0, 100% 100%, 65% 100%, 65% 0); margin: 0; width: 0.7em; }
.narration-body { min-width: 0; }
.narration-text { margin: 0.2em 0 0; font-size: 0.98em; line-height: 1.4; min-height: 1.4em; }
.narration-text .w { opacity: 0.22; transition: opacity 0.25s ease; }
.narration-text .w.on { opacity: 1; }
.narration-wave { width: 6em; height: 1.6em; }

.hint {
  position: absolute;
  left: 50%;
  top: 4.2em;
  transform: translateX(-50%);
  padding: 0.55em 1.1em;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--teal-dim);
  font-size: 0.88em;
  white-space: nowrap;
  animation: card-in 0.5s ease, hint-glow 2.4s ease-in-out infinite;
}
@keyframes hint-glow { 50% { box-shadow: 0 0 22px rgba(78, 205, 196, 0.35); } }

.stamp {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) rotate(-6deg);
  padding: 0.6em 1.4em;
  border: 3px solid var(--gold);
  border-radius: 10px;
  color: var(--gold);
  font-family: var(--label);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  font-size: 1.25em;
  background: rgba(1, 4, 9, 0.35);
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.5);
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.25), inset 0 0 20px rgba(255, 209, 102, 0.15);
  animation: stamp-in 0.55s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none !important;
}
.stamp small { display: block; margin-top: 0.4em; font-family: var(--body); font-weight: 500; letter-spacing: 0.02em; text-transform: none; font-size: 0.55em; color: var(--text); text-shadow: none; }
@keyframes stamp-in { from { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(1.8); } to { opacity: 1; } }

/* ---------- route map and finale ---------- */
.route, .finale {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(44em, calc(100% - 2em));
  max-height: calc(100% - 2em);
  overflow: auto;
  padding: 1.2em 1.4em 1.3em;
  animation: card-in 0.5s ease;
}
.route h2, .finale h2 { margin: 0.25em 0 0.7em; font-size: 1.3em; text-wrap: balance; }
.route svg { width: 100%; height: auto; display: block; }
.route .close, .finale .close {
  position: absolute; top: 0.6em; right: 0.7em; width: 2em; height: 2em; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted); font-size: 1em;
}
.route-legend { display: flex; flex-wrap: wrap; gap: 0.5em 1.2em; margin: 0.8em 0 0; padding: 0; list-style: none; font-size: 0.86em; color: var(--muted); }
.route-legend b { color: var(--text); font-weight: 600; }
.finale-stops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8em; margin: 0.4em 0 1em; }
.finale-stop { display: grid; justify-items: center; gap: 0.35em; text-align: center; font-size: 0.86em; }
.finale-stop .ball { width: 3.6em; height: 3.6em; border-radius: 50%; position: relative; box-shadow: 0 0 0 1px var(--line), 0 0 24px rgba(78, 205, 196, 0.25); }
.finale-stop .ball::after { content: "✓"; position: absolute; right: -0.25em; bottom: -0.25em; width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #012; font-weight: 800; font-size: 0.8em; }
.finale-stop small { color: var(--muted); }
.finale p { margin: 0 0 0.8em; line-height: 1.5; color: #d3e3e8; }
.finale-links { display: grid; gap: 0.5em; margin: 0.4em 0 1em; }
.finale-links a {
  display: flex; align-items: center; gap: 0.7em; padding: 0.6em 0.8em; border-radius: 10px;
  border: 1px solid var(--line); color: var(--text); text-decoration: none; background: rgba(78, 205, 196, 0.06);
}
.finale-links a::before { content: ""; flex: none; width: 1.6em; height: 1.1em; border-radius: 4px; background: var(--coral); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.finale-links a span { color: var(--muted); font-size: 0.85em; margin-left: auto; }
.finale-actions { display: flex; flex-wrap: wrap; gap: 0.8em; align-items: center; }

/* ---------- hotspots ---------- */
#hotspots { position: fixed; inset: 0; pointer-events: none; }
.hotspot {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}
.hotspot.off { opacity: 0; pointer-events: none; }
.hotspot-hit { position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%; }
.hotspot-core, .hotspot-ring, .hotspot-ring2 { position: absolute; border-radius: 50%; pointer-events: none; }
.hotspot-core { left: -7px; top: -7px; width: 14px; height: 14px; background: #eafffd; box-shadow: 0 0 12px 3px var(--teal), 0 0 30px 8px rgba(78, 205, 196, 0.35); }
.hotspot-ring { left: -20px; top: -20px; width: 40px; height: 40px; border: 2px solid var(--teal); animation: ring-pulse 2s ease-out infinite; }
.hotspot-ring2 { left: -20px; top: -20px; width: 40px; height: 40px; border: 2px solid var(--teal); animation: ring-pulse 2s ease-out 1s infinite; }
@keyframes ring-pulse { from { transform: scale(0.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hotspot-label {
  position: absolute; left: 22px; top: -13px; white-space: nowrap; padding: 4px 10px 4px 9px; border-radius: 6px;
  background: var(--glass-strong); border: 1px solid var(--teal-dim); font-family: var(--label); font-weight: 600;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; pointer-events: none;
}
.hotspot.left .hotspot-label { left: auto; right: 22px; }
.hotspot.scanning .hotspot-ring { border-color: var(--gold); border-style: dashed; animation: spin 1s linear infinite; transform: none; opacity: 1; }
.hotspot.scanning .hotspot-ring2 { display: none; }
.hotspot.scanning .hotspot-core { background: var(--gold); box-shadow: 0 0 14px 4px var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
.hotspot.done .hotspot-ring, .hotspot.done .hotspot-ring2 { display: none; }
.hotspot.done .hotspot-core { background: var(--teal); box-shadow: 0 0 10px 2px rgba(78, 205, 196, 0.6); }
.hotspot.done .hotspot-core::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #012; font-size: 10px; font-weight: 800; }
.hotspot.done .hotspot-label { color: var(--muted); border-color: var(--line); }

/* ---------- dashboard panel ---------- */
.panel {
  position: fixed;
  font-size: var(--panel-fs, 15px);
  display: grid;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease 0.4s;
}
body.in-ship .panel { opacity: 1; pointer-events: auto; }
.is-desktop .panel {
  grid-template-columns: 1.15fr 1.25fr auto auto;
  gap: 1.6em;
  padding: 0 1.8em;
}
.is-desktop .panel > * + * { position: relative; }
.is-desktop .panel-progress::before, .is-desktop .panel-tools::before {
  content: ""; position: absolute; left: -0.8em; top: 15%; bottom: 15%; width: 1px; background: var(--line);
}
.is-mobile .panel {
  grid-template-columns: auto 1fr;
  grid-template-areas: "dest dest" "prog prog" "tools cta";
  align-content: center;
  gap: 0.75em 1em;
  padding: 0.8em 1.1em 0.9em;
}
.is-mobile .panel-dest { grid-area: dest; }
.is-mobile .panel-progress { grid-area: prog; }
.is-mobile .panel-tools { grid-area: tools; }
.is-mobile .panel .cta { grid-area: cta; }
.is-mobile .dest-swatch { width: 2.6em; height: 2.6em; }
.is-mobile .tool span { display: none; }
.is-mobile .tool { min-width: 0; }
.is-mobile .tool svg { width: 2.7em; height: 2.7em; padding: 0.6em; }
.is-mobile .progress-stops { margin-top: 0.5em; }
.is-mobile .fact { width: calc(100% - 2em); left: 1em; top: 1em; padding: 0.8em 0.95em 0.75em; }
.is-mobile .fact-list { margin-top: 0.55em; }
.is-mobile .narration { bottom: 0.8em; width: calc(100% - 1.6em); }
.is-mobile .art-tag { right: 50%; transform: translateX(50%); bottom: auto; top: 0.5em; white-space: nowrap; }
.panel-dest { display: flex; align-items: center; gap: 0.9em; min-width: 0; }
.dest-swatch {
  flex: none; width: 3.4em; height: 3.4em; border-radius: 50%; position: relative;
  box-shadow: 0 0 0 1px var(--line), 0 0 22px rgba(78, 205, 196, 0.2);
}
.dest-swatch::after { content: ""; position: absolute; inset: -0.45em; border: 1px solid var(--teal-dim); border-radius: 10px; clip-path: polygon(0 0, 30% 0, 30% 2px, 2px 2px, 2px 30%, 0 30%, 0 70%, 2px 70%, 2px calc(100% - 2px), 30% calc(100% - 2px), 30% 100%, 70% 100%, 70% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 70%, 100% 70%, 100% 30%, calc(100% - 2px) 30%, calc(100% - 2px) 2px, 70% 2px, 70% 0, 100% 0, 100% 100%, 0 100%); }
.dest-text { min-width: 0; }
.dest-name { margin: 0.25em 0 0; font-size: 1.08em; line-height: 1.25; }
.dest-name strong { display: block; font-family: var(--label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 1.22em; }
.dest-name span { display: block; color: var(--muted); font-size: 0.86em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-progress { min-width: 0; }
.progress-text { margin: 0 0 0.55em; font-size: 0.92em; color: #cfe0e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-bar { height: 0.42em; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(78, 205, 196, 0.12); }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2aa8a0, var(--teal)); box-shadow: 0 0 12px var(--teal); transition: width 0.6s ease; }
.progress-stops { display: flex; align-items: center; justify-content: space-between; margin: 0.65em 12% 0; position: relative; }
.progress-stops::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.stop-dot { position: relative; width: 0.62em; height: 0.62em; border-radius: 50%; background: #23434a; box-shadow: 0 0 0 2px rgba(1, 4, 9, 0.9); }
.stop-dot.done { background: var(--teal); box-shadow: 0 0 0 2px rgba(1, 4, 9, 0.9), 0 0 8px var(--teal); }
.stop-dot.here { background: var(--gold); box-shadow: 0 0 0 2px rgba(1, 4, 9, 0.9), 0 0 0 4px rgba(255, 209, 102, 0.35), 0 0 10px var(--gold); }
.panel-tools { display: flex; gap: 0.9em; }
.is-mobile .panel-tools { gap: 0.55em; }
.tool { display: grid; justify-items: center; gap: 0.35em; font-size: 0.78em; color: #cfe0e6; min-width: 4.2em; }
.tool svg {
  width: 3em; height: 3em; padding: 0.7em; border-radius: 50%; border: 1px solid var(--teal-dim);
  fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  background: rgba(78, 205, 196, 0.06); transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.tool:hover svg, .tool.active svg { background: rgba(78, 205, 196, 0.18); border-color: var(--teal); }
.tool:active svg { transform: scale(0.94); }
.tool[disabled] { opacity: 0.35; pointer-events: none; }
.tool .wave-off { display: none; }
.tool.muted .wave-on { display: none; }
.tool.muted .wave-off { display: inline; }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.95em 1.4em 0.95em 1.6em; border-radius: 12px; white-space: nowrap;
  font-family: var(--body); font-weight: 700; font-size: 1em; color: #2a1c00;
  background: linear-gradient(180deg, #ffe08c, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 0 0 1px rgba(255, 230, 160, 0.7) inset, 0 0 26px rgba(255, 209, 102, 0.45), 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, filter 0.2s ease, opacity 0.3s ease;
}
.cta svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: scale(0.97); }
.cta.ready { animation: cta-glow 1.6s ease-in-out infinite; }
@keyframes cta-glow { 50% { box-shadow: 0 0 0 1px rgba(255, 230, 160, 0.7) inset, 0 0 44px rgba(255, 209, 102, 0.8), 0 8px 24px rgba(0, 0, 0, 0.4); } }
.cta[disabled] { filter: grayscale(0.85) brightness(0.55); box-shadow: none; pointer-events: none; }
.is-mobile .panel .cta { width: 100%; font-size: 1.02em; padding: 0.85em 0.9em; }

/* ---------- boarding ---------- */
.boarding {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.6vh, 28px);
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 70% at 50% 55%, rgba(1, 4, 9, 0.15), rgba(1, 4, 9, 0.7) 75%),
    linear-gradient(180deg, rgba(1, 4, 9, 0.55), transparent 30%, transparent 70%, rgba(1, 4, 9, 0.75));
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.boarding.leaving { opacity: 0; transform: translateY(-4vh) scale(1.03); pointer-events: none; }
.boarding-head { text-align: center; max-width: 40rem; }
.boarding-head h1 {
  margin: 0.15em 0 0.2em; font-family: var(--label); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.1rem, 6.4vw, 4.4rem); letter-spacing: 0.12em; line-height: 1;
  text-shadow: 0 0 40px rgba(78, 205, 196, 0.35);
}
.boarding-head h1.brand { display: grid; justify-items: center; gap: 0.18em; font-weight: 600; letter-spacing: 0.22em; text-shadow: 0 0 30px rgba(78, 205, 196, 0.25); }
.brand small { font-size: 0.42em; font-weight: 500; letter-spacing: 0.5em; margin-right: -0.5em; color: #dce9ee; }
.brand-word { display: inline-flex; align-items: center; margin-right: -0.22em; color: #f2f7f9; }
.brand-o { width: 1.02em; height: 1.02em; margin: 0 0.2em 0 0.02em; overflow: visible; filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.55)); }
.brand-o circle, .brand-o .orbit { fill: none; stroke: var(--gold); stroke-linecap: round; }
.brand-o circle { stroke-width: 9; }
.brand-o .orbit { stroke-width: 6; }
.boarding-head .eyebrow { font-size: clamp(0.7rem, 1.6vw, 0.85rem); }
.boarding-sub { margin: 0 auto; max-width: 34em; color: #c7d8de; font-size: clamp(0.92rem, 1.9vw, 1.08rem); line-height: 1.5; text-wrap: balance; }

.pass {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 230px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 40%),
    linear-gradient(160deg, rgba(10, 34, 44, 0.92), rgba(4, 12, 19, 0.94));
  border: 1px solid rgba(120, 220, 214, 0.32);
  box-shadow: var(--shadow), 0 0 60px rgba(78, 205, 196, 0.12);
  position: relative;
  animation: pass-in 0.9s cubic-bezier(.2, .8, .2, 1);
}
@keyframes pass-in { from { opacity: 0; transform: translateY(24px) rotateX(18deg); } to { opacity: 1; transform: none; } }
.pass-main { padding: 20px 24px 20px; display: grid; gap: 16px; min-width: 0; }
.pass-top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--label); font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }
.pass-brand { color: var(--gold); font-weight: 700; }
.pass-field { display: grid; gap: 6px; }
.pass-field input {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35); color: var(--text); font: 600 1.15rem var(--body); outline: none;
  user-select: text; -webkit-user-select: text;
}
.pass-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.18); }
.pass-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.pass-route strong { display: block; font-family: var(--label); font-size: 1.6rem; letter-spacing: 0.08em; line-height: 1.1; margin-top: 4px; }
.pass-route small { color: var(--muted); font-size: 0.8rem; }
.pass-route div:last-child { text-align: right; }
.pass-route div:last-child strong { color: var(--gold); }
.pass-arc { width: 100%; height: 30px; }
.pass-arc path { fill: none; stroke: var(--teal-dim); stroke-width: 1.5; stroke-dasharray: 4 5; }
.pass-arc circle { fill: var(--teal); filter: drop-shadow(0 0 4px var(--teal)); }
.pass-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pass-grid b { display: block; margin-top: 4px; font-family: var(--label); font-size: 1.05rem; letter-spacing: 0.06em; }
.pass-stub {
  position: relative; padding: 18px 18px 16px; display: grid; gap: 10px; align-content: start; justify-items: center;
  border-left: 2px dashed rgba(120, 220, 214, 0.28);
}
.pass-stub::before, .pass-stub::after { content: ""; position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px rgba(120, 220, 214, 0.32); }
.pass-stub::before { top: -12px; }
.pass-stub::after { bottom: -12px; }
#flag-preview { width: 150px; height: auto; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.flag-colors, .flag-emblems { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.swatch-btn { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.swatch-btn[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); transform: scale(1.08); }
.emblem-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); display: grid; place-items: center; background: rgba(0, 0, 0, 0.3); }
.emblem-btn canvas { width: 22px; height: 22px; }
.emblem-btn[aria-checked="true"] { border-color: var(--teal); background: rgba(78, 205, 196, 0.16); }
.pass-stamps { display: flex; gap: 6px; min-height: 0; }
.pass-stamps span { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.barcode {
  width: 100%; height: 34px; opacity: 0.75;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 4px, var(--text) 4px 5px, transparent 5px 8px, var(--text) 8px 11px, transparent 11px 13px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.boarding-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cta-big { font-size: 1.15rem; padding: 1em 2.4em 1em 2.6em; border-radius: 14px; }
.link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 0.9rem; padding: 6px; }
.boarding-note { margin: 0; color: var(--muted); font-size: 0.82rem; text-align: center; }

@media (max-width: 640px) {
  .pass { grid-template-columns: 1fr; }
  .pass-main { padding: 16px 16px 14px; gap: 13px; }
  .pass-route strong { font-size: 1.25rem; }
  .pass-grid { grid-template-columns: repeat(2, 1fr); }
  .pass-stub { border-left: 0; border-top: 2px dashed rgba(120, 220, 214, 0.28); grid-template-columns: auto 1fr; justify-items: start; align-items: center; column-gap: 14px; padding: 14px 16px; }
  .pass-stub > .eyebrow { grid-column: 1 / -1; }
  .pass-stub::before, .pass-stub::after { left: auto; top: -12px; bottom: auto; }
  .pass-stub::before { left: -12px; }
  .pass-stub::after { right: -12px; }
  #flag-preview { width: 112px; grid-row: span 2; }
  .flag-colors, .flag-emblems { justify-content: flex-start; }
  .barcode, .pass-stamps { display: none; }
}

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--bg); transition: opacity 0.8s ease; z-index: 5; }
.loader span { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--teal-dim); border-top-color: var(--teal); animation: spin 0.9s linear infinite; }
.loader p { margin: 0; font-family: var(--label); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.8rem; color: var(--muted); }
body:not(.is-loading) .loader { opacity: 0; pointer-events: none; }

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

/* ---------- layering and small screens (14-oct, after the first test on an iPhone) ---------- */
#space { z-index: 0; }
#cockpit { z-index: 1; }
#hotspots { z-index: 2; }
#window-layer { z-index: 3; }
.panel { z-index: 4; }
.boarding { z-index: 6; }
#flash { z-index: 7; }
.loader { z-index: 8; }
#hotspots.covered { visibility: hidden; }
body.card-open .narration, body.card-open .fact, body.card-open .hint { display: none; }
.hotspot.done .hotspot-label { display: none; }
.narration-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.is-mobile .art-tag { font-size: 0.6em; top: 0.35em; }
.is-mobile .arrival { top: 2.1em; font-size: 0.85em; }
.is-mobile .arrival.big { font-size: 1.15em; top: 30%; }
.is-mobile .fact { top: 1.7em; left: 0.7em; width: calc(100% - 1.4em); padding: 0.6em 0.8em; cursor: pointer; }
.is-mobile .fact-swatch { display: none; }
.is-mobile .fact-title { font-size: 1.02em; margin: 0.1em 0 0; }
.is-mobile .fact-kicker { font-size: 0.66em; }
.is-mobile .fact-head { position: relative; padding-right: 1.8em; }
.is-mobile .fact-head::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 1.4em; height: 1.4em; border-radius: 50%; border: 1px solid var(--teal-dim); display: grid; place-items: center; color: var(--teal); font-weight: 700; line-height: 1; }
.is-mobile .fact.open .fact-head::after { content: "–"; }
.is-mobile .fact-list, .is-mobile .fact-source { display: none; }
.is-mobile .fact.open .fact-list { display: grid; }
.is-mobile .fact.open .fact-source { display: block; }
.is-mobile .fact-list li { font-size: 0.86em; }
.is-mobile .narration { grid-template-columns: auto 1fr; gap: 0.6em; padding: 0.5em 0.75em 0.55em 0.55em; bottom: 0.6em; width: calc(100% - 1.2em); }
.is-mobile .narration-wave { display: none; }
.is-mobile .narration-play { width: 2.1em; height: 2.1em; }
.is-mobile .narration-text { font-size: 0.92em; line-height: 1.35; }
.is-mobile .narration-who { font-size: 0.6em; }
.is-mobile .hint { bottom: auto; top: 46%; font-size: 0.82em; white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 2em); }
.is-mobile .hotspot-label { font-size: 10.5px; padding: 3px 7px; top: -11px; left: 18px; }
.is-mobile .hotspot.left .hotspot-label { right: 18px; }
.is-mobile .route, .is-mobile .finale {
  position: fixed;
  left: 10px;
  right: 10px;
  top: max(10px, env(safe-area-inset-top));
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: none;
  width: auto;
  max-height: none;
  font-size: 15px;
  background: linear-gradient(160deg, rgba(8, 26, 34, 0.96), rgba(3, 10, 16, 0.97));
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.is-mobile .finale-stop .ball { width: 3em; height: 3em; }
.is-mobile .finale h2 { font-size: 1.25em; padding-right: 1.6em; }
.is-mobile .finale-actions .cta { flex: 1; }
body.card-open #window-layer { z-index: 5; }
.is-mobile .stamp { top: 64%; font-size: 0.95em; padding: 0.5em 1em; max-width: calc(100% - 2em); }

/* ---------- stage 2 vote, lead form, shared pass ---------- */
.finale-share { margin: 0 0 1.1em; }
.finale-share .cta { width: 100%; }
.next { margin: 0 0 1.2em; padding: 1em 1.1em 1.1em; border-radius: 12px; border: 1px solid rgba(255, 209, 102, 0.35); background: linear-gradient(160deg, rgba(255, 209, 102, 0.08), rgba(255, 209, 102, 0.02)); }
.next .eyebrow { color: var(--gold); }
.next h3 { margin: 0.2em 0 0.25em; font-size: 1.2em; }
.next-sub { margin: 0 0 0.8em !important; font-size: 0.92em; color: #c7d8de !important; }
.next-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6em; }
.next-option {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 0.7em; align-items: center;
  text-align: left; padding: 0.65em 0.75em; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.next-option .ball { grid-row: span 2; width: 2.4em; height: 2.4em; border-radius: 50%; box-shadow: 0 0 14px rgba(255, 255, 255, 0.12); }
.next-option b { font-size: 0.95em; }
.next-option small { color: var(--muted); font-size: 0.78em; line-height: 1.3; }
.next-option:hover { border-color: var(--teal); }
.next-option:active { transform: scale(0.98); }
.next-option[aria-checked="true"] { border-color: var(--gold); background: rgba(255, 209, 102, 0.12); box-shadow: 0 0 18px rgba(255, 209, 102, 0.2); }
.lead { display: grid; gap: 0.7em; margin-top: 1em; animation: card-in 0.4s ease; }
.lead-field { display: grid; gap: 0.35em; }
.lead-field input {
  width: 100%; min-width: 0; padding: 0.75em 0.85em; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.4); color: var(--text); font: 600 1rem var(--body); outline: none; user-select: text; -webkit-user-select: text;
}
.lead-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.18); }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6em; align-items: start; font-size: 0.86em; line-height: 1.4; color: #c7d8de; cursor: pointer; }
.check input { width: 1.25em; height: 1.25em; margin: 0.1em 0 0; accent-color: var(--teal); }
.check a { color: var(--teal); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lead .cta { width: 100%; white-space: normal; text-align: center; }
.lead-msg { margin: 0 !important; min-height: 1.2em; font-size: 0.86em; color: var(--coral) !important; }
.lead-done { margin: 0.9em 0 0 !important; padding: 0.8em 1em; border-radius: 10px; background: rgba(78, 205, 196, 0.12); border: 1px solid var(--teal-dim); color: var(--text) !important; font-weight: 600; }
.finale-actions .link { padding: 0.4em 0.2em; }
.pass-viewer { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 16px; background: rgba(1, 4, 9, 0.85); touch-action: pan-y; }
.pass-viewer-box { max-width: 420px; width: 100%; max-height: 100%; overflow: auto; padding: 14px; display: grid; gap: 10px; text-align: center; }
.pass-viewer-box img { width: 100%; border-radius: 10px; user-select: auto; -webkit-user-select: auto; -webkit-touch-callout: default; }
.pass-viewer-box p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.pass-viewer .cta { text-decoration: none; }
@media (max-width: 420px) { .next-options { grid-template-columns: 1fr; } }
.route-vote { width: 100%; margin-top: 1em; }
.finale-stop.todo { opacity: 0.45; } .finale-stop.todo .ball::after { display: none; }
/* boarding: never cut the title when the page is taller than the screen; compact on phones */
.boarding { justify-content: flex-start; }
.boarding > :first-child { margin-top: auto; }
.boarding > :last-child { margin-bottom: auto; }
@media (max-width: 640px) {
  .boarding { gap: 14px; }
  .boarding-sub { font-size: 0.9rem; }
  .pass-grid { display: none; }
  .pass-top .pass-class { display: none; }
  .pass-main { gap: 10px; }
}
/* the Sun just outside the window, top right: a warm glow and a thin lens streak, like the mock-ups */
.sun-leak { position: absolute; inset: 0; overflow: hidden; pointer-events: none !important; mix-blend-mode: screen; }
.sun-leak::before {
  content: ""; position: absolute; right: -14%; top: -30%; width: 55%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 225, 0.95) 0 3%, rgba(255, 214, 150, 0.45) 9%, rgba(255, 170, 90, 0.14) 28%, transparent 62%);
  animation: sun-breathe 9s ease-in-out infinite alternate;
}
.sun-leak span {
  position: absolute; right: -10%; top: 4%; width: 70%; height: 2px; transform: rotate(-8deg); transform-origin: right center;
  background: linear-gradient(90deg, transparent, rgba(170, 225, 255, 0.0) 20%, rgba(170, 225, 255, 0.35) 80%, rgba(255, 255, 255, 0.7));
  filter: blur(1px);
}
@keyframes sun-breathe { from { opacity: 0.85; transform: scale(1); } to { opacity: 1; transform: scale(1.06); } }
body.warping .sun-leak { opacity: 0; transition: opacity 0.6s; }
.is-mobile .sun-leak::before { width: 90%; right: -40%; top: -28%; }
/* boarding: the hangar with Earth and the docked ship behind the pass */
.boarding {
  background:
    radial-gradient(ellipse 70% 55% at 50% 45%, rgba(1, 4, 9, 0.55), rgba(1, 4, 9, 0.15) 80%),
    linear-gradient(180deg, rgba(1, 4, 9, 0.35), transparent 30%, transparent 65%, rgba(1, 4, 9, 0.8)),
    url("../assets/boarding_desktop.webp") center / cover no-repeat,
    var(--bg);
}
@media (orientation: portrait) {
  .boarding {
    background:
      linear-gradient(180deg, rgba(1, 4, 9, 0.25), rgba(1, 4, 9, 0.45) 30%, rgba(1, 4, 9, 0.55) 60%, rgba(1, 4, 9, 0.85)),
      url("../assets/boarding_mobile.webp") center / cover no-repeat,
      var(--bg);
  }
}
.pass { backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 40%), linear-gradient(160deg, rgba(10, 34, 44, 0.78), rgba(4, 12, 19, 0.86)); }
.pass-grid b { white-space: nowrap; font-size: 0.95rem; }
.nudge { position: absolute; right: 1.2em; top: 1.2em; width: min(22em, calc(100% - 2.4em)); padding: 0.9em 1em; border-color: rgba(255, 209, 102, 0.45); animation: card-in 0.5s ease; }
.nudge p { margin: 0 0 0.7em; font-size: 0.92em; line-height: 1.45; }
.nudge b { color: var(--gold); }
.nudge-actions { display: flex; gap: 0.8em; align-items: center; }
.nudge .cta { padding: 0.65em 1em; font-size: 0.92em; }
.is-mobile .nudge { left: 0.7em; right: 0.7em; top: 1.7em; width: auto; }
body.card-open .nudge { display: none; }
