/* Resource Han Rounded (SIL OFL), subset to the characters used in this prototype. */
@font-face { font-family: 'SIRound'; font-weight: 500; font-display: block; src: url('../assets/fonts/rhr-medium.woff') format('woff'), local('Resource Han Rounded CN Medium'); }
@font-face { font-family: 'SIRound'; font-weight: 700; font-display: block; src: url('../assets/fonts/rhr-bold.woff') format('woff'), local('Resource Han Rounded CN Bold'); }
@font-face { font-family: 'SIRound'; font-weight: 900; font-display: block; src: url('../assets/fonts/rhr-heavy.woff') format('woff'), local('Resource Han Rounded CN Heavy'); }
:root {
  --ink: #1B2A47;
  --sun: #FFC12E;
  --sun-deep: #FF9F1C;
  --orange: #F47B20;
  --meadow: #5DBF52;
  --mint: #C8F6E7;
  --blue: #1F6FE5;
  --fog: #BCC2CE;
  --purple: #8B4BE0;
  --paper: #FFFFFF;
  --manila: #F6E3B4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #10331F; overflow: hidden; }
body { font-family: 'SIRound', 'PingFang SC', 'Hiragino Sans GB', sans-serif; color: var(--ink); font-weight: 500; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, [tabindex]:focus-visible { outline: 6px solid var(--blue); outline-offset: 4px; }

#viewport { position: fixed; left: 0; right: 0; top: 44px; bottom: 0; }
#stage { position: absolute; width: 1920px; height: 1080px; left: 50%; top: 50%; transform-origin: 0 0; overflow: hidden; background: var(--mint); }
.screen { position: absolute; inset: 0; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-svg text { font-family: 'SIRound', sans-serif; font-weight: 700; }

/* ---------- motion helpers ---------- */
.drift { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translateX(60px); } }
.bob { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-14px); } }
.boss-glow { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .5; } }
.fog-puffs { animation: fog 6s ease-in-out infinite alternate; }
@keyframes fog { to { transform: translateX(10px); } }
.medallion { cursor: pointer; }
.medallion.locked { cursor: not-allowed; }
.medallion .ring { transition: stroke .15s; }
.medallion.current .ring { stroke: var(--orange); }
.medallion:not(.locked):hover .ring { stroke: var(--sun); }
.boss-orb { cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  height: 96px; padding: 0 48px; border-radius: 48px; font-size: 40px; color: #fff;
  background: var(--orange); border: 6px solid var(--ink); box-shadow: 0 10px 0 var(--ink);
  transition: transform .08s, box-shadow .08s; white-space: nowrap;
}
.btn:active { transform: translateY(8px); box-shadow: 0 2px 0 var(--ink); }
.btn svg { width: 44px; height: 44px; }
.btn.white { background: #fff; color: var(--ink); }
.btn.green { background: #3FAE5A; }
.btn.small { height: 72px; font-size: 32px; padding: 0 32px; box-shadow: 0 8px 0 var(--ink); }
.btn[disabled] { filter: grayscale(.8); opacity: .6; pointer-events: none; }
.round-btn {
  width: 92px; height: 92px; border-radius: 50%; background: #fff; border: 6px solid var(--ink);
  box-shadow: 0 8px 0 var(--ink); display: grid; place-items: center; transition: transform .08s, box-shadow .08s;
}
.round-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.round-btn svg { width: 46px; height: 46px; }

/* ---------- HUD ---------- */
.hud { position: absolute; left: 0; right: 0; top: 0; height: 130px; display: flex; align-items: center; gap: 24px; padding: 0 40px; pointer-events: none; z-index: 20; }
.hud > * { pointer-events: auto; }
.hud .spacer { flex: 1; }
.hud-title {
  font-size: 46px; color: #fff; padding: 10px 40px; border-radius: 40px; background: var(--ink);
  border: 5px solid #fff;
}
.pill { display: flex; align-items: center; gap: 12px; height: 76px; padding: 0 30px 0 18px; border-radius: 38px; background: #fff; border: 5px solid var(--ink); font-size: 38px; box-shadow: 0 6px 0 var(--ink); }
.pill svg { width: 50px; height: 50px; color: var(--sun); }
.pill.btnlike { cursor: pointer; }
.pill.btnlike svg { color: var(--blue); }

/* Level progress: the map's white road in miniature, no words. */
.steps { display: flex; align-items: center; background: rgba(27,42,71,.85); padding: 16px 28px; border-radius: 40px; border: 4px solid #fff; }
.steps .dot { width: 30px; height: 30px; border-radius: 50%; border: 5px solid #7D8AA6; flex: none; }
.steps .bar { width: 54px; height: 8px; background: #3D4A66; margin: 0 8px; border-radius: 4px; }
.steps .dot.done { background: #fff; border-color: #fff; }
.steps .bar.done { background: #fff; }
.steps .dot.now { width: 40px; height: 40px; border: 6px solid #fff; background: var(--sun); }
body.wf .steps .dot { border-color: #BBB; } body.wf .steps .dot.done { background: #999; border-color: #999; } body.wf .steps .dot.now { background: #333; border-color: #333; }
body.wf .steps .bar { background: #DDD; } body.wf .steps .bar.done { background: #999; }

/* ---------- Ring Fit style dialog banner ---------- */
.banner-wrap { position: absolute; left: 60px; right: 120px; bottom: 34px; height: 250px; z-index: 30; cursor: pointer; }
.banner-wrap.hidden { display: none; }
.banner-portrait {
  position: absolute; left: 0; bottom: 0; width: 250px; height: 250px; border-radius: 50%; background: #fff;
  border: 0; box-shadow: 0 0 0 8px rgba(255,255,255,.6); overflow: hidden; z-index: 2;
}
.banner-portrait::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: radial-gradient(ellipse at 50% 120%, var(--sun) 0 55%, #FFE07A 56% 70%, transparent 71%); }
.banner-portrait img { position: absolute; left: 50%; top: 14px; width: 210px; transform: translateX(-50%); }
.banner-name { position: absolute; left: 52px; bottom: -6px; z-index: 3; font-size: 46px; color: #fff; text-shadow: 0 0 0 var(--ink), 3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink); }
.banner {
  position: absolute; left: 200px; right: 0; bottom: 6px; height: 214px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.18) 0 18%, transparent 18% 40%, rgba(255,255,255,.12) 40% 52%, transparent 52% 76%, rgba(255,255,255,.14) 76% 84%, transparent 84%),
    linear-gradient(180deg, #FFD23F, var(--sun-deep));
  clip-path: polygon(4% 0, 100% 3%, 98% 100%, 0 96%, 3% 52%);
  padding: 44px 120px 0 170px;
}
.banner-text { font-size: 50px; line-height: 1.42; color: #fff; text-shadow: 0 3px 0 rgba(160,82,0,.55); max-width: 1180px; }
.banner-text b { font-weight: normal; color: var(--blue); text-shadow: 0 0 0 #fff, 2px 2px 0 #fff, -2px 2px 0 #fff, 2px -2px 0 #fff, -2px -2px 0 #fff; }
.banner-next { position: absolute; right: 48px; bottom: 26px; width: 62px; height: 62px; animation: paw 1.1s ease-in-out infinite; }
.banner-next svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 3px 0 rgba(160,82,0,.45)); }
@keyframes paw { 0%, 100% { transform: translateY(0) rotate(-8deg); } 45% { transform: translateY(-8px) rotate(-8deg); } 60% { transform: translateY(0) rotate(-8deg) scale(1.08, .92); } }
@keyframes nudge { 50% { transform: translateY(6px); } }
.banner-wrap.typing .banner-next { visibility: hidden; }

/* ---------- raccoon sprite ---------- */
.raccoon { position: absolute; background-repeat: no-repeat; pointer-events: none; }

/* ---------- title ---------- */
.title-logo { position: absolute; left: 50%; top: 170px; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.title-logo .l1 { font-size: 160px; line-height: 1; color: #fff; letter-spacing: 6px;
  text-shadow: 0 10px 0 var(--ink), 8px 0 0 var(--ink), -8px 0 0 var(--ink), 0 -8px 0 var(--ink), 6px 6px 0 var(--ink), -6px 6px 0 var(--ink), 6px -6px 0 var(--ink), -6px -6px 0 var(--ink), 0 22px 0 rgba(27,42,71,.25); }
.title-logo .l1 span { color: var(--sun); }
.title-logo .l2 { margin-top: 34px; display: inline-block; font-size: 44px; color: var(--ink); background: #fff; border: 6px solid var(--ink); border-radius: 50px; padding: 12px 44px; }
.title-cta { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); }
.title-cta .btn { height: 124px; font-size: 56px; padding: 0 80px; border-radius: 62px; }
.title-villain { position: absolute; right: 120px; top: 560px; width: 300px; animation: bob 2.4s ease-in-out infinite; }
.title-villain .say { position: absolute; left: -330px; top: 40px; background: #fff; border: 5px solid var(--ink); border-radius: 30px; padding: 16px 28px; font-size: 34px; white-space: nowrap; }
.title-villain .say::after { content: ''; position: absolute; right: -24px; top: 26px; border: 14px solid transparent; border-left-color: var(--ink); }

/* ---------- level info bar (non-modal) ---------- */
.modal-back { position: absolute; inset: 0; background: rgba(16,30,52,.55); z-index: 50; display: grid; place-items: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.card { background: #fff; border: 8px solid var(--ink); border-radius: 48px; box-shadow: 0 16px 0 var(--ink); position: relative; animation: pop .28s cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.level-bar { position: absolute; left: 60px; right: 60px; bottom: 34px; height: 236px; z-index: 30; display: flex; align-items: center; gap: 44px; padding: 0 56px;
  background: #fff; border: 8px solid var(--ink); border-radius: 48px; box-shadow: 0 12px 0 var(--ink); animation: slideup .25s cubic-bezier(.3,1.4,.6,1); }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
.lb-main { flex: 1; min-width: 0; }
.lb-title { display: flex; align-items: baseline; gap: 28px; font-size: 70px; font-weight: 700; line-height: 1.1; }
.lb-title .swap { font-size: 30px; font-weight: 500; color: var(--blue); text-decoration: underline; text-underline-offset: 8px; }
.lb-goals { display: flex; gap: 36px; margin-top: 22px; }
.goal { display: flex; align-items: center; gap: 10px; font-size: 32px; }
.goal svg { width: 46px; height: 46px; color: #E3E6EC; flex: none; }
.goal.got svg { color: var(--sun); }
.lb-reward { width: 150px; height: 150px; border-radius: 30px; background: #F2F4F8; border: 5px dashed #A9B2C3; display: grid; place-items: center; flex: none; }
.lb-reward img { width: 112px; filter: brightness(0) opacity(.22); }
.lb-go { height: 120px; font-size: 52px; padding: 0 64px; border-radius: 60px; }
.medallion.picked .ring { stroke: var(--sun) !important; }
body.wf .level-bar { border-width: 3px; }
body.wf .lb-reward { border-width: 3px; }
body.wf .medallion.picked circle { stroke: #000 !important; stroke-width: 8; }
.card-actions { display: flex; gap: 30px; }
.close-x { position: absolute; right: -30px; top: -30px; }

/* ---------- inner screens: shared ---------- */
.paper-bg { position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, #DFFBF1, #BDEFD9 70%); }
.paper-bg::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(27,42,71,.07) 2px, transparent 2px); background-size: 34px 34px; }

/* ---------- scene picker ---------- */
.scene-row { position: absolute; left: 0; right: 0; top: 230px; display: flex; justify-content: center; gap: 40px; }
.scene-card { width: 400px; border-radius: 34px; background: #fff; border: 7px solid var(--ink); box-shadow: 0 10px 0 var(--ink); overflow: hidden; transition: transform .15s; cursor: pointer; }
.scene-card .pic { height: 300px; position: relative; overflow: hidden; }
.scene-card .pic svg { width: 100%; height: 100%; display: block; }
.scene-card .nm { font-size: 44px; text-align: center; padding: 18px 0 22px; }
.scene-card.sel { transform: translateY(-16px) rotate(-1.5deg); border-color: var(--orange); box-shadow: 0 14px 0 var(--orange), 0 0 0 10px rgba(244,123,32,.25); }
.scene-card.mic-card .pic { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #FFF6DA 0 24px, #FFEFC2 24px 48px); }
.scene-card.mic-card .pic svg { width: 120px; height: 120px; color: var(--orange); }
.scene-preview { position: absolute; left: 50%; top: 680px; transform: translateX(-50%); display: flex; gap: 40px; align-items: center; }

/* ---------- collage ---------- */
.canvas {
  position: absolute; left: 30px; top: 136px; width: 1400px; height: 788px; border-radius: 34px; overflow: hidden;
  border: 8px solid var(--ink); background: #fff; box-shadow: 0 12px 0 var(--ink);
}
.canvas .bg, .shot .bg { position: absolute; inset: 0; }
.canvas .bg svg, .shot .bg svg { width: 100%; height: 100%; display: block; }
.placed { position: absolute; transform-origin: 50% 50%; touch-action: none; cursor: grab; }
.placed .inner { width: 100%; height: 100%; }
.placed img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }
.die { filter: drop-shadow(4px 0 0 #fff) drop-shadow(-4px 0 0 #fff) drop-shadow(0 4px 0 #fff) drop-shadow(0 -4px 0 #fff) drop-shadow(0 8px 6px rgba(27,42,71,.28)); }
.placed.sel .inner { outline: 5px dashed var(--orange); outline-offset: 10px; border-radius: 12px; }
.placed .name { position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%); font-size: 26px; background: var(--ink); color: #fff; padding: 2px 16px; border-radius: 18px; white-space: nowrap; opacity: 0; transition: opacity .25s; }
.placed.sel .name, .placed.fresh .name { opacity: 1; }
.placed .crown { position: absolute; left: 50%; top: -48px; transform: translateX(-50%); font-size: 24px; background: var(--sun); color: var(--ink); border: 4px solid var(--ink); padding: 0 12px; border-radius: 16px; white-space: nowrap; }

/* idle animations: stickers feel alive (meeting idea: “拖进去的小元素要有一点动态”) */
.a-hop { animation: hop 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0) scale(1); } 70% { transform: translateY(0) scale(1.06, .92); } 82% { transform: translateY(-18%) scale(.96, 1.05); } 92% { transform: translateY(0) scale(1.04, .96); } }
.a-sway { animation: sway 3s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sway { 50% { transform: rotate(4deg); } 0%, 100% { transform: rotate(-3deg); } }
.a-spin { animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.a-drift { animation: driftx 7s ease-in-out infinite alternate; }
@keyframes driftx { to { transform: translateX(14%); } }
.a-fly { animation: fly 2.4s ease-in-out infinite; }
@keyframes fly { 25% { transform: translate(4%, -8%) rotate(-4deg); } 75% { transform: translate(-4%, 4%) rotate(3deg); } }
.a-swim { animation: swim 2.8s ease-in-out infinite; }
@keyframes swim { 50% { transform: translateX(10%) rotate(5deg); } }
.a-float { animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8%) rotate(2deg); } }
.a-shimmer { animation: shimmer 2.4s ease-in-out infinite; }
@keyframes shimmer { 50% { filter: brightness(1.15) saturate(1.2); } }
.a-twinkle { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.82) rotate(12deg); filter: brightness(1.3); } }
.a-drive { animation: drive 1.2s ease-in-out infinite; }
@keyframes drive { 50% { transform: translateY(-2%) rotate(-1deg); } }
.a-rock { animation: rock 2.6s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes rock { 50% { transform: rotate(6deg); } 0%, 100% { transform: rotate(-5deg); } }

.sel-tools { position: absolute; z-index: 15; display: flex; gap: 10px; transform: translate(-50%, -100%); width: max-content; white-space: nowrap; }
.sel-tools button { flex: none; }
.sel-tools button { height: 64px; min-width: 64px; padding: 0 18px; border-radius: 32px; background: #fff; border: 5px solid var(--ink); font-size: 26px; box-shadow: 0 5px 0 var(--ink); }
.sel-tools button.warn { color: #D9363E; }
.sel-tools button.magic { background: var(--sun); }

.side { position: absolute; left: 1490px; right: 40px; top: 150px; bottom: 150px; }
.hint-bubble { position: relative; background: #fff; border: 6px solid var(--ink); border-radius: 34px; padding: 26px 30px; font-size: 34px; line-height: 1.45; min-height: 170px; }
.hint-bubble::after { content: ''; position: absolute; left: 70px; bottom: -30px; border: 16px solid transparent; border-top-color: var(--ink); }
.big-magic {
  width: 100%; margin-top: 300px; height: 150px; border-radius: 36px; background: var(--sun); border: 7px solid var(--ink); box-shadow: 0 10px 0 var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 40px; transition: transform .08s, box-shadow .08s;
}
.big-magic svg { width: 64px; height: 64px; }
.big-magic:active { transform: translateY(8px); box-shadow: 0 2px 0 var(--ink); }
.side .done-btn { position: absolute; left: 0; right: 0; bottom: -100px; width: 100%; }

.tray { position: absolute; left: 50px; right: 470px; bottom: 26px; height: 116px; display: flex; gap: 14px; align-items: center; }
.tray-tabs { display: flex; flex-direction: column; gap: 6px; }
.tray-tabs button { width: 108px; height: 34px; border-radius: 17px; font-size: 22px; background: rgba(255,255,255,.6); border: 3px solid var(--ink); }
.tray-tabs button.on { background: var(--ink); color: #fff; }
.tray-list { flex: 1; height: 116px; display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 4px; scrollbar-width: none; background: #fff; border: 5px solid var(--ink); border-radius: 26px; align-items: center; padding: 0 14px; }
.tray-list::-webkit-scrollbar { display: none; }
.tray-item { flex: none; width: 92px; height: 92px; border-radius: 20px; background: #F3F6F9; display: grid; place-items: center; position: relative; touch-action: none; cursor: grab; }
.tray-item img { width: 78px; height: 78px; object-fit: contain; pointer-events: none; }
.tray-item.locked { cursor: not-allowed; }
.tray-item.locked img { filter: brightness(0) opacity(.18); }
.tray-item.locked::after { content: ''; position: absolute; right: 6px; bottom: 6px; width: 22px; height: 18px; border-radius: 4px; background: #8E97A8; box-shadow: 0 -8px 0 -3px #fff, 0 -8px 0 0 #8E97A8; }
.tray-item.gen { background: #FFF2C6; }
.ghost { position: absolute; z-index: 100; pointer-events: none; width: 160px; height: 160px; transform: translate(-50%, -50%) scale(1.1); }
.ghost img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- voice modal (mock speech) ---------- */
.voice-card { width: 980px; padding: 56px 64px 60px; text-align: center; }
.voice-card h3 { font-size: 54px; font-weight: normal; margin: 0 0 14px; }
.voice-card .sub { font-size: 32px; color: #6B7790; }
.try { font-size: 28px; color: #6B7790; margin-top: 30px; }
.chips { display: flex; gap: 18px; justify-content: center; margin: 14px 0 10px; flex-wrap: wrap; }
.chip { font-size: 30px; padding: 12px 28px; border-radius: 30px; border: 4px solid var(--ink); background: #fff; }
.chip.on { background: var(--sun); }
.mic-big {
  width: 220px; height: 220px; border-radius: 50%; margin: 30px auto 10px; display: grid; place-items: center; color: #fff;
  background: var(--orange); border: 8px solid var(--ink); box-shadow: 0 12px 0 var(--ink); position: relative; transition: transform .08s, box-shadow .08s; touch-action: none;
}
.mic-big svg { width: 110px; height: 110px; }
.mic-big.listening { transform: translateY(8px); box-shadow: 0 4px 0 var(--ink); background: #E8434F; }
.mic-big.listening::before, .mic-big.listening::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 8px solid #E8434F; animation: ripple 1.2s ease-out infinite; }
.mic-big.listening::after { animation-delay: .6s; }
@keyframes ripple { to { transform: scale(1.6); opacity: 0; } }
.mic-label { font-size: 32px; color: #6B7790; }
.wave { display: flex; gap: 8px; justify-content: center; align-items: center; height: 70px; }
.wave i { width: 12px; border-radius: 6px; background: var(--orange); animation: wv .8s ease-in-out infinite; }
@keyframes wv { 0%, 100% { height: 14px; } 50% { height: 64px; } }
.heard { font-size: 40px; min-height: 60px; margin: 18px 0; }
.heard::before { content: '“'; } .heard::after { content: '”'; }
.heard:empty::before, .heard:empty::after { content: ''; }
.gen-box { width: 380px; height: 380px; margin: 20px auto; border-radius: 40px; border: 6px dashed #A9B2C3; position: relative; display: grid; place-items: center; overflow: hidden; background: #F7F9FB; }
.gen-box img { width: 300px; height: 300px; object-fit: contain; }
.gen-box.loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.9) 50%, transparent 70%); animation: sweep 1.1s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.gen-steps { display: flex; gap: 14px; justify-content: center; font-size: 28px; color: #A9B2C3; }
.gen-steps span.on { color: var(--ink); }
.pop-in { animation: popin .5s cubic-bezier(.3,1.7,.5,1); }
@keyframes popin { from { transform: scale(.2) rotate(-20deg); opacity: 0; } }

/* ---------- detective ---------- */
.det-raccoon-zone { position: absolute; left: 30px; bottom: 0; width: 520px; height: 900px; }
.speech {
  position: absolute; left: 40px; top: 160px; width: 560px; background: #fff; border: 7px solid var(--ink); border-radius: 40px;
  padding: 34px 38px; font-size: 42px; line-height: 1.45; min-height: 220px; z-index: 5;
}
.speech::after { content: ''; position: absolute; left: 150px; bottom: -40px; border: 20px solid transparent; border-top-color: var(--ink); }
.speech .who { position: absolute; top: -28px; left: 30px; background: var(--ink); color: #fff; font-size: 28px; padding: 4px 22px; border-radius: 20px; }
.det-pic { position: absolute; left: 640px; top: 160px; width: 760px; height: 428px; border-radius: 28px; border: 7px solid var(--ink); overflow: hidden; background: #fff; box-shadow: 0 10px 0 var(--ink); }
.det-pic .mini { position: absolute; inset: 0; }
.det-pic .placed { cursor: default; }
.placed.spot .inner { animation: spot 1s ease-in-out 3; }
@keyframes spot { 50% { filter: drop-shadow(0 0 0 var(--sun)) drop-shadow(0 0 18px #FFD23F) brightness(1.1); transform: scale(1.12); } }
.kid-said { position: absolute; left: 640px; top: 618px; width: 760px; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; max-height: 170px; overflow: hidden; justify-content: flex-end; }
.kid-said .b { background: var(--blue); color: #fff; font-size: 32px; padding: 14px 26px; border-radius: 28px 28px 6px 28px; max-width: 700px; animation: pop .25s; }
.kid-said .b.old { opacity: .5; }
.det-mic { position: absolute; left: 1020px; bottom: 40px; transform: translateX(-50%); text-align: center; }
.det-mic .mic-big { width: 170px; height: 170px; margin: 0 auto 8px; }
.det-mic .mic-big svg { width: 84px; height: 84px; }
.notebook {
  position: absolute; left: 1440px; right: 40px; top: 150px; bottom: 40px; background: var(--manila); border: 7px solid var(--ink); border-radius: 30px;
  box-shadow: 0 10px 0 var(--ink); padding: 34px 28px; background-image: repeating-linear-gradient(transparent 0 66px, rgba(160,110,40,.18) 66px 69px);
}
.notebook h4 { margin: 0 0 22px; font-weight: normal; font-size: 42px; text-align: center; }
.clue { position: relative; display: flex; gap: 16px; align-items: flex-start; padding: 16px 12px; border-radius: 20px; margin-bottom: 12px; min-height: 120px; }
.clue .ic { flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 4px dashed #B9A372; color: #C9B88E; }
.clue .ic svg { width: 36px; height: 36px; }
.clue .lb { font-size: 34px; color: #A08A5C; }
.clue .tx { font-size: 26px; line-height: 1.35; color: var(--ink); margin-top: 4px; }
.clue.now { background: rgba(255,255,255,.65); box-shadow: inset 0 0 0 4px var(--sun); }
.clue.got .ic { border: 4px solid var(--ink); background: var(--sun); color: var(--ink); }
.clue.got .lb { color: var(--ink); }
.clue .tx { padding-right: 76px; }
.stamp { position: absolute; right: 6px; top: 50%; margin-top: -36px; width: 72px; height: 72px; font-size: 24px !important; border-radius: 50%; border: 6px solid #E8434F; color: #E8434F; display: grid; place-items: center; font-size: 30px; transform: rotate(-14deg); animation: stamp .35s cubic-bezier(.2,1.8,.5,1); opacity: .85; background: rgba(255,255,255,.4); }
@keyframes stamp { from { transform: scale(2.4) rotate(-14deg); opacity: 0; } }
.fly-star { position: absolute; z-index: 60; width: 70px; height: 70px; color: var(--sun); pointer-events: none; transition: transform .7s cubic-bezier(.5,-0.3,.6,1), opacity .7s; }
.fly-star svg { width: 100%; height: 100%; filter: drop-shadow(0 0 0 var(--ink)); }
.case-closed { position: absolute; left: 1020px; top: 380px; transform: translate(-50%, -50%) rotate(-8deg); font-size: 110px; color: #E8434F; border: 12px solid #E8434F; border-radius: 30px; padding: 10px 50px; background: rgba(255,255,255,.85); z-index: 40; animation: stamp .45s cubic-bezier(.2,1.8,.5,1); white-space: nowrap; }

/* ---------- report ---------- */
.folder { position: absolute; left: 600px; top: 160px; width: 1060px; height: 760px; background: var(--manila); border: 8px solid var(--ink); border-radius: 18px 40px 40px 40px; box-shadow: 0 12px 0 var(--ink); padding: 70px 80px; }
.folder::before { content: '团团记下的故事'; position: absolute; left: -8px; top: -70px; height: 70px; padding: 0 44px; background: var(--manila); border: 8px solid var(--ink); border-bottom: 0; border-radius: 24px 24px 0 0; font-size: 38px; line-height: 64px; }
.folder .clip { position: absolute; right: 70px; top: 50px; width: 220px; height: 150px; border-radius: 14px; overflow: hidden; border: 5px solid #fff; transform: rotate(4deg); box-shadow: 0 6px 12px rgba(0,0,0,.2); }
.report-text { font-size: 48px; line-height: 2.0; max-width: 700px; }
.seg { cursor: pointer; border-radius: 10px; padding: 2px 0; transition: background .15s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.seg:hover { background: rgba(255,255,255,.7); }
.report-text.shake { animation: shake .4s; }
.seg.shake { animation: shake .4s; background: rgba(255,255,255,.7); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.seg.fixed s { color: #A08A5C; text-decoration-thickness: 5px; text-decoration-color: #E8434F; }
.seg.fixed ins { text-decoration: none; color: var(--blue); background: rgba(255,255,255,.75); border-radius: 10px; padding: 0 6px; }
.seg.added { color: var(--blue); }
.report-actions { position: absolute; left: 80px; bottom: 60px; display: flex; gap: 26px; }
.fix-pop { position: absolute; z-index: 45; width: 640px; padding: 34px; }
.fix-pop h5 { margin: 0 0 20px; font-weight: normal; font-size: 36px; }
.fix-pop .opt { display: block; width: 100%; text-align: left; font-size: 34px; padding: 18px 26px; margin-bottom: 14px; border-radius: 24px; border: 5px solid var(--ink); background: #fff; }
.fix-pop .opt:hover { background: #FFF2C6; }

/* ---------- studio (waiting) ---------- */
.studio-bg { position: absolute; inset: 0; background: #2B2140; }
.stage-floor { position: absolute; left: 80px; top: 170px; width: 1160px; height: 760px; border-radius: 30px; overflow: hidden; border: 8px solid var(--ink); background: linear-gradient(#3B2C6B, #5A3E8C); }
.stage-floor .boards { position: absolute; left: 0; right: 0; bottom: 0; height: 230px; background: repeating-linear-gradient(90deg, #B5733F 0 120px, #A6672F 120px 124px); }
.stage-floor .spot { position: absolute; top: -40px; width: 380px; height: 800px; background: radial-gradient(ellipse at 50% 0, rgba(255,240,180,.55), transparent 65%); transform-origin: 50% 0; animation: swing 4s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.curtain { position: absolute; top: 0; bottom: 0; width: 160px; background: repeating-linear-gradient(90deg, #C8323C 0 40px, #A72631 40px 80px); }
.curtain.l { left: 0; border-radius: 0 0 80px 0; } .curtain.r { right: 0; border-radius: 0 0 0 80px; }
.actor { position: absolute; bottom: 110px; width: 190px; height: 190px; transition: left 1.6s cubic-bezier(.4,0,.2,1); }
.actor img { width: 100%; height: 100%; object-fit: contain; }
.actor .ok { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); background: #3FAE5A; color: #fff; border: 4px solid #fff; font-size: 24px; padding: 2px 14px; border-radius: 16px; white-space: nowrap; }
.clapper { position: absolute; left: 90px; top: 30px; width: 220px; }
.clapper .top { height: 46px; background: repeating-linear-gradient(-45deg, var(--ink) 0 22px, #fff 22px 44px); border: 5px solid var(--ink); border-radius: 8px 8px 0 0; transform-origin: 0 100%; animation: clap 1.6s ease-in-out infinite; }
@keyframes clap { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-24deg); } }
.clapper .body { background: var(--ink); color: #fff; font-size: 30px; padding: 14px 18px; border-radius: 0 0 10px 10px; }
.reel-wrap { position: absolute; left: 80px; top: 50px; width: 1160px; display: flex; align-items: center; gap: 24px; color: #fff; }
.reel-wrap .phase { font-size: 40px; flex: none; width: 320px; }
.reel { flex: 1; height: 50px; border-radius: 25px; background: #1A1428; border: 5px solid #fff; overflow: hidden; position: relative; }
.reel i { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, var(--sun) 0 34px, #FFD866 34px 44px); border-radius: 20px; transition: width .4s linear; }
.task-card { position: absolute; left: 1290px; top: 170px; width: 590px; padding: 40px 40px 44px; }
.task-card .tt { font-size: 30px; color: var(--purple); margin-bottom: 10px; }
.task-card .q { font-size: 40px; line-height: 1.4; margin-bottom: 26px; }
.task-card .opt { display: block; width: 100%; text-align: left; font-size: 34px; padding: 18px 26px; margin-bottom: 14px; border-radius: 24px; border: 5px solid var(--ink); background: #fff; }
.task-card .opt.on { background: var(--sun); }
.task-card .done-note { font-size: 32px; color: #3FAE5A; }
.studio-go { position: absolute; left: 1290px; right: 40px; bottom: 60px; }
.studio-go .btn { width: 100%; }
.shooting { height: 96px; display: grid; place-items: center; font-size: 36px; color: #C9BEE6; border: 4px dashed #5E4F84; border-radius: 48px; }
body.wf .shooting { color: #666; border-color: #999; }

/* ---------- premiere ---------- */
.cinema { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, #3A2E58, #160F24 70%); }
.screen-frame { position: absolute; left: 250px; top: 60px; width: 1420px; height: 808px; border-radius: 24px; overflow: hidden; border: 10px solid #0B0812; box-shadow: 0 0 120px rgba(255,220,150,.25); background: #000; }
.shot { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.shot.on { opacity: 1; }
.shot .cam { position: absolute; inset: 0; }
.shot.on .cam { animation: kb 4.2s ease-out forwards; }
@keyframes kb { from { transform: scale(1.12) translate(2%, 1%); } to { transform: scale(1) translate(0, 0); } }
.shot .tint { position: absolute; inset: 0; mix-blend-mode: multiply; pointer-events: none; }
.shot .tod { position: absolute; left: 30px; top: 26px; font-size: 32px; color: #fff; background: rgba(0,0,0,.45); padding: 6px 22px; border-radius: 22px; }
.subtitle { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); max-width: 1200px; text-align: center; font-size: 46px; color: #fff; text-shadow: 0 3px 0 #000, 0 0 12px #000; z-index: 3; }
.subtitle .k { color: var(--sun); }
.walk { animation: walk 4s linear forwards; }
@keyframes walk { to { transform: translateX(-160px); } }
.film-strip { position: absolute; left: 250px; top: 896px; width: 1420px; display: flex; gap: 20px; }
.film-strip .fs { flex: 1; height: 120px; border-radius: 14px; border: 5px solid #3D3358; background: #241B38; color: #9C90BC; font-size: 28px; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; overflow: hidden; }
.film-strip .fs.on { border-color: var(--sun); color: #fff; }
.film-strip .fs .bar { position: absolute; left: 0; bottom: 0; height: 8px; background: var(--sun); width: 0; }
.film-strip .fs.on .bar { animation: fill 4.2s linear forwards; }
@keyframes fill { to { width: 100%; } }
.film-strip .fs.past .bar { width: 100%; }
.prem-side { position: absolute; right: 40px; top: 70px; width: 200px; display: flex; flex-direction: column; gap: 30px; align-items: center; }
.rec-dot { position: absolute; right: 30px; top: 26px; z-index: 4; color: #fff; font-size: 30px; display: flex; gap: 12px; align-items: center; background: rgba(0,0,0,.5); padding: 6px 20px; border-radius: 22px; }
.rec-dot i { width: 22px; height: 22px; border-radius: 50%; background: #E8434F; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.dub-panel { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(10,6,20,.6); }
.dub-panel .card { width: 900px; padding: 56px; text-align: center; }
.dub-panel h3 { font-size: 58px; font-weight: normal; margin: 0 0 16px; }
.dub-panel p { font-size: 32px; color: #6B7790; margin: 0 0 30px; line-height: 1.5; }

/* ---------- result ---------- */
.result-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, #FFE48A, #FFB627 55%, #F28C1C); overflow: hidden; }
.rays { position: absolute; left: 50%; top: 40%; width: 2600px; height: 2600px; margin: -1300px 0 0 -1300px; background: repeating-conic-gradient(rgba(255,255,255,.18) 0 8deg, transparent 8deg 20deg); animation: spin 60s linear infinite; }
.result-title { position: absolute; left: 0; right: 0; top: 70px; text-align: center; font-size: 110px; color: #fff; text-shadow: 0 8px 0 var(--ink), 6px 0 0 var(--ink), -6px 0 0 var(--ink), 0 -6px 0 var(--ink), 5px 5px 0 var(--ink), -5px 5px 0 var(--ink), 5px -5px 0 var(--ink), -5px -5px 0 var(--ink); }
.big-stars { position: absolute; left: 0; right: 0; top: 250px; display: flex; justify-content: center; gap: 60px; }
.big-star { width: 300px; text-align: center; }
.big-star svg { width: 220px; height: 220px; color: rgba(255,255,255,.45); filter: drop-shadow(0 8px 0 rgba(27,42,71,.35)); }
.big-star.on svg { color: #fff36b; animation: popin .6s cubic-bezier(.3,1.7,.5,1); }
.big-star .gt { font-size: 32px; color: var(--ink); background: rgba(255,255,255,.85); border-radius: 22px; padding: 8px 18px; display: inline-block; }
.chest-zone { position: absolute; left: 0; right: 0; top: 610px; display: flex; justify-content: center; align-items: center; gap: 80px; }
.chest { width: 260px; height: 220px; position: relative; cursor: pointer; animation: bob 1.6s ease-in-out infinite; }
.chest .lid { position: absolute; left: 0; right: 0; top: 0; height: 90px; background: #C8323C; border: 7px solid var(--ink); border-radius: 60px 60px 10px 10px; transform-origin: 0 100%; transition: transform .4s; }
.chest .base { position: absolute; left: 0; right: 0; bottom: 0; height: 140px; background: #E8434F; border: 7px solid var(--ink); border-radius: 10px 10px 24px 24px; }
.chest .lock { position: absolute; left: 50%; top: 66px; width: 54px; height: 60px; margin-left: -27px; background: var(--sun); border: 6px solid var(--ink); border-radius: 12px; z-index: 2; }
.chest.open { animation: none; }
.chest.open .lid { transform: rotate(-35deg) translate(-10px, -30px); }
.reward { width: 300px; height: 360px; border-radius: 34px; background: #fff; border: 8px solid var(--ink); box-shadow: 0 12px 0 var(--ink); text-align: center; padding: 26px; }
.reward img { width: 220px; height: 220px; object-fit: contain; }
.reward .new { display: inline-block; background: #E8434F; color: #fff; font-size: 28px; padding: 4px 18px; border-radius: 18px; }
.reward .nm { font-size: 40px; margin-top: 4px; }
.result-actions { position: absolute; left: 0; right: 0; bottom: 70px; display: flex; justify-content: center; gap: 40px; }
.toast { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 36px; padding: 18px 40px; border-radius: 40px; z-index: 90; animation: toast 2.4s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ---------- sticker book ---------- */
.book-bg { position: absolute; inset: 0; background: #3E8E86; }
.book { position: absolute; left: 100px; right: 100px; top: 150px; bottom: 60px; background: #FFFDF5; border: 8px solid var(--ink); border-radius: 30px; box-shadow: 0 14px 0 var(--ink); display: flex; }
.book .page { flex: 1; padding: 46px 50px; position: relative; }
.book .page + .page { border-left: 6px dashed #E1D7BD; }
.book h4 { font-weight: normal; font-size: 44px; margin: 0 0 8px; }
.book .count { font-size: 30px; color: #8E97A8; margin-bottom: 26px; }
.book-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.book-cell { aspect-ratio: 1; border-radius: 22px; background: #F3F0E6; display: grid; place-items: center; position: relative; }
.book-cell img { width: 78%; height: 78%; object-fit: contain; }
.book-cell.no img { filter: brightness(0) opacity(.14); }
.book-cell .q { position: absolute; font-size: 44px; color: #B5AE9C; }
.book-cell.newone { box-shadow: 0 0 0 6px var(--sun); }
.book-cell.newone::after { content: '新'; position: absolute; right: -8px; top: -8px; background: #E8434F; color: #fff; font-size: 22px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 3px solid #fff; }
.film-card { display: flex; gap: 24px; align-items: center; background: #fff; border: 5px solid var(--ink); border-radius: 24px; padding: 16px; margin-bottom: 18px; }
.film-card .th { width: 220px; height: 124px; border-radius: 14px; overflow: hidden; position: relative; flex: none; }
.film-card .th svg { width: 100%; height: 100%; }
.film-card .nm { font-size: 36px; }
.film-card .meta { font-size: 26px; color: #8E97A8; }
.empty-films { font-size: 32px; color: #8E97A8; line-height: 1.6; padding: 40px 10px; }

/* ---------- iris transition ---------- */
#iris { position: absolute; inset: 0; z-index: 200; background: var(--ink); pointer-events: none; clip-path: circle(0% at 50% 50%); }
#iris.cover { transition: clip-path .38s ease-in; clip-path: circle(80% at 50% 50%); pointer-events: auto; }
#iris.reveal { transition: clip-path .42s ease-out; clip-path: circle(0% at 50% 50%); }

/* ---------- team notes drawer (outside the 1920 canvas) ---------- */
#notes-toggle { font: inherit; color: #DCEFE3; border: 1px solid #3C6650; border-radius: 6px; padding: 6px 14px; }
#notes-toggle.on { background: #DCEFE3; color: #0D2618; }
#notes { position: fixed; right: 0; top: 44px; bottom: 0; width: 360px; z-index: 999; background: #FFFDF5; border-left: 3px solid var(--ink); padding: 22px; overflow-y: auto; transform: translateX(100%); transition: transform .25s; font: 15px/1.6 'PingFang SC', sans-serif; color: var(--ink); }
#notes.open { transform: none; }
#notes h3 { font-size: 20px; margin: 0 0 6px; }
#notes .goal { font-size: 15px; display: block; margin-bottom: 14px; color: #3B4A68; }
#notes h6 { font-size: 13px; color: #8E97A8; margin: 16px 0 6px; font-weight: 600; }
#notes ul { margin: 0; padding-left: 18px; }
#notes li { margin-bottom: 6px; }
#notes select { width: 100%; font-size: 14px; padding: 6px; margin-top: 18px; }
#notes .jump { margin-top: 26px; border-top: 1px dashed #C9C2AE; padding-top: 12px; }

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

/* weights */
.btn, .hud-title, .pill, .banner-text, .banner-name, .big-magic, .intro-card h2, .voice-card h3, .dub-panel h3, .notebook h4, .clue .lb,
.scene-card .nm, .case-closed, .stamp, .reward .nm, .book h4, .film-card .nm, .task-card .q, .fix-pop h5 { font-weight: 700; }
.title-logo .l1, .result-title { font-weight: 900; }

/* ---------- top-right controls (outside canvas) ---------- */
#toolbar { position: fixed; left: 0; right: 0; top: 0; height: 44px; z-index: 1001; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #0D2618; color: #DCEFE3; font: 14px/1 'PingFang SC', sans-serif; }
#toolbar .tb-name { font-weight: 600; }
#toolbar .tb-gap { flex: 1; }
#toolbar select { font: inherit; background: #1B3A28; color: #DCEFE3; border: 1px solid #3C6650; border-radius: 6px; padding: 4px 8px; }
#mode-switch { display: flex; border: 1px solid #3C6650; border-radius: 6px; overflow: hidden; }
#mode-switch button { padding: 6px 14px; color: #DCEFE3; font: inherit; }
#mode-switch button.on { background: #DCEFE3; color: #0D2618; }

/* =================================================================
   Wireframe mode: the same screens, art replaced by grey boxes.
   ================================================================= */
body.wf { --ink: #333; --sun: #E3E3E3; --sun-deep: #D6D6D6; --orange: #333; --meadow: #999; --mint: #F2F2F2; --blue: #333; --manila: #F7F7F7; --purple: #666; }
body.wf, body.wf #stage { font-family: 'PingFang SC', 'Helvetica Neue', sans-serif; }
body.wf #stage { background: #FAFAFA; }
body.wf #stage *, body.wf #stage *::before, body.wf #stage *::after { text-shadow: none !important; box-shadow: none !important; }
body.wf .map-svg text { font-family: 'PingFang SC', sans-serif; }
body.wf :is(.a-hop, .a-sway, .a-spin, .a-drift, .a-fly, .a-swim, .a-float, .a-shimmer, .a-twinkle, .a-drive, .a-rock, .drift, .bob, .boss-glow, .fog-puffs, .rays, .stage-floor .spot, .clapper .top, .chest, .title-villain, .banner-next, .walk, .shot.on .cam) { animation: none !important; }
body.wf .die { filter: none; }
body.wf .medallion:not(.locked):hover circle { fill: #F4F4F4; }
body.wf .btn, body.wf .round-btn, body.wf .pill, body.wf .card, body.wf .sel-tools button { border-width: 3px; }
body.wf .btn:active, body.wf .round-btn:active { transform: translateY(2px); }
body.wf .btn.green { background: #333; }
body.wf .hud-title { background: #fff; color: #222; border: 3px solid #333; }
body.wf .steps { background: #fff; border: 3px solid #333; }
body.wf .banner { background: #fff; clip-path: none; border: 3px solid #333; border-radius: 8px; padding: 36px 110px 0 90px; left: 260px; }
body.wf .banner-text { color: #222; font-size: 40px; font-weight: 500; }
body.wf .banner-text b { color: #000; text-decoration: underline; text-underline-offset: 6px; }
body.wf .banner-next svg { fill: #999; filter: none; }
body.wf .banner-portrait { border: 3px solid #333; border-radius: 8px; }
body.wf .banner-portrait::before { display: none; }
body.wf .banner-name { color: #222; font-size: 28px; left: 20px; bottom: 8px; z-index: 3; background: #fff; padding: 0 10px; }
body.wf .paper-bg { background: #FAFAFA; } body.wf .paper-bg::after { display: none; }
body.wf .title-logo .l1, body.wf .title-logo .l1 span { color: #222; font-size: 120px; }
body.wf .title-logo .l2 { border-width: 3px; }
body.wf .scene-card { border-width: 3px; } body.wf .scene-card.sel { transform: none; border: 6px solid #000; }
body.wf .canvas, body.wf .det-pic, body.wf .notebook, body.wf .folder, body.wf .stage-floor, body.wf .screen-frame, body.wf .book { border-width: 3px; }
body.wf .big-magic { background: #EEE; border-width: 3px; }
body.wf .hint-bubble, body.wf .speech { border-width: 3px; }
body.wf .tray-list { border-width: 3px; }
body.wf .placed.sel .inner { outline-color: #000; }
body.wf .placed .crown { background: #fff; }
body.wf .mic-big { background: #333; border-width: 3px; } body.wf .mic-big.listening { background: #000; }
body.wf .mic-big.listening::before, body.wf .mic-big.listening::after { border-color: #999; }
body.wf .wave i { background: #666; }
body.wf .notebook { background: #fff; background-image: none; }
body.wf .clue .ic { border-color: #BBB; color: #BBB; } body.wf .clue.got .ic { background: #333; color: #fff; border-color: #333; }
body.wf .clue .lb { color: #999; } body.wf .clue.got .lb { color: #222; }
body.wf .clue.now { box-shadow: inset 0 0 0 3px #333 !important; }
body.wf .stamp, body.wf .case-closed { border-color: #333; color: #333; }
body.wf .folder, body.wf .folder::before { background: #fff; border-width: 3px; }
body.wf .seg.fixed s { color: #999; text-decoration-color: #333; } body.wf .seg.fixed ins { color: #000; text-decoration: underline; }
body.wf .studio-bg, body.wf .cinema, body.wf .book-bg { background: #EDEDED; }
body.wf .stage-floor { background: #fff; } body.wf .stage-floor .boards { background: #E6E6E6; }
body.wf .stage-floor .spot { display: none; } body.wf .curtain { background: #DDD; }
body.wf .clapper .top { background: #CCC; } body.wf .clapper .body { background: #666; }
body.wf .reel-wrap { color: #222; } body.wf .reel { background: #fff; border-color: #333; } body.wf .reel i { background: #333; }
body.wf .task-card .tt { color: #666; } body.wf .task-card .done-note { color: #333; }
body.wf .skip { color: #666 !important; }
body.wf .screen-frame { border-color: #333; background: #fff; }
body.wf .subtitle { color: #222; background: rgba(255,255,255,.92); padding: 8px 24px; border: 2px solid #333; }
body.wf .subtitle .k { color: #000; text-decoration: underline; }
body.wf .shot .tod { background: #333; }
body.wf .shot .tint { display: none; }
body.wf .film-strip .fs { background: #fff; border: 3px solid #BBB; color: #777; }
body.wf .film-strip .fs.on { border-color: #000; color: #000; } body.wf .film-strip .fs .bar { background: #333; }
body.wf .prem-side div { color: #333 !important; }
body.wf .rec-dot i { background: #333; }
body.wf .result-bg { background: #FAFAFA; } body.wf .rays { display: none; }
body.wf .result-title { color: #222; font-size: 80px; }
body.wf .big-star svg { color: #E3E3E3; filter: none; } body.wf .big-star.on svg { color: #333; }
body.wf .big-star .gt { border: 2px solid #333; }
body.wf .chest .lid, body.wf .chest .base { background: #E3E3E3; border-width: 3px; } body.wf .chest .lock { background: #fff; border-width: 3px; }
body.wf .reward .new { background: #333; }
body.wf .book-cell { background: #F4F4F4; border: 2px solid #DDD; }
body.wf .book-cell.newone::after { background: #333; }
body.wf .intro-reward .slot { border-width: 3px; }
body.wf .tray-item.gen { background: #F4F4F4; }
body.wf .toast { background: #333; }
body.wf .fly-star { display: none; }
body.wf #iris { display: none; }

/* placeholder for animated characters */
.wf-ph { background: #F2F2F2 linear-gradient(to top right, transparent calc(50% - 1px), #D6D6D6 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(to top left, transparent calc(50% - 1px), #D6D6D6 calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); border: 2px solid #999; display: grid; place-items: center; text-align: center; }
.wf-ph span { background: #F2F2F2; color: #555; font-size: 24px; padding: 6px 10px; line-height: 1.4; font-family: 'PingFang SC', sans-serif; }

/* numbered annotation markers (Axure-style notes) */
.anno { position: absolute; z-index: 80; width: 46px; height: 46px; border-radius: 50%; background: #FFD400; border: 3px solid #333; color: #222; font: 700 24px/40px 'PingFang SC', sans-serif; text-align: center; cursor: help; }
#notes ol { margin: 0; padding-left: 20px; }
#notes ol li { margin-bottom: 6px; }

body:not(.notes-open) .anno { display: none; }

/* collage: right sticker panel + hint strip under the canvas */
.sticker-panel { position: absolute; left: 1470px; right: 30px; top: 136px; bottom: 28px; background: #fff; border: 7px solid var(--ink); border-radius: 34px; box-shadow: 0 10px 0 var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sp-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-tabs button { height: 54px; padding: 0 18px; border-radius: 27px; border: 4px solid var(--ink); font-size: 27px; font-weight: 700; background: #fff; }
.sp-tabs button.on { background: var(--ink); color: #fff; }
.sp-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: start; padding: 2px; scrollbar-width: thin; }
.sp-grid .tray-item { width: auto; height: auto; aspect-ratio: 1; border-radius: 22px; }
.sp-grid .tray-item img { position: absolute; left: 10%; top: 10%; width: 80%; height: 80%; }
.sticker-panel .big-magic { margin-top: 0; height: 104px; font-size: 30px; gap: 10px; border-width: 6px; white-space: nowrap; }
.sticker-panel .big-magic svg { width: 50px; height: 50px; }
.sticker-panel .done-btn { position: static; width: 100%; }
.tray-add { border: 4px dashed #C9B26A; background: #FFF6D8; color: #B8932B; }
.tray-add svg { width: 50%; height: 50%; }
.hint-strip { position: absolute; left: 30px; top: 950px; width: 1416px; height: 104px; display: flex; align-items: center; gap: 22px; }
.hs-face { position: relative; width: 104px; height: 104px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); overflow: hidden; flex: none; }
.hint-strip .hint-bubble { flex: 1; min-height: 0; height: 84px; display: flex; align-items: center; padding: 0 30px; font-size: 34px; border-width: 5px; border-radius: 42px; }
.hint-strip .hint-bubble::after { left: -26px; top: 26px; bottom: auto; border: 13px solid transparent; border-right-color: var(--ink); border-top-color: transparent; }
body.wf .sticker-panel, body.wf .hs-face, body.wf .sp-tabs button { border-width: 3px; }
body.wf .tray-add { border-color: #999; background: #F4F4F4; color: #666; }

.banner-wrap.last { cursor: default; }
.banner-wrap.last .banner-next { display: none; }
.hint-bubble.shake { animation: shake .4s; }

/* ---------- wallet ---------- */
.pill.wallet { cursor: pointer; padding: 0 26px 0 14px; }
.pill.wallet svg { width: 46px; height: 46px; }
.pill.bump { animation: bump .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 40% { transform: scale(1.18); } }
.cost { display: inline-flex; align-items: center; gap: 2px; margin-left: 12px; padding: 2px 12px 2px 4px; border-radius: 22px; background: rgba(255,255,255,.9); color: var(--ink); font-size: .7em; line-height: 1.2; vertical-align: middle; border: 3px solid var(--ink); }
.cost svg { width: 1.2em !important; height: 1.2em !important; }
.sel-tools .cost { font-size: 20px; margin-left: 6px; border-width: 2px; }
.voice-card h3 .cost { font-size: 26px; }
.small-card { width: 720px; padding: 50px 56px; text-align: center; }
.small-card h3 { font-size: 50px; margin: 10px 0 8px; }
.small-card p { font-size: 34px; color: #4B587A; margin: 0; }
.small-card .sd-icons svg { width: 90px; height: 90px; }
.small-card .btn svg { width: 40px; height: 40px; }
.wallet-pop { position: absolute; right: 40px; top: 128px; width: 760px; padding: 26px 30px; z-index: 60; }
.wp-row { display: flex; align-items: center; gap: 20px; padding: 16px 0; }
.wp-row + .wp-row { border-top: 3px dashed #E1E5EC; }
.wp-row > svg { width: 72px; height: 72px; flex: none; }
.wp-t { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wp-t b { font-size: 38px; } .wp-t span { font-size: 26px; color: #6B7790; }
.earn { position: absolute; left: 50%; top: 560px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; font-size: 52px; font-weight: 900; color: #fff; text-shadow: 0 4px 0 var(--ink); animation: earn 1.8s ease-in forwards; z-index: 20; }
.earn svg { width: 70px; height: 70px; }
@keyframes earn { 0% { opacity: 0; transform: translate(-50%, 30px) scale(.6); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; transform: translate(560px, -470px) scale(.6); } 100% { opacity: 0; transform: translate(620px, -480px) scale(.4); } }
body.wf .pill.wallet svg, body.wf .cost svg, body.wf .wp-row > svg, body.wf .small-card .sd-icons svg, body.wf .earn svg { filter: grayscale(1); }
body.wf .earn { color: #333; }

/* ---------- sticker book: fixed square cells ---------- */
.book .page { min-width: 0; overflow: hidden; }
.book-cell { aspect-ratio: auto; height: 0; padding-bottom: 100%; position: relative; }
.book-cell img { position: absolute; left: 11%; top: 11%; width: 78%; height: 78%; }
.book-cell .q { left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; }

.hud .steps { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.result-title { top: 140px; font-size: 96px; }
.big-stars { top: 290px; }
.big-star svg { width: 200px; height: 200px; }
.chest-zone { top: 620px; }
.reel-wrap { top: 150px; }
.stage-floor { top: 230px; height: 700px; }
.task-card { top: 150px; }
.screen-frame { top: 136px; height: 808px; }
.film-strip { top: 966px; }
.film-strip .fs { height: 84px; }
.prem-side { top: 136px; }
.book-cell.empty { background: none; border: 4px dashed #E1D7BD; }

/* ---------- wrapping rules: controls never wrap, prose avoids orphans ---------- */
button, .btn, .pill, .chip, .tag, .hud-title, .cost, .crown, .placed .name, .actor .ok, .rec-dot, .shot .tod, .goal, .lb-title, .gen-steps, .mic-label, .film-strip .fs, .speech .who, .new { white-space: nowrap; }
.fix-pop .opt, .task-card .opt { white-space: normal; }
.speech, .hint-bubble, .banner-text, .heard, .report-text, .task-card .q, .small-card p, .voice-card .sub, .dub-panel p, .subtitle, .kid-said .b, .wp-t span, .clue .tx, .title-logo .l2 { text-wrap: pretty; line-break: strict; }

/* studio without the side task: full-width stage */
.stage-floor { left: 80px; width: 1760px; top: 230px; height: 640px; }
.reel-wrap { width: 1760px; }
.studio-go { left: 660px; right: 660px; bottom: 50px; }
.mini .crown, .mini .name { display: none; }
.big-star { width: 360px; }
.big-star .gt { white-space: nowrap; }
.subtitle { text-wrap: balance; }
.result-title { top: 116px; }
.big-stars { top: 250px; }
.big-star svg { width: 170px; height: 170px; }
.chest-zone { top: 530px; height: 320px; }
.chest { width: 240px; height: 200px; }
.reward { width: 270px; height: 310px; padding: 20px; }
.reward img { width: 170px; height: 170px; }
.result-actions { bottom: 56px; }

/* ================= playable version ================= */
#debug-toggle { font: inherit; color: #DCEFE3; border: 1px solid #3C6650; border-radius: 6px; padding: 6px 14px; }
#debug-toggle.on { background: #E9D8FF; color: #2B1450; border-color: #E9D8FF; }

/* model is thinking */
.dots { display: inline-flex; gap: 8px; margin-right: 14px; vertical-align: middle; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--orange); animation: dotb 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotb { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-10px); opacity: 1; } }
.vc-think { font-size: 34px; color: #6B7790; margin: 26px 0 10px; }
.vc-reply { font-size: 34px; line-height: 1.45; color: var(--ink); background: #FFF2C6; border-radius: 26px; padding: 16px 28px; margin: 24px auto 0; max-width: 760px; text-wrap: pretty; }
.vc-line { font-size: 42px; line-height: 1.5; color: var(--blue); background: #EEF4FF; border-radius: 26px; padding: 20px 30px; margin: 10px auto 0; max-width: 780px; text-wrap: pretty; }
.voice-card .vc-mic { margin-top: 34px; }
.voice-card .sub { text-wrap: balance; }
.writing { font-size: 40px; color: #8A6E3A; padding-top: 30px; }
.mic-big.thinking { background: #FFE3A3; pointer-events: none; }
.mic-big.thinking svg { animation: dotb 1s ease-in-out infinite; }
.det-mic.wait .mic-big { filter: grayscale(.7); opacity: .6; }
.clue.skipped .lb { color: #B9A372; }
.clue.skipped .tx::before { content: '下次再讲'; color: #B9A372; }
.stamp.still { animation: none; }
.gem-earn { left: calc(50% + 200px); }
.gem-earn svg { width: 70px; height: 70px; }
button.film-card { width: 100%; text-align: left; font: inherit; }

/* dub: one line at a time */
.dub-bar { position: absolute; left: 250px; top: 896px; width: 1420px; height: 120px; z-index: 12; display: flex; align-items: center; gap: 30px; padding: 0 30px; background: #241B38; border: 5px solid var(--sun); border-radius: 18px; }
.dub-bar .db-line { flex: 1; color: #fff; font-size: 34px; white-space: nowrap; }
.dub-bar .btn[disabled] { visibility: hidden; }

/* debug: simulated kid voice (not part of the game UI) */
.synth-sheet { position: absolute; right: 30px; bottom: 30px; width: 640px; z-index: 120; background: #FBF7FF; border: 4px dashed #8B4BE0; border-radius: 22px; padding: 18px 22px 20px; font-family: 'PingFang SC', sans-serif; box-shadow: 0 10px 30px rgba(43,20,80,.35); }
.synth-sheet .ss-head { display: flex; align-items: baseline; gap: 14px; font-size: 24px; color: #4A2A80; }
.synth-sheet .ss-head span { font-size: 18px; color: #8B78AB; flex: 1; }
.synth-sheet .ss-x { font-size: 34px; line-height: 1; color: #8B78AB; }
.synth-sheet textarea { width: 100%; margin-top: 12px; font: 26px/1.4 'PingFang SC', sans-serif; padding: 12px 14px; border: 2px solid #CDB8F0; border-radius: 12px; resize: none; user-select: text; -webkit-user-select: text; }
.synth-sheet .ss-row { display: flex; gap: 12px; justify-content: flex-end; margin-top: 12px; }
.synth-sheet .ss-btn { font-size: 22px; padding: 10px 22px; border-radius: 12px; border: 2px solid #8B4BE0; color: #4A2A80; background: #fff; }
.synth-sheet .ss-btn.primary { background: #8B4BE0; color: #fff; }
.synth-sheet .ss-btn[disabled] { opacity: .45; }
.synth-sheet .ss-log { font-size: 18px; color: #6B5A8A; margin-top: 8px; line-height: 1.5; }
.synth-sheet .err { color: #C42B3A; }

#debug { position: fixed; right: 0; top: 44px; bottom: 0; width: 380px; z-index: 999; background: #FBF7FF; border-left: 3px solid #4A2A80; padding: 16px 18px 30px; overflow-y: auto; font: 14px/1.5 'PingFang SC', sans-serif; color: #2B1450; transform: translateX(100%); transition: transform .2s; user-select: text; -webkit-user-select: text; }
body.debug-open #debug { transform: none; }
#debug h3 { font-size: 18px; margin: 0 0 4px; }
#debug h6 { font-size: 12px; color: #8B78AB; margin: 14px 0 6px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
#debug label { display: block; margin: 3px 0; cursor: pointer; }
#debug label.sub { padding-left: 22px; color: #5B4A7A; }
#debug .row { display: flex; flex-wrap: wrap; gap: 6px; }
#debug button { font: 13px 'PingFang SC', sans-serif; padding: 4px 10px; border: 1px solid #B9A3E0; border-radius: 6px; background: #fff; color: #2B1450; }
#debug button.warn { color: #C42B3A; border-color: #E8A2AA; }
#debug button.mini { padding: 0 8px; font-size: 11px; }
#debug .kv { background: #fff; border: 1px solid #E4D8F6; border-radius: 8px; padding: 8px 10px; }
#debug .kv.dim { color: #A897C4; }
#debug .log { list-style: none; margin: 0; padding: 0; }
#debug .log li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 3px 0; border-bottom: 1px dashed #E4D8F6; }
#debug .log li small { grid-column: 1 / -1; color: #7B6A9A; word-break: break-all; }
#debug .log li.ok span::before { content: '● '; color: #2E9E5B; }
#debug .log li.bad span::before { content: '● '; color: #C42B3A; }
#debug .log li.run span::before { content: '● '; color: #E0A21B; }
#debug .log em { font-style: normal; color: #7B6A9A; }

.subtitle { width: max-content; max-width: 1200px; }
.synth-sheet { right: auto; left: 30px; }

/* story book: tasks of the current narrative type, grouped */
.notebook.compact { padding: 26px 22px; overflow: hidden; }
.notebook.compact h4 { margin-bottom: 10px; }
.notebook.compact .gh { font-size: 24px; color: #A08A5C; margin: 10px 4px 4px; display: flex; align-items: center; gap: 8px; }
.notebook.compact .grp.done .gh { color: var(--ink); }
.notebook.compact .grp.done .gh::after { content: '✓'; color: #3FAE5A; font-weight: 900; }
.notebook.compact .clue { min-height: 0; padding: 8px 10px; margin-bottom: 4px; gap: 12px; align-items: center; }
.notebook.compact .clue .ic { width: 50px; height: 50px; }
.notebook.compact .clue .ic svg { width: 28px; height: 28px; }
.notebook.compact .clue .cbody { min-width: 0; flex: 1; }
.notebook.compact .clue .lb { font-size: 28px; line-height: 1.2; }
.notebook.compact .clue .tx { font-size: 21px; line-height: 1.3; margin-top: 2px; padding-right: 58px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notebook.compact .clue .tx:empty { display: none; }
.notebook.compact .clue.opt:not(.got) .lb { color: #C2B08A; }
.notebook.compact .stamp { width: 54px; height: 54px; font-size: 18px !important; margin-top: -27px; border-width: 4px; }
.notebook.compact .clue.skipped .tx { display: block; }
.notebook.compact.dense .clue { padding: 4px 8px; margin-bottom: 2px; }
.notebook.compact.dense .clue .ic { width: 42px; height: 42px; }
.notebook.compact.dense .clue .lb { font-size: 25px; }
.notebook.compact.dense .clue .tx { -webkit-line-clamp: 1; font-size: 19px; }
.notebook.compact.dense .gh { margin: 4px 4px 2px; font-size: 21px; }

/* parent login (outside the game canvas) */
#login { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #2E6B47, #10331F 70%); font-family: 'SIRound', 'PingFang SC', sans-serif; }
#login .lg-card { width: min(440px, 92vw); background: #FFFDF5; border: 5px solid var(--ink); border-radius: 28px; box-shadow: 0 10px 0 var(--ink); padding: 34px 32px 30px; color: var(--ink); }
#login h2 { margin: 0; font-size: 34px; font-weight: 900; }
#login p { margin: 6px 0 22px; color: #5B6B88; font-size: 17px; }
#login label { display: block; font-size: 15px; color: #5B6B88; margin-bottom: 14px; flex: 1; }
#login input { display: block; width: 100%; margin-top: 6px; font: 500 20px 'SIRound', 'PingFang SC', sans-serif; padding: 12px 14px; border: 3px solid #C9D2E0; border-radius: 14px; background: #fff; color: var(--ink); user-select: text; -webkit-user-select: text; }
#login input:focus { outline: none; border-color: var(--blue); }
#login .lg-row { display: flex; gap: 12px; align-items: flex-end; }
#login .lg-send { flex: none; height: 52px; margin-bottom: 14px; padding: 0 16px; border-radius: 14px; border: 3px solid var(--ink); background: #fff; font-size: 16px; white-space: nowrap; }
#login .lg-send[disabled] { opacity: .5; }
#login .lg-msg { min-height: 22px; font-size: 15px; color: #3FAE5A; margin-bottom: 10px; }
#login .lg-msg.bad { color: #D9363E; }
#login .lg-go { width: 100%; height: 58px; border-radius: 29px; background: var(--orange); color: #fff; font-size: 22px; font-weight: 700; border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
#login .lg-go[disabled] { opacity: .6; }
body.no-tools #debug-toggle, body.no-tools #mode-switch, body.no-tools #debug { display: none; }
