/* Fierro7: alto contraste para usar al sol, botones grandes para usar con guante */
:root {
  --fondo: #F3F5F8;
  --tarjeta: #FFFFFF;
  --texto: #10141A;
  --suave: #4A5260;
  --borde: #D8DEE7;
  --borde-fuerte: #98A2B3;
  --azul: #405F8C;          /* interfaz: 6,5:1 sobre blanco */
  --azul-oscuro: #2B4366;
  --azul-claro: #E3EAF5;
  --azul-noche: #1C2B44;    /* modo "marcas a otro": distinto del azul normal */
  --marca: #7493C0;         /* azul del logo: solo para el logo, no para texto */
  --rojo: #9B2C1F;
  --rojo-claro: #F8E5E2;
  --radio: 16px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; }

.pantalla {
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}

.pila { display: flex; flex-direction: column; gap: 14px; }
.centro { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.centro-texto { text-align: center; }

h1 { font-size: 22px; margin: 0; font-weight: 800; }
h2 { font-size: 18px; margin: 0; font-weight: 700; }
p { margin: 0; line-height: 1.45; }
.nota { font-size: 14px; color: var(--suave); }
.seccion { margin-top: 8px; }
.vacio { color: var(--suave); text-align: center; padding: 24px 8px; }

/* Marca */
.marca { display: block; height: 24px; width: auto; }
.logo-portada { display: block; width: 150px; height: auto; margin: 0 auto 8px; }
.cargando-logo { width: 96px; height: 96px; border-radius: 22px; }
.portada { text-align: center; padding: 48px 0 16px; }
.portada.pequena { padding: 8px 0 0; }
.portada .sub { color: var(--suave); margin-top: 6px; }

/* Cabecera */
.cabecera { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.cabecera h1 { flex: 1; }
.cabecera-texto { flex: 1; min-width: 0; }
.cabecera .marca { margin-right: auto; }
.icono-boton {
  width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
  color: var(--azul); border-radius: 22px;
}
.icono-boton svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chip {
  height: 44px; padding: 0 16px; border: 1.5px solid var(--azul); border-radius: 22px;
  display: flex; align-items: center; font-weight: 700; color: var(--azul); text-decoration: none; background: var(--tarjeta);
}

/* Tarjetas y listas */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; }
.lista { display: flex; flex-direction: column; gap: 10px; }
.fila, .fila-plana {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 64px;
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  color: var(--texto); text-decoration: none; text-align: left; font: inherit; width: 100%;
}
button.fila { cursor: pointer; }
.fila-plana { padding: 12px 12px 12px 16px; }
.fila-texto { flex: 1; min-width: 0; }
.fila-titulo { font-weight: 700; font-size: 17px; }
.fila-sub { font-size: 14px; color: var(--suave); margin-top: 2px; }
.fila-dato { font-size: 20px; font-weight: 800; }

.estado { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: var(--fondo); color: var(--suave); white-space: nowrap; }
.estado-en_juego { background: var(--azul); color: #FFFFFF; }
.estado-abierta { background: var(--azul-claro); color: var(--azul-oscuro); }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; border: none; padding: 0; margin: 0; min-width: 0; }
.campo > span, .campo > legend { font-size: 14px; font-weight: 600; color: var(--suave); padding: 0; margin-bottom: 6px; }
input, select {
  font: inherit; font-size: 17px; height: 52px; padding: 0 14px; width: 100%;
  border: 1.5px solid var(--borde-fuerte); border-radius: 12px; background: var(--tarjeta); color: var(--texto);
}
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }

.segmentado { display: flex; gap: 4px; padding: 4px; background: #E3E8EF; border-radius: 14px; }
.segmentado button {
  flex: 1; min-height: 48px; border: none; border-radius: 11px; background: transparent;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--suave); cursor: pointer; padding: 4px 6px;
}
.segmentado button.activo { background: var(--azul); color: #FFFFFF; font-weight: 700; }

/* Botones */
.boton {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: var(--radio); border: none;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.boton:disabled { opacity: 0.5; cursor: default; }
.boton.grande { min-height: 58px; font-size: 18px; }
.boton.primario { background: var(--azul); color: #FFFFFF; }
.boton.secundario { background: var(--tarjeta); color: var(--azul); border: 1.5px solid var(--azul); }
.boton.whatsapp { background: #1F7A4D; color: #FFFFFF; flex: 1; }
.boton.enlace { background: none; color: var(--azul); min-height: 44px; padding: 0 8px; font-size: 16px; }
.boton.enlace.izquierda { align-self: flex-start; padding: 0; }
.fila-botones { display: flex; gap: 10px; }
.fila-botones .boton { flex: 1; }

.enlace-caja input { font-size: 15px; background: var(--fondo); }

/* Avisos */
.aviso {
  position: sticky; top: 0; z-index: 10; margin: 0 0 8px; padding: 14px 16px;
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.aviso-error { background: var(--rojo-claro); color: var(--rojo); border-bottom: 2px solid var(--rojo); }

/* ---------- Juego (pantalla B) ---------- */
.juego { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 96px; }
.juego-cabecera {
  display: flex; align-items: center; gap: 6px; background: var(--azul); color: #FFFFFF;
  padding: max(10px, env(safe-area-inset-top)) 10px 12px;
}
.icono-boton.claro { color: #FFFFFF; }
.flecha {
  width: 48px; height: 48px; flex: none; border-radius: 24px; border: none; background: rgba(255,255,255,0.16);
  color: #FFFFFF; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.flecha svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.flecha:disabled { opacity: 0.35; }
.flecha.lista { background: #FFFFFF; color: var(--azul); }
.juego-hoyo { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.juego-hoyo .num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.juego-hoyo .datos { font-size: 14px; font-weight: 600; opacity: 0.95; }

.match-linea { text-align: center; font-weight: 800; padding: 10px 16px 0; }

.chips { display: grid; gap: 8px; padding: 14px 16px; }
.chip-jugador {
  min-height: 84px; border-radius: 14px; border: 1px solid var(--borde); background: var(--tarjeta); color: var(--suave);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px; min-width: 0;
}
.chip-jugador.yo { border: 2.5px solid var(--azul); background: var(--azul-claro); color: var(--texto); }
.chip-jugador.marcado { border: 2.5px dashed var(--azul); color: var(--texto); }
.chip-jugador .n { font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-jugador .g { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--texto); }
.chip-jugador .r { font-size: 12px; font-weight: 600; white-space: nowrap; }

.pestanas { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0 16px 12px; padding: 4px; background: #E3E8EF; border-radius: 14px; }
.pestanas.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pestanas button { height: 48px; border: none; border-radius: 11px; background: transparent; color: var(--suave); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.pestanas button.activa { background: var(--azul); color: #FFFFFF; }
.pestanas button.activa.oscura { background: var(--azul-noche); }

.banda { margin: 0 16px; padding: 12px 16px; border-radius: 16px; background: var(--azul); color: #FFFFFF; display: flex; align-items: center; gap: 12px; }
.banda.oscura { background: var(--azul-noche); }
.banda .inicial { width: 40px; height: 40px; border-radius: 20px; background: rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex: none; }
.banda .nombre { flex: 1; min-width: 0; font-size: 22px; font-weight: 800; }
.banda .info { font-size: 13px; font-weight: 600; opacity: 0.9; text-align: right; }

.resultados { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 4px; }
.resultado {
  height: 84px; border-radius: 16px; border: 1.5px solid #C5CDD9; background: var(--tarjeta); color: var(--texto);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; cursor: pointer;
}
.resultado .g { font-size: 34px; font-weight: 800; line-height: 1; }
.resultado .t { font-size: 13px; font-weight: 600; }
.resultado.elegido { background: var(--azul); border-color: var(--azul); color: #FFFFFF; }
.resultado.elegido.oscuro { background: var(--azul-noche); border-color: var(--azul-noche); }
.juego > .boton.enlace { margin: 0 16px; }

.detalle { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.detalle.apagado { opacity: 0.4; pointer-events: none; }
.etiqueta { font-size: 14px; font-weight: 600; color: var(--suave); }
.botonera { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.botonera.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.botonera button { height: 50px; border-radius: 12px; border: 1.5px solid #C5CDD9; background: var(--tarjeta); color: var(--texto); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.botonera button.elegido { background: var(--azul); border-color: var(--azul); color: #FFFFFF; }

.juego-pie {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom)); background: var(--tarjeta); border-top: 1px solid var(--borde);
}
.pie-texto { display: flex; flex-direction: column; font-size: 14px; color: var(--suave); min-width: 0; }
.pie-texto .red { color: var(--rojo); font-weight: 700; }

/* ---------- Tarjeta (pantalla C) ---------- */
.tabla-tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.t-fila {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); align-items: center; text-align: center;
  min-height: 44px; border: none; border-top: 1px solid #E3E8EF; background: var(--tarjeta); width: 100%;
  font: inherit; color: var(--texto); padding: 0;
}
button.t-fila { cursor: pointer; }
.t-fila.actual { background: var(--azul-claro); }
.t-cab { background: var(--azul-oscuro); color: #FFFFFF; font-size: 13px; font-weight: 700; border-top: none; }
.t-cab div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.t-num { font-weight: 700; }
.t-par { color: var(--suave); }
.t-g { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; font-size: 17px; font-weight: 700; border: 2px solid transparent; }
.t-g.bajo { border-color: var(--azul); border-radius: 50%; }
.t-g.sobre { border-color: var(--texto); border-radius: 3px; }
.t-total { border-top: 2px solid var(--texto); font-weight: 700; font-size: 15px; }
.t-total small { color: var(--suave); font-weight: 600; }
.t-puntos { background: var(--azul-claro); font-weight: 800; font-size: 17px; }
.dos-col { grid-column: span 2; text-align: left; padding-left: 12px; font-size: 14px; }
.aviso-suave { background: var(--rojo-claro); color: var(--rojo); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.ok { color: var(--azul-oscuro); font-weight: 700; }

/* v0.6 código de acceso */
input.codigo { font-size: 28px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }


/* v0.9 Google, instalar y legal */
.boton.google { background: #FFFFFF; color: #1F1F1F; border: 1.5px solid #747775; gap: 12px; text-decoration: none; }
.boton.google svg { flex: none; }
.separador { display: flex; align-items: center; gap: 12px; color: var(--suave); font-size: 14px; }
.separador::before, .separador::after { content: ""; flex: 1; height: 1px; background: var(--borde); }
.pie-legal { text-align: center; font-size: 14px; margin-top: 16px; }
.pie-legal a { color: var(--suave); }
.instalar { display: grid; grid-template-columns: 44px 1fr; gap: 10px 12px; align-items: center; margin-bottom: 12px; }
.instalar img { border-radius: 10px; }
.instalar-texto { display: flex; flex-direction: column; font-size: 14px; color: var(--suave); }
.instalar-texto b { font-size: 16px; color: var(--texto); }
.instalar-botones { grid-column: 1 / -1; display: flex; gap: 8px; }
.instalar-botones .boton.primario { flex: 1; min-height: 44px; }
.instalar-botones .boton.enlace { width: auto; }
.velo { position: fixed; inset: 0; background: rgba(16, 20, 26, 0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.hoja { background: var(--tarjeta); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.pasos { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.45; }
.ico-ios { vertical-align: -5px; color: var(--azul); }

/* v0.10 */
.aviso-info { background: var(--azul-claro); color: var(--azul-oscuro); border-bottom: 2px solid var(--azul); }
.boton.enlace.peligro { color: var(--rojo); }
.previo { background: var(--azul-claro); color: var(--azul-oscuro); border-radius: 12px; padding: 12px 14px; font-weight: 700; text-align: center; margin: 0; }
.aviso-bloqueo { margin: 8px 16px 0; background: var(--azul-claro); color: var(--azul-oscuro); border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 14px; text-align: center; }
.resultados.bloqueados .resultado { opacity: .45; }
.pie-botones { display: flex; gap: 8px; align-items: center; flex: none; }
.boton.pie-siguiente { min-height: 44px; height: 44px; padding: 0 16px; font-size: 16px; border-radius: 22px; width: auto; }
.t-pts { font-size: 11px; font-weight: 700; color: var(--azul); margin-left: 1px; vertical-align: -2px; }
.t-recibe { color: var(--suave); font-weight: 600; font-size: 14px; }
.resultado-lista { font-weight: 800; color: var(--azul-oscuro); white-space: nowrap; }
