/* ==========================================================
   Invitación — estilos responsivos (mobile-first)
   Celular  : < 600px   → una columna
   Tablet   : 600–899px → galería 3 columnas, formulario más ancho
   iPad horiz./PC: ≥ 900px → portada en dos columnas, detalles y
                    cuenta regresiva lado a lado
   Pantallas grandes: ≥ 1280px → tamaños más generosos
   ========================================================== */
:root {
  --night: #0B2E59;
  --night-2: #15508A;
  --ice: #DDF3FC;
  --ice-2: #A9DDF3;
  --frost: #F3FAFE;
  --line: #CDE9F6;
  --field: #B4DAEE;
  --text: #0C2A4D;
  --muted: #42627F;
  --accent: #1A6FB0;
  --accent-dark: #145A92;
  --aurora: #7CD6E8;
  --lilac: #9B82E6;
  --radius: 20px;
  --maxw: 1120px;
  --gutter: clamp(18px, 5vw, 48px);
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--frost);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; }
.app { position: relative; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

h1, h2 { font-family: var(--display); font-weight: 600; margin: 0; color: var(--night); line-height: 1.1; text-wrap: balance; }
h2 { font-size: clamp(24px, 2.6vw + 14px, 36px); text-align: center; }
.muted { color: var(--muted); font-size: 14px; font-weight: 400; }
.center { text-align: center; }
.center-text { text-align: center; line-height: 1.55; color: #1F4A70; margin: 10px 0 0; }
.subtitle { text-align: center; color: var(--muted); margin: 6px 0 clamp(18px, 3vw, 32px); }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--night);
  color: #fff;
  padding: max(48px, env(safe-area-inset-top)) var(--gutter) 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  text-align: center;
  min-height: 92vh;
  min-height: 92svh;
  padding-bottom: 96px;
}
.eyebrow { margin: 0; font-family: var(--display); font-size: clamp(20px, 1.6vw + 14px, 28px); font-weight: 600; letter-spacing: .01em; line-height: 1.15; text-transform: none; color: var(--ice); position: relative; max-width: 22em; text-shadow: 0 0 18px rgba(124,214,232,.45); }
.hero-photo {
  position: relative;
  width: clamp(180px, 52vw, 240px); aspect-ratio: 1; border-radius: 50%;
  border: 4px solid var(--ice);
  box-shadow: 0 0 0 12px rgba(221,243,252,.14), 0 0 60px rgba(143,211,238,.35);
  background: var(--night-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--ice-2); font-size: 13px; flex: none;
}
.hero-photo.has-img span { display: none; }
.hero-name { position: relative; color: #fff; font-size: clamp(40px, 6vw + 20px, 80px); line-height: 1.02; overflow-wrap: anywhere; }
.hero-age { position: relative; display: flex; align-items: center; gap: 14px; font-family: var(--display); font-size: clamp(20px, 1vw + 16px, 26px); color: var(--ice); }
.age-badge {
  width: clamp(64px, 4vw + 50px, 84px); aspect-ratio: 1; border-radius: 50%;
  background: var(--ice); color: var(--night);
  font-size: clamp(40px, 2vw + 32px, 52px); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  animation: pulse 2.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(221,243,252,.5); } 50% { box-shadow: 0 0 0 14px rgba(221,243,252,0); } }
.hero-msg { position: relative; margin: 0; max-width: 32ch; line-height: 1.55; color: var(--ice); font-size: clamp(16px, .5vw + 14px, 19px); text-wrap: pretty; }
.scroll-cue { position: relative; color: var(--ice-2); width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* Nieve */
.snow { position: absolute; inset: 0; pointer-events: none; }
.flake { position: absolute; top: -30px; color: #fff; opacity: .7; animation: fall linear infinite; }
.flake svg { display: block; width: 100%; height: 100%; }
@keyframes fall {
  0% { transform: translate3d(0, -30px, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift, 20px), 110vh, 0) rotate(240deg); }
}

/* ---------- Secciones ---------- */
.section { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter) 8px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.details { margin-top: 16px; padding: clamp(18px, 2.5vw, 28px); display: flex; flex-direction: column; gap: 16px; }
.detail { display: flex; gap: 14px; align-items: flex-start; }
.detail > div { display: flex; flex-direction: column; gap: 2px; }
.detail strong { font-size: clamp(16px, .4vw + 15px, 19px); }
.icon { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--ice); color: var(--night); display: flex; align-items: center; justify-content: center; }
.icon svg { width: 22px; height: 22px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Botones */
.btn {
  min-height: 52px; width: 100%;
  border-radius: 16px; border: 0;
  font: inherit; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; cursor: pointer; padding: 0 20px; text-align: center;
  transition: transform .12s ease, background-color .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; font-size: 17px; min-height: 56px; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-outline { background: transparent; color: var(--night); border: 1.5px solid var(--night); }
.btn-waze { background: #33CCFF; color: #0A2540; }
.btn-link { background: none; color: var(--accent); min-height: 44px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent-dark); }
  .btn-outline:hover { background: var(--ice); }
  .btn-waze:hover { background: #1FB8EC; }
}

/* Cuenta regresiva */
.countdown { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.5vw, 14px); }
.countdown > div { background: var(--night); color: #fff; border-radius: 16px; padding: clamp(12px, 2vw, 22px) 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.countdown span { font-family: var(--display); font-size: clamp(26px, 2.5vw + 16px, 44px); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown small { font-size: clamp(12px, .3vw + 11px, 14px); color: var(--ice-2); font-weight: 600; }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2.5vw, 28px); }
.polaroid {
  margin: 0; padding: 8px 8px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  display: flex; flex-direction: column; gap: 8px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .25s ease, box-shadow .25s ease;
  text-align: left; font: inherit; color: inherit; width: 100%;
}
button.polaroid { cursor: zoom-in; }
@media (hover: hover) {
  .polaroid:hover { transform: rotate(0deg) scale(1.03); box-shadow: 0 14px 30px rgba(11,46,89,.12); }
}
.polaroid .ph { aspect-ratio: 1 / 1; border-radius: 12px; background: var(--ice) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.polaroid strong { font-family: var(--display); font-weight: 600; font-size: clamp(15px, .5vw + 13px, 18px); color: var(--night); padding: 0 4px; }
.polaroid .muted { font-size: 13px; padding: 0 4px; }
.reveal { opacity: 0; translate: 0 18px; transition: opacity .6s ease, translate .6s ease; }
.reveal.in { opacity: 1; translate: 0 0; }

/* Confirmación */
.rsvp-wrap { padding-top: clamp(44px, 6vw, 80px); }
.rsvp-card { max-width: 640px; margin: 0 auto; background: var(--ice); border-radius: 26px; padding: clamp(24px, 4vw, 44px) clamp(18px, 4vw, 44px); display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; }
form { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.field label, legend { font-size: 14px; font-weight: 700; padding: 0; }
legend { margin-bottom: 8px; }
input[type=text], input[type=tel], textarea {
  min-height: 50px; width: 100%;
  border: 1.5px solid var(--field); border-radius: 14px;
  padding: 12px 14px; font: inherit; font-size: 16px; /* 16px evita el zoom automático en iPhone */
  color: var(--text); background: #fff;
  -webkit-appearance: none; appearance: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,111,176,.2); }
input[aria-invalid=true] { border-color: #B3261E; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  min-height: 52px; border-radius: 14px; border: 1.5px solid var(--field);
  background: #fff; color: var(--night); padding: 6px 10px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 16px; cursor: pointer; transition: background-color .2s, color .2s;
}
.choice input:checked + label { background: var(--night); border-color: var(--night); color: #fff; }
.choice input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.counters { padding: 4px 16px; }
.counter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.counter + .counter { border-top: 1px solid #E1F0F8; }
.counter > div:first-child { display: flex; flex-direction: column; }
.stepper { display: flex; align-items: center; gap: 12px; flex: none; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--field); background: var(--frost); color: var(--night); font-size: 22px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.stepper button.plus { background: var(--night); border-color: var(--night); color: #fff; }
.stepper output { min-width: 24px; text-align: center; font-family: var(--display); font-size: 22px; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { margin: 0; color: #B3261E; font-weight: 700; font-size: 14px; }
.error:empty { display: none; }
.hint { margin: -6px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* Gracias */
.thanks { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 8px 0; }
.thanks:focus { outline: none; }
.thanks p { margin: 0; line-height: 1.55; color: #1F4A70; max-width: 46ch; }
.check { width: 96px; height: 96px; border-radius: 50%; background: var(--night); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px rgba(11,46,89,.1); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.thanks-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 6px; }

/* Pie */
.footer { padding: clamp(40px, 6vw, 72px) var(--gutter) 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #5FA9D3; text-align: center; }
.footer p { margin: 0; color: var(--muted); font-size: 14px; }
.footer .papas { font-family: var(--display); font-size: clamp(19px, 1vw + 15px, 24px); color: var(--night); }

/* Botón flotante */
.fab {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(380px, calc(100% - 32px)); min-height: 54px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 16px; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(26,111,176,.35);
  transition: opacity .25s, transform .25s; z-index: 5;
}
.fab.hide { opacity: 0; transform: translateX(-50%) translateY(20px); pointer-events: none; }

/* Visor de fotos */
dialog#lightbox { border: 0; padding: 0; background: transparent; width: min(92vw, 720px); max-height: 92vh; overflow: visible; }
dialog#lightbox::backdrop { background: rgba(6, 24, 48, .88); }
#lbImg { width: 100%; max-height: 80vh; object-fit: contain; border-radius: 18px; display: block; }
#lbCaption { color: #fff; text-align: center; font-family: var(--display); font-size: 18px; margin: 12px 0 0; }
.close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 28px; cursor: pointer; }

/* Aviso cuando no carga la información */
.load-error { max-width: 560px; margin: 24px auto; padding: 16px 20px; border-radius: 16px; background: #FDECEA; color: #8C1D18; font-weight: 700; text-align: center; }

/* ---------- Celulares pequeños (iPhone SE, Android compactos) ---------- */
@media (max-width: 359px) {
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { grid-template-columns: minmax(0, 1fr); }
  .stepper { gap: 8px; }
}

/* ---------- Teléfono horizontal / pantallas bajas ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 32px; padding-bottom: 32px; }
  .hero-photo { width: 150px; }
}

/* ---------- Tablet / iPad vertical (≥ 600px) ---------- */
@media (min-width: 600px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thanks-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-photo { width: clamp(220px, 34vw, 280px); }
  .hero { min-height: 80vh; min-height: 80svh; }
}

/* ---------- Detalles y cuenta regresiva lado a lado (≥ 860px) ---------- */
@media (min-width: 860px) {
  .info-grid {
    max-width: var(--maxw); margin: 0 auto;
    padding: 0 var(--gutter);
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 48px); align-items: stretch;
  }
  .info-grid > .section { padding-left: 0; padding-right: 0; display: flex; flex-direction: column; }
  .info-grid .details { flex: 1; }
  .countdown-section { justify-content: flex-start; }
  .countdown-section .countdown { flex: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .countdown-section .countdown > div { justify-content: center; }
}

/* ---------- iPad horizontal / computadora (≥ 900px) ---------- */
@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: auto minmax(0, 560px);
    grid-template-areas:
      "photo eyebrow"
      "photo crown"
      "photo name"
      "photo age"
      "photo msg"
      "cue   cue";
    justify-content: center; align-content: center;
    column-gap: clamp(48px, 6vw, 96px); row-gap: 16px;
    text-align: left;
    min-height: min(86vh, 820px);
    padding-top: 64px; padding-bottom: 40px;
  }
  .eyebrow { grid-area: eyebrow; align-self: end; max-width: none; }
  .hero-figure { grid-area: photo; align-self: center; }
  .hero-photo { width: clamp(280px, 28vw, 380px); }
  .crown { grid-area: crown; margin: 0; }
  .hero { padding-bottom: 110px; }
  .hero-name { grid-area: name; }
  .hero-age { grid-area: age; }
  .hero-msg { grid-area: msg; align-self: start; }
  .scroll-cue { grid-area: cue; justify-self: center; margin-top: 16px; }

  .fab { width: auto; padding: 0 32px; left: auto; right: 32px; transform: none; bottom: 32px; }
  .fab.hide { transform: translateY(20px); }
}

/* ---------- Pantallas grandes (≥ 1280px) ---------- */
@media (min-width: 1280px) {
  .gallery { gap: 32px; }
  .polaroid { padding: 10px 10px 16px; }
}

/* ==========================================================
   Temática de hielo y personajes
   ========================================================== */
.aurora {
  position: absolute; inset: -20% -10% auto; height: 80%; pointer-events: none;
  background:
    radial-gradient(40% 50% at 20% 30%, rgba(124,214,232,.28), transparent 70%),
    radial-gradient(35% 45% at 75% 20%, rgba(155,130,230,.30), transparent 70%),
    radial-gradient(30% 40% at 50% 60%, rgba(58,155,213,.18), transparent 70%);
  filter: blur(10px);
  animation: aurora 14s ease-in-out infinite alternate;
}
@keyframes aurora { to { transform: translateX(4%) scaleY(1.08); opacity: .8; } }
.icicles { position: absolute; top: 0; left: 0; width: 100%; height: clamp(22px, 3vw, 40px); pointer-events: none; }
.drift { position: absolute; left: 0; bottom: -1px; width: 100%; height: clamp(44px, 7vw, 90px); pointer-events: none; }
.scroll-cue { z-index: 1; }

.hero-figure { position: relative; display: inline-flex; }
.ch { display: block; overflow: visible; }
.ch-hero {
  position: absolute; width: clamp(78px, 22vw, 120px); aspect-ratio: 120 / 124;
  right: -14%; bottom: -10%;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.25));
}
.crown { position: relative; width: clamp(48px, 6vw, 64px); height: auto; margin-bottom: -10px; filter: drop-shadow(0 0 10px rgba(124,214,232,.6)); }
.hero-name { text-shadow: 0 0 28px rgba(124,214,232,.55); }

/* Destellos */
.sparkle { position: absolute; width: 14px; height: 14px; pointer-events: none; color: #fff; animation: twinkle 3s ease-in-out infinite; }
.sparkle svg { width: 100%; height: 100%; display: block; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: .95; transform: scale(1) rotate(45deg); } }

/* Títulos con copos a los lados */
.section > h2, .cd-head h2, .rsvp-card h2 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.section > h2::before, .section > h2::after, .rsvp-card #rsvpIntro h2::before, .rsvp-card #rsvpIntro h2::after {
  content: ""; width: 18px; height: 18px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7M9 4l3 2 3-2M9 20l3-2 3 2' fill='none' stroke='%233A9BD5' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Tarjetas escarchadas */
.card { box-shadow: 0 12px 32px rgba(58,155,213,.14); position: relative; }
.details::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 12' preserveAspectRatio='none'%3E%3Cpath d='M0 0H60V2L54 10 48 2 40 8 32 2 24 11 16 2 8 7 0 2Z' fill='%23DDF3FC'/%3E%3C/svg%3E") repeat-x;
  background-size: 60px 12px; border-radius: 0 0 6px 6px; pointer-events: none;
}
.countdown > div {
  background: linear-gradient(160deg, #15508A, #0B2E59 60%);
  border: 1px solid rgba(143,211,238,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px rgba(11,46,89,.2);
}

/* Pingüino junto a la cuenta regresiva */
.cd-head { position: relative; display: flex; justify-content: center; align-items: flex-end; }
.ch-pingu { position: absolute; right: 2%; bottom: -14px; width: clamp(64px, 14vw, 96px); aspect-ratio: 120 / 124; }
.ch-pingu .wave { transform-box: fill-box; transform-origin: 20% 90%; animation: wave 1.6s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg); } }
.countdown-section .countdown { position: relative; z-index: 1; }

/* Galería: cinta de hielo en cada foto */
.polaroid { position: relative; }
.polaroid::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 56px; height: 18px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(143,211,238,.55); border: 1px solid rgba(255,255,255,.7);
  border-radius: 3px; backdrop-filter: blur(2px); z-index: 1;
}

/* Búho en la confirmación */
.rsvp-card { position: relative; margin-top: 56px; border: 1px solid #C4E5F5; box-shadow: 0 16px 40px rgba(58,155,213,.18); }
.ch-owl { width: clamp(96px, 22vw, 120px); aspect-ratio: 120 / 124; margin: -92px auto -6px; }
.ch-owl .letter { transform-box: fill-box; transform-origin: center; animation: letter 3s ease-in-out infinite; }
@keyframes letter { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }

/* Conejita en el pie */
.ch-foot { width: 74px; aspect-ratio: 120 / 124; margin-bottom: 6px; }

/* Movimiento suave */
.bob { animation: bob-ch 3.2s ease-in-out infinite; }
.bob-slow { animation: bob-ch 4.2s ease-in-out infinite; }
@keyframes bob-ch { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.ch-hero .ear-l, .ch-hero .ear-r { transform-box: fill-box; transform-origin: 50% 100%; animation: ear 4s ease-in-out infinite; }
.ch-hero .ear-r { animation-delay: .3s; }
@keyframes ear { 0%, 85%, 100% { transform: rotate(0); } 90% { transform: rotate(-10deg); } 95% { transform: rotate(6deg); } }

/* Botón principal con brillo helado */
.btn-primary, .fab { background-image: linear-gradient(135deg, #2B86C8, #1A6FB0 55%, #14598F); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }

@media (max-width: 599px) {
  .ch-pingu { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aurora, .sparkle { animation: none !important; }
  .sparkle { display: none; }
}

/* ---------- Anfitriona, zorrito y foquita ---------- */
.host { display: flex; align-items: flex-end; gap: 12px; margin: 14px 0 -6px; }
.ch-princesa { width: clamp(84px, 20vw, 120px); aspect-ratio: 120 / 152; flex: none; }
.ch-princesa .arm-wave { transform-box: fill-box; transform-origin: 0% 100%; animation: wave 2.2s ease-in-out infinite; }
.bubble {
  position: relative; margin: 0 0 34px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 4px;
  font-weight: 700; color: var(--night); line-height: 1.4; font-size: clamp(14px, .4vw + 13px, 16px);
  box-shadow: 0 8px 20px rgba(58,155,213,.14);
}
.gallery-wrap { position: relative; }
.ch-zorro { position: absolute; right: -4px; top: -66px; width: clamp(62px, 9vw, 86px); aspect-ratio: 120 / 124; z-index: 2; }
.friends { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin-bottom: 8px; }
.friends .ch-foot { margin: 0; }
.ch-foca { width: 92px; aspect-ratio: 130 / 110; }
.ch-foca .gift { transform-box: fill-box; transform-origin: 50% 100%; animation: letter 2.6s ease-in-out infinite; }

/* ---------- Botón de música ---------- */
.music-btn {
  position: fixed; z-index: 10;
  top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right));
  width: 52px; height: 52px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.55);
  background: rgba(11,46,89,.72); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 8px 22px rgba(11,46,89,.3);
}
.music-btn .eq { display: none; gap: 3px; align-items: flex-end; height: 18px; }
.music-btn .eq i { width: 4px; height: 100%; border-radius: 2px; background: #fff; animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.music-btn .eq i:nth-child(2) { animation-delay: .2s; }
.music-btn .eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.music-btn[aria-pressed=true] .ico-play { display: none; }
.music-btn[aria-pressed=true] .eq { display: flex; }
.music-btn[aria-pressed=true] { background: var(--accent); }
.music-hint {
  position: fixed; z-index: 10; margin: 0;
  top: calc(max(14px, env(safe-area-inset-top)) + 10px); right: calc(max(14px, env(safe-area-inset-right)) + 62px);
  padding: 7px 12px; border-radius: 999px; background: #fff; color: var(--night);
  font-size: 13px; font-weight: 700; box-shadow: 0 6px 18px rgba(11,46,89,.2);
  transition: opacity .5s, transform .5s;
}
.music-hint.hide { opacity: 0; transform: translateX(8px); pointer-events: none; }

/* Muñeco de nieve: saluda con el mitón */
.ch-hero .mitt-r { transform-box: fill-box; transform-origin: 0% 100%; animation: wave 1.8s ease-in-out infinite; }

/* Personaje reemplazado por una imagen subida: siempre un círculo igual */
img.ch-img {
  --pj: 110px;
  flex: 0 0 var(--pj);
  width: var(--pj) !important; height: var(--pj) !important;
  min-width: var(--pj); min-height: var(--pj);
  max-width: none; max-height: none; aspect-ratio: auto;
  object-fit: cover; object-position: center 20%;
  border-radius: 50%; border: 4px solid #fff; box-sizing: border-box;
  overflow: hidden !important; clip-path: circle(50%);
  background: #DDF3FC;
  filter: drop-shadow(0 8px 14px rgba(11,46,89,.18));
}
/* Imágenes subidas: fijas, sin movimiento */
img.ch-img { animation: none !important; translate: none !important; transform: none !important; transition: none !important; }
/* Tamaño según el lugar */
.ch-hero.ch-img      { --pj: clamp(96px, 26vw, 150px); right: -10%; bottom: -6%; }
.ch-princesa.ch-img  { --pj: clamp(92px, 22vw, 130px); }
.ch-pingu.ch-img     { --pj: clamp(76px, 18vw, 104px); bottom: -10px; }
.ch-zorro.ch-img     { --pj: clamp(64px, 14vw, 96px); top: -40px; right: -8px; }
@media (min-width: 600px) { .ch-zorro.ch-img { top: -76px; } }
.ch-owl.ch-img       { --pj: clamp(100px, 24vw, 128px); display: block; margin: -84px auto 0; }
.friends .ch-img     { --pj: clamp(100px, 28vw, 140px); margin: 0; }
.friends { gap: clamp(14px, 4vw, 24px); align-items: center; }

/* ---------- Campos de ingreso (vehículo / peatonal / DPI) ---------- */
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.hint-field { color: var(--muted); font-size: 13px; line-height: 1.4; }
select {
  min-height: 50px; width: 100%;
  border: 1.5px solid var(--field); border-radius: 14px;
  padding: 12px 40px 12px 14px; font: inherit; font-size: 16px; color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%230C2A4D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 20px no-repeat;
  -webkit-appearance: none; appearance: none;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,111,176,.2); }
select[aria-invalid=true], textarea[aria-invalid=true] { border-color: #B3261E; }
#fPlaca { text-transform: uppercase; letter-spacing: .06em; }
#fDpi { letter-spacing: .08em; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: 0 0; }
  .snow { display: none; }
}
