/* ─── LOADING SCREEN ─── */
#loading-screen {
  position: fixed; inset: 0;
  background: #0f0d0a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-candle { font-size: 48px; animation: flicker 1.2s ease-in-out infinite; }
@keyframes flicker { 0%,100%{transform:scale(1) rotate(-1deg);opacity:1} 50%{transform:scale(1.05) rotate(1deg);opacity:0.85} }
.loading-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: var(--gold);
  margin-top: 20px; letter-spacing: 0.06em;
}
.loading-bar-wrap {
  width: 200px; height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; margin-top: 24px; overflow: hidden;
}
.loading-bar {
  height: 100%; width: 0%;
  background: var(--gold);
  border-radius: 2px;
  animation: load-progress 1.8s ease forwards;
}
@keyframes load-progress { to { width: 100%; } }

/* ─── LAYOUT ─── */
#app { max-width: 720px; margin: 0 auto; padding: 0 16px 80px; }

/* ─── HERO ─── */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, transparent, var(--gold));
}
.eyebrow {
  font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 16px;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 700; color: var(--parchment);
  line-height: 1.15; margin-bottom: 8px;
}
.hero-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: clamp(13px, 2.5vw, 16px);
  color: var(--ash); font-style: italic;
  margin-bottom: 24px; line-height: 1.6;
}
.hero-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  font-size: 11px; color: var(--smoke); letter-spacing: 0.06em;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.dot { width: 3px; height: 3px; background: var(--border); border-radius: 50%; }

/* ─── SECTION LABEL / CHARACTERS GRID ─── */
.section-label {
  font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px;
}
.characters-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 36px;
}
@media (min-width: 500px) { .characters-grid { grid-template-columns: repeat(4, 1fr); } }

/* ─── CHAPTER NAVIGATION ─── */
.chapters-nav {
  display: flex; gap: 6px; margin-bottom: 32px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.chapters-nav::-webkit-scrollbar { display: none; }

.ch-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  font-size: 12px; color: var(--ash);
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.ch-tab:hover { border-color: var(--border); color: var(--parchment); }
.ch-tab.active {
  border-color: var(--gold); color: var(--gold-light);
  background: rgba(184,151,42,0.08);
}
.ch-tab.locked { opacity: 0.5; cursor: default; }
.ch-tab .lock-icon { font-size: 10px; }

/* ─── CHAPTER CONTENT ─── */
.chapter-panel { display: none; }
.chapter-panel.active { display: block; animation: fade-in 0.5s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.chapter-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.chapter-num {
  font-size: 9px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 8px;
}
.chapter-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700; color: var(--parchment);
  line-height: 1.2; margin-bottom: 6px;
}
.chapter-setting {
  font-size: 12px; color: var(--smoke);
  font-style: italic; letter-spacing: 0.04em;
}

/* ─── SCENE TEXT ─── */
.scene {
  font-family: 'Crimson Text', serif;
  font-size: clamp(16px, 2.5vw, 18px);
  line-height: 1.85; color: #c8c0b0;
  margin-bottom: 28px;
}
.scene p { margin-bottom: 1.4em; }
.scene p:last-child { margin-bottom: 0; }

.scene em { color: var(--parchment); font-style: italic; }
.scene strong { color: var(--parchment); font-weight: 600; }

.clue-inline {
  display: inline-block;
  background: rgba(139,26,26,0.15);
  border: 1px solid rgba(139,26,26,0.3);
  border-radius: 4px; padding: 1px 7px;
  font-size: 13px; color: #c07070;
  font-style: normal;
}

/* ─── CHOICES ─── */
.choices-label {
  font-size: 9px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px;
}
.choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }

/* ─── CONSEQUENCE BOX ─── */
.consequence {
  background: rgba(139,26,26,0.08);
  border: 1px solid rgba(139,26,26,0.2);
  border-left: 3px solid var(--blood);
  border-radius: 0 8px 8px 0;
  padding: 16px 18px; margin-bottom: 28px;
  font-family: 'Crimson Text', serif;
  font-size: 16px; line-height: 1.7; color: #c8a0a0;
  display: none;
}
.consequence.visible { display: block; animation: fade-in 0.5s ease; }

/* ─── CLUES COLLECTED ─── */
.clues-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  margin-bottom: 28px;
}
.clues-box-title {
  font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 12px;
}
.clues-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ─── INTER-CHAPTER AD ─── */
.inter-ad {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 10px; padding: 24px 20px;
  margin-bottom: 28px; text-align: center;
  display: none;
}
.inter-ad.show { display: block; animation: fade-in 0.4s ease; }
.inter-ad-label { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--smoke); margin-bottom: 12px; }
.inter-ad-img {
  width: 100%; max-width: 300px; height: 90px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--smoke);
}
.inter-ad-skip {
  font-size: 11px; color: var(--smoke); cursor: pointer;
  text-decoration: underline; transition: color 0.2s;
  background: none; border: none; font-family: inherit;
}
.inter-ad-skip:hover { color: var(--parchment); }
.skip-countdown { display: inline-block; min-width: 20px; }

/* ─── PROGRESS BAR ─── */
.progress-wrap {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px; font-size: 11px; color: var(--smoke);
}
.progress-track {
  flex: 1; height: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--gold);
  border-radius: 2px; transition: width 0.8s ease;
}

/* ─── SUSPICION TRACKER ─── */
.suspicion-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  margin-bottom: 28px;
}
.suspicion-title {
  font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px;
}
.suspicion-item {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; font-size: 12px; color: var(--ash);
}
.suspicion-item:last-child { margin-bottom: 0; }
.sus-bar-track {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden;
}
.sus-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 1s ease;
}
.sus-name { min-width: 90px; }
.sus-pct { min-width: 32px; text-align: right; font-size: 11px; }

/* ─── CLIFFHANGER ─── */
.cliffhanger {
  text-align: center; padding: 32px 20px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.cliffhanger-icon { font-size: 32px; margin-bottom: 14px; }
.cliffhanger-text {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-size: 18px;
  color: var(--ash); line-height: 1.6;
  max-width: 460px; margin: 0 auto 20px;
}
