/* 1分 探偵 — 「シネマ」(2026-11-14 리디자인): 거의 검정 바탕 · 금색 포인트 · 필름 그레인.
   이 파일은 옛 규칙(배치·동작 보정 R1~R6)을 그대로 두고, 색·글꼴 변수만 css/cinema.css 토큰으로 잇는다.
   새 모양은 cinema.css(공통 기본형) · cinema-<영역>.css 에. 휴대폰 세로(390x844) 기준. 데스크톱에선 가운데 9:16 틀. */

:root {
  /* 옛 이름 → 시네마 토큰(뒤의 값은 cinema.css 를 못 읽었을 때 대체값). 밝은 종이 → 어두운 바탕, 먹 → 밝은 글자 */
  --paper: var(--c-bg, #0b0a09);
  --paper-2: var(--c-surface, #1c1814);
  --paper-3: var(--c-bg2, #14110e);
  --card: var(--c-surface, #1c1814);
  --ink: var(--c-text, #f4ede1);
  --ink-2: var(--c-text2, #b9ad98);
  --muted: var(--c-text2, #b9ad98); /* 작은 글자 대비 4.5:1 이상(--c-text3 은 4:1 아래라 쓰지 않음) */
  --line: var(--c-line, rgba(244, 237, 225, .12));
  --line-2: var(--c-line2, rgba(255, 232, 196, .18));
  --film: var(--c-surface2, #24201a); /* 옛 「필름(진한 판)」 = 한 단 떠 있는 어두운 판 */
  --film-2: #2e2821;
  --red: var(--c-red, #e2483d);
  --red-ink: var(--c-red, #e2483d);
  --amber: var(--c-gold, #e8b54d);
  --ok: var(--c-green, #5fbf7a);
  --print: var(--c-ink-print, #2a2420); /* 일부러 밝게 둔 「물건」(폴라로이드·쪽지·다이얼 바퀴) 위 글자 */
  --accent: var(--case-accent, var(--c-gold, #e8b54d));
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.5);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --f-body: var(--f-ui, 'Zen Kaku Gothic New', 'Noto Sans KR', sans-serif);
  --f-head: var(--f-title, 'Shippori Mincho B1', 'Noto Serif KR', serif);
  --f-dot: var(--f-num, 'Oswald', 'Zen Kaku Gothic New', sans-serif); /* 옛 도트 글꼴 자리(머리말·시계·번호) → Oswald */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --grain: none; /* 옛 종이 결 무늬(배경 그림 자리). 그레인은 cinema.css 가 화면 전체에 한 장으로 */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  position: relative;
  width: 100%;
  max-width: calc(100dvh * 9 / 16);
  min-width: min(100%, 360px);
  height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.page-home .app { overflow-y: auto; overscroll-behavior: contain; display: block; }
@media (min-aspect-ratio: 9/16) and (min-width: 600px) {
  body { display: grid; place-items: center; background: #050505; }
  .app { height: min(100dvh, 960px); max-width: min(540px, calc(min(100dvh, 960px) * 9 / 16)); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06); }
}

/* ───────── 버튼 ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em; text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, opacity 160ms ease;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn .ico { width: 18px; height: 18px; }
.btn--primary { background: var(--c-gold, #e8b54d); color: var(--c-on-gold, #1d1405); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); } /* 금색 그라데이션은 cinema.css */
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn--danger { background: var(--red); color: #fff; }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn--wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover:not(:disabled) { filter: brightness(1.06); }
  .btn--ghost:hover { background: rgba(255, 255, 255, 0.06); }
}
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row .btn { flex: 1; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.icon-btn:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.1); }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease;
  position: relative;
}
.chip-btn::after { content: ''; position: absolute; inset: -5px -2px; } /* 터치 영역 44px */
.chip-btn:active { transform: scale(0.96); }
.chip-btn .ico { width: 16px; height: 16px; }
.chip-btn.is-on { background: var(--c-gold, #e8b54d); color: var(--c-on-gold, #1d1405); box-shadow: none; }
.chip-btn--ghost { background: transparent; box-shadow: none; padding: 0 8px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.seg-btn { min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font-size: 12.5px; font-weight: 700; color: var(--muted); transition: background-color 180ms ease, color 180ms ease; position: relative; }
.seg-btn::after { content: ''; position: absolute; inset: -5px 0; }
.seg-btn.is-on { background: var(--film); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-family: var(--f-dot); font-size: 11px; letter-spacing: 0.08em; line-height: 1; }
.badge--free { color: var(--ok); box-shadow: inset 0 0 0 1px rgba(74, 107, 71, 0.5); }
.badge--premium { color: var(--c-on-gold, #1d1405); background: linear-gradient(180deg, #f3d48b, #e2b356); box-shadow: inset 0 0 0 1px rgba(138, 90, 18, 0.35); }

/* ───────── 목록 (home) ───────── */
.home-head { padding: calc(var(--sat) + 10px) 18px 6px; }
.home-tools { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.home-hero { display: flex; align-items: center; gap: 18px; padding: 14px 4px 18px; }
.home-polaroid {
  flex: none; width: 92px; padding: 7px 7px 22px; background: #fbf7ee;
  box-shadow: var(--shadow-2); transform: rotate(-4deg); position: relative;
}
.home-polaroid .hana-face { display: block; width: 100%; height: auto; border-radius: 1px; background: #e9dcc3; }
.home-polaroid-cap { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-family: var(--f-dot); font-size: 10px; letter-spacing: 0.2em; color: var(--print); }
.home-kicker { margin: 0; font-family: var(--f-dot); font-size: 11px; letter-spacing: 0.3em; color: var(--red); }
.home-title { margin: 2px 0 4px; font-family: var(--f-head); font-weight: 800; font-size: clamp(22px, 7vw, 30px); white-space: nowrap; line-height: 1.2; letter-spacing: 0.02em; text-wrap: balance; }
.home-sub { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.home-count { margin: 6px 0 0; font-family: var(--f-dot); font-size: 12px; color: var(--muted); letter-spacing: 0.05em; }

.resume {
  margin: 0 16px 8px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 14px; text-decoration: none;
  background: var(--film); color: var(--ink);
  box-shadow: var(--shadow-2);
  transition: transform 140ms var(--ease-out);
}
.resume:active { transform: scale(0.98); }
.resume-k { font-family: var(--f-dot); font-size: 11px; letter-spacing: 0.2em; color: var(--amber); }
.resume-t { font-family: var(--f-head); font-weight: 700; font-size: 17px; }
.resume-m { font-family: var(--f-dot); font-size: 12px; opacity: 0.7; }
.resume .ico { grid-column: 2; grid-row: 1 / 4; color: var(--amber); }

.cs { padding: 18px 16px 6px; }
.cs-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 2px; font-family: var(--f-head); font-weight: 800; font-size: 19px; letter-spacing: 0.04em; }
.cs-head::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--red); transform: translateY(-3px); }
.cs-head > span:first-child { flex: 1; }
.cs-head-n { font-family: var(--f-dot); font-weight: 400; font-size: 12px; color: var(--muted); }
.cs-lead { margin: 0 4px 6px 22px; font-size: 13px; color: var(--ink-2); }
.cs-list { display: flex; flex-direction: column; }
.cs-row {
  position: relative; display: grid; grid-template-columns: 92px 1fr 20px; gap: 14px; align-items: center;
  padding: 14px 4px; text-decoration: none; color: inherit;
  border-bottom: 1px dashed var(--line-2);
  transition: transform 140ms var(--ease-out), opacity 160ms ease;
}
.cs-row:last-child { border-bottom: 0; }
a.cs-row:active { transform: scale(0.985); }
.cs-arrow { width: 18px; height: 18px; color: var(--muted); }
.cs-thumb {
  position: relative; width: 92px; aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--tone); border-radius: 2px;
  box-shadow: 0 0 0 4px var(--film), 0 0 0 5px rgba(0,0,0,.2), 0 8px 16px rgba(42, 36, 32, 0.18);
  margin: 4px;
  display: grid; place-items: center;
}
.cs-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cs-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.18), transparent 40%, rgba(0,0,0,.25)); pointer-events: none; }
.cs-glyph { font-family: var(--f-head); font-weight: 800; font-size: 40px; color: rgba(255, 248, 235, 0.92); text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.cs-no { position: absolute; left: 5px; bottom: 3px; z-index: 1; font-family: var(--f-dot); font-size: 10px; color: var(--amber); letter-spacing: 0.08em; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cs-lock { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; background: rgba(27, 23, 21, 0.55); color: #f3d48b; }
.cs-lock .ico { width: 26px; height: 26px; }
.cs-stamp {
  position: absolute; z-index: 1; right: -4px; top: 8px; padding: 2px 8px; transform: rotate(8deg);
  border: 2px solid #d4573f; border-radius: 4px; color: #b5402c; background: rgba(251, 247, 238, 0.9);
  font-family: var(--f-head); font-weight: 800; font-size: 11px; letter-spacing: 0.1em;
}
.cs-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cs-kicker { display: flex; align-items: center; gap: 6px; font-family: var(--f-dot); font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.cs-dot { opacity: 0.6; }
.type-mark { padding: 0 5px; border-radius: 3px; color: #fff; background: #4f453d; font-family: var(--f-body); font-weight: 700; font-size: 10.5px; letter-spacing: 0.08em; line-height: 17px; }
.type-mark--escape { background: #6b4a2e; }
.type-mark--deduce { background: #3d4f63; }
.cs-title { font-family: var(--f-head); font-weight: 800; font-size: 18px; line-height: 1.3; letter-spacing: 0.02em; }
.cs-tag { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.status { font-size: 12px; font-weight: 700; }
.status--done { color: var(--red-ink); }
.status--wip { color: var(--c-gold, #e8b54d); }
.status--prep { color: var(--muted); font-weight: 500; }
.status-sub { font-family: var(--f-dot); font-size: 11.5px; color: var(--muted); }
.cs-row--prep { opacity: 0.55; }
.cs-row--prep .cs-thumb { filter: grayscale(0.9) contrast(0.9); }
.cs-row--prep::after { content: ''; }
.cs-row.is-locked .cs-title { color: var(--ink-2); }
.cs--sample .cs-head::before { background: var(--muted); }
.cs--sample .cs-head { font-size: 15px; color: var(--ink-2); }
.home-foot { padding: 28px 20px calc(36px + var(--sab)); text-align: center; color: var(--muted); }
.home-foot p { margin: 0; font-family: var(--f-head); font-size: 15px; }
.home-foot-s { font-family: var(--f-dot) !important; font-size: 11px !important; letter-spacing: 0.1em; margin-top: 4px !important; }
/* 앱: 광고 개인정보 설정(UMP 동의 지역에서만 보임). 터치 44px */
.home-foot-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 6px; padding: 0 10px; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ───────── 플레이 공통 ───────── */
.bar {
  flex: none; display: flex; align-items: center; gap: 4px;
  padding: calc(var(--sat) + 4px) 6px 4px; min-height: 56px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
}
.bar > a.icon-btn { text-decoration: none; }
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; padding-left: 2px; }
.bar-kicker { font-family: var(--f-dot); font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-name { font-family: var(--f-head); font-weight: 800; font-size: 15px; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.clock { font-family: var(--f-dot); font-size: 14px; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 5px; background: var(--film); color: var(--c-gold-hi, #ffd98a); font-variant-numeric: tabular-nums; }
.hint-btn { margin-left: 4px; }
.play { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* 무대 */
.stage-area { position: relative; flex: 1; min-height: 0; display: flex; }
.stage-wrap { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; padding: 10px 12px; }
.film {
  position: relative; background: var(--film); border-radius: 3px;
  padding: 8px 20px 22px;
  width: fit-content;
  box-shadow: 0 10px 30px rgba(27, 23, 21, 0.28), 0 1px 0 rgba(255,255,255,.06) inset;
}
.film-edge { position: absolute; top: 8px; bottom: 22px; width: 20px; }
.film-edge--l { left: 0; }
.film-edge--r { right: 0; }
.film-edge::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: 4px; bottom: 4px;
  background: repeating-linear-gradient(180deg, transparent 0 7px, #e9ddc5 7px 15px, transparent 15px 22px);
  -webkit-mask: linear-gradient(#000, #000); opacity: 0.85; border-radius: 1px;
}
.film-mark { position: absolute; left: 22px; bottom: 3px; font-family: var(--f-dot); font-size: 10.5px; letter-spacing: 0.12em; color: var(--amber); opacity: 0.9; white-space: pre; }
.stage {
  position: relative; aspect-ratio: var(--ar, 0.75);
  width: min(calc(100cqw - 40px), calc((100cqh - 30px) * var(--ar, 0.75)));
  container-type: inline-size;
  overflow: hidden; background: #2a2420; border-radius: 1px;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.stage-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; -webkit-user-drag: none; }
.stage-ov { position: absolute; inset: 0; pointer-events: none; }
.ov { position: absolute; display: flex; align-items: center; font-size: calc(var(--fs, 4) * var(--fk, 1) * 1cqi); line-height: 1.15; white-space: pre-line; overflow: visible; }
.ov--v { align-items: flex-start; }
.ov-t { width: 100%; }
.ov svg { width: 100%; height: 100%; display: block; }
.stage-hot { position: absolute; inset: 0; }
.hs { position: absolute; padding: 0; border: 0; background: transparent; border-radius: 6px; min-width: 0; }
.hs--round { border-radius: 50%; }
.hs:focus-visible { outline: 2px dashed var(--amber); outline-offset: 0; }
.hs--debug { outline: 2px dashed rgba(255, 70, 70, 0.95); background: rgba(255, 70, 70, 0.14); }
.hs-dbg { position: absolute; left: 2px; top: 1px; font: 10px/1.2 var(--f-dot); color: #fff; background: rgba(200, 30, 30, 0.85); padding: 0 3px; border-radius: 2px; pointer-events: none; }
.ripple { position: absolute; width: 64px; height: 64px; border-radius: 50%; pointer-events: none; border: 2px solid rgba(255, 246, 228, 0.9); box-shadow: 0 0 12px rgba(255, 246, 228, 0.4); }
.mark {
  position: absolute; width: 22px; height: 22px; transform: translate(-50%, -50%); pointer-events: none;
  border-radius: 50%; background: rgba(251, 247, 238, 0.92); box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: grid; place-items: center;
}
.mark::before { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: translateY(-1px) rotate(-45deg); }

/* 말풍선 */
.bubble {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 3;
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--c-glass-solid, rgba(22, 18, 14, .94)); color: var(--ink); box-shadow: var(--shadow-2);
  border: 1px solid var(--c-glass-line, rgba(255, 226, 180, .16));
  cursor: pointer;
}
.bubble.is-on { display: flex; }
.bubble-face { width: 36px; height: 36px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 217, 138, .55); }
.bubble-text { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.6; white-space: pre-line; }
.bubble.is-narr .bubble-text { font-family: var(--f-head); font-weight: 500; }
.bubble-more { align-self: flex-end; color: var(--red); font-size: 13px; animation: nudge 1.1s var(--ease-in-out) 4; } /* PERF 11/30: infinite 금지(정지 화면 상시 프레임) */
@keyframes nudge { 50% { transform: translateX(3px); } }
.catcher { position: absolute; inset: 0; z-index: 2; display: none; }
.catcher.is-on { display: block; }

/* 장면 막대 · 가방 */
.scene-bar { flex: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 0; }
.scene-name { font-family: var(--f-head); font-weight: 700; font-size: 14px; color: var(--ink-2); letter-spacing: 0.04em; }
.scene-name::before { content: '● '; color: var(--c-amber, #f39a2b); font-size: 9px; vertical-align: 2px; }
.hold {
  flex: none; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px;
  margin: 0 12px; padding: 0 6px 0 14px; height: 0; overflow: hidden; opacity: 0;
  border-radius: 12px; background: var(--film); color: var(--ink);
  transition: height 200ms var(--ease-out), opacity 160ms ease, margin 200ms var(--ease-out);
}
.hold.is-on { height: 46px; opacity: 1; margin-bottom: 6px; }
.hold-text { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hold .chip-btn { background: rgba(255,255,255,.1); box-shadow: none; color: var(--ink); }
.bag {
  flex: none; display: flex; gap: 8px; align-items: center;
  padding: 8px 12px calc(10px + var(--sab)); min-height: 78px;
  overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(180deg, var(--paper-2), var(--paper-3));
  border-top: 1px solid var(--line);
}
.bag::-webkit-scrollbar { display: none; }
.bag-empty { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; padding-left: 6px; } /* 가방 바탕(paper-3)이 진해 muted 는 대비 부족 */
.bag-empty .ico { width: 18px; height: 18px; }
.slot {
  flex: none; width: 58px; height: 58px; padding: 6px; border: 0; border-radius: 12px;
  background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px var(--line-2);
  display: grid; place-items: center;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease;
}
.slot img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.slot:active { transform: scale(0.95); }
.slot.is-sel { transform: translateY(-5px); box-shadow: inset 0 0 0 2px var(--c-gold, #e8b54d), 0 0 16px rgba(232, 181, 77, 0.4); }
.slot-txt { font-weight: 700; font-size: 14px; }
.fly-item { object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.flyer { position: absolute; z-index: 60; pointer-events: none; margin: 0; }

/* ───────── 시트 ───────── */
.sheet-root { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.sheet-back { position: absolute; inset: 0; background: rgba(5, 4, 3, 0.62); opacity: 0; transition: opacity 240ms ease; pointer-events: auto; }
.sheet {
  position: relative; max-height: calc(100% - 48px - var(--sat)); display: flex; flex-direction: column;
  background: var(--paper); border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(100%); transition: transform 320ms var(--ease-drawer);
  pointer-events: auto;
}
.sheet::before { content: ''; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line-2); pointer-events: none; /* 손잡이 막대를 잡아도 아래 .sheet-head 가 끌기를 받게(R2-009) */ }
.sheet--full { height: calc(100% - 28px - var(--sat)); }
.sheet-root.is-open .sheet { transform: translateY(0); }
.sheet-root.is-open .sheet-back { opacity: 1; }
.sheet-root.is-closing .sheet { transform: translateY(100%); transition-duration: 200ms; transition-timing-function: var(--ease-out); }
.sheet-root.is-closing .sheet-back { opacity: 0; transition-duration: 200ms; }
.sheet-head { display: flex; align-items: flex-start; gap: 8px; padding: 20px 10px 4px 22px; }
.sheet-titles { flex: 1; min-width: 0; padding-top: 6px; }
.sheet-kicker { font-family: var(--f-dot); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.sheet-title { margin: 0; font-family: var(--f-head); font-weight: 800; font-size: 20px; line-height: 1.35; text-wrap: balance; }
.sheet-body { padding: 8px 22px calc(22px + var(--sab)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-lead { margin: 4px 0; color: var(--ink-2); }
.resume-meta { margin: 6px 0 0; font-family: var(--f-dot); color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
}

/* 메뉴 */
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 4px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; text-decoration: none;
  font-weight: 500;
}
.menu-row > span:nth-of-type(1) { flex: 1; }
.menu-val { font-family: var(--f-dot); color: var(--muted); font-size: 13px; }
.menu-row--danger { color: var(--red-ink); border-bottom: 0; }
.menu-row--seg > span { flex: 1; }

/* 토스트 · 플래시 */
.toast {
  position: absolute; left: 50%; top: calc(var(--sat) + 64px); z-index: 70;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px;
  background: var(--film); color: var(--ink); font-size: 13.5px; font-weight: 700; text-align: center;
  box-shadow: var(--shadow-2);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  transition: transform 260ms var(--ease-out), opacity 200ms ease;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.toast--clue { background: var(--film); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-2); }
.toast--clue::before { content: '◉ '; color: var(--red); }
/* 홈(홈·목록·컬렉션·마이): 위쪽 큰 제목을 덮지 않게 하단 탭 바로 위에, 불투명 바탕으로(Q1-2). 줄은 고르게(Q3-8) */
.page-home .toast { top: auto; bottom: calc(var(--sab) + 58px + 14px); transform: translate(-50%, 12px); background: var(--c-surface2, #24201a); text-wrap: balance; }
.page-home .toast.is-on { transform: translate(-50%, 0); }
.flash { position: absolute; inset: 0; z-index: 80; background: #fffaf0; pointer-events: none; opacity: 0; }

/* ───────── 자물쇠 ───────── */
.sheet--lock .sheet-body { text-align: center; }
.lock-pic { width: min(240px, 70%); margin: 4px auto 10px; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow-1); }
.lock-prompt { margin: 2px 0 14px; color: var(--ink-2); font-size: 14px; white-space: pre-line; }
.dial { display: flex; justify-content: center; gap: 8px; padding: 14px 10px; border-radius: 18px; background: linear-gradient(180deg, #3a322c, #241f1c); box-shadow: inset 0 2px 8px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.4); }
.dial-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; flex: 0 1 62px; }
.dial-btn { width: 100%; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #cbbfa8; display: grid; place-items: center; transition: transform 120ms var(--ease-out), background-color 120ms ease; }
.dial-btn:active { transform: scale(0.92); background: rgba(255,255,255,.08); }
.dial-btn .ico { width: 20px; height: 20px; }
.dial-wheel {
  width: 100%; height: 64px; border: 0; border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #d9ccb2 0%, #f8f2e6 30%, #f8f2e6 70%, #d9ccb2 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), inset 0 6px 8px -6px rgba(0,0,0,.5), inset 0 -6px 8px -6px rgba(0,0,0,.5);
  display: grid; place-items: center; touch-action: none;
}
.dial-face { display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; font-size: 30px; color: var(--print); line-height: 1; }
.dial--letters .dial-face, .dial--symbols .dial-face { font-size: 26px; }
.dial-name { font-size: 13px; line-height: 1.25; color: #e3d8c3; min-height: 17px; text-align: center; overflow-wrap: anywhere; }
.swatch { display: block; width: 34px; height: 34px; border-radius: 50%; background: var(--c, #888); box-shadow: inset 0 0 0 2px rgba(0,0,0,.18), inset 0 6px 8px rgba(255,255,255,.25); }
.dial.is-ok .dial-wheel, .seq.is-ok .seq-slot { box-shadow: inset 0 0 0 2px var(--amber), 0 0 18px rgba(225, 162, 60, 0.5); }
.lock-status { min-height: 24px; margin: 12px 0 4px; font-weight: 700; font-size: 14px; color: var(--muted); }
.lock-status.is-bad { color: var(--red-ink); }
.lock-status.is-ok { color: var(--ok); }
.lock-go { width: 100%; margin-top: 6px; }
.sheet--lock.is-solved .lock-go { background: var(--ok); }
.seq { display: flex; justify-content: center; gap: 8px; padding: 12px; border-radius: 16px; background: linear-gradient(180deg, #3a322c, #241f1c); box-shadow: inset 0 2px 8px rgba(0,0,0,.5); }
.seq-slot { flex: 0 1 46px; aspect-ratio: 1; border-radius: 10px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); display: grid; place-items: center; color: #f3ead8; font-family: var(--f-head); font-weight: 800; font-size: 20px; transition: background-color 160ms ease; }
.seq-slot.is-filled { background: #f8f2e6; color: var(--print); }
.seq-slot .ico { width: 22px; height: 22px; stroke-width: 2.2; }
.seq-slot .swatch { width: 70%; height: 70%; }
.pad { display: grid; gap: 10px; margin: 10px auto 4px; }
.pad--arrows { grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(3, 58px); justify-content: center; gap: 8px; }
.pad--arrows .pad-up { grid-column: 2; grid-row: 1; }
.pad--arrows .pad-left { grid-column: 1; grid-row: 2; }
.pad--arrows .pad-right { grid-column: 3; grid-row: 2; }
.pad--arrows .pad-down { grid-column: 2; grid-row: 3; }
.pad--seq { grid-template-columns: repeat(var(--cols, 3), 1fr); }
.pad-btn {
  min-height: 56px; border: 0; border-radius: 14px; background: var(--film);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 3px 0 #000, 0 4px 10px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700;
  transition: transform 120ms var(--ease-out), box-shadow 120ms ease;
}
.pad-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 #000; }
.pad-btn .ico { width: 26px; height: 26px; stroke-width: 2.2; }
.pad-btn .swatch { width: 22px; height: 22px; }
.lock-clear { margin-top: 8px; min-height: 40px; }
/* 순서·화살표 자물쇠: 「한 칸 지우기(⌫)」 + 「지우기(전부)」 한 줄(R3-008) */
.lock-edit { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 8px; }
.lock-edit .lock-clear, .sheet--lock.is-compact .lock-edit .lock-clear { margin-top: 0; }
.lock-undo { min-height: 40px; min-width: 52px; padding: 0 14px; }
.lock-undo .ico { width: 20px; height: 20px; }
.sheet--lock.is-compact .lock-edit { margin-top: 4px; }
.lock-text { display: flex; gap: 8px; }
.lock-input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 0; border-radius: 14px; background: rgba(0, 0, 0, 0.35); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); font-size: 18px; font-weight: 700; text-align: center; }
.lock-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--c-gold, #e8b54d); }

/* 확대 · 아이템 보기 */
.show-pic { margin: 4px 0 12px; border-radius: 4px; overflow: hidden; background: var(--film); padding: 6px; box-shadow: var(--shadow-1); }
.show-pic .stage { margin: 0 auto; width: min(100%, calc(52dvh * var(--ar, 0.75))); }
.lock-pic .stage { width: 100%; }
/* 보기 창 그림의 「크게 보기」 단추(R3-011): 작고 반투명하게, 그림 틀 오른쪽 아래(세로 그림이면 그림 옆 어두운 여백) */
.show-pic { position: relative; }
.show-pic-zoom { position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 23, 21, 0.62); color: #f3ead8; opacity: 0.85; box-shadow: 0 0 0 1px rgba(243, 234, 216, 0.25); }
.show-pic-zoom .ico { width: 17px; height: 17px; }
.show-pic-zoom::after { content: ''; position: absolute; inset: -6px; } /* 터치 영역 44px */
.show-pic:has(.stage.is-zoomed) .show-pic-zoom { background: var(--amber); color: var(--film); opacity: 1; }
.show-cap { margin: 4px 0 8px; font-size: 14.5px; white-space: pre-line; }
.show-say { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.show-say p { margin: 0; white-space: pre-line; }
.show-tip { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.item-big { display: grid; place-items: center; padding: 18px; margin-bottom: 8px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.item-big img { width: 120px; height: 120px; object-fit: contain; }

/* 힌트 */
.hint-topic { margin: 0 0 10px; font-family: var(--f-head); font-weight: 700; color: var(--ink-2); }
.hint-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line-2); }
.hint-no { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-dot); font-size: 15px; background: var(--paper-2); color: var(--muted); }
.hint-step.is-open .hint-no { background: var(--c-gold, #e8b54d); color: var(--c-on-gold, #1d1405); box-shadow: 0 0 18px rgba(232, 181, 77, .45); }
.hint-level { font-size: 12px; font-weight: 700; color: var(--muted); margin: 2px 0 6px; }
.hint-text { margin: 0; font-size: 15px; white-space: pre-line; }
.hint-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* 도입 */
.intro { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; padding: 18px 20px calc(18px + var(--sab)); background: var(--paper); overflow-y: auto; }
.intro-head { text-align: center; margin: 6px 0 14px; }
.intro-kicker { font-family: var(--f-dot); font-size: 11.5px; letter-spacing: 0.16em; color: var(--c-gold, #e8b54d); }
.intro-title { margin: 4px 0 2px; font-family: var(--f-head); font-weight: 800; font-size: 28px; line-height: 1.25; }
.intro-tag { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.intro-card { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.intro-photo { margin: 0 auto; width: min(100%, 300px); padding: 10px 10px 34px; background: #fbf7ee; box-shadow: var(--shadow-2); transform: rotate(-1.5deg); }
.intro-photo img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.intro-text { display: flex; gap: 12px; align-items: flex-start; }
.intro-text p { margin: 0; font-size: 16px; line-height: 1.85; white-space: pre-line; }
.intro-text:not(.is-hana) p { font-family: var(--f-head); font-weight: 500; font-size: 17px; text-align: center; width: 100%; }
.intro-face { width: 44px; height: 44px; flex: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 217, 138, .55); }
.intro-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; }
.intro-count { font-family: var(--f-dot); font-size: 13px; color: var(--muted); }
.intro-foot .btn { min-width: 150px; }
/* 넘기는 장면: 위에서부터 채움(가운데 정렬은 키 큰 폰에서 제목 아래·버튼 위에 큰 빈칸) — 장마다 사진 위치가 같게 */
.intro-card { justify-content: flex-start; padding-top: clamp(4px, 3vh, 28px); }
.intro-tag { text-wrap: balance; white-space: pre-line; } /* 소제목의 줄바꿈 문자도 줄로(R4) */
.intro-text p { text-wrap: pretty; }
html[data-lang='ja'] :is(.intro-tag, .intro-text p, .bubble-text) { word-break: auto-phrase; } /* 「出よ/う」 같은 어절 중간 줄바꿈 방지(안드로이드 WebView) */

/* ───────── 추리 ───────── */
.tabs { position: relative; flex: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 8px; border-bottom: 1px solid var(--line); }
.tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border: 0; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); transition: color 160ms ease; }
.tab .ico { width: 18px; height: 18px; }
.tab.is-on { color: var(--ink); }
.tab-badge { font-family: var(--f-dot); font-weight: 500; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: rgba(232, 181, 77, .16); color: var(--c-gold-hi, #ffd98a); }
.tab-ind { position: absolute; left: 8px; bottom: -1px; width: calc((100% - 16px) / 3); height: 2px; display: flex; justify-content: center; transition: transform 240ms var(--ease-out); }
.tab-ind::before { content: ''; width: 46px; height: 2px; border-radius: 2px; background: var(--c-gold, #e8b54d); }
.panel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.panel[data-tab='scene'] { overflow: hidden; display: flex; }
.scene-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scene-chips { flex: none; display: flex; gap: 8px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; min-height: 46px; align-items: center; }
.chip-count { font-family: var(--f-dot); font-weight: 400; font-size: 11px; opacity: 0.7; }
.scene-tip { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0 0 8px; font-size: 12px; color: var(--muted); }
.scene-tip .ico { width: 15px; height: 15px; }
.cta { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(10px + var(--sab)); background: linear-gradient(180deg, var(--paper-2), var(--paper-3)); border-top: 1px solid var(--line); }
.cta-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cta-count { font-family: var(--f-dot); font-size: 13px; }
.cta-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-btn { min-width: 132px; }

.people { padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.people-intro { margin: 0 2px 2px; font-size: 13px; color: var(--ink-2); }
.person { padding: 14px 14px 6px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-1); border-left: 4px solid var(--pc); }
.person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.person-name { margin: 0; font-family: var(--f-head); font-weight: 800; font-size: 17px; line-height: 1.3; }
.person-role { margin: 0; font-size: 12px; color: var(--muted); }
.ava { flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 2px #fbf7ee, 0 0 0 3px var(--line-2); }
.ava img { width: 100%; height: 100%; object-fit: cover; }
.ava--letter { background: var(--pc); color: #fbf7ee; font-family: var(--f-head); font-weight: 800; font-size: 20px; }
.lines { display: flex; flex-direction: column; }
.line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px dashed var(--line); }
.line-text { flex: 1; margin: 0; font-size: 14.5px; line-height: 1.7; }
.line-text::before { content: '「'; color: var(--muted); }
.line-text::after { content: '」'; color: var(--muted); }
.line.is-memo .line-text { background: linear-gradient(transparent 62%, rgba(225, 162, 60, 0.35) 62%); }
.memo-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--c-gold, #e8b54d); color: var(--c-on-gold, #1d1405); font-size: 12px; font-weight: 700; transition: transform 140ms var(--ease-out); position: relative; }
.memo-btn::after { content: ''; position: absolute; inset: -4px; }
.memo-btn:active { transform: scale(0.95); }
.memo-btn .ico { width: 15px; height: 15px; }
.memo-btn.is-done { background: transparent; color: var(--ok); box-shadow: inset 0 0 0 1.5px rgba(95, 191, 122, 0.5); }

.notes { padding: 14px 14px 24px; }
.notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; }
.polaroid { position: relative; padding: 7px 7px 0; color: var(--print); background: #fbf7ee; box-shadow: var(--shadow-1), 0 0 0 1px rgba(42,36,32,.06); border-radius: 2px; transition: transform 160ms var(--ease-out), box-shadow 160ms ease; cursor: pointer; }
.polaroid:nth-child(odd) { transform: rotate(-1.2deg); }
.polaroid:nth-child(even) { transform: rotate(1deg); }
.polaroid:active { transform: scale(0.97); }
.polaroid-pic { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--film); display: grid; place-items: center; color: var(--muted); font-family: var(--f-head); font-size: 28px; }
.polaroid-cap { padding: 7px 2px 9px; font-family: 'Klee One', var(--f-body); font-size: 13px; line-height: 1.35; text-align: center; min-height: 2.6em; }
.polaroid--empty { box-shadow: none; background: transparent; border: 1.5px dashed var(--line-2); cursor: default; }
.polaroid--empty .polaroid-pic { background: rgba(255,255,255,.04); }
.polaroid--empty .polaroid-cap { color: var(--muted); font-size: 12px; }
.polaroid.is-picked { box-shadow: 0 0 0 3px var(--red), var(--shadow-2); transform: rotate(0) translateY(-2px); }
.polaroid.is-picked::after { content: ''; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/16px no-repeat; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.polaroid--fly { width: 120px; box-shadow: var(--shadow-2); }
.polaroid--fly .polaroid-cap { font-size: 11px; padding: 4px 2px 6px; min-height: 0; }
.crop { position: absolute; inset: 0; overflow: hidden; }
.crop-inner { position: absolute; aspect-ratio: var(--ar); container-type: inline-size; }
.crop-inner .stage-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.polaroid-pic .stage, .clue-big .stage { width: 100%; }
.quote-thumb { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; background: #f1e7d3; color: var(--print); text-align: center; }
.quote-thumb p { margin: 0; font-family: 'Klee One', var(--f-body); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.quote-ava { width: 34px; height: 34px; font-size: 15px; }
.clue-big { position: relative; aspect-ratio: 1; width: min(100%, 320px); margin: 4px auto 12px; overflow: hidden; background: var(--film); border: 8px solid #fbf7ee; border-bottom-width: 26px; box-shadow: var(--shadow-2); }
.clue-big .quote-thumb p { font-size: 16px; -webkit-line-clamp: 8; }
.clue-src { margin: 0; text-align: right; color: var(--muted); font-size: 13px; }

.accuse { display: flex; flex-direction: column; min-height: 100%; }
.acc-step { font-family: var(--f-dot); color: var(--c-gold, #e8b54d); font-size: 12px; letter-spacing: 0.16em; }
.acc-q { margin: 4px 0 6px; font-family: var(--f-head); font-weight: 700; font-size: 18px; line-height: 1.5; }
.acc-sub { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.acc-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.acc-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 14px; border: 0; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform 140ms var(--ease-out), box-shadow 160ms ease; }
.acc-choice:active { transform: scale(0.97); }
.acc-choice.is-on { box-shadow: inset 0 0 0 2px var(--c-gold, #e8b54d), 0 0 18px rgba(232, 181, 77, 0.3); }
.acc-name { font-family: var(--f-head); font-weight: 800; font-size: 16px; }
.acc-role { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.acc-foot { position: sticky; bottom: 0; display: flex; gap: 10px; margin-top: auto; padding: 14px 0 4px; background: linear-gradient(180deg, transparent, var(--paper) 30%); }
.acc-foot .btn { flex: 1; white-space: nowrap; padding: 0 14px; }
.acc-foot .acc-go { flex: 1.7; }
.notes-grid--pick { margin-bottom: 10px; }
.acc-miss { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 16px; min-height: 100%; }
.miss-photo { width: 150px; aspect-ratio: 1; margin: 6px auto 18px; background: #fbf7ee; padding: 8px 8px 26px; box-shadow: var(--shadow-2); transform: rotate(-3deg); position: relative; }
.miss-photo::before { content: ''; position: absolute; inset: 8px 8px 26px; background: radial-gradient(circle at 40% 45%, #9a8d7c, #4a403a); filter: blur(5px); }
.acc-miss .acc-foot { width: 100%; }

.solution { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 14px 14px calc(14px + var(--sab)); }
.sol-head { text-align: center; margin-bottom: 10px; }
.sol-kicker { font-family: var(--f-dot); color: var(--c-gold, #e8b54d); font-size: 12px; letter-spacing: 0.2em; }
.sol-title { margin: 2px 0 0; font-family: var(--f-head); font-weight: 800; font-size: 26px; }
.board { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; padding: 16px 10px; border-radius: 8px; background: #b99a74 var(--grain); box-shadow: inset 0 0 0 6px #8e6f4c, inset 0 0 30px rgba(0,0,0,.25); }
.board-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.thread { fill: none; stroke: #b5262a; stroke-width: 2.6; stroke-linecap: round; filter: drop-shadow(0 2px 1.5px rgba(0,0,0,.35)); }
.polaroid--board { transform: rotate(var(--rot)); opacity: 0.55; filter: saturate(0.4); transition: opacity 260ms ease, filter 260ms ease, transform 260ms var(--ease-out); cursor: default; padding: 5px 5px 0; }
.polaroid--board .polaroid-cap { font-size: 11px; padding: 4px 1px 6px; min-height: 2.4em; }
.polaroid--board::before { content: ''; position: absolute; z-index: 2; top: -5px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f06a55, #9c2a1c); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.polaroid--board.is-seen { opacity: 0.85; filter: none; }
.polaroid--board.is-hot { opacity: 1; filter: none; transform: rotate(0) scale(1.04); box-shadow: 0 0 0 2px var(--amber), var(--shadow-2); z-index: 1; }
.sol-text { min-height: 120px; padding: 16px 4px 8px; }
.sol-text p { margin: 4px 0 0; font-size: 15.5px; line-height: 1.8; white-space: pre-line; }
.sol-no { font-family: var(--f-dot); font-size: 12px; color: var(--muted); }
.sol-foot { margin-top: auto; padding-top: 8px; }
.sol-foot .btn { width: 100%; }

/* ───────── 해결 화면 ───────── */
.play--end { overflow-y: auto; }
.ending { display: flex; flex-direction: column; align-items: center; padding: 22px 20px calc(28px + var(--sab)); }
.end-photo { position: relative; margin: 6px 0 18px; width: min(78%, 300px); padding: 10px 10px 40px; background: #fbf7ee; box-shadow: var(--shadow-2); transform: rotate(-1.2deg); }
.end-photo img, .end-photo-blank { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--film); }
.end-photo-blank { display: grid; place-items: center; background: linear-gradient(160deg, #3a2f2a, var(--accent)); }
.end-face { width: 46%; height: auto; border-radius: 50%; }
.end-stamp { position: absolute; right: -12px; bottom: 14px; padding: 4px 12px; transform: rotate(-9deg); border: 2.5px solid #d4573f; border-radius: 6px; color: #d4573f; background: rgba(251,247,238,.9); font-family: var(--f-head); font-weight: 800; font-size: 15px; letter-spacing: 0.12em; }
.end-line { margin: 0; font-family: var(--f-head); font-weight: 800; font-size: 30px; letter-spacing: 0.04em; }
.end-title { margin: 8px 0 0; font-family: var(--f-head); font-weight: 700; font-size: 18px; text-align: center; }
.end-text { margin: 8px 0 0; text-align: center; color: var(--ink-2); white-space: pre-line; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin: 20px 0 6px; padding: 12px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.stats div { text-align: center; }
.stats div + div { border-left: 1px dashed var(--line-2); }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--f-dot); font-size: 24px; }
.end-actions { width: 100%; margin: 14px 0 6px; }
.end-actions .btn { width: 100%; }
.explain { width: 100%; margin-top: 18px; }
.explain-title { margin: 0 0 6px; font-family: var(--f-head); font-weight: 800; font-size: 18px; }
.explain ol { margin: 0; padding: 0; list-style: none; counter-reset: ex; }
.explain li { position: relative; padding: 12px 0 12px 36px; border-top: 1px dashed var(--line-2); counter-increment: ex; }
.explain li::before { content: counter(ex); position: absolute; left: 0; top: 13px; width: 24px; height: 24px; border-radius: 50%; background: var(--film); color: var(--c-gold-hi, #ffd98a); font-family: var(--f-dot); font-size: 12px; display: grid; place-items: center; }
.explain strong { display: block; font-family: var(--f-head); font-size: 15px; }
.explain p { margin: 2px 0 0; font-size: 14.5px; white-space: pre-line; }
.next-case {
  width: 100%; margin-top: 22px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center;
  padding: 16px 18px; border-radius: 16px; background: var(--film); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-2);
  transition: transform 140ms var(--ease-out);
}
.next-case:active { transform: scale(0.98); }
.next-kicker { font-family: var(--f-dot); font-size: 11px; letter-spacing: 0.2em; color: var(--amber); }
.next-title { font-family: var(--f-head); font-weight: 800; font-size: 19px; }
.next-meta { font-family: var(--f-dot); font-size: 12px; opacity: 0.7; }
.next-arrow { grid-column: 2; grid-row: 1 / 4; color: var(--amber); }
.end-foot { display: flex; gap: 10px; width: 100%; margin-top: 14px; }
.end-foot .btn { flex: 1; }
.share-img { display: block; width: 100%; border-radius: 8px; box-shadow: var(--shadow-2); }

/* ───────── 안내 · 유료 자리 ───────── */
.notice { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 28px calc(30px + var(--sab)); text-align: center; }
.notice-back { position: absolute; top: calc(var(--sat) + 8px); left: 8px; }
.notice-face { width: 84px; height: 84px; margin-bottom: 8px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 217, 138, .55), var(--shadow-2); }
.notice-kicker { margin: 0; font-family: var(--f-dot); font-size: 12px; color: var(--muted); letter-spacing: 0.1em; }
.notice-title { margin: 0; font-family: var(--f-head); font-weight: 800; font-size: 26px; line-height: 1.3; }
.notice-tag { margin: 0; color: var(--ink-2); font-size: 14px; }
.notice-text { margin: 8px 0 14px; color: var(--ink-2); }
.notice--paywall .btn { margin-top: 4px; }
.pw-film { width: 180px; aspect-ratio: 4/5; margin-bottom: 14px; border-radius: 3px; background: linear-gradient(160deg, #3a2f2a, #1b1715); box-shadow: 0 0 0 6px #000, var(--shadow-2); display: grid; place-items: center; transform: rotate(-2deg); }
.pw-lock { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #f3d48b, #e2b356); color: #5a3a0a; }
.pw-lock .ico { width: 30px; height: 30px; stroke-width: 2; }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60dvh; font-family: var(--f-dot); color: var(--muted); }
.loading-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-amber, #f39a2b); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .tab-ind, .hold { transition: none; }
}

/* ───────── 추가: 작은 핫스팟 44px 보정 · 추리 가방 · 넛지 ───────── */
.hs::after { content: ''; position: absolute; left: calc(-1 * var(--exl, 0px)); right: calc(-1 * var(--exr, 0px)); top: calc(-1 * var(--ext, 0px)); bottom: calc(-1 * var(--exb, 0px)); } /* 44px 까지 넓히되 옆 핫스팟 실제 영역은 침범하지 않음(js fitTouch) */
.dbag { flex: none; display: flex; gap: 8px; align-items: center; padding: 6px 14px 4px; overflow-x: auto; scrollbar-width: none; min-height: 60px; }
.dbag .slot { width: 50px; height: 50px; }
.dbag-hold { font-size: 12px; font-weight: 700; color: var(--ink-2); padding-left: 4px; }
.acc-nudge { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: rgba(232, 181, 77, 0.12); font-size: 13px; color: var(--c-gold-hi, #ffd98a); }
.play--outro { position: relative; }
.notes-grid--pick { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.notes-grid--pick .polaroid { padding: 5px 5px 0; }
.notes-grid--pick .polaroid-cap { font-size: 11.5px; padding: 5px 1px 7px; }
.notes-grid--pick .quote-thumb p { font-size: 10.5px; -webkit-line-clamp: 3; }
.notes-grid--pick .quote-ava { width: 26px; height: 26px; font-size: 12px; }
.is-ended .hint-btn { visibility: hidden; }

/* 말풍선은 아래 핫스팟을 막지 않는다(탭하면 그 핫스팟이 눌리고 말풍선은 바뀌거나 닫힘). 여러 줄 대기일 때만 catcher 가 받는다 */
/* 단서 그림 비율 유지: 정사각 칸 안에 contain */
.polaroid-pic .stage--clue.is-tall { width: auto; height: 100%; }
.polaroid-pic .stage--clue.is-wide { width: 100%; height: auto; }
/* 큰 단서 카드: 테두리(폴라로이드 여백)는 바깥, 그림 칸은 안쪽 — 서로 겹치지 않게 */
.clue-big { aspect-ratio: auto; border: 0; padding: 8px 8px 26px; background: #fbf7ee; overflow: visible; display: block; }
.clue-big-pic { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--film); display: grid; place-items: center; }
.clue-big-pic:has(.stage--clue) { aspect-ratio: auto; }
.clue-big-pic .stage--clue { width: min(100%, calc(56dvh * var(--ar, 1))); height: auto; }
.clue-big-pic .quote-thumb p { font-size: 16px; -webkit-line-clamp: 8; }

/* 숫자 패드 (digits 자물쇠: 칸을 탭해 고르고 숫자를 누른다) */
.dial-wheel.is-cur { box-shadow: inset 0 0 0 2.5px var(--amber), 0 0 14px rgba(225, 162, 60, 0.45); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 10px; }
.numpad-key { min-height: 50px; border: 0; border-radius: 12px; background: var(--film); box-shadow: inset 0 0 0 1px var(--line-2), 0 2px 0 #000; font-family: var(--f-head); font-weight: 800; font-size: 22px; display: grid; place-items: center; transition: transform 120ms var(--ease-out); }
.numpad-key:active { transform: translateY(1px) scale(0.97); }
.numpad-key--sub { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.numpad-key .ico { width: 20px; height: 20px; }
.sheet--lock .lock-status { margin-top: 8px; }
/* 장면 칩 줄: 가로 스크롤, 무대 폭은 화면에 고정 */
.panel, .scene-view, .stage-area, .stage-wrap { min-width: 0; }
.scene-view { width: 100%; }
.scene-chips { max-width: 100%; flex-wrap: nowrap; overscroll-behavior-x: contain; }
.scene-chips::-webkit-scrollbar { display: none; }
.scene-chips .chip-btn { flex: none; }

/* 말풍선 자리: 무대 아래 고정 칸. 무대(그림)와 겹치지 않는다. 메시지가 없을 땐 자리만 비워 둔다 */
.stage-area { flex-direction: column; }
.stage-area > .bubble {
  position: relative; left: auto; right: auto; bottom: auto; z-index: 3;
  flex: none; display: flex; margin: 0 12px 8px; min-height: 64px;
  visibility: hidden; pointer-events: none;
}
.stage-area > .bubble.is-on { visibility: visible; pointer-events: auto; }
.stage-area > .catcher { z-index: 2; }
.stage-area > .stage-wrap { padding-bottom: 4px; }

/* ───────── 4개 언어 글꼴·줄바꿈 ───────── */
html[data-lang='zh'] {
  line-break: strict;
}
html[data-lang='zh'] .polaroid-cap, html[data-lang='zh'] .quote-thumb p { font-family: 'Noto Sans SC', sans-serif; }
html[data-lang='en'] body { overflow-wrap: anywhere; hyphens: auto; }
html[data-lang='en'] .polaroid-cap, html[data-lang='en'] .quote-thumb p { font-family: var(--f-ui), sans-serif; }
html[data-lang='ja'] { line-break: strict; }
html[data-lang='ko'] { word-break: keep-all; overflow-wrap: anywhere; }
.seg { flex-wrap: nowrap; }
.seg-btn { padding: 0 10px; }
.menu-row--seg { flex-wrap: wrap; row-gap: 6px; padding: 8px 4px; }

/* ───────── 방탈출 레벨 탭 ───────── */
.cs--level { padding-top: 10px; }
.lv-tabs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px 0 8px; padding: 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); }
.lv-tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 54px; padding: 6px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); transition: color 180ms ease, transform 140ms var(--ease-out); }
.lv-tab:active { transform: scale(0.97); }
.lv-tab.is-on { color: var(--c-gold-hi, #ffd98a); }
.lv-name { font-family: var(--f-head); font-weight: 800; font-size: 16px; line-height: 1.2; }
.lv-count { font-family: var(--f-dot); font-size: 11px; letter-spacing: 0.04em; }
html[data-lang='en'] .lv-name { font-size: clamp(13px, 3.7vw, 15px); hyphens: none; overflow-wrap: normal; } /* "Intermediate" 가 칸을 꽉 채움 */
.cs-tag { text-wrap: pretty; }
html[data-lang='ja'] .cs-tag { word-break: auto-phrase; }
.lv-ind { position: absolute; z-index: 0; left: 4px; top: 4px; bottom: 4px; width: calc((100% - 8px) / 3); border-radius: 12px; background: var(--film); box-shadow: inset 0 0 0 1px rgba(232, 181, 77, .35); transition: transform 260ms var(--ease-out); }
.cs--level .cs-lead { margin: 4px 4px 6px; }
.type-mark--beginner { background: #5e7a52; }
.type-mark--intermediate { background: #5f5486; }
.type-mark--advanced { background: #8a4a38; }
.cs--level .cs-glyph { font-family: var(--f-dot); font-weight: 400; font-size: 34px; letter-spacing: 0.04em; }
.legacy { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.legacy-head { margin: 0 20px 2px; font-family: var(--f-head); font-weight: 800; font-size: 15px; color: var(--ink-2); letter-spacing: 0.04em; }
.legacy .cs-head { font-size: 17px; }
.home-tools { gap: 2px; }
.home-tools .seg-btn { min-height: 32px; padding: 0 9px; font-size: 12px; }
/* 위쪽 제목: 두 줄까지, 길면 글자를 줄인다(js 가 data-len 을 붙임) */
.bar-name[data-len='long'] { font-size: 13.5px; }
.bar-name[data-len='xlong'] { font-size: 12.5px; }
.bar { min-height: 60px; }
/* 오버레이 손글씨: 언어별로 보이는 크기 맞추기 (실측: ja 가나는 Klee One 이라 한국어보다 약 16% 작고 가늘다, zh 는 한자 글꼴이 섞임) */
html[data-lang='ja'] .ov[data-font='hand'] { --fk: 1.08; letter-spacing: -0.04em; } /* Klee One 가나: 작고 자간이 넓다 → 조금 키우고 자간을 좁힌다 */
html[data-lang='zh'] .ov[data-font='hand'] { font-family: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif !important; --fk: 1; }

/* 확대 가능한 그림(두 손가락 확대) */
.stage.is-zoomable { touch-action: none; }
.stage-pan { position: absolute; inset: 0; transform-origin: 0 0; }
/* 성능(RELEASE 1201): will-change 를 늘 걸면 확대 안 할 때도 사진 판이 따로 합성 레이어가 되고, 그 위 대사 창(.catcher)까지 「겹침」 레이어로 떨어져
   탭할 때마다 화면 5배 면적을 합성했다(실기기 탭 버벅임). 두 손가락 확대·끌기 중이거나 확대된 동안에만 */
.stage.is-gesture .stage-pan, .stage.is-zoomed .stage-pan { will-change: transform; }
.stage.is-zoomed { cursor: grab; }
/* 가로(4:3 등) 그림: 필름 테두리를 얇게 하고 화면 폭을 꽉 채운다 */
.stage-wrap:has(.stage.is-wide) { padding-inline: 4px; }
.film:has(> .stage.is-wide) { padding: 6px 6px 20px; }
.film:has(> .stage.is-wide) .film-edge { display: none; }
.film:has(> .stage.is-wide) .film-mark { left: 8px; }
.film > .stage.is-wide { width: min(calc(100cqw - 12px), calc((100cqh - 26px) * var(--ar, 1.33))); }
.show-pic:has(.stage.is-wide) { padding: 2px; margin-inline: -10px; }
.show-pic .stage.is-wide { width: 100%; }
/* 자물쇠 창 그림: 탭하면 크게 */
.lock-pic { position: relative; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.lock-pic-zoom { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 23, 21, 0.72); color: #f3ead8; pointer-events: none; }
.lock-pic-zoom .ico { width: 17px; height: 17px; }
/* 터치 영역 44px (L1 점검) */
.seg { padding: 2px; }
.seg-btn { min-height: 44px; }
.home-tools .seg-btn { min-height: 44px; }
.hint-btn { min-height: 44px; }
.chip-btn.back-chip { min-height: 44px; }

/* 자물쇠 창 그림 크기: imageSize "normal"(기본 240px) · "medium" · "large"(창 폭 가득) */
.lock-pic--medium { width: min(320px, 90%); }
.lock-pic--large { width: 100%; }

/* 자물쇠 창 그림: 기본을 창 폭의 88% 로 (메모 글씨가 읽히게). imageSize: "small"(240px) · "medium" · "large"(100%) */
.lock-pic, .lock-pic--normal { width: min(88%, 440px); }
.lock-pic--small { width: min(240px, 70%); }
.lock-pic--medium { width: min(94%, 470px); }
.lock-pic--large { width: 100%; }
/* 정사각 확대 그림도 가로 그림처럼 화면 폭을 채운다 */
.stage-wrap:has(.stage.is-square) { padding-inline: 4px; }
.film:has(> .stage.is-square) { padding: 6px 6px 20px; }
.film:has(> .stage.is-square) .film-edge { display: none; }
.film:has(> .stage.is-square) .film-mark { left: 8px; }
.film > .stage.is-square { width: min(calc(100cqw - 12px), calc((100cqh - 26px) * var(--ar, 1))); }
.show-pic:has(.stage.is-square) { padding: 2px; margin-inline: -10px; }
.show-pic .stage.is-square { width: min(100%, calc(60dvh * var(--ar, 1))); }

/* fit:"height" — 아주 긴 가로 그림: 무대는 세로 3:4 칸, 그림은 높이에 맞추고 좌우로 끌어 본다 */
.stage.fit-h { aspect-ratio: 3 / 4; }
.film > .stage.fit-h { width: min(calc(100cqw - 12px), calc((100cqh - 26px) * 0.75)); }
.stage.fit-h .stage-pan { right: auto; width: calc(100% * var(--ar) / 0.75); }
.show-pic .stage.fit-h { width: min(100%, calc(56dvh * 0.75)); }
.stage.fit-h::after { content: '⇆'; position: absolute; right: 8px; bottom: 8px; z-index: 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 23, 21, 0.6); color: #f3ead8; font-size: 15px; pointer-events: none; }

/* 연타·더블탭: 확대 제스처로 탭이 씹히지 않게 */
html { touch-action: manipulation; }
.sheet--lock button, .numpad-key, .dial-btn, .pad-btn { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
/* 자물쇠 창: 그림은 남는 높이에 맞춰 줄어든다(js fit). 아주 작아지면 썸네일 표시 */
.lock-pic { margin-inline: auto; }
.lock-pic.is-thumb .lock-pic-zoom { width: 24px; height: 24px; right: 3px; bottom: 3px; }
.sheet--lock .lock-prompt { margin: 2px 0 10px; }
.sheet--lock .dial { padding: 10px 10px; }
.sheet--lock .dial-btn { height: 32px; }
.sheet--lock .dial-wheel { height: 58px; }
.sheet--lock .numpad { gap: 6px; margin: 2px 0 8px; }
.sheet--lock .numpad-key { min-height: 44px; }
.sheet--lock .lock-status { min-height: 20px; margin: 6px 0 2px; }
/* 기호 다이얼·버튼: 웹폰트로 고정하고 이모지로 그리지 않는다 */
.dial-face, .seq-slot, .pad-btn, .dial-name { font-variant-emoji: text; }
.dial--symbols .dial-face, .seq-slot, .pad--seq .pad-btn span { font-family: 'Noto Sans Symbols 2', 'Noto Sans Symbols', var(--f-head); }
/* 낮은 화면(360x740 등): 자물쇠 창을 조금 더 촘촘하게 */
@media (max-height: 780px) {
  .sheet--lock .sheet-head { padding-top: 14px; }
  .sheet--lock .sheet-title { font-size: 18px; }
  .sheet--lock .dial-wheel { height: 52px; }
  .sheet--lock .dial-btn { height: 28px; }
  .sheet--lock .numpad-key { min-height: 42px; }
  .sheet--lock .lock-go { min-height: 46px; }
}

/* 말풍선 「탭해서 계속 ▸」: 또렷하게 깜빡임 */
.bubble-more { align-self: flex-end; flex: none; padding: 3px 9px; border-radius: 999px; background: rgba(232, 181, 77, .14); color: var(--c-gold-hi, #ffd98a); font-size: 11.5px; font-weight: 700; white-space: nowrap; animation: tapblink 1.2s ease-in-out 4; } /* PERF 11/30: 대사마다 4번만 깜빡이고 멈춤(infinite 이면 대사 화면 내내 매 프레임 합성) */
@keyframes tapblink { 50% { opacity: 0.35; } }
/* 결과 화면: 레벨 사건 머리글 + 부제 */
.end-title--level { font-family: var(--f-dot); font-weight: 500; font-size: 16px; letter-spacing: 0.1em; color: var(--c-gold, #e8b54d); }
.end-sub { margin: 6px 0 0; font-family: var(--f-head); font-weight: 700; font-size: 18px; text-align: center; }

/* 자물쇠 창 촘촘한 배치(그림을 줄여도 넘칠 때, js fit) — 터치 영역은 40px 이상 유지 */
.sheet--lock.is-compact .sheet-head { padding-top: 12px; padding-bottom: 0; }
.sheet--lock.is-compact .sheet-title { font-size: 17px; }
.sheet--lock.is-compact .lock-prompt { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.sheet--lock.is-compact .lock-status { margin: 4px 0 0; font-size: 13px; line-height: 1.4; }
.sheet--lock.is-compact .pad { margin: 6px auto 2px; gap: 6px; }
.sheet--lock.is-compact .pad--arrows { grid-template-rows: repeat(3, 46px); grid-template-columns: repeat(3, 60px); }
.sheet--lock.is-compact .pad-btn { min-height: 44px; }
.sheet--lock.is-compact .seq { padding: 8px; }
.sheet--lock.is-compact .seq-slot { flex-basis: 40px; }
.sheet--lock.is-compact .lock-clear { margin-top: 4px; min-height: 40px; }
.sheet--lock.is-compact .dial { padding: 6px 8px; }
.sheet--lock.is-compact .dial-wheel { height: 50px; }
.sheet--lock.is-compact .dial-btn { height: 28px; }
.sheet--lock.is-compact .numpad-key { min-height: 40px; }
.sheet--lock.is-compact .sheet-body { padding-bottom: calc(12px + var(--sab)); }
/* ───────── 중국어(zh): 간체자가 다른 글꼴로 섞이지 않게 (Q15 측정) ───────── */
html[data-lang='zh'] .ov:not([data-font]), html[data-lang='zh'] .ov[data-font='maru'], html[data-lang='zh'] .ov[data-font='sans'] { font-family: 'Noto Sans SC', 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'Noto Sans Math', sans-serif !important; }
html[data-lang='zh'] .ov[data-font='mincho'] { font-family: 'Noto Serif SC', 'Noto Sans SC', 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'Noto Sans Math', serif !important; }
/* 옛 도트 글꼴 자리(--f-dot)는 --f-num(Oswald + 언어별 글꼴)으로 바뀌었다 — 중국어도 따로 덮어쓰지 않는다 */

/* 레벨 탭 4개(초급·중급·고급·마스터) */
.lv-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* 칸 너비를 늘 4등분(글자가 커져도 탭 줄이 화면 밖으로 넘치지 않고, 선택 표시 .lv-ind 와 칸이 맞게) */
.lv-ind { width: calc((100% - 8px) / 4); }
.lv-name { font-size: 15px; white-space: nowrap; }
html[data-lang='en'] .lv-name { font-size: 12.5px; letter-spacing: -0.01em; }
.type-mark--master { background: #3f3a5c; }
/* 좁은 폰(360px 이하): 위쪽 제목을 한 단계 더 작게 → 두 줄 안에 들어가게 (Q16) */
@media (max-width: 370px) {
  .bar-name { font-size: 13.5px; }
  .bar-name[data-len='long'] { font-size: 12.5px; }
  .bar-name[data-len='xlong'] { font-size: 11.5px; }
}
/* 아이템을 들었을 때 안내: 두 줄까지 (동사 부분이 잘리지 않게) */
.hold.is-on { height: auto; min-height: 46px; padding-block: 4px; }
.hold-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
/* 자물쇠 선택지 아이콘(icon·svg): svg 에 width·height 가 없어도 보이게 기본 크기 */
.opt-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; }
.opt-ico svg { width: 100%; height: 100%; display: block; }
img.opt-ico { display: block; object-fit: contain; } /* 크기는 .opt-ico(자리별) 를 따른다 — 100% 로 늘어나 버튼을 키우지 않게 */
.dial-face .opt-ico { width: 36px; height: 36px; }
.seq-slot .opt-ico { width: 70%; height: 70%; }
/* sequence 버튼: 아이콘이 있으면 아이콘 위·이름 아래 (긴 이름이 찌그러지지 않게) */
.pad--seq .pad-btn:has(.opt-ico) { flex-direction: column; gap: 3px; padding: 6px 4px; min-height: 66px; }
.pad--seq .pad-btn:has(.opt-ico) > span:not(.opt-ico) { font-size: 12px; line-height: 1.2; text-align: center; }
/* 자물쇠 버튼·다이얼 이름: 숫자·단위(예 52°C)가 글자 중간에서 갈라지지 않게 — 띄어쓰기에서만 줄바꿈 */
.pad-btn span, .dial-name, .seq-slot, .dial-face { overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.pad--seq .pad-btn span:not(.opt-ico) { white-space: normal; text-align: center; line-height: 1.2; font-variant-numeric: tabular-nums; }
/* 기호 글꼴은 '대체'로만: 숫자·글자는 본문/제목 글꼴, 그 글꼴에 없는 기호만 Noto Sans Symbols(2) (이모지로는 안 감) */
.dial--symbols .dial-face, .seq-slot, .pad--seq .pad-btn span { font-family: var(--f-head), 'Noto Sans Symbols 2', 'Noto Sans Symbols', sans-serif; font-variant-numeric: normal; letter-spacing: 0; }

/* 색 + 무늬 아이콘(색약 대응): 색 동그라미 위에 무늬 */
.swatch--icon { display: grid; place-items: center; }
.swatch--icon .swatch-ico { width: 72%; height: 72%; }
.swatch--icon .swatch-ico svg, .swatch--icon img.swatch-ico { width: 100%; height: 100%; filter: drop-shadow(0 0 1px rgba(255,255,255,.7)); }
/* 기호 대체 글꼴: 본문·제목 글꼴에 없는 기호(⧉ ☿ 등)를 시스템 글꼴이 아닌 같은 웹폰트로 */
:root { --f-sym: 'Noto Sans Symbols 2', 'Noto Sans Symbols', 'Noto Sans Math'; }
body { font-family: var(--f-body), var(--f-sym), sans-serif; }
.cs-title, .sheet-title, .bar-name, .intro-title, .end-line, .end-title, .end-sub, .home-title, .notice-title, .acc-q, .person-name, .lv-name { font-family: var(--f-head), var(--f-sym), serif; }

/* 9칸 이상 다이얼(12칸 전보 등): 두 줄, 자리 번호, 4칸마다 틈. 숫자 패드가 있으면 위아래 버튼 숨김(패드·스와이프로 입력) */
.dial--long { flex-wrap: wrap; gap: 8px 5px; padding-left: 8px; padding-right: 8px; }
.dial--long .dial-col { flex: 0 0 calc((100% - (var(--per) - 1) * 5px - 8px) / var(--per)); }
.dial--long .dial-col--gap { margin-left: 8px; }
.dial--long .dial-face { font-size: 26px; }
.dial-idx { font-size: 10.5px; line-height: 1; color: #a89c86; font-variant-numeric: tabular-nums; }
.dial--long.dial--pad .dial-btn { display: none; }
.sheet--lock .dial--long .dial-wheel { height: 50px; }
.sheet--lock.is-compact .dial--long { row-gap: 3px; padding-top: 6px; padding-bottom: 6px; }
.sheet--lock.is-compact .dial--long .dial-wheel { height: 42px; }
.sheet--lock.is-compact .dial--long .dial-face { font-size: 23px; }
.sheet--lock.is-compact .dial--long .dial-col { gap: 2px; }

/* Q16/A20: 순서·기호 버튼 열은 늘 같은 폭(minmax(0,1fr)) — 긴 이름(「オレンジのベル」)이 열을 밀어 화면 밖으로 내보내지 않게. 이름은 칸 안에서 줄바꿈 */
.pad--seq { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.pad--seq .pad-btn { min-width: 0; padding-left: 6px; padding-right: 6px; }
.pad--seq .pad-btn > span:not(.opt-ico):not(.swatch) { min-width: 0; max-width: 100%; }
html[data-lang='ja'] .pad--seq .pad-btn span, html[data-lang='zh'] .pad--seq .pad-btn span,
html[data-lang='ja'] .dial-name, html[data-lang='zh'] .dial-name { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
/* 색 동그라미 + 이름 버튼: 그림 버튼처럼 동그라미 위·이름 아래(이름이 버튼 폭을 다 쓰게) */
.pad--seq .pad-btn:has(> .swatch):has(> span:not(.swatch)) { flex-direction: column; gap: 4px; padding: 6px 4px; min-height: 64px; }
.pad--seq .pad-btn:has(> .swatch) > span:not(.swatch) { font-size: 13px; line-height: 1.2; }
html[data-lang='ja'] .pad--seq .pad-btn:has(> .swatch) > span:not(.swatch), html[data-lang='zh'] .pad--seq .pad-btn:has(> .swatch) > span:not(.swatch) { font-size: 12.5px; letter-spacing: -0.02em; }
html[data-lang='en'] .pad--seq .pad-btn span, html[data-lang='ko'] .pad--seq .pad-btn span { overflow-wrap: break-word; }
/* 좁은 폰: 위쪽 제목 한 단계 더 작게(Q16 결정) */
@media (max-width: 370px) {
  .bar-name { font-size: 13px; }
  .bar-name[data-len='long'] { font-size: 12px; }
  .bar-name[data-len='xlong'] { font-size: 11px; }
}

/* 다이얼 칸이 좁을 때(색 8칸 등) 색 동그라미가 칸 밖으로 잘리지 않게 */
.dial--colors .dial-wheel { container-type: inline-size; padding-left: 0; padding-right: 0; }
.dial--colors .dial-face .swatch { width: min(34px, calc(100cqw - 4px)); height: min(34px, calc(100cqw - 4px)); }
/* 6칸 이상 다이얼의 이름: 작게, 영어는 하이픈 줄바꿈(긴 낱말이 옆 칸으로 넘치지 않게) */
.dial--many .dial-name { font-size: 11px; line-height: 1.2; letter-spacing: -0.01em; }
html[data-lang='en'] .dial-name { hyphens: auto; overflow-wrap: anywhere; }
.dial-name { max-width: 100%; }

/* 그림을 끝내 못 불러왔을 때: 깨진 아이콘 대신 조용한 자리 표시 */
img.img-failed { object-fit: cover; background: var(--c-surface, #1c1814); opacity: .85; }

/* Q19: 언어 버튼 터치 영역 최소 44×44 — 가로는 최소 폭(EN·中文 도 44px), 세로는 보이는 크기 그대로 두고 터치 영역만 44px */
.seg-btn { min-width: 44px; }
.seg-btn::after { inset: auto 0; top: 50%; height: max(100%, 44px); transform: translateY(-50%); }

/* 자물쇠 창 3단계(is-tight): 작은 폰(iPhone SE 375×667 등) + 긴 설명에서도 「열기」가 화면 안에 들어오게 */
.sheet--lock.is-tight .sheet-head { padding-top: 8px; }
.sheet--lock.is-tight .sheet-title { font-size: 16px; }
.sheet--lock.is-tight .lock-prompt { margin: 0 0 4px; font-size: 12.5px; line-height: 1.4; }
.sheet--lock.is-tight .lock-pic { margin-top: 0; margin-bottom: 6px; }
.sheet--lock.is-tight .numpad { gap: 6px; margin: 2px 0 6px; }
.sheet--lock.is-tight .numpad-key { min-height: 36px; font-size: 19px; }
.sheet--lock.is-tight .dial { padding: 4px 8px; }
.sheet--lock.is-tight .dial-wheel { height: 44px; }
.sheet--lock.is-tight .dial-face { font-size: 26px; }
.sheet--lock.is-tight .dial-btn { height: 24px; }
.sheet--lock.is-tight .pad-btn { min-height: 44px; }
.sheet--lock.is-tight .pad--seq .pad-btn:has(.opt-ico), .sheet--lock.is-tight .pad--seq .pad-btn:has(> .swatch) { min-height: 54px; padding-top: 4px; padding-bottom: 4px; }
.sheet--lock.is-tight .lock-go { min-height: 44px; }

/* 순서·기호 버튼의 그림 옵션: 40px(촘촘 단계 34px) */
.pad--seq .pad-btn .opt-ico { width: 40px; height: 40px; }
.sheet--lock.is-tight .pad--seq .pad-btn .opt-ico { width: 34px; height: 34px; }
/* 위쪽 사건 제목: 두 줄이면 줄 길이를 고르게(둘째 줄에 「工/房」처럼 한 글자만 남지 않게). 미지원 브라우저는 그대로. 한국어는 낱말 단위로 */
.bar-name { text-wrap: balance; }
html[data-lang='ko'] .bar-name { word-break: keep-all; }
.bar-name.is-3 { -webkit-line-clamp: 3; }
/* 6칸 이상 다이얼: 칸이 좁으면 그림·색 동그라미를 칸 폭에 맞춘다(M07 8칸 기호 다이얼) */
.dial--many .dial-wheel { container-type: inline-size; padding-left: 0; padding-right: 0; }
.dial--many .dial-face .opt-ico { width: min(36px, calc(100cqw - 4px)); height: min(36px, calc(100cqw - 4px)); }

/* ───────── R1 페르소나 QA: 접근성·줄바꿈·배치 ───────── */
/* 화면에는 안 보이고 스크린리더만 읽는 글(보기 창 그림 위 글자 등) */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* 핫스팟 포커스: 밝은 선 + 어두운 선을 겹쳐 밝은 자갈·나무 위에서도 보이게(키보드 포커스에만) */
.hs:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.78); }
/* 장면 이름·본문은 스크린리더 안내용 포커스 자리(테두리 없음) */
.scene-name:focus, main:focus { outline: none; }
/* 말풍선 「계속 ▸」은 버튼(키보드 Enter·Space) */
button.bubble-more { border: 0; font-family: inherit; line-height: 1.4; cursor: pointer; }
button.bubble-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bubble-body { flex: 1; min-width: 0; }
.bubble-tip { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
/* 초급 다이얼 자물쇠 조작 안내 */
.lock-howto { margin: -8px 0 10px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.sheet--lock.is-compact .lock-howto, .sheet--lock.is-tight .lock-howto { margin: -4px 0 4px; font-size: 11.5px; }
/* 힌트 주제 칩: 열 수 있는 주제가 둘 이상일 때 */
.hint-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.hint-chip { min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--ink-2); font-size: 13px; font-weight: 700; position: relative; }
.hint-chip::after { content: ''; position: absolute; inset: -4px 0; }
.hint-chip.is-on { background: var(--c-gold, #e8b54d); color: var(--c-on-gold, #1d1405); }
/* 무대 그림 늦게 옴 / 못 불러옴 */
.stage-load { position: absolute; inset: 0; z-index: 4; display: none; place-items: center; padding: 12px; border: 0; background: rgba(27, 23, 21, 0.55); color: #f3ead8; font-family: var(--f-dot); font-size: 13px; line-height: 1.5; text-align: center; pointer-events: none; }
.stage-load.is-on { display: grid; }
.stage-load.is-fail { pointer-events: auto; cursor: pointer; background: rgba(27, 23, 21, 0.82); font-family: var(--f-body); font-weight: 700; }

/* 일본어: 낱말 중간에서 꺾이지 않게(어절 단위). 한 어절이 칸보다 길 때만 그 안에서 꺾는다 */
html[data-lang='ja'] :is(.intro-tag, .intro-text p, .bubble-text, .bubble-tip, .bar-name, .sheet-title, .lock-prompt, .lock-howto, .show-cap, .show-tip, .end-text, .end-sub, .ending li p, .explain p, .stage-ov, .hint-text, .hint-topic) { word-break: auto-phrase; overflow-wrap: anywhere; }
/* 다이얼 이름(「マゼンタ」 등): 일본어·중국어는 조금 작게, 어절 단위로 */
html[data-lang='ja'] .dial-name, html[data-lang='zh'] .dial-name { font-size: 11.5px; letter-spacing: -0.03em; }
html[data-lang='ja'] .dial-name { word-break: auto-phrase; }
/* 중국어: 위 제목·도입 소개가 낱말 가운데서 끊기지 않게 줄 길이를 고르게 */
html[data-lang='zh'] :is(.bar-name, .intro-tag, .sheet-title) { text-wrap: balance; }
html[data-lang='zh'] :is(.bubble-text, .end-text, .lock-prompt) { text-wrap: pretty; }
.lock-prompt { text-wrap: pretty; }

/* 메뉴의 「언어」 라벨: 쪼개지지 않게. 좁은 폰에서는 언어 버튼 묶음을 다음 줄로 */
.menu-row--seg > span { white-space: nowrap; overflow-wrap: normal; hyphens: none; }
@media (max-width: 399px) {
  .menu-row--seg { flex-wrap: wrap; }
  .menu-row--seg .seg { flex-basis: 100%; display: flex; }
  .menu-row--seg .seg-btn { flex: 1; }
}

/* 물건 획득 알림: 확대 장면의 「돌아가기」를 덮지 않게 장면 막대 아래(그림 위쪽 안)로 */
.page-play .toast { top: calc(var(--sat) + 112px); pointer-events: none; }

/* 자물쇠 그림의 「크게 보기」 표시: 작고 반투명하게(지도 칸·방위 글자를 덜 가림) */
.lock-pic-zoom { width: 24px; height: 24px; right: 4px; bottom: 4px; opacity: 0.7; }
.lock-pic-zoom .ico { width: 14px; height: 14px; }
.lock-pic.is-thumb .lock-pic-zoom { width: 20px; height: 20px; right: 2px; bottom: 2px; }
/* 「크게 보기」 표시는 그림 바깥 오른쪽 아래(그림 틀 밖 4px)에 — 그림 오른쪽 아래 단서(M07 열 번호 「8」 등)를 가리던 것(R3-019).
   잘라 내기(둥근 모서리)는 그림 쪽이 맡고, 단추 자리만큼 아래 여백을 둔다 */
.lock-pic { overflow: visible; margin-bottom: 32px; }
.lock-pic > .stage { border-radius: 6px; }
.lock-pic-zoom, .lock-pic.is-thumb .lock-pic-zoom { top: calc(100% + 4px); bottom: auto; right: 0; width: 24px; height: 24px; opacity: 0.8; }
.sheet--lock.is-tight .lock-pic { margin-bottom: 30px; }

/* 순서 입력 자물쇠의 글자 칸(「冷蔵庫」「ヒーター」): 가로로 긴 칸, 안쪽 여백 */
.seq--txt .seq-slot { flex: 1 1 0; min-width: 0; aspect-ratio: auto; min-height: 46px; padding: 4px 6px; font-size: 14px; line-height: 1.15; letter-spacing: -0.02em; text-align: center; }
.sheet--lock.is-compact .seq--txt .seq-slot { min-height: 40px; font-size: 13px; }

/* 고대비(forced-colors): 색 자체가 정보인 견본은 칠한 색 그대로 */
@media (forced-colors: active) {
  .swatch, .pad-btn[style*='--c'], .dial--colors .dial-face { forced-color-adjust: none; }
}

/* 글자 150% 확대 등 아주 좁은 폭(260px): 위 제목 최소 폭, 힌트는 아이콘만, 짧은 표기는 꺾지 않음 */
.bar-title { min-width: 5em; }
.badge, .cs-kicker > span, .seg-btn, .lv-count, .status, .status-sub, .end-actions .btn, .end-foot .btn, .clock { white-space: nowrap; }
.cs-kicker { flex-wrap: wrap; row-gap: 2px; }
.end-foot { flex-wrap: wrap; }
/* 위 막대는 340px 미만부터(사파리 125% 확대 312px 에서 메뉴 버튼이 8px 잘리던 것, R3-017) */
@media (max-width: 339px) {
  .hint-btn .hint-label { display: none; }
  .hint-btn { padding-inline: 9px; margin-left: 0; }
  .bar { gap: 2px; padding-left: 2px; padding-right: 2px; }
  .bar .icon-btn { width: 36px; }
  .bar .clock { padding-inline: 4px; font-size: 12px; }
  .bar-title { min-width: 4em; }
}
@media (max-width: 300px) {
  .home-tools { flex-wrap: wrap; }
}

/* 200% 확대 등 낮은 화면(높이 480px 이하): 장면을 최소 높이로 두고 페이지를 세로로 스크롤. 말풍선은 장면 아래로 흐름 */
@media (max-height: 480px) {
  .page-play .app { height: auto; min-height: 100dvh; overflow: visible; }
  .page-play .play--escape { flex: none; }
  .page-play .play--escape .stage-area { flex: none; }
  .page-play .play--escape .stage-wrap { flex: none; height: min(60vh, 420px); min-height: 220px; }
  body.page-play { place-items: start center; } /* 가운데 정렬이면 넘친 위쪽(위 막대)이 스크롤로도 안 보인다 */
  /* 도입·엔딩 넘기기(R3-001): 부모 높이가 내용만큼이라 absolute 로 덮으면 높이 0 → 흐름 안에서 화면 높이만큼. 「다음」 줄은 화면 아래에 붙는다(sticky) */
  .page-play .play > .intro { position: relative; inset: auto; flex: 1 0 auto; min-height: calc(100dvh - 60px - var(--sat)); overflow: visible; }
  .page-play .play:has(> .intro) { flex: 1 0 auto; }
  .page-play .intro-photo img { max-height: 40vh; }
  /* 창·알림(R3-002): 페이지가 화면보다 길어도 긴 페이지 바닥이 아니라 화면 아래에. 넘치는 내용은 창 안에서 스크롤 */
  .page-play .sheet-root { position: fixed; inset: 0; margin: 0 auto; width: 100%; max-width: calc(100dvh * 9 / 16); min-width: min(100%, 360px); }
  .page-play .toast { position: fixed; }
  .page-play .sheet { max-height: calc(100dvh - 12px); }
  /* 자물쇠 창은 그림·다이얼·숫자패드가 창 높이(약 330px)를 넘어 본문이 창 안에서 스크롤된다 → 「열기」는 늘 창 아래에 보이게 */
  .page-play .sheet--lock .sheet-body:has(.lock-go-bar) { padding-bottom: 0; } /* 「열기」 줄은 .lock-ctl(display: contents) 안 */
  .page-play .sheet--lock .lock-go-bar { position: sticky; bottom: 0; z-index: 2; margin: 0 -22px; padding: 0 22px calc(12px + var(--sab)); background: #110e0b; }
  .page-play .sheet--lock .lock-go-bar::before { content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px; background: linear-gradient(rgba(17, 14, 11, 0), #110e0b); pointer-events: none; }
}
/* 필름 칸이 아주 작으면 「FILM 400 ▸ 01A」는 숨긴다(액자 밖으로 넘치지 않게) */
@container (max-height: 240px) { .film-mark { display: none; } }

/* 태블릿 가로·넓은 화면(1000px 이상 가로, 높이 540px 이상 — 1280×800 노트북 브라우저 안쪽 690px 포함, R3-004): 플레이는 왼쪽 장면 + 오른쪽 360px 열, 목록은 2열 */
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 540px) {
  .page-play .app { max-width: min(1180px, 96vw); }
  .page-home .app { max-width: min(920px, 92vw); }
  .page-home .cs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  .page-home .cs-row:last-child { border-bottom: 1px solid var(--line); }
  .play--escape { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: 'stage bar' 'stage hold' 'stage msg' 'stage bag'; }
  .play--escape > .scene-bar { grid-area: bar; padding-top: 14px; }
  .play--escape > .stage-area { display: contents; }
  .play--escape .stage-wrap { grid-area: stage; min-height: 0; padding: 14px 12px 14px 18px; }
  .play--escape .catcher { grid-area: stage; }
  .play--escape .stage-area > .bubble { grid-area: msg; align-self: start; margin: 8px 12px; }
  .play--escape > .hold { grid-area: hold; }
  .play--escape > .bag { grid-area: bag; flex-wrap: wrap; overflow: visible; align-content: flex-start; border-top: 1px solid var(--line); }
  .play--escape > .intro { grid-column: 1 / -1; grid-row: 1 / -1; }
  /* 장면 외의 화면(도입·결과·추리·창)은 읽기 좋은 폭으로 가운데 */
  .intro { padding-inline: max(20px, calc(50% - 300px)); }
  .page-play .ending, .page-play .notice { width: 100%; max-width: 640px; margin-inline: auto; }
  .play--deduce { width: 100%; max-width: 600px; margin-inline: auto; }
  .sheet { align-self: center; width: min(100%, 620px); border-radius: 22px 22px 0 0; }
}
/* 마우스·터치로 쓰는 동안은 스크립트가 옮긴 포커스의 테두리를 감춘다(키보드를 누르면 다시 보임 — js/ui.js 가 html.is-pointer 를 붙였다 뗌) */
html.is-pointer :focus-visible { outline: none; }
html.is-pointer .hs:focus-visible { box-shadow: none; }

/* ───────── R2 페르소나 QA: 다크 강제·작은 화면·키보드·한 손·줄바꿈 ───────── */
/* 브라우저 강제 다크(삼성 인터넷·Chrome 웹 콘텐츠 다크)가 그림 위 단서 글씨 색을 뒤집지 않게(meta color-scheme 과 같은 값) */
:root { color-scheme: only dark; } /* 2026-11-14 シネマ: 스스로 어두운 화면 — 브라우저 강제 다크가 덧칠하지 않게(meta 와 같은 값) */

/* 도입·엔딩 넘기기: 쪽 번호 + 「다음」 줄을 모든 쪽에서 화면 아래에 고정(작은 화면 1쪽에서 버튼이 화면 밖으로 밀리던 것) */
.intro { padding-bottom: 0; }
.intro-foot {
  position: sticky; bottom: 0; z-index: 1;
  margin: 0 -20px; padding: 16px 20px calc(18px + var(--sab));
  background: var(--paper);
}
.intro.is-scroll .intro-foot { box-shadow: 0 -12px 14px -12px rgba(0, 0, 0, 0.7); } /* 내용이 넘칠 때만: 아래로 더 있다는 표시 */
@media (max-height: 760px) {
  .intro-photo img { max-height: 34vh; object-fit: cover; }
}
/* 사진이 오기 전: 「현상 중…」 + 은은한 현상 무늬(느린 회선에서 하얀 빈 카드로 보이던 것) */
.intro-photo { position: relative; }
.intro-photo.is-loading img { background: linear-gradient(110deg, #e6dccb 30%, #f1e9da 50%, #e6dccb 70%) 0 0 / 300% 100%; animation: develop 1.6s ease-in-out infinite; }
.intro-photo.is-loading::after {
  content: attr(data-loading); position: absolute; left: 10px; right: 10px; top: 10px; bottom: 34px;
  display: grid; place-items: center; font-family: var(--f-dot); font-size: 13px; color: #685c50;
  opacity: 0; animation: fadein 200ms ease 300ms forwards; /* 금방 오는 그림에서 글자가 번쩍이지 않게 */
}
@keyframes develop { 50% { background-position: 100% 0; } }
@keyframes fadein { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .intro-photo.is-loading img { animation: none; } .intro-photo.is-loading::after { animation: none; opacity: 1; } }

/* 시트: 닫히는 동안(0.2초)은 막·창이 탭을 받지 않는다 — 닫자마자 누른 핫스팟이 씹히던 것 */
.sheet-root.is-closing, .sheet-root.is-closing .sheet-back, .sheet-root.is-closing .sheet { pointer-events: none; }
/* 손잡이·제목 줄을 끌어내려 닫기(js/ui.js). 닫을 수 없는 창(이어하기 등)은 손잡이를 숨긴다 */
.sheet-root:not([data-locked]) .sheet-head { touch-action: none; }
.sheet-root[data-locked] .sheet::before { display: none; }
/* 창이 열린 동안 뜬 알림: 창 제목·그림 대신 아래 버튼 줄 위에 */
.toast.is-low, .page-play .toast.is-low { top: auto; bottom: calc(var(--sab) + 88px); }
/* 대사가 있는 보기 창: 창 머리 위 어두운 띠로(R3-013) */
.toast.is-low.is-top, .page-play .toast.is-low.is-top { top: calc(var(--sat) + 8px); bottom: auto; }

/* 힌트: 연 힌트 문장으로 포커스를 옮긴다(테두리 없음) */
.hint-text:focus { outline: none; }

/* 결과 화면: 다시 풀어 더 느렸을 때 최고 기록 */
.stats-best { margin: 0; font-family: var(--f-dot); font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }

/* 작은 글자 대비 4.5:1 이상: 초급 배지(4.01 → 5.05), 힌트 단계 번호(4.39 → 5.36) */
.type-mark--beginner { background: #4f6a45; }
.hint-no { color: var(--ink-2); }

/* 물건을 든 안내: 세 줄까지(150% 확대에서 동사가 잘리던 것). 「調べる」는 300px 이하에서 돋보기 아이콘만 */
.hold-text { -webkit-line-clamp: 3; }
.hold-inspect .ico { display: none; }
@media (max-width: 300px) {
  .hold-inspect { padding-inline: 10px; }
  .hold-inspect .ico { display: block; }
  .hold-inspect-label { display: none; }
}

/* 일본어·중국어 어절 줄바꿈: 목록 카드 제목·소개, 보기 창 대사, 오답 문구, 이어하기 안내, 든 물건 안내 */
html[data-lang='ja'] :is(.cs-title, .cs-lead, .show-say p, .lock-status, .sheet-lead, .hold-text, .toast, .shop-lead, .tk-note, .tk-empty, .notice-text, .tk-have-k) { word-break: auto-phrase; overflow-wrap: anywhere; }
html[data-lang='zh'] :is(.lock-status, .show-say p, .hold-text, .toast) { text-wrap: pretty; }
/* 티켓 창·잠금 화면 안내: 마지막 한두 글자만 다음 줄로 넘어가지 않게(「再领1|张。」「重|玩。」, 모든 언어) */
:is(.shop-lead, .tk-note, .tk-empty, .notice-text) { text-wrap: pretty; }
.lock-status { text-wrap: pretty; }

/* 목록 머리(「脱出ゲーム」 + 「初級 · 0 / 20 解決済み」): 제목은 한 줄로, 칸이 모자라면 오른쪽 수를 아래 줄로 */
.cs-head { flex-wrap: wrap; row-gap: 0; }
.cs-head > span:first-child { flex: 1 0 auto; white-space: nowrap; }
.cs-head-n { white-space: nowrap; }
/* 영어 카드 제목: 아무 데서나(「Aquariu/m」) 대신 낱말 사이·하이픈에서 */
html[data-lang='en'] .cs-title { overflow-wrap: break-word; hyphens: auto; }
/* 150% 확대 등 340px 미만: 카드 썸네일을 줄여 제목 칸 확보, 레벨 탭 2×2, 언어 버튼 여백 줄임 */
@media (max-width: 339px) {
  .cs-row { grid-template-columns: 64px minmax(0, 1fr) 16px; gap: 10px; }
  .cs-thumb { width: 64px; }
  .cs--level .cs-glyph { font-size: 26px; }
  .lv-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .lv-ind { display: none; }
  .lv-tab.is-on { background: var(--film); box-shadow: inset 0 0 0 1px rgba(232, 181, 77, .35); }
  .seg-btn, .home-tools .seg-btn { padding-inline: 6px; }
}

/* 작은 화면(폭 320px 미만, 또는 폰 폭에서 높이 640px 이하 — 150% 확대·375×548 등): 긴 목표 대사가 장면을 우표 크기로 밀어내지 않게.
   말풍선은 높이 상한 + 안 스크롤, 장면 칸은 최소 크기를 지키고 모자라는 높이는 세로 스크롤 */
@media (max-width: 319px), (max-height: 640px) and (max-width: 599px) {
  /* 화면 높이는 그대로 두고(장면 칸 높이가 정해져야 그림 크기 계산이 된다) 넘치는 만큼 화면 틀 안에서 세로 스크롤 */
  .page-play .app { overflow-y: auto; overscroll-behavior: contain; }
  .page-play .play--escape, .page-play .play--escape .stage-area { min-height: auto; }
  .page-play .play--escape .stage-wrap { min-height: max(220px, min(48vh, 300px)); }
  .page-play .play--escape .stage-area > .bubble { max-height: 28vh; overflow-y: auto; }
  /* 페이지가 길어져도 창은 화면 아래에(목록의 shop.css 방식) */
  .page-play .sheet-root { position: fixed; inset: 0; margin: 0 auto; width: 100%; max-width: calc(100dvh * 9 / 16); min-width: min(100%, 360px); }
  .page-play .toast { position: fixed; }
}
/* 폰 배치: 물건을 든 안내 줄(.hold)은 흐름 밖으로 — 소지품 막대 바로 위에 겹쳐 띄운다. 끼어들면 장면이 14% 줄고 핫스팟이 36px 올라가 헛누름이 나던 것(R3-010).
   넓은 화면(grid 의 hold 칸)과 높이 480px 이하(페이지 스크롤) 배치는 그대로 */
@media (min-height: 481px) {
  .play--escape > .hold { position: absolute; left: 0; right: 0; bottom: max(78px, calc(77px + var(--sab))); z-index: 5; box-shadow: 0 -6px 18px rgba(27, 23, 21, 0.18); }
}
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 540px) {
  .play--escape > .hold { position: static; box-shadow: none; }
}
/* 높이 480px 이하(세로 200% 확대 390×420 등)는 틀 높이가 내용만큼이라 틀 안 스크롤이 없다 — 페이지가 스크롤되게 두어야 도입 「다음」 줄이 화면 아래에 붙는다(R3-001) */
@media (max-height: 480px) { .page-play .app { overflow: visible; } }

/* 결과 카드 창: 좁은 폭에서 버튼 글자가 「공유 / 하기」로 꺾이지 않게. 300px 미만은 세로로 쌓는다 */
.sheet--share .btn { white-space: nowrap; }
.sheet--share .btn-row { flex-wrap: wrap; }
@media (max-width: 299px) { .sheet--share .btn-row .btn { flex: 1 1 100%; } }

/* 데스크톱(넓은 가로 화면): 보기 창만 넓게, 그림은 창 높이 안에서 크게(쪽지·장부 글씨가 9px 이던 것). 자물쇠·힌트 창은 그대로 */
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 540px) {
  .sheet.sheet--show { width: min(100%, 960px, 80vw); }
  .sheet--show .show-pic .stage, .sheet--show .show-pic .stage.is-wide, .sheet--show .show-pic .stage.is-square { width: min(100%, calc(70vh * var(--ar, 0.75))); }
}
/* 영어 폰 화면: 레벨 이름(Intermediate 등) 길이에 따라 목록 머리가 한 줄·두 줄로 출렁이지 않게 수는 늘 아래 줄 */
@media (max-width: 479px) { html[data-lang='en'] .cs--level .cs-head-n { flex-basis: 100%; } }
/* 목록 맨 위 브랜드 이름: 낱말 가운데서 꺾지 않는다(150% 확대 260px 에서 「Detectiv/e」 이던 것) */
.home-title { overflow-wrap: normal; hyphens: none; word-break: keep-all; }
@media (max-width: 339px) { .home-title { font-size: 20px; } .home-hero { gap: 14px; } }

/* 폰 세로 화면(폭 600px 미만): 화면 틀을 화면 폭 그대로. 9:16 상한은 데스크톱 카드 배치용이라 사파리 실제 높이(390×664)에서 양옆에 8px 띠가 남던 것(R3-016) */
@media (max-width: 599px) and (orientation: portrait) {
  .app { max-width: 100%; }
  .page-play .sheet-root { max-width: 100%; }
}

/* ───────── R4 페르소나 QA: 화면·앱·번역 ───────── */
/* 그림을 끝내 못 불러온 장면: 오류 안내 뒤로 그림 위 글(「小屋の錠：…」)이 비쳐 겹치지 않게 불투명하게 */
.stage-load.is-fail { background: #14110e; }
/* 자물쇠 설명 속 화살표(↑ = 北): 아래 화살표 패드와 같은 선 아이콘(js/lock.js) — 글꼴의 전각 화살표가 가늘고 양옆이 넓던 것 */
.lock-arrow { display: inline-block; line-height: 1; vertical-align: -0.17em; margin: 0 -0.12em; } /* 아이콘 양옆 여백(viewBox)만큼 당겨 글자 간격처럼 */
.lock-arrow .ico { width: 1.12em; height: 1.12em; stroke-width: 2.4; }
/* 자물쇠 그림 아래 「크게 보기」 아이콘: 그림 틀 밖으로 옮긴 뒤(R3-019) 누름이 아래 본문으로 빠지던 것 → 누르면 그림 버튼으로 전달 */
.lock-pic-zoom, .lock-pic.is-thumb .lock-pic-zoom { pointer-events: auto; cursor: zoom-in; }
.lock-pic-zoom::after { content: ''; position: absolute; inset: -8px; } /* 터치 영역 40px */
/* 보기 창의 「크게 보기」 단추도 그림 틀 밖 오른쪽 아래로(그림 안 오른쪽 아래 글자·숫자 「12」「4」를 가리던 것) */
.show-pic { overflow: visible; margin-bottom: 42px; }
.show-pic-zoom { top: calc(100% + 6px); bottom: auto; right: 0; }
/* 말풍선 「눌러서 계속 ▸」: 글 옆 칸(약 100px)을 차지해 마지막 대사가 두 줄로 갈리던 것 → 글 아래 줄 오른쪽 */
.bubble { flex-wrap: wrap; row-gap: 2px; }
.bubble > .bubble-text, .bubble > .bubble-body { flex: 1 1 calc(100% - 46px); min-width: 0; }
.bubble.is-narr > .bubble-text, .bubble.is-narr > .bubble-body { flex-basis: 100%; }
.bubble > .bubble-more { margin-left: auto; }
/* 장면 필름 띠(「FILM 400 ▸ 上級 09」): 좁은 장면에서 틀 밖으로 넘치지 않게 */
.film-mark { max-width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; }
/* 소지품이 넘치면(가로 스크롤) 넘친 쪽 끝을 흐리게 — 화면 밖에 물건이 더 있다는 표시(js/escape.js markBagOverflow) */
.bag.is-more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.bag.is-more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.bag.is-more-l.is-more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
/* 폰 세로: 소지품 위에 겹쳐 뜨는 「〈렌즈〉를 쓸 곳」 줄이 직전 대사의 아래 줄을 덮던 것 → 그 줄이 떠 있는 동안 대사를 줄 높이만큼 위로(--hold-h: js) */
@media (min-height: 481px) {
  .play--escape .stage-area > .bubble { transition: transform 200ms var(--ease-out); }
  .play--escape:has(> .hold.is-on) .stage-area > .bubble.is-on { transform: translateY(calc(-1 * var(--hold-h, 52px))); }
}
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 540px) {
  .play--escape:has(> .hold.is-on) .stage-area > .bubble.is-on { transform: none; }
}
/* 도입·엔딩 쪽 아래 줄: 왼쪽에 소리 단추 + 쪽 번호(처음 소리가 나는 곳에서 바로 끌 수 있게) */
.intro-foot-l { display: inline-flex; align-items: center; gap: 2px; margin-left: -10px; }
.intro-sound { color: var(--muted); }
.intro-sound .ico { width: 20px; height: 20px; }
/* 일본어 본문의 「……」: Zen Maru Gothic 은 글자 아래에 붙은 좁은 점(......)으로 그린다 → U+2026 만 시스템 일본어 글꼴(가운데 높이 ⋯⋯) */
@font-face {
  font-family: 'JaDots';
  src: local('Hiragino Maru Gothic ProN W4'), local('HiraMaruProN-W4'), local('Hiragino Sans W3'), local('HiraginoSans-W3'),
    local('Yu Gothic Medium'), local('YuGothic-Medium'), local('Yu Gothic'), local('Meiryo'),
    local('Noto Sans CJK JP'), local('Noto Sans CJK JP Regular'), local('NotoSansCJKjp-Regular'), local('Noto Sans JP Regular'), local('NotoSansJP-Regular');
  unicode-range: U+2026;
}
html[data-lang='ja'] { --f-body: 'JaDots', var(--f-ui, 'Zen Kaku Gothic New'), sans-serif; }
/* 넓은 화면: 글자 없는 편지지·메모 그림(그림 위 글 없음 + 캡션)이 보기 창을 다 차지해 캡션(실제 내용)이 화면 밖에 있던 것 → 그림 오른쪽에 글 */
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 540px) {
  .sheet--show .sheet-body:has(> .show-text):has(> .show-pic .stage-ov:empty) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); column-gap: 24px; align-items: start; }
  .sheet--show .sheet-body:has(> .show-text):has(> .show-pic .stage-ov:empty) > .show-pic { grid-column: 1; grid-row: 1; }
  .sheet--show .sheet-body:has(> .show-text):has(> .show-pic .stage-ov:empty) > .show-text { grid-column: 2; grid-row: 1; padding-top: 6px; }
}
/* 자물쇠 창 두 묶음(js/lock.js): 보통은 한 줄로 쌓인다 */
.lock-info, .lock-ctl { display: contents; }

/* 폰 가로(높이 480px 이하): 가운데 360px 세로 기둥이라 장면이 127px, 소지품 줄·첫 대사가 화면 밖이던 것 →
   왼쪽 장면(화면 높이에 맞춤) + 오른쪽 기둥(장면 이름·대사·든 물건·소지품). 페이지는 스크롤하지 않는다 */
@media (orientation: landscape) and (max-height: 480px) and (min-width: 560px) {
  body.page-play { display: block; }
  .page-play .app { max-width: 100%; min-width: 0; height: 100dvh; min-height: 0; overflow: hidden; border-radius: 0; box-shadow: none; }
  .page-play .bar { min-height: 50px; padding-top: calc(var(--sat) + 2px); padding-bottom: 2px; padding-left: max(6px, env(safe-area-inset-left, 0px)); padding-right: max(6px, env(safe-area-inset-right, 0px)); }
  .page-play .play--escape { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-areas: 'stage bar' 'stage hold' 'stage msg' 'stage bag'; }
  .page-play .play--escape > .scene-bar { grid-area: bar; min-height: 40px; padding: 4px 12px 0 6px; }
  .page-play .play--escape > .stage-area { display: contents; }
  .page-play .play--escape .stage-wrap { grid-area: stage; flex: none; height: auto; min-height: 0; padding: 6px 6px 6px max(10px, env(safe-area-inset-left, 0px)); }
  .page-play .play--escape .catcher { grid-area: stage; }
  .page-play .play--escape .stage-area > .bubble { grid-area: msg; align-self: start; margin: 4px 10px 6px 4px; min-height: 0; max-height: 100%; overflow-y: auto; transform: none; }
  .page-play .play--escape > .hold { grid-area: hold; position: static; box-shadow: none; margin: 2px 10px 4px 4px; }
  .page-play .play--escape > .bag { grid-area: bag; flex-wrap: wrap; overflow: visible; align-content: flex-start; gap: 6px; min-height: 0; padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + var(--sab)) 6px; border-top: 1px solid var(--line); -webkit-mask-image: none; mask-image: none; }
  .page-play .play--escape > .bag .slot { width: 50px; height: 50px; padding: 5px; }
  .page-play .play--escape > .intro { grid-column: 1 / -1; grid-row: 1 / -1; }
  /* 도입·엔딩 넘기기: 사진 왼쪽 + 글 오른쪽(본문이 사진 아래 화면 밖으로 밀려 「다음」만 보이던 것). 쪽 안에서만 스크롤 */
  .page-play .play > .intro { position: absolute; inset: 0; min-height: 0; overflow-y: auto; padding: 8px max(24px, calc(50% - 380px)) 0; }
  .page-play .play:has(> .intro) { flex: 1 1 auto; }
  .page-play .intro-head { margin: 2px 0 6px; }
  .page-play .intro-title { font-size: 21px; }
  .page-play .intro-card { flex: 1 0 auto; flex-direction: row; align-items: center; justify-content: center; gap: 22px; padding: 6px 0 4px; min-height: 0; }
  .page-play .intro-photo { flex: 0 0 auto; width: auto; margin: 0; padding: 7px 7px 22px; }
  .page-play .intro-photo img { width: auto; height: auto; max-width: min(42vw, 320px); max-height: calc(100dvh - 236px); min-height: 90px; aspect-ratio: 4 / 3; }
  .page-play .intro-text { flex: 1 1 0; min-width: 0; max-width: 460px; }
  .page-play .intro-text:not(.is-hana) p { text-align: left; }
  .page-play .intro-foot { margin: 0 calc(-1 * max(24px, calc(50% - 380px))); padding: 8px max(24px, calc(50% - 380px)) calc(8px + var(--sab)); }
  /* 창: 화면 폭을 쓰는 가운데 창 */
  .page-play .sheet-root { max-width: 100%; min-width: 0; }
  .page-play .sheet { align-self: center; width: min(100%, 720px); }
  .page-play .sheet-head { padding-top: 14px; }
  /* 자물쇠 창: 그림·설명 | 다이얼·숫자 패드·열기 두 단. 숫자 패드가 있으면 다이얼 위아래 단추는 숨김(패드·밀어 올리기로 입력) */
  .page-play .sheet--lock .sheet-body:has(> .lock-info > *) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 18px; align-items: start; padding-bottom: 0; }
  .page-play .sheet--lock .lock-info, .page-play .sheet--lock .lock-ctl { display: block; min-width: 0; }
  .page-play .sheet--lock .lock-info { position: sticky; top: 0; }
  .page-play .sheet--lock .lock-ctl:has(.numpad) .dial:not(.dial--long) .dial-btn { display: none; }
  .page-play .sheet--lock .lock-ctl .numpad { gap: 5px; margin: 4px 0 6px; }
  .page-play .sheet--lock .lock-ctl .numpad-key { min-height: 38px; font-size: 19px; }
  .page-play .sheet--lock .sheet-body:has(> .lock-info > *) .lock-go-bar { margin: 0; padding: 0 0 calc(10px + var(--sab)); }
  .page-play .sheet--lock .sheet-body:has(.lock-go-bar) { padding-bottom: 0; }
  /* 보기 창: 그림(화면 높이에 맞춤) | 글 */
  .page-play .sheet--show .show-pic .stage, .page-play .sheet--show .show-pic .stage.is-wide, .page-play .sheet--show .show-pic .stage.is-square, .page-play .sheet--show .show-pic .stage.fit-h { width: min(100%, calc((100dvh - 150px) * var(--ar, 0.75))); }
  .page-play .sheet--show .sheet-body:has(> .show-text) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr); column-gap: 18px; align-items: start; }
  .page-play .sheet--show .sheet-body:has(> .show-text) > .show-pic { grid-column: 1; grid-row: 1; margin-inline: 0; }
  .page-play .sheet--show .sheet-body:has(> .show-text) > .show-text { grid-column: 2; grid-row: 1; }
  /* 결과·추리·안내 화면은 읽기 좋은 폭으로 가운데 */
  .page-play .ending, .page-play .notice { width: 100%; max-width: 640px; margin-inline: auto; }
  .page-play .play--deduce { width: 100%; max-width: 600px; margin-inline: auto; }
  .page-play .toast { top: calc(var(--sat) + 58px); }
}
/* ───────── R5 페르소나 QA ───────── */
/* 줄 가운데서 끊지 않을 덩어리: 자물쇠 안내의 괄호 묶음 「（↑＝北）」, 힌트·해설의 화살표 나열 「← ↑ → ↓」(js/ui.js arrowNodes·lock.js) */
.nowrap { white-space: nowrap; }
/* 든 물건 내려놓기: 「調べる」 칩과 같은 모양 + 글자(しまう). 300px 이하는 × 아이콘만, 터치 영역 44px 이상(R5-010) */
.hold-release { justify-content: center; min-width: 40px; }
.hold-release .ico { display: none; }
@media (max-width: 300px) {
  .hold-release { padding-inline: 10px; }
  .hold-release .ico { display: block; }
  .hold-release-label { display: none; }
}
/* 넓은 화면: 그림 위 글이 있는 보기 창도 캡션이 길면(운행 도표의 규칙 ①~④ 등, js/escape.js is-long) 그림 오른쪽에 글 — 규칙이 첫 화면 아래로 밀리던 것(R5-017) */
@media (min-width: 1000px) and (orientation: landscape) and (min-height: 540px) {
  .sheet--show .sheet-body:has(> .show-text.is-long) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr); column-gap: 24px; align-items: start; }
  .sheet--show .sheet-body:has(> .show-text.is-long) > .show-pic { grid-column: 1; grid-row: 1; }
  .sheet--show .sheet-body:has(> .show-text.is-long) > .show-text { grid-column: 2; grid-row: 1; padding-top: 6px; }
}
/* ───────── R6 ───────── */
/* 영어 레벨 탭: 「Intermediate」(12.5px 80px)가 4등분 칸(360px 폭 72px)보다 길다 → 좁은 폰에서만 글자를 조금 줄이고 칸 여백을 줄여 한 줄에.
   안드로이드 글자 크게(1.3배 등)로 그래도 넘치면 칸 안에서 하이픈으로 줄을 바꾼다(탭 줄이 넘쳐 「Master」가 잘리던 것) */
html[data-lang='en'] .lv-tab { padding-inline: 2px; }
html[data-lang='en'] .lv-name { font-size: min(12.5px, 3.2vw); white-space: normal; hyphens: manual; overflow-wrap: anywhere; text-align: center; } /* 꺾을 자리는 js/index.js LV_SHY 의 소프트 하이픈 */
@media (max-width: 339px) {
  html[data-lang='en'] .lv-name { font-size: 12.5px; } /* 2×2 탭: 칸이 넓다 */
}
/* 일본어 목록 카드 제목(360px 폭에서 칸 180px): 「クリスマス脱出ゲーム」 같은 10자 어절이 칸보다 길어 글자 단위로 꺾이던 것(「…ゲー|ム」) → 좁은 폰에서만 조금 작게 */
@media (max-width: 370px) {
  html[data-lang='ja'] .cs-title { font-size: 16.5px; letter-spacing: 0; }
}
