/* ==========================================================================
   PARA CHOMPI ♡ — ESTILOS
   1. Fuentes y paleta        5. Sobre, orbe, camino, cuenta regresiva
   2. Base y estructura       6. Acertijo y revelación
   3. Tipografía              7. Espera, regalo, tarjeta, final
   4. Botones                 8. Barra, progreso, hoja, modal, comodín, efectos
                              9. Modo prueba · 10. Movimiento reducido
   ========================================================================== */

/* ---------- 1. FUENTES Y PALETA ---------- */
@font-face {
  font-family: 'Caveat';
  src: url('fonts/Caveat-variable.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #faf3ec;
  --paper: #fffaf6;
  --blush: #f5e3de;
  --blush-2: #eed2cd;
  --rose: #d6a3a6;
  --rose-deep: #b5767f;
  --wine: #8b4c58;
  --ink: #4a3437;
  --ink-soft: #775f62;
  --muted: #a48d8d;
  --line: rgba(139, 76, 88, 0.15);
  --line-strong: rgba(139, 76, 88, 0.28);
  --gold: #c9a57a;

  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino', Georgia, serif;
  --sans: 'Jost', -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Bradley Hand', 'Snell Roundhand', cursive;

  --shadow: 0 30px 60px -36px rgba(120, 62, 70, 0.4), 0 2px 8px -4px rgba(120, 62, 70, 0.1);
  --shadow-sm: 0 12px 26px -18px rgba(120, 62, 70, 0.45);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

/* ---------- 2. BASE Y ESTRUCTURA ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 60% at 100% 0%, rgba(240, 204, 200, 0.55), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(246, 222, 210, 0.7), transparent 65%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .32 0 0 0 0 .3 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed, scroll;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button,
input,
textarea,
select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--safe-t) + 14px)
    calc(var(--safe-r) + 20px)
    calc(var(--safe-b) + 26px)
    calc(var(--safe-l) + 20px);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: opacity 0.26s ease, transform 0.26s ease, filter 0.26s ease;
}
.stage.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.995);
  filter: blur(3px);
}

.screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 26px 0 10px;
}
.screen--center { justify-content: center; }

.rise {
  opacity: 0;
  animation: rise 0.95s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 110ms + 60ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Corazones ambientales */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient span {
  position: absolute;
  bottom: -40px;
  width: calc(16px * var(--s, 1));
  height: calc(16px * var(--s, 1));
  color: rgba(214, 163, 166, 0.3);
  animation: drift var(--t, 30s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.ambient svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes drift {
  0% { transform: translate(0, 0) rotate(-8deg); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(18px, -55vh) rotate(8deg); }
  90% { opacity: 1; }
  100% { transform: translate(-10px, -112vh) rotate(-6deg); opacity: 0; }
}

/* ---------- 3. TIPOGRAFÍA ---------- */
.eyebrow {
  margin: 0;
  font: 500 11px/1.5 var(--sans);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(31px, 8.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.title--xl { font-size: clamp(44px, 13vw, 58px); line-height: 1; }
.title--md { font-size: clamp(27px, 7.4vw, 32px); }
.title--sm { font-size: 26px; }
.title__line {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 0.56em;
  color: var(--ink-soft);
  margin-bottom: 0.1em;
}
.title--final .title__line { font-size: 0.62em; }
.title__name {
  display: block;
  font-style: italic;
  color: var(--wine);
}

.lead {
  margin: 0;
  max-width: 30ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.35;
  color: var(--ink-soft);
  text-wrap: balance;
}

.prose {
  max-width: 34ch;
  font: 300 16px/1.65 var(--sans);
  color: var(--ink-soft);
  text-wrap: pretty;
}
.prose p { margin: 0 0 0.85em; }
.prose p:last-child { margin-bottom: 0; }
.prose--small { font-size: 14.5px; }

.meta {
  margin: 0;
  max-width: 34ch;
  font: 400 13px/1.55 var(--sans);
  color: var(--muted);
}

.tabular { font-variant-numeric: tabular-nums; }

.ornament {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--rose);
}
.ornament span { width: 38px; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong)); }
.ornament span:last-child { transform: scaleX(-1); }
.ornament svg { width: 10px; height: 10px; fill: currentColor; }

.pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  margin: 4px 0 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.8);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 400 13px/1.4 var(--sans);
  color: var(--ink-soft);
}
.pill__sep { width: 3px; height: 3px; border-radius: 50%; background: var(--rose); }
.pill .tabular { color: var(--wine); font-weight: 500; }

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 340px;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 246, 0.85);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
}
.note p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.note__icon { flex: none; width: 14px; height: 14px; margin-top: 3px; fill: var(--rose); }

.tag {
  display: inline-block;
  margin: 2px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blush);
  font: 500 10.5px/1.3 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wine);
}
.tag--soon { background: #f3e7d6; color: #8d6a43; }

/* ---------- 4. BOTONES ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  min-height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font: 500 15px/1.2 var(--sans);
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: transform 0.25s var(--spring), box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}
.btn:active { transform: scale(0.965); }
.btn:focus-visible,
.choice:focus-visible,
.giftbox:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.btn[disabled] { opacity: 0.38; cursor: default; transform: none; box-shadow: none; }

.btn--primary {
  background: linear-gradient(180deg, #5b4044, var(--ink));
  color: #fff6f1;
  box-shadow: 0 16px 30px -16px rgba(74, 52, 55, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn--secondary {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-sm);
}
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--link {
  width: auto;
  min-height: 40px;
  padding: 0 12px;
  background: none;
  color: var(--rose-deep);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: underline;
  text-decoration-color: rgba(181, 118, 127, 0.35);
  text-underline-offset: 5px;
}
.btn--small { width: auto; min-height: 42px; padding: 0 18px; font-size: 13px; }
.btn--small:not(.btn--ghost) { background: var(--ink); color: #fff6f1; }

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

/* ---------- 5. SOBRE, ORBE, CAMINO, CUENTA REGRESIVA ---------- */
.envelope {
  position: relative;
  width: 196px;
  height: 132px;
  margin: 18px auto 6px;
  perspective: 700px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
.envelope > div { position: absolute; border-radius: 6px; }
.envelope__back {
  inset: 0;
  background: linear-gradient(180deg, #efd4cf, #f4dfd9);
  box-shadow: var(--shadow);
}
.envelope__letter {
  left: 12px;
  right: 12px;
  top: 8px;
  height: 112px;
  z-index: 2;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(180deg, transparent 0 17px, rgba(181, 118, 127, 0.12) 17px 18px),
    var(--paper);
  border-radius: 4px !important;
  box-shadow: 0 1px 4px rgba(120, 62, 70, 0.12);
}
.envelope__letter span {
  font: italic 500 54px/1 var(--serif);
  color: var(--wine);
  opacity: 0;
}
.envelope__front {
  inset: 0;
  z-index: 3;
  background: linear-gradient(170deg, #f8e6e0, #f3dad4);
  clip-path: polygon(0 32%, 50% 70%, 100% 32%, 100% 100%, 0 100%);
}
.envelope__flap {
  left: 0;
  right: 0;
  top: 0;
  height: 76%;
  z-index: 4;
  background: linear-gradient(180deg, #ecc9c4, #e8c0bc);
  clip-path: polygon(0 0, 100% 0, 50% 88%);
  transform-origin: 50% 0;
  border-radius: 6px 6px 0 0;
}
.envelope__seal {
  left: 50%;
  top: 54%;
  z-index: 5;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  display: grid;
  place-items: center;
  border-radius: 50% !important;
  background: radial-gradient(circle at 35% 30%, #cf8f97, var(--wine));
  box-shadow: 0 4px 10px -3px rgba(139, 76, 88, 0.6), inset 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.envelope__seal svg { width: 15px; height: 15px; fill: #fbe9e6; }

.envelope--open { margin-top: 92px; }
.envelope--open .envelope__flap { animation: flap-open 0.9s var(--ease) 0.5s forwards; }
.envelope--open .envelope__seal { animation: seal-off 0.5s ease 0.3s forwards; }
.envelope--open .envelope__letter { animation: letter-up 1s var(--ease) 1.1s forwards; }
.envelope--open .envelope__letter span { animation: fade-in 0.8s ease 1.6s forwards; }
@keyframes flap-open {
  0% { transform: rotateX(0); z-index: 4; }
  49% { z-index: 4; }
  50% { z-index: 1; }
  100% { transform: rotateX(180deg); z-index: 1; }
}
@keyframes seal-off { to { opacity: 0; transform: scale(0.6); } }
@keyframes letter-up { to { transform: translateY(-50px); } }
@keyframes fade-in { to { opacity: 1; } }

.orb {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 10px auto 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffaf6, var(--blush) 70%);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}
.orb--luna { background: radial-gradient(circle at 35% 30%, #fffaf8, #ead7dc 72%); }
.orb--sol { background: radial-gradient(circle at 35% 30%, #fffaf3, #f6dccd 72%); }
.orb__halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  animation: halo 3.6s ease-out infinite;
}
.orb__icon { width: 30px; height: 30px; color: var(--rose-deep); }
.orb__icon--heart { fill: var(--rose-deep); animation: beat 2.4s ease-in-out infinite; }
@keyframes halo {
  0% { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.14); }
  24% { transform: scale(1); }
  36% { transform: scale(1.1); }
  48% { transform: scale(1); }
}

.road {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 70px;
  margin: 18px auto 4px;
}
.road svg { width: 100%; height: 60px; overflow: visible; }
.road path {
  fill: none;
  stroke: var(--rose);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1.2 3;
}
.road__heart {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  color: var(--wine);
  animation: travel 7s ease-in-out infinite;
}
.road__heart svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes travel {
  0% { transform: translate(-4px, 34px) rotate(-10deg); }
  25% { transform: translate(70px, 12px) rotate(6deg); }
  50% { transform: translate(150px, 38px) rotate(-4deg); }
  75% { transform: translate(225px, 16px) rotate(6deg); }
  100% { transform: translate(280px, 18px) rotate(0); }
}

.seal-float {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6979e, var(--wine));
  box-shadow: 0 16px 30px -14px rgba(139, 76, 88, 0.7);
  animation: rise 0.95s var(--ease) forwards, float 6s ease-in-out 1s infinite;
}
.seal-float svg { width: 24px; height: 24px; fill: #fbe9e6; animation: beat 2.6s ease-in-out infinite; }

.units {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 330px;
  margin: 6px 0;
}
.units__cell {
  padding: 14px 0 10px;
  border-radius: 18px;
  background: rgba(255, 250, 246, 0.9);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}
.units__cell b {
  display: block;
  font: 500 34px/1 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}
.units__cell span {
  display: block;
  margin-top: 6px;
  font: 500 9.5px/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.crest {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
}
.crest__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.crest__ring circle {
  fill: none;
  stroke: var(--rose);
  stroke-width: 1.2;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw 1.8s var(--ease) 0.3s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.crest__heart {
  width: 40px;
  height: 40px;
  fill: var(--wine);
  transform: scale(0);
  animation: pop-in 0.8s var(--spring) 1s forwards, beat 2.6s ease-in-out 2s infinite;
}
@keyframes pop-in { to { transform: scale(1); } }

/* ---------- 6. ACERTIJO Y REVELACIÓN ---------- */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin-top: 6px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 12px 18px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 250, 246, 0.92);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  font: 400 15.5px/1.35 var(--sans);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.25s var(--spring), opacity 0.4s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.choice:active { transform: scale(0.98); }
.choice__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.choice__mark svg { width: 12px; height: 12px; fill: transparent; stroke: var(--rose); stroke-width: 2; transition: fill 0.3s ease; }
.choice[disabled] { opacity: 0.4; cursor: default; }
.choice[disabled] span:last-child { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.choice.is-right,
.choice.is-right[disabled] {
  opacity: 1;
  background: linear-gradient(120deg, #fbeae6, #f6dad6);
  box-shadow: inset 0 0 0 1px rgba(181, 118, 127, 0.5), 0 14px 30px -16px rgba(181, 118, 127, 0.7);
  transform: scale(1.02);
}
.choice.is-right span:last-child { text-decoration: none; }
.choice.is-right .choice__mark { background: var(--wine); box-shadow: none; }
.choice.is-right .choice__mark svg { fill: #fbe9e6; stroke: none; }
.is-wrong { animation: shake 0.5s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.guess {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}
.guess__input {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 400 17px/1 var(--sans);
  text-align: center;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.guess__input:focus { box-shadow: inset 0 0 0 1.5px var(--rose-deep), 0 0 0 5px rgba(214, 163, 166, 0.2); }

.feedback {
  min-height: 1.4em;
  margin: 0;
  font: italic 400 18px/1.35 var(--serif);
  color: var(--rose-deep);
  opacity: 0;
}
.feedback.is-shown { animation: rise 0.6s var(--ease) forwards; }

.hint {
  max-width: 320px;
  margin: 0;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(245, 227, 222, 0.7);
  font: italic 400 17px/1.4 var(--serif);
  color: var(--wine);
}
.hint.is-shown { animation: rise 0.7s var(--ease) both; }

.burst-seal {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 8px auto 2px;
}
.burst-seal__half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 70% 35%, #d6979e, var(--wine) 75%);
  box-shadow: 0 16px 30px -14px rgba(139, 76, 88, 0.7);
  animation: split-l 1s var(--ease) 0.35s forwards;
}
.burst-seal__half--l { left: 0; border-radius: 58px 0 0 58px; }
.burst-seal__half--r {
  right: 0;
  border-radius: 0 58px 58px 0;
  background: radial-gradient(circle at 0% 35%, #d6979e, var(--wine) 75%);
  animation-name: split-r;
}
.burst-seal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fbe9e6' d='M12 20.6c-.3 0-.6-.1-.8-.3C7.4 17.2 2.6 13.4 2.6 8.9 2.6 6 4.8 3.8 7.5 3.8c1.8 0 3.4 1 4.5 2.5 1.1-1.5 2.7-2.5 4.5-2.5 2.7 0 4.9 2.2 4.9 5.1 0 4.5-4.8 8.3-8.6 11.4-.2.2-.5.3-.8.3z'/%3E%3C/svg%3E") center / 38px no-repeat;
  animation: seal-off 0.35s ease 0.3s forwards;
}
.burst-seal__glow {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 214, 208, 0.95), rgba(246, 214, 208, 0) 65%);
  opacity: 0;
  animation: glow 1.6s ease-out 0.4s forwards;
}
@keyframes split-l { to { transform: translate(-70px, 10px) rotate(-28deg); opacity: 0; } }
@keyframes split-r { to { transform: translate(70px, 10px) rotate(28deg); opacity: 0; } }
@keyframes glow {
  0% { opacity: 0; transform: scale(0.4); }
  40% { opacity: 1; }
  100% { opacity: 0.55; transform: scale(1.15); }
}

.title--reveal {
  margin-top: -64px;
  font-style: italic;
  font-size: clamp(36px, 10.5vw, 46px);
  color: var(--wine);
}
.title--reveal .lt {
  display: inline-block;
  opacity: 0;
  animation: letter 0.9s var(--ease) forwards;
  animation-delay: calc(900ms + var(--i) * 45ms);
}
@keyframes letter {
  from { opacity: 0; transform: translateY(18px) rotate(4deg); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.ornament--late,
.lead--late,
.actions--late { opacity: 0; animation: rise 0.9s var(--ease) forwards; }
.ornament--late { animation-delay: 1.9s; }
.lead--late { animation-delay: 2.1s; }
.actions--late { animation-delay: 2.4s; }

/* ---------- 7. ESPERA, REGALO, TARJETA, FINAL ---------- */
.ring {
  --p: 0;
  position: relative;
  width: 188px;
  height: 188px;
  margin: 2px auto;
  animation: rise 0.95s var(--ease) forwards, breathe 5s ease-in-out 1s infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.ring::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffcf9, var(--blush) 80%);
  box-shadow: var(--shadow);
}
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--line); stroke-width: 2.4; }
.ring__bar {
  fill: none;
  stroke: var(--rose-deep);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p) * 100);
  transition: stroke-dashoffset 1s linear;
}
.ring__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.ring__time {
  font: 500 40px/1 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}
.ring__label {
  font: 500 9.5px/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.ring__orbit {
  position: absolute;
  inset: 0;
  transform: rotate(calc(var(--p) * 360deg));
  transition: transform 1s linear;
  pointer-events: none;
}
.ring__orbit svg {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  fill: var(--wine);
  filter: drop-shadow(0 2px 4px rgba(139, 76, 88, 0.4));
}

/* Comodín */
.wildcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 2px;
}
.btn--wildcard {
  overflow: hidden;
  background: linear-gradient(120deg, #f6dcd7, #fdf1ea 48%, #f3d4d0);
  color: var(--wine);
  box-shadow: inset 0 0 0 1px rgba(181, 118, 127, 0.38), 0 14px 28px -16px rgba(181, 118, 127, 0.75);
}
.btn--wildcard span:last-child { position: relative; }
.wildcard__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  transform: skewX(-18deg);
  animation: shine 4.2s ease-in-out 1.5s infinite;
}
@keyframes shine {
  0% { left: -40%; }
  35%, 100% { left: 130%; }
}
.wildcard__note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 400 12px/1.4 var(--sans);
  color: var(--muted);
}
.wildcard__note svg { width: 9px; height: 9px; fill: var(--rose); }

/* Cajita de regalo */
.giftbox {
  position: relative;
  width: 180px;
  height: 172px;
  margin: 10px auto 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.giftbox > span { position: absolute; left: 50%; display: block; }
.giftbox__glow {
  bottom: -6px;
  width: 220px;
  height: 220px;
  margin-left: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 210, 204, 0.85), rgba(246, 210, 204, 0) 62%);
  animation: glow-pulse 3s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}
.giftbox__box {
  bottom: 14px;
  width: 124px;
  height: 92px;
  margin-left: -62px;
  border-radius: 6px 6px 12px 12px;
  background: linear-gradient(180deg, #f2d4cf, #e9c3be);
  box-shadow: var(--shadow), inset 0 -10px 18px -10px rgba(139, 76, 88, 0.25);
}
.giftbox__ribbon {
  bottom: 14px;
  width: 20px;
  height: 92px;
  margin-left: -10px;
  background: linear-gradient(90deg, #a3606b, #b7737d 50%, #a3606b);
  transition: opacity 0.4s ease;
}
.giftbox__lid {
  bottom: 102px;
  width: 140px;
  height: 30px;
  margin-left: -70px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f7e0dc, #eccbc6);
  box-shadow: 0 8px 14px -8px rgba(139, 76, 88, 0.45);
  transform-origin: 30% 100%;
  animation: lid-wiggle 3.6s ease-in-out 1.6s infinite;
}
.giftbox__lid::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 20px;
  height: 100%;
  margin-left: -10px;
  background: linear-gradient(90deg, #a3606b, #b7737d 50%, #a3606b);
}
.giftbox__bow {
  position: absolute;
  left: 50%;
  top: -24px;
  width: 0;
  height: 0;
}
.giftbox__bow i {
  position: absolute;
  top: 0;
  width: 34px;
  height: 26px;
  border: 5px solid #ad6973;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.giftbox__bow i:first-child { right: 0; transform: rotate(-24deg); transform-origin: 100% 100%; }
.giftbox__bow i:last-child { left: 0; transform: rotate(24deg); transform-origin: 0 100%; }
.giftbox__bow::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 14px;
  width: 16px;
  height: 14px;
  border-radius: 6px;
  background: var(--wine);
}
@keyframes lid-wiggle {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-3deg) translateY(-3px); }
  90% { transform: rotate(2deg) translateY(-1px); }
  94% { transform: rotate(-1deg); }
}
.giftbox:active .giftbox__box { transform: scale(0.98); }
.giftbox.is-opening .giftbox__lid { animation: lid-off 0.85s var(--ease) forwards; }
.giftbox.is-opening .giftbox__glow { animation: glow-flash 0.9s ease-out forwards; }
.giftbox.is-opening .giftbox__ribbon { opacity: 0; }
@keyframes lid-off {
  to { transform: translate(-30px, -110px) rotate(-38deg); opacity: 0; }
}
@keyframes glow-flash {
  50% { transform: scale(1.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Tarjeta del regalo */
.gift-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 26px 30px;
  border-radius: 30px;
  background: linear-gradient(180deg, #fffcf9, var(--paper));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}
.gift-card::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 23px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.gift-card__corner {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6979e, var(--wine));
  box-shadow: 0 8px 16px -8px rgba(139, 76, 88, 0.8);
}
.gift-card__corner svg { width: 12px; height: 12px; fill: #fbe9e6; }
.gift-card .title { font-size: clamp(30px, 8.4vw, 36px); }
.gift-card__how {
  margin: 4px 0 0;
  font: 500 25px/1.15 var(--hand);
  color: var(--rose-deep);
  transform: rotate(-2deg);
}
.screen--grand .gift-card { box-shadow: 0 30px 70px -30px rgba(139, 76, 88, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.8); }
.screen--grand .giftbox__glow { background: radial-gradient(circle, rgba(240, 196, 170, 0.9), rgba(240, 196, 170, 0) 62%); }

/* Final */
.screen--final { overflow: hidden; }
.rising {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.rising span {
  position: absolute;
  bottom: -30px;
  left: calc(var(--i) * 10% + 3%);
  width: 14px;
  height: 14px;
  color: rgba(181, 118, 127, 0.4);
  animation: drift calc(9s + var(--i) * 0.7s) linear infinite;
  animation-delay: calc(var(--i) * -1.3s);
}
.rising svg { width: 100%; height: 100%; fill: currentColor; }

.letter {
  width: 100%;
  max-width: 360px;
  padding: 30px 26px 26px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(180deg, transparent 0 27px, rgba(181, 118, 127, 0.1) 27px 28px),
    linear-gradient(180deg, #fffcf9, var(--paper));
  box-shadow: var(--shadow);
  text-align: left;
  transform: rotate(-0.6deg);
}
.letter .prose { max-width: none; font-size: 16px; line-height: 1.75; }
.signature {
  margin: 18px 0 0;
  font: 500 26px/1.15 var(--hand);
  color: var(--wine);
  text-align: right;
}

.chapters {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 300px;
}
.chapters li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font: italic 400 19px/1.25 var(--serif);
  color: var(--ink);
  text-align: left;
}
.chapters__num {
  flex: none;
  width: 30px;
  font: 500 11px/1 var(--sans);
  letter-spacing: 0.16em;
  color: var(--rose-deep);
  font-style: normal;
}

/* ---------- 8. BARRA, PROGRESO, HOJA, MODAL, EFECTOS ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  animation: fade-in 0.8s ease both;
}
.topbar__left { display: flex; align-items: center; gap: 10px; }
.icon-btn--back { width: 38px; height: 38px; }
.icon-btn--back svg { width: 19px; height: 19px; }
.brand { display: flex; align-items: center; gap: 7px; }
.brand__name { font: italic 500 21px/1 var(--serif); color: var(--ink); }
.brand__heart { width: 11px; height: 11px; fill: var(--rose-deep); animation: beat 3s ease-in-out infinite; }
.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 250, 246, 0.85);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.25s var(--spring);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn__dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose-deep);
  box-shadow: 0 0 0 2px var(--paper);
}

.progress { margin-top: 10px; animation: fade-in 0.8s ease both; }
.progress__days { display: flex; justify-content: center; gap: 16px; }
.progress__day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.progress__label {
  font: 500 9px/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.progress__hearts { display: flex; gap: 3px; }
.ph { display: block; width: 12px; height: 12px; }
.ph svg { display: block; width: 100%; height: 100%; fill: transparent; stroke: var(--line-strong); stroke-width: 1.8; transition: fill 0.5s ease; }
.ph--done svg { fill: var(--rose-deep); stroke: var(--rose-deep); stroke-width: 0.6; }
.ph--current svg { fill: var(--blush-2); stroke: var(--rose-deep); stroke-width: 1.6; animation: beat 2.4s ease-in-out infinite; transform-origin: center; }
.progress__caption {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 10px 0 0;
  font: 400 12px/1.4 var(--sans);
  color: var(--muted);
  text-align: center;
}
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--rose); }

/* Hoja inferior */
.sheet,
.modal { position: fixed; inset: 0; z-index: 60; }
.sheet__backdrop,
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74, 52, 55, 0.26);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sheet.is-open .sheet__backdrop,
.modal.is-open .modal__backdrop { opacity: 1; }
.sheet__panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px calc(var(--safe-r) + 22px) calc(var(--safe-b) + 22px) calc(var(--safe-l) + 22px);
  border-radius: 30px 30px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 50px -20px rgba(120, 62, 70, 0.35);
  transform: translate(-50%, 100%);
  transition: transform 0.45s var(--ease);
}
.sheet.is-open .sheet__panel { transform: translate(-50%, 0); }
.sheet__grip { width: 38px; height: 4px; margin: 0 auto 18px; border-radius: 4px; background: var(--line-strong); }
.sheet__body { display: flex; flex-direction: column; gap: 14px; }
.sheet__body > .title { text-align: center; }
.sheet__sub { margin: -6px 0 4px; text-align: center; font-size: 13px; color: var(--muted); }
.sheet__close { align-self: center; margin-top: 4px; }

.memories { list-style: none; margin: 0; padding: 0; }
.mem {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.mem__num {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blush);
  font: 500 12px/1 var(--sans);
  color: var(--wine);
}
.mem__title { flex: 1; font: 400 15px/1.3 var(--sans); color: var(--ink); }
.mem__title small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.mem__heart { flex: none; width: 12px; height: 12px; fill: var(--rose); }
.mem--cat { padding-top: 18px; border-bottom: 0; }
.mem--cat .mem__num { background: none; box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 10px; letter-spacing: 0.08em; }
.mem--cat .mem__title { font: italic 500 20px/1.2 var(--serif); color: var(--wine); }
.mem--future .mem__title { color: var(--muted); letter-spacing: 0.2em; }
.mem--cat.mem--future .mem__title { color: var(--muted); letter-spacing: 0; }
.mem--future .mem__num { background: rgba(245, 227, 222, 0.5); color: var(--muted); }

.soon {
  padding: 14px 16px;
  border-radius: 20px;
  background: #f8efe3;
  box-shadow: inset 0 0 0 1px rgba(201, 165, 122, 0.35);
}
.soon__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.soon__title { margin: 4px 0 0; font: italic 500 20px/1.2 var(--serif); }
.soon .eyebrow { color: #8d6a43; }


/* Modal */
.modal { display: grid; place-items: center; padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px); }
.modal__panel {
  position: relative;
  width: min(100%, 380px);
  max-height: 100%;
  overflow-y: auto;
  padding: 18px;
  border-radius: 32px;
  background: var(--bg);
  box-shadow: 0 40px 80px -30px rgba(74, 52, 55, 0.55);
  opacity: 0;
  transform: translateY(14px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.45s var(--spring);
}
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal__actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; }

.ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 18px;
  border-radius: 22px;
  background: linear-gradient(160deg, #fffcf9, #fbede8);
  box-shadow: inset 0 0 0 1px rgba(181, 118, 127, 0.3);
  text-align: center;
}
.ticket::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 17px;
  border: 1px dashed rgba(181, 118, 127, 0.3);
  pointer-events: none;
}
.ticket__top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font: 500 9.5px/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.ticket__heart { position: relative; width: 70px; height: 70px; display: grid; place-items: center; margin: 4px 0; }
.ticket__heart svg { width: 40px; height: 40px; fill: var(--wine); animation: beat 2.2s ease-in-out infinite; }
.ticket__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(181, 118, 127, 0.4);
  animation: halo 2.6s ease-out infinite;
}
.ticket__perf {
  position: relative;
  width: calc(100% + 44px);
  height: 1px;
  margin: 6px 0 0;
  background-image: linear-gradient(90deg, rgba(181, 118, 127, 0.45) 50%, transparent 50%);
  background-size: 8px 1px;
}
.ticket__perf::before,
.ticket__perf::after {
  content: '';
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(181, 118, 127, 0.3);
}
.ticket__perf::before { left: -10px; clip-path: inset(0 0 0 50%); }
.ticket__perf::after { right: -10px; clip-path: inset(0 50% 0 0); }
.ticket--plain { background: linear-gradient(160deg, #fffcf9, #fbf2ee); }
.ticket--plain::before { display: none; }
.ticket__fine { margin: 2px 0 0; font: 400 11px/1.4 var(--sans); letter-spacing: 0.06em; color: var(--muted); }

/* Celebración del comodín */
.wild-cel {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: auto;
}
.wild-cel__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(253, 236, 230, 0.96), rgba(244, 214, 210, 0.92) 60%, rgba(214, 163, 166, 0.85));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.wild-cel__card {
  position: relative;
  overflow: hidden;
  width: min(100%, 330px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 24px 30px;
  border-radius: 30px;
  background: linear-gradient(160deg, #fffcf9, #fbeee9);
  box-shadow: 0 40px 80px -30px rgba(139, 76, 88, 0.6), inset 0 0 0 1px rgba(181, 118, 127, 0.3);
  text-align: center;
  opacity: 0;
  transform: scale(0.7) rotate(-4deg);
  transition: opacity 0.4s ease, transform 0.7s var(--spring);
}
.wild-cel.is-in .wild-cel__veil { opacity: 1; }
.wild-cel.is-in .wild-cel__card { opacity: 1; transform: none; }
.wild-cel.is-out .wild-cel__card { opacity: 0; transform: translateY(-20px) scale(0.96); }
.wild-cel__heart { width: 64px; height: 64px; display: grid; place-items: center; }
.wild-cel__heart svg { width: 54px; height: 54px; fill: var(--wine); }
.wild-cel.is-in .wild-cel__heart svg { animation: heart-thump 0.9s var(--spring) 0.25s both, beat 2.4s ease-in-out 1.4s infinite; }
@keyframes heart-thump {
  0% { transform: scale(0.2); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.wild-cel__stamp {
  position: absolute;
  top: 16px;
  right: 14px;
  padding: 6px 10px;
  border: 1.5px solid rgba(139, 76, 88, 0.55);
  border-radius: 10px;
  font: 600 20px/1 var(--hand);
  color: var(--wine);
  opacity: 0;
  transform: scale(2.2) rotate(-14deg);
}
.wild-cel.is-in .wild-cel__stamp { animation: stamp 0.5s cubic-bezier(0.5, 0, 0.75, 0) 1.1s forwards; }
@keyframes stamp {
  to { opacity: 0.85; transform: scale(1) rotate(-12deg); }
}
.wild-cel__shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -50%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: skewX(-18deg);
}
.wild-cel.is-in .wild-cel__shine { animation: shine 1.6s ease-in-out 0.6s forwards; }

/* Efectos de corazones */
.fx { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.fx .wild-cel { pointer-events: auto; }
.fx-heart,
.fx-spark {
  position: fixed;
  width: 18px;
  height: 18px;
  color: var(--c);
  transform: translate(-50%, -50%) scale(0);
  animation: pop var(--t, 1.1s) cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}
.fx-spark { width: 14px; height: 14px; color: var(--gold); }
.fx-heart svg,
.fx-spark svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes pop {
  0% { transform: translate(-50%, -50%) scale(0) rotate(0); opacity: 1; }
  25% { opacity: 1; }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--s)) rotate(var(--r));
    opacity: 0;
  }
}
.fx-rain {
  position: fixed;
  top: -40px;
  width: calc(20px * var(--s));
  height: calc(20px * var(--s));
  color: var(--c);
  opacity: 0;
  animation: rain var(--t) ease-in var(--delay) forwards;
}
.fx-rain svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes rain {
  0% { transform: translate(0, 0) rotate(-20deg); opacity: 0; }
  10% { opacity: 0.95; }
  100% { transform: translate(var(--sway), 112vh) rotate(25deg); opacity: 0.2; }
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 14px);
  z-index: 95;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.96);
  box-shadow: 0 18px 36px -18px rgba(120, 62, 70, 0.5), inset 0 0 0 1px var(--line);
  font: 400 14px/1.3 var(--sans);
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -16px);
  transition: opacity 0.35s ease, transform 0.5s var(--spring);
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }

.storage-warning {
  margin: 12px auto 0;
  max-width: 340px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f8efe3;
  font-size: 12.5px;
  line-height: 1.45;
  color: #8d6a43;
  text-align: center;
}

/* ---------- 9. MODO PRUEBA (solo local) ---------- */
body.is-test .app { padding-top: calc(var(--safe-t) + 34px); }
.devbar { font: 400 12px/1.3 ui-monospace, Menlo, monospace; }
.devbar__ribbon {
  position: fixed;
  top: var(--safe-t);
  left: 0;
  right: 0;
  z-index: 70;
  padding: 4px;
  background: repeating-linear-gradient(45deg, #fff1d6 0 10px, #ffe8bd 10px 20px);
  color: #7a5a2f;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.devbar__toggle {
  position: fixed;
  left: calc(var(--safe-l) + 12px);
  bottom: calc(var(--safe-b) + 12px);
  z-index: 75;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #fff1d6;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35);
  font-size: 20px;
}
.devbar__panel {
  position: fixed;
  left: calc(var(--safe-l) + 12px);
  right: calc(var(--safe-r) + 12px);
  bottom: calc(var(--safe-b) + 66px);
  z-index: 75;
  max-width: 440px;
  max-height: 70vh;
  overflow: auto;
  padding: 12px;
  border-radius: 16px;
  background: #fffaf0;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.45), inset 0 0 0 1px #ecd9b0;
  color: #4a3a22;
}
.devbar__clock { margin: 0 0 10px; }
.devbar__group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.devbar__group button,
.devbar__jump select {
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: #f6e7c8;
  font: inherit;
  color: inherit;
}
.devbar__group button.danger { background: #f6d2c8; }
.devbar__group a { color: #7a5a2f; }
.devbar__jump { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.devbar__jump select { flex: 1; min-width: 0; font-size: 16px; }

/* Inspector del funcionamiento interno (solo modo prueba) */
.inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 72;
  width: min(100vw, 430px);
  display: none;
  flex-direction: column;
  background: #fffdf8;
  box-shadow: -18px 0 40px -24px rgba(0, 0, 0, 0.35), inset 1px 0 0 #ecd9b0;
  font: 400 13px/1.45 -apple-system, 'Helvetica Neue', sans-serif;
  color: #3d3326;
}
.inspector.is-open { display: flex; }
.inspector__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 30px) 16px 10px;
  border-bottom: 1px solid #f0e3c4;
  font-size: 15px;
}
.inspector__head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f6e7c8;
  cursor: pointer;
}
.inspector__body { flex: 1; overflow-y: auto; padding: 12px 14px calc(var(--safe-b) + 80px); -webkit-overflow-scrolling: touch; }
.i-card { margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px #f0e3c4; }
.i-card--now { background: #fff8ea; box-shadow: inset 0 0 0 1.5px #e5c27a; }
.i-label { margin: 0 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #9a7b45; }
.i-big { margin: 0; font-size: 16px; font-weight: 600; }
.i-small { margin: 4px 0 0; color: #5d5243; }
.i-why { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px #f0e3c4; }
.i-rules { margin: 0; padding-left: 18px; color: #5d5243; }
.i-rules li + li { margin-top: 4px; }
.i-chip {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1ece2;
  font-size: 11px;
  font-weight: 600;
  color: #7a6d5a;
}
.i-chip--done { background: #e3f1e4; color: #2f6b3a; }
.i-chip--now { background: #fde7c0; color: #8a5a10; }
.i-steps { list-style: none; margin: 0; padding: 0; }
.i-day { margin: 12px 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #b5767f; }
.i-day:first-child { margin-top: 2px; }
.i-step { display: flex; gap: 10px; padding: 7px 6px; border-radius: 8px; }
.i-step.is-cur { background: #fff3db; box-shadow: inset 3px 0 0 #e5a93a; }
.i-step.is-done .i-step__name { color: #8a8070; }
.i-step__n { flex: none; width: 22px; color: #b0a38c; font-variant-numeric: tabular-nums; text-align: right; }
.i-step__name { margin: 0; font-weight: 500; }
.i-step__detail { margin: 2px 0 0; font-size: 12px; color: #7a6d5a; }
.inspector code { font: 11px ui-monospace, Menlo, monospace; color: #9a7b45; }
.inspector details summary { cursor: pointer; margin-top: 6px; color: #8a5a10; }
.inspector pre {
  max-height: 340px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #2f2a22;
  color: #f5ead2;
  font: 11px/1.45 ui-monospace, Menlo, monospace;
}
@media (min-width: 1000px) {
  body.has-inspector .app { margin-left: max(20px, calc((100vw - 430px - 460px) / 2)); }
  body.has-inspector .devbar__ribbon { right: 430px; }
}

.inspector-fab {
  position: fixed;
  left: calc(var(--safe-l) + 66px);
  bottom: calc(var(--safe-b) + 12px);
  z-index: 75;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #fff1d6;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35);
  font-size: 19px;
  cursor: pointer;
}
body.has-inspector .inspector-fab { background: #fde7c0; box-shadow: 0 0 0 2px #e5a93a, 0 6px 18px -6px rgba(0, 0, 0, 0.35); }

/* Simulación (solo local) */
.sim-badge {
  position: fixed;
  right: calc(var(--safe-r) + 10px);
  bottom: calc(var(--safe-b) + 8px);
  z-index: 70;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.85);
  box-shadow: inset 0 0 0 1px var(--line);
  font: 400 11px/1.3 var(--sans);
  color: var(--muted);
}
.sim-badge a { color: var(--rose-deep); }
.sim-skip {
  margin-top: 4px;
  padding: 8px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font: 400 12.5px/1.3 var(--sans);
  color: var(--rose-deep);
  cursor: pointer;
}

/* ---------- 10. MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .ambient { display: none; }
}

@media (min-height: 760px) {
  .screen { gap: 20px; }
}
