/* The Blue Dragon — the page over the world.
   Void, ivory, one blue, one gold. Logical properties everywhere: Arabic is RTL. */

@font-face { font-family: "Cormorant Garamond"; font-weight: 400; src: url(/voyage/fonts/cormorant-garamond-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; src: url(/voyage/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; src: url(/voyage/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; src: url(/voyage/fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 400; font-style: italic; src: url(/voyage/fonts/cormorant-garamond-latin-400-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; src: url(/voyage/fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Amiri"; font-weight: 400; src: url(/voyage/fonts/amiri-arabic-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Amiri"; font-weight: 700; src: url(/voyage/fonts/amiri-arabic-700-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Arabic"; font-weight: 300; src: url(/voyage/fonts/ibm-plex-sans-arabic-arabic-300-normal.woff2) format("woff2"), url(/voyage/fonts/ibm-plex-sans-arabic-latin-300-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; src: url(/voyage/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"), url(/voyage/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; src: url(/voyage/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"), url(/voyage/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; src: url(/voyage/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); font-display: swap; }

:root {
  --void: #03050c;
  --ivory: #eef2f8;
  --stone: #aeb6c8;
  --dim: #6f7890;
  --blue: #2f8dff;
  --cyan: #8fe8ff;
  --gold: #e8c480;
  --line: rgba(238, 242, 248, 0.14);
  --panel: rgba(4, 8, 20, 0.78);
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --arabic: "Amiri", "Noto Naskh Arabic", serif;
  --body: "Plex Arabic", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sa: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--void); color: var(--ivory); }
body { font-family: var(--body); font-weight: 300; font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; position: fixed; inset: 0; width: 100%; }
#gl { touch-action: none; }
.scrolls { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
body.ar { font-family: var(--body); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.ar .latin { font-family: var(--display); }

/* ───── the curtain ───── */
.curtain { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; background: radial-gradient(ellipse at 50% 70%, #071233 0%, var(--void) 60%); transition: opacity 1.4s ease, visibility 1.4s, background 1.6s; }
body.lobby .curtain { background: linear-gradient(to bottom, rgba(3, 5, 12, 0.82) 0%, rgba(3, 5, 12, 0.28) 38%, rgba(3, 5, 12, 0.3) 62%, rgba(3, 5, 12, 0.9) 100%); }
body.lobby .mark { display: none; }
.curtain-inner { text-shadow: 0 2px 24px rgba(0, 0, 0, 0.9); }
.curtain.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.curtain-inner { text-align: center; padding: calc(24px + var(--sa)) 24px calc(24px + var(--sb)); max-width: 720px; }
.mark { width: 150px; height: 150px; filter: drop-shadow(0 0 28px rgba(47, 141, 255, 0.45)); margin-bottom: 0; }
.eyebrow { font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--stone); }
.ar .eyebrow { letter-spacing: 0; font-size: 14px; }
.curtain-name { margin: 26px 0 4px; line-height: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.curtain-name .ar-name { font-family: var(--arabic); font-weight: 700; font-size: clamp(56px, 11vw, 120px); line-height: 1.5; color: #fff; text-shadow: 0 0 40px rgba(47, 141, 255, 0.35); }
.curtain-name .latin-name { font-family: var(--display); font-weight: 500; font-size: clamp(22px, 3.6vw, 36px); letter-spacing: 0.42em; margin-inline-start: 0.42em; color: var(--ivory); }
.curtain-sub { font-family: var(--display); font-size: clamp(22px, 3vw, 30px); font-weight: 500; font-style: italic; color: var(--gold); }
.ar .curtain-sub { font-family: var(--arabic); font-style: normal; }
.curtain-tag { margin-top: 6px; font-size: 15px; color: var(--stone); letter-spacing: 0.04em; }
.bismillah { font-family: var(--arabic); font-size: 30px; margin: 22px 0 18px; color: var(--ivory); direction: rtl; }
.begin { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: 0.22em; text-transform: uppercase; padding: 16px 54px; border: 1px solid rgba(238, 242, 248, 0.55); border-radius: 999px; transition: background 0.3s, color 0.3s, transform 0.3s, box-shadow 0.3s; }
.ar .begin { font-family: var(--arabic); letter-spacing: 0; font-size: 26px; text-transform: none; }
.begin:hover { background: var(--ivory); color: var(--void); box-shadow: 0 0 40px rgba(47, 141, 255, 0.35); transform: translateY(-1px); }
.begin:disabled { opacity: 0.35; cursor: default; }
.curtain-note { margin-top: 18px; font-size: 13px; color: var(--dim); }
.curtain-lang { margin-top: 10px; }
.lang-toggle { font-family: var(--arabic); font-size: 18px; color: var(--stone); padding: 6px 12px; border-bottom: 1px solid transparent; }
.ar .lang-toggle { font-family: var(--display); font-size: 17px; letter-spacing: 0.1em; }
.lang-toggle:hover { color: var(--ivory); border-bottom-color: var(--gold); }
.webgl-warn { margin-top: 16px; color: var(--gold); font-size: 14px; }

@media (max-height: 680px) {
  .mark { width: 84px; height: 84px; }
  .curtain-name .ar-name { font-size: clamp(44px, 9vw, 72px); line-height: 1.3; }
  .curtain-name .latin-name { font-size: 20px; }
  .curtain-sub { font-size: 20px; }
  .bismillah { font-size: 22px; margin: 10px 0 10px; }
  .begin { padding: 12px 40px; font-size: 18px; }
  .curtain-note { margin-top: 10px; }
}

/* ───── fade, loading ───── */
.fade { position: fixed; inset: 0; z-index: 30; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.7s ease; }
.fade.on { opacity: 1; }
.loading { position: fixed; left: 0; right: 0; bottom: calc(14px + var(--sb)); z-index: 41; display: none; text-align: center; font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); }
.loading.on { display: block; }
.ar .loading { letter-spacing: 0; font-size: 14px; }
.loading-bar { width: 220px; height: 1px; margin: 0 auto 10px; background: rgba(238, 242, 248, 0.12); }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.4s; }

/* ───── hud ───── */
.hud { position: fixed; inset-inline: 0; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: calc(14px + var(--sa)) 18px 10px; pointer-events: none; opacity: 0; transition: opacity 1s; }
body.playing .hud { opacity: 1; }
.hud > * { pointer-events: auto; }
.hud-left { display: flex; align-items: center; gap: 14px; }
.chapter { font-family: var(--display); font-size: 17px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stone); }
.ar .chapter { font-family: var(--arabic); letter-spacing: 0; font-size: 19px; text-transform: none; }
.dots { display: flex; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(238, 242, 248, 0.22); transition: background 0.5s; }
.dots i.on { background: var(--gold); }
.hud-right { display: flex; gap: 6px; }
.hud-btn { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--stone); padding: 8px 12px; border: 1px solid transparent; border-radius: 999px; transition: color 0.25s, border-color 0.25s; }
.ar .hud-btn { letter-spacing: 0; font-size: 14px; text-transform: none; }
.hud-btn:hover { color: var(--ivory); border-color: var(--line); }
.hud-btn.lang-toggle { font-family: var(--arabic); font-size: 15px; }
.ar .hud-btn.lang-toggle { font-family: var(--display); font-size: 15px; letter-spacing: 0.1em; }
.sound .sound-off, .hud.muted .sound .sound-on { display: none; }
.hud.muted .sound .sound-off { display: inline; color: var(--gold); }

/* ───── caption ───── */
.caption { position: fixed; inset-inline: 0; bottom: calc(34px + var(--sb)); z-index: 15; display: flex; justify-content: center; padding: 0 24px; pointer-events: none; }
.caption p { max-width: 62ch; text-align: center; font-family: var(--display); font-weight: 500; font-size: clamp(20px, 2.5vw, 33px); line-height: 1.35; color: var(--ivory); text-shadow: 0 2px 24px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9); opacity: 0; transform: translateY(12px); transition: opacity 0.9s ease, transform 0.9s ease; position: relative; padding-top: 16px; }
.caption p::before { content: ""; position: absolute; top: 0; left: 50%; width: 36px; height: 1px; background: var(--gold); transform: translateX(-50%); opacity: 0.8; }
.caption.show p { opacity: 1; transform: translateY(0); }
.ar .caption p { font-family: var(--arabic); font-weight: 400; font-size: clamp(23px, 2.9vw, 38px); line-height: 1.55; }
.caption p.who-cap { color: #dbeeff; }
.caption p.who-yemen { color: var(--gold); font-style: italic; }
.ar .caption p.who-yemen { font-style: normal; }
.caption p.who-name { font-size: clamp(34px, 5vw, 64px); letter-spacing: 0.3em; margin-inline-start: 0.3em; }
.ar .caption p.who-name { letter-spacing: 0; margin: 0; }

body.with-panel .caption { inset-inline-start: min(680px, 52vw); padding-inline-end: 24px; }
body.with-panel .caption p { max-width: 34ch; font-size: clamp(18px, 1.9vw, 26px); }
@media (max-width: 760px) {
  body.with-panel .caption { inset-inline: 0; top: calc(50px + var(--sa)); bottom: auto; }
  body.with-panel .caption p { font-size: 16px; padding-top: 10px; }
}

/* ───── title cards ───── */
.title-card { position: fixed; inset: 0; z-index: 16; display: grid; place-items: center; text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; padding: 0 20px; }
.title-card.show { opacity: 1; }
.title-card .t-ar { display: block; font-family: var(--arabic); font-weight: 700; font-size: clamp(54px, 10vw, 150px); line-height: 1.1; text-shadow: 0 0 60px rgba(47, 141, 255, 0.45), 0 2px 30px rgba(0, 0, 0, 0.8); }
.title-card .t-en { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(22px, 3.4vw, 44px); letter-spacing: 0.5em; margin-inline-start: 0.5em; text-transform: uppercase; color: var(--ivory); text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9); }
.title-card .t-sub { display: block; margin-top: 14px; font-size: clamp(14px, 1.6vw, 20px); color: var(--gold); letter-spacing: 0.12em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9); }
.ar .title-card .t-sub { letter-spacing: 0; font-family: var(--arabic); font-size: clamp(20px, 2.2vw, 28px); }
.title-card .t-nums { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 6vw, 92px); letter-spacing: 0.1em; color: var(--ivory); text-shadow: 0 0 60px rgba(47, 141, 255, 0.5), 0 2px 30px rgba(0, 0, 0, 0.8); font-variant-numeric: lining-nums; }
.hint { position: fixed; inset-inline: 0; bottom: calc(96px + var(--sb)); z-index: 15; text-align: center; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--stone); opacity: 0; transition: opacity 0.8s; pointer-events: none; }
.hint.show { opacity: 1; }
.ar .hint { letter-spacing: 0; font-size: 16px; font-family: var(--arabic); text-transform: none; }

/* ───── hotspots ───── */
.hotspots { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
.hotspots.on { opacity: 1; }
.marker { position: absolute; left: 0; top: 0; transform: translate(-100px, -100px); display: flex; align-items: center; gap: 10px; color: var(--ivory); pointer-events: auto; transition: opacity 0.4s; margin: -11px 0 0 -11px; }
.marker i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(238, 242, 248, 0.9); position: relative; background: rgba(3, 5, 12, 0.35); flex: none; }
.marker i::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.marker i::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(143, 232, 255, 0.55); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.marker span { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; text-shadow: 0 1px 10px #000; white-space: nowrap; }
.ar .marker span { font-family: var(--arabic); letter-spacing: 0; font-size: 16px; text-transform: none; }
.marker.active i::after { background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.panel { position: fixed; z-index: 22; background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px 28px; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.45s, transform 0.45s, visibility 0.45s; max-height: calc(100dvh - 160px); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.panel .close { position: absolute; top: 8px; inset-inline-end: 10px; font-size: 26px; line-height: 1; color: var(--stone); padding: 6px 10px; }
.panel h3 { font-family: var(--display); font-weight: 600; font-size: 26px; margin-bottom: 8px; letter-spacing: 0.02em; }
.ar .panel h3 { font-family: var(--arabic); font-size: 28px; }
.panel p { color: var(--stone); font-size: 15px; line-height: 1.7; }
.hotspot-panel { inset-inline-end: 22px; top: calc(80px + var(--sa)); width: min(380px, calc(100vw - 44px)); }
.specs-panel { inset-inline-start: 22px; top: calc(80px + var(--sa)); width: min(440px, calc(100vw - 44px)); }
.specs-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.specs-panel dt { color: var(--gold); letter-spacing: 0.08em; font-size: 12px; text-transform: uppercase; padding-top: 2px; }
.ar .specs-panel dt { letter-spacing: 0; font-size: 14px; text-transform: none; }
.specs-panel dd { color: var(--ivory); }
.explore-bar { position: fixed; inset-inline: 0; bottom: calc(22px + var(--sb)); z-index: 21; display: flex; justify-content: center; align-items: center; gap: 14px; opacity: 0; visibility: hidden; transition: opacity 0.6s, visibility 0.6s; flex-wrap: wrap; padding: 0 16px; }
.explore-bar.on { opacity: 1; visibility: visible; }
.orbit-hint { width: 100%; text-align: center; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }
.ar .orbit-hint { letter-spacing: 0; font-size: 14px; text-transform: none; }
.specs-btn, .continue, .send, .again { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: 0.2em; text-transform: uppercase; padding: 12px 30px; border-radius: 999px; border: 1px solid rgba(238, 242, 248, 0.45); transition: background 0.3s, color 0.3s; backdrop-filter: blur(6px); }
.ar .specs-btn, .ar .continue, .ar .send, .ar .again { font-family: var(--arabic); letter-spacing: 0; text-transform: none; font-size: 21px; }
.continue, .send { background: var(--ivory); color: var(--void); border-color: var(--ivory); }
.continue:hover, .send:hover { background: #fff; box-shadow: 0 0 30px rgba(47, 141, 255, 0.35); }
.specs-btn:hover, .again:hover { background: rgba(238, 242, 248, 0.12); }

/* ───── rooms (the cutaway) ───── */
.rooms { position: fixed; inset: 0; z-index: 12; pointer-events: none; opacity: 0; transition: opacity 1s; }
.rooms.on { opacity: 1; }
.room { position: absolute; left: 0; top: 0; transform: translate(-200px, -200px); display: flex; align-items: center; gap: 8px; margin: -5px 0 0 -5px; transition: opacity 0.5s; }
.room i { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); flex: none; }
.room span { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ivory); text-shadow: 0 1px 12px #000, 0 0 2px #000; white-space: nowrap; }
.ar .room span { font-family: var(--arabic); letter-spacing: 0; font-size: 18px; text-transform: none; }
@media (max-width: 760px) { .room span { font-size: 11px; letter-spacing: 0.08em; } .ar .room span { font-size: 14px; } }

/* ───── the captain ───── */
.captain { position: fixed; inset-inline: 0; bottom: 0; z-index: 14; display: flex; align-items: flex-end; justify-content: center; gap: 0; padding: 0 20px calc(20px + var(--sb)); pointer-events: none; opacity: 0; transform: translateY(30px); transition: opacity 1.1s ease, transform 1.1s ease; }
.captain.on { opacity: 1; transform: translateY(0); }
.portrait { position: relative; flex: none; transition: transform 0.25s ease-out; will-change: transform; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.portrait img { height: min(64vh, 680px); width: auto; display: block; filter: drop-shadow(0 0 22px rgba(47, 141, 255, 0.5)) drop-shadow(0 14px 34px rgba(0, 0, 0, 0.75)); -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%); mask-image: linear-gradient(to bottom, #000 80%, transparent 100%); }
.portrait .rim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(47, 141, 255, 0.0), rgba(47, 141, 255, 0.0)); pointer-events: none; }
.dialogue { max-width: 560px; margin-bottom: 28px; padding: 22px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transform: translateX(-30px); opacity: 0; transition: opacity 0.6s, transform 0.6s; }
.ar .dialogue { transform: translateX(30px); }
.dialogue.talking { opacity: 1; transform: translateX(0); }
.speaker { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.ar .speaker { letter-spacing: 0; font-size: 15px; font-family: var(--arabic); }
.dialogue .line { font-family: var(--display); font-weight: 500; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.4; color: var(--ivory); }
.ar .dialogue .line { font-family: var(--arabic); font-size: clamp(22px, 2.5vw, 31px); line-height: 1.6; }

/* ───── the route ───── */
.route-hud { position: fixed; inset: 0; z-index: 13; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
.route-hud.on { opacity: 1; }
.label { position: absolute; left: 0; top: 0; transform: translate(-200px, -200px); margin: -10px 0 0 10px; padding: 4px 10px; border-radius: 999px; background: rgba(3, 5, 12, 0.6); border: 1px solid rgba(143, 232, 255, 0.25); white-space: nowrap; font-size: 12px; color: var(--stone); transition: opacity 0.5s; display: flex; gap: 8px; align-items: baseline; }
.label b { font-weight: 500; color: var(--ivory); font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; }
.ar .label b { font-family: var(--arabic); font-size: 16px; }
.label.current { border-color: var(--gold); color: var(--gold); }
.route-day { position: absolute; inset-inline-end: 22px; top: calc(64px + var(--sa)); text-align: end; font-family: var(--display); }
.route-day b { display: block; font-weight: 500; font-size: clamp(54px, 9vw, 120px); line-height: 1; color: var(--ivory); text-shadow: 0 0 40px rgba(47, 141, 255, 0.45); font-variant-numeric: tabular-nums; }
.route-day span { font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.ar .route-day span { letter-spacing: 0; font-family: var(--arabic); font-size: 18px; text-transform: none; }
.route-stats { position: absolute; inset-inline: 0; bottom: calc(120px + var(--sb)); display: flex; justify-content: center; gap: clamp(18px, 4vw, 56px); opacity: 0; transform: translateY(10px); transition: opacity 1s, transform 1s; padding: 0 16px; flex-wrap: wrap; }
.route-hud.stats .route-stats { opacity: 1; transform: translateY(0); }
.route-stats div { text-align: center; }
.route-stats b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(30px, 5vw, 60px); line-height: 1; color: var(--ivory); text-shadow: 0 2px 20px #000; font-variant-numeric: tabular-nums; }
.route-stats span { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--stone); }
.ar .route-stats span { letter-spacing: 0; font-size: 14px; text-transform: none; font-family: var(--arabic); }

/* ───── twenty-four days ───── */
.build-panel { position: fixed; z-index: 18; inset-inline-start: 22px; top: calc(70px + var(--sa)); bottom: calc(22px + var(--sb)); width: min(620px, calc(100vw - 44px)); opacity: 0; visibility: hidden; transform: translateX(-20px); transition: opacity 0.8s, transform 0.8s, visibility 0.8s; pointer-events: none; }
.ar .build-panel { transform: translateX(20px); }
.build-panel.on { opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto; }
.build-inner { height: 100%; display: flex; flex-direction: column; background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.build-scroll { flex: 1 1 auto; min-height: 0; padding: 26px 28px 10px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.panel-foot { flex: none; padding: 12px 28px 18px; border-top: 1px solid var(--line); background: rgba(4, 8, 20, 0.55); display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.build-inner h2 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: 0.02em; margin-bottom: 14px; }
.ar .build-inner h2 { font-family: var(--arabic); font-size: 26px; }
.gantt { position: relative; margin-bottom: 26px; }
.gantt-scale { position: relative; height: 18px; margin-inline-start: 0; margin-bottom: 6px; }
.gantt-scale i { position: absolute; top: 0; font-style: normal; font-size: 11px; color: var(--dim); letter-spacing: 0.1em; transform: translateX(-50%); }
.ar .gantt-scale i { transform: translateX(50%); }
.gantt-row { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 8px; opacity: 0; transform: translateY(6px); transition: opacity 0.6s, transform 0.6s; }
.gantt-row.in { opacity: 1; transform: translateY(0); }
.g-label { font-size: 13px; color: var(--stone); line-height: 1.4; }
.g-track { position: relative; height: 7px; background: rgba(238, 242, 248, 0.07); border-radius: 4px; overflow: hidden; }
.g-track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--cyan)); transform: scaleX(0); transform-origin: inline-start; transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s; box-shadow: 0 0 12px rgba(47, 141, 255, 0.5); }
.gantt-row.in .g-track i { transform: scaleX(1); }
.budget-h { opacity: 0; transition: opacity 0.8s; }
.build-panel.budget-in .budget-h { opacity: 1; }
.b-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-bottom: 9px; opacity: 0; transition: opacity 0.6s; }
.b-row.in { opacity: 1; }
.b-label { font-size: 13px; color: var(--stone); grid-column: 1; }
.b-usd { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--ivory); grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; }
.b-track { grid-column: 1; height: 5px; background: rgba(238, 242, 248, 0.07); border-radius: 4px; overflow: hidden; }
.b-track i { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: inline-start; transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s; }
.b-row.in .b-track i { transform: scaleX(1); }
.b-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; font-size: 13px; color: var(--stone); opacity: 0; transition: opacity 1s 1.2s; }
.build-panel.budget-in .b-total { opacity: 1; }
.b-total b { font-family: var(--display); font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.honest { margin: 18px 0 20px; font-size: 12.5px; color: var(--dim); line-height: 1.6; opacity: 0; transition: opacity 1s 1.5s; }
.build-panel.budget-in .honest { opacity: 1; }
.panel-foot .continue { display: inline-block; }

/* ───── the flag: manifest + credits ───── */
.flag-panel { position: fixed; z-index: 18; inset-inline-end: 22px; top: calc(70px + var(--sa)); bottom: calc(22px + var(--sb)); width: min(460px, calc(100vw - 44px)); opacity: 0; visibility: hidden; transform: translateY(16px); transition: opacity 1s, transform 1s, visibility 1s; pointer-events: none; }
.flag-panel.on { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.flag-inner { height: 100%; display: flex; flex-direction: column; background: var(--panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.flag-scroll { flex: 1 1 auto; min-height: 0; padding: 26px 28px 20px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior: contain; }
.flag-inner h2 { font-family: var(--display); font-weight: 600; font-size: 26px; margin-bottom: 16px; }
.ar .flag-inner h2 { font-family: var(--arabic); }
.manifest label { display: block; margin-bottom: 12px; }
.manifest label > span { display: block; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); margin-bottom: 5px; }
.ar .manifest label > span { letter-spacing: 0; font-size: 14px; text-transform: none; }
.manifest input, .manifest textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ivory); background: rgba(238, 242, 248, 0.06); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.manifest textarea { resize: vertical; }
.manifest .hp { position: absolute; left: -9999px; }
.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.role { position: relative; }
.role input { position: absolute; opacity: 0; width: 0; height: 0; }
.role span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--stone); cursor: pointer; }
.role input:checked + span { background: var(--ivory); color: var(--void); border-color: var(--ivory); }
.send { margin-top: 6px; }
.form-note { margin-top: 10px; font-size: 13px; color: var(--stone); min-height: 1.4em; }
.manifest.sent .send { display: none; }
.manifest.sent .form-note { color: var(--gold); font-size: 15px; }
.credits { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.believe { font-family: var(--display); font-style: italic; font-size: 20px; color: var(--ivory); margin-bottom: 8px; }
.ar .believe { font-family: var(--arabic); font-style: normal; }
.made { font-size: 13px; color: var(--stone); margin-bottom: 14px; }
.constellation { font-size: 12px; letter-spacing: 0.08em; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin-bottom: 18px; }
.constellation a { color: var(--stone); border-bottom: 1px solid transparent; }
.constellation a:hover { color: var(--ivory); border-bottom-color: var(--gold); }

/* ───── phones ───── */
@media (max-width: 760px) {
  .hud { padding-inline: 12px; }
  .chapter { font-size: 13px; }
  .hud-btn { padding: 10px 10px; font-size: 11px; min-height: 40px; }
  .caption { bottom: calc(26px + var(--sb)); padding: 0 16px; }
  .caption p { font-size: 19px; }
  .ar .caption p { font-size: 22px; }
  .hotspot-panel, .specs-panel { inset-inline: 12px; top: auto; bottom: calc(86px + var(--sb)); width: auto; max-height: 46dvh; padding: 20px 20px 22px; }
  .marker span { display: none; }
  .marker.active span { display: inline; }
  .captain { padding-inline: 10px; flex-direction: column; align-items: center; }
  .portrait { margin-bottom: -24px; }
  .portrait img { height: 40vh; }
  .dialogue { max-width: none; width: 100%; margin-bottom: 10px; padding: 16px 18px 18px; transform: translateY(10px); }
  .ar .dialogue { transform: translateY(10px); }
  .dialogue .line { font-size: 18px; }
  .ar .dialogue .line { font-size: 20px; }
  .route-day { top: calc(58px + var(--sa)); }
  .route-stats { bottom: calc(180px + var(--sb)); gap: 16px; }
  .route-stats b { font-size: 26px; }
  .build-panel, .flag-panel { inset-inline: 10px; width: auto; top: auto; height: 74dvh; max-height: 74dvh; bottom: calc(10px + var(--sb)); }
  .build-scroll, .flag-scroll { padding: 18px 16px 12px; }
  .panel-foot { padding: 10px 16px calc(12px + var(--sb)); }
  .build-inner h2, .flag-inner h2 { font-size: 20px; }
  .g-label { font-size: 12.5px; }
  .honest { font-size: 12px; }
  .explore-bar { bottom: calc(14px + var(--sb)); }
  .specs-btn, .continue, .send, .again { font-size: 15px; padding: 11px 22px; }
}
@media (prefers-reduced-motion: reduce) { .marker i::before { animation: none; } }
