/* GanaHoy — fondo verde claro sacado del verde del logo; siempre claro
   (sin modo oscuro, a pedido de Juan: el fondo negro opacaba el logo). */
:root {
  --fondo: #f7efdc;
  --superficie: #fffaf0;
  --suave: #efe3c8;
  --texto: #1d2024;
  --texto-suave: #6b5d42;
  --texto-tenue: #a8997a;
  --borde: #e4d3ae;
  --lima: #c9a24a;
  --lima-claro: #f3e6c4;
  --oliva: #94701f;
  --tinta: #2f3337;
  --tinta-texto: #ffffff;
  --error: #b42318;
  --sombra: 0 12px 32px rgba(70,50,15, 0.12);
  --radio: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--fondo); }
body {
  margin: 0;
  background: linear-gradient(160deg, #f4e5c0 0%, #ecd59f 50%, #dfbb72 100%) fixed, var(--fondo);
  color: var(--texto);
  font: 16px/1.5 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 112px;
}
a { color: inherit; }
h1, h2 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--oliva); outline-offset: 2px; }

/* ---------- Encabezado ---------- */
.barra {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: center;
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}
.marca img { width: 42px; height: 42px; display: block; }
.marca span { color: var(--oliva); }

.contenido { max-width: 720px; margin: 0 auto; padding: 8px 16px 96px; } /* abajo, espacio para el botón de WhatsApp */
.cargando, .vacio { color: var(--texto-suave); text-align: center; padding: 56px 0; }

/* ---------- Etiqueta de tipo ---------- */
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--texto-suave);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.etiqueta::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--lima);
  box-shadow: 0 0 0 3px var(--lima-claro);
}

/* ---------- Datos de la rifa ---------- */
.cifras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.cifra {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
}
.cifra small { display: block; color: var(--texto-suave); font-size: 0.75rem; font-weight: 500; }
.cifra strong {
  display: block;
  /* Se achica en teléfonos angostos para que «$500.000» no se parta en dos líneas. */
  font-size: clamp(0.88rem, 4.2vw, 1.05rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
  line-height: 1.25;
}
.tarjeta .cifra strong { font-size: 0.95rem; }
.cifra-destacada { background: var(--lima-claro); border-color: transparent; }
.fecha { color: var(--texto-suave); font-size: 0.9rem; margin: 12px 0 0; }
.fecha::first-letter { text-transform: uppercase; }

.loteria { color: var(--oliva); font-weight: 700; font-size: 1rem; margin: 4px 0 0; }

.rifa-cabecera { margin: 8px 0 24px; text-align: center; }
.rifa-cabecera h1 { margin-top: 10px; }
.rifa-cabecera .cifra { text-align: center; }
.aviso { color: var(--texto-suave); font-size: 0.9rem; margin: 0 0 12px; text-align: center; }

/* ---------- Lista de rifas ---------- */
.titulo-lista { margin: 8px 0 20px; text-align: center; }
.tarjetas { display: grid; gap: 12px; }
.tarjeta {
  display: block;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 18px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.tarjeta:hover { border-color: var(--texto-tenue); transform: translateY(-1px); }
.tarjeta h2 { margin-top: 6px; }
.tarjeta .cifras { margin-top: 12px; }
.tarjeta .cifra { background: var(--fondo); border-color: transparent; }
.tarjeta .cifra-destacada { background: var(--lima-claro); }

/* ---------- Herramientas ---------- */
.herramientas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.buscar {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 16px; /* con menos de 16px el iPhone acerca la pantalla al tocarlo */
  padding: 10px 14px 10px 38px;
  min-height: 44px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: var(--superficie) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a39c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 18px;
  color: var(--texto);
}
.buscar::placeholder { color: var(--texto-tenue); }
.chip {
  flex: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--borde);
  background: var(--superficie);
  color: var(--texto);
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--tinta-texto); }

.centenas {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -16px 12px;
  padding: 0 16px 4px;
  scrollbar-width: none;
}
.centenas::-webkit-scrollbar { display: none; }
.centena {
  flex: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 0;
  background: var(--suave);
  color: var(--texto-suave);
  cursor: pointer;
}
.centena[aria-pressed="true"] { background: var(--tinta); color: var(--tinta-texto); }

.leyenda { display: flex; gap: 16px; font-size: 0.8rem; color: var(--texto-suave); margin-bottom: 12px; flex-wrap: wrap; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda span::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 4px;
  background: var(--superficie);
  border: 1px solid var(--borde);
}
.leyenda .l-elegido::before { background: var(--lima); border-color: var(--lima); }
.leyenda .l-ocupado::before { background: transparent; border-style: dashed; }
.leyenda .l-pagado::before { background: var(--tinta); border-color: var(--tinta); }

/* ---------- Cuadrícula ---------- */
.cuadricula { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.num {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  aspect-ratio: 1;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--borde);
  background: var(--superficie);
  color: var(--texto);
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.num:hover:not(:disabled) { border-color: var(--texto-tenue); }
.num:active:not(:disabled) { transform: scale(0.95); }
.num[aria-pressed="true"] { background: var(--lima); border-color: var(--lima); color: #1a1408; }
.num:disabled {
  background: rgba(255, 250, 240, 0.4);
  border-style: dashed;
  color: var(--texto-tenue);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
/* Ocupado y ya pagado: casilla oscura (el apartado sin pagar queda punteado). */
.num.num-pagado:disabled {
  background: var(--tinta);
  border: 1px solid var(--tinta);
  color: #d8cdb5;
  text-decoration: none;
}

/* ---------- Resultado y resultados anteriores ---------- */
.resultado {
  background: var(--superficie);
  border: 2px solid var(--lima);
  border-radius: var(--radio);
  padding: 16px;
  margin: 0 0 16px;
  text-align: center;
  box-shadow: var(--sombra);
}
.resultado h2 { margin: 0 0 4px; font-size: 1.05rem; }
.resultado .resultado-num { font-size: 2rem; font-weight: 900; letter-spacing: 0.12em; margin: 0 0 8px; }
.ganadores { display: grid; gap: 6px; text-align: left; }
.ganador-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.ganador-fila b {
  min-width: 46px; text-align: center;
  background: var(--lima-claro); color: var(--oliva);
  border-radius: 10px; padding: 2px 8px; font-size: 1rem;
}
.ganador-fila small { color: var(--texto-suave); }
.historial-publico { margin: 28px 0 8px; }
.historial-publico h2 { font-size: 1.05rem; margin: 0 0 10px; text-align: center; }
.historial-lista { display: grid; gap: 10px; }
.historial-item {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 12px 14px;
}
.historial-item p { margin: 0 0 6px; font-size: 0.85rem; color: var(--texto-suave); overflow-wrap: anywhere; }
.historial-item p strong { color: var(--texto); }

/* ---------- Barra fija con lo elegido ---------- */
.carrito {
  position: fixed;
  left: 12px; right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 696px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--tinta);
  color: var(--tinta-texto);
  border-radius: 18px;
  box-shadow: var(--sombra);
  padding: 10px 10px 10px 18px;
}
.carrito[hidden] { display: none; }
.carrito-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.9rem; line-height: 1.3; }
.carrito-info span { opacity: 0.65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carrito .boton-suave { color: inherit; border-color: color-mix(in srgb, currentColor 25%, transparent); }
.carrito .boton:not(.boton-suave) { background: var(--lima); color: #1a1408; }

.boton {
  font: inherit;
  font-weight: 700;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 12px;
  border: 0;
  background: var(--tinta);
  color: var(--tinta-texto);
  cursor: pointer;
}
.boton:disabled { opacity: 0.6; cursor: wait; }
.boton-suave { background: transparent; color: var(--texto); border: 1px solid var(--borde); font-weight: 600; }

/* ---------- Ventanas ---------- */
.ventana {
  width: min(420px, calc(100% - 32px));
  border: 0;
  border-radius: 22px;
  padding: 24px;
  background: var(--superficie);
  color: var(--texto);
  box-shadow: var(--sombra);
}
.ventana::backdrop { background: rgba(14, 14, 14, 0.4); backdrop-filter: blur(2px); }
.ventana label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--texto-suave); margin-top: 14px; }
.ventana input {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  font-size: 1rem;
  color: var(--texto);
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--suave);
}
.ventana input:focus { outline: none; border-color: var(--texto-tenue); background: var(--superficie); }
.elegidos { color: var(--texto-suave); margin: 6px 0 0; word-break: break-word; font-size: 0.95rem; }
.elegidos strong { color: var(--texto); }
.error { color: var(--error); font-size: 0.9rem; margin: 14px 0 0; }
.acciones { display: flex; gap: 8px; margin-top: 22px; }
.acciones .boton { flex: 1; }

.listo { text-align: center; }
.listo-icono {
  width: 60px; height: 60px;
  margin: 4px auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lima);
  color: #1a1408;
}
.listo-icono svg { width: 28px; height: 28px; }
.listo p { color: var(--texto-suave); margin: 8px 0 0; }
.listo-numeros { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 16px 0; }
.listo-numeros span {
  background: var(--lima-claro);
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.listo .listo-total { color: var(--texto); font-weight: 800; font-size: 1.15rem; margin: 0; }
.listo .nota { font-size: 0.85rem; margin: 10px 0 20px; }
.listo .boton { width: 100%; }

/* Datos de pago y botón de WhatsApp en la confirmación */
.pago { background: var(--fondo); border-radius: 16px; padding: 12px; margin: 16px 0 0; text-align: left; }
.pago-titulo { text-align: center; font-weight: 800; color: var(--texto) !important; margin: 0 0 8px !important; font-size: 0.95rem; }
.pago-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--superficie);
  border-radius: 12px;
  padding: 8px;
}
.pago-fila + .pago-fila { margin-top: 6px; }
.pago-logo {
  flex: none;
  width: 54px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--superficie);
  border: 1px solid var(--borde);
}
.pago-logo img { display: block; max-width: 46px; height: auto; }
.pago-dato { flex: 1; min-width: 0; }
.pago-fila small { display: block; color: var(--texto-suave); font-size: 0.75rem; font-weight: 600; }
.pago-fila strong { display: block; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.copiar {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 38px;
  flex: none;
  background: var(--lima);
  color: #1a1408;
  cursor: pointer;
}
.listo .metodo-titulo { color: var(--texto); font-weight: 800; font-size: 0.95rem; margin: 16px 0 8px; }
.metodos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.metodo img { max-width: 100%; height: auto; }
.pago-titular { text-align: center; margin: 10px 0 2px !important; font-size: 0.9rem; color: var(--texto-suave) !important; }
.pago-titular strong { color: var(--texto); font-weight: 800; }
.metodo {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--borde);
  background: var(--superficie);
  color: var(--texto);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  position: relative;
}
.metodo img { display: block; }
/* Elegido: borde verde grueso y un chulito; el fondo sigue blanco para que los logos se vean bien. */
.metodo[aria-checked="true"] { border: 2px solid var(--lima); box-shadow: 0 0 0 3px var(--lima-claro); }
.metodo[aria-checked="true"]::after {
  content: "✓";
  position: absolute;
  top: -8px; right: -8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--lima);
  color: #1a1408;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.boton-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: #8f6b1d;
  color: #ffffff;
}
.boton-whatsapp svg { width: 22px; height: 22px; }
.enlace-cerrar {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  background: none;
  border: 0;
  color: var(--texto-suave);
  margin-top: 10px;
  padding: 8px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%; top: 16px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  background: var(--tinta);
  color: var(--tinta-texto);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--sombra);
  z-index: 10;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Encabezado de la rifa: datos y reparto de premios ---------- */
.hero { text-align: center; margin: 4px 0 28px; }
.hero svg { width: 1em; height: 1em; flex: none; }
.hero-titulo {
  font-size: clamp(2rem, 9vw, 2.6rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.05;
  background: linear-gradient(90deg, #6e4f10, #b8902f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-fecha {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 7px 14px;
  border-radius: 14px;
  background: var(--lima-claro);
  border: 1px solid #ecd9a8;
  color: #6e4f10;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.hero-fecha svg { font-size: 1.05rem; }

.hero-datos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(70,50,15, 0.06);
}
.hero-dato { padding: 14px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.hero-dato small {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--texto-suave);
  line-height: 1.2;
}
.hero-dato small svg { color: var(--lima); font-size: 1rem; }
.hero-dato strong { font-size: clamp(0.95rem, 4.4vw, 1.2rem); font-weight: 800; color: #6e4f10; font-variant-numeric: tabular-nums; line-height: 1.15; }
.hero-dato-destacado { background: linear-gradient(160deg, #2b2620, #121110); }
.hero-dato-destacado small, .hero-dato-destacado small svg { color: #d9b56a; }
.hero-dato-destacado strong { color: #f0d48a; }

.reparto { margin-top: 26px; }
.reparto h2 {
  display: block;
  font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em;
  color: #6e4f10;
}
.reparto h2 svg { color: var(--lima); font-size: 1.25rem; vertical-align: -4px; margin-right: 6px; }
.reparto-ejemplo { color: var(--texto-suave); margin: 8px 0 0; font-size: 0.95rem; }
.reparto-ejemplo b { color: var(--texto); font-weight: 800; letter-spacing: 0.04em; }

.balotas { display: flex; justify-content: center; align-items: flex-end; gap: 22px; margin: 16px 0 18px; flex-wrap: wrap; }
.balotas-grupo small { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-suave); margin-bottom: 8px; }
.balotas-grupo .quinta-texto { color: var(--oliva); }
.balotas-fila { display: flex; gap: 8px; justify-content: center; }
.balota {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem; color: #ffffff;
  background: radial-gradient(circle at 35% 30%, #b8902f, #6e4f10 70%);
  box-shadow: 0 4px 10px rgba(110,79,16, 0.28), inset 0 -3px 6px rgba(0,0,0,0.18);
}
.balota-quinta {
  background: radial-gradient(circle at 35% 30%, #4a4f57, #2f3337 70%);
  color: var(--lima);
  box-shadow: 0 0 0 4px var(--lima-claro), 0 4px 12px rgba(47, 51, 55, 0.35);
}

.premios { display: grid; gap: 8px; }
.premio-fila {
  display: flex; align-items: center; gap: 12px;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 10px 14px 10px 10px;
  text-align: left;
}
.premio-num {
  flex: none;
  min-width: 48px; height: 40px; padding: 0 8px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800; color: #ffffff; font-variant-numeric: tabular-nums;
}
.premio-num-0 { background: #b8902f; }
.premio-num-1 { background: #6e4f10; }
.premio-num-2 { background: #2f3337; color: var(--lima); }
.premio-nombre { flex: 1; min-width: 0; font-weight: 600; color: var(--texto); }
.premio-valor { flex: none; font-weight: 800; color: #6e4f10; font-variant-numeric: tabular-nums; }

.elige { text-align: center; margin: 4px 0 10px; padding-top: 22px; border-top: 1px solid var(--borde); }
.elige h2 { font-size: 1.25rem; font-weight: 800; color: var(--texto); }
.elige p { color: var(--texto-suave); font-size: 0.9rem; margin: 4px 0 0; }
.elige p b { color: #6e4f10; }

/* ---------- Teléfono (casi todos entran desde WhatsApp) ---------- */
.boton-x { width: 44px; padding: 0; flex: none; font-size: 1rem; }
.carrito-info strong { white-space: nowrap; }
#form-separar h2, #form-separar .elegidos { text-align: center; }
button, a, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.leyenda { justify-content: center; }
.pago-fila small { white-space: nowrap; }
@media (max-width: 379px) {
  .premio-nombre { font-size: 0.9rem; }
  .premio-fila { gap: 10px; padding-right: 12px; }
  /* Teléfonos pequeños: menos margen para que el número de pago y «Copiar» quepan. */
  .ventana { width: calc(100% - 16px); padding: 20px 14px; }
  .pago { padding: 8px; }
  .pago-fila { padding: 6px; gap: 6px; }
  .pago-logo { width: 44px; }
  .pago-logo img { max-width: 36px; }
  .copiar { padding: 8px; }
}
@media (max-width: 479px) {
  /* Buscador a lo ancho y los dos botones debajo, mitad y mitad. */
  .buscar { flex-basis: 100%; }
  .herramientas .chip { flex: 1 1 0; }
  .cifras { gap: 6px; }
  .cifra { padding: 10px 6px; }
}

@media (min-width: 560px) {
  h1 { font-size: 2.1rem; }
  .cuadricula { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
/* ================= Animaciones (Poppins + movimiento) ================= */
.hero-titulo { font-weight: 900; letter-spacing: -0.02em; }
.hero-dato strong, .premio-valor, .premio-num, .balota { font-weight: 800; }

/* Encabezado: balotas flotando y destellos a los lados del logo */
.barra { position: relative; }
.adornos { position: absolute; inset: 0; pointer-events: none; }
.mini-balota {
  position: absolute;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 800; color: #2f3337;
  background: radial-gradient(circle at 32% 28%, #ffffff, #f1e6cc 60%, #dcc89c);
  box-shadow: 0 6px 14px rgba(90,65,15, 0.18);
  animation: flotar 5s ease-in-out infinite;
}
.mini-balota.oscura { color: #e6c46e; background: radial-gradient(circle at 32% 28%, #4a4f57, #2f3337 60%, #1f2226); }
.mb1 { left: 4%;  top: 10px; animation-delay: -1s; }
.mb2 { right: 5%; top: 6px; width: 42px; height: 42px; font-size: 0.72rem; animation-delay: -2.5s; }
.mb3 { left: 14%; top: 50px; width: 28px; height: 28px; font-size: 0.6rem; animation-delay: -3.5s; }
.mb4 { right: 16%; top: 52px; width: 30px; height: 30px; font-size: 0.6rem; animation-delay: -0.5s; }
.destello { position: absolute; width: 14px; height: 14px; fill: #b8902f; animation: titilar 2.4s ease-in-out infinite; }
.d1 { left: 30px; top: 62px; }
.d2 { right: 26%; top: 64px; width: 10px; height: 10px; animation-delay: -0.8s; }
.d3 { right: 30px; top: 66px; width: 9px; height: 9px; animation-delay: -1.6s; }
.marca { position: relative; animation: entrar-logo 0.7s cubic-bezier(.2,.9,.3,1.3) both; }

@keyframes flotar { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
@keyframes titilar { 0%, 100% { opacity: 0.25; transform: scale(0.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@keyframes entrar-logo { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }

/* Entrada en cascada de las partes de la rifa */
.hero > *, .elige { animation: subir 0.6s cubic-bezier(.2,.8,.2,1) both; }
.hero > :nth-child(1) { animation-delay: 0.05s; }
.hero > :nth-child(2) { animation-delay: 0.15s; }
.hero > :nth-child(3) { animation-delay: 0.25s; }
.hero > :nth-child(4) { animation-delay: 0.35s; }
.elige { animation-delay: 0.45s; }
@keyframes subir { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Brillo que recorre el título */
.hero-titulo {
  background: linear-gradient(100deg, #6e4f10 0%, #b8902f 35%, #ecd08a 50%, #b8902f 65%, #6e4f10 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: subir 0.6s cubic-bezier(.2,.8,.2,1) both, brillo-titulo 4.5s ease-in-out 0.8s infinite;
}
@keyframes brillo-titulo { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0% 0; } }

/* Destello sobre «Total premios» */
.hero-dato-destacado { position: relative; overflow: hidden; }
.hero-dato-destacado::after {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  animation: destello-tarjeta 3.2s ease-in-out 1.2s infinite;
}
@keyframes destello-tarjeta { 0% { left: -60%; } 45%, 100% { left: 130%; } }

/* Balotas del ejemplo: caen una por una y la quinta late */
.reparto .balota { animation: caer 0.6s cubic-bezier(.3,1.5,.5,1) both; }
.balotas-fila .balota:nth-child(1) { animation-delay: 0.5s; }
.balotas-fila .balota:nth-child(2) { animation-delay: 0.62s; }
.balotas-fila .balota:nth-child(3) { animation-delay: 0.74s; }
.balotas-fila .balota:nth-child(4) { animation-delay: 0.86s; }
.balota-quinta { animation: caer 0.6s cubic-bezier(.3,1.5,.5,1) 1.05s both, latir 2s ease-in-out 1.8s infinite !important; }
@keyframes caer { from { opacity: 0; transform: translateY(-36px) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes latir { 0%, 100% { box-shadow: 0 0 0 4px var(--lima-claro), 0 4px 12px rgba(47,51,55,.35); } 50% { box-shadow: 0 0 0 10px rgba(201,162,74,.18), 0 4px 12px rgba(47,51,55,.35); } }

/* Filas de premios entran desde el lado */
.premio-fila { animation: deslizar 0.5s cubic-bezier(.2,.8,.2,1) both; }
.premio-fila:nth-child(1) { animation-delay: 0.9s; }
.premio-fila:nth-child(2) { animation-delay: 1.02s; }
.premio-fila:nth-child(3) { animation-delay: 1.14s; }
@keyframes deslizar { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* Número elegido: rebote */
.num[aria-pressed="true"] { box-shadow: 0 6px 14px rgba(201,162,74,.35); }
.num.salta { animation: rebote 0.32s cubic-bezier(.3,1.6,.5,1); }
@keyframes rebote { 0% { transform: scale(0.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Barra de abajo sube al aparecer */
.carrito:not([hidden]) { animation: subir-barra 0.35s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes subir-barra { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* Confirmación: el chulito aparece con rebote y caen papelitos */
.ventana[open] { animation: aparecer 0.3s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
.listo-icono { animation: rebote 0.6s cubic-bezier(.3,1.6,.5,1) 0.15s both; }
/* La ventana es «fixed» (encima de todo): no ponerle position: relative, porque en el celular
   se iba al final de la página y el cliente no veía los datos de pago. */
#listo { overflow-x: hidden; }
.papelito {
  position: absolute; top: -12px;
  width: 8px; height: 12px; border-radius: 2px;
  pointer-events: none;
  animation: caer-papelito var(--t, 1.8s) cubic-bezier(.25,.6,.4,1) var(--d, 0s) forwards;
}
@keyframes caer-papelito {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to { transform: translateY(var(--y, 520px)) translateX(var(--x, 0px)) rotate(var(--r, 540deg)); opacity: 0; }
}

@media (max-width: 379px) {
  .mb3, .mb4, .d2 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  *, *::before, *::after { animation: none !important; }
  .papelito { display: none; }
}

/* El fondo dorado cubre toda la pantalla aunque la página sea corta. */
body { min-height: 100vh; min-height: 100dvh; }

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-flotante {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, bottom 0.2s;
}
.wa-flotante svg { width: 30px; height: 30px; }
.wa-flotante:active { transform: scale(0.94); }
/* Con la barra de «Separar» abierta, el botón sube para no taparla. */
.carrito:not([hidden]) ~ .wa-flotante { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 78px); }
