:root {
  --cream: #f6efe0;
  --paper: #fffaf0;
  --ink: #3b3a45;
  --ink-soft: #6e6c7a;
  --moss: #7fae7a;
  --moss-deep: #4f8a5a;
  --sky: #cfe6f2;
  --rose: #f2a7b3;
  --sun: #f5c86b;
  --berry: #b56d8f;
  --river: #8dc3dd;
  --shadow: 0 6px 0 rgba(59, 58, 69, .10);
  --radius: 26px;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "Rounded Mplus 1c", "M PLUS Rounded 1c", "BIZ UDPGothic", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  font-feature-settings: "palt";
}
button { font-family: inherit; color: inherit; }

#sky {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(#dcecf5 0%, #f1f0e4 55%, #e5eed9 100%);
  transition: background 2s;
}
#sky.evening { background: linear-gradient(#f4c9b0 0%, #f6e5d3 50%, #dfe8cf 100%); }
#sky.night { background: linear-gradient(#5b6b96 0%, #8a93b5 55%, #b9c4c8 100%); }
#sky.rain { background: linear-gradient(#b8c8d2 0%, #d5dcdb 55%, #d6e0cd 100%); }

#app { position: relative; z-index: 1; height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes wobble { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes twinkle { 0%,100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes drift { from { transform: translateX(-10%); } to { transform: translateX(110vw); } }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-80px); opacity: 0; } }
@keyframes sparkle-burst { from { transform: translate(0,0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

.topbar {
  display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 8px;
}
.topbar .spacer { flex: 1; }
.pill {
  background: var(--paper); border-radius: 999px; padding: 8px 14px; box-shadow: var(--shadow);
  font-weight: 700; display: inline-flex; align-items: center; gap: 6px; font-size: 17px;
}
.btn {
  border: 0; background: var(--paper); border-radius: 999px; padding: 12px 22px; box-shadow: var(--shadow);
  font-size: 19px; font-weight: 700; cursor: pointer; transition: transform .08s, box-shadow .08s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(59,58,69,.1); }
.btn.primary { background: var(--moss); color: #fff; }
.btn.rose { background: var(--rose); color: #fff; }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-soft); }
.btn.big { font-size: 26px; padding: 18px 34px; border-radius: 34px; }
.btn.icon { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 22px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- title ---------- */
.title { justify-content: center; align-items: center; text-align: center; padding: 20px; gap: 18px; }
.title h1 { font-size: clamp(38px, 8vw, 70px); margin: 0; letter-spacing: .04em; color: var(--ink); }
.title h1 small { display: block; font-size: .38em; color: var(--ink-soft); letter-spacing: .3em; font-weight: 500; margin-top: 6px; }
.title .hero { width: min(70vw, 340px); animation: bob 3s ease-in-out infinite; }
.title .sub { color: var(--ink-soft); font-size: 18px; margin: 0; }

/* ---------- valley map ---------- */
.valley { position: relative; }
.map-wrap { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.map { width: 100%; height: 100%; display: block; }
.house { cursor: pointer; transition: transform .15s; transform-box: fill-box; transform-origin: center bottom; }
.house:hover, .house:active { transform: scale(1.06); }
.house.locked { opacity: .55; filter: saturate(.4); }
.house text { font-family: var(--font); font-weight: 700; pointer-events: none; }
.cloud { animation: drift linear infinite; }
.star { animation: twinkle 2.4s ease-in-out infinite; }
.fuwari-map { animation: bob 2.6s ease-in-out infinite; }
.bottombar {
  display: flex; gap: 10px; padding: 8px 16px max(12px, env(safe-area-inset-bottom)); justify-content: center; flex-wrap: wrap;
}

/* ---------- play ---------- */
.play { padding: 0 16px; }
.progress { height: 14px; background: rgba(255,255,255,.7); border-radius: 999px; overflow: hidden; flex: 1; box-shadow: inset 0 2px 0 rgba(0,0,0,.05); }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--moss), var(--sun)); border-radius: 999px; transition: width .4s; }
.stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; justify-content: safe center; gap: 14px; min-height: 0;
}
.card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; width: min(100%, 760px);
  animation: pop .35s cubic-bezier(.2,.9,.3,1.2) both;
}
.card.speech { position: relative; }
.card.speech:after {
  content: ""; position: absolute; left: 44px; bottom: -14px; border: 14px solid transparent; border-top-color: var(--paper); border-bottom: 0;
}
.qrow { display: flex; align-items: center; gap: 16px; }
.qrow .friend { width: 96px; height: 96px; flex: none; animation: wobble 3s ease-in-out infinite; }
.qtext { font-size: clamp(22px, 3.6vw, 34px); font-weight: 700; line-height: 1.35; flex: 1; }
.qtext .en { display: block; font-size: .5em; color: var(--ink-soft); font-weight: 500; margin-top: 4px; letter-spacing: .04em; }
.qtext .expr { font-size: 1.4em; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.visual { width: min(100%, 760px); display: flex; justify-content: center; align-items: center; min-height: 40px; }
.visual svg { max-width: 100%; height: auto; }

/* dots / blocks */
.dots { display: grid; gap: 6px; justify-content: center; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: var(--berry); animation: pop .3s both; }
.dot.b { background: var(--river); }
.dot.x { background: #ddd; position: relative; }
.dot.x:after { content: ""; position: absolute; inset: 40%; background: var(--ink-soft); border-radius: 2px; transform: rotate(45deg); width: 120%; height: 3px; left: -10%; top: 45%; }
.blocks { display: flex; gap: 18px; align-items: flex-end; justify-content: center; flex-wrap: wrap; }
.blocks .group { display: flex; gap: 4px; align-items: flex-end; }
.rod { width: 14px; height: 110px; background: var(--moss); border-radius: 4px; background-image: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(255,255,255,.5) 9px 11px); }
.unit { width: 14px; height: 14px; background: var(--sun); border-radius: 3px; }
.units { display: grid; grid-template-columns: repeat(5, 14px); gap: 3px; }
.hundred { width: 60px; height: 60px; background: var(--berry); border-radius: 6px; background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px); background-size: 6px 6px; }
.plus, .minus, .eq { font-size: 34px; font-weight: 700; color: var(--ink-soft); align-self: center; }

/* answers */
.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: min(100%, 640px); }
.answers.four { grid-template-columns: repeat(2, 1fr); }
.choice {
  border: 0; background: var(--paper); border-radius: 22px; padding: 18px 10px; font-size: 28px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .08s, background .2s; min-height: 72px;
}
.choice:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(59,58,69,.1); }
.choice.ok { background: var(--moss); color: #fff; }
.choice.ng { background: #eee; color: #aaa; animation: shake .35s; }
.numpad-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 420px); }
.answerbox {
  min-width: 160px; height: 64px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); font-size: 38px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; letter-spacing: .08em; font-variant-numeric: tabular-nums; padding: 0 20px;
}
.answerbox.empty { color: #ccc; }
.answerbox.ok { background: var(--moss); color: #fff; }
.answerbox.ng { animation: shake .35s; background: #f3e3e6; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.numpad button {
  border: 0; background: var(--paper); border-radius: 18px; font-size: 28px; font-weight: 700; height: 58px; box-shadow: var(--shadow); cursor: pointer;
}
.numpad button:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(59,58,69,.1); }
.numpad button.go { background: var(--moss); color: #fff; }
.numpad button.del { background: #f0e6d8; font-size: 22px; }

.hint { color: var(--ink-soft); font-size: 20px; text-align: center; min-height: 28px; }
.hint.warm { color: var(--moss-deep); font-weight: 700; }
.reveal { font-size: 26px; font-weight: 700; color: var(--berry); text-align: center; }
.sparkle { position: fixed; width: 14px; height: 14px; border-radius: 50%; pointer-events: none; animation: sparkle-burst .8s ease-out forwards; z-index: 50; }

/* ---------- result ---------- */
.result { align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 20px; }
.result h2 { font-size: 38px; margin: 0; }
.result .stars { font-size: 44px; letter-spacing: .1em; }
.result .stars span { display: inline-block; animation: pop .5s both; }
.result .friend { width: 160px; animation: bob 2s ease-in-out infinite; }
.newitem { background: var(--paper); border-radius: 22px; padding: 14px 22px; box-shadow: var(--shadow); font-size: 22px; font-weight: 700; animation: pop .5s .4s both; }

/* ---------- house / stickers ---------- */
.house-scene { padding: 0 16px; gap: 12px; }
.room { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.room svg { max-height: 100%; max-width: 100%; }
.shelf { display: flex; gap: 10px; overflow-x: auto; padding: 8px 4px 16px; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.sticker {
  flex: none; width: 96px; height: 110px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.sticker .em { font-size: 40px; }
.sticker.locked { opacity: .35; filter: grayscale(1); }
.sticker.locked .em { filter: blur(3px); }

/* ---------- kuku table ---------- */
.kuku { padding: 0 16px; overflow: auto; }
.kuku-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: min(100%, 720px, calc(100dvh - 350px)); margin: 0 auto; flex: none; }
.kuku-grid div {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 700; font-size: clamp(12px, 2.4vw, 20px);
  background: rgba(255,255,255,.55); font-variant-numeric: tabular-nums;
}
.kuku-grid .h { background: var(--sun); }
.kuku-grid .m0 { background: rgba(255,255,255,.55); }
.kuku-grid .m1 { background: #dfeedb; }
.kuku-grid .m2 { background: #b8dcb0; }
.kuku-grid .m3 { background: var(--moss); color: #fff; }
.kuku-grid .m4 { background: var(--moss-deep); color: #fff; box-shadow: inset 0 0 0 2px var(--sun); }
.kuku-grid .cell { cursor: pointer; }
.dan-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 12px 0; }
.dan-row button { border: 0; border-radius: 999px; padding: 8px 16px; font-size: 18px; font-weight: 700; background: var(--paper); box-shadow: var(--shadow); }
.dan-row button.on { background: var(--berry); color: #fff; }
.chant { text-align: center; font-size: clamp(24px, 4vw, 40px); font-weight: 700; min-height: 60px; }
.chant small { display: block; color: var(--ink-soft); font-size: .55em; }

/* ---------- parent ---------- */
.parent { padding: 0 16px; overflow: auto; color: var(--ink); }
.parent .inner { max-width: 760px; margin: 0 auto; padding-bottom: 40px; display: flex; flex-direction: column; gap: 12px; }
.parent h2 { margin: 6px 0; font-size: 26px; }
.parent p { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.stat { background: var(--paper); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow); }
.stat .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stat .bar { height: 10px; background: #eee; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.stat .bar > div { height: 100%; background: var(--moss); }
.weak { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.weak span { background: #fbe5e9; color: var(--berry); border-radius: 99px; padding: 4px 10px; font-weight: 700; font-size: 15px; }
.settings label { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 18px; }
.toggle { width: 54px; height: 32px; border-radius: 99px; background: #ddd; position: relative; border: 0; }
.toggle:after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: var(--moss); }
.toggle.on:after { left: 25px; }

#toast {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%) translateY(-100px); z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 700; transition: transform .3s; pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* clock */
.clockset { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }

@media (max-width: 520px) {
  .qrow .friend { width: 64px; height: 64px; }
  .card { padding: 14px 16px; }
  .choice { font-size: 24px; min-height: 60px; }
}
@media (min-width: 900px) {
  .answers { grid-template-columns: repeat(4, 1fr); }
}

/* overflow safety on narrow screens */
.screen { width: 100%; max-width: 100vw; }
.qtext { min-width: 0; overflow-wrap: anywhere; }
.qrow .friend svg { width: 100%; height: 100%; }
.card, .visual, .answers, .numpad-wrap, .stage { max-width: 100%; }
.stage { width: 100%; overflow: auto; }

/* ---------- valley ambient ---------- */
@keyframes raindrop { from { transform: translate(0, 0); opacity: 0; } 10% { opacity: .6; } to { transform: translate(-20px, 720px); opacity: 0; } }
@keyframes firefly { 0%,100% { opacity: 0; transform: translate(0,0); } 30% { opacity: 1; } 60% { opacity: .3; transform: translate(6px, -10px); } 80% { opacity: 1; transform: translate(-4px, -16px); } }
@keyframes shoot { 0% { transform: translate(1200px, 40px); opacity: 0; } 4% { opacity: 1; } 16% { transform: translate(700px, 260px); opacity: 0; } 100% { transform: translate(700px, 260px); opacity: 0; } }
@keyframes beam { 0%,100% { opacity: .15; } 50% { opacity: .55; } }
@keyframes smokeup { from { transform: translate(0,0) scale(.6); opacity: .7; } to { transform: translate(6px, -40px) scale(1.8); opacity: 0; } }
@keyframes ripple { 0%,100% { opacity: .2; transform: translateX(0); } 50% { opacity: .6; transform: translateX(6px); } }
@keyframes flap { 0%,100% { transform: translate(0,0); } 50% { transform: translate(4px, -3px); } }
@keyframes winglow { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.rain { animation: raindrop 1.2s linear infinite; }
.firefly { animation: firefly 4s ease-in-out infinite; }
.shooting { animation: shoot 14s ease-in infinite; }
.beam { animation: beam 3s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }
.smoke { animation: smokeup 3.4s ease-out infinite; }
.ripple { animation: ripple 3s ease-in-out infinite; }
.bird { animation: flap 1.6s ease-in-out infinite; }
.house { transform-box: fill-box; transform-origin: 50% 80%; transition: transform .18s cubic-bezier(.2,.9,.3,1.3); }
.house:hover { transform: scale(1.07); }
.house:active { transform: scale(.97); }
.house.locked:hover { transform: none; }
.house.locked .win { display: none; }
#fw { will-change: transform; }

/* combo, confetti, moods */
.combo { position: absolute; right: 16px; top: 64px; background: var(--sun); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 18px; box-shadow: var(--shadow); animation: pop .3s both; }
.combo.hot { background: linear-gradient(90deg, #f5c86b, #f2a7b3); }
.confetti { position: fixed; top: -12px; width: 10px; height: 16px; border-radius: 2px; pointer-events: none; z-index: 55; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }
.bigword { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: clamp(40px, 8vw, 80px); font-weight: 700; color: var(--berry); text-shadow: 0 4px 0 #fff, 0 8px 0 rgba(0,0,0,.08); pointer-events: none; z-index: 56; animation: bigword 1.3s ease-out forwards; }
@keyframes bigword { 0% { transform: translate(-50%, -30%) scale(.5); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }
.play { position: relative; }
.play .theme { position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none; background: radial-gradient(circle at 15% 80%, var(--theme, #fff) 0, transparent 40%), radial-gradient(circle at 85% 20%, var(--theme, #fff) 0, transparent 35%); }

/* quests, badges, letter */
.panel { position: fixed; inset: 0; z-index: 40; background: rgba(59,58,69,.35); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .25s both; }
.panel .box { background: var(--paper); border-radius: 30px; box-shadow: 0 20px 60px rgba(0,0,0,.2); padding: 22px 24px; width: min(100%, 560px); max-height: 90dvh; overflow: auto; animation: pop .35s both; }
.panel h3 { margin: 0 0 12px; font-size: 26px; display: flex; align-items: center; gap: 10px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0e8da; font-size: 20px; font-weight: 700; }
.quest .tick { width: 34px; height: 34px; border-radius: 50%; background: #eee; display: flex; align-items: center; justify-content: center; flex: none; }
.quest.done .tick { background: var(--moss); color: #fff; }
.quest.done span.t { color: var(--ink-soft); text-decoration: line-through; }
.quest small { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.badge { background: #fff; border-radius: 18px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; }
.badge .em { font-size: 34px; display: block; }
.badge.locked { opacity: .35; filter: grayscale(1); }
.letter { background: #fffdf5; border: 2px dashed #e5d9c6; border-radius: 18px; padding: 16px; font-size: 18px; line-height: 1.7; }
.hearts { color: #e78ca0; letter-spacing: .05em; font-size: 20px; }

/* costume shelf */
.shelf .sticker.costume { background: #fff3f6; }
.shelf .sticker.on { outline: 3px solid var(--rose); }

/* breathing break */
.breath { align-items: center; justify-content: center; gap: 20px; text-align: center; }
.breath .circle { width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #fff 0, var(--sky) 70%); box-shadow: 0 0 60px rgba(141,195,221,.6); display: flex; align-items: center; justify-content: center; animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(.75); } 50% { transform: scale(1.15); } }
.breath .word { font-size: 34px; font-weight: 700; min-height: 44px; }

.topbar { position: relative; z-index: 2; }
.toplink { font-size: 15px; padding: 8px 12px; }

.lglow { animation: winglow 2.4s ease-in-out infinite; }
.story { justify-content: flex-end; padding: 0 16px max(16px, env(safe-area-inset-bottom)); gap: 0; position: relative; }
.story .scene { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 24px; min-height: 0; padding-bottom: 12px; }
.story .actor { width: min(34vw, 260px); transition: transform .3s, opacity .3s, filter .3s; }
.story .actor.dim { opacity: .45; transform: scale(.9); filter: grayscale(.4); }
.story .actor.talk { animation: bob 1.2s ease-in-out infinite; }
.story .box { background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); padding: 18px 24px; width: min(100%, 820px); margin: 0 auto; min-height: 150px; cursor: pointer; position: relative; }
.story .box .name { display: inline-block; background: var(--berry); color: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.story .box .line { font-size: clamp(20px, 3vw, 28px); font-weight: 700; line-height: 1.5; }
.story .box .en { color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.story .box .tap { position: absolute; right: 22px; bottom: 12px; color: var(--ink-soft); font-size: 14px; animation: bob 1.4s ease-in-out infinite; }
.story .chapter { text-align: center; font-size: 15px; letter-spacing: .3em; color: var(--ink-soft); padding: 8px 0 4px; }
.story .skip { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 16px; }

/* ---------- painted valley ---------- */
.map-wrap { background: #1d3b2a; }
.mapstage { position: absolute; left: 50%; top: 50%; width: 1440px; height: 1000px; transform-origin: center; }
.mapbg { position: absolute; inset: 0; width: 100%; height: 100%; }
.maptint { position: absolute; inset: 0; pointer-events: none; transition: background 2s; }
.mapstage.dusk .maptint { background: linear-gradient(rgba(255,150,80,.18), rgba(120,60,90,.25)); }
.mapstage.night .maptint { background: linear-gradient(rgba(20,30,80,.42), rgba(10,20,60,.48)); }
.mapstage .firefly { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff4a8; box-shadow: 0 0 10px 3px rgba(255,244,168,.7); animation: firefly 4s ease-in-out infinite; }
.hspot { position: absolute; width: 0; height: 0; cursor: pointer; }
.hspot .himg { position: absolute; left: -110px; bottom: -6px; width: 220px; height: 220px; object-fit: contain; filter: drop-shadow(0 14px 10px rgba(0,0,0,.35)); transition: transform .18s cubic-bezier(.2,.9,.3,1.3); transform-origin: 50% 90%; }
.hspot:hover .himg { transform: scale(1.06); }
.hspot:active .himg { transform: scale(.97); }
.hspot.locked .himg { filter: grayscale(.85) brightness(.75) drop-shadow(0 14px 10px rgba(0,0,0,.35)); }
.hspot .hlock { position: absolute; left: -26px; top: -170px; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.hspot .hglow { position: absolute; left: -130px; top: -190px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,220,120,.55) 0, rgba(255,220,120,0) 60%); opacity: 0; pointer-events: none; }
.hspot.lit .hglow { opacity: 1; animation: winglow 2.6s ease-in-out infinite; }
.hspot .hlabel { position: absolute; left: -80px; top: 10px; width: 160px; text-align: center; background: rgba(255,250,240,.94); border-radius: 16px; padding: 6px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.25); line-height: 1.2; }
.hspot .hlabel b { font-size: 19px; display: block; }
.hspot .hlabel small { font-size: 12px; color: var(--ink-soft); }
.hspot.locked .hlabel small { color: var(--berry); }
.fwspot { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; }
.fwspot img { position: absolute; left: -60px; bottom: -4px; width: 120px; height: 120px; filter: drop-shadow(0 10px 8px rgba(0,0,0,.35)); animation: bob 2.6s ease-in-out infinite; }
.fwspot .fwshadow { position: absolute; left: -34px; top: -6px; width: 68px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.3); filter: blur(3px); }
.fwspot.hop img { animation: hop .32s ease-out; }
@keyframes hop { 0% { transform: translateY(0) scaleY(1); } 40% { transform: translateY(-40px) scaleY(1.06); } 100% { transform: translateY(0) scaleY(1); } }
.bubble { position: absolute; left: 16px; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 10px; background: rgba(255,250,240,.95); border-radius: 22px; padding: 8px 16px 8px 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: min(90%, 460px); font-size: 17px; cursor: pointer; animation: pop .4s .3s both; }
.bubble .sprite { border-radius: 50%; }
.bubble .en { display: block; font-size: 13px; color: var(--ink-soft); }
.sprite { object-fit: contain; }
.title .hero img { filter: drop-shadow(0 16px 14px rgba(0,0,0,.18)); }
.rankrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0e8da; font-size: 19px; }
.rankrow.me { background: #fff5d6; border-radius: 14px; padding: 8px 10px; }
.rankrow .pos { width: 34px; font-size: 22px; text-align: center; }
.rankrow .spacer { flex: 1; }
.gacha { text-align: center; }
.machine { font-size: 110px; line-height: 1.1; display: inline-block; }
.machine.spin { animation: wobble .15s linear 6; }
.cardface { text-align: center; background: linear-gradient(#fff9e8, #ffe9f0); border: 4px solid #f5c86b; border-radius: 24px; padding: 18px; animation: pop .5s both; }
.cardface h3 { justify-content: center; }
.cardface p { font-size: 18px; margin: 4px 0; }
.rewardrow { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-weight: 700; color: var(--ink-soft); }
.coin { color: #b7842d; }
.room-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
.room { position: relative; }
.room svg { position: relative; }

.mapblur { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(18px) brightness(.55); }
.mapstage.night ~ .mapblur { filter: blur(18px) brightness(.3); }
.hspot .himg { width: 200px; height: 200px; left: -100px; }
.hspot .hlabel { top: 14px; }
.fwspot { transition: z-index 0s; }

/* dark glass chrome over the painted map */
.valley { background: #0e1a14; }
.valley .topbar, .valley .bottombar { background: rgba(10, 18, 14, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); margin: 0; }
.valley .topbar { padding-bottom: 10px; }
.valley .topbar .pill, .valley .topbar .btn, .valley .bottombar .btn { background: rgba(255,255,255,.08); color: #f3efe6; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.valley .topbar .btn.icon { background: rgba(255,255,255,.1); }
.valley .bottombar .btn { font-size: 18px; }
.valley .bottombar .btn:active, .valley .topbar .btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.valley .map-wrap { background: #0e1a14; }
.mapblur { filter: blur(22px) brightness(.35); }
.bubble { background: rgba(10,18,14,.85); color: #f3efe6; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 8px 24px rgba(0,0,0,.4); }
.bubble .en { color: #b9b5aa; }

/* ---------- dark painted backdrop everywhere ---------- */
#sky { background: #0e1a14 url(../img/sky_blur.webp) center / cover no-repeat; filter: blur(20px) brightness(.32); transform: scale(1.08); }
#sky.evening, #sky.night, #sky.rain { background: #0e1a14 url(../img/sky_blur.webp) center / cover no-repeat; }
#app { color: #f3efe6; }
.card, .panel .box, .stat, .sticker, .choice, .numpad button, .answerbox, .badge, .pill, .btn:not(.primary):not(.rose):not(.ghost), .story .box, .hlabel, .newitem, .cardface, .letter, .settings, .parent .inner p { color: var(--ink); }
.btn.ghost { color: #d9d4c8; }
.title h1, .result h2, .breath .word, .story .chapter, .kuku .chant, .parent h2 { color: #f7f3ea; }
.title h1 small, .title .sub { color: #cfc9bc; }
.hint { color: #d9d4c8; }
.hint.warm { color: #b7dcae; }
.reveal { color: #f2a7b3; }
.answerbox.empty { color: #bbb; }
.kuku-grid .m0 { background: rgba(255,255,255,.85); color: var(--ink); }
.kuku-grid .m1 { color: var(--ink); } .kuku-grid .m2 { color: var(--ink); }
.dan-row button { color: var(--ink); }
.kuku .chant small, .story .box .en, .parent p, .quest small { color: var(--ink-soft); }
.parent p { color: #cfc9bc; }
.parent .stat .row { color: var(--ink); }
.house-scene p { color: #cfc9bc !important; }
.valley .topbar .pill, .valley .topbar .btn, .valley .bottombar .btn { color: #f3efe6; }
.progress { background: rgba(255,255,255,.2); }
.play .theme { opacity: .25; }
.answers .choice[disabled] { opacity: .6; }
.hearts { color: #f2a7b3; }
.combo { color: var(--ink); }
.story .actor img { filter: drop-shadow(0 16px 14px rgba(0,0,0,.45)); }
.result .friend img, .title .hero img { filter: drop-shadow(0 16px 14px rgba(0,0,0,.45)); }
.toplink { color: #f3efe6; }

/* ---------- RPG-style dialogue box ---------- */
.story .box { background: linear-gradient(rgba(14,24,18,.88), rgba(8,14,10,.92)); color: #f7f3ea !important; border: 2px solid rgba(245,200,107,.55); box-shadow: 0 0 0 4px rgba(10,18,14,.6), 0 20px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); border-radius: 22px; padding: 22px 28px 26px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.story .box:before { content: ""; position: absolute; inset: 6px; border-radius: 16px; border: 1px solid rgba(245,200,107,.18); pointer-events: none; }
.story .box .name { position: absolute; top: -22px; left: 22px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 16px 4px 4px; border-radius: 999px; font-size: 16px; background: linear-gradient(135deg, #f5c86b, #e0a93c) !important; color: #3b2a10; box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.story .box .name img { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: contain; }
.story .box .line { margin-top: 8px; color: #f7f3ea; letter-spacing: .02em; text-shadow: 0 2px 6px rgba(0,0,0,.4); min-height: 1.5em; }
.story .box .en { color: #c9c2b2; }
.story .box .tap { color: #f5c86b; }
.story .chapter { color: #f5c86b; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.story .skip { background: rgba(10,18,14,.7); color: #f3efe6; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.story .actor.talk { filter: drop-shadow(0 0 30px rgba(245,200,107,.35)); }
.cursor { display: inline-block; width: .5em; animation: twinkle .8s infinite; color: #f5c86b; }
.valley .topbar .pill, .valley .topbar .btn.toplink, .valley .topbar .btn.icon, .valley .bottombar .btn.btn { color: #f3efe6 !important; }

.mapstage { left: 0; top: 0; width: 2880px; height: 1278px; transform-origin: 0 0; }
.map-wrap { cursor: grab; touch-action: none; }
.mapblur { display: none; }
.hspot .himg { width: 330px; height: 330px; left: -165px; bottom: -8px; filter: drop-shadow(0 22px 16px rgba(0,0,0,.4)); }
.hspot .hlabel { left: -120px; top: 22px; width: 240px; padding: 10px 12px; border-radius: 22px; }
.hspot .hlabel b { font-size: 28px; }
.hspot .hlabel small { font-size: 17px; }
.hspot .hlock { left: -36px; top: -300px; width: 72px; height: 72px; font-size: 36px; }
.hspot .hglow { left: -220px; top: -330px; width: 440px; height: 440px; }
.fwspot img { width: 190px; height: 190px; left: -95px; }
.fwspot .fwshadow { left: -50px; width: 100px; height: 24px; }
.mapstage .firefly { width: 9px; height: 9px; }

.coin-i { display: inline-block; width: 1em; height: 1em; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe38a, #e0a93c 70%, #b7842d); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.3); vertical-align: -.12em; margin-right: .2em; }
.result { overflow: auto; justify-content: flex-start; padding-top: max(16px, env(safe-area-inset-top)); }
.result .friend { width: 150px; flex: none; }
.result h2 { font-size: 32px; }
.result .stars { font-size: 38px; }

/* ---------- shiny play screen ---------- */
.play .theme { opacity: 1; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--theme, #fff) 28%, transparent) 0, transparent 55%); }
.play .theme:after { content: ""; position: absolute; right: -60px; bottom: -40px; width: 420px; height: 420px; background: var(--house) center / contain no-repeat; opacity: .28; filter: drop-shadow(0 0 30px rgba(0,0,0,.5)); }
.play .card.speech { background: linear-gradient(rgba(14,24,18,.88), rgba(8,14,10,.92)); color: #f7f3ea !important; border: 2px solid rgba(245,200,107,.55); box-shadow: 0 0 0 4px rgba(10,18,14,.55), 0 20px 50px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.play .card.speech:after { border-top-color: rgba(10,18,14,.9); }
.play .qtext { color: #f7f3ea; }
.play .qtext .expr { background: linear-gradient(180deg, #fff6d5, #f5c86b 60%, #d99a2e); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); font-size: 1.6em; }
.play .qtext .en { color: #c9c2b2; }
.play .qrow .friend { border-radius: 50%; background: radial-gradient(circle, #fff, #f3e7c8); box-shadow: 0 0 0 4px #f5c86b, 0 0 24px rgba(245,200,107,.5); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.play .qrow .friend img { width: 90% !important; height: 90% !important; }
.progress { height: 16px; background: rgba(0,0,0,.45); box-shadow: inset 0 2px 4px rgba(0,0,0,.5), 0 0 0 2px rgba(245,200,107,.3); }
.progress > div { background: linear-gradient(90deg, #7fae7a, #f5c86b, #ffe38a); box-shadow: 0 0 14px rgba(245,200,107,.7); position: relative; }
.progress > div:after { content: "★"; position: absolute; right: -6px; top: -8px; color: #ffe38a; font-size: 22px; text-shadow: 0 0 8px #f5c86b; }
.play .pill, .play .btn.icon { background: rgba(10,18,14,.8); color: #f3efe6 !important; box-shadow: inset 0 0 0 1px rgba(245,200,107,.35); }
.numpad button { background: linear-gradient(180deg, #fffdf7, #efe4cf); box-shadow: 0 6px 0 #c9b592, 0 10px 16px rgba(0,0,0,.35), inset 0 1px 0 #fff; border: 1px solid #e6d8bd; height: 62px; font-size: 30px; }
.numpad button:active { transform: translateY(5px); box-shadow: 0 1px 0 #c9b592, inset 0 1px 0 #fff; }
.numpad button.go { background: linear-gradient(180deg, #a8d68f, #5f9a52); color: #fff; box-shadow: 0 6px 0 #3f6f3a, 0 10px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.5); border-color: #6fa36a; text-shadow: 0 1px 0 rgba(0,0,0,.25); animation: gopulse 2s ease-in-out infinite; }
@keyframes gopulse { 0%,100% { box-shadow: 0 6px 0 #3f6f3a, 0 10px 18px rgba(0,0,0,.35), 0 0 0 0 rgba(168,214,143,.0); } 50% { box-shadow: 0 6px 0 #3f6f3a, 0 10px 18px rgba(0,0,0,.35), 0 0 22px 4px rgba(168,214,143,.45); } }
.numpad button.del { background: linear-gradient(180deg, #f6ecdc, #dccbb0); box-shadow: 0 6px 0 #b8a283, 0 10px 16px rgba(0,0,0,.35), inset 0 1px 0 #fff; }
.answerbox { background: rgba(10,18,14,.85); color: #fff6d5; border: 2px solid rgba(245,200,107,.6); box-shadow: 0 0 20px rgba(245,200,107,.25), inset 0 1px 0 rgba(255,255,255,.1); font-size: 42px; }
.answerbox.empty { color: rgba(255,246,213,.35); }
.answerbox.ok { background: linear-gradient(180deg, #a8d68f, #5f9a52); color: #fff; border-color: #d9f0c8; box-shadow: 0 0 30px rgba(168,214,143,.8); animation: okpop .4s cubic-bezier(.2,.9,.3,1.4); }
@keyframes okpop { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
.answerbox.ng { background: rgba(120,40,60,.8); border-color: #f2a7b3; }
.choice { background: linear-gradient(180deg, #fffdf7, #efe4cf); box-shadow: 0 6px 0 #c9b592, 0 10px 16px rgba(0,0,0,.35), inset 0 1px 0 #fff; border: 1px solid #e6d8bd; }
.choice:active { transform: translateY(5px); box-shadow: 0 1px 0 #c9b592; }
.choice.ok { background: linear-gradient(180deg, #a8d68f, #5f9a52); color: #fff; box-shadow: 0 0 30px rgba(168,214,143,.8); }
.choice.ng { background: #7a6f66; color: #cbc2b8; box-shadow: none; }
.dot { box-shadow: inset -4px -4px 8px rgba(0,0,0,.25), inset 3px 3px 6px rgba(255,255,255,.55), 0 3px 6px rgba(0,0,0,.35); width: 26px; height: 26px; }
.rod, .unit, .hundred { box-shadow: inset -3px -3px 6px rgba(0,0,0,.25), inset 2px 2px 4px rgba(255,255,255,.4), 0 3px 6px rgba(0,0,0,.35); }
.plus, .minus, .eq { color: #f5c86b; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.hint { font-size: 22px; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.hint.warm { color: #ffe38a; }
.combo { background: linear-gradient(135deg, #ffe38a, #f5a54b); color: #4a2a00; box-shadow: 0 0 22px rgba(245,165,75,.7), 0 6px 0 #b8702a; font-size: 20px; top: 70px; }
.combo.hot { background: linear-gradient(135deg, #ffb35c, #ff5e7a); color: #fff; animation: pop .3s both, hotpulse 1s ease-in-out infinite; }
@keyframes hotpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.bigword { background: linear-gradient(180deg, #fff6d5, #f5c86b 55%, #e0872e); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 4px 0 #6b3a10) drop-shadow(0 10px 20px rgba(0,0,0,.5)); font-size: clamp(56px, 10vw, 110px); -webkit-text-stroke: 0; }
.reveal { color: #ffe38a; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.coin { color: #ffe38a; }
.ring { position: fixed; width: 20px; height: 20px; border-radius: 50%; border: 4px solid #ffe38a; pointer-events: none; z-index: 50; animation: ring .7s ease-out forwards; transform: translate(-50%, -50%); }
@keyframes ring { to { width: 260px; height: 260px; opacity: 0; border-width: 1px; } }
.sparkle { box-shadow: 0 0 10px 2px currentColor; }

.spr { position: relative; display: inline-block; vertical-align: middle; }
.spr .cos { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.fwspot .spr { position: absolute; left: -95px; bottom: -4px; width: 190px; height: 190px; }
.fwspot .spr img { position: static; width: 190px; height: 190px; animation: bob 2.6s ease-in-out infinite; }
.fwspot .spr .cos { animation: bob 2.6s ease-in-out infinite; }
.fwspot.hop .spr img, .fwspot.hop .spr .cos { animation: hop .32s ease-out; }
.qrow .friend .spr { width: 100% !important; height: 100% !important; display: flex; align-items: center; justify-content: center; }
.room .stk { font-size: 42px; }
.parent .inner > p { color: #d9d4c8 !important; }
.parent .stat, .parent .stat * { color: var(--ink); }
.parent .stat .row span, .parent .stat .row b { color: var(--ink); }
.panel h3 .en { display: block; font-size: 14px; font-weight: 500; color: var(--ink-soft); }

/* ================= story arc update: title, story stage, ceremony, journal, particles ================= */
/* particles */
.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.particles i { position: absolute; bottom: -40px; width: 10px; height: 10px; border-radius: 50%; opacity: 0; animation: floatup linear infinite; transform: scale(var(--s, 1)); }
@keyframes floatup { 0% { transform: translate(0, 0) scale(var(--s, 1)); opacity: 0; } 10% { opacity: .9; } 50% { transform: translate(30px, -50vh) scale(var(--s, 1)); } 90% { opacity: .7; } 100% { transform: translate(-20px, -105vh) scale(var(--s, 1)); opacity: 0; } }
.particles.lanterns i { width: 18px; height: 24px; border-radius: 40% 40% 45% 45%; background: radial-gradient(circle at 50% 40%, #fff3c4, #f5a54b 70%, #c4652a); box-shadow: 0 0 22px 6px rgba(245,165,75,.45); }
.particles.fireflies i { width: 7px; height: 7px; background: #fff4a8; box-shadow: 0 0 12px 4px rgba(255,244,168,.7); animation-name: floatup, twinkle; animation-duration: 12s, 2.2s; animation-iteration-count: infinite, infinite; }
.particles.petals i { width: 12px; height: 9px; border-radius: 60% 0 60% 0; background: linear-gradient(135deg, #ffd7e0, #f2a7b3); opacity: .9; animation-name: floatdown; }
@keyframes floatdown { 0% { transform: translate(0, -110vh) rotate(0deg) scale(var(--s, 1)); opacity: 0; } 10% { opacity: .9; } 50% { transform: translate(-40px, -50vh) rotate(200deg) scale(var(--s, 1)); } 100% { transform: translate(30px, 10vh) rotate(420deg) scale(var(--s, 1)); opacity: 0; } }
.particles.stars i { width: 5px; height: 5px; background: #fff; box-shadow: 0 0 10px 3px rgba(255,255,255,.7); animation-name: twinkle; animation-duration: 3s; bottom: auto; top: calc(var(--s, 1) * 40%); }
.particles.wisps i { width: 9px; height: 9px; background: #9fe9ff; box-shadow: 0 0 16px 6px rgba(120,220,255,.6); animation-duration: 16s; }

/* ---------- title with key visual ---------- */
.title { position: relative; overflow: hidden; padding: 0; justify-content: flex-end; }
.title .kv { position: absolute; inset: 0; z-index: 0; }
.title .kv img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 30%; animation: kenburns 40s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -3%); } }
.title .kv:after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,18,40,.15) 0%, rgba(10,18,40,0) 30%, rgba(8,12,30,.55) 70%, rgba(6,10,26,.92) 100%); }
.title .title-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 20px max(24px, env(safe-area-inset-bottom)); width: 100%; }
.title h1 { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: drop 1.2s .2s cubic-bezier(.2,.9,.3,1.2) both; }
.title h1 .t1 { font-size: clamp(44px, 9vw, 84px); background: linear-gradient(180deg, #fffbe8 0%, #ffe9a6 45%, #f5b74b 70%, #d98a2a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(90,50,10,.55)) drop-shadow(0 12px 28px rgba(0,0,0,.6)); letter-spacing: .06em; line-height: 1.1; }
.title h1 small { color: #ffe9a6; letter-spacing: .5em; font-size: 14px; text-shadow: 0 2px 10px rgba(0,0,0,.6); margin: 0; opacity: .9; }
.title h1 .t2 { font-size: clamp(16px, 2.6vw, 22px); color: #fff; font-weight: 700; letter-spacing: .12em; text-shadow: 0 2px 12px rgba(0,0,0,.7); margin-top: 6px; padding: 4px 18px; border-top: 1px solid rgba(255,233,166,.5); border-bottom: 1px solid rgba(255,233,166,.5); }
.title-bubble { display: flex; align-items: center; gap: 10px; background: rgba(10,18,30,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,233,166,.35); border-radius: 22px; padding: 8px 18px 8px 8px; color: #f7f3ea; max-width: min(92%, 520px); font-size: 17px; animation: pop .5s .8s both; }
.title-bubble .en { display: block; font-size: 13px; color: #c9c2b2; }
.title-bubble .sprite { border-radius: 50%; background: rgba(255,255,255,.9); }
.title-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; animation: pop .5s 1.1s both; }
.btn.glow { background: linear-gradient(180deg, #ffe38a, #f5a54b); color: #4a2a00; box-shadow: 0 0 0 3px rgba(255,227,138,.35), 0 8px 0 #b8702a, 0 16px 40px rgba(245,165,75,.5); animation: glowpulse 2.4s ease-in-out infinite; font-size: 26px; padding: 18px 40px; }
@keyframes glowpulse { 0%,100% { box-shadow: 0 0 0 3px rgba(255,227,138,.35), 0 8px 0 #b8702a, 0 16px 40px rgba(245,165,75,.5); } 50% { box-shadow: 0 0 0 6px rgba(255,227,138,.2), 0 8px 0 #b8702a, 0 16px 60px rgba(245,165,75,.8); } }
.btn.glow:active { transform: translateY(6px); box-shadow: 0 2px 0 #b8702a; }
.btn.glass { background: rgba(10,18,30,.6); color: #f7f3ea !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255,233,166,.4), 0 8px 24px rgba(0,0,0,.4); }
.title-meta { color: #ffe9a6; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.7); font-size: 16px; min-height: 20px; }
.title .btn.ghost { color: #d9d4c8; text-shadow: 0 2px 8px rgba(0,0,0,.7); }

/* ---------- story stage ---------- */
.story { overflow: hidden; }
.story .sbg { position: absolute; left: -4%; top: -4%; width: 108%; height: 108%; object-fit: cover; animation: kenburns 36s ease-in-out infinite alternate; z-index: 0; }
.story .svignette { position: absolute; inset: 0; z-index: 0; background: radial-gradient(ellipse at 50% 35%, transparent 45%, rgba(0,0,0,.5) 100%), linear-gradient(180deg, rgba(0,0,0,.15), transparent 25%, transparent 60%, rgba(0,0,0,.65)); pointer-events: none; }
.story .scene { position: relative; z-index: 2; cursor: pointer; }
.story .actor { position: absolute; bottom: 0; width: min(38vw, 320px); transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .45s, filter .45s; }
.story .actor.left { left: 6%; transform-origin: bottom center; }
.story .actor.right { right: 6%; }
.story .actor.right.back { right: 30%; width: min(30vw, 240px); }
.story .actor.hidden { opacity: 0; transform: translateX(60px); }
.story .actor.dim { opacity: .6; transform: scale(.92); filter: brightness(.55) saturate(.7); }
.story .actor.talk { animation: talkbob 1.2s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(245,200,107,.45)); z-index: 3; }
@keyframes talkbob { 0%,100% { transform: translateY(0) scale(1.02); } 50% { transform: translateY(-8px) scale(1.02); } }
.story .actor img { width: 100% !important; height: auto !important; }
.story .box { z-index: 4; opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s; }
.story .box.in { opacity: 1; transform: none; }
.story .box.narr { background: rgba(6,10,20,.72); border-color: rgba(255,255,255,.25); text-align: center; font-style: normal; }
.story .box.narr .line { color: #e8e4f4; font-weight: 500; letter-spacing: .06em; }
.story .box .en:empty { display: none; }
.story .chapter { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0; z-index: 3; font-size: 15px; pointer-events: none; }
.story .skip { z-index: 6; }
.titlecard { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(4,8,18,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: opacity .8s; animation: fade .8s both; }
.titlecard small { color: #ffe9a6; letter-spacing: .5em; font-size: 16px; }
.titlecard b { font-size: clamp(32px, 6vw, 56px); color: #fff; text-shadow: 0 0 40px rgba(245,200,107,.5), 0 4px 12px rgba(0,0,0,.8); letter-spacing: .1em; padding: 12px 40px; border-top: 1px solid rgba(255,233,166,.5); border-bottom: 1px solid rgba(255,233,166,.5); }
.titlecard span { color: #c9c2b2; font-size: 16px; letter-spacing: .1em; }
.titlecard.gone { animation: none; opacity: 0; pointer-events: none; }
.fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fx.flash { animation: flash 1.2s ease-out both; background: #fff6d5; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .95; } 100% { opacity: 0; } }
.fx.flame { background: radial-gradient(circle at 78% 48%, rgba(120,220,255,.85) 0, rgba(120,220,255,.25) 10%, transparent 22%); animation: flame 2.4s ease-in-out both; }
@keyframes flame { 0% { opacity: 0; transform: translateX(40px); } 30% { opacity: 1; } 70% { opacity: 1; transform: translateX(-30px) scale(1.15); } 100% { opacity: 0; transform: translateX(-120px) scale(.6); } }
.fx.stars { background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.8) 0, transparent 2%), radial-gradient(circle at 60% 10%, rgba(255,255,255,.8) 0, transparent 1.5%), radial-gradient(circle at 80% 30%, rgba(255,255,255,.8) 0, transparent 2%), radial-gradient(circle at 40% 35%, rgba(255,255,255,.8) 0, transparent 1.2%); animation: twinkle 1.6s ease-in-out 3; }
.fx.shake ~ .scene, .fx.shake ~ .sbg { animation: shake .5s; }

/* ---------- lantern ceremony ---------- */
.ceremony { position: relative; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(ellipse at 50% 40%, #1a2440 0, #070a16 70%); overflow: hidden; cursor: pointer; }
.ceremony .lamp { position: relative; width: min(60vw, 300px); aspect-ratio: 1; animation: swingin 1.3s cubic-bezier(.2,.9,.3,1.1) both; transform-origin: top center; }
@keyframes swingin { 0% { transform: translateY(-120%) rotate(-12deg); } 60% { transform: translateY(0) rotate(6deg); } 80% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
.ceremony .lamp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 1.2s; }
.ceremony .lamp .lit { opacity: 0; filter: drop-shadow(0 0 40px rgba(255,180,80,.9)); }
.ceremony .lamp.on .lit { opacity: 1; animation: lampbloom 1.4s cubic-bezier(.2,.9,.3,1.3) both; }
.ceremony .lamp.on .dark { opacity: 0; }
@keyframes lampbloom { 0% { transform: scale(.9); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
.ceremony .rays { position: absolute; inset: -60%; background: conic-gradient(from 0deg, rgba(255,210,120,0) 0deg, rgba(255,210,120,.25) 10deg, rgba(255,210,120,0) 20deg, rgba(255,210,120,0) 40deg, rgba(255,210,120,.25) 50deg, rgba(255,210,120,0) 60deg, rgba(255,210,120,0) 90deg, rgba(255,210,120,.25) 100deg, rgba(255,210,120,0) 110deg, rgba(255,210,120,0) 150deg, rgba(255,210,120,.25) 160deg, rgba(255,210,120,0) 170deg, rgba(255,210,120,0) 220deg, rgba(255,210,120,.25) 230deg, rgba(255,210,120,0) 240deg, rgba(255,210,120,0) 290deg, rgba(255,210,120,.25) 300deg, rgba(255,210,120,0) 310deg, rgba(255,210,120,0) 360deg); border-radius: 50%; opacity: 0; transition: opacity 1.5s; animation: spin 30s linear infinite; z-index: -1; }
.ceremony .lamp.on .rays { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.ceremony .ctext { text-align: center; opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.ceremony .ctext.in { opacity: 1; transform: none; }
.ceremony .ctext b { display: block; font-size: clamp(26px, 5vw, 44px); color: #fff6d5; text-shadow: 0 0 30px rgba(255,200,100,.7), 0 4px 10px rgba(0,0,0,.6); }
.ceremony .ctext small { display: block; color: #ffe9a6; font-size: 18px; margin-top: 6px; letter-spacing: .1em; }
.ceremony .ctext small .en { display: block; color: #c9c2b2; font-size: 14px; }
.ceremony .cfriend { position: absolute; right: 6%; bottom: 8%; animation: bob 2s ease-in-out infinite; }
.ceremony .btn { transition: opacity .6s; z-index: 2; }

/* ---------- journal ---------- */
.journal { display: flex; flex-direction: column; gap: 6px; }
.chap { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; cursor: pointer; transition: background .15s; }
.chap:hover { background: #fff5d6; }
.chap .num { width: 30px; height: 30px; border-radius: 50%; background: var(--sun); color: #4a2a00; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.chap b { display: block; font-size: 18px; }
.chap small { display: block; color: var(--ink-soft); font-size: 13px; }
.chap.locked { opacity: .5; cursor: default; }
.chap.locked .num { background: #ddd; color: #777; }
.chap.locked .sprite { filter: grayscale(1) opacity(.6); }
.panel .box .chap b { color: var(--ink); }

/* ---------- Yoru on the map ---------- */
.yoruspot { position: absolute; width: 0; height: 0; cursor: pointer; }
.yoruspot img { position: absolute; left: -80px; bottom: -4px; width: 160px; height: 160px; filter: drop-shadow(0 10px 8px rgba(0,0,0,.4)); animation: bob 3s ease-in-out infinite; }
.yoruspot .flame { position: absolute; left: -90px; top: -190px; width: 180px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(120,220,255,.55) 0, rgba(120,220,255,0) 60%); animation: winglow 2s ease-in-out infinite; pointer-events: none; }
.yoruspot.shy img { opacity: .75; filter: brightness(.6) drop-shadow(0 0 20px rgba(120,220,255,.8)); }
.yoruspot.friend .flame { background: radial-gradient(circle, rgba(255,210,120,.5) 0, rgba(255,210,120,0) 60%); }
.yoruspot.flee img { animation: flee .9s ease-in both; }
@keyframes flee { to { transform: translateX(120px) scale(.4); opacity: 0; } }
.pill.lant img { width: 22px; height: 22px; object-fit: contain; }
.valley .particles { z-index: 4; }
.valley .particles.petals i { opacity: .7; }

/* ---------- quest framing: light meter, quest chip, ways ---------- */
.lightmeter { flex: 1; display: flex; align-items: center; gap: 8px; position: relative; }
.lightmeter img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255,200,100,.6)); transition: transform .3s; }
.lightmeter.charge img { animation: okpop .5s; }
.lightmeter .progress { flex: 1; }
.lightmeter .frag { background: rgba(10,18,14,.8); color: #ffe38a; border-radius: 999px; padding: 4px 10px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(245,200,107,.4); font-size: 15px; }
.fragfly { position: fixed; z-index: 60; color: #ffe38a; font-size: 30px; text-shadow: 0 0 12px #f5c86b; pointer-events: none; animation: fragfly .85s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes fragfly { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(var(--tx), var(--ty)) scale(.4); opacity: 0; } }
.questchip { background: linear-gradient(90deg, rgba(245,165,75,.25), rgba(245,200,107,.12)); border: 1px solid rgba(245,200,107,.5); color: #ffe9a6; border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 16px; text-shadow: 0 2px 6px rgba(0,0,0,.6); animation: drop .5s both; max-width: 100%; }
.questcard { display: flex; align-items: center; gap: 14px; background: rgba(10,18,14,.8); border: 1px solid rgba(245,200,107,.5); border-radius: 22px; padding: 12px 18px; max-width: 560px; text-align: left; color: #f7f3ea; animation: pop .5s .2s both; }
.questcard img { width: 56px; height: 56px; object-fit: contain; flex: none; filter: drop-shadow(0 0 10px rgba(255,200,100,.6)); }
.questcard b { display: block; color: #ffe38a; font-size: 18px; }
.questcard small { display: block; color: #d9d4c8; font-size: 14px; margin-top: 2px; }
.questcard small .en { display: block; color: #a9a49a; font-size: 12px; }
.hintrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; width: min(100%, 760px); }
.hintrow .hint { flex: 1; min-width: 200px; }
.btn.ways { background: linear-gradient(180deg, #d9c8ff, #a98be8); color: #2c1a55; font-size: 17px; padding: 10px 18px; box-shadow: 0 5px 0 #6d4fb3, 0 8px 16px rgba(0,0,0,.35); }
.btn.ways:active { transform: translateY(4px); box-shadow: 0 1px 0 #6d4fb3; }
.btn.ways.nudge { animation: wobble .6s ease-in-out 3; box-shadow: 0 5px 0 #6d4fb3, 0 0 24px rgba(169,139,232,.9); }
.waysintro { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--ink); margin-bottom: 10px; }
.waysintro .sprite { border-radius: 50%; background: #fff; }
.ways { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.waycard { background: linear-gradient(#fff, #f6efff); border: 2px solid #d9c8ff; border-radius: 18px; padding: 12px 14px; cursor: pointer; transition: transform .15s, box-shadow .15s; color: var(--ink); }
.waycard:hover, .waycard.on { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(109,79,179,.25); border-color: #a98be8; }
.waycard.on { background: linear-gradient(#fff, #ede3ff); }
.waycard .wname { font-weight: 700; font-size: 18px; color: #4a2f8f; margin-bottom: 4px; }
.waycard .wname .en { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.waycard ol { margin: 0; padding-left: 22px; font-size: 16px; line-height: 1.5; }
.waycard ol li + li { margin-top: 2px; }
.waycard .wlisten { font-size: 13px; color: #6d4fb3; margin-top: 6px; text-align: right; }
.waycard.mini { margin-top: 10px; width: min(100%, 460px); background: rgba(10,18,14,.8); border-color: rgba(169,139,232,.6); color: #f7f3ea; cursor: default; }
.waycard.mini .wname { color: #d9c8ff; }
.waycard.mini:hover { transform: none; box-shadow: none; }
.visual { flex-direction: column; }

/* ---- captions: whatever is being spoken, with its English ---- */
#caption { position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 45; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 720px); padding: 10px 18px; border-radius: 18px; background: rgba(20, 18, 30, .82); color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#caption.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#caption img { width: 40px; height: 40px; object-fit: contain; flex: none; }
#caption b { display: block; font-size: 18px; font-weight: 700; line-height: 1.35; }
#caption small { display: block; font-size: 13px; color: #d7d2c6; margin-top: 2px; }

/* ---- settings and profiles ---- */
.settings .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 18px; }
.settings .row small { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.settings .seg { display: flex; gap: 6px; }
.settings .seg button { border: 0; border-radius: 12px; padding: 8px 12px; background: #f0e6d8; font-size: 16px; }
.settings .seg button.on { background: var(--moss); color: #fff; }
.settings input[type=text] { font: inherit; border: 1px solid #ddd; border-radius: 10px; padding: 6px 10px; width: 150px; background: #fff; color: var(--ink); }
.profiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0 16px; }
.profile { width: 128px; padding: 12px 8px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); text-align: center; font-size: 17px; font-weight: 700; color: var(--ink); cursor: pointer; }
.profile.on { outline: 4px solid var(--sun); }
.profile.add { background: #f0e6d8; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.profile small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.avatars .av { border-radius: 16px; padding: 4px; cursor: pointer; }
.avatars .av.on { background: var(--sun); }
.title .who { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 14px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 6px 14px 6px 6px; border-radius: 99px; background: rgba(10,18,30,.55); color: #f7f3ea; font-size: 16px; font-weight: 700; border: 0; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255,233,166,.35); }
.title .who img { width: 32px; height: 32px; object-fit: contain; }
.title .gear { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 3; }
.voicechip { font-size: 13px; color: var(--ink-soft); }

/* ---- own problems ---- */
.custom { align-items: center; gap: 14px; padding: 12px 16px; overflow: auto; }
.custom .ops { display: flex; gap: 10px; }
.custom .ops button { width: 64px; height: 64px; border-radius: 20px; border: 0; background: var(--paper); box-shadow: var(--shadow); font-size: 32px; font-weight: 700; color: var(--ink); }
.custom .ops button.on { background: var(--sun); }
.custom .eq { display: flex; align-items: center; gap: 12px; font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.custom .eq .num { min-width: 120px; height: 76px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; padding: 0 14px; color: var(--ink); cursor: pointer; }
.custom .eq .num.on { outline: 4px solid var(--sun); }
.custom .eq .num.empty { color: #ccc; }
.custom .eq .ans { background: #fff5d6; }
.custom .eq .ans.ok { background: var(--moss); color: #fff; }
.custom .eq .ans.ng { animation: shake .35s; background: #f3e3e6; }
.custom .numpad { width: min(100%, 360px); }
.custom .ways { width: min(100%, 860px); }
.custom .msg { font-size: 18px; color: var(--ink-soft); text-align: center; min-height: 24px; }
.custom .friendrow { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 18px; padding: 8px 14px; box-shadow: var(--shadow); max-width: 560px; color: var(--ink); font-size: 16px; }
.custom .friendrow .en { display: block; font-size: 13px; color: var(--ink-soft); }
.custom .waycard { color: var(--ink); }
.settings .row .en, .profiles .en { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 500; }

/* Map walk: waddle while moving, face the direction of travel, dust puffs, squash on arrival */
.fwspot .spr { transition: transform .15s; }
.fwspot.flip .spr { transform: scaleX(-1); }
.fwspot.walking .spr img, .fwspot.walking .spr .cos { animation: waddle .36s ease-in-out infinite; transform-origin: 50% 100%; }
.fwspot.walking .fwshadow { animation: shadowstep .36s ease-in-out infinite; }
.fwspot.land .spr img, .fwspot.land .spr .cos { animation: land .38s ease-out; transform-origin: 50% 100%; }
@keyframes waddle { 0% { transform: rotate(-7deg) translateY(0) scaleY(.97); } 25% { transform: rotate(0) translateY(-12px) scaleY(1.04); } 50% { transform: rotate(7deg) translateY(0) scaleY(.97); } 75% { transform: rotate(0) translateY(-12px) scaleY(1.04); } 100% { transform: rotate(-7deg) translateY(0) scaleY(.97); } }
@keyframes shadowstep { 0%, 50%, 100% { transform: scale(1); opacity: 1; } 25%, 75% { transform: scale(.82); opacity: .7; } }
@keyframes land { 0% { transform: scale(1.08, .86); } 45% { transform: scale(.95, 1.08) translateY(-8px); } 100% { transform: none; } }
.dust { position: absolute; width: 18px; height: 12px; margin: -6px 0 0 -9px; border-radius: 50%; background: rgba(245, 238, 220, .75); pointer-events: none; z-index: 4; animation: dust .7s ease-out forwards; }
@keyframes dust { 0% { transform: scale(.4) translate(0, 0); opacity: .9; } 100% { transform: scale(1.6) translate(0, -10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fwspot.walking .spr img, .fwspot.walking .spr .cos, .fwspot.land .spr img, .dust { animation: none; } }

/* Praise burst on a correct answer; grows with the streak (t1 → t3) */
.praise { position: fixed; left: 50%; top: 42%; width: 0; height: 0; z-index: 57; pointer-events: none; }
.praise .rays { position: absolute; left: -240px; top: -240px; width: 480px; height: 480px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 227, 138, .85) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: prays 1.2s ease-out forwards; }
.praise .halo { position: absolute; left: -130px; top: -130px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 246, 213, .9), rgba(245, 200, 107, .35) 45%, transparent 70%); animation: phalo 1.2s ease-out forwards; }
.praise i { position: absolute; left: 0; top: 0; font-style: normal; font-size: 22px; color: #ffe38a; text-shadow: 0 0 10px rgba(255, 210, 90, .9); transform: translate(-50%, -50%); animation: pstar .95s cubic-bezier(.2, .8, .3, 1) var(--dl) forwards; opacity: 0; }
.praise .pw { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap; font-weight: 800; font-size: clamp(40px, 11vw, 120px); letter-spacing: .04em;
  background: linear-gradient(180deg, #fffbe8, #ffd76e 50%, #f08a2c); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #7a3f0e) drop-shadow(0 0 18px rgba(255, 200, 80, .7)) drop-shadow(0 12px 24px rgba(0, 0, 0, .45)); animation: pword 1.2s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.praise .pe { position: absolute; left: 0; top: 58px; transform: translateX(-50%); white-space: nowrap; font-weight: 700; font-size: 20px; color: #fff6d5; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); animation: psub 1.2s ease-out forwards; }
.praise .pc { position: absolute; left: 0; top: -96px; transform: translateX(-50%); white-space: nowrap; padding: 6px 18px; border-radius: 999px; font-weight: 800; font-size: 22px; color: #fff; background: linear-gradient(90deg, #f2789f, #b56df2); box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 18px rgba(242, 120, 159, .7); animation: psub 1.2s ease-out forwards; }
.praise.t2 .rays { background: repeating-conic-gradient(from 0deg, rgba(255, 190, 220, .85) 0 8deg, rgba(255, 227, 138, .8) 8deg 16deg, transparent 16deg 24deg); }
.praise.t3 .rays { width: 640px; height: 640px; left: -320px; top: -320px; background: repeating-conic-gradient(from 0deg, #ff9ec5dd 0 7deg, #ffe38add 7deg 14deg, #9ee6ffdd 14deg 21deg, transparent 21deg 28deg); }
.praise.t3 .pw { font-size: clamp(44px, 13vw, 140px); }
@keyframes pword { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-12deg); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.12) rotate(3deg); opacity: 1; } 45% { transform: translate(-50%, -50%) scale(1) rotate(0); } 80% { transform: translate(-50%, -50%) scale(1.03); opacity: 1; } 100% { transform: translate(-50%, -70%) scale(.9); opacity: 0; } }
@keyframes prays { 0% { transform: scale(.3) rotate(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(1.15) rotate(60deg); opacity: 0; } }
@keyframes phalo { 0% { transform: scale(.2); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes pstar { 0% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(.3); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(1.1) rotate(180deg); opacity: 0; } }
@keyframes psub { 0%, 5% { opacity: 0; transform: translateX(-50%) translateY(10px); } 20%, 85% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .praise .rays, .praise i { display: none; } .praise .pw { animation-timing-function: ease-out; } }

.valley .topbar { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 560px) {
  .valley .topbar { flex-wrap: nowrap; gap: 4px; padding-left: 6px; padding-right: 6px; justify-content: space-between; }
  .valley .topbar .lbl { display: none; }
  .valley .topbar .pill, .valley .topbar .btn { padding-left: 6px; padding-right: 6px; font-size: 12px; white-space: nowrap; }
  .valley .topbar .btn.icon { width: 34px; height: 34px; padding: 0; flex: none; }
  .valley .topbar #music, .valley .topbar .spacer { display: none; }
  .valley .topbar .pill.lant img { width: 16px; height: 16px; }
  .valley .topbar > * { flex-shrink: 1; min-width: 0; }
  .valley .bottombar { flex-wrap: nowrap; gap: 6px; padding-left: 8px; padding-right: 8px; }
  .valley .bottombar .btn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 22px; line-height: 1; }
  .valley .bottombar .lbl { font-size: 10px; line-height: 1.15; max-width: 100%; }
}
.story .actor .spr { display: block; width: 100% !important; height: auto !important; }
@media (max-width: 560px) {
  .story .actor { width: 44vw; }
  .story .actor.left { left: 2%; }
  .story .actor.right { right: 2%; }
  .story .actor.right.back { right: 26%; width: 34vw; }
  .play .topbar { flex-wrap: wrap; gap: 6px; padding-left: 8px; padding-right: 8px; }
  .play .topbar .lightmeter { order: 10; flex: 1 1 100%; }
  .play .topbar .pill { white-space: nowrap; }
  .play .topbar .btn.icon { width: 36px; height: 36px; }
}
@media (max-width: 560px) {
  .play .qtext { font-size: 19px; }
  .play .qrow { gap: 10px; }
  .play .qrow .friend .spr, .play .qrow .friend img { width: 64px !important; height: 64px !important; }
  .play .card { padding: 12px 14px; }
}
@media (max-width: 560px) { .story .box { padding-bottom: 34px; } .story .box .line { font-size: 18px; } }
@media (max-width: 560px) { .panel .bottombar .btn { white-space: nowrap; font-size: 16px; padding-left: 14px; padding-right: 14px; } }

/* Readability and tap sizes for small hands */
.kuku .chant small, .house-scene .hint, .house-scene .tip { color: #c9c2b2; }
.dan-row button { min-height: 44px; }
.toggle { width: 60px; height: 36px; }
.waycard .wlisten { font-size: 15px; padding: 8px 4px; display: inline-block; }
@media (max-width: 560px) { .valley .topbar .btn.icon, .play .topbar .btn.icon { width: 40px; height: 40px; } }
/* After a first wrong answer, glow the picture so non-readers know where to look */
.visual.look { animation: lookglow 1.2s ease-in-out 2; border-radius: 18px; }
@keyframes lookglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 227, 138, 0); } 50% { box-shadow: 0 0 0 6px rgba(255, 227, 138, .55), 0 0 28px rgba(255, 227, 138, .5); } }
.toggle:after { width: 30px; height: 30px; } .toggle.on:after { left: 27px; }
