/* 감성 시안 v4 반영(H79, 2026-11-05) — 밤하늘 바탕(H61 가) 위의 다듬기. 다른 스타일 파일 뒤에 읽는다(index.html).
   바탕은 앱 전체 남색 밤하늘 그대로이고, 시안의 '빛과 종이'·별지도 바탕은 넣지 않는다.
   ① 두꺼운 캐릭터 받침판·카드·키패드의 굵은 윤곽과 그림자를 줄이고, 캐릭터 뒤에는 얇은 광원.
   ② 오늘 화면: 머리 줄 + 진행 줄 + 반디 한 명 장면 + 퀘스트 카드 + 아래 주 단추(넓게, 글 왼쪽·화살표 오른쪽).
   ③ 학습·전투: 위 줄 'n / N 문제' + 진행 점, 칩 줄(도전 이름·하트), 키패드·확인 고정.
   ④ (차분형은 2026-11-13에 없앴다. 화면 모양은 한 벌)
   글자 대비 4.5:1, 누르는 것·그림 테두리 3:1 이상(tests/e2e/v4.e2e.test.mjs 가 잰다). 색은 tokens.css 이름만 쓴다. */

:root { --v4-edge: var(--line-strong); /* 누르는 것·그림 테두리 3:1 이상(바탕과 3.4~5.4:1). 굵기만 1px로 줄인다 */ --v4-card: color-mix(in srgb, var(--panel) 82%, var(--sky0)); }

/* ── 캐릭터: 받침판 대신 원화 + 얇은 광원. 어두운 캐릭터(깜빡이·책비)도 밤하늘에서 실루엣이 보이게 가는 밝은 테두리 빛 ── */
:root:not([data-theme="day"]) .char-pic__img { filter: drop-shadow(0 0 0.8px rgba(214, 224, 255, 0.85)) drop-shadow(0 0 6px rgba(169, 181, 227, 0.28)); }
/* 밝은 바탕(낮 모드 자리, 16절)에서는 밝은 테두리 빛 대신 옅은 그림자만 */
:root[data-theme="day"] .char-pic__img { filter: drop-shadow(0 2px 4px rgba(10, 17, 40, 0.18)); }
/* 친구 자세 그림(30판, styles/friend.css .fr-pose__img)도 같은 테두리 빛. 4단계 금빛 테두리(--fr-pose-gold)는 그 뒤에 겹친다 */
:root:not([data-theme="day"]) { --fr-pose-rim: drop-shadow(0 0 0.8px rgba(214, 224, 255, 0.85)) drop-shadow(0 0 6px rgba(169, 181, 227, 0.28)); }
:root[data-theme="day"] { --fr-pose-rim: drop-shadow(0 2px 4px rgba(10, 17, 40, 0.18)); }
.bt-stage .bt-mon::before, .bt-hero__mon::before, .hero-glow {
  content: ''; position: absolute; left: 50%; bottom: 4%; width: 92%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 196, 90, 0.16), rgba(169, 181, 227, 0.08) 60%, transparent 100%);
}
.bt-stage .bt-mon, .bt-hero__mon { isolation: isolate; }

/* ── 오늘 화면(v4) ── */
.screen[data-screen="today"][data-layout="v4"] { display: flex; flex-direction: column; gap: 10px; padding-top: calc(10px + var(--sat)); }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.today-head__text { min-width: 0; }
.today-name { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: 21px; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); } /* 머리글 문구를 뺀 자리: 이름표(칭호 · 별명)가 화면 제목(h1)이다 */
.today-head__tools { display: flex; gap: 8px; flex: none; }
.today-head .sound-btn { border-width: 1px; border-color: var(--v4-edge); border-radius: 14px; background: var(--v4-card); }
.daily-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.daily-count { flex: none; color: var(--mute); font-size: 14px; font-variant-numeric: tabular-nums; }
/* 남은 꼭 할 것의 예상 시간 + 미리 보기는 선택이라는 안내(H175·H177) */
.daily-note { margin: 2px 0 8px; color: var(--mute); font-size: 13px; line-height: 1.4; }
.daily-note[hidden] { display: none; }

/* 첫 장면: 반디 한 명·가로등 하나·등대. 테두리는 얇게 */
.scene-hero.scene-today { margin-top: 0; border-color: var(--v4-edge); border-radius: 22px; }
.hero-bandi { position: absolute; z-index: 5; height: auto; aspect-ratio: 1; }
.hero-bandi .fr { width: 100% !important; height: auto !important; position: relative; z-index: 1; }
.hero-glow { bottom: 0; width: 110%; }
.scene-today .hero-say { left: auto; right: 10px; top: 10px; max-width: 64%; text-align: right; }
.scene-today .hero-say .ui-bubble { text-align: left; font-size: 15px; padding: 7px 12px; }

/* 퀘스트 카드(v4): 그림 왼쪽 · 제목과 둘째 줄 · 오른쪽 상태(번호·'시작'·✓). 굵은 윤곽 대신 얇은 선 */
.screen[data-layout="v4"] .quest { padding: 0; border: 0; background: transparent; }
.section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 0 8px; }
.section-label h2 { margin: 0; font-size: 15px; font-weight: 700; }
.section-label span { color: var(--mute); font-size: 13px; }
.screen[data-layout="v4"] .parts { gap: 9px; }
.screen[data-layout="v4"] .part { min-height: 68px; padding: 7px 12px 7px 8px; gap: 10px; border-radius: 17px; border: 1px solid var(--v4-edge); background: var(--v4-card); }
.screen[data-layout="v4"] .part.is-next { border: 1.5px solid var(--lamp); background: color-mix(in srgb, var(--lamp) 7%, var(--v4-card)); }
.screen[data-layout="v4"] .part .label b { font-size: 17px; line-height: 1.35; }
.screen[data-layout="v4"] .part .label span { display: block; font-size: 14px; line-height: 1.45; margin-top: 2px; }
.screen[data-layout="v4"] .part .state { width: 34px; height: 34px; border: 1.5px dashed var(--line-strong); color: var(--mute); font-size: 15px; }
.screen[data-layout="v4"] .part .state.has-tag { width: auto; height: auto; border: 0; }
.screen[data-layout="v4"] .part .state .next-tag { margin: 0; padding: 4px 12px; font-size: 15px; }
.screen[data-layout="v4"] .part.done .state { border: 0; background: var(--lamp); color: var(--lamp-ink); }
.screen[data-layout="v4"] .part.done .state svg { width: 18px; height: 18px; }
.screen[data-layout="v4"] .part-pic { flex: none; width: 52px; height: 52px; display: grid; place-items: center; }
.screen[data-layout="v4"] .part-pic .char-pic { width: 52px; height: 52px; }
.screen[data-layout="v4"] .part-pic svg { max-width: 100%; max-height: 100%; }
/* 끝낸 카드의 켜진 등불(세로로 긴 40×80 그림): 52px 칸 높이에 맞춘다. 칸 밖(다음 카드·주간 등대 띠)으로 길게 나오지 않게(24판 #4) */
.screen[data-layout="v4"] .part-pic[data-art="lamp"] svg { width: 26px; height: 52px; max-width: none; max-height: none; }
.screen[data-layout="v4"] .resume-box { margin: 0; }
.screen[data-layout="v4"] .week { margin-top: 4px; }
.screen[data-layout="v4"] .week li svg { width: 26px; height: 44px; }

/* 아래 주 단추: 넓게, 글 왼쪽·화살표 오른쪽(v4). 자리는 탭 바로 위 고정 줄 그대로(ui.todayNext) */
.screen[data-layout="v4"] ~ * .today-next, .today-next { background: var(--sky0); border-top-color: color-mix(in srgb, var(--line) 60%, var(--sky0)); }
.today-next .ui-btn { flex: 1; justify-content: space-between; padding-inline: 20px; }

/* 보물 탭 위쪽 숫자 칩(오늘 화면에서 옮겨 옴) */
.treasure-top { justify-content: flex-end; }

/* ── 카드·키패드·단추: 굵은 윤곽·그림자 줄이기(밤하늘) ── */
.ui-key { box-shadow: none; border-width: 1px; }
.ui-card { box-shadow: none; }
.ui-btn--sub, .ui-btn--small { border-width: 1px; }

/* ── 학습·전투·섞기·보스(v4 배치) ── */
/* 위 줄: 뒤로 · 'n / N 문제'와 진행 점 · 작은 반디 */
.learn-top__mid { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.learn-count { font-size: 13px; font-weight: 700; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 칩 줄: 도전 이름 칩 · (가방) · 하트 n/N */
.bt-status.v4 { justify-content: space-between; }
.bt-chipline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bt-kind { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid var(--lamp); border-radius: 999px; color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap; }
.bt-status.v4 .bt-status__lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* 키패드와 확인은 화면 아래에 붙는다(내용이 짧아도 아래, 길면 읽기 칸이 스크롤) */
.learn-input.has-pad { margin-top: auto; }
/* 섞기(기억 잇기) 무대: 깜빡이가 문제 위 장면 칸에 선다 */
.mix-stage { position: relative; }

/* ── 결과(v4): 상대 resolved 그림 · 한 줄 제목 · 한 줄 설명 · 별 3칸 · 칩 · 보상 상자 줄 · 마을로 돌아가기 ── */
.bt-result-v4 .learn-title { text-align: center; }
.bt-result-v4 .bt-chips { justify-content: center; }

/* ── 움직임 줄이기(기기 설정 먼저, 앱 설정은 보호자 화면): 장면·카드의 끝없는 움직임 없음. 설정이 바뀌면 바로(html[data-motion], src/ui/feel.js) ── */
html[data-motion="reduce"] [data-rest] .tw, html[data-motion="reduce"] [data-rest] .wv,
html[data-motion="reduce"] [data-rest] .path-lamp .lp-on, html[data-motion="reduce"] [data-rest] .path-lamp .lp-sp,
html[data-motion="reduce"] [data-rest] .lh-beam, html[data-motion="reduce"] .village[data-rest] * { animation: none !important; }
html[data-motion="reduce"] .part, html[data-motion="reduce"] .ui-btn, html[data-motion="reduce"] .ui-key { transition: none !important; }

/* ── 작은 화면(높이 700 이하): 장면을 줄이고 읽기 칸만 스크롤, 키패드는 고정 ── */
@media (max-height: 700px) {
  .screen[data-screen="today"][data-layout="v4"] { gap: 8px; }
  .today-name { font-size: 19px; }
  .screen[data-layout="v4"] .part { min-height: 60px; padding-block: 5px; }
  .screen[data-layout="v4"] .part-pic, .screen[data-layout="v4"] .part-pic .char-pic { width: 44px; height: 44px; }
  .screen[data-layout="v4"] .part .label b { font-size: 15px; }
  .screen[data-layout="v4"] .part .label span { font-size: 13px; }
}

/* ── 칩 줄·이름표 세부(v4) ── */
.bt-status.v4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bt-hearts { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.bt-chipline .ui-btn { min-height: var(--touch); padding: 0 12px; font-size: 15px; }
.bt-chipline .ui-btn .ui-btn__label { white-space: nowrap; }

/* ── 끼운 아이템(27판): 가방 단추와 같은 줄에 그림 + 이름. 줄이 하나 늘지 않아 문제 칸이 밀리지 않는다 ──
   줄이 모자라면 아래 data-fit 단계로 덜 중요한 것부터 줄인다(360px 폰에서도 한 줄 안, 읽어 주는 글은 그대로) */
.bt-status.has-held { flex-wrap: nowrap; }
.bt-status.has-held .bt-chipline { flex: 1 1 auto; gap: 5px; }
.bt-status.has-held .bt-kind { flex: none; }
.bt-status.has-held .bt-chipline > .ui-btn { flex: none; }
.bt-status.has-held .bt-hearts { flex: none; }
/* 한 줄이 모자라면 battle-view fitStatusRow 가 data-fit 을 올린다: 1 도전 이름 칩 감춤 · 2 하트 옆 n/3 감춤 · 3 짧은 이름 · 4 이름 접음 · 5 줄바꿈 */
.bt-status[data-fit="1"] .bt-kind, .bt-status[data-fit="2"] .bt-kind, .bt-status[data-fit="3"] .bt-kind, .bt-status[data-fit="4"] .bt-kind, .bt-status[data-fit="5"] .bt-kind { display: none; }
.bt-status[data-fit="2"] .ui-energy__num, .bt-status[data-fit="3"] .ui-energy__num, .bt-status[data-fit="4"] .ui-energy__num, .bt-status[data-fit="5"] .ui-energy__num { display: none; }
.bt-status[data-fit="2"] .ui-energy, .bt-status[data-fit="3"] .ui-energy, .bt-status[data-fit="4"] .ui-energy, .bt-status[data-fit="5"] .ui-energy { padding: 4px 8px 4px 7px; }
.bt-status[data-fit="3"], .bt-status[data-fit="4"] { gap: 4px; }
.bt-held__name .n-short { display: none; }
.bt-status[data-fit="3"] .bt-held__name:has(.n-short) .n-full, .bt-status[data-fit="4"] .bt-held__name:has(.n-short) .n-full { display: none; }
.bt-status[data-fit="3"] .bt-held__name .n-short { display: inline; }
.bt-status[data-fit="4"] .bt-held__name, .bt-status[data-fit="5"] .bt-held__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bt-status[data-fit="4"] .bt-held__item, .bt-status[data-fit="5"] .bt-held__item { padding: 0 6px; }
.bt-status[data-fit="5"] { flex-wrap: wrap; }
.bt-held { display: inline-flex; align-items: center; gap: 5px; flex: none; min-width: 0; }
.bt-held__item { position: relative; display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 36px; padding: 0 7px 0 4px; border-radius: 999px; border: 1.5px solid var(--lamp); background: color-mix(in srgb, var(--lamp) 16%, var(--sky1)); color: var(--ink); font-size: 14px; font-weight: 700; white-space: nowrap; }
.bt-held__ico { display: grid; place-items: center; width: 22px; height: 22px; color: var(--lamp); }
.bt-held__ico .ui-icon { width: 20px; height: 20px; }
.bt-held__item.is-new { animation: bt-equip var(--bt-fx, 450ms) ease-out; }
.bt-held__ring { position: absolute; inset: -3px; border-radius: inherit; border: 2px solid var(--lamp); opacity: 0; pointer-events: none; animation: bt-equip-ring var(--bt-fx, 450ms) ease-out; } /* 진짜 칸으로 둔다: 움직임 줄이기 규칙(* 선택자)이 가짜 칸(::after)에는 닿지 않는다 */
@keyframes bt-equip { 0% { transform: scale(.55); opacity: .2; } 55% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bt-equip-ring { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

/* 방어막이 막은 때(27판): 하트 줄 위에 방어막 그림이 잠깐 덮였다 사라진다. 움직임 줄이기면 움직임 없이 그림만 잠깐(battle-view GUARD_MS 뒤에 지운다) */
.bt-hearts { position: relative; }
.bt-guard { position: absolute; inset: -2px; display: grid; place-items: center; border-radius: 999px; background: color-mix(in srgb, var(--sky0) 82%, transparent); border: 2px solid var(--lamp); color: var(--lamp); pointer-events: none; z-index: 2; animation: bt-guard var(--bt-fx, 450ms) ease-out forwards; }
.bt-guard .ui-icon { width: 28px; height: 28px; fill: color-mix(in srgb, var(--lamp) 38%, transparent); stroke-width: 2.2; }
@keyframes bt-guard { 0% { transform: scale(.6); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 75% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* 황금 열쇠로 나온 상자(27판): 상자 그림 모서리에 열쇠 그림 하나(글은 늘리지 않는다) */
.bt-chest__pic { position: relative; flex: none; width: 44px; height: 44px; }
/* 상자 그림(31판 H92, 팩 화풍 128 아이콘). 아래 탭 '보물'(선 아이콘)과 다른 그림 */
.bt-chest__img { display: block; flex: none; width: 44px; height: 44px; object-fit: contain; pointer-events: none; user-select: none; }
.bt-chest .bt-chest__pic > .ui-icon { width: 38px; height: 38px; }
.bt-chest .bt-chest__key { position: absolute; right: -11px; bottom: -8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--lamp); border: 2px solid var(--surface-2); color: var(--lamp-ink); }
.bt-chest .bt-chest__key .ui-icon { width: 18px; height: 18px; stroke-width: 2.2; color: var(--lamp-ink); }
.bt-chest.has-key { gap: 22px; }

/* 상자 확률 [?] 단추와 '별 3개면 …배예요.' 줄(28판): 단추는 누르는 곳 44px, 상자 줄 오른쪽 끝(상자 줄 글은 오른쪽 자리를 비워 둔다)이나 줄 옆에 둔다 */
.bt-odds-btn { flex: none; display: grid; place-items: center; width: var(--touch); height: var(--touch); min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 1.5px solid var(--lamp); background: var(--surface); color: var(--text); cursor: pointer; }
.bt-odds-btn .ui-icon { width: 24px; height: 24px; }
.bt-odds-btn:focus-visible { outline: 3px solid var(--lamp); outline-offset: 2px; }
.bt-chestwrap { position: relative; width: 100%; }
.bt-chestwrap > .bt-chest { padding-right: 62px; }
.bt-chestwrap > .bt-odds-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.bt-multiple { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; }
.bt-multiple__text { text-align: center; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.quest-chipline { margin: 2px 0 4px; }
.quest-chipline .bt-kind { gap: 6px; padding-left: 4px; }
.quest-chip__pic { display: inline-block; width: 30px; height: 30px; }
.bt-rival-name { position: relative; z-index: 2; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); text-align: center; }
.bt-stage.is-rival { min-height: 170px; }
.bt-stage.is-rival .bt-mon { width: 120px; height: 120px; }
.mix-stage { border: 1px solid var(--v4-edge); border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, var(--sky0), var(--sky1)); }
.mix-stage { flex: none; height: 168px; }
.mix-stage .fill-scene { position: absolute !important; inset: 0; max-height: none !important; flex: none !important; container-type: normal !important; }
.mix-stage .fill-box { border: 0 !important; border-radius: 0 !important; }
.mix-stage .bt-rival-name { position: absolute; left: 0; right: 0; bottom: 8px; }
/* 기억 잇기 끝 화면(24판 #2): 상대 그림 칸이 남는 자리만큼 자라서 아래가 비지 않는다 */
.learn-body:has(.fill-scene[data-scene="practiceEnd"]) .mix-stage { flex: 1 1 140px; height: auto; min-height: 118px; max-height: min(70dvh, 840px); }
/* 전투 결과 화면(토요일 점검 포함, 24판 #2): 상대 그림 칸(.bt-hero)이 남는 자리만큼 자라고 상대도 함께 커진다.
   25판 N1: 내용이 화면보다 길어도 제목과 별 줄이 아래 단추 띠 위, 첫 화면 안에 남도록 그림 칸의 '가장 작은 높이'를
   화면 높이 − (머리 + 제목 + 단추 띠 + 그림 칸 아래에 첫 화면에서 보여 줄 자리 --res-rx)로 둔다(작은 폰 130px, 큰 화면 800px까지).
   --res-rx: 진 화면·토요일 점검 160px, 별 칸 288px, 별 칸+상자 360px. 내용이 짧으면 1fr이 남는 자리를 채운다 */
.learn-body > .bt-res { --res-rx: 160px; --res-hero: max(130px, min(800px, calc(100dvh - 200px - var(--res-rx)))); }
.learn-body > .bt-res:has([data-role="stars"]) { --res-rx: 288px; }
.learn-body > .bt-res:has([data-role="stars"]):has(.bt-chest) { --res-rx: 360px; }
/* '별 3개면 …배예요.' 줄이 붙으면 그만큼 더 비워 둔다(줄 하나 + 상자가 없을 때만 줄 옆 [?]) */
.learn-body > .bt-res:has([data-role="stars"]):has([data-role="box-multiple"]) { --res-rx: 340px; }
.learn-body > .bt-res:has([data-role="stars"]):has(.bt-chest):has([data-role="box-multiple"]) { --res-rx: 396px; }
.learn-body > .bt-res { flex: 1 1 auto; align-content: stretch; grid-template-rows: minmax(var(--res-hero), 1fr); --hero-mon: clamp(90px, min(calc(100dvh * .28 - 30px), calc(var(--res-hero) - 40px)), 300px); }
.learn-body > .bt-res > .bt-hero { height: auto; min-height: 130px; align-items: center; padding-bottom: 0; }
.learn-body > .bt-res .bt-hero__mon, .learn-body > .bt-res .bt-spark { width: var(--hero-mon); height: var(--hero-mon); }
.learn-body > .bt-res .bt-spark { margin-left: calc(var(--hero-mon) / -2); bottom: auto; top: 50%; margin-top: calc(var(--hero-mon) / -2); }
.bt-res.bt-result-v4 { text-align: center; }
.bt-result-v4 .bt-hero { border-color: var(--v4-edge); }
.bt-result-v4 .ui-stars, .bt-result-v4 [data-role="stars"] { margin-inline: auto; }
.bt-result-v4 .bt-chest { justify-content: flex-start; text-align: left; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--lamp) 60%, var(--sky1)); }
.learn-bar .ui-btn--sub[data-role="hint"] { min-width: 108px; }
/* 위 줄(뒤로 · 'n / N 문제'+점 · 반디): 가운데 칸이 줄어들 수 있게 */
.screen.learn .learn-top { grid-template-columns: auto minmax(0, 1fr) auto; }
.screen.learn .learn-top__mid .ui-dots { justify-content: center; }
@media (max-height: 700px) {
  .screen.learn[data-screen="battle"]:is([data-phase="ask"], [data-phase="retry"]) { --bt-stage-h: 120px; --bt-mon: 66px; }
  .mix-stage { height: 118px; }
  .bt-stage.is-rival { min-height: 130px; }
  .bt-stage.is-rival .bt-mon { width: 88px; height: 88px; }
}
/* 도움 단추가 아래 줄로 옮겨 가 생긴 자리만큼 문제 푸는 화면의 장면 칸을 키운다(키 큰 폰) */
@media (min-height: 780px) and (min-width: 371px) {
  .screen.learn[data-screen="battle"]:is([data-phase="ask"], [data-phase="retry"]) { --bt-stage-h: 176px; --bt-mon: 100px; }
  .screen.learn[data-screen="battle"]:is([data-phase="ask"], [data-phase="retry"]) .bt-stage:has(.bt-tag) .bt-mon { width: 92px; height: 92px; }
}
.learn-bar [data-role="hint"] .ui-btn__label { white-space: nowrap; }
.bt-result-v4 .bt-stage.is-rival { align-self: stretch; width: 100%; }
.learn-center.bt-result-v4 { justify-items: stretch; }
.learn-center.bt-result-v4 > .learn-side { justify-self: center; }
/* 큰 화면(태블릿 820×1180, 24판 #15): 문제 카드와 아래 키패드 사이가 비지 않게 상대 그림 칸을 남는 자리만큼 키운다 */
@media (min-width: 700px) and (min-height: 1000px) {
  .screen.learn[data-screen="battle"]:not([data-phase="result"]) { --bt-stage-h: 200px; --bt-mon: 150px; }
  .screen.learn[data-screen="battle"]:not([data-phase="result"]) .bt-stage { flex: 1 1 auto; max-height: 560px; }
  .screen.learn[data-screen="practice"] .mix-stage { flex: 1 1 168px; max-height: 520px; }
}

/* ── 태블릿 배치(24판 태블릿 보완, 결정 H12·H40): 글 열을 넓히고, 남는 세로 자리는 그 칸이 하는 일을 보여 주는 장면이 채운다. 휴대폰(700px 미만)은 그대로 ── */
/* 칸 아래 이야기 아이 장면(.az-scene.is-grow, fill.js growScene): 그림은 아래에 그대로 두고 위는 별하늘. 짧은 카드의 첫 칸(휴대폰 포함)에서 아래가 비지 않게 남는 자리만큼 자란다 */
.learn-body > .az-scene.is-grow { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.az-scene.is-grow > .fill-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.az-scene.is-grow > svg:not(.fill-sky) { position: relative; flex: none; }
/* 없는 단원 화면: 반디와 안내는 가운데 한 덩이, 아래 남는 자리는 길 잃은 장면 */
.learn-center.learn-missing { flex: none; padding-block: var(--sp-3); }
.learn-missing__bandi { width: 112px; }
.learn-missing .learn-title { margin: 0; }
.learn-missing p { margin: 0; color: var(--text-mute); }

@media (min-width: 700px) {
  .app:has(.screen.learn:is([data-screen="cards"], [data-screen="hub"], [data-screen="summary"], [data-screen="learn-missing"], [data-screen="learn-soon"])),
  .app:has(.learn-body > .fill-scene[data-scene="practiceEnd"]) { max-width: 720px; }
}
@media (min-width: 700px) and (min-height: 900px) {
  /* 단원 첫 화면: 동네 띠가 남는 자리만큼 자란다(하늘이 더 보인다) */
  .fill-scene--fixed[data-scene="hubStrip"] { aspect-ratio: auto; flex: 1 1 300px; min-height: 300px; max-height: 500px; }
  .learn-missing__bandi { width: 150px; }
  /* 칸 아래 장면은 남는 자리만큼 자란다(그림은 아래, 위는 별하늘) */
  .learn-body > .az-scene.is-grow, .learn-body > .scene-fill.is-grow { min-height: 240px; }
  .learn-body > .scene-fill.is-grow { position: relative; display: flex; flex-direction: column; justify-content: flex-end; flex: 1 1 auto; height: auto; }
  .scene-fill.is-grow > .fill-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
  .scene-fill.is-grow > .scene-art { position: relative; inset: auto; flex: none; width: 100%; height: auto; }
  .fill-scene[data-scene="cardBuild"] { flex: 1 1 0; min-height: 0; max-height: min(56dvh, 760px); margin-bottom: var(--sp-2); }
  @container (max-height: 179px) { .fill-scene[data-scene="cardBuild"] .fill-box { display: none; } } /* 집이 보일 만큼 자리가 없으면 접는다 */
  /* 끝 화면: 상대 그림 칸이 남는 자리만큼 자라고 상대도 함께 커진다 */
  .learn-body > .learn-center.bt-result-v4 { align-content: stretch; grid-template-rows: minmax(200px, 1fr); --end-mon: clamp(140px, calc(100dvh * .3), 360px); }
  .learn-body > .learn-center.bt-result-v4 > .bt-stage.is-rival { max-height: min(62dvh, 760px); height: 100%; }
  .learn-body > .learn-center.bt-result-v4 > .bt-stage.is-rival .bt-mon { width: var(--end-mon); height: var(--end-mon); }
  /* 기억 잇기 끝: 상대 그림 칸이 남는 자리만큼(전투 무대 규칙보다 뒤에 두어 이긴다) */
  .screen.learn[data-screen="practice"] .learn-body:has(.fill-scene[data-scene="practiceEnd"]) .mix-stage { flex: 1 1 168px; max-height: min(66dvh, 820px); }
}
