:root {
  color-scheme: dark;
  --ink: #f5f2ee;
  --muted: #b2b0b8;
  --accent: #ffc928;
  --accent-hover: #ffdc70;
  --page: #15130f;
  --surface: #211e18;
  --raised: #2b271f;
  --border: #484034;
  --mono: "Cascadia Mono", Consolas, monospace;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
p { word-break: keep-all; overflow-wrap: anywhere; }
button, input, select { font: inherit; }
input::placeholder { color: #a29fa9; opacity: 1; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .58; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 4px; }

.topbar { background: var(--page); border-bottom: 1px solid var(--border); }
.bar-inner, #app, .site-footer { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.bar-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; background: none; font-weight: 900; font-size: 1.2rem; letter-spacing: -.045em; }
.brand-mark { display: block; width: 36px; height: 36px; }
.brand-accent { color: var(--accent); }
nav { display: flex; align-items: center; gap: 23px; }
.nav-link, .link-button { padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: .86rem; font-weight: 700; }
.nav-link:hover, .link-button:hover { color: var(--ink); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 12px; padding: 9px 17px; border: 1px solid transparent; border-radius: 8px; font-size: .87rem; font-weight: 780; text-decoration: none; transition: background-color .15s, border-color .15s; }
.button.primary { background: var(--accent); color: #221517; }
.button.primary:hover { background: var(--accent-hover); }
.button.outline { background: var(--surface); color: var(--ink); border-color: var(--border); }
.button.outline:hover { background: var(--raised); border-color: #78717c; }
#app { min-height: 64vh; }

.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 435px; margin-top: 32px; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: #151518; }
.hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg,#131419 0%,#131419f5 26%,#13141955 58%,transparent 79%), linear-gradient(0deg,#15130f80,transparent 45%), url('/assets/station.webp') right 45% / 76% auto no-repeat; }
.hero-content { padding: 42px clamp(30px, 5vw, 65px); }
.eyebrow { margin: 0 0 10px; color: var(--accent); font: 700 .72rem/1.5 var(--mono); letter-spacing: .14em; }
.hero .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.signal { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px #ffc92880; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.7rem); line-height: 1.08; letter-spacing: -.085em; font-weight: 900; }
.hero-content > p:not(.eyebrow) { margin: 20px 0 25px; color: #dedbe0; font-size: .98rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-feature { position: absolute; right: 22px; bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 10px 13px 10px 16px; background: #131419ed; border: 1px solid #ffffff38; border-radius: 9px; text-align: left; }
.hero-feature:hover { border-color: var(--accent); }
.feature-copy { display: grid; }
.feature-copy small { color: var(--muted); font-size: .67rem; letter-spacing: .04em; }
.feature-copy strong { font-size: 1rem; }
.feature-arrow { color: var(--accent); font-size: 1.3rem; }

.library { margin: 49px 0 60px; scroll-margin: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 18px; }
.section-head .eyebrow { margin-bottom: 4px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); letter-spacing: -.055em; line-height: 1.22; }
.count { display: inline-flex; padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: 700 .72rem/1.5 var(--mono); vertical-align: middle; }
.search { display: flex; align-items: center; gap: 8px; padding: 2px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.search input { width: min(190px, 37vw); min-width: 0; padding: 7px 0; background: none; border: 0; color: var(--ink); }
.search:focus-within { border-color: var(--accent); }
.search input:focus-visible { outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chip { min-height: 34px; padding: 5px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .79rem; }
.chip:hover { color: var(--ink); }
.chip.active { color: var(--ink); border-color: var(--accent); background: #ffc9281c; }
.case-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.case-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.case-card { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.case-card:hover, .case-card:focus-within { border-color: #a56d66; }
.cover { position: relative; isolation: isolate; display: grid; align-items: end; min-height: 156px; overflow: hidden; border-bottom: 1px solid #ffffff24; }
.cover.radio { background: #182526 url('/assets/station.webp') center 49% / cover; }
.cover.glass { color: #b1e2ca; background: radial-gradient(ellipse at 50% 70%,#395a51,#182a2a 76%); }
.cover.train { color: #ffcf9d; background: radial-gradient(ellipse at 50% 70%,#6c4330,#2c252a 76%); }
.cover.deep { color: #bdd7fc; background: radial-gradient(ellipse at 50% 70%,#3e5574,#202638 76%); }
.cover-art { width: 100%; height: 100%; position: absolute; inset: 0; opacity: .9; }
.cover-number { position: relative; z-index: 1; align-self: start; justify-self: start; margin: 10px; padding: 3px 7px; background: #15130fda; color: var(--ink); border: 1px solid #ffffff36; border-radius: 5px; font: 700 .65rem/1.5 var(--mono); letter-spacing: .1em; }
.card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 15px; }
.genre, .badge { align-self: start; display: inline-block; padding: 2px 7px; background: #ffc92816; color: #ffdc70; border: 1px solid #ffc92842; border-radius: 5px; font-weight: 750; font-size: .68rem; }
.card-body h3 { margin: 7px 0 5px; font-size: 1.1rem; letter-spacing: -.055em; line-height: 1.35; }
.card-body p { flex: 1; margin-bottom: 13px; color: var(--muted); font-size: .82rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 3px 10px; color: var(--muted); font-size: .72rem; }
.card-link { display: flex; justify-content: space-between; width: 100%; min-height: 37px; margin-top: 12px; padding: 9px 0 0; border: 0; border-top: 1px solid var(--border); background: none; color: var(--accent); font-size: .86rem; font-weight: 800; text-align: left; }
.card-link:hover { color: var(--accent-hover); }
.site-footer { display: flex; justify-content: space-between; gap: 12px; padding: 19px 0 26px; border-top: 1px solid var(--border); color: var(--muted); font-size: .77rem; }
.site-footer strong { color: var(--ink); letter-spacing: .06em; }

.room { padding: 26px 0 54px; }
.room-top { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 22px; }
.room-top .eyebrow { margin: 8px 0 4px; }
.room-top h1 { font-size: clamp(1.85rem, 4vw, 3.1rem); line-height: 1.15; letter-spacing: -.07em; }
.room-code { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.room-code small { color: var(--muted); }
.room-code strong { color: var(--ink); font: 800 1.05rem var(--mono); letter-spacing: .12em; }
.room-code [data-action="notebook"] { border-color: #ffc92888; color: #ffdc70; }
.phases { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; padding: 0; margin: 0 0 17px; list-style: none; }
.phases.seven-steps { grid-template-columns: repeat(7,minmax(0,1fr)); }
.phases li { display: flex; align-items: center; gap: 7px; padding: 9px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; font-size: .77rem; }
.phases li span { font: 800 .73rem var(--mono); }
.phases li.current { background: #ffc9281c; color: #ffc1b5; border-color: #ffc92894; }
.phases li.done span { color: var(--accent); }
.phases li.done { padding: 0; }
.phases li.done button { display: flex; align-items: center; gap: 7px; width: 100%; height: 100%; padding: 9px; border: 0; border-radius: inherit; background: transparent; text-align: left; }
.phases li.done button:hover { background: var(--raised); color: var(--ink); }
.edition-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.room-columns { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(225px, 1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; padding: clamp(16px, 2.5vw, 26px); }
.panel h2 { margin-bottom: 7px; font-size: 1.35rem; letter-spacing: -.045em; }
.panel p { margin-bottom: 14px; color: var(--muted); overflow-wrap: anywhere; }
.panel > .button { margin-top: 12px; }
.room-side ul, .tally { padding: 0; margin: 9px 0; list-style: none; }
.room-side li, .tally li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.room-side li small, .tally li strong { margin-left: auto; color: #ffdc70; }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #90ceaa; }
.bot-label { font: 700 .76rem/1.5 var(--mono); }
.seat-list, .clues { display: grid; gap: 9px; margin: 13px 0; }
.seat { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; background: var(--raised); border: 1px solid var(--border); border-radius: 9px; text-align: left; }
.seat:hover:not(:disabled), .seat.selected { background: #ffc9281c; border-color: #ffc9289e; }
.seat small { display: block; color: var(--muted); }
.seat em { margin-left: auto; color: #ffdc70; font-size: .78rem; font-style: normal; }
.avatar { width: 43px; height: 48px; flex: none; border-radius: 7px; object-fit: cover; }
.avatar-letter { display: inline-grid; place-items: center; background: #ffc92822; color: #ffdc70; font-weight: 800; }
.detail-roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.detail-roles > span { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--raised); border-radius: 7px; }
.detail-roles small { color: var(--muted); font-size: .73rem; }
.detail-roles .avatar { width: 26px; height: 30px; }
.spaced { margin-top: 20px !important; }
details { margin: 12px 0; padding: 9px 12px; background: var(--raised); border: 1px solid var(--border); border-radius: 8px; }
details summary { cursor: pointer; color: var(--ink); font-weight: 700; }
details p { margin: 9px 0 0 !important; }
.record-clue { background: var(--page); }
.record-clue summary { color: #ffdc70; }
.record-clue .button { margin-top: 9px; }
.notebook-status:empty { display: none; }
#notebook h3 { margin-top: 12px; font-size: .9rem; }
.place-list { display: flex; flex-wrap: wrap; gap: 8px; }
.survey-turn, .mission-card { padding: 11px 13px; margin: 12px 0; background: var(--raised); border: 1px solid var(--border); border-radius: 8px; }
.survey-turn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.survey-turn .eyebrow, .mission-card .eyebrow { margin: 0; }
.mission-card p:last-child { margin: 5px 0 0; }
.inference { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 12px 0; }
.inference label { flex: 1 1 125px; min-width: 0; }
.clues article { padding: 10px 12px; background: var(--page); border: 1px solid var(--border); border-left: 3px solid #ffc92880; border-radius: 7px; }
.clues span { color: #ffdc70; font-size: .68rem; font-weight: 800; }
.clues h3 { font-size: 1rem; }
.clues p { margin: 3px 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.clues .button { min-height: 36px; margin-top: 9px; }
.messages { display: grid; gap: 5px; min-height: 100px; max-height: 380px; overflow-y: auto; padding: 9px; background: var(--page); border: 1px solid var(--border); border-radius: 9px; }
.message { padding: 8px 10px; overflow-wrap: anywhere; }
.message.bot { background: var(--raised); border-radius: 7px; }
.message p { margin: 3px 0; }
.composer { display: flex; align-items: end; gap: 8px; margin-top: 11px; }
.message-input { flex: 1; min-width: 0; }
form label { display: block; color: var(--muted); font-size: .82rem; font-weight: 700; }
form input, form select { display: block; width: 100%; min-height: 44px; padding: 8px 10px; margin-top: 3px; background: var(--page); border: 1px solid var(--border); border-radius: 7px; color: var(--ink); }
.hint, .empty, .loading { padding: 12px; color: var(--muted); }
.loading { text-align: center; margin: 18vh auto; }
.reveal { color: #ffdc70 !important; font-weight: 800; }

dialog { position: relative; width: min(510px, calc(100% - 24px)); max-height: 89dvh; padding: 24px; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 13px; }
dialog::backdrop { background: #09090dba; }
dialog .cover { margin-bottom: 14px; border-radius: 8px; }
dialog .close { position: absolute; z-index: 2; top: 9px; right: 9px; width: 42px; height: 42px; background: var(--page); border: 1px solid var(--border); border-radius: 50%; font-size: 1.4rem; }
dialog .close:hover { background: var(--raised); }
dialog p { color: var(--muted); margin: 7px 0 12px; }
dialog form { display: grid; gap: 10px; margin-top: 14px; }
.legacy { display: block; margin-top: 13px; font-size: .8rem; }
.toast { position: fixed; z-index: 8; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); padding: 10px 15px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); color: var(--ink); }

@media (max-width: 940px) {
  .case-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hero { min-height: 390px; }
  .hero::before { background-size: auto, auto, auto 100%; }
}
@media (max-width: 620px) {
  .bar-inner, #app, .site-footer { width: calc(100% - 28px); }
  .bar-inner { min-height: 63px; }
  .brand { font-size: 1.04rem; gap: 7px; }
  .brand-mark { width: 31px; height: 31px; }
  nav { gap: 0; }
  .nav-link { display: none; }
  nav .button { min-height: 38px; padding: 6px 10px; font-size: .75rem; }
  .hero { align-items: end; min-height: 375px; margin-top: 14px; border-radius: 12px; }
  .hero::before { background: linear-gradient(0deg,#131419 8%,#131419f5 38%,#1314193b 78%), url('/assets/station.webp') 67% top / auto 66% no-repeat; }
  .hero-content { width: 100%; padding: 95px 16px 15px; }
  .hero h1 { font-size: clamp(1.85rem, 8.3vw, 3rem); }
  .hero .eyebrow { margin-bottom: 8px; }
  .hero-content > p:not(.eyebrow) { max-width: 32ch; margin: 10px 0 15px; font-size: .79rem; }
  .desktop-break { display: none; }
  .hero-actions { gap: 6px; }
  .hero-actions .button { min-height: 40px; padding: 6px 8px; gap: 6px; font-size: .76rem; }
  .hero-feature { top: 10px; right: 10px; bottom: auto; gap: 12px; padding: 6px 8px; }
  .feature-copy small { font-size: .59rem; }
  .feature-copy strong { font-size: .79rem; }
  .library { margin: 28px 0 36px; }
  .section-head { margin-bottom: 12px; }
  .search { padding-inline: 7px; }
  .search input { font-size: .79rem; }
  .case-grid { gap: 8px; }
  .cover { min-height: 103px; }
  .cover-number { margin: 7px; font-size: .59rem; }
  .card-body { padding: 9px; }
  .card-body h3 { font-size: .91rem; }
  .card-body p, .card-meta { font-size: .73rem; }
  .chip { padding-inline: 8px; font-size: .73rem; }
  .room { padding: 14px 0 33px; }
  .room-top { flex-direction: column; align-items: start; }
  .room-code .button { min-height: 40px; padding: 5px 9px; font-size: .76rem; }
  .phases, .phases.seven-steps { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .phases li { padding: 7px; font-size: .72rem; }
  .phases li.done button { padding: 7px; }
  .room-columns { grid-template-columns: minmax(0,1fr); }
  .panel { padding: 14px; }
  .composer { flex-wrap: wrap; }
  .composer label:first-child { width: 100%; }
  form input, form select { font-size: 1rem; }
  .site-footer { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .case-card { transition: none; }
}

/* ───── 마지막 방송 3판: 게임형 화면 ───── */
.game { margin: 26px 0 64px; }
.game-top { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.game-top .eyebrow { margin: 6px 0 2px; }
.game-top h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -.06em; line-height: 1.15; }
.g-steps { position: sticky; top: 0; z-index: 30; display: flex; gap: 6px; margin: 0 -16px 22px; padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--page, #0d0e12); border-bottom: 1px solid var(--border); list-style: none; overflow-x: auto; scrollbar-width: none; }
.g-steps::-webkit-scrollbar { display: none; }
.g-steps li, .g-steps li button { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.g-steps li button { padding: 0; border: 0; background: none; }
.g-steps li span { font: 700 .66rem var(--mono); opacity: .7; }
.g-steps li.current { border-color: var(--accent); background: #ffc92822; color: var(--ink); }
.g-steps li.done { color: #d9d5dc; }
.g-steps li.done button:hover { color: var(--accent); }
.stage { display: grid; gap: 18px; }
.stage-head h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.05em; line-height: 1.25; margin-bottom: 8px; }
.stage-head p:not(.eyebrow) { color: #d4d1d8; max-width: 760px; }
.stage-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; align-items: center; }
.button.big { min-height: 52px; padding-inline: 24px; font-size: .95rem; }
.button.wide { width: 100%; }
.button.small { min-height: 34px; padding: 5px 11px; font-size: .78rem; }

/* 브리핑 */
.cine { position: relative; isolation: isolate; display: flex; align-items: end; min-height: clamp(300px, 46vw, 470px); overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: #0d0e12; }
.cine::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(0deg,#0d0e12 4%,#0d0e12c4 38%,#0d0e1230 72%), url('/assets/station.webp') center 40% / cover; animation: drift 24s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09) translateX(-1.5%); } }
.cine-copy { padding: clamp(22px, 4vw, 44px); }
.onair { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 5px 11px; border: 1px solid #ff3d3d99; border-radius: 6px; background: #3a0d0fcc; color: #ffd6d2; font: 800 .74rem var(--mono); letter-spacing: .16em; }
.onair span { width: 9px; height: 9px; border-radius: 50%; background: #ff3d3d; box-shadow: 0 0 14px #ff3d3d; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.cine-title { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 900; letter-spacing: -.08em; line-height: 1.02; }
.cine-hook { margin-top: 12px; color: #f0e8e4; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; }
.brief-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.brief-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.brief-card { display: grid; align-content: start; gap: 8px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.brief-card h3 { font-size: 1.1rem; letter-spacing: -.03em; }
.brief-card p:not(.eyebrow) { color: #d4d1d8; font-size: .92rem; }
.brief-card .eyebrow { margin: 0; }
.brief-card small { color: var(--muted); }
.brief-card.accent { border-color: #ffc92866; background: linear-gradient(160deg,#2a1716,var(--surface) 60%); }
.brief-card.victim, .brief-card.npc { grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.questions { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.questions li { color: #f0ece9; font-weight: 650; }
.questions li::marker { color: var(--accent); font: 700 .8rem var(--mono); }
.strip { padding: 18px 20px 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.time-strip { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.time-strip::before { position: absolute; top: 9px; left: 6px; right: 6px; height: 2px; content: ""; background: linear-gradient(90deg,var(--border),var(--accent)); }
.time-strip li { position: relative; display: grid; gap: 6px; padding-top: 24px; }
.time-strip li::before { position: absolute; top: 3px; left: 0; width: 14px; height: 14px; content: ""; border: 2px solid var(--accent); border-radius: 50%; background: var(--page); }
.time-strip li:last-child::before { background: var(--accent); }
.time-strip b { font: 800 1.05rem var(--mono); color: var(--ink); }
.time-strip span { color: #cfccd3; font-size: .85rem; }

/* 초상 */
.pt { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: center 22%; background: var(--raised); border: 1px solid #ffffff2a; }
.pt.big { width: 72px; height: 72px; }
.pt.sm { width: 34px; height: 34px; }
.pt.xs { width: 20px; height: 20px; border-width: 1px; }
.pt-letter { display: inline-grid; place-items: center; color: var(--accent); font-weight: 900; }
.pt.big.pt-letter { font-size: 1.6rem; }
.pt.xs.pt-letter { font-size: .6rem; }

/* 인물 선택 */
.char-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.char-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); transition: transform .18s, border-color .18s, box-shadow .18s; }
.char-card:hover { transform: translateY(-3px); border-color: #8a6a66; }
.char-card.mine { border-color: var(--accent); box-shadow: 0 0 0 2px #ffc92855, 0 18px 40px -20px #ffc92888; }
.char-card.taken { opacity: .6; }
.char-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 4 / 4.2; padding: 14px; background: center 18% / cover no-repeat; }
.char-art::after { position: absolute; inset: 0; content: ""; background: linear-gradient(0deg,#211e18 2%,#211e1800 52%); }
.char-name { position: relative; z-index: 1; order: 2; display: grid; }
.char-name small { color: #e7e2e0; font-size: .78rem; }
.char-name strong { font-size: 2rem; font-weight: 900; letter-spacing: -.06em; line-height: 1.05; }
.char-tags { position: relative; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.char-tags span { padding: 3px 9px; border-radius: 999px; background: #0d0e12c9; border: 1px solid #ffffff30; font-size: .72rem; font-weight: 700; }
.char-body { display: grid; gap: 10px; padding: 16px 18px 18px; flex: 1; align-content: start; }
.char-body > p { color: #d4d1d8; font-size: .9rem; }
.quote { color: var(--accent-hover) !important; font-weight: 750; font-size: .95rem !important; }
.relations { display: grid; gap: 5px; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--raised); list-style: none; font-size: .8rem; color: #cfccd3; }
.relations b { display: inline-block; min-width: 38px; margin-right: 6px; color: var(--ink); }
.teaser { padding-left: 10px; border-left: 2px solid var(--accent); color: #f0e0dc !important; font-style: italic; }
.char-body .button { margin-top: auto; }
.roster { display: grid; gap: 6px; margin: 4px 0 10px; padding: 0; list-style: none; }
.roster li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 9px; background: var(--raised); font-size: .88rem; }
.roster b { color: var(--accent); }

/* 설정집 */
.dossier { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.dossier-id { position: sticky; top: 16px; display: grid; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.dossier-photo { aspect-ratio: 3 / 3.4; border-radius: 10px; background: center 18% / cover no-repeat; filter: saturate(.9); }
.stamp { justify-self: start; margin: 6px 0 2px; padding: 3px 9px; border: 2px solid #ff4d4d; border-radius: 4px; color: #ff6b6b; font: 800 .72rem var(--mono); letter-spacing: .2em; transform: rotate(-4deg); }
.dossier-id h2 { font-size: 1.7rem; letter-spacing: -.05em; }
.dossier-id small { color: var(--muted); }
.dossier-body { display: grid; gap: 14px; }
.dossier-body > section { padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.dossier-body .lead, .epilogue .lead { font-size: 1rem; color: #ece8e6; line-height: 1.75; }
.dossier-body .secret { border-color: #ff4d4d70; background: linear-gradient(160deg,#2b1213,var(--surface) 70%); }
.dossier-body .breaks { border-style: dashed; }
.v-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.v-timeline li { position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 0 0 12px 0; }
.v-timeline li::before { position: absolute; top: 8px; bottom: -8px; left: 70px; width: 1px; content: ""; background: var(--border); }
.v-timeline li:last-child::before { display: none; }
.v-timeline li::after { position: absolute; top: 6px; left: 66px; width: 9px; height: 9px; content: ""; border-radius: 50%; background: var(--accent); }
.v-timeline b { font: 700 .86rem var(--mono); color: var(--accent-hover); }
.v-timeline span { padding-left: 16px; color: #dbd7dd; font-size: .9rem; }
.excuse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.excuse-grid article { padding: 13px 14px; border-radius: 11px; background: var(--raised); border: 1px solid #ffffff12; }
.excuse-grid h3 { font-size: .92rem; margin-bottom: 4px; }
.excuse-grid p { color: #cfccd3; font-size: .85rem; }
.mission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mission { position: relative; padding: 16px; border-radius: 12px; border: 1px solid #ffc06a55; background: linear-gradient(150deg,#2c2414,var(--raised) 70%); }
.mission .eyebrow { color: #ffc06a; margin-bottom: 4px; }
.mission h3 { font-size: 1rem; margin-bottom: 4px; }
.mission p:not(.eyebrow) { color: #d9d4cf; font-size: .86rem; }
.mission.win { border-color: #4fd18b88; background: linear-gradient(150deg,#123022,var(--raised) 70%); }
.mission.lose { border-color: #ff6b6b66; background: linear-gradient(150deg,#301516,var(--raised) 70%); }
.tip { padding: 12px 16px; border-radius: 12px; background: #ffc92814; border: 1px solid #ffc92840; color: #f3e6e2; font-size: .9rem; }
.tip b { color: var(--accent); margin-right: 6px; }

/* 조사 HUD */
.hud { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, auto); gap: 12px; align-items: stretch; }
.hud > * { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.round { display: grid; place-content: center; padding: 10px 18px; text-align: center; }
.round small { color: var(--muted); font: 700 .66rem var(--mono); letter-spacing: .2em; }
.round strong { font: 900 2rem/1 var(--mono); color: var(--accent); }
.round em { font-style: normal; color: var(--muted); font-size: 1rem; }
.seat-slots { display: flex; gap: 8px; padding: 8px; overflow-x: auto; }
.seat-slot { display: flex; align-items: center; gap: 9px; flex: 1 0 auto; min-width: 140px; padding: 8px 12px 8px 8px; border: 1px solid transparent; border-radius: 11px; background: var(--raised); transition: border-color .2s, background .2s; }
.seat-slot b { display: block; font-size: .86rem; white-space: nowrap; }
.seat-slot b i { margin-left: 3px; padding: 1px 5px; border-radius: 4px; background: #ffffff18; color: var(--muted); font: 700 .6rem var(--mono); font-style: normal; }
.seat-slot.me b { color: var(--accent-hover); }
.seat-slot.active { border-color: var(--accent); background: #ffc9281f; box-shadow: 0 0 0 1px #ffc92855 inset; }
.seat-slot.active .pt { box-shadow: 0 0 0 2px var(--accent); }
.pips { display: flex; gap: 4px; margin-top: 4px; }
.pips i { width: 16px; height: 6px; border-radius: 3px; background: #ffffff1c; }
.pips i.on { background: #ffc06a; box-shadow: 0 0 8px #ffc06a88; }
.turn-call { display: grid; align-content: center; gap: 2px; padding: 10px 16px; }
.turn-call b { font-size: 1rem; }
.turn-call small { color: var(--muted); font-size: .78rem; }
.turn-call.mine { border-color: var(--accent); background: linear-gradient(140deg,#3a1f1b,var(--surface)); }
.turn-call.mine b { color: var(--accent-hover); }
.turn-call .link-button { justify-self: start; padding: 4px 0 0; }
.event-banner { padding: 16px 18px; border: 1px solid #ffc06a66; border-radius: 14px; background: linear-gradient(120deg,#2d2512,var(--surface) 75%); }
.event-banner .eyebrow { color: #ffc06a; margin-bottom: 4px; }
.event-banner h3 { font-size: 1.05rem; margin-bottom: 4px; }
.event-banner p:not(.eyebrow) { color: #ded8cf; font-size: .9rem; }

/* 지도 */
.inv-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.map { display: grid; gap: 12px; }
.floor { padding: 12px 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #121318; }
.floor h3 { margin: 0 0 8px 4px; color: var(--muted); font: 700 .72rem var(--mono); letter-spacing: .14em; }
.plan { position: relative; aspect-ratio: 16 / 6.6; border-radius: 10px; background-color: #15171d; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg,#ffffff08 1px, transparent 1px); background-size: 22px 22px; border: 1px solid #2b2d36; }
.corridor { position: absolute; left: 1%; right: 1%; bottom: 6%; height: 22%; border: 1px dashed #ffffff1c; border-radius: 6px; }
.stairs { position: absolute; right: 2%; bottom: 9%; display: flex; align-items: center; gap: 4px; color: #77747e; font-size: .68rem; }
.stairs .ico { width: 16px; height: 16px; }
.tile { position: absolute; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 8px 9px; overflow: hidden; border: 1.5px solid #3c3f4b; border-radius: 9px; background: linear-gradient(160deg,#252833,#1b1d24); text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: #8d8995; transform: translateY(-1px); }
.tile-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tile-head b { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.tile .ico { color: var(--accent-hover); }
.slots { display: flex; gap: 4px; flex-wrap: wrap; }
.slots i { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid #ffffff3a; }
.slots i.on { border-color: #ffc06a; background: #ffc06a; box-shadow: 0 0 6px #ffc06a77; }
.visitors { display: flex; gap: 2px; min-height: 20px; }
.tile.can { border-color: var(--accent); box-shadow: 0 0 0 1px #ffc92866, 0 0 20px -4px #ffc92899; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 1px #ffc92833, 0 0 8px -4px #ffc92855; } }
.tile.sel { border-color: #ffffff; background: linear-gradient(160deg,#363a48,#20232c); }
.tile.locked { background: repeating-linear-gradient(135deg,#1a1b21 0 8px,#202129 8px 16px); border-style: dashed; }
.tile.locked .ico { color: #ffc06a; }
.tile.done { opacity: .58; }
.tile.scene { border-color: #b8343488; }
.tape { position: absolute; top: 46%; left: -10%; right: -10%; padding: 1px 0; background: #e8c547; color: #1b1b1b; font: 900 .55rem var(--mono); letter-spacing: .3em; text-align: center; transform: rotate(-8deg); opacity: .85; pointer-events: none; }
.place-panel { position: sticky; top: 16px; display: grid; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.place-panel.scene { border-color: #b8343466; }
.place-panel header { display: flex; align-items: center; gap: 12px; }
.place-panel header > div { flex: 1; }
.place-panel h3 { font-size: 1.3rem; letter-spacing: -.04em; }
.place-panel .eyebrow { margin: 0; }
.place-panel > p { color: #d4d1d8; font-size: .9rem; }
.place-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--raised); color: var(--accent-hover); }
.place-ico .ico { width: 24px; height: 24px; }
.slot-count { font: 800 1rem var(--mono); color: #ffc06a; }
.lock-hint { display: flex; gap: 8px; align-items: center; color: #ffd79a !important; }
.unlock { display: grid; gap: 8px; padding: 14px; border: 1px dashed #ffc06a66; border-radius: 12px; background: #ffc06a0d; }
.unlock p { font-size: .86rem; color: #e9e2d6; }
.unlock-row { display: flex; gap: 8px; align-items: center; }
.unlock-row select { flex: 1; min-width: 0; }
.unlock small { color: var(--muted); font-size: .74rem; }
.code-input { width: 100%; text-align: center; font: 800 1.6rem var(--mono) !important; letter-spacing: .6em; }
.evi-list { display: grid; gap: 8px; }
.evi { display: grid; gap: 4px; padding: 12px 14px; border-radius: 11px; border: 1px solid #ffffff14; background: var(--raised); }
.evi-tag { justify-self: start; padding: 1px 7px; border-radius: 4px; background: #ffffff12; color: var(--muted); font: 700 .64rem var(--mono); letter-spacing: .06em; }
.evi h4 { margin: 0; font-size: .94rem; }
.evi p { color: #d2ced6; font-size: .85rem; }
.evi.private { border-color: #7d6cff55; background: linear-gradient(150deg,#211e35,var(--raised) 70%); }
.evi.private .evi-tag { background: #7d6cff33; color: #cfc8ff; }
.evi.event { border-color: #ffc06a55; }
.evi .button { justify-self: start; margin-top: 4px; }
.board { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.board header { display: flex; justify-content: space-between; align-items: center; }
.board h3 { font-size: 1.05rem; }
.board .eyebrow { margin: 4px 0 0; }
.evi-list.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.log { padding: 10px 14px; margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.log ol { display: grid; gap: 6px; margin: 10px 0 2px; padding: 0; list-style: none; }
.log li { display: flex; align-items: center; gap: 7px; font-size: .84rem; }
.log li i { padding: 0 5px; border-radius: 4px; background: #ffffff14; color: var(--muted); font: 700 .6rem var(--mono); font-style: normal; }
.log li span { color: #cfccd3; }
.chat-drawer { padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.chat-drawer summary { font-weight: 750; }
.chat-drawer .hint { margin: 8px 0; }
.chat { display: grid; gap: 10px; align-content: start; }
.chat .messages { max-height: 440px; min-height: 220px; }
.bubble { display: flex; gap: 10px; align-items: flex-start; max-width: 86%; }
.bubble > div { padding: 9px 13px; border-radius: 4px 14px 14px 14px; background: var(--raised); }
.bubble b { font-size: .8rem; color: var(--muted); }
.bubble p { margin-top: 2px; color: var(--ink); font-size: .92rem; }
.bubble.bot > div { background: #222634; border: 1px solid #3a4055; }
.bubble.mine { flex-direction: row-reverse; margin-left: auto; }
.bubble.mine > div { border-radius: 14px 4px 14px 14px; background: #ffc92826; border: 1px solid #ffc92855; }
.disc-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.disc-grid .chat { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.disc-grid .chat .messages { max-height: 560px; min-height: 360px; }
.disc-grid .evi-list.compact { grid-template-columns: 1fr; max-height: 520px; overflow-y: auto; }

/* 투표 */
.suspect-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.suspect { display: grid; gap: 4px; justify-items: center; padding: 0 0 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); text-align: center; transition: border-color .15s, transform .15s; }
.suspect:hover { border-color: var(--accent); transform: translateY(-3px); }
.suspect-art { width: 100%; aspect-ratio: 1 / 1.05; margin-bottom: 8px; background: center 18% / cover no-repeat; }
.suspect-art.letter { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%,#2b2e3a,#16171d); color: var(--accent); font-size: 3rem; font-weight: 900; }
.suspect small { color: var(--muted); font-size: .76rem; }
.suspect em { margin-top: 6px; padding: 4px 14px; border-radius: 999px; background: var(--accent); color: #221517; font-size: .78rem; font-weight: 800; font-style: normal; }
.suspect.none em { background: var(--raised); color: var(--ink); }
.vote-done { padding: 18px; border: 1px solid var(--accent); border-radius: 14px; background: #ffc92814; font-weight: 750; text-align: center; }

/* 결말 */
.verdict { padding: clamp(22px, 4vw, 36px); border: 1px solid var(--border); border-radius: 18px; background: radial-gradient(ellipse at 20% 0%,#3a1c18,var(--surface) 60%); }
.verdict.solved { background: radial-gradient(ellipse at 20% 0%,#163626,var(--surface) 60%); }
.verdict h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); letter-spacing: -.06em; margin-bottom: 16px; }
.culprit { display: flex; gap: 18px; align-items: center; }
.culprit-art { flex: 0 0 auto; width: 120px; aspect-ratio: 1 / 1.15; border-radius: 12px; background: center 18% / cover no-repeat; border: 2px solid #ff4d4d; }
.culprit strong { display: block; font-size: 1.8rem; letter-spacing: -.05em; margin-bottom: 6px; }
.culprit p:not(.eyebrow) { color: #ddd8dc; }
.end-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel-card { display: grid; gap: 10px; align-content: start; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.panel-card h3 { font-size: 1.1rem; }
.panel-card.twist { border-color: #ffc06a66; background: linear-gradient(150deg,#2d2512,var(--surface) 70%); }
.panel-card.twist .eyebrow { color: #ffc06a; margin: 0; }
.panel-card.twist p:not(.eyebrow) { color: #ece4d6; }
.bars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 58px 1fr 36px; gap: 10px; align-items: center; font-size: .88rem; }
.bars i { height: 10px; min-width: 2px; border-radius: 5px; background: #6b6875; }
.bars li.hit i { background: var(--accent); }
.bars b { font: 700 .82rem var(--mono); text-align: right; }
.ballots { display: grid; gap: 5px; margin: 6px 0 0; padding: 0; list-style: none; font-size: .84rem; }
.ballots li { display: flex; gap: 7px; align-items: center; color: #cfccd3; }
.explain { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.explain li { display: grid; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--raised); border-radius: 0 10px 10px 0; }
.explain span { color: #d4d1d8; font-size: .9rem; }
.mission-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mission-results article { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--raised); }
.mission-results header { display: flex; align-items: center; gap: 8px; }
.mission-results header i { padding: 0 6px; border-radius: 4px; background: var(--accent); color: #221517; font: 700 .64rem var(--mono); font-style: normal; }
.mission-results p { display: flex; gap: 8px; font-size: .84rem; color: #d4d1d8; }
.mission-results p span { flex: 0 0 auto; padding: 0 6px; border-radius: 4px; font: 700 .7rem/1.7 var(--mono); }
.mission-results p.win span { background: #4fd18b33; color: #8ff0b8; }
.mission-results p.lose span { background: #ff6b6b33; color: #ffb0b0; }
.epilogue p:not(.eyebrow):not(.lead) { color: #d4d1d8; font-size: .92rem; }
.detail-tagline { color: var(--accent-hover) !important; font-weight: 700; }
.record-clue summary small { color: var(--muted); font-size: .72rem; margin-right: 4px; }

@media (max-width: 1080px) {
  .inv-grid, .disc-grid { grid-template-columns: 1fr; }
  .place-panel { position: static; }
  .suspect-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .brief-grid, .brief-grid.two, .char-grid, .end-grid { grid-template-columns: 1fr; }
  .char-art { aspect-ratio: 16 / 11; }
  .dossier { grid-template-columns: 1fr; }
  .dossier-id { position: static; grid-template-columns: 96px 1fr; column-gap: 14px; }
  .dossier-photo { grid-row: span 4; }
  .hud { grid-template-columns: auto 1fr; }
  .turn-call { grid-column: 1 / -1; }
  .mission-results { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .game { margin-top: 16px; }
  .time-strip { grid-template-columns: 1fr 1fr; row-gap: 16px; }
  .time-strip::before { display: none; }
  .excuse-grid, .mission-grid { grid-template-columns: 1fr; }
  .plan { aspect-ratio: 16 / 10; }
  .tile { padding: 6px; }
  .tile-head b { font-size: .74rem; }
  .tile-head .ico { width: 15px; height: 15px; }
  .slots i { width: 9px; height: 9px; }
  .visitors { display: none; }
  .tape { font-size: .45rem; }
  .seat-slot { min-width: 118px; }
  .suspect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bubble { max-width: 100%; }
  .culprit { flex-direction: column; align-items: start; }
  .stage-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cine::before, .tile.can, .onair span { animation: none; }
  .char-card:hover, .suspect:hover, .tile:hover { transform: none; }
}
.phase-intro .game-top h1 { display: none; }
.explain small.missed { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #ffffff12; color: var(--muted); font-size: .7rem; font-weight: 600; }
.relations li { display: grid; grid-template-columns: 44px 1fr; gap: 6px; }
.relations b { min-width: 0; margin: 0; }

/* 조사·대화 라운드 */
.round .stage-tag { margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: #ffc06a22; color: #ffc06a; font: 700 .66rem var(--mono); }
.hud.talking .round .stage-tag { background: #7d6cff2e; color: #cfc8ff; }
.hud.talking .turn-call { border-color: #7d6cff88; background: linear-gradient(140deg,#221f3a,var(--surface)); }
.clock { margin-left: 6px; padding: 1px 8px; border-radius: 6px; background: #ffffff14; font: 800 1.05rem var(--mono); color: #e6e1ff; }
.clock.urgent { background: #ff4d4d33; color: #ffb3b3; animation: blink 1s steps(2) infinite; }
.ready-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.ready-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.ready-list span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border: 1px solid var(--border); border-radius: 999px; opacity: .6; }
.ready-list span.on { opacity: 1; border-color: #4fd18b88; color: #b9f3d0; }
.ready-list b { font: 700 .8rem var(--mono); color: var(--ink); }
.ready-box .link-button { flex-basis: 100%; text-align: right; }
.map-drawer { padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.map-drawer summary { font-weight: 750; }
.map-drawer .inv-grid { margin-top: 12px; }
.log li small { color: var(--muted); font: 700 .62rem var(--mono); }
.messages.typing::after { display: block; margin: 6px 0 2px 44px; content: "AI들이 이어서 말하는 중…"; color: var(--muted); font-size: .8rem; animation: blink 1.4s steps(2) infinite; }
@media (max-width: 620px) {
  .ready-box { justify-content: stretch; }
  .ready-box .button { width: 100%; }
  .ready-box .link-button { text-align: center; }
}

/* 그림이 없는 작품: 작품마다 정해진 색조(--h)로 표지와 인물 카드를 칠한다. */
.cover.tone { background: radial-gradient(ellipse at 70% 30%, hsl(var(--h) 46% 34%), hsl(var(--h) 38% 13%) 78%); }
.cover-glyph { position: absolute; right: 14px; bottom: 2px; font-size: 5.2rem; line-height: 1; opacity: .92; filter: drop-shadow(0 6px 14px #0009); }
.cover-mood { position: relative; z-index: 1; margin: 10px; color: hsl(var(--h) 70% 86%); font: 700 .7rem var(--mono); letter-spacing: .08em; }
.cine.toned::before { background: linear-gradient(0deg,#0d0e12 4%,#0d0e12b0 44%,#0d0e1200 80%), radial-gradient(ellipse at 76% 24%, hsl(var(--h) 52% 36%), hsl(var(--h) 40% 10%) 72%); }
.cine.toned .onair { border-color: hsl(var(--h) 70% 62% / .6); background: hsl(var(--h) 50% 14% / .8); color: hsl(var(--h) 80% 90%); }
.cine.toned .onair span { background: hsl(var(--h) 85% 66%); box-shadow: 0 0 14px hsl(var(--h) 85% 66%); }
.cine-glyph { position: absolute; z-index: -1; right: 5%; top: 8%; font-size: clamp(6rem, 20vw, 13rem); line-height: 1; opacity: .9; filter: drop-shadow(0 12px 30px #000a); }
.toned { background: radial-gradient(circle at 50% 34%, hsl(var(--h, 20) 44% 36%), hsl(var(--h, 20) 36% 13%) 78%) !important; }
.art-letter { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 14%; color: hsl(var(--h, 20) 60% 84% / .5); font-size: clamp(4rem, 9vw, 6.4rem); font-weight: 900; }
.dossier-photo { position: relative; }
.pt-letter[style] { background: hsl(var(--h) 40% 24%); color: hsl(var(--h) 75% 86%); }
.suspect-art.letter[style] { background: radial-gradient(circle at 50% 40%, hsl(var(--h) 42% 32%), hsl(var(--h) 36% 13%)); color: hsl(var(--h) 70% 86%); }
.filters { max-height: 7.2rem; overflow-y: auto; }

/* ── 9판: 스크롤 대신 버튼으로 여닫는 패널, 생각 중 표시, 알림 ── */
.talk-hint { margin: 12px 0 8px; color: var(--muted); font-size: .86rem; }
.phase-investigation .chat { padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.phase-investigation .chat .messages { height: clamp(260px, calc(100dvh - 520px), 620px); max-height: none; min-height: 0; align-content: start; }
.phase-investigation .map { margin-top: 14px; }
:root { --dock-h: 66px; }
.phase-investigation { padding-bottom: calc(var(--dock-h) + 30px); }
.dock { position: fixed; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); bottom: max(10px, env(safe-area-inset-bottom, 0px)); z-index: 45; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 0; padding: 6px; border: 1px solid var(--border); border-radius: 18px; background: #14161ef2; backdrop-filter: blur(10px); box-shadow: 0 10px 30px #000a; }
.dock-btn { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 4px 7px; border: 0; border-radius: 13px; background: transparent; color: #cfccd3; font: 700 .76rem var(--sans, inherit); cursor: pointer; }
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn:hover { background: #ffffff10; color: var(--ink); }
.dock-btn.on { background: #ffc92826; color: #ffb7a8; }
.dock-btn b { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent, #ffc928); color: #17120f; font: 800 .66rem/1.6 var(--mono); text-align: center; }
.sheet-back { position: fixed; inset: 0; z-index: 40; background: #0009; }
.sheet-back.enter { animation: fade .18s ease-out; }
.sheet { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--page, #0d0e12); box-shadow: -20px 0 50px #000a; }
.sheet.enter { animation: slide-in .22s ease-out; }
.sheet.sheet-map { width: min(760px, 100vw); }
.sheet > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sheet > header h3 { flex: 1; font-size: 1.05rem; }
.sheet .close { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px calc(var(--dock-h) + 30px + env(safe-area-inset-bottom, 0px)); }
.evi-by { color: #9fb4ff; font-size: .74rem; font-weight: 700; }
.sheet .place-panel, .sheet .board { position: static; padding: 0; border: 0; background: none; }
.sheet .evi-list.compact { grid-template-columns: 1fr; }
.log-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.log-list li { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .88rem; }
.log-list small { color: var(--muted); font: 700 .66rem var(--mono); }
.log-list i { padding: 0 5px; border-radius: 4px; background: #ffffff14; color: var(--muted); font: 700 .6rem var(--mono); font-style: normal; }
.log-list span { margin-left: auto; color: #cfccd3; text-align: right; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.dots { display: inline-flex; gap: 4px; padding: 6px 2px 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa1b8; animation: dot 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -2px; background: currentColor; animation: blink 1s steps(2) infinite; }
.bubble.thinking b { color: var(--muted); }
.messages.typing::after { content: none; }
#feed { position: fixed; z-index: 60; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; width: min(440px, calc(100vw - 24px)); transform: translateX(-50%); display: grid; gap: 6px; pointer-events: none; }
.feed-item { display: grid; gap: 1px; padding: 9px 14px; border: 1px solid #3a4055; border-left: 4px solid #8f9bff; border-radius: 12px; background: #1b1e2bf5; color: #eceaf0; box-shadow: 0 10px 26px #000a; font-size: .86rem; animation: drop .28s ease-out; transition: opacity .3s, transform .3s; }
.feed-item b { font-size: .88rem; } .feed-item span { color: #c3c0cb; overflow-wrap: anywhere; }
.feed-item.search { border-left-color: #ffb454; } .feed-item.unlock { border-left-color: #63d39b; } .feed-item.stage { border-left-color: #ffc928; } .feed-item.talk { border-left-color: #8f9bff; }
.feed-item.out { opacity: 0; transform: translateY(-8px); }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } }
@media (max-width: 720px) {
  .sheet, .sheet.sheet-map { top: auto; left: 0; right: 0; width: auto; height: min(84dvh, 720px); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; }
  .sheet.enter { animation-name: slide-up; }
  .sheet, .sheet.sheet-map { bottom: calc(var(--dock-h) + max(10px, env(safe-area-inset-bottom, 0px)) + 8px); height: auto; top: 8dvh; border-bottom: 1px solid var(--border); border-radius: 18px; left: 8px; right: 8px; }
  .phase-investigation .chat { padding: 10px; }
  .phase-investigation .chat .messages { height: clamp(240px, calc(100dvh - 430px), 560px); }
  .phase-investigation .hud .seat-slots { display: none; }
  .dock-btn { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back, .feed-item, .dots i, .caret { animation: none; } }

.floor-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.floor-tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); color: #cfccd3; font: 700 .86rem inherit; cursor: pointer; }
.floor-tabs button.on { border-color: var(--accent); background: #ffc92826; color: #ffd0c6; }
.floor-tabs b { min-width: 18px; padding: 0 5px; border-radius: 99px; background: #ffb454; color: #17120f; font: 800 .66rem/1.6 var(--mono); }
.map .floor > h3 { display: none; }
@media (max-width: 720px) { .feed-item { padding: 7px 12px; font-size: .8rem; } .feed-item b { font-size: .82rem; } }

.epilogue p { max-width: 68ch; line-height: 1.85; margin-top: 12px; }
.epilogue hr.soft { margin: 18px 0 6px; border: 0; border-top: 1px solid var(--border); }

.brief-card p, [data-record="briefing"] p { white-space: pre-line; }

.detail-world { white-space: pre-line; max-height: 15rem; overflow-y: auto; }
.filters.seats { margin-bottom: 6px; }
.filters.seats .chip.active { background: #ffb454; border-color: #ffb454; color: #17120f; }
.char-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* 로그인 */
.account-button { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 26px; }
.account-button[hidden] { display: none; }
.social-logins { display: grid; gap: 9px; margin-top: 16px; }
.social { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #1f1f1f; font-weight: 760; font-size: .9rem; }
.social:hover { filter: brightness(.96); }
.social-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; font-weight: 900; font-size: .85rem; }
.social.google .social-mark { color: #4285f4; }
.social.kakao { background: #fee500; border-color: #fee500; color: #191919; }
.social.naver { background: #03c75a; border-color: #03c75a; color: #fff; }
.social.apple { background: #000; border-color: #444; color: #fff; }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 0 !important; font-size: .78rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.account-links { display: flex; justify-content: center; gap: 18px; margin-top: 12px !important; }
.account-actions { margin-top: 14px; }
.account-status:empty { display: none; }
.account-status { color: var(--accent-hover) !important; font-size: .85rem; }
@media (max-width: 620px) { .account-button { margin-left: 8px; max-width: 110px; } }

/* Character-card brand */
.brand-mark{width:56px;height:56px;object-fit:contain}
.brand-name{display:grid;text-align:left;font-size:1rem;line-height:1.3}
.brand-accent{font-size:.75rem}
.topbar,.site-footer{border-color:var(--accent)}
.hero{min-height:480px;background:#ffc928;color:#15130f;border:0;border-radius:4px}
.hero::before{background:url('/assets/mystery-logo.png') right 20px center / 43% auto no-repeat}
.hero-content{max-width:61%;padding:48px}
.hero h1{font-size:clamp(2.3rem,4.6vw,4.2rem)}
.hero .eyebrow,.hero-content>p:not(.eyebrow){color:#443019}
.hero .signal{background:#b73910;box-shadow:none}
.hero .button.primary{background:#15130f;color:#ffc928}
.hero .button.outline{background:transparent;border:2px solid #15130f;color:#15130f}
.hero-feature{background:#15130f;color:var(--ink);border-radius:3px}
.button,.search,.panel,.case-card,.chip{border-radius:4px}
.case-card{box-shadow:4px 4px 0 #090805}
.case-card:hover{border-color:var(--accent)}
.chip.active{background:var(--accent);color:#15130f;font-weight:800}
.section-head{padding-bottom:16px;border-bottom:2px solid var(--border)}
.card-body{padding:19px}
@media(max-width:700px){
.bar-inner,#app,.site-footer{width:calc(100% - 32px)}
.brand-mark{width:40px;height:40px}.brand-name{font-size:.7rem}.brand-accent{font-size:.6rem}nav{gap:8px}
.hero{min-height:660px;align-items:flex-start}.hero-content{max-width:100%;padding:28px 24px}
.hero::before{background-position:center bottom 65px;background-size:240px auto}
.hero h1{font-size:2.6rem}.hero-feature{bottom:12px;right:12px;left:12px}
}

/* Board-game shelf and tactile controls */
.hero { border: 3px solid #080705; box-shadow: 8px 8px 0 #080705; }
.button { border-width: 2px; font-weight: 850; }
.button.primary { box-shadow: 3px 3px 0 #080705; }
.case-card { border-width: 2px; box-shadow: 5px 5px 0 #080705; }
.cover { min-height: 190px; border-bottom: 2px solid #080705; }
.cover-number { background: #fff0cc; color: #21170d; border: 2px solid #21170d; border-radius: 2px; }
.card-body h3 { font-size: 1.25rem; }
.card-link { border-top: 1px dashed #78694e; }
.section-head h2 { font-weight: 900; }
@media(max-width:420px) {
.bar-inner { flex-wrap: wrap; padding-block: 12px; gap: 10px; }
.bar-inner nav { width: 100%; justify-content: space-between; }
.hero { min-height: 700px; }
.hero-content { padding: 24px 18px; }
.hero h1 { font-size: 2.2rem; }
.hero::before { background-size: 220px auto; }
}

@media(max-width:700px){.hero-feature{top:auto}}

.scene-image,.clue-image{display:block;width:100%;max-height:440px;object-fit:contain;border-radius:12px;margin:12px 0;background:#ebe8df}.floor-image{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}.illustrated-plan .corridor,.illustrated-plan .stairs{display:none}.illustrated-plan .tile{background:rgba(250,248,240,.72);backdrop-filter:blur(1px)}
