/* =====================================================================
   MEJORAS GLOBALES DE LA WEB PÚBLICA
   Solo CSS: no cambia ni el HTML ni el JS. Se carga la última de todas
   y usa el prefijo `html body` para ganar a las reglas de cada página
   sin necesidad de !important. Usa los mismos tokens de style.css, así
   que el modo oscuro ([data-theme=dark]) sale solo.
   ===================================================================== */

/* ---------- Base: lectura, selección, desplazamiento ---------- */
html{scroll-padding-top:calc(var(--eof-header-alto,150px) + 12px)}
html body{
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  font-feature-settings:"kern","liga";
}
html body :is(h1,h2,h3){text-wrap:balance}
html body main :is(p,li){text-wrap:pretty}
html body ::selection{background:var(--rojo);color:#fff}
html body{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--texto-suave) 55%,transparent) transparent}
html body ::-webkit-scrollbar{width:11px;height:11px}
html body ::-webkit-scrollbar-track{background:transparent}
html body ::-webkit-scrollbar-thumb{
  background:color-mix(in srgb,var(--texto-suave) 45%,transparent);
  border:3px solid var(--fondo);border-radius:999px;
}
html body ::-webkit-scrollbar-thumb:hover{background:var(--rojo)}

/* ---------- Foco de teclado: uno solo, claro y coherente ---------- */
html body :focus{outline:none}
html body :focus-visible{
  outline:3px solid color-mix(in srgb,var(--celeste) 85%,#fff);
  outline-offset:3px;
}
html body :is(input,select,textarea):focus-visible{outline:none}

/* ---------- Cabecera ---------- */
html body .main-header{
  box-shadow:0 10px 24px -18px rgba(12,27,46,.55);
}
html body .top-bar{letter-spacing:.01em}
html body .top-bar .redes-mini a{transition:color .18s,transform .18s}
html body .top-bar .redes-mini a:hover{transform:translateY(-1px)}

/* ---------- Botones: misma respuesta en toda la web ---------- */
html body :is(.btn-primario,.btn-secundario,.btn-login,.btn-instalar-app,.btn-volver,.btn-compartir,.btn-copiar){
  transition:transform .18s ease,box-shadow .18s ease,background-color .18s,border-color .18s,color .18s,filter .18s;
  -webkit-tap-highlight-color:transparent;
}
html body :is(.btn-primario,.btn-login,.btn-instalar-app){
  box-shadow:0 6px 16px -6px rgba(209,19,46,.55);
}
html body :is(.btn-primario,.btn-login,.btn-instalar-app):hover{
  transform:translateY(-2px);
  box-shadow:0 12px 24px -8px rgba(209,19,46,.6);
  filter:saturate(1.08);
}
html body :is(.btn-secundario,.btn-volver,.btn-compartir,.btn-copiar):hover{
  transform:translateY(-1px);box-shadow:var(--sombra-md);
}
html body :is(.btn-primario,.btn-secundario,.btn-login,.btn-instalar-app,.btn-volver,.btn-compartir,.btn-copiar):active{
  transform:translateY(0) scale(.98);box-shadow:var(--sombra-sm);
}

/* ---------- Tarjetas: elevación suave al pasar el ratón ---------- */
html body :is(.card,.mini-card,.sim-card,.lat-card,.pc-card){
  border-radius:var(--radio-md);
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease;
}
@media (hover:hover){
  html body :is(.card,.mini-card,.sim-card,.lat-card,.pc-card):hover{
    transform:translateY(-3px);box-shadow:var(--sombra-hover);
    border-color:color-mix(in srgb,var(--rojo) 28%,var(--borde));
  }
}

/* ---------- Enlaces dentro de textos largos ---------- */
html body main :is(.texto,.contenido,.cuerpo,.prosa,article) p a:not([class]),
html body main :is(.texto,.contenido,.cuerpo,.prosa,article) li a:not([class]){
  color:var(--rojo);text-decoration:underline;
  text-decoration-color:color-mix(in srgb,var(--rojo) 35%,transparent);
  text-decoration-thickness:1.5px;text-underline-offset:3px;
  transition:text-decoration-color .18s,color .18s;
}
html body main :is(.texto,.contenido,.cuerpo,.prosa,article) p a:not([class]):hover,
html body main :is(.texto,.contenido,.cuerpo,.prosa,article) li a:not([class]):hover{
  text-decoration-color:currentColor;
}
[data-theme=dark] body main :is(.texto,.contenido,.cuerpo,.prosa,article) p a:not([class]){color:var(--celeste-claro)}

/* ---------- Formularios ---------- */
html body main :is(
  input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=button],[type=submit],[type=reset],[type=image]),
  select,textarea){
  font:inherit;color:var(--texto);
  background:var(--tarjeta);
  border:1.5px solid var(--borde);border-radius:var(--radio-md);
  padding:11px 14px;min-height:44px;
  transition:border-color .18s,box-shadow .18s,background-color .18s;
}
html body main :is(input,select,textarea)::placeholder{color:color-mix(in srgb,var(--texto-suave) 80%,transparent)}
html body main :is(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=button],[type=submit],[type=reset],[type=image]),select,textarea):hover{
  border-color:color-mix(in srgb,var(--texto-suave) 55%,var(--borde));
}
html body main :is(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=button],[type=submit],[type=reset],[type=image]),select,textarea):focus{
  border-color:var(--celeste);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--celeste) 25%,transparent);
}
html body main textarea{line-height:1.55;resize:vertical}
html body main :is(input[type=checkbox],input[type=radio],input[type=range]){accent-color:var(--rojo)}
html body main :is(input,select,textarea):disabled{opacity:.6;cursor:not-allowed;background:var(--fondo-alt)}

/* ---------- Tablas ---------- */
html body main .tabla-scroll,
html body main :is(.tabla-wrap,.tabla-responsive){
  border:1px solid var(--borde);border-radius:var(--radio-md);
  box-shadow:var(--sombra-sm);background:var(--tarjeta);
}

/* ---------- Pie de página ---------- */
html body footer .footer-titulo{
  position:relative;padding-bottom:10px;margin-bottom:14px;
}
html body footer .footer-titulo::after{
  content:"";position:absolute;left:0;bottom:0;width:28px;height:3px;border-radius:3px;
  background:linear-gradient(90deg,var(--rojo),var(--celeste));
  transition:width .3s ease;
}
html body footer .footer-grid > div:hover .footer-titulo::after{width:52px}
html body footer .footer-grid ul a,
html body footer .footer-link-boton{
  display:inline-block;transition:color .18s,transform .18s;
}
html body footer .footer-grid ul a:hover,
html body footer .footer-link-boton:hover{color:#fff;transform:translateX(3px)}
html body footer .redes-footer a{transition:transform .2s,background-color .2s,box-shadow .2s}
html body footer .redes-footer a:hover{transform:translateY(-3px)}
html body footer .footer-arriba{
  transition:transform .2s,background-color .2s,border-color .2s;
}
html body footer .footer-arriba:hover{transform:translateY(-2px)}
html body footer .footer-bottom{border-top:1px solid rgba(255,255,255,.1);padding-top:18px}

/* ---------- Imágenes de contenido ---------- */
html body main img{image-rendering:auto}
/* Fondo gris de carga solo para FOTOS: los logos y escudos son PNG transparentes y el gris se veía a través
   de ellos como un rectángulo (competiciones, escudos de clubes, avatares, iconos). */
html body main img[loading=lazy]:not([class*=logo]):not([class*=escudo]):not([class*=avatar]):not([class*=icono]):not([src*="/escudos/"]):not([src*="/competiciones/"]):not([data-equipo]){background:color-mix(in srgb,var(--borde) 55%,transparent)}

/* ---------- Móvil: zonas táctiles y respiración ---------- */
@media (max-width:640px){
  html body main :is(input,select,textarea){font-size:16px} /* evita el zoom de iOS al enfocar */
  html body footer .footer-grid ul a{padding-block:4px}
}

/* ---------- Respetar «reducir movimiento» ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  html body *,html body *::before,html body *::after{
    transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;
  }
  html body :is(.card,.mini-card,.sim-card,.lat-card,.pc-card,.btn-primario,.btn-login,.btn-instalar-app):hover{transform:none}
}
