/* Earth's Dinner Table — build 3. Same palette and frame as build 2 (Menu of a Planet). */
:root {
  --infrared: #e02d34;
  --seaweed: #03e474;
  --bondi: #0197b4;
  --marine: #0040d4;
  --outer-rim: #321b7d;
  --violaceous: #75207c;
  --paper: #f3e9d8;
  --paper-dim: #c9bfd9;
  --ink: #1d1a33;
  --mint: #03e474;
  --neon: #ff4511;          /* saturated reddish orange: the console colour of build 3 (まどかの指定) */
  --neon-rgb: 255, 69, 17;
  --head-en: "Josefin Sans", "Helvetica Neue", sans-serif;
  --head-ja: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --sans: "Zen Kaku Gothic New", -apple-system, "Hiragino Sans", sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
}
/* Scripts that need their own fonts */
html[lang="dz"] { --sans: "Noto Serif Tibetan", "Kailasa", "Kokonor", "Microsoft Himalaya", "Jomolhari", serif; --head-ja: var(--sans); }
html[lang="hi"] { --sans: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Mangal", sans-serif; --head-ja: var(--sans); }
html[lang="en"] { --head-ja: var(--head-en); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--paper); font-family: var(--sans); font-size: 15px; line-height: 1.7; }

/* LED-wall texture: a dot grid over everything, plus film grain and a soft vignette (after まどか's references) */
.dots { position: fixed; inset: 0; z-index: 8; pointer-events: none; background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 0.9px, rgba(0, 0, 0, 0.38) 1.3px, rgba(0, 0, 0, 0.38) 100%); background-size: 3px 3px; mix-blend-mode: multiply; opacity: 0.8; }
.vignette { position: fixed; inset: 0; z-index: 8; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
.grain { position: fixed; inset: -50%; z-index: 8; pointer-events: none; opacity: 0.13; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain 0.6s steps(2) infinite; }
@keyframes grain { 50% { transform: translate(-3%, 2%); } }
.frame { position: fixed; inset: 10px; z-index: 7; pointer-events: none; border: 2px solid var(--neon); border-radius: 4px; box-shadow: inset 0 0 60px rgba(var(--neon-rgb), 0.18), 0 0 18px rgba(var(--neon-rgb), 0.35); }

.hud { position: fixed; top: 22px; left: 24px; z-index: 9; margin: 0; padding: 5px 12px; border: 1px solid var(--neon); background: #000; color: var(--neon); font: 11px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.blink { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: var(--neon); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.lang-switch { position: fixed; top: 20px; right: 22px; z-index: 9; display: inline-flex; padding: 3px; border: 1px solid var(--neon); background: #000; }
.lang-switch button { padding: 3px 10px; border: 0; background: transparent; color: var(--paper-dim); font: inherit; font-size: 12px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--neon); color: #000; }
.lang-switch .mute { margin-left: 2px; border-left: 1px solid rgba(243, 233, 216, 0.25); color: var(--paper); }
.lang-switch .mute[aria-pressed="true"] { color: var(--paper-dim); text-decoration: line-through; background: transparent; }
body.titling .hud { visibility: hidden; }

.screen { position: fixed; inset: 0; }
.screen[hidden], [hidden] { display: none !important; }

/* Title: a transmission on a dark console */
.title { z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(ellipse at 50% 45%, #2a0a02 0%, #000 72%); color: var(--neon); font-family: "DotGothic16", var(--mono); text-align: center; transition: opacity 0.9s ease, filter 0.9s ease; }
.title.gone { opacity: 0; filter: blur(6px) brightness(2); pointer-events: none; }
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(var(--neon-rgb), 0.06) 0 1px, transparent 1px 3px); }
.t-line { margin: 0; font-size: clamp(13px, 2vw, 17px); letter-spacing: 0.12em; text-shadow: 0 0 10px rgba(var(--neon-rgb), 0.55); }
.t-logo { margin: 0; font: 400 clamp(36px, 7vw, 76px)/1.1 "Audiowide", sans-serif; letter-spacing: 0.06em; color: var(--neon); text-shadow: 0 0 14px rgba(var(--neon-rgb), 0.9), 0 0 36px rgba(var(--neon-rgb), 0.45), 3px 0 0 rgba(255, 220, 80, 0.5), -3px 0 0 rgba(120, 60, 255, 0.5); }
html[lang="ja"] .t-logo, html[lang="dz"] .t-logo, html[lang="hi"] .t-logo { font-family: var(--head-ja); font-weight: 900; }
.t-sub { margin: -4px 0 6px; font-size: clamp(14px, 2.2vw, 20px); letter-spacing: 0.3em; }
.press { margin-top: 18px; padding: 10px 28px; border: 2px solid var(--neon); background: transparent; color: var(--neon); box-shadow: 0 0 14px rgba(var(--neon-rgb), 0.35), inset 0 0 10px rgba(var(--neon-rgb), 0.15); text-shadow: 0 0 8px rgba(var(--neon-rgb), 0.6); font: 400 18px/1 "Audiowide", sans-serif; letter-spacing: 0.25em; cursor: pointer; animation: blinkTxt 1.1s infinite steps(1); }
html[lang="ja"] .press, html[lang="dz"] .press, html[lang="hi"] .press { font-family: var(--head-ja); font-weight: 700; font-size: 15px; letter-spacing: 0.15em; }
.press:hover { background: var(--neon); color: #000; animation: none; }
.press.resume { margin-top: 8px; animation: none; opacity: 0.85; }
@keyframes blinkTxt { 50% { opacity: 0.2; } }
.t-foot { position: absolute; bottom: 40px; margin: 0; color: rgba(var(--neon-rgb), 0.5); font-size: 11px; letter-spacing: 0.2em; }

/* ---------- The Bowl ---------- */
#bowl { z-index: 2; background: linear-gradient(180deg, #170a3a 0%, #2c1366 38%, #5a1a7a 62%, #a02a6a 82%, #ff5a3a 100%); }
.dome { position: absolute; left: 2%; top: 14%; width: 72%; height: 78%; overflow: visible; }
.dome path { fill: rgba(var(--neon-rgb), 0.05); stroke: var(--neon); stroke-width: 2.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(var(--neon-rgb), 0.9)) drop-shadow(0 0 14px rgba(var(--neon-rgb), 0.5)); }
.dome .ground { fill: none; stroke-width: 0.5; }
.plot { position: absolute; width: clamp(120px, 16vw, 210px); margin: 0; transform: translate(-50%, -50%); cursor: pointer; text-align: center; }
.plot img { display: block; width: 100%; height: auto; transition: filter 0.3s; filter: saturate(1.15) drop-shadow(0 0 0 transparent); }
.plot:hover img { filter: saturate(1.2) drop-shadow(0 0 10px rgba(var(--neon-rgb), 0.8)); }
.plot[data-status="dark"] img { opacity: 0.6; filter: saturate(0.6) brightness(0.75); }
.plot[data-status="wilting"] img { filter: saturate(0.85) drop-shadow(0 0 12px rgba(224, 48, 154, 0.85)); animation: shiver 0.35s ease-in-out infinite; }
@keyframes shiver { 50% { translate: 2px 0; } }
.plot figcaption { margin-top: -6px; color: var(--neon); font-size: 12px; letter-spacing: 0.12em; text-shadow: 0 0 8px rgba(var(--neon-rgb), 0.6); }
.plot .say { z-index: 3; position: absolute; left: 50%; bottom: 100%; width: max-content; max-width: 220px; margin: 0 0 6px; padding: 6px 10px; transform: translateX(-50%); border: 1px solid var(--neon); background: rgba(10, 2, 0, 0.92); color: #ffd9c9; font-size: 12px; line-height: 1.45; white-space: pre-line; box-shadow: 0 0 12px rgba(var(--neon-rgb), 0.45); }
.plot .say::after { content: ""; position: absolute; left: 50%; top: 100%; border: 6px solid transparent; border-top-color: var(--neon); transform: translateX(-50%); }
.alien { z-index: 2; position: absolute; width: clamp(44px, 4.6vw, 70px); pointer-events: none; transform: translate(-50%, -100%); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.5)); }
/* Cute motion: the bell bobs and squashes, the 8 legs wiggle one after another, the eyes blink now and then.
   Walking makes everything faster and adds a little hop. */
.alien-svg { display: block; width: 100%; overflow: visible; animation: bob 1.8s ease-in-out infinite var(--d, 0s); transform-origin: 50% 100%; }
.alien.flip .alien-svg { scale: -1 1; }
.alien-svg .body { animation: squash 1.8s ease-in-out infinite var(--d, 0s); transform-origin: 60px 90px; transform-box: view-box; }
.alien-svg .leg { animation: wiggle 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.15s); transform-origin: top center; transform-box: fill-box; }
.alien-svg .eyes { animation: eyeblink 4.2s infinite var(--d, 0s); transform-origin: 60px 64px; transform-box: view-box; }
.alien.walking .alien-svg { animation: hop 0.5s ease-in-out infinite; }
.alien.walking .leg { animation-duration: 0.45s; }
@keyframes bob { 50% { transform: translateY(-4%); } }
@keyframes squash { 50% { transform: scale(1.04, 0.95); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
/* eyes blink by squashing; lights blink by fading (they used to share the name 'blink', so lights squashed) */
@keyframes eyeblink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes hop { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12%) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .alien-svg, .alien-svg * { animation: none !important; } }
/* The aliens' own house in the Bowl: a Futuro-style pod at the back. Windows glow and flicker gently. */
.home-pod { position: absolute; left: 38%; top: 52%; width: clamp(150px, 15vw, 230px); transform: translate(-50%, -12%); filter: drop-shadow(0 0 16px rgba(var(--neon-rgb), 0.35)); }
.futuro { display: block; width: 100%; overflow: visible; }
.futuro .win { animation: glow 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.6s); }
.futuro .atom { animation: spin 6s linear infinite; transform-origin: 100px 14px; transform-box: view-box; }
@keyframes glow { 0%, 100% { fill: #3a3fe0; } 50% { fill: #5ad0ff; } }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Panels: tree, log, calendar, card ---------- */
.panel-title { margin: 0 0 6px; color: var(--neon); font: 400 11px/1.4 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 0 8px rgba(var(--neon-rgb), 0.6); }
html[lang="ja"] .panel-title { font-family: var(--head-ja); font-weight: 700; font-size: 12px; letter-spacing: 0.16em; }
#tree { position: fixed; z-index: 4; top: 70px; right: 26px; bottom: 120px; width: min(330px, 30vw); padding: 10px 12px; border: 1px solid rgba(var(--neon-rgb), 0.5); background: rgba(12, 2, 0, 0.72); }
#tree .vines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.vine { fill: none; stroke-linecap: round; }
.vine.lit { stroke: #ff7a3d; stroke-width: 2.4; filter: drop-shadow(0 0 3px #ff4511) drop-shadow(0 0 9px rgba(255, 69, 17, 0.8)); }
.vine.warm { stroke: rgba(255, 110, 60, 0.75); stroke-width: 1.8; filter: drop-shadow(0 0 4px rgba(255, 69, 17, 0.6)); }
.vine.dim { stroke: rgba(255, 110, 60, 0.28); stroke-width: 1.4; stroke-dasharray: 2 5; }
.node { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 58px; padding: 3px 6px; transform: translate(-50%, -50%); border: 1px solid rgba(var(--neon-rgb), 0.35); background: #120300; color: #ffd9c9; font: inherit; font-size: 12px; line-height: 1.25; cursor: default; }
.node b { font-weight: 700; white-space: nowrap; }
.node small { font-size: 10px; opacity: 0.8; white-space: nowrap; }
.node.can { cursor: pointer; border-color: var(--neon); box-shadow: 0 0 10px rgba(var(--neon-rgb), 0.55); animation: breathe 1.6s ease-in-out infinite; }
.node.can:hover { background: var(--neon); color: #000; }
.node.st-done { border-color: #ff9a5c; color: #fff; box-shadow: 0 0 12px rgba(255, 140, 70, 0.7); }
.node.st-wilting { border-color: #e02d34; color: #ffb3b3; }
.node.st-dark:not(.can) { opacity: 0.55; }
.node.goal { border-width: 2px; padding: 6px 12px; font-size: 13px; }
@keyframes breathe { 50% { box-shadow: 0 0 18px rgba(var(--neon-rgb), 0.85); } }
#log { position: fixed; z-index: 4; left: 26px; top: 66px; width: min(340px, 28vw); max-height: 30vh; display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid rgba(var(--neon-rgb), 0.5); background: rgba(12, 2, 0, 0.78); }
#log ol { margin: 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; }
#log li { margin: 0 0 7px; font-size: 12.5px; line-height: 1.5; color: #ffd9c9; }
#log .when { display: block; color: rgba(var(--neon-rgb), 0.85); font: 10px/1.4 var(--mono); letter-spacing: 0.06em; }
#log a, #card a { display: block; color: #ffb38a; font-size: 11px; text-decoration: none; }
#log a:hover, #card a:hover { text-decoration: underline; }
#calendar { position: fixed; z-index: 4; top: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px 12px; border: 1px solid var(--neon); background: rgba(12, 2, 0, 0.85); box-shadow: 0 0 14px rgba(var(--neon-rgb), 0.35); }
#calendar p { margin: 0; }
#calendar .date { color: var(--neon); font: 700 13px/1 var(--mono); letter-spacing: 0.06em; text-shadow: 0 0 8px rgba(var(--neon-rgb), 0.6); }
html[lang="ja"] #calendar .date { font-family: var(--head-ja); }
#calendar .ff { display: flex; gap: 4px; }
#calendar button { padding: 3px 8px; border: 1px solid rgba(var(--neon-rgb), 0.6); background: transparent; color: #ffd9c9; font: inherit; font-size: 11px; cursor: pointer; }
#calendar button:hover:not(:disabled) { background: var(--neon); color: #000; }
#calendar button:disabled { opacity: 0.35; cursor: not-allowed; }
#calendar .waiting, #calendar .stopped { color: #ffb38a; font-size: 11px; }
#card { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); }
.card-box { width: min(560px, calc(100% - 40px)); padding: 20px 22px; border: 2px solid var(--neon); background: #140300; box-shadow: 0 0 30px rgba(var(--neon-rgb), 0.45), inset 0 0 30px rgba(var(--neon-rgb), 0.12); }
.card-box .eyebrow { margin: 0 0 8px; color: var(--neon); font: 700 12px/1 var(--mono); letter-spacing: 0.3em; text-transform: uppercase; animation: blinkTxt 1.1s infinite steps(1); }
.card-box .body { margin: 0 0 14px; color: #ffe6da; font-size: 15px; line-height: 1.75; }
.card-box .choices { display: flex; flex-direction: column; gap: 8px; }
.card-box .choices button { padding: 10px 14px; border: 1px solid var(--neon); background: transparent; color: #ffe6da; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.card-box .choices button:hover { background: var(--neon); color: #000; }
.card-box .src { margin: 12px 0 0; font-size: 11px; color: rgba(255, 217, 201, 0.7); }

/* plots pop up when they become needed */
.plot.pop { animation: popUp 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes popUp { 0% { transform: translate(-50%, -30%) scale(0.2); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* The floor of the Bowl: everything stands on it (nothing floats) */
.floor { position: absolute; left: 3%; width: 70%; top: 68%; height: 26%; filter: drop-shadow(0 0 18px rgba(224, 48, 154, 0.35)); }
.plot { z-index: 1; }

/* ---------- Pill buttons: every boxed control is a soft round "pillow" ----------
   States (after NN/g "button states"): enabled / focus (double ring) / hover (deeper) / pressed (deepest, pushed in) / disabled (pale). */
:root { --pill: linear-gradient(180deg, #ff7a3a 0%, #ff4511 100%); --pill-hover: linear-gradient(180deg, #ff5a1f 0%, #d8330a 100%); --pill-press: linear-gradient(180deg, #c22a05 0%, #9a1f02 100%); --pill-text: #fff6ef; }
.lang-switch, .hud, #calendar { border-radius: 999px; }
.lang-switch { padding: 3px; gap: 2px; }
.lang-switch button, #calendar button, .card-box .choices button, .press, .node {
  border-radius: 999px; border: 0; background: var(--pill); color: var(--pill-text); font-weight: 700;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(120, 20, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s, opacity 0.15s;
}
.lang-switch button { background: transparent; box-shadow: none; color: var(--paper-dim); font-weight: 500; }
.lang-switch button[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.press { padding: 12px 34px; animation: none; color: var(--pill-text); text-shadow: none; }
.lang-switch button:hover, #calendar button:hover:not(:disabled), .card-box .choices button:hover, .press:hover, .node.can:hover { background: var(--pill-hover); color: var(--pill-text); }
.lang-switch button:active, #calendar button:active:not(:disabled), .card-box .choices button:active, .press:active, .node.can:active { background: var(--pill-press); transform: translateY(2px); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.45); }
.lang-switch button:focus-visible, #calendar button:focus-visible, .card-box .choices button:focus-visible, .press:focus-visible, .node:focus-visible { outline: 2px solid #fff6ef; outline-offset: -6px; box-shadow: 0 0 0 3px #ff4511, 0 4px 10px rgba(0, 0, 0, 0.45); }
#calendar button:disabled { background: #ffc7ad; color: #fff; opacity: 0.55; box-shadow: none; cursor: not-allowed; }
#calendar button { padding: 4px 12px; }
.card-box .choices button { padding: 11px 18px; text-align: center; }
/* tree nodes: actionable ones are bright pills; the rest are quiet pills by state */
.node { padding: 4px 12px; animation: none; }
.node.can { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 0 16px rgba(255, 69, 17, 0.9); } }
.node:not(.can) { background: #2a0a12; color: #ffd9c9; box-shadow: inset 0 0 0 1.5px rgba(255, 120, 70, 0.45); cursor: default; }
.node.st-done:not(.can) { background: linear-gradient(180deg, #ffd23f, #ff9a3c); color: #3a1060; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 0 12px rgba(255, 190, 70, 0.7); }
.node.st-growing:not(.can) { background: linear-gradient(180deg, #2fd6b5, #1a9a8a); color: #052a26; }
.node.st-wilting:not(.can) { background: linear-gradient(180deg, #e0309a, #9a1a6a); color: #fff; }
.node.st-dark:not(.can) { opacity: 0.6; }
.node.goal { padding: 7px 16px; }
/* panels: rounded instead of square */
#tree, #log { border-radius: 22px; }
.card-box { border-radius: 26px; }
.plot .say { border-radius: 14px; }

/* ---------- The sky: friendly, not scary ---------- */
.sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stars { position: absolute; inset: 0; }
.star { animation: twinkle 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.33s); }
@keyframes twinkle { 50% { opacity: 0.25; } }
.planet { position: absolute; overflow: visible; filter: drop-shadow(0 0 18px rgba(255, 120, 200, 0.35)); animation: drift 14s ease-in-out infinite; }
.planet.ringed { left: 52%; top: 9%; width: clamp(140px, 14vw, 220px); }
.planet.crater { left: 30%; top: 4%; width: clamp(50px, 5vw, 80px); animation-duration: 18s; animation-delay: -6s; }
.planet.blue { left: 4%; top: 52%; width: clamp(60px, 6vw, 96px); animation-duration: 20s; animation-delay: -3s; }
@keyframes drift { 50% { transform: translateY(-8px) rotate(2deg); } }
.shooting { position: absolute; left: 70%; top: 6%; width: 120px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); transform: rotate(-28deg); opacity: 0; animation: shoot 7s ease-in infinite 2s; }
@keyframes shoot { 0% { opacity: 0; translate: 0 0; } 3% { opacity: 1; } 12% { opacity: 0; translate: -260px 140px; } 100% { opacity: 0; translate: -260px 140px; } }
@media (prefers-reduced-motion: reduce) { .star, .planet, .shooting { animation: none !important; } }
/* glass of the dome over the sky: a faint tint so the inside reads as "inside" */
.dome path:first-child { fill: rgba(255, 140, 200, 0.07); }

/* ---------- Buttons and panels that belong to the world (sky gradients, frosted glass) ---------- */
:root {
  --pill: linear-gradient(135deg, #ff5fa2 0%, #ff7a3a 55%, #ffb04a 100%);
  --pill-hover: linear-gradient(135deg, #e0309a 0%, #ff5a2a 60%, #ff9a3c 100%);
  --pill-press: linear-gradient(135deg, #9a1a7a 0%, #c8301a 100%);
  --glass: rgba(42, 18, 96, 0.55);
  --glass-edge: rgba(255, 170, 230, 0.35);
}
/* frosted-glass panels instead of black boxes */
#tree, #log, #calendar, .lang-switch, .hud, .card-box {
  background: var(--glass); border: 1px solid var(--glass-edge);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 10px 30px rgba(20, 0, 50, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.card-box { background: linear-gradient(160deg, rgba(60, 22, 120, 0.92), rgba(120, 26, 110, 0.92)); border: 1px solid rgba(255, 170, 230, 0.5); }
.panel-title, .card-box .eyebrow, #calendar .date, .hud { color: #ffd6f0 !important; text-shadow: 0 0 10px rgba(255, 95, 162, 0.7); }
.card-box .body { color: #fff1fb; }
#log li { color: #fbe9ff; }
#log .when { color: #ffb0dc; }
#log a, #card a { color: #9ad8ff; }

/* glossy candy pills: gradient body, a white highlight on top, a soft coloured glow */
.lang-switch button, #calendar button, .card-box .choices button, .press, .node.can {
  position: relative; overflow: hidden; background: var(--pill); color: #fff;
  text-shadow: 0 1px 2px rgba(120, 10, 60, 0.5);
  box-shadow: inset 0 -3px 0 rgba(120, 20, 80, 0.35), 0 4px 14px rgba(255, 95, 162, 0.45);
}
.lang-switch button::before, #calendar button::before, .card-box .choices button::before, .press::before, .node.can::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 2px; height: 42%; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); pointer-events: none;
}
.lang-switch button { background: transparent; box-shadow: none; text-shadow: none; color: #ffd6f0; }
.lang-switch button::before { display: none; }
.lang-switch button[aria-pressed="true"] { background: var(--pill); color: #fff; box-shadow: 0 2px 8px rgba(255, 95, 162, 0.5); }
.lang-switch button[aria-pressed="true"]::before { display: block; }
.lang-switch button:hover, #calendar button:hover:not(:disabled), .card-box .choices button:hover, .press:hover, .node.can:hover { background: var(--pill-hover); box-shadow: inset 0 -3px 0 rgba(120, 20, 80, 0.35), 0 6px 20px rgba(255, 95, 162, 0.7); }
.lang-switch button:active, #calendar button:active:not(:disabled), .card-box .choices button:active, .press:active, .node.can:active { background: var(--pill-press); }
#calendar button:disabled { background: rgba(255, 200, 235, 0.25); color: rgba(255, 255, 255, 0.6); text-shadow: none; }
#calendar button:disabled::before { display: none; }
.press { font-size: 16px; letter-spacing: 0.2em; }

/* tree nodes: state colours from the world's palette */
.node:not(.can) { background: rgba(50, 20, 110, 0.7); color: #f3e2ff; box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.35); }
.node.st-done:not(.can) { background: linear-gradient(135deg, #ffe36a, #ffb04a); color: #4a1a7a; box-shadow: 0 0 14px rgba(255, 210, 63, 0.65), inset 0 2px 0 rgba(255, 255, 255, 0.6); }
.node.st-growing:not(.can) { background: linear-gradient(135deg, #7cf5c0, #2bb3ff); color: #08304a; box-shadow: 0 0 12px rgba(91, 208, 255, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.node.st-wilting:not(.can) { background: linear-gradient(135deg, #ff5fa2, #9a3fe4); color: #fff; box-shadow: 0 0 14px rgba(224, 48, 154, 0.7); }
@keyframes breathe { 50% { box-shadow: inset 0 -3px 0 rgba(120, 20, 80, 0.35), 0 0 22px rgba(255, 95, 162, 0.95); } }
/* the vines take the sky's colours too: warm when done, cool while growing */
.vine.lit { stroke: #ffd23f; filter: drop-shadow(0 0 3px #ff7a3a) drop-shadow(0 0 9px rgba(255, 95, 162, 0.8)); }
.vine.warm { stroke: rgba(255, 140, 210, 0.85); filter: drop-shadow(0 0 4px rgba(255, 95, 162, 0.6)); }
.vine.dim { stroke: rgba(220, 180, 255, 0.35); }
/* the outer frame and the dome line in the same pink-orange */
.frame { border-color: rgba(255, 140, 210, 0.6); box-shadow: inset 0 0 60px rgba(255, 95, 162, 0.15), 0 0 18px rgba(255, 95, 162, 0.25); }
.dome path { stroke: #ff9ad5; filter: drop-shadow(0 0 4px rgba(255, 95, 162, 0.9)) drop-shadow(0 0 14px rgba(255, 95, 162, 0.45)); }
.plot figcaption { color: #fff1fb; text-shadow: 0 0 8px rgba(224, 48, 154, 0.9), 0 1px 2px rgba(0, 0, 0, 0.6); }
.plot .say { background: linear-gradient(160deg, rgba(60, 22, 120, 0.95), rgba(120, 26, 110, 0.95)); border-color: #ff9ad5; color: #fff1fb; }
.plot .say::after { border-top-color: #ff9ad5; }
/* tree nodes stay absolutely placed even with the glossy pill style; softer highlight */
.node, .node.can { position: absolute; }
.lang-switch button::before, #calendar button::before, .card-box .choices button::before, .press::before, .node.can::before { height: 38%; background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); }

/* ---------- One world for the whole UI ---------- */
/* Readable type wherever you have to read or choose: a clean gothic, a bit larger, roomy lines */
:root { --read: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; }
html[lang="en"] { --read: "Josefin Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[lang="dz"] { --read: "Noto Serif Tibetan", "Kailasa", "Kokonor", "Microsoft Himalaya", "Jomolhari", serif; }
html[lang="hi"] { --read: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Mangal", sans-serif; }
.card-box .body, .card-box .choices button, #log li, .plot .say, .node b, .node small, #calendar, .lang-switch button, .press, .t-line, .t-sub, .t-foot, .hud { font-family: var(--read); }
.card-box .body { font-size: 16.5px; line-height: 1.85; font-weight: 500; letter-spacing: 0.02em; }
.card-box .choices button { font-size: 15.5px; font-weight: 700; letter-spacing: 0.02em; padding: 13px 20px; }
#log li { font-size: 13.5px; line-height: 1.65; }
#calendar .date { font-family: var(--read); font-variant-numeric: tabular-nums; font-size: 14px; }
.hud { font-size: 12px; text-transform: none; letter-spacing: 0.06em; }

/* Title: the same sky, a candy-gradient logo, readable lines */
.title { background: linear-gradient(180deg, #170a3a 0%, #2c1366 40%, #5a1a7a 65%, #a02a6a 85%, #ff5a3a 100%); color: #ffe6f6; }
.title .scan { display: none; }
.title > :not(.sky):not(.t-foot) { position: relative; z-index: 1; }
.title .t-foot { z-index: 1; }
.t-logo { color: transparent; background: linear-gradient(135deg, #ffe36a 0%, #ff7a3a 45%, #ff5fa2 100%); -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 0 18px rgba(255, 95, 162, 0.55)); }
.t-line, .t-sub { color: #ffd6f0; text-shadow: 0 0 10px rgba(255, 95, 162, 0.6); }
.t-sub { letter-spacing: 0.4em; font-weight: 700; }
.t-foot { color: rgba(255, 214, 240, 0.55); }

/* Tree as a network map: dots and curved lines; labels sit under the dots */
.vines .web { fill: none; stroke: rgba(200, 170, 255, 0.12); stroke-width: 0.8; }
.vines .halo { opacity: 0.18; }
.vines .halo.pulse { animation: halo 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { 50% { opacity: 0.45; transform: scale(1.25); } }
.vines .dot { filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35)); }
.vine.lit { stroke: #ffd23f; }
.vine.warm { stroke: #ff5fa2; }
.vine.dim { stroke: rgba(154, 122, 208, 0.45); stroke-dasharray: none; stroke-width: 1.1; }
.node, .node.can, .node:not(.can), .node.st-done:not(.can), .node.st-growing:not(.can), .node.st-wilting:not(.can) {
  transform: translate(-50%, 0); padding: 1px 8px 2px; min-width: 0; background: transparent; box-shadow: none; color: #f6ecff; animation: none; text-shadow: 0 1px 3px rgba(20, 0, 50, 0.9);
}
.node::before { display: none !important; }
.node b { font-size: 12px; font-weight: 700; }
.node small { font-size: 10px; opacity: 0.75; }
.node.st-done b { color: #ffe36a; }
.node.st-growing b { color: #8fd8ff; }
.node.st-wilting b { color: #ff8fb0; }
.node.goal b { font-size: 14px; }
/* what you can do now: the label becomes a small candy pill */
.node.can { background: var(--pill); border-radius: 999px; color: #fff; box-shadow: 0 3px 12px rgba(255, 95, 162, 0.55); cursor: pointer; }
.node.can small { opacity: 0.95; }
.node.can:hover { background: var(--pill-hover); }
.node.can:active { background: var(--pill-press); }

/* Earth in the sky, and the procurement UFO that flies there and back */
.planet.earth { left: auto; right: 30%; top: 3%; width: clamp(46px, 4.4vw, 70px); filter: drop-shadow(0 0 14px rgba(120, 200, 255, 0.6)); }
.earth-label { position: absolute; right: 30%; top: calc(3% + clamp(46px, 4.4vw, 70px) + 2px); width: clamp(46px, 4.4vw, 70px); text-align: center; color: #bfe9ff; font: 700 9px/1 var(--mono); letter-spacing: 0.25em; opacity: 0.8; }
.run { position: absolute; z-index: 3; width: clamp(54px, 5vw, 80px); transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 0 10px rgba(255, 210, 63, 0.7)); }
.run svg { display: block; width: 100%; animation: wobble 0.6s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(-6deg) translateY(-2px); } }
.run .cargo { position: absolute; left: 50%; top: 92%; transform: translateX(-50%) scale(0); padding: 2px 8px; border-radius: 999px; background: var(--pill); color: #fff; font: 700 11px/1.5 var(--read); white-space: nowrap; box-shadow: 0 2px 8px rgba(255, 95, 162, 0.6); transition: transform 0.3s cubic-bezier(0.2, 1.6, 0.4, 1); }
.run.carrying .cargo { transform: translateX(-50%) scale(1); }
.run .beam { position: absolute; left: 50%; top: 70%; width: 70%; height: 0; transform: translateX(-50%); background: linear-gradient(180deg, rgba(255, 227, 106, 0.85), rgba(255, 227, 106, 0)); clip-path: polygon(35% 0, 65% 0, 100% 100%, 0 100%); transition: height 0.4s; }
.run.beaming .beam { height: 260%; }
.run.beaming .cargo { transition: transform 0.6s ease-in, top 0.9s ease-in; top: 260%; transform: translateX(-50%) scale(0.6); }

/* Planets at different sizes and distances: a huge ringed planet cut by the edge, a big one peeking from a corner, tiny far ones */
.planet.ringed { left: 44%; top: -9%; width: clamp(320px, 36vw, 560px); filter: drop-shadow(0 0 30px rgba(255, 120, 200, 0.4)); animation-duration: 26s; }
.planet.crater { left: auto; right: -7%; top: auto; bottom: -14%; width: clamp(240px, 26vw, 400px); opacity: 0.95; animation-duration: 30s; }
.planet.blue { left: 3%; top: 48%; width: clamp(36px, 3.4vw, 54px); opacity: 0.85; filter: blur(0.4px) drop-shadow(0 0 10px rgba(120, 200, 255, 0.5)); }
.planet.earth { right: 31%; top: 4%; width: clamp(40px, 3.8vw, 60px); }
.earth-label { right: 31%; top: calc(4% + clamp(40px, 3.8vw, 60px) + 2px); width: clamp(40px, 3.8vw, 60px); }
.far { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0%, var(--c) 45%, transparent 75%); opacity: 0.7; filter: blur(0.5px); }
/* friends and family: arrive with a bounce; children are smaller */
.alien.child { width: clamp(30px, 3vw, 46px); }
.alien.arriving .alien-svg { animation: land 0.9s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes land { 0% { transform: translateY(-260%) scale(0.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateY(0) scale(1); } }

/* Earth moved off the ringed planet, into the open sky left of centre */
.planet.earth { left: 33%; right: auto; top: 13%; }
.earth-label { left: 33%; right: auto; top: calc(13% + clamp(40px, 3.8vw, 60px) + 2px); }

/* a bigger procurement UFO */
.run { width: clamp(96px, 9vw, 150px); }
.run .cargo { font-size: 12.5px; padding: 3px 10px; }

/* ---------- Onboarding story ---------- */
#story { z-index: 5; background: linear-gradient(180deg, #170a3a 0%, #2c1366 40%, #5a1a7a 65%, #a02a6a 85%, #ff5a3a 100%); overflow: hidden; }
.story-earth { position: absolute; left: 50%; top: 9%; width: clamp(120px, 14vw, 200px); aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9ae0ff 0%, #2b8fe0 45%, #1f3fb0 100%); box-shadow: 0 0 60px rgba(120, 200, 255, 0.55), inset -18px -18px 40px rgba(0, 0, 60, 0.45); animation: drift 12s ease-in-out infinite; }
.story-earth::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background:
  radial-gradient(ellipse 22% 14% at 34% 36%, #5fd66b 60%, transparent 62%), radial-gradient(ellipse 16% 22% at 64% 58%, #5fd66b 60%, transparent 62%), radial-gradient(ellipse 10% 8% at 30% 66%, #5fd66b 60%, transparent 62%); opacity: 0.9; }
#story .planet.earth, #story .earth-label { display: none; }
.record { position: absolute; left: 50%; top: 8%; width: min(560px, 60vw); margin: 0; transform: translateX(-50%); padding: 10px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: 0 0 40px rgba(255, 95, 162, 0.35); animation: popUp 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); z-index: 2; }
.record img { display: block; width: 100%; border-radius: 14px; }
.record figcaption { margin-top: 6px; color: #ffd6f0; font: 700 12px/1.4 var(--read); text-align: center; letter-spacing: 0.06em; }
.cast { position: absolute; left: 0; right: 0; bottom: 30%; display: flex; justify-content: center; gap: 12vw; align-items: flex-end; }
.who { width: clamp(90px, 9vw, 140px); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4)); transition: transform 0.3s; }
.who.kid { width: clamp(66px, 6.4vw, 100px); }
.who.speaking { transform: translateY(-8px) scale(1.06); }
.who .alien-svg { animation: bob 1.8s ease-in-out infinite; }
.who.speaking .alien-svg .leg { animation-duration: 0.6s; }
.talk { position: absolute; left: 50%; bottom: 6%; width: min(720px, 86vw); transform: translateX(-50%); padding: 18px 22px 16px; border-radius: 26px; background: linear-gradient(160deg, rgba(60, 22, 120, 0.9), rgba(120, 26, 110, 0.9)); border: 1px solid rgba(255, 170, 230, 0.5); box-shadow: 0 10px 40px rgba(20, 0, 50, 0.5); backdrop-filter: blur(10px); }
.talk .name { margin: 0 0 4px; color: #ffb0dc; font: 700 12px/1 var(--read); letter-spacing: 0.2em; }
.talk .line { margin: 0; min-height: 3.6em; color: #fff3fb; font: 500 18px/1.75 var(--read); letter-spacing: 0.02em; }
.talk-next { position: absolute; right: 18px; bottom: 14px; padding: 7px 16px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 13px/1 var(--read); cursor: pointer; box-shadow: 0 4px 14px rgba(255, 95, 162, 0.45); }
.talk-next:hover { background: var(--pill-hover); }
.ask { margin-top: 12px; }
.ask-form { display: flex; gap: 8px; }
.ask-input { flex: 1; padding: 12px 18px; border-radius: 999px; border: 1px solid rgba(255, 170, 230, 0.6); background: rgba(20, 6, 50, 0.6); color: #fff; font: 500 16px/1.2 var(--read); outline: none; }
.ask-input:focus { border-color: #ffb0dc; box-shadow: 0 0 0 3px rgba(255, 95, 162, 0.45); }
.ask-input::placeholder { color: rgba(255, 214, 240, 0.55); }
.ask-go { padding: 0 22px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 15px/1 var(--read); cursor: pointer; box-shadow: 0 4px 14px rgba(255, 95, 162, 0.45); }
.ask-go:hover { background: var(--pill-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 170, 230, 0.5); background: rgba(255, 255, 255, 0.08); color: #ffe6f6; font: 500 13px/1.2 var(--read); cursor: pointer; }
.chip:hover { background: rgba(255, 95, 162, 0.35); }
/* the goal stays on screen in the Bowl */
.goalchip { position: fixed; z-index: 6; left: 50%; top: 66px; transform: translateX(-50%); margin: 0; padding: 6px 16px; border-radius: 999px; background: var(--pill); color: #fff; font: 700 13px/1.2 var(--read); letter-spacing: 0.04em; box-shadow: 0 4px 16px rgba(255, 95, 162, 0.5); }

/* the story happens on a lovely spot of the home planet: pink sand dunes, a pool, their house — feet on the ground */
.homeland { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 58%; }
.story-house { position: absolute; right: 10%; bottom: 44%; width: clamp(130px, 13vw, 200px); filter: drop-shadow(0 8px 10px rgba(80, 0, 60, 0.35)); }
#story .cast { bottom: 27%; gap: 7vw; }
#story .who::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: -4px; height: 10px; border-radius: 50%; background: rgba(120, 20, 80, 0.35); filter: blur(2px); }
#story .who { position: relative; }
#story .planet.crater { opacity: 0.6; }

#story .story-earth { left: 30%; top: 8%; }
#story .planet.ringed { left: 56%; top: -6%; }

/* Earth's dinner tables as floating sphere panels */
.record { top: 6%; width: min(1000px, 92vw); padding: 14px 16px 10px; }
.spheres { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px; }
.sphere { margin: 0; width: clamp(80px, 8.4vw, 124px); text-align: center; animation: drift 7s ease-in-out infinite, popUp 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) backwards; animation-delay: calc(var(--k) * -0.7s), calc(var(--k) * 0.08s); }
.sphere img { display: block; width: 100%; filter: drop-shadow(0 6px 14px rgba(255, 95, 162, 0.45)); }
.sphere figcaption { margin-top: 2px; color: #fff3fb; font: 700 11.5px/1.3 var(--read); }
.sphere small { display: block; color: #ffb0dc; font-weight: 500; font-size: 10px; }
.record .photo { display: block; width: 100%; border-radius: 14px; }
/* key ingredients to pick */
.keys { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.key { display: inline-flex; flex-direction: column; align-items: center; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 15px/1.2 var(--read); cursor: pointer; box-shadow: 0 4px 14px rgba(255, 95, 162, 0.5); }
.key:hover { background: var(--pill-hover); }
.key.locked { background: rgba(255, 255, 255, 0.08); color: rgba(255, 230, 246, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.3); cursor: not-allowed; }
.key small { font-size: 10px; font-weight: 500; }
.key.finish { background: linear-gradient(135deg, #ffe36a, #ffb04a); color: #4a1a7a; }
/* "done!" and the Zukan */
#next, #zukan { position: fixed; inset: 0; z-index: 11; display: grid; place-items: center; background: rgba(10, 0, 30, 0.55); }
#next[hidden], #zukan[hidden] { display: none; }
.next-box, .zukan-box { width: min(560px, calc(100% - 40px)); max-height: 86vh; overflow: auto; padding: 22px 24px; border-radius: 28px; background: linear-gradient(160deg, rgba(60, 22, 120, 0.95), rgba(120, 26, 110, 0.95)); border: 1px solid rgba(255, 170, 230, 0.5); box-shadow: 0 0 40px rgba(255, 95, 162, 0.45); color: #fff3fb; text-align: center; }
.next-box .burst { font-size: 56px; line-height: 1; animation: popUp 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
.next-box .eyebrow, .zukan-box .eyebrow { margin: 8px 0 4px; color: #ffd6f0; font: 900 20px/1.3 var(--read); }
.next-box .body { font: 500 15px/1.75 var(--read); }
.next-box .keys { justify-content: center; }
.ghostbtn { margin-top: 10px; padding: 7px 16px; border-radius: 999px; border: 1px solid rgba(255, 170, 230, 0.6); background: transparent; color: #ffe6f6; font: 700 13px/1 var(--read); cursor: pointer; }
.zukan-box { width: min(760px, calc(100% - 40px)); text-align: left; }
.zukan-box .count { margin: 0 0 10px; color: #ffb0dc; font: 700 13px/1 var(--read); }
.zlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.z { padding: 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.3); font-family: var(--read); }
.z .ic { display: block; font-size: 32px; line-height: 1.2; }
.z b { display: block; font-size: 14px; }
.z small { display: block; color: #ffb0dc; font-size: 10.5px; }
.z p { margin: 6px 0 4px; font-size: 11.5px; line-height: 1.5; color: #f3e2ff; }
.z a { display: block; color: #9ad8ff; font-size: 10.5px; text-decoration: none; }
.z.locked .ic { filter: grayscale(1) brightness(0.25); }
.z.locked b { color: rgba(255, 230, 246, 0.45); }
.zukan-box .zclose { display: block; margin: 14px auto 0; padding: 9px 22px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 14px/1 var(--read); cursor: pointer; }
.zukan-btn { position: fixed; z-index: 9; left: 140px; top: 20px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 12px/1.2 var(--read); cursor: pointer; box-shadow: 0 4px 12px rgba(255, 95, 162, 0.5); }
.goalchip { top: 72px; }

/* ---------- Story scenes: show, don't tell ---------- */
.scene.web { position: absolute; left: 50%; top: 5%; width: min(360px, 40vw); transform: translateX(-50%); z-index: 2; animation: popUp 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); filter: drop-shadow(0 0 30px rgba(255, 95, 162, 0.45)); }
.scene.web svg { display: block; width: 100%; }
.scene.web .spin { transform-origin: 160px 160px; animation: spinweb 24s linear infinite; }
.scene.web .critter > * { transform-box: fill-box; }
.scene.web .critter { animation: nib 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.27s); }
.scene.web .eat { fill: none; stroke: #ff9ad5; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 6 8; animation: flow 1.2s linear infinite; filter: drop-shadow(0 0 4px rgba(255, 95, 162, 0.9)); }
@keyframes spinweb { to { transform: rotate(360deg); } }
@keyframes flow { to { stroke-dashoffset: -28; } }
@keyframes nib { 50% { opacity: 0.75; } }
#story.bare .story-earth { opacity: 0.35; transform: translateX(-50%) scale(0.7); transition: all 1.2s; }
.scene.build { position: absolute; left: 0; right: 0; bottom: 28%; width: 100%; height: 46%; z-index: 1; pointer-events: none; }
.dome-draw { fill: none; stroke: #ff9ad5; stroke-width: 3; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 2.4s ease-out forwards; filter: drop-shadow(0 0 6px rgba(255, 95, 162, 0.9)); }
.dome-draw.floor { animation-delay: 0.6s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.scene.ufo-go { position: absolute; right: 13%; bottom: 52%; width: 70px; height: 26px; border-radius: 50%; background: linear-gradient(180deg, #ffe36a, #ff7a3a); box-shadow: 0 0 18px rgba(255, 210, 63, 0.8); animation: liftoff 3.2s ease-in 1.4s forwards; opacity: 0; }
.scene.ufo-go::before { content: ""; position: absolute; left: 30%; top: -10px; width: 40%; height: 14px; border-radius: 50% 50% 0 0; background: #9ad8ff; }
@keyframes liftoff { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 30% { transform: translate(-20px, -40px) scale(1); } 100% { opacity: 0; transform: translate(-36vw, -40vh) scale(0.2); } }
.talk .line { min-height: 1.8em; font-size: 20px; }

/* Earth's tables float scattered like planets: free positions, sizes by depth, small ones fainter */
.record { top: 3%; left: 0; width: 100%; height: 56%; transform: none; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.record .spheres { position: relative; display: block; width: 100%; height: 100%; }
.record .sphere { position: absolute; width: calc(clamp(90px, 9vw, 140px) * var(--z)); transform: translate(-50%, 0); opacity: calc(0.55 + var(--z) * 0.35); filter: blur(calc((1.2 - var(--z)) * 1px)); }
.record .sphere figcaption { font-size: calc(11px * var(--z)); }
.record > figcaption { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); white-space: nowrap; padding: 4px 12px; border-radius: 999px; background: var(--glass); }

/* the glimpse: a bird dives, catches a fish, flies off; loops slowly */
.scene.web .gl-fish { animation: fishjump 4s ease-in-out infinite; }
.scene.web .gl-bird { animation: birddive 4s ease-in-out infinite; }
.scene.web .gl-splash { animation: splash 4s ease-out infinite; opacity: 0; }
@keyframes fishjump { 0%, 30% { transform: translate(150px, 220px) rotate(-20deg); opacity: 1; } 42% { transform: translate(160px, 196px) rotate(-30deg); opacity: 1; } 48% { transform: translate(168px, 184px); opacity: 1; } 49%, 100% { opacity: 0; transform: translate(168px, 184px); } }
@keyframes birddive { 0% { transform: translate(-40px, 60px) rotate(20deg); } 45% { transform: translate(164px, 182px) rotate(30deg); } 55% { transform: translate(190px, 160px) rotate(-10deg); } 100% { transform: translate(360px, 40px) rotate(-20deg); } }
@keyframes splash { 0%, 44% { opacity: 0; transform: translate(166px, 192px) scale(0.4); } 50% { opacity: 1; transform: translate(166px, 188px) scale(1.2); } 70%, 100% { opacity: 0; transform: translate(166px, 180px) scale(1.6); } }

/* ---------- Big, specific action buttons in the middle ---------- */
#dock { position: fixed; z-index: 6; left: 38%; top: 40%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: min(380px, 60vw); padding: 14px 16px 16px; border-radius: 28px; background: rgba(42, 18, 96, 0.55); border: 1px solid rgba(255, 170, 230, 0.4); backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(20, 0, 50, 0.5); }
#dock[hidden] { display: none; }
.dock-title { margin: 0 0 2px; color: #ffd6f0; font: 700 12px/1 var(--read); letter-spacing: 0.18em; text-align: center; }
.do { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 14px 22px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 900 19px/1.2 var(--read); letter-spacing: 0.02em; text-align: left; cursor: pointer; box-shadow: inset 0 -4px 0 rgba(120, 20, 80, 0.35), 0 6px 18px rgba(255, 95, 162, 0.55); transition: transform 0.08s, background 0.15s; }
.do::before { content: ""; position: absolute; left: 8%; right: 8%; top: 3px; height: 38%; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); pointer-events: none; }
.do:hover { background: var(--pill-hover); }
.do:active { background: var(--pill-press); transform: translateY(2px); }
.do .ic { font-size: 26px; line-height: 1; }
.do.act { background: linear-gradient(135deg, #7cf5c0, #2bb3ff); color: #08304a; text-shadow: none; }
.do.wait { background: linear-gradient(135deg, #b18cff, #7b3fe4); }
html[lang="en"] .do { font-size: 17px; }
/* the tree, easier to read */
.tree-hint { margin: 0 0 6px; color: #f3e2ff; font: 500 12px/1.5 var(--read); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.legend .lg { display: inline-flex; align-items: center; gap: 4px; color: #e8d6ff; font: 500 11px/1 var(--read); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
/* coach marks */
#coach { position: fixed; inset: 0; z-index: 20; }
#coach[hidden] { display: none; }
.spot { position: fixed; border-radius: 24px; box-shadow: 0 0 0 9999px rgba(10, 0, 30, 0.6), 0 0 0 3px #ffe36a, 0 0 24px rgba(255, 227, 106, 0.8); pointer-events: none; transition: all 0.3s; }
.coach-say { position: fixed; width: 340px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(160deg, rgba(60, 22, 120, 0.97), rgba(120, 26, 110, 0.97)); border: 1px solid rgba(255, 170, 230, 0.6); color: #fff3fb; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.coach-say p { margin: 0 0 10px; font: 500 15px/1.7 var(--read); }
.coach-say button { padding: 8px 18px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 14px/1 var(--read); cursor: pointer; }
.help-btn { position: fixed; z-index: 9; left: 210px; top: 20px; padding: 6px 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #ffe6f6; font: 700 12px/1.2 var(--read); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.4); }

/* speed buttons: the active one glows */
#calendar .spd { min-width: 54px; }
#calendar .spd.on { background: linear-gradient(135deg, #ffe36a, #ffb04a); color: #4a1a7a; text-shadow: none; box-shadow: 0 0 14px rgba(255, 210, 63, 0.7); }
/* the tree is a map: no pointer, no pills */
#tree .node, #tree .node.can { cursor: default; background: transparent !important; box-shadow: none !important; animation: none !important; }
#tree .node.can b { color: #ffd6f0; }

/* dad explains each step, right above the big buttons */
.dock-why { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 8px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.1); color: #fff3fb; font: 500 14.5px/1.6 var(--read); }
.dad-face { flex: none; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #e8505b 60%, #c83a48 100%); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15); position: relative; }
.dad-face::before { content: ""; position: absolute; left: 9px; top: 12px; width: 4px; height: 5px; border-radius: 50%; background: #3a1a22; box-shadow: 12px 0 0 #3a1a22; }
.dad-face::after { content: ""; position: absolute; left: 6px; top: -7px; width: 22px; height: 9px; border-radius: 3px 3px 0 0; background: #3a1060; box-shadow: 0 6px 0 -2px #ff5fa2; }

/* ---------- The novel game: kamishibai ---------- */
#novel { z-index: 5; background: linear-gradient(180deg, #170a3a 0%, #2c1366 40%, #5a1a7a 70%, #a02a6a 100%); }
.kami { position: absolute; left: 50%; top: 9%; width: min(820px, 86vw); transform: translateX(-50%); }
.kami-pic { border-radius: 26px; overflow: hidden; box-shadow: 0 0 40px rgba(255, 95, 162, 0.4), 0 14px 40px rgba(20, 0, 50, 0.6); background: #2c1366; }
.kami-pic.flip { animation: kamiflip 0.45s ease-out; }
@keyframes kamiflip { 0% { transform: translateX(30px) rotate(1deg); opacity: 0.2; } 100% { transform: none; opacity: 1; } }
.kami-svg { display: block; width: 100%; height: auto; }
.kami-day { position: absolute; right: 14px; top: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(20, 6, 50, 0.6); color: #ffe36a; font: 700 13px/1.2 var(--read); }
.kami-day:empty { display: none; }
.kami-svg .k-sway { animation: ksway 2.6s ease-in-out infinite; }
@keyframes ksway { 50% { transform: rotate(4deg); } }
.kami-svg .k-star { animation: twinkle 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.3s); }
.kami-svg .k-steam { animation: steam 2.2s ease-out infinite; animation-delay: calc(var(--i) * -0.7s); opacity: 0; }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: 0.6; } 100% { opacity: 0; transform: translateY(-20px); } }
.kami-svg .k-drip { animation: drip 1.2s linear infinite; animation-delay: calc(var(--i) * -0.25s); }
@keyframes drip { from { transform: translateY(-6px); opacity: 1; } to { transform: translateY(18px); opacity: 0; } }
.kami-svg .k-bub { animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.4s); }
.novel-talk { bottom: 4%; width: min(820px, 86vw); }
.novel-talk.narration .name { display: none; }
.novel-talk.narration .line { color: #ffe36a; font-weight: 700; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.choice { padding: 11px 18px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 16px/1.35 var(--read); text-align: left; cursor: pointer; box-shadow: 0 4px 14px rgba(255, 95, 162, 0.45); }
.choice:hover { background: var(--pill-hover); }
.choice.tried { background: rgba(255, 255, 255, 0.1); color: rgba(255, 230, 246, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.3); text-decoration: line-through; }

.kami-svg .k-pin { animation: pinpop 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pinpop { 50% { transform: scale(1.35); } }
.kami-svg .k-arc { animation: flow 1.2s linear infinite; }

/* the narration of a place reads like a caption, not a warning */
.novel-talk.narration .line { color: #fff3fb; font-weight: 500; }
.novel-talk .line { font-size: 17px; line-height: 1.75; }

/* ---------- Home: the Pot from above ---------- */
#home { position: fixed; z-index: 6; left: 38%; top: 34%; transform: translate(-50%, -50%); }
#home[hidden] { display: none; }
.home-box { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: min(420px, 64vw); padding: 16px 18px 18px; border-radius: 28px; background: rgba(42, 18, 96, 0.62); border: 1px solid rgba(255, 170, 230, 0.45); backdrop-filter: blur(10px); box-shadow: 0 10px 40px rgba(20, 0, 50, 0.5); color: #fff3fb; text-align: center; }
.home-box .burst { font-size: 48px; line-height: 1; animation: popUp 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
.home-box .eyebrow { margin: 0; color: #ffd6f0; font: 900 20px/1.3 var(--read); }
.home-box .body { margin: 0; font: 500 14.5px/1.6 var(--read); }
.home-made { margin: 0; font: 500 13px/1.6 var(--read); color: #f3e2ff; }
.home-made span { font-size: 20px; margin: 0 2px; }
.home-box .do { justify-content: flex-start; }
.home-box .do.locked { background: rgba(255, 255, 255, 0.08); color: rgba(255, 230, 246, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.3); cursor: not-allowed; }
.home-box .do small { margin-left: auto; font-size: 11px; font-weight: 500; }
.home-box .ghostbtn { align-self: center; }

/* home panel sits at the left, over where the log was, so the Pot and everyone in it stay in view */
#home { left: 26px; top: 66px; transform: none; }
.home-box { min-width: 0; width: min(380px, 34vw); }
.home-box .do { font-size: 17px; padding: 12px 18px; }

.kami-svg .k-light { animation: blink 1.2s infinite; animation-delay: calc(var(--i) * -0.24s); }

.kami-svg .w-link { stroke: #ff9ad5; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 6 7; opacity: 0; animation: wlink 0.6s ease-out forwards, flow 1.2s linear infinite; animation-delay: calc(0.4s + var(--i) * 0.12s), 0s; filter: drop-shadow(0 0 4px rgba(255, 95, 162, 0.9)); }
@keyframes wlink { to { opacity: 0.9; } }
.kami-svg .w-node { opacity: 0; animation: wnode 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; animation-delay: calc(var(--i) * 0.12s); transform-box: fill-box; transform-origin: center; }
@keyframes wnode { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }

/* talk to the aliens; look at the plots */
.alien.talkable { pointer-events: auto; cursor: pointer; }
.alien.talkable:hover .alien-svg { filter: drop-shadow(0 0 10px rgba(255, 210, 63, 0.9)); }
.alien.hop .alien-svg { animation: hop 0.5s ease-in-out 2; }
#alienSay { position: fixed; z-index: 12; max-width: 260px; margin: 0; padding: 8px 12px; transform: translate(-50%, -100%); border-radius: 16px; background: #fff; color: #4a1a7a; font: 700 13.5px/1.55 var(--read); box-shadow: 0 6px 18px rgba(20, 0, 50, 0.45); pointer-events: none; }
#alienSay::after { content: ""; position: absolute; left: var(--tail, 50%); top: 100%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #fff; }
#alienSay[hidden] { display: none; }
.plot { cursor: pointer; }
.plot-info { text-align: left; }
.plot-items { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.plot-items li { padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.08); }
.plot-items .ic { font-size: 22px; margin-right: 6px; }
.plot-items b { font: 700 15px/1.4 var(--read); }
.plot-items p { margin: 4px 0; font: 500 13px/1.6 var(--read); }
.plot-items a { color: #9ad8ff; font-size: 11px; text-decoration: none; }
.kid-say { margin: 6px 0 0; font: 700 14px/1.6 var(--read); color: #ffd6f0; }
.home-hint { margin: 0; font: 500 12px/1.5 var(--read); color: #ffe36a; }
/* QA 11/09 #22: a dish already made stays in "which dish next?" with a check, dimmed and not pickable */
.home-box .key.made, .home-box .key.made:hover { background: rgba(255, 255, 255, 0.08); color: rgba(255, 230, 246, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.3); cursor: default; transform: none; animation: none; }
/* the hint and the Zukan button sit together at the end of the home panel (a sticky row on a phone, #16) */
.home-foot { display: contents; }

.home-box .do.finish { background: linear-gradient(135deg, #ffe36a, #ffb04a); color: #4a1a7a; text-shadow: none; animation: breathe 1.6s ease-in-out infinite; }

/* an Earth issue page: warm orange frame so it reads as "this is happening for real" */
.novel-talk.issue { border-color: #ff9a3c; box-shadow: 0 0 0 2px rgba(255, 154, 60, 0.55), 0 0 28px rgba(255, 120, 40, 0.45); }
.novel-talk.issue .line { color: #fff3e0; }

/* camp kitchen fire */
.kami-svg .k-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 0.9s ease-in-out infinite; }
.kami-svg .k-glow { animation: glowfire 1.8s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(0.94, 1.08); } 60% { transform: scale(1.05, 0.93); } }
@keyframes glowfire { 50% { opacity: 0.14; } }
@media (prefers-reduced-motion: reduce) { .kami-svg .k-flame, .kami-svg .k-glow { animation: none; } }

/* Readability (まどか, 10/23): the LED dots and film grain stay on the backgrounds and the pictures,
   but never over text boxes or buttons. The global overlays are off; each screen carries the texture
   behind its content (z-index -1 inside the screen's own layer), and the kamishibai picture carries it on top. */
.dots, .grain { display: none; }
.screen::before, .kami-pic::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, rgba(0, 0, 0, 0) 0.9px, rgba(0, 0, 0, 0.38) 1.3px, rgba(0, 0, 0, 0.38) 100%); background-size: 3px 3px; mix-blend-mode: multiply; opacity: 0.8; }
.screen::after, .kami-pic::after { content: ""; position: absolute; inset: -50%; pointer-events: none; opacity: 0.13; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain 0.6s steps(2) infinite; }
.screen::before, .screen::after { z-index: -1; }
.kami-pic { position: relative; }
.kami-pic::before, .kami-pic::after { z-index: 1; }
@media (prefers-reduced-motion: reduce) { .screen::after, .kami-pic::after { animation: none; } }
.screen { isolation: isolate; overflow: hidden; }
/* the soft vignette also stays behind the content, so the lowest buttons aren't dimmed */
.vignette { display: none; }
.screen { box-shadow: inset 0 0 22vmin rgba(0, 0, 0, 0.5); }
/* while a question is open, the picture steps back a little so the choices never cover it */
.kami { transition: width 0.35s ease, top 0.35s ease; }
#novel.asking .kami { width: min(560px, 58vw); top: 4%; }

/* mission pages: "this really happened on Earth" and the action card, a green frame (issues are orange) */
.novel-talk.precedent { border-color: #4fd6a0; box-shadow: 0 0 0 2px rgba(79, 214, 160, 0.55), 0 0 28px rgba(40, 200, 140, 0.4); }
.novel-talk.precedent .line { color: #effff7; }
.action-link { display: inline-block; margin-top: 10px; padding: 9px 18px; border-radius: 999px; background: linear-gradient(90deg, #2fd6b5, #4fd6a0); color: #10303a; font: 700 14px/1.2 var(--read); text-decoration: none; }

/* Devanagari and Tibetan letters join up; letter-spacing pulls them apart (पापा → पा पा) */
html[lang="hi"] *, html[lang="dz"] * { letter-spacing: normal !important; }
.choices .action-link { align-self: flex-start; width: auto; max-width: calc(100% - 150px); }

/* ---------- "Meanwhile on Earth" card (ui/issuecard.js): its own moment over the picture, not a talk-box line ---------- */
.ic-card { position: absolute; left: 3%; right: 3%; top: 5%; min-height: 90%; box-sizing: border-box; z-index: 5; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 22px 28px 18px; border-radius: 22px; background: linear-gradient(160deg, rgba(36, 14, 82, 0.72), rgba(70, 20, 70, 0.66)); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border: 2px solid #ff9a3c; box-shadow: 0 0 0 4px rgba(255, 154, 60, 0.18), 0 0 34px rgba(255, 120, 40, 0.45), 0 14px 40px rgba(20, 0, 50, 0.6); color: #fff3e0; animation: ic-in 0.38s cubic-bezier(0.2, 1.4, 0.4, 1); }
.ic-card.ic-precedent { border-color: #3ee59a; box-shadow: 0 0 0 4px rgba(62, 229, 154, 0.18), 0 0 34px rgba(3, 228, 116, 0.4), 0 14px 40px rgba(0, 30, 30, 0.6); background: linear-gradient(160deg, rgba(12, 52, 70, 0.74), rgba(20, 60, 50, 0.66)); color: #eafff4; }
@keyframes ic-in { 0% { opacity: 0; transform: scale(0.92) translateY(10px); } 100% { opacity: 1; transform: none; } }
.ic-card p { margin: 0; }
.ic-head { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 8px; border-radius: 999px; background: rgba(255, 154, 60, 0.22); color: #ffc58a; font: 700 13px/1.2 var(--read); letter-spacing: 0.12em; }
.ic-precedent .ic-head { background: rgba(62, 229, 154, 0.2); color: #8ff5c4; }
.ic-globe { display: inline-block; font-size: 20px; letter-spacing: 0; animation: ic-spin 6s linear infinite; }
@keyframes ic-spin { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
.ic-tie { color: #ffd9b0; font: 500 15px/1.6 var(--read); }
.ic-precedent .ic-tie { color: #bff7dc; }
.ic-text { font: 700 clamp(17px, 2.6vw, 23px)/1.6 var(--read); letter-spacing: 0.02em; text-wrap: pretty; }
.ic-src { color: rgba(255, 240, 225, 0.62); font: 400 11px/1.45 var(--read); }
.ic-foot { display: flex; align-items: flex-end; gap: 12px; margin-top: 4px; }
.ic-react { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 34px; opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
.ic-said .ic-react { opacity: 1; transform: none; }
.ic-who { flex: none; padding: 3px 10px; border-radius: 999px; background: #ff5fa2; color: #fff; font: 700 11px/1.4 var(--read); letter-spacing: 0.1em; }
.ic-dad .ic-who { background: #7a5cff; }
.ic-say { position: relative; padding: 6px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); color: #2a1450; font: 700 15px/1.4 var(--read); min-height: 1.4em; }
.ic-say:empty { visibility: hidden; }
.ic-next { flex: none; padding: 8px 18px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 14px/1 var(--read); cursor: pointer; box-shadow: 0 4px 14px rgba(255, 95, 162, 0.45); }
.ic-next:hover { background: var(--pill-hover); }
.ic-next:focus-visible { outline: 3px solid #ffe36a; outline-offset: 3px; }
.ic-precedent .ic-next { background: linear-gradient(90deg, #2fd6b5, #4fd6a0); color: #10303a; box-shadow: 0 4px 14px rgba(47, 214, 181, 0.45); }
/* while the card is up, the talk box steps aside (the card has its own つぎへ) */
.kami:has(.ic-card) + .novel-talk { visibility: hidden; }
@media (max-width: 600px) {
  .ic-card { left: 0; right: 0; top: 0; min-height: 100%; padding: 16px 16px 14px; gap: 8px; border-radius: 18px; }
  .ic-tie { font-size: 14px; }
  .ic-text { font-size: 17px; }
  .ic-foot { flex-direction: column; align-items: stretch; }
  .ic-next { align-self: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .ic-card, .ic-globe { animation: none; } .ic-react { transition: none; } }
.ic-src { margin-top: 2px; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, 0.14); }

/* ---------- Build 4 #4: the time-lapse while days pass (ui/timelapse.js) ---------- */
.tl-wrap { position: relative; }
.tl-wrap .tl-st { opacity: 0; transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1); transform: scale(0.92, 0.6); transform-box: view-box; transform-origin: 320px 300px; }
.tl-wrap svg[data-stage="rock"] .tl-st[data-st="rock"], .tl-wrap svg[data-stage="sprout"] .tl-st[data-st="sprout"],
.tl-wrap svg[data-stage="growing"] .tl-st[data-st="growing"], .tl-wrap svg[data-stage="done"] .tl-st[data-st="done"] { opacity: 1; transform: none; }
.tl-wrap .tl-ev { opacity: 0; transition: opacity 0.4s; }
.tl-wrap .tl-ev.on, .tl-wrap .tl-walk.on { opacity: 1; }
.tl-wrap .tl-night { transition: opacity 0.2s; }
.tl-wrap .tl-can { animation: tl-tilt 0.9s ease-in-out infinite; transform-box: view-box; transform-origin: 30px -34px; }
.tl-wrap .tl-rake { animation: tl-rake 0.5s ease-in-out infinite; transform-box: view-box; transform-origin: 18px -40px; }
.tl-wrap .tl-cheer .alien-svg { animation: hop 0.4s ease-in-out infinite; }
@keyframes tl-tilt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(24deg); } }
@keyframes tl-rake { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }
.tl-hud { position: absolute; z-index: 2; right: 14px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding: 8px 14px 10px; border-radius: 18px; background: rgba(20, 6, 50, 0.66); }
.tl-day { color: #ffe36a; font: 900 clamp(18px, 2.6vw, 28px)/1 var(--read); font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(255, 210, 63, 0.6); }
.tl-bar { display: block; width: clamp(90px, 14vw, 150px); height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.tl-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2fd66b, #ffe36a); }
.tl-cap { position: absolute; z-index: 2; left: 14px; top: 12px; max-width: min(58%, 420px); margin: 0; padding: 8px 14px; border-radius: 16px; background: rgba(255, 246, 252, 0.94); color: #3a1060; font: 700 clamp(13px, 1.6vw, 16px)/1.5 var(--read); white-space: pre-line; box-shadow: 0 4px 16px rgba(20, 0, 50, 0.4); }
.tl-cap.tl-in { animation: tl-cap 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes tl-cap { from { opacity: 0; transform: translateY(-8px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tl-wrap *, .tl-cap.tl-in { animation: none !important; transition: none !important; } }
.kami:has(.ic-card) .kami-day { visibility: hidden; }
.ic-card { backdrop-filter: blur(7px) saturate(1.3); -webkit-backdrop-filter: blur(7px) saturate(1.3); }

/* ---------- Build 4 #4: home — plots pop in, worn paths and piles, flow lines, busy aliens, animals (ui/bowl.js) ---------- */
.plot.tl-pop { animation: tl-pop 0.75s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: var(--tl-delay, 0s); }
@keyframes tl-pop { 0% { transform: translate(-50%, -20%) scale(0.1); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.tl-spark { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.tl-spark i { position: absolute; width: 12px; height: 12px; margin: -6px; background: #fff36b; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: 0; animation: tl-spark 1s ease-out both; animation-delay: calc(var(--tl-delay, 0s) + 0.2s); }
.tl-spark i:nth-child(1) { --sx: -60px; --sy: -40px; } .tl-spark i:nth-child(2) { --sx: 56px; --sy: -46px; background: #ff9ad5; }
.tl-spark i:nth-child(3) { --sx: -30px; --sy: -70px; background: #9ad8ff; } .tl-spark i:nth-child(4) { --sx: 34px; --sy: -74px; } .tl-spark i:nth-child(5) { --sx: 0; --sy: -90px; background: #7cf5c0; }
@keyframes tl-spark { 0% { opacity: 0; transform: translate(0, 0) scale(0.3) rotate(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(1.1) rotate(90deg); } }
.tl-ground, .flow-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tl-ground { z-index: 0; }
.flow-layer { z-index: 1; }
.tl-path { fill: none; stroke: #ffd6f0; stroke-width: 14; stroke-linecap: round; filter: blur(2px); }
.tl-steps { fill: none; stroke: #fff6fb; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 11; }
.flow-line { fill: none; stroke: #ffe36a; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 7 8; opacity: 0; filter: drop-shadow(0 0 4px rgba(255, 210, 63, 0.95)); animation: tl-linein 0.6s ease-out forwards, flow 1.1s linear infinite; animation-delay: var(--d, 0s), 0s; }
.flow-dot { fill: #fff; opacity: 0; filter: drop-shadow(0 0 6px #ffe36a); animation: tl-linein 0.4s ease-out forwards; animation-delay: calc(var(--d, 0s) + 0.4s); }
@keyframes tl-linein { to { opacity: 0.95; } }
.tl-piles { position: absolute; left: -6%; bottom: 22%; display: flex; gap: 0; pointer-events: none; }
.tl-piles svg { width: clamp(14px, 1.6vw, 24px); height: auto; margin-right: -4px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
/* props the aliens hold while they work */
.tl-prop { position: absolute; left: 62%; top: 34%; width: 62%; pointer-events: none; }
.tl-prop svg { display: block; width: 100%; overflow: visible; }
.alien.flip .tl-prop { left: auto; right: 62%; scale: -1 1; }
.alien[data-act="beam"] .tl-prop { left: 10%; top: -110%; width: 80%; }
.alien[data-act="plant"].tl-working .alien-svg, .alien[data-act="circle"] .alien-svg { animation: hop 0.45s ease-in-out infinite; }
.alien[data-act="milk"].tl-working .alien-svg { transform: translateY(8%) scale(1, 0.92); }
.tl-prop .tl-p-tilt { animation: tl-tilt 1s ease-in-out infinite; transform-box: fill-box; transform-origin: 20% 80%; }
.tl-prop .tl-p-swing { animation: tl-swing 0.55s ease-in-out infinite; transform-box: fill-box; transform-origin: 0 0; }
.tl-prop .tl-p-hammer { animation: tl-hammer 0.5s ease-in infinite; transform-box: fill-box; transform-origin: 0 0; }
.tl-prop .tl-p-bob { animation: bob 0.6s ease-in-out infinite; }
.tl-prop .tl-p-rub { animation: tl-rub 0.5s ease-in-out infinite; }
.tl-prop .tl-p-stir { animation: tl-stir 0.9s linear infinite; transform-box: fill-box; transform-origin: 50% 0; }
.tl-prop .tl-p-dip { animation: tl-dip 0.8s ease-in-out infinite; }
.tl-prop .tl-p-hover { animation: bob 1.2s ease-in-out infinite; }
.tl-prop .tl-p-dust { animation: tl-puff 0.55s ease-out infinite; }
.tl-prop .tl-drip { animation: drip 0.7s linear infinite; animation-delay: calc(var(--i) * -0.23s); }
.tl-prop .tl-grain { animation: tl-grain 0.8s ease-in infinite; animation-delay: calc(var(--i) * -0.2s); }
.tl-prop .tl-bub { animation: tl-rise 1.2s ease-out infinite; animation-delay: calc(var(--i) * -0.4s); }
@keyframes tl-swing { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(10deg); } }
@keyframes tl-hammer { 0%, 100% { transform: rotate(-30deg); } 60% { transform: rotate(18deg); } }
@keyframes tl-rub { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(4px); } }
@keyframes tl-stir { 0% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } 100% { transform: rotate(-12deg); } }
@keyframes tl-dip { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px) rotate(10deg); } }
@keyframes tl-puff { 0% { opacity: 0.9; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(4px, -6px) scale(1.4); } }
@keyframes tl-grain { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(6px, 20px); opacity: 0; } }
@keyframes tl-rise { 0% { transform: translateY(0); opacity: 0.9; } 100% { transform: translateY(-16px); opacity: 0; } }
/* animals living at their plots */
.tl-animal { position: absolute; z-index: 2; transform: translate(-50%, -100%); pointer-events: none; transition: opacity 0.6s; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4)); }
.tl-animal svg { display: block; width: 100%; overflow: visible; }
.tl-hen { width: clamp(18px, 1.9vw, 28px); }
.tl-cow { width: clamp(54px, 5.6vw, 84px); }
.tl-pig { width: clamp(34px, 3.6vw, 54px); }
.tl-animal.flip svg { scale: -1 1; }
.tl-animal[data-state="in"] { opacity: 0; }
.tl-animal[data-state="walk"] svg { animation: tl-waddle 0.35s ease-in-out infinite; }
.tl-animal .tl-head { transform-box: fill-box; transform-origin: 20% 90%; }
.tl-animal[data-state="peck"] .tl-head, .tl-animal[data-state="eat"] .tl-head { animation: tl-peck 0.45s ease-in-out infinite; animation-delay: var(--d, 0s); }
.tl-animal[data-state="graze"] .tl-head, .tl-animal[data-state="root"] .tl-head { animation: tl-graze 1.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.tl-animal .tl-dust, .tl-animal .tl-mud, .tl-animal .tl-z { opacity: 0; transition: opacity 0.4s; }
.tl-animal[data-state="bath"] .tl-dust { opacity: 0.8; animation: tl-puff 0.6s ease-out infinite; }
.tl-animal[data-state="bath"] .tl-body, .tl-animal[data-state="wallow"] .tl-body { animation: tl-wallow 0.5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.tl-animal[data-state="wallow"] .tl-mud { opacity: 0.9; }
.tl-cow .tl-tail { animation: tl-tail 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 100% 0; }
.tl-cow .tl-legs { transition: transform 0.6s; transform-box: fill-box; transform-origin: 50% 0; }
.tl-cow .tl-body { transition: transform 0.6s; }
.tl-cow[data-state="lie"] .tl-legs, .tl-cow[data-state="sleep"] .tl-legs { transform: scaleY(0.15); }
.tl-cow[data-state="lie"] .tl-body, .tl-cow[data-state="sleep"] .tl-body { transform: translateY(12px); }
.tl-animal[data-state="sleep"] .tl-z { opacity: 1; animation: tl-rise 2s ease-out infinite; }
.tl-pig[data-state="sleep"] .tl-body { transform: translateY(4px) scaleY(0.9); }
@keyframes tl-waddle { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-6%); } }
@keyframes tl-peck { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(38deg); } }
@keyframes tl-graze { 0%, 100% { transform: rotate(0); } 30%, 70% { transform: rotate(26deg); } }
@keyframes tl-wallow { 0%, 100% { transform: rotate(-6deg) scale(1.03, 0.94); } 50% { transform: rotate(6deg); } }
@keyframes tl-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-26deg); } }
@media (prefers-reduced-motion: reduce) { .plot.tl-pop, .tl-spark i, .flow-line, .tl-prop *, .tl-animal, .tl-animal * { animation: none !important; } .flow-line, .flow-dot { opacity: 0.9; } .tl-spark { display: none; } }
/* phone width: the UFO-7 pill and the language switch were overlapping at 390px */
@media (max-width: 600px) { .hud { top: 10px; left: 10px; padding: 4px 8px; font-size: 10px; } .lang-switch { top: 8px; right: 8px; transform: scale(0.85); transform-origin: top right; } }
@media (max-width: 560px) { .tl-hud { right: 8px; top: 8px; padding: 5px 9px 7px; gap: 4px; } .tl-day { font-size: 15px; } .tl-bar { width: 64px; height: 5px; } .tl-cap { left: 8px; top: 8px; max-width: calc(100% - 110px); padding: 6px 10px; font-size: 12px; line-height: 1.4; } }
/* phone width: the home panel is a bottom sheet with a handle — see "Layout fixes" at the end */

/* living space: planets turn, more shooting stars, passing UFOs, a satellite (skyHTML in ui/bowl.js) */
.planet .surf { animation: surf 24s linear infinite; }
.planet .surf.slow { animation-duration: 40s; }
.planet .surf.fast { animation-duration: 14s; }
@keyframes surf { from { transform: translateX(0); } to { transform: translateX(-92px); } }
.shooting.s2 { left: 34%; top: 18%; animation-duration: 9s; animation-delay: -4s; }
.shooting.s3 { left: 88%; top: 28%; width: 80px; animation-duration: 13s; animation-delay: -9s; }
.ufo-far { position: absolute; width: clamp(34px, 3.4vw, 54px); opacity: 0.85; filter: drop-shadow(0 0 8px rgba(255, 230, 120, 0.5)); }
.ufo-far.u1 { top: 22%; left: -8%; animation: ufo-cross 28s linear infinite, ufo-bob 2.4s ease-in-out infinite; }
.ufo-far.u2 { top: 40%; left: 108%; width: clamp(24px, 2.4vw, 38px); opacity: 0.6; animation: ufo-back 41s linear infinite, ufo-bob 3.1s ease-in-out infinite; animation-delay: -17s, 0s; }
@keyframes ufo-cross { from { translate: 0 0; } to { translate: 120vw -6vh; } }
@keyframes ufo-back { from { translate: 0 0; } to { translate: -122vw 4vh; } }
@keyframes ufo-bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
.ufo-blink { animation: blink 0.9s steps(2) infinite; }
.ufo-blink.b2 { animation-delay: -0.45s; }
.sat-blink { animation: blink 1.4s steps(2) infinite; }
@media (prefers-reduced-motion: reduce) { .planet .surf, .ufo-far, .ufo-blink, .sat-blink { animation: none !important; } .ufo-far { display: none; } }

/* ---------- Build 4 farm (牧場物語): crops on their beds, count badges, chicks / calves / piglets (ui/bowl.js, lib/farm.js) ---------- */
.tl-crop { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
.tl-crop svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl-crop .tl-sway { animation: ksway 3s ease-in-out infinite; animation-delay: calc(var(--i) * -0.9s); transform-box: fill-box; transform-origin: 50% 100%; }
.tl-count { position: absolute; left: 50%; top: -4%; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: rgba(42, 18, 96, 0.82); border: 1px solid rgba(255, 170, 230, 0.55); color: #fff3fb; font: 700 clamp(10px, 1vw, 13px)/1.5 var(--read); white-space: nowrap; pointer-events: none; }
.tl-count.tl-bump { animation: tl-bump 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes tl-bump { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
.tl-chick { width: clamp(10px, 1.05vw, 16px); }
.tl-calf { width: clamp(32px, 3.3vw, 50px); }
.tl-piglet { width: clamp(20px, 2vw, 30px); }
.tl-animal.tl-born svg { animation: tl-born 0.8s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes tl-born { 0% { transform: scale(0.1) translateY(30%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tl-crop .tl-sway, .tl-count.tl-bump, .tl-animal.tl-born svg { animation: none !important; } }
/* the count badge sits under the plot's name, where no flow line goes */
.tl-count { top: 100%; margin-top: 2px; }
/* phone width: the Pot has its own layout above the home sheet (PHONE_POS in ui/bowl.js, "Layout fixes" at the end) */

/* ---------- Build 4: the wheat cascade (lib/cascade.js, ui/bowl.js setCascade / showCascadeNews) ---------- */
/* the Pot goes dark outward from wheat: each plot, line and mark waits its own --cas-d (0.4 s a step) */
.plot > img, .plot > .tl-crop, .plot > .tl-piles, .plot > figcaption { transition: filter 0.6s ease var(--cas-d, 0s); }
.plot.cas-dark > img, .plot.cas-dark > .tl-crop, .plot.cas-dark > .tl-piles, .plot.cas-dark > figcaption { filter: grayscale(1) brightness(0.42); }
.plot.cas-dim > img, .plot.cas-dim > .tl-crop, .plot.cas-dim > .tl-piles, .plot.cas-dim > figcaption { filter: grayscale(0.8) brightness(0.58); }
/* a dark plot wears a small '?' too (it pops in at its step); the filter is on its children, so the '?' stays white */
.plot.cas-dark::after, .plot.cas-dim::after { content: "?"; position: absolute; left: 50%; top: 4%; display: grid; place-items: center; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: #fff; color: #7a3fe4; font: 900 17px/1 var(--read); box-shadow: 0 2px 8px rgba(20, 0, 50, 0.6); animation: cas-qpop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: var(--cas-d, 0s); }
.plot[data-cas-cut="wheat"] .tl-crop [data-part="wheat"] { filter: grayscale(1) sepia(0.7) brightness(0.55); }
.plot.cas-relit > img, .plot.cas-relit > .tl-crop, .plot.cas-relit > figcaption { animation: cas-relit 1s ease-out both; animation-delay: var(--cas-d, 0s); }
@keyframes cas-relit { 0% { filter: grayscale(0.9) brightness(0.5); } 55% { filter: brightness(1.35) drop-shadow(0 0 18px #ffe36a); } 100% { filter: none; } }
.flow-line { transition: stroke 0.5s ease var(--cas-d, 0s), stroke-width 0.5s ease var(--cas-d, 0s); }
.flow-line.cas-dark { stroke: #5a4a6a; filter: none; animation-play-state: paused; }
.flow-line.cas-dim { stroke: #6a5a7a; filter: none; }
.flow-dot { transition: fill-opacity 0.4s ease var(--cas-d, 0s); }
.flow-dot.cas-dark { fill-opacity: 0; }
/* snap to dark without a transition; the element's own animations (pop-in, line fade-in) are left alone so they don't replay */
.cas-instant, .cas-instant > * { transition: none !important; }
.cas-instant::after { transition: none !important; animation: none !important; }
/* stopped dishes and parts in the home list and the dish picker: dimmed, with a small '?' */
[data-cas] { position: relative; transition: filter 0.5s ease var(--cas-d, 0s), opacity 0.5s ease var(--cas-d, 0s); }
[data-cas].cas-q { filter: grayscale(0.9); opacity: 0.55; }
[data-cas].cas-q::after { content: "?"; position: absolute; right: -5px; top: -7px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #7a3fe4; font: 900 11px/1 var(--read); box-shadow: 0 1px 4px rgba(20, 0, 50, 0.5); animation: cas-qpop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: var(--cas-d, 0s); }
.home-made [data-cas] { display: inline-block; }
@keyframes cas-qpop { from { transform: scale(0); } to { transform: scale(1); } }
/* the home banner while the wheat is stopped */
.cas-banner { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 18px; background: rgba(20, 8, 40, 0.55); border: 1px dashed rgba(255, 210, 63, 0.6); }
.cas-banner p { margin: 0; font: 700 14px/1.55 var(--read); color: #ffe9a8; }
.home-box .do.cas-go { background: linear-gradient(135deg, #ffe36a, #ffb04a); color: #4a1a7a; text-shadow: none; }
.cas-back { margin: 0; color: #ffe36a; font: 900 18px/1.4 var(--read); }
/* the Earth news card: calm, one frame, the war in one line, the honest note, sources small at the bottom */
.next-box.cas-news { width: min(640px, calc(100% - 32px)); text-align: left; display: flex; flex-direction: column; gap: 10px; border: 2px solid #ff9a3c; background: linear-gradient(160deg, rgba(36, 14, 82, 0.96), rgba(70, 20, 70, 0.95)); box-shadow: 0 0 0 4px rgba(255, 154, 60, 0.18), 0 0 34px rgba(255, 120, 40, 0.4); animation: ic-in 0.38s cubic-bezier(0.2, 1.4, 0.4, 1); }
.cas-news p { margin: 0; }
.cas-head { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 8px; border-radius: 999px; background: rgba(255, 154, 60, 0.22); color: #ffc58a; font: 700 13px/1.2 var(--read); letter-spacing: 0.12em; }
.cas-globe { font-size: 20px; letter-spacing: 0; }
.cas-title { margin: 2px 0 0; color: #fff3e0; font: 900 clamp(18px, 2.4vw, 23px)/1.45 var(--read); text-wrap: balance; }
html[lang="ja"] .cas-title { word-break: keep-all; overflow-wrap: anywhere; }
.cas-text { color: #fff3e0; font: 500 clamp(14.5px, 1.7vw, 16.5px)/1.75 var(--read); text-wrap: pretty; }
.cas-text.cas-good { color: #bff7dc; }
.cas-talk { display: grid; gap: 6px; margin: 2px 0; }
.cas-say { display: flex; align-items: center; gap: 8px; min-height: 30px; opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
.cas-say.on { opacity: 1; transform: none; }
.cas-who { flex: none; padding: 3px 10px; border-radius: 999px; background: #ff5fa2; color: #fff; font: 700 11px/1.4 var(--read); letter-spacing: 0.1em; }
.cas-dad .cas-who { background: #7a5cff; }
.cas-line { padding: 5px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); color: #2a1450; font: 700 14px/1.45 var(--read); min-height: 1.4em; }
.cas-line:empty { visibility: hidden; }
.cas-honest { padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); color: #ffe9c8; font: 500 12.5px/1.6 var(--read); }
.cas-foot { display: flex; align-items: flex-end; gap: 12px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.cas-src { flex: 1; color: rgba(255, 240, 225, 0.62); font: 400 11px/1.5 var(--read); }
.cas-src a { color: rgba(255, 240, 225, 0.75); text-decoration: underline; text-decoration-color: rgba(255, 240, 225, 0.3); }
.cas-next { flex: none; padding: 9px 20px; border: 0; border-radius: 999px; background: var(--pill); color: #fff; font: 700 14px/1 var(--read); cursor: pointer; box-shadow: 0 4px 14px rgba(255, 95, 162, 0.45); }
.cas-next:focus-visible { outline: 3px solid #ffe36a; outline-offset: 3px; }
@media (max-width: 600px) {
  .next-box.cas-news { padding: 16px 16px 14px; gap: 8px; max-height: 92vh; }
  .cas-foot { flex-direction: column; align-items: stretch; }
  .cas-next { align-self: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .plot > *, .flow-line, .flow-dot, [data-cas] { transition: none !important; }
  .plot.cas-relit > *, .plot::after, [data-cas].cas-q::after, .next-box.cas-news { animation: none !important; }
  .cas-say { transition: none; }
}

/* ---------- Layout fixes (QA 2026-11-10 #5 #6 #7 #9, Zukan overlap, Tibetan buttons, time-lapse captions) ---------- */
/* #7 desktop home: the Pot stands in the right two thirds (PLOT_POS in ui/bowl.js), the home panel keeps the left third.
   The floor keeps its aspect: its viewBox is 100×30 and the box below is about 10:3 (the default "meet" never stretches it). */
.dome { left: 34%; top: 8%; width: 63%; height: 78%; }
.floor { left: 36%; top: 60%; width: 60%; height: 28%; }
.home-pod { left: 67%; top: 46%; width: clamp(130px, 12vw, 200px); }
.plot { width: clamp(110px, 13vw, 190px); }
/* the panel never runs off the screen: it scrolls inside, and nothing in it is squashed */
.home-box { max-height: calc(100vh - 66px - 24px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 170, 230, 0.5) transparent; }
.home-box > * { flex-shrink: 0; }
/* the big emoji keeps a line box tall enough for any script's font (Tibetan fonts drew it above the panel's top edge) */
.home-box .burst { line-height: 1.3; }
.home-sheet { display: contents; }
.sheet-handle { display: none; }

/* #6 phone home: the Pot in the upper half (PHONE_POS), drawn on a rounder floor that keeps its own aspect (viewBox 100×50);
   the home panel is a bottom sheet with a handle: down (42% of the screen, scrolls inside) or pulled up to read everything */
@media (max-width: 600px) {
  .dome { left: 2%; top: 4%; width: 96%; height: 44%; }
  .floor { left: 4%; top: 29%; width: 92%; height: 21%; }
  .home-pod { left: 50%; top: 22%; width: 26vw; }
  .plot { width: 25vw; }
  .plot figcaption { margin-top: -4px; font-size: 11px; letter-spacing: 0.06em; }
  .plot .say { max-width: 46vw; font-size: 11px; }
  .home-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; flex-direction: column; max-height: 42vh; max-height: 42dvh; border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, rgba(48, 20, 104, 0.94), rgba(70, 22, 104, 0.96)); border: 1px solid rgba(255, 170, 230, 0.45); border-bottom: 0;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 -8px 30px rgba(20, 0, 50, 0.5); transition: max-height 0.3s ease; }
  .home-sheet.open { max-height: 86vh; max-height: 86dvh; }
  .home-sheet:has(> #home[hidden]) { display: none; }
  .sheet-handle { display: block; flex: none; width: 100%; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: none; }
  .sheet-handle span { display: block; width: 46px; height: 5px; margin: 0 auto; border-radius: 3px; background: rgba(255, 214, 240, 0.65); transition: background 0.15s; }
  .sheet-handle:hover span, .sheet-handle:focus-visible span { background: #ffe36a; }
  .sheet-handle:focus-visible { outline: none; }
  #home { position: static; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .home-box { width: auto; min-width: 0; max-height: none; overflow: visible; gap: 10px; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .home-box .burst { font-size: 30px; }
  .home-box .eyebrow { font-size: 18px; }
  .home-box .body { font-size: 14px; }
  .home-made span { font-size: 18px; }
  /* comfortable thumb-sized buttons; the emoji has its own room and is never cut */
  .home-box .do { min-height: 52px; padding: 10px 18px; gap: 10px; font-size: 16px; line-height: 1.3; }
  .home-box .do .ic { flex: none; font-size: 24px; line-height: 1.2; }
  .home-box .keys { justify-content: center; }
  /* what to do next comes first; what is already in the Pot, the hint and the Zukan follow */
  .home-box > .home-made, .home-box > .home-hint, .home-box > .ghostbtn { order: 1; }
  .home-box .key { padding: 10px 16px; font-size: 14.5px; }
  .home-box .ghostbtn { padding: 10px 18px; }
  /* QA 11/09 #16: the hint and 📖 the Zukan stay in sight at the bottom of the sheet, without pulling it up */
  .home-box > .home-foot { order: 2; position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0 -16px calc(-18px - env(safe-area-inset-bottom));
    padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(70, 22, 104, 0.97); border-top: 1px solid rgba(255, 170, 230, 0.3); }
  .home-foot .home-hint { flex: 1 1 auto; min-width: 0; text-align: left; font-size: 11.5px; line-height: 1.4; }
  .home-foot .ghostbtn { flex: none; padding: 8px 14px; white-space: nowrap; }
  /* a button scrolled into view (a tap, or the keyboard highlight) is never left under that row */
  #home { scroll-padding-bottom: 76px; }
}

/* #5 the talk box keeps room for its つぎへ: on a wide screen the text stops short of the button,
   on a phone the button gets its own row under the text */
.talk:has(> .talk-next:not([hidden])) > .line { padding-right: 104px; }
@media (max-width: 600px) {
  .talk:has(> .talk-next:not([hidden])) > .line { padding-right: 0; }
  .choices .action-link { max-width: 100%; }
  .talk-next { position: static; display: block; margin: 8px 0 0 auto; padding: 9px 20px; font-size: 14px; }
}

/* #9 the kamishibai on a phone: the picture stays full width at the top, the talk box (and the choices) right under it */
@media (max-width: 600px) {
  #novel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 54px 18px 18px; overflow-y: auto; }
  #novel .kami, #novel.asking .kami { position: relative; left: auto; top: auto; flex: none; width: 100%; transform: none; transition: none; }
  #novel .novel-talk { position: relative; left: auto; bottom: auto; flex: none; width: 100%; transform: none; padding: 14px 16px 14px; }
  .novel-talk .line { font-size: 16px; line-height: 1.7; }
  .choice { padding: 11px 16px; font-size: 15px; }
}

/* time-lapse captions: on a wide screen a long one stays in the sky at the top of the picture;
   on a phone they sit in a band under the picture, not over it */
.tl-cap { max-width: min(54%, 400px); }
@media (max-width: 600px) {
  .tl-wrap { padding-bottom: calc(3 * 1.4em + 14px); font-size: 12px; }
  .tl-cap { left: 0; right: 0; top: auto; bottom: 0; max-width: none; min-height: calc(3 * 1.4em + 14px); padding: 7px 14px; border-radius: 0; box-shadow: none; background: rgba(255, 246, 252, 0.96); }
}

/* the Zukan and the "done" cards are on top of everything in the Pot: the aliens' speech bubble and the goal chip step back */
body:has(#zukan:not([hidden])) #alienSay, body:has(#next:not([hidden])) #alienSay { display: none; }
body:has(#zukan:not([hidden])) .goalchip, body:has(#next:not([hidden])) .goalchip { visibility: hidden; }

/* Tibetan stacks letters above and below the line: buttons get a taller line so the tops are never cut */
html[lang="dz"] :is(.do, .key, .choice, .chip, .ghostbtn, .talk-next, .ic-next, .cas-next, .zclose, .press, .action-link, .ask-go, .goalchip, .zukan-btn) { line-height: 1.75; }

/* phone: the long placeholder ("Type a food (e.g. ...)") fits instead of being cut off */
@media (max-width: 600px) { .ask-form { flex-wrap: wrap; } .ask-input { flex: 1 1 100%; min-width: 0; padding: 12px 14px; font-size: 15px; } .ask-go { flex: 1 1 100%; padding: 12px 22px; } }

/* ---------- Keyboard play (まどか 11/10 #1): the highlighted button, in the kit's pill glow ----------
   .kb-on is set by app.js on the button the arrows (or Tab) moved to; Enter presses it. */
.kb-on, .kb-on:focus, .kb-on:focus-visible {
  outline: 3px solid #fff6ef !important; outline-offset: 3px !important;
  box-shadow: 0 0 0 7px rgba(255, 95, 162, 0.55), 0 0 26px 6px rgba(255, 176, 74, 0.75) !important;
  position: relative; z-index: 1;
}
.kb-on.choice, .kb-on.key, .kb-on.do, .kb-on.chip { transform: translateX(4px); transition: transform 0.12s ease; }
.kb-on.chip { background: rgba(255, 95, 162, 0.45); }
.kb-on.tried, .kb-on.locked, .kb-on:disabled { box-shadow: 0 0 0 5px rgba(255, 170, 230, 0.35) !important; }
@media (prefers-reduced-motion: reduce) { .kb-on.choice, .kb-on.key, .kb-on.do, .kb-on.chip { transform: none; } }

/* the ? (how to play) in the top bar, next to ♪ */
.lang-switch .kb-help { min-width: 28px; font-weight: 900; }

/* ---------- How to play: one card before the story (and from the ?) ---------- */
#howto { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; background: rgba(10, 0, 30, 0.6); }
#howto[hidden] { display: none; }
.next-box.kb-howto { width: min(480px, calc(100% - 32px)); display: flex; flex-direction: column; align-items: stretch; gap: 12px; animation: popUp 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.kb-howto .eyebrow { margin: 0 0 2px; font-size: 24px; }
.kb-howto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.kb-howto-list li { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); text-align: left; }
.kb-icons { display: flex; justify-content: flex-end; gap: 6px; }
.kb-what { font: 700 16px/1.35 var(--read); color: #fff3fb; }
.kb-cap { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; background: linear-gradient(180deg, #fff6fb, #ffd6ec); color: #4a1a7a; font: 900 16px/1 var(--read); box-shadow: inset 0 -3px 0 rgba(160, 60, 140, 0.35), 0 3px 8px rgba(255, 95, 162, 0.45); }
.kb-cap.kb-wide { min-width: 64px; font-size: 13px; letter-spacing: 0.02em; }
.kb-tapicon { display: inline-grid; place-items: center; width: 40px; height: 34px; font-size: 24px; line-height: 1; }
.kb-tapicon.kb-pill::before { content: ""; width: 40px; height: 18px; border-radius: 999px; background: var(--pill); box-shadow: 0 3px 8px rgba(255, 95, 162, 0.5); }
/* "tap outside a window": a little window, and the tap dot outside it */
.kb-tapicon.kb-outside { position: relative; }
.kb-tapicon.kb-outside::before { content: ""; width: 26px; height: 20px; border-radius: 6px; border: 2px solid #ffd6f0; background: rgba(255, 214, 240, 0.15); transform: translate(-5px, -3px); }
.kb-tapicon.kb-outside::after { content: ""; position: absolute; right: 3px; bottom: 2px; width: 10px; height: 10px; border-radius: 50%; background: #ffe36a; box-shadow: 0 0 8px #ffe36a; }
.kb-howto-tap .kb-howto-list li { grid-template-columns: 52px 1fr; }
.kb-howto-alt { margin: 0; color: #ffd6f0; font: 500 13.5px/1.6 var(--read); }
.kb-howto .kb-howto-go { align-self: center; justify-content: center; min-width: 200px; margin-top: 4px; }
@media (max-width: 600px) {
  .kb-howto-list li { grid-template-columns: 112px 1fr; gap: 10px; padding: 7px 10px; }
  .kb-what { font-size: 14.5px; }
  .kb-howto .eyebrow { font-size: 21px; }
}

/* ---------- Outside the talk box (まどか 11/10): where we are, and the sources ---------- */
/* the place tag: top right of the picture, under the day pill, like it */
.kami-place { position: absolute; right: 14px; top: 12px; z-index: 2; max-width: 55%; margin: 0; padding: 4px 12px; border-radius: 999px; background: rgba(20, 6, 50, 0.66); color: #fff3fb; font: 700 13px/1.3 var(--read); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 10px rgba(20, 0, 50, 0.4); }
.kami-place[hidden] { display: none; }
.kami-day:not(:empty) ~ .kami-place { top: 44px; }
.kami:has(.ic-card) .kami-place, .kami:has(.tl-wrap) .kami-place { visibility: hidden; }
/* the sources: one small, quiet line just under the picture (never inside the talk box) */
.kami-src { position: absolute; z-index: 3; left: 10px; right: 10px; top: calc(100% + 6px); display: flex; align-items: center; gap: 8px; min-width: 0; }
.kami-src[hidden] { display: none; }
.kami-src-line { flex: 1; min-width: 0; margin: 0; color: rgba(255, 214, 240, 0.62); font: 500 11.5px/1.5 var(--read); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kami-src-line a { color: rgba(190, 225, 255, 0.78); text-decoration: underline; text-decoration-color: rgba(190, 225, 255, 0.3); text-underline-offset: 2px; }
.kami-src-line a:hover { color: #c8e8ff; }
.kami-src-head { color: rgba(255, 214, 240, 0.75); font-weight: 700; }
.kami-src-dot { opacity: 0.6; }
/* the line would touch the talk box (a short window): just the 📚 button */
.kami-src.kami-src-short .kami-src-line { display: none; }
.kami-src.kami-src-short { justify-content: flex-end; }
.kami-src-btn { flex: none; padding: 3px 10px; border: 1px solid rgba(255, 170, 230, 0.45); border-radius: 999px; background: rgba(20, 6, 50, 0.6); color: #fff; font: 700 13px/1.2 var(--read); cursor: pointer; }
.kami-src-btn:hover { background: rgba(255, 95, 162, 0.35); }
.kami-src-btn[hidden] { display: none; }
.kami-src-list { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 4; width: min(460px, 100%); max-height: 50vh; overflow: auto; padding: 12px 16px; border-radius: 18px; background: linear-gradient(160deg, rgba(36, 14, 82, 0.97), rgba(70, 20, 90, 0.97)); border: 1px solid rgba(255, 170, 230, 0.5); box-shadow: 0 10px 30px rgba(20, 0, 50, 0.6); text-align: left; }
.kami-src-list[hidden] { display: none; }
.kami-src-title { margin: 0 0 6px; color: #ffd6f0; font: 700 13px/1.3 var(--read); }
.kami-src-list ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.kami-src-list li { color: #f3e2ff; font: 500 13px/1.5 var(--read); }
.kami-src-list a { color: #9ad8ff; }
@media (max-width: 600px) {
  /* phone: the line sits between the picture and the talk box, in the flow (one line; 📚 opens the rest) */
  .kami-src { position: relative; top: auto; left: auto; right: auto; margin-top: 6px; padding: 0 4px; }
  .kami-place { right: 10px; top: 8px; max-width: 62%; font-size: 12px; padding: 3px 10px; }
  .kami-day:not(:empty) ~ .kami-place { top: 38px; }
  .kami-src-list { width: 100%; }
}

/* ---------- play-test 11/10 (pictures): the meal-ritual party — friends hop with two legs up, confetti drifts down ---------- */
.kami-svg .k-hop { animation: k-hop 0.9s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.23s); }
@keyframes k-hop { 50% { transform: translateY(-7px); } }
.kami-svg .k-confetti { animation: k-confetti 3.4s linear infinite; animation-delay: calc(var(--i, 0) * -0.41s); transform-box: fill-box; transform-origin: center; }
@keyframes k-confetti { 0% { translate: 0 -50px; rotate: 0deg; opacity: 0; } 12% { opacity: 1; } 85% { opacity: 1; } 100% { translate: 14px 130px; rotate: 300deg; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kami-svg .k-hop, .kami-svg .k-confetti { animation: none; } }

/* ---------- play-test 11/10 #4 (pictures): the Pot is a habitat capsule standing on a bare planet ----------
   ui/bowl.js draws the ground (.pot-land, behind everything but the sky), the dome and its base ring inside the floor's svg
   (it overflows upwards), and the front of the glass over the plots (.pot-glass). The old outline dome is gone. */
#bowl .pot-land { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bowl .pot-floor { overflow: visible; filter: drop-shadow(0 0 14px rgba(142, 232, 255, 0.28)); }
#bowl .pot-glass { position: absolute; z-index: 1; overflow: visible; pointer-events: none; }
#bowl .pot-floor .pot-lamp { animation: pot-lamp 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.27s); }
@keyframes pot-lamp { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { #bowl .pot-floor .pot-lamp { animation: none; } }

/* ---------- play-test 11/10 #9 (pictures): the pond becomes a sea once tuna, oysters, nori or an octopus live in the Pot ---------- */
#bowl .plot.is-sea { width: clamp(170px, 19vw, 280px); }
#bowl .plot .sea-life { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
#bowl .plot .sea-life svg { display: block; width: 100%; height: auto; overflow: visible; }
/* the Pot's air (phytoplankton pond, or the sea's green edge) and the worm compost box (ui/bowl.js potExtra) */
#bowl .plot .pot-extra { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
#bowl .plot .pot-extra svg { display: block; width: 100%; height: auto; overflow: visible; }
.pot-extra .px-bub { animation: px-bub 2.8s ease-out infinite; animation-delay: calc(var(--i) * -0.9s); opacity: 0; }
@keyframes px-bub { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
.pot-extra .px-worm { animation: px-worm 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.pot-extra .px-worm.w2 { animation-delay: -0.8s; }
@keyframes px-worm { 50% { transform: rotate(14deg) translateY(-1px); } }
.plot > .pot-extra { transition: filter 0.6s ease var(--cas-d, 0s); }
.plot.cas-dark > .pot-extra { filter: grayscale(1) brightness(0.42); }
.plot.cas-dim > .pot-extra { filter: grayscale(0.8) brightness(0.58); }
@media (prefers-reduced-motion: reduce) { .pot-extra .px-bub, .pot-extra .px-worm { animation: none; } .pot-extra .px-bub { opacity: 0.7; } }
#bowl .plot .sea-octo { animation: sea-octo 2.6s ease-in-out infinite; }
@keyframes sea-octo { 50% { translate: 0 4px; } }
@media (max-width: 600px) { #bowl .plot.is-sea { width: 30vw; } }
@media (prefers-reduced-motion: reduce) { #bowl .plot .sea-octo { animation: none; } }

/* ---------- play-test 11/10 follow-up (pictures): what a UFO's beam lifts bobs gently on its way up ---------- */
.kami-svg .k-rise { animation: k-rise 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.6s); }
@keyframes k-rise { 50% { translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) { .kami-svg .k-rise { animation: none; } }

/* ---------- The goal chip: a small 「目標」 label instead of "目標：" (no colons, まどか) ---------- */
.kb-goal-label { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #c2306a; font-size: 11px; font-weight: 900; letter-spacing: 0.06em; vertical-align: 1px; }

/* ---------- The Zukan as a Pokédex (まどか 11/10): number, icon screen, days, how we made it, the note ---------- */
.zukan-box { width: min(980px, calc(100% - 32px)); }
.zlist { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; align-items: start; }
.z.zd { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-radius: 20px; background: linear-gradient(170deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05)); box-shadow: inset 0 0 0 1px rgba(255, 170, 230, 0.32); }
.zd-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.zd-no { color: #ffb0dc; font: 700 11px/1 "Space Mono", ui-monospace, monospace; letter-spacing: 0.08em; }
.zd-days { padding: 3px 9px; border-radius: 999px; background: rgba(255, 227, 106, 0.16); color: #ffe36a; font: 700 11.5px/1.3 var(--read); text-align: right; }
.zd-head { display: flex; align-items: center; gap: 10px; }
.z .zd-screen { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; font-size: 30px; line-height: 1; background: radial-gradient(circle at 35% 30%, #fff6fb 0%, #ffc4e2 45%, #c25aa8 100%); box-shadow: inset 0 -3px 6px rgba(90, 20, 80, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.18); }
.zd-head b { display: block; font-size: 16px; line-height: 1.3; }
.zd-head small { display: block; color: #ffb0dc; font-size: 10.5px; }
.zd-how { margin: 4px 0 0; color: #ffd6f0; font: 900 11.5px/1.3 var(--read); letter-spacing: 0.08em; }
.zd-how small { margin-left: 4px; color: rgba(255, 214, 240, 0.6); font-weight: 500; letter-spacing: 0; }
.zd-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0; }
.zd-steps li { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 6px; align-items: start; padding: 3px 0 7px; }
/* a thin line joins the steps, like a little flow */
.zd-steps li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; border-radius: 2px; background: rgba(255, 170, 230, 0.35); }
.zd-i { display: grid; place-items: center; width: 24px; height: 22px; font-size: 15px; line-height: 1; }
.zd-t { color: #fff3fb; font: 500 12px/1.5 var(--read); }
.zd-t em { font-style: normal; white-space: nowrap; }
.zd-p { color: #9ad8ff; font-size: 10.5px; }
.zd-w { margin-left: 4px; color: #ffe36a; font-size: 10.5px; }
.zd-b { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: rgba(255, 95, 162, 0.35); color: #fff; font-size: 10px; font-weight: 700; }
.zd-chose .zd-t { font-weight: 700; }
.zd-reuse .zd-t { color: #b8f0d8; }
.zd-none { margin: 0; color: rgba(255, 230, 246, 0.5); font: 500 12px/1.4 var(--read); }
.zd-uses { margin: 2px 0 0; font: 500 12px/1.7 var(--read); color: #f3e2ff; }
.zd-label { margin-right: 4px; color: #ffd6f0; font-weight: 900; font-size: 11.5px; letter-spacing: 0.06em; }
.zd-use { white-space: nowrap; margin-right: 6px; }
.z .zd-note { margin: 4px 0 0; padding-top: 6px; border-top: 1px dashed rgba(255, 170, 230, 0.3); font-size: 11.5px; line-height: 1.55; color: #f3e2ff; }
.z.zd.locked { opacity: 0.7; }
.z.zd.locked .zd-screen { filter: grayscale(1) brightness(0.35); }
@media (max-width: 600px) {
  .zukan-box { width: calc(100% - 20px); padding: 16px 12px; }
  .zlist { grid-template-columns: 1fr; }
  .z.locked.zd { padding: 8px 12px; }
}
@media (max-width: 600px) {
  /* phone: locked entries two to a row, made ones across the whole width */
  .zlist { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .z.zd:not(.locked) { grid-column: 1 / -1; }
}
/* a made thing takes a whole row, as a two-sided Pokédex page; the ones still to find stay small tiles */
.zlist { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.z.zd.zd-got { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 6px 18px; align-items: start; }
.zd-side, .zd-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.zd-main { padding-left: 16px; border-left: 1px dashed rgba(255, 170, 230, 0.3); }
.zd-side .zd-note { border-top: 0; padding-top: 0; }
.zd-main .zd-how { margin-top: 2px; }
@media (max-width: 600px) {
  .z.zd.zd-got { grid-template-columns: 1fr; }
  .zd-main { padding-left: 0; padding-top: 6px; border-left: 0; border-top: 1px dashed rgba(255, 170, 230, 0.3); }
}
@media (max-width: 600px) {
  .zlist { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- play-test 11/10 (pictures): on a wide screen the talk box never covers the picture ----------
   The picture and the talk box stack in a column (like the phone layout) instead of overlapping. The picture's width
   also follows the window height, leaving room (--rsv) for the talk box: more choices, more room. If a question is
   still too tall (a very short window), the screen scrolls instead of covering the picture. The sources line
   (.kami-src, under the picture) keeps its place in the 34px gap. */
@media (min-width: 601px) {
  #novel { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 58px 24px 14px; box-sizing: border-box; overflow-y: auto; --rsv: 250px; }
  #novel > .kami { margin-top: auto; }
  #novel > .novel-talk { margin-bottom: auto; }
  #novel .kami, #novel.asking .kami { position: relative; left: auto; top: auto; transform: none; flex: none; }
  #novel .novel-talk { position: relative; left: auto; bottom: auto; transform: none; flex: none; }
  #novel .kami { width: min(820px, 86vw, max(320px, calc((100dvh - var(--rsv)) * 16 / 9))); }
  #novel.asking { --rsv: 366px; }
  #novel.asking:has(.choice:nth-child(4)) { --rsv: 418px; }
  #novel.asking:has(.choice:nth-child(5)) { --rsv: 470px; }
  #novel.asking:has(.choice:nth-child(6)) { --rsv: 522px; }
  #novel.asking:has(.choice:nth-child(7)) { --rsv: 574px; }
  #novel.asking .kami { width: min(560px, 58vw, max(240px, calc((100dvh - var(--rsv)) * 16 / 9))); }
  /* the 🌍 card takes the picture's place and hides the talk box: it may use the height */
  #novel:has(.ic-card) .kami { width: min(820px, 86vw, max(360px, calc((100dvh - 90px) * 16 / 9))); }
}
/* the screen's scanline/grain layers (inset -50%) are fixed to the window, so they never make the novel scroll into empty space */
#novel::before, #novel::after { position: fixed; }

/* ---------- Who else lives at home (lib/residents.js, ui/bowl.js): the pets, the spared ones in the water, visiting friends ---------- */
.tl-animal.tl-pet { pointer-events: auto; cursor: pointer; }
.tl-animal.tl-pet[data-state="in"] { pointer-events: none; }
.tl-animal.tl-pet:hover svg { filter: drop-shadow(0 0 8px rgba(255, 210, 63, 0.95)); }
.tl-pet-koron { width: clamp(26px, 2.6vw, 40px); }
.tl-pet-piglet { width: clamp(24px, 2.3vw, 34px); }
.tl-pet-chick { width: clamp(16px, 1.5vw, 22px); }
.tl-pet-calf { width: clamp(34px, 3.4vw, 52px); }
.tl-pet-hen { width: clamp(20px, 2vw, 30px); }
.tl-pet .pet-shut { opacity: 0; }
.tl-pet[data-state="sleep"] .pet-shut { opacity: 1; }
.tl-pet[data-state="sleep"] .pet-eyes { opacity: 0; }
.tl-pet-koron[data-state="sleep"] svg { transform: translateY(5%) scale(1.06, 0.9); transform-origin: 50% 100%; }
.tl-pet-koron .pet-antenna { animation: pet-sway 2.4s ease-in-out infinite; transform-box: view-box; transform-origin: 30px 25px; }
.tl-pet-koron[data-state="sit"] svg { animation: pet-breathe 2s ease-in-out infinite; transform-origin: 50% 100%; }
.tl-animal.tl-pet.tl-hop svg { animation: pet-hop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pet-sway { 0%, 100% { rotate: -10deg; } 50% { rotate: 10deg; } }
@keyframes pet-breathe { 50% { scale: 1.04 0.96; } }
@keyframes pet-hop { 0%, 100% { translate: 0 0; } 45% { translate: 0 -55%; scale: 0.94 1.08; } 80% { translate: 0 0; scale: 1.1 0.9; } }
.alien.tl-visitor.tl-leaving { animation: tl-beam-up 0.7s ease-in forwards; }
@keyframes tl-beam-up { to { translate: 0 -70%; scale: 0.5; opacity: 0; } }
#bowl .plot .tl-spared { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
#bowl .plot .tl-spared svg { display: block; width: 100%; height: auto; overflow: visible; }
.tl-spared .tl-sparkle { animation: tl-twinkle 2.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.55s); transform-box: fill-box; transform-origin: center; }
@keyframes tl-twinkle { 0%, 100% { opacity: 0.15; scale: 0.6; } 50% { opacity: 1; scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .tl-pet *, .tl-pet svg, .tl-spared *, .alien.tl-visitor.tl-leaving { animation: none !important; }
  .tl-spared .tl-sparkle { opacity: 1; }
}
