/* Klang River Festival · Madu AI — guest app
   Layout: AI-first. A visual stage illustrates whatever Madu says; the chat drives it.
   Desktop: stage left, chat right. Phone: stage on top, chat below, draggable splitter between.
   Colours follow the KRF mark (navy, cream river line, bright dots) and the River Guardians game (sky, sun, hibiscus). */
:root {
  --ink: #0E4A6B; --navy: #13284A; --jade: #166694;
  --sky: #10BBEC; --sky-d: #0A93BF; --sky-l: #BDEBFA;
  --leaf: #8BCF5E; --leaf-d: #62A93E; --pink: #FD9BC8; --pink-d: #E56FA8;
  --sun: #FFC547; --sun-d: #E0A21F; --hib: #E94825; --hib-d: #B9351A;
  --cream: #EFE6D2; --mist: #F2FAFE; --paper: #fff; --line: #D3E7F0; --muted: #557C8E; --dim: #8FAEBD;
  --text: #0E4A6B;
  --display: "Fredoka", "Noto Sans SC", system-ui, sans-serif;
  --body: "Figtree", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 20px; --top-h: 60px; --stage-h: 46%; --chat-w: 440px;
  --shadow: 0 10px 28px rgba(14, 74, 107, .1); --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.2, .9, .3, 1.4);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--text); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button, a, input, [role="button"] { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; -webkit-user-drag: none; user-select: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun-d); outline-offset: 2px; border-radius: 8px; }
.disp { font-family: var(--display); font-weight: 700; line-height: 1.02; text-wrap: balance; letter-spacing: -.01em; }
html[lang="zh"] .disp { line-height: 1.18; letter-spacing: .01em; }

/* ---------- welcome ---------- */
.welcome { position: fixed; inset: 0; z-index: 50; display: grid; overflow: auto; color: #fff;
  background: radial-gradient(ellipse at 50% 62%, #1F4C86 0%, var(--navy) 62%, #0C1B36 100%); transition: opacity .75s ease, transform .75s var(--ease), filter .75s; }
.welcome.out { opacity: 0; transform: scale(1.12); filter: blur(6px); pointer-events: none; }
.w-river { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .9; }
.w-river .line { fill: none; stroke: var(--cream); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2200; stroke-dashoffset: 2200; animation: drawLine 2.6s var(--ease) .2s forwards; opacity: .5; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.w-river .dot { transform-box: fill-box; transform-origin: center; animation: dotIn .7s var(--spring) both, bobDot 5s ease-in-out infinite; opacity: .9; }
.w-river .d1 { fill: #8A7650; animation-delay: .5s, 0s; } .w-river .d2 { fill: #0B5CFF; animation-delay: .7s, .6s; } .w-river .d3 { fill: #F58A84; animation-delay: .9s, 1.2s; }
.w-river .d4 { fill: #F03A2E; animation-delay: 1.1s, 1.8s; } .w-river .d5 { fill: #F03A2E; animation-delay: 1.3s, .3s; } .w-river .d6 { fill: #5B9DFF; animation-delay: 1.5s, .9s; }
@keyframes dotIn { from { transform: scale(0); opacity: 0; } }
@keyframes bobDot { 50% { translate: 0 -10px; } }
.w-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2.6vh, 26px); min-height: 100%; justify-content: space-between;
  padding-block: calc(env(safe-area-inset-top, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 22px); padding-inline: max(18px, env(safe-area-inset-left, 0px)) max(18px, env(safe-area-inset-right, 0px)); }
.w-top { width: 100%; max-width: 980px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.w-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.w-brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.w-brand b { font: 600 15px/1.15 var(--display); letter-spacing: .01em; max-width: 9em; }
.w-copy { text-align: center; max-width: 720px; display: grid; gap: 8px; animation: rise .8s var(--ease) .3s both; }
.w-eyebrow { margin: 0; font: 700 11.5px/1.3 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--sun); }
.w-title { margin: 0; font: 700 clamp(40px, 10.5vw, 88px)/.98 var(--display); display: grid; text-shadow: 0 6px 30px rgba(0,0,0,.35); letter-spacing: -.015em; }
.w-title span { font-size: .5em; font-weight: 600; color: var(--sky-l); }
.w-title b { font-weight: 700; }
html[lang="zh"] .w-title { line-height: 1.12; }
.w-sub { margin: 0 auto; font-size: clamp(14.5px, 2.2vw, 18px); opacity: .92; max-width: 34em; }
.w-drop { position: relative; width: min(60vw, 280px, 36vh); aspect-ratio: 1; border: 0; padding: 0; background: none; display: grid; place-items: center; animation: floatY 3.6s ease-in-out infinite; }
.w-drop .bubble { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: end center;
  background: radial-gradient(circle at 32% 26%, #fff 0 6%, rgba(255,255,255,.55) 7% 12%, transparent 30%), radial-gradient(circle at 50% 60%, #8FE3FB 0%, var(--sky) 55%, var(--sky-d) 100%);
  box-shadow: inset 0 -18px 40px rgba(10,147,191,.75), inset 0 0 0 5px rgba(255,255,255,.45), 0 24px 60px rgba(0,0,0,.45), 0 0 80px rgba(16,187,236,.45); transition: transform .5s var(--spring); }
.w-drop .bubble img { width: 92%; margin-bottom: -6%; filter: drop-shadow(0 8px 12px rgba(14,74,107,.35)); animation: maduBob 2.4s ease-in-out infinite; }
.w-drop .shine { position: absolute; left: 14%; top: 12%; width: 26%; height: 14%; border-radius: 50%; background: rgba(255,255,255,.7); transform: rotate(-32deg); filter: blur(2px); }
.w-drop .ring { position: absolute; inset: -2%; border-radius: 50%; border: 3px solid rgba(189,235,250,.8); opacity: 0; animation: ripple 3s ease-out infinite; pointer-events: none; }
.w-drop .ring.r2 { animation-delay: 1s; } .w-drop .ring.r3 { animation-delay: 2s; }
.w-drop:active .bubble { transform: scale(.95); }
.w-drop.hit { animation: none; }
.w-drop.hit .bubble { animation: dive 1.05s var(--ease) forwards; }
.w-drop.hit .ring { animation: ripple .9s ease-out 2; border-color: #fff; }
@keyframes dive { 0% { transform: scale(1); } 22% { transform: scale(.88); } 60% { transform: scale(1.14); } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes floatY { 50% { translate: 0 -8px; } }
@keyframes maduBob { 50% { transform: translateY(-2.5%) rotate(1.2deg); } }
@keyframes ripple { from { opacity: .85; transform: scale(1); } to { opacity: 0; transform: scale(1.55); } }
.w-hint { margin: 0; text-align: center; display: grid; gap: 5px; font: 700 clamp(17px, 3.6vw, 22px)/1.1 var(--display); letter-spacing: .06em; animation: rise .8s var(--ease) .6s both; }
.w-hint small { font: 500 12px/1.3 var(--body); letter-spacing: .03em; color: var(--sky-l); }
.w-hint em { font: 700 10.5px/1.3 var(--body); font-style: normal; letter-spacing: .2em; color: rgba(255,255,255,.55); margin-top: 6px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); flex: none; }
.seg button { border: 0; background: none; padding: 8px 15px; border-radius: 999px; font: 700 13px/1 var(--body); color: rgba(255,255,255,.8); letter-spacing: .03em; white-space: nowrap; transition: background .2s, color .2s; }
.seg button.on { background: var(--sun); color: var(--ink); box-shadow: 0 2px 0 var(--sun-d); }
.seg.small { background: var(--mist); border-color: var(--line); }
.seg.small button { padding: 7px 10px; font-size: 12px; color: var(--muted); }
.seg.small button.on { background: var(--sky); color: #fff; box-shadow: 0 2px 0 var(--sky-d); }

/* ---------- frame ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.top { position: relative; z-index: 5; flex: none; display: flex; align-items: center; gap: 10px; height: calc(var(--top-h) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 2px 14px rgba(14,74,107,.06); }
.brand img { height: 40px; width: 40px; border-radius: 12px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ag-avatar { position: relative; width: 42px; height: 42px; border-radius: 50%; flex: none; background: radial-gradient(circle at 40% 30%, #fff, var(--sky-l)); box-shadow: 0 0 0 2.5px var(--sky), 0 3px 10px rgba(16,187,236,.35); transition: box-shadow .3s; }
.ag-avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ag-avatar.thinking > img { animation: tilt 1s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.ag-avatar.talking > img { animation: nod .34s ease-in-out infinite alternate; }
@keyframes nod { to { transform: translateY(-2px) scale(1.04); } }
.ag-avatar.talking, .ag-avatar.speaking { animation: avatarGlow 1.2s ease-in-out infinite; }
.ag-avatar.speaking { cursor: pointer; }
@keyframes avatarGlow { 0%, 100% { box-shadow: 0 0 0 2.5px var(--sky), 0 0 0 0 rgba(16,187,236,.5); } 50% { box-shadow: 0 0 0 2.5px var(--sun), 0 0 0 8px rgba(16,187,236,0); } }
.ag-mood { position: absolute; right: -6px; bottom: -5px; z-index: 3; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(14,74,107,.3); pointer-events: none; }
.ag-mood .emo { width: 18px; height: 18px; }
.ag-mood.pop { animation: emopop .7s var(--spring); }
.ag-who { display: grid; min-width: 0; }
.ag-who b { font: 700 19px/1.05 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-who small { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-who small i { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf-d); flex: none; box-shadow: 0 0 0 3px rgba(139,207,94,.25); }
.ag-who small i.off { background: var(--sun-d); box-shadow: 0 0 0 3px rgba(255,197,71,.3); }
.top-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--mist); display: grid; place-items: center; flex: none; color: var(--jade); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .x { display: none; }
#stageBtn[aria-pressed="false"] .x { display: block; }
.eq { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.eq i { width: 3px; background: var(--sky); border-radius: 2px; height: 4px; transition: height .12s; }

.split { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage { position: relative; flex: none; height: var(--stage-h); min-height: 0; overflow: hidden; isolation: isolate; transition: height .4s var(--ease);
  background: linear-gradient(180deg, #CDF1FC 0%, #E9F9FF 46%, #F4FCFF 100%); }
.split.dragging .stage { transition: none; }
.split.textonly .stage { height: 0 !important; }
.backdrop { position: absolute; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 88%, var(--mood-glow, transparent), transparent 62%); transition: background .9s; }
.backdrop .sun { position: absolute; right: 7%; top: 56px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, #FFF3C4 0 38%, rgba(255,197,71,.3) 40%, rgba(255,197,71,0) 70%); opacity: .8; animation: sunPulse 6s ease-in-out infinite; }
@keyframes sunPulse { 50% { transform: scale(1.12); opacity: .85; } }
.backdrop .cloud { position: absolute; width: 150px; height: 44px; border-radius: 999px; background: #fff; opacity: .8; filter: blur(.4px); }
.backdrop .cloud::before, .backdrop .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.backdrop .cloud::before { width: 62px; height: 62px; left: 22px; top: -28px; } .backdrop .cloud::after { width: 78px; height: 74px; right: 24px; top: -38px; }
.backdrop .c1 { left: -160px; top: 92px; animation: drift 70s linear infinite; } .backdrop .c2 { left: -160px; top: 190px; scale: .62; opacity: .6; animation: drift 96s linear -40s infinite; }
@keyframes drift { to { transform: translateX(calc(100vw + 400px)); } }
.waves { position: absolute; left: 0; bottom: 0; width: 220%; height: clamp(70px, 16%, 130px); }
.waves path { animation: waveX 9s linear infinite; }
.waves .w1 { fill: rgba(16,187,236,.16); } .waves .w2 { fill: rgba(16,187,236,.2); animation-duration: 13s; animation-direction: reverse; } .waves .w3 { fill: rgba(16,187,236,.26); animation-duration: 17s; }
@keyframes waveX { to { transform: translateX(-300px); } }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.sweep { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0) 40%, rgba(255,255,255,.55) 48%, rgba(189,235,250,.75) 50%, rgba(255,255,255,.55) 52%, transparent 60%); background-size: 250% 100%; background-position: 120% 0; }
.sweep.go { animation: sweep .95s cubic-bezier(.3,.7,.2,1); }
@keyframes sweep { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: .2; background-position: -40% 0; } }

.scene-tabs { position: absolute; z-index: 3; top: 10px; left: 0; right: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%); mask: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%); }
.scene-tabs::-webkit-scrollbar { display: none; }
.scene-tabs button { flex: none; border: 1px solid var(--line); background: rgba(255,255,255,.86); backdrop-filter: blur(8px); border-radius: 999px; padding: 7px 13px; font: 600 13.5px/1 var(--display); color: var(--jade); box-shadow: 0 2px 0 rgba(14,74,107,.08); }
.scene-tabs button.on { background: var(--sky); border-color: var(--sky-d); color: #fff; box-shadow: 0 3px 0 var(--sky-d); }
.showing { position: absolute; z-index: 5; left: 50%; bottom: 12px; transform: translate(-50%, 14px); opacity: 0; pointer-events: none; display: flex; gap: 8px; align-items: center; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 12.5px/1 var(--body); white-space: nowrap; transition: .35s var(--spring); box-shadow: 0 8px 24px rgba(14,74,107,.35); }
.showing b { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: var(--sky-l); }
.showing b img { width: 100%; height: 100%; object-fit: cover; }
.showing.show { opacity: 1; transform: translate(-50%, 0); }
.showing.show b { animation: spinIn .6s var(--spring); }
@keyframes spinIn { from { transform: rotate(-120deg) scale(.4); } }
.scene-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; container-type: inline-size; padding: 58px max(14px, env(safe-area-inset-right, 0px)) 96px max(14px, env(safe-area-inset-left, 0px)); scroll-behavior: smooth; overscroll-behavior: contain; }
.scene { max-width: 980px; margin: 0 auto; display: grid; gap: 16px; }
.scene.leave { animation: sceneOut .23s cubic-bezier(.4,0,1,1) forwards; pointer-events: none; }
@keyframes sceneOut { to { opacity: 0; transform: translateY(-10px) scale(.985); filter: blur(4px); } }
.scene.enter > * { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.scene.enter [data-stagger] > * { animation: rise .6s var(--ease) both; animation-delay: calc(120ms + var(--j, 0) * 50ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* Madu on the stage */
.stage-madu { position: absolute; z-index: 4; left: max(8px, env(safe-area-inset-left, 0px)); bottom: 4px; width: clamp(64px, 15%, 104px); aspect-ratio: 1; border: 0; padding: 0; background: none; filter: drop-shadow(0 8px 10px rgba(14,74,107,.28)); transition: opacity .3s, transform .3s; }
.stage-madu img { width: 100%; height: 100%; object-fit: contain; }
.stage-madu.boing img { animation: boing .6s var(--spring); }
.stage-madu.talking img { animation: nod .34s ease-in-out infinite alternate; }
@keyframes boing { 0% { transform: scale(.82, 1.12); } 45% { transform: scale(1.1, .92); } 100% { transform: none; } }
.stage[data-scene="home"] .stage-madu, .stage[data-scene="river"] .stage-madu, .stage[data-scene="rescue"] .stage-madu, .stage[data-scene="madu"] .stage-madu, .stage[data-scene="quiz"] .stage-madu, .stage[data-scene="msg"] .stage-madu { opacity: 0; pointer-events: none; transform: translateY(30px); }
.madu-say { position: absolute; z-index: 5; left: calc(max(8px, env(safe-area-inset-left, 0px)) + clamp(64px, 15%, 104px) - 6px); bottom: clamp(46px, 9%, 70px); max-width: min(300px, 62%); padding: 10px 14px; border-radius: 18px 18px 18px 4px; background: #fff; border: 2px solid var(--sky); font-size: 13.5px; line-height: 1.4; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px) scale(.9); transform-origin: left bottom; pointer-events: none; transition: .35s var(--spring); }
.madu-say.show { opacity: 1; transform: none; }

.splitter { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; height: 18px; position: relative; z-index: 6; cursor: row-resize; touch-action: none; background: var(--paper); border-block: 1px solid var(--line); }
.splitter i { width: 52px; height: 5px; border-radius: 3px; background: var(--line); transition: background .25s, box-shadow .25s; }
.splitter:hover i, .split.dragging .splitter i { background: var(--sky); }
.splitter .chev { width: 7px; height: 7px; border-top: 2px solid var(--dim); border-left: 2px solid var(--dim); opacity: .6; transition: opacity .25s, border-color .25s; }
.splitter .chev.a { transform: translateY(2px) rotate(45deg); }
.splitter .chev.b { transform: translateY(-2px) rotate(225deg); }
.splitter:hover .chev { opacity: 1; border-color: var(--sky); }
.drag-hint { position: absolute; right: max(14px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); display: none; align-items: center; gap: 5px; padding: 3px 9px 3px 6px; border-radius: 999px; background: var(--sun); color: var(--ink); font: 700 10.5px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; box-shadow: 0 3px 0 var(--sun-d); }
.drag-hint .hand { font-size: 12px; animation: handY 1.4s ease-in-out infinite; }
@keyframes handY { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.split.hint .splitter .chev, .splitter.gt-focus .chev { opacity: 1; border-color: var(--sun-d); }
.split.hint .splitter .chev.a, .splitter.gt-focus .chev.a { animation: chevUp 1.4s ease-in-out infinite; }
.split.hint .splitter .chev.b, .splitter.gt-focus .chev.b { animation: chevDown 1.4s ease-in-out infinite; }
@keyframes chevUp { 0%, 100% { transform: translateY(2px) rotate(45deg); opacity: .55; } 50% { transform: translateY(-3px) rotate(45deg); opacity: 1; } }
@keyframes chevDown { 0%, 100% { transform: translateY(-2px) rotate(225deg); opacity: .55; } 50% { transform: translateY(3px) rotate(225deg); opacity: 1; } }
.split.hint .splitter i, .splitter.gt-focus i { background: var(--sun); animation: gripGlow 1.4s ease-in-out infinite; }
@keyframes gripGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,197,71,0); } 50% { box-shadow: 0 0 12px 3px rgba(255,197,71,.7); } }
.split.hint .drag-hint, .splitter.gt-focus .drag-hint { display: inline-flex; animation: hintIn .5s var(--spring) both; }
@keyframes hintIn { from { opacity: 0; transform: translateY(-50%) scale(.7); } }
.split.nudging .stage { transition: height .48s cubic-bezier(.4,0,.2,1) !important; }
.split.nudging .chat { transition: width .48s cubic-bezier(.4,0,.2,1); }

/* ---------- chat ---------- */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--paper); }
.log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 90%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.msg.me { align-self: flex-end; background: var(--sky); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 3px 0 var(--sky-d); animation: meIn .35s var(--ease); transform-origin: right bottom; }
.msg.bot { position: relative; align-self: flex-start; background: var(--mist); border: 1px solid var(--line); border-bottom-left-radius: 5px; padding-left: 42px; animation: botIn .45s var(--ease); transform-origin: left bottom; }
@keyframes botIn { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes meIn { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.msg.bot .mtag { position: absolute; left: 10px; top: 9px; width: 24px; height: 24px; display: grid; place-items: center; }
.msg.bot .mtag .emo { width: 24px; height: 24px; animation: emopop .7s var(--spring); }
.msg.bot.speaking { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(16,187,236,.18); }
.msg.bot.speaking .mtag .emo { animation: emopop .7s var(--spring), emobob 1.1s ease-in-out .7s infinite; }
.msg .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; white-space: normal; }
.msg .acts button, .msg .acts a { border: 1px solid var(--sky); background: #fff; color: var(--sky-d); border-radius: 999px; padding: 6px 11px; font: 700 12px/1 var(--body); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; animation: chipIn .4s var(--spring) both; }
.msg .acts svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.msg .acts button.listen { border-color: var(--line); color: var(--muted); }
.msg.bot.speaking .acts button.listen { background: var(--sun); color: var(--ink); border-color: var(--sun-d); }
.typing { align-self: flex-start; display: flex; gap: 6px; padding: 14px 16px; border-radius: 18px; background: var(--mist); border: 1px solid var(--line); }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); animation: bubbleUp 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bubbleUp { 0%, 100% { transform: translateY(3px) scale(.8); opacity: .5; } 50% { transform: translateY(-4px) scale(1.1); opacity: 1; } }

.journey { flex: none; display: grid; grid-template-rows: 1fr; padding: 4px 0 0; border-top: 1px solid var(--line); background: linear-gradient(180deg, #FFF9E8, transparent);
  transition: grid-template-rows .38s var(--ease), opacity .3s ease, padding .38s ease, border-color .3s; }
.journey > .chips { min-height: 0; overflow-y: hidden; }
.journey.collapsed { grid-template-rows: 0fr; opacity: 0; padding: 0; border-top-color: transparent; pointer-events: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 13px; font: 600 13px/1.15 var(--body); color: var(--text); display: inline-flex; gap: 7px; align-items: center; max-width: 82vw; box-shadow: 0 2px 0 rgba(14,74,107,.08); }
.chips button .g { white-space: nowrap; font: 700 9.5px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.chips button.next { position: relative; overflow: hidden; background: var(--sun); border-color: var(--sun-d); color: var(--ink); font-weight: 700; box-shadow: 0 3px 0 var(--sun-d); }
.chips button.next .g { color: var(--ink); opacity: .65; }
.chips button.next::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.6) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 3.8s ease-in-out 1s infinite; }
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.chips.in > * { animation: chipIn .45s var(--spring) both; animation-delay: calc(var(--j, 0) * 60ms); }
@keyframes chipIn { from { opacity: 0; transform: translateX(14px) scale(.96); } }
.chips .clear-chip { background: none; border-style: dashed; color: var(--dim); box-shadow: none; }
.chips .clear-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.composer { flex: none; display: flex; gap: 8px; padding: 6px max(14px, env(safe-area-inset-right, 0px)) 6px max(14px, env(safe-area-inset-left, 0px)); }
.composer input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; border: 2px solid var(--line); background: var(--mist); color: var(--text); padding: 0 18px; font: 16px var(--body); outline: none; transition: border-color .2s, background .2s; }
.composer input::placeholder { color: var(--dim); }
.composer input:focus { border-color: var(--sky); background: #fff; }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--sky); display: grid; place-items: center; flex: none; box-shadow: 0 3px 0 var(--sky-d); transition: transform .12s, box-shadow .12s; }
.send:active { transform: translateY(3px); box-shadow: 0 0 0 var(--sky-d); }
.send svg { width: 20px; height: 20px; fill: #fff; }
.send:disabled { opacity: .5; }
.qk-btn { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--sun); background: #FFF6DC; color: var(--sun-d); display: grid; place-items: center; transition: background .25s, color .25s, transform .2s; }
.qk-btn svg { width: 21px; height: 21px; fill: currentColor; transition: transform .45s var(--spring); }
.qk-btn[aria-expanded="true"] { background: var(--sun); color: var(--ink); }
.qk-btn[aria-expanded="true"] svg { transform: rotate(72deg) scale(.92); }
.qk-btn:active { transform: scale(.92); }
.qk-dot { position: absolute; right: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--hib); box-shadow: 0 0 0 2px #fff; opacity: 0; transform: scale(.4); transition: .25s; }
.qk-btn.fresh .qk-dot { opacity: 1; transform: none; }
.qk-btn.fresh { animation: qkPulse 1.8s ease-out 3; }
@keyframes qkPulse { 0% { box-shadow: 0 0 0 0 rgba(255,197,71,.7); } 70% { box-shadow: 0 0 0 12px rgba(255,197,71,0); } 100% { box-shadow: 0 0 0 0 rgba(255,197,71,0); } }
.credit { flex: none; text-align: center; color: var(--dim); font-size: 11px; padding: 2px 16px calc(8px + env(safe-area-inset-bottom, 0px)); }
.credit a { color: var(--muted); }
.vip-link { display: inline-flex; align-items: center; gap: 4px; vertical-align: -2px; }
.vip-mark { height: 11px; width: auto; display: inline-block; filter: brightness(.55) sepia(1) hue-rotate(160deg) saturate(3); }
.beta { font-size: 9.5px; letter-spacing: .1em; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }

@media (min-width: 980px) {
  .split { flex-direction: row; }
  .stage { height: auto !important; flex: 1; min-width: 0; transition: none; }
  .split.textonly .stage { flex: 0; width: 0; }
  .splitter { flex-direction: column; width: 18px; height: auto; cursor: col-resize; border-block: 0; border-inline: 1px solid var(--line); }
  .splitter i { width: 5px; height: 52px; }
  .splitter .chev.a { transform: translateX(2px) rotate(-45deg); }
  .splitter .chev.b { transform: translateX(-2px) rotate(135deg); }
  @keyframes chevUp { 0%, 100% { transform: translateX(2px) rotate(-45deg); opacity: .55; } 50% { transform: translateX(-3px) rotate(-45deg); opacity: 1; } }
  @keyframes chevDown { 0%, 100% { transform: translateX(-2px) rotate(135deg); opacity: .55; } 50% { transform: translateX(3px) rotate(135deg); opacity: 1; } }
  .drag-hint { right: auto; left: 50%; top: calc(50% - 64px); transform: translate(-50%, -50%); }
  @keyframes hintIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } }
  @keyframes handY { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(3px); } }
  .chat { flex: none; width: var(--chat-w); }
  .split.textonly .chat { flex: 1; width: auto; max-width: 820px; margin: 0 auto; }
  .scene-scroll { padding: 66px 28px 120px; }
  .scene-tabs { top: 14px; padding-inline: 20px; }
  .stage-madu { left: 14px; bottom: 8px; }
}
@media (max-width: 979px) { .split.tall:not(.dragging) .stage { height: 68% !important; } }
/* Madu peeks over the edge of the stage and pops up when he reacts or you hover */
.stage-madu[data-pose="idle"]:not(.talking):not(:hover) { transform: translateY(46%); }
@media (max-width: 520px) { .who .ag-who small { display: none; } .brand img { height: 34px; width: 34px; } .ag-who b { font-size: 17px; } }
@media (max-width: 440px) { .top { gap: 8px; } .top-tools { gap: 4px; } .icon-btn { width: 34px; height: 34px; } .seg.small button { padding: 7px 8px; } .ag-avatar { width: 36px; height: 36px; } .who { flex: 1; } }
@media (max-width: 380px) { .brand { display: none; } }

/* ---------- shared scene parts ---------- */
.eyebrow { font: 700 11px/1.3 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--sky-d); margin: 0; }
.h2 { font: 700 clamp(26px, 5.6cqi, 42px)/1.05 var(--display); margin: 4px 0 0; letter-spacing: -.01em; text-wrap: balance; }
html[lang="zh"] .h2 { line-height: 1.22; }
.lead { color: var(--muted); max-width: 62ch; margin: 6px 0 0; }
.head { display: grid; gap: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 18px; font: 700 14px/1 var(--body); text-decoration: none; background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: 0 3px 0 var(--line); transition: transform .12s var(--ease), box-shadow .12s, background .2s, filter .2s; white-space: nowrap; }
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 transparent; }
.btn.sun { background: var(--sun); border-color: var(--sun-d); box-shadow: 0 4px 0 var(--sun-d); }
.btn.sky { background: var(--sky); border-color: var(--sky-d); color: #fff; box-shadow: 0 4px 0 var(--sky-d); }
.btn.vip { background: var(--navy); border-color: #0A1730; color: #fff; box-shadow: 0 4px 0 #0A1730; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.sm { padding: 8px 13px; font-size: 12.5px; box-shadow: 0 2px 0 var(--line); }
.btn.sm.sky { box-shadow: 0 3px 0 var(--sky-d); } .btn.sm.sun { box-shadow: 0 3px 0 var(--sun-d); } .btn.sm.vip { box-shadow: 0 3px 0 #0A1730; }
.btn.big { padding: 14px 24px; font-size: 16px; }
.btn:disabled { opacity: .7; filter: saturate(.6); cursor: default; transform: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.center { justify-content: center; }
.panel { padding: 18px; border-radius: var(--r); background: rgba(255,255,255,.94); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 10px; min-width: 0; }
.panel.pop { animation: panelPop .4s var(--spring); }
@keyframes panelPop { from { transform: scale(.96); opacity: .5; } }
.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 55% { box-shadow: 0 0 0 4px var(--sun), var(--shadow); } 100% { box-shadow: var(--shadow); } }
.tag { display: inline-block; font: 700 10px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: var(--sky-l); color: var(--jade); width: fit-content; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.stat { padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); border-bottom: 4px solid var(--sky); box-shadow: 0 4px 14px rgba(14,74,107,.06); }
.stat:nth-child(5n+2) { border-bottom-color: var(--sun); } .stat:nth-child(5n+3) { border-bottom-color: var(--leaf); } .stat:nth-child(5n+4) { border-bottom-color: var(--pink); } .stat:nth-child(5n+5) { border-bottom-color: var(--hib); }
.stat b { display: block; font: 700 clamp(22px, 4.6cqi, 30px)/1.05 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat span { color: var(--muted); font-size: 12px; line-height: 1.3; display: block; margin-top: 2px; }
.madu { pointer-events: none; }

/* home */
.hero-grid { display: grid; gap: 6px; align-items: center; grid-template-columns: minmax(0, 1fr) clamp(110px, 34cqi, 300px); }
.hero-copy { display: grid; gap: 12px; min-width: 0; }
.hero h1 { margin: 0; font-size: clamp(32px, 8.6cqi, 76px); }
.hero h1 small { display: block; font: 700 clamp(12px, 2.4cqi, 17px)/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--sky-d); margin-bottom: 8px; }
.hero-sub { font-size: clamp(14.5px, 2.4cqi, 19px); max-width: 34ch; margin: 0; color: var(--jade); }
.hero-madu { position: relative; border: 0; background: none; padding: 0; aspect-ratio: 1; width: 100%; align-self: end; animation: floatY 5s ease-in-out infinite; }
.hero-madu img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 16px rgba(14,74,107,.25)); }
.hero-madu .puddle { position: absolute; left: 12%; right: 12%; bottom: 3%; height: 12%; border-radius: 50%; background: radial-gradient(ellipse, rgba(16,187,236,.45), rgba(16,187,236,0) 70%); animation: puddle 2.5s ease-in-out infinite; }
@keyframes puddle { 50% { transform: scaleX(1.18); opacity: .6; } }
.hero-madu.boing img { animation: boing .6s var(--spring); }
@container (max-width: 460px) { .hero .row .btn { padding: 10px 14px; font-size: 13px; } }
.fact-now { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: #FFF9E8; border: 1.5px solid #F6DFA0; box-shadow: 0 4px 0 #F6DFA0; text-align: left; width: 100%; transition: transform .15s; }
.fact-now:active { transform: translateY(3px); box-shadow: none; }
.fact-now .bulb { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); box-shadow: 0 3px 0 var(--sun-d); animation: wiggle 3.2s ease-in-out infinite; }
.fact-now .bulb svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@keyframes wiggle { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-12deg); } 94% { transform: rotate(10deg); } 97% { transform: rotate(-5deg); } }
.fact-now p { margin: 0; }
.fact-now .k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--sun-d); font-weight: 700; }
.fact-now .v { font: 600 15.5px/1.35 var(--display); }
.fact-now .n { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); gap: 10px; }
.tile { --c: var(--sky); --cd: var(--sky-d); display: grid; gap: 10px; justify-items: start; text-align: left; padding: 14px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform .15s var(--ease), box-shadow .15s, border-color .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 7px 0 var(--line); }
.tile:active { transform: translateY(3px); box-shadow: none; }
.tile .ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--c); box-shadow: 0 3px 0 var(--cd); }
.tile .ic svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font: 600 15px/1.2 var(--display); }
.tile.c1 { --c: var(--sun); --cd: var(--sun-d); } .tile.c1 .ic svg { stroke: var(--ink); }
.tile.c2 { --c: var(--hib); --cd: var(--hib-d); } .tile.c3 { --c: var(--leaf); --cd: var(--leaf-d); } .tile.c4 { --c: var(--pink); --cd: var(--pink-d); }

/* pillars, key message, timeline */
.quote-line { font: 700 clamp(22px, 4.6cqi, 36px)/1.15 var(--display); margin: 0; max-width: 24ch; color: var(--jade); text-wrap: balance; }
.mean { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mean article { --c: var(--sky); --cd: var(--sky-d); padding: 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--c); box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; min-width: 0; }
.mean .c-pink { --c: var(--pink); --cd: var(--pink-d); } .mean .c-leaf { --c: var(--leaf); --cd: var(--leaf-d); } .mean .c-sun { --c: var(--sun); --cd: var(--sun-d); }
.mean .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--c); box-shadow: 0 3px 0 var(--cd); }
.mean .ic svg { width: 23px; height: 23px; fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mean h3 { margin: 0; font: 700 24px/1.1 var(--display); }
.mean p { margin: 0; color: var(--muted); font-size: 14px; }
.spot { position: relative; padding: clamp(20px, 4cqi, 40px); padding-right: clamp(110px, 30cqi, 300px); border-radius: 26px; background: linear-gradient(135deg, var(--navy), var(--jade) 70%, var(--sky-d)); color: #fff; overflow: hidden; display: grid; gap: 14px; min-height: 230px; align-content: center; box-shadow: var(--shadow); }
.spot::before { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 110%; border-radius: 50%; background: radial-gradient(ellipse, rgba(16,187,236,.45), transparent 65%); pointer-events: none; }
.spot .spot-madu { position: absolute; right: -1%; bottom: -6%; width: clamp(120px, 32cqi, 300px); filter: drop-shadow(0 10px 20px rgba(0,0,0,.35)); animation: rise .9s var(--ease) .2s both, floatY 5s ease-in-out 1s infinite; }
.spot .num { position: relative; font: 700 12px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--sun); }
.spot p.big { margin: 0; font: 700 clamp(22px, 4.8cqi, 42px)/1.12 var(--display); max-width: 22ch; text-wrap: balance; position: relative; }
html[lang="zh"] .spot p.big { line-height: 1.3; }
.pager { display: flex; gap: 8px; align-items: center; position: relative; }
.pager button.dot { width: 28px; height: 7px; border-radius: 4px; border: 0; background: rgba(255,255,255,.28); padding: 0; transition: background .2s, width .3s var(--spring); }
.pager button.dot.on { background: var(--sun); width: 44px; }
.timeline { position: relative; display: grid; gap: 12px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 6px; border-radius: 3px; background: linear-gradient(180deg, var(--leaf), var(--sky) 30%, var(--sky-d) 80%, var(--sun)); opacity: .55; }
.tl { --c: var(--sky); position: relative; }
.tl .node { position: absolute; left: -29px; top: 16px; width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(14,74,107,.25); }
.tl-card { padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(14,74,107,.06); display: grid; gap: 4px; }
.tl-top { display: flex; align-items: center; gap: 10px; }
.tl-top b { font: 700 24px/1 var(--display); color: var(--c); filter: brightness(.86); }
.tl p { margin: 0; color: var(--text); font-size: 14px; }
.tl.k-city { --c: #8A7650; } .tl.k-river { --c: var(--sky); } .tl.k-krf { --c: var(--hib); } .tl.k-next { --c: var(--sun); }
.tl.k-krf .tl-card { border-left: 5px solid var(--hib); }
.tl.k-next .tl-card { background: #FFF9E8; border: 2px dashed var(--sun-d); }
.tl.k-next .node { animation: pulseDot 1.8s ease-out infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(255,197,71,.8); } 100% { box-shadow: 0 0 0 14px rgba(255,197,71,0); } }
.tl .tag { background: color-mix(in srgb, var(--c) 18%, #fff); color: var(--ink); }

/* activations */
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: 700 13px/1 var(--body); color: var(--muted); box-shadow: 0 2px 0 var(--line); transition: .2s; }
.filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 3px 0 #072C40; }
.filters .f-people.on, .filters .fc-krf.on { background: var(--pink); border-color: var(--pink-d); color: var(--ink); box-shadow: 0 3px 0 var(--pink-d); }
.filters .f-habitat.on, .filters .fc-wild.on { background: var(--leaf); border-color: var(--leaf-d); color: var(--ink); box-shadow: 0 3px 0 var(--leaf-d); }
.filters .f-culture.on, .filters .fc-madu.on { background: var(--sun); border-color: var(--sun-d); color: var(--ink); box-shadow: 0 3px 0 var(--sun-d); }
.filters .fc-river.on { background: var(--sky); border-color: var(--sky-d); box-shadow: 0 3px 0 var(--sky-d); }
.filters .fc-act.on { background: var(--hib); border-color: var(--hib-d); box-shadow: 0 3px 0 var(--hib-d); }
.acts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.act { --c: var(--pink); display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .5s var(--ease) both; animation-delay: calc(var(--j, 0) * 45ms); transition: transform .3s var(--ease); min-width: 0; }
.act:hover { transform: translateY(-3px); }
.act.p-habitat { --c: var(--leaf); } .act.p-culture { --c: var(--sun); }
.act .emoji { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: color-mix(in srgb, var(--c) 28%, #fff); border: 2px solid var(--c); }
.act-body { display: grid; gap: 6px; min-width: 0; align-content: start; }
.act .tag { background: color-mix(in srgb, var(--c) 30%, #fff); color: var(--ink); }
.act h3 { margin: 0; font: 700 19px/1.15 var(--display); }
.act p { margin: 0; color: var(--muted); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--jade); font-weight: 600; font-size: 13px; }
.meta span { display: inline-flex; gap: 5px; align-items: center; }
.meta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }

/* river */
.river-wrap { display: grid; gap: 14px; }
.river-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-radius: 24px; background: linear-gradient(180deg, #DDF6FD, #C4ECFA); border: 1px solid var(--line); box-shadow: inset 0 2px 12px rgba(14,74,107,.08); }
.river-scroll::-webkit-scrollbar { display: none; }
.river-map { display: block; width: 100%; min-width: 680px; height: auto; overflow: visible; }
.river-map .bank { fill: none; stroke: #fff; stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.river-map .water { fill: none; stroke: var(--sky); stroke-width: 22; stroke-linecap: round; stroke-linejoin: round; }
.river-map .flow { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 4 30; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -34; } }
.river-map .stop { cursor: pointer; --c: var(--sky-d); outline: none; }
.river-map .stop.c-leaf { --c: var(--leaf-d); } .river-map .stop.c-sun { --c: var(--sun-d); } .river-map .stop.c-pink { --c: var(--pink-d); } .river-map .stop.c-hib { --c: var(--hib); } .river-map .stop.c-sky { --c: #0B5CFF; }
.river-map .stop .dot { fill: var(--c); stroke: #fff; stroke-width: 4; transition: r .3s var(--spring); }
.river-map .stop .halo { fill: var(--c); opacity: 0; transform-box: fill-box; transform-origin: center; }
.river-map .stop .n { fill: #fff; font: 700 14px var(--display); text-anchor: middle; pointer-events: none; }
.river-map .stop .lab { fill: var(--ink); font: 600 14px var(--display); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 4; }
.river-map .stop.sel .dot { r: 19; }
.river-map .stop.sel .halo { animation: halo 1.5s ease-out infinite; }
.river-map .stop.sel .lab { font-weight: 700; fill: var(--c); filter: brightness(.8); }
@keyframes halo { 0% { opacity: .5; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.5); } }
.scene.enter .river-map .stop { animation: stopPop .5s var(--spring) both; animation-delay: calc(200ms + var(--k, 0) * 60ms); }
@keyframes stopPop { from { opacity: 0; } }
.river-map .boat { pointer-events: none; }
.river-map .boat .pin { fill: var(--sun); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 100%; animation: pinBob 1.6s ease-in-out infinite; }
.river-map .boat .ring { fill: none; stroke: var(--sun); stroke-width: 3; opacity: .7; }
@keyframes pinBob { 50% { transform: translateY(-5px); } }
.stop-fact { margin: 0; font-size: 15.5px; }
@container (min-width: 700px) { .river-map { min-width: 0; } }

/* friends */
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 120px), 1fr)); gap: 10px; }
.friend { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 10px 8px 12px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); box-shadow: 0 4px 0 var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.friend:hover { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 8px 0 var(--line); }
.friend:active { transform: translateY(3px); box-shadow: none; }
.art { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #fff, #DDF6FD); overflow: hidden; }
.friend.night .art, .art.night { background: radial-gradient(circle at 50% 35%, #2B4C7E, #13284A); }
.art img { width: 86%; height: 86%; object-fit: contain; }
.friend b { font: 600 14px/1.15 var(--display); }
.friend small { color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.friends.small { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.friends.small .friend small { display: none; }
.spotlight { display: grid; gap: 18px; align-items: center; padding: 18px; border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
@container (min-width: 560px) { .spotlight { grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); } }
.art.big { max-width: 240px; margin: 0 auto; border-radius: 24px; animation: floatY 5s ease-in-out infinite; }
.sp-copy { display: grid; gap: 8px; min-width: 0; }
.spotlight h3 { margin: 0; font: 700 clamp(26px, 5.6cqi, 40px)/1.05 var(--display); }
.spotlight .role { color: var(--sky-d); font-weight: 700; }
.spotlight p { margin: 0; }

/* future + pledge */
.fu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.fu { --c: var(--sky); --cd: var(--sky-d); padding: 18px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.fu.f-biz { --c: var(--sun); --cd: var(--sun-d); } .fu.f-com { --c: var(--pink); --cd: var(--pink-d); }
.fu-top { display: flex; align-items: center; gap: 10px; }
.fu .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--c); box-shadow: 0 3px 0 var(--cd); flex: none; }
.fu .ic svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fu h3 { margin: 0; font: 700 22px/1.1 var(--display); }
.fu-lead { margin: 0; font-weight: 600; color: var(--jade); font-size: 14px; }
.fu ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fu li { position: relative; padding-left: 20px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.fu li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 9px; height: 9px; border-radius: 50% 50% 50% 0; background: var(--c); transform: rotate(-45deg); }
.dream { display: grid; grid-template-columns: clamp(84px, 24cqi, 170px) 1fr; gap: 12px; align-items: center; padding: 16px 20px 16px 10px; border-radius: 26px; background: linear-gradient(120deg, #FFE9F3, #E4F7FF 60%, #FFF6DC); border: 1px solid var(--line); box-shadow: var(--shadow); }
.dream-madu { width: 100%; animation: floatY 4.5s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(14,74,107,.2)); }
.dream .big { margin: 4px 0 0; font: 700 clamp(19px, 4.2cqi, 32px)/1.2 var(--display); text-wrap: balance; }
.pledge { display: grid; gap: 16px; padding: clamp(16px, 3.4cqi, 28px); border-radius: 26px; background: var(--navy); color: #fff; box-shadow: var(--shadow); overflow: hidden; }
@container (min-width: 640px) { .pledge { grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr); align-items: stretch; } }
.pledge .eyebrow { color: var(--sun); } .pledge .lead { color: var(--sky-l); }
.pl-copy { display: grid; gap: 10px; align-content: start; min-width: 0; }
.pl-pick { margin: 6px 0 0; font-weight: 700; font-size: 13px; color: var(--sky-l); }
.picks { display: grid; gap: 7px; }
.pick { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #fff; font: 600 13.5px/1.3 var(--body); transition: background .2s, border-color .2s, transform .15s; }
.pick:active { transform: scale(.98); }
.pick .tick { width: 22px; height: 22px; border-radius: 8px; border: 2px solid rgba(255,255,255,.5); display: grid; place-items: center; flex: none; transition: .2s var(--spring); }
.pick .tick svg { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.3); transition: .25s var(--spring); }
.pick.on { background: rgba(16,187,236,.22); border-color: var(--sky); }
.pick.on .tick { background: var(--sun); border-color: var(--sun); }
.pick.on .tick svg { opacity: 1; transform: none; }
.tank { position: relative; min-height: 190px; border-radius: 22px; overflow: hidden; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.22); display: grid; place-items: center; }
.tank-water { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: linear-gradient(180deg, var(--sky), var(--sky-d)); transition: height 1.6s var(--ease); }
.tank-water i { position: absolute; left: -50%; top: -16px; width: 200%; height: 34px; border-radius: 45%; background: var(--sky); animation: slosh 5s ease-in-out infinite; }
.tank-water i + i { top: -11px; opacity: .5; animation-duration: 7s; animation-direction: reverse; background: #8FE3FB; }
@keyframes slosh { 0%, 100% { transform: translateX(-4%) rotate(-1.4deg); } 50% { transform: translateX(4%) rotate(1.4deg); } }
.tank-num { position: relative; text-align: center; text-shadow: 0 2px 10px rgba(14,74,107,.6); padding: 10px; }
.tank-num b { display: block; font: 700 clamp(44px, 10cqi, 72px)/1 var(--display); font-variant-numeric: tabular-nums; }
.tank-num b.tick { animation: bigTick .6s var(--spring); }
@keyframes bigTick { 0% { transform: scale(1.5); color: var(--sun); } }
.tank-num span { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.raindrop { position: absolute; top: -30px; width: 12px; height: 12px; border-radius: 50% 50% 50% 0; background: var(--sky); transform: rotate(-45deg) scale(var(--s, 1)); box-shadow: inset 2px 2px 0 rgba(255,255,255,.6); animation: rainFall 1.5s cubic-bezier(.5,0,.9,.6) forwards; }
@keyframes rainFall { to { top: 105%; opacity: .6; } }

/* fun facts */
.fact-card { position: relative; display: grid; grid-template-columns: clamp(96px, 30cqi, 240px) 1fr; gap: 6px; align-items: center; width: 100%; text-align: left; padding: clamp(12px, 3cqi, 24px); padding-left: 6px; border-radius: 28px; min-height: 200px; --c: var(--sky); --bg: #E6F8FF;
  background: var(--bg); border: 2.5px solid var(--c); box-shadow: 0 6px 0 var(--c), var(--shadow); transition: transform .15s; transform-style: preserve-3d; }
.fact-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c); }
.fact-card[data-cat="krf"] { --c: var(--pink-d); --bg: #FFEFF7; } .fact-card[data-cat="wild"] { --c: var(--leaf-d); --bg: #F0FAE8; } .fact-card[data-cat="madu"] { --c: var(--sun-d); --bg: #FFF7E0; } .fact-card[data-cat="act"] { --c: var(--hib); --bg: #FFEFEA; }
.fact-card.flip { animation: flipCard .36s ease-in-out; }
@keyframes flipCard { 0% { transform: perspective(900px) rotateY(0); } 50% { transform: perspective(900px) rotateY(88deg) scale(.96); } 51% { transform: perspective(900px) rotateY(-88deg) scale(.96); } 100% { transform: perspective(900px) rotateY(0); } }
.fact-madu { width: 100%; filter: drop-shadow(0 8px 10px rgba(14,74,107,.2)); animation: maduBob 3s ease-in-out infinite; }
.fact-body { display: grid; gap: 8px; min-width: 0; }
.fact-body .tag { background: var(--c); color: #fff; }
.fact-body p { margin: 0; font: 600 clamp(17px, 3.9cqi, 28px)/1.3 var(--display); text-wrap: pretty; }
.fact-body small { color: var(--muted); font-size: 11.5px; }
.fx-prog { display: grid; gap: 6px; justify-items: center; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.fx-prog .bar { width: min(100%, 360px); height: 10px; border-radius: 5px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.fx-prog .bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--sky), var(--leaf), var(--sun)); transition: width .6s var(--ease); }

/* play */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.game-card { --c: var(--sky); --cd: var(--sky-d); position: relative; display: grid; grid-template-columns: clamp(84px, 26cqi, 130px) 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 12px 16px 12px 6px; border-radius: 26px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, #fff), #fff 70%); border: 2.5px solid var(--c); box-shadow: 0 6px 0 var(--cd); transition: transform .15s var(--ease), box-shadow .15s; overflow: hidden; }
.game-card:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--cd); }
.game-card:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd); }
.game-card.g-quiz { --c: var(--sun); --cd: var(--sun-d); }
.game-card img { width: 100%; animation: maduBob 2.8s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(14,74,107,.2)); }
.gc-copy { display: grid; gap: 3px; min-width: 0; }
.gc-copy b { font: 700 clamp(20px, 4.6cqi, 26px)/1.1 var(--display); }
.gc-copy small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.gc-copy em { font: 700 11.5px/1 var(--body); font-style: normal; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; width: fit-content; margin-top: 4px; }
.game-card .go { width: 46px; height: 46px; border-radius: 50%; background: var(--c); box-shadow: 0 3px 0 var(--cd); display: grid; place-items: center; }
.game-card .go svg { width: 20px; height: 20px; fill: #fff; stroke: none; margin-left: 3px; }
.game-card.g-quiz .go svg { fill: var(--ink); }
.full-game { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: var(--navy); color: #fff; text-decoration: none; font: 600 14.5px/1.3 var(--display); box-shadow: 0 5px 0 #0A1730; transition: transform .15s; }
.full-game:active { transform: translateY(4px); box-shadow: none; }
.full-game img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.full-game span { flex: 1; }
.full-game svg { width: 18px; height: 18px; fill: none; stroke: var(--sun); stroke-width: 2; stroke-linecap: round; flex: none; }

/* river rescue */
.rs-top { display: flex; align-items: center; gap: 10px; }
.rs-top .h2 { margin: 0; font-size: clamp(22px, 4.6cqi, 30px); }
.rs-hud { display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px; align-items: end; }
.hud-score { display: grid; padding: 6px 14px; border-radius: 14px; background: var(--ink); color: #fff; min-width: 84px; text-align: center; }
.hud-score span, .hud-bar span { font: 700 9.5px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.hud-score b { font: 700 26px/1 var(--display); font-variant-numeric: tabular-nums; display: block; }
.hud-score b.tick { animation: scoreTick .3s var(--spring); }
@keyframes scoreTick { 0% { transform: scale(1.35); color: var(--sun); } }
.hud-bar { display: grid; gap: 4px; color: var(--muted); min-width: 0; }
.hud-bar .bar { height: 14px; border-radius: 7px; background: #fff; border: 1.5px solid var(--line); overflow: hidden; }
.hud-bar .bar i { display: block; height: 100%; border-radius: 6px; transition: width .25s linear; }
.bar.time i { background: linear-gradient(90deg, var(--sun), var(--sun-d)); }
.bar.time.low i { background: var(--hib); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .5; } }
.bar.clean i { background: linear-gradient(90deg, #8A9A5E, var(--leaf) 45%, var(--sky)); transition: width .6s var(--ease); }
.rs-field { position: relative; height: clamp(240px, 41vh, 440px); border-radius: 24px; overflow: hidden; border: 3px solid #fff; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); touch-action: none; user-select: none; background: #6FA7B8; }
@media (min-width: 980px) { .rs-field { height: clamp(300px, 56vh, 560px); } }
.rs-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: none; }
.rs-combo { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font: 700 22px/1 var(--display); color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 14px rgba(255,197,71,.9); pointer-events: none; opacity: 0; white-space: nowrap; }
.rs-combo.pop { animation: comboPop .9s var(--spring) forwards; }
@keyframes comboPop { 0% { opacity: 0; transform: translateX(-50%) scale(.4); } 20% { opacity: 1; transform: translateX(-50%) scale(1.2); } 70% { opacity: 1; transform: translateX(-50%) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }
.rs-over { position: absolute; inset: 0; display: grid; gap: 7px; align-content: safe center; justify-content: center; justify-items: center; text-align: center; padding: 14px; background: rgba(19,40,74,.72); backdrop-filter: blur(6px); color: #fff; opacity: 0; pointer-events: none; transition: opacity .35s; overflow-y: auto; }
.rs-over.show { opacity: 1; pointer-events: auto; }
.rs-over.show > * { animation: rise .5s var(--ease) both; }
.rs-over.show > :nth-child(2) { animation-delay: .06s; } .rs-over.show > :nth-child(3) { animation-delay: .12s; } .rs-over.show > :nth-child(4) { animation-delay: .18s; } .rs-over.show > :nth-child(5) { animation-delay: .24s; } .rs-over.show > :nth-child(6) { animation-delay: .3s; }
.rs-over .eyebrow { color: var(--sun); }
.rs-over h3 { margin: 0; font: 700 clamp(24px, 6cqi, 38px)/1.05 var(--display); }
.rs-over p { margin: 0; max-width: 34ch; font-size: 14px; }
.ov-madu { width: clamp(60px, 17cqi, 130px); filter: drop-shadow(0 8px 14px rgba(0,0,0,.4)); }
.ov-stats { display: flex; gap: 8px; }
.ov-stats div { padding: 7px 12px; border-radius: 14px; background: rgba(255,255,255,.14); min-width: 76px; }
.ov-stats b { display: block; font: 700 22px/1.1 var(--display); color: var(--sun); }
.ov-stats span { font-size: 10.5px; opacity: .85; line-height: 1.2; display: block; }
.ov-fact { font-size: 13px !important; color: var(--sky-l); }

/* quiz */
.qz { display: grid; }
.qz-card { position: relative; display: grid; gap: 10px; justify-items: center; text-align: center; padding: clamp(16px, 4cqi, 30px); border-radius: 28px; background: #fff; border: 2.5px solid var(--sun); box-shadow: 0 6px 0 var(--sun-d), var(--shadow); animation: rise .45s var(--ease) both; transition: border-color .3s, box-shadow .3s; }
.qz-card.ok { border-color: var(--leaf); box-shadow: 0 6px 0 var(--leaf-d), var(--shadow); }
.qz-card.no { border-color: var(--hib); box-shadow: 0 6px 0 var(--hib-d), var(--shadow); animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.qz-prog { display: flex; gap: 5px; }
.qz-prog i { width: 26px; height: 7px; border-radius: 4px; background: var(--line); }
.qz-prog i.done { background: var(--leaf); } .qz-prog i.on { background: var(--sun); }
.qz-madu { width: clamp(90px, 26cqi, 160px); animation: maduBob 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(14,74,107,.2)); }
.qz-q { margin: 0; font: 700 clamp(19px, 4.6cqi, 30px)/1.25 var(--display); max-width: 24ch; text-wrap: balance; }
.qz-card h3 { margin: 0; font: 700 clamp(26px, 6cqi, 40px)/1.1 var(--display); }
.qz-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.qz-yes { background: var(--leaf); border-color: var(--leaf-d); box-shadow: 0 4px 0 var(--leaf-d); min-width: 124px; }
.qz-no { background: #FFD9CF; border-color: var(--hib); box-shadow: 0 4px 0 var(--hib); min-width: 124px; }
.qz-btns .correct { outline: 4px solid var(--leaf-d); outline-offset: 2px; animation: boing .5s var(--spring); }
.qz-btns .wrong { opacity: .45; }
.qz-fb { display: none; gap: 8px; justify-items: center; }
.qz-fb.show { display: grid; animation: rise .4s var(--ease); }
.qz-fb b { font: 700 20px/1 var(--display); color: var(--leaf-d); }
.qz-card.no .qz-fb b { color: var(--hib); }
.qz-fb span { color: var(--muted); max-width: 36ch; }

/* my madu */
.md-wrap { display: grid; gap: 16px; }
@container (min-width: 700px) { .md-wrap { grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); align-items: start; } }
.md-left { display: grid; gap: 12px; justify-items: center; }
.md-stage { position: relative; width: min(78%, 280px, 32vh); aspect-ratio: 1; border-radius: 32px; overflow: hidden; border: 5px solid #fff; box-shadow: 0 8px 0 var(--line), var(--shadow); background: var(--sky-l); }
@media (min-width: 980px) { .md-stage { width: min(100%, 380px); } }
@container (max-width: 520px) { .stage[data-scene="madu"] .head .lead, .stage[data-scene="madu"] .head .eyebrow { display: none; } }
.md-layer, .md-hero { position: absolute; inset: 0; width: 100%; height: 100%; }
.md-layer svg { width: 100%; height: 100%; display: block; }
.md-hero { object-fit: contain; }
.md-stage.boing .md-hero, .md-stage.boing .md-layer:last-of-type { animation: boing .55s var(--spring); transform-origin: 50% 90%; }
.md-name { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); max-width: 86%; padding: 5px 14px; border-radius: 999px; background: rgba(255,255,255,.94); font: 700 14px/1.2 var(--display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 rgba(14,74,107,.15); }
.md-right { display: grid; gap: 12px; min-width: 0; }
.md-profile { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; padding: 12px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.pf-pic { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--sky-l); box-shadow: 0 0 0 3px var(--sky); }
.pf-pic img { width: 100%; height: 100%; object-fit: cover; }
.pf-copy { display: grid; gap: 2px; min-width: 0; }
.pf-copy b { font: 700 17px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-copy small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.pf-copy .why { color: var(--dim); }
.pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--navy); color: #fff; font: 700 11.5px/1.2 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); flex: none; }
.pf-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.md-field { display: grid; gap: 4px; font: 700 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.md-field input { height: 44px; border-radius: 14px; border: 2px solid var(--line); background: #fff; padding: 0 14px; font: 600 16px var(--body); color: var(--ink); outline: none; text-transform: none; letter-spacing: 0; }
.md-field input:focus { border-color: var(--sky); }
.md-slots { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.md-slots::-webkit-scrollbar { display: none; }
.md-slots button { position: relative; flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: 700 13px/1 var(--body); color: var(--muted); box-shadow: 0 2px 0 var(--line); }
.md-slots button.on { background: var(--sky); border-color: var(--sky-d); color: #fff; box-shadow: 0 3px 0 var(--sky-d); }
.md-slots button.has::after { content: ""; position: absolute; right: 2px; top: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--hib); box-shadow: 0 0 0 2px #fff; }
.md-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.md-item { display: grid; gap: 4px; justify-items: center; padding: 6px 4px 8px; border-radius: 16px; border: 2px solid var(--line); background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .15s var(--ease), border-color .2s, box-shadow .15s; }
.md-items.in .md-item { animation: itemIn .35s var(--spring) both; animation-delay: calc(var(--j, 0) * 35ms); }
@keyframes itemIn { from { opacity: 0; transform: scale(.7); } }
.md-item:active { transform: translateY(3px); box-shadow: none; }
.md-item.on { border-color: var(--sun-d); background: #FFF6DC; box-shadow: 0 3px 0 var(--sun-d); }
.md-item .thumb { width: 100%; aspect-ratio: 1; border-radius: 11px; overflow: hidden; display: block; background: var(--mist); }
.md-item .thumb svg { width: 100%; height: 100%; display: block; }
.md-item small { font: 600 10.5px/1.15 var(--body); color: var(--muted); text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.3em; }

/* partners */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.sp-card { position: relative; display: grid; gap: 7px; align-content: start; padding: 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit; overflow: hidden; transition: transform .35s var(--ease), border-color .3s; min-width: 0; }
a.sp-card:hover { transform: translateY(-4px); border-color: var(--sky); }
.sp-card.featured { border: 2px solid var(--sun); background: linear-gradient(140deg, #FFF6DC, #fff 55%); }
.sp-card.featured::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.7) 50%, transparent 70%); transform: translateX(-120%); animation: sheen 5.5s ease-in-out infinite; pointer-events: none; }
.sp-logo { height: 84px; border-radius: 14px; display: grid; place-items: center; background: var(--mist); overflow: hidden; padding: 10px; text-align: center; }
.sp-logo img { width: 100%; height: 100%; object-fit: contain; }
.sp-logo b { font: 700 20px/1.1 var(--display); color: var(--jade); }
.sp-tier { font: 700 10px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--sky-d); }
.sp-name { font: 700 15.5px/1.25 var(--display); }
.sp-blurb { color: var(--muted); font-size: 13px; }
.sp-visit { font-size: 12px; color: var(--sky-d); font-weight: 700; }

/* ---------- sound panel ---------- */
.sound-wrap { position: relative; }
.sound-btn .muted { display: none; }
.sound-btn.off .eq { display: none; }
.sound-btn.off .muted { display: block; color: var(--dim); }
.sound-btn[aria-expanded="true"] { border-color: var(--sky); background: #fff; }
.sound-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: min(300px, calc(100vw - 24px)); padding: 14px; border-radius: 20px; background: rgba(255,255,255,.98); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(14,74,107,.25); backdrop-filter: blur(12px); display: grid; gap: 12px; transform-origin: top right; }
.sound-pop.in { animation: popIn .28s var(--spring); }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(-6px); } }
.sp-title { margin: 0; font: 700 10.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--sky-d); }
.sp-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.sp-row input { grid-column: 2; }
.sp-tog { grid-row: span 2; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--mist); display: grid; place-items: center; color: var(--dim); transition: .2s; }
.sp-tog[aria-pressed="true"] { background: var(--sky); border-color: var(--sky-d); color: #fff; box-shadow: 0 2px 0 var(--sky-d); }
.sp-tog svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp-l { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; min-width: 0; }
.sp-l b { font-size: 13px; }
.sp-l small { color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-pop input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sky) var(--v, 50%), var(--line) var(--v, 50%)); outline: none; }
.sound-pop input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--sky); box-shadow: 0 2px 6px rgba(14,74,107,.3); cursor: pointer; }
.sound-pop input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--sky); cursor: pointer; }
.sp-foot { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- moods ---------- */
.emo { display: inline-block; flex: none; width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
.emo-txt { width: auto; height: auto; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 17px; line-height: 1; }
.ag-mood .emo-txt { font-size: 13px; }
@keyframes emopop { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.25) rotate(6deg); opacity: 1; } 100% { transform: none; } }
@keyframes emobob { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-2px) rotate(-6deg); } 75% { transform: translateY(-1px) rotate(6deg); } }
.emo-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.float-emo { position: absolute; bottom: 8%; width: 46px; height: 46px; opacity: 0; animation: floatup var(--d, 2.6s) cubic-bezier(.2,.7,.3,1) forwards; filter: drop-shadow(0 6px 10px rgba(14,74,107,.3)); }
.float-emo.emo-txt { font-size: 38px; width: auto; height: auto; }
@keyframes floatup { 0% { opacity: 0; transform: translateY(16px) scale(.5); } 14% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translate(var(--dx, 0px), -240px) scale(.9) rotate(var(--rot, 0deg)); } }
.glint { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--sky); opacity: 0; animation: glintUp var(--d, 2s) var(--ease) forwards; }
.glint.c0 { background: var(--sun); box-shadow: none; border-radius: 2px; } .glint.c1 { background: var(--hib); box-shadow: none; border-radius: 2px; } .glint.c2 { background: var(--leaf); box-shadow: none; } .glint.c3 { background: var(--pink); box-shadow: none; border-radius: 2px; }
@keyframes glintUp { 0% { opacity: 0; transform: translateY(0) scale(.4) rotate(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-130px) scale(1) rotate(200deg); } }

/* ---------- toast & guided tour ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 12px); transform: translate(-50%, -14px) scale(.9); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 999px; z-index: 95; transition: .3s var(--spring); max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 10px 30px rgba(14,74,107,.35); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.help-btn svg { width: 19px; height: 19px; }
.gt { position: fixed; inset: 0; z-index: 90; }
.gt.out { animation: gtOut .3s ease forwards; }
@keyframes gtOut { to { opacity: 0; } }
.gt-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(19,40,74,.72); border: 3px solid var(--sun);
  transition: left .45s var(--ease), top .45s var(--ease), width .45s var(--ease), height .45s var(--ease), border-radius .45s; pointer-events: none; animation: gtIn .4s ease; }
.gt-hole::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid var(--sun); animation: gtRing 1.8s ease-out infinite; }
@keyframes gtRing { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.08); } }
@keyframes gtIn { from { opacity: 0; } }
.gt-card { position: fixed; z-index: 2; padding: 16px 16px 14px; border-radius: 20px; background: #fff; border: 2px solid var(--sun); box-shadow: 0 24px 60px rgba(14,74,107,.4); display: grid; gap: 8px; transition: left .45s var(--ease), top .45s var(--ease); }
.gt-card.in { animation: gtCard .45s var(--spring); }
@keyframes gtCard { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.gt-card h3 { margin: 0; font: 700 22px/1.1 var(--display); }
.gt-card p { margin: 0; color: var(--muted); font-size: 14px; }
.gt-top { display: flex; justify-content: space-between; align-items: center; }
.gt-step { font: 700 10.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--sky-d); }
.gt-skip { border: 0; background: none; color: var(--dim); font: 600 12px/1 var(--body); padding: 4px; }
.gt-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.gt-dots { display: flex; gap: 4px; flex: 1; }
.gt-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s, width .2s; }
.gt-dots i.done { background: var(--sky-l); }
.gt-dots i.on { width: 16px; border-radius: 3px; background: var(--sky); }
.gt-arrow { position: absolute; width: 14px; height: 14px; margin-left: -7px; background: #fff; transform: rotate(45deg); }
.gt-arrow.top { top: -9px; border-left: 2px solid var(--sun); border-top: 2px solid var(--sun); }
.gt-arrow.bottom { bottom: -9px; border-right: 2px solid var(--sun); border-bottom: 2px solid var(--sun); }
.gt-arrow.none { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .w-river .line { stroke-dashoffset: 0; }
}
