/* ════════════════════════════════════════
   시간의 도서관 — style.css
   작성: 리팩토링 버전 (Unified Living Newspaper)
════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nanum+Myeongjo:wght@400;700;800&display=swap');

:root {
  /* Dark Theme (Default) */
  --bg-app: #080808;
  --bg-screen: #0d0d0d;
  --bg-shelf: #111;
  --bg-item: #181818;
  --bg-panel: #0a0a0a;
  
  --text-main: #e8e0d0;
  --text-dim: #666;
  --text-muted: #333;
  --text-accent: #c8b89a;
  
  --accent: #c8a96e;
  --border-light: #222;
  --border-dim: #1a1a1a;
  --border-item: #252525;

  --paper-bg: #ede3ce;
  --paper-text: #1a1a1a;
  --item-filter: grayscale(100%) brightness(0.55);

  /* Font Scale */
  --f-scale: 1;
}

.theme-sepia {
  /* Sepia Theme (Light) - Elegant "Modern Archive" Style */
  --bg-app: #fafafa;
  --bg-screen: #fcfcfc;
  --bg-shelf: #f4f3ef;
  --bg-item: #fdfdfd;
  --bg-panel: #ffffff;
  
  --text-main: #2d2621;
  --text-dim: #7a7065;
  --text-muted: #b5ada3;
  --text-accent: #8c7355;
  
  --accent: #a68b67;
  --border-light: #ececea;
  --border-dim: #e5e3de;
  --border-item: #e1ddd5;

  /* Newspaper/Parchment */
  --paper-bg: #fffefe;
  --paper-text: #1a1a1a;
  --item-filter: sepia(0.2) contrast(0.95) brightness(1.0);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-app);
  color: var(--text-main);
  font-family: 'Nanum Myeongjo', serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

.screen { display: none; }
.screen.active { display: flex; }

/* ════════════════════════════
   도서관 (Library)
════════════════════════════ */
#screen-library {
  flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-screen); padding: 40px 20px;
}
.library-title    { font-size: calc(11px * var(--f-scale)); letter-spacing: 8px; color: var(--text-muted); margin-bottom: 8px; }
.library-subtitle { font-size: calc(28px * var(--f-scale)); color: var(--text-accent); margin-bottom: 6px; letter-spacing: 2px; }
.library-desc     { font-size: calc(11px * var(--f-scale)); color: var(--text-muted); margin-bottom: 60px; letter-spacing: 3px; }

.shelf { width: 100%; max-width: 860px; margin-bottom: 40px; }
.shelf-label { font-size: calc(10px * var(--f-scale)); color: var(--text-muted); letter-spacing: 4px; margin-bottom: 12px; padding-left: 4px; }
.shelf-row {
  display: flex; gap: 14px; padding: 20px 16px 28px;
  background: var(--bg-shelf); border-top: 3px solid var(--border-light);
  border-bottom: 6px solid var(--bg-app); flex-wrap: wrap;
}

.newspaper-item {
  width: 110px; height: 155px; background: var(--bg-item);
  border: 1px solid var(--border-item); cursor: pointer; position: relative;
  transition: transform 0.25s, box-shadow 0.25s, filter 0.25s;
  filter: var(--item-filter);
  display: flex; flex-direction: column; padding: 8px 7px; overflow: hidden;
}
.newspaper-item:hover {
  transform: translateY(-10px) rotate(-1.5deg);
  box-shadow: 0 16px 40px rgba(0,0,0,0.9);
  filter: grayscale(60%) brightness(0.85);
}
.newspaper-item.solved { 
  filter: grayscale(0%) brightness(1); 
  border-color: var(--accent); 
  box-shadow: 0 0 30px rgba(166,139,103,0.3);
}
.newspaper-item.solved::after {
  content: 'SOLVED'; position: absolute; top: 15px; left: 10px;
  border: 2px solid #8b1a1a; color: #8b1a1a; font-size: 10px; font-weight: 900;
  padding: 2px 6px; transform: rotate(-15deg); letter-spacing: 1px;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(1px);
  z-index: 5; pointer-events: none;
}
.newspaper-item.locked { opacity: 0.25; cursor: not-allowed; }

.np-date      { font-size: calc(7px * var(--f-scale)); color: var(--text-dim); letter-spacing: 1px; border-bottom: 1px solid var(--border-item); padding-bottom: 4px; margin-bottom: 5px; }
.np-headline  { font-size: calc(9px * var(--f-scale)); line-height: 1.6; color: var(--text-accent); font-weight: 700; flex: 1; }
.np-status    { font-size: calc(8px * var(--f-scale)); text-align: center; margin-top: 6px; padding: 3px; border-top: 1px solid var(--border-item); color: var(--text-muted); }

/* ════════════════════════════
   살아있는 신문 (기사 + 수사 통합)
════════════════════════════ */
#screen-newspaper { 
  flex-direction: column; align-items: center; background: var(--bg-app); 
  height: 100vh; overflow: hidden;
}

.newspaper-main-container {
  flex: 1; width: 100%; max-width: 900px;
  overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 20px;
}
.newspaper-main-container::-webkit-scrollbar { width: 5px; }
.newspaper-main-container::-webkit-scrollbar-track { background: var(--bg-app); }
.newspaper-main-container::-webkit-scrollbar-thumb { background: var(--border-light); }

/* 신문 양피지 스타일 */
.newspaper-wrap {
  width: 100%; max-width: 700px; background: var(--paper-bg); color: var(--paper-text);
  padding: 36px 40px; position: relative; margin: 0 auto;
  box-shadow: 0 0 80px rgba(0,0,0,0.95), inset 0 0 60px rgba(0,0,0,0.08);
  filter: sepia(35%); animation: paperIn 0.7s ease;
}
@keyframes paperIn {
  from { opacity: 0; transform: scale(0.93) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.np-masthead { text-align: center; border-bottom: 3px double #2a2a2a; border-top: 3px double #2a2a2a; padding: 10px 0; margin-bottom: 18px; }
.np-masthead-name { font-size: calc(34px * var(--f-scale)); font-weight: 800; letter-spacing: 8px; line-height: 1; }
.np-masthead-info { display: flex; justify-content: space-between; font-size: calc(10px * var(--f-scale)); margin-top: 6px; color: #555; letter-spacing: 1px; }
.np-main-headline { font-size: calc(28px * var(--f-scale)); font-weight: 800; text-align: center; line-height: 1.3; margin: 16px 0 8px; border-bottom: 2px solid #2a2a2a; padding-bottom: 14px; letter-spacing: 2px; }
.np-sub-headline  { font-size: calc(13px * var(--f-scale)); text-align: center; color: #555; margin-bottom: 18px; letter-spacing: 1px; }
.np-columns       { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; border-bottom: 1px solid #aaa; padding-bottom: 16px; }
.np-col-body      { font-size: calc(11px * var(--f-scale)); line-height: 2; color: #2a2a2a; }

.clue {
  display: inline; background: rgba(200,169,110,0.18);
  border-bottom: 2px solid #c8a96e; cursor: pointer;
  padding: 1px 2px; transition: background 0.2s;
}
.clue:hover { background: rgba(200,169,110,0.4); }
.clue.found { background: rgba(200,169,110,0.45); color: #7a3a10; font-weight: 700; }

.np-btn {
  background: var(--bg-item); color: var(--text-accent); border: 1px solid var(--border-item);
  padding: 11px 26px; font-family: inherit;
  font-size: 12px; letter-spacing: 2px; cursor: pointer; transition: all 0.2s;
}
.np-btn:hover { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.np-btn.primary { background: var(--accent); color: #0a0a0a; border-color: var(--accent); font-weight: 700; }

/* ─────────────────────────────
   현장 수사 일지 (Investigation Notes)
   ───────────────────────────── */
.field-notes-wrap {
  background: #fdf6e3; color: #3b2a1a;
  padding: 40px; margin: 0 auto 40px;
  width: 100%; max-width: 700px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  border-top: 2px dashed #d1c1a1;
  position: relative;
  display: none; 
  animation: slideUp 0.6s ease;
}
.field-notes-wrap.active { display: block; }

.field-notes-header {
  font-size: 10px; color: #8b7d62; letter-spacing: 4px;
  border-bottom: 1px solid #e5dcc5; padding-bottom: 15px; margin-bottom: 25px;
  text-align: center; font-weight: 800;
}

#game-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 30px; }
.log-line { font-size: calc(14px * var(--f-scale)); line-height: 1.8; color: #4a3728; font-family: 'Nanum Myeongjo', serif; }
.log-line.time    { color: #8b7d62; font-size: 11px; margin-top: 15px; border-top: 1px solid #eee; padding-top: 10px; }
.log-line.system  { color: #888; font-style: italic; font-size: 12px; }
.log-line.clue    { color: #a67c00; font-weight: 800; background: rgba(166,124,0,0.05); padding: 4px 8px; border-radius: 2px; }

#game-choices { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.btn-choice {
  background: rgba(139,125,98,0.05); color: var(--text-dim); border: 1px solid var(--border-light);
  padding: 12px 18px; font-size: 13px; text-align: left;
  transition: all 0.2s; font-family: inherit; cursor: pointer;
}
.btn-choice:hover { background: var(--text-dim); color: #fff; border-color: var(--text-dim); padding-left: 24px; }

@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* 통합 헤더/스탯 */
.game-header { 
  width: 100%; max-width: 900px; padding: 15px 20px; display: flex; align-items: center; gap: 15px; 
  background: var(--bg-screen); border-bottom: 1px solid var(--border-dim); 
  mask: none !important; -webkit-mask: none !important; /* 브라우저 강제 그라데이션 제거 */
}
.game-stats  { width: 100%; max-width: 900px; padding: 8px 20px; display: none; gap: 20px; background: var(--bg-panel); border-bottom: 1px solid var(--border-dim); }
.game-stats.active { display: flex; }
.stat-item   { font-size: 10px; display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.stat-value  { color: var(--text-accent); font-weight: 700; }

.game-btn-back { background: var(--bg-app); color: var(--text-dim); border: 1px solid var(--border-item); padding: 5px 12px; font-size: 10px; cursor: pointer; }
.game-btn-back:hover { color: var(--accent); border-color: var(--accent); }

.game-era-badge { font-size: calc(10px * var(--f-scale)); background: var(--accent); color: #080808; padding: 3px 10px; letter-spacing: 2px; font-weight: 800; }
.game-location  { font-size: calc(11px * var(--f-scale)); color: var(--text-dim); flex: 1; }
.game-clues     { font-size: calc(11px * var(--f-scale)); color: var(--accent); letter-spacing: 1px; cursor: pointer; transition: opacity 0.3s; }
.game-clues.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

/* 단서 패널 (사이드바) */
.clue-panel {
  width: 250px; background: var(--bg-panel); border-left: 1px solid var(--border-dim);
  padding: 24px 20px; height: 100vh; overflow-y: auto;
  position: absolute; right: -250px; top: 0;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 500;
}
.clue-panel.active { right: 0; }
.clue-panel-title { 
  font-size: 9px; color: var(--text-muted); letter-spacing: 5px; 
  border-bottom: 1px solid var(--border-dim); padding-bottom: 10px; margin-bottom: 16px; 
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-close-btn { display: none; } /* PC에선 숨김 */

.clue-item {
  background: var(--bg-item); border: 1px solid var(--border-dim); padding: 10px 12px;
  font-size: 11px; color: var(--text-dim); line-height: 1.7; margin-bottom: 10px;
  opacity: 0; transform: translateY(6px); transition: all 0.5s;
}
.clue-item.visible { opacity: 1; transform: translateY(0); }
.clue-item-title { color: var(--accent); font-weight: 700; font-size: 10px; letter-spacing: 2px; margin-bottom: 4px; }

.mystery-bar-wrap { margin-top: auto; border-top: 1px solid var(--border-dim); padding-top: 16px; }
.mystery-bar-label { font-size: 9px; color: var(--text-muted); letter-spacing: 4px; margin-bottom: 8px; }
.mystery-bar { height: 2px; background: var(--border-dim); }
.mystery-bar-fill { height: 100%; background: var(--accent); transition: width 1s ease; width: 0%; }
.mystery-pct { font-size: 10px; color: var(--accent); text-align: right; margin-top: 6px; }

/* ════════════════════════════
   해결 화면 (Solved)
════════════════════════════ */
#screen-solved {
  flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg-app); padding: 40px 20px;
}
.solved-newspaper {
  width: 100%; max-width: 540px; background: #f0e6d0; color: #1a1a1a;
  padding: 32px 36px; box-shadow: 0 0 100px rgba(200,169,110,0.5);
  animation: solvedIn 1.2s ease forwards;
}
@keyframes solvedIn {
  0%   { opacity: 0; transform: scale(0.88) rotate(-3deg); filter: grayscale(100%) sepia(100%); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); filter: sepia(15%); }
}
.solved-headline { font-size: calc(22px * var(--f-scale)); font-weight: 800; text-align: center; line-height: 1.4; margin: 14px 0; color: #8b1a1a; }
.solved-stamp-wrap { margin: 20px 0; text-align: center; perspective: 1000px; }
.solved-stamp { 
  display: inline-block; border: 4px double #8b1a1a; color: #8b1a1a; 
  font-size: 20px; font-weight: 900; padding: 6px 24px; 
  letter-spacing: 10px; transform: rotate(-12deg); 
  animation: stampImpact 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0; box-shadow: 0 0 10px rgba(139, 26, 26, 0.2);
}
@keyframes stampImpact {
  0% { transform: scale(5) rotate(20deg); opacity: 0; filter: blur(10px); }
  100% { transform: scale(1) rotate(-12deg); opacity: 1; filter: blur(0); }
}
.solved-clue-item { font-size: calc(12px * var(--f-scale)); line-height: 2; color: #444; padding-left: 12px; border-left: 2px solid #c8a96e; margin-bottom: 6px; }
.shelf-back-btn  { margin-top: 32px; background: transparent; color: var(--accent); border: 1px solid rgba(200,169,110,0.2); padding: 13px 36px; font-size: 12px; letter-spacing: 4px; cursor: pointer; }

/* ════════════════════════════
   시스템 컴포넌트 (Flash, Modal, Overlay)
════════════════════════════ */
.flash { position: fixed; inset: 0; background: #f0e6d0; z-index: 9999; pointer-events: none; opacity: 0; }
.flash.go { animation: flashAnim 0.8s ease forwards; }
@keyframes flashAnim {
  0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; }
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px); z-index: 10000;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-content { background: var(--bg-screen); border: 1px solid var(--border-item); width: 90%; max-width: 400px; padding: 30px; text-align: center; }
.modal-header { font-size: 11px; letter-spacing: 5px; color: var(--text-muted); border-bottom: 1px solid var(--border-dim); padding-bottom: 15px; margin-bottom: 20px; font-weight: 800; }
.modal-body { font-size: 13px; color: var(--text-accent); line-height: 1.8; margin-bottom: 30px; }
.modal-footer { display: flex; gap: 12px; }
.modal-btn { flex: 1; background: var(--bg-item); color: var(--text-dim); border: 1px solid var(--border-item); padding: 12px; font-size: 11px; cursor: pointer; }
.modal-btn.primary { background: var(--accent); color: #0a0a0a; border-color: var(--accent); font-weight: 800; }

#landing-overlay {
  position: fixed; inset: 0; background: #000; z-index: 8888;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
}
#landing-overlay.active { display: flex; }

/* 위성 레이더 스캐닝 라인 */
#landing-overlay::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 200vw; height: 1px; background: rgba(200,169,110,0.1);
  transform: translate(-50%, -50%); z-index: 5;
  animation: radarSweep 4s linear infinite;
  pointer-events: none;
}
@keyframes radarSweep {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 지도 컨테이너 */
.map-zoom-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  filter: grayscale(80%) contrast(120%) brightness(0.6) sepia(20%);
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
#landing-overlay.active .map-zoom-container {
  opacity: 1;
}

/* Leaflet UI 숨김 */
.leaflet-control-zoom, .leaflet-control-attribution { display: none !important; }

/* 기존 비주얼 레이어 조정 */
.landing-map-container {
  width: 100%; height: 100%; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(circle at center, rgba(166,139,103,0.1) 0%, transparent 70%);
  z-index: 2; /* 지도 위에 렌더링 */
  mix-blend-mode: color-dodge; /* 지도와 겹쳤을 때 하이라이트 효과 */
}
#landing-overlay.active .landing-map-container { 
  opacity: 1; animation: mapDive 3.2s cubic-bezier(0.7, 0, 0.3, 1) forwards; 
}

.landing-map-svg {
  width: 180vw; height: 180vh; 
  filter: drop-shadow(0 0 20px var(--accent));
  transition: transform 2.8s cubic-bezier(0.7, 0, 0.3, 1);
  transform-origin: center;
}

.map-target { opacity: 0; }
.map-target.active { opacity: 1; transition: opacity 0.2s 0.5s; }

/* 정밀 타겟 UI */
.landing-location {
  position: absolute; bottom: 15%; right: 10%;
  color: #ff3333; font-size: 15px; font-weight: 800; letter-spacing: 2px;
  text-shadow: 0 0 15px #ff3333; opacity: 0; z-index: 20;
  text-align: right; line-height: 1.5;
}
.landing-location.active { 
  opacity: 1; animation: techBlink 0.1s 1.2s infinite alternate; 
}

@keyframes mapDive {
  0% { transform: scale(0.4); filter: blur(1px); opacity: 0; }
  10% { opacity: 1; }
  40% { transform: scale(0.45); filter: blur(0); }
  70% { transform: scale(40); filter: blur(15px); opacity: 1; }
  85% { opacity: 0.8; filter: blur(30px); }
  100% { transform: scale(60); opacity: 0; }
}

@keyframes techBlink {
  0% { opacity: 1; transform: skewX(0deg) scale(1); }
  50% { opacity: 0.6; transform: skewX(5deg) scale(1.02); }
  100% { opacity: 0.9; transform: skewX(-5deg) scale(0.98); }
}

@keyframes whiteout {
  0% { background: transparent; }
  80% { background: #fff; }
  100% { background: var(--bg-app); }
}
#landing-overlay.active::after {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  z-index: 9999; animation: whiteout 0.5s 2.2s forwards;
}

.landing-year { 
  font-size: 84px; font-weight: 900; color: var(--accent); 
  letter-spacing: 12px; opacity: 0; z-index: 10000; position: relative;
  text-shadow: 0 0 30px rgba(200,169,110,0.6);
  font-family: 'Nanum Myeongjo', serif;
}
#landing-overlay.active .landing-year { 
  animation: yearIn 0.7s 2.6s cubic-bezier(0.2, 0, 0.2, 1) forwards; 
}

@keyframes yearIn { 
  from { opacity: 0; transform: scale(1.3) translateY(20px); } 
  to { opacity: 1; transform: scale(1) translateY(0); } 
}

.landing-date { 
  font-size: 14px; color: var(--text-dim); opacity: 0; z-index: 10000; position: relative;
}
#landing-overlay.active .landing-date { 
  animation: fadeIn 0.8s 2.3s forwards; 
}

.landing-msg { 
  font-size: 12px; color: var(--accent); max-width: 300px; text-align: center; 
  line-height: 1.6; opacity: 0; z-index: 10000; position: relative;
}
#landing-overlay.active .landing-msg { 
  animation: fadeIn 0.8s 2.6s forwards; 
}

@keyframes fadeIn { to { opacity: 1; } }

/* ════════════════════════════
   어드민 패널 (Admin)
════════════════════════════ */
#screen-admin { background: var(--bg-screen); flex-direction: column; padding: 40px 20px; overflow-y: auto; }
.admin-panel { width: 100%; max-width: 900px; margin: 0 auto; background: var(--bg-shelf); border: 1px solid var(--border-light); padding: 30px; }
.admin-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.admin-title { font-size: 14px; letter-spacing: 4px; color: var(--accent); font-weight: 800; }
.admin-field { margin-bottom: 20px; }
.admin-field label { display: block; font-size: 10px; color: var(--text-dim); margin-bottom: 8px; }
.admin-field input, .admin-field textarea { width: 100%; background: var(--bg-item); border: 1px solid var(--border-item); color: var(--text-main); padding: 12px; font-size: 12px; }
.admin-btn { width: 100%; padding: 16px; background: var(--accent); color: #0a0a0a; font-weight: 800; cursor: pointer; border: none; }

/* ════════════════════════════
   모바일 최적화 (Mobile Responsive)
   ───────────────────────────── */
@media (max-width: 768px) {
  /* 1. 도서관 */
  .shelf-row { gap: 10px; justify-content: center; }
  .newspaper-item { width: 130px; height: 180px; }
  .library-subtitle { font-size: 20px; }
  #screen-newspaper, #screen-investigation { background: #1a1a1a; }
  .newspaper-container { padding: 0; width: 100%; }

  /* 2. 신문 본문 */
  .newspaper-wrap { padding: 15px 12px; box-shadow: none; filter: none; width:100%; border-radius:0; }
  .np-masthead-name { font-size: 20px; letter-spacing: 2px; }
  .np-masthead-info { font-size: 8px; }
  .np-main-headline { font-size: 18px; margin: 15px 0; }
  .np-sub-headline { font-size: 10px; text-align: left; }
  .np-columns { display: flex; flex-direction: column; gap: 15px; border-bottom: none; }
  .np-col-body { font-size: 12px; line-height: 1.7; text-align: justify; }
  .np-col-title { font-size: 13px; margin-bottom: 8px; border-bottom: 2px solid #333; }
  
  /* 3. 수사 일지 */
  .field-notes-wrap { padding: 20px 15px; }
  .log-line { font-size: 13px; }
  .btn-choice { font-size: 12px; padding: 14px; }

  /* 4. 헤더 & 스탯 */
  .game-header { gap: 8px; padding: 8px 10px; flex-wrap: wrap; justify-content: space-between; }
  .game-location { 
    font-size: 10px; order: 3; width: 100%; border-top: 1px solid var(--border-dim); 
    padding-top: 8px; margin-top: 5px; opacity: 0.7;
    white-space: normal; overflow: visible; /* 잘림 방지 */
  }
  .game-clues { 
    font-size: 10px; color: #fff; background: var(--accent); padding: 4px 10px; 
    border-radius: 4px; cursor: pointer; flex-shrink: 0;
  }
  .game-era-badge { flex-shrink: 0; }
  .font-controls { margin-left: 0 !important; gap: 2px; }
  .btn-theme-toggle { margin-left: 0 !important; flex: 1; text-align: center; }
  .stat-item .stat-label { display: none; } /* 모바일에서 라벨 숨김 */
  .stat-item::before { content: "● "; font-size: 8px; color: #444; }

  .drawer-close-btn { 
    display: block; font-size: 18px; cursor: pointer; color: #c8a96e; 
    background: transparent; border: none; padding: 0 4px; 
    margin-top: -4px; opacity: 0.6;
  }

  /* ───── 모바일 단서 패널 (상단 상단 드롭다운 방식) ───── */
  .clue-panel {
    width: 100%; position: fixed; top: -100%; left: 0; right: 0; height: auto; max-height: 85vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8); border-left: none; border-bottom: 2px solid var(--accent);
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 10000;
    border-radius: 0 0 24px 24px; padding: 30px 20px 40px;
  }
  .clue-panel.active { top: 0; right: auto; } /* right 초기화 */
  
  /* 배경 어둡게 처리 (배경 클릭 시 닫기용) */
  .clue-panel-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(2px);
    z-index: 9999; display: none;
  }
  .clue-panel-overlay.active { display: block; }
}

/* ───── 모바일 전용 UI 초기 상태 제거 (HTML 삭제됨) ───── */

/* 폰트 제어 버튼 스타일 */
.font-controls { display: flex; align-items: center; gap: 4px; margin-left: 10px; border-left: 1px solid var(--border-light); padding-left: 10px; }
.font-btn { 
  background: var(--bg-item); color: var(--text-dim); border: 1px solid var(--border-item); 
  width: 28px; height: 28px; border-radius: 4px; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.font-btn:hover { border-color: var(--accent); color: var(--accent); }
.font-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ════════════════════════════
   단서 재열람 & 시간 도약 (Re-view & Jump)
   ───────────────────────────── */
.context-modal-content {
  max-width: 500px !important;
  background: var(--bg-item) !important;
  border: 1px solid var(--border-item) !important;
  text-align: left !important;
  box-shadow: 0 0 50px rgba(0,0,0,1), 0 0 20px rgba(200,169,110,0.1);
}

.context-clue-title {
  font-size: 20px;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.context-clue-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-dim);
}

.context-log-scroll {
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-panel);
  padding: 20px;
  border: 1px solid var(--border-dim);
  margin-bottom: 20px;
}

.context-log-scroll::-webkit-scrollbar { width: 4px; }
.context-log-scroll::-webkit-scrollbar-thumb { background: #333; }

/* 클릭 가능한 해결 단서 */
.solved-clue-item.clickable {
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  background: rgba(255,255,255,0.03);
  margin-bottom: 8px;
}
.solved-clue-item.clickable:hover {
  background: rgba(200,169,110,0.1);
  padding-left: 18px;
  color: var(--accent);
  border-left-color: var(--accent);
}
.solved-clue-item.clickable::after {
  content: ' 🔍 맥락 재열람';
  font-size: 10px;
  float: right;
  opacity: 0.4;
  font-weight: normal;
}

/* 시간 도약 효과 */
@keyframes timeGlitch {
  0% { transform: translate(0); filter: hue-rotate(0deg); }
  25% { transform: translate(-2px, 2px); }
  50% { transform: translate(2px, -2px); filter: contrast(150%); }
  75% { transform: translate(-2px, -2px); }
  100% { transform: translate(0); filter: hue-rotate(0deg); }
}
.time-glitch-active {
  animation: timeGlitch 0.2s infinite;
  pointer-events: none;
}
/* 단서 부족 시 박동 효과 */
.clue-pulse {
  animation: cluePulse 1.5s infinite;
  box-shadow: 0 0 0 0 rgba(200, 169, 110, 0.7);
}
@keyframes cluePulse {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(200, 169, 110, 0.7); }
  70%  { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(200, 169, 110, 0); }
  100% { transform: scale(1);   box-shadow: 0 0 0 0 rgba(200, 169, 110, 0); }
}

/* ══════════════════════════════
   소개 페이지 (About)
══════════════════════════════ */
.about-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 40px;
  animation: slideUp 0.8s ease-out;
}

.about-header {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 20px;
}

.about-header-main {
  font-family: serif;
  font-size: calc(28px * var(--f-scale));
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--text-main);
}

.about-header-sub {
  font-size: calc(10px * var(--f-scale));
  letter-spacing: 4px;
  color: var(--accent);
  margin-top: 5px;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.about-section {
  padding: 30px;
  background: var(--bg-panel);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  line-height: 1.8;
  font-size: calc(14px * var(--f-scale));
  color: var(--text-dim);
}

.about-section strong {
  color: var(--text-main);
}

.about-section.warning {
  border-left: 6px solid #c0392b; /* 경고 레드 */
  background: rgba(192, 57, 43, 0.05);
}

.section-title {
  font-size: calc(18px * var(--f-scale));
  margin-bottom: 15px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.about-footer {
  margin-top: 20px;
  margin-bottom: 60px;
  text-align: center;
}

@media (max-width: 768px) {
  .about-container { padding: 40px 20px; gap: 30px; }
  .about-header-main { font-size: calc(24px * var(--f-scale)); }
  .about-section { padding: 20px; }
}
