/* 미니 추리 게임 — 디자인 컨셉: 원목 진열 상자 + 크라프트지 사건 파일 + 손글씨 메모
 * 화면: 헤더 / 무대(3D 디오라마) / 독(아래 메뉴). 모바일은 세로 화면 전용. */
:root {
  --bg: #1f1813; --bg2: #2a2019; --wood: #6b4a32; --wood-l: #8a6242;
  --kraft: #caa77a; --kraft-d: #a8865a; --paper: #f7f0e1; --paper2: #ede1c8; --ink: #2b221b; --ink2: #6f604f;
  --cream: #f4e8d2; --muted: #b3a18a; --line: rgba(244,232,210,.14);
  --accent: #d9653f; --teal: #22b39c; --teal-d: #138a77; --gold: #f2c46b; --red: #d6503f;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Gowun Batang", "AppleMyungjo", serif;
  --hand: "Nanum Pen Script", "Gaegu", cursive;
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom);
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--cream); }
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none;
  padding: var(--sat) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  background: radial-gradient(900px 520px at 50% -10%, #3a2a1e 0%, transparent 70%), var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); font-size: 13px; }

/* ───────── 헤더 ───────── */
#hdr { flex: none; display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px; position: relative; z-index: 25; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand small { display: block; font-size: 10.5px; letter-spacing: 2px; color: var(--muted); }
.brand b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 30px; height: 30px; flex: none; background: url(../icon.png) center/cover no-repeat; border-radius: 9px; }
.logo.big { width: 64px; height: 64px; border-radius: 16px; display: inline-block; }
.hstat { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--gold); background: rgba(0,0,0,.25); padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.hbtn { background: rgba(244,232,210,.08); border: 1px solid var(--line); border-radius: 10px; width: 38px; height: 34px; font-size: 15px; display: grid; place-items: center; }
.hbtn.off { opacity: .7; }

/* ───────── 무대 (3D) ───────── */
#stage { flex: 1; min-height: 0; position: relative; margin: 0 10px; border-radius: 20px; overflow: hidden; background: #241b15;
  box-shadow: inset 0 0 0 1px rgba(255,230,190,.10), 0 0 0 5px #3a2a1e, 0 0 0 6px rgba(255,230,190,.08), 0 14px 34px rgba(0,0,0,.5); }
#world { position: absolute; inset: 0; }
#world canvas { display: block; width: 100%; height: 100%; position: relative; z-index: 0; }
#world .tilt { position: absolute; left: 0; right: 0; height: 16%; z-index: 1; pointer-events: none; backdrop-filter: blur(2.5px); -webkit-backdrop-filter: blur(2.5px); }
#world .tilt.top { top: 0; -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
#world .tilt.bot { bottom: 0; -webkit-mask-image: linear-gradient(transparent, #000); mask-image: linear-gradient(transparent, #000); }
#world .vig { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(10,6,3,.5) 100%); }
#stageui { display: none; } #stageui.on { display: block; }
#where { position: absolute; left: 12px; top: 12px; z-index: 3; background: rgba(31,24,19,.78); border: 1px solid var(--line); color: var(--cream); padding: 6px 12px; border-radius: 99px; font-size: 13px; backdrop-filter: blur(6px); pointer-events: none; }
#zoomctl { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
#zoomctl button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(31,24,19,.78); color: var(--cream); font-size: 20px; backdrop-filter: blur(6px); }
#keys { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; font-size: 12px; color: var(--muted); background: rgba(31,24,19,.6); padding: 5px 12px; border-radius: 99px; white-space: nowrap; pointer-events: none; }
@media (pointer: coarse) { #keys { display: none; } }

/* 근처 사물 고르기 */
.pickbox { position: absolute; z-index: 6; background: var(--paper); color: var(--ink); border-radius: 14px; padding: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 5px; min-width: 170px; animation: pop .16s ease-out; }
.pickbox::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: var(--paper); transform: translateX(-50%) rotate(45deg); }
.pickbox em { font-style: normal; font-size: 11px; color: var(--ink2); padding: 0 6px; }
.pickbox button { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: var(--paper2); border-radius: 10px; padding: 10px 12px; font-size: 14px; text-align: left; position: relative; z-index: 1; }
.pickbox button:first-of-type { background: var(--ink); color: var(--paper); }
.pickbox button i { font-style: normal; font-size: 18px; opacity: .8; }

/* 생각 말풍선 */
#thought { position: absolute; z-index: 7; max-width: min(320px, 82%); background: #fffdf6; color: var(--ink); border-radius: 18px; padding: 12px 15px; box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; transform: translateY(6px) scale(.97); pointer-events: none; transition: opacity .2s, transform .2s; }
#thought.on { opacity: 1; transform: none; pointer-events: auto; }
#thought p { margin: 0; font-family: var(--hand); font-size: 22px; line-height: 1.25; }
#thought em { display: block; font-style: normal; font-size: 12px; color: var(--ink2); margin-top: 6px; }
#thought::before, #thought::after { content: ''; position: absolute; background: #fffdf6; border-radius: 50%; }
#thought::before { width: 14px; height: 14px; left: 50%; bottom: -12px; }
#thought::after { width: 8px; height: 8px; left: calc(50% + 8px); bottom: -22px; }

/* ───────── 독 (아래 메뉴) ───────── */
#dock { flex: none; display: none; justify-content: center; align-items: flex-end; gap: clamp(18px, 7vw, 46px); height: calc(94px + var(--sab)); padding: 0 12px var(--sab); }
body.playing #dock { display: flex; }
.dk { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; padding: 0 0 12px; color: var(--cream); min-width: 72px; }
.dk em { font-style: normal; font-size: 12px; color: var(--muted); }
.dk .ic { position: relative; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(160deg, #d8b98c, var(--kraft-d)); color: var(--ink); box-shadow: 0 3px 0 #7a5a38, 0 8px 18px rgba(0,0,0,.35); }
.dk .ic svg { width: 28px; height: 28px; }
.dk.think .ic { background: linear-gradient(160deg, #f6efe2, #d9ccb3); box-shadow: 0 3px 0 #9a8a6e, 0 8px 18px rgba(0,0,0,.35); }
.dk.phone .ic { width: 66px; height: 66px; border-radius: 22px; color: #fff; background: linear-gradient(160deg, #3fdcc0, var(--teal-d)); box-shadow: 0 4px 0 #0c6b5c, 0 10px 26px rgba(34,179,156,.45); transform: translateY(-8px); }
.dk.phone .ic svg { width: 36px; height: 36px; }
.dk.phone em { color: #7fe6d3; font-weight: 700; transform: translateY(-8px); }
.dk.phone.ring .ic { animation: ring 2.6s infinite; }
.dk.phone.point .ic, .dk.think.nudge .ic { animation: nudge 1s 4; }
.dk.think.nudge em { color: var(--gold); }
@keyframes ring { 0%, 86%, 100% { transform: translateY(-8px) rotate(0); } 89% { transform: translateY(-8px) rotate(-9deg); } 92% { transform: translateY(-8px) rotate(9deg); } 95% { transform: translateY(-8px) rotate(-5deg); } }
@keyframes nudge { 50% { box-shadow: 0 0 0 8px rgba(242,196,107,.55), 0 10px 26px rgba(0,0,0,.4); } }
.dk .badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--red); color: #fff; font-style: normal; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; box-shadow: 0 0 0 2px var(--bg); }
.dk .dot { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* ───────── 공통 버튼 ───────── */
.btn { background: var(--ink); color: var(--paper); border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 14px; }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .35; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; font-weight: 600; opacity: .85; }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn.big { padding: 14px 30px; font-size: 16px; border-radius: 14px; }
.btn.danger { background: var(--red); color: #fff; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* ───────── 패널 (크라프트지 파일) ───────── */
#panel { position: fixed; z-index: 15; display: none; flex-direction: column; top: calc(54px + var(--sat)); left: 0; right: 0; bottom: 0; background: var(--paper2); color: var(--ink); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); overflow: hidden; animation: up .22s ease-out; }
#panel.show { display: flex; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.pbar { display: flex; align-items: center; gap: 10px; padding: 9px 10px 0 14px; background: var(--kraft); border-bottom: 3px solid var(--kraft-d); }
.pbar > b { white-space: nowrap; font-size: 15px; font-family: var(--serif); padding-bottom: 8px; }
.ptabs { display: flex; gap: 3px; flex: 1; overflow-x: auto; scrollbar-width: none; align-self: flex-end; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { background: rgba(255,255,255,.28); border: 0; border-radius: 10px 10px 0 0; padding: 8px 13px; font-size: 14px; color: var(--ink); white-space: nowrap; }
.ptab.on { background: var(--paper2); font-weight: 700; }
.pclose { background: var(--ink); color: var(--paper); border: 0; border-radius: 10px; width: 36px; height: 34px; font-size: 15px; margin-bottom: 7px; flex: none; }
#main { flex: 1; overflow-y: auto; padding: 14px; min-width: 0; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; }
#main > * { flex: none; }
@media (min-width: 900px) {
  #panel { top: calc(64px + var(--sat)); left: max(3vw, calc(50% - 640px)); right: max(3vw, calc(50% - 640px)); bottom: 24px; border-radius: 18px; }
}

/* 기기 프레임 */
.device { width: 100%; max-width: 1080px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(60,40,20,.25); display: flex; flex-direction: column; }
.dbar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #e9e6e1; font-size: 12.5px; color: #555; flex: none; }
.dbar i { width: 10px; height: 10px; border-radius: 50%; background: #c9c4bc; }
.dbar span { margin-left: 8px; }
.device.laptop .dbar i:nth-child(1) { background: #ff5f57; } .device.laptop .dbar i:nth-child(2) { background: #febc2e; } .device.laptop .dbar i:nth-child(3) { background: #28c840; }
.device.laptop .dbody { background: #fafafa; color: #222; }
.device.phone { max-width: 440px; border-radius: 30px; border: 7px solid #1b1d22; background: #fff; }
.device.phone .dbar { background: #fff; justify-content: center; color: #222; font-weight: 600; } .device.phone .dbar i { display: none; }
.device.doc .dbody { background: #fffdf7; color: var(--ink); }
.device.cctv { background: #0b0d0f; } .device.cctv .dbar { background: #15181b; color: #9fb0a0; }
.dbody { min-height: 380px; flex: 1; }
#panel.p-phone #main, #panel.p-laptop #main { padding: 10px; }

/* 목록 + 내용 */
.split { display: grid; grid-template-columns: 260px 1fr; min-height: 460px; }
.list { border-right: 1px solid #e6e0d6; overflow-y: auto; max-height: 68vh; background: #fff; }
.row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #efeae2; padding: 12px 14px; color: #222; }
.row b { display: block; font-size: 14px; margin-bottom: 3px; }
.row span { display: block; font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row em { display: block; font-size: 11px; opacity: .5; font-style: normal; margin-top: 3px; }
.row:hover { background: #f6f3ee; } .row.on { background: #fdf0d8; }
.pane { padding: 18px 22px; overflow-y: auto; max-height: 68vh; }
.pane.paper { background: #fff; color: #222; line-height: 1.7; }
.pane.paper h3 { margin: 0 0 6px; font-size: 18px; }
.pane .back { border: 0; background: #f1ece3; border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; }
.mhead { font-size: 12px; color: #777; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 12px; }
.status { background: #fff1e6; color: #b2401f; border: 1px solid #f3c8b0; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.empty { display: grid; place-items: center; min-height: 260px; color: #9a8e7e; text-align: center; line-height: 1.8; }
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 위치 */
.loc { display: grid; grid-template-columns: 1fr; background: #fff; }
.mapbox svg { display: block; width: 100%; }
.loclist { padding: 16px; color: #222; }
.lochead { margin-bottom: 10px; font-size: 14px; }
.lrow { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.lrow span { font-family: var(--mono); color: #b07a1a; margin-right: 10px; }
.lrow.last { color: var(--red); }
.loc .muted { color: #888; }

/* 전화 */
.contacts { background: #fff; color: #191919; min-height: 100%; }
.crow { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-bottom: 1px solid #f0f0f0; padding: 11px 16px; text-align: left; color: #191919; }
.crow b { display: block; font-weight: 600; } .crow span { font-size: 12px; color: #888; } .crow i { margin-left: auto; font-style: normal; font-size: 18px; }
.contacts .muted { padding: 12px 16px; color: #7a6a50; }
.avatar { width: 44px; height: 44px; border-radius: 16px; background: #c8b89a; color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.avatar.big { width: 88px; height: 88px; border-radius: 32px; font-size: 34px; margin: 0 auto 10px; }
.cav { width: 92px; height: 92px; border-radius: 34px; object-fit: cover; display: block; margin: 0 auto 10px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.cav.sm { width: 44px; height: 44px; border-radius: 16px; margin: 0; box-shadow: none; }
.call { padding: 26px 18px 18px; background: linear-gradient(#3b4a52, #1c2329); color: #fff; min-height: 100%; display: flex; flex-direction: column; gap: 14px; }
.callee { text-align: center; } .callee b { display: block; font-size: 20px; } .callee span { color: #7ee0a8; font-size: 12px; }
.lines p { margin: 7px 0; line-height: 1.55; font-size: 14.5px; } .lines .them { color: #eef3f6; } .lines .mine { color: #ffd88a; text-align: right; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.opt { text-align: left; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; font-size: 14px; }
.opt:hover { background: rgba(255,255,255,.18); } .opt.dis { opacity: .45; cursor: default; }
.hang { align-self: center; margin-top: 6px; background: #e5483b; color: #fff; border: 0; border-radius: 99px; padding: 11px 30px; font-weight: 700; }

/* 잠금 화면 */
.device.laptop.lockscr .dbody { background: linear-gradient(135deg, #8aa5c0, #3b4f6a); display: grid; place-items: center; min-height: 460px; }
.lockbox { text-align: center; color: #fff; padding: 20px; }
.lockav { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 10px; border: 3px solid rgba(255,255,255,.6); }
.lockbox b { display: block; font-size: 20px; margin-bottom: 16px; }
.lockbox form { display: flex; gap: 6px; justify-content: center; }
.lockbox input { background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 99px; padding: 10px 16px; width: 200px; font-size: 16px; outline: none; }
.lockbox input::placeholder { color: rgba(255,255,255,.75); }
.lockbox .btn { border-radius: 99px; background: rgba(255,255,255,.3); color: #fff; }
.lockbox .muted { color: rgba(255,255,255,.85); }
.err { color: #ffd2cf; min-height: 18px; font-size: 13px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

/* 탭, 표 */
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid #e6e0d6; background: #fff; }
.tab { background: none; border: 0; padding: 8px 14px; border-bottom: 2px solid transparent; font-size: 14px; opacity: .65; color: #222; }
.tab.on { border-color: var(--accent); opacity: 1; font-weight: 700; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid #ebe5da; text-align: left; white-space: nowrap; }
.tbl th { font-size: 12px; opacity: .7; font-weight: 600; }
.tbl.mono td { font-family: var(--mono); }
.tbl tr.hl td { background: #fff4d6; }
.tbl.small td { padding: 5px 8px; font-size: 12px; }

/* 클라우드, 헬스, 문서 */
.cloud, .health, .doc { padding: 16px 18px; color: #222; background: #fff; }
.doc { background: #fffdf7; }
.crumb { font-size: 13px; color: #666; margin-bottom: 6px; }
.versions { margin-top: 14px; background: #f5f2ec; border-radius: 10px; padding: 12px 16px; }
.versions h4 { margin: 0 0 8px; }
.vrow { padding: 8px 0; border-bottom: 1px solid #e6e0d6; }
.vrow b { margin-right: 10px; } .vrow span { font-size: 12px; color: #777; } .vrow p { margin: 4px 0 0; font-size: 13px; }
.vrow.hl p { color: #b2401f; font-weight: 600; }
.hhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; } .hhead span { font-size: 12px; color: #777; }
.chart { padding: 10px 0; } .chart svg { width: 100%; max-width: 760px; max-height: 230px; display: block; } .chartcap { font-size: 12px; color: #666; margin: 8px 0 0; }
.dochead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.dochead span { font-size: 12px; color: #666; }
.doc .muted, .health .muted { color: #7a6f60; }
.photo { margin-top: 14px; position: relative; } .photo img, .photo svg { width: 100%; display: block; border-radius: 6px; } .photo .btn { position: absolute; right: 10px; bottom: 10px; }
.photo.plan svg { max-width: 560px; }

/* CCTV (3D 장면을 찍은 화면 + CCTV 질감) */
.cctv { padding: 12px; color: #cfd6cf; }
.screen { position: relative; border-radius: 4px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.screen img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(1.1) brightness(.97) sepia(.08) blur(.4px); }
.screen.night img { filter: grayscale(.85) contrast(1.25) brightness(1.05) blur(.5px); }
.screen.pet img { filter: saturate(.85) contrast(1.05) blur(.3px); }
.noise { position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain .4s steps(3) infinite; }
@keyframes grain { 33% { transform: translate(-4px, 3px); } 66% { transform: translate(3px, -2px); } }
.osd { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 4px; padding: 8px 12px; font-family: var(--mono); font-size: 12px; color: #e9f7e9; text-shadow: 0 0 3px #000; pointer-events: none; }
.osd span:first-child { color: #ff5a4e; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.1) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.caption { font-size: 14px; padding: 12px 2px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; line-height: 1.5; }
.caption .btn { background: #e9f2e6; color: #12210f; }
.timeline { display: flex; gap: 6px; flex-wrap: wrap; }
.tframe { font-family: var(--mono); font-size: 13px; background: #161b20; border: 1px solid #2a323b; color: #9fb0a0; padding: 7px 11px; border-radius: 8px; }
.tframe.on { border-color: #6fd18a; color: #c7f5d2; }
.cctv .muted { color: #6f7d70; }

/* ───────── 사건 파일 ───────── */
.board { max-width: 1240px; margin: 0 auto; width: 100%; }
.bhead h2 { margin: 0 0 4px; font-size: 24px; font-family: var(--serif); }
.bhead p { color: var(--ink2); margin: 0 0 14px; font-size: 14px; line-height: 1.6; }
.bfilter { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.chipb { border: 1.5px solid #b59c78; background: transparent; color: var(--ink); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.chipb.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card { position: relative; text-align: left; background: #fffaf0; color: var(--ink); border-radius: 3px; padding: 14px 14px 12px; box-shadow: 0 2px 0 #d9c9a8, 0 6px 14px rgba(80,50,20,.12); transform: rotate(-.4deg); }
.card:nth-child(2n) { transform: rotate(.5deg); }
.card::before { content: ''; position: absolute; top: -7px; left: 50%; width: 46px; height: 14px; transform: translateX(-50%) rotate(-2deg); background: rgba(242,214,150,.75); }
.card span { font-size: 11px; color: #9a7a4a; } .card b { display: block; margin: 3px 0 6px; font-size: 14.5px; padding-right: 22px; } .card p { margin: 0; font-size: 12.5px; line-height: 1.55; color: #4e4438; }
.card.sel { background: #fff3d6; transform: rotate(0) translateY(-2px); }
.card .star { position: absolute; top: 8px; right: 8px; background: none; border: 0; font-size: 16px; opacity: .3; filter: grayscale(1); }
.card .star.on { opacity: 1; filter: none; }
.tl { position: relative; max-width: 860px; }
.tlday { margin: 18px 0 6px; font-weight: 700; color: var(--accent); font-size: 13px; letter-spacing: 1px; }
.tlrow { display: grid; grid-template-columns: 50px 14px 1fr; gap: 10px; align-items: start; padding: 6px 0; }
.tlrow em { font-style: normal; font-family: var(--mono); color: #6a5a3a; font-size: 13px; padding-top: 2px; text-align: right; }
.tlrow i { width: 10px; height: 10px; border-radius: 50%; background: #c2ad88; margin-top: 5px; box-shadow: 0 0 0 3px var(--paper2); }
.tlrow.star i { background: var(--accent); }
.tlrow p { margin: 0; line-height: 1.5; font-size: 14px; } .tlrow span { font-size: 12px; color: var(--ink2); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.person { display: flex; gap: 12px; background: #fffaf0; border-radius: 14px; padding: 14px; box-shadow: 0 2px 0 #d9c9a8; }
.pav { width: 54px; height: 54px; border-radius: 18px; background: #c8b89a; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; object-fit: cover; color: #fff; }
.person b { display: block; } .person span { font-size: 12px; color: var(--ink2); }
.person ul { margin: 8px 0 0; padding-left: 16px; } .person li { font-size: 13.5px; line-height: 1.6; }
.person .muted { color: #9a8e7e; }

/* 연구 노트 (줄 노트 + 손글씨) */
.notebook { max-width: 720px; width: 100%; margin: 0 auto; background: #fbf6ea; color: #2c2a35; border-radius: 6px 14px 14px 6px; padding: 26px 26px 26px 46px; box-shadow: inset 18px 0 0 #7a2e2e, inset 21px 0 0 #5a1f1f, 0 14px 30px rgba(60,30,10,.3); position: relative; }
.nbcover { font-family: var(--serif); font-weight: 700; color: #7a2e2e; margin-bottom: 10px; letter-spacing: 1px; }
.nbpage { padding: 10px 0 14px; background-image: repeating-linear-gradient(transparent 0 33px, #b9cde0 33px 34px); background-position: 0 6px; }
.nbd { font-family: var(--hand); font-size: 22px; color: #8a5a2a; }
.nbpage p { margin: 0; font-family: var(--hand); font-size: 25px; line-height: 34px; color: #1f2a5a; }

/* ───────── 들여다보기 그림 (화이트보드·쪽지·안내문·사진·게시판) ───────── */
.vis { margin: 6px auto 14px; }
.wb { position: relative; background: linear-gradient(135deg, #ffffff, #eef1f2); border: 10px solid #b9bfc4; border-radius: 6px; padding: 16px 20px 26px; box-shadow: inset 0 0 30px rgba(120,140,150,.15), 0 8px 18px rgba(0,0,0,.25); }
.wbin p { margin: 2px 0; font-family: var(--hand); font-size: 25px; line-height: 1.2; }
.wb .mag { position: absolute; width: 20px; height: 20px; border-radius: 50%; top: 8px; box-shadow: inset -3px -3px 0 rgba(0,0,0,.2); }
.wb .mag.a { right: 26px; background: #e05a4a; } .wb .mag.b { right: 54px; background: #3a7bd5; }
.wb .tray { position: absolute; left: 10%; right: 10%; bottom: -14px; height: 8px; background: #9aa1a8; border-radius: 3px; }
.wb .tray i { position: absolute; top: -6px; width: 48px; height: 8px; border-radius: 4px; background: #1f3b73; left: 20%; } .wb .tray i + i { left: 40%; background: #c0392b; }
.sticky { width: min(300px, 90%); aspect-ratio: 1; background: var(--c); padding: 26px 22px; transform: rotate(var(--rot)); box-shadow: 0 12px 20px rgba(0,0,0,.25), inset 0 -18px 30px rgba(0,0,0,.04); }
.sticky p { margin: 0; font-family: var(--hand); font-size: 28px; line-height: 1.25; color: #2a2a5a; }
.notice { position: relative; width: min(380px, 94%); background: #fffef9; padding: 26px 24px 20px; box-shadow: 0 10px 22px rgba(0,0,0,.22); transform: rotate(-.6deg); color: #222; font-family: var(--serif); }
.notice h4 { margin: 0 0 12px; text-align: center; font-size: 19px; border-bottom: 2px solid #222; padding-bottom: 8px; }
.notice p { margin: 0; line-height: 1.75; font-size: 14.5px; }
.notice em { display: block; text-align: right; margin-top: 14px; font-style: normal; font-size: 13px; color: #555; }
.notice .tape { position: absolute; top: -10px; width: 70px; height: 22px; background: rgba(240,225,180,.8); } .notice .tape.l { left: 18px; transform: rotate(-8deg); } .notice .tape.r { right: 18px; transform: rotate(7deg); }
.polaroid { width: min(380px, 94%); background: #fff; padding: 12px 12px 6px; box-shadow: 0 12px 26px rgba(0,0,0,.3); transform: rotate(var(--rot)); }
.polaroid img { width: 100%; display: block; }
.polaroid p { margin: 8px 0 4px; font-family: var(--hand); font-size: 25px; text-align: center; color: #2a2a5a; }
.cork { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding: 22px 16px; border-radius: 6px; border: 9px solid #7a5a3a; background: #c49a64 radial-gradient(circle at 20% 30%, rgba(0,0,0,.08) 1px, transparent 2px) 0 0 / 9px 9px; }
.cork .pp { position: relative; width: 170px; background: #fffef8; color: #222; padding: 16px 12px 12px; box-shadow: 0 6px 12px rgba(0,0,0,.25); transform: rotate(var(--rot)); font-family: var(--serif); }
.cork .pp.green { background: #eef7ea; } .cork .pp.pink { background: #fde8ee; }
.cork .pp b { display: block; font-size: 15px; margin-bottom: 6px; } .cork .pp p { margin: 0; font-size: 13px; line-height: 1.6; }
.cork .pin { position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: #d6503f; transform: translateX(-50%); box-shadow: 0 2px 2px rgba(0,0,0,.35); }

/* ───────── 오버레이 ───────── */
#overlay { position: fixed; inset: 0; display: none; place-items: center; background: rgba(18,12,8,.66); z-index: 20; padding: 16px; padding-top: calc(16px + var(--sat)); }
#overlay.show { display: grid; }
#overlay.intro, #overlay.ending { top: calc(54px + var(--sat)); padding-top: 16px; overflow-y: auto; background: radial-gradient(700px 480px at 50% 25%, #3a2a1e, #140e0a); align-items: start; }
.modal { position: relative; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 24px 22px 22px; width: min(560px, 100%); max-height: 86dvh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .18s ease-out; }
.modal.wide { width: min(640px, 100%); }
.modal h2 { margin: 4px 0 12px; font-family: var(--serif); font-size: 21px; } .modal p { line-height: 1.7; }
.modal .obs { color: #3d3329; }
.modal .x { position: absolute; top: 12px; right: 12px; background: var(--paper2); border: 0; width: 34px; height: 34px; border-radius: 10px; font-size: 15px; color: var(--ink); }
.kick { color: var(--accent); font-size: 12px; letter-spacing: 2px; font-weight: 800; }
.say { margin: 9px 0; line-height: 1.6; } .say b { color: var(--accent); margin-right: 10px; font-size: 13px; }
.floors { display: grid; gap: 8px; }
.floor { display: flex; gap: 14px; align-items: center; text-align: left; background: #fffaf0; border: 1.5px solid #d9c9a8; border-radius: 14px; padding: 12px 14px; color: var(--ink); }
.floor b { font-family: var(--mono); font-size: 22px; color: var(--wood); width: 44px; } .floor span { font-size: 14px; color: var(--ink2); }
.floor:hover:not(:disabled) { border-color: var(--accent); } .floor.here { opacity: .6; } .floor:disabled { opacity: .45; cursor: default; }
.zoomimg { position: relative; border-radius: 8px; overflow: hidden; }
.zoomimg img { width: 100%; display: block; }
.zoomimg.cctvz img { filter: saturate(.5) contrast(1.15) blur(.7px); }
.sndset { background: #fffaf0; border-radius: 12px; padding: 10px 14px; margin: 12px 0; display: grid; gap: 6px; }
.sndset b { font-size: 12px; color: var(--accent); letter-spacing: 1px; }
.sndset label { font-size: 14px; display: flex; gap: 8px; align-items: center; cursor: pointer; }
.vrow2 { display: flex; justify-content: space-between; gap: 10px; background: var(--paper2); border: 0; border-radius: 9px; padding: 8px 10px; font-size: 13px; text-align: left; color: var(--ink); }
.vrow2 em { font-style: normal; color: var(--ink2); font-size: 12px; }

/* 결론 대화 */
#overlay.verdict { place-items: end center; padding: 10px; top: calc(54px + var(--sat)); }
#overlay.verdict .vd { max-height: calc(100dvh - 74px - var(--sat)); }
.vd { width: min(680px, 100%); max-height: calc(100dvh - 30px - var(--sat)); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: up .25s ease-out; }
.vdhead { display: flex; gap: 10px; align-items: baseline; padding: 14px 18px 10px; background: var(--kraft); }
.vdhead span { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: #7a2e1e; } .vdhead b { font-family: var(--serif); font-size: 17px; }
.vdlog { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.vl { display: flex; gap: 10px; align-items: flex-start; }
.vl img, .vl > i { width: 42px; height: 42px; border-radius: 15px; flex: none; object-fit: cover; background: #d9c9a8; }
.vl b { font-size: 12px; color: var(--accent); } .vl p { margin: 2px 0 0; background: #fff; border-radius: 4px 14px 14px 14px; padding: 9px 12px; line-height: 1.55; font-size: 14.5px; }
.vl.me { flex-direction: row-reverse; } .vl.me > div { text-align: right; } .vl.me p { background: #fde7b0; border-radius: 14px 4px 14px 14px; text-align: left; }
.vn { margin: 2px 8px; font-size: 13.5px; color: var(--ink2); font-style: italic; text-align: center; line-height: 1.6; }
.vdask { padding: 12px 16px 16px; border-top: 1px dashed #c9b48e; display: flex; flex-direction: column; gap: 10px; background: var(--paper2); }
.vdq { font-weight: 700; font-size: 14.5px; }
.evpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; max-height: 32dvh; overflow-y: auto; }
.evc { text-align: left; background: #fffaf0; border: 2px solid transparent; border-radius: 10px; padding: 8px 10px; color: var(--ink); box-shadow: 0 2px 0 #d9c9a8; }
.evc span { display: block; font-size: 10.5px; color: #9a7a4a; } .evc b { font-size: 13px; }
.evc.on, .pc.on { border-color: var(--accent); background: #fff1dc; }
.ppick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pc { display: flex; flex-direction: column; align-items: center; gap: 3px; background: #fffaf0; border: 2px solid transparent; border-radius: 14px; padding: 10px; color: var(--ink); }
.pc img { width: 58px; height: 58px; border-radius: 20px; object-fit: cover; } .pc span { font-size: 11px; color: var(--ink2); text-align: center; }
.vdask .opts .opt { background: #fffaf0; color: var(--ink); border-color: #d9c9a8; }
.vdask .btn { align-self: center; }

/* 인트로 · 사건 선택 · 결말 */
.slide { max-width: 640px; width: 100%; margin: 0 auto; text-align: center; animation: fade .6s; padding: 18px 4px 30px; }
.slide .title { font-family: var(--serif); font-size: 48px; font-weight: 700; color: var(--cream); letter-spacing: -1px; margin-bottom: 18px; }
.slide .title.sm { font-size: 22px; color: var(--kraft); margin-bottom: 26px; }
.slide.end .title { font-size: 38px; margin: 8px 0 18px; }
.slide p { font-size: 19px; line-height: 1.75; margin: 14px 0 26px; }
.slide .kick { color: var(--gold); }
.slide .btn { background: var(--cream); color: var(--ink); }
.slide .btn.ghost { background: transparent; color: var(--cream); }
.howto { text-align: left; background: rgba(244,232,210,.07); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.7; margin-bottom: 22px; display: grid; gap: 6px; }
.howto b { color: var(--gold); }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 22px; } .dots i { width: 26px; height: 3px; background: #4a3a2c; border-radius: 2px; } .dots i.on { background: var(--gold); }
.gbrand { margin: 8px 0 22px; } .gbrand .title { font-size: 40px; margin: 10px 0 6px; } .gbrand .tag { font-size: 15px; color: var(--muted); margin: 0; }
.slide.gate .cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 10px 0 26px; text-align: left; }
.casecard { position: relative; background: linear-gradient(170deg, #d4b385, var(--kraft-d)); border: 0; border-radius: 6px 16px 16px 16px; padding: 18px 18px 16px; color: var(--ink); box-shadow: 0 4px 0 #7a5a38, 0 12px 26px rgba(0,0,0,.4); opacity: .78; }
.casecard::before { content: ''; position: absolute; top: -10px; left: 0; width: 42%; height: 12px; border-radius: 8px 8px 0 0; background: #d4b385; }
.casecard small { font-size: 11px; letter-spacing: 2px; color: #7a2e1e; font-weight: 800; }
.casecard b { font-family: var(--serif); font-size: 22px; display: block; margin: 2px 0 6px; } .casecard p { font-size: 14px; margin: 0 0 10px; line-height: 1.5; color: #3d3127; }
.casecard span { font-size: 12px; color: #5a4a38; }
.casecard.on { opacity: 1; outline: 3px solid var(--gold); outline-offset: 3px; }
.slide.gate .muted { margin-top: 18px; line-height: 1.8; }
.stamp { display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: 6px; color: var(--accent); border: 4px double var(--accent); padding: 6px 18px; border-radius: 8px; transform: rotate(-6deg); margin: 6px 0 14px; }
.stamp.grey { color: var(--muted); border-color: var(--muted); }
.truths { text-align: left; margin: 18px auto; max-width: 440px; display: grid; gap: 8px; }
.truths div { display: flex; gap: 10px; align-items: center; background: rgba(244,232,210,.07); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.truths i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex: none; }
.truths .ok i { background: var(--teal); color: #fff; } .truths .no { color: var(--muted); } .truths .no i { background: #4a3a2c; color: var(--muted); }
.slide .note { font-size: 15px; color: var(--gold); margin: 8px 0 14px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

/* 토스트 */
#toasts { position: fixed; top: calc(64px + var(--sat)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 30; align-items: center; pointer-events: none; width: min(420px, 92vw); }
.toast { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 10px 16px; font-size: 14px; animation: fade .3s; transition: opacity .4s; box-shadow: 0 10px 26px rgba(0,0,0,.4); text-align: center; }
.toast b { font-weight: 700; } .toast span { display: block; font-size: 11.5px; color: var(--ink2); margin-top: 2px; }
.toast.ev { border-left: 5px solid var(--accent); } .toast.out { opacity: 0; }
#tip { position: fixed; z-index: 8; pointer-events: none; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 8px; opacity: 0; transition: opacity .12s; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
#tip.on { opacity: 1; }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 18; }
#fade.on { opacity: 1; }

/* ───────── 톡톡 PC (카톡 PC 배치) ───────── */
.tt { display: grid; grid-template-columns: 64px 320px 1fr; height: 68vh; min-height: 480px; background: #fff; color: #191919; font-size: 14px; }
.ttrail { background: #ececec; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 22px 0; font-size: 20px; }
.ttrail i { font-style: normal; opacity: .45; position: relative; } .ttrail i.on { opacity: 1; }
.ttrail i b { position: absolute; top: -6px; right: -14px; background: #f2462b; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 99px; }
.ttbottom { margin-top: auto; display: flex; flex-direction: column; gap: 18px; }
.ttlist { border-right: 1px solid #ececec; overflow-y: auto; }
.ttchips { display: flex; gap: 6px; padding: 12px 14px 8px; }
.ttchip { border: 0; background: #f2f2f2; border-radius: 99px; padding: 7px 14px; font-size: 13px; color: #333; }
.ttchip.on { background: #222; color: #fff; } .ttchip b { background: #f2462b; color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 6px; margin-left: 5px; }
.ttrow { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: #fff; padding: 10px 14px; text-align: left; color: #191919; }
.ttrow:hover { background: #f6f6f6; } .ttrow.on { background: #ededed; }
.ttav { width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; flex-shrink: 0; overflow: hidden; }
.ttav.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ttav.sm { width: 38px; height: 38px; border-radius: 14px; font-size: 14px; }
.ttmid { flex: 1; min-width: 0; } .ttmid b { font-size: 14.5px; font-weight: 600; } .ttmid span { color: #999; margin-left: 5px; font-size: 13px; }
.ttmid p { margin: 3px 0 0; color: #888; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttright { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; } .ttright em { font-style: normal; font-size: 11px; color: #999; white-space: nowrap; }
.ttright b { background: #f2462b; color: #fff; font-size: 11px; border-radius: 99px; padding: 2px 7px; }
.ttroom { display: flex; flex-direction: column; background: #b2c7da; min-width: 0; min-height: 0; }
.ttroom.empty { align-items: center; justify-content: center; color: #6b7d8f; font-size: 40px; } .ttroom.empty p { font-size: 14px; }
.tthead { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #b2c7da; border-bottom: 1px solid rgba(0,0,0,.06); }
.tthead b { font-size: 15px; } .tthead span { color: #5a6b7b; font-size: 13px; } .tthead i { margin-left: auto; font-style: normal; opacity: .6; letter-spacing: 6px; }
.ttmsgs { flex: 1; overflow-y: auto; padding: 8px 14px 16px; }
.ttday { text-align: center; margin: 14px 0; } .ttday span { background: rgba(0,0,0,.12); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 99px; }
.ttsys { text-align: center; color: #4f6172; font-size: 12px; margin: 8px 0; }
.ttmsg { display: flex; gap: 8px; margin-top: 4px; } .ttmsg.first { margin-top: 10px; }
.ttside { width: 38px; flex-shrink: 0; } .ttcol { min-width: 0; max-width: 72%; } .ttname { font-size: 12.5px; color: #3d4b58; margin: 0 0 4px 2px; }
.ttline { display: flex; align-items: flex-end; gap: 5px; }
.ttbub { background: #fff; padding: 8px 11px; border-radius: 4px 12px 12px 12px; line-height: 1.45; word-break: break-word; box-shadow: 0 1px 0 rgba(0,0,0,.04); color: #191919; }
.ttbub.pic { padding: 0; overflow: hidden; background: none; }
.ttpic { display: block; width: 180px; max-width: 100%; border-radius: 10px; }
.ttmsg:not(.first) .ttbub { border-radius: 12px; }
.ttmsg em, .ttmeta em { font-style: normal; font-size: 10.5px; color: #55667a; white-space: nowrap; }
.ttmsg.me { justify-content: flex-end; align-items: flex-end; gap: 5px; } .ttmsg.me .ttbub { background: #fee500; max-width: 72%; border-radius: 12px 4px 12px 12px; }
.ttmsg.me:not(.first) .ttbub { border-radius: 12px; }
.ttinput { background: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #e3e3e3; }
.ttinput div { flex: 1; color: #b5b5b5; font-size: 13px; } .ttinput span { opacity: .5; letter-spacing: 4px; }
.ttinput button { border: 0; background: #f1f1f1; color: #b1b1b1; border-radius: 6px; padding: 6px 12px; font-size: 13px; }
.ttinput i { font-style: normal; font-size: 20px; color: #999; }
.ttback { border: 0; background: none; font-size: 30px; line-height: 1; padding: 0 8px 2px 0; color: #222; }
.ttphoto { width: 150px; height: 110px; background: #efe4d2; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 40px; }
.ttphoto span { font-size: 11px; color: #7a6a5a; }
.ttmid .mute { margin-left: 4px; font-size: 11px; }

/* 톡톡 모바일 */
.kk { display: flex; flex-direction: column; height: min(70vh, 720px); background: #fff; color: #191919; font-size: 14px; }
.kktop { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 4px; } .kktop b { font-size: 20px; } .kktop span { opacity: .55; letter-spacing: 4px; }
.kklist { flex: 1; overflow-y: auto; }
.kktabs { display: flex; justify-content: space-around; border-top: 1px solid #eee; padding: 7px 0 9px; background: #fff; }
.kktabs i { font-style: normal; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 18px; opacity: .4; position: relative; }
.kktabs i.on { opacity: 1; } .kktabs em { font-style: normal; font-size: 10px; }
.kktabs b { position: absolute; top: -4px; right: -12px; background: #f2462b; color: #fff; font-size: 9px; border-radius: 99px; padding: 1px 5px; }
.kk .ttroom { flex: 1; min-height: 0; } .kk .ttmsgs { flex: 1; } .kk .ttcol, .kk .ttmsg.me .ttbub { max-width: 78%; }

/* ───────── 좁은 화면 (휴대폰 세로) ───────── */
@media (max-width: 760px) {
  #hdr { height: 50px; padding: 0 10px; }
  .brand b { font-size: 17px; } .clock { font-size: 11px; padding: 4px 7px; }
  #stage { margin: 0 6px; border-radius: 16px; }
  #panel, #overlay.intro, #overlay.ending { top: calc(50px + var(--sat)); }
  #toasts { top: calc(60px + var(--sat)); }
  #main { padding: 10px; }
  #panel.p-phone #main, #panel.p-laptop #main { padding: 0; }
  #panel.p-phone .device.phone { border: 0; border-radius: 0; max-width: none; box-shadow: none; flex: 1; }
  #panel.p-phone .device.phone .dbar { display: none; }
  #panel.p-laptop .device { border-radius: 0; box-shadow: none; flex: 1; }
  #panel.p-phone #main > .device, #panel.p-laptop #main > .device { min-height: 100%; }
  .kk { height: calc(100dvh - 50px - 46px - var(--sat)); }
  #panel.p-laptop .kk { height: calc(100dvh - 50px - 46px - 34px - var(--sat)); }
  .split { grid-template-columns: 1fr; min-height: 0; }
  .split .list { max-height: none; border-right: 0; }
  .split.has .list { display: none; } .split:not(.has) .pane { display: none; }
  .pane { max-height: none; padding: 14px 16px; }
  .tt { grid-template-columns: 1fr; height: auto; } .ttrail { display: none; }
  .cards { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  .slide .title { font-size: 38px; } .slide p { font-size: 17px; }
  .gbrand .title { font-size: 32px; }
  .modal { padding: 20px 16px 18px; border-radius: 18px; }
  #overlay:not(.intro):not(.ending):not(.verdict) { place-items: end center; padding: 10px 8px calc(10px + var(--sab)); }
  .modal { max-height: 80dvh; }
  .call { padding-top: 34px; }
  .cctv { padding: 8px; }
  .osd { font-size: 10.5px; padding: 6px 8px; }
  .wbin p { font-size: 21px; } .nbpage p { font-size: 22px; line-height: 30px; } .nbpage { background-image: repeating-linear-gradient(transparent 0 29px, #b9cde0 29px 30px); }
  .notebook { padding: 20px 16px 20px 36px; }
}

/* ───────── 모바일은 세로 전용: 휴대폰을 가로로 눕히면 안내 ───────── */
#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--cream); flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
#rotate .rot { font-size: 54px; animation: rot 2s ease-in-out infinite; } #rotate b { font-size: 20px; font-family: var(--serif); } #rotate p { color: var(--muted); margin: 0; }
@keyframes rot { 0%, 30% { transform: rotate(90deg); } 60%, 100% { transform: rotate(0); } }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) { #rotate { display: flex; } }

/* 링크 공유 이미지 촬영 모드 */
body.ogshot #hdr, body.ogshot #dock, body.ogshot #stageui, body.ogshot #overlay, body.ogshot #toasts { display: none !important; }
body.ogshot #stage { margin: 0; border-radius: 0; box-shadow: none; }
body.ogshot #overlay { display: none !important; }
.ogcard { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; display: flex; align-items: center; gap: 34px; padding: 80px 56px 44px; background: linear-gradient(transparent, rgba(24,17,12,.92) 45%); }
.ogcard small { display: block; font-size: 22px; letter-spacing: 6px; color: var(--gold); }
.ogcard b { display: block; font-family: var(--serif); font-size: 72px; color: var(--cream); line-height: 1.1; }
.ogcard p { margin: 6px 0 0; font-size: 24px; color: var(--muted); }
.ogcard .logo.big { width: 230px; height: 230px; border-radius: 48px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* ───────── 사건 선택 화면 ───────── */
.home { width: 100%; max-width: 980px; margin: 0 auto; padding: 8px 2px 28px; animation: fade .5s; }
.homehead { margin: 6px 4px 18px; }
.homehead h1 { margin: 0; font-family: var(--serif); font-size: 26px; color: var(--cream); }
.homehead p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.clist { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 400px)); justify-content: center; gap: 16px; }
@media (min-width: 760px) { .homehead { text-align: center; } }
.cc { background: #2c221b; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,.4); border: 1px solid rgba(255,230,190,.08); display: flex; flex-direction: column; }
.cc.cur { border-color: rgba(242,196,107,.45); }
.ccimg { position: relative; aspect-ratio: 16 / 9; background: #241b15 center / cover no-repeat; }
.ccimg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(30,22,16,.85)); }
.ccimg em { position: absolute; left: 14px; bottom: 10px; z-index: 1; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: 2.5px; color: var(--gold); }
.ccbadge { position: absolute; top: 10px; right: 10px; z-index: 1; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--teal); color: #fff; }
.ccbadge.done { background: rgba(244,232,210,.9); color: var(--ink); }
.ccbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ccbody b { font-family: var(--serif); font-size: 22px; color: var(--cream); }
.ccbody p { margin: 0; font-size: 14px; line-height: 1.55; color: #d9cbb4; }
.ccmeta { display: flex; flex-wrap: wrap; gap: 6px; }
.ccmeta span { font-size: 12px; color: var(--muted); background: rgba(244,232,210,.07); padding: 4px 9px; border-radius: 8px; }
.ccbtns { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.ccbtns .btn { flex: 1; background: var(--cream); color: var(--ink); padding: 12px; font-size: 15px; }
.ccbtns .btn.ghost { flex: 0 0 auto; background: transparent; color: var(--cream); padding: 12px 16px; }
.home > .muted { text-align: center; margin-top: 20px; }

.hbtn svg { width: 21px; height: 21px; display: block; }
.hbtn.snd.off { color: var(--muted); }
.sndnote { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sndnote svg { width: 17px; height: 17px; flex: none; }

/* 침수선 아래 · 현장 표식, 설비 도면, 연속 사진 */
body[data-case="flood"] #stage {
  background: #172b31;
  border-color: #526362;
}
body[data-case="flood"] #where {
  background: #172b31ee;
  border-color: #52716f;
}
#mission {
  position: absolute;
  top: 53px;
  left: 14px;
  max-width: calc(100% - 99px);
  border-left: 2px solid #d29d66;
  padding: 6px 10px;
  background: #20383bed;
  color: #e6eee7;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
#mission:empty { display: none; }
.routeplan {
  margin: 14px 0;
  padding: 15px;
  background-color: #e2ebe4;
  background-image: linear-gradient(#a4bdb148 1px, transparent 1px), linear-gradient(90deg, #a4bdb148 1px, transparent 1px);
  background-size: 14px 14px;
  border: 1px solid #799489;
  border-radius: 4px;
  color: #183734;
}
.routeplan figcaption { font-weight: 800; margin-bottom: 12px; }
.route-level {
  display: grid;
  grid-template-columns: 33px 1fr;
  gap: 7px;
  align-items: start;
  border-top: 1px solid #9eafa2;
  padding: 9px 0;
  font-size: 12px;
}
.route-level > b { color: #3c635c; padding-top: 5px; }
.route-level > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.route-level span { padding: 5px 7px; background: #f8faf3; border: 1px solid #849e92; }
.route-level i { font-style: normal; font-weight: 800; }
.contactsheet { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 9px; margin: 12px 0; }
.contactsheet button { padding: 6px; text-align: left; border: 1px solid #aaa08a; border-radius: 4px; color: #233b38; background: #eee5ce; }
.contactsheet img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; background: #243536; }
.contactsheet span { display: flex; justify-content: space-between; padding: 6px 3px 1px; font: 12px/1.4 var(--mono); }
.vdback { margin-left: auto; padding: 6px 9px; border: 1px solid #9b8e72; border-radius: 5px; background: transparent; color: inherit; font-size: 11px; }

.vdnote { margin: 4px 0; padding: 9px 12px; border-inline-start: 2px solid var(--accent, #74bcad); line-height: 1.5; }

/* 온재현 · 먹과 한지 */
body[data-case="granary"] .clock { color: #f4d9a8; }
body[data-case="granary"] .vdhead { background: #3d302b; color: #fff2da; }
.grain-paper { padding: 17px 19px; border: 1px solid #b79263; border-radius: 2px; background: repeating-linear-gradient(174deg,#eddbb2 0 6px,#efdeb7 7px 9px); color: #402d21; box-shadow: inset 0 0 19px #b07e3a44; }
.grain-paper h4 { margin: 0 0 12px; padding-bottom: 7px; border-bottom: 1px solid #8f6c4d; font-family: "Nanum Myeongjo", Georgia, serif; font-size: 1.09rem; }
.grain-paper p { margin: 0; line-height: 1.7; }
.grain-paper footer { margin-top: 11px; color: #674238; font-size: .8rem; }
.grain-tray { position: relative; margin: 8px 0; min-height: 170px; display: grid; justify-items: center; padding: 10px; background: radial-gradient(ellipse at center,#7f5c40,#442e30); color: #fff2d4; border-radius: 6px; }
.grain-sieve { position: relative; width: 136px; aspect-ratio: 1; border-radius: 50%; border: 8px solid #d0a164; box-shadow: 0 8px 12px #261512a0, inset 0 0 13px #4c311e; background: repeating-linear-gradient(43deg,#5f4b35cc 0 1px,transparent 1px 4px),repeating-linear-gradient(133deg,#37291d 0 1px,#a88758 1px 4px); }
.grain-sieve i { position: absolute; left: var(--x); top: var(--y); transform: rotate(var(--r)); width: 10px; height: 4px; border: 1px solid #f2ca77; border-radius: 60%; background: #8f6b38; }
.grain-scoop { position: absolute; right: calc(50% - 111px); top: 82px; width: 40px; height: 33px; border: 5px solid #b99266; background: #4e392a; transform: rotate(21deg); box-shadow: 0 4px 8px #2c1b18; }
.grain-tray figcaption { margin-top: 8px; font-size: .8rem; }
