/* Lumin Reader: the reading Journey. A sibling of Lumin Vocab's Journey (its banner, sand road, paper discs, lantern
   and passport), built on the app's tokens. Idle loops run only under .idle-on (motion.idle: four at most, none under
   reduced motion, Calmer motion or Still); everything else moves once, on arrival, and only when motion is welcome.
   Copyright (C) 2026 B7 Collective LLC. Licensed under AGPL-3.0-only.
   Owner: PB-U9 (build-plan 3, 5.10, 6.13). Uses the tokens in app.css :root. */

.rj { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s3) var(--gutter) calc(var(--s8) + 64px); display: flex; flex-direction: column; gap: var(--s5); }
.rj-top { display: flex; justify-content: flex-end; align-items: center; gap: var(--s3); margin-bottom: calc(-1 * var(--s2)); }
.rj-view button { padding: 0 var(--s4); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.rj-view .icon { width: 18px; height: 18px; }
.rj-card { background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--s4) var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.rj-card h2, .rj-list h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: calc(1.375rem * var(--scale)); line-height: 1.2; }
.rj-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.rj-h3 { margin: var(--s2) 0 0; font-size: var(--t-s); font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.rj-h3 .icon { color: var(--sage); }
.rj .small, .rj-card .small { font-size: var(--t-xs); }
.rj-none { color: var(--muted); font-style: italic; font-family: var(--serif); }

/* ---- The banner (Vocab's region banner: scene, keeper, the keeper's line) ---- */
.rj-banner { position: relative; min-height: 150px; border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-lift); color: #fff; isolation: isolate; display: flex; align-items: center; }
.rj-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; z-index: -2; }
.rj-banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,10,14,.74), rgba(8,10,14,.42) 62%, rgba(8,10,14,.2)); }
.rj-btext { display: flex; flex-direction: column; gap: 2px; padding: var(--s4) calc(96px + var(--s5)) var(--s4) var(--s5); min-width: 0; }
.rj-kick { font-size: var(--t-xs); font-weight: 700; color: rgba(255,255,255,.86); letter-spacing: .02em; }
.rj-btext strong { font-family: var(--serif); font-weight: 400; font-size: calc(clamp(24px, 6vw, 38px) * var(--scale)); line-height: 1.1; text-wrap: balance; }
.rj-bsub { font-size: var(--t-s); color: rgba(255,255,255,.92); }
.rj-say { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-size: var(--t-s); line-height: 1.35; color: rgba(255,255,255,.92); max-width: 44ch; }
.rj-keeper { position: absolute; right: var(--s4); top: 50%; width: 92px; height: 92px; margin-top: -46px; border-radius: 50%; object-fit: cover; background: var(--tile);
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 10px 24px -8px rgba(0,0,0,.55); animation: rjKeeperIn .7s var(--spring) .25s both; }
@keyframes rjKeeperIn { from { opacity: 0; transform: translateY(18px) scale(.6) rotate(-10deg); } }
@media (min-width: 900px) { .rj-banner { min-height: 176px; } .rj-keeper { width: 124px; height: 124px; margin-top: -62px; right: var(--s6); } .rj-btext { padding-right: calc(124px + var(--s7)); } }
@media (max-width: 359px) { .rj-keeper { width: 64px; height: 64px; margin-top: -32px; right: var(--s3); top: var(--s5); } .rj-btext { padding: var(--s4) calc(64px + var(--s4)) var(--s4) var(--s4); } .rj-say { margin-right: calc(-64px - var(--s2)); } }

/* ---- Two columns on wide screens: the road on the left, the lantern, atlas, passport and stats on the right ---- */
.rj-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.rj-c1, .rj-c2 { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
@media (min-width: 1024px) { .rj-cols { grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s6); align-items: start; } }

/* ---- The book switcher ---- */
.rj-switch { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px 2px var(--s2); scrollbar-width: none; }
.rj-switch::-webkit-scrollbar { display: none; }
.rj-switch a { flex: 0 0 auto; display: flex; align-items: center; gap: var(--s2); min-height: 52px; max-width: 240px; padding: 4px var(--s3) 4px 4px; border-radius: var(--r-m); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--t-s); box-shadow: 0 0 0 1px var(--line), 0 2px 0 var(--lip); }
.rj-switch a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rj-switch .cover.small { width: 30px; border-radius: 4px; }
.rj-switch a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 24%, var(--card)); box-shadow: 0 0 0 2px var(--accent), 0 2px 0 var(--accent-lip); }
.rj-switch a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* ---- The expedition header ---- */
.rj-exp { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.rj-eyebrow { font-size: var(--t-xs); font-weight: 700; letter-spacing: .07em; color: var(--muted); }
.rj-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--t-2xl); line-height: 1.1; text-wrap: balance; }
.rj-title a { color: inherit; text-decoration: none; }
.rj-title a:hover { text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
.rj-by { margin: 0; color: var(--muted); font-size: var(--t-s); }
.rj-promise { margin: 2px 0 0; font-family: var(--serif); font-style: italic; color: var(--muted); max-width: 38ch; text-wrap: balance; }

/* ---- The road: ground, the sand road with its shadow, edge and footsteps, the gold walked line ---- */
.rj-road { position: relative; display: flex; flex-direction: column; gap: var(--s4); margin-inline: calc(var(--gutter) * -1); }
@media (min-width: 1024px) { .rj-road { margin-inline: 0; } }
.rj-road { --road: #EFE6D4; --road-edge: #C7B595; --road-shadow: rgba(60,44,20,.16); --trail-dot: rgba(120,96,58,.55); }
[data-theme="dark"] .rj-road { --road: #343E49; --road-edge: #1E252D; --road-shadow: rgba(0,0,0,.45); --trail-dot: rgba(236,239,242,.42); }
.rj-slot { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.rj-map { position: relative; width: 100%; overflow: hidden; isolation: isolate; }
@media (min-width: 1024px) { .rj-map { border-radius: 26px; } }
.rj-map.loading { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--soft) 60%, transparent) 30%, transparent); }
.rj-ground { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--ground) 50% 0 / 300px repeat; opacity: .5; filter: saturate(.7);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 90px, #000 calc(100% - 140px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 90px, #000 calc(100% - 140px), transparent); }
[data-theme="dark"] .rj-ground { opacity: .18; filter: saturate(.45) brightness(.8); }
.rj-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rj-trail path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rj-trail .rj-rs { stroke: var(--road-shadow); stroke-width: 50; transform: translateY(5px); filter: blur(3px); }
.rj-trail .rj-re { stroke: var(--road-edge); stroke-width: 44; }
.rj-trail .rj-rd { stroke: var(--road); stroke-width: 39; }
.rj-trail .rj-dots { stroke: var(--trail-dot); stroke-width: 5; stroke-dasharray: 0 15; }
.rj-trail .rj-walk { stroke: var(--accent); stroke-width: 6; filter: drop-shadow(0 0 5px rgba(242,181,68,.55)); }

.rj-camps { list-style: none; margin: 0; padding: 0; }
.rj-camp { position: absolute; z-index: 10000; transform: translateX(-50%); width: 184px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: none; text-align: center; -webkit-tap-highlight-color: transparent; animation: rjCampIn .55s var(--spring) both; animation-delay: calc(var(--j, 0) * 90ms + 120ms); }
@keyframes rjCampIn { from { opacity: 0; translate: 0 18px; scale: .85; } }
.rj-disc { position: relative; width: 78px; height: 78px; border-radius: 50%; overflow: hidden; background: var(--tile); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--card), 0 5px 0 4px var(--lip), 0 18px 26px -14px rgba(24,33,43,.5); transition: transform var(--d2) var(--spring); }
.rj-disc .rj-num { font-family: var(--serif); font-size: 22px; color: var(--muted); letter-spacing: .02em; }
[data-theme="dark"] .rj-disc { background: #2A3540; }
[data-theme="dark"] .rj-disc .rj-num { color: #C3CBD3; }
.rj-camp.done .rj-disc::after { content: ""; position: absolute; inset: 0; background: rgba(242,181,68,.22); }
.rj-camp.done .rj-num { color: var(--ink); }
.rj-check { position: absolute; z-index: 2; right: 2px; bottom: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 var(--accent-lip); }
.rj-check .icon { width: 15px; height: 15px; stroke-width: 3; }
.rj-gem { position: absolute; z-index: 2; left: 2px; bottom: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); color: var(--sage); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px var(--sage); }
.rj-gem .icon { width: 14px; height: 14px; }
.rj-camp.ahead .rj-disc { filter: grayscale(.5); opacity: .9; box-shadow: 0 0 0 4px var(--card), 0 4px 0 4px var(--lip); }
.rj-camp.current .rj-disc { width: 96px; height: 96px; overflow: visible; box-shadow: 0 0 0 5px var(--accent), 0 6px 0 5px var(--accent-lip), 0 22px 30px -14px rgba(24,33,43,.55); }
.rj-camp.current .rj-disc .cover { width: 96px; height: 96px; border-radius: 50%; aspect-ratio: auto; }
.rj-camp.current .rj-disc .cover img { object-position: 50% 30%; }
.rj-camp.current::before { content: ""; position: absolute; top: 0; left: 50%; width: 96px; height: 96px; margin-left: -48px; border-radius: 50%; box-shadow: 0 0 0 5px var(--accent); opacity: 0; pointer-events: none; }
.rj-nm { background: color-mix(in srgb, var(--card) 94%, transparent); color: var(--ink); font-weight: 700; font-size: var(--t-xs); line-height: 1.3; padding: 4px 12px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 2px 0 var(--lip); max-width: min(184px, 60vw); text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rj-camp.ahead .rj-nm { color: var(--muted); font-weight: 400; }
.rj-nl { white-space: nowrap; font-size: var(--t-xs); color: var(--ink); background: color-mix(in srgb, var(--card) 94%, transparent); padding: 3px 10px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
.rj-here { position: absolute; z-index: 3; top: -27px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-weight: 700; font-size: var(--t-xs); padding: 6px 12px; border-radius: 12px; white-space: nowrap; }
.rj-here::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.rj-camp:focus-visible { outline: none; }
.rj-camp:focus-visible .rj-disc { outline: 3px solid var(--link); outline-offset: 6px; }
@media (hover: hover) { .rj-camp.done:hover .rj-disc, .rj-camp.current:hover .rj-disc { transform: translateY(-3px); } }
.rj-camp.done:active .rj-disc, .rj-camp.current:active .rj-disc { transform: translateY(3px); }
.rj-behind { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); z-index: 10001; font-size: var(--t-xs); font-weight: 700; color: var(--muted); background: color-mix(in srgb, var(--card) 92%, transparent); padding: 3px 12px; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); white-space: nowrap; }
.rj-goal { position: absolute; left: 50%; transform: translateX(-50%); z-index: 9999; width: 220px; display: flex; flex-direction: column; align-items: center; animation: rjCampIn .6s var(--spring) .5s both; }
.rj-goal img { width: 150px; height: 150px; border-radius: 50%; background: var(--tile); box-shadow: 0 0 0 6px color-mix(in srgb, var(--card) 85%, transparent), var(--shadow-lift); filter: grayscale(.55) opacity(.82); }
.rj-goal.reached img { filter: none; box-shadow: 0 0 0 6px var(--accent), var(--shadow-lift); }
.rj-plaque { margin-top: -10px; position: relative; text-align: center; background: var(--card); border-radius: 14px; padding: 6px 14px; box-shadow: 0 0 0 1px var(--line), 0 2px 0 var(--lip); display: flex; flex-direction: column; max-width: 220px; }
.rj-plaque b { font-family: var(--serif); font-weight: 400; font-size: calc(1.125rem * var(--scale)); }
.rj-plaque small { font-size: var(--t-xs); color: var(--muted); }
.rj-whole { align-self: center; margin-top: calc(-1 * var(--s3)); }
@media (max-width: 599px) { .rj-goal img { width: 120px; height: 120px; } .rj-banner { min-height: 132px; } .rj-lamp { width: 60px; height: 60px; } .rj-promise { font-size: var(--t-s); } }

/* scenery beside the road: a tap brings it to life for a moment */
.rj-decor { position: absolute; inset: 0; pointer-events: none; }
.rj-dc { position: absolute; display: block; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; animation: rjDecorIn .7s var(--spring) both; animation-delay: calc(var(--i, 0) * 70ms + 380ms); }
.rj-dc::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: 2%; height: 14%; border-radius: 50%; background: radial-gradient(closest-side, rgba(40,30,15,.3), transparent); }
[data-theme="dark"] .rj-dc::before { background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); }
.rj-dc img { position: relative; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 92%; }
.rj-dc img.flip { scale: -1 1; }
[data-theme="dark"] .rj-dc img { filter: brightness(.88); }
@keyframes rjDecorIn { from { opacity: 0; transform: translateY(10px) scale(.85); } }
.rj-fx { position: absolute; z-index: 3; pointer-events: none; display: block; line-height: 0; }
.rj-fx.ring { width: 70%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(124,198,206,.8); }
.rj-fx.flake { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.9); }

/* ---- Treasures and roads, on the road (one strip each; they scroll sideways on phones) ---- */
.rj-onroad { margin-inline: var(--gutter); margin-top: calc(-1 * var(--s4)); position: relative; background: color-mix(in srgb, var(--card) 94%, transparent); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--s2) var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
@media (min-width: 1024px) { .rj-onroad { margin-inline: 0; } }
.rj-onroad .rj-h3 { margin: 0; }
.rj-treasure { display: flex; gap: var(--s2); overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.rj-treasure::-webkit-scrollbar { display: none; }
@media (min-width: 600px) { .rj-treasure { flex-wrap: wrap; overflow: visible; } }
.rj-tw { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: calc(1.0625rem * var(--scale)); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 3px 0 var(--lip), 0 0 0 1px var(--line); animation: rjPop .45s var(--spring) both; animation-delay: calc(var(--i, 0) * 50ms + 200ms); }
.rj-tw:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip), 0 0 0 1px var(--line); }
.rj-tw:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
@keyframes rjPop { from { opacity: 0; transform: scale(.7); } }
.rj-roads { display: flex; align-items: center; gap: var(--s2); }
.rj-sign { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.rj-rl { list-style: none; margin: 0; padding: 2px 2px 4px; display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; }
.rj-rl::-webkit-scrollbar { display: none; }
.rj-rl li { flex: 0 0 min(240px, 72%); }
@media (min-width: 600px) { .rj-rl { flex-direction: column; overflow: visible; } .rj-rl li { flex: none; } }
.rj-rl a { display: flex; align-items: center; gap: var(--s3); color: var(--ink); text-decoration: none; min-height: 48px; border-radius: var(--r-s); }
.rj-rl a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.rj-rl .cover.small { width: 34px; border-radius: 4px; flex-shrink: 0; }
.rj-rl a span { display: flex; flex-direction: column; min-width: 0; }
.rj-rl b { font-family: var(--serif); font-weight: 400; font-size: var(--t-s); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rj-rl small { color: var(--muted); font-size: 12px; line-height: 1.25; }
@media (hover: hover) { .rj-rl a:hover b { text-decoration: underline; text-underline-offset: .15em; } }

/* ---- Empty road ---- */
.rj-empty { align-items: center; text-align: center; padding: 0 var(--gutter) var(--s5); }
.rj-emap { position: relative; width: 100%; height: 220px; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.rj-emap::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ground) 50% 0 / 300px repeat; opacity: .45; -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent); mask-image: radial-gradient(closest-side, #000 40%, transparent); }
.rj-emap::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 40px; margin-left: -20px; z-index: -1; background: var(--road, #EFE6D4); border-radius: 20px; box-shadow: 0 0 0 3px var(--road-edge, #C7B595); -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.rj-emap img { width: 120px; height: 120px; object-fit: contain; margin-left: 90px; }

/* ---- The lantern ---- */
.rj-lantern { flex-direction: row; align-items: center; gap: var(--s4); position: relative; overflow: hidden; }
.rj-lantern::before { content: ""; position: absolute; left: -50px; top: 50%; width: 230px; height: 230px; margin-top: -115px; border-radius: 50%; background: radial-gradient(circle, rgba(242,181,68, calc(var(--glow) * .45)), transparent 65%); pointer-events: none; }
.rj-lamp { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.rj-lamp img { position: relative; width: 100%; height: 100%; border-radius: 50%; background: var(--tile); box-shadow: 0 0 0 3px var(--card), 0 3px 0 3px var(--lip); }
.rj-halo { position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,120, calc(var(--glow) * .8)), transparent 66%); }
.rj-ltext { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rj-lsay { margin: 0; font-family: var(--serif); font-size: calc(1.1875rem * var(--scale)); line-height: 1.3; }
.rj-lit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rj-lit i { width: 14px; height: 18px; border-radius: 7px 7px 5px 5px; background: radial-gradient(circle at 50% 60%, #FFF4C8, #FFC94D 45%, #E8913A); box-shadow: 0 0 9px rgba(242,181,68,.7), 0 0 0 1.5px #8A5A00 inset; animation: rjLight .5s var(--spring) both; animation-delay: calc(var(--k) * 80ms + 300ms); }
@keyframes rjLight { from { opacity: 0; transform: scale(.3); filter: brightness(.4); } }
.rj-lantern.plain .rj-lamp { width: 56px; height: 56px; }

/* ---- The atlas ---- */
.rj-rgns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 600px) and (max-width: 1023px) { .rj-rgns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rj-rgn { position: relative; width: 100%; height: 100%; display: flex; align-items: center; gap: var(--s2); padding: 6px 8px; min-height: 60px; border: 0; border-radius: var(--r-m); background: var(--soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; animation: rjPop .45s var(--spring) both; animation-delay: calc(var(--k) * 50ms + 150ms); transition: transform var(--d2) var(--spring); }
.rj-rgn img { width: 46px; height: 46px; border-radius: 50%; background: var(--tile); flex-shrink: 0; }
.rj-rtx { display: flex; flex-direction: column; min-width: 0; }
.rj-rtx b { font-size: var(--t-xs); line-height: 1.25; }
.rj-rtx small { font-size: 12px; line-height: 1.3; color: var(--muted); }
.rj-rgn.fog { background: transparent; outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.rj-rgn.fog img { filter: grayscale(1) blur(1.2px) opacity(.5); }
.rj-rgn.fresh { box-shadow: 0 0 0 2px var(--accent); }
.rj-new { position: absolute; top: -6px; right: -4px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; box-shadow: 0 2px 0 var(--accent-lip); }
.rj-rgn:focus-visible, .rj-stamp:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.rj-rgn:active { transform: scale(.97); }
@media (hover: hover) { .rj-rgn:hover { transform: translateY(-2px); } }
.rj-rhead { display: flex; align-items: center; gap: var(--s3); }
.rj-rhead img { width: 72px; height: 72px; border-radius: 50%; background: var(--tile); flex-shrink: 0; }
.rj-places, .rj-explore { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rj-places li { display: flex; flex-direction: column; padding: var(--s2) var(--s3); background: var(--soft); border-radius: var(--r-s); }
.rj-places small { color: var(--muted); font-size: var(--t-xs); }
.rj-explore a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-s); color: var(--link); font-weight: 700; text-decoration: none; box-shadow: inset 0 0 0 1.5px var(--line); }
.rj-explore .icon { width: 16px; height: 16px; }

/* ---- The passport ---- */
.rj-stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4) var(--s2); }
@media (max-width: 339px) { .rj-stamps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 600px) and (max-width: 1023px) { .rj-stamps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rj-stamp { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: none; border: 0; padding: 4px 0; color: var(--ink); font: inherit; cursor: pointer; border-radius: var(--r-s); animation: rjStampDrop .55s var(--spring) both; animation-delay: calc(var(--k) * 60ms + 200ms); }
@keyframes rjStampDrop { from { opacity: 0; transform: scale(1.3) rotate(-12deg); } }
.rj-ring { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--tile); overflow: hidden; flex-shrink: 0; transform: rotate(var(--rot, 0deg)); transition: transform var(--d2) var(--spring);
  box-shadow: 0 0 0 3px var(--card), 0 0 0 5px color-mix(in srgb, var(--berry) 60%, transparent), 0 4px 0 5px var(--lip); }
.rj-ring img { width: 100%; height: 100%; object-fit: cover; }
.rj-stamp b { font-size: 12.5px; line-height: 1.25; font-weight: 700; }
.rj-stamp small { font-size: 12px; line-height: 1.3; color: var(--muted); }
.rj-stamp.open .rj-ring { background: transparent; box-shadow: none; outline: 2px dashed var(--line); outline-offset: -2px; color: var(--muted); transform: none; }
.rj-stamp.open b { color: var(--muted); }
.rj-stamp .rj-how { color: var(--muted); }
@media (hover: hover) { .rj-stamp.got:hover .rj-ring { transform: rotate(0deg) translateY(-3px); } }
.rj-stamp:active .rj-ring { transform: scale(.95); }
.rj-stamp.fresh .rj-ring { animation: rjStampFresh 1s var(--spring) .6s both; }
@keyframes rjStampFresh { 0% { transform: scale(2) rotate(-24deg); opacity: 0; } 60% { transform: scale(.94) rotate(var(--rot)); opacity: 1; } 100% { transform: rotate(var(--rot)); } }
.rj-sbig { display: flex; justify-content: center; padding: var(--s3) 0; }
.rj-sbig .rj-ring { width: 128px; height: 128px; --rot: -4deg; }
.rj-sbig:not(.got) .rj-ring { background: transparent; box-shadow: none; outline: 2px dashed var(--line); outline-offset: -2px; color: var(--muted); transform: none; }

/* ---- Your reading (Just you / You and your parents) ---- */
.rj-who { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.rj-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
@media (max-width: 339px) { .rj-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rj-stats div { display: flex; flex-direction: column; min-width: 0; }
.rj-stats b { font-family: var(--serif); font-weight: 400; font-size: calc(1.75rem * var(--scale)); line-height: 1.1; font-variant-numeric: tabular-nums; }
.rj-stats small { font-size: 12px; color: var(--muted); line-height: 1.25; }
.rj-chart { display: flex; align-items: flex-end; gap: 5px; height: 90px; padding-top: 6px; }
.rj-chart i { flex: 1; height: var(--h); border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--link) 68%, transparent); transform-origin: 50% 100%; animation: rjBar .6s var(--spring) both; animation-delay: calc(var(--k) * 40ms + 200ms); }
.rj-chart i:last-child { background: var(--link); }
.rj-chart i.z { background: var(--soft); }
@keyframes rjBar { from { transform: scaleY(0); } }
.rj-cax { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---- Your Journey (choices and Clear my reading history) ---- */
.rj-set .switch { padding-top: 0; }
.rj-hidden { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.rj-hidden li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.rj-clear { align-self: flex-start; color: var(--bad); }
.rj-undo { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.rj-undo:empty { display: none; }
.rj-off { align-items: center; text-align: center; }
.rj-off img { border-radius: 50%; background: var(--tile); }

/* ---- The camp sheet ---- */
.rj-marks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.rj-mark { display: flex; gap: var(--s2); align-items: flex-start; }
.rj-mark span { display: flex; flex-direction: column; gap: 2px; }
.rj-mark q { font-family: var(--serif); }
.rj-mark small { color: var(--muted); }
.rj-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; background: rgb(var(--hl-y)); }
.rj-dot.c-g { background: rgb(var(--hl-g)); } .rj-dot.c-b { background: rgb(var(--hl-b)); } .rj-dot.c-p { background: rgb(var(--hl-p)); } .rj-dot.c-u { background: transparent; box-shadow: inset 0 -3px 0 var(--link); border-radius: 0; }
.rj-line { display: flex; align-items: center; gap: 6px; }

/* ---- List view ---- */
.rj-list { display: flex; flex-direction: column; gap: var(--s4); max-width: var(--page); width: 100%; margin: 0 auto; }
.rj-list h3 { margin: var(--s2) 0 0; font-family: var(--serif); font-weight: 400; font-size: var(--t-l); }
.rj-lbook { display: flex; flex-direction: column; gap: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.rj-lbook:first-of-type { border-top: 0; }
.rj-lcamps { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; }
.rj-lcamps li.current { font-weight: 700; }
.rj-lplain { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.rj-ldl { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--s4); margin: 0; }
.rj-ldl dt { color: var(--muted); } .rj-ldl dd { margin: 0; font-weight: 700; }
.rj-list .rj-who { margin: 0; }

/* ---- Idle motion: only under .idle-on (motion.idle), four loops, each 3 s or slower, 18 px or less ---- */
.rj.idle-on .rj-keeper { animation: rjKeeperIn .7s var(--spring) .25s both, rjFloat 6s ease-in-out 1s infinite; }
.rj.idle-on .rj-halo { animation: rjGlow 3.6s ease-in-out infinite; }
.rj.idle-on .rj-here { animation: rjBob 3.2s ease-in-out infinite; }
.rj.idle-on .rj-camp.current::before { animation: rjRing 3.2s var(--ease) infinite; }
@keyframes rjFloat { 50% { transform: translateY(-6px) rotate(-1deg); } }
@keyframes rjGlow { 50% { transform: scale(.78); opacity: .65; } }
@keyframes rjBob { 50% { transform: translate(-50%, -4px); } }
@keyframes rjRing { 0% { transform: scale(1); opacity: .8; } 60%, 100% { transform: scale(1.32); opacity: 0; } }

/* Redrawn in place (a change from another device, a choice): no arrival motion */
.rj.still-in .rj-camp, .rj.still-in .rj-goal, .rj.still-in .rj-dc, .rj.still-in .rj-tw, .rj.still-in .rj-rgn, .rj.still-in .rj-stamp, .rj.still-in .rj-lit i, .rj.still-in .rj-chart i, .rj.still-in .rj-keeper { animation: none; }
.rj.still-in.idle-on .rj-keeper { animation: rjFloat 6s ease-in-out 1s infinite; }

/* Reduced motion, Calmer motion and Still: nothing moves by itself, nothing is drawn in */
@media (prefers-reduced-motion: reduce) { .rj *, .rj *::before, .rj *::after { animation: none !important; transition: none !important; } }
html.calm .rj *, html.calm .rj *::before, html.calm .rj *::after, html.still .rj *, html.still .rj *::before, html.still .rj *::after { animation: none !important; transition: none !important; }

/* ---- Phones: the first view holds the banner, five camps, the lantern, the atlas and the passport ---- */
@media (max-width: 599px) {
  .rj-disc { width: 72px; height: 72px; }
  .rj, .rj-cols, .rj-c1, .rj-c2 { gap: var(--s4); }
  .rj-card { padding: var(--s3) var(--s3) var(--s4); gap: var(--s2); }
  .rj-rgns { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .rj-rgn.fog small { display: none; }
  .rj-rtx b { font-size: 12px; }
  .rj-onroad { margin-top: -4px; }
  .rj-rgn { flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 6px 4px 8px; min-height: 0; }
  .rj-rgn img { width: 40px; height: 40px; }
  .rj-rtx { align-items: center; }
  .rj-rtx small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (max-width: 339px) { .rj-rgns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 379px) { .rj-rgns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 299px) { .rj-rgns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phones (where the top bar has room on its right): the Map and List switch sits in the top bar's empty corner */
@media (min-width: 360px) and (max-width: 899px) {
  .rj-top { position: relative; z-index: 7; margin-top: calc(-60px - var(--s3) + 8px); margin-bottom: 0; height: 44px; }
  .rj-view button { min-height: 44px; padding: 0 var(--s3); }
}
@media (max-width: 599px) {
  .rj-switch a { min-height: 44px; font-size: var(--t-xs); padding-block: 3px; }
  .rj-switch .cover.small { width: 24px; }
  .rj-cols.has-switch .rj-promise { display: none; }
}
