/* ==========================================================
   RLoterias24H - estilos de todo el sitio
   Colores: BLANCO (base), NARANJA (secundario), ROJO (detalles).
   Para cambiar un color, edita solo las variables de aquí abajo.
   ========================================================== */
:root {
  --blanco: #ffffff;       /* fondo principal */
  --crema: #fff7ed;        /* fondo suave (secciones alternas, botones pequeños) */
  --borde: #fed7aa;        /* líneas y bordes (naranja muy claro) */
  --naranja: #f97316;      /* color secundario */
  --naranja-osc: #ea580c;  /* naranja más fuerte (textos, hover) */
  --rojo: #dc2626;         /* detalles */
  --rojo-claro: #fee2e2;   /* fondo suave del rojo */
  --texto: #1f2937;        /* texto principal */
  --suave: #6b7280;        /* texto secundario */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, Segoe UI, sans-serif; background: var(--blanco); color: var(--texto); line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
h1 { font-size: 1.7rem; }
h1 span { color: var(--naranja); }
.contenedor { max-width: 960px; margin: 0 auto; padding: 0 18px; }

/* ---------- Barra superior ---------- */
.barra { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.98); border-bottom: 3px solid var(--naranja); }
.barra .contenedor, .barra .cont { max-width: 960px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; }
.marca { font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--naranja-osc); }
.marca span { color: var(--rojo); }
.barra nav { display: flex; gap: 18px; font-size: .92rem; }
.barra nav a { text-decoration: none; color: var(--suave); padding: 4px 0; border-bottom: 2px solid transparent; }
.barra nav a:hover { color: var(--naranja-osc); }
.barra nav a.activo { color: var(--naranja-osc); font-weight: 600; border-bottom-color: var(--rojo); }
@media (max-width: 560px) {
  .barra .contenedor, .barra .cont { height: auto; flex-wrap: wrap; justify-content: center; padding: 8px 14px; gap: 4px 14px; }
  .barra nav { gap: 14px; font-size: .85rem; }
}

/* ---------- Botones ---------- */
.boton { display: inline-block; background: var(--naranja); color: #fff; font-weight: 700; padding: 13px 26px; border-radius: 30px; text-decoration: none; box-shadow: 0 4px 12px rgba(249,115,22,.3); }
.boton { border: 2px solid var(--naranja); transition: background .2s, color .2s; }
.boton:hover { background: #fff; color: var(--naranja-osc); }

/* ---------- Indicador "en vivo" ---------- */
.punto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rojo); margin-right: 7px; animation: pulso 1.5s infinite; }
@keyframes pulso { 50% { opacity: .3; } }

/* ---------- Inicio: portada ---------- */
.portada { text-align: center; padding: 52px 0 26px; }
.portada .etiqueta { display: inline-flex; align-items: center; font-size: .85rem; color: var(--suave); margin-bottom: 14px; }
.portada h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.15; margin-bottom: 14px; }
.portada p { max-width: 600px; margin: 0 auto; color: var(--suave); font-size: 1.05rem; }

/* ---------- Inicio: selector Animalitos / Loterías / Terminales ---------- */
.selector { padding: 10px 0 12px; }
.selector h2 { text-align: center; font-size: 1.05rem; margin-bottom: 14px; }
.opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.opcion { display: block; text-decoration: none; background: var(--blanco); border: 2px solid var(--borde); border-radius: 20px; padding: 26px 22px; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.05); transition: transform .15s, border-color .2s, box-shadow .2s, background .2s; }
.opcion:hover { transform: translateY(-3px); background: var(--naranja); border-color: var(--rojo); box-shadow: 0 8px 20px rgba(249,115,22,.35); }
.opcion .grande { font-size: 3rem; }
.opcion h3 { font-size: 1.4rem; margin: 6px 0; color: var(--naranja-osc); }
.opcion p { color: var(--suave); font-size: .92rem; margin-bottom: 14px; }
.opcion .ir { display: inline-block; background: var(--naranja); color: #fff; font-weight: 700; padding: 8px 20px; border-radius: 20px; font-size: .9rem; }
.opcion:hover .ir { background: #fff; color: var(--rojo); }
.opcion:hover h3, .opcion:hover p { color: #fff; }

/* ---------- Microbotones (chips) ---------- */
.micro { padding: 20px 0 40px; text-align: center; }
.micro h2 { font-size: .9rem; color: var(--suave); font-weight: 500; margin-bottom: 14px; }
.micro h4 { font-size: .8rem; color: var(--rojo); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.chips, #menu { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chips a, #menu a { background: var(--crema); text-decoration: none; padding: 7px 14px; border-radius: 20px; font-size: .82rem; border: 1px solid var(--borde); color: var(--texto); }
.chips a:hover, #menu a:hover { background: var(--naranja); border-color: var(--rojo); color: #fff; }
#menu { max-width: 900px; margin: 12px auto 0; padding: 0 16px; }

/* ---------- Inicio: secciones ---------- */
section.bloque { padding: 44px 0; }
section.bloque.alt { background: var(--crema); }
h2.titulo { font-size: 1.6rem; text-align: center; margin-bottom: 8px; }
h2.titulo span { color: var(--naranja); }
.sub { text-align: center; color: var(--suave); margin-bottom: 28px; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-top: 3px solid var(--rojo); border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.tarjeta .icono { font-size: 1.9rem; margin-bottom: 8px; }
.tarjeta h3 { font-size: 1.02rem; margin-bottom: 6px; }
.tarjeta p { color: var(--suave); font-size: .92rem; }
.quienes { max-width: 680px; margin: 0 auto; text-align: center; color: #374151; }
.quienes p + p { margin-top: 12px; }
.final { text-align: center; padding: 50px 0; }
.final h2 { font-size: 1.5rem; margin-bottom: 16px; }
.final .dos { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Páginas de resultados ---------- */
header.titulo { padding: 24px 16px 8px; text-align: center; }
.estado { margin-top: 8px; font-size: .85rem; color: var(--suave); }
#aviso { display: none; max-width: 900px; margin: 12px auto; padding: 10px 14px; border-radius: 10px; background: var(--rojo-claro); color: #991b1b; border: 1px solid #fecaca; font-size: .9rem; text-align: center; }
main { max-width: 900px; margin: 0 auto; padding: 12px 16px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

/* Tarjeta de cada sorteo: encabezado naranja con línea roja */
.loteria { background: var(--blanco); border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; scroll-margin-top: 90px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.loteria .cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; background: linear-gradient(90deg, var(--naranja-osc), var(--naranja)); color: #fff; border-bottom: 3px solid var(--rojo); }
.loteria .nom { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.loteria .nom::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.loteria .fecha { font-size: .82rem; color: rgba(255,255,255,.92); }
.loteria .cuerpo { padding: 14px 12px 12px; }
.vacio { color: var(--suave); font-size: .9rem; text-align: center; padding: 12px 0; }

/* Animalitos: casillas con el animal de cada sorteo */
.cuerpo .rejilla { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.rejilla .res { background: var(--crema); border: 2px solid var(--borde); border-radius: 12px; padding: 10px; text-align: center; }
.rejilla .res.ultimo { border-color: var(--rojo); background: var(--rojo-claro); }
.res .hora { font-size: .8rem; color: var(--suave); }
.res .emoji { font-size: 2rem; margin: 4px 0; }
.res .num { font-weight: 700; font-size: 1.1rem; }
.res .nombre { font-size: .85rem; color: var(--suave); }

/* Loterías y Terminales: tabla con horas arriba y números abajo */
.tabla-wrap { overflow-x: auto; text-align: center; }
table.res { border-collapse: collapse; margin: 0 auto; }
table.res th, table.res td { padding: 7px 14px; white-space: nowrap; }
table.res th { font-size: 1.1rem; font-weight: 700; color: var(--suave); }
table.res td { font-size: 1.25rem; font-weight: 600; border-bottom: 1px solid var(--borde); }
table.res td small { color: var(--rojo); font-size: .75rem; font-weight: 500; margin-left: 4px; }
table.res .ultimo { background: var(--rojo-claro); color: #b91c1c; }
table.res th.ultimo { border-radius: 8px 8px 0 0; }

/* Triples: columnas Triple A / B / C */
.cols { display: flex; flex-wrap: wrap; }
.cols .col { flex: 1 1 90px; min-width: 0; text-align: center; padding: 8px 6px; border-right: 1px solid var(--borde); }
.cols .col:last-child { border-right: 0; }
.cols h4 { display: inline-block; font-weight: 600; font-size: .9rem; color: var(--rojo); border-bottom: 2px solid var(--rojo); padding: 0 8px 3px; margin-bottom: 12px; }
.cols .fila { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 12px; padding: 3px 0; }
.cols .fila .h { color: var(--suave); font-size: .95rem; }
.cols .fila .n { font-weight: 700; font-size: 1.3rem; }
.cols .fila .n small { color: var(--rojo); font-size: .75rem; font-weight: 500; margin-left: 4px; }

/* ---------- Pie de página ---------- */
footer { border-top: 1px solid var(--borde); text-align: center; color: var(--suave); font-size: .78rem; padding: 24px 18px 34px; }
footer p + p { margin-top: 6px; }

/* Logo */
.marca { display:flex; align-items:center; gap:6px; }
.logo-mini { height: 44px; width: auto; }
.logo-grande { display:block; margin:0 auto 8px; width:min(340px,80%); height:auto; }

/* ===== Fuente Anton (títulos) ===== */
:root { --titulos: 'Anton', Impact, 'Arial Narrow Bold', sans-serif; }
h1, h2, h3, h4, .marca, .opcion .ir, .boton, .chips h4, .cab .nom, nav a {
  font-family: var(--titulos); font-weight: 400; letter-spacing: .04em; text-transform: uppercase;
}
h1 { letter-spacing: .03em; }
.marca { font-size: 1.5rem; }
nav a { font-size: 1rem; }
.chips a, #menu a { font-family: inherit; }

/* ===== Animaciones ===== */
@keyframes subir { from { opacity:0; transform: translateY(26px); } to { opacity:1; transform:none; } }
@keyframes entrar { from { opacity:0; transform: scale(.94); } to { opacity:1; transform:none; } }
@keyframes caer { from { opacity:0; transform: translateY(-100%); } to { opacity:1; transform:none; } }
@keyframes flota { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes latido { 50% { opacity: .55; } }
@keyframes brilloTexto { to { background-position: 200% center; } }

.barra { animation: caer .6s ease-out both; }
.logo-grande { animation: entrar .9s cubic-bezier(.2,1.3,.4,1) both, flota 4s 1s ease-in-out infinite; will-change: transform; }
.portada .etiqueta { animation: subir .6s .2s both; }
.portada h1 { animation: subir .7s .35s both; }
.portada h1 span {
  background: linear-gradient(90deg, var(--naranja), var(--rojo), var(--naranja)); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.portada p { animation: subir .7s .5s both; }
.opciones .opcion { animation: subir .7s backwards; }
.opciones .opcion:nth-child(1) { animation-delay: .6s; }
.opciones .opcion:nth-child(2) { animation-delay: .75s; }
.opciones .opcion:nth-child(3) { animation-delay: .9s; }
.opcion .grande { display:inline-block; transition: transform .3s; }
.opcion:hover .grande { transform: scale(1.25) rotate(-8deg); }
.opcion .ir { transition: transform .2s, background .2s, color .2s; }
.opcion:hover .ir { transform: translateX(4px); }
.boton { box-shadow: 0 4px 16px rgba(249,115,22,.4); }
.boton:hover { transform: translateY(-2px); animation: none; }
.chips a, #menu a { transition: transform .15s, background .2s, color .2s, border-color .2s; }
.chips a:hover, #menu a:hover { transform: translateY(-3px) scale(1.06); }
.punto { animation-duration: 1.4s; }

/* Aparecer al hacer scroll (lo activa animar.js) */
.reveal { will-change: opacity, transform; opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visto { opacity: 1; transform: none; will-change: auto; }

/* Sorteos de las páginas de resultados */
.loteria { transition: transform .2s, box-shadow .2s; }
body:not(.listo) .loteria { animation: subir .6s backwards; }
.loteria:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(249,115,22,.2); }
.loteria:nth-of-type(2) { animation-delay: .06s; } .loteria:nth-of-type(3) { animation-delay: .12s; }
.loteria:nth-of-type(4) { animation-delay: .18s; } .loteria:nth-of-type(5) { animation-delay: .24s; }
.ultimo { box-shadow: 0 4px 14px rgba(249,115,22,.4); }
.rejilla .res { transition: transform .15s; } .rejilla .res:hover { transform: scale(1.12); }
@keyframes cambio { from { background: #fde68a; } to { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Resultados por fecha ===== */
#barra-fecha { max-width: 900px; margin: 14px auto 0; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; background: var(--crema); border: 1px solid var(--borde); border-radius: 14px; }
#barra-fecha label { font-weight: 700; color: var(--naranja-osc); font-size: .92rem; }
.campo-fecha { font: inherit; font-size: .9rem; padding: 6px 10px; border: 2px solid var(--naranja); border-radius: 10px; background: #fff; color: var(--texto); cursor: pointer; }
.campo-fecha:focus { outline: 3px solid var(--rojo-claro); border-color: var(--rojo); }
.btn-hoy { font: inherit; font-weight: 700; font-size: .85rem; background: var(--rojo); color: #fff; border: 0; border-radius: 20px; padding: 7px 16px; cursor: pointer; }
.btn-hoy:hover { background: var(--naranja-osc); }
.ctl-fecha { display: inline-flex; align-items: center; gap: 6px; }
.ctl-fecha .campo-fecha { font-size: .78rem; padding: 3px 6px; border: 1px solid #fff; background: rgba(255,255,255,.95); }
.btn-x { font: inherit; font-weight: 800; background: var(--rojo); color: #fff; border: 2px solid #fff; border-radius: 50%; width: 24px; height: 24px; line-height: 1; cursor: pointer; }
@media (max-width: 560px) { #barra-fecha { margin: 12px 12px 0; } .loteria .cab .fecha { order: 3; width: 100%; } }
@media (max-width: 560px) { .barra nav { gap: 10px; } .barra nav a { font-size: .85rem; letter-spacing: .02em; } }
/* Selectores de fecha más grandes */
.campo-fecha { font-size: 1.1rem; padding: 10px 16px; border-radius: 12px; min-height: 46px; }
#barra-fecha { padding: 14px 18px; gap: 12px; }
#barra-fecha label { font-size: 1.05rem; }
.btn-hoy { font-size: 1rem; padding: 11px 20px; min-height: 46px; }
.ctl-fecha .campo-fecha { font-size: 1rem; padding: 8px 12px; min-height: 42px; border: 2px solid #fff; }
.btn-x { width: 38px; height: 38px; font-size: 1.05rem; }
.loteria .cab { padding: 16px 18px; }

/* Calendario grande */
.campo-fecha { font-weight: 700; color: var(--texto); }
.campo-fecha:hover { background: var(--crema); }
.cal-fondo { position: fixed; inset: 0; background: rgba(31,41,55,.55); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 1000; animation: entrar .2s both; }
.cal { background: #fff; border-radius: 20px; width: min(420px, 100%); padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.35); border-top: 6px solid var(--rojo); }
.cal-cab { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.cal-cab button { flex: 0 0 52px; height: 52px; font-size: 1.8rem; line-height: 1; border: 0; border-radius: 14px; background: var(--naranja); color: #fff; cursor: pointer; }
.cal-cab button:hover { background: var(--rojo); }
.cal-cab select { flex: 1; min-width: 0; height: 52px; font: inherit; font-size: 1.05rem; font-weight: 700; border: 2px solid var(--borde); border-radius: 14px; padding: 0 8px; background: #fff; color: var(--texto); }
.cal-rejilla { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dia-sem { text-align: center; font-weight: 800; color: var(--rojo); padding: 6px 0; }
.cal-dia { aspect-ratio: 1; min-height: 46px; font: inherit; font-size: 1.15rem; font-weight: 700; border: 2px solid transparent; border-radius: 12px; background: var(--crema); color: var(--texto); cursor: pointer; transition: transform .1s, background .15s; }
.cal-dia:hover:not(:disabled) { background: var(--naranja); color: #fff; transform: scale(1.08); }
.cal-dia:disabled { background: transparent; color: #cbd5e1; cursor: not-allowed; }
.cal-dia.es-hoy { border-color: var(--naranja); }
.cal-dia.elegido { background: var(--rojo); color: #fff; }
.cal-pie { display: flex; gap: 10px; margin-top: 14px; }
.cal-pie button { flex: 1; height: 50px; font: inherit; font-size: 1.05rem; font-weight: 800; border: 0; border-radius: 14px; background: var(--naranja); color: #fff; cursor: pointer; }
.cal-pie button.gris { background: #e5e7eb; color: var(--texto); }
@media (max-width: 400px) { .cal { padding: 12px; } .cal-dia { min-height: 40px; font-size: 1.05rem; } }
@media (max-width: 400px) { .cal-cab button { flex-basis: 44px; height: 48px; } .cal-cab select { height: 48px; font-size: .92rem; padding: 0 2px; } .cal-cab { gap: 5px; } }

/* ===== Sorteos que faltan ===== */
.faltan { text-align: center; font-weight: 700; color: var(--naranja-osc); background: var(--crema); border: 1px dashed var(--naranja); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; font-size: .95rem; }
.rejilla .res.pendiente { background: #fff; border: 2px dashed var(--borde); box-shadow: none; opacity: .9; }
.rejilla .res.pendiente .num { color: var(--naranja); }
.rejilla .res.pendiente.esperando { border-color: var(--rojo); box-shadow: 0 3px 12px rgba(220,38,38,.35); }
.rejilla .res.pendiente.esperando .nombre { color: var(--rojo); font-weight: 700; }
table.res th.pend, table.res td.pend { color: var(--naranja); border-bottom-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(249,115,22,.07) 6px 12px); }
table.res th.esperando { color: var(--rojo); }
.cols .fila.pend { opacity: .8; border-bottom: 1px dashed var(--borde); }
.fila.pend .n { color: var(--naranja); }
.cols .fila.pend.esperando { opacity: 1; border-bottom-color: var(--rojo); }
.cols .fila.pend.esperando .h { color: var(--rojo); font-weight: 700; }

/* ===== Más espacio entre bloques y micro-botones más pequeños ===== */
header.titulo { padding-bottom: 14px; }
#aviso { margin: 20px auto 0; }
#barra-fecha { margin: 24px auto 0; }
#menu { margin: 26px auto 0; gap: 6px; }
#menu a { font-size: .72rem; padding: 4px 11px; letter-spacing: .02em; }
#contenido { margin-top: 30px; }
#contenido .loteria { margin-bottom: 28px; }
.loteria .cuerpo { padding-top: 18px; padding-bottom: 18px; }
@media (max-width: 560px) { #menu { margin-top: 22px; } #contenido { margin-top: 24px; } }

/* ===== Logo de cada sorteo ===== */
.loteria .cab .nom { display: inline-flex; align-items: center; gap: 12px; }
.logo-sorteo { flex: none; width: 54px; height: 54px; border-radius: 50%; background: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-sorteo img { width: 100%; height: 100%; object-fit: contain; }
.logo-sorteo.insignia { color: var(--rojo); font-family: var(--titulos); font-size: 1.1rem; letter-spacing: .02em; }


/* ===== Fuente Londrina Solid (Google Fonts) ===== */
:root { --titulos: 'Londrina Solid', 'Anton', Impact, sans-serif; }
h1, h2, h3, h4, .marca, .opcion .ir, .boton, .chips h4, .cab .nom, nav a { letter-spacing: .02em; }
h1, h2, .marca { font-weight: 900; }
h3, h4, .cab .nom, nav a, .boton, .opcion .ir { font-weight: 400; }
.marca { font-size: 1.6rem; }
nav a { font-size: 1.15rem; }
h1 { font-size: 2.6rem; }
@media (max-width: 560px) { nav a { font-size: 1rem; } .barra nav a { font-size: 1rem; } h1 { font-size: 2.1rem; } }

/* ===== Dibujos de animales ===== */
.res .emoji { min-height: 72px; display: flex; align-items: center; justify-content: center; }
.img-animal { width: 72px; height: 72px; display: block; transition: transform .2s; }
.rejilla .res:hover .img-animal { transform: scale(1.12) rotate(-4deg); }
