:root {
  --navy: #1f3a66;
  --navy-deep: #142647;
  --wood-hi: #c9955a;
  --wood: #9a6434;
  --wood-dk: #5e3a1c;
  --parch: #f6ead0;
  --parch-dk: #e3cfa6;
  --ink: #4a2f18;
  --gold: #ffd35a;
  --sky: #7cc4f2;
  --pink: #ff6fa8;
  --ui: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e1c33; color: #fff; font-family: var(--ui); }
body { display: flex; justify-content: center; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font-family: inherit; cursor: pointer; border: 0; }
img { -webkit-user-drag: none; }

#app { position: relative; width: 100%; max-width: 520px; height: 100dvh; overflow: hidden; background: #6aa9d8; box-shadow: 0 0 80px #0008; }
.screen { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.screen.active { opacity: 1; pointer-events: auto; }
.bg { position: absolute; inset: 0; background: center / cover no-repeat; }
.bg.blur { inset: -20px; filter: blur(6px) saturate(1.1) brightness(.95); }
.hand { font-family: "Klee One", var(--ui); }

/* ---------- Title ---------- */
#title .bg { animation: kenburns 30s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05); } to { transform: scale(1.15) translate(-2%, 1%); } }
.title-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 10%, #fff8 0, transparent 45%), linear-gradient(#0000 55%, #0f2548cc 100%); }
.catch { position: absolute; top: 5%; left: 7%; margin: 0; font-size: clamp(26px, 8vw, 40px); line-height: 1.35; color: #fff; text-shadow: 0 2px 10px #1f3a66cc, 0 0 2px #1f3a66; transform: rotate(-4deg); animation: floaty 5s ease-in-out infinite; }
.logo { position: absolute; left: 0; right: 0; bottom: 21%; text-align: center; z-index: 3; }
.logo h1 { position: relative; display: inline-block; margin: 0; font: 800 clamp(52px, 17vw, 84px)/1 "Fraunces", Georgia, serif; color: var(--navy); letter-spacing: -1px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 4px 0 #fff, 0 8px 24px #0006; }
.logo h1 span { color: #2d5aa0; }
.logo .leaf { position: absolute; right: -10px; top: -14px; width: 34px; height: 22px; background: linear-gradient(135deg, #7ad66a, #2f9a4a); border-radius: 0 100% 0 100%; transform: rotate(-25deg); box-shadow: inset -3px -3px 6px #0003; }
.logo .leaf::after { content: ""; position: absolute; left: -12px; top: 8px; width: 22px; height: 15px; background: linear-gradient(135deg, #9be28b, #3aa855); border-radius: 100% 0 100% 0; transform: rotate(40deg); }
.logo small { display: block; margin-top: 6px; font-weight: 700; letter-spacing: .5em; color: var(--navy); text-shadow: 0 0 4px #fff, 0 0 8px #fff; }
.title-heroine { position: absolute; left: -6%; bottom: 0; height: 52%; z-index: 2; filter: drop-shadow(0 10px 20px #0005); animation: rise .9s cubic-bezier(.2, 1.4, .4, 1) both .2s; }
.title-cat { position: absolute; right: 2%; bottom: 3%; height: 23%; z-index: 2; filter: drop-shadow(0 8px 14px #0005); animation: rise .9s cubic-bezier(.2, 1.4, .4, 1) both .5s, bob 2.6s ease-in-out infinite 1.4s; }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-4%) rotate(2deg); } }
@keyframes floaty { 50% { transform: rotate(-4deg) translateY(-6px); } }
#startBtn { position: absolute; left: 50%; bottom: 11%; transform: translateX(-50%); z-index: 4; }
.tagline { position: absolute; left: 0; right: 0; bottom: 4%; margin: 0; text-align: center; font-size: 14px; letter-spacing: .15em; color: #fff; z-index: 4; text-shadow: 0 1px 6px #000a; }

/* ---------- Buttons & plates ---------- */
.btn-primary { padding: 14px 34px; border-radius: 999px; font-size: 18px; font-weight: 900; color: #fff; letter-spacing: .08em;
  background: linear-gradient(#ffcf5c, #f39a2b 60%, #e0761a); box-shadow: 0 5px 0 #a4500f, 0 10px 20px #0005, inset 0 2px 0 #fff9;
  text-shadow: 0 2px 0 #b35a12; transition: transform .1s; white-space: nowrap; }
.btn-primary:active { transform: translateY(3px) !important; box-shadow: 0 2px 0 #a4500f, 0 4px 10px #0005, inset 0 2px 0 #fff9; }
#startBtn:active { transform: translate(-50%, 3px) !important; }
.btn-sub { padding: 12px 22px; border-radius: 999px; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(#6fb6ec, #3478c6); box-shadow: 0 4px 0 #1f4f8a, 0 8px 16px #0004, inset 0 2px 0 #fff8; text-shadow: 0 1px 0 #1f4f8a; }
.btn-sub:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f4f8a; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.06); } }
.round-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 20px; font-weight: 900; color: #fff; background: #0006; backdrop-filter: blur(6px); box-shadow: inset 0 0 0 2px #fff6; display: grid; place-items: center; }
.round-btn.off { opacity: .45; }
.settings { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; display: flex; gap: 8px; z-index: 50; }

.wood { position: relative; color: #fff4dc; border-radius: 14px;
  background: repeating-linear-gradient(90deg, #0000 0 14px, #0000000d 14px 16px), linear-gradient(#b87c43, #8b5629);
  box-shadow: inset 0 0 0 3px #d9a86b, inset 0 0 0 5px #6b421f, 0 6px 14px #0006; text-shadow: 0 2px 0 #4d2d12; }
.parchment { color: var(--ink); border-radius: 18px; background: radial-gradient(ellipse at 30% 20%, #fffaf0, var(--parch) 55%, var(--parch-dk)); box-shadow: inset 0 0 0 3px #caa46a, inset 0 0 30px #b8905540, 0 14px 40px #0007; }

/* ---------- Map ---------- */
#map { background: #0e1c33; }
#townCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-head { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 104px; display: flex; gap: 8px; z-index: 5; }
.map-head .plate { padding: 8px 14px; display: flex; flex-direction: column; justify-content: center; }
.map-head .plate:first-child { flex: 1; }
.map-head b { font-size: 16px; }
.map-head span { font-size: 12px; opacity: .9; }
.map-head .stars { flex-direction: row; align-items: center; gap: 4px; color: var(--gold); font-size: 18px; }
.map-head .stars b { color: #fff4dc; }
#pins { position: absolute; inset: 0; }
.pin { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; font-weight: 900; font-size: 17px; color: #fff; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #9fd6ff, #3a7fd0 60%, #22518f); box-shadow: 0 0 0 3px #fff, 0 6px 12px #0007; transition: transform .2s; z-index: 3; }
.pin.done { background: radial-gradient(circle at 35% 30%, #ffe89a, #f0aa2a 60%, #b86d10); }
.pin.locked { background: radial-gradient(circle at 35% 30%, #ccc, #888 60%, #555); box-shadow: 0 0 0 3px #ddd, 0 4px 8px #0006; opacity: .85; font-size: 14px; }
.pin.current { animation: pinpulse 1.2s ease-in-out infinite; z-index: 4; }
.pin .st { position: absolute; top: -15px; font-size: 11px; color: var(--gold); letter-spacing: -1px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
@keyframes pinpulse { 50% { transform: scale(1.18); box-shadow: 0 0 0 3px #fff, 0 0 0 10px #fff5, 0 6px 12px #0007; } }
.map-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px; background: linear-gradient(#0000, #0f2548e0 45%); z-index: 5; }
.restore-bar { position: relative; width: 100%; max-width: 360px; height: 22px; border-radius: 11px; background: #0007; box-shadow: inset 0 0 0 2px #fff6; overflow: hidden; }
.restore-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #7ad66a, #ffd35a, #ff8fb8); transition: width 1.2s ease; }
.restore-bar span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 22px; font-weight: 700; text-shadow: 0 1px 2px #000; }

/* ---------- Puzzle ---------- */
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; display: flex; align-items: stretch; gap: 8px; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: auto; }
#backBtn { align-self: center; flex: none; }
.goals-plate { flex: 1; padding: 20px 8px 6px; display: flex; justify-content: center; min-height: 76px; }
.ribbon { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 3px 16px; border-radius: 8px; font: 800 13px/1.2 "Fraunces", serif; letter-spacing: .08em; white-space: nowrap;
  background: linear-gradient(#c98d4f, #8d5a2b); box-shadow: inset 0 0 0 2px #e6b57a, 0 3px 6px #0005; }
#goals { display: flex; gap: 10px; align-items: center; }
.goal { position: relative; width: 46px; text-align: center; }
.goal img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 2px #0006); }
.goal b { display: block; font-size: 15px; line-height: 1; margin-top: 1px; }
.goal.done b { color: #9dff8a; }
.goal.bump img { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }
.moves-plate { width: 76px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.moves-plate small { font: 800 11px "Fraunces", serif; letter-spacing: .1em; }
.moves-plate b { font: 800 34px/1 "Fraunces", serif; }
.moves-plate.low b { color: #ffb0a0; animation: bump .6s ease infinite; }
.score-line { position: absolute; left: 16px; right: 16px; z-index: 5; display: flex; align-items: center; gap: 10px; pointer-events: none; }
#score { min-width: 64px; font: 800 18px "Fraunces", serif; text-shadow: 0 2px 4px #000a; }
.score-bar { position: relative; flex: 1; height: 12px; border-radius: 6px; background: #0007; box-shadow: inset 0 0 0 2px #fff5; }
.score-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ffd35a, #ff9d3b); transition: width .4s; }
.score-bar em { position: absolute; top: -5px; margin-left: -8px; font-style: normal; font-size: 16px; color: #0008; text-shadow: 0 0 2px #fff8; }
.score-bar em.on { color: var(--gold); text-shadow: 0 0 6px #ffae00, 0 1px 1px #000; }
.boosters { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px max(10px, env(safe-area-inset-bottom)); display: flex; justify-content: flex-end; gap: 10px; z-index: 5; }
.booster { position: relative; width: 70px; height: 76px; border-radius: 16px; background: linear-gradient(#34568ccc, #1c3561e6); box-shadow: inset 0 0 0 2px #9cc6ff66, 0 6px 12px #0006; color: #fff; padding: 4px 0 0; }
.booster img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 3px 3px #0007); }
.booster span { display: block; font-size: 10px; font-weight: 700; }
.booster b { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; border-radius: 12px; background: linear-gradient(#ff7a9c, #e0366a); font-size: 13px; line-height: 24px; box-shadow: 0 0 0 2px #fff; }
.booster.active { background: linear-gradient(#ffcf5c, #e8891f); box-shadow: 0 0 0 3px #fff, 0 0 20px #ffd35a; transform: translateY(-4px); }
.booster:disabled { filter: grayscale(1); opacity: .6; }
.cat-peek { position: absolute; left: 4px; bottom: 0; height: 118px; transform-origin: 50% 100%; filter: drop-shadow(0 6px 10px #0006); transition: transform .3s; pointer-events: auto; }
.cat-peek.hop { animation: hop .5s ease; }
@keyframes hop { 30% { transform: translateY(-18px) scale(1.05, .95); } 60% { transform: translateY(0) scale(.95, 1.05); } }
.toast { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: #0009; font-size: 14px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 6; }
.toast.show { opacity: 1; }

/* ---------- Overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .35s; }
.overlay.show { opacity: 1; pointer-events: auto; }
#story { background: linear-gradient(#0000 30%, #0b1a33b0); }
#storyChar { position: absolute; left: 50%; bottom: 150px; height: 58%; transform: translateX(-50%); filter: drop-shadow(0 10px 30px #0008); transition: transform .3s; }
#story.show #storyChar { animation: rise .6s cubic-bezier(.2, 1.3, .4, 1) both; }
#story.cat #storyChar { height: 30%; bottom: 170px; }
#story .dialog { position: absolute; left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); min-height: 130px; padding: 22px 20px 18px; }
#story .name { position: absolute; top: -16px; left: 18px; padding: 4px 16px; border-radius: 10px; font-weight: 900; color: #fff; background: linear-gradient(#ff8fb8, #e0578e); box-shadow: 0 3px 0 #a33664, 0 4px 10px #0005; }
#story.cat .name { background: linear-gradient(#ffbe6a, #e98a2a); box-shadow: 0 3px 0 #a55c14; }
#story p { margin: 0; font-size: 17px; line-height: 1.7; font-weight: 700; min-height: 58px; }
#story .next { position: absolute; right: 18px; bottom: 10px; color: #c7853f; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

#result { display: grid; place-items: center; background: #0b1a33a8; backdrop-filter: blur(3px); }
#result .card { position: relative; width: min(88%, 380px); padding: 26px 20px 22px; text-align: center; transform: scale(.8); transition: transform .4s cubic-bezier(.2, 1.4, .4, 1); }
#result.show .card { transform: scale(1); }
#result h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; color: #d4600e; text-shadow: 0 2px 0 #fff; }
.result-stars { display: flex; justify-content: center; gap: 6px; font-size: 48px; line-height: 1; }
.result-stars i { font-style: normal; color: #0002; transform: scale(.4); transition: transform .4s cubic-bezier(.2, 1.8, .4, 1), color .2s; }
.result-stars i:nth-child(2) { transform: scale(.4) translateY(-8px); font-size: 58px; }
.result-stars i.on { color: var(--gold); text-shadow: 0 0 12px #ffb300, 0 3px 0 #c77c00; transform: scale(1); }
.result-stars i.on:nth-child(2) { transform: scale(1) translateY(-8px); }
#resultScore { margin: 6px 0 0; font: 800 20px "Fraunces", serif; }
#resultImg { width: 150px; height: 150px; object-fit: contain; margin: 4px auto 0; display: block; filter: drop-shadow(0 8px 12px #0004); }
#result.show #resultImg { animation: bob 2s ease-in-out infinite; }
#resultMsg { margin: 4px 0 16px; font-weight: 700; line-height: 1.6; font-size: 15px; }
#result .row { display: flex; gap: 12px; justify-content: center; }
/* in-game: settings move under the moves plate, next to the score bar */
#app.ingame .settings { top: var(--set-top, 96px); gap: 6px; }
#app.ingame .settings .round-btn { width: 32px; height: 32px; font-size: 15px; }
#app.ingame .score-line { right: 92px; }

.bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: kenburns 30s ease-in-out infinite alternate; }
#movie { background: #000; z-index: 40; }
#movie video { width: 100%; height: 100%; object-fit: cover; }
#movie .skip { position: absolute; right: 14px; bottom: max(18px, env(safe-area-inset-bottom)); padding: 8px 16px; border-radius: 999px; color: #fff; font-weight: 700; background: #0008; }

/* ---------- Map nodes ---------- */
.node { position: absolute; width: 62px; height: 62px; margin: -31px 0 0 -31px; padding: 0; background: none; border-radius: 50%; z-index: 3; transition: transform .2s; }
.node > img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 6px #0008); }
.node.locked > img { filter: grayscale(1) sepia(.35) brightness(.72) drop-shadow(0 4px 5px #0008); }
.node.current { width: 78px; height: 78px; margin: -39px 0 0 -39px; z-index: 4; animation: nodebob 1.6s ease-in-out infinite; }
.node.current::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; background: radial-gradient(circle, #fff7c0aa 40%, #fff0 70%); animation: halo 1.6s ease-in-out infinite; z-index: -1; }
.node.shake { animation: shake .35s; }
@keyframes nodebob { 50% { transform: translateY(-6px); } }
@keyframes halo { 50% { transform: scale(1.18); opacity: .6; } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.node .num { position: absolute; left: -4px; bottom: -2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font: 800 13px/22px "Fraunces", serif; color: #fff;
  background: linear-gradient(#5aa2e8, #2c64b0); box-shadow: 0 0 0 2px #fff, 0 2px 4px #0006; }
.node.done .num { background: linear-gradient(#ffcf5c, #e0861a); }
.node.locked .num { background: linear-gradient(#aaa, #777); }
.node .lock { position: absolute; right: -4px; bottom: -2px; font-size: 16px; filter: drop-shadow(0 1px 2px #000); }
.node .st { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-size: 14px; color: var(--gold); letter-spacing: -1px; white-space: nowrap; text-shadow: 0 1px 0 #a36400, 0 0 4px #0008; }
.node .st i { font-style: normal; color: #0005; text-shadow: none; }
.node .mia { position: absolute; left: 50%; top: -58px; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; overflow: hidden; background: #ffe9c9; box-shadow: 0 0 0 3px #fff, 0 4px 8px #0007; }
.node .mia::after { content: ""; position: absolute; }
.node .mia img { position: absolute; width: 150%; left: -22%; top: -8%; }
.node .label { position: absolute; left: 50%; top: 100%; margin-top: 4px; transform: translateX(-50%); padding: 3px 10px; border-radius: 8px; white-space: nowrap; font-size: 12px; font-weight: 900; color: var(--ink);
  background: var(--parch); box-shadow: inset 0 0 0 2px #caa46a, 0 3px 6px #0006; }
.signpost { position: absolute; transform: translate(-50%, -100%); padding: 4px 12px 5px; border-radius: 8px; white-space: nowrap; font-size: 12px; font-weight: 900; color: #fff4dc; text-align: center; line-height: 1.2; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(90deg, #0000 0 12px, #0000000f 12px 14px), linear-gradient(#b87c43, #8b5629); box-shadow: inset 0 0 0 2px #d9a86b, 0 4px 8px #0007; text-shadow: 0 1px 0 #4d2d12; }
.signpost small { display: block; font: 800 9px "Fraunces", serif; letter-spacing: .15em; opacity: .85; }
.signpost::after { content: ""; position: absolute; left: 50%; top: 100%; width: 5px; height: 14px; margin-left: -2px; background: #6b421f; }
.signpost.dim { filter: grayscale(.7) brightness(.8); }

/* ---------- CM recording mode ---------- */
.cm #app { max-width: none; box-shadow: none; }
.cm .settings, .cm #backBtn { display: none; }
#cmTouch { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; pointer-events: none; z-index: 20; opacity: 0;
  background: radial-gradient(circle, #fff 0 30%, #ffffffa0 45%, #fff0 70%); box-shadow: 0 0 24px #fff; }
#cmTouch.down { opacity: 1; transform: scale(1); }
#cmTouch.up { opacity: 0; transform: scale(1.6); transition: opacity .35s, transform .35s !important; }

/* ---------- Stage unlock ---------- */
.node.unlocking { animation: unlockpop .9s cubic-bezier(.2, 1.5, .4, 1) forwards; z-index: 5; }
.node.unlocking > img { animation: bloom .9s ease forwards .35s; }
.node.unlocking .lock { animation: lockbreak .55s ease forwards; }
.node.unlocking .num { animation: bloomnum .9s forwards .35s; }
@keyframes unlockpop { 0%, 35% { transform: scale(1); } 20% { transform: scale(1.08) rotate(-4deg); } 30% { transform: scale(1.08) rotate(4deg); } 60% { transform: scale(1.35); } 100% { transform: scale(1.15); } }
@keyframes bloom { from { filter: grayscale(1) sepia(.35) brightness(.72) drop-shadow(0 4px 5px #0008); } 50% { filter: grayscale(0) brightness(1.6) drop-shadow(0 0 18px #fff6b0); } to { filter: grayscale(0) brightness(1) drop-shadow(0 0 12px #ffe07a); } }
@keyframes bloomnum { to { background: linear-gradient(#5aa2e8, #2c64b0); } }
@keyframes lockbreak { 0% { transform: none; } 25% { transform: rotate(-20deg); } 50% { transform: rotate(20deg) scale(1.2); } 100% { transform: translateY(-30px) scale(2); opacity: 0; } }
.node.fresh { animation: freshpop .5s cubic-bezier(.2, 1.6, .4, 1), nodebob 1.6s ease-in-out infinite .5s; }
.node.fresh .mia { animation: miadrop .8s cubic-bezier(.3, 1.6, .5, 1) both .1s; }
.node .newbadge { position: absolute; right: -18px; top: -6px; padding: 2px 7px; border-radius: 8px; font: 900 12px/1.3 "Fraunces", serif; color: #fff; transform: rotate(12deg);
  background: linear-gradient(#ff7a9c, #e0366a); box-shadow: 0 0 0 2px #fff, 0 3px 6px #0006; animation: newbadge 1s ease-in-out infinite; z-index: 2; }
@keyframes freshpop { from { transform: scale(1.35); } }
@keyframes miadrop { from { transform: translateY(-80px) scale(.6); opacity: 0; } }
@keyframes newbadge { 50% { transform: rotate(12deg) scale(1.15); } }

#movie .caption { position: absolute; left: 50%; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 64px); transform: translateX(-50%); padding: 10px 26px 12px; border-radius: 14px; white-space: nowrap; text-align: center;
  font-size: 24px; font-weight: 900; color: #fff4dc; text-shadow: 0 2px 0 #4d2d12; line-height: 1.2;
  background: repeating-linear-gradient(90deg, #0000 0 14px, #0000000d 14px 16px), linear-gradient(#b87c43, #8b5629); box-shadow: inset 0 0 0 3px #d9a86b, inset 0 0 0 5px #6b421f, 0 8px 20px #0007; }
#movie .caption small { display: block; font: 800 12px "Fraunces", serif; letter-spacing: .2em; opacity: .9; }
#movie.show .caption { animation: capin 4.6s ease both .6s; }
@keyframes capin { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1.08); } 18% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Rich callouts ---------- */
#banner { position: absolute; left: 0; right: 0; top: 42%; height: 0; pointer-events: none; z-index: 8; opacity: 0; }
#banner.show { animation: bnLife 1.75s ease both; }
@keyframes bnLife { 0% { opacity: 1; } 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-26px) scale(1.04); } }
.bn-rays, .bn-glow, .bn-ribbon { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); }
.bn-rays { width: 620px; height: 620px; border-radius: 50%; mix-blend-mode: screen;
  background: repeating-conic-gradient(from 0deg, #fff4c8cc 0 5deg, #fff4c800 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 12%, #0000 62%); mask: radial-gradient(circle, #000 12%, #0000 62%);
  animation: bnRays 1.75s ease-out both; }
@keyframes bnRays { 0% { transform: translate(-50%, -50%) scale(.2) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.1) rotate(70deg); opacity: .6; } }
.bn-glow { width: 560px; height: 220px; border-radius: 50%; background: radial-gradient(ellipse, #fff8e0f0 0, #ffd35a99 35%, #ff9d3b00 70%); mix-blend-mode: screen; animation: bnGlow 1.75s ease both; }
@keyframes bnGlow { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: .7; } }
.bn-text { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); display: flex; justify-content: center; white-space: nowrap;
  font: 900 clamp(34px, 11vw, 54px)/1.1 var(--ui); letter-spacing: -.02em; }
.bn-text span { position: relative; display: inline-block; color: transparent; padding: 0 .02em;
  background: linear-gradient(110deg, #fff0 38%, #ffffffee 48%, #fff0 58%) no-repeat, linear-gradient(#fffbe6 8%, #ffe26a 42%, #f7a21c 58%, #ffd04e 86%);
  background-size: 260% 100%, 100% 100%; background-position: 160% 0, 0 0; -webkit-background-clip: text; background-clip: text;
  animation: bnChar .6s cubic-bezier(.2, 1.7, .45, 1) both calc(var(--i) * 45ms), bnShine 1.1s ease-in-out both calc(450ms + var(--i) * 30ms); }
.bn-text span::before { content: attr(data-c); position: absolute; left: .02em; top: 0; z-index: -1; color: #fff; -webkit-text-stroke: 9px #7a3b0a; paint-order: stroke fill;
  text-shadow: 0 5px 0 #5b2a06, 0 10px 18px #0009; }
@keyframes bnChar { 0% { transform: translateY(-60px) scale(2.2) rotate(-14deg); opacity: 0; } 55% { transform: translateY(4px) scale(.9) rotate(3deg); opacity: 1; } 100% { transform: none; } }
@keyframes bnShine { to { background-position: -60% 0, 0 0; } }
/* rainbow tier */
.tier-rainbow .bn-text span { background-image: linear-gradient(110deg, #fff0 38%, #ffffffee 48%, #fff0 58%), linear-gradient(90deg, #ff6b8b, #ffb347, #ffe66d, #7de37a, #6cc0ff, #b98bff, #ff6b8b);
  background-size: 260% 100%, 600% 100%; animation: bnChar .6s cubic-bezier(.2, 1.7, .45, 1) both calc(var(--i) * 45ms), bnShine 1.1s ease-in-out both calc(450ms + var(--i) * 30ms), bnHue 1.4s linear infinite; }
.tier-rainbow .bn-text span::before { -webkit-text-stroke-color: #3b2a7a; text-shadow: 0 5px 0 #2a1a5e, 0 10px 18px #0009; }
.tier-rainbow .bn-rays { background: repeating-conic-gradient(from 0deg, #ff9ac4cc 0 5deg, #0000 5deg 12deg, #9fd8ffcc 12deg 17deg, #0000 17deg 24deg, #fff1a0cc 24deg 29deg, #0000 29deg 36deg); }
@keyframes bnHue { to { background-position: -60% 0, -600% 0; } }
/* stage clear */
.tier-clear .bn-text { font-size: clamp(40px, 13vw, 64px); }
.tier-clear .bn-rays { width: 820px; height: 820px; }
.bn-ribbon { width: 108%; max-width: 560px; height: 74px; background: linear-gradient(#ff8fb8, #e0578e); box-shadow: inset 0 3px 0 #ffc4da, inset 0 -4px 0 #a33664, 0 10px 24px #0006;
  clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); animation: bnRibbon .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes bnRibbon { from { transform: translate(-50%, -50%) scaleX(0); } }
/* STAGE n: calm wooden plate */
.tier-stage .bn-rays, .tier-stage .bn-glow { display: none; }
.tier-stage .bn-text { font: 800 clamp(34px, 10vw, 46px)/1.2 "Fraunces", serif; letter-spacing: .08em; }
.tier-stage .bn-text span { background-image: linear-gradient(110deg, #fff0 38%, #fffe 48%, #fff0 58%), linear-gradient(#fff6de, #f1d3a0); }
.tier-stage .bn-text span::before { -webkit-text-stroke: 7px #5e3a1c; }
#bnFlash { position: absolute; inset: 0; pointer-events: none; z-index: 7; opacity: 0; background: radial-gradient(circle at 50% 42%, #fff 0, #fff8e0cc 30%, #fff0 75%); }
#bnFlash.on { animation: bnFlash .5s ease-out; }
@keyframes bnFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
/* safer fill: solid glossy gold with stroke on the glyph itself (background-clip text rendered dark in some engines) */
.bn-text { font-size: clamp(26px, 8.4vw, 46px); }
.tier-clear .bn-text { font-size: clamp(32px, 10vw, 56px); }
.bn-text span, .tier-rainbow .bn-text span, .tier-stage .bn-text span { background: none; color: #ffe066; -webkit-text-stroke: 7px #7a3b0a; paint-order: stroke fill;
  text-shadow: 0 -2px 0 #fff8d0, 0 5px 0 #5b2a06, 0 0 22px #fff3b0, 0 10px 18px #0009; }
.bn-text span::before { display: none; }
.tier-rainbow .bn-text span { -webkit-text-stroke-color: #3b2a7a; animation: bnChar .6s cubic-bezier(.2, 1.7, .45, 1) both calc(var(--i) * 45ms), bnRainbow 1.2s linear infinite calc(var(--i) * -120ms); }
@keyframes bnRainbow { 0% { color: #ff8fa8; } 20% { color: #ffc15e; } 40% { color: #fff07a; } 60% { color: #8ff08a; } 80% { color: #8fd0ff; } 100% { color: #d0a0ff; } }
.tier-stage .bn-text span { color: #fff1d6; -webkit-text-stroke: 6px #5e3a1c; text-shadow: 0 4px 0 #3a220e, 0 8px 14px #0008; }
