/* Last Ten — 화면/퍼즐 스타일 */

/* =====================================================================
   타이틀
   ===================================================================== */
#stage.on-title #topbar, #stage.on-title #side { visibility: hidden; }
.screen.title { background: #05050a; overflow: hidden; }
.title-bg { position: absolute; inset: -20px; background: url("../assets/img/prologue/p05.webp") center/cover; filter: blur(6px) brightness(.35) saturate(1.2); animation: drift 30s ease-in-out infinite alternate; }
.title-bg::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 2px, transparent 2px 4px), radial-gradient(ellipse at 30% 50%, transparent 20%, rgba(0, 0, 0, .85) 80%); }
@keyframes drift { from { transform: scale(1.05) translateX(-10px); } to { transform: scale(1.12) translateX(10px); } }
.title-art { position: absolute; left: 110px; top: 96px; width: 364px; height: 456px; border-radius: 6px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08); transform: rotate(-2deg); animation: floatArt 7s ease-in-out infinite; }
.title-art img { width: 100%; height: 100%; object-fit: cover; }
@keyframes floatArt { 50% { transform: rotate(-1.4deg) translateY(-6px); } }
.title-main { position: absolute; left: 580px; top: 64px; width: 470px; }
.title-logo { display: block; width: 400px; margin: 20px 0 6px -14px; mix-blend-mode: screen; pointer-events: none; }
.title-sub { font-family: var(--pen); font-size: 30px; color: var(--accent-2); margin: 0 0 12px 6px; letter-spacing: .08em; }
.title-tag { margin: 0 0 26px 6px; font-size: 14px; line-height: 1.8; color: #c9c5d8; }
.title-menu { display: flex; flex-direction: column; gap: 8px; margin-left: 4px; }
.menu-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 320px; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(10, 10, 18, .6); backdrop-filter: blur(4px); text-align: left; transition: border-color .15s, background .15s, transform .15s; }
.menu-btn b { font-size: 16px; font-weight: 700; }
.menu-btn small { font-size: 12px; color: var(--muted); }
.menu-btn:hover { border-color: var(--accent); background: rgba(40, 32, 80, .55); transform: translateX(4px); }
.menu-btn.primary { border-color: rgba(185, 168, 255, .55); background: linear-gradient(90deg, rgba(122, 104, 224, .35), rgba(10, 10, 18, .6)); }
.title-row { display: flex; gap: 6px; margin-top: 8px; }
.title-warn { margin: 22px 0 0 6px; font-size: 11.5px; color: var(--dim); white-space: nowrap; } /* 한 줄로 — 끝 글자만 다음 줄로 떨어지지 않게 */
.title-credit { position: absolute; right: 22px; bottom: 16px; font-size: 11px; color: var(--dim); letter-spacing: .1em; }

/* 챕터 카드 */
.screen.chapter-card { background: #000; cursor: pointer; }
.cc-view { position: absolute; left: 10px; top: 40px; width: 900px; height: 600px; overflow: hidden; border-radius: 4px; }
.cc-view img, .cc-view video { width: 100%; height: 100%; object-fit: cover; animation: ccZoom 6s ease-out forwards; }
@keyframes ccZoom { from { transform: scale(1.06); filter: brightness(.6); } to { transform: none; filter: none; } }
.cc-info { position: absolute; left: 922px; top: 40px; width: 220px; height: 600px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; padding: 0 8px; font-size: 13px; color: var(--muted); }
.cc-en { font-family: var(--serif); font-size: 15px; color: #d9d3ea; letter-spacing: .04em; }
.cc-code { display: flex; flex-direction: column; gap: 4px; }
.cc-no { font-family: var(--mono); letter-spacing: .3em; color: var(--accent); }
.cc-code b { font-family: var(--mono); font-size: 22px; color: var(--accent-2); letter-spacing: .12em; margin-left: 6px; user-select: text; -webkit-user-select: text; }
.cc-tip { animation: pulse 1.6s infinite; }

/* 진행 노트 */
.screen.notebook { background: rgba(0, 0, 0, .6); display: grid; place-items: center; }
.nb-panel { width: 780px; height: 600px; display: flex; flex-direction: column; border-radius: 14px; background: linear-gradient(180deg, #16141f, #0f0e16); border: 1px solid var(--line-2); box-shadow: 0 30px 90px rgba(0, 0, 0, .8); overflow: hidden; }
.nb-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.nb-head h2 { margin: 0; font-size: 18px; letter-spacing: .06em; }
.nb-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.nb-tab { padding: 10px 14px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; }
.nb-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.nb-content { flex: 1; overflow-y: auto; padding: 16px 24px 28px; user-select: text; -webkit-user-select: text; scrollbar-width: thin; scrollbar-color: #3a3650 transparent; }
.nb-chapter { margin: 18px 0 8px; font-size: 12px; color: var(--accent); letter-spacing: .08em; }
.nb-chapter:first-child { margin-top: 0; }
.nb-card { margin: 0 0 10px; padding: 14px 18px; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.nb-card h3 { margin: 0 0 6px; font-size: 14.5px; }
.nb-card p { margin: 0; font-size: 14px; line-height: 1.75; color: #d6d2e3; white-space: pre-line; word-break: keep-all; }
.nb-card.is-story { background: linear-gradient(180deg, rgba(255, 244, 214, .07), rgba(255, 244, 214, .03)); border-color: rgba(255, 230, 170, .14); }
.nb-card.is-story p { font-family: var(--pen); font-size: 21px; line-height: 1.5; color: #efe6cf; }
.nb-card { position: relative; }
.nb-stamp { position: absolute; right: 16px; top: 12px; width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid rgba(214, 64, 64, .8); border-radius: 50%; color: rgba(226, 74, 74, .92); font: 700 24px var(--font); transform: rotate(-12deg); box-shadow: inset 0 0 0 3px rgba(214, 64, 64, .25); mix-blend-mode: screen; }
.nb-img { display: block; max-width: 100%; max-height: 220px; margin: 6px 0 8px; border-radius: 6px; cursor: zoom-in; }
.nb-empty { color: var(--dim); text-align: center; margin-top: 80px; }
.nb-help { color: var(--muted); font-size: 13px; }
.nb-log .log-line { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 5px 0; font-size: 13.5px; line-height: 1.6; border-bottom: 1px solid rgba(255, 255, 255, .03); }
.nb-log .log-line b { color: var(--accent); font-weight: 500; }
.nb-log .log-line > span:only-child { grid-column: 2; }
.nb-log .log-line.is-narr span { color: #b9b4c9; font-style: italic; }
.nb-codes .code-row { display: flex; justify-content: space-between; padding: 12px 16px; margin-bottom: 6px; border-radius: 8px; background: rgba(255, 255, 255, .04); }
.nb-codes .code-row b { font-family: var(--mono); font-size: 17px; color: var(--accent-2); letter-spacing: .12em; user-select: text; -webkit-user-select: text; }

/* 문제 창의 힌트 — 창 왼쪽 위 */
.puzzle-help { position: absolute; left: 24px; top: 52px; z-index: 2; width: 268px; pointer-events: none; text-align: left; }
.modal.in-view .puzzle-help { left: 14px; top: 12px; }
.pzh-btns { display: flex; gap: 6px; }
.pzh-btn { pointer-events: auto; height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(16, 14, 26, .94); color: var(--text); font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); transition: border-color .15s, background .15s; }
.pzh-btn:hover, .pzh-btn.on { border-color: rgba(255, 217, 138, .7); background: rgba(34, 30, 48, .96); }
.pzh-btn.answer { color: #ffc2c8; }
.pzh-btn.answer:hover { border-color: rgba(255, 93, 108, .6); }
.pzh-card { pointer-events: auto; margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: rgba(16, 14, 26, .97); border: 1px solid var(--line-2); box-shadow: 0 14px 44px rgba(0, 0, 0, .65); }
.pzh-card[hidden] { display: none; }
.pzh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--accent-2); }
.pzh-x { width: 22px; height: 22px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.pzh-x:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.pzh-steps { margin: 0; padding-left: 18px; max-height: 300px; overflow-y: auto; }
.pzh-steps li { margin: 0 0 8px; font-size: 13.5px; line-height: 1.65; color: #dcd8e8; word-break: keep-all; }
.pzh-steps li.answer { list-style: none; margin: 4px 0 2px -18px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--accent-2); font-weight: 700; }
.pzh-steps li.answer b { margin-right: 4px; padding: 1px 6px; border-radius: 4px; background: rgba(255, 217, 138, .14); font-size: 12px; }
.pzh-more { text-align: right; }
.pzh-more .btn[hidden] { display: none; }

/* 설정 */
.modal-box.settings { width: 440px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.set-row input[type=range] { width: 200px; accent-color: var(--accent); }
.set-row.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { padding: 5px 10px; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: rgba(185, 168, 255, .2); color: var(--text); }
.set-warn { font-size: 12.5px; color: var(--accent-2); line-height: 1.6; }

/* 조작법 */
.modal-box.howto { width: 520px; }
.howto-list { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; margin: 0; font-size: 14px; line-height: 1.6; }
.howto-list dt { color: var(--accent); font-family: var(--mono); }
.howto-list dd { margin: 0; color: #d6d2e3; word-break: keep-all; }

/* =====================================================================
   컷신: 중앙 자막 / 편지 / 타이틀
   ===================================================================== */
.caption { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.caption.in { opacity: 1; }
.caption-text { font-size: 26px; font-weight: 500; letter-spacing: .04em; color: #f1eef8; text-align: center; white-space: pre-line; line-height: 1.6; text-shadow: 0 0 18px rgba(185, 168, 255, .25); }
.caption-sub { font-size: 14px; color: var(--muted); }
.caption.is-date .caption-text { font-family: var(--mono); font-size: 30px; letter-spacing: .18em; }
.caption.is-red .caption-text { color: #ff3b46; font-weight: 700; }
.caption.is-small .caption-text { font-size: 18px; }
.caption.is-left { align-items: flex-start; padding: 0 110px; }
.caption.is-left .caption-text { text-align: left; font-size: 19px; line-height: 1.9; }

/* 편지지 · 시네마 카메라 → letter.css */

/* =====================================================================
   퍼즐 공통
   ===================================================================== */
.modal-box.puzzle { min-width: 360px; text-align: center; }
.modal-box.puzzle.bad { animation: shake 420ms; border-color: rgba(255, 93, 108, .6); }
.modal-box.puzzle.ok { border-color: rgba(125, 240, 176, .7); box-shadow: 0 0 0 1px rgba(125, 240, 176, .4), 0 0 40px rgba(125, 240, 176, .25); }
.puzzle-image { display: block; max-width: 620px; max-height: 300px; margin: 0 auto 14px; border-radius: 6px; }
.puzzle-prompt { margin: 0 0 16px; font-size: 14.5px; line-height: 1.75; color: #d9d5e6; white-space: pre-line; word-break: keep-all; }

/* 다이얼 */
.dial-row { display: flex; justify-content: center; align-items: center; gap: 8px; }
.dial-wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dial-wheel button { width: 54px; height: 24px; font-size: 11px; color: var(--muted); border-radius: 6px; }
.dial-wheel button:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.dial-face { width: 54px; height: 66px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(180deg, #dcdae4 0%, #fff 45%, #fff 55%, #c9c6d4 100%); color: #15131c; font: 700 32px var(--mono); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35), 0 2px 0 rgba(255, 255, 255, .1); cursor: pointer; }
.dial-face.cursor { outline: 2px solid var(--accent); outline-offset: 2px; }
.dial-sep { font: 700 30px var(--mono); color: var(--text); padding: 0 2px; }

/* 주관식 */
.answer-boxes { display: flex; justify-content: center; gap: 6px; margin: -4px 0 14px; }
.answer-boxes span { width: 34px; height: 38px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-2); font-size: 18px; font-weight: 700; color: var(--accent-2); }
.answer-boxes span.on { border-color: var(--accent-2); }
.answer-row { display: flex; gap: 8px; justify-content: center; }
.answer-input { width: 260px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .4); color: var(--text); font-size: 16px; text-align: center; user-select: text; -webkit-user-select: text; }
.answer-input.code { font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.answer-input:focus { outline: none; border-color: var(--accent); }
.answer-msg { min-height: 22px; margin-top: 10px; font-size: 13.5px; color: #ffb3ba; }
.modal-box.code-entry { width: 460px; }

/* 휴대폰 */
.phone { position: relative; width: 270px; height: 520px; margin: 0 auto; padding: 14px; border-radius: 38px; background: linear-gradient(145deg, #2a2a33, #0d0d12); box-shadow: inset 0 0 0 2px #3a3a46, 0 20px 50px rgba(0, 0, 0, .7); }
.phone-notch { position: absolute; left: 50%; top: 20px; width: 70px; height: 16px; margin-left: -35px; border-radius: 10px; background: #000; z-index: 2; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 26px; overflow: hidden; background: linear-gradient(180deg, #1e2a3a, #0b1018) center/cover; display: flex; flex-direction: column; align-items: center; }
.phone-lock { margin-top: 48px; font-size: 18px; opacity: .8; }
.phone-time { font: 300 44px var(--font); color: #fff; margin: 4px 0 2px; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.pattern-msg { min-height: 40px; padding: 0 18px; font-size: 12.5px; line-height: 1.5; color: #ffe0a3; text-align: center; white-space: pre-line; text-shadow: 0 1px 4px #000; }
.pattern-svg { width: 220px; height: 220px; margin-top: 18px; touch-action: none; cursor: crosshair; }
.pattern-svg circle { fill: rgba(255, 255, 255, .75); transition: fill .15s; }
.pattern-svg circle.on { fill: #fff; }
.pattern-svg line { stroke: rgba(255, 255, 255, .8); stroke-width: 5; stroke-linecap: round; }
.pattern-svg line.live { stroke: rgba(255, 255, 255, .45); }
.pattern-svg.bad line { stroke: var(--danger); }
.pattern-svg.bad circle.on { fill: var(--danger); }
.pattern-svg.ok line { stroke: var(--ok); }
.pattern-svg.ok circle.on { fill: var(--ok); }
.modal-box.pattern { background: transparent; border: 0; box-shadow: none; padding: 10px; }
.modal-box.pattern .modal-title { text-align: center; margin-right: 0; }
