@font-face { font-family: Poppins; src: url(Poppins-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Poppins; src: url(Poppins-Medium.ttf); font-weight: 500; font-display: swap; }
@font-face { font-family: Poppins; src: url(Poppins-SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: Poppins; src: url(Poppins-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Poppins; src: url(Poppins-ExtraBold.ttf); font-weight: 800; font-display: swap; }

:root {
  --rojo: #ee4742; --rojo-osc: #c62a25; --naranja: #eb9f15; --dorado: #ffc800;
  --tinta: #1f1e1e; --gris: #6b6b6b; --linea: #eddcc4; --fondo: #fff8ee; --blanco: #fff;
  --ok: #1f8a4c; --wa: #25d366; --radio: 16px;
  --grad: linear-gradient(90deg, var(--rojo), var(--naranja));
  --sombra: 0 6px 24px rgb(120 60 0 / .08);
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Poppins, system-ui, -apple-system, sans-serif; color: var(--tinta); background: var(--fondo); line-height: 1.5; }
a { color: var(--rojo-osc); }
img { max-width: 100%; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 0 0 .7em; }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.main { padding-top: 22px; padding-bottom: 48px; min-height: 60vh; }
.center { text-align: center; }
.muted { color: var(--gris); }
.small { font-size: .85rem; }
.inline { display: inline; }
.pre { white-space: pre-line; }
.big { font-size: 1.9rem; font-weight: 800; color: var(--rojo); margin: .1em 0; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }

.stage-bar { background: #1f1e1e; color: #ffc800; text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .05em; padding: 4px; padding-top: max(4px, env(safe-area-inset-top)); }

/* ---------- encabezado */
.top { background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  box-shadow: 0 1px 0 var(--linea); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--rojo); font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.brand img { width: 46px; height: 46px; }
.nav { display: flex; gap: 20px; flex: 1; }
.nav a { color: var(--tinta); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.on { color: var(--rojo); border-color: var(--rojo); }
.acct { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.saldo-pill { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--tinta); font-weight: 700;
  background: #fff4e0; border: 1px solid #f6d9a8; padding: 6px 6px 6px 12px; border-radius: 999px; font-size: .92rem; white-space: nowrap; }
.saldo-pill small { color: var(--gris); font-weight: 500; }
.saldo-pill b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 1rem; }

/* ---------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  color: #fff; text-decoration: none; background: var(--grad); min-height: 48px; padding: 12px 24px; border-radius: 999px; text-align: center;
  box-shadow: 0 6px 16px rgb(238 71 66 / .25); transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .9rem; box-shadow: none; }
.btn.full { width: 100%; }
.btn-wa { background: var(--wa); box-shadow: 0 6px 16px rgb(37 211 102 / .3); }
.btn-gris { background: #6b6b6b; box-shadow: none; }
.ico { width: 22px; height: 22px; fill: currentColor; flex: none; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--rojo-osc); text-decoration: underline; cursor: pointer; min-height: 32px; }

/* ---------- tarjetas y formularios */
.card { background: var(--blanco); border-radius: var(--radio); padding: 22px; box-shadow: var(--sombra); margin-bottom: 18px; }
.narrow { max-width: 500px; margin-left: auto; margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid2 .card { margin-bottom: 0; }
.saldo { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: linear-gradient(135deg, #fff, #fff4e0); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .92rem; }
/* 16px evita que el iPhone haga zoom al tocar un campo */
.form input, .form select, .form textarea, .search input { font: inherit; font-size: 16px; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--linea); border-radius: 12px; background: #fff; width: 100%; color: var(--tinta); }
.form input:focus, .form select:focus, .form textarea:focus, .search input:focus { outline: 2px solid var(--naranja); border-color: transparent; }
.form .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.form .check input { width: 22px; height: 22px; min-height: 0; margin-top: 1px; accent-color: var(--rojo); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.alert, .warn, .ok { padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; }
.alert { background: #fde8e7; color: #9b1c17; }
.warn { background: #fff4d6; color: #7a5200; }
.ok { background: #e3f5ea; color: var(--ok); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.list li:last-child { border-bottom: 0; }
.row-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; color: inherit; text-decoration: none; }
.pos { color: var(--ok); } .neg { color: var(--rojo-osc); }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #eee; text-transform: capitalize; }
.tag-aprobada, .tag-activa { background: #e3f5ea; color: var(--ok); }
.tag-pendiente { background: #fff4d6; color: #7a5200; }
.tag-rechazada, .tag-cancelada { background: #fde8e7; color: #9b1c17; }

/* ---------- carga de saldo */
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: grid; place-items: center; min-height: 54px; border: 2px solid var(--linea); border-radius: 14px; font-weight: 700; background: #fff; cursor: pointer; text-align: center; padding: 4px; }
.chip input:checked + span { border-color: var(--rojo); background: #fff1ee; color: var(--rojo-osc); }
.chip input:focus-visible + span { outline: 2px solid var(--naranja); }
.datos { margin: 0; }
.datos div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--linea); }
.datos dt { color: var(--gris); font-size: .9rem; }
.datos dd { margin: 0; font-weight: 600; text-align: right; display: flex; align-items: center; gap: 8px; word-break: break-word; }
.copy { font: inherit; font-size: .8rem; font-weight: 600; border: 1px solid var(--linea); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; min-height: 34px; color: var(--rojo-osc); }
.copy.done { background: #e3f5ea; color: var(--ok); border-color: #bfe6cd; }
.pasos { text-align: left; padding-left: 22px; margin: 16px 0 20px; }
.pasos li { margin-bottom: 8px; }

/* ---------- mi cuenta */
.ticket { display: grid; grid-template-columns: 2fr 3fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.ticket.voided { opacity: .55; }
.nums { display: flex; flex-wrap: wrap; gap: 6px; }
.num { background: var(--fondo); border: 1px solid var(--naranja); border-radius: 8px; padding: 2px 8px; font-weight: 600; font-size: .9rem; }

/* ---------- inicio */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px;
  background: radial-gradient(circle at 85% 40%, #ffd07a 0, transparent 45%), linear-gradient(120deg, #ffe9b8, #ffcf9a); border-radius: 22px; margin-bottom: 28px; overflow: hidden; }
.hero h1 { font-size: 2.3rem; line-height: 1.12; }
.hero h1 em { font-style: normal; display: block; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero img { max-width: 38%; height: auto; filter: drop-shadow(0 12px 18px rgb(120 60 0 / .25)); }
.pill { display: inline-block; background: #fff; border-radius: 999px; padding: 4px 14px; font-size: .85rem; font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.rifa { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px; transition: transform .15s; }
.rifa:hover { transform: translateY(-3px); }
.rifa-foot { display: flex; justify-content: space-between; align-items: baseline; }
.cover { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 12px; background: #fff3e0; }
.bar { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: #f1e3cf; overflow: hidden; }
.bar::-webkit-progress-bar { background: #f1e3cf; border-radius: 99px; }
.bar::-webkit-progress-value { background: var(--grad); border-radius: 99px; }
.bar::-moz-progress-bar { background: var(--grad); border-radius: 99px; }
.steps li { margin-bottom: 12px; }
details { border-bottom: 1px solid var(--linea); padding: 12px 0; }
summary { font-weight: 600; cursor: pointer; min-height: 32px; }

/* ---------- rifa */
.rifa-top { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.gallery img#foto-principal, .gallery > img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; background: #fff3e0; border-radius: 14px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumb { border: 2px solid transparent; padding: 0; border-radius: 10px; background: none; cursor: pointer; }
.thumb:hover { border-color: var(--naranja); }
.thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.price { font-size: 1.9rem; font-weight: 800; color: var(--rojo); }
.price small { font-size: .9rem; color: var(--gris); font-weight: 500; }
.countdown { font-size: 1.25rem; font-weight: 700; color: var(--rojo-osc); margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.prizes { padding-left: 18px; }
.grid-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.grid-tools input[type=number] { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--linea); border-radius: 12px; width: 160px; }
.azar { display: flex; gap: 6px; align-items: center; }
.azar .btn { white-space: nowrap; }
.azar input { width: 72px !important; }
.check-sm { display: flex; gap: 8px; align-items: center; font-size: .92rem; min-height: 44px; }
.check-sm input { width: 20px; height: 20px; accent-color: var(--rojo); }
.numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; min-height: 120px; }
.n { font: inherit; font-weight: 600; font-size: .95rem; min-height: 44px; border-radius: 10px; border: 1px solid var(--linea); background: #fff; cursor: pointer; color: var(--tinta); font-variant-numeric: tabular-nums; }
.n:hover:not(:disabled) { border-color: var(--naranja); }
.n.sel { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgb(238 71 66 / .3); }
.n.vendido { background: #f1efec; color: #b3b0ab; text-decoration: line-through; cursor: not-allowed; }
.n.buscado { outline: 3px solid var(--dorado); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.carrito { position: sticky; bottom: 0; background: rgb(255 255 255 / .96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 2px solid var(--naranja); padding: 14px 0 8px; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.carrito-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

/* ---------- ganadores */
.gan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gan-card, .gan { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; margin: 0; }
.gan { padding: 10px 0; border-bottom: 1px solid var(--linea); }
.gnum-pub { display: grid; place-items: center; min-width: 64px; height: 64px; padding: 0 8px; border-radius: 16px; background: var(--grad); color: #fff; font-weight: 800; font-size: 1.3rem; flex: none; }
.ganadores-rifa { border: 2px solid var(--dorado); }
.ultimos { margin-top: 34px; }

/* ---------- pie */
.foot { background: linear-gradient(120deg, #ffe9b8, #ffd3a1); padding-top: 24px; }
.foot-in { display: flex; gap: 24px; align-items: center; font-size: .9rem; }
.foot-links { display: flex; flex-direction: column; gap: 4px; margin-left: auto; }
.badge18 { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--tinta); display: grid; place-items: center; font-weight: 800; background: #fff; flex: none; }

p.copyright { text-align: center; font-size: .8rem; margin: 16px 0 0; padding: 12px; background: #fff; }

/* ---------- barra inferior (celular) */
.tabbar { display: none; }

@media (max-width: 760px) {
  body { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
  h1 { font-size: 1.45rem; }
  .card { padding: 18px; border-radius: 18px; }
  .nav, .hide-m { display: none; }
  .brand span { display: none; }
  .top-in { min-height: 58px; }
  .grid2, .row2, .row3 { grid-template-columns: 1fr; }
  .chips { grid-template-columns: repeat(2, 1fr); }
  .ticket { grid-template-columns: 1fr; gap: 6px; }
  .hero { flex-direction: column-reverse; text-align: center; padding: 22px 18px; gap: 8px; }
  .hero h1 { font-size: 1.75rem; }
  .hero img { max-width: 55%; }
  .rifa-top { grid-template-columns: 1fr; gap: 16px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .rifa { padding: 8px; }
  .rifa strong { font-size: .92rem; line-height: 1.3; }
  .numeros { grid-template-columns: repeat(5, 1fr); }
  .grid-tools input[type=number] { width: 100%; flex: 1 1 140px; }
  .grid-tools > #buscar { flex-basis: 100%; }
  .azar { flex: 1 1 100%; }
  .azar input { flex: 1; width: auto !important; }
  .carrito { bottom: calc(var(--tab-h) + var(--safe-b)); margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  .foot-in { flex-wrap: wrap; justify-content: center; text-align: center; }
  .foot-links { margin: 0; align-items: center; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b); background: rgb(255 255 255 / .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--linea); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem;
    font-weight: 600; color: var(--gris); text-decoration: none; }
  .tabbar svg { width: 24px; height: 24px; fill: currentColor; }
  .tabbar a.on { color: var(--rojo); }
  .tabbar .tab-cta svg { width: 34px; height: 34px; padding: 5px; border-radius: 50%; background: var(--grad); fill: #fff; margin-top: -10px;
    box-shadow: 0 4px 12px rgb(238 71 66 / .35); }
}
@media (max-width: 370px) {
  .cards { grid-template-columns: 1fr; }
  .numeros { grid-template-columns: repeat(4, 1fr); }
  .saldo-pill small { display: none; }
}
