@font-face { font-family: 'Inter'; src: url('/fonts/Inter.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('/fonts/Playfair.woff2') format('woff2'); font-weight: 600 800; font-display: swap; }
:root {
  --acento-rgb: 245, 196, 81; --oro3: #f8dc8f; --sobre-acento: #1b1405; --bg-brillo: #26306b; --esc1: #283478; --esc2: #050814;
  --aur1: rgba(209, 36, 47, .55); --aur2: rgba(245, 196, 81, .38); --aur3: rgba(31, 157, 104, .38);
  --bg: var(--bg); --bg2: var(--bg2); --oro: var(--oro); --oro2: var(--oro2); --rojo: #d1242f; --verde: #1f9d68;
  --txt: #f4f6ff; --suave: #aab2d6; --vidrio: rgba(255, 255, 255, .07); --borde: rgba(var(--acento-rgb), .35);
  --titulo: 'Playfair Display', Georgia, 'Times New Roman', serif; --cuerpo: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--cuerpo); color: var(--txt); font-size: 17px;
  background: radial-gradient(1200px 700px at 50% -10%, var(--bg-brillo) 0%, var(--bg) 60%) fixed, var(--bg);
}
#nieve { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
main, header.barra { position: relative; z-index: 1; }
h1, h2, h3 { font-family: var(--titulo); margin: 0 0 .4em; letter-spacing: .01em; }
a { color: var(--oro); }
.centro { text-align: center; }
.suave { color: var(--suave); }
.error { color: #ff8a8f; min-height: 1.3em; margin: .4em 0; }

.tarjeta {
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035) 55%); border: 1px solid var(--borde); border-radius: 20px; padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 44px rgba(0, 0, 0, .32);
}
.btn {
  display: inline-block; width: 100%; font: inherit; font-weight: 700; font-size: 18px; color: var(--sobre-acento); cursor: pointer;
  background: linear-gradient(180deg, var(--oro), var(--oro2)); border: 0; border-radius: 14px; padding: 14px 20px;
  box-shadow: 0 6px 18px rgba(var(--acento-rgb), .25); transition: transform .08s, filter .15s; text-decoration: none; text-align: center;
}
.btn { transition: transform .18s var(--ease), filter .15s, box-shadow .2s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn.rojo { background: linear-gradient(180deg, #ef4450, var(--rojo)); color: #fff; box-shadow: 0 6px 18px rgba(209, 36, 47, .3); }
.btn.verde { background: linear-gradient(180deg, #2fc486, var(--verde)); color: #fff; box-shadow: 0 6px 18px rgba(31, 157, 104, .3); }
.btn.sec { background: transparent; color: var(--oro); border: 1px solid var(--borde); box-shadow: none; }
.btn.chico { width: auto; font-size: 15px; padding: 9px 14px; }

label { display: block; font-size: 14px; color: var(--suave); margin: 14px 0 5px; }
input, select {
  width: 100%; font: inherit; font-size: 18px; color: var(--txt); background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 13px 14px; outline: none;
}
input:focus { border-color: var(--oro); box-shadow: 0 0 0 3px rgba(var(--acento-rgb), .2); }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; padding: 0; accent-color: var(--oro); flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--suave); margin-top: 16px; }

/* ----- PIN */
.overlay-pin { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5, 8, 20, .92); padding: 20px; }
.pin-box { width: min(380px, 100%); text-align: center; background: var(--bg2); }

/* ----- Celular */
.cel { max-width: 460px; margin: 0 auto; padding: 18px 16px 60px; }
.marca { text-align: center; padding: 14px 0 6px; }
.marca small { letter-spacing: .35em; color: var(--oro); font-size: 12px; }
.marca h1 { font-size: 34px; }

.ticket { position: relative; border-radius: 22px; overflow: hidden; color: var(--sobre-acento); margin: 14px 0;
  background: linear-gradient(135deg, var(--oro3) 0%, var(--oro) 45%, var(--oro2) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .35); }
.ticket::before, .ticket::after { content: ''; position: absolute; top: 58%; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); }
.ticket::before { left: -13px; } .ticket::after { right: -13px; }
.ticket .arriba { padding: 22px 22px 26px; }
.ticket .arriba small { letter-spacing: .3em; font-weight: 700; font-size: 11px; opacity: .75; }
.ticket .arriba h2 { font-size: 27px; margin: 6px 0 2px; }
.ticket .num { font-weight: 700; opacity: .8; }
.ticket .abajo { padding: 22px; border-top: 2px dashed rgba(42, 27, 0, .35); background: rgba(255, 255, 255, .22); text-align: center; }
.ticket .estado { font-weight: 800; font-size: 19px; }
.ticket .cuenta { font-family: var(--titulo); font-size: 40px; font-weight: 700; margin: 4px 0; font-variant-numeric: lining-nums tabular-nums; }
.ticket::after { box-shadow: none; }
.ticket.gano { background: linear-gradient(135deg, color-mix(in srgb, var(--oro3), #fff 55%), var(--oro3) 40%, var(--oro)); animation: brillo 2.5s ease-in-out infinite; }
@keyframes brillo { 50% { filter: brightness(1.12) saturate(1.15); box-shadow: 0 0 60px rgba(255, 210, 85, .55), 0 18px 40px rgba(0, 0, 0, .45); } }
.premio { font-size: 26px; font-weight: 800; line-height: 1.15; margin: 4px 0 8px; }
.premio .emo { display: block; font-size: 64px; animation: salto 1.6s ease-in-out infinite; }
@keyframes salto { 50% { transform: translateY(-8px) rotate(-4deg); } }
.folio { font-family: 'Courier New', monospace; font-size: 26px; font-weight: 800; letter-spacing: .1em; }
.qr { background: #fff; border-radius: 14px; padding: 8px; width: 190px; margin: 10px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.aviso { background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 10px; }

.linea-tiempo { margin-top: 14px; display: grid; gap: 8px; }
.linea-tiempo .item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--vidrio); border: 1px solid transparent; }
.linea-tiempo .item.hecha { opacity: .55; }
.linea-tiempo .item.siguiente { border-color: var(--borde); }
.linea-tiempo .punto { width: 12px; height: 12px; border-radius: 50%; background: var(--suave); flex: none; }
.linea-tiempo .item.hecha .punto { background: var(--verde); }
.linea-tiempo .item.siguiente .punto { background: var(--oro); animation: pulso 1.4s infinite; }
@keyframes pulso { 50% { box-shadow: 0 0 0 7px rgba(var(--acento-rgb), 0); } 0% { box-shadow: 0 0 0 0 rgba(var(--acento-rgb), .6); } }
.linea-tiempo .hora { margin-left: auto; color: var(--suave); font-size: 14px; }

/* ----- Paneles de operación */
.panel { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.barra { display: flex; align-items: center; gap: 12px; padding: 14px 20px; flex-wrap: wrap; }
.barra h1 { font-size: 22px; margin: 0; } .barra .sp { flex: 1; }
.rejilla { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.kpi { text-align: center; } .kpi .n { font-family: var(--titulo); font-size: 46px; color: var(--oro); line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.kpi .t { color: var(--suave); font-size: 14px; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.etq { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .12); }
.etq.ok { background: rgba(31, 157, 104, .3); color: #7dffc4; } .etq.pend { background: rgba(var(--acento-rgb), .25); color: var(--oro); }
table { width: 100%; border-collapse: collapse; } th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, .1); }
th { color: var(--suave); font-size: 13px; font-weight: 600; }
.barra-prog { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.barra-prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--oro2), var(--oro)); transition: width .6s; }
.barra-prog.v > i { background: linear-gradient(90deg, #1b8d5d, #35d896); }

/* ----- Canje */
.res { text-align: center; }
.res .gde { font-family: var(--titulo); font-size: 38px; line-height: 1.1; margin: 6px 0; }
.res .id { font-size: 30px; color: var(--oro); font-weight: 800; }
.res.mal { border-color: #ff6b73; background: rgba(209, 36, 47, .18); }
.res.bien { border-color: #35d896; background: rgba(31, 157, 104, .15); }
#lector { width: 100%; max-width: 420px; margin: 0 auto; border-radius: 16px; overflow: hidden; }

/* ----- Hub demo */
.hub a.tarjeta { display: block; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.hub a.tarjeta:hover { transform: translateY(-3px); border-color: var(--oro); }
.hub .emo { font-size: 40px; }

/* ===================== Pulido visual ===================== */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, a, summary, [data-ronda], [data-premio] { cursor: pointer; }

/* Fondo: aurora lenta + viñeta + guirnalda de luces */
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: .6; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; will-change: transform; transform: translateZ(0); }
.aurora i:nth-child(1) { width: 55vmax; height: 55vmax; left: 5%; top: -10%; background: radial-gradient(circle, var(--aur1), transparent 65%); animation: deriva 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 50vmax; height: 50vmax; right: 0; top: 20%; background: radial-gradient(circle, var(--aur2), transparent 65%); animation: deriva 32s ease-in-out -8s infinite alternate-reverse; }
.aurora i:nth-child(3) { width: 60vmax; height: 60vmax; left: 25%; bottom: -25%; background: radial-gradient(circle, var(--aur3), transparent 65%); animation: deriva 38s ease-in-out -15s infinite alternate; }
@keyframes deriva { to { transform: translate3d(8vmax, 5vmax, 0) scale(1.18); } }
.vineta { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55)); }
.luces { position: fixed; left: 0; right: 0; top: 0; height: 56px; z-index: 3; pointer-events: none; }
.luces svg { width: 100%; height: 100%; display: block; overflow: visible; }
.luces .foco { animation: foco 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes foco { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Texto dorado con brillo que cruza */
.oro-txt { background: linear-gradient(100deg, var(--oro3) 0%, color-mix(in srgb, var(--oro3), #fff 60%) 22%, var(--oro) 42%, var(--oro2) 70%, var(--oro3) 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: pasa-brillo 6s linear infinite; }
@keyframes pasa-brillo { to { background-position: -220% 0; } }

/* Boleto: entrada, destello holográfico, estado ganador */
.ticket { animation: sube-ticket .7s var(--ease) both; }
@keyframes sube-ticket { from { opacity: 0; transform: translateY(26px) scale(.96) rotateX(8deg); } }
.ticket .brillo { position: absolute; inset: 0; pointer-events: none; will-change: transform;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .5) 50%, transparent 62%); transform: translateX(-130%); animation: barrido 5s ease-in-out 1s infinite; }
@keyframes barrido { 0% { transform: translateX(-130%); } 35%, 100% { transform: translateX(130%); } }
.ticket .arriba h2 { font-weight: 800; }
.linea-tiempo .item { animation: entra-item .5s var(--ease) both; }
.linea-tiempo .item:nth-child(2) { animation-delay: .08s; } .linea-tiempo .item:nth-child(3) { animation-delay: .16s; } .linea-tiempo .item:nth-child(4) { animation-delay: .24s; }
@keyframes entra-item { from { opacity: 0; transform: translateX(-14px); } }
.linea-tiempo .item .ico { color: var(--oro); }

/* Regalo (al ganar) */
.regalo { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; text-align: center; cursor: pointer;
  background: radial-gradient(circle at 50% 45%, var(--bg-brillo), #05081a); animation: aparece .5s ease both; }
@keyframes aparece { from { opacity: 0; } }
.regalo h2 { font-size: 34px; margin: 6px 0; } .regalo p { color: var(--suave); }
.regalo svg.caja { width: min(62vw, 260px); height: auto; filter: drop-shadow(0 0 40px rgba(var(--acento-rgb), .55)); animation: late 1.3s ease-in-out infinite; }
@keyframes late { 50% { transform: scale(1.07) rotate(-2deg); } }
.regalo .tapa { transform-box: fill-box; transform-origin: 50% 100%; }
.regalo.abre svg.caja { animation: none; }
.regalo.abre .tapa { animation: vuela-tapa .8s var(--ease) forwards; }
.regalo.abre .cuerpo-c { animation: sacude .5s ease; }
.regalo.abre { animation: desvanece .6s ease .7s forwards; }
@keyframes vuela-tapa { to { transform: translate(40px, -150px) rotate(28deg); opacity: 0; } }
@keyframes sacude { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes desvanece { to { opacity: 0; visibility: hidden; } }

/* Premio ganado: entrada escalonada */
.ticket.gano .abajo > * { animation: sube-suave .6s var(--ease) both; }
.ticket.gano .abajo > *:nth-child(2) { animation-delay: .12s; } .ticket.gano .abajo > *:nth-child(3) { animation-delay: .24s; } .ticket.gano .abajo > *:nth-child(4) { animation-delay: .36s; }
@keyframes sube-suave { from { opacity: 0; transform: translateY(14px); } }

/* Paneles: aparición suave */
.panel > *, .cel > .tarjeta { animation: sube-suave .5s var(--ease) both; }
.hub a.tarjeta .emo, .hub a.tarjeta .ico-gde { color: var(--oro); }
.ico-gde { width: 40px; height: 40px; stroke-width: 1.5; }
h2 .ico, h1 .ico, .barra .ico { color: var(--oro); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .aurora, #nieve { display: none; }
}

/* ===================== Marca (logo) ===================== */
.logo-marca { display: flex; align-items: center; justify-content: center; color: var(--oro); }
.logo-marca:empty { display: none; }
.logo-marca img { max-height: var(--logo-h, 56px); max-width: min(var(--logo-w, 220px), 100%); width: auto; height: auto; object-fit: contain; }
.logo-marca .logo-texto { font-family: var(--titulo); font-weight: 800; color: var(--oro); font-size: calc(var(--logo-h, 56px) * .52); line-height: 1.1; letter-spacing: .01em; max-width: var(--logo-w, 260px); text-align: center; overflow-wrap: anywhere; }
.logo-cel { --logo-h: 54px; margin-bottom: 10px; }
.logo-barra { --logo-h: 34px; --logo-w: 130px; margin-right: 4px; }
.logo-panel { --logo-h: 64px; --logo-w: 240px; margin-bottom: 8px; }

/* Ícono de Navidad solo en el ambiente navideño; en los demás, un boleto */
.no-navidad { display: none; }
body:not(.amb-navidad) .solo-navidad { display: none; }
body:not(.amb-navidad) .no-navidad { display: inline; }
/* Logo oscuro sobre placa clara */
.logo-img.placa { background: #f8f8fa; padding: 6px 12px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }

/* Marca del producto (Boletapp): solo en pantallas de operador / comerciales */
.logo-producto { display: block; width: auto; max-width: 100%; }
.barra-producto { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 0 12px; border-bottom: 1px solid var(--borde); margin-bottom: 8px; }
.barra-producto small { color: var(--suave); }
.logo-hero { display: flex; justify-content: center; margin-bottom: 12px; }
.logo-barra-producto { display: inline-flex; }
.pie-producto { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 34px; color: var(--suave); font-size: 13px; }
@media (max-width: 640px) { .logo-barra-producto { display: none; } .barra-producto .logo-producto { height: 40px; } }
