/* Rifas en vivo — estilos comunes. Tokens de GRAFIA Studio (MANUAL-VISUAL-GRAFIA.md):
   base oscura #000A0F / #04141C, luz naranja #FBBA00, Montserrat. El color de cada rifa entra
   como --rifa y solo en detalles: la página es de GRAFIA, la boleta es del cliente. */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #000A0F;
  --bg-2: #04141C;
  --bg-3: #0B2230;
  --ink: #FFFFFF;
  --ink-dim: #B9BBB8;
  --ink-faint: #8A8E90;
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.22);
  --luz: #FBBA00;
  --grad: linear-gradient(120deg, #CE8F00, #FBBA00 55%, #FFE000);
  --ok: #22C55E;
  --ok-bg: #DCFCE7;
  --ok-ink: #166534;
  --debe: #FFB703;
  --debe-bg: #FFF3C4;
  --debe-ink: #7A4B00;
  --wa: #25D366;
  --rifa: #D7263D;
  --radio: 14px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--luz); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Barra superior de GRAFIA */
.g-barra { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--line); background: rgba(0, 10, 15, 0.86); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.g-barra a { text-decoration: none; }
.g-logo { flex: none; }
.g-logo img { height: 26px; width: auto; }
/* Las migas van en UNA línea: si la barra crece, tapa el contenido de abajo (pasó con títulos largos) */
.g-migas { display: flex; gap: 8px; font-size: 13px; color: var(--ink-faint); min-width: 0; white-space: nowrap; }
.g-migas > * { flex: none; }
.g-migas a { color: var(--ink-dim); }
.g-migas a:hover { color: var(--ink); }
.g-migas span[aria-current], .g-migas > :last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.g-migas span[aria-current] { color: var(--ink); font-weight: 600; }
@media (max-width: 480px) { .g-migas > a:first-child:not(:last-child), .g-migas > a:first-child:not(:last-child) + span { display: none; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 12px;
  border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; transition: transform 0.15s var(--ease), filter 0.15s; }
.btn:active { transform: scale(0.98); }
.btn--wa { background: var(--wa); color: #04210f; }
.btn--luz { background: var(--grad); color: #1d1300; }
.btn--fantasma { border-color: var(--line-2); background: transparent; }
.btn--fantasma:hover { background: rgba(255, 255, 255, 0.06); }
.btn--apagado { background: rgba(255, 255, 255, 0.05); color: var(--ink-faint); border-color: var(--line); cursor: not-allowed; font-weight: 600; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn svg { flex: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--ink-dim); }
.chip--vivo { color: #FFE9A8; border-color: rgba(251, 186, 0, 0.5); }
.chip--vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--luz); box-shadow: 0 0 10px var(--luz); animation: latido 1.8s infinite; }
@keyframes latido { 50% { opacity: 0.35; } }

/* Aviso flotante */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); opacity: 0; z-index: 90;
  background: #111c22; color: #fff; border: 1px solid var(--line-2); padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  max-width: min(92vw, 420px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); transition: 0.3s var(--ease); pointer-events: none; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* La cuadrícula de números */
.numeros { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.n { appearance: none; border: 1px solid var(--line-2); background: transparent; border-radius: 8px; padding: 0; height: 40px;
  font: 700 13px/1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink); letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center; transition: transform 0.12s, background 0.15s; }
.n:hover { border-color: rgba(255, 255, 255, 0.5); }
.n:active { transform: scale(0.94); }
.n--ocupado { background: rgba(255, 255, 255, 0.07); border-color: transparent; color: rgba(255, 255, 255, 0.3); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.25); }
.n--elegido { background: var(--rifa); border-color: var(--rifa); color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.paginas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.paginas button { flex: none; border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 7px 12px;
  font: 600 13px var(--font); color: var(--ink-dim); white-space: nowrap; }
.paginas button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }
.leyenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-dim); }
.leyenda i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--line-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
