@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --ink-navy: #1c2b1f;
  --ink-navy-deep: #12190f;
  --parchment: #ece1c8;
  --parchment-dim: #ddceac;
  --ink-text: #2b2118;
  --brass: #b9944c;
  --brass-light: #d4b876;
  --wax-red: #8a3226;
  --seal-teal: #3e7a4f;
  --seal-teal-light: #57986a;
  --shadow-soft: 0 20px 40px -12px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink-navy-deep);
  background-image:
    radial-gradient(circle at 20% -10%, rgba(185,148,76,0.08), transparent 45%),
    radial-gradient(circle at 90% 110%, rgba(62,122,79,0.14), transparent 45%);
  color: var(--ink-text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 40px;
}

.cover-header { text-align: center; padding: 28px 12px 20px; color: var(--parchment); }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass-light); margin-bottom: 10px; }
.cover-header h1 { font-family: 'Fraunces', serif; font-weight: 700; font-size: 2rem; line-height: 1.1; margin: 0 0 8px; letter-spacing: -0.01em; }
.cover-header p { font-size: 0.95rem; color: var(--parchment-dim); margin: 0; }

.passport-page {
  background: var(--parchment);
  border-radius: 4px;
  padding: 28px 22px 24px;
  box-shadow: var(--shadow-soft);
  position: relative;
  border: 1px solid rgba(43,33,24,0.12);
  animation: page-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.passport-page::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; background: linear-gradient(to bottom, transparent, rgba(43,33,24,0.15) 15%, rgba(43,33,24,0.15) 85%, transparent); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.zone-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.5rem; margin: 0 0 14px; line-height: 1.2; }
.story-text { font-size: 1rem; line-height: 1.65; color: var(--ink-text); margin-bottom: 22px; }
.divider { border: none; border-top: 1px dashed rgba(43,33,24,0.25); margin: 20px 0; }

.question-block h3 { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; }
.option-btn { display: block; width: 100%; text-align: left; background: rgba(255,255,255,0.4); border: 1.5px solid rgba(43,33,24,0.2); border-radius: 10px; padding: 13px 16px; margin-bottom: 10px; font-family: 'Inter', sans-serif; font-size: 0.95rem; color: var(--ink-text); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease; }
.option-btn:hover { border-color: var(--brass); background: rgba(255,255,255,0.65); }
.option-btn:active { transform: scale(0.99); }
.option-btn.correct { background: rgba(62,122,79,0.15); border-color: var(--seal-teal); color: var(--seal-teal); font-weight: 600; }
.option-btn.wrong { background: rgba(138,50,38,0.12); border-color: var(--wax-red); color: var(--wax-red); }
.option-btn:disabled { cursor: default; }

.feedback-box { margin-top: 16px; padding: 14px 16px; border-radius: 10px; font-size: 0.92rem; line-height: 1.5; animation: feedback-in 0.3s ease; }
@keyframes feedback-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.feedback-box.correct { background: rgba(62,122,79,0.12); color: var(--seal-teal); border: 1px solid rgba(62,122,79,0.3); }
.feedback-box.wrong { background: rgba(138,50,38,0.10); color: var(--wax-red); border: 1px solid rgba(138,50,38,0.28); }

.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--ink-navy); color: var(--parchment); border: none; border-radius: 10px; padding: 15px 18px; font-family: 'Inter', sans-serif; font-size: 0.98rem; font-weight: 600; cursor: pointer; margin-top: 18px; transition: background 0.15s ease, transform 0.1s ease; }
.primary-btn:hover { background: #243a28; }
.primary-btn:active { transform: scale(0.98); }
.primary-btn.teal { background: var(--seal-teal); }
.primary-btn.teal:hover { background: var(--seal-teal-light); }
.primary-btn.ghost { background: transparent; color: var(--ink-navy); border: 1.5px solid rgba(43,33,24,0.3); }
.primary-btn.ghost:hover { background: rgba(43,33,24,0.06); }

.stamps-section { margin-top: 26px; padding-top: 22px; border-top: 1px dashed rgba(43,33,24,0.25); }
.stamps-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.stamps-header h4 { font-family: 'Fraunces', serif; font-size: 1rem; font-weight: 600; margin: 0; }
.stamps-count { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--brass); }
.stamps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 10px; }
.stamp { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 700; border: 2px solid rgba(43,33,24,0.18); color: rgba(43,33,24,0.3); background: rgba(255,255,255,0.3); }
.stamp.done { border: 2px solid var(--brass); color: var(--seal-teal); background: radial-gradient(circle, rgba(62,122,79,0.1) 0%, transparent 70%); box-shadow: inset 0 0 0 3px rgba(185,148,76,0.35); transform: rotate(var(--rot, -6deg)); animation: stamp-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes stamp-in { from { transform: rotate(var(--rot, -6deg)) scale(0.4); opacity: 0; } to { transform: rotate(var(--rot, -6deg)) scale(1); opacity: 1; } }

.notice-box { background: rgba(185,148,76,0.12); border: 1px solid rgba(185,148,76,0.35); border-radius: 10px; padding: 14px 16px; font-size: 0.9rem; color: #6b5321; margin-bottom: 18px; }

.final-seal { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%; border: 3px solid var(--brass); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 4px rgba(185,148,76,0.3); animation: stamp-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.final-seal svg { width: 44px; height: 44px; stroke: var(--wax-red); }

.footer-note { text-align: center; margin-top: 24px; font-size: 0.78rem; color: rgba(236,225,200,0.45); }
.footer-note button { background: none; border: none; color: rgba(236,225,200,0.55); text-decoration: underline; font-size: 0.78rem; cursor: pointer; padding: 0; }

.choice-row { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

/* ---------- Visor de cámara para escanear QR dentro de la app ---------- */
.scan-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: var(--brass); color: var(--ink-navy-deep); border: none;
  border-radius: 10px; padding: 14px 18px; font-family: 'Inter', sans-serif;
  font-size: 0.95rem; font-weight: 700; cursor: pointer; margin-top: 14px;
}
.scan-btn:hover { background: var(--brass-light); }

.scanner-overlay {
  position: fixed; inset: 0; background: rgba(10,14,9,0.94); z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
}
.scanner-video-wrap {
  position: relative; width: 100%; max-width: 380px; aspect-ratio: 1;
  border-radius: 16px; overflow: hidden; border: 2px solid var(--brass);
}
.scanner-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scanner-hint { color: var(--parchment); font-family: 'Inter', sans-serif; font-size: 0.9rem; margin-top: 18px; text-align: center; max-width: 320px; }
.scanner-close-btn {
  margin-top: 18px; background: transparent; border: 1.5px solid rgba(236,225,200,0.4);
  color: var(--parchment); border-radius: 10px; padding: 10px 22px; font-family: 'Inter', sans-serif;
  cursor: pointer; font-size: 0.9rem;
}
.scanner-error { color: var(--parchment); text-align: center; max-width: 320px; font-size: 0.9rem; margin-top: 14px; }

.scenario-list { display: flex; flex-direction: column; gap: 14px; }
.scenario-card {
  display: block; text-decoration: none; color: var(--ink-text);
  background: rgba(255,255,255,0.35); border: 1.5px solid rgba(43,33,24,0.18);
  border-radius: 12px; padding: 16px 18px; transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.scenario-card:hover { border-color: var(--brass); background: rgba(255,255,255,0.6); }
.scenario-card:active { transform: scale(0.99); }
.scenario-card h3 { font-family: 'Fraunces', serif; font-size: 1.15rem; margin: 0 0 4px; }
.scenario-card p { font-size: 0.88rem; color: rgba(43,33,24,0.65); margin: 0; }

@media (max-width: 360px) { .cover-header h1 { font-size: 1.6rem; } }
