/* ==========================================================================
   《눈사람 살인사건》 CASE ARCHIVE // WINTER 03
   Click-Through Viewfinder Scene Deck + Polaroid Dossier + Stacked Photos
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-top: #0B1017;
  --bg-mid: #111823;
  --bg-deep: #070A0F;

  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.068);
  --glass-border: rgba(210, 228, 245, 0.12);
  --glass-border-strong: rgba(210, 228, 245, 0.24);

  --text-primary: #F2F5F8;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --crimson: #A82433;
  --crimson-bright: #C93344;
  --crimson-soft: rgba(168, 36, 51, 0.18);
  --crimson-border: rgba(168, 36, 51, 0.48);

  /* Typography */
  --font-serif: 'Gowun Batang', 'Noto Serif KR', Georgia, serif;
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --container-max: 1060px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse 85% 45% at 50% 18%, rgba(152, 188, 224, 0.1) 0%, transparent 70%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-deep) 100%);
  transition: background 0.8s var(--ease-out);
}

body[data-mood="archive"] {
  background:
    radial-gradient(ellipse 80% 45% at 50% 20%, rgba(168, 36, 51, 0.06) 0%, transparent 68%),
    linear-gradient(180deg, #090D14 0%, var(--bg-deep) 55%, #04060A 100%);
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(186, 214, 242, 0.65);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); letter-spacing: 0.03em; }
.text-crimson { color: #D84859; }
.text-center { text-align: center; }
.center-desc { margin-left: auto; margin-right: auto; }

/* ==========================================================================
   Snow Canvas, Vignette & Camera Shutter Flash
   ========================================================================== */
#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
  transition: opacity 0.8s ease;
}

body[data-mood="archive"] #snow-canvas {
  opacity: 0.45;
}

.atmosphere-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at 50% 50%, transparent 48%, rgba(4, 6, 10, 0.62) 100%);
  opacity: 0.55;
  transition: opacity 0.8s ease;
}

body[data-mood="archive"] .atmosphere-vignette {
  opacity: 0.95;
}

.shutter-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 28;
  background: rgba(210, 228, 245, 0.08);
  opacity: 0;
}

.shutter-flash.is-flashing {
  animation: shutterPulse 0.36s var(--ease-out);
}

@keyframes shutterPulse {
  0% { opacity: 0.7; }
  100% { opacity: 0; }
}

/* ==========================================================================
   Fixed DSLR Viewfinder HUD (All Screens)
   ========================================================================== */
.viewfinder-hud {
  position: fixed;
  inset: 8px 10px;
  pointer-events: none;
  z-index: 30;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(242, 245, 248, 0.58);
}

.hud-corner {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
}

.hud-bracket {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(210, 228, 245, 0.3);
  border-style: solid;
  transition: border-color 0.5s ease;
}

body[data-mood="archive"] .hud-bracket {
  border-color: rgba(168, 36, 51, 0.48);
}

.hud-tl { top: 0; left: 0; }
.hud-tl .hud-bracket { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }

.hud-tr { top: 0; right: 0; }
.hud-tr .hud-bracket { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }

.hud-bl { bottom: 0; left: 0; }
.hud-bl .hud-bracket { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }

.hud-br { bottom: 0; right: 0; }
.hud-br .hud-bracket { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

.hud-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.hud-rec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
  font-weight: 500;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--crimson);
  box-shadow: 0 0 8px rgba(168, 36, 51, 0.95);
  animation: recBlink 2s infinite ease-in-out;
}

@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.22; }
}

.hud-divider,
.hud-dot { color: rgba(148, 163, 184, 0.45); }

.hud-battery {
  display: inline-flex;
  align-items: center;
  color: rgba(242, 245, 248, 0.75);
}

.battery-low-bar { animation: recBlink 2.8s infinite ease-in-out; }

.hud-hide-xs { display: none; }

.hud-center-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  opacity: 0.08;
}

.hud-center-mark::before,
.hud-center-mark::after {
  content: "";
  position: absolute;
  background: rgba(210, 228, 245, 0.7);
}
.hud-center-mark::before { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.hud-center-mark::after { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }

/* ==========================================================================
   Top Utility Bar (BGM Player + Temperature Status)
   ========================================================================== */
.top-utility-bar {
  position: fixed;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
}

.bgm-toggle-btn,
.top-temp-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 16, 24, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-strong);
  font-size: 0.7rem;
  color: var(--text-primary);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
  white-space: nowrap;
}

.bgm-toggle-btn:hover,
.top-temp-btn:hover {
  border-color: rgba(210, 228, 245, 0.42);
  background: rgba(18, 26, 38, 0.88);
}

.bgm-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.bgm-bars i {
  display: block;
  width: 2px;
  height: 3px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: height 0.2s ease, background-color 0.2s ease;
}

body[data-bgm="playing"] .bgm-toggle-btn {
  border-color: rgba(186, 214, 242, 0.45);
}

body[data-bgm="playing"] .bgm-bars i {
  background: #93C5FD;
  animation: soundBar 1.1s infinite ease-in-out;
}
body[data-bgm="playing"] .bgm-bars i:nth-child(2) { animation-delay: 0.2s; }
body[data-bgm="playing"] .bgm-bars i:nth-child(3) { animation-delay: 0.4s; }

@keyframes soundBar {
  0%, 100% { height: 3px; }
  50% { height: 10px; }
}

.temp-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7DD3FC;
  box-shadow: 0 0 8px rgba(125, 211, 252, 0.75);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

body[data-temp="warm"] .top-temp-btn {
  border-color: var(--crimson-border);
  background: rgba(28, 14, 20, 0.88);
}

body[data-temp="warm"] .temp-led {
  background: var(--crimson-bright);
  box-shadow: 0 0 10px rgba(201, 51, 68, 0.9);
}

/* ==========================================================================
   Viewport Scene Container & Bottom Navigation Dock
   ========================================================================== */
.viewport-stage {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100svh;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.scene.is-active {
  animation: sceneFadeIn 0.28s var(--ease-out) both;
}

@keyframes sceneFadeIn {
  from {
    opacity: 0.2;
    transform: scale(0.99) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.scene-scroll-area {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 78px 0 calc(96px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: thin;
  scrollbar-color: rgba(210, 228, 245, 0.18) transparent;
}

/* 짧은 화면에서는 수직 중앙 정렬, 긴 화면에서는 상단 HUD 아래(86px)부터 안전하게 시작 */
.scene-scroll-area > .container {
  margin-top: auto;
  margin-bottom: auto;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding: 0 18px;
}

/* Glass Card Base */
.frost-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.frost-card-crimson {
  border-color: var(--crimson-border);
  background: linear-gradient(145deg, rgba(168, 36, 51, 0.1), rgba(255, 255, 255, 0.03));
}

.compact-header {
  margin-bottom: 20px;
}

.section-code {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}

.section-title {
  font-size: clamp(1.4rem, 3.6vw, 1.95rem);
  font-weight: 700;
  line-height: 1.28;
  color: var(--text-primary);
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  max-width: 580px;
  margin-top: 6px;
}

.section-desc code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* Bottom Scene Navigation Dock (모바일: 번호 전용 최적화 / 데스크톱: 번호 + 라벨) */
.scene-nav-dock {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 999px;
  background: rgba(9, 13, 20, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65);
  max-width: calc(100vw - 16px);
}

.scene-step-btn {
  flex-shrink: 0;
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(210, 228, 245, 0.14);
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.scene-step-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(210, 228, 245, 0.34);
}

.scene-step-next:not(:disabled) {
  background: rgba(168, 36, 51, 0.78);
  border-color: rgba(220, 80, 96, 0.55);
  color: #FFFFFF;
}

.scene-step-next:hover:not(:disabled) {
  background: var(--crimson);
}

.scene-step-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

/* 모바일에서는 페이지 번호만 노출해 6개 페이지가 스크롤 없이 한눈에 들어오도록 처리 */
.step-btn-label,
.pill-label {
  display: none;
}

.scene-chapter-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chapter-pill {
  flex-shrink: 0;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.71rem;
  color: var(--text-secondary);
  transition: background-color 0.22s ease, color 0.22s ease;
}

.chapter-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.chapter-pill.is-active {
  background: rgba(210, 228, 245, 0.16);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(210, 228, 245, 0.25);
}

/* ==========================================================================
   SCENE 01. Hero (Custom Title Typography Logo)
   ========================================================================== */
.hero-inner {
  text-align: center;
  max-width: 680px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crimson);
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
}

.hero-logo-img {
  width: min(82vw, 420px);
  height: auto;
  filter:
    drop-shadow(0 10px 26px rgba(0, 0, 0, 0.88))
    drop-shadow(0 2px 6px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 22px rgba(210, 228, 245, 0.16));
  user-select: none;
}

.hero-title-fallback {
  font-size: clamp(2.3rem, 8vw, 3.8rem);
  font-weight: 700;
}

.hero-subtitle {
  font-size: clamp(0.96rem, 2.5vw, 1.16rem);
  color: #CBD5E1;
  margin-bottom: 14px;
}

.hero-lead {
  font-size: clamp(0.98rem, 2.4vw, 1.12rem);
  color: var(--text-primary);
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  max-width: 420px;
  margin: 0 auto 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.22s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--crimson);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(168, 36, 51, 0.34);
}

.btn-primary:hover {
  background: #BA293A;
  transform: translateY(-2px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-strong);
  color: var(--text-primary);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.btn-crimson-outline {
  padding: 9px 18px;
  font-size: 0.82rem;
  border: 1px solid var(--crimson-border);
  background: rgba(168, 36, 51, 0.16);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}

.btn-crimson-outline:hover { background: var(--crimson); }

.enter-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: #CBD5E1;
  border: 1px dashed rgba(210, 228, 245, 0.26);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.enter-archive-btn:hover {
  border-color: rgba(210, 228, 245, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(3px);
}

/* ==========================================================================
   SCENE 02. Asymmetric Timeline (모바일 컴팩트 2분할 배지 포함)
   ========================================================================== */
.time-contrast-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.time-side {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 19, 0.45);
  border: 1px solid rgba(210, 228, 245, 0.08);
}

.time-side-seoon { border-left: 3px solid rgba(186, 214, 242, 0.55); }
.time-side-user { border-left: 3px solid var(--crimson); }

.time-code { display: none; }
.time-badge-text { font-size: 0.84rem; color: var(--text-primary); line-height: 1.4; margin-bottom: 2px; }
.time-badge-text strong { display: block; font-size: 1rem; color: #FFFFFF; margin-top: 1px; }
.time-side-user .time-badge-text strong { color: #F4B4BC; }
.time-sub { display: block; font-size: 0.65rem; color: var(--text-secondary); line-height: 1.35; }
.time-vs { display: none; align-items: center; justify-content: center; font-size: 0.72rem; color: var(--text-muted); }

.timeline-list {
  list-style: none;
  position: relative;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 1px;
  background: linear-gradient(180deg, rgba(210, 228, 245, 0.35), var(--crimson));
}

.timeline-item { position: relative; }

.timeline-marker {
  position: absolute;
  left: -22px;
  top: 18px;
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #CBD5E1;
  border: 2px solid var(--bg-mid);
}

.marker-dot-crimson {
  width: 10px;
  height: 10px;
  background: var(--crimson);
  box-shadow: 0 0 10px rgba(168, 36, 51, 0.9);
}

.timeline-card { padding: 15px 16px; height: 100%; }

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.timeline-tag {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(210, 228, 245, 0.1);
}

.badge-crimson {
  background: var(--crimson-soft);
  border-color: var(--crimson-border);
  color: #F4C2C8;
}

.timeline-heading { font-size: 1.05rem; font-weight: 700; margin-bottom: 5px; }
.timeline-body { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.6; }

/* ==========================================================================
   SCENE 03. Character Files (상단: 사진 - 사진 / 하단: 설명란 사각형)
   ========================================================================== */
.char-mobile-hint {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.character-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 상단 사진 행: 모바일과 데스크톱 모두 [윤서온 사진] - [윤서진 사진] 나란히 배치 */
.character-photos-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  justify-items: center;
}

.polaroid-select-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 4px 0;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

/* 모바일에서 비활성 인물 사진은 살짝 뒤로 물러나고, 선택된 인물 사진이 선명하게 강조됨 */
.polaroid-select-btn:not(.is-selected) {
  opacity: 0.48;
  transform: scale(0.94);
}

.polaroid-select-btn.is-selected {
  opacity: 1;
  transform: translateY(-3px) scale(1);
}

.polaroid-select-btn.is-selected .polaroid-print {
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.68),
    0 0 0 2px rgba(210, 228, 245, 0.45);
}

/* 인화 사진 프레임 (폴라로이드 인화지 질감) */
.polaroid-print {
  position: relative;
  width: 100%;
  max-width: 168px;
  padding: 7px 7px 10px;
  background: linear-gradient(160deg, #ECEFF4 0%, #DAE0E9 100%);
  border-radius: 3px;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.58),
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  color: #1A202C;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}

.polaroid-tilt-left { transform: rotate(-1.5deg); }
.polaroid-tilt-right { transform: rotate(1.5deg); }

.polaroid-muted {
  background: linear-gradient(160deg, #E2E5EB 0%, #CFD5DF 100%);
}

.polaroid-tape {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 58px;
  height: 16px;
  background: rgba(235, 232, 218, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.polaroid-img-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0B0F17;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.polaroid-img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.14) 0%, transparent 38%, rgba(0, 0, 0, 0.12) 100%);
  pointer-events: none;
}

.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.film-date-burn {
  position: absolute;
  right: 7px;
  bottom: 6px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 168, 76, 0.88);
  text-shadow: 0 0 6px rgba(255, 110, 30, 0.65), 0 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 2;
}

.polaroid-caption-strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  padding: 7px 2px 0;
}

.polaroid-handwriting {
  font-size: 0.96rem;
  font-weight: 700;
  color: #161B24;
}

.polaroid-code {
  font-size: 0.58rem;
  color: #525D6E;
}

/* 하단 설명란 사각형 영역 */
.character-dossiers-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.dossier-note {
  display: none;
  width: 100%;
  padding: 16px 18px;
  flex-direction: column;
}

.dossier-note.is-active-char {
  display: flex;
}

.dossier-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(210, 228, 245, 0.09);
}

.dossier-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dossier-ename {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 6px;
}

.dossier-file-no {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.meta-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 11px;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(210, 228, 245, 0.13);
  color: #CBD5E1;
}

.meta-tag-crimson {
  background: var(--crimson-soft);
  border-color: var(--crimson-border);
  color: #F8D0D5;
}

.character-bio {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.66;
  margin-bottom: 13px;
  flex: 1;
}

.character-quote {
  padding: 10px 14px;
  border-left: 2px solid var(--crimson);
  background: rgba(168, 36, 51, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.character-card-neutral {
  background: rgba(255, 255, 255, 0.03);
}

.character-record-note {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ==========================================================================
   SCENE 04. Stacked Physical Photos Viewer (< > Navigation & Click Detail)
   ========================================================================== */
.stack-scene-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-deck-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 740px;
  margin: 8px auto 18px;
  padding: 12px 0;
}

.deck-arrow {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(13, 19, 29, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  z-index: 15;
}

.deck-arrow:hover {
  background: var(--crimson);
  border-color: rgba(255, 200, 206, 0.5);
  transform: scale(1.07);
}

.deck-arrow:active {
  transform: scale(0.95);
}

.photo-stack-stage {
  position: relative;
  width: min(73vw, 470px);
  aspect-ratio: 3 / 2.34;
  perspective: 1100px;
}

.stacked-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  text-align: left;
  transition:
    transform 0.52s var(--ease-out),
    opacity 0.52s var(--ease-out),
    filter 0.52s var(--ease-out);
  will-change: transform, opacity;
}

/* 겹쳐진 사진 포지션 (0이 맨 앞 활성 사진, 1~4는 뒤에 어긋나게 깔린 사진들) */
.stacked-photo[data-pos="0"] {
  z-index: 10;
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(-0.6deg) scale(1);
  filter: brightness(1);
  cursor: pointer;
}

.stacked-photo[data-pos="0"]:hover {
  transform: translate3d(0, -5px, 0) rotate(0deg) scale(1.015);
}

.stacked-photo[data-pos="1"] {
  z-index: 9;
  opacity: 0.92;
  transform: translate3d(14px, 7px, 0) rotate(3.6deg) scale(0.97);
  filter: brightness(0.72);
  pointer-events: none;
}

.stacked-photo[data-pos="2"] {
  z-index: 8;
  opacity: 0.82;
  transform: translate3d(-15px, 11px, 0) rotate(-4.2deg) scale(0.945);
  filter: brightness(0.56);
  pointer-events: none;
}

.stacked-photo[data-pos="3"] {
  z-index: 7;
  opacity: 0.68;
  transform: translate3d(19px, 15px, 0) rotate(6deg) scale(0.92);
  filter: brightness(0.44);
  pointer-events: none;
}

.stacked-photo[data-pos="4"] {
  z-index: 6;
  opacity: 0.52;
  transform: translate3d(-18px, 17px, 0) rotate(-6.2deg) scale(0.9);
  filter: brightness(0.35);
  pointer-events: none;
}

/* 사진 넘길 때 물리적으로 스쳐 넘어가는 슬라이드 모션 */
.stacked-photo.is-leaving-next {
  z-index: 12 !important;
  transform: translate3d(-62px, -12px, 0) rotate(-11deg) scale(0.96) !important;
  opacity: 0.25 !important;
}

.stacked-photo.is-leaving-prev {
  z-index: 12 !important;
  transform: translate3d(62px, -12px, 0) rotate(11deg) scale(0.96) !important;
  opacity: 0.25 !important;
}

/* 실제 인화 사진 용지 테두리 */
.printed-photo-frame {
  width: 100%;
  height: 100%;
  padding: 9px 9px 10px;
  background: linear-gradient(165deg, #ECEFF4 0%, #D9E0E8 100%);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.72),
    0 3px 10px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.printed-frame-corrupted {
  background: linear-gradient(165deg, #27161B 0%, #171218 100%);
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(168, 36, 51, 0.55);
}

.printed-img-area {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #070A0F;
  overflow: hidden;
}

.printed-img-area::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 42%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
}

.printed-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tap-badge {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 4px;
  background: rgba(7, 10, 15, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(210, 228, 245, 0.26);
  font-size: 0.65rem;
  color: #F2F5F8;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.stacked-photo[data-pos="0"]:hover .photo-tap-badge {
  background: rgba(168, 36, 51, 0.88);
  border-color: rgba(255, 200, 206, 0.5);
}

.printed-bottom-margin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 0;
  font-size: 0.7rem;
  color: #27303F;
  margin-top: auto;
}

.printed-frame-corrupted .printed-bottom-margin {
  color: #94A3B8;
}

.printed-no { font-weight: 600; }
.printed-lens { font-size: 0.66rem; opacity: 0.78; }

/* Deck Bottom Counter & Dots */
.deck-status-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #CBD5E1;
}

.deck-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(210, 228, 245, 0.24);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.deck-dot.is-current {
  background: #F2F5F8;
  transform: scale(1.3);
}

.deck-dot-err {
  background: rgba(168, 36, 51, 0.45);
}

.deck-dot-err.is-current {
  background: var(--crimson-bright);
  box-shadow: 0 0 8px var(--crimson);
}

/* Corrupted Glitch Layers */
.glitch-frame { position: relative; }

.glitch-base {
  filter: blur(3.5px) contrast(1.45) saturate(0.45) brightness(0.62);
  transform: scale(1.08);
}

.glitch-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  mix-blend-mode: screen;
}

.glitch-red {
  filter: blur(2px) sepia(1) hue-rotate(-50deg) saturate(4);
  opacity: 0.55;
  transform: translate(-6px, 2px) scale(1.08);
  animation: glitchShiftRed 3.4s infinite steps(2, end);
}

.glitch-cyan {
  filter: blur(2px) sepia(1) hue-rotate(140deg) saturate(3.5);
  opacity: 0.48;
  transform: translate(6px, -2px) scale(1.08);
  animation: glitchShiftCyan 2.9s infinite steps(2, end);
}

.glitch-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.42) 0px, rgba(0, 0, 0, 0.42) 2px, transparent 2px, transparent 4px),
    linear-gradient(90deg, rgba(168, 36, 51, 0.18) 0%, transparent 35%, rgba(148, 163, 184, 0.12) 68%, rgba(168, 36, 51, 0.24) 100%);
}

@keyframes glitchShiftRed {
  0%, 84%, 100% { transform: translate(-5px, 1px) scale(1.08); clip-path: inset(0 0 0 0); }
  86% { transform: translate(-12px, -3px) scale(1.1); clip-path: inset(18% 0 42% 0); }
  90% { transform: translate(7px, 2px) scale(1.09); clip-path: inset(62% 0 12% 0); }
}

@keyframes glitchShiftCyan {
  0%, 78%, 100% { transform: translate(5px, -1px) scale(1.08); clip-path: inset(0 0 0 0); }
  80% { transform: translate(11px, 3px) scale(1.1); clip-path: inset(35% 0 28% 0); }
  84% { transform: translate(-8px, -2px) scale(1.08); clip-path: inset(8% 0 70% 0); }
}

.corrupted-badge-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: radial-gradient(circle, rgba(7, 10, 15, 0.52) 0%, rgba(7, 10, 15, 0.78) 100%);
  padding: 12px;
  text-align: center;
}

.corrupted-badge {
  padding: 5px 12px;
  background: rgba(168, 36, 51, 0.9);
  border: 1px solid rgba(255, 190, 198, 0.48);
  border-radius: 3px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #FFFFFF;
}

.corrupted-sub { font-size: 0.65rem; color: rgba(242, 245, 248, 0.82); }

/* ==========================================================================
   SCENE 05. Paper Clipping & Interactive Frost Memo
   ========================================================================== */
.archive-evidence-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

.clipping-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.paper-clipping {
  position: relative;
  width: 100%;
  background:
    radial-gradient(circle at 85% 18%, rgba(120, 113, 102, 0.16), transparent 55%),
    linear-gradient(165deg, #D5D1C8 0%, #C5C0B5 100%);
  color: #1B1F24;
  padding: 24px 20px 22px;
  border-radius: 3px;
  transform: rotate(-0.8deg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(40, 38, 34, 0.18);
}

.paper-tape {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(1.8deg);
  width: 84px;
  height: 20px;
  background: rgba(226, 222, 208, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.clipping-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #4B525C;
  border-bottom: 1px solid rgba(27, 31, 36, 0.25);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.clipping-headline {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  color: #121519;
  margin-bottom: 12px;
}

.clipping-rule {
  height: 2px;
  border-top: 1px solid rgba(27, 31, 36, 0.35);
  border-bottom: 1px solid rgba(27, 31, 36, 0.18);
  margin-bottom: 12px;
}

.clipping-body {
  font-size: 0.88rem;
  line-height: 1.68;
  color: #2A3038;
  margin-bottom: 18px;
}

.clipping-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.clipping-source { font-size: 0.66rem; color: #555D68; }

.crimson-stamp {
  margin-left: auto;
  padding: 5px 11px;
  border: 2.5px solid var(--crimson);
  outline: 1px solid rgba(168, 36, 51, 0.55);
  outline-offset: -5px;
  color: var(--crimson);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  transform: rotate(-6deg);
  background: rgba(168, 36, 51, 0.06);
}

.frost-memo-wrapper {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(10, 15, 23, 0.72);
}

.frost-memo-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.frost-label { display: block; font-size: 0.66rem; color: var(--text-muted); margin-bottom: 2px; }
.frost-memo-title { font-size: 1.12rem; color: var(--text-primary); }

.inline-temp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(186, 214, 242, 0.26);
  font-size: 0.75rem;
  color: var(--text-primary);
}

body[data-temp="warm"] .inline-temp-btn {
  background: var(--crimson-soft);
  border-color: var(--crimson-border);
}

.frost-instruction {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.frost-instruction code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-primary);
}

.thermometer-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-bottom: 14px;
}

.thermometer-fill {
  width: 18%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60A5FA, #93C5FD);
  transition: width 0.9s var(--ease-out), background 0.9s ease;
}

body[data-temp="warm"] .thermometer-fill {
  width: 100%;
  background: linear-gradient(90deg, #60A5FA 0%, #D97757 55%, var(--crimson-bright) 100%);
}

.frosted-glass-stage {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(210, 228, 245, 0.16);
  background: rgba(6, 9, 14, 0.74);
  padding: 18px 16px;
  overflow: hidden;
  min-height: 142px;
  display: flex;
  align-items: center;
}

.hidden-memos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  filter: blur(7px);
  opacity: 0.18;
  transition: filter 1.1s var(--ease-out), opacity 1.1s var(--ease-out);
  user-select: none;
}

body[data-temp="warm"] .hidden-memos {
  filter: blur(0px);
  opacity: 0.96;
  user-select: text;
}

.memo-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #E2E8F0;
}

.memo-num {
  flex-shrink: 0;
  margin-top: 3px;
  font-size: 0.68rem;
  color: #E07A86;
  padding: 1px 6px;
  border: 1px solid rgba(168, 36, 51, 0.45);
  border-radius: 3px;
}

.frost-sheet {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 25%, rgba(226, 240, 255, 0.2), transparent 50%),
    radial-gradient(circle at 82% 78%, rgba(196, 222, 248, 0.18), transparent 52%),
    rgba(168, 198, 228, 0.1);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: opacity 1.1s var(--ease-out), visibility 1.1s ease;
  cursor: pointer;
}

.frost-crystals {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    radial-gradient(rgba(210, 228, 245, 0.35) 1px, transparent 1px);
  background-size: 22px 22px, 15px 15px;
  background-position: 0 0, 9px 11px;
}

.frost-overlay-badge {
  position: relative;
  z-index: 1;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(9, 14, 22, 0.76);
  border: 1px solid rgba(210, 228, 245, 0.25);
  font-size: 0.68rem;
  color: #CBD5E1;
}

body[data-temp="warm"] .frost-sheet {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ==========================================================================
   SCENE 06. Play Guide & Hint Accordion
   ========================================================================== */
.route-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.route-card { padding: 18px; }
.route-num { display: inline-block; font-size: 0.68rem; color: var(--text-muted); margin-bottom: 6px; }
.route-title { font-size: 1.08rem; font-weight: 700; margin-bottom: 6px; }
.route-desc { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.62; }

.hint-accordion {
  overflow: hidden;
  margin-bottom: 24px;
}

.accordion-trigger {
  width: 100%;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.accordion-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.accordion-badge {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--crimson-soft);
  border: 1px solid var(--crimson-border);
  font-size: 0.66rem;
  color: #F4C2C8;
}

.accordion-question { font-size: 0.9rem; font-weight: 500; }

.accordion-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.3s var(--ease-out);
}

.accordion-trigger[aria-expanded="true"] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-panel-inner {
  padding: 12px 18px 18px;
  border-top: 1px solid rgba(210, 228, 245, 0.08);
  color: #CBD5E1;
  font-size: 0.9rem;
  line-height: 1.68;
}

.archive-footer {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(210, 228, 245, 0.08);
}

.footer-quote { font-size: 0.95rem; color: #CBD5E1; margin-bottom: 14px; }
.footer-actions { display: flex; justify-content: center; }

/* ==========================================================================
   Modals (Photo Back-Memo Detail Modal & Corrupted File Warning)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 6, 10, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.22s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  width: 100%;
  background: #0C1119;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
  overflow: hidden;
  max-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
}

.photo-detail-dialog {
  max-width: 900px;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(210, 228, 245, 0.1);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  position: relative;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(210, 228, 245, 0.14);
}

.modal-close-btn:hover {
  background: rgba(168, 36, 51, 0.55);
  border-color: rgba(168, 36, 51, 0.8);
}

.photo-detail-body {
  display: grid;
  grid-template-columns: 1fr;
  overflow-y: auto;
}

.photo-detail-media {
  position: relative;
  background: #05070B;
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(7, 10, 15, 0.78);
  border: 1px solid rgba(210, 228, 245, 0.25);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav:hover { background: var(--crimson); }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.photo-detail-memo {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, #0E141E 0%, #0A0E16 100%);
}

.memo-meta-header {
  border-bottom: 1px solid rgba(210, 228, 245, 0.1);
  padding-bottom: 12px;
  position: relative;
}

.memo-file-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.memo-filename {
  font-size: 1.2rem;
  color: #FFFFFF;
}

.memo-counter {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.exif-spec-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.74rem;
}

.exif-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(210, 228, 245, 0.08);
}

.exif-row dt { color: var(--text-muted); }
.exif-row dd { color: #CBD5E1; text-align: right; }

.back-memo-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border-left: 3px solid var(--crimson);
}

.back-memo-tag {
  display: block;
  font-size: 0.65rem;
  color: #E07A86;
  margin-bottom: 8px;
}

.lightbox-caption {
  font-size: 1.02rem;
  color: #FFFFFF;
  line-height: 1.65;
  margin-bottom: 8px;
}

.lightbox-subnote {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Corrupted Warning Modal */
.corrupted-dialog {
  max-width: 480px;
  border-color: var(--crimson-border);
  background: linear-gradient(180deg, #180C11 0%, #0B0E14 100%);
}

.corrupted-dialog-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(168, 36, 51, 0.3);
  font-size: 0.73rem;
  color: #F4C2C8;
}

.corrupted-dialog-header .modal-close-btn { margin-left: auto; }

.err-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson-bright);
  box-shadow: 0 0 10px var(--crimson);
}

.corrupted-dialog-body { padding: 24px 20px; }

.err-code-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(168, 36, 51, 0.22);
  border: 1px solid rgba(168, 36, 51, 0.5);
  color: #F08C99;
  font-size: 0.72rem;
  margin-bottom: 14px;
}

.corrupted-message {
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.corrupted-dialog-footer {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
}

/* Fallback Placeholder & Toast */
.img-fallback-box {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.45), rgba(7, 10, 15, 0.95));
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.fallback-icon { font-size: 0.95rem; color: rgba(210, 228, 245, 0.45); }
.fallback-filename { font-size: 0.76rem; color: var(--text-primary); padding: 2px 8px; border: 1px solid rgba(210, 228, 245, 0.18); border-radius: 4px; }
.fallback-mood { font-size: 0.65rem; color: var(--text-muted); }

.archive-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 95;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(14, 20, 30, 0.95);
  border: 1px solid var(--crimson-border);
  font-size: 0.75rem;
  color: var(--text-primary);
  text-align: center;
  max-width: calc(100vw - 32px);
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Desktop)
   ========================================================================== */
@media (min-width: 680px) {
  .hud-hide-xs { display: inline; }
  .viewfinder-hud { inset: 16px; font-size: 0.72rem; }
  .top-utility-bar { top: 18px; gap: 8px; }

  .scene-scroll-area {
    padding: 80px 0 88px;
  }

  /* 태블릿/데스크톱에서는 하단 내비게이션에 '01 표지' 등 텍스트 라벨도 함께 표시 */
  .scene-nav-dock {
    bottom: 18px;
    gap: 8px;
    padding: 6px 12px;
  }

  .step-btn-label,
  .pill-label {
    display: inline;
  }

  .scene-step-btn {
    padding: 0 13px;
    gap: 5px;
  }

  .chapter-pill {
    padding: 0 11px;
    gap: 5px;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }

  .deck-arrow {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .photo-deck-viewer {
    gap: 28px;
  }
}

@media (min-width: 820px) {
  .time-contrast-panel {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 18px 24px;
    gap: 14px;
  }

  .time-code { display: block; font-size: 0.65rem; color: var(--text-muted); margin-bottom: 2px; }
  .time-badge-text { font-size: 0.98rem; }
  .time-badge-text strong { display: inline; font-size: 1.12rem; }
  .time-sub { font-size: 0.72rem; }
  .time-vs { display: flex; }

  /* 데스크톱 등장인물 파일:
     상단 행 [윤서온 사진]  —  [윤서진 사진]
     하단 행 [윤서온 설명란] — [윤서진 설명란] */
  .char-mobile-hint {
    display: none;
  }

  .character-stage {
    gap: 22px;
  }

  .character-photos-row {
    max-width: none;
    gap: 28px;
  }

  .polaroid-select-btn,
  .polaroid-select-btn:not(.is-selected),
  .polaroid-select-btn.is-selected {
    opacity: 1;
    transform: none;
    cursor: default;
  }

  .polaroid-select-btn.is-selected .polaroid-print {
    box-shadow:
      0 20px 42px rgba(0, 0, 0, 0.62),
      0 2px 6px rgba(0, 0, 0, 0.35),
      inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  }

  .polaroid-print {
    max-width: 225px;
    padding: 10px 10px 13px;
  }

  .polaroid-print:hover {
    transform: rotate(0deg) translateY(-4px);
  }

  .polaroid-tape {
    width: 72px;
    height: 18px;
  }

  .polaroid-handwriting {
    font-size: 1.15rem;
  }

  .polaroid-code,
  .film-date-burn {
    font-size: 0.66rem;
  }

  .character-dossiers-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    align-items: stretch;
  }

  .dossier-note {
    display: flex !important;
    padding: 20px 22px;
  }

  .archive-evidence-grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 28px;
  }

  .route-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .photo-detail-body {
    grid-template-columns: 1.35fr 1fr;
  }
}

@media (min-width: 1024px) {
  .timeline-list {
    padding-left: 0;
    padding-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .timeline-list::before {
    top: 6px;
    bottom: auto;
    left: 16px;
    right: 16px;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, rgba(210, 228, 245, 0.35), var(--crimson));
  }

  .timeline-marker {
    left: 18px;
    top: -24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene,
  .stacked-photo {
    transition: none;
  }
  .glitch-red,
  .glitch-cyan,
  .rec-dot,
  .battery-low-bar {
    animation: none;
  }
}
