/* ---------- 1. Colours and fonts (change them here, they update everywhere) ---------- */
:root {
  --space: #05061a;
  --navy: #0b1030;
  --violet: #8b5cf6;
  --violet-soft: #a78bfa;
  --cyan: #22d3ee;
  --text: #e8ecff;
  --muted: #9aa3cf;
  --line: rgba(167, 139, 250, 0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(139, 92, 246, 0.25), transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(34, 211, 238, 0.14), transparent 50%),
    linear-gradient(180deg, var(--navy), var(--space) 70%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- 2. Background: stars and planets ---------- */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation: twinkle var(--t, 4s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.95; }
}

.planet { transition: opacity 0.8s; position: fixed; border-radius: 50%; z-index: 0; pointer-events: none; }

.planet-violet {
  width: 340px; height: 340px; right: -120px; top: 14%;
  background: radial-gradient(circle at 30% 30%, #c4b5fd, #6d28d9 45%, #1e1145 100%);
  box-shadow: 0 0 80px rgba(139, 92, 246, 0.35);
  opacity: 0.55;
  animation: float 14s ease-in-out infinite;
}

.planet-cyan {
  width: 150px; height: 150px; left: -50px; bottom: 8%;
  background: radial-gradient(circle at 35% 30%, #a5f3fc, #0e7490 50%, #082f49 100%);
  box-shadow: 0 0 50px rgba(34, 211, 238, 0.3);
  opacity: 0.5;
  animation: float 11s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-18px); }
}

/* ---------- 3. Top bar and logo ---------- */
.topbar, .layout { position: relative; z-index: 1; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1100px; margin: 0 auto; padding: 24px 24px 0;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.logo { width: 44px; height: 44px; filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5)); }

.wordmark {
  font-size: 1.9rem; font-weight: 700; letter-spacing: 0.22em;
  background: linear-gradient(90deg, var(--cyan), var(--violet-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}


/* ---------- 4. Page layout: two columns on wide screens ---------- */
.layout {
  max-width: 1100px; margin: 0 auto; padding: 48px 24px 80px;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px;
}

h1 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.12; letter-spacing: -0.01em; }
.intro { margin: 20px 0 32px; max-width: 46ch; color: var(--muted); font-size: 1.1rem; }

/* ---------- 5. Play button ---------- */
.play-button {
  font: inherit; font-size: 1.2rem; font-weight: 700; color: #04122b;
  padding: 16px 40px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--cyan), var(--violet-soft));
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.4), 0 0 60px rgba(139, 92, 246, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.play-button:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 0 40px rgba(34, 211, 238, 0.6), 0 0 80px rgba(139, 92, 246, 0.4); }
.play-button:active { transform: scale(0.98); }
.play-button:focus-visible, .brand:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.toast { min-height: 1.6em; margin-top: 14px; color: var(--cyan); font-size: 0.95rem; }

/* ---------- 6. Today's quiz and streak ---------- */
.info { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }

.info-block {
  padding: 20px 22px; border-radius: 18px;
  background: rgba(11, 16, 48, 0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

h2 { font-size: 1.05rem; color: var(--violet-soft); margin-bottom: 8px; }
.info-date { font-weight: 700; margin-bottom: 8px; }
.info ul { list-style: none; color: var(--muted); font-size: 0.95rem; }
.info li + li { margin-top: 2px; }
.countdown { margin-top: 14px; font-size: 0.95rem; color: var(--muted); }
.countdown strong { color: var(--cyan); font-variant-numeric: tabular-nums; }

.streak-number { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.streak-number span { color: var(--cyan); }
.streak-dots { display: flex; gap: 8px; margin: 14px 0; }
.streak-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.streak-dots .today { border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.small { color: var(--muted); font-size: 0.9rem; }

/* ---------- 7. The journey: a glowing route with a stop for each place ---------- */
.right h2 { font-size: 1.3rem; margin-bottom: 22px; }

.journey { list-style: none; position: relative; padding-left: 34px; }

.journey::before {            /* the vertical route line */
  content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet) 45%, rgba(139, 92, 246, 0.15));
}

.stage { position: relative; padding-bottom: 26px; }
.stage h3 { font-size: 1.05rem; }
.stage p { color: var(--muted); font-size: 0.92rem; max-width: 40ch; }

.node {
  position: absolute; left: -34px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--space); border: 2px solid var(--violet);
}

.stage.current .node { background: var(--cyan); border-color: var(--cyan); animation: pulse 2s ease-in-out infinite; }
.stage.locked { opacity: 0.55; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6); }
  50%      { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); }
}

/* ---------- 8. Small screens (phones) ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 40px; }
  .info { grid-template-columns: 1fr; }
}

/* Respect people who turn animations off in their device settings */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 9. Switching between screens ---------- */
.in-quiz .planet { opacity: 0; }            /* planets fade out while you are in the quiz */

.screen-in  { animation: screenIn 0.6s ease backwards; }   /* backwards (Stage 16a): once finished it holds no transform, so the fixed banner inside the quiz screen stays on the visible screen */
.screen-out { animation: screenOut 0.35s ease both; }

@keyframes screenIn  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes screenOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px); } }

/* ---------- 10. Quiz screen ---------- */
.quiz { position: relative; z-index: 1; min-height: calc(100vh - 80px); }

/* Earth seen from orbit: a huge dark circle, mostly below the screen, so only its curved edge shows */
.earth {
  position: fixed; z-index: 0; pointer-events: none;
  width: 170vw; height: 170vw; left: -35vw;
  bottom: calc(-170vw + clamp(120px, 17vw, 280px));
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, #38bdf8 0%, #1d4ed8 7%, #0b2a6b 22%, #050d2b 55%);
  box-shadow: 0 -4px 8px rgba(186, 230, 253, 0.9), 0 -14px 40px rgba(56, 189, 248, 0.55), 0 -40px 120px rgba(99, 102, 241, 0.35);
}

.quiz-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 40px 24px 220px; }

.quiz-top { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }

.back-button {
  font: inherit; font-size: 0.95rem; color: var(--text); cursor: pointer;
  padding: 8px 18px; border-radius: 999px; background: rgba(11, 16, 48, 0.6);
  border: 1px solid var(--line); transition: border-color 0.2s, box-shadow 0.2s;
}
.back-button:hover { border-color: var(--cyan); box-shadow: 0 0 14px rgba(34, 211, 238, 0.35); }
.back-button:focus-visible, .answer:focus-visible, .continue-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.location { display: flex; align-items: center; gap: 10px; color: var(--cyan); font-size: 0.95rem; }
.location-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); animation: pulse 2s ease-in-out infinite; }

.progress-area { margin-top: 36px; }
.counter { color: var(--muted); font-size: 0.95rem; margin-bottom: 8px; }
.progress { height: 8px; border-radius: 999px; background: rgba(167, 139, 250, 0.18); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet-soft));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  transition: width 0.8s ease;
}

.question { margin: 36px 0 28px; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; outline: none; text-shadow: 0 2px 20px rgba(5, 6, 26, 0.9); }

.answers { display: grid; gap: 14px; }

.answer {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  font: inherit; font-size: 1.1rem; color: var(--text); cursor: pointer;
  padding: 16px 20px; border-radius: 16px;
  background: rgba(11, 16, 48, 0.72); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  animation: screenIn 0.5s ease both;          /* each answer slides in, one after another */
}
.answer:hover:not(:disabled) { transform: translateX(6px); border-color: var(--cyan); box-shadow: 0 0 20px rgba(34, 211, 238, 0.3); }

.answer-letter {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  color: var(--cyan); border: 2px solid var(--line);
}

.answer:disabled { cursor: default; }
.answer.correct { border-color: #34d399; background: rgba(52, 211, 153, 0.16); box-shadow: 0 0 26px rgba(52, 211, 153, 0.4); animation: pop 0.5s ease; }
.answer.correct .answer-letter { background: #34d399; border-color: #34d399; color: #04122b; }
.answer.wrong { border-color: #fb7185; background: rgba(251, 113, 133, 0.14); animation: shake 0.4s ease; }
.answer.wrong .answer-letter { background: #fb7185; border-color: #fb7185; color: #04122b; }
.answer.faded { opacity: 0.45; }

@keyframes pop   { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.feedback {
  margin-top: 24px; padding: 18px 22px; border-radius: 16px;
  background: rgba(11, 16, 48, 0.8); border: 1px solid var(--line);
  animation: screenIn 0.5s ease both;
}
.feedback[hidden] { display: none; }
.feedback-title { font-weight: 700; margin-bottom: 4px; }

.continue-button {
  font: inherit; margin-top: 14px; padding: 10px 22px; border-radius: 999px; cursor: pointer;
  color: #04122b; font-weight: 700; border: 0;
  background: linear-gradient(90deg, var(--cyan), var(--violet-soft));
  transition: transform 0.2s;
}
.continue-button:hover { transform: translateY(-2px); }

/* ---------- 11. Journey panel on the quiz screen ---------- */
.journey-panel {
  margin-top: 22px; padding: 16px 20px 14px; border-radius: 18px;
  background: rgba(11, 16, 48, 0.62); border: 1px solid var(--line); backdrop-filter: blur(6px);
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-label { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 2px; }
.stat-value { font-size: 1rem; }
#current-location { color: var(--cyan); }
.flash { animation: flash 0.9s ease; }
@keyframes flash { 0% { text-shadow: 0 0 0 transparent; } 30% { text-shadow: 0 0 18px var(--cyan); transform: scale(1.06); } 100% { text-shadow: 0 0 0 transparent; transform: none; } }

/* The mini timeline: eleven dots joined by a line that fills as you progress */
.mini-journey {
  --ratio: 0; list-style: none; position: relative; display: flex; justify-content: space-between;
  margin: 18px 4px 10px;
}
.mini-journey::before, .mini-journey::after {
  content: ""; position: absolute; top: 6px; left: 7px; height: 2px; border-radius: 2px;
}
.mini-journey::before { right: 7px; background: rgba(167, 139, 250, 0.25); }
.mini-journey::after {
  width: calc((100% - 14px) * var(--ratio));
  background: linear-gradient(90deg, var(--cyan), var(--violet-soft));
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
  transition: width 0.9s ease;
}

.dot {
  position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%;
  background: var(--space); border: 2px solid var(--violet);
}
.dot.done { background: var(--cyan); border-color: var(--cyan); }
.dot.current { background: var(--cyan); border-color: #fff; animation: pulse 2s ease-in-out infinite; }
.dot.arrive { animation: arrive 0.8s ease; }
@keyframes arrive { 0% { transform: scale(0.6); } 50% { transform: scale(1.9); } 100% { transform: scale(1); } }

.journey-note { color: var(--muted); font-size: 0.8rem; }

/* Arrival card (correct answers) and stay note (wrong answers) */
.arrival {
  margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.5); background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18);
}
.arrival[hidden], .stay-note[hidden] { display: none; }
.arrival-label { color: var(--cyan); font-size: 0.8rem; }
.arrival-name { font-size: 1.25rem; font-weight: 700; margin: 2px 0 4px; }
.arrival-measure { color: var(--muted); font-size: 0.88rem; margin-bottom: 6px; }
.arrival-fact { font-size: 0.95rem; }
.stay-note { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .dot { width: 11px; height: 11px; }
  .mini-journey::before, .mini-journey::after { top: 4.5px; left: 5.5px; }
  .mini-journey::before { right: 5.5px; }
  .mini-journey::after { width: calc((100% - 11px) * var(--ratio)); }
}

/* ---------- 12. Animated space (canvas) and cinematic travel ---------- */
#space-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.quiz .earth { display: none; }                         /* the canvas now draws Earth */
#stars { transition: opacity 0.8s; }
.in-quiz #stars { opacity: 0; }

.quiz-inner { transition: opacity 0.7s; }
.quiz-inner.cinematic { opacity: 0; pointer-events: none; }   /* the question fades away while you travel */

.arrival-banner[hidden] { display: none; }

.arrival-banner {
  position: fixed; inset: 0; z-index: 5; display: grid; place-content: center; text-align: center;
  pointer-events: none; animation: bannerIn 2.2s ease both;
}
.banner-label { color: var(--cyan); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.9rem; }
.banner-name { font-size: clamp(2.2rem, 7vw, 4.4rem); font-weight: 700; text-shadow: 0 0 30px rgba(34, 211, 238, 0.7), 0 0 80px rgba(139, 92, 246, 0.6); }
@keyframes bannerIn {
  0% { opacity: 0; transform: scale(0.9); } 18% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); }
}

/* The journey scale becomes a small secondary indicator */
.journey-panel { padding: 10px 14px; margin-top: 14px; }
.journey-note { display: none; }
.stat-label { font-size: 0.7rem; }
.stat-value { font-size: 0.9rem; }
.mini-journey { margin: 12px 4px 4px; }

/* =====================================================================
   13. PIXEL-ART THEME (Stage 4): fonts, square corners, notched borders
   ===================================================================== */

/* The old smooth backgrounds are replaced by the pixel canvas */
#stars, .planet, .quiz .earth { display: none; }
#game-canvas { position: fixed; top: 0; left: 0; z-index: 0; image-rendering: pixelated; }

body { font-family: "VT323", "Courier New", monospace; font-size: 1.35rem; line-height: 1.2; }
h1, h2, h3, .wordmark, .play-button, .stat-label, .stat-value, .counter, .arrival-label, .arrival-name,
.banner-label, .banner-name, .back-button, .continue-button, .streak-number, .answer-letter { font-family: "Press Start 2P", monospace; }

.logo { width: 44px; height: 44px; image-rendering: pixelated; filter: none; }
.wordmark { font-size: 1.5rem; letter-spacing: 0.1em; }
h1 { font-size: clamp(1rem, 2.6vw, 1.7rem); line-height: 1.55; letter-spacing: 0; text-shadow: 3px 3px 0 #1c1458; }
.intro { font-size: 1.5rem; line-height: 1.15; }
h2 { font-size: 0.75rem; line-height: 1.5; }
h3 { font-size: 0.7rem; line-height: 1.5; }
.info-date { font-size: 1.5rem; font-weight: 400; }
.info ul, .stage p, .small, .countdown, .arrival-fact, .arrival-measure, .stay-note, .toast { font-size: 1.3rem; }
.countdown strong { font-family: "Press Start 2P", monospace; font-size: 0.8rem; font-weight: 400; }
.streak-number { font-size: 1.3rem; font-weight: 400; }

/* Notched pixel borders: four hard-edged shadows make a border with chopped corners.
   Each component sets --edge to choose its border colour. */
.info-block, .journey-panel, .feedback, .arrival, .answer, .back-button, .continue-button, .progress {
  --edge: #3a2f8c; border: 0 !important; border-radius: 0 !important; backdrop-filter: none;
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge) !important;
}
.info-block, .journey-panel, .feedback { background: rgba(8, 10, 40, 0.86); }
.arrival { --edge: var(--cyan); background: rgba(8, 40, 70, 0.9); }
.answer { background: rgba(8, 10, 40, 0.9); font-size: 1.6rem; }
.answer:hover:not(:disabled) { --edge: var(--cyan); transform: translateX(6px); }
.answer.correct { --edge: #34d399; background: rgba(8, 70, 50, 0.92); }
.answer.wrong { --edge: #fb7185; background: rgba(80, 14, 34, 0.92); }
.answer-letter { border-radius: 0; width: 34px; height: 34px; font-size: 0.8rem; border: 0; background: #1c1458; }
.back-button, .continue-button { background: #1c1458; color: var(--text); font-size: 0.65rem; padding: 12px 16px; margin: 4px; }
.continue-button { background: var(--cyan); color: #04122b; --edge: #a5f3fc; }
.back-button:hover { --edge: var(--cyan); }
.progress, .progress-fill, .dot, .node, .streak-dots span, .location-dot { border-radius: 0 !important; }
.progress { height: 14px; background: #0c0a30; }
.progress-fill { box-shadow: none; background: repeating-linear-gradient(90deg, var(--cyan) 0 8px, #1fa5c8 8px 10px); }
.dot, .streak-dots span { width: 12px; height: 12px; }
.counter { font-size: 0.65rem; }
.stat-label { font-size: 0.5rem; line-height: 1.5; } .stat-value { font-size: 0.6rem; line-height: 1.5; }
.question { font-family: "VT323", monospace; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.05; text-shadow: 3px 3px 0 #05061a; }
.location { font-size: 1.3rem; }

/* The big start button */
.play-button {
  --edge: #a5f3fc; border-radius: 0; font-size: 0.95rem; padding: 20px 26px; color: #04122b; background: var(--cyan);
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge), 0 12px 0 0 #3b1d8a;
  animation: blink 1.6s steps(2) infinite;
}
.play-button:hover { transform: translateY(-3px); background: #67e8f9; }
.play-button:active { transform: translateY(4px); }
@keyframes blink { 50% { background: #6fd9ee; } }

/* Journey list on the homepage: compact, square nodes, only the current stop shows its description */
.right { align-self: end; }
.stage p { display: none; } .stage.current p { display: block; }
.stage { padding-bottom: 14px; }
.journey::before { width: 4px; left: 7px; background: repeating-linear-gradient(180deg, var(--cyan) 0 6px, transparent 6px 10px); }
.node { width: 16px; height: 16px; left: -34px; }
.layout { align-items: start; }
.arrival-banner .banner-name { font-size: clamp(1.2rem, 4.4vw, 2.6rem); line-height: 1.4; text-shadow: 4px 4px 0 #1c1458; }

@media (max-width: 820px) { .layout { padding-top: 150px; } }

/* ---------- 14. Arrival message with a fact (Stage 4 fix) ---------- */
.arrival-banner { animation-duration: 3.2s; padding: 0 24px; }
.banner-fact { max-width: 34ch; margin: 18px auto 0; font-size: 1.5rem; line-height: 1.15; text-shadow: 2px 2px 0 #05061a; }

/* ---------- 15. Stage 4 flow: next-destination card and the Continue button ---------- */
.continue-button[hidden] { display: none; }
.continue-button { display: inline-flex; align-items: center; gap: 12px; font-size: 0.8rem; padding: 14px 22px; margin-top: 16px; }
.continue-button::after {                       /* a little pixel arrow that nudges forward */
  content: ""; width: 0; height: 0; border-left: 10px solid #04122b; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  animation: nudge 0.9s steps(2) infinite;
}
@keyframes nudge { 50% { transform: translateX(4px); } }

.arrival { padding: 16px 20px; margin-top: 18px; }
.arrival-label { font-family: "Press Start 2P", monospace; font-size: 0.55rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.arrival-name { font-size: 0.9rem; font-weight: 400; text-transform: uppercase; line-height: 1.5; margin: 8px 0 12px; }
.arrival-distance {
  font-family: "Press Start 2P", monospace; font-size: clamp(1rem, 3.8vw, 1.7rem); line-height: 1.3; color: #fff; margin-bottom: 10px;
  text-shadow: 3px 3px 0 #1c1458, 0 0 14px rgba(34, 211, 238, 0.7);
}
.arrival-measure { font-size: 1.4rem; line-height: 1.1; color: var(--text); margin-bottom: 6px; }
.arrival-fact { font-size: 1.2rem; line-height: 1.1; color: var(--muted); }

/* ---------- 16. Stage 15: the perfect-score finale (achievement screen at the Andromeda Galaxy) ---------- */
/* It sits outside the quiz screen, so "fixed" really means "on the visible screen". It never hides itself:
   only the "Return to Home" button closes it. Wide screens: a card on the left, the galaxy on the right.
   Tall phone screens: the galaxy at the top, the card at the bottom. */
.finale[hidden] { display: none; }
.finale {
  position: fixed; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: flex-start;
  padding: 96px 4vw 32px; pointer-events: none; overflow-y: auto;
}
.finale-card {
  --edge: #c4a8ff; pointer-events: auto; width: min(38vw, 460px); padding: 24px 26px 26px;
  background: rgba(8, 8, 34, 0.88);
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge), 0 0 40px rgba(196, 168, 255, 0.25);
  animation: finaleIn 1.6s ease both;
}
@keyframes finaleIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.finale-place { font-size: 1.2rem; color: var(--muted); margin: 0 0 14px; }
.finale-title {
  font-family: "Press Start 2P", monospace; font-size: clamp(1rem, 2.3vw, 1.6rem); line-height: 1.45; text-transform: uppercase;
  color: #ffe9b0; margin: 0 0 10px; text-shadow: 3px 3px 0 #3b1d8a, 0 0 18px rgba(255, 214, 140, 0.55);
}
.finale-sub { font-family: "Press Start 2P", monospace; font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cyan); margin: 0 0 18px; }
.finale-score {
  font-family: "Press Start 2P", monospace; font-size: 0.75rem; line-height: 1.6; text-transform: uppercase; color: #fff;
  display: inline-block; padding: 8px 12px; background: #1c1458; margin: 0 0 16px;
}
.finale-message { font-size: 1.4rem; line-height: 1.15; margin: 0 0 20px; }
.finale-home {
  --edge: #a5f3fc; font-family: "Press Start 2P", monospace; font-size: 0.8rem; padding: 16px 22px; margin: 4px;
  color: #04122b; background: var(--cyan); border: 0; border-radius: 0; cursor: pointer;
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge);
}
.finale-home:hover, .finale-home:focus-visible { background: #67e8f9; outline: none; --edge: #fff; }
@media (max-aspect-ratio: 10/11) {
  .finale { align-items: flex-end; justify-content: center; padding: 0 16px 4vh; }
  .finale-card { width: 100%; max-width: 520px; padding: 18px 18px 20px; }
  .finale-place { font-size: 1.05rem; margin-bottom: 10px; }
  .finale-message { font-size: 1.2rem; margin-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .finale-card { animation: none; } }

/* ---------- 17. Stage 16b: short, wide screens (landscape phones; at most 520 px tall) ---------- */
/* Only these screens: normal desktop and portrait layouts are untouched. Less vertical spacing, a slightly smaller
   question, and the four answers as a 2 x 2 grid, so the question and all four answers fit on the screen. */
@media (max-height: 520px) and (min-aspect-ratio: 10/11) {
  .in-quiz .topbar { padding-top: 8px; }
  .in-quiz .logo { width: 32px; height: 32px; }
  .in-quiz .wordmark { font-size: 1.1rem; }
  .quiz-inner { max-width: 920px; padding: 6px 20px 120px; }
  .quiz-top { gap: 6px 16px; }
  .back-button { padding: 8px 12px; }
  .location { font-size: 1.15rem; }
  .progress-area { margin-top: 8px; }
  .counter { margin-bottom: 4px; }
  .question { margin: 10px 0; font-size: 1.8rem; line-height: 1.05; }
  .answers { grid-template-columns: 1fr 1fr; gap: 12px 14px; }
  .answer { font-size: 1.3rem; line-height: 1.05; padding: 8px 12px; gap: 10px; }
  .answer-letter { width: 28px; height: 28px; font-size: 0.65rem; }
  .feedback { margin-top: 14px; padding: 12px 16px; }
  .stay-note { font-size: 1.15rem; }
  .arrival { margin-top: 10px; padding: 10px 14px; }
  .arrival-name { margin: 4px 0 6px; }
  .arrival-distance { font-size: 1.1rem; margin-bottom: 6px; }
  .arrival-measure { font-size: 1.2rem; }
  .arrival-fact { font-size: 1.1rem; }
  .continue-button { margin-top: 10px; padding: 10px 18px; }

  /* the Andromeda achievement card: kept clear of the logo, laid out more compactly (the subtitle and the score
     share one row), and centred "safely" (auto margins), so it can never be cut off at the top; if a screen is even
     shorter, the card scrolls */
  .finale { align-items: flex-start; padding: 52px 4vw 8px; }
  .finale-card { margin: auto 0; width: min(48vw, 460px); padding: 12px 18px 14px; }
  .finale-place { font-size: 1.05rem; margin-bottom: 6px; }
  .finale-title { font-size: 1rem; margin-bottom: 8px; }
  .finale-sub { display: inline-block; vertical-align: middle; font-size: 0.6rem; margin: 0 14px 10px 0; }
  .finale-score { vertical-align: middle; font-size: 0.6rem; padding: 6px 10px; margin-bottom: 10px; }
  .finale-message { font-size: 1.15rem; margin-bottom: 12px; }
  .finale-home { font-size: 0.7rem; padding: 11px 16px; }
}

/* ---------- 18. Stage 16b (mobile-first): portrait phones ---------- */
/* After a wrong answer: the correct answer, letter and text, on its own line under the title (every screen; since 22 Nov
   2026 the feedback has no explanation / fun-fact paragraph). */
.feedback-answer { color: var(--text); font-size: 1.35rem; line-height: 1.15; margin: 2px 0 0; }
.feedback-answer[hidden] { display: none; }
/* Portrait phones (up to 600 px wide; tablets and landscape keep their layouts): a tighter header so the question and
   all four answers fit, and the feedback as a BOTTOM SHEET: after an answer locks it slides up from the bottom edge (a
   moment after the green/red reveal), Continue is pinned at its bottom under the thumb, and the page never has to
   scroll. If the sheet's content is taller than its space, only the sheet scrolls; Continue stays visible. The page
   gains bottom padding so the question and answers can still be scrolled up above the sheet to review them. */
@media (max-width: 600px) and (max-aspect-ratio: 10/11) {
  .in-quiz .topbar { padding: 12px 16px 0; }
  .in-quiz .logo { width: 36px; height: 36px; }
  .in-quiz .wordmark { font-size: 1.3rem; }
  .quiz-inner { padding: 10px 16px 32px; }
  .quiz-top { gap: 8px 16px; }
  .back-button { padding: 9px 12px; }
  .location { font-size: 1.2rem; gap: 8px; }
  .progress-area { margin-top: 14px; }
  .counter { margin-bottom: 6px; }
  .question { margin: 14px 0; font-size: 1.9rem; line-height: 1.05; }
  .answers { gap: 10px; }
  .answer { font-size: 1.45rem; line-height: 1.1; padding: 11px 14px; gap: 12px; }
  .answer-letter { width: 30px; height: 30px; }

  .quiz-inner:has(#feedback:not([hidden])) { padding-bottom: 74vh; }
  .feedback {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; margin: 0;
    max-height: 72vh; max-height: 72dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 16px 18px calc(14px + env(safe-area-inset-bottom));
    background: #080924; --edge: #4b3fb0;                       /* fully opaque: no answer text ghosting through */
    box-shadow: 0 -4px 0 0 var(--edge), 0 -16px 32px rgba(3, 4, 18, 0.75) !important;
    animation: sheetUp 0.35s ease 0.25s both;
  }
  .feedback-title { margin-bottom: 4px; }
  .feedback-answer { font-size: 1.25rem; line-height: 1.1; margin: 2px 0 0; }
  .stay-note { font-size: 1.2rem; line-height: 1.12; }
  .stay-note { margin-top: 10px; }
  .arrival { margin-top: 10px; padding: 10px 14px; }
  .arrival-name { margin: 4px 0 6px; }
  .arrival-distance { font-size: 1.15rem; margin-bottom: 6px; }
  .arrival-measure { font-size: 1.2rem; line-height: 1.1; }
  .arrival-fact { font-size: 1.1rem; }
  .continue-button { position: sticky; bottom: 0; width: calc(100% - 8px); justify-content: center; margin: 12px 4px 4px; }
}
@keyframes sheetUp { from { transform: translateY(105%); } to { transform: none; } }

/* ---------- 19. Stage 16c: text readability over the scenery (the owner's choice: "option D, the hybrid") ---------- */
/* Large text that floats on the pixel art gets a crisp dark PIXEL OUTLINE (hard-edged copies of the letters, no blur),
   like classic 16-bit game text: it hides none of the scenery. Small labels (about 10 px) cannot be rescued by an
   outline over bright cloud bands, so they sit in small dark CHIPS in the same notched style as the Back button.
   No panels, no gradients. Nothing here uses transform or filter on an ancestor of the banner (see Stage 16a). */
:root {
  --ink: #05061a;                                   /* outline colour: the game's deepest navy */
  --outline-2: -2px 0 0 var(--ink), 2px 0 0 var(--ink), 0 -2px 0 var(--ink), 0 2px 0 var(--ink),
               -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink);
  --outline-3: -1.5px 0 0 var(--ink), 1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink), 0 1.5px 0 var(--ink),
               -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink),
               -3px 0 0 var(--ink), 3px 0 0 var(--ink), 0 -3px 0 var(--ink), 0 3px 0 var(--ink),
               -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink);
  --chip-edge: rgba(58, 47, 140, 0.9);
}

/* The question: a paler lavender (still violet-tinted; it used to inherit the darker heading violet #a78bfa) with a
   3 px outline and the old drop shadow underneath. */
.question { color: #e4dcff; text-shadow: var(--outline-3), 5px 5px 0 var(--ink); }

/* "Destination reached": the big destination name gets the 3 px outline (its purple drop shadow is kept); the small
   label above it sits in a chip. */
.arrival-banner .banner-name { text-shadow: var(--outline-3), 6px 6px 0 #1c1458; }

/* Small labels in chips: the location / score label and the question counter. */
.location, .counter {
  background: rgba(8, 10, 40, 0.82);
  box-shadow: 0 -2px 0 0 var(--chip-edge), 0 2px 0 0 var(--chip-edge), -2px 0 0 0 var(--chip-edge), 2px 0 0 0 var(--chip-edge);
}
.location { padding: 2px 8px; margin: 0 2px; }
.counter { width: fit-content; padding: 3px 6px; margin-left: 2px; color: #c9cff5; }      /* lighter than the old grey #9aa3cf */
/* "Destination reached" (since 22 Nov 2026 no chip): bright cyan pixel letters with a hard dark 2 px outline and a deep
   purple drop shadow, so it reads on bright planets and dark space alike without a box. */
.banner-label { justify-self: center; padding: 0; margin-bottom: 14px; background: none; box-shadow: none; color: #67e8f9; text-shadow: var(--outline-2), 3px 3px 0 #1c1458; }
@media (max-width: 480px) { .banner-label { letter-spacing: 0.12em; } }   /* one line on phones */

/* The wordmark and the homepage text: the 2 px outline. */
.wordmark { filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)); }
h1 { text-shadow: var(--outline-2), 4px 4px 0 #1c1458; }
.intro, #journey-title, .stage h3, .stage p { text-shadow: var(--outline-2); }
.intro, .stage p { color: #c9cff5; }

/* The homepage journey list: locked stops are no longer faded to 55% (that faded their outline too, so over Earth's
   bright edge they almost vanished). They are now solid but clearly "not yet reached": muted grey-violet text and a
   dim, empty node, against the current stop's white text and bright cyan node. They are not links and have no hover. */
.stage.locked { opacity: 1; }
.stage.locked h3 { color: #8a8fc0; }
.stage.locked .node { background: var(--space); border-color: #4b3fb0; }

/* Keep the phone layouts the same height: the chips add about 10 px, so the same amount of spacing is taken back. */
@media (max-width: 600px) and (max-aspect-ratio: 10/11) {
  .progress-area { margin-top: 10px; }
  .counter { margin-bottom: 7px; }
  .question { margin: 8px 0 12px; }
}
@media (max-height: 520px) and (min-aspect-ratio: 10/11) {
  .location { padding: 1px 8px; }
  .counter { padding: 2px 6px; margin-bottom: 6px; }
  .progress-area { margin-top: 6px; }
  .question { margin: 6px 0 8px; }
}

/* ---------- 20. Stage 16e: final polish ---------- */
/* "Reduce motion" now also turns off the page's smooth scrolling (html { scroll-behavior: smooth } in section 1). */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =====================================================================
   21. THE UNIVERSAL RESULTS SCREEN (every finished expedition, every score)
   A pixel-art card like the achievement screen's, over the place the expedition ended (the canvas stays behind it).
   Fixed to the visible screen; scrolls by itself if a screen is too short. Question marks: crisp pixel-art SVG.
   ===================================================================== */
.results[hidden] { display: none; }
.results {
  position: fixed; inset: 0; z-index: 8; display: flex; justify-content: center; align-items: flex-start;
  padding: 92px 16px 24px; overflow-y: auto; pointer-events: none;
}
.results-card {
  --edge: #c4a8ff; pointer-events: auto; width: min(600px, 100%); margin: auto 0; padding: 22px 24px 22px; text-align: center;
  background: rgba(8, 8, 34, 0.9);
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge), 0 0 40px rgba(196, 168, 255, 0.22);
  animation: finaleIn 0.9s ease both;
}
.results-title {                                      /* always Nebora blue: gold is kept for the perfect score */
  font-family: "Press Start 2P", monospace; font-size: clamp(0.95rem, 2.4vw, 1.35rem); line-height: 1.5; text-transform: uppercase;
  color: var(--cyan); margin: 0 0 14px; text-shadow: 3px 3px 0 #1c1458, 0 0 16px rgba(34, 211, 238, 0.35);
}
/* 10/10 only: the score and the card's edge turn gold, like the PERFECT EXPLORER achievement */
.results-card.is-perfect { --edge: #ffd98a; box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge), 0 0 40px rgba(255, 214, 140, 0.3); }
.results-card.is-perfect #results-score { color: #ffe9b0; text-shadow: 4px 4px 0 #3b1d8a, 0 0 18px rgba(255, 214, 140, 0.55); }
.results-score { margin: 0 0 14px; display: flex; justify-content: center; align-items: baseline; gap: 12px; }
#results-score { font-family: "Press Start 2P", monospace; font-size: clamp(2rem, 7vw, 2.9rem); line-height: 1; color: #fff; text-shadow: 4px 4px 0 #1c1458; }
.results-score-label { font-family: "Press Start 2P", monospace; font-size: 0.62rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.12em; }
.results-dest-label { font-family: "Press Start 2P", monospace; font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan); margin: 0 0 6px; }
.results-dest { font-family: "Press Start 2P", monospace; font-size: clamp(0.8rem, 2.6vw, 1.05rem); line-height: 1.5; color: #fff; margin: 0 0 18px; }
.results-grid { list-style: none; margin: 0 auto 18px; padding: 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; max-width: 520px; }
.results-q { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 5px; background: rgba(28, 20, 88, 0.85); }
.results-q.is-right { box-shadow: inset 0 -3px 0 0 #22a35b; }
.results-q.is-wrong { box-shadow: inset 0 -3px 0 0 #b8354f; }
.results-q-num { font-family: "Press Start 2P", monospace; font-size: 0.5rem; color: var(--muted); }
.results-q-mark { display: block; width: 33px; height: 33px; image-rendering: pixelated; }
.results-anecdote { font-size: 1.35rem; line-height: 1.15; margin: 0 0 20px; color: var(--text); }
.results-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 18px; }
.results-share, .results-home {
  font-family: "Press Start 2P", monospace; font-size: 0.72rem; padding: 15px 20px; margin: 4px; border: 0; border-radius: 0; cursor: pointer;
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge);
}
.results-share { --edge: #a5f3fc; color: #04122b; background: var(--cyan); }
.results-share:hover, .results-share:focus-visible { background: #67e8f9; outline: none; --edge: #fff; }
.results-home { --edge: #3a2f8c; color: var(--text); background: #1c1458; }
.results-home:hover, .results-home:focus-visible { outline: none; --edge: var(--cyan); }
/* the small notice after copying: a pixel chip that pops in (empty: takes no room) */
.results-status { margin: 0; font-size: 1.15rem; color: var(--cyan); }
.results-status.is-on {
  --edge: #22d3ee; display: inline-block; margin: 16px 0 0; padding: 6px 14px; background: rgba(8, 40, 70, 0.95);
  box-shadow: 0 -2px 0 0 var(--edge), 0 2px 0 0 var(--edge), -2px 0 0 0 var(--edge), 2px 0 0 0 var(--edge);
  animation: statusIn 0.3s ease both;
}
@keyframes statusIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .results-status.is-on { animation: none; } }
/* phones: five questions per row, a little tighter */
@media (max-width: 520px) {
  .results { padding: 76px 12px 16px; }
  .results-card { padding: 18px 14px 18px; }
  .results-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 300px; }
  .results-q-mark { width: 30px; height: 30px; }
  .results-anecdote { font-size: 1.2rem; margin-bottom: 16px; }
  .results-share, .results-home { font-size: 0.64rem; padding: 13px 14px; }
}
/* short, wide screens (landscape phones): kept compact so it fits, and it scrolls if needed */
@media (max-height: 520px) and (min-aspect-ratio: 10/11) {
  .results { padding: 52px 4vw 8px; }
  .results-card { padding: 12px 18px 14px; width: min(640px, 100%); }
  .results-title { margin-bottom: 8px; }
  .results-score { margin-bottom: 6px; }
  #results-score { font-size: 1.6rem; }
  .results-dest { margin-bottom: 10px; }
  .results-grid { margin-bottom: 10px; }
  .results-q { padding: 4px 0 3px; }
  .results-q-mark { width: 24px; height: 24px; }
  .results-anecdote { font-size: 1.1rem; margin-bottom: 10px; }
  .results-share, .results-home { font-size: 0.62rem; padding: 11px 14px; }
}
@media (prefers-reduced-motion: reduce) { .results-card { animation: none; } }

/* =====================================================================
   22. READING TYPOGRAPHY, THE QUESTION'S FACT, AND THE DESTINATION ROW (28 Nov 2026)
   Text that players READ (the question, the answers, the feedback, the educational fact, the destination name and
   distance, and paragraphs elsewhere) uses the device's own clean sans-serif font: nothing is downloaded. The pixel font
   Press Start 2P stays where it is part of the look: the wordmark, headings, small labels such as "NEXT DESTINATION",
   the question counter, buttons, answer letters, the arrival banner, the finale and the results score.
   VT323 is no longer used for reading text. These rules come last, so they replace the older sizes above.
   ===================================================================== */
:root { --read: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }

body { font-family: var(--read); font-size: 1rem; line-height: 1.45; }

/* Homepage paragraphs. Over the bright launch-site sky the 2 px pixel outline (made for the pixel font) smudges thin
   sans-serif letters, so reading text on the scenery gets a crisp 1 px outline, a hard 2 px drop shadow, and a slightly
   bolder weight instead (still no blur). */
:root { --outline-read: -1px 0 0 var(--ink), 1px 0 0 var(--ink), 0 -1px 0 var(--ink), 0 1px 0 var(--ink),
                        -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink), 1px 1px 0 var(--ink), 2px 2px 0 var(--ink); }
.intro, .stage p { font-weight: 600; text-shadow: var(--outline-read); }
.intro { font-size: 1.08rem; line-height: 1.5; }
.info-date { font-size: 1rem; font-weight: 600; }
.info ul, .stage p, .small, .countdown, .toast { font-size: 0.95rem; line-height: 1.45; }

/* The quiz: location chip, question and answers */
.location { font-size: 0.92rem; font-weight: 600; line-height: 1.6; }
.question {
  font-family: var(--read); font-weight: 700; font-size: clamp(1.3rem, 0.95rem + 1vw, 1.7rem); line-height: 1.3;
  letter-spacing: -0.005em; text-shadow: var(--outline-2), 3px 3px 0 var(--ink);
}
.answer { font-size: 1.08rem; line-height: 1.35; font-weight: 500; }

/* The feedback: the result, the correct answer (after a wrong answer), the question's fact, and "you stay at" */
.feedback-title { font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.feedback-answer { font-size: 1.02rem; font-weight: 600; line-height: 1.4; margin: 4px 0 0; }
.feedback-fact { margin: 10px 0 0; font-size: 1rem; line-height: 1.5; color: #d9ddf7; }
.feedback-fact[hidden], .arrival-fact[hidden] { display: none; }
.stay-note { font-size: 0.95rem; line-height: 1.45; }

/* The next-destination card: the name and the distance share ONE row (the distance smaller and lighter); the question's
   fact sits underneath. Each keeps its words together; only if a screen were too narrow for both would the distance
   move, whole, to the next line. */
.arrival-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin: 8px 0 0; }
.arrival-name {
  font-family: var(--read); font-size: 1.35rem; font-weight: 700; line-height: 1.25; text-transform: none;
  margin: 0; color: #fff; white-space: nowrap;
}
.arrival-distance {
  font-family: var(--read); font-size: 1rem; font-weight: 600; line-height: 1.25; margin: 0; color: #9fe7f5;
  text-shadow: none; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.arrival-fact { margin: 10px 0 0; font-size: 1rem; line-height: 1.5; color: var(--text); }

/* Other reading text: the arrival banner's fact, the finale and the results screen */
.banner-fact { font-size: 1.1rem; line-height: 1.45; }
.finale-place { font-size: 0.95rem; line-height: 1.45; }
.finale-message { font-size: 1.02rem; line-height: 1.5; }
.results-anecdote { font-size: 1rem; line-height: 1.5; }
.results-status { font-size: 0.95rem; }

/* Laptop-height screens (wide, 521 to 860 px tall, such as 1366 x 768): a little less empty space above and between
   things, so a long question and all four answers fit on the screen. The text itself keeps its size. */
@media (min-aspect-ratio: 10/11) and (min-height: 521px) and (max-height: 860px) {
  .quiz-inner { padding-top: 16px; }
  .progress-area { margin-top: 18px; }
  .question { margin: 18px 0 18px; font-size: clamp(1.3rem, 0.9rem + 0.9vw, 1.6rem); }
  .answers { gap: 12px; }
  .answer { padding: 11px 18px; }
  .feedback { margin-top: 18px; }
}

/* Portrait phones (the bottom-sheet layout) */
@media (max-width: 600px) and (max-aspect-ratio: 10/11) {
  .location { font-size: 0.85rem; }
  .question { font-size: 1.2rem; line-height: 1.28; margin: 8px 0 12px; }
  .answer { font-size: 1rem; line-height: 1.3; padding: 10px 12px; }
  .feedback-title { font-size: 1.02rem; }
  .feedback-answer { font-size: 0.98rem; }
  .feedback-fact, .arrival-fact { font-size: 0.95rem; line-height: 1.45; margin-top: 8px; }
  .stay-note { font-size: 0.9rem; line-height: 1.4; }
  .arrival-row { margin-top: 6px; gap: 2px 12px; }
  .arrival-name { font-size: 1.15rem; }
  .arrival-distance { font-size: 0.9rem; }
  .finale-place { font-size: 0.9rem; }
  .finale-message { font-size: 0.98rem; }
  .results-anecdote { font-size: 0.95rem; }
}
/* Small phones (up to 374 px wide, such as 320 x 568) and short portrait screens (up to 600 px tall, such as an
   iPhone SE in Safari, 375 x 548 with the toolbars): slightly tighter, so the longest destination name and its distance
   still share one row and a long question and all four answers fit */
@media (max-width: 374px) and (max-aspect-ratio: 10/11), (max-width: 600px) and (max-height: 600px) and (max-aspect-ratio: 10/11) {
  .in-quiz .topbar { padding-top: 8px; }
  .in-quiz .logo { width: 30px; height: 30px; }
  .in-quiz .wordmark { font-size: 1.15rem; }
  .quiz-top { gap: 6px 12px; }
  .quiz-inner { padding-top: 6px; }
  .progress-area { margin-top: 6px; }
  .question { font-size: 1.1rem; line-height: 1.25; margin: 6px 0 10px; }
  .answers { gap: 8px; }
  .answer { font-size: 0.95rem; padding: 8px 10px; gap: 10px; }
  .answer-letter { width: 26px; height: 26px; font-size: 0.7rem; }
  .arrival-name { font-size: 1.05rem; }
  .arrival-distance { font-size: 0.84rem; }
  .arrival-row { gap: 2px 10px; }
}

/* Short, wide screens (landscape phones) */
@media (max-height: 520px) and (min-aspect-ratio: 10/11) {
  .location { font-size: 0.85rem; }
  .question { font-size: 1.12rem; line-height: 1.25; }
  .answer { font-size: 0.95rem; line-height: 1.25; }
  .feedback-title { font-size: 1rem; }
  .feedback-answer { font-size: 0.95rem; }
  .feedback-fact, .arrival-fact { font-size: 0.92rem; line-height: 1.4; margin-top: 6px; }
  .stay-note { font-size: 0.88rem; }
  .arrival-row { margin-top: 4px; }
  .arrival-name { font-size: 1.05rem; }
  .arrival-distance { font-size: 0.85rem; }
  .finale-place { font-size: 0.88rem; }
  .finale-message { font-size: 0.95rem; }
  .results-anecdote { font-size: 0.92rem; }
}

/* =====================================================================
   23. TODAY'S RESULT ON THE HOMEPAGE (4.42)
   Shown only when today's expedition is completed, where the Start button would be. The same notched pixel panel as
   "Today's quiz" and "Your streak"; the label and the score in the pixel font, the rest in the reading font (section 22).
   10/10 turns the score and the edge gold, like the results screen.
   ===================================================================== */
.home-score[hidden] { display: none; }
.home-score {
  --edge: #3a2f8c; max-width: 460px; margin: 0 4px 8px; padding: 16px 20px 18px; background: rgba(8, 10, 40, 0.86);
  box-shadow: 0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge);
}
.home-score.is-perfect { --edge: #ffd98a; }
.home-score-label { font-family: "Press Start 2P", monospace; font-size: 0.55rem; line-height: 1.6; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); margin: 0 0 10px; }
.home-score-line { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; }
.home-score-value { font-family: "Press Start 2P", monospace; font-size: 1.7rem; line-height: 1; color: #fff; text-shadow: 3px 3px 0 #1c1458; }
.home-score.is-perfect .home-score-value { color: #ffe9b0; text-shadow: 3px 3px 0 #3b1d8a, 0 0 14px rgba(255, 214, 140, 0.5); }
.home-score-of { font-family: "Press Start 2P", monospace; font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.home-score-dest { font-size: 1rem; line-height: 1.4; margin: 0 0 6px; color: var(--muted); }
.home-score-dest strong { color: #fff; font-weight: 700; }
.home-score-note { font-size: 0.95rem; line-height: 1.5; color: var(--text); margin: 0; }
@media (max-width: 600px) and (max-aspect-ratio: 10/11) {
  .home-score { padding: 14px 16px 16px; }
  .home-score-value { font-size: 1.45rem; }
  .home-score-note { font-size: 0.92rem; }
}
@media (max-height: 520px) and (min-aspect-ratio: 10/11) {
  .home-score { padding: 10px 14px 12px; }
  .home-score-value { font-size: 1.2rem; }
  .home-score-line { margin-bottom: 6px; }
  .home-score-note { font-size: 0.88rem; line-height: 1.4; }
}

/* =====================================================================
   24. THE SOUND BUTTON AND THE PHONE LOGO POSITION (4.43)
   The speaker button sits in the top bar: at its right end on wide screens, and on portrait phones just left of the
   logo, which moves to the top-right corner there (on the phone homepage the logo sat on the Sun). It is a small
   notched chip like the Back button; lit cyan when sound is on, a crossed-out speaker when off.
   ===================================================================== */
.sound-toggle[hidden] { display: none; }
.sound-toggle {
  --edge: #3a2f8c; display: grid; place-items: center; width: 40px; height: 40px; margin: -8px 4px; padding: 0;   /* the negative margin: it never makes the top bar taller */ border: 0; border-radius: 0;
  color: #9aa3cf; background: rgba(8, 10, 40, 0.86); cursor: pointer; flex: none;
  box-shadow: 0 -3px 0 0 var(--edge), 0 3px 0 0 var(--edge), -3px 0 0 0 var(--edge), 3px 0 0 0 var(--edge);
}
.sound-toggle:hover { --edge: var(--cyan); }
.sound-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sound-toggle .sound-waves { display: none; }
.sound-toggle.is-on { color: var(--cyan); --edge: #1fa5c8; }
.sound-toggle.is-on .sound-waves { display: inline; }
.sound-toggle.is-on .sound-mute { display: none; }
.sound-icon { display: block; image-rendering: pixelated; }

/* Portrait phones only: the logo and wordmark move to the top-right corner (same size and look), with the sound
   button just to their left, clear of the Sun at the top left. Desktop, tablets and landscape phones are unchanged. */
@media (max-width: 600px) and (max-aspect-ratio: 10/11) {
  .topbar { justify-content: flex-end; gap: 10px; padding-right: max(24px, env(safe-area-inset-right)); padding-left: max(24px, env(safe-area-inset-left)); }
  .sound-toggle { order: -1; width: 36px; height: 36px; }
}

/* =====================================================================
   25. PORTRAIT PHONES: THE LAUNCH SITE BELOW THE LOGO (4.44)
   With the logo top-right (section 24), the launch tower stood up behind the wordmark. launch-site.js now puts the
   pad's ground row 250 screen px down on portrait phones (339 px on the rare 540-600 px wide ones, which draw at 3x),
   just clear of the logo; the homepage text moves down by the same amount, keeping its old 22 px gap below the pad.
   ===================================================================== */
@media (max-width: 600px) and (max-aspect-ratio: 10/11) { .layout { padding-top: 204px; } }
@media (min-width: 540px) and (max-width: 600px) and (max-aspect-ratio: 10/11) { .layout { padding-top: 293px; } }
