/*
 * Ported from the 17 signed-off artboards.
 *
 * The designs are fixed 390x844 frames with overflow hidden; real phones are
 * not. Every screen here is a flex column that grows, and the answer panel is
 * the part that scrolls - so a long item pushes options into a scroll area
 * rather than pushing the CTA off the bottom of the screen, which is the one
 * failure that costs a completion.
 */

:root {
  --ink: #f8fbff;
  --ink-soft: #eaf5ff;
  --muted: #a9c4d9;
  --teal: #2ee2d0;
  --teal-soft: #bdebe4;
  --cyan: #57cce9;
  --orange: #ff8a28;
  --orange-deep: #ff5b18;
  --gold: #ffc857;
  --gold-soft: #ffd468;

  --line: rgba(151, 205, 228, 0.23);
  --line-bright: rgba(118, 223, 235, 0.38);
  --card: linear-gradient(180deg, rgba(13, 49, 85, 0.7), rgba(7, 30, 65, 0.76));
  --panel: linear-gradient(180deg, rgba(12, 43, 80, 0.9), rgba(7, 26, 61, 0.92));
  --scene: linear-gradient(145deg, rgba(20, 74, 108, 0.82), rgba(8, 31, 66, 0.9));
  --sel-bg: linear-gradient(180deg, rgba(20, 82, 103, 0.72), rgba(7, 40, 76, 0.82));

  --ground: radial-gradient(circle at 80% 8%, #124d71 0, transparent 29%),
    linear-gradient(155deg, #040b22 0%, #081d3e 48%, #07345b 100%);

  --font: Tahoma, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #040b22;
  color: var(--ink);
  font-family: var(--font);
  direction: rtl;
  text-align: right;
  /* iOS Safari zooms a form control below 16px on focus, which jumps the whole
   * layout mid-answer. Nothing interactive here goes under it. */
  -webkit-text-size-adjust: 100%;
}

#app {
  min-height: 100dvh;
  background: var(--ground);
  background-attachment: fixed;
  max-width: 460px;
  margin: 0 auto;
}

.screen {
  min-height: 100dvh;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.screen.welcome { padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); gap: 14px; }

/* Top bar ---------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line-bright);
  background: rgba(7, 25, 58, 0.78);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn svg { stroke: var(--ink); }
.topbar-right { display: flex; gap: 6px; align-items: center; }

/* Six stamps, one per challenge, filled as each is finished. */
.stamps { display: flex; gap: 5px; }
.stamp {
  width: 22px; height: 22px; border-radius: 7px;
  border: 1px dashed rgba(151, 205, 228, 0.34);
  display: flex; align-items: center; justify-content: center;
}
.stamp.done {
  border: 0;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
}
.stamp.done svg { stroke: #06132f; }
.stamp:not(.done) svg { display: none; }

/* Headings --------------------------------------------------------- */
.h-challenge { margin: 0; font-size: 29px; line-height: 1.25; font-weight: 900; }
.h-challenge .num { color: var(--orange); }
.beat { margin: 6px 0 0; color: var(--teal); font-weight: 700; line-height: 1.65; font-size: 13px; }
/* The artboard's how-to-answer line, spoken under the story, not over it. */
.instr { margin: 4px 0 0; color: var(--muted); font-weight: 700; line-height: 1.6; font-size: 11.5px; }

/* Progress meter --------------------------------------------------- */
.meter {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 999px;
  border: 1px solid rgba(120, 220, 230, 0.28);
  background: rgba(8, 30, 65, 0.72);
}
.meter-label { font-size: 11.5px; font-weight: 800; color: #dcedf8; white-space: nowrap; }
.meter-track {
  flex-grow: 1; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.11); overflow: hidden;
}
.meter-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
  transition: width 0.35s ease;
}
.meter-count { font-size: 11.5px; font-weight: 900; color: var(--teal-soft); white-space: nowrap; }

/* Scene band ------------------------------------------------------- */
.scene {
  position: relative; border-radius: 24px; padding: 14px;
  background: var(--scene);
  border: 1px solid rgba(81, 221, 220, 0.22);
  display: flex; gap: 12px; align-items: center;
}
.scene-img {
  width: 72px; min-width: 72px; height: 96px; border-radius: 16px;
  overflow: hidden; border: 1px solid rgba(121, 220, 235, 0.22);
}
.scene-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; display: block; }
.scene-body { flex-grow: 1; min-width: 0; }
.scene-body p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); }

/* The mock post. Tilted and shadowed so it reads as a thing lying on the
 * scene rather than another panel in the page. */
.post-card {
  width: 104px; min-width: 104px;
  background: #f2f7fc; border-radius: 16px; padding: 10px;
  transform: rotate(-1.5deg);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.24);
}
.post-label {
  font-size: 8px; font-weight: 800; color: #7d93a8;
  letter-spacing: 0.2px; margin-bottom: 5px;
}
.post-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.post-avatar { width: 20px; height: 20px; border-radius: 50%; background: #8cb2d3; }
.post-lines { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.post-lines i { height: 5px; border-radius: 9px; background: #a7bfd4; }
.post-lines i:last-child { width: 55%; background: #d2deea; }
.post-lines i:first-child { width: 80%; }
.post-body {
  height: 56px; border-radius: 11px;
  background: linear-gradient(135deg, #173c70, #0f74a1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 9.5px; text-align: center;
  padding: 6px; line-height: 1.55;
}
.post-body em { font-style: normal; color: #ffd06b; }
.post-counts {
  display: flex; justify-content: space-around;
  font-size: 9px; margin-top: 7px; color: #647c93; font-weight: 700;
  direction: ltr;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(90deg, rgba(34, 220, 202, 0.22), rgba(72, 126, 255, 0.18));
  border: 1px solid rgba(75, 220, 211, 0.32);
  border-radius: 999px; padding: 5px 10px;
  color: #dffdf9; font-weight: 800; font-size: 11px; margin-bottom: 8px;
}

/* The answer panel ------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid rgba(124, 224, 235, 0.23);
  border-radius: 28px;
  box-shadow: 0 0 0 1px rgba(46, 226, 208, 0.08), 0 24px 60px rgba(0, 0, 0, 0.31);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  flex-grow: 1;
  /* The scroll lives here, never on the screen, so the CTA below stays put. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.stem { margin: 0; font-size: 14.5px; line-height: 1.8; font-weight: 800; }
.lead { margin: 0 0 6px; font-size: 12.5px; font-weight: 800; color: var(--teal); }
.item { display: flex; flex-direction: column; gap: 9px; }
.item + .item { border-top: 1px solid rgba(143, 210, 227, 0.14); padding-top: 14px; }

/* Options ---------------------------------------------------------- */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  padding: 13px; border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px; line-height: 1.55; font-weight: 700; color: #f5fbff;
  font-family: inherit; text-align: right; width: 100%;
  cursor: pointer;
}
.opt .box {
  width: 22px; height: 22px; min-width: 22px; border-radius: 50%;
  border: 2px solid #d7e7f4;
}
.opt.multi .box { border-radius: 7px; }
.opt[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--sel-bg);
  box-shadow: 0 0 0 1px rgba(46, 226, 208, 0.18), 0 0 30px rgba(46, 226, 208, 0.12);
}
.opt[aria-pressed="true"] .box {
  background: var(--teal); border-color: var(--teal);
  box-shadow: inset 0 0 0 4px #0d3857;
}
.opt[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Likert ----------------------------------------------------------- */
/* direction:ltr so the scale runs disagree -> agree left to right, matching
 * the ad creative. Reversing it in an RTL page is a reading error, not a
 * detail: the same tap would mean the opposite thing. */
.likert {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px; direction: ltr;
}
.likert-cell {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 3px; border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  font-family: inherit; cursor: pointer;
}
.likert-cell span {
  font-size: 8.5px; font-weight: 800; color: #f5fbff;
  text-align: center; line-height: 1.3;
}
.likert-cell[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--sel-bg);
  box-shadow: 0 0 0 1px rgba(46, 226, 208, 0.18), 0 0 30px rgba(46, 226, 208, 0.12);
  transform: translateY(-3px);
}

/* Text input ------------------------------------------------------- */
/* 16px is not a style choice: anything smaller makes iOS Safari zoom the page
 * on focus, and it never zooms back out. */
.text-input {
  width: 100%; padding: 13px; border-radius: 18px;
  border: 1px solid var(--line); background: rgba(7, 30, 65, 0.76);
  color: var(--ink); font-family: inherit; font-size: 16px; line-height: 1.6;
  resize: vertical; min-height: 96px;
}
/* The email field is one line, so it does not inherit the textarea's height. */
input.text-input { min-height: 0; resize: none; }
.text-input::placeholder { color: #6f8aa8; }
.text-input:focus-visible { border-color: var(--teal); outline: none; box-shadow: 0 0 0 1px rgba(46, 226, 208, 0.25); }

/* Footer and CTA --------------------------------------------------- */
.footer { display: flex; gap: 9px; align-items: center; }
/* Grow only inside the footer row, beside the points chip. A bare .btn in the
 * screen's vertical column must never grow: flex-grow there is vertical, and
 * it turns the button into a slab that swallows the empty space. */
.footer .btn { flex-grow: 1; width: auto; }
.points {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: 1px solid rgba(129, 223, 236, 0.32); border-radius: 16px;
  background: rgba(8, 30, 64, 0.68); padding: 8px 11px; min-width: 74px;
}
.points b { font-size: 14px; font-weight: 900; color: var(--gold); }
.points span { font-size: 9px; font-weight: 800; color: var(--muted); white-space: nowrap; }

.btn {
  border: 0; width: 100%;
  padding: 16px 20px; border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff; font-size: 19px; font-weight: 900; font-family: inherit;
  box-shadow: 0 16px 36px rgba(255, 100, 25, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer;
}
/* The design's four button sizes, taken from the artboards rather than
 * invented: 21px is the welcome hero alone; 20px carries the gate steps and
 * story beats; 19px with tighter padding starts the first challenge; the
 * plain .btn (16x20, 19px) is every challenge footer; share on the result
 * screen drops to 18px. */
.btn.lg { padding: 17px 22px; font-size: 21px; }
.btn.md { padding: 17px 22px; font-size: 20px; }
.btn.start { padding: 15px 22px; font-size: 19px; }
.btn.share { font-size: 18px; }
.btn[disabled] { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
.btn-ghost {
  border: 1px solid rgba(129, 223, 236, 0.32);
  padding: 15px 16px; border-radius: 999px;
  background: rgba(8, 30, 64, 0.68);
  color: #dcedf8; font-weight: 800; font-size: 14px;
  font-family: inherit; white-space: nowrap; cursor: pointer;
}

.note {
  padding: 12px 14px; border-radius: 18px;
  background: rgba(70, 221, 193, 0.09);
  border: 1px solid rgba(75, 222, 203, 0.22);
  color: var(--teal-soft); line-height: 1.65; font-size: 12.5px;
}
.note.sm { font-size: 11.5px; border-radius: 16px; padding: 11px 13px; }

.hint { font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.6; }
.hint.warn { color: var(--gold); }

/* Welcome ---------------------------------------------------------- */
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.3px; }
.pill {
  border: 1px solid var(--line-bright); background: rgba(7, 25, 58, 0.78);
  border-radius: 999px; padding: 7px 13px;
  font-size: 11px; font-weight: 800; color: var(--teal-soft);
}
.hero-title { margin: 0; font-size: 54px; line-height: 1.06; font-weight: 900; letter-spacing: -1px; text-shadow: 0 10px 40px rgba(0, 0, 0, 0.24); }
.hero-title em { font-style: normal; color: var(--orange); }
.hero-sub { margin: 14px auto 0; color: var(--teal); font-size: 19px; font-weight: 800; line-height: 1.6; max-width: 310px; }

/* Full-bleed band at the illustration's own ratio. A portrait slot crops a
 * 2.4:1 group shot down to whoever happens to stand in the middle. */
.hero-band {
  position: relative; height: 164px; flex-shrink: 0; overflow: hidden;
  margin-left: -16px; margin-right: -16px;
}
.hero-band img { width: 100%; height: 100%; object-fit: cover; object-position: center 34%; display: block; }
.hero-band .fade-b { position: absolute; inset: auto 0 0 0; height: 52px; background: linear-gradient(180deg, rgba(6, 19, 47, 0) 0%, rgba(6, 19, 47, 0.72) 100%); }
.hero-band .fade-t { position: absolute; inset: 0 0 auto 0; height: 26px; background: linear-gradient(0deg, rgba(6, 19, 47, 0) 0%, rgba(6, 19, 47, 0.55) 100%); }

.bubble {
  position: absolute; right: 14px; bottom: 11px; max-width: 62%;
  background: rgba(5, 17, 42, 0.9);
  border: 1px solid rgba(75, 222, 203, 0.55);
  border-radius: 15px 15px 4px 15px;
  padding: 8px 11px; font-size: 11px; line-height: 1.65; font-weight: 700;
  color: #e9f8ff; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fact {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 900; text-align: center;
}
.map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.map-cell {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px; border-radius: 15px;
  border: 1px solid rgba(151, 205, 228, 0.2); background: rgba(9, 32, 66, 0.55);
  font-size: 9.5px; font-weight: 800; color: #dcedf8; text-align: center;
}
.map-cell.final { border-color: rgba(255, 200, 87, 0.28); background: rgba(46, 32, 9, 0.4); color: #ffdca1; }
.rule { display: flex; align-items: center; gap: 9px; }
.rule span { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: 0.3px; white-space: nowrap; }
.rule i { flex-grow: 1; height: 1px; background: rgba(143, 210, 227, 0.16); }
.grow { flex-grow: 1; display: flex; flex-direction: column; gap: 9px; justify-content: center; }
/* A pill in the column hugs its text; stretched to full width it reads as an
 * empty input, not a stamp. */
.grow > .pill { align-self: flex-start; }
/* Story beats read top-down: stamp and title directly under the scene, the
 * breathing room below, the button on the floor. */
.grow.start { justify-content: flex-start; padding-top: 6px; }

/* Result ----------------------------------------------------------- */
.screen.result { background: radial-gradient(circle at 50% 6%, #1a5c7f 0, transparent 34%); }
/* The passport card ends where its content ends; leftover space falls on the
 * page ground between card and footer instead of as dead space inside the
 * card, and the share row stays pinned to the bottom. */
.screen.result .panel { flex-grow: 0; }
.screen.result .footer { margin-top: auto; }
.crest { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crest .eyebrow { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: 0.4px; }
.seal {
  width: 112px; height: 112px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #fff2a7 0 14%, #d99a32 15% 21%, #152b4e 22% 48%, #f5c765 49% 56%, #7b4c18 57% 64%, #142b4b 65%);
  box-shadow: 0 0 55px rgba(255, 200, 87, 0.25);
}
.persona-name { margin: 2px 0 0; font-size: 33px; font-weight: 900; color: var(--gold-soft); line-height: 1.25; }
.persona-line { margin: 0; color: #d7e8f4; line-height: 1.75; font-size: 13.5px; max-width: 310px; }

.bars { display: flex; flex-direction: column; }
.bar {
  display: grid; grid-template-columns: 98px 1fr 34px; gap: 10px;
  align-items: center; padding: 7px 0;
  border-bottom: 1px solid rgba(143, 210, 227, 0.12);
}
.bar:last-child { border-bottom: 0; }
.bar-name { font-weight: 800; font-size: 12px; }
.bar-track { height: 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #6ee8d2); transition: width 0.6s ease; }
.bar-val { text-align: left; font-weight: 900; font-size: 12.5px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 17px; font-weight: 900; color: var(--teal); }

/* Loading and interstitial ----------------------------------------- */
.screen.centred { align-items: center; justify-content: center; text-align: center; }
.spinner {
  width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid rgba(46, 226, 208, 0.18);
  border-top-color: var(--teal);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tips { display: flex; flex-direction: column; gap: 10px; }
.tip {
  padding: 13px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card);
}
.tip b { display: block; font-size: 14px; font-weight: 900; margin-bottom: 5px; }
.tip span { font-size: 12.5px; line-height: 1.7; color: var(--ink-soft); font-weight: 700; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

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

/* ── The artboard alignment pass ─────────────────────────────────── */

/* Mechanic cards: what each challenge builds. Same shell as the scene. */
.mech {
  display: flex; gap: 14px; align-items: center;
  border-radius: 24px; padding: 14px 16px;
  background: var(--scene);
  border: 1px solid rgba(81, 221, 220, 0.22);
}
.mech.column { display: block; padding: 10px 14px; }
.mech-text { display: flex; flex-direction: column; gap: 5px; }
.mech-label { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.3px; }
.mech-big { font-size: 17px; font-weight: 900; line-height: 1.4; color: var(--ink); }
.mech-small { font-size: 11.5px; font-weight: 700; color: var(--teal-soft); line-height: 1.6; }

/* Counter chips inside a panel hug their text; stretched across the card
 * they read as progress bars that never move. */
.panel > .chip { align-self: flex-start; }

/* Gate panels end at their content, as the artboards draw them; the button
 * takes the floor and the leftover space sits above it. */
.panel.natural { flex-grow: 0; }
.btn.push { margin-top: auto; }

/* Support map: SVG scaffold, real faces for the human nodes. The wrapper
 * carries the 340x200 ratio itself and the SVG fills it absolutely, because
 * mobile WebKit collapses an auto-height SVG that desktop rendering gets
 * right. The avatar boxes take the same treatment for the same reason. */
/* 232/340 — the support map's viewBox ratio. Both numbers live in app.js. */
.map-wrap { position: relative; width: 100%; padding-bottom: 68.24%; }
.map-wrap > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-avatar {
  /* 48/232: the y of the top row of nodes, as a fraction of the viewBox. */
  position: absolute; top: 20.69%; width: 13%; padding-bottom: 13%; height: 0;
  transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden;
}
.map-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* A consent checkbox: the option row, squared off and ticked rather than
 * filled. Unticked is the resting state and stays visually quiet — a consent
 * box that looks pre-selected is not consent. */
.opt.check .box { border-radius: 6px; position: relative; }
.opt.check.on { border-color: var(--teal); background: var(--sel-bg); }
.opt.check.on .box { background: var(--teal); border-color: var(--teal); }
.opt.check.on .box::after {
  content: ""; position: absolute; inset: 0;
  background: no-repeat center/12px 12px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052f2c' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5 L9.5 18 L20 6.5'/%3E%3C/svg%3E");
}

/* The way out of the last screen. Deliberately quieter than the CTA beside it,
 * but full width and plainly labelled — skipping is permanent, so it must not
 * be something a thumb finds by accident. */
.btn-ghost.wide { width: 100%; margin-top: 9px; }

/* Kit slots: the bag grows with what goes in it, so the row wraps rather than
 * holding three fixed columns — the item asks for «كل ما ينطبق», up to six. */
.kit-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kit-slot {
  border-radius: 20px; border: 1px dashed rgba(151, 205, 228, 0.4);
  background: rgba(8, 30, 64, 0.5); padding: 13px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.kit-slot.filled {
  border: 1px solid rgba(46, 226, 208, 0.55);
  background: linear-gradient(180deg, rgba(20, 82, 103, 0.72), rgba(7, 40, 76, 0.82));
}
.kit-label { font-size: 9.5px; font-weight: 800; text-align: center; line-height: 1.35; color: #dffdf9; }
.kit-label.dim { color: #8fa8c2; }

/* Gate stations. */
.gate-dashes { display: flex; gap: 7px; justify-content: center; padding: 2px 0; }
.gate-dashes i {
  width: 34px; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}
.gate-dashes i.on { background: linear-gradient(90deg, var(--teal), var(--cyan)); }
.gate-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.gate-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(180deg, #134b76, #092b55);
  border: 2px solid rgba(74, 228, 216, 0.52);
  display: flex; align-items: center; justify-content: center;
}
.gate-title { margin: 0; font-size: 31px; line-height: 1.25; font-weight: 900; }
.gate-title span { color: var(--orange); }
.gate-sub { margin: 0; color: var(--teal); font-weight: 700; line-height: 1.7; font-size: 13.5px; max-width: 320px; }
.gate-warning {
  padding: 11px 13px; border-radius: 14px;
  background: rgba(120, 40, 60, 0.28);
  border: 1px solid rgba(255, 130, 150, 0.28);
  color: #ffd3dc; font-size: 12px; font-weight: 700; line-height: 1.6;
}
.req { color: var(--orange); font-weight: 900; }

/* The player card answers in chips, not rows. */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.opt.chipopt {
  display: inline-flex; width: auto;
  padding: 9px 12px; border-radius: 13px;
  font-size: 12px; font-weight: 700;
}

/* The age step answers on a grid of years. */
.age-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.opt.agecell {
  display: block; width: auto; padding: 15px 0;
  text-align: center; font-size: 19px; font-weight: 900; border-radius: 16px;
}

/* Scenario dressing: the pressure line, quoted and hot. */
.quote { color: var(--orange); }
.chip.hot {
  background: linear-gradient(90deg, rgba(255, 138, 40, 0.24), rgba(255, 91, 24, 0.16));
  border-color: rgba(255, 138, 40, 0.4);
  color: #ffd6b0;
}
.night-band {
  position: relative; width: 100%; height: 148px;
  border-radius: 18px; overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(121, 220, 235, 0.22);
}
.night-band img { width: 100%; height: 100%; object-fit: cover; object-position: center 26%; display: block; }
.bubble.hot {
  right: auto; left: 10px; bottom: 9px; max-width: 78%;
  background: rgba(46, 17, 4, 0.9);
  border-color: rgba(255, 138, 40, 0.65);
  border-radius: 15px 15px 15px 4px;
  font-size: 10.5px; color: #ffe3c7;
}

/* Story beats: framed scene, centered story. */
.screen.beat { text-align: center; }
.beat-card {
  position: relative; height: 250px; flex-shrink: 0;
  border-radius: 22px; overflow: hidden;
  border: 1px solid rgba(121, 220, 235, 0.22);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}
.beat-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.beat-body {
  flex-grow: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  padding: 6px 10px;
}
.beat-body .h-challenge { font-size: 27px; max-width: 300px; }
.beat-body .beat { max-width: 300px; }

/* Three statements on one card read at the artboard's compact size. */
.panel.compact .stem { font-size: 12.5px; line-height: 1.6; }
.panel.compact .likert-cell { padding: 6px 3px; border-radius: 14px; }
.panel.compact .likert svg { width: 26px; height: 26px; }

/* Loading: the seal being pressed. */
.load-ring { position: relative; width: 96px; height: 96px; }
.load-ring .spinner { width: 96px; height: 96px; }
.load-ring svg { position: absolute; inset: 0; margin: auto; }
.load-bar {
  width: 100%; max-width: 300px; height: 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.11); overflow: hidden;
}
.load-bar i {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
  animation: loadslide 1.4s ease-in-out infinite alternate;
}
@keyframes loadslide { from { width: 15%; } to { width: 88%; } }

/* Endings pin their footnote to the floor. */
.note.bottom { margin-top: auto; }
.screenout-icon {
  width: 122px; height: 122px; border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 108, 150, 0.5), rgba(9, 33, 66, 0.2) 70%);
  border: 1px solid rgba(87, 204, 233, 0.35);
  display: flex; align-items: center; justify-content: center;
}

/* ── Phone-fit pass ──────────────────────────────────────────────── */

/* The action stays on screen while the content scrolls under it. Real
 * phones are shorter than the 844px artboard once the browser bar takes
 * its share, and a CTA below the fold costs completions. */
.footer,
.screen > .btn {
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 5;
}

/* Shorter screens get tighter rhythm, so there is less to scroll at all. */
@media (max-height: 780px) {
  .screen { gap: 9px; }
  .screen.welcome { gap: 10px; padding-top: 14px; }
  .hero-title { font-size: 42px; }
  .hero-sub { font-size: 16px; margin-top: 8px; }
  .hero-band { height: 122px; }
  .beat-card { height: 190px; }
  .fact { padding: 9px 6px; font-size: 12px; }
  .map-cell { padding: 8px 4px; }
  .mech { padding: 11px 14px; }
  /* Direct children only: the compass, shield and seal. The support map's
   * svg lives one level deeper and must keep its full-width ratio box —
   * this selector unscoped was crushing it to 68px on every real phone. */
  .mech > svg:first-child { width: 68px; height: 68px; min-width: 68px; }
  .gate-icon { width: 54px; height: 54px; }
  .gate-title { font-size: 27px; }
  .panel { padding: 13px; }
  .h-challenge { font-size: 25px; }
}
