@font-face { font-family: "Alegreya"; src: url(assets/fonts/alegreya.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url(assets/fonts/caveat.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(assets/fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --ink: #2b1d24; --plum: #5b3a57; --plum-d: #3e2640; --moss: #5e7148; --moss-d: #3f4f2a; --amber: #e3a23b; --gold: #f2c45a;
  --paper: #f5e9cf; --paper-d: #e6d3ac; --cream: #fffaf0; --red: #b4523f; --wood: #4a2f22; --wood-d: #2e1c14; --brass: #d9a441;
  --hud-h: 122px; --safe-b: env(safe-area-inset-bottom, 0px);
  --head: "Alegreya", Georgia, serif; --ui: "Nunito", "Trebuchet MS", system-ui, sans-serif; --hand: "Caveat", "Segoe Print", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1c1420; overflow: hidden; font-family: var(--ui); color: var(--ink);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; color: inherit; }
img { -webkit-user-drag: none; }

/* ---------- Buttons ---------- */
.btn { position: relative; border: 0; cursor: pointer; font-weight: 900; font-size: 18px; color: #fff; padding: 12px 24px; border-radius: 16px;
  background: linear-gradient(#93c65f 0%, #6a9a3c 48%, #557f2c 52%, #4c7426 100%);
  box-shadow: 0 0 0 2px #2f4a17, inset 0 2px 0 rgba(255,255,255,.45), 0 5px 0 #2f4a17, 0 9px 16px rgba(0,0,0,.35);
  text-shadow: 0 2px 0 rgba(0,0,0,.35); transition: transform .08s, filter .15s; letter-spacing: .2px; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 2px #2f4a17, inset 0 2px 0 rgba(255,255,255,.45), 0 1px 0 #2f4a17; }
.btn:disabled { filter: grayscale(.8) brightness(.9); cursor: default; }
.btn.amber { background: linear-gradient(#ffd77a 0%, #f2a93a 48%, #de8d22 52%, #d17f1a 100%); box-shadow: 0 0 0 2px #7d4a0e, inset 0 2px 0 rgba(255,255,255,.5), 0 5px 0 #7d4a0e, 0 9px 16px rgba(0,0,0,.35); }
.btn.plum { background: linear-gradient(#a978a3 0%, #7c4f78 48%, #6a4066 52%, #5b3a57 100%); box-shadow: 0 0 0 2px #2e1a2c, inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 #2e1a2c, 0 9px 16px rgba(0,0,0,.35); }
.btn.ghost { background: linear-gradient(#fffaf0, #ecdcb8); color: var(--ink); text-shadow: none; box-shadow: 0 0 0 2px #8a6b3e, inset 0 2px 0 #fff, 0 5px 0 #8a6b3e, 0 9px 16px rgba(0,0,0,.3); }
.btn.ad { background: linear-gradient(#8cc3f0 0%, #4f8fd0 48%, #3f7cc0 52%, #3570b0 100%); box-shadow: 0 0 0 2px #1d3d63, inset 0 2px 0 rgba(255,255,255,.45), 0 5px 0 #1d3d63, 0 9px 16px rgba(0,0,0,.35); }
.btn.big { font-size: clamp(26px, 3.8vw, 36px); padding: 14px 64px; border-radius: 22px; }
.btn img.ic { width: 1.35em; height: 1.35em; vertical-align: -.32em; margin-right: 4px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }
.btn .badge { position: absolute; top: -8px; right: -8px; background: var(--red); color: #fff; font-size: 12px; border-radius: 9px; padding: 1px 6px; box-shadow: 0 0 0 2px #fff; }
.medal { flex: 0 0 auto; width: 54px; height: 54px; border: 0; padding: 0; cursor: pointer; background: url(assets/ui/ui_medal.webp) center/contain no-repeat;
  display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); transition: transform .1s; }
.medal:active { transform: scale(.92); }
.medal img { width: 58%; }
.medal .pause { width: 16px; height: 18px; border-left: 5px solid var(--cream); border-right: 5px solid var(--cream); }
.ribbon { display: inline-block; min-width: 260px; padding: 12px 54px 18px; background: url(assets/ui/ui_ribbon.webp) center/100% 100% no-repeat;
  color: var(--cream); font-family: var(--head); font-weight: 900; font-size: 22px; text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.45); white-space: nowrap; }

/* ---------- Screens & overlays ---------- */
.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.show { display: block; }
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: radial-gradient(ellipse, rgba(25,12,28,.45), rgba(15,6,18,.82)); padding: 16px; z-index: 40; }
.overlay.show { display: flex; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.card { position: relative; background: url(assets/ui/ui_parchment.webp) center/100% 100% no-repeat; padding: 50px 38px 30px; text-align: center; width: min(470px, 100%);
  max-height: calc(100% - 20px); overflow-y: auto; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); animation: rise .34s cubic-bezier(.2,1.4,.5,1); }
.card.wide { width: min(720px, 100%); }
@keyframes rise { from { transform: translateY(30px) scale(.88); opacity: 0; } }
.card > .ribbon { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); font-size: 21px; }
.card h2 { font-family: var(--head); font-size: 28px; margin: 6px 0 6px; color: var(--plum-d); }
.card p { margin: 6px 0; line-height: 1.42; font-weight: 700; }
.card .hero { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }
.card .row { display: flex; gap: 14px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.card .row .btn { flex: 1 1 0; min-width: 150px; }
.card .col { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.fake-ad .card { background: #222; color: #eee; filter: none; }
.fake-ad .cd { font-size: 42px; font-weight: 800; }

#loading { position: fixed; inset: 0; display: none; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: radial-gradient(#2c1f2e, #120a14); color: var(--paper); font-size: 20px; z-index: 60; font-family: var(--head); }
#loading.show { display: flex; }
#loading .spin { width: 90px; animation: sway 1.4s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-18deg) translateX(-8px); } }
#loading .bar { width: min(320px, 70vw); height: 14px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.12); box-shadow: 0 0 0 2px var(--brass); }
#loading .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--amber)); transition: width .2s; }
#toast { position: fixed; left: 50%; top: 14%; transform: translate(-50%, -10px); background: linear-gradient(#fffaf0, #f0e1bd); border-radius: 14px; padding: 10px 20px; font-weight: 900;
  box-shadow: 0 0 0 2px #8a6b3e, 0 8px 20px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 70; text-align: center; max-width: 86vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast img { width: 26px; vertical-align: -6px; margin-right: 6px; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 80; }
.flystar { position: absolute; width: 38px; height: 38px; background: url(assets/ui/ic_star.webp) center/contain no-repeat; filter: drop-shadow(0 0 8px #fff3b0); }

/* ---------- Scene HUD ---------- */
#view { position: fixed; left: 0; top: 0; width: 100%; height: calc(100% - var(--hud-h)); touch-action: none; cursor: grab; display: none; }
body.in-scene #view { display: block; }
body.in-scene #hud { display: flex; }
#pops { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.pop-txt { position: absolute; transform: translate(-50%, -50%); font-family: var(--head); font-weight: 900; font-size: 34px; color: var(--gold); white-space: nowrap;
  text-shadow: 0 3px 0 #7d4a0e, 0 0 14px rgba(255,220,120,.8); animation: popUp 1.1s ease-out forwards; }
@keyframes popUp { 0% { transform: translate(-50%, -30%) scale(.4); opacity: 0; } 20% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -160%) scale(1); opacity: 0; } }
#hud { position: fixed; left: 0; right: 0; bottom: 0; min-height: var(--hud-h); display: none; align-items: center; gap: 12px; z-index: 5;
  padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + var(--safe-b)) max(12px, env(safe-area-inset-left));
  background: repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 120px, rgba(0,0,0,.06) 120px 122px), linear-gradient(#6b4430, #4a2f22 55%, #3a2419);
  box-shadow: inset 0 3px 0 #8c5c3f, inset 0 -2px 0 #23150e, 0 -4px 0 var(--brass), 0 -6px 0 #6b4a1c, 0 -12px 24px rgba(0,0,0,.45); }
.hud-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.hud-top { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-size: 19px; color: var(--cream); text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.hud-top #counter { margin-left: auto; font-family: var(--ui); font-weight: 900; font-size: 15px; background: var(--wood-d); color: var(--gold); border-radius: 10px; padding: 2px 10px; box-shadow: 0 0 0 1px var(--brass); }
.tag { font-family: var(--ui); font-size: 12px; font-weight: 900; background: var(--plum); color: var(--gold); border-radius: 8px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .5px; text-shadow: none; }
.combo { position: relative; width: 120px; height: 16px; border-radius: 9px; background: rgba(0,0,0,.45); box-shadow: 0 0 0 1px var(--brass); overflow: hidden; opacity: .45; transition: opacity .3s; }
.combo.on { opacity: 1; }
.combo i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #6fd3c4, #2fb39c); }
.combo b { position: absolute; inset: 0; text-align: center; font: 900 11px/16px var(--ui); color: #fff; text-shadow: 0 1px 0 #000; }
.items { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; align-items: flex-start; }
.item { position: relative; width: 76px; display: flex; flex-direction: column; align-items: center; padding: 3px 2px 2px; border-radius: 12px; background: linear-gradient(#fffaf0, #eddcb7); color: var(--ink);
  box-shadow: 0 0 0 1px #8a6b3e, 0 2px 0 #2e1c14; transition: opacity .3s, transform .2s; }
.item canvas { width: 46px; height: 46px; filter: drop-shadow(0 2px 1px rgba(0,0,0,.3)); }
.item span { font-weight: 900; font-size: 11px; line-height: 1.05; text-align: center; max-width: 74px; min-height: 2.1em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.isclue { background: linear-gradient(#fff3c4, #f2cf6a); box-shadow: 0 0 0 2px var(--brass), 0 0 10px rgba(255,210,90,.7), 0 2px 0 #2e1c14; }
.item.isclue::before { content: ""; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; background: url(assets/ui/ic_magnifier.webp) center/contain no-repeat; }
.item.found { opacity: .38; transform: scale(.94); }
.item.found span { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--moss); }
.item.pop { animation: pop .45s ease-out; }
@keyframes pop { 40% { transform: scale(1.22) rotate(-4deg); background: #fff3b0; } }
.hint { position: relative; flex: 0 0 auto; width: 86px; height: 86px; border: 0; cursor: pointer; background: url(assets/ui/ui_medal.webp) center/contain no-repeat;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,.5)); display: flex; align-items: center; justify-content: center; transition: transform .1s; }
.hint:active { transform: scale(.92); }
.hint img { width: 54px; transform: rotate(-18deg); animation: glint 4s ease-in-out infinite; }
@keyframes glint { 0%, 85%, 100% { filter: brightness(1); } 92% { filter: brightness(1.6) drop-shadow(0 0 8px #fff6b0); } }
.hint b { position: absolute; right: -2px; top: -2px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--red); color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.hint small { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 900; background: var(--wood-d); color: var(--gold); border-radius: 6px; padding: 0 6px; box-shadow: 0 0 0 1px var(--brass); }
.hint small:empty { display: none; }
.hint.empty img { filter: grayscale(.8) brightness(.8); animation: none; }

/* ---------- Title ---------- */
#title { background: #2a1d2c; overflow: hidden; }
#title .bg { position: absolute; inset: -6%; background: url(assets/hub/hub_after.webp) center/cover; animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04) translate(-1.5%, -1%); } to { transform: scale(1.14) translate(1.5%, 1%); } }
#leaves { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#title .shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, rgba(40,20,40,.05), rgba(25,12,28,.78)); }
#title .box { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; }
#title .seal { width: 92px; margin-bottom: -18px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); animation: sealIn .9s cubic-bezier(.2,1.6,.5,1) both; }
@keyframes sealIn { from { transform: scale(2.4) rotate(-40deg); opacity: 0; } }
.logo { margin: 0; font-family: var(--head); font-weight: 900; font-size: clamp(52px, 9.5vw, 112px); line-height: .9; color: var(--cream);
  text-shadow: 0 3px 0 #c9a46a, 0 6px 0 var(--plum-d), 0 10px 0 rgba(0,0,0,.3), 0 0 40px rgba(255,200,120,.5); animation: logoIn 1s .15s cubic-bezier(.2,1.3,.5,1) both; }
@keyframes logoIn { from { transform: translateY(30px) scale(.8); opacity: 0; } }
.logo span { display: block; font-size: .6em; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; }
.tagline { font-family: var(--hand); font-size: clamp(22px, 3vw, 32px); color: var(--paper); text-shadow: 0 2px 6px #000; margin-bottom: 8px; animation: fade 1s .6s both; }
#playBtn { animation: fade .6s .9s both, pulse 2.2s 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
#title .row { display: flex; gap: 12px; animation: fade 1s 1.1s both; }
.tog { border: 0; border-radius: 12px; background: linear-gradient(#fffaf0, #ecdcb8); padding: 8px 16px; font-weight: 900; cursor: pointer; box-shadow: 0 0 0 1px #8a6b3e, 0 3px 0 #8a6b3e; }
.tog.off { opacity: .55; text-decoration: line-through; }

/* ---------- Hub ---------- */
#hub { background: #2a1d2c; overflow: hidden; }
#hubCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
#markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; width: 76px; height: 76px; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; border: 0; padding: 9px;
  background: url(assets/ui/ui_medal.webp) center/contain no-repeat; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); animation: bounce 1.6s ease-in-out infinite; }
.marker span { display: block; width: 100%; height: 100%; border-radius: 50%; background-size: cover; background-position: center; }
.marker .cost { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); background: var(--wood-d); color: var(--gold); font: 900 13px var(--ui); border-radius: 9px; padding: 1px 8px 1px 4px; box-shadow: 0 0 0 1px var(--brass); white-space: nowrap; }
.marker .cost img { width: 16px; vertical-align: -3px; }
@keyframes bounce { 50% { translate: 0 -9px; } }
#ada { position: absolute; pointer-events: auto; cursor: pointer; transform-origin: 50% 100%; }
#ada img { display: block; height: 100%; filter: drop-shadow(0 12px 10px rgba(0,0,0,.45)); animation: breathe 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
#ada.hop img { animation: hopTalk .5s ease-out, breathe 3.4s .5s ease-in-out infinite; }
#adaSay { position: absolute; left: 60%; bottom: 92%; width: max-content; max-width: 240px; background: var(--cream); border-radius: 16px; padding: 10px 14px; font-weight: 800; font-size: 15px; line-height: 1.25;
  box-shadow: 0 0 0 2px #8a6b3e, 0 8px 16px rgba(0,0,0,.35); opacity: 0; transform: translateY(8px) scale(.9); transition: opacity .3s, transform .3s; pointer-events: none; }
#adaSay::after { content: ""; position: absolute; left: 18px; bottom: -10px; border: 10px solid transparent; border-top-color: var(--cream); border-bottom: 0; }
#adaSay.show { opacity: 1; transform: none; }
.topbar { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 10px; align-items: center; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); z-index: 2; }
.topbar .grow { flex: 1; }
.pill { display: flex; align-items: center; gap: 6px; background: linear-gradient(#4a2f22, #2e1c14); color: var(--cream); border-radius: 22px; padding: 4px 16px 4px 4px; font-weight: 900; font-size: 20px;
  box-shadow: 0 0 0 2px var(--brass), 0 4px 10px rgba(0,0,0,.4); }
.pill img { width: 36px; height: 36px; object-fit: contain; margin: -6px 0 -6px -6px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.pill.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.18); } }
.pill.rank div { display: flex; flex-direction: column; gap: 2px; }
.pill.rank b { font-size: 13px; line-height: 1; color: var(--gold); }
.pill.rank i { display: block; width: 92px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; }
.pill.rank u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6fd3c4, #2fb39c); transition: width .8s; }
#taskPanel { position: absolute; left: max(10px, env(safe-area-inset-left)); top: 66px; width: min(340px, calc(100% - 20px)); display: flex; flex-direction: column; gap: 10px; z-index: 2; }
#taskPanel .ribbon { align-self: flex-start; font-size: 18px; min-width: 0; padding: 10px 44px 16px; margin-left: -6px; }
.task { display: flex; align-items: center; gap: 10px; background: url(assets/ui/ui_parchment.webp) center/100% 100% no-repeat; padding: 12px 14px 12px 12px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.45));
  animation: slideIn .45s cubic-bezier(.2,1.3,.5,1) both; }
@keyframes slideIn { from { transform: translateX(-60px); opacity: 0; } }
.task .ic { width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%; background: #3a2419 center/cover; box-shadow: 0 0 0 3px var(--brass), 0 3px 6px rgba(0,0,0,.4); }
.task .ic.obj { background-size: 80%; background-repeat: no-repeat; background-color: #f6e8c8; }
.task .lbl { flex: 1; font-weight: 900; font-size: 16px; line-height: 1.15; }
.task .lbl small { display: block; font-weight: 700; font-size: 12px; opacity: .7; margin-top: 2px; }
.task .btn { padding: 8px 14px; font-size: 16px; white-space: nowrap; }
.task.ready .btn { animation: pulse 1.6s ease-in-out infinite; }
.hubbar { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: calc(10px + var(--safe-b)); display: flex; gap: 6px; z-index: 2; }
.hb { position: relative; width: 84px; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; transition: transform .1s; }
.hb:active { transform: scale(.92); }
.hb img { width: 68px; height: 68px; object-fit: contain; filter: drop-shadow(0 5px 5px rgba(0,0,0,.55)); }
.hb span { margin-top: -10px; background: linear-gradient(#4a2f22, #2e1c14); color: var(--cream); font-weight: 900; font-size: 13px; border-radius: 10px; padding: 2px 10px; box-shadow: 0 0 0 1px var(--brass); }
.dot { position: absolute; top: 0; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; display: none; animation: bump 1.4s infinite; }
.dot.on { display: block; }

/* ---------- Cutscenes ---------- */
#cine { background: #000; z-index: 30; }
#cineCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#cineTap { position: absolute; transform: translate(-50%, -50%); pointer-events: none; display: none; }
#cineTap.show { display: block; }
#cineTap i { display: block; width: 110px; height: 110px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,220,130,.95), 0 0 30px 8px rgba(255,200,90,.7); animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
#cineTap b { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 16px; white-space: nowrap; background: var(--cream); color: var(--ink); font-weight: 900; font-size: 18px; border-radius: 12px; padding: 6px 14px; box-shadow: 0 0 0 2px var(--brass), 0 6px 14px rgba(0,0,0,.5); animation: pulse 1.2s infinite; }
#cineCap { position: absolute; left: 50%; bottom: calc(7vh + var(--safe-b)); transform: translate(-50%, 20px); width: min(760px, calc(100% - 24px)); padding: 24px 40px 26px;
  background: url(assets/ui/ui_parchment.webp) center/100% 100% no-repeat; filter: drop-shadow(0 10px 20px rgba(0,0,0,.6)); opacity: 0; transition: opacity .4s, transform .4s; cursor: pointer; }
#cineCap.show { opacity: 1; transform: translate(-50%, 0); }
#cineCap p { margin: 0; font-family: var(--head); font-weight: 700; font-size: clamp(19px, 2.4vw, 25px); line-height: 1.35; text-align: center; }
#cineCap .more { position: absolute; right: 30px; bottom: 8px; font-size: 12px; font-weight: 900; color: var(--plum); animation: blink 1s infinite; }
#cineCard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; opacity: 0; transition: opacity .8s; }
#cineCard.show { opacity: 1; }
#cineCard img { width: 96px; margin-bottom: -10px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.6)); }
#cineCard h1 { margin: 0; font-family: var(--head); font-weight: 900; font-size: clamp(42px, 7vw, 86px); color: var(--cream); text-shadow: 0 4px 0 var(--plum-d), 0 0 40px rgba(255,200,120,.6); }
#cineCard p { margin: 6px 0 0; font-family: var(--hand); font-size: clamp(24px, 3.4vw, 38px); color: var(--gold); text-shadow: 0 2px 6px #000; }

/* ---------- Dialogue ---------- */
#talk { background: #1c1420; overflow: hidden; }
#talk .bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(2px) brightness(.68) saturate(1.1); transform: scale(1.04); animation: drift 30s ease-in-out infinite alternate; }
.por { position: absolute; bottom: 0; height: min(86vh, 900px); max-width: 52vw; object-fit: contain; object-position: bottom; transition: filter .3s, opacity .3s, translate .35s cubic-bezier(.2,1.2,.4,1);
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); transform-origin: 50% 100%; }
.por.left { left: 4vw; } .por.right { right: 4vw; }
.por.dim { filter: brightness(.55) saturate(.7) drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
.por.off { opacity: 0; }
.por.left.off { translate: -60px 0; } .por.right.off { translate: 60px 0; }
.por.speak { animation: breathe 3.4s ease-in-out infinite; }
.por.hopping { animation: hopTalk .45s ease-out, breathe 3.4s ease-in-out .45s infinite; }
.por.shake { animation: shakeX .45s, breathe 3.4s ease-in-out .45s infinite; }
@keyframes breathe { 50% { transform: scale(1.012, 1.02); } }
@keyframes hopTalk { 35% { transform: translateY(-16px) scale(.99, 1.03); } 70% { transform: translateY(0) scale(1.02, .98); } }
@keyframes shakeX { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.emote { position: absolute; font-family: var(--head); font-weight: 900; font-size: 64px; color: var(--gold); text-shadow: 0 4px 0 #7d4a0e, 0 0 16px rgba(255,220,120,.8); pointer-events: none; opacity: 0; }
.emote.go { animation: emote 1.1s ease-out; }
@keyframes emote { 0% { opacity: 0; transform: scale(.3) rotate(-20deg); } 25% { opacity: 1; transform: scale(1.2) rotate(8deg); } 70% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: translateY(-20px); } }
.tbox { position: absolute; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); width: min(840px, calc(100% - 24px)); min-height: 140px;
  background: url(assets/ui/ui_parchment.webp) center/100% 100% no-repeat; padding: 34px 44px 26px; filter: drop-shadow(0 14px 26px rgba(0,0,0,.6)); cursor: pointer; }
.tbox .name { position: absolute; top: -18px; left: 30px; padding: 10px 38px 16px; background: url(assets/ui/ui_ribbon.webp) center/100% 100% no-repeat; color: var(--cream);
  font-family: var(--head); font-weight: 900; font-size: 21px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.tbox.right .name { left: auto; right: 30px; }
.tbox p { margin: 0; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.42; font-weight: 800; }
.tbox .more { position: absolute; right: 30px; bottom: 12px; color: var(--plum); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.skip { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); padding: 8px 16px; font-size: 15px; z-index: 3; }

/* ---------- Puzzles ---------- */
#puzzle { background: #1c1420; }
.pz-bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(10px) brightness(.6); }
#puzzle.sharp .pz-bg { filter: none; inset: 0; }
.pz-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse, rgba(0,0,0,0) 45%, rgba(10,4,12,.55)); }
.pz-head { position: relative; text-align: center; color: var(--cream); padding: max(8px, env(safe-area-inset-top)) 60px 0; z-index: 2; }
.pz-head p { margin: 2px 0 0; font-weight: 900; text-shadow: 0 2px 4px #000, 0 0 12px #000; }
#pzBody { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pz-stage { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; }
.note-slot { position: absolute; border-radius: 6px; background: rgba(0,0,0,.18); box-shadow: inset 0 0 0 3px rgba(255,235,200,.35), inset 0 0 30px rgba(0,0,0,.35); }
.piece { position: absolute; cursor: grab; touch-action: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.55)); transition: filter .2s; }
.piece.drag { cursor: grabbing; filter: drop-shadow(0 18px 18px rgba(0,0,0,.6)); z-index: 5; }
.piece.placed { cursor: default; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); transition: left .2s, top .2s, transform .2s; }
.snapfx { position: absolute; border-radius: 8px; box-shadow: 0 0 0 3px rgba(255,230,140,.9), 0 0 24px rgba(255,210,90,.8); animation: snapfx .6s ease-out forwards; pointer-events: none; }
@keyframes snapfx { to { opacity: 0; transform: scale(1.06); } }
.clue { font-family: var(--hand); font-size: 30px; line-height: 1.12; color: var(--ink); background: url(assets/ui/ui_parchment.webp) center/100% 100% no-repeat; padding: 22px 34px;
  transform: rotate(-1.5deg); text-align: center; }
.dialw { position: absolute; border-radius: 50%; overflow: hidden; cursor: pointer; background: radial-gradient(circle at 50% 40%, #fdf3da, #d8c08c); box-shadow: inset 0 6px 14px rgba(0,0,0,.55); }
.dialw img { position: absolute; left: 50%; top: 50%; height: 78%; transform: translate(-50%, -50%); transition: transform .3s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.dialw img.out { transform: translate(-50%, -50%) rotate(140deg) scale(.2); }
.dialw.ok { box-shadow: inset 0 6px 14px rgba(0,0,0,.4), 0 0 0 4px #ffe58a, 0 0 26px #ffd34d; }
.dialname { position: absolute; transform: translateX(-50%); font: 900 18px var(--ui); color: var(--cream); text-shadow: 0 2px 3px #000; white-space: nowrap; }
.lockglow { position: absolute; border-radius: 30px; box-shadow: 0 0 60px 30px rgba(255,220,120,.9); opacity: 0; transition: opacity .6s; pointer-events: none; }
.shake { animation: shakeX .45s; }
.polaroid { position: absolute; background: #fbf6ea; padding: 8px 8px 30px; box-shadow: 0 8px 14px rgba(0,0,0,.45); cursor: pointer; transition: transform .2s; text-align: center; }
.polaroid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid b { position: absolute; left: 0; right: 0; bottom: 4px; font: 700 24px var(--hand); color: var(--ink); }
.polaroid:hover { transform: scale(1.05) rotate(0deg) !important; z-index: 3; }
.polaroid.wrong { animation: shakeX .45s; }
.polaroid.right { box-shadow: 0 0 0 5px #ffd34d, 0 0 30px #ffd34d; }
.pin { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, #a3261a); box-shadow: 0 3px 3px rgba(0,0,0,.45); transform: translate(-50%, -50%); z-index: 4; }
.cl { position: absolute; background: #fbf3df; font: 700 21px/1.1 var(--hand); padding: 12px 12px 10px; box-shadow: 0 6px 10px rgba(0,0,0,.4); }
.qbox { position: absolute; background: url(assets/ui/ui_parchment.webp) center/100% 100% no-repeat; padding: 20px 30px; text-align: center; }
.qbox h3 { margin: 0; font: 900 54px var(--head); color: var(--plum-d); }
.qbox p { margin: 6px 0 0; font: 800 34px var(--ui); min-height: 1.3em; }
.opttxt { position: absolute; background: linear-gradient(#fffaf0, #ecdcb8); border: 0; border-radius: 12px; padding: 10px 18px; font: 900 20px var(--ui); cursor: pointer; box-shadow: 0 0 0 2px #8a6b3e, 0 4px 0 #8a6b3e; }

/* ---------- Results, album, calendar, journal ---------- */
.big-stars { display: flex; justify-content: center; gap: 4px; margin: 18px 0 4px; }
.big-stars span { width: 74px; height: 74px; background: url(assets/ui/ic_star.webp) center/contain no-repeat; filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); animation: starIn .55s cubic-bezier(.2,1.8,.5,1) both; }
.big-stars span:nth-child(2) { width: 92px; height: 92px; margin-top: -14px; }
.big-stars span.off { filter: grayscale(1) brightness(.6) opacity(.45); animation: none; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.gain { display: inline-flex; align-items: center; gap: 4px; font: 900 26px var(--ui); color: var(--plum-d); }
.gain img { width: 34px; }
.feathers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.feathers div { aspect-ratio: 1; border-radius: 12px; background: rgba(120,90,50,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px rgba(120,90,50,.35); }
.feathers div img { width: 70%; opacity: .2; filter: grayscale(1); }
.feathers div.got { background: radial-gradient(circle, #fff7da, #f0c96a); box-shadow: 0 0 0 2px var(--brass); }
.feathers div.got img { opacity: 1; filter: none; }
.feathers small { font-size: 10px; font-weight: 900; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0 4px; }
.cal div { border-radius: 10px; background: rgba(120,90,50,.18); padding: 6px 2px; font-size: 11px; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal div img { width: 30px; }
.cal div b { font-size: 13px; }
.cal div.done { opacity: .45; }
.cal div.today { background: radial-gradient(circle, #fff7da, #f0c96a); box-shadow: 0 0 0 3px var(--plum); animation: bump 1.2s infinite; }
.scene-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.sc { border-radius: 12px; overflow: hidden; background: var(--cream); box-shadow: 0 0 0 3px var(--brass), 0 6px 10px rgba(0,0,0,.3); cursor: pointer; text-align: left; border: 0; padding: 0; transition: transform .15s; }
.sc:hover { transform: translateY(-3px); }
.sc img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.sc div { padding: 6px 8px; font-weight: 900; font-size: 14px; }
.sc small { display: block; font-weight: 700; opacity: .7; font-size: 12px; }
.sc.locked { opacity: .45; cursor: default; }
.tabs { display: flex; gap: 6px; justify-content: center; margin: 14px 0 10px; }
.tabs button { border: 0; border-radius: 10px; padding: 6px 14px; font-weight: 900; background: rgba(120,90,50,.18); cursor: pointer; }
.tabs button.on { background: var(--plum); color: #fff; }
.jlist { text-align: left; display: flex; flex-direction: column; gap: 10px; max-height: 48vh; overflow-y: auto; padding: 2px 4px; }
.jent { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.45); border-radius: 12px; padding: 8px 10px; box-shadow: inset 0 0 0 1px rgba(120,90,50,.3); }
.jent img { width: 56px; height: 56px; object-fit: contain; flex: 0 0 auto; border-radius: 10px; }
.jent.locked { opacity: .45; }
.jent b { display: block; font-family: var(--head); font-size: 18px; }
.jent p { margin: 2px 0 0; font-size: 14px; line-height: 1.3; font-weight: 700; }
.chest { width: 150px; animation: chestShake .9s ease-in-out; filter: drop-shadow(0 8px 10px rgba(0,0,0,.4)); }
@keyframes chestShake { 10%, 30%, 50% { transform: rotate(-6deg); } 20%, 40%, 60% { transform: rotate(6deg); } 80% { transform: scale(1.15); } }
.rewards { display: flex; gap: 18px; justify-content: center; margin: 6px 0; }
.rewards span { display: flex; align-items: center; gap: 4px; font: 900 24px var(--ui); animation: starIn .5s .8s both; }
.rewards img { width: 40px; }
.cluecard .big { width: 140px; height: 140px; object-fit: contain; filter: drop-shadow(0 0 18px rgba(255,220,120,.9)); animation: float 3s ease-in-out infinite; }
.settings .toggles { display: flex; gap: 10px; justify-content: center; }

@media (max-width: 760px), (max-height: 520px) {
  :root { --hud-h: 108px; }
  .hint { width: 70px; height: 70px; } .hint img { width: 44px; }
  .item { width: 58px; } .item canvas { width: 36px; height: 36px; } .item span { font-size: 9.5px; max-width: 56px; }
  .combo { width: 70px; }
  .tbox { padding: 30px 26px 20px; min-height: 120px; }
  .por { height: min(70vh, 700px); max-width: 64vw; }
  .por.left { left: -8vw; } .por.right { right: -8vw; }
  #taskPanel { top: 58px; width: min(300px, calc(100% - 20px)); }
  .task .lbl { font-size: 14px; } .task .ic { width: 44px; height: 44px; }
  .hb { width: 66px; } .hb img { width: 54px; height: 54px; } .hb span { font-size: 11px; padding: 1px 6px; }
  .pill { font-size: 17px; } .pill img { width: 30px; height: 30px; }
  .pill.rank i { width: 64px; }
  .medal { width: 46px; height: 46px; }
  .card { padding: 46px 26px 24px; }
}
@media (max-width: 480px) { .pill.rank { display: none; } }
@media (max-height: 520px) { .por { height: 92vh; } .tbox { min-height: 96px; } .tbox p { font-size: 17px; } }

/* ---------- Mini-games ---------- */
.mg-full { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 10px; touch-action: none; }
.cloth { position: absolute; width: 120px; height: 90px; margin: -45px 0 0 -60px; border-radius: 40% 55% 45% 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff8e6, #e8d7b5 60%, #c9b28a); box-shadow: 0 8px 14px rgba(0,0,0,.35); transform: rotate(-12deg); }
.spk { position: absolute; width: 22px; height: 22px; pointer-events: none; z-index: 20;
  background: radial-gradient(circle, #fff 0 18%, rgba(255,230,140,.9) 30%, rgba(255,210,90,0) 70%); }
.mg-done { position: absolute; transform: translate(-50%, -50%); z-index: 30; font: 900 86px var(--head); color: var(--cream); white-space: nowrap; pointer-events: none;
  text-shadow: 0 5px 0 var(--plum-d), 0 0 40px rgba(255,210,120,.9); animation: starIn .6s cubic-bezier(.2,1.6,.5,1) both; }
.pipe-board { position: absolute; border-radius: 16px; background: rgba(40,30,22,.55); box-shadow: inset 0 0 0 4px rgba(217,164,65,.6), 0 12px 30px rgba(0,0,0,.5); }
.pipe { position: absolute; cursor: pointer; }
.pipe img { width: 100%; height: 100%; transform: rotate(var(--r)); transition: transform .18s cubic-bezier(.3,1.4,.5,1); filter: saturate(.75) brightness(.9); }
.pipe.wet img { filter: saturate(1.2) brightness(1.05) drop-shadow(0 0 10px rgba(80,180,255,.95)); }
.pipe-end { position: absolute; }
.pipe-end.wet { filter: drop-shadow(0 0 16px rgba(80,180,255,1)); }
.mud { position: absolute; border-radius: 22px; box-shadow: 0 0 0 6px #5a3a22, 0 14px 30px rgba(0,0,0,.6); touch-action: none; }
.lamp-glow { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; pointer-events: none; z-index: 5;
  background: radial-gradient(circle, rgba(255,220,140,.9) 0 10%, rgba(255,190,90,.25) 40%, rgba(255,160,60,0) 70%); }
.boots { position: absolute; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; opacity: .25; pointer-events: none; transition: opacity .6s; }
.boots.show { opacity: 1; pointer-events: auto; }
.boot { border: 0; border-radius: 16px; background: url(assets/ui/ui_parchment.webp) center/100% 100%; padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s; }
.boot:hover { transform: translateY(-4px); }
.boot img { height: 300px; }
.boot b { font: 900 17px var(--ui); }
.boot.right { box-shadow: 0 0 0 5px #ffd34d, 0 0 30px #ffd34d; }
.boot.wrong { animation: shakeX .45s; }
.recipe { position: absolute; width: 330px; padding: 36px 34px 30px; background: url(assets/ui/ui_parchment.webp) center/100% 100%; transform: rotate(-2deg); }
.recipe h3 { margin: 0 0 8px; font: 900 32px var(--head); color: var(--plum-d); }
.recipe ol { margin: 0; padding-left: 26px; font: 700 28px/1.35 var(--hand); }
.recipe li i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 0 2px rgba(0,0,0,.3); }
.recipe li.ok { text-decoration: line-through; opacity: .55; }
.recipe p { margin: 10px 0 0; font: 700 22px var(--hand); color: var(--red); }
.tonic { position: absolute; width: 220px; height: 300px; }
.tonic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 2; }
.tonic .liq { position: absolute; left: 22%; right: 22%; bottom: 8%; height: 0; border-radius: 0 0 30px 30px; transition: height .6s, background .6s; z-index: 1; opacity: .85; }
.tonic .liq.glow { box-shadow: 0 0 40px 14px rgba(200,120,255,.8); animation: pulse 1.2s infinite; }
.tonic.fizz { animation: shakeX .5s; }
.flask { position: absolute; width: 100px; height: 150px; border: 0; background: none; padding: 0; cursor: pointer; transition: transform .2s; transform-origin: 50% 100%; }
.flask img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(0,0,0,.45)); }
.flask:hover { transform: translateY(-8px); }
.flask.pour { animation: pour .55s ease-in-out; }
@keyframes pour { 40% { transform: translate(60px, -120px) rotate(-70deg); } 70% { transform: translate(60px, -120px) rotate(-90deg); } }
.card3d { position: absolute; border: 0; padding: 0; background: none; perspective: 900px; cursor: pointer; }
.card3d .face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; transition: transform .45s; box-shadow: 0 8px 14px rgba(0,0,0,.45); }
.card3d .back { background: url(assets/ui/ui_seal.webp) center/55% no-repeat, linear-gradient(135deg, #3e5a2c, #26381a); box-shadow: inset 0 0 0 5px var(--brass), 0 8px 14px rgba(0,0,0,.45); }
.card3d .front { background: linear-gradient(#fffaf0, #ecdcb8); box-shadow: inset 0 0 0 5px var(--brass), 0 8px 14px rgba(0,0,0,.45); transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card3d .front canvas { width: 72%; }
.card3d .front b { font: 900 16px var(--ui); margin-top: 4px; }
.card3d.up .back { transform: rotateY(180deg); }
.card3d.up .front { transform: rotateY(360deg); }
.card3d.matched .front { box-shadow: 0 0 0 4px #ffd34d, 0 0 24px #ffd34d; }
.suspect { position: absolute; left: 470px; bottom: 0; height: 700px; filter: drop-shadow(0 14px 20px rgba(0,0,0,.6)); transform-origin: 50% 100%; animation: breathe 3.4s ease-in-out infinite; }
.suspect.talk { animation: hopTalk .45s ease-out, breathe 3.4s ease-in-out .45s infinite; }
.stress { position: absolute; left: 60px; top: 40px; width: 300px; padding: 14px 18px; border-radius: 14px; background: rgba(30,18,24,.75); box-shadow: 0 0 0 2px var(--brass); color: var(--cream); }
.stress b { font: 900 20px var(--ui); }
.stress i { display: block; height: 18px; border-radius: 9px; margin-top: 8px; background: rgba(255,255,255,.15); overflow: hidden; }
.stress u { display: block; height: 100%; width: 30%; transition: width .5s, background .5s; }
.answer { left: 60px; top: 150px; width: 400px; text-align: left !important; }
.answer h3 { font-size: 30px !important; }
.answer p { font-size: 22px !important; min-height: 4em; }
.asks { position: absolute; right: 40px; top: 120px; width: 420px; display: flex; flex-direction: column; gap: 14px; }
.ask { border: 0; border-radius: 14px; padding: 16px 18px; text-align: left; font: 800 21px var(--ui); background: linear-gradient(#fffaf0, #ecdcb8); box-shadow: 0 0 0 2px #8a6b3e, 0 4px 0 #8a6b3e; cursor: pointer; }
.ask:disabled { opacity: .5; }
.learned { font: 900 26px var(--head); color: var(--cream); text-shadow: 0 2px 4px #000; text-align: center; }
.tea { position: absolute; left: 60px; bottom: 40px; font-size: 22px; }

#guest { position: absolute; cursor: pointer; transform-origin: 50% 100%; }
#guest[hidden] { display: none; }
#guest img { display: block; height: 100%; filter: drop-shadow(0 12px 10px rgba(0,0,0,.45)); animation: breathe 3.8s ease-in-out .7s infinite; transform-origin: 50% 100%; }
#guest.hop img { animation: hopTalk .5s ease-out, breathe 3.8s .5s ease-in-out infinite; }
#guestSay { position: absolute; right: 55%; bottom: 92%; width: max-content; max-width: 230px; background: var(--cream); border-radius: 16px; padding: 10px 14px; font-weight: 800; font-size: 15px; line-height: 1.25;
  box-shadow: 0 0 0 2px #8a6b3e, 0 8px 16px rgba(0,0,0,.35); opacity: 0; transform: translateY(8px) scale(.9); transition: opacity .3s, transform .3s; pointer-events: none; }
#guestSay.show { opacity: 1; transform: none; }

.pz-stage.tall .suspect { left: 170px; bottom: auto; top: 330px; height: 560px; }
.pz-stage.tall .stress { left: 30px; top: 20px; width: 400px; }
.pz-stage.tall .answer { left: 30px; top: 110px; width: 760px; min-height: 200px; }
.pz-stage.tall .asks { left: 30px; right: auto; top: 910px; width: 760px; }
.pz-stage.tall .ask { font-size: 28px; padding: 20px 22px; }
.pz-stage.tall .tea { left: auto; right: 30px; top: 20px; bottom: auto; font-size: 26px; }
.recipe.big { width: 740px; padding: 50px 60px 44px; }
.recipe.big h3 { font-size: 52px; } .recipe.big ol { font-size: 46px; } .recipe.big p { font-size: 36px; } .recipe.big li i { width: 26px; height: 26px; }

/* ---- Case 2 mini-games ---- */
.gear-plate { position: absolute; border-radius: 22px; background: radial-gradient(circle at 40% 35%, #4b4036, #241c16); box-shadow: inset 0 0 0 5px rgba(217,164,65,.55), inset 0 0 60px rgba(0,0,0,.6), 0 14px 30px rgba(0,0,0,.5); }
.gear-plate::after { content: ""; position: absolute; inset: 14px; border-radius: 14px; background: repeating-radial-gradient(circle at 0 0, rgba(255,255,255,.025) 0 2px, transparent 2px 9px); }
.gear-tray { position: absolute; border-radius: 22px; background: url(assets/ui/ui_parchment.webp) center/100% 100%; box-shadow: 0 12px 26px rgba(0,0,0,.45); }
.gear { position: absolute; cursor: grab; touch-action: none; user-select: none; transition: transform .2s; }
.gear.drag { cursor: grabbing; transition: none; z-index: 9; }
.gear.fixed { cursor: default; filter: brightness(.82) saturate(.8); }
.gear.spin-cw { animation: spin var(--spin, 3s) linear infinite; }
.gear.spin-ccw { animation: spin var(--spin, 3s) linear infinite reverse; }
.gear.jam { animation: shakeX .45s; filter: sepia(1) hue-rotate(-30deg) saturate(3); }
@keyframes spin { to { rotate: 360deg; } }
.peg { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a0, #b07a2a 60%, #5a3a14); box-shadow: 0 0 0 6px rgba(255,220,140,.18), 0 0 18px rgba(255,210,120,.5); animation: pulse 1.6s infinite; }
.crank { position: absolute; width: 22px; height: 120px; margin: -110px 0 0 -11px; transform-origin: 50% 100%; border-radius: 11px; background: linear-gradient(90deg, #6b4a1c, #e2b456, #6b4a1c); box-shadow: 0 4px 8px rgba(0,0,0,.5); pointer-events: none; }
.crank::before { content: ""; position: absolute; left: -9px; top: -12px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8a3b2a, #4a170e); }
.crank.spin-cw { animation: spin 2.2s linear infinite; }
.gear-goal { position: absolute; transform: translateX(-50%); padding: 4px 16px; border-radius: 999px; font: 900 22px var(--ui); color: #fff7e0; background: #5b3a57; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.gear-goal.ok { background: #3e7a3a; box-shadow: 0 0 22px #ffd34d; }
.wax { position: absolute; filter: drop-shadow(0 12px 14px rgba(0,0,0,.5)); }
.keys { position: absolute; display: flex; flex-direction: column; gap: 12px; }
.keyopt { border: 0; border-radius: 16px; background: url(assets/ui/ui_parchment.webp) center/100% 100%; padding: 10px 26px; cursor: pointer; transition: transform .15s; height: 128px; display: flex; align-items: center; justify-content: center; }
.keyopt:hover { transform: translateX(-6px); }
.keyopt img { max-height: 104px; max-width: 100%; }
.keyopt.right { box-shadow: 0 0 0 5px #ffd34d, 0 0 30px #ffd34d; }
.keyopt.wrong { animation: shakeX .45s; }
.safe-in { position: absolute; inset: 40px 120px; border-radius: 10px; background: radial-gradient(circle at 50% 60%, #ffe39a, #9a6a20 35%, #1c120a 75%); box-shadow: inset 0 0 60px #000; }
.safe-door { position: absolute; inset: 0; background-size: cover; background-position: center; transform-origin: 14% 50%; transition: transform 1.4s cubic-bezier(.5,0,.3,1); border-radius: 8px; }
.safe-door.open { transform: perspective(1400px) rotateY(-78deg); }
.safe-door.shake { animation: shakeX .45s; }
.dial { position: absolute; width: 120px; display: flex; flex-direction: column; align-items: center; }
.dial b { width: 104px; height: 120px; display: grid; place-items: center; font: 900 78px var(--ui); color: #3a2410; border-radius: 16px;
  background: linear-gradient(#f6e1a6, #c99a45 45%, #f3d78f 55%, #a87526); box-shadow: inset 0 0 0 5px #6b4818, inset 0 10px 18px rgba(255,255,255,.4), 0 8px 16px rgba(0,0,0,.5); }
.dial b.roll { animation: roll .25s; }
@keyframes roll { from { transform: translateY(-12px); opacity: .4; } }
.dial.ok b { box-shadow: inset 0 0 0 5px #3e7a3a, 0 0 26px #ffd34d; }
.dial button { width: 72px; height: 54px; border: 0; cursor: pointer; background: none; position: relative; }
.dial button::after { content: ""; position: absolute; left: 50%; top: 50%; translate: -50% -50%; border: 22px solid transparent; }
.dial .up::after { border-bottom: 26px solid #ffd76a; border-top: 0; filter: drop-shadow(0 3px 2px rgba(0,0,0,.6)); }
.dial .dn::after { border-top: 26px solid #ffd76a; border-bottom: 0; filter: drop-shadow(0 3px 2px rgba(0,0,0,.6)); }
.dial small { margin-top: 4px; padding: 3px 14px; border-radius: 999px; background: rgba(40,25,15,.75); font: 900 20px var(--ui); color: #ffe7a8; }
.safe-go { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); font-size: 28px; }
.jcase { grid-column: 1 / -1; margin: 10px 0 2px; font: 900 20px var(--head); color: var(--plum-d); }
.gear-ghost { position: absolute; border-radius: 50%; border: 4px dashed rgba(255,215,130,.45); box-shadow: inset 0 0 24px rgba(255,200,100,.15); pointer-events: none; }
