/*
 * Forest · sistema visual compartido (portada, app, liga, recepción, gerencia y pantalla).
 * Concepto: fútbol de noche en Loja. Fondo verde pino casi negro, césped con franjas de corte,
 * líneas de tiza y un solo acento: la luz ámbar de los reflectores.
 * Display condensada tipo marcador (Anybody) + grotesca muy legible para el texto (Familjen Grotesk).
 */
@font-face { font-family: "Anybody"; font-style: normal; font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; src: url("../fonts/anybody-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Anybody"; font-style: normal; font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; src: url("../fonts/anybody-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/familjen-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/familjen-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  /* color */
  --fondo: #08130E;
  --sup-1: #0D1D16;
  --sup-2: #12271E;
  --sup-3: #193327;
  --sup-4: #214034;
  --linea: rgba(196, 232, 210, .09);
  --linea-2: rgba(196, 232, 210, .17);
  --texto-1: #EEF5F0;
  --texto-2: #AFC5B8;
  --texto-3: #809A8C;
  --acento: #FFC045;
  --acento-2: #FFD27A;
  --acento-suave: rgba(255, 192, 69, .14);
  --sobre-acento: #1F1500;
  --cesped: #1D7444;
  --cesped-2: #23824D;
  --tiza: rgba(246, 251, 247, .9);
  --ok: #52D891;
  --ok-suave: rgba(82, 216, 145, .14);
  --aviso: #FFA552;
  --aviso-suave: rgba(255, 165, 82, .15);
  --error: #FF7474;
  --error-suave: rgba(255, 116, 116, .14);
  --info: #79BEFF;
  --info-suave: rgba(121, 190, 255, .14);

  /* tipografía */
  --f-display: "Anybody", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-texto: "Familjen Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --t-12: .75rem; --t-14: .875rem; --t-16: 1rem; --t-20: 1.25rem; --t-24: 1.5rem;
  --t-32: 2rem; --t-40: 2.5rem; --t-56: 3.5rem; --t-72: 4.5rem;

  /* espacio (múltiplos de 4) */
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 20px; --e-6: 24px;
  --e-8: 32px; --e-10: 40px; --e-12: 48px; --e-16: 64px; --e-20: 80px; --e-24: 96px;
  --gutter: 20px;

  /* forma, profundidad y movimiento */
  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-4: 20px; --r-5: 28px; --r-pill: 999px;
  --sombra-1: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 10px 30px -18px rgba(0, 0, 0, .7);
  --sombra-2: 0 30px 70px -30px rgba(0, 0, 0, .85);
  --brillo-acento: 0 0 0 1px rgba(255, 192, 69, .35), 0 12px 32px -12px rgba(255, 192, 69, .55);
  --curva: cubic-bezier(.2, .8, .2, 1);
  --d-1: 150ms; --d-2: 220ms; --d-3: 380ms;
  --z-cabecera: 20; --z-hoja: 40; --z-toast: 60;
}

/* ───── base ───── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
html.sin-scroll { overflow: hidden; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto-1);
  font-family: var(--f-texto);
  font-size: var(--t-16);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--acento); color: var(--sobre-acento); }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.solo-lector { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.contenedor {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ───── tipografía de marca ───── */
.display { font-family: var(--f-display); font-stretch: 62%; font-weight: 800; text-transform: uppercase; letter-spacing: .004em; line-height: .94; }
.antetitulo { display: inline-flex; align-items: center; gap: var(--e-2); font-size: var(--t-12); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--acento); }
.titulo-seccion { font-family: var(--f-display); font-stretch: 62%; font-weight: 800; text-transform: uppercase; font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: .94; letter-spacing: .004em; }
.bajada { color: var(--texto-2); font-size: var(--t-20); line-height: 1.5; max-width: 60ch; }
.texto-2 { color: var(--texto-2); }
.texto-3 { color: var(--texto-3); }
.pequeno { font-size: var(--t-14); }

/* ───── logo ───── */
.logo-marca { display: inline-flex; align-items: center; gap: 10px; color: var(--texto-1); text-decoration: none; }
.logo-simbolo { width: 34px; height: 34px; color: var(--acento); }
.logo-texto { display: grid; line-height: 1; }
.logo-palabra { font-family: var(--f-display); font-stretch: 70%; font-weight: 800; font-size: 1.5rem; letter-spacing: .14em; text-transform: uppercase; }
.logo-sub { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--texto-3); margin-top: 3px; }

/* ───── botones ───── */
.btn {
  --alto: 48px;
  --giro: rgba(238, 245, 240, .95);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
  min-height: var(--alto);
  padding: 0 var(--e-5);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-weight: 650; font-size: var(--t-16); line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform var(--d-1) var(--curva), background-color var(--d-2) var(--curva), border-color var(--d-2) var(--curva), color var(--d-2) var(--curva), box-shadow var(--d-2) var(--curva);
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primario { background: var(--acento); color: var(--sobre-acento); box-shadow: var(--brillo-acento); --giro: var(--sobre-acento); }
.btn-primario:hover:not([disabled]) { background: var(--acento-2); }
.btn-secundario { background: var(--sup-3); color: var(--texto-1); border-color: var(--linea-2); }
.btn-secundario:hover:not([disabled]) { background: var(--sup-4); }
.btn-fantasma { background: transparent; color: var(--texto-1); border-color: var(--linea-2); }
.btn-fantasma:hover:not([disabled]) { background: var(--sup-2); border-color: rgba(196, 232, 210, .28); }
.btn-texto { background: transparent; color: var(--texto-2); padding: 0 var(--e-3); }
.btn-texto:hover:not([disabled]) { color: var(--texto-1); background: var(--sup-2); }
.btn-peligro { background: var(--error-suave); color: var(--error); border-color: rgba(255, 116, 116, .3); }
.btn-peligro:hover:not([disabled]) { background: rgba(255, 116, 116, .22); }
.btn-ok { background: var(--ok); color: #04150C; --giro: #04150C; }
.btn-chico { --alto: 40px; padding: 0 var(--e-4); font-size: var(--t-14); }
.btn-grande { --alto: 56px; padding: 0 var(--e-6); font-size: 1.0625rem; }
.btn-bloque { width: 100%; }
.btn-icono { --alto: 44px; width: var(--alto); padding: 0; }
.btn .ico { width: 1.15em; height: 1.15em; }
.btn.cargando { color: transparent !important; pointer-events: none; }
.btn.cargando .ico { opacity: 0; }
.btn.cargando::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--giro); border-right-color: transparent; animation: girar .7s linear infinite;
}

/* ───── etiquetas, chips y estados ───── */
.etiqueta { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--t-12); font-weight: 700; letter-spacing: .02em; background: var(--sup-3); color: var(--texto-2); white-space: nowrap; }
.etiqueta .ico { width: 14px; height: 14px; }
.etiqueta.ok { background: var(--ok-suave); color: var(--ok); }
.etiqueta.aviso { background: var(--aviso-suave); color: var(--aviso); }
.etiqueta.error { background: var(--error-suave); color: var(--error); }
.etiqueta.info { background: var(--info-suave); color: var(--info); }
.etiqueta.acento { background: var(--acento-suave); color: var(--acento); }
.punto-vivo { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.punto-vivo::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: latido 2.2s var(--curva) infinite; }

/* ───── formularios ───── */
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > label, .campo > .rotulo { font-size: var(--t-14); font-weight: 650; color: var(--texto-2); }
.entrada {
  width: 100%; min-height: 52px; padding: 0 var(--e-4);
  border-radius: var(--r-3); background: var(--sup-1); border: 1px solid var(--linea-2); color: var(--texto-1);
  font-size: var(--t-16);
  transition: border-color var(--d-2) var(--curva), box-shadow var(--d-2) var(--curva), background-color var(--d-2);
}
textarea.entrada { padding: var(--e-3) var(--e-4); min-height: 96px; resize: vertical; }
select.entrada { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.entrada::placeholder { color: var(--texto-3); }
.entrada:hover { border-color: rgba(196, 232, 210, .28); }
.entrada:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); background: var(--sup-2); }
.campo .ayuda { font-size: var(--t-14); color: var(--texto-3); }
.campo .error-texto { font-size: var(--t-14); color: var(--error); display: none; }
.campo.invalido .entrada { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-suave); }
.campo.invalido .error-texto { display: block; }
.campo.invalido { animation: sacudir .32s var(--curva); }

.segmento { display: flex; padding: 4px; gap: 4px; background: var(--sup-1); border: 1px solid var(--linea); border-radius: var(--r-pill); }
.segmento button { flex: 1; min-height: 44px; padding: 0 var(--e-3); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--texto-2); font-weight: 650; cursor: pointer; transition: background-color var(--d-2) var(--curva), color var(--d-2) var(--curva), box-shadow var(--d-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.segmento button:hover { color: var(--texto-1); }
.segmento button[aria-pressed="true"] { background: var(--sup-4); color: var(--texto-1); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 12px -6px rgba(0, 0, 0, .6); }
.segmento small { color: var(--texto-3); font-weight: 600; font-size: var(--t-12); }

.contador { display: inline-flex; align-items: center; gap: 2px; background: var(--sup-1); border: 1px solid var(--linea-2); border-radius: var(--r-pill); padding: 3px; }
.contador button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--sup-3); color: var(--texto-1); display: grid; place-items: center; cursor: pointer; transition: background-color var(--d-1), transform var(--d-1) var(--curva); }
.contador button:hover:not([disabled]) { background: var(--sup-4); }
.contador button:active:not([disabled]) { transform: scale(.92); }
.contador button[disabled] { opacity: .35; cursor: not-allowed; }
.contador output { min-width: 28px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.contador output.salta { animation: saltar .3s var(--curva); }

.interruptor { position: relative; display: inline-block; width: 52px; height: 32px; flex: none; }
.interruptor input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.interruptor span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--sup-4); border: 1px solid var(--linea-2); transition: background-color var(--d-2) var(--curva); }
.interruptor span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--texto-1); transition: transform var(--d-2) var(--curva); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.interruptor input:checked + span { background: var(--acento); border-color: transparent; }
.interruptor input:checked + span::after { transform: translateX(20px); background: var(--sobre-acento); }
.interruptor input:focus-visible + span { outline: 2px solid var(--acento); outline-offset: 2px; }

.opcion { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3) var(--e-4); min-height: 60px; border-radius: var(--r-3); border: 1px solid var(--linea-2); background: var(--sup-1); cursor: pointer; transition: border-color var(--d-2) var(--curva), background-color var(--d-2) var(--curva); position: relative; }
.opcion:hover { border-color: rgba(196, 232, 210, .3); }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion:has(input:checked) { border-color: var(--acento); background: linear-gradient(0deg, var(--acento-suave), var(--acento-suave)), var(--sup-1); }
.opcion:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 2px; }
.opcion .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--linea-2); flex: none; display: grid; place-items: center; transition: border-color var(--d-2); }
.opcion .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--acento); transform: scale(0); transition: transform var(--d-2) var(--curva); }
.opcion:has(input:checked) .radio { border-color: var(--acento); }
.opcion:has(input:checked) .radio::after { transform: scale(1); }
.opcion-texto { display: grid; gap: 2px; min-width: 0; flex: 1; }
.opcion-texto b { font-weight: 650; }
.opcion-texto small { color: var(--texto-3); font-size: var(--t-14); }

/* ───── superficies ───── */
.tarjeta { background: var(--sup-1); border: 1px solid var(--linea); border-radius: var(--r-4); box-shadow: var(--sombra-1); }
.separador { height: 1px; background: var(--linea); border: 0; margin: 0; }

/* ───── tabla ───── */
.tabla-envoltura { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabla { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
.tabla th { font-size: var(--t-12); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-3); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea-2); white-space: nowrap; }
.tabla td { padding: 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla .c { text-align: center; }

/* ───── hojas ───── */
.velo { position: fixed; inset: 0; background: rgba(2, 8, 5, .62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity var(--d-3) var(--curva); z-index: var(--z-hoja); }
.velo.abierto { opacity: 1; pointer-events: auto; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-hoja) + 1);
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--sup-1); border-top: 1px solid var(--linea-2); border-radius: var(--r-5) var(--r-5) 0 0;
  box-shadow: var(--sombra-2);
  padding: var(--e-2) max(var(--gutter), env(safe-area-inset-right, 0px)) calc(var(--e-6) + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
  transform: translateY(104%);
  transition: transform var(--d-3) var(--curva), opacity var(--d-3) var(--curva);
}
.hoja.abierta { transform: none; }
.asa { width: 100%; height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; margin-bottom: var(--e-2); }
.asa::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: var(--linea-2); }
.hoja-cabeza { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e-4); margin-bottom: var(--e-5); }
.hoja-titulo { font-size: var(--t-24); font-weight: 700; line-height: 1.2; outline: none; }
.hoja-cuerpo { display: grid; gap: var(--e-5); }
@media (min-width: 720px) {
  .hoja { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, calc(100% - 48px)); max-height: 88dvh; border: 1px solid var(--linea-2); border-radius: var(--r-5); padding: var(--e-6) var(--e-8) var(--e-8); transform: translate(-50%, calc(-50% + 24px)); opacity: 0; pointer-events: none; }
  .hoja.abierta { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .hoja .asa { display: none; }
  .hoja.ancha { width: min(760px, calc(100% - 48px)); }
}

/* ───── avisos ───── */
.toasts { position: fixed; left: 50%; bottom: calc(var(--e-6) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(440px, calc(100% - 32px)); display: grid; gap: var(--e-2); z-index: var(--z-toast); pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--e-3); padding: 14px var(--e-4); border-radius: var(--r-3); background: var(--sup-4); border: 1px solid var(--linea-2); box-shadow: var(--sombra-2); font-size: var(--t-14); font-weight: 600; animation: entrarAbajo var(--d-3) var(--curva); transition: opacity var(--d-2), transform var(--d-2) var(--curva); }
.toast .ico { color: var(--ok); }
.toast-error .ico { color: var(--error); }
.toast-info .ico { color: var(--info); }
.toast-aviso .ico { color: var(--acento); }
.toast.sale { opacity: 0; transform: translateY(8px); }
.aviso-conexion { position: fixed; top: calc(var(--e-3) + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; align-items: center; gap: var(--e-2); padding: 10px var(--e-4); border-radius: var(--r-pill); background: var(--aviso); color: #1E0F00; font-weight: 700; font-size: var(--t-14); box-shadow: var(--sombra-2); }

/* ───── carga y vacíos ───── */
.esqueleto { background: linear-gradient(90deg, var(--sup-2) 0%, var(--sup-3) 45%, var(--sup-2) 90%); background-size: 220% 100%; animation: brillo 1.4s linear infinite; border-radius: var(--r-2); }
.vacio { display: grid; justify-items: center; text-align: center; gap: var(--e-3); padding: var(--e-10) var(--e-5); color: var(--texto-2); }
.vacio .ico { width: 40px; height: 40px; color: var(--texto-3); stroke-width: 1.5; }
.vacio b { color: var(--texto-1); font-size: var(--t-20); }

/* ───── cancha y escudos ───── */
.cancha-svg { width: 100%; height: auto; border-radius: var(--r-2); }
.escudo { width: 28px; height: 32px; flex: none; }
.qr { width: 100%; height: auto; border-radius: var(--r-2); background: #fff; }

/* ───── movimiento ───── */
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes latido { 0% { transform: scale(.6); opacity: .8; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
@keyframes brillo { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes entrarAbajo { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes saltar { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes sacudir { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes trazo { to { stroke-dashoffset: 0; } }
@keyframes aparecerEscala { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
