/* 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: blink 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); } }
@keyframes blink { 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: 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; }

.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); }
