/* «روّاد» story prototype: one night stage. The pictures move by their depth maps (WebGL);
   figures, lantern light, drops and words are drawn on top. Dark on purpose (it is night). */
:root {
  --ink: #070B17;
  --night: #13203B;
  --cream: #F3E9D2;
  --gold: #F2B544;
  --gold-soft: #FFE3A1;
  --mute: #A9B2C8;
  --line: rgba(243, 233, 210, .16);
  --narrator: #F3E9D2;
  --qandil: #FFC864;
  --planner: #C9D6F2;
  --hero: #A8E6B5;
  --mother: #F2B6A0;
  --f-ui: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
  --f-title: 'Baloo Bhaijaan 2', 'Tajawal', system-ui, sans-serif;
  --f-hand: 'Aref Ruqaa', 'Amiri', 'Tajawal', serif;
  --f-quran: 'Amiri Quran', 'Amiri', serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body {
  background: var(--ink); color: var(--cream); font-family: var(--f-ui);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
/* phone: the whole screen. Wider screens: a 9:16 window. */
#stage {
  position: relative; container-type: size; width: 100%; height: 100%;
  overflow: hidden; background: #000; isolation: isolate; touch-action: manipulation;
}
@media (min-aspect-ratio: 10/16) {
  #stage { width: auto; height: min(100dvh - 20px, 1100px); aspect-ratio: 9 / 16; border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 0 1px var(--line); }
}
.view, #fx, #map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.view { opacity: 0; }
#fx { z-index: 3; pointer-events: none; }
#actors { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.actor { position: absolute; left: 0; top: 0; transform-origin: 50% 100%; will-change: transform, opacity; pointer-events: none; }
.actor.tap { pointer-events: auto; cursor: pointer; }
.halo { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: screen; will-change: transform, opacity;
  background: radial-gradient(circle, rgba(255, 214, 140, .95) 0, rgba(255, 170, 70, .42) 22%, rgba(242, 140, 50, .12) 48%, transparent 70%); }
.halo.white { background: radial-gradient(circle, rgba(255, 255, 255, .95) 0, rgba(210, 225, 255, .45) 22%, rgba(170, 195, 255, .12) 48%, transparent 70%); }
.ring { position: absolute; left: 0; top: 0; width: 22cqw; height: 22cqw; margin: -11cqw 0 0 -11cqw; border-radius: 50%; border: .7cqw solid var(--gold-soft); pointer-events: none; animation: ring 1.6s ease-out infinite; opacity: 0; }
@keyframes ring { 0% { transform: scale(.45); opacity: .95; } 100% { transform: scale(1.5); opacity: 0; } }

#map { z-index: 6; touch-action: none; }
#mapUi { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
#mapUi > * { pointer-events: auto; }
#mapClose { position: absolute; top: max(4cqw, env(safe-area-inset-top)); right: 4cqw; }
#mapCard { position: absolute; left: 6cqw; right: 6cqw; bottom: max(8cqw, env(safe-area-inset-bottom)); padding: 4cqw 5cqw; border-radius: 4cqw; text-align: center;
  background: rgba(7, 11, 23, .9); border: 1px solid var(--line); box-shadow: 0 2cqw 6cqw rgba(0, 0, 0, .5); display: grid; gap: 1.6cqw; }
#mapCard h3 { margin: 0; font-family: var(--f-title); font-size: 6cqw; color: var(--gold-soft); }
#mapCard p { margin: 0; font-size: 4.2cqw; color: var(--cream); line-height: 1.6; }
#mapCard .stars svg { width: 7cqw; height: 7cqw; transform: none; }

#page { position: absolute; z-index: 4; inset: 0; pointer-events: none; }

#black { position: absolute; inset: 0; z-index: 8; background: #000; opacity: 1; pointer-events: none; }

#verse { position: absolute; z-index: 9; top: max(17cqw, calc(env(safe-area-inset-top) + 13cqw)); left: 6cqw; right: 6cqw; text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
#verse.on { opacity: 1; }
#verse p { margin: 0; font-family: var(--f-quran); font-size: 7.2cqw; line-height: 2; text-wrap: balance; color: #FFF6DE; text-shadow: 0 0 4cqw rgba(255, 220, 150, .45), 0 .4cqw 2cqw rgba(0, 0, 0, .8); }
#verse small { display: block; margin-top: 1cqw; font-size: 3.6cqw; color: var(--mute); }

#hint { position: absolute; z-index: 9; left: 0; right: 0; bottom: calc(max(6cqw, env(safe-area-inset-bottom)) + 30cqw); text-align: center; font-size: 4.2cqw; font-weight: 700; color: var(--gold-soft);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .8); opacity: 0; transition: opacity .5s; pointer-events: none; }
#hint.on { opacity: 1; }

/* who speaks, and what: a bar at the bottom. Tap it to hurry on. */
#dialog { position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; padding: 14cqw 6cqw max(7cqw, calc(env(safe-area-inset-bottom) + 4cqw)); text-align: center;
  background: linear-gradient(transparent, rgba(3, 5, 12, .78) 42%); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
#dialog.on { opacity: 1; }
/* while a game is open, the words sit at the top, above it */
#stage.gaming #dialog { z-index: 14; bottom: auto; top: 0; padding: max(20cqw, calc(env(safe-area-inset-top) + 16cqw)) 6cqw 12cqw; background: linear-gradient(rgba(3, 5, 12, .9) 55%, transparent); }
#dialog b { display: inline-block; font-size: 3.6cqw; font-weight: 800; padding: .6cqw 3cqw; border-radius: 999px; background: rgba(7, 11, 23, .7); border: 1px solid var(--line); color: var(--c, var(--cream)); margin-bottom: 1.6cqw; }
#dialog b:empty { display: none; }
#dialog p { margin: 0; font-size: 5.1cqw; line-height: 1.85; font-weight: 500; text-wrap: balance; color: var(--cream); text-shadow: 0 1px 8px rgba(0, 0, 0, .75); }

/* the student's own words: a button; pressing it says them */
#choices { position: absolute; z-index: 11; left: 6cqw; right: 6cqw; bottom: max(9cqw, calc(env(safe-area-inset-bottom) + 6cqw)); display: grid; gap: 3cqw; justify-items: center; }
.say { appearance: none; border: 0; font: inherit; font-weight: 800; font-size: 5cqw; line-height: 1.5; color: #1B1406; background: linear-gradient(#FFE3A1, var(--gold)); padding: 3.2cqw 7cqw; border-radius: 999px;
  cursor: pointer; box-shadow: 0 1.4cqw 0 #A87A22, 0 0 8cqw rgba(242, 181, 68, .35); max-width: 100%; text-wrap: balance; animation: rise .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.say:active { transform: translateY(1cqw); box-shadow: 0 .4cqw 0 #A87A22; }
.say.act { background: rgba(243, 233, 210, .1); color: var(--cream); box-shadow: 0 0 0 1px rgba(243, 233, 210, .3); font-weight: 700; }
.say:focus-visible, .btn:focus-visible, .round:focus-visible, .pick:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
@keyframes rise { from { transform: translateY(4cqw) scale(.94); opacity: 0; } }

#top { position: absolute; z-index: 12; top: max(4cqw, env(safe-area-inset-top)); left: 4.5cqw; right: 4.5cqw; display: flex; justify-content: space-between; pointer-events: none; }
#top > * { pointer-events: auto; }
.round { width: 11cqw; height: 11cqw; border-radius: 50%; border: 1px solid rgba(243, 233, 210, .22); background: rgba(7, 11, 23, .55); color: var(--cream); display: grid; place-items: center; cursor: pointer; padding: 0; }
.round svg { width: 5.2cqw; height: 5.2cqw; }
#mapBtn { animation: rise .6s both; }
#mapBtn.new { box-shadow: 0 0 0 0 rgba(242, 181, 68, .7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 4cqw rgba(242, 181, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 181, 68, 0); } }

#game { position: absolute; inset: 0; z-index: 13; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: dark; }

.over { position: absolute; z-index: 20; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4.5cqw; padding: 8cqw;
  text-align: center; background: radial-gradient(circle at 50% 35%, rgba(19, 32, 59, .92), rgba(4, 6, 14, .97)); }
.over h1 { font-family: var(--f-title); font-weight: 800; font-size: 20cqw; margin: 0; line-height: 1; color: var(--gold-soft); text-shadow: 0 0 6cqw rgba(242, 181, 68, .5); }
.over h2 { font-family: var(--f-title); font-weight: 800; font-size: 10cqw; margin: 0; color: var(--gold-soft); }
.over p { margin: 0; color: var(--mute); font-size: 4.3cqw; line-height: 1.7; max-width: 82cqw; text-wrap: balance; }
.over .sub { font-family: var(--f-hand); font-size: 6cqw; color: var(--cream); margin-top: -2cqw; }
.over .note { font-size: 3.6cqw; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 4cqw; width: 100%; }
.pick { appearance: none; font: inherit; color: var(--cream); background: rgba(243, 233, 210, .05); border: 1px solid var(--line); border-radius: 5cqw; padding: 3cqw 2cqw 2.4cqw; cursor: pointer; display: grid; justify-items: center; gap: 1.4cqw; }
.pick img { height: 30cqw; width: auto; }
.pick span { font-weight: 800; font-size: 4.6cqw; }
.pick[aria-pressed="true"] { border-color: var(--gold); background: rgba(242, 181, 68, .12); box-shadow: 0 0 6cqw rgba(242, 181, 68, .2); }
.name { display: grid; gap: 1.6cqw; width: 100%; text-align: start; font-size: 3.8cqw; color: var(--mute); }
.name input { font: inherit; font-size: 5cqw; font-weight: 700; color: var(--cream); background: rgba(243, 233, 210, .06); border: 1px solid var(--line); border-radius: 3.4cqw; padding: 3cqw 4cqw; outline: none; }
.name input:focus { border-color: var(--gold); }
.row { display: flex; gap: 3cqw; flex-wrap: wrap; justify-content: center; }
.btn { appearance: none; border: 0; font: inherit; font-weight: 800; font-size: 5.4cqw; color: #1B1406; background: linear-gradient(#FFD98A, var(--gold)); padding: 3cqw 12cqw; border-radius: 999px; cursor: pointer; box-shadow: 0 1.4cqw 0 #A87A22; }
.btn:active { transform: translateY(1cqw); box-shadow: 0 .4cqw 0 #A87A22; }
.btn.ghostbtn { background: rgba(243, 233, 210, .08); color: var(--cream); box-shadow: none; border: 1px solid rgba(243, 233, 210, .22); font-size: 4.6cqw; padding: 2.6cqw 8cqw; }
.loading { font-size: 3.6cqw; color: var(--mute); min-height: 1.5em; }
.stars { display: flex; gap: 2.4cqw; justify-content: center; }
.stars svg { width: 10cqw; height: 10cqw; }
@media (prefers-reduced-motion: reduce) { .ring, #mapBtn.new { animation: none; opacity: .8; } }

/* ───────── 2026-10-26 ───────── */
#top { justify-content: flex-start; gap: 3cqw; }
#top > span { flex: 1; }
#bookBtn { animation: rise .6s both; }
#bookBtn.new { animation: pulse 1.6s infinite; }
/* the verse's ornate brackets: drawn, the left one is the mirror of the right one */
#verse .orn { display: inline-block; height: 1.15em; width: .5em; vertical-align: -.22em; margin: 0 1.6cqw; color: var(--gold-soft); }
#verse .orn.end { transform: scaleX(-1); }
.ring.white { border-color: rgba(235, 242, 255, .95); box-shadow: 0 0 5cqw rgba(200, 220, 255, .5); }

/* the notebook: ink on the right-hand page of the notebook picture */
.pg { position: absolute; container-type: size; perspective: 160cqw; pointer-events: none; }
.pg .ink { position: absolute; color: #2B2418; font-family: var(--f-hand); text-align: center; line-height: 1.7; mix-blend-mode: multiply; }
.pg .sketch { left: 10%; top: 12%; width: 80%; height: 46%; opacity: .85; }
.pg .title { left: 0; right: 0; top: 1.5%; font-size: 7.5cqw; opacity: .75; }
.pg .title.small { font-size: 6cqw; opacity: .55; }
.pg .line { left: 0; right: 0; top: 30%; font-size: 8.4cqw; line-height: 2; opacity: .92; }
/* the page found at the well: four short lines; the changed words are in a darker ink that shines a little */
.pg .line.two { top: 6%; font-size: 7.6cqw; line-height: 1.9; mix-blend-mode: normal; color: #3A3122; }
.pg .blot { display: inline-block; width: 2.3em; height: .9em; vertical-align: -.16em; border-radius: 44% 56% 52% 48% / 55% 45% 55% 45%;
  background: radial-gradient(60% 60% at 35% 45%, rgba(14, 22, 40, .8), transparent 72%), radial-gradient(55% 60% at 70% 60%, rgba(24, 34, 60, .65), transparent 72%); animation: glint 2.4s ease-in-out infinite; }
.pg .fresh { font-weight: 700; color: #0B1222; animation: glint 2.6s ease-in-out infinite; }
@keyframes glint { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 .1em rgba(150, 180, 255, .95)); } }
/* the true words written back after the cipher: the notebook's own ink, a thin gold line under them */
.pg .true { font-weight: 700; box-shadow: inset 0 -.08em 0 rgba(242, 181, 68, .75); }
.pg .leaf { position: absolute; inset: -1% -2% -1% 0; transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 0 1.5cqw 1.5cqw 0;
  background: linear-gradient(to right, rgba(95, 62, 20, .45), rgba(95, 62, 20, 0) 22%), linear-gradient(160deg, #E4CC9A, #CFB07A); box-shadow: -1cqw 0 4cqw rgba(0, 0, 0, .35); }
#book { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; align-content: center; gap: 6cqw; background: rgba(3, 4, 9, .9); touch-action: pan-y; }
#book .nb { position: relative; width: 94cqw; aspect-ratio: 837 / 530; overflow: hidden; container-type: inline-size; border-radius: 2cqw; box-shadow: 0 3cqw 9cqw rgba(0, 0, 0, .6); }
#book .nb img { position: absolute; width: 122.4cqi; left: -12.24cqi; top: -42.8cqi; max-width: none; }
#book .nb .pg { left: 56.3cqi; top: 10.4cqi; width: 44.1cqi; height: 49.6cqi; }
#book .bookNav { display: flex; gap: 5cqw; }
#book .bookNav .round:disabled { opacity: .3; cursor: default; }
/* the speaker's round picture above the name */
#face { display: block; width: 14cqw; height: 14cqw; margin: 0 auto 1.6cqw; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2A3150, #0B0F1E); color: var(--c, var(--cream)); }
#face[hidden] { display: none; }
#face img { width: 100%; height: 100%; object-fit: cover; }
#face.head img { width: 220%; height: auto; max-width: none; margin-left: -60%; margin-top: -8%; object-fit: initial; }
#face.lamp img { object-fit: contain; padding: 1.5cqw; }
#face.icon { display: grid; place-items: center; }
#face.icon svg { width: 60%; height: 60%; }
/* the speaker on the right (picture, name under it), the words on their left */
#dialog { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 3.5cqw; align-items: center; text-align: start; }
#dialog #face { grid-column: 1; grid-row: 1; margin: 0 auto .8cqw; }
#dialog b { grid-column: 1; grid-row: 2; justify-self: center; margin: 0; font-size: 3.2cqw; padding: .4cqw 2.2cqw; }
#dialog p { grid-column: 2; grid-row: 1 / span 2; text-align: start; }
#dialog #face[hidden] + b + p, #dialog b:empty + p { grid-column: 1 / span 2; text-align: center; }
#face.head { background-repeat: no-repeat; background-color: #1A2038; }

/* ───────── «سجلّ القنديل»: a tidy notebook (now · goal · tabs · one plain list) ───────── */
#journalBtn { position: relative; animation: rise .6s both; }
#journalBtn.new::after { content: attr(data-n); position: absolute; top: -1cqw; left: -1cqw; min-width: 4.6cqw; height: 4.6cqw; padding: 0 1cqw; border-radius: 999px; background: var(--gold); color: #1B1406; font: 800 3cqw/4.6cqw var(--f-ui); text-align: center; }
#journal { position: absolute; inset: 0; z-index: 16; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(120% 55% at 50% 0%, rgba(46, 36, 18, .98), #06080F 72%); padding-top: max(4cqw, env(safe-area-inset-top)); }
#journal[hidden] { display: none; }
.jhead { display: flex; align-items: center; justify-content: space-between; padding: 0 5cqw 3cqw; }
.jhead h2 { margin: 0; font-family: var(--f-hand); font-weight: 700; font-size: 8cqw; color: var(--gold-soft); text-shadow: 0 0 5cqw rgba(242, 181, 68, .35); }
.jhead h2 small { font: 600 3.4cqw var(--f-ui); color: var(--mute); text-shadow: none; margin-inline-start: 2cqw; }
.jbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.jtop { flex: none; display: grid; gap: 2.4cqw; padding: 0 5cqw 3cqw; }
.jnow { padding: 3.4cqw 4cqw; border-radius: 3.5cqw; border: 1px solid rgba(242, 181, 68, .45); background: rgba(242, 181, 68, .08); font-size: 4.3cqw; line-height: 1.7; }
.jnow small { display: block; color: var(--gold-soft); font-weight: 800; font-size: 3.3cqw; }
.jgoal { display: flex; align-items: center; gap: 3cqw; width: 100%; text-align: start; appearance: none; font: inherit; color: var(--cream); background: rgba(243, 233, 210, .05); border: 1px solid var(--line); border-radius: 3.5cqw; padding: 2cqw 3cqw; cursor: pointer; }
.jgoal img { flex: none; width: 9cqw; height: 9cqw; object-fit: contain; }
.jgoal small { display: block; color: var(--gold-soft); font-weight: 800; font-size: 3cqw; }
.jgoal b { font-size: 4cqw; }
.jtabs { flex: none; display: flex; gap: 1.6cqw; padding: 0 5cqw 3cqw; overflow-x: auto; scrollbar-width: none; }
.jtab { position: relative; flex: none; appearance: none; font: inherit; font-weight: 700; font-size: 3.7cqw; color: var(--cream); background: rgba(243, 233, 210, .06); border: 1px solid var(--line); border-radius: 999px; padding: 1.7cqw 3.6cqw; cursor: pointer; }
.jtab[aria-pressed="true"] { background: var(--gold); color: #1B1406; border-color: var(--gold); }
.jtab i, .fresh::after { content: ''; position: absolute; top: .4cqw; left: .6cqw; width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: #FFE3A1; box-shadow: 0 0 3cqw var(--gold); }
.jtab[aria-pressed="true"] i { display: none; }
.jlist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 1cqw 5cqw max(8cqw, env(safe-area-inset-bottom)); display: grid; grid-auto-rows: max-content; align-content: start; gap: 2.6cqw; }
.jlist.people, .jlist.places { grid-template-columns: 1fr 1fr; }
.jc, .jq, .jt, .jgoal { position: relative; }
.fresh::after { top: 1.6cqw; left: 1.8cqw; }
/* people and places: picture cards */
.jc { display: block; appearance: none; font: inherit; color: var(--cream); background: rgba(243, 233, 210, .05); border: 1px solid var(--line); border-radius: 4cqw; padding: 0; overflow: hidden; cursor: pointer; text-align: center; }
.jc .jimg { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: radial-gradient(circle at 50% 60%, rgba(242, 181, 68, .16), rgba(0, 0, 0, .4)); color: var(--gold-soft); }
.jc .jimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jc .jimg svg, .jc .jimg .fog { position: absolute; inset: 0; margin: auto; width: 38%; height: 38%; }
.jc .jimg img[src*="sprites/"] { object-fit: contain; object-position: 50% 100%; box-sizing: border-box; padding-top: 6%; }
.jc b { display: block; padding: 2.2cqw 2cqw 2.8cqw; font-size: 3.9cqw; line-height: 1.4; }
/* what happened: one vertical timeline */
.jtl { margin-inline-start: 2cqw; padding-inline-start: 6.5cqw; border-inline-start: 2px solid rgba(242, 181, 68, .5); display: grid; }
.jt { display: block; width: 100%; text-align: start; appearance: none; font: inherit; color: var(--cream); background: none; border: 0; padding: 0 0 4.6cqw; cursor: pointer; }
.jt .jtd { position: absolute; inset-inline-start: -8.1cqw; top: 1.3cqw; width: 3.2cqw; height: 3.2cqw; border-radius: 50%; background: rgba(243, 233, 210, .55); }
.jt:last-child { padding-bottom: 0; }
.jt:last-child .jtd { background: var(--gold); box-shadow: 0 0 4cqw rgba(242, 181, 68, .8); }
.jt b { display: block; font-size: 4.3cqw; color: var(--gold-soft); }
.jt .tx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 3.8cqw; line-height: 1.7; color: rgba(243, 233, 210, .78); }
.jt.fresh::after { content: none; }
.jt.fresh b::after { content: ''; display: inline-block; width: 2.2cqw; height: 2.2cqw; margin-inline-start: 2cqw; border-radius: 50%; background: #FFE3A1; box-shadow: 0 0 3cqw var(--gold); vertical-align: middle; }
/* secrets and sayings: text cards */
.jq { display: block; width: 100%; text-align: start; appearance: none; font: inherit; color: var(--cream); background: rgba(243, 233, 210, .05); border: 1px solid var(--line); border-radius: 4cqw; padding: 3.2cqw 4cqw; cursor: pointer; }
.jq b { display: block; font-size: 4.2cqw; color: var(--gold-soft); margin-bottom: 1cqw; }
.jq p { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 3.9cqw; line-height: 1.8; color: rgba(243, 233, 210, .82); }
.jq.secret { border-color: rgba(160, 175, 215, .4); background: rgba(120, 140, 200, .07); }
.jq.secret b { color: #C8D2EE; }
.jq.quran p { font-family: var(--f-quran); font-size: 5cqw; text-align: center; -webkit-line-clamp: 2; }
.jc.locked, .jq.locked { border-style: dashed; opacity: .8; }
.jc.locked b, .jq.locked b, .jq.locked p { color: var(--mute); font-weight: 500; font-style: italic; }
.jc.locked .jimg { background: radial-gradient(circle at 50% 70%, rgba(60, 72, 110, .3), rgba(0, 0, 0, .5)); }
#jtoast { position: absolute; z-index: 17; top: max(18cqw, calc(env(safe-area-inset-top) + 15cqw)); left: 50%; transform: translate(-50%, -3cqw); opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s;
  display: grid; text-align: center; padding: 2cqw 5cqw; border-radius: 999px; background: rgba(7, 11, 23, .85); border: 1px solid rgba(242, 181, 68, .5); box-shadow: 0 0 6cqw rgba(242, 181, 68, .25); }
#jtoast.on { opacity: 1; transform: translate(-50%, 0); }
#jtoast b { font-size: 3cqw; color: var(--gold-soft); }
#jtoast span { font-size: 4cqw; font-weight: 700; white-space: nowrap; }

/* the speaker: smaller, tight to the right edge, name just under the picture; the words smaller and closer */
#dialog { column-gap: 2.6cqw; padding-right: 3cqw; padding-left: 5cqw; }
#dialog #face { width: 10.5cqw; height: 10.5cqw; margin: 0 auto .4cqw; }
#dialog b { font-size: 2.7cqw; padding: .2cqw 1.6cqw; }
#dialog p { font-size: 4.3cqw; line-height: 1.6; }

/* the unknown: a dark shape, a mist */
.sil { filter: brightness(0) drop-shadow(0 0 6px rgba(140, 160, 215, .45)); opacity: .9; object-fit: contain !important; object-position: 50% 100% !important; }
.fog { width: 60%; height: 60%; border-radius: 50%; background: radial-gradient(circle, rgba(150, 165, 205, .3), transparent 70%); animation: fogp 4s ease-in-out infinite; }
@keyframes fogp { 50% { transform: scale(.75); opacity: .5; } }
/* the details: a sheet from the bottom over a shade */
.jshade { position: absolute; z-index: 3; inset: 0; background: rgba(2, 4, 10, .55); }
.jshade[hidden], .jsheet[hidden] { display: none; }
.jsheet { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; max-height: 78%; overflow-y: auto; padding: 3cqw 6cqw max(7cqw, env(safe-area-inset-bottom)); border-radius: 6cqw 6cqw 0 0;
  background: linear-gradient(#1B1A24, #0B0D16); border-top: 1px solid rgba(242, 181, 68, .45); box-shadow: 0 -4cqw 10cqw rgba(0, 0, 0, .6); }
.jsheet .grab { display: block; width: 12cqw; height: 1.2cqw; border-radius: 9px; background: rgba(243, 233, 210, .25); margin: 0 auto 3cqw; }
.jsheet .jpic { height: 46cqw; margin-bottom: 3cqw; border-radius: 4cqw; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 60%, rgba(242, 181, 68, .18), rgba(0, 0, 0, .35)); }
.jsheet .jpic img { max-height: 100%; max-width: 92%; object-fit: contain; }
.jsheet .jpic.dark { background: radial-gradient(circle at 50% 70%, rgba(60, 72, 110, .35), rgba(0, 0, 0, .6)); }
.jsheet .jpic.dark .sil { height: 92%; width: auto; animation: fogp 5s ease-in-out infinite; }
.fog.big { width: 40cqw; height: 40cqw; }
.jtxt small { color: var(--gold-soft); font-weight: 800; font-size: 3.3cqw; }
.jtxt h3 { margin: .5cqw 0 2cqw; font-family: var(--f-hand); font-size: 7.4cqw; color: var(--gold-soft); }
.jtxt p { margin: 0 0 2.6cqw; font-size: 4.5cqw; line-height: 1.9; }
.jsheet.unknown h3 { color: var(--mute); letter-spacing: .2em; }
.jhint { font-style: italic; color: var(--mute); }
.jwait { font-size: 3.6cqw !important; color: rgba(169, 178, 200, .6); }
.jtxt .jqv { font-family: var(--f-quran); font-size: 6.2cqw; text-align: center; }
.jtxt .jqv .orn { display: inline-block; height: 1.15em; width: .5em; vertical-align: -.22em; margin: 0 1.6cqw; color: var(--gold-soft); }
.jtxt .jqv .orn.end { transform: scaleX(-1); }
/* testing: a tap on the words hurries them on (DEV_SKIP in engine.js) */
#dialog.on { pointer-events: auto; cursor: pointer; }
/* a new journal card: small, top corner, below the buttons; it never takes a tap */
.jcard { position: absolute; z-index: 18; top: max(19cqw, calc(env(safe-area-inset-top) + 16cqw)); right: 4cqw; width: 52cqw; display: flex; align-items: center; gap: 2.6cqw; padding: 1.8cqw; pointer-events: none;
  border-radius: 3.5cqw; background: linear-gradient(135deg, rgba(38, 30, 14, .95), rgba(10, 12, 22, .95)); border: 1px solid rgba(242, 181, 68, .7); box-shadow: 0 0 6cqw rgba(242, 181, 68, .35), 0 2cqw 5cqw rgba(0, 0, 0, .5); }
.jcard img { flex: none; width: 15cqw; height: 15cqw; border-radius: 2.4cqw; object-fit: cover; box-shadow: 0 0 0 1px rgba(242, 181, 68, .5); }
.jcard small { display: block; font-size: 2.8cqw; font-weight: 800; color: var(--gold-soft); }
.jcard b { display: block; font-size: 3.8cqw; line-height: 1.35; color: var(--cream); }
.jcard.secrets { border-color: rgba(160, 175, 215, .6); box-shadow: 0 0 6cqw rgba(140, 160, 215, .3); }
.jsheet .jpic img[src*="art/journal/"] { width: 100%; max-width: 100%; height: 100%; object-fit: cover; }
.jsheet .jpic:has(img[src*="art/journal/"]) { height: 70cqw; }
/* scene 6: the last stone lifted off the picture, splashes */
.lift { position: absolute; transform-origin: 50% 60%; pointer-events: none; }
.lift canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lift .under { position: absolute; inset: 15% 8% 5%; border-radius: 50%; background: radial-gradient(#0E1A33, rgba(14, 26, 51, 0) 70%); opacity: 0; }
#actors i.drop { position: absolute; width: 5px; height: 7px; margin: -3px 0 0 -2px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: rgba(214, 228, 255, .9); pointer-events: none; }
#actors i.ripple { position: absolute; width: 70px; height: 18px; border-radius: 50%; border: 2px solid rgba(214, 228, 255, .7); pointer-events: none; }
/* testing: start at a scene */
.jump { width: 100%; display: grid; gap: 1.6cqw; }
.jump small { font-size: 3.2cqw; color: var(--mute); }
#jumps { display: flex; flex-wrap: wrap; gap: 1.6cqw; justify-content: center; }
.jb { appearance: none; font: inherit; font-size: 3.4cqw; font-weight: 700; color: var(--cream); background: rgba(243, 233, 210, .06); border: 1px solid var(--line); border-radius: 999px; padding: 1.2cqw 3cqw; cursor: pointer; }
/* the passing of time while searching: a small clock with a spinning hand and the minutes */
#clock { position: absolute; z-index: 9; top: max(20cqw, calc(env(safe-area-inset-top) + 17cqw)); left: 50%; transform: translateX(-50%) scale(.9); display: flex; align-items: center; gap: 3cqw; padding: 2cqw 5cqw 2cqw 4cqw; border-radius: 999px; opacity: 0; transition: opacity .8s, transform .8s; pointer-events: none;
  background: rgba(5, 7, 14, .78); border: 1px solid rgba(242, 181, 68, .55); box-shadow: 0 0 6cqw rgba(242, 181, 68, .25); color: var(--gold-soft); }
#clock.on { opacity: 1; transform: translateX(-50%) scale(1); }
#clock[hidden] { display: none; }
#clock svg { width: 8cqw; height: 8cqw; }
#clock span { display: grid; line-height: 1.15; }
#clock small { font-size: 2.8cqw; color: var(--mute); }
#clock b { font: 800 5.4cqw var(--f-title); font-variant-numeric: tabular-nums; color: var(--cream); min-width: 22cqw; }
/* the big stone in the dark water (scene 6, «الحجر الذي تحرّك») */
.closeup { position: absolute; z-index: 4; left: 0; right: 0; top: 18%; height: 40%; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: radial-gradient(70% 60% at 50% 55%, rgba(8, 18, 40, .88), rgba(8, 18, 40, .55) 60%, transparent 85%); }
.closeup img { width: 86cqw; height: auto; filter: drop-shadow(0 4cqw 4cqw rgba(0, 0, 0, .6)); }
.closeup .r { position: absolute; left: 50%; top: 58%; width: 92cqw; height: 26cqw; margin: -13cqw 0 0 -46cqw; border-radius: 50%; border: 1px solid rgba(214, 228, 255, .45); animation: closeRing 2.8s ease-out infinite; }
.closeup .r2 { animation-delay: 1.4s; }
@keyframes closeRing { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.25); opacity: 0; } }
/* the torn edge of the lost page at the spine */
.stub { position: absolute; pointer-events: none; z-index: 1; opacity: .9; background: linear-gradient(90deg, #8A7448, #B39B68 55%, #9C8556); box-shadow: -2px 0 5px rgba(0, 0, 0, .45), inset -2px 0 4px rgba(50, 30, 8, .4);
  clip-path: polygon(0 0, 55% 0, 100% 4%, 62% 9%, 100% 15%, 58% 21%, 96% 28%, 52% 34%, 100% 41%, 60% 48%, 94% 55%, 55% 62%, 100% 69%, 57% 76%, 98% 83%, 54% 90%, 100% 96%, 60% 100%, 0 100%); }
/* the quiet sign of a new journal entry: one soft glow, no card */
#journalBtn.ping { animation: jping 1.4s ease-out; }
@keyframes jping { 0% { box-shadow: 0 0 0 0 rgba(242, 181, 68, .85); transform: scale(1); } 25% { transform: scale(1.22); } 100% { box-shadow: 0 0 0 5cqw rgba(242, 181, 68, 0); transform: scale(1); } }

/* scenes 8–13: words written into the picture (a sign, names over heads, names carved in stone), glued to a picture point */
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; transform-origin: 0 0; will-change: transform, opacity; line-height: 1; direction: rtl; }
.tag.sign { font-family: 'Tajawal', sans-serif; font-weight: 800; color: #1E3E9A; letter-spacing: -.01em; text-shadow: 0 .03em 0 rgba(255, 238, 150, .55); opacity: .92; }
.tag.who { font-family: var(--f-ui); font-weight: 700; color: rgba(255, 236, 200, .92); padding: .18em .55em .28em; border-radius: 999px; background: rgba(7, 11, 23, .45); text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.tag.who.me { color: #FFE3A1; background: rgba(40, 26, 6, .55); box-shadow: 0 0 .8em rgba(242, 181, 68, .55); font-weight: 800; }
.tag.carve { font-family: var(--f-hand); font-weight: 700; color: rgba(92, 62, 30, .62); text-shadow: 0 .06em 0 rgba(255, 240, 210, .35), 0 -.03em 0 rgba(60, 36, 12, .35); display: flex; gap: .45em; align-items: baseline; }
.tag.carve b { font-family: 'Tajawal', sans-serif; font-weight: 800; font-size: .8em; opacity: .85; }
.tag.carve.mine { color: rgba(84, 52, 18, .85); transition: color 1.2s, text-shadow 1.2s; }
.tag.carve.mine.lit { color: #FFE9B0; text-shadow: 0 0 .25em rgba(255, 200, 110, .95), 0 0 .8em rgba(242, 160, 60, .7), 0 .05em 0 rgba(90, 50, 10, .6); }
/* a layer that takes the touches of a search or a drag in the picture */
.seek { position: absolute; inset: 0; z-index: 9; touch-action: none; cursor: pointer; }
.dust { position: absolute; z-index: 9; width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(232, 214, 180, .75), rgba(232, 214, 180, 0) 70%); }
/* the sign of «روّاد» rising out of the fire (scene 11ب) */
.logo { position: absolute; z-index: 9; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqw; padding-bottom: 18cqh; pointer-events: none; text-align: center; transition: opacity 1.4s ease; }
.logo .drop { width: 16cqw; height: 16cqw; filter: drop-shadow(0 0 4cqw rgba(255, 190, 90, .85)); opacity: 0; }
.logo h1 { margin: 0; font-family: var(--f-title); font-weight: 800; font-size: 19cqw; line-height: 1; color: #FFE3A1; text-shadow: 0 0 7cqw rgba(242, 181, 68, .6), 0 .6cqw 2cqw rgba(0, 0, 0, .6); opacity: 0; transform: translateY(3cqw) scale(.94); letter-spacing: .02em; transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.2, .8, .2, 1); }
.logo .motto { margin: 0; font-family: var(--f-hand); font-size: 7cqw; color: var(--cream); text-shadow: 0 .4cqw 2cqw rgba(0, 0, 0, .8); opacity: 0; transition: opacity 1.4s ease; }
.logo .credits { display: grid; gap: 1.2cqw; margin-top: 7cqw; font-size: 3.6cqw; color: rgba(243, 233, 210, .78); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.logo .credits span { opacity: 0; transition: opacity 1.6s ease; }
.logo.word h1 { opacity: 1; transform: none; }
.logo.motto-on .motto { opacity: 1; }
.logo.credits-on .credits span:first-child { opacity: 1; }
.logo.credits-on .credits span:last-child { opacity: 1; transition-delay: 1.4s; }
.logo.out { opacity: 0; }
#endStars { align-items: center; gap: 2.6cqw; }
#endStars b { font-family: var(--f-title); font-weight: 800; font-size: 11cqw; line-height: 1; color: var(--gold-soft); text-shadow: 0 0 5cqw rgba(242, 181, 68, .45); }
/* the paid skip of a long scene (owner, 2026-10-30): small and quiet, so it is not the first thing the eye finds */
.skipBtn { position: absolute; z-index: 15; top: max(5cqw, calc(env(safe-area-inset-top) + 1cqw)); left: 4.5cqw; display: flex; align-items: center; gap: 1.2cqw; padding: 1.4cqw 3cqw 1.6cqw 2.6cqw;
  border: 1px solid rgba(243, 233, 210, .18); border-radius: 999px; background: rgba(7, 11, 23, .45); color: rgba(243, 233, 210, .55); font: inherit; font-size: 3.3cqw; font-weight: 700; cursor: pointer; }
.skipBtn svg { width: 3.6cqw; height: 3.6cqw; }
.skipAsk { z-index: 21; justify-content: center; background: radial-gradient(circle at 50% 45%, rgba(19, 32, 59, .9), rgba(4, 6, 14, .95)); }
.skipAsk h2 { font-size: 8cqw; }
.skipAsk p { color: var(--cream); font-size: 4.6cqw; line-height: 1.8; }
.skipAsk p b { color: var(--gold-soft); font-family: var(--f-title); font-size: 5.6cqw; }
.skipAsk .row { flex-direction: column; gap: 3.4cqw; margin-top: 3cqw; }
.skipAsk .ghostbtn { font-size: 4cqw; padding: 2.4cqw 6cqw; opacity: .8; }
.lostToast { position: absolute; z-index: 22; direction: ltr; unicode-bidi: isolate; top: 30%; left: 50%; transform: translateX(-50%); font-family: var(--f-title); font-weight: 800; font-size: 10cqw; color: #E5A23F; text-shadow: 0 0 5cqw rgba(0, 0, 0, .8); pointer-events: none; animation: lostUp 2.2s ease-out forwards; }
@keyframes lostUp { 0% { opacity: 0; transform: translate(-50%, 4cqw); } 20% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -8cqw); } }

/* map after the chapter */
#mapCard .replay { justify-self: center; min-height: 48px; padding: 0 7cqw; border: 0; border-radius: 99px; background: var(--gold, #F2B544); color: #2a1a05; font: 700 4.4cqw var(--f-title, inherit); cursor: pointer; }
