/* Scene player (E-D27): picture-book art (apps/web/src/art.ts, inline SVG) in a visual-novel layout.
   Colours come from style.css; the illustrations keep their own fixed colours in both themes. */
.kicker { display: block; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.muted.small.center, .locked { display: flex; align-items: center; justify-content: center; gap: 6px; }
h1.with-ic { display: flex; align-items: center; gap: 8px; }
.card h2 { display: flex; align-items: center; gap: 6px; }

/* ── page header with Mia ── */
.hero { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.hero h1 { margin: 2px 0 0; }
.hero-av { width: 64px; height: 64px; flex: none; }
.pick { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 4px 0 6px; }
.vi { display: inline-block; width: 24px; height: 24px; flex: none; }
.chip .vi { width: 22px; height: 22px; margin: -3px 0; }

/* ── the task card: a paper ticket ── */
.ticket { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: #fffaf2; color: #3a2a1f; border: 2px solid #3a2a1f; border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; }
.ticket-h { width: 100%; font-size: 12px; letter-spacing: 1px; color: #b0552a; }
.ti { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.ti.done { text-decoration: line-through; text-decoration-thickness: 2px; color: #9a8572; }
.ticket.small { margin: 0; padding: 6px 9px 8px; gap: 2px 8px; max-width: 152px; border-width: 1.5px; border-radius: 3px; transform: rotate(2.5deg); box-shadow: 0 8px 16px -8px #0009; }
.ticket.small .ti { font-size: 12.5px; }
.ticket.small .vi { width: 17px; height: 17px; }

/* ── task-card screen: the shop as a picture ── */
.card-hero { position: relative; margin: -16px -16px 4px; }
.card-hero svg.shop { display: block; width: 100%; height: min(42vh, 330px); border-bottom: 2.5px solid var(--edge); }
.card-hero-title { position: absolute; left: 16px; bottom: -18px; background: var(--card); border: 2px solid var(--edge); border-radius: 12px; padding: 4px 14px 6px; box-shadow: 3px 3px 0 var(--edge); }
.card-hero-title h1 { margin: 0; font-size: 22px; }
.card-hero + .card { margin-top: 30px; }

/* ── the shop, visual-novel layout ── */
.vn { margin: -16px -16px 0; }
.vn-stage { position: relative; }
.vn-scene svg.shop { display: block; width: 100%; height: min(46vh, 400px); }
.vn-back { position: absolute; top: 10px; left: 10px; width: 40px; height: 40px; border-radius: 50%; background: #fffaf2; color: #3a2a1f; border: 2px solid #3a2a1f; display: grid; place-items: center; cursor: pointer; padding: 0; }
.vn-note { position: absolute; top: 10px; right: 10px; }
.menu-pick { position: absolute; left: 4%; top: 10%; width: 48%; display: grid; gap: 6px; background: #2f3b33; color: #f6f1e4; border: 3px solid #8a5a3a; border-radius: 8px; padding: 8px; box-shadow: 0 0 0 5px #e07a3f88; font-size: 13px; }
.menu-pick[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 6px; font: 700 14px/1.2 ui-monospace, Menlo, monospace; background: #ffffff14; color: #f6f1e4; border: 1.5px dashed #f6f1e499; border-radius: 6px; padding: 8px; cursor: pointer; text-align: left; }
.vn-bottom { position: relative; margin-top: -30px; padding: 0 12px calc(24px + env(safe-area-inset-bottom)); }
.vn-you { display: flex; justify-content: flex-end; }
.you-bubble { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; max-width: 82%; margin: 0 0 10px; padding: 6px 12px; background: var(--accent); color: #fff; border: 2px solid var(--edge); border-radius: 16px 16px 4px 16px; box-shadow: 2px 2px 0 var(--edge); position: relative; z-index: 1; }
.you-bubble .who { font-size: 11px; opacity: .85; }
.you-bubble .en { margin: 0; font-size: 17px; font-weight: 700; }
.pointed { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.vn-dialog { position: relative; background: var(--card); border: 2.5px solid var(--edge); border-radius: 18px; padding: 20px 16px 12px; box-shadow: 4px 4px 0 var(--edge); }
.vn-dialog .name { position: absolute; top: -14px; left: 14px; background: var(--accent); color: #fff; border: 2px solid var(--edge); border-radius: 999px; padding: 1px 12px; font-size: 13px; font-weight: 700; }
.vn-dialog .line { margin: 0; font-size: 27px; font-weight: 800; line-height: 1.2; }
.vn-dialog.slow .line { color: var(--muted); }
.vn-dialog .zh { color: var(--muted); font-size: 15px; margin-top: 4px; }
.vn-dialog .listen { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ctl-btn { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 13px; font-weight: 600; background: var(--chip); color: var(--fg); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.vn-tip:empty { display: none; }
.tip { display: flex; align-items: flex-start; gap: 8px; background: var(--tip); color: var(--fg); border: 2px dashed var(--tip-edge); border-radius: 12px; padding: 8px 10px; margin: 12px 0 0; font-size: 15px; }
.tip .ic { color: #d98a1f; margin-top: 3px; }

/* answers: say first, then sticker buttons */
.answers { display: grid; gap: 10px; margin-top: 14px; }
.answer { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; font: inherit; font-size: 19px; font-weight: 700; color: var(--fg); background: var(--card); border: 2px solid var(--edge); border-radius: 14px; padding: 12px 14px; box-shadow: 3px 3px 0 var(--edge); cursor: pointer; }
.answer .en { margin: 0; }
.answer:active:not([disabled]) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
.answer.told { background: var(--tip); border-color: #d98a1f; }
.answer.right { background: #e3f0e3; color: #2f5a3a; }
.answer.wrong { opacity: .45; text-decoration: line-through; box-shadow: none; }
.hint-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.say-first { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px dashed var(--line); border-radius: 14px; padding: 10px 12px; }
.say-first > span:nth-child(2) { flex: 1; }
.say-first .btn.small { margin: 0; }
.say-icon { width: 34px; height: 34px; border-radius: 50%; background: #6e9c7a; color: #fff; display: grid; place-items: center; flex: none; border: 2px solid var(--edge); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tools .chip { margin: 0; }

/* Mia talks while her line plays, and blinks */
.mia .m-open { opacity: 0; }
.talking .mia .m-open { animation: open .3s steps(1) infinite; }
.talking .mia .m-close { animation: close .3s steps(1) infinite; }
@keyframes open { 50% { opacity: 1; } }
@keyframes close { 50% { opacity: 0; } }
.char .eyes { transform-box: fill-box; transform-origin: center; animation: blink 5s infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .talking .mia .m-open, .talking .mia .m-close, .char .eyes { animation: none; } }

/* ── conversations (watch Tom, AI role-play) ── */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.chat > * { scroll-margin: 200px 0 280px; }
.chat-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-row.right { flex-direction: row-reverse; }
.chat-av { width: 38px; height: 38px; flex: none; }
.bubble { max-width: 80%; padding: 9px 12px; border: 2px solid var(--edge); border-radius: 16px; }
.bubble .en { margin: 0; font-size: 18px; font-weight: 700; }
.bubble .who { font-size: 11px; opacity: .75; }
.bubble .zh { font-size: 14px; opacity: .8; margin-top: 2px; }
.bubble.them { align-self: flex-start; background: var(--card); border-bottom-left-radius: 4px; box-shadow: 2px 2px 0 var(--edge); }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble.model { background: #6e9c7a; }
.bubble .ctl { margin-top: 6px; }
.scene-top { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0 10px; border-bottom: 2px solid var(--line); }
.dock { position: sticky; bottom: 0; z-index: 2; background: var(--bg); border-top: 2px solid var(--line); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); }

/* ── learn the frame ── */
.frame-row { display: grid; gap: 6px; padding: 12px 0; border-top: 1.5px dashed var(--line); }
.frame-row:first-child { border-top: 0; }
.frame-q { display: flex; align-items: center; gap: 8px; }
.frame-q .en { flex: 1; margin: 0; font-size: 19px; font-weight: 800; }
.mini-av { width: 30px; height: 30px; flex: none; }
.say-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.say-row .btn.audio { margin: 0; }
.answer-model { margin-top: 2px; }
.answer-model .en { font-size: 20px; font-weight: 800; color: var(--accent); }
.mini { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1.5px solid var(--line); background: var(--chip); color: var(--fg); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.en.big { font-size: 30px; font-weight: 800; }

/* ── result: the drink and a receipt ── */
.cup-wrap { text-align: center; }
.cup-art { width: 140px; height: 162px; }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
table.compare th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1.5px dashed var(--line); }
table.compare td { padding: 7px 4px; border-bottom: 1px dashed var(--line); }
table.compare tr.no td { color: var(--no); font-weight: 700; }
table.compare tr.ok td:last-child { color: var(--ok); font-weight: 700; }
.focus-row { padding: 10px 0; border-top: 1.5px dashed var(--line); }
.focus-row:first-of-type { border-top: 0; }
.focus-row .strong { font-size: 20px; font-weight: 800; }
.card.mission { background: var(--mission); }

/* ── record ── */
.due-banner { border-color: var(--edge); }
.rec-row { display: grid; gap: 6px; padding: 10px 0; border-top: 1.5px dashed var(--line); }
.rec-row:first-of-type { border-top: 0; }
.rec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-head .en { flex: 1; min-width: 10em; margin: 0; font-weight: 700; }
.badge { font-size: 12px; font-weight: 700; white-space: nowrap; border-radius: 999px; padding: 2px 9px; background: var(--chip); color: var(--muted); }
.badge.due { background: #fde3cf; color: #b85a26; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid currentColor; }
.dot .ic { width: 14px; height: 14px; }
.dot.ok { color: var(--ok); }
.dot.no { color: var(--no); }
.dot.help { color: #c98a1f; }
.chip.en { margin: 2px 4px 2px 0; }

/* ── drills ── */
.drill-q { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 8px; }
.drill-av { width: 56px; height: 56px; flex: none; margin-top: 6px; }
.drill-q .vn-dialog { flex: 1; }

/* ── AI role-play ── */
.rp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-order { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; margin-top: 8px; }
.rp-order .vi { width: 18px; height: 18px; }
.scene-top .ticket.small { transform: none; max-width: none; margin-top: 8px; box-shadow: none; }
.rp-form { display: flex; gap: 8px; margin: 6px 0; }
.rp-form .btn.small { margin: 0; }
.rp-input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 10px 12px; border: 2px solid var(--edge); border-radius: 12px; background: var(--card); color: var(--fg); }
.rp-status { min-height: 1.2em; }

/* ── 纠音: the pronunciation card ── */
.vn-pron:empty { display: none; }
.vn-pron { margin: -2px 0 12px; }
.pron { background: var(--card); border: 2px solid var(--edge); border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; box-shadow: 2px 2px 0 var(--edge); }
.focus-row .pron { box-shadow: none; border-width: 1.5px; margin-top: 6px; }
.pron-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; }
.pron-score { font-size: 22px; color: var(--accent); }
.pron-words { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 18px; font-weight: 700; }
.pw { border-bottom: 3px solid transparent; }
.pw.ok { border-color: var(--ok); }
.pw.weak { border-color: #d9a75a; color: #a8661c; }
.pw.mispronounced { border-color: var(--no); color: var(--no); }
.pw.missing { color: var(--muted); text-decoration: line-through; }
.pw.not_assessed { color: var(--muted); }
.pron .ctl { margin-top: 2px; }
.say-first.rec { border-color: var(--no); border-style: solid; }
.say-first.rec .say-icon { background: var(--no); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .say-first.rec .say-icon { animation: none; } }
