:root {
  --night: #141038;
  --night-2: #1d1748;
  --night-3: #2a2160;
  --ink: #0d0a26;
  --gold: #e2b35c;
  --gold-2: #f4cd2a;
  --velvet: #c8320f;
  --milk: #f6f1e6;
  --milk-2: rgba(246, 241, 230, .72);
  --milk-3: rgba(246, 241, 230, .46);
  --line: rgba(226, 179, 92, .28);
  --noun: #ffb35c;
  --verb: #7dd3ff;
  --adj: #ff8ad8;
  --num: #ffe27a;
  --loop: #7dff9a;
  --rule: #c9a4ff;
  --quote: #f6f1e6;
  --display: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --read: "Roboto Serif", Georgia, serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  --r: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--milk); }
body { font-family: var(--display); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--gold); }
[hidden] { display: none !important; }

#app { min-height: 100dvh; display: flex; flex-direction: column; background:
  radial-gradient(1200px 600px at 80% -10%, rgba(200, 50, 15, .16), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgba(226, 179, 92, .10), transparent 60%), var(--night); }

/* ---- top bar ---------------------------------------------------------------------------------- */
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: rgba(13, 10, 38, .7); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--milk); text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: .01em; }
.brand svg { width: 30px; height: 30px; }
.studio-name { flex: 1; font-weight: 700; color: var(--gold); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-name em { font-style: normal; color: var(--milk-3); font-weight: 500; margin-left: 6px; }
.tools { display: flex; gap: 6px; }
.tool { display: flex; align-items: center; gap: 5px; height: 36px; padding: 0 10px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255, 255, 255, .04); font-weight: 700; font-size: 14px; }
.tool svg { width: 18px; height: 18px; }
.tool:hover { background: rgba(226, 179, 92, .12); }
.tool b { color: var(--gold-2); }
#btnStickers svg { color: var(--gold-2); }
#btnSound.off { opacity: .55; }

/* ---- home ------------------------------------------------------------------------------------- */
.home { width: min(1180px, 100%); margin: 0 auto; padding: 18px 16px 30px; }
.hero-card { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); min-height: 330px; display: flex; align-items: flex-end; background: var(--night-2); }
#homeCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: relative; padding: 26px; max-width: 560px; background: linear-gradient(90deg, rgba(13, 10, 38, .92), rgba(13, 10, 38, .6) 70%, transparent); }
.hero-copy h1 { font-size: clamp(34px, 6vw, 56px); line-height: .98; margin: 0 0 12px; font-weight: 800; letter-spacing: -.01em; }
.hero-copy h1 em { color: var(--gold-2); font-style: normal; }
.hero-copy p { font-family: var(--read); font-size: 17px; line-height: 1.5; color: var(--milk-2); margin: 0 0 18px; }
.big-go { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px; border-radius: 10px; background: var(--gold-2); color: var(--ink); font-weight: 800; font-size: 20px; box-shadow: 0 5px 0 #b07d1c, 0 10px 30px rgba(244, 205, 42, .35); transition: transform .08s; }
.big-go svg { width: 22px; height: 22px; }
.big-go:active { transform: translateY(4px); box-shadow: 0 1px 0 #b07d1c; }
.pick { font-size: 22px; margin: 26px 2px 12px; color: var(--gold); font-weight: 800; }
.studios { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.studio-card { position: relative; text-align: left; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--night-2); min-height: 158px; padding: 0; display: flex; flex-direction: column; transition: transform .12s, border-color .12s; }
.studio-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.studio-card canvas { width: 100%; height: 96px; display: block; }
.studio-card .meta { padding: 10px 12px 12px; }
.studio-card h3 { margin: 0; font-size: 20px; font-weight: 800; }
.studio-card p { margin: 3px 0 0; font-family: var(--read); font-size: 13.5px; color: var(--milk-2); line-height: 1.35; }
.studio-card .stars { position: absolute; top: 8px; right: 10px; font-size: 13px; font-weight: 800; color: var(--gold-2); background: rgba(13, 10, 38, .7); padding: 2px 7px; border-radius: 6px; }
@media (max-width: 760px) {
  .hero-card { min-height: 590px; }
  .hero-copy { padding: 22px 18px; max-width: none; width: 100%; background: linear-gradient(180deg, rgba(13, 10, 38, 0), rgba(13, 10, 38, .94) 22%); padding-top: 46px; }
}
.studio-card .stars:empty { display: none; }
.home-foot { margin-top: 26px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--read); font-size: 15px; }

/* ---- studio layout ---------------------------------------------------------------------------- */
.studio { flex: none; display: grid; grid-template-columns: minmax(300px, 360px) 1fr; grid-template-areas: "story world"; grid-template-rows: minmax(0, 1fr); gap: 12px; padding: 12px; min-height: 0; height: calc(100dvh - 58px - 30px); }
.pane { min-height: 0; min-width: 0; }
.world-pane { grid-area: world; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-height: 0; }
.story-pane { grid-area: story; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.story-pane > .mic { position: sticky; bottom: 0; z-index: 2; }
.code-pane { display: none; }
@media (min-width: 1180px) {
  .studio { grid-template-columns: minmax(300px, 340px) 1fr minmax(330px, 400px); grid-template-areas: "story world code"; }
  .code-pane { display: flex; grid-area: code; min-height: 0; }
  .code-pane .code-wrap { flex: 1; }
  .world-pane .seg { display: none; }
}

.world-head { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; flex: none; }
.seg button { padding: 7px 12px; font-weight: 700; font-size: 14px; color: var(--milk-2); }
.seg button[aria-selected="true"] { background: var(--gold); color: var(--ink); }
.hud { flex: 1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.hud .pill { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r); background: rgba(13, 10, 38, .75); border: 1px solid var(--line); font-weight: 800; font-size: 16px; }
.hud .pill i { font-style: normal; font-size: 15px; }
.hud .pill.bump { animation: bump .35s; }
@keyframes bump { 30% { transform: scale(1.25); background: rgba(244, 205, 42, .3); } }

.world-wrap { position: relative; min-height: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--night-2); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .35); }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.banner h2 { margin: 0; font-size: clamp(38px, 8vw, 72px); font-weight: 800; color: var(--gold-2); text-shadow: 0 4px 0 #8a5a10, 0 0 40px rgba(244, 205, 42, .5); animation: slam .5s cubic-bezier(.2, 1.6, .4, 1); }
.banner p { margin: 6px 0 0; font-size: 18px; font-weight: 700; color: var(--milk); text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.banner.lose h2 { color: #ff8a8a; text-shadow: 0 4px 0 #7a1a10; }
@keyframes slam { 0% { transform: scale(2.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.pad { position: absolute; right: 10px; bottom: 10px; display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 4px; grid-template-areas: ". up ." "left action right" ". down ."; opacity: .82; }
.pad button { border-radius: 8px; background: rgba(13, 10, 38, .7); border: 1px solid var(--line); font-size: 18px; color: var(--milk); touch-action: none; user-select: none; -webkit-user-select: none; }
.pad button:active, .pad button.on { background: var(--gold); color: var(--ink); }
.pad [data-k=up] { grid-area: up; } .pad [data-k=left] { grid-area: left; } .pad [data-k=right] { grid-area: right; } .pad [data-k=down] { grid-area: down; } .pad [data-k=action] { grid-area: action; color: var(--gold-2); }
.pad.one { grid-template-columns: 84px; grid-template-rows: 84px; grid-template-areas: "action"; }
.pad.one button:not([data-k=action]) { display: none; }
.pad.one [data-k=action] { font-size: 15px; font-weight: 800; }
.pad.lr { grid-template-columns: repeat(3, 52px); grid-template-rows: 52px; grid-template-areas: "left action right"; }
.pad.lr [data-k=up], .pad.lr [data-k=down] { display: none; }

/* code */
.code-wrap { display: flex; flex-direction: column; min-height: 0; border-radius: 10px; border: 1px solid var(--line); background: #0b0920; overflow: hidden; }
.code-head { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid rgba(226, 179, 92, .16); font-size: 13px; color: var(--milk-3); font-weight: 700; }
.code-head .py { color: var(--ink); background: var(--gold); padding: 1px 7px; border-radius: 4px; font-weight: 800; }
.code { margin: 0; padding: 10px 0 18px; overflow: auto; flex: 1; font: 500 13.5px/1.62 var(--mono); color: #d9d4ee; tab-size: 4; }
.code .ln { display: block; padding: 0 12px 0 0; position: relative; white-space: pre; transition: background .25s; }
.code .ln::before { content: attr(data-n); display: inline-block; width: 34px; text-align: right; margin-right: 12px; color: rgba(246, 241, 230, .2); }
.code .ln.new { animation: newline 1.1s ease-out; }
@keyframes newline { 0% { background: rgba(125, 255, 154, .28); } 100% { background: transparent; } }
.code .ln.lit { background: rgba(244, 205, 42, .2); box-shadow: inset 3px 0 0 var(--gold-2); }
.code .ln.loop.lit { background: rgba(125, 255, 154, .2); box-shadow: inset 3px 0 0 var(--loop); }
.code .ln.rule.lit, .code .ln.effect.lit { background: rgba(201, 164, 255, .22); box-shadow: inset 3px 0 0 var(--rule); }
.code .ln.hover { background: rgba(255, 255, 255, .07); }
.code .badge { display: inline-block; margin-left: 10px; padding: 0 6px; border-radius: 4px; background: var(--loop); color: var(--ink); font-weight: 700; font-size: 12px; line-height: 18px; vertical-align: 1px; }
.code .badge.spin { animation: spin .4s; }
@keyframes spin { 40% { transform: scale(1.5) rotate(-8deg); } }
.code .k { color: #ff8ad8; font-weight: 700; } .code .s { color: #ffe27a; } .code .n { color: #7dd3ff; } .code .c { color: rgba(246, 241, 230, .38); font-style: italic; } .code .f { color: #7dff9a; } .code .m { color: #ffb35c; }

/* layout views on narrow screens */
@media (max-width: 1179px) {
  .world-pane[data-view="world"] .code-wrap { display: none; }
  .world-pane[data-view="code"] .world-wrap { display: none; }
  .world-pane[data-view="code"] { grid-template-rows: auto 1fr; }
  .world-pane[data-view="world"] { grid-template-rows: auto 1fr; }
  .world-pane[data-view="both"] { grid-template-rows: auto 1.9fr 1fr; }
}
@media (min-width: 1180px) { .world-pane { grid-template-rows: auto 1fr; } .world-pane > .code-wrap { display: none; } }

/* story */
.level { border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(226, 179, 92, .14), rgba(200, 50, 15, .08)); padding: 10px 12px; }
.level .row { display: flex; align-items: center; gap: 8px; }
.level .num { flex: none; width: 30px; height: 30px; border-radius: 7px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 17px; display: grid; place-items: center; }
.level .title { font-weight: 800; font-size: 18px; flex: 1; line-height: 1.1; }
.level .goal { margin: 7px 0 0; font-family: var(--read); font-size: 15px; line-height: 1.4; color: var(--milk); }
.level .goal b { color: var(--gold-2); font-family: var(--display); }
.level .bar2 { height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .35); margin-top: 8px; overflow: hidden; }
.level .bar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 4px; transition: width .4s; }
.level .done { color: var(--loop); }
.level .nav { display: flex; gap: 6px; }
.level .nav button { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); font-weight: 800; }
.level .next { margin-top: 9px; width: 100%; height: 44px; border-radius: 8px; background: var(--loop); color: var(--ink); font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 #2a9a4a; animation: breathe 1.4s infinite; }
@keyframes breathe { 50% { transform: scale(1.03); } }
.level .dots { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.level .dots button { width: 22px; height: 8px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.level .dots button.won { background: var(--gold); }
.level .dots button.on { outline: 2px solid var(--milk); outline-offset: 1px; }

.story-box { border-radius: 10px; border: 1px solid var(--line); background: rgba(13, 10, 38, .6); padding: 8px 10px 10px; flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.story-label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--milk-3); font-weight: 700; margin-bottom: 4px; }
.clear { font-size: 13px; color: var(--milk-3); text-decoration: underline; }
.story-field { position: relative; flex: 1; min-height: 70px; }
.story-back, #story { position: absolute; inset: 0; margin: 0; padding: 2px; font: 400 19px/1.55 var(--read); white-space: pre-wrap; word-wrap: break-word; overflow-y: auto; border: 0; letter-spacing: 0; }
.story-back { color: transparent; pointer-events: none; }
#story { background: transparent; color: var(--milk); resize: none; outline: none; caret-color: var(--gold-2); }
#story::placeholder { color: var(--milk-3); }
.story-back mark { color: transparent; border-radius: 3px; padding: 0; background: none; box-shadow: inset 0 -.22em 0 var(--c); }
.story-back mark.fresh { animation: glow 1s ease-out; }
@keyframes glow { 0% { background: var(--c); } 100% { background: transparent; } }
.story-back .noun { --c: rgba(255, 179, 92, .55); } .story-back .verb { --c: rgba(125, 211, 255, .55); } .story-back .adj { --c: rgba(255, 138, 216, .55); }
.story-back .num { --c: rgba(255, 226, 122, .6); } .story-back .loop { --c: rgba(125, 255, 154, .6); } .story-back .rule { --c: rgba(201, 164, 255, .6); } .story-back .quote { --c: rgba(246, 241, 230, .4); }
.story-back .interim { color: transparent; background: rgba(125, 211, 255, .12); }
.listening { display: flex; align-items: center; gap: 3px; margin-top: 6px; color: var(--verb); font-size: 14px; font-weight: 700; }
.listening i { width: 4px; height: 14px; background: var(--verb); border-radius: 2px; animation: eq .8s infinite; }
.listening i:nth-child(2) { animation-delay: .1s; } .listening i:nth-child(3) { animation-delay: .2s; } .listening i:nth-child(4) { animation-delay: .3s; } .listening i:nth-child(5) { animation-delay: .4s; }
.listening span { margin-left: 8px; }
@keyframes eq { 50% { transform: scaleY(.3); } }

.coach-label { font-size: 13px; color: var(--milk-3); font-weight: 700; margin: 0 2px 5px; }
.chips { display: flex; flex-direction: column; gap: 6px; }
.chip { text-align: left; border-radius: 9px; border: 1px solid rgba(125, 211, 255, .35); background: rgba(125, 211, 255, .07); padding: 8px 10px; transition: transform .1s, background .1s; }
.chip:hover { background: rgba(125, 211, 255, .15); }
.chip:active { transform: scale(.98); }
.chip .say { display: block; font: 600 16px/1.3 var(--read); color: var(--milk); }
.chip .say::before { content: "“"; color: var(--verb); } .chip .say::after { content: "”"; color: var(--verb); }
.chip .then { display: block; margin-top: 3px; font-size: 13.5px; color: var(--loop); font-weight: 700; }
.chip .then::before { content: "→ "; }
.chip.loop { border-color: rgba(125, 255, 154, .5); background: rgba(125, 255, 154, .08); }
.chip.or { border-style: dashed; }

.mic { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; border-radius: 12px; background: var(--velvet); color: var(--milk); font-weight: 800; font-size: 20px; box-shadow: 0 5px 0 #7a1a08, 0 10px 30px rgba(200, 50, 15, .35); user-select: none; -webkit-user-select: none; touch-action: manipulation; flex: none; }
.mic svg { width: 26px; height: 26px; }
.mic.on { background: #ff3b2f; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 5px 0 #7a1a08, 0 0 0 0 rgba(255, 59, 47, .6); } 50% { box-shadow: 0 5px 0 #7a1a08, 0 0 0 16px rgba(255, 59, 47, 0); } }

/* footer */
.foot { display: flex; justify-content: space-between; padding: 6px 14px calc(6px + var(--safe-b)); font-size: 12px; color: var(--milk-3); }
.foot a { color: var(--milk-3); }
.stamp { font-family: var(--mono); font-size: 11px; color: var(--milk-3); }

/* dialogs, toasts, stickers */
.dlg { border: 1px solid var(--gold); border-radius: 12px; background: var(--night-2); color: var(--milk); padding: 16px; width: min(560px, calc(100% - 24px)); }
.dlg::backdrop { background: rgba(5, 3, 18, .7); backdrop-filter: blur(4px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--gold-2); }
.x { font-size: 28px; line-height: 1; width: 36px; height: 36px; }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; max-height: 60vh; overflow: auto; }
.stk { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.stk .art { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: var(--milk); display: grid; place-items: center; font-size: 36px; box-shadow: 0 0 0 4px var(--gold), 0 6px 14px rgba(0, 0, 0, .4); transform: rotate(-6deg); }
.stk.locked .art { background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); filter: grayscale(1); opacity: .45; font-size: 0; }
.stk.locked .art::after { content: "?"; font-size: 28px; color: var(--milk-3); font-weight: 800; }
.stk b { display: block; margin-top: 8px; font-size: 13px; line-height: 1.15; }
.stk small { display: block; font-family: var(--read); font-size: 11px; color: var(--milk-3); margin-top: 2px; }
.share-sub { font-family: var(--read); color: var(--milk-2); }
.share-row { display: flex; gap: 8px; margin-top: 10px; }
.share-row input { flex: 1; min-width: 0; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--milk); padding: 0 10px; font: 500 15px var(--mono); }
.share-row button { height: 44px; padding: 0 16px; border-radius: 8px; background: var(--gold-2); color: var(--ink); font-weight: 800; }
.share-row .wide { flex: 1; background: var(--velvet); color: var(--milk); }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--milk); color: var(--ink); font-weight: 800; padding: 10px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: rise .3s; }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
.sticker-pop { position: fixed; inset: 0; display: grid; place-items: center; z-index: 60; pointer-events: none; }
.sticker-pop .card { text-align: center; animation: stick 2.6s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.sticker-pop .art { width: 140px; height: 140px; border-radius: 50%; background: var(--milk); display: grid; place-items: center; font-size: 84px; margin: 0 auto; box-shadow: 0 0 0 7px var(--gold), 0 20px 50px rgba(0, 0, 0, .55), 0 0 80px rgba(244, 205, 42, .6); }
.sticker-pop h3 { margin: 14px 0 0; font-size: 30px; font-weight: 800; color: var(--gold-2); text-shadow: 0 3px 0 #8a5a10; }
.sticker-pop p { margin: 4px 0 0; font-family: var(--read); font-size: 17px; color: var(--milk); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); max-width: 300px; }
@keyframes stick { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 15% { transform: scale(1.12) rotate(-6deg); opacity: 1; } 22% { transform: scale(1) rotate(-6deg); } 80% { transform: scale(1) rotate(-6deg); opacity: 1; } 100% { transform: scale(.4) translate(60vw, -60vh) rotate(20deg); opacity: 0; } }

/* play-only (shared link) */
.play { flex: none; display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 12px; height: calc(100dvh - 58px - 30px); }
.play .who { font-family: var(--read); font-size: 16px; color: var(--milk-2); }
.play .who b { color: var(--gold-2); font-family: var(--display); font-size: 20px; }
.play-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.play-actions button { height: 50px; padding: 0 18px; border-radius: 10px; font-weight: 800; font-size: 18px; }
.play-actions .back { background: var(--gold-2); color: var(--ink); box-shadow: 0 4px 0 #b07d1c; }
.play-actions .peek { border: 1px solid var(--line); }

/* phones */
@media (max-width: 760px) {
  .bar { padding: 8px 10px; gap: 8px; }
  .brand span { display: none; }
  .tool span { display: none; }
  .studio { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.25fr) auto; grid-template-areas: "world" "story"; padding: 8px; gap: 8px; height: calc(100dvh - 52px - 26px); }
  .story-pane { gap: 7px; }
  .level { padding: 8px 10px; }
  .level .goal { font-size: 14px; margin-top: 5px; }
  .story-box { min-height: 92px; flex: none; height: 104px; }
  .level.shared { display: flex; align-items: center; gap: 10px; }
  .level.shared .goal { display: none; }
  .level.shared .row { flex: 1; min-width: 0; }
  .level.shared .title { font-size: 16px; }
  .level.shared .next { width: auto; flex: none; margin: 0; height: 40px; padding: 0 14px; font-size: 16px; }
  .story-back, #story { font-size: 17px; }
  .chips { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 2px; }
  .chip { flex: none; width: 78%; scroll-snap-align: start; }
  .chip .say { font-size: 15px; }
  .mic { height: 56px; }
  .hud .pill { height: 28px; font-size: 14px; padding: 0 8px; }
  .seg button { padding: 6px 9px; font-size: 13px; }
  .code { font-size: 12px; }
  .code .ln::before { width: 22px; margin-right: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; } }
