/* ============================================================
   Para Raquel — hoja de estilos
   Paleta: crema, tinta, terracota, mostaza, salvia.
   Mobile first. Todo el layout es una columna centrada.
   ============================================================ */

:root {
  --cream: #fff3e4;
  --paper: #fffaf3;
  --ink: #2b211a;
  --ink-soft: #6d5c4e;
  --terracotta: #c9553b;
  --terracotta-dark: #a8412b;
  --mustard: #e5a83c;
  --sage: #5f8261;
  --sage-soft: #eaf1e6;
  --line: rgba(43, 33, 26, 0.12);
  --shadow-sm: 0 2px 10px rgba(80, 50, 30, 0.06);
  --shadow-md: 0 14px 40px -18px rgba(80, 50, 30, 0.35);
  --radius: 26px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120% 80% at 50% -10%, #ffe9cf 0%, rgba(255, 233, 207, 0) 60%),
    radial-gradient(90% 60% at 100% 100%, #fbe3d3 0%, rgba(251, 227, 211, 0) 55%),
    var(--cream);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

/* grano de papel muy sutil */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: calc(100dvh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding-bottom: 8px;
}

/* ---------- tipografía ---------- */

h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
  font-variation-settings: "SOFT" 40, "WONK" 1;
}

h1 { font-size: clamp(2.1rem, 9vw, 2.9rem); }
h2 { font-size: clamp(1.6rem, 6.4vw, 2.05rem); }
p { margin: 0; }
.lead { font-size: 1.06rem; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-size: 0.92rem; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0;
}

.serif-em { font-family: "Fraunces", Georgia, serif; font-style: italic; }

/* ---------- cabecera / progreso ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.brand {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

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

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(43, 33, 26, 0.15);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}
.dot.done { background: var(--sage); transform: scale(1.05); }
.dot.current { background: var(--terracotta); box-shadow: 0 0 0 4px rgba(201, 85, 59, 0.16); }

/* ---------- tarjeta ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-md);
  animation: rise 0.5s var(--ease) both;
}

.card + .card { animation-delay: 0.06s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.center { text-align: center; align-items: center; }

/* ---------- sobre / sello ---------- */

.envelope {
  width: 74px; height: 74px;
  border-radius: 22px;
  display: grid; place-items: center;
  font-size: 34px;
  background: linear-gradient(160deg, #ffe6cc, #ffd9b8);
  border: 1px solid rgba(201, 85, 59, 0.18);
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(229, 168, 60, 0.16);
  color: #8a5f14;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- botones ---------- */

.btn {
  appearance: none;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 16px;
  padding: 15px 20px;
  width: 100%;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform 0.18s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--terracotta);
  color: #fff8f1;
  box-shadow: 0 10px 24px -12px rgba(201, 85, 59, 0.9);
}
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-primary:active { transform: scale(0.985); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(43, 33, 26, 0.04); }

.btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- opciones del quiz ---------- */

.options { display: flex; flex-direction: column; gap: 11px; margin-top: 4px; }

.option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.16s var(--ease), border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}

.option:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(201, 85, 59, 0.45);
  box-shadow: 0 12px 26px -16px rgba(80, 50, 30, 0.5);
}
.option:active:not(:disabled) { transform: scale(0.99); }

.option .key {
  flex: 0 0 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(229, 168, 60, 0.18);
  color: #8a5f14;
  font-weight: 700;
  font-size: 0.85rem;
}

.option .text { padding-top: 2px; font-size: 0.98rem; }

.option.correct {
  border-color: var(--sage);
  background: var(--sage-soft);
  animation: pop 0.45s var(--ease);
}
.option.correct .key { background: var(--sage); color: #fff; }

.option.wrong {
  border-color: rgba(201, 85, 59, 0.6);
  background: #fdeee9;
  animation: shake 0.4s ease;
}
.option.wrong .key { background: var(--terracotta); color: #fff; }

.option:disabled { cursor: default; }
.option.faded { opacity: 0.45; }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- feedback ---------- */

.feedback {
  border-radius: 16px;
  padding: 13px 15px;
  font-size: 0.94rem;
  font-weight: 500;
  animation: rise 0.35s var(--ease) both;
}
.feedback.ok { background: var(--sage-soft); color: #3d5a3f; }
.feedback.ko { background: #fdeee9; color: #93372a; }

/* ---------- estados: bloqueado / final ---------- */

.locked-icon { font-size: 40px; }

.penalty {
  background: #fff8ec;
  border-color: rgba(229, 168, 60, 0.45);
}

.countdown {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.6rem, 14vw, 3.6rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--terracotta);
  line-height: 1;
  margin: 2px 0 4px;
}

.final-card { padding: 30px 24px; }

.letter {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.62;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.letter .signature {
  font-style: italic;
  font-size: 1.2rem;
  margin-top: 4px;
}

.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.photos img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f1e4d6;
}
.photos img:only-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }

/* ---------- tarjeta final (busca a X del staff) ---------- */

.download {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 2px;
}

.ticket-card { background: linear-gradient(180deg, #fffaf3, #fff3e4); }

.ticket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  padding: 26px 18px 22px;
  border: 1px dashed rgba(201, 85, 59, 0.45);
  border-radius: 18px;
}

.ticket-kicker {
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.ticket-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.3rem, 12vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 2px 0;
}

.ticket-rule {
  width: 42px;
  height: 2px;
  background: var(--terracotta);
  opacity: 0.55;
  margin: 3px 0;
}

.ticket-suffix {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  padding-left: 0.28em;
}

.ticket-note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.gift-dl { margin-top: 10px; }

/* ---------- siguiente parada ---------- */

.next { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 4px; }

.next-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.35;
}
.next-name strong {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 2px;
}

/* ---------- confetti ---------- */

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute;
  top: -12px;
  width: 9px; height: 14px;
  border-radius: 2px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}

/* ---------- pie ---------- */

.footer {
  text-align: center;
  font-size: 0.76rem;
  color: rgba(43, 33, 26, 0.4);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ---------- accesibilidad ---------- */

:focus-visible {
  outline: 3px solid rgba(201, 85, 59, 0.55);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 480px) {
  body { padding-top: 40px; padding-bottom: 40px; }
  .card { padding: 32px 28px; }
}
