/* ═══════════════════════════════════════
   CRIMSON CHAPTER — game.css
   play.html styles — responsive, legible
   ═══════════════════════════════════════ */

:root {
  --black:   #080706;
  --ink:     #0f0d0a;
  --surface: #161310;
  --surface2:#1e1a16;
  --gold:    #c9a84c;
  --gold-light: #d4af37;
  --blood:   #8b1a1a;
  --blood-l: #a02020;
  --parchment: #e8dfc8;
  --muted:   #6e6355;
  --ash:     #9a8e7e;
  --smoke:   #6b6254;
  --border:  rgba(201,168,76,0.18);
}

/* ── LOADING ── */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--ink);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease;
  gap: 6px;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loading-candle { font-size: 44px; 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-brand {
  font-family: 'Playfair Display', serif;
  font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); margin-top: 14px;
}
.loading-title {
  font-family: 'Playfair Display', serif;
  font-size: 19px; font-style: italic; color: var(--ash);
}
.loading-bar-wrap {
  width: 180px; height: 1px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; margin-top: 18px; overflow: hidden;
}
.loading-bar {
  height: 100%; width: 0%; background: var(--gold);
  animation: load-progress 1.8s ease forwards;
}
@keyframes load-progress { to { width: 100%; } }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,7,6,0.96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-back {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  text-decoration: none; transition: color 0.2s; padding: 8px 0;
}
.topbar-back:hover { color: var(--parchment); }
.topbar-back-arrow { font-size: 16px; }
.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 600; color: var(--gold);
  letter-spacing: 0.06em;
  position: absolute; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
}
.topbar-chapter {
  font-size: 12px; color: var(--muted); letter-spacing: 0.05em;
}

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

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

/* ── SECTION LABEL ── */
.section-label {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 12px; display: block;
}

/* ── CHARACTERS ── */
.characters-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 28px;
}
@media (min-width: 480px) {
  .characters-grid { grid-template-columns: repeat(4, 1fr); }
}
.char-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 14px 10px;
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.char-card:hover { border-color: var(--border); background: rgba(201,168,76,0.05); }
.char-card.selected { border-color: var(--gold); background: rgba(201,168,76,0.08); }
.char-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.char-name {
  font-family: 'Playfair Display', serif;
  font-size: 13px; font-weight: 600; color: var(--parchment);
  margin-bottom: 4px; line-height: 1.2;
}
.char-role { font-size: 11px; color: var(--ash); line-height: 1.4; }

/* ── AD BANNER ── */
.ad-banner {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px; padding: 12px 16px;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ad-label {
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); flex-shrink: 0;
}
.ad-content { font-size: 13px; color: var(--ash); font-style: italic; flex: 1; text-align: center; }
.ad-close {
  font-size: 18px; color: var(--muted); cursor: pointer;
  padding: 4px; transition: color 0.2s; flex-shrink: 0;
}
.ad-close:hover { color: var(--parchment); }

/* ── PROGRESS ── */
.progress-wrap {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; font-size: 13px; color: var(--muted);
}
.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;
}

/* ── CLUES BOX ── */
.clues-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 18px;
}
.clues-box-title {
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}
.clues-list { display: flex; flex-wrap: wrap; gap: 8px; }
.clue-pill {
  padding: 5px 12px;
  border: 1px solid rgba(139,26,26,0.3);
  background: rgba(139,26,26,0.08);
  border-radius: 20px; font-size: 13px; color: #c07070;
}
.clue-pill.new {
  border-color: var(--blood); background: rgba(139,26,26,0.18); color: #e08080;
  animation: pulse-clue 1.5s ease 3;
}
@keyframes pulse-clue { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 12px rgba(139,26,26,0.5)} }

/* ── SUSPICION ── */
.suspicion-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 24px;
}
.suspicion-title {
  font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.suspicion-item {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; font-size: 13px; color: var(--ash);
}
.suspicion-item:last-child { margin-bottom: 0; }
.sus-name { min-width: 86px; font-size: 13px; }
.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-pct { min-width: 36px; text-align: right; font-size: 12px; color: var(--muted); }

/* ── CHAPTER NAV ── */
.chapters-nav-wrap {
  position: relative; margin-bottom: 28px;
}
.chapters-nav-wrap::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 6px;
  width: 28px;
  background: linear-gradient(to right, transparent, var(--ink));
  pointer-events: none;
}
.chapters-nav {
  display: flex; gap: 6px;
  overflow-x: auto; padding-bottom: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chapters-nav::-webkit-scrollbar { display: none; }
.ch-tab {
  flex-shrink: 0; padding: 9px 18px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; font-size: 13px; color: var(--ash);
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  min-height: 40px;
}
.ch-tab:hover { border-color: var(--border); color: var(--parchment); }
.ch-tab.active {
  border-color: var(--gold); color: var(--gold-light);
  background: rgba(201,168,76,0.08);
}
.ch-tab.locked { opacity: 0.45; cursor: default; }

/* ── CHAPTER CONTENT ── */
.chapter-panel { display: none; }
.chapter-panel.active { display: block; animation: fade-in 0.4s 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: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 10px;
}
.chapter-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4.5vw, 32px);
  font-weight: 700; color: var(--parchment);
  line-height: 1.2; margin-bottom: 8px;
}
.chapter-setting {
  font-size: 13px; color: var(--smoke);
  font-style: italic; letter-spacing: 0.03em;
}

/* ── SCENE ── */
.scene {
  font-family: 'Crimson Text', serif;
  font-size: clamp(17px, 2.8vw, 20px);
  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;
  background: rgba(139,26,26,0.15);
  border: 1px solid rgba(139,26,26,0.3);
  border-radius: 4px; padding: 1px 7px;
  font-size: 90%; color: #c07070; font-style: normal;
}

/* ── CHOICES ── */
.choices-label {
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.choice-btn {
  width: 100%; padding: 18px 20px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #b0a898; font-family: 'Crimson Text', serif;
  font-size: clamp(16px, 2.5vw, 18px);
  text-align: left; cursor: pointer;
  transition: all 0.2s; line-height: 1.55;
  display: flex; align-items: flex-start; gap: 14px;
  min-height: 64px;
}
.choice-btn:hover {
  border-color: rgba(201,168,76,0.4);
  background: rgba(201,168,76,0.05); color: var(--parchment);
}
.choice-btn.selected {
  border-color: var(--gold); background: rgba(201,168,76,0.08); color: var(--parchment);
}
.choice-btn:disabled { opacity: 0.6; cursor: default; }
.choice-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }

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

/* ── NEXT BTN ── */
.next-btn {
  width: 100%; padding: 18px;
  background: var(--blood); border: 1px solid var(--blood-l);
  border-radius: 8px;
  color: var(--parchment); font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 36px; letter-spacing: 0.02em;
}
.next-btn:hover {
  background: var(--blood-l); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,26,26,0.35);
}

/* ── INTER-CHAPTER AD ── */
.inter-ad {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px; padding: 22px 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: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.inter-ad-img {
  width: 100%; max-width: 300px; height: 90px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
.inter-ad-skip {
  font-size: 13px; color: var(--muted); 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; }

/* ── CLIFFHANGER ── */
.cliffhanger {
  margin: 8px 0 36px;
  padding: 28px 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: 0 0 8px 8px;
  text-align: center;
}
.cliffhanger-icon { font-size: 32px; margin-bottom: 14px; display: block; }
.cliffhanger-text {
  font-family: 'Playfair Display', serif;
  font-style: italic; font-size: clamp(16px, 2.8vw, 20px);
  color: var(--ash); line-height: 1.65;
  max-width: 480px; margin: 0 auto;
}

/* ── PAYWALL ── */
.paywall {
  background: linear-gradient(160deg, rgba(26,23,18,0.98) 0%, var(--black) 100%);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 44px 28px;
  text-align: center; margin-bottom: 40px;
  position: relative; overflow: hidden;
}
.paywall::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.paywall-icon { font-size: 44px; margin-bottom: 16px; }
.paywall-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 5vw, 30px); font-weight: 700;
  color: var(--parchment); margin-bottom: 12px;
}
.paywall-subtitle {
  font-family: 'Crimson Text', serif;
  font-size: 18px; color: var(--ash); line-height: 1.6;
  margin-bottom: 28px; max-width: 380px; margin-left: auto; margin-right: auto;
}
.paywall-features { list-style: none; margin-bottom: 28px; display: inline-block; text-align: left; }
.paywall-features li {
  font-size: 15px; color: #b0a898;
  padding: 7px 0; display: flex; align-items: center; gap: 10px;
}
.paywall-features li::before { content: '✦'; color: var(--gold); font-size: 10px; flex-shrink: 0; }
.paywall-price {
  font-family: 'Playfair Display', serif;
  font-size: 44px; font-weight: 700; color: var(--gold); margin-bottom: 4px;
}
.paywall-price-note { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.paywall-cta {
  display: inline-block; width: 100%; max-width: 300px;
  padding: 18px 32px; background: var(--gold); border: none; border-radius: 8px;
  color: #1a1712; font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; margin-bottom: 14px; letter-spacing: 0.02em;
}
.paywall-cta:hover { background: var(--gold-light); transform: translateY(-1px); }
.paywall-free-note { font-size: 13px; color: var(--muted); }
.paywall-preview { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.paywall-preview-text {
  font-family: 'Crimson Text', serif; font-size: 17px; line-height: 1.8;
  color: #7a7060; font-style: italic; position: relative;
}
.paywall-preview-text::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(15,13,10,0.98));
}
.paywall-preview-label {
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 20px; text-align: center;
  font-size: 13px; color: var(--muted); line-height: 1.8;
  max-width: 680px; margin: 0 auto;
}
footer strong { color: var(--gold); font-family: 'Playfair Display', serif; font-size: 15px; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.2); border-radius: 3px; }

/* ══════════════════════════════════
   RESPONSIVE — 600px (tablets/mobile)
   ══════════════════════════════════ */
@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 13px; }
  #app { padding: 0 16px 72px; }

  .hero { padding: 28px 0 24px; }
  .hero-meta { gap: 10px; font-size: 12px; }

  .characters-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .char-card { padding: 12px 8px; }
  .char-avatar { width: 38px; height: 38px; font-size: 18px; }
  .char-name { font-size: 12px; }
  .char-role { font-size: 10px; }

  .ad-banner { flex-direction: column; text-align: center; gap: 8px; }
  .ad-label { align-self: flex-start; }

  .suspicion-item { font-size: 12px; }
  .sus-name { min-width: 72px; font-size: 12px; }

  .chapters-nav-wrap::after { width: 20px; }
  .ch-tab { padding: 8px 14px; font-size: 12px; min-height: 36px; }

  .choice-btn { padding: 16px 14px; gap: 10px; min-height: 60px; }
  .choice-icon { font-size: 18px; }

  .cliffhanger { padding: 22px 16px; }
  .cliffhanger-text { font-size: 16px; }

  .paywall { padding: 32px 20px; }
  .paywall-features li { font-size: 14px; }

  .next-btn { font-size: 16px; padding: 16px; }
}

/* ══════════════════════════════════
   RESPONSIVE — 400px (small phones)
   ══════════════════════════════════ */
@media (max-width: 400px) {
  .topbar-back-text { display: none; }
  .topbar-back { font-size: 12px; }
  .hero-meta .dot { display: none; }

  .characters-grid { gap: 6px; }
  .char-card { padding: 10px 6px; }
  .char-avatar { width: 34px; height: 34px; font-size: 16px; margin-bottom: 6px; }

  .choice-btn { padding: 14px 12px; font-size: 15px; }
  .next-btn { font-size: 15px; padding: 15px; }
  .paywall-cta { font-size: 16px; padding: 16px 20px; }
}

/* ══════════════════════════════════
   ACCESIBILIDAD
   ══════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .loading-candle { animation: none; }
  .clue-pill.new { animation: none; }
  .chapter-panel.active { animation: none; }
  .consequence.visible { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
