/* 화면 틀 일관성(작업 D, 2026-11-15). 머리줄·무대 띠 위치, 태블릿 열 폭, 끝내기 카드, 뒤로 단추 모양을 한 곳에서 맞춘다. 다른 파일보다 뒤에 둔다. */

/* ① 오늘·모험·보물·끝내기: 머리줄은 위에서 10(+안전 영역)·높이 48, 그 아래 10 띄워 무대 띠가 늘 y 68에서 시작한다(폰·태블릿 같다) */
.app main.screen:is([data-screen="today"], [data-screen="adventure"], [data-screen="treasure"], [data-screen="closing"]) { padding-top: calc(10px + var(--sat)); }
.app main.screen:is([data-screen="adventure"], [data-screen="treasure"], [data-screen="closing"]) { gap: 10px; }
.app main.screen[data-screen="closing"] .closing-title { display: flex; align-items: center; min-height: 48px; }
/* 무대 띠 다음 칸들의 간격은 전과 같게(모험 8·보물 12·끝내기 12) */
.app main.screen[data-screen="adventure"] > .sband { margin-bottom: -2px; }
.app main.screen[data-screen="treasure"] > .sband { margin-bottom: 2px; }
.app main.screen[data-screen="closing"] > .sband { margin-bottom: 2px; }

/* ② 세로 태블릿(폭 700~999): 열 폭 값은 그대로(480). 아래 줄·숫자판의 어두운 사각이 본문(480-2×여백)보다 넓어 보이던 이음매를 없애고, 숫자판은 글 카드 바로 아래로 붙여 가운데 큰 빈 곳을 줄인다 */
@media (min-width: 700px) and (max-width: 999px) {
  .screen.learn > .learn-bar, .screen.learn .learn-input.has-pad { margin-inline: 0; padding-inline: 0; }
}
@media (min-width: 700px) and (max-width: 999px) and (min-height: 900px) {
  .screen.learn[data-screen="battle"] .learn-input.has-pad { position: static; margin-top: 8px; background: none; }
}

/* ③ 끝내기 '오늘 켠 불' 카드: 제목은 맨 위에 붙고, 남는 세로는 카드가 먹되 가로등 그림이 그 안에서 가운데로 커진다(빈 곳은 그림으로 채운다, 빈 세로 8% 이하) */
.screen.closing[data-v="h157"] [data-role="closing-lamps"] { flex: 1 1 auto; justify-content: flex-start; }
.screen.closing[data-v="h157"] .cl-lamps { flex: 1 1 auto; align-content: center; align-items: center; }
.screen.closing[data-v="h157"] .cl-lamp__fig { height: clamp(120px, 20dvh, 260px); width: auto; aspect-ratio: 64 / 120; }
@media (min-height: 900px) { .screen.closing[data-v="h157"] .cl-lamp__fig { height: clamp(220px, 30dvh, 340px); } }
.screen.closing[data-v="h157"] .cl-lamp__glow { top: -2%; width: 190%; max-width: 124px; height: auto; aspect-ratio: 1; }

/* ④ 뒤로 단추: 아이 화면은 사각 아이콘 한 모양(학습 틀과 같다). 보너스 놀이의 [그만할래요]도 같은 모양, 글은 스크린 리더용 */
.bonus-top [data-role="bonus-quit"] .ui-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bonus-top [data-role="bonus-quit"] { flex: none; width: 48px; min-width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; box-sizing: border-box; border-width: 4px !important; border-style: solid !important; border-color: transparent !important; border-radius: calc(var(--nx-r-s) + 4px) !important; background-clip: padding-box !important; }
/* 보너스 시작 칸: 무대 띠의 친구가 대신하므로 큰 반디는 감춘다(끝 칸은 그대로) */
.bonus-start .bonus-hero { display: none; }
/* 태블릿(폭 700 이상)은 띠 아래가 비므로 큰 반디를 다시 보인다(폰은 위 그대로) */
@media (min-width: 700px) {
  .bonus-start .bonus-hero { display: block; }
  /* 태블릿 보너스 시작: 큰 반디가 보이면 띠의 친구는 감춰 한 마리만(작업 D '한 마리만') */
  .bonus-area:has(> .bonus-start) > .sband .sband__friend { display: none; }
}
.bonus-area > .sband { margin-bottom: 8px; }

/* ⑤ 글 대비 4.5 이상: 잠긴 단원 줄은 줄 전체를 흐리게(opacity) 하지 않고 글 색만 낮춘다(점선 틀이 잠금을 보여 준다). 성장 일기 보조 글은 한 단계 밝게 */
.ul-item.is-locked { opacity: 1; }
.ul-item.is-locked, .ul-item.is-locked * { color: var(--off-ink) !important; }
.td-stage[data-state="later"] .td-stage__name, .td-stage[data-state="later"] .td-stage__what { color: var(--mute); }
.td-next__line, .td-stage__date, .td-stage[data-state="next"] .td-stage__what { color: var(--ink); }
.td-stage__date { color: var(--mute); }

/* ⑥ 풀이 화면: 금색은 주 단추·지금 할 것(말풍선 틀) 하나만. 이름표·답 칸·힌트 박스는 파랑·흰색 실선, 밑줄 링크는 흰색 */
.bt-ans__row.is-mine > .bt-ans__lbl { color: var(--mute); }
.bt-ans__row.is-mine .bt-ans__cell { border: 1.5px solid var(--gl-line, var(--line-strong)); }
.bt-hintline { border: 1px solid var(--gl-line, var(--line-strong)); }
.bt-hintline .ui-icon { color: var(--mute); }
.screen.learn .ui-btn--text { color: var(--ink); }

/* ⑦ 보호자 잠금: 그림은 어느 키에서나 PIN판 위, 작은 폰은 작게(96), 태블릿은 높이 상한 300 */
@media (max-height: 799px) { .g-gate__art { order: 0; flex: none; height: 96px; min-height: 0; max-height: none; } .g-gate > .g-link { order: 0; } }
/* 태블릿(높이 1000 이상)만 상한을 올려 아래 빈 곳을 그림이 채운다. 폰은 위 값 그대로 */
@media (min-height: 1000px) { .g-gate__art { max-height: min(54dvh, 700px); } }

/* ⑧ 끝내기 아래 줄: 상자가 없어 주 단추 하나뿐일 때도 늘 오른쪽(주 단추는 오른쪽·같은 자리) */
.screen.closing[data-v="h157"] .closing-bar:not(:has(.closing-bar__main)) { justify-content: flex-end; }
/* 키 작은 폰(높이 700 이하)에서 오늘 화면 칸 간격을 8로 줄여도 머리줄 아래 무대 띠는 다른 탭과 같은 자리(68) */
@media (max-height: 700px) { .app main.screen[data-screen="today"] > .today-head + .scene-hero { margin-top: 2px; } }
