/* Quiniela · estilos propios. La base (colores, letra, botones) viene de zojim-ui.css. */

/* Color: petróleo (calma, claridad y confianza, como un informe). A propósito NO es rojo ni dorado:
   la app informa, no entusiasma a jugar. */
[data-app="lacabeza"] {
  --z-app-1: #67e8f9;
  --z-app-2: #0891b2;
  --z-app-tinta: #04161c;
  --q-acento: #7eeaf8;               /* petróleo claro para textos sobre negro */
  --q-fondo: rgba(34, 211, 238, .09);
  --q-mio: #7ee2a8;                  /* verde: "salió tu número" */
}
/* Por si zojim-ui.css no carga (sin internet la primera vez) */
body { margin: 0; background: #09090a; color: #f5f3ee; font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6; }
html { font-size: 112.5%; }
[hidden] { display: none !important; }

.contenedor { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
@media (min-width: 720px) { .contenedor { padding: 0 32px; } }

/* Cabecera */
.cabecera { position: sticky; top: 0; z-index: 20; background: rgba(9, 9, 10, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--z-borde, rgba(255,255,255,.12)); padding-top: env(safe-area-inset-top); }
.cabecera-fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.marca { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; color: var(--z-texto, #f5f3ee) !important; text-decoration: none; font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.marca img { width: 44px; height: 44px; border-radius: 22%; box-shadow: 0 10px 26px -12px #0891b2; }
.btn-avisos { min-height: 48px; padding: 8px 18px; font-size: 1rem; }

main { padding-top: 16px; padding-bottom: 32px; }
main:focus { outline: none; }

/* Barra de abajo (celular) / arriba del contenido (PC) */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(14, 14, 16, .97); border-top: 1px solid var(--z-borde-fuerte, rgba(255,255,255,.28)); padding-bottom: env(safe-area-inset-bottom); }
.barra a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 2px; color: var(--z-texto-2, #d4d0c8) !important; text-decoration: none; font-weight: 600; font-size: .9rem; line-height: 1.15; text-align: center; -webkit-tap-highlight-color: transparent; }
.barra svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.barra a[aria-current="page"] { color: var(--q-acento) !important; background: var(--q-fondo); box-shadow: inset 0 3px 0 var(--z-app-2); }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
/* El "A+" de legal.js va arriba de la barra */
@media (max-width: 899px) { #letra-grande { bottom: calc(80px + env(safe-area-inset-bottom)) !important; } }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .barra { position: sticky; top: 73px; bottom: auto; z-index: 15; max-width: 900px; margin: 0 auto; padding: 12px 32px 0; box-sizing: border-box; border: none; background: transparent; gap: 10px; }
  .barra a { flex-direction: row; gap: 10px; min-height: 54px; border-radius: 999px; border: 2px solid var(--z-borde-fuerte, rgba(255,255,255,.28)); background: rgba(14,14,16,.95); font-size: 1rem; }
  .barra a[aria-current="page"] { box-shadow: none; border-color: var(--z-app-2); }
}

/* Aviso de "sin internet" o "datos viejos" */
.aviso-red { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 16px 18px; border-radius: 16px; border: 2px solid rgba(245, 203, 110, .7); background: rgba(245, 203, 110, .1); color: var(--z-texto, #f5f3ee); font-weight: 600; }
.aviso-red .z-btn { min-height: 48px; }

/* Títulos */
.titulo-zona { margin: 8px 0 14px; }
.titulo { margin: 2px 0 0; font-size: clamp(1.75rem, 6vw, 2.6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; }
.titulo em { font-family: var(--z-serif, Georgia, serif); font-style: italic; font-weight: 400; background: linear-gradient(120deg, var(--z-app-1), var(--z-app-2)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.actualizado { margin: 6px 0 0; color: var(--z-texto-2, #d4d0c8); font-size: 1.05rem; }
.actualizado b { color: var(--z-texto, #f5f3ee); }
.explica { color: var(--z-texto-2, #d4d0c8); margin: 0 0 14px; }

/* Selector de lotería: botones grandes, todos a la vista */
.loterias { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr)); gap: 8px; margin: 0 0 18px; }
.loterias button { min-height: 54px; padding: 6px 8px; border-radius: 999px; border: 2px solid var(--z-borde-fuerte, rgba(255,255,255,.28)); background: rgba(255,255,255,.04); color: var(--z-texto, #f5f3ee); font: 600 1rem/1.15 var(--z-sans, sans-serif); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.loterias button:hover { background: rgba(255,255,255,.08); }
.loterias button[aria-pressed="true"] { border-color: transparent; background: linear-gradient(120deg, var(--z-app-1), var(--z-app-2)); color: var(--z-app-tinta); box-shadow: 0 10px 30px -14px #0891b2; }

/* Sorteos */
.sorteos { display: grid; gap: 14px; }
@media (min-width: 720px) { .sorteos { grid-template-columns: 1fr 1fr; } .sorteo.abierto { grid-column: 1 / -1; } }
.sorteo { position: relative; border-radius: 24px; border: 1px solid var(--z-borde, rgba(255,255,255,.12)); background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)); padding: 18px 18px 16px; overflow: hidden; }
.sorteo::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--z-app-1), var(--z-app-2)); opacity: .9; }
.sorteo.pendiente::before { background: rgba(255,255,255,.18); }
.sorteo-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sorteo-nombre { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.sorteo-hora { color: var(--z-texto-2, #d4d0c8); font-size: 1rem; }
.cabeza { display: flex; align-items: center; gap: 14px; margin: 10px 0 6px; flex-wrap: wrap; }
.cabeza-tit { font-size: var(--z-t-chico, .875rem); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--q-acento); }
.cabeza-num { font-variant-numeric: tabular-nums; font-size: clamp(3.4rem, 17vw, 4.6rem); line-height: 1; font-weight: 750; letter-spacing: .04em; color: var(--z-texto, #f5f3ee); }
.cabeza-num.mio { color: var(--q-mio); }
.cabeza-sueno { color: var(--z-texto-2, #d4d0c8); font-size: 1rem; }
.cabeza-sueno b { color: var(--z-texto, #f5f3ee); font-weight: 600; }
.sorteo-espera { margin: 14px 0 8px; font-size: 1.2rem; color: var(--z-texto-2, #d4d0c8); }
.sorteo-espera b { color: var(--z-texto, #f5f3ee); }
.sorteo-fuente { margin: 8px 0 0; font-size: var(--z-t-chico, .875rem); color: var(--z-texto-3, #aaa69e); }
.sorteo-fuente a { color: var(--z-texto-3, #aaa69e) !important; display: inline-flex; min-height: 2.6rem; align-items: center; }
.ver-20 { width: 100%; margin-top: 8px; }
.mio-aviso { margin: 8px 0 0; padding: 10px 14px; border-radius: 14px; border: 2px solid rgba(126, 226, 168, .6); background: rgba(126, 226, 168, .1); font-weight: 600; }

/* Los 20 números: dos columnas (1 al 10 y 11 al 20) */
.veinte { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(10, auto); grid-auto-flow: column; gap: 6px 10px; counter-reset: none; }
.veinte li { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 48px; padding: 4px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.veinte .pos { color: var(--z-texto-2, #d4d0c8); font-size: 1rem; font-weight: 600; min-width: 2.2em; }
.veinte .num { font-variant-numeric: tabular-nums; font-size: 1.55rem; font-weight: 700; letter-spacing: .05em; }
.veinte li:first-child { border-color: var(--z-app-2); background: var(--q-fondo); }
.veinte li.mio { border-color: rgba(126, 226, 168, .8); background: rgba(126, 226, 168, .12); }
.veinte li.mio .num { color: var(--q-mio); }
@media (min-width: 720px) { .veinte { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(5, auto); } }

/* Cargando, vacío */
.cargando, .vacio { display: flex; align-items: center; gap: 12px; padding: 24px 4px; color: var(--z-texto-2, #d4d0c8); }
.cargando .z-cargando { border-color: rgba(255,255,255,.2); border-top-color: #22d3ee; }

/* Formularios en fila */
.fila-campos { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 640px) { .fila-campos { grid-template-columns: 1fr 1fr auto; align-items: end; } .fila-campos .z-campo { margin: 0; } }
.z-entrada[type="date"] { color-scheme: dark; }
select.z-entrada { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23f5f3ee' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 22px; }

/* Mis números */
.mis-lista { display: grid; gap: 10px; margin: 16px 0; padding: 0; list-style: none; }
.mi-num { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 12px 12px 18px; border-radius: 18px; border: 1px solid var(--z-borde, rgba(255,255,255,.12)); background: rgba(255,255,255,.04); flex-wrap: wrap; }
.mi-num .num { font-variant-numeric: tabular-nums; font-size: 1.9rem; font-weight: 750; letter-spacing: .06em; }
.mi-num .estado { flex: 1 1 12rem; color: var(--z-texto-2, #d4d0c8); }
.mi-num .estado b { color: var(--q-mio); }
.mi-num .z-btn { min-height: 48px; padding: 6px 16px; font-size: 1rem; }
.resumen-mios { display: grid; gap: 10px; margin: 0 0 16px; }

/* Sueños */
.suenos { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
@media (min-width: 720px) { .suenos { grid-template-columns: 1fr 1fr; } }
.sueno { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--z-borde, rgba(255,255,255,.12)); background: rgba(255,255,255,.035); }
.sueno .num { flex: 0 0 auto; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 14px; background: var(--q-fondo); border: 1px solid rgba(103,232,249,.35); color: var(--q-acento); font-size: 1.4rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.sueno h3 { margin: 0; font-size: 1.15rem; }
.sueno p { margin: 2px 0 0; color: var(--z-texto-2, #d4d0c8); }
.nota-folclore { color: var(--z-texto-2, #d4d0c8); }

/* Ayuda y avisos */
.tel { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 22px; border: 1px solid var(--z-borde, rgba(255,255,255,.12)); background: rgba(255,255,255,.04); margin-bottom: 12px; }
.tel h3 { margin: 0; font-size: 1.2rem; }
.tel p { margin: 0; color: var(--z-texto-2, #d4d0c8); }
.tel .z-btn { margin-top: 10px; align-self: flex-start; }
.aviso-fijo { margin-top: 32px; }
.aviso-botones { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.bloque { margin: 28px 0; }
.bloque h2 { font-size: 1.45rem; margin: 0 0 10px; letter-spacing: -0.02em; }
.precio { font-size: 2rem; font-weight: 750; }
.precio small { font-size: 1rem; font-weight: 500; color: var(--z-texto-2, #d4d0c8); }
.interruptor { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--z-borde-fuerte, rgba(255,255,255,.28)); margin-bottom: 10px; cursor: pointer; }
.interruptor input { width: 28px; height: 28px; accent-color: #22d3ee; flex-shrink: 0; }

/* Confirmación de edad */
.edad { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 8, .96); overflow-y: auto; }
.edad-caja { width: 100%; max-width: 30rem; display: grid; gap: 14px; text-align: center; padding: 28px 22px; border-radius: 28px; border: 1px solid rgba(103,232,249,.35); background: #111114; box-sizing: border-box; }
.edad-caja img { justify-self: center; border-radius: 22%; }
.edad-caja h1 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.edad-caja p { margin: 0; color: var(--z-texto-2, #d4d0c8); }
.edad-chico { font-size: 1rem; }
.edad-chico a { color: var(--q-acento) !important; }

/* Mensaje corto de confirmación */
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(84px + env(safe-area-inset-top)); z-index: 120; max-width: calc(100% - 32px); padding: 14px 20px; border-radius: 16px; background: #1d2b22; border: 2px solid rgba(126,226,168,.7); color: #f5f3ee; font-weight: 600; box-shadow: 0 20px 40px -20px #000; }
@media (min-width: 900px) { .toast { top: 150px; } }

@media (prefers-reduced-motion: no-preference) {
  .veinte { animation: aparecer .25s ease-out; }
  @keyframes aparecer { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}
.mio-hits { margin: 4px 0 0; padding-left: 1.1em; }
.mio-hits li { margin: 2px 0; }
.mi-num .estado .mio-hits b { color: var(--z-texto, #f5f3ee); }
.mi-num .estado .mio-hits b ~ b { color: var(--q-mio); }
a.z-btn-app, a.z-btn-app:hover { color: var(--z-app-tinta) !important; text-decoration: none; }
