/* Bingo Digital — azul noche, oro y cartones marfil. Mobile-first, sin scroll horizontal. */
@font-face { font-family: Lexend; src: url(/lexend.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Lexend; src: url(/lexend-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF; }

:root {
  --noche: #060e26; --noche-2: #0b1a40; --noche-3: #13275a; --linea: #24407f;
  --oro: #e2b248; --oro-claro: #ffe7a0; --oro-osc: #9a6a1f;
  --marfil: #fbf5e6; --marfil-2: #f1e7cc; --tinta: #1a2340; --tinta-2: #5b6687;
  --texto: #eef2ff; --texto-2: #a9b6db; --ok: #3ddc97; --mal: #ff6b6b; --aviso: #ffc857;
  --radio: 18px; --nav: 68px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--noche); color: var(--texto); font-family: Lexend, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
html, body { overflow-x: hidden; max-width: 100%; touch-action: pan-y; overscroll-behavior-x: none; }
body { background: radial-gradient(120% 60% at 50% -10%, #1a3373 0%, var(--noche) 60%) fixed; min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--nav) + var(--safe-b) + 12px); position: relative; overflow-x: hidden; }

/* ── Cabecera ─────────────────────────────────────────── */
.cab { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(6, 14, 38, .88); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(226, 178, 72, .15); }
.cab .logo { width: 40px; height: 40px; border-radius: 10px; }
.cab h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
.cab h1 small { display: block; font-size: 11px; color: var(--texto-2); font-weight: 400; letter-spacing: 0; }
.cab .esp { flex: 1; }
.saldo { display: flex; flex-direction: column; align-items: flex-end; background: var(--noche-2); border: 1px solid var(--linea); border-radius: 12px; padding: 5px 10px; min-width: 0; }
.saldo span { font-size: 10px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .08em; }
.saldo b { font-size: 14px; color: var(--oro-claro); white-space: nowrap; }
.ico-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--linea); background: var(--noche-2); display: grid; place-items: center; padding: 0; }
.ico-btn svg { width: 20px; height: 20px; }
.ico-btn[aria-pressed="true"] { border-color: var(--oro); color: var(--oro-claro); }
.cinta-demo { background: linear-gradient(90deg, var(--oro-osc), var(--oro)); color: #1b1203; font-size: 11px; font-weight: 700; text-align: center; padding: 3px; letter-spacing: .08em; }
.banda { margin: 10px 14px 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.banda.red { background: #3a2a07; border: 1px solid var(--aviso); color: #ffe3a3; }
.banda.susp { background: #3a1616; border: 1px solid var(--mal); color: #ffd0d0; }

/* ── Navegación inferior fija ─────────────────────────── */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: rgba(6, 14, 38, .96); border-top: 1px solid rgba(226, 178, 72, .18); padding-bottom: var(--safe-b); backdrop-filter: blur(10px); }
.nav .in { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; max-width: 560px; }
.nav button { background: none; border: 0; height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--texto-2); font-size: 11px; position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--oro-claro); }
.nav button[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--oro); }
.nav .punto { position: absolute; top: 10px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--mal); }

/* ── Bloques ──────────────────────────────────────────── */
.vista { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.card { background: linear-gradient(180deg, var(--noche-2), #0a1636); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--oro-claro); }
.sub { color: var(--texto-2); font-size: 13px; margin: 0; line-height: 1.45; }
.fila { display: flex; gap: 10px; align-items: center; }
.fila.entre { justify-content: space-between; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--noche-3); border: 1px solid var(--linea); white-space: nowrap; }
.chip.vivo { background: #3a0f14; border-color: #ff5a6e; color: #ffd0d6; }
.chip.vivo::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #ff5a6e; animation: late 1.2s infinite; }
.chip.venta { background: #0f3324; border-color: var(--ok); color: #c9ffe6; }
.chip.oro { background: #3b2a08; border-color: var(--oro); color: var(--oro-claro); }
.chip.mal { background: #3a1616; border-color: var(--mal); color: #ffd0d0; }
@keyframes late { 50% { opacity: .3; } }
.btn { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; font-size: 16px; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.oro { background: linear-gradient(180deg, #ffe7a0, var(--oro) 55%, #b57d25); color: #1b1203; box-shadow: 0 6px 18px rgba(226, 178, 72, .25); }
.btn.sec { background: var(--noche-3); border: 1px solid var(--linea); color: var(--texto); }
.btn.bloque { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.chico { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.enlace { background: none; border: 0; color: var(--oro-claro); text-decoration: underline; padding: 6px 0; font-size: 14px; }

/* ── Lobby: Sala Federal ──────────────────────────────── */
.hero { text-align: center; position: relative; overflow: hidden; }
.hero .logo-g { width: min(46vw, 190px); height: auto; display: block; margin: 0 auto 4px; filter: drop-shadow(0 10px 30px rgba(226, 178, 72, .25)); }
.pozo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.pozo div { background: var(--noche); border: 1px solid var(--linea); border-radius: 14px; padding: 10px; }
.pozo span { display: block; font-size: 11px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .08em; }
.pozo b { display: block; font-size: 20px; color: var(--oro-claro); margin-top: 2px; }
.pozo .gr { grid-column: 1 / -1; }
.cuenta { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 800; letter-spacing: .02em; }
.cuenta.ur { color: var(--aviso); }
.datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.datos dt { color: var(--texto-2); }
.datos dd { margin: 0; text-align: right; font-weight: 600; }
.jugadores { display: flex; flex-wrap: wrap; gap: 8px; }
.jug { display: flex; align-items: center; gap: 6px; background: var(--noche); border: 1px solid var(--linea); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12px; max-width: 100%; }
.jug img { width: 26px; height: 26px; border-radius: 50%; background: var(--noche-3); }
.avatar { border-radius: 50%; background: var(--noche-3); }

/* ── Cartón ───────────────────────────────────────────── */
.carton { background: var(--marfil); color: var(--tinta); border-radius: 14px; padding: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35), inset 0 0 0 2px var(--marfil-2); position: relative; }
.carton .cid { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--tinta-2); padding: 0 2px 6px; font-weight: 600; }
.carton .cid b { color: var(--tinta); }
.grilla { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.celda { aspect-ratio: 1 / 1.05; display: grid; place-items: center; border-radius: 7px; background: #fff; font-weight: 700; font-size: clamp(12px, 4.2vw, 19px); position: relative; border: 1px solid #e9dfc3; font-variant-numeric: tabular-nums; }
.celda.v { background: repeating-linear-gradient(135deg, #efe4c6 0 4px, #f6eedb 4px 8px); border-color: transparent; }
.celda.m::after { content: ''; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 231, 160, .95), rgba(226, 178, 72, .85) 60%, rgba(154, 106, 31, .9)); mix-blend-mode: multiply; }
.celda.m { color: #2b1a00; }
.celda.ult { animation: pop .9s ease; box-shadow: 0 0 0 3px #ff5a6e; }
.fila-gana .celda:not(.v) { box-shadow: 0 0 0 2px #1b9f6c inset; background: #d8ffe9; }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(1.25); } 100% { transform: scale(1); } }
.carton.chico .celda { font-size: clamp(9px, 2.4vw, 12px); border-radius: 4px; }
.carton.chico { padding: 6px; border-radius: 10px; }
.carton.chico .cid { font-size: 10px; padding-bottom: 4px; }
.falta { font-size: 12px; color: var(--tinta-2); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.falta b { color: var(--tinta); }
.falta.cerca b { color: #b3261e; }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini button { min-width: 0; background: none; border: 2px solid transparent; padding: 0; border-radius: 12px; text-align: left; }
.mini button[aria-pressed="true"] { border-color: var(--oro); }
.mini .carton { padding: 5px; box-shadow: none; }
.mini .grilla { gap: 1px; }
.mini .celda { border-radius: 2px; border: 0; min-width: 0; aspect-ratio: 1 / 1.15; background: #e6dcc0; }
.mini .celda.v { background: transparent; }
.mini .celda.m { background: transparent; }
.mini .celda.m::after { inset: 4%; }
.mini .falta { font-size: 10px; margin-top: 3px; }

/* ── Sorteo en vivo ───────────────────────────────────── */
.tablero { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.bola { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 28%, #fff, var(--oro-claro) 30%, var(--oro) 62%, var(--oro-osc)); box-shadow: 0 10px 30px rgba(226, 178, 72, .35), inset -6px -8px 14px rgba(0, 0, 0, .25); position: relative; }
.bola::before { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: var(--noche); box-shadow: inset 0 0 0 3px var(--oro-claro); }
.bola b { position: relative; font-size: 34px; color: var(--oro-claro); font-variant-numeric: tabular-nums; }
.bola.nueva { animation: rodar .7s cubic-bezier(.2, .8, .2, 1.2); }
.bola.vacia b { font-size: 16px; color: var(--texto-2); }
@keyframes rodar { 0% { transform: translateX(-60px) rotate(-200deg) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.destello { position: fixed; inset: 0; pointer-events: none; z-index: 25; background: radial-gradient(circle at 50% 30%, rgba(255, 231, 160, .35), transparent 60%); animation: destello .8s ease forwards; }
@keyframes destello { from { opacity: 1; } to { opacity: 0; } }
.ultimas { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.ultimas i { font-style: normal; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: var(--noche-3); border: 1px solid var(--linea); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.ultimas i:first-child { background: var(--oro); color: #1b1203; border-color: var(--oro-claro); }
.orden { font-size: 12px; color: var(--texto-2); }
.objetivo { display: flex; gap: 8px; }
.objetivo span { flex: 1; text-align: center; padding: 8px; border-radius: 12px; background: var(--noche); border: 1px solid var(--linea); font-size: 12px; }
.objetivo span.on { border-color: var(--oro); color: var(--oro-claro); }
.objetivo span.ok { border-color: var(--ok); color: #c9ffe6; text-decoration: line-through; }

/* ── Bolillero 1–90 ───────────────────────────────────── */
.bolillero { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.bolillero span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-size: clamp(10px, 3vw, 14px); background: var(--noche); border: 1px solid var(--linea); color: var(--texto-2); font-variant-numeric: tabular-nums; }
.bolillero span.s { background: radial-gradient(circle at 35% 30%, var(--oro-claro), var(--oro) 60%, var(--oro-osc)); color: #1b1203; font-weight: 700; border-color: transparent; }
.bolillero span.u { box-shadow: 0 0 0 3px #ff5a6e; }
.historial { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.historial li { background: var(--noche); border: 1px solid var(--linea); border-radius: 10px; padding: 6px; text-align: center; }
.historial li small { display: block; font-size: 10px; color: var(--texto-2); }
.historial li b { font-size: 16px; }

/* ── Hojas (bottom sheet) y avisos ────────────────────── */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 18, .7); display: flex; align-items: flex-end; justify-content: center; animation: aparece .2s ease; }
.hoja { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #0e1f4b, var(--noche)); border-radius: 22px 22px 0 0; border: 1px solid var(--linea); border-bottom: 0; padding: 10px 16px calc(18px + var(--safe-b)); animation: sube .25s ease; }
.hoja .agarre { width: 44px; height: 5px; border-radius: 3px; background: var(--linea); margin: 2px auto 12px; }
.hoja h2 { margin: 0 0 4px; font-size: 20px; }
.hoja .cerrar { float: right; margin-top: -2px; }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }
@keyframes aparece { from { opacity: 0; } }
.opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.opciones button { background: var(--noche); border: 2px solid var(--linea); border-radius: 16px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.opciones button b { font-size: 28px; }
.opciones button span { font-size: 12px; color: var(--texto-2); }
.opciones button[aria-checked="true"] { border-color: var(--oro); background: #1b2a55; }
.opciones button[aria-checked="true"] b { color: var(--oro-claro); }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px dashed var(--linea); border-bottom: 1px dashed var(--linea); margin-bottom: 12px; }
.total b { font-size: 24px; color: var(--oro-claro); }
.msg { padding: 10px 12px; border-radius: 12px; font-size: 13px; margin-bottom: 12px; }
.msg.mal { background: #3a1616; border: 1px solid var(--mal); color: #ffd0d0; }
.msg.ok { background: #0f3324; border: 1px solid var(--ok); color: #c9ffe6; }
.msg.av { background: #3a2a07; border: 1px solid var(--aviso); color: #ffe3a3; }
.toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; background: #0e1f4b; border: 1px solid var(--oro); color: var(--texto); padding: 10px 14px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 28px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: aparece .2s ease; display: flex; gap: 10px; align-items: center; }
.toast img { width: 30px; height: 30px; border-radius: 50%; }

/* ── Celebración ──────────────────────────────────────── */
.festejo { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(2, 6, 18, .78); padding: 18px; animation: aparece .25s ease; }
.festejo .caja { width: 100%; max-width: 420px; text-align: center; background: linear-gradient(180deg, #13275a, var(--noche)); border: 2px solid var(--oro); border-radius: 24px; padding: 20px 16px; box-shadow: 0 20px 60px rgba(226, 178, 72, .3); }
.festejo .titulo { font-size: 40px; font-weight: 900; margin: 4px 0; background: linear-gradient(180deg, #fff3c9, var(--oro) 60%, var(--oro-osc)); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .02em; }
.festejo .monto { font-size: 30px; font-weight: 800; color: var(--oro-claro); }
.barra-auto { height: 4px; border-radius: 2px; background: var(--noche-3); overflow: hidden; margin-top: 14px; }
.barra-auto i { display: block; height: 100%; background: var(--oro); animation: llena linear forwards; }
@keyframes llena { from { width: 0; } to { width: 100%; } }
.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 56; overflow: hidden; }
.confeti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: cae 2.6s linear forwards; }
@keyframes cae { to { transform: translateY(105vh) rotate(720deg); } }

/* ── Resultado, historial y comprobante ───────────────── */
.res-titulo { font-size: 28px; font-weight: 900; margin: 0; }
.desglose { width: 100%; border-collapse: collapse; font-size: 14px; }
.desglose td { padding: 8px 0; border-bottom: 1px solid rgba(36, 64, 127, .6); }
.desglose td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.desglose tr.tot td { border-bottom: 0; font-size: 18px; color: var(--oro-claro); font-weight: 800; padding-top: 12px; }
.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lista button { width: 100%; text-align: left; background: linear-gradient(180deg, var(--noche-2), #0a1636); border: 1px solid var(--linea); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.lista button .t { font-weight: 700; }
.lista button .s { font-size: 12px; color: var(--texto-2); }
.lista button .m { text-align: right; font-weight: 700; color: var(--oro-claro); }
.ids { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--texto-2); word-break: break-all; }
.vacio { text-align: center; padding: 28px 10px; color: var(--texto-2); }

/* ── Compartir ────────────────────────────────────────── */
.previa { display: flex; justify-content: center; margin: 10px 0; }
.previa canvas { width: min(58vw, 230px); height: auto; aspect-ratio: 9 / 16; border-radius: 16px; border: 1px solid var(--linea); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.redes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.redes button { background: var(--noche); border: 1px solid var(--linea); border-radius: 14px; padding: 10px 2px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--texto); }
.redes svg { width: 26px; height: 26px; }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.interruptor input { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--noche-3); border: 1px solid var(--linea); position: relative; flex: 0 0 48px; }
.interruptor input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--texto-2); transition: left .15s; }
.interruptor input:checked { background: #1b2a55; border-color: var(--oro); }
.interruptor input:checked::after { left: 23px; background: var(--oro); }

/* ── Ingreso y carga ──────────────────────────────────── */
.cargando, .ingreso { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.cargando img { width: 160px; height: auto; animation: late 1.6s infinite; }
.ingreso img { width: min(60vw, 240px); height: auto; }
.ingreso form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.campo label { display: block; font-size: 13px; color: var(--texto-2); margin-bottom: 6px; }
.campo input { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--linea); background: var(--noche-2); font-size: 16px; }

@media (min-width: 420px) { .bola { width: 110px; height: 110px; } .bola b { font-size: 40px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
