/* ==================================================================
   ZYRA — sistema de diseño
   Fondo oscuro, acento lima, tarjetas redondeadas con borde fino y
   títulos anchos en cursiva. Importa Bootstrap en su propia capa.
   ================================================================== */

/* Capas (UX-025): el orden declarado fija quién gana; dentro de una capa manda el orden del archivo.
   overrides (solo !important que pisan utilidades de Bootstrap) < base (enlaces) < vendor (Bootstrap y
   Font Awesome, importados aquí en su capa) < tokens < components < screens. Las reglas de las capas
   propias ganan a Bootstrap sin subir especificidad. */
@layer overrides, base, vendor, tokens, components, screens;
@import url("vendor/bootstrap/bootstrap.min.22fd4eef025c.css") layer(vendor);
@import url("vendor/fontawesome/css/all.min.644717d7662f.css") layer(vendor);

/* ---------- Fuentes (servidas desde static/, licencia OFL) ---------- */

@font-face { font-family: 'Archivo'; font-weight: 400; font-display: swap; src: url("zyra/fonts/Archivo-Regular.fc87a89f4be2.ttf") format('truetype'); }
@font-face { font-family: 'Archivo'; font-weight: 700; font-display: swap; src: url("zyra/fonts/Archivo-Bold.8e2c14f8866e.ttf") format('truetype'); }
@font-face { font-family: 'Archivo'; font-weight: 800; font-display: swap; src: url("zyra/fonts/Archivo-ExtraBold.332c4b0c4109.ttf") format('truetype'); }
@font-face { font-family: 'Syncopate'; font-weight: 700; font-display: swap; src: url("zyra/fonts/Syncopate-Bold.209016b91eca.ttf") format('truetype'); unicode-range: U+0000-00C0, U+00C2-00C8, U+00CA-00CC, U+00CE-00D0, U+00D2, U+00D4-00D9, U+00DB, U+00DD-10FFFF; }
@font-face { font-family: 'Syncopate'; font-style: italic; font-weight: 700; font-display: swap; src: url("zyra/fonts/Syncopate-BoldItalic.99730185fdb0.ttf") format('truetype'); unicode-range: U+0000-00C0, U+00C2-00C8, U+00CA-00CC, U+00CE-00D0, U+00D2, U+00D4-00D9, U+00DB, U+00DD-10FFFF; }
/* Las vocales con tilde de Syncopate (sobre todo la Í en cursiva) salen con el acento pegado a la letra siguiente:
   esas letras se pintan con Archivo, que las dibuja bien; el resto del texto sigue en Syncopate. */
@font-face { font-family: 'Syncopate'; font-style: normal; font-weight: 700; font-display: swap; src: url("zyra/fonts/Archivo-ExtraBold.332c4b0c4109.ttf") format('truetype'); size-adjust: 112%; unicode-range: U+00C1, U+00C9, U+00CD, U+00D3, U+00DA, U+00DC, U+00D1; }

/* Anton: tipografía deportiva de los títulos (solo tiene un peso; el rango evita la negrita sintética). */
@font-face { font-family: 'Anton'; font-weight: 400 900; font-display: swap; src: url("zyra/fonts/Anton-Regular.bdbc086d4e48.ttf") format('truetype'); }

/* overrides: los !important que deben ganar a las utilidades !important de Bootstrap (.text-*, .bg-*,
   .d-*, .gap-*, .me-*). Con capas, entre declaraciones !important gana la capa MÁS TEMPRANA: por eso
   va la primera. No añadir aquí nada que no necesite pisar una utilidad de Bootstrap. */
@layer overrides {
.text-muted, .text-secondary, .form-text { color: var(--z-muted) !important; }
.text-dark { color: var(--z-text) !important; }
.text-success { color: var(--z-lime) !important; }
.text-danger { color: var(--z-danger) !important; }
.text-lime { color: var(--z-lime) !important; }
.z-badge--lime, .bg-success { color: var(--z-ink) !important; background: var(--z-lime) !important; }
.z-badge--danger, .bg-danger { color: #FFFFFF !important; background: rgba(255, 92, 99, .22) !important; }
.z-badge--danger { color: var(--z-danger) !important; }
.btn-group > .btn { border-radius: 999px !important; margin: 0 !important; }
@media (max-width: 991.98px) {
    .z-nav, .z-header-actions .z-desktop-only { display: none !important; }
    .z-user-menu .dropdown-toggle { gap: 0 !important; }
    .z-lang-menu .dropdown-toggle { gap: 6px !important; }
    .st-tabs.z-segmented .btn i { margin: 0 !important; }
    /* UC-10: en móvil el aviso de confirmación se pinta sobre la cabecera (logo e iconos), no sobre los controles de la página */
    .z-toasts { top: env(safe-area-inset-top, 0px) !important; margin-top: 0 !important; padding-top: 4px !important; }
}
}

/* base: solo el color de los enlaces; va por debajo de Bootstrap para que .btn, .nav-link, .dropdown-item…
   conserven el suyo (una regla de elemento en una capa posterior les ganaría por orden de capa). */
@layer base {
a { color: var(--z-lime); }
a:hover { color: var(--z-lime-hover); }
}

@layer tokens {
:root,
[data-bs-theme="dark"] {
    --z-lime: #B4F100;
    --z-lime-hover: #C8FF2E;
    --z-lime-press: #9AD000;
    --z-lime-rgb: 180, 241, 0;
    /* Una competición, un color propio (H-40): el lima es de Zyra (acción, activo, victoria) y no identifica a SNP. */
    --z-snp: #DBA400;
    --z-snp-rgb: 219, 164, 0;
    --z-lapi: #61E2C9;
    --z-lapi-rgb: 97, 226, 201;
    --z-ink: #0A0A0A;          /* texto sobre lima */
    /* Grises con un toque oliva: casan con el lima en vez de ser grises "de serie" */
    --z-bg: #0A0B09;
    --z-bg-top: #252821;
    --z-surface: #141512;
    --z-surface-2: #1C1D1A;
    --z-surface-3: #252722;
    --z-border: #30322D;
    --z-border-strong: #474A42;
    /* Borde de los controles (campos, casillas, interruptores): ≥3:1 sobre surface y surface-2
       (WCAG 1.4.11, UX-007). --z-border queda para separadores decorativos. */
    --z-border-control: #6B6F64;
    --z-border-control-hover: #8A8E83;
    --z-text: #F4F5F1;
    --z-muted: #A4A79E;
    --z-danger: #FF5C63;
    --z-warning: #FFC940;
    --z-success: #B4F100;
    --z-radius: 16px;
    --z-radius-xs: 6px;
    --z-radius-sm: 10px;
    --z-radius-lg: 24px;
    /* Escala tipográfica (UX-006): mínimo 12 px (.75rem) salvo contadores compactos. */
    --z-fs-xs: .75rem;
    --z-fs-sm: .82rem;
    --z-fs-md: .95rem;
    --z-fs-base: 1rem;
    --z-fs-lg: 1.15rem;
    --z-fs-xl: 1.4rem;
    --z-fs-2xl: 1.75rem;
    --z-fs-3xl: 3.2rem;
    --z-display: 'Anton', 'Archivo Narrow', Impact, 'Archivo', system-ui, sans-serif;
    --z-brand: 'Syncopate', 'Archivo', system-ui, sans-serif;     /* logotipo y portada pública */
    --z-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --z-nav-h: 88px;
    --z-ease: cubic-bezier(.22, 1, .36, 1);
    /* Relieve: filo de luz arriba + sombra tintada hacia abajo */
    --z-edge: inset 0 1px 0 rgba(255, 255, 255, .05);
    --z-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
    --z-shadow-pop: 0 24px 48px -16px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .04);
    --z-glow: 0 10px 30px -12px rgba(var(--z-lime-rgb), .55);
    --z-sheen: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0) 45%);

    /* Bootstrap */
    --bs-body-font-family: var(--z-body);
    --bs-body-bg: var(--z-bg);
    --bs-body-color: var(--z-text);
    --bs-emphasis-color: #FFFFFF;
    --bs-secondary-color: var(--z-muted);
    --bs-tertiary-bg: var(--z-surface-2);
    --bs-border-color: var(--z-border);
    --bs-border-radius: var(--z-radius-sm);
    --bs-primary: var(--z-lime);
    --bs-primary-rgb: var(--z-lime-rgb);
    --bs-success: var(--z-lime);
    --bs-success-rgb: var(--z-lime-rgb);
    --bs-danger: var(--z-danger);
    --bs-danger-rgb: 255, 92, 99;
    --bs-link-color: var(--z-lime);
    --bs-link-color-rgb: var(--z-lime-rgb);
    --bs-link-hover-color: var(--z-lime-hover);
    --bs-link-hover-color-rgb: 200, 255, 46;
    --bs-heading-color: #FFFFFF;
    --bs-focus-ring-color: rgba(var(--z-lime-rgb), .35);
}

}

@layer components {
/* ---------- Base ---------- */

/* La reboot de Bootstrap subraya los enlaces; aquí no (los de texto corrido se subrayan más abajo) */
a { text-decoration: none; }

*, *::before, *::after { box-sizing: border-box; }

html {
    min-height: 100%;
    color-scheme: dark;
    scrollbar-color: var(--z-border-strong) var(--z-bg);
    -webkit-tap-highlight-color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* Paso suave entre páginas (js/page-transitions.js). Solo opacidad sobre el contenido:
   nada de View Transitions (desvían los clics mientras dura la animación) ni transform
   o filter (mueven la zona clicable o recolocan lo fijo). La opacidad no cambia dónde
   cae un clic, así que pulsar rápido durante el fundido sigue funcionando. Cabecera y
   barra inferior no se animan.
   Al salir, el contenido se desvanece; al entrar, cada bloque aparece en cascada con
   un pequeño retardo, lo que da sensación de continuidad entre una página y la otra.
   "backwards" y no "both": al acabar, ningún bloque se queda como contexto de apilamiento. */
@keyframes z-page-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
    .main-content { transition: opacity .2s cubic-bezier(.4, 0, .2, 1); }
    /* Bloques: los hijos de main o, si la página lo envuelve todo en un único div, los de ese div. */
    .main-content > :not(script, style, link, div:only-of-type),
    .main-content > div:only-of-type > :not(script, style, link) {
        animation: z-page-in .42s cubic-bezier(.25, .1, .25, 1) var(--z-in-delay, 0s) backwards;
    }
    :is(.main-content, .main-content > div:only-of-type) > :nth-child(2 of :not(script, style, link)) { --z-in-delay: .05s; }
    :is(.main-content, .main-content > div:only-of-type) > :nth-child(3 of :not(script, style, link)) { --z-in-delay: .1s; }
    :is(.main-content, .main-content > div:only-of-type) > :nth-child(4 of :not(script, style, link)) { --z-in-delay: .15s; }
    :is(.main-content, .main-content > div:only-of-type) > :nth-child(n+5 of :not(script, style, link)) { --z-in-delay: .2s; }
    body.z-leaving .main-content { opacity: .12; }
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: var(--z-body);
    line-height: 1.55;
    color: var(--z-text);
    background-color: var(--z-bg);
    /* Grano muy suave + halo lima arriba + degradado de siempre */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        radial-gradient(50% 35% at 50% -8%, rgba(var(--z-lime-rgb), .09) 0%, rgba(var(--z-lime-rgb), 0) 100%),
        radial-gradient(120% 60% at 50% 0%, var(--z-bg-top) 0%, var(--z-bg) 70%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Nada debe ensanchar la página en móvil (desplazaría el contenido a un lado) */
    overflow-x: clip;
}

::selection { background: var(--z-lime); color: var(--z-ink); }

/* Enlaces dentro de un texto: subrayados, para no distinguirlos solo por el color (WCAG 1.4.1) */
/* (UX-042) también los de ayudas, avisos y textos pequeños de formularios, con o sin clase propia */
/* Enlaces dentro de un texto corrido (WCAG 1.4.1, UX-042): subrayado lima para no depender solo del
   color. Solo en párrafos, ayudas y avisos: tarjetas, filas de lista, menús y botones no lo llevan. */
.z-auth-foot a, .z-legal p a, .z-legal li a, main p a:not([class]),
main :is(p, .form-text, .alert) a:not(.btn, .stretched-link, .dropdown-item, .z-eyebrow, .z-location, [class*="z-chip"]) {
    text-decoration: underline; text-decoration-color: var(--z-lime); text-decoration-thickness: 1px; text-underline-offset: .2em;
}
/* btn-outline-danger de Bootstrap (#dc3545) no llega a 4.5:1 sobre el fondo oscuro */
.btn-outline-danger { --bs-btn-color: var(--z-danger); --bs-btn-border-color: var(--z-danger); }

img { border-radius: var(--z-radius-sm); }

h1, h2, h3, h4, h5, h6 { color: #FFFFFF; font-weight: 700; text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Títulos de página: Anton en mayúsculas, grandes y compactos (estilo deportivo) */
h1, .z-title {
    font-family: var(--z-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .015em;
    font-size: clamp(2rem, 6.4vw, 3.2rem);
    line-height: 1;
    margin: 0 0 1.25rem;
    text-align: left;
}

h2, .z-subtitle {
    font-size: var(--z-fs-base);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

h3 { font-size: var(--z-fs-base); font-weight: 700; }
/* Encabezado con el tamaño de .h4/.h5 de Bootstrap pero sin las mayúsculas de h2 */
.z-heading-plain { text-transform: none; letter-spacing: normal; font-weight: 700; }


:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 2px; }
/* Enlace «Saltar al contenido»: oculto hasta que se llega a él con el teclado */
.z-skip-link {
    position: absolute; left: 12px; top: -100px; z-index: 2000;
    padding: 10px 16px; border-radius: var(--z-radius-sm);
    background: var(--z-lime); color: var(--z-ink); font-weight: 700;
}
.z-skip-link:focus { top: 12px; color: var(--z-ink); }
/* Al usar «Saltar al contenido» el foco pasa a <main>: se marca con un contorno para que se vea
   dónde ha quedado (el ratón no lo muestra: solo :focus-visible, que activa también el JS). */
main:focus { outline: none; }
main:focus-visible, main.z-skip-target { outline: 2px solid var(--z-lime); outline-offset: -2px; }
main { scroll-margin-top: 0; }

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

/* ---------- Layout ---------- */

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.container { max-width: 1200px; }

/* Contenedor genérico de página: tarjeta oscura con borde fino */
.table-container,
.styled-table,
.z-panel {
    width: 100%;
    margin: 0 auto 24px;
    padding: 28px;
    background: var(--z-sheen), rgba(20, 21, 18, .86);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
    box-shadow: var(--z-edge), var(--z-shadow);
    overflow: visible;
    backdrop-filter: blur(10px);
}

.z-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 22px;
}
.z-page-head h1 { margin: 0; }
.z-page-head .z-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.z-eyebrow {
    display: block;
    margin-bottom: 4px;
    font-size: var(--z-fs-sm);
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--z-lime);
}

/* Título de sección (UX-010): Anton como H1 y tarjetas, sin overrides posteriores */
.z-section-title {
    margin: 28px 0 14px;
    font-family: var(--z-display);
    font-size: var(--z-fs-2xl);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: .01em;
    text-transform: uppercase;
    color: #FFFFFF;
}
}

@layer components {
/* ---------- Cabecera / navegación ---------- */

.z-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--z-bg);
}

.z-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1200px;
    height: 76px;
    margin: 0 auto;
    padding: 0 24px;
}

.z-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    flex-shrink: 0;
}
.z-brand:hover { color: #FFFFFF; }
.z-brand img { width: 46px; height: 46px; padding: 12px 13px; object-fit: contain; background: var(--z-surface-2); border-radius: 50%; }
@media (max-width: 991.98px) { .z-brand img { width: 38px; height: 38px; padding: 9px 10px; } }

.z-wordmark {
    font-family: var(--z-display);
    font-weight: 400;
    font-size: var(--z-fs-2xl);
    letter-spacing: .04em;
    line-height: 1;
}

.z-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.z-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: var(--z-fs-sm);
    font-weight: 700;
    color: var(--z-text);
    border-radius: 999px;
    transition: color .2s var(--z-ease), background-color .2s var(--z-ease), box-shadow .2s var(--z-ease);
}
.z-nav-link:hover { color: #FFFFFF; background: var(--z-surface-2); }
.z-nav-link.is-active { color: var(--z-ink); background: var(--z-lime); }
/* Cabecera como el mockup: pestañas solo con texto; los iconos quedan para la barra móvil */
.z-nav-link i { display: none; }

.z-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.z-club-role { font-weight: 700; }
.z-header-actions .btn-secondary { --bs-btn-bg: var(--z-surface); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--z-surface-2); --bs-btn-hover-border-color: transparent; --bs-btn-padding-x: 1.1rem; --bs-btn-padding-y: .6rem; }
@media (min-width: 992px) { .z-user-menu .dropdown-toggle > i { display: none; } }
.z-club-name {
    max-width: 200px;
    overflow: hidden;
    font-size: var(--z-fs-sm);
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #FFFFFF;
}

.z-club-select { min-width: 160px; max-width: 220px; }

.z-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--z-text);
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: 50%;
    transition: border-color .2s var(--z-ease), color .2s var(--z-ease);
}
.z-icon-btn:hover { color: var(--z-lime); border-color: var(--z-lime); }

.z-user-menu .dropdown-menu { min-width: 240px; padding: 8px; }
.z-lang-menu .dropdown-menu { min-width: 160px; padding: 8px; }
.z-lang-menu .btn { font-size: var(--z-fs-sm); font-weight: 700; }

/* Barra inferior (móvil), como en los mockups */
.z-bottom-nav {
    display: none;
    position: fixed;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 1030;
    transform: translateX(-50%);
    width: min(440px, calc(100% - 28px));
    padding: 6px;
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: 999px;
    box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .75);
}
.z-bottom-nav ul {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* Cada pestaña mide lo que su etiqueta: «Enfrentamientos» cabe entera a 390 px sin recortar a las demás */
.z-bottom-nav li { flex: 1 1 auto; min-width: 0; }
.z-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 56px;
    font-size: var(--z-fs-lg);
    color: var(--z-muted);
    border-radius: 999px;
    transition: background-color .2s var(--z-ease), color .2s var(--z-ease);
}
/* Barra oscura: el lima queda reservado a la pestaña activa (como la pastilla de la cabecera) */
.z-bottom-nav a.is-active { color: var(--z-ink); background: var(--z-lime); }
/* Etiqueta siempre visible bajo el icono (H-13): la barra no depende solo de iconos */
.z-bn-label { max-width: 100%; overflow: hidden; font-size: var(--z-fs-xs); font-weight: 700; line-height: 1; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 359.98px) { .z-bn-label { font-size: var(--z-fs-xs); } }

/* La cabecera se esconde al bajar y vuelve al subir (static/js/nav.js); la barra inferior se queda (UX-054) */
.z-header { transition: transform .35s var(--z-ease); }
.z-bottom-nav { transition: transform .35s var(--z-ease); }
.z-nav-hidden .z-header { transform: translateY(-100%); }
.z-typing .z-bottom-nav { transform: translate(-50%, calc(100% + 24px + env(safe-area-inset-bottom))); }

@media (max-width: 991.98px) {
    .z-header-inner { gap: 12px; height: 60px; padding: 0 16px; justify-content: space-between; }
    .z-bottom-nav { display: block; }
    .main-content { padding: 20px 16px calc(var(--z-nav-h) + 40px); }
    .table-container, .styled-table, .z-panel { padding: 20px 16px; }
    .z-footer { padding-bottom: calc(var(--z-nav-h) + 30px); }

    /* Que la cabecera quepa en el ancho del móvil: menú de usuario solo con icono */
    .z-header-actions { gap: 8px; min-width: 0; }
    .z-header-actions .btn-sm { --bs-btn-padding-x: .75rem; }
    .z-user-menu .dropdown-toggle { width: 40px; height: 34px; justify-content: center; padding: 0; }
    .z-user-menu .dropdown-toggle::after, .z-lang-menu .dropdown-toggle::after { display: none; }
    .z-user-menu .dropdown-toggle i { font-size: var(--z-fs-lg); }
    .z-user-menu .z-club-name {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); white-space: nowrap;
    }
    .z-user-menu .dropdown-toggle .z-comp-badge { display: none; }
    .z-lang-menu .dropdown-toggle { height: 34px; }
    .z-header-actions .dropdown-menu { max-width: calc(100vw - 32px); }
}

@media (max-width: 359.98px) {
    .z-wordmark { display: none; }
}

.z-footer {
    padding: 22px 16px;
    font-size: var(--z-fs-sm);
    text-align: center;
    color: var(--z-muted);
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.z-footer p { margin: 0; }
.z-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 8px; }
.z-footer-links a { color: var(--z-muted); padding: 4px 0; }
.z-footer-links a:hover { color: var(--z-lime); }
.z-footer-links .z-footer-social { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; }

/* Páginas legales: texto largo, ancho de lectura cómodo */
.z-legal { max-width: 760px; margin: 0 auto; }
.z-legal h2 { margin-top: 1.75rem; }
.z-legal li { margin-bottom: .35rem; }
.footer { background: transparent; box-shadow: none; }

/* ---------- Botones ---------- */
/* Ojo: nada de transform (scale/translate) en :hover/:active de botones, enlaces o tarjetas.
   Mueven la zona clicable: si el puntero queda fuera al soltar, el clic se pierde. */

.btn {
    --bs-btn-font-weight: 800;
    --bs-btn-padding-x: 1.35rem;
    --bs-btn-padding-y: .62rem;
    --bs-btn-border-radius: 999px;
    --bs-btn-focus-box-shadow: 0 0 0 .2rem rgba(var(--z-lime-rgb), .35);
    font-size: var(--z-fs-sm);
    letter-spacing: .01em;
    transition: background-color .2s var(--z-ease), color .2s var(--z-ease), border-color .2s var(--z-ease), box-shadow .2s var(--z-ease);
}
.btn-primary:hover, .btn-success:hover, .button:hover { box-shadow: var(--z-glow); }
.btn-primary, .btn-success, .button { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-sm { --bs-btn-padding-x: .9rem; --bs-btn-padding-y: .38rem; font-size: var(--z-fs-xs); }
.btn-lg { --bs-btn-padding-y: .85rem; font-size: var(--z-fs-base); }

.btn-primary, .btn-success, .button {
    --bs-btn-color: var(--z-ink);
    --bs-btn-bg: var(--z-lime);
    --bs-btn-border-color: var(--z-lime);
    --bs-btn-hover-color: var(--z-ink);
    --bs-btn-hover-bg: var(--z-lime-hover);
    --bs-btn-hover-border-color: var(--z-lime-hover);
    --bs-btn-active-color: var(--z-ink);
    --bs-btn-active-bg: var(--z-lime-press);
    --bs-btn-active-border-color: var(--z-lime-press);
    --bs-btn-disabled-color: var(--z-ink);
    --bs-btn-disabled-bg: var(--z-lime);
    --bs-btn-disabled-border-color: var(--z-lime);
}
.button {
    display: inline-block;
    padding: .62rem 1.35rem;
    font-weight: 800;
    color: var(--z-ink);
    background: var(--z-lime);
    border: 0;
    border-radius: 999px;
}

.btn-secondary, .btn-dark, .btn-light {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: var(--z-surface-3);
    --bs-btn-border-color: var(--z-border-strong);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #30322C;
    --bs-btn-hover-border-color: #5A5D54;
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: #383A33;
    --bs-btn-active-border-color: #5A5D54;
}

.btn-warning {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--z-border-strong);
    --bs-btn-hover-color: var(--z-ink);
    --bs-btn-hover-bg: var(--z-lime);
    --bs-btn-hover-border-color: var(--z-lime);
    --bs-btn-active-color: var(--z-ink);
    --bs-btn-active-bg: var(--z-lime-press);
    --bs-btn-active-border-color: var(--z-lime-press);
}

.btn-danger {
    --bs-btn-color: var(--z-danger);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: rgba(255, 92, 99, .55);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: var(--z-danger);
    --bs-btn-hover-border-color: var(--z-danger);
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: #E0474E;
    --bs-btn-active-border-color: #E0474E;
}

.btn-outline-primary, .btn-outline-secondary, .btn-outline-light {
    --bs-btn-color: var(--z-text);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--z-border-strong);
    --bs-btn-hover-color: var(--z-ink);
    --bs-btn-hover-bg: var(--z-lime);
    --bs-btn-hover-border-color: var(--z-lime);
    --bs-btn-active-color: var(--z-ink);
    --bs-btn-active-bg: var(--z-lime);
    --bs-btn-active-border-color: var(--z-lime);
}

.btn-link { --bs-btn-color: var(--z-lime); --bs-btn-hover-color: var(--z-lime-hover); text-transform: none; }

.btn-group { gap: 6px; flex-wrap: wrap; }


/* Selector segmentado (vista, orden, etc.) */
.z-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: 999px;
}
.z-segmented .btn, .z-segmented a, .z-segmented button {
    --bs-btn-border-color: transparent;
    --bs-btn-bg: transparent;
    --bs-btn-color: var(--z-muted);
    border-radius: 999px !important;
}
.z-segmented .active, .z-segmented [aria-current="page"] {
    color: var(--z-ink) !important;
    background: var(--z-lime) !important;
}

/* ---------- Formularios ---------- */

label, .form-label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--z-fs-sm);
    font-weight: 700;
    letter-spacing: .01em;
    color: #FFFFFF;
}
.form-check-label { display: inline; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--z-fs-md); color: var(--z-text); cursor: pointer; }

.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
.z-select-trigger,
textarea {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    font: inherit;
    font-size: max(16px, 1rem); /* UX-056: por debajo de 16 px Safari en iOS amplía la página al enfocar */
    color: var(--z-text);
    background-color: var(--z-surface-2);
    border: 1px solid var(--z-border-control);
    border-radius: var(--z-radius-sm);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
    transition: border-color .2s var(--z-ease), box-shadow .2s var(--z-ease), background-color .2s var(--z-ease);
}
.form-control:hover:not(:focus):not(:disabled), .form-select:hover:not(:focus):not(:disabled),
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), .z-select-trigger:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: var(--z-border-control-hover); }
.form-control::placeholder, input::placeholder, textarea::placeholder { color: #8C8C8C; }
.form-control:focus, .form-select:focus, input:focus, select:focus, .z-select-trigger:focus-visible, textarea:focus {
    color: #FFFFFF;
    background-color: var(--z-surface-2);
    border-color: var(--z-lime);
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--z-lime-rgb), .16);
}
select, .form-select, .z-select-trigger {
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23B4F100' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px 8px;
    cursor: pointer;
}
select[multiple] { background-image: none; padding-right: 1rem; }
option { color: var(--z-text); background: var(--z-surface-2); }
input[type="date"], input[type="time"] { color-scheme: dark; }
input[type="number"] { width: 90px; text-align: center; }
input[type="file"], .form-control[type="file"] { padding: .55rem; color: var(--z-muted); }
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: .4rem 1rem;
    font-weight: 700;
    color: var(--z-ink);
    background: var(--z-lime);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

input[type="checkbox"], .form-check-input {
    width: 1.15em;
    height: 1.15em;
    accent-color: var(--z-lime);
    background-color: var(--z-surface-2);
    border-color: var(--z-border-control);
    cursor: pointer;
}
.form-check-input:checked { background-color: var(--z-lime); border-color: var(--z-lime); }
.form-check-input:checked[type="checkbox"] {
    --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230A0A0A' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--z-lime-rgb), .25); border-color: var(--z-lime); }

form p { margin-bottom: 1rem; }
form ul.errorlist, .errorlist { margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--z-fs-sm); color: var(--z-danger); }
.helptext { display: block; margin-top: 4px; font-size: var(--z-fs-sm); color: var(--z-muted); }

/* Contraseñas: botón para mostrarla y lista de requisitos (static/js/password.js) */
.z-password { position: relative; display: block; }
.z-password input { padding-right: 3rem; }
.z-password-toggle {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 3rem; padding: 0;
    color: var(--z-muted); background: none; border: 0; border-radius: 0 12px 12px 0;
    cursor: pointer;
}
.z-password-toggle:hover, .z-password-toggle:focus-visible { color: var(--z-lime); }
.z-password-toggle:focus-visible { outline: 2px solid var(--z-lime); outline-offset: -4px; }
.z-password-rules { display: block; margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-password-rules li { position: relative; padding-left: 1.4em; margin: 2px 0; }
.z-password-rules li::before { content: "•"; position: absolute; left: .35em; }
.z-password-rules.is-live li::before { content: "○"; left: .15em; }
.z-password-rules li.is-ok { color: var(--z-success); }
.z-password-rules li.is-ok::before { content: "✓"; }
.z-password-rules li.is-bad { color: var(--z-danger); }
.z-password-rules li.is-bad::before { content: "✗"; }

fieldset {
    margin: 0 0 16px;
    padding: 20px;
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
}
legend {
    float: none;
    width: auto;
    margin: 0 0 8px;
    padding: 0;
    font-size: var(--z-fs-md);
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--z-lime);
}

/* Lista de jugadores seleccionables (convocatorias, sanciones) */
.z-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.z-check-grid .form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin: 0;
    padding: 10px 14px;
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius-sm);
    transition: border-color .15s;
}
.z-check-grid .form-check:hover { border-color: var(--z-border-strong); }
.z-check-grid .form-check:has(input:checked) { border-color: var(--z-lime); }
.z-check-grid .form-check-input { margin: 0; flex-shrink: 0; }

/* ---------- Tarjetas ---------- */

.card, .z-card {
    --bs-card-bg: var(--z-surface);
    --bs-card-border-color: var(--z-border);
    --bs-card-color: var(--z-text);
    --bs-card-cap-bg: var(--z-surface-2);
    --bs-card-border-radius: var(--z-radius);
    --bs-card-inner-border-radius: calc(var(--z-radius) - 1px);
    color: var(--z-text);
    background: var(--z-sheen), var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
    box-shadow: var(--z-edge) !important;
}
.z-card { padding: 20px; }
.card-title { color: #FFFFFF; }

a.z-card, .z-card--link { display: block; color: inherit; transition: border-color .25s var(--z-ease), box-shadow .25s var(--z-ease); }
a.z-card:hover, .z-card--link:hover {
    color: inherit;
    border-color: rgba(var(--z-lime-rgb), .7);
    box-shadow: var(--z-edge), var(--z-shadow), 0 0 0 1px rgba(var(--z-lime-rgb), .15) !important;
}

.z-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
}

/* Etiquetas */
.badge { padding: .4em .8em; font-weight: 700; letter-spacing: .03em; border-radius: 999px; }
.z-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: var(--z-fs-xs);
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--z-muted);
    background: var(--z-surface-3);
    border-radius: 999px;
    white-space: nowrap;
}
.z-badge--warning { color: var(--z-ink); background: var(--z-warning); }
.z-badge--outline { color: var(--z-text); background: transparent; border: 1px solid var(--z-border-strong); }

/* Avatares con aro lima (como en los mockups) */
.z-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    padding: 2px;
    object-fit: cover;
    background: var(--z-surface-2);
    border: 2px solid var(--z-lime);
    border-radius: 50% !important;
}
.z-avatar--lg { width: 96px; height: 96px; border-width: 3px; }
.z-avatar--xl { width: 140px; height: 140px; border-width: 3px; }
.z-avatar--sm { width: 40px; height: 40px; }
.z-avatar.table-avatar { width: 42px; height: 42px; }
/* Sin foto (UX-035): iniciales sobre superficie 3 y aro neutro; el lima queda para acción y estado */
.z-avatar--initials { display: inline-grid; place-items: center; padding: 0; font: 400 1.3rem/1 var(--z-display); letter-spacing: .02em; color: var(--z-text); background: var(--z-surface-3); border: 2px solid var(--z-border-strong); }
.z-avatar--lg.z-avatar--initials { font-size: var(--z-fs-2xl); border-width: 3px; }
.z-avatar--xl.z-avatar--initials { font-size: var(--z-fs-3xl); border-width: 3px; }
.z-avatar--sm.z-avatar--initials, .z-avatar.table-avatar.z-avatar--initials { font-size: var(--z-fs-base); border-width: 2px; }
@media (max-width: 767.98px) { .z-player .z-avatar--lg { width: 64px; height: 64px; } .z-player .z-avatar--lg.z-avatar--initials { font-size: var(--z-fs-xl); } }


/* ---------- Tablas ---------- */

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--z-text);
    --bs-table-border-color: var(--z-border);
    --bs-table-striped-bg: rgba(255, 255, 255, .03);
    --bs-table-hover-bg: rgba(var(--z-lime-rgb), .06);
    --bs-table-hover-color: #FFFFFF;
    margin-bottom: 0;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}
.table > thead th,
.styled-table th {
    padding: 12px 14px;
    font-size: var(--z-fs-xs);
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--z-muted);
    background: var(--z-surface-2);
    border-bottom: 1px solid var(--z-border);
}
.table > :not(caption) > * > * { padding: 12px 14px; }
.table-bordered > :not(caption) > * { border-color: var(--z-border); }
.styled-table td { color: var(--z-text); background: transparent; border-color: var(--z-border); }

.z-table-wrap {
    overflow-x: auto;
    background: var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
}
.z-table-wrap .table > thead th:first-child { border-top-left-radius: var(--z-radius); }
.z-table-wrap .table > thead th:last-child { border-top-right-radius: var(--z-radius); }
.z-table-wrap .table tbody tr:last-child > * { border-bottom: 0; }

.table-avatar, .table-logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50% !important;
    border: 2px solid var(--z-lime);
}
.table-logo { border-radius: var(--z-radius-sm) !important; border-color: var(--z-border-strong); }

/* ---------- Paginación ---------- */

.pagination {
    --bs-pagination-color: var(--z-text);
    --bs-pagination-bg: var(--z-surface-2);
    --bs-pagination-border-color: var(--z-border);
    --bs-pagination-hover-color: var(--z-ink);
    --bs-pagination-hover-bg: var(--z-lime);
    --bs-pagination-hover-border-color: var(--z-lime);
    --bs-pagination-focus-color: var(--z-ink);
    --bs-pagination-focus-bg: var(--z-lime);
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(var(--z-lime-rgb), .3);
    --bs-pagination-active-color: var(--z-lime);
    --bs-pagination-active-bg: transparent;
    --bs-pagination-active-border-color: transparent;
    --bs-pagination-disabled-color: #5A5A5A;
    --bs-pagination-disabled-bg: var(--z-surface);
    --bs-pagination-disabled-border-color: var(--z-border);
    flex-wrap: wrap;
    gap: 6px;
    margin: 24px 0 0;
}
.pagination .page-link { border-radius: 999px !important; font-weight: 700; font-size: var(--z-fs-sm); }
.pagination .page-item.active .page-link { font-weight: 800; }

/* ---------- Mensajes y avisos ---------- */

.alert,
.alert-message,
.alert-log,
.warning,
.error,
.messages p {
    display: block;
    margin: 0 0 16px;
    padding: 14px 16px;
    font-size: var(--z-fs-md);
    color: var(--z-text);
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-left: 4px solid var(--z-lime);
    border-radius: var(--z-radius-sm);
    box-shadow: none;
}
.alert p, .alert-message p { margin: 0; }
.alert p + p, .alert-message p + p { margin-top: 6px; }
.alert-message ul { margin: 0; padding-left: 18px; }
.warning, .alert-danger, .error, .alert .error, p.error { border-left-color: var(--z-danger); }
.alert-log, .alert-warning { border-left-color: var(--z-warning); }
.alert-success { border-left-color: var(--z-lime); }
.alert .success, .alert-message .success { color: var(--z-text); }
.alert-success, .alert-danger, .alert-warning, .alert-info { --bs-alert-color: var(--z-text); --bs-alert-bg: var(--z-surface-2); --bs-alert-border-color: var(--z-border); }

.log-container {
    max-height: 340px;
    overflow-y: auto;
    padding: 12px;
    background: var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
}
.log-container p { margin: 0 0 8px; }

/* ---------- Dropdowns, modales, tooltips ---------- */

.dropdown-menu {
    --bs-dropdown-bg: rgba(28, 29, 26, .88);
    --bs-dropdown-border-color: var(--z-border);
    --bs-dropdown-color: var(--z-text);
    --bs-dropdown-link-color: var(--z-text);
    --bs-dropdown-link-hover-color: var(--z-ink);
    --bs-dropdown-link-hover-bg: var(--z-lime);
    --bs-dropdown-link-active-color: var(--z-ink);
    --bs-dropdown-link-active-bg: var(--z-lime);
    --bs-dropdown-divider-bg: var(--z-border);
    --bs-dropdown-header-color: var(--z-muted);
    border-radius: var(--z-radius);
    box-shadow: var(--z-edge), var(--z-shadow-pop);
    backdrop-filter: blur(16px) saturate(140%);
}
.dropdown-item { border-radius: var(--z-radius-sm); font-weight: 600; transition: background-color .15s var(--z-ease), color .15s var(--z-ease); }

/* Desplegables y popovers aparecen con un pequeño fundido (translate no choca con el transform de Popper) */
@keyframes z-pop { from { opacity: 0; translate: 0 -6px; } }
.dropdown-menu.show, .z-picker.is-open .z-picker-list, .z-datepicker.is-open .z-datepicker-pop { animation: z-pop .2s var(--z-ease); }
.modal-backdrop { --bs-backdrop-opacity: .6; backdrop-filter: blur(6px); }
.dropdown-item i { width: 20px; }

.tooltip { --bs-tooltip-bg: var(--z-surface-3); --bs-tooltip-color: var(--z-text); }
.tooltip-inner { text-align: left; border: 1px solid var(--z-border); }
.tooltip-inner p { margin: 0; }

.list-group-item { color: var(--z-text); background: var(--z-surface); border-color: var(--z-border); }

.modal {
    --bs-modal-bg: var(--z-surface);
    --bs-modal-color: var(--z-text);
    --bs-modal-border-color: var(--z-border);
    --bs-modal-header-border-color: var(--z-border);
    --bs-modal-footer-border-color: var(--z-border);
    --bs-modal-border-radius: var(--z-radius);
}
.modal .btn-close { filter: invert(1); }

/* «Completar equipo» */
.z-import-wrap { max-height: 420px; overflow-y: auto; margin: 0 0 20px; }
/* Tabla con columnas de ancho fijo: nombres, etiquetas y última columna alineados en todas las filas. */
.z-import-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.z-import-table col.z-import-cat { width: 130px; }
.z-import-table col.z-import-last { width: 34%; }
.z-import-table th { position: sticky; top: 0; z-index: 1; padding: 8px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--z-muted); text-align: left; background: var(--z-surface); border-bottom: 1px solid var(--z-border-strong, var(--z-border)); }
.z-import-table td { padding: 10px 8px; vertical-align: middle; border-bottom: 1px solid var(--z-border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-import-table tbody tr:last-child td { border-bottom: 0; }
.z-import-table .text-end { text-align: right; }

/* Categoría SNP / división (UX-026): insignia neutra con la división en texto; el color queda para estados y competiciones. */
.z-cat { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .03em; vertical-align: middle; color: var(--z-text); background: var(--z-surface-3); border: 1px solid var(--z-border); }


}

@layer screens {
/* ---------- Pantallas de acceso (login, registro, portada) ---------- */

.z-auth {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 220px);
}
.z-auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px 28px;
    background: var(--z-sheen), var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius-lg);
    box-shadow: var(--z-edge), 0 30px 60px -20px rgba(0, 0, 0, .7), 0 0 80px -40px rgba(var(--z-lime-rgb), .35);
}
.z-auth-card--wide { max-width: 560px; }
.z-auth-logo { display: block; width: 64px; height: auto; margin: 0 auto 14px; border-radius: 0; }
.z-auth-card h1 { text-align: center; }
.z-auth-card .btn { width: 100%; }
.z-auth-foot { margin: 18px 0 0; font-size: var(--z-fs-md); text-align: center; color: var(--z-muted); }

/* Portada pública (estilo «Social club»): bloque lima con la pista, competiciones disponibles, funciones, pasos, guías y preguntas */
.z-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    max-width: 1100px;
    margin: 0 auto;
}
.z-hero-main {
    position: relative;
    padding: clamp(22px, 5vw, 44px);
    color: var(--z-ink);
    background: var(--z-lime);
    border-radius: var(--z-radius-lg);
    overflow: hidden;
}
.z-hero-main > * { position: relative; z-index: 1; }
.z-hero-main::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' fill='none' stroke='%230A0A0A' stroke-opacity='.15' stroke-width='2'%3E%3Crect x='3' y='6' width='194' height='88' rx='1' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M100 6V94M30.5 6V94M169.5 6V94M30.5 50H169.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / contain no-repeat;
}
.z-hero-tag { margin: 0 0 14px; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--z-ink); }
.z-hero-title {
    margin: 0 0 16px;
    font-family: var(--z-display);
    font-weight: 400;
    font-size: clamp(3.6rem, 12vw, 6.5rem);
    line-height: .92;
    text-transform: uppercase;
    color: var(--z-ink);
}
.z-hero-text { max-width: 460px; margin: 0 0 24px; font-size: var(--z-fs-base); font-weight: 700; color: var(--z-ink); }
.z-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.z-hero-main .btn-primary { --bs-btn-color: var(--z-text); --bs-btn-bg: var(--z-ink); --bs-btn-border-color: var(--z-ink); --bs-btn-hover-color: var(--z-lime); --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-active-color: var(--z-lime); --bs-btn-active-bg: #000; }
.z-hero-main .btn-outline-light { --bs-btn-color: var(--z-ink); --bs-btn-border-color: var(--z-ink); --bs-btn-hover-color: var(--z-lime); --bs-btn-hover-bg: var(--z-ink); --bs-btn-hover-border-color: var(--z-ink); --bs-btn-active-color: var(--z-lime); --bs-btn-active-bg: var(--z-ink); }
.z-hero-comps { position: relative; display: grid; align-content: center; gap: 12px; padding: 24px; background: var(--z-surface-2); border-radius: var(--z-radius-lg); }
.z-hero-sticker { position: absolute; top: 18px; right: 18px; padding: 8px 16px; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-ink); background: var(--z-lime); border-radius: 999px; transform: rotate(8deg); }
.z-hero-comps-title { margin: 0; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--z-lime); }
.z-hero-comp { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; padding: 14px 18px; border: 2px solid var(--z-snp); border-radius: var(--z-radius-lg); }
.z-hero-comp[data-comp="lapi"] { border-color: var(--z-lapi); }
.z-hero-comp strong { font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; line-height: 1; text-transform: uppercase; }
.z-hero-comp p { grid-column: 1 / -1; margin: 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-hero-comps-note { margin: 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
@media (min-width: 992px) {
    .z-hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
    .z-hero-comps { padding: 28px; }
}
.z-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; text-align: left; }
.z-feature { padding: 22px 24px; }
.z-feature-num { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; font: 400 1.4rem var(--z-display); color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius); }
.z-feature h3 { margin: 0 0 8px; font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; line-height: 1; text-transform: uppercase; }
.z-feature p { margin: 0; font-size: var(--z-fs-md); color: var(--z-muted); }
.z-landing-section { width: 100%; max-width: 1100px; margin: 56px auto 0; }
.z-landing-title { margin: 0 0 18px; font-family: var(--z-display); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 400; line-height: 1; text-align: left; text-transform: uppercase; }
.z-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: z-step; }
.z-steps li { padding: 24px 26px; color: var(--z-muted); counter-increment: z-step; }
.z-steps li::before { content: "0" counter(z-step); display: block; font: 400 5rem/.9 var(--z-display); color: var(--z-lime); }
.z-steps li:first-child { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-steps li:first-child::before, .z-steps li:first-child strong { color: var(--z-ink); }
.z-steps strong { display: block; margin: 8px 0 6px; font: 400 1.7rem/1 var(--z-display); text-transform: uppercase; color: var(--z-text); }
.z-faq { display: grid; gap: 8px; }
.z-faq details { padding: 16px 22px; border-radius: var(--z-radius-lg); }
.z-faq summary { cursor: pointer; }
.z-faq summary h3 { display: inline; margin: 0; font-size: var(--z-fs-base); font-weight: 800; }
.z-faq details p { margin: 10px 0 0; color: var(--z-muted); }
.z-landing-cta { margin-top: 28px; justify-content: center; }
.z-back-to-top { align-items: center; gap: 8px; }

@media (max-width: 767.98px) {
    .z-steps { grid-template-columns: 1fr; }
    .z-landing-section { margin-top: 40px; }
    .z-hero-actions .btn { flex: 1 1 100%; }
    .z-features { grid-template-columns: 1fr; }
}

/* ---------- Listados (jugadores, equipos, partidos) ---------- */

.z-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.z-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.z-search { position: relative; min-width: 260px; }
.z-search i { position: absolute; top: 50%; left: 16px; transform: translateY(-50%); color: var(--z-muted); pointer-events: none; }
.z-search input { padding-left: 42px; border-radius: 999px; }
@media (min-width: 768px) { .z-toolbar-group > .z-search { flex-shrink: 0; min-width: 300px; } }
.z-toggle { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; user-select: none; }
.z-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.z-toggle-track {
    position: relative; flex-shrink: 0; width: 44px; height: 24px; border-radius: 999px;
    background: var(--z-surface-3); border: 1px solid var(--z-border-strong);
    transition: background-color .2s var(--z-ease), border-color .2s var(--z-ease);
}
.z-toggle-track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--z-muted); transition: transform .2s var(--z-ease), background-color .2s var(--z-ease);
}
.z-toggle:hover .z-toggle-track { border-color: var(--z-muted); }
.z-toggle input:checked + .z-toggle-track { background: var(--z-lime); border-color: var(--z-lime); }
.z-toggle input:checked + .z-toggle-track::after { transform: translateX(20px); background: var(--z-ink); }
.z-toggle input:focus-visible + .z-toggle-track { box-shadow: 0 0 0 3px rgba(var(--z-lime-rgb), .35); }
.z-toggle-label { font-size: var(--z-fs-md); font-weight: 500; color: var(--z-text); text-transform: none; letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) {
    .z-toggle-track, .z-toggle-track::after { transition: none; }
}
.z-toolbar-label { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }

@media (max-width: 767.98px) {
    .z-toolbar, .z-toolbar-group { align-items: stretch; }
    .z-toolbar-group, .z-search { width: 100%; min-width: 0; }
    .z-segmented { width: 100%; justify-content: space-between; }
    .z-segmented > * { flex: 1; }
}

/* Tarjeta de jugador */
.z-player {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    padding: 18px;
}
.z-player-name { margin: 0 0 4px; font-size: var(--z-fs-base); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: #FFFFFF; }
.z-player-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-player-meta i { color: var(--z-lime); margin-right: 4px; }
.z-player-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.z-edit {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    font-size: var(--z-fs-sm);
    color: var(--z-muted);
    background: var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: 50%;
}
.z-edit:hover { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-edit--danger { color: var(--z-danger); background: rgba(255, 92, 99, .1); border-color: rgba(255, 92, 99, .55); }
.z-edit--danger:hover { color: #FFFFFF; background: var(--z-danger); border-color: var(--z-danger); }

/* Nivel de rendimiento (0-10) */

/* Tarjeta de equipo */
.z-team { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--z-radius-lg); }
.z-team-head { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.z-team img { width: 60px; height: 60px; flex-shrink: 0; object-fit: cover; border-radius: var(--z-radius); background: var(--z-surface-3); }
.z-team h2 { margin: 0 0 2px; font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; line-height: 1.05; text-transform: uppercase; letter-spacing: normal; overflow-wrap: anywhere; }
.z-team p { margin: 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-team-foot { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 14px; border-top: 1px solid var(--z-border); }
.z-form-narrow { max-width: 640px; }
.z-team-new { display: flex; align-items: center; gap: 14px; min-height: 120px; padding: 18px 20px; color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-lg); text-decoration: none; }
.z-team-new:hover { color: var(--z-ink); filter: brightness(1.05); }
.z-team-new-plus { display: grid; place-items: center; flex: none; width: 56px; height: 56px; font-size: var(--z-fs-xl); color: var(--z-lime); background: var(--z-ink); border-radius: 50%; }
.z-team-new strong { display: block; font: 400 1.5rem/1 var(--z-display); text-transform: uppercase; }
.z-team-new small { display: block; margin-top: 4px; font-size: var(--z-fs-sm); font-weight: 700; }

/* Tarjeta de enfrentamiento */
.z-match {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
}
.z-match-team { display: flex; align-items: center; gap: 14px; min-width: 0; font-weight: 800; text-transform: uppercase; color: #FFFFFF; }
.z-match-team--away { flex-direction: row-reverse; text-align: right; }
.z-match-team span { overflow: hidden; text-overflow: ellipsis; }
.z-match-team img { width: 56px; height: 56px; flex-shrink: 0; object-fit: cover; border-radius: 50%; border: 2px solid var(--z-border-strong); background: var(--z-surface-2); }
.z-match-center { text-align: center; }
.z-match-score { font-size: var(--z-fs-xl); font-weight: 800; line-height: 1; color: var(--z-lime); font-variant-numeric: tabular-nums; }
.z-match-date { margin-top: 6px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-match-status { margin-top: 8px; }

@media (max-width: 575.98px) {
    .z-match { grid-template-columns: 1fr; gap: 10px; padding: 18px 16px; }
    .z-match-team, .z-match-team--away { flex-direction: row; text-align: left; }
    .z-match-center { order: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; text-align: left; }
    .z-match-date, .z-match-status { margin: 0; }
    .z-match-team img { width: 40px; height: 40px; }
}

/* ---------- Detalle de enfrentamiento ---------- */

.z-ficha-top { display: grid; gap: 12px; margin-bottom: 14px; }
.z-versus {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 22px 18px;
    background: var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius-lg);
    overflow: hidden;
    container-type: inline-size;
}
/* Móvil y tablet: dos columnas iguales para local y visitante (antes la del visitante era «auto»
   y la del local se quedaba estrecha, partiendo «GLADIADORES» a mitad de palabra, UX-004). */
@media (max-width: 991.98px) { .z-versus { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.z-versus > * { position: relative; }
/* Nombres del marcador: nunca se parten dentro de una palabra; el tamaño sigue al ancho del panel
   y las líneas se equilibran. Solo una palabra más larga que la columna entera se corta. */
.z-versus-team { font: 400 clamp(1rem, 6.5cqi, 2.6rem)/1.02 var(--z-display); text-transform: uppercase; color: #FFFFFF; overflow-wrap: break-word; word-break: normal; hyphens: manual; text-wrap: balance; }
.z-versus-team small { display: block; margin-top: 6px; font: 700 .7rem var(--z-body); letter-spacing: .1em; color: var(--z-muted); }
.z-versus-team:last-child { text-align: right; }
.z-versus-mid { grid-column: 1 / -1; grid-row: 1; text-align: center; }
.z-versus-vs { font: 400 clamp(3.4rem, 17vw, 6rem)/.9 var(--z-display); color: var(--z-lime); white-space: nowrap; }
/* El marcador lleva el color del resultado del equipo propio: lima solo si gana (UX-005). */
.z-versus-vs.is-loss { color: var(--z-danger); }
.z-versus-vs.is-draw { color: var(--z-text); }
.z-ficha-side { display: grid; align-content: start; gap: 8px; padding: 16px 18px; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius-lg); }
.z-ficha-side p { margin: 0; }
.z-kind { display: grid; gap: 2px; }
.z-kind b { display: block; font: 400 1.5rem/1.05 var(--z-display); text-transform: uppercase; color: #FFFFFF; }
.z-kind small { color: var(--z-muted); font-size: var(--z-fs-sm); }
.z-ficha-outcome { font: 400 clamp(2.4rem, 9vw, 4rem)/1 var(--z-display); text-transform: uppercase; color: var(--z-text); }
.z-ficha-outcome.is-win { color: var(--z-lime); }
.z-ficha-outcome.is-loss { color: var(--z-danger); }
.z-ficha-when { font-weight: 800; color: var(--z-text); }
.z-ficha-where .z-location { font-weight: 600; }
.z-call-more { margin: 10px 0; padding: 6px 0; font: inherit; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-lime); background: none; border: 0; cursor: pointer; }
.z-call-more:hover { text-decoration: underline; }
.z-callist[hidden] { display: none; }
.z-callist + .z-callist { margin-top: 8px; }
.z-ficha-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.z-tag { display: inline-block; padding: 4px 11px; font-size: var(--z-fs-xs); font-weight: 800; color: var(--z-text); background: var(--z-surface-3); border-radius: 999px; }
.z-tag.is-lime { color: var(--z-ink); background: var(--z-lime); }
.z-tag.is-amber { color: var(--z-ink); background: var(--z-warning); }
/* Escritorio: el marcador es la pista (2:1, sin deformarla) con la red entre local y visitante;
   a su lado, el tipo de enfrentamiento, el desenlace y el lugar. */
@media (min-width: 992px) {
    .z-ficha-top { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
    .z-versus { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); aspect-ratio: 2 / 1; padding: 0 8%; }
    .z-versus::before {
        content: ""; position: absolute; inset: 0; pointer-events: none;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' fill='none' stroke='%23B4F100' stroke-opacity='.22' stroke-width='2'%3E%3Crect x='3' y='6' width='194' height='88' rx='1' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M100 6V94M30.5 6V94M169.5 6V94M30.5 50H169.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    .z-versus-team { font-size: var(--z-fs-2xl); }
    .z-versus-team:first-child { padding-right: 96px; text-align: right; }
    .z-versus-team:last-child { padding-left: 96px; text-align: left; }
    .z-versus-mid { grid-column: auto; grid-row: auto; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 4px 16px; background: var(--z-surface); }
    .z-ficha-side { padding: 22px 26px; }
}
.z-status4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.z-status4 li { position: relative; display: grid; gap: 2px; padding: 14px 16px; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-status4 b { font: 400 1.7rem/1 var(--z-display); color: #FFFFFF; }
.z-status4-label { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--z-muted); }
.z-status4-ic { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; font-size: var(--z-fs-xs); font-weight: 800; color: var(--z-muted); background: var(--z-surface-3); border-radius: 50%; }
.z-status4 .is-done .z-status4-ic { color: var(--z-ink); background: var(--z-lime); }
.z-status4 .is-cur { border-color: var(--z-warning); }
.z-status4 .is-cur .z-status4-ic { color: var(--z-ink); background: var(--z-warning); }
.z-status4 .is-done .z-status4-label { color: var(--z-text); }
.z-status4-bar { display: block; height: 6px; margin-top: 8px; overflow: hidden; background: var(--z-surface-3); border-radius: 999px; }
.z-status4-bar i { display: block; height: 100%; background: var(--z-lime); border-radius: inherit; }
.z-status4 .is-cur .z-status4-bar i { background: var(--z-warning); }
@media (min-width: 768px) { .z-status4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .z-status4--short { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.z-callist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.z-pl { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 12px 8px 8px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-pl.is-me { outline: 2px solid var(--z-lime); outline-offset: 1px; }
.z-pl-av { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; object-fit: cover; font: 400 1rem/1 var(--z-display); color: var(--z-text); background: var(--z-surface-3); border-radius: 50%; }
.z-pl-who { flex: 1; min-width: 0; }
.z-pl-who b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.15; font-size: var(--z-fs-md); text-transform: uppercase; color: #FFFFFF; }
.z-pl-who small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; overflow-wrap: anywhere; color: var(--z-muted); font-size: var(--z-fs-xs); }
.z-pl-pair { padding: 1px 7px; font-weight: 800; color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-xs); }
.z-edit-date { margin-left: .35rem; color: var(--z-muted); }
.z-edit-date:hover, .z-edit-date:focus-visible { color: var(--z-text, inherit); }

.z-positions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.z-positions .z-card { padding: 16px; }
.z-positions h3 { margin: 0 0 10px; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-lime); }
.z-positions ul { margin: 0; padding: 0; list-style: none; }
.z-positions li { padding: 8px 0; border-bottom: 1px solid var(--z-border); font-weight: 600; }
.z-positions li:last-child { border-bottom: 0; }
.z-positions p { margin: 0; font-size: var(--z-fs-sm); color: var(--z-muted); }

.z-game { margin-bottom: 12px; overflow: hidden; }
.z-game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--z-surface-2); border-bottom: 1px solid var(--z-border); }
.z-game-head h3 { margin: 0; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; }
.z-game-row { display: grid; grid-template-columns: 1fr repeat(3, 44px); align-items: center; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--z-border); }
.z-game-row:last-child { border-bottom: 0; }
.z-game-row .z-set { font-size: var(--z-fs-base); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; color: var(--z-muted); }
.z-game-row.is-winner .z-set, .z-game-row.is-winner .z-game-side { color: #FFFFFF; }
.z-game-row.is-winner.is-own .z-set { color: var(--z-lime); }
.z-game-row.is-lost .z-set { color: var(--z-danger); }
.z-game-side { min-width: 0; font-size: var(--z-fs-md); color: var(--z-muted); }
.z-game-side strong { display: block; font-size: var(--z-fs-sm); letter-spacing: .01em; }
.z-game-side.has-pair { display: flex; align-items: center; gap: 12px; }
.z-game-who { min-width: 0; overflow-wrap: anywhere; }
.z-game-pair { display: inline-flex; flex-shrink: 0; gap: 6px; }
.z-avatar--game { width: 48px; height: 48px; }
.z-avatar--game.z-avatar--initials { font-size: var(--z-fs-lg); border-width: 2px; }
.z-game-row:not(.is-winner) .z-avatar--game { border-color: var(--z-border-strong); }
.z-game-sets-head { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; font-size: var(--z-fs-xs); font-weight: 800; color: var(--z-muted); text-align: center; }
@media (max-width: 575.98px) { .z-game-row { grid-template-columns: 1fr repeat(3, 32px); padding-inline: 12px; } .z-game-sets-head { grid-template-columns: repeat(3, 32px); } .z-game-side.has-pair { gap: 8px; font-size: var(--z-fs-sm); } .z-avatar--game { width: 38px; height: 38px; } .z-avatar--game.z-avatar--initials { font-size: var(--z-fs-md); } }

@media (max-width: 767.98px) {
    .z-positions { grid-template-columns: 1fr; }
}

/* Orden de parejas en la creación de partidos */
.pair-order-container { margin-top: 20px; padding: 20px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.pair-order-container h2 { margin: 0 0 10px; }
#pair-order-list { margin: 0; padding: 0; list-style: none; counter-reset: pair; }
#pair-order-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-weight: 600; border-bottom: 1px solid var(--z-border); counter-increment: pair; }
#pair-order-list li:last-child { border-bottom: 0; }
#pair-order-list li::before {
    content: counter(pair);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: var(--z-fs-sm);
    font-weight: 800;
    color: var(--z-ink);
    background: var(--z-lime);
    border-radius: 50%;
}
/* Alineación: parejas a la izquierda, orden por puntos SNP a la derecha (fijo al hacer scroll) */
.z-lineup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 20px; align-items: start; }
.z-lineup-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.z-lineup-pairs fieldset { margin: 0; }
.z-lineup-pairs fieldset { position: relative; }
.z-lineup-reset { position: absolute; top: 10px; right: 16px; padding: 3px 10px; font-size: var(--z-fs-xs); letter-spacing: .02em; }
.z-lineup-pairs fieldset > div + div { margin-top: 12px; }
.z-lineup-side.pair-order-container { position: sticky; top: 96px; margin-top: 0; }
.z-lineup > input, .z-lineup > .z-selector-bar { grid-column: 1 / -1; }
.z-lineup--unordered { grid-template-columns: minmax(0, 1fr); }
#pair-order-list li > div { display: grid; flex: 1; min-width: 0; }
#pair-order-list li small { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
#pair-order-list li span { overflow: hidden; text-overflow: ellipsis; }
#pair-order-list li p { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; }
#pair-order-list li b { flex-shrink: 0; font-size: var(--z-fs-sm); font-variant-numeric: tabular-nums; color: var(--z-lime); }
#pair-order-list li.is-empty span { font-weight: 500; color: var(--z-muted); }
#pair-order-list li.is-empty::before { color: var(--z-muted); background: var(--z-surface-3); }
@media (max-width: 991.98px) {
    .z-lineup { grid-template-columns: 1fr; }
    .z-lineup-side.pair-order-container { position: static; }
}
.z-games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.z-games-grid fieldset { margin: 0; }
.z-games-grid fieldset > div + div { margin-top: 12px; }

/* Resultado de un partido (sets) */
.set-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.set { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.set label { margin: 0; color: var(--z-lime); }
.set input[type="number"] { width: 84px; height: 52px; font-size: var(--z-fs-xl); font-weight: 800; }
.z-set-legend { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px 0; }
.z-set-legend span { display: flex; align-items: center; height: 52px; font-size: var(--z-fs-sm); font-weight: 700; color: var(--z-muted); }

/* ---------- Perfil de jugador ---------- */

.z-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 26px; }
.z-profile-name { margin: 0 0 6px; }
.z-profile-stats { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.z-stat { min-width: 110px; padding: 14px 18px; text-align: center; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-stat b { display: block; font-size: var(--z-fs-xl); font-weight: 800; line-height: 1.1; color: var(--z-lime); }
.z-stat span { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--z-muted); }

.z-results { margin: 0; padding: 0; list-style: none; }
.z-results li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--z-border); }
.z-results li:last-child { border-bottom: 0; }
.z-results .z-result-date { font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-wl { display: inline-grid; place-items: center; width: 30px; height: 30px; font-weight: 800; font-size: var(--z-fs-sm); border-radius: 50%; }
.z-wl--w { color: var(--z-ink); background: var(--z-lime); }
.z-wl--l { color: #FFFFFF; background: rgba(255, 92, 99, .3); }

@media (max-width: 767.98px) {
    .z-profile { flex-direction: column; text-align: center; }
    .z-profile-stats { width: 100%; margin: 0; justify-content: center; }
}

/* ---------- Portada ---------- */

.z-home-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(var(--z-lime-rgb), .12), rgba(var(--z-lime-rgb), 0) 60%), var(--z-surface-2);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
}
.z-home-hero h1 { margin: 0; }
.z-home-logo {
    flex-shrink: 0;
    width: 112px;
    height: 112px;
    padding: 6px;
    object-fit: contain;
    background: var(--z-surface);
    border: 3px solid var(--z-lime);
    border-radius: 50% !important;
}

/* ---------- Inicio: enfrentamiento protagonista ---------- */
.z-home-grid { display: grid; gap: 18px; margin-top: 24px; }
@media (min-width: 1100px) {
    .z-home-grid:not(.z-home-grid--both) .z-next-deck { max-width: 820px; }
    .z-home-grid--both { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
    /* Las dos tarjetas miden siempre lo mismo: la fila la marca la más alta (la pista 2:1 o «Pendiente» con sus filas).
       Con un único enfrentamiento no hay selector y la pista ocupa también ese hueco. */
    .z-home-grid--both .z-next-deck { display: flex; flex-direction: column; }
    .z-home-grid--both .z-next-deck-track { flex: 1; }
    .z-home-grid--both .z-next-deck-track::before { content: ""; grid-area: 1 / 1; width: 100%; align-self: start; aspect-ratio: 2 / 1; }
    .z-home-grid--both .z-next-slide { align-self: stretch; }
    .z-home-grid--both .z-next-slide .z-next-match { aspect-ratio: auto; align-self: stretch; }
    /* Con la tarjeta estirada hay sitio de sobra: equipos y ubicación más grandes. */
    .z-home-grid.z-home-grid--both .z-next-match { row-gap: clamp(12px, 2.4cqw, 26px); }
    .z-home-grid--both .z-next-match-meta { margin-top: clamp(8px, 1.4cqw, 16px); }
    .z-home-grid--both .z-next-match-meta .z-location { font-size: var(--z-fs-lg); }
    .z-home-grid--both .z-next-match-meta .z-location span { white-space: normal; }
}
.z-next-match {
    container-type: inline-size;
    position: relative;
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 22px clamp(18px, 5%, 40px);
    overflow: hidden;
    color: var(--z-ink);
    background: var(--z-lime);
    border-radius: var(--z-radius-lg);
}
.z-next-match > * { position: relative; z-index: 1; min-width: 0; }
.z-next-match-when { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.z-next-match-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.z-next-match .z-comp-badge { color: var(--z-lime); background: var(--z-ink); }
.z-next-match .z-fixture-type { color: var(--z-lime); background: var(--z-ink); }
.z-next-match-kicker { margin: 0; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--z-ink); }
/* Indicador de días: fondo oscuro sobre el lima */
.z-next-match-days { flex: none; padding: 7px 14px; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--z-lime); background: var(--z-ink); border-radius: 999px; transform: rotate(4deg); }
.z-next-match-day { margin: 0; font-family: var(--z-display); font-size: clamp(3.4rem, 22cqw, 7.5rem); line-height: .95; text-transform: uppercase; }
.z-next-match-day small { margin-left: .35em; font-size: .28em; letter-spacing: .06em; opacity: .7; }
.z-next-match-meta { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-weight: 700; }
.z-next-match-meta strong { flex: none; font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; line-height: 1; }
.z-next-match-meta .z-location { align-items: center; min-width: 0; font-size: var(--z-fs-md); }
.z-next-match-meta .z-location i { margin: 0; }
.z-next-match-meta .z-location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-next-match .z-location { color: var(--z-ink); }
.z-next-match .z-location i { color: var(--z-ink); }
.z-next-match .z-next-match-me { margin: 0; padding: 0; color: var(--z-ink); background: none; font-size: var(--z-fs-sm); font-weight: 600; }
.z-next-match .z-next-match-me.is-in, .z-next-match .z-next-match-me.is-in i { color: var(--z-ink); }
.z-next-match .z-next-match-me a { color: var(--z-ink); font-weight: 800; }
.z-next-match-cta { display: flex; flex-wrap: wrap; gap: 8px; }
.z-next-match .btn-secondary { --bs-btn-color: var(--z-text); --bs-btn-bg: var(--z-ink); --bs-btn-border-color: var(--z-ink); --bs-btn-hover-color: var(--z-lime); --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-padding-x: 1.75rem; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
.z-next-match .btn-link { --bs-btn-color: var(--z-ink); --bs-btn-hover-color: var(--z-ink); text-decoration: underline; }
/* Local y visitante: siempre centrados, con el VS en el centro de la tarjeta y los dos nombres del mismo tamaño.
   Un nombre largo (más de 16 letras) llega partido en dos líneas desde el servidor (`team_names_fit`) en vez de
   encoger los dos; --fit son las letras de la línea más larga y marca el tamaño común. Los nombres se alinean por
   abajo (Local, VS y Visitante a la misma altura) y el de dos líneas crece hacia arriba. Móvil: uno encima del otro
   con el VS en medio; si aun así una línea no cabe, se recorta con puntos suspensivos. */
.z-next-match-teams { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 6px; width: 100%; margin-inline: auto; text-align: center; }
.z-next-match-team { display: grid; gap: 2px; justify-items: center; min-width: 0; max-width: 100%; text-align: center; }
.z-next-match-team > span { max-width: 100%; font-family: var(--z-display); font-size: clamp(1.1rem, calc(215cqw / var(--fit, 16)), 2.6rem); line-height: 1.05; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-next-match-team small { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--z-ink); opacity: .75; }
.z-next-match-team.is-own span { color: var(--z-ink); }
.z-next-match .z-versus-vs { display: block; padding: 3px 12px; font-size: var(--z-fs-sm); color: var(--z-ink); background: var(--z-lime); border-radius: 999px; line-height: 1; opacity: .7; }

/* Escritorio con «Pendiente» al lado: el bloque es la pista (20 × 10 m, proporción 2:1, sin deformarla).
   La red separa local y visitante, y cada equipo queda en su cuadro de saque. */
@media (min-width: 1100px) {
    .z-home-grid .z-next-match {
        justify-self: stretch;
        aspect-ratio: 2 / 1;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto 1fr;
        grid-template-areas: "when when" "date date" "me cta" "teams teams";
        gap: 6px 12px;
        padding: 1.8cqw 6% 2.6cqw;
    }
    .z-home-grid .z-next-match::before {
        content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' fill='none' stroke='%230A0A0A' stroke-opacity='.15' stroke-width='2'%3E%3Crect x='3' y='6' width='194' height='88' rx='1' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M100 6V94M30.5 6V94M169.5 6V94M30.5 50H169.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / contain no-repeat;
    }
    .z-home-grid .z-next-match-when { grid-area: when; }
    .z-home-grid .z-next-match-date { grid-area: date; }
    .z-home-grid .z-next-match-me { grid-area: me; align-self: center; margin: 0; }
    .z-home-grid .z-next-match-cta { grid-area: cta; align-self: center; justify-self: end; }
    .z-home-grid .z-next-match .btn-secondary { --bs-btn-padding-x: 1.1rem; --bs-btn-padding-y: .3rem; --bs-btn-font-size: var(--z-fs-xs); min-height: 36px; }
    .z-home-grid .z-next-match-day { font-size: clamp(3rem, 13.5cqw, 6.2rem); white-space: nowrap; }
    .z-home-grid .z-next-match-teams {
        grid-area: teams; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; align-self: end; gap: 0 6px; margin: 0 auto; width: 100%;
    }
    .z-home-grid .z-next-match-team > span { font-size: clamp(1.1rem, calc(88cqw / var(--fit, 16)), 3.4rem); }
    .z-home-grid .z-next-match .z-versus-vs, .z-home-grid .z-versus-vs { display: block; padding: 4px 12px; font-size: clamp(1rem, 3cqw, 1.5rem); color: var(--z-ink); background: var(--z-lime); border-radius: 999px; }
}

/* Carrusel de «Próximo enfrentamiento»: el más cercano delante y el siguiente por detrás, asomando y
   difuminado. La tarjeta mide siempre lo mismo (ancho − --p) y todo el movimiento es transform, así que
   no hay saltos de maquetación. Sin JS solo se ve el primero. */
.z-next-deck { --p: 32px; --s: 0px; --ease-deck: cubic-bezier(.32, .72, 0, 1); display: grid; gap: 14px; min-width: 0; }
.z-next-deck[data-pos="mid"] { --s: calc(var(--p) / 2); }
.z-next-deck[data-pos="last"] { --s: var(--p); }
.z-next-deck-track { display: grid; min-width: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.z-next-deck--multi .z-next-deck-track { width: calc(100% - var(--p)); transform: translateX(var(--s)); transition: transform .55s var(--ease-deck); }
.z-next-slide { grid-area: 1 / 1; display: grid; min-width: 0; transition: transform .55s var(--ease-deck); will-change: transform; }
.z-next-slide .z-next-match { transition: opacity .55s var(--ease-deck), filter .55s var(--ease-deck), box-shadow .55s var(--ease-deck); }
.z-next-slide.is-front { z-index: 3; }
.z-next-slide.is-front .z-next-match { box-shadow: 0 14px 32px -14px rgba(0, 0, 0, .75); }
.z-next-slide.is-next, .z-next-slide.is-prev { z-index: 1; cursor: pointer; }
.z-next-slide.is-next { transform: translateX(calc(var(--p) - var(--s))) scale(.94); transform-origin: right center; }
.z-next-slide.is-prev { transform: translateX(calc(var(--s) * -1)) scale(.94); transform-origin: left center; }
.z-next-slide.is-next .z-next-match, .z-next-slide.is-prev .z-next-match { opacity: .55; filter: blur(4px); }
.z-next-slide.is-next a, .z-next-slide.is-prev a, .z-next-slide.is-next button, .z-next-slide.is-prev button { pointer-events: none; }
.z-next-slide:not(.is-front):not(.is-next):not(.is-prev) { visibility: hidden; }
.z-next-deck.is-dragging .z-next-slide.is-front { transition: none; }

/* Selector: una pastilla por tarjeta con su competición y su día, para saber qué hay antes de pulsar. */
.z-next-picker { display: flex; align-items: stretch; gap: 8px; }
.z-next-picker[hidden] { display: none; }
.z-next-chips { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; flex: 1; min-width: 0; }
.z-next-chip { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px; padding: 6px 10px; color: var(--z-text); background: var(--z-surface-2); border: 1px solid var(--z-border-control); border-radius: var(--z-radius-sm); cursor: pointer; transition: background .25s ease, border-color .25s ease, color .25s ease; }
.z-next-chip:hover { border-color: var(--z-border-control-hover); background: var(--z-surface-3); }
.z-next-chip-comp { display: inline-flex; align-items: center; gap: 6px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted); }
.z-next-chip-comp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--z-lime); }
.z-next-chip--snp .z-next-chip-comp::before { background: var(--z-snp); }
.z-next-chip--lapi .z-next-chip-comp::before { background: var(--z-lapi); }
.z-next-chip-date { font-size: var(--z-fs-md); font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.z-next-chip[aria-current="true"] { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-next-chip[aria-current="true"] .z-next-chip-comp { color: var(--z-ink); }
.z-next-chip[aria-current="true"] .z-next-chip-comp::before { background: var(--z-ink); }
.z-next-arrow { display: none; flex: none; width: 52px; color: var(--z-text); background: var(--z-surface-2); border: 1px solid var(--z-border-control); border-radius: var(--z-radius-sm); cursor: pointer; }
.z-next-arrow:hover:not(:disabled) { border-color: var(--z-lime); color: var(--z-lime); }
.z-next-arrow:disabled { opacity: .4; cursor: default; }
@media (min-width: 768px) { .z-next-arrow { display: grid; place-items: center; } }
.z-next-chip:focus-visible, .z-next-arrow:focus-visible { outline: 2px solid var(--z-text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .z-next-deck--multi .z-next-deck-track, .z-next-slide, .z-next-slide .z-next-match, .z-next-chip { transition: none; }
}

/* Panel «Pendiente» */
.z-home-pending { display: grid; align-content: start; gap: 6px; padding: 22px 26px; border-radius: var(--z-radius-lg); }
.z-home-pending-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.z-panel-title { margin: 0; font-family: var(--z-display); font-size: var(--z-fs-2xl); font-weight: 400; line-height: 1; letter-spacing: .01em; }
.z-panel-title span { color: var(--z-muted); }
.z-location { display: inline-flex; align-items: flex-start; gap: 8px; min-width: 0; font-weight: 600; color: var(--z-text); }
.z-location i { margin-top: 3px; color: var(--z-lime); }
a.z-location:hover span { text-decoration: underline; }


/* Banner con equipos en varias competiciones: todos a la vez, cada uno con su escudo, competición y papel. */
.z-home-hero--teams { display: grid; gap: 16px; align-items: stretch;
    background: linear-gradient(135deg, rgba(var(--z-snp-rgb), .14), rgba(var(--z-snp-rgb), 0) 50%, rgba(var(--z-lapi-rgb), .14)), var(--z-surface-2); }
.z-home-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
/* Tira compacta de equipos sobre el enfrentamiento (sustituye al banner grande «Tus equipos») */
.z-home-strip { margin-bottom: 4px; }
.z-home-strip .z-home-team { padding: 8px 14px 8px 8px; background: var(--z-surface); border-radius: 999px; }
.z-home-strip .z-home-team-logo { width: 40px; height: 40px; padding: 3px; border-width: 2px; }
.z-home-strip .z-home-team-text { gap: 0; }
.z-home-strip .z-home-team-text strong { font-size: var(--z-fs-md); }
.z-home-strip .z-home-team-text > span { font-size: var(--z-fs-sm); flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.z-home-strip .z-comp-badge { margin: 0; }
.z-home-team { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
/* Equipo clicable: el enlace del nombre se estira sobre toda la píldora (un solo enlace); «Pon la categoría» queda por encima. */
.z-home-team--link { position: relative; transition: border-color .15s, background .15s; }
.z-home-team--link:hover { border-color: var(--z-lime); background: var(--z-surface-2); }
.z-home-team--link:focus-within { outline: 2px solid var(--z-lime); outline-offset: 2px; }
.z-home-team--link .stretched-link { color: inherit; text-decoration: none; }
.z-home-team--link .stretched-link:focus-visible { outline: none; }
.z-home-team-action { position: relative; z-index: 2; }
.z-home-team-logo { flex-shrink: 0; width: 56px; height: 56px; padding: 4px; object-fit: contain; background: var(--z-surface); border: 2px solid var(--z-lime); border-radius: 50% !important; }
.z-home-team--snp .z-home-team-logo { border-color: var(--z-snp); }
.z-home-team--lapi .z-home-team-logo { border-color: var(--z-lapi); }
.z-home-team-text { display: grid; gap: 4px; min-width: 0; text-align: left; }
.z-home-team-text strong { font-weight: 800; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-home-team-text > span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--z-muted); font-size: var(--z-fs-sm); }
/* Elegir equipo al crear un enfrentamiento (match/templates/create_match_choose.html). */
.z-choose-teams { margin-top: 16px; }
/* UX-030: dos opciones grandes lado a lado, no una lista pequeña en un lienzo vacío */
@media (min-width: 768px) {
    .z-choose-teams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 880px; }
    .z-choose-team { min-height: 132px; padding: 22px; }
    .z-choose-team .z-home-team-logo { width: 72px; height: 72px; }
    .z-choose-team .z-home-team-text strong { font-size: var(--z-fs-xl); }
}
.z-account-sheet-team { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.z-create-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 20px; background: rgba(255, 255, 255, .04); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-create-in > i { color: var(--z-muted); }
.z-create-in-change { margin-left: auto; font-weight: 700; }
.z-choose-team { color: var(--z-text); text-decoration: none; min-height: 80px; transition: border-color .15s var(--z-ease), background .15s var(--z-ease); }
.z-choose-team:hover, .z-choose-team:focus-visible { color: var(--z-text); border-color: var(--z-lime); background: rgba(var(--z-lime-rgb), .06); }
.z-home-hero--teams .z-comp-badge { margin: 0; }

@media (max-width: 575.98px) {
    .z-home-hero { flex-direction: column; text-align: center; }
    .z-home-hero--teams { text-align: left; }
    .z-home-logo { width: 96px; height: 96px; }
}

.z-empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--z-muted);
    background: var(--z-surface);
    border: 1px dashed var(--z-border-strong);
    border-radius: var(--z-radius);
}
.z-empty > i { display: block; margin-bottom: 10px; font-size: var(--z-fs-xl); color: var(--z-lime); }

/* ==================================================================
   Estadísticas (equipo y jugador). Prefijo st- para no chocar con el
   CSS global. Reutilizan los colores de Zyra.
   ================================================================== */

.st-page {
  --st-navy: var(--z-lime);
  --st-navy-soft: var(--z-muted);
  --st-gold: var(--z-lime);
  --st-win: var(--z-lime);
  --st-loss: var(--z-danger);
  --st-ink: var(--z-text);
  --st-muted: var(--z-muted);
  --st-line: var(--z-border);
  --st-tint: var(--z-surface-2);
  --st-card: var(--z-surface);
  --st-display: var(--z-display);

  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0 40px;
  font-family: var(--z-body);
  color: var(--st-ink);
  line-height: 1.5;
}

.st-page *, .st-page *::before, .st-page *::after { box-sizing: border-box; }
.st-page h1, .st-page h2, .st-page h3, .st-page p { text-align: left; }

.st-up { color: var(--st-win); }
.st-down { color: var(--st-loss); }
.st-muted { color: var(--st-muted); }

.st-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 32px; margin-bottom: 24px;
}
.st-title {
  margin: 0; font-family: var(--st-display); text-transform: uppercase;
  font-size: clamp(2rem, 5.6vw, 3.2rem); font-weight: 400; line-height: 1.12; color: #FFFFFF;
}
.st-subtitle { margin: 6px 0 0; font-size: var(--z-fs-base); color: var(--st-muted); }

.st-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-label { margin: 0; }
.st-select { min-width: 240px; width: auto; }
.st-btn { padding: 9px 18px; font: inherit; font-weight: 800; color: var(--z-ink); background: var(--z-lime); border: 0; border-radius: 999px; cursor: pointer; }

.st-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px; margin-bottom: 14px;
}

@media (min-width: 1100px) {
  .st-kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .st-kpis--5 .st-kpi--ring { gap: 12px; padding-inline: 16px; }
  .st-kpis--5 .st-ring { --size: 76px; }
}

.st-kpi {
  display: flex; flex-direction: column; justify-content: center;
  padding: 20px 22px; background: var(--st-card);
  border: 1px solid var(--st-line); border-radius: var(--z-radius);
}
.st-kpi-label { margin: 0; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--st-muted); }
.st-kpi-value {
  margin: 4px 0 0; font-size: var(--z-fs-2xl); font-weight: 800;
  line-height: 1; font-variant-numeric: tabular-nums; color: #FFFFFF;
}
.st-kpi-sub { margin: 6px 0 0; font-size: var(--z-fs-md); color: var(--st-muted); }

.st-kpi--ring { flex-direction: row; align-items: center; gap: 18px; background: var(--st-card); border-color: var(--z-lime); }
.st-kpi--ring .st-kpi-label { color: var(--z-lime); }
.st-kpi--ring .st-kpi-sub { color: var(--z-text); }

.st-ring {
  --size: 96px;
  flex: none; display: grid; place-items: center;
  width: var(--size); height: var(--size); border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--st-card) 80%, transparent 82%),
    conic-gradient(var(--z-lime) calc(var(--pct) * 1%), var(--z-surface-3) 0);
}
.st-ring span { font-size: var(--z-fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; color: #FFFFFF; }
/* 100 %: cuatro caracteres no caben a 1.5rem dentro del aro */
.st-ring--full span { font-size: var(--z-fs-lg); }

.st-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px; margin-bottom: 14px;
}

/* Dos tarjetas por fila (la de sets necesita ancho para sus dos columnas) */
.st-row--pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }

.st-card {
  display: flex; flex-direction: column; min-width: 0;
  padding: 22px; background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius);
}
.st-card-title { margin: 0; font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; line-height: 1.15; color: #FFFFFF; }
.st-card-note { margin: 4px 0 0; font-size: var(--z-fs-sm); color: var(--st-muted); }

.st-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.st-pip {
  display: grid; place-items: center; width: 38px; height: 38px;
  font-size: var(--z-fs-base); font-weight: 800; border-radius: 50%;
}
.st-pip--w { color: var(--z-ink); background: var(--st-win, var(--z-lime)); }
.st-pip--l { color: #FFFFFF; background: rgba(255, 92, 99, .35); }

.st-split { margin-top: 18px; }
.st-split-head { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; }
.st-split-head b { font-size: var(--z-fs-xl); font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.st-meter { height: 14px; margin-top: 6px; overflow: hidden; background: var(--z-surface-3); border-radius: 999px; }
.st-meter span { display: block; height: 100%; background: var(--z-lime); border-radius: 999px; }
.st-split-foot { margin: 6px 0 0; font-size: var(--z-fs-sm); color: var(--st-muted); }

.st-section { margin-top: 36px; scroll-margin-top: 90px; }
.st-section-title {
  display: inline-block; margin: 0 0 16px; padding-bottom: 8px;
  font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; letter-spacing: .02em; line-height: 1.1; text-transform: uppercase;
  color: #FFFFFF; border-bottom: 2px solid var(--z-lime);
}

.st-chart { position: relative; height: 280px; margin-top: 16px; }
.st-chart--tall { height: 520px; }

.st-table-wrap { margin-top: 12px; overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.st-table th, .st-table td { padding: 12px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--st-line); }
.st-table thead th { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--st-muted); }
.st-table th:first-child, .st-table td:first-child { text-align: left; }
.st-table tbody th { font-weight: 700; color: #FFFFFF; }
.st-table tbody tr:last-child th, .st-table tbody tr:last-child td { border-bottom: 0; }
.st-table tbody tr:hover { background: rgba(var(--z-lime-rgb), .05); }

.st-empty {
  margin-bottom: 24px; padding: 36px 24px; text-align: center; color: var(--st-muted);
  background: var(--st-card); border: 1px dashed var(--z-border-strong); border-radius: var(--z-radius);
}
.st-empty strong { display: block; margin-bottom: 4px; font-size: var(--z-fs-lg); color: #FFFFFF; }

.st-seasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.st-chip {
  display: inline-block; padding: 7px 16px;
  font-size: var(--z-fs-sm); font-weight: 700; color: var(--z-text);
  background: var(--z-surface-2); border: 1px solid var(--st-line); border-radius: 999px;
  transition: border-color .2s var(--z-ease), background-color .2s var(--z-ease), color .2s var(--z-ease);
}
.st-chip:hover { color: #FFFFFF; border-color: var(--z-lime); }
.st-chip[aria-current="page"] { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.st-filter-label { align-self: center; margin-right: 4px; font-size: var(--z-fs-sm); font-weight: 700; letter-spacing: .01em; color: var(--z-muted); }
.st-chip[aria-pressed="true"] { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
button.st-chip { font-family: inherit; line-height: inherit; cursor: pointer; }

/* Grado de afinidad: selector de compañeros arriba a la derecha */
.st-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.st-aff-scope { display: flex; flex-wrap: wrap; gap: 8px; }
.st-aff-empty { margin-top: 16px; }
.st-chart[hidden], .st-balance-sort[hidden], .st-tally[hidden], .st-aff-empty[hidden] { display: none; }
@media (max-width: 760px) {
  .st-aff-scope { gap: 6px; }
  .st-aff-scope .st-chip { padding: 6px 12px; font-size: var(--z-fs-sm); white-space: nowrap; }
}

/* Balance por jugador: orden y paginador */
.st-balance-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.st-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.st-pager[hidden] { display: none; }
.st-pager-info { min-width: 7.5em; text-align: center; font-size: var(--z-fs-md); font-weight: 700; color: var(--z-text); font-variant-numeric: tabular-nums; }
.st-pager-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  color: var(--z-text); background: var(--z-surface-2); border: 1px solid var(--st-line); border-radius: 999px;
  cursor: pointer; transition: border-color .15s;
}
.st-pager-btn:hover:not(:disabled) { color: #FFFFFF; border-color: var(--z-lime); }
.st-pager-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) {
  .st-balance-sort { gap: 6px; }
  .st-balance-sort .st-filter-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .st-balance-sort .st-chip { padding: 6px 12px; font-size: var(--z-fs-sm); white-space: nowrap; }
}

.st-detail { margin-bottom: 24px; padding: 22px; background: rgba(var(--z-lime-rgb), .05); border: 1px solid rgba(var(--z-lime-rgb), .25); border-radius: var(--z-radius-lg); }
.st-detail-title { margin: 0 0 16px; font-size: var(--z-fs-base); font-weight: 800; letter-spacing: .01em; color: var(--z-lime); }
.st-detail .st-kpis, .st-detail .st-row { margin-bottom: 14px; }
.st-detail .st-row:last-child { margin-bottom: 0; }

.st-kpi--accent { border-left: 4px solid var(--z-lime); }

.st-vs { margin-top: 18px; }
.st-vs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-weight: 600; }
.st-vs-head b { font-size: var(--z-fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; }
.st-vs-bar { height: 14px; margin-top: 6px; overflow: hidden; background: rgba(255, 92, 99, .45); border-radius: 999px; }
.st-vs-bar span { display: block; height: 100%; background: var(--st-win); }
.st-vs-bar--neutral { background: var(--z-surface-3); }
.st-vs-bar--neutral span { background: var(--z-lime); }

.st-tally { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--st-line); }
.st-tally-item { display: inline-flex; align-items: baseline; gap: 6px; color: var(--st-muted); }
.st-tally-item::before { content: ""; width: 10px; height: 10px; align-self: center; border-radius: 50%; background: var(--st-muted); }
.st-tally-item b { font-size: var(--z-fs-lg); font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.st-tally-item--win::before { background: var(--st-win); }
.st-tally-item--loss::before { background: var(--st-loss); }
.st-tally-item--draw::before { background: #8A8A8A; }
.st-tally-item--neutral::before { background: var(--z-lime); }
.st-tally-item--muted::before { background: var(--z-surface-3); }

.st-table tbody tr.st-current { background: rgba(var(--z-lime-rgb), .08); }
.st-table tbody tr.st-current th { box-shadow: inset 3px 0 0 var(--z-lime); }
.st-table a { color: inherit; text-decoration: underline; text-decoration-color: var(--z-border-strong); text-underline-offset: 3px; }
.st-table a:hover { text-decoration-color: var(--z-lime); }
/* Tabla de partidos del jugador: toda la fila lleva al partido */
.st-table--links tbody tr { cursor: pointer; }
/* El clic en cualquier punto de la fila lo gestiona a11y.js: un enlace estirado con ::after
   dependía de que <tr> fuera el bloque contenedor, y algunos Safari no lo hacen, así que el
   enlace cubría toda la página y cualquier toque abría un partido. */
/* Partido enlazado desde las estadísticas (call_for_match#partido-N) */
.z-game { scroll-margin-top: 90px; }
.z-game:target { box-shadow: 0 0 0 2px var(--z-lime); }

.st-empty--inline { padding: 18px 24px; text-align: left; margin-bottom: 16px; }
.st-empty--inline strong { display: inline; margin: 0 6px 0 0; font-size: var(--z-fs-base); }

.st-kpi-of { font-size: var(--z-fs-lg); font-weight: 700; color: var(--st-muted); }
.st-page h4 { margin: 0; }
.st-card-title + .st-vs { margin-top: 14px; }

/* Barras de la vista de equipo */
.st-bar { height: 10px; margin-top: 8px; overflow: hidden; background: rgba(255, 92, 99, .45); border-radius: 999px; }
.st-bar { display: flex; }
.st-bar-win { display: block; height: 100%; background: var(--z-lime); }
.st-split { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px 0; background: var(--z-surface-2, #1B1B1B); border: 1px solid var(--st-line); border-bottom: 0; border-radius: 14px 14px 0 0; }
.st-split-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-split-side--against { align-items: flex-end; text-align: right; }
.st-split-label { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--st-muted); }
.st-split-pct { font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.st-split-side--for .st-split-pct { color: var(--z-lime); }
.st-split-side--against .st-split-pct { color: var(--st-loss); }
.st-split-count { font-size: var(--z-fs-sm); color: var(--st-muted); padding-bottom: 14px; }
.st-split-bar { display: flex; height: 14px; overflow: hidden; background: rgba(255, 92, 99, .25); border: 1px solid var(--st-line); border-top: 0; border-radius: 0 0 14px 14px; }
.st-split-for { display: block; height: 100%; background: var(--z-lime); }
.st-split-against { display: block; height: 100%; background: var(--st-loss); }
.st-bar-draw { display: block; height: 100%; background: #8A8A8A; }

/* Jugadores para elegir en las estadísticas de jugador (sin jugador elegido) */
.st-player-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px; margin: 0 0 24px; padding: 0; list-style: none;
}
.st-player-card {
  display: flex; align-items: center; gap: 12px; height: 100%; padding: 10px 14px;
  font-weight: 700; color: var(--z-text); text-decoration: none;
  background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius);
  transition: border-color .2s var(--z-ease), background .2s var(--z-ease);
}
.st-player-card:hover, .st-player-card:focus-visible { color: var(--z-text); border-color: var(--z-lime); background: var(--z-surface-2); }
.st-player-card span { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .st-select { min-width: 0; width: 100%; }
  .st-picker { width: 100%; }
  .st-player-grid { gap: 8px; }
  .st-player-card { padding: 8px 12px; }
  .st-chart { height: 260px; }
  .st-chart--tall { height: 460px; }
  .st-kpi-value { font-size: var(--z-fs-2xl); }
}

/* Utilidades */
[hidden] { display: none !important; }
.min-w-0 { min-width: 0; }
.z-check-grid > [class*="col-"] { width: auto; max-width: none; padding: 0; }

/* Estadísticas del equipo: marcador, datos y rejilla */
.st-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 14px;
  padding: 28px;
  color: var(--z-ink);
  background: var(--z-lime);
  border-radius: var(--z-radius-lg);
}
.st-board-label { margin: 0 0 8px; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-ink); }
.st-record { display: flex; align-items: center; gap: 18px; }
.st-score { display: flex; flex-direction: column; }
.st-record-num { font-family: var(--z-display); font-size: clamp(4rem, 12vw, 7rem); font-weight: 400; line-height: .9; color: var(--z-ink); font-variant-numeric: tabular-nums; }
.st-score-cap { font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-ink); }
.st-record-sep { font-size: var(--z-fs-2xl); color: var(--z-ink); opacity: .45; }
.st-board .st-bar { height: 14px; background: rgba(10, 10, 10, .15); }
.st-board .st-bar-win { background: var(--z-ink); }
.st-board .st-bar-draw { background: rgba(10, 10, 10, .4); }
.st-board .st-fact { background: var(--z-ink); border-color: transparent; }
.st-board .st-fact dd { font-family: var(--z-display); font-weight: 400; }
.st-board .st-fact--gold dd { color: var(--z-lime); }
.st-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.st-fact { padding: 14px 16px; background: var(--z-surface-2); border: 1px solid var(--st-line); border-radius: var(--z-radius-sm); }
.st-fact dt { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--st-muted); }
.st-fact dd { margin: 2px 0 0; font-size: var(--z-fs-xl); font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.st-fact--gold { border-color: var(--z-lime); }
.st-fact--gold dd { color: var(--z-lime); }
.st-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.st-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-card--wide { grid-column: 1 / -1; }
.st-vs-bar--loss span { background: var(--z-lime); }

.st-tabs { margin-bottom: 20px; }

@media (max-width: 900px) {
  .st-grid { grid-template-columns: 1fr; }
  .st-board { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
  .st-board { padding: 18px; }
  .st-record { justify-content: space-between; gap: 8px; }
  .st-record-sep { font-size: var(--z-fs-xl); }
  .st-score-cap { font-size: var(--z-fs-xs); letter-spacing: .04em; }
  .st-fact { min-width: 0; padding: 12px; }
}

/* Ajustes de maquetación */
.z-header-inner > nav { margin: 0 auto; }
.z-header-actions { margin-left: auto; }
.z-header-inner > nav + .z-header-actions { margin-left: 0; }
.z-game { padding: 0; }
@media (max-width: 991.98px) {
    .z-club-name { max-width: 120px; }
}

/* Tablet horizontal (992-1199 px): la cabecera de escritorio no cabe, se compacta */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .z-header-inner { gap: 12px; padding: 0 16px; }
    .z-nav { gap: 2px; }
    .z-nav-link { padding: 9px 12px; gap: 6px; font-size: var(--z-fs-sm); }
    .z-header-actions { gap: 6px; min-width: 0; }
    .z-club-name { max-width: 110px; }
}

/* Resultado: equipos + 3 sets siempre en una fila */
.set-row { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 620px; }
.set { padding: 12px 8px; }
.set input[type="number"] { width: 100%; max-width: 84px; }
.z-set-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 52px; }
.z-set-legend { padding: 12px 0; min-width: 0; }
@media (max-width: 575.98px) {
    .set-row { gap: 6px; }
    .set { padding: 10px 4px; }
    .set input[type="number"] { height: 46px; font-size: var(--z-fs-lg); padding: .4rem; }
    .z-set-legend span { height: 46px; line-height: 46px; font-size: var(--z-fs-xs); }
}

/* Tablas top 5 */
.st-top-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.st-top { margin: 14px 0 0; padding: 0; list-style: none; }
.st-top-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--st-line); }
.st-top-row:last-child { border-bottom: 0; padding-bottom: 0; }
.st-top-pos {
  display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px;
  font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-text); background: var(--z-surface-3); border-radius: 50%;
}
.st-top-row:first-child .st-top-pos { color: var(--z-ink); background: var(--z-lime); }
.st-top-name { flex: 1; min-width: 0; font-weight: 700; color: #FFFFFF; overflow-wrap: anywhere; }
.st-top-name small { display: block; font-size: var(--z-fs-sm); font-weight: 500; color: var(--st-muted); }
.st-top-pct { font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; color: var(--z-lime); font-variant-numeric: tabular-nums; }
.st-top-bar { display: block; height: 8px; margin-top: 6px; overflow: hidden; background: var(--z-surface-3); border-radius: 999px; }
.st-top-bar i { display: block; height: 100%; background: var(--z-lime); border-radius: inherit; }
@media (max-width: 760px) { .st-top-grid { grid-template-columns: 1fr; } }

/* ---------- Partidos: resumen y filas compactas ---------- */
.z-select-compact { width: auto; min-width: 210px; padding-top: .55rem; padding-bottom: .55rem; }
.z-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.z-summary > div { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-summary b { font-size: var(--z-fs-xl); font-weight: 800; line-height: 1; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.z-summary span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.z-summary .is-win b { color: var(--z-lime); }
.z-summary .is-loss b { color: var(--z-danger); }
.z-summary .is-draw b { color: #A3A3A3; }

/* Listado de enfrentamientos: una fila por partido. Franja izquierda con el color de la competición
   (SNP ámbar, LAPI turquesa), fecha en bloque (lima victoria, rojo derrota, gris empate, ámbar
   pendiente), tipo en píldora, recorrido de cuatro pasos y resultado o estado a la derecha.
   En móvil el recorrido pasa a una segunda línea. Toda la tarjeta es pulsable. */
.z-fixtures { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.z-fixture {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-areas: "date main" "result result" "flow flow";
    align-items: center;
    gap: 14px 18px;
    min-width: 0;
    padding: 18px 20px;
    background: var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius-lg);
    box-shadow: var(--z-edge);
    transition: border-color .2s var(--z-ease), background-color .2s var(--z-ease);
}
.z-fixture:hover { background-color: var(--z-surface-2); border-color: var(--z-border-strong); }
.z-fixture:focus-within { outline: 2px solid var(--z-lime); outline-offset: 2px; }
.z-fixture-date { grid-area: date; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 58px; border-radius: var(--z-radius); background: var(--z-surface-3); color: var(--z-text); }
.z-fixture-date b { font: 400 1.7rem/1 var(--z-display); }
.z-fixture-date small { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; }
.z-fixture-main { grid-area: main; display: grid; gap: 12px; min-width: 0; }
.z-fixture-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.z-fixture-type { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: var(--z-fs-xs); font-weight: 800; color: var(--z-text); background: var(--z-surface-2); border-radius: 999px; white-space: nowrap; }
.z-fixture-result { grid-area: result; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.z-fixture-score { font: 400 1.9rem/1 var(--z-display); color: var(--z-text); white-space: nowrap; }
.z-fixture.is-win .z-fixture-score { color: var(--z-lime); }
.z-fixture.is-loss .z-fixture-score { color: var(--z-danger); }
.z-flow4 { grid-area: flow; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0 4px; list-style: none; }
.z-flow4 li { position: relative; text-align: center; font-size: var(--z-fs-xs); font-weight: 700; color: var(--z-muted); }
.z-flow4 li::before { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 3px; background: var(--z-border-strong); }
.z-flow4 li:first-child::before { display: none; }
.z-flow4 li.is-done::before, .z-flow4 li.is-cur::before { background: var(--z-lime); }
.z-flow4 li.is-done, .z-flow4 li.is-cur { color: var(--z-text); }
.z-flow4 i { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 50%; background: var(--z-surface); border: 3px solid var(--z-border-strong); font-size: var(--z-fs-xs); font-style: normal; font-weight: 800; color: var(--z-ink); }
.z-flow4 .is-done i { background: var(--z-lime); border-color: var(--z-lime); }
.z-flow4 .is-cur i { background: var(--z-warning); border-color: var(--z-warning); }
/* Jugadores sin permisos de gestión: tarjeta como la de Inicio (fecha grande, local contra visitante)
   con el borde del color de la competición y sin recorrido de pasos. */
.z-fixture.is-player { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 18px 20px; border: 2px solid var(--z-snp); }
.z-fixture.is-player[data-comp="lapi"] { border-color: var(--z-lapi); }
.z-pfx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.z-pfx-head .z-fixture-state { margin-left: auto; }
.z-pfx-date { margin: 4px 0 0; font: 400 clamp(2.6rem, 11vw, 4rem)/.95 var(--z-display); text-transform: uppercase; color: var(--z-text); }
.z-pfx-date small { margin-left: .35em; font-size: .3em; letter-spacing: .06em; color: var(--z-muted); }
.z-pfx-meta { display: flex; align-items: center; gap: 10px; margin: 0; font-size: var(--z-fs-md); font-weight: 700; color: var(--z-muted); }
.z-pfx-meta strong { flex: none; font: 400 1.4rem/1 var(--z-display); color: var(--z-text); }
.z-pfx-meta .z-location { min-width: 0; font-size: var(--z-fs-md); color: var(--z-muted); }
.z-pfx-meta .z-location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-pfx-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--z-border); }
.z-pfx-team { font: 400 clamp(1.15rem, 4.6vw, 1.7rem)/1.05 var(--z-display); text-transform: uppercase; color: #D9DBD3; overflow-wrap: break-word; }
.z-pfx-team:last-child { text-align: right; }
.z-pfx-team.is-own { color: #FFFFFF; }
.z-pfx-team small { display: block; margin-top: 4px; font: 800 .66rem var(--z-body); letter-spacing: .14em; color: var(--z-muted); }
.z-pfx-vs { padding: 3px 12px; font: 400 1.2rem/1.2 var(--z-display); color: var(--z-ink); background: var(--z-lime); border-radius: 999px; white-space: nowrap; }
.z-pfx-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-pfx-open { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-lime); text-decoration: none; }
@media (min-width: 992px) { .z-fixtures:has(.is-player) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
  /* Con tarjetas de jugador en columnas, las de capitán (fila de cuatro bloques) ocupan la fila entera. */
  .z-fixtures:has(.is-player) > .z-fixture:not(.is-player) { grid-column: 1 / -1; } }
@media (min-width: 992px) {
    .z-fixture { grid-template-columns: 64px minmax(0, 1fr) 320px 190px; grid-template-areas: "date main flow result"; gap: 18px; padding-right: 22px; }
    .z-fixture-result { flex-direction: column; align-items: flex-end; }
    .z-fixture-date { height: 64px; }
}
.z-fixture-state { padding: 3px 10px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; border-radius: 999px; white-space: nowrap; }
.z-fixture-state.is-win { color: var(--z-ink); background: var(--z-lime); }
.z-fixture-state.is-loss { color: var(--z-ink); background: var(--z-danger); }
.z-fixture-state.is-draw { color: var(--z-ink); background: #C9CBC4; }
.z-fixture-state.is-upcoming { color: var(--z-ink); background: var(--z-warning); }
.z-fixture-state.is-pending-close { color: var(--z-ink); background: var(--z-lime); }
.z-fixture-state.is-open { color: var(--z-warning); border: 1px solid var(--z-warning); }
/* Fecha pasada sin cerrar (UX-016): relleno rojo, igual que el aviso del Inicio */
.z-fixture-state.is-overdue { color: var(--z-ink); background: var(--z-danger); }

.z-fixture-teams { display: grid; gap: 10px; }
.z-fixture-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: var(--z-fs-md); font-weight: 700; color: #D9DBD3; }
.z-fixture-team img { width: 28px; height: 28px; flex-shrink: 0; object-fit: cover; border-radius: 50%; background: var(--z-surface-2); border: 1px solid var(--z-border-strong); }
.z-fixture-name { text-transform: uppercase; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-fixture-team.is-own .z-fixture-name { color: #FFFFFF; font-weight: 800; }
.z-fixture-team.is-own img { border-color: var(--z-lime); }
.z-fixture-team.is-loser { color: var(--z-muted); }

.z-fixture-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-fixture-meta { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.z-fixture-meta i { font-size: .9em; }
.z-fixture-place { display: block; flex: 0 1 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-fixture-place i { margin-right: 6px; }
.z-fixture-actions { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.z-fixture-open { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--z-lime); text-decoration: none; white-space: nowrap; }
.z-fixture-open:hover { color: var(--z-lime-hover); }
.z-fixture-open:focus-visible { outline: none; }
.z-fixture-open i { font-size: .75em; }
.z-fixture .z-fixture-delete { position: relative; top: auto; right: auto; }
.z-wl { color: var(--z-text); background: var(--z-surface-3); }
.z-wl--d { color: var(--z-ink); background: #C9CBC4; }

/* Buscador y filtro por rival encima del listado */
.z-match-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
.z-match-filters .z-search { flex: 1 1 260px; max-width: 420px; }
.z-match-filters .z-picker { flex: 0 1 280px; min-width: 200px; }
.z-match-filters-count { font-size: var(--z-fs-sm); color: var(--z-muted); }

@media (max-width: 767.98px) {
    .z-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
    .z-summary > div { flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 0; }
    .z-summary b { font-size: var(--z-fs-lg); }
    /* El texto escala con la pantalla para que "Pendientes" quepa en su panel incluso a 320 px */
    .z-summary span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.47rem, 2.3vw, .6rem); letter-spacing: 0; }
    .z-select-compact { min-width: 0; width: 100%; }
    .z-page-head .z-actions { width: 100%; }
    .z-page-head .z-actions form { flex: 1; }
    /* Móvil: una tarjeta por fila a todo el ancho, con algo menos de relleno. */
    .z-fixtures { gap: 10px; }
    .z-fixture { gap: 10px; padding: 12px 14px; }
    .z-fixture-team img { width: 32px; height: 32px; }
    .z-match-filters .z-search, .z-match-filters .z-picker { flex: 1 1 100%; max-width: none; }
}

/* ---------- Selector con búsqueda (player-picker.js) ---------- */
.z-picker { position: relative; min-width: 240px; }
.z-picker-input {
    padding-left: 2.6rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A3A3A3' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 1rem center;
    border-radius: 999px !important;
}
.z-picker-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1040;
    display: none;
    max-height: 320px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    background: var(--z-surface-2);
    border: 1px solid var(--z-border-strong);
    border-radius: var(--z-radius);
    box-shadow: var(--z-edge), var(--z-shadow-pop);
}
.z-picker.is-open .z-picker-list { display: block; }
.z-picker-option { padding: 9px 12px; font-weight: 600; border-radius: var(--z-radius-sm); cursor: pointer; }
.z-picker-option:hover { background: var(--z-surface-3); }
.z-picker-option.is-active { color: var(--z-ink); background: var(--z-lime); }
.z-picker-option { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.z-picker-meta { flex-shrink: 0; font-size: var(--z-fs-xs); font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.z-picker.has-toggle .z-picker-input { padding-right: 2.8rem !important; }
.z-picker-toggle { position: absolute; top: 0; right: 4px; display: grid; place-items: center; width: 40px; height: 100%; padding: 0; color: var(--z-muted); background: none; border: 0; cursor: pointer; }
.z-picker-toggle:hover { color: var(--z-lime); }
.z-picker.is-open .z-picker-toggle i { transform: rotate(180deg); }
.z-picker-option[aria-selected="true"]:not(.is-active) { color: var(--z-lime); }
.z-picker-empty { padding: 9px 12px; color: var(--z-muted); }
@media (max-width: 760px) { .z-picker { min-width: 0; width: 100%; } }

/* ---------- Calendario (static/js/date-picker.js) ---------- */
.z-datepicker { position: relative; }
.z-datepicker-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: .7rem 1rem;
    font: inherit;
    font-size: max(16px, 1rem);
    font-weight: 600;
    text-align: left;
    color: var(--z-text);
    background: var(--z-surface-2);
    border: 1px solid var(--z-border-control);
    border-radius: var(--z-radius-sm);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.z-datepicker-trigger i { color: var(--z-lime); }
.z-datepicker-trigger.is-empty span { font-weight: 500; color: #8C8C8C; }
.z-datepicker-trigger:hover { border-color: var(--z-border-control-hover); }
.z-datepicker.is-open .z-datepicker-trigger,
.z-datepicker-trigger:focus-visible {
    border-color: var(--z-lime);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--z-lime-rgb), .18);
}
.z-datepicker.is-invalid .z-datepicker-trigger { border-color: var(--z-danger); box-shadow: 0 0 0 3px rgba(255, 92, 99, .18); }

.z-datepicker-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1040;
    display: none;
    width: 320px;
    max-width: 100%;
    padding: 14px;
    background: var(--z-surface-2);
    border: 1px solid var(--z-border-strong);
    border-radius: var(--z-radius);
    box-shadow: var(--z-edge), var(--z-shadow-pop);
}
.z-datepicker.is-open .z-datepicker-pop { display: block; }

.z-datepicker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.z-datepicker-title {
    font-family: var(--z-display);
    font-size: var(--z-fs-base);
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #FFFFFF;
}
.z-datepicker-nav {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: var(--z-fs-sm);
    color: var(--z-lime);
    background: var(--z-surface-3);
    border: 1px solid var(--z-border);
    border-radius: 50%;
    cursor: pointer;
}
.z-datepicker-nav:hover { border-color: var(--z-lime); }

.z-datepicker-weekdays,
.z-datepicker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.z-datepicker-weekdays span {
    padding: 4px 0;
    font-size: var(--z-fs-xs);
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
    color: var(--z-muted);
}
.z-datepicker-day {
    aspect-ratio: 1;
    padding: 0;
    font: inherit;
    font-size: var(--z-fs-md);
    font-weight: 600;
    color: var(--z-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--z-radius-sm);
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
.z-datepicker-day:hover { background: var(--z-surface-3); }
.z-datepicker-day:focus-visible { outline: none; border-color: var(--z-lime); }
.z-datepicker-day.is-outside { color: #5C5C5C; }
.z-datepicker-day.is-today { color: var(--z-lime); border-color: rgba(var(--z-lime-rgb), .45); }
.z-datepicker-day.is-selected { font-weight: 800; color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-datepicker-day.is-selected:hover { background: var(--z-lime-hover); }

.z-datepicker-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--z-border);
}
.z-datepicker-foot button {
    padding: 4px 10px;
    font: inherit;
    font-size: var(--z-fs-sm);
    font-weight: 800;
    letter-spacing: .06em;
  
    color: var(--z-lime);
    background: none;
    border: 0;
    border-radius: var(--z-radius-sm);
    cursor: pointer;
}
.z-datepicker-foot button:hover { background: var(--z-surface-3); }
.z-datepicker-foot .z-datepicker-clear { color: var(--z-muted); }
@media (max-width: 760px) {
    /* En móvil se abre dentro del formulario para poder hacer scroll por encima de la barra inferior */
    .z-datepicker-pop { position: static; width: 100%; margin-top: 8px; }
}

/* ---------- Selector de jugadores (convocatorias) ---------- */
.z-selector-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
/* UX-034: buscador y filtros fijos bajo la cabecera al recorrer la lista */
.z-selector-tools { position: sticky; top: 0; z-index: 15; padding: 10px 0; background: var(--z-bg); border-bottom: 1px solid var(--z-border); }
@media (max-width: 991.98px) { .z-selector-tools { top: 60px; } .z-nav-hidden .z-selector-tools { top: 0; } }
.z-selector-tools .z-selector-more ul { top: 100%; right: 0; bottom: auto; left: auto; min-width: 260px; margin-top: 6px; }
.z-selector-tools .z-search { flex: 1 1 240px; }
.z-selector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px; }
.z-pick {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 12px 14px;
    text-transform: none;
    letter-spacing: 0;
    background: var(--z-surface);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius);
    cursor: pointer;
    user-select: none;
    transition: border-color .2s var(--z-ease), background-color .2s var(--z-ease);
}
.z-pick:hover { border-color: var(--z-border-strong); }
.z-pick input { position: absolute; opacity: 0; pointer-events: none; }
.z-pick-check {
    display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px;
    font-size: var(--z-fs-xs); color: transparent; border: 2px solid var(--z-border-strong); border-radius: 50%;
    transition: background-color .12s, border-color .12s;
}
.z-pick-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.z-pick-name { font-size: var(--z-fs-md); font-weight: 700; color: #FFFFFF; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.2; }
.z-pick-answer { display: flex; align-items: center; flex-wrap: nowrap; min-width: 0; }
.z-pick-answer .z-tip { flex: none; }
.z-pick-meta { font-size: var(--z-fs-sm); font-weight: 500; color: var(--z-muted); }
.z-pick-warn { flex-shrink: 0; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-warning); }
.z-pick:has(input:checked) { background: rgba(var(--z-lime-rgb), .08); border-color: var(--z-lime); }
.z-pick:has(input:checked) .z-pick-check { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-pick:has(input:focus-visible) { outline: 2px solid var(--z-lime); outline-offset: 2px; }
/* Respuesta de disponibilidad: franja de color a la izquierda (siempre con icono y texto, el color no va solo) y,
   si se elige a quien dijo «No» o está pendiente, la tarjeta cambia de color y muestra «Lo has seleccionado». */
.z-pick[data-answer]::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--z-border-strong); border-radius: calc(var(--z-radius) - 1px) 0 0 calc(var(--z-radius) - 1px); }
/* Sin overflow:hidden en la tarjeta: recortaría el globo del «i» (la franja ya se redondea sola). */
.z-pick[data-answer="yes"]::before { background: var(--z-lime); }
.z-pick[data-answer="no"]::before { background: var(--z-danger); }
.z-pick[data-answer="maybe"]::before { background: var(--z-warning); }
.z-pick[data-answer="no"]:has(input:checked) { background: rgba(255, 92, 99, .10); border-color: var(--z-danger); box-shadow: 0 0 0 1px var(--z-danger) inset; }
.z-pick[data-answer="maybe"]:has(input:checked) { background: rgba(255, 201, 64, .09); border-color: var(--z-warning); }
.z-pick-hint.is-no { color: var(--z-danger); font-weight: 700; }
.z-pick-hint.is-maybe { color: var(--z-warning); font-weight: 700; }
.z-pick-flag { display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-top: 4px; padding: 2px 9px; border: 1px solid; border-radius: 999px; font-size: var(--z-fs-sm); font-weight: 800; white-space: nowrap; }
.z-pick-flag.is-no { color: var(--z-danger); border-color: var(--z-danger); background: rgba(255, 92, 99, .10); }
.z-pick-flag.is-maybe { color: var(--z-warning); border-color: var(--z-warning); background: rgba(255, 201, 64, .09); }
/* Al marcar a quien dijo No o Pendiente, la línea de respuesta cambia de texto en su sitio («⚠ Dice que no · seleccionado»): sin línea extra, la tarjeta no cambia de tamaño. */
.z-pick-hint-sel { display: none; }
.z-pick[data-answer="no"]:has(input:checked) .z-pick-hint-base, .z-pick[data-answer="maybe"]:has(input:checked) .z-pick-hint-base { display: none; }
.z-pick:has(input:checked) .z-pick-hint-sel { display: inline; }
.z-selector-warns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.z-selector-warns .z-pick-flag { margin-top: 0; }
.z-selector-warns[hidden], .z-selector-warns [hidden] { display: none; }
/* «Seleccionado» en la ventana de respuestas del capitán */
.z-availability-list li.is-forced { background: rgba(255, 92, 99, .10); border-color: var(--z-danger); }
.z-availability-list li.is-forced-maybe { background: rgba(255, 201, 64, .09); border-color: var(--z-warning); }
.z-availability-list .z-pick-flag { margin-top: 0; }

.z-selector-bar {
    position: sticky;
    bottom: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 10px 10px 20px;
    background: rgba(28, 29, 26, .82);
    border: 1px solid var(--z-border-strong);
    border-radius: 999px;
    box-shadow: var(--z-edge), var(--z-shadow-pop);
    backdrop-filter: blur(16px) saturate(140%);
}
.z-selector-bar b { font-size: var(--z-fs-lg); color: var(--z-lime); }
.z-selector-bar small { display: block; color: var(--z-muted); }
@media (max-width: 991.98px) {
    .z-selector-bar { bottom: calc(var(--z-nav-h) + 26px); transition: bottom .25s ease; }
    /* Con una barra de acción fija, la de navegación se esconde: a 320 px las dos tapaban ~40 % de la pantalla (H-30) */
    body:has(.z-selector-bar) .z-bottom-nav { display: none; }
    body:has(.z-selector-bar) .z-selector-bar { bottom: calc(16px + env(safe-area-inset-bottom)); }
    body:has(.z-selector-bar) .main-content { padding-bottom: 120px; }
}
.st-warn-count { color: var(--z-warning); }
.st-table td:nth-child(3) a { white-space: normal; }

/* ---------- Gestionar plantilla ---------- */
.z-roster {
    display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 14px;
    text-transform: none; letter-spacing: 0;
    background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius); cursor: pointer;
    transition: border-color .12s, opacity .12s;
}
/* Fuera del equipo: se atenúa la foto, no el texto (el texto debe mantener contraste 4.5:1) */
.z-roster:not(.is-on) .z-avatar { opacity: .5; }
.z-roster:not(.is-on) .z-pick-name { color: var(--z-muted); }
.z-roster:not(.is-on) .z-avatar { border-color: var(--z-border-strong); }
.z-roster.is-changed { border-color: var(--z-warning); opacity: 1; }
.z-roster .form-switch .form-check-input { width: 2.6em; height: 1.4em; margin: 0; cursor: pointer; }
.form-switch .form-check-input {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23A3A3A3'/%3e%3c/svg%3e");
}
.form-switch .form-check-input:checked {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%230A0A0A'/%3e%3c/svg%3e");
}
.form-switch .form-check-input:focus:not(:checked) {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23A3A3A3'/%3e%3c/svg%3e");
}
.z-select-compact { min-width: 150px; }
@media (max-width: 767.98px) {
    .z-selector-bar small { font-size: var(--z-fs-xs); }
}

/* ---------- Resultado de un partido ---------- */
.z-result { max-width: 640px; }
.z-result-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, 72px);
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.z-result-head { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; text-align: center; color: var(--z-lime); }
.z-result-team { overflow: hidden; font-weight: 800; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; color: #FFFFFF; }
.z-result-team small { display: block; overflow: hidden; text-overflow: ellipsis; font-size: var(--z-fs-xs); font-weight: 600; color: var(--z-lime); }
.z-result-pair { margin: 4px 0 0; color: var(--z-muted); }
.z-result-pair strong { color: var(--z-text); }
.z-result-grid input { height: 56px; padding: 0; font-size: var(--z-fs-xl); font-weight: 800; text-align: center; }
.z-result-grid input:disabled { opacity: .35; cursor: not-allowed; }
.z-result-checks { display: grid; gap: 4px; min-height: 1.5rem; margin: 0 0 12px; padding: 0; list-style: none; font-size: var(--z-fs-md); }
.z-result-checks li { color: var(--z-muted); }
.z-result-checks .is-ok { color: var(--z-lime); }
.z-result-checks .is-rival { color: var(--z-text); }
.z-result-checks .is-bad { color: var(--z-danger); }
.z-result-checks i { width: 18px; }
@media (max-width: 575.98px) {
    .z-result-grid { grid-template-columns: minmax(0, 1fr) repeat(3, 52px); gap: 8px; }
    .z-result-grid input { height: 50px; font-size: var(--z-fs-xl); }
    .z-result-team { font-size: var(--z-fs-sm); }
}

/* ---------- Convocatoria en el detalle del partido ---------- */
.z-call { margin-top: 8px; padding: 18px; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-call-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; color: var(--z-muted); }
.z-call-head b { font-size: var(--z-fs-xl); color: #FFFFFF; }
.z-dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; background: var(--z-lime); border-radius: 50%; }

/* ---------- Advertencias: historial a ancho completo y legible ---------- */
.st-warn-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1100px) { .st-warn-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; } }
.st-table--wrap th, .st-table--wrap td { white-space: normal; text-align: left; }
.st-table--wrap td:first-child { white-space: nowrap; }
.st-warn-actions { white-space: nowrap; }
.st-warn-actions form { display: inline-block; margin: 0 0 0 6px; }
@media (max-width: 575.98px) {
    .st-table--wrap thead { display: none; }
    .st-table--wrap tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--st-line); }
    .st-table--wrap td { padding: 0; border: 0; }
    .st-table--wrap td:nth-child(3) { grid-column: 1 / -1; color: var(--st-muted); }
    .st-table--wrap td.st-warn-actions { grid-column: 1 / -1; padding-top: 6px; }
    .st-table--wrap td.st-warn-actions .btn { min-height: 40px; }
}

/* Separador "o" y botón de Google en las pantallas de acceso */
.z-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--z-muted); font-size: var(--z-fs-sm); }
.z-or::before, .z-or::after { content: ""; flex: 1; height: 1px; background: var(--z-border); }
.z-google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }

/* Aviso de la portada para registrar la cuenta SNP (es un .z-notice, como el del gestor) */

/* ---------- Móvil: revisión general ----------
   Acciones de cabecera a todo el ancho, pestañas de estadísticas en una
   fila y filtros (temporada, tipo de partido) deslizables en horizontal. */
@media (max-width: 767.98px) {
    .z-page-head .z-actions > .btn,
    .z-page-head .z-actions > a,
    .z-page-head .z-actions > form { flex: 1 1 150px; }
    .z-page-head .z-actions .btn { width: 100%; white-space: nowrap; }

    /* Pestañas de estadísticas (UX-001): una fila que se desliza dentro de su propio contenedor,
       nunca más ancha que la pantalla; la pestaña activa se centra al cargar (a11y.js). */
    .st-tabs.z-segmented {
        display: flex; flex-wrap: nowrap; justify-content: flex-start; width: 100%; max-width: 100%; min-width: 0;
        overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
        border-radius: 999px;
    }
    .st-tabs.z-segmented::-webkit-scrollbar { display: none; }
    .st-tabs.z-segmented > .btn {
        flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
        padding: .45rem .9rem; font-size: var(--z-fs-sm); white-space: nowrap; scroll-snap-align: start;
    }
    .st-tabs.z-segmented .btn i { font-size: var(--z-fs-md); }
    /* Cinco pestañas (Yo, Equipo, Jugadores, Parejas, Rivales) caben en 390 px sin deslizar. */
    .st-tabs.z-segmented > .btn { padding: .45rem .6rem; gap: 4px; }

    /* Temporadas y tipo de partido: sin scroll lateral, los chips reparten el ancho
       y si no caben pasan a la línea siguiente (nunca se salen de la pantalla). */
    .st-seasons { gap: 6px; }
    .st-seasons > li { flex: 1 1 auto; min-width: 0; }
    .st-seasons .st-chip { display: block; overflow: hidden; padding: 7px 10px; font-size: var(--z-fs-sm); text-align: center; text-overflow: ellipsis; }
    /* Temporadas: Todas + tres últimas en una sola fila de columnas iguales; si hay una
       temporada antigua elegida (quinto chip), baja a una segunda fila. */
    .st-season-filter .st-seasons { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .st-season-filter .st-seasons:has(> li:nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .st-season-filter .st-chip { padding: 7px 4px; font-size: clamp(.7rem, 3.4vw, .85rem); }
    .st-seasons > .st-filter-label { flex-basis: 100%; margin: 0 0 2px; font-size: var(--z-fs-xs); }
    .st-chip { white-space: nowrap; }
}

/* Tablas que en móvil pasan a tarjetas apiladas (miembros, invitaciones) */
@media (max-width: 575.98px) {
    .z-table-stack thead { display: none; }
    .z-table-stack, .z-table-stack tbody, .z-table-stack tr, .z-table-stack td { display: block; width: 100%; }
    .z-table-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--z-border); }
    .z-table-stack tbody tr:last-child { border-bottom: 0; }
    .table.z-table-stack > :not(caption) > * > * { padding: 4px 0; border: 0; text-align: left; }
    .z-table-stack td:first-child { font-weight: 700; color: #FFFFFF; }
    .z-table-stack input, .z-table-stack select, .z-table-stack .z-select-trigger { max-width: none !important; }
    .z-table-stack form.d-flex > * { flex: 1 1 100%; }
    .z-table-stack .text-end .btn { width: 100%; }
}

/* ---------- Formulario de partido: modo y cards de equipo ---------- */
.z-mode { margin: 0 0 18px; padding: 0; background: none; border: 0; border-radius: 0; }
.z-mode legend { float: none; width: auto; margin-bottom: 6px; padding: 0; }
.z-mode-option {
    position: relative;
    margin: 0;
    padding: .5rem 1.2rem;
    font-size: var(--z-fs-sm);
    color: var(--z-muted);
    border-radius: 999px;
    cursor: pointer;
}
.z-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.z-mode-option.active, .z-mode-option:has(input:checked) { color: var(--z-ink); background: var(--z-lime); }
.z-mode-option:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(var(--z-lime-rgb), .35); }

.z-team-cards { display: grid; gap: 14px; margin: 6px 0 18px; }
.z-team-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 16px 52px 16px 16px;
    text-transform: none;
    letter-spacing: 0;
    background: linear-gradient(90deg, #2E3A1C 0%, #232619 45%, #1A1A1A 100%);
    border: 1px solid var(--z-border);
    border-radius: var(--z-radius-sm);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.z-team-card:hover { border-color: var(--z-border-strong); }
.z-team-card:focus-within { border-color: var(--z-lime); box-shadow: 0 0 0 3px rgba(var(--z-lime-rgb), .18); }
.z-team-card-logo {
    flex: none;
    width: 96px;
    height: 96px;
    padding: 4px;
    border: 4px solid var(--z-lime);
    border-radius: 50%;
    background: var(--z-bg);
    overflow: hidden;
}
.z-team-card-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.z-team-card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.z-team-card-role { font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-lime); }
.z-team-card-name {
    font-family: var(--z-display);
    font-size: var(--z-fs-2xl);
    font-weight: 400;
    line-height: 1.05;
    text-transform: uppercase;
    color: #FFFFFF;
    overflow-wrap: anywhere;
}
.z-team-card-name.is-empty { color: var(--z-muted); font-size: var(--z-fs-lg); }
.z-team-card-caret { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--z-lime); }
/* El <select> real cubre toda la card: al pulsarla se abre el desplegable de equipos. */
.z-team-card select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
@media (max-width: 575.98px) {
    .z-team-card { gap: 14px; padding: 12px 40px 12px 12px; }
    .z-team-card-logo { width: 64px; height: 64px; border-width: 3px; padding: 3px; }
    .z-team-card-name { font-size: var(--z-fs-lg); }
    .z-team-card-caret { right: 14px; }
}

/* Estadísticas: selector de tipo dentro de "Competitivos" */
.st-type-filter .st-seasons:has(+ .st-type-select) { margin-bottom: 10px; }
.st-type-select { margin: 0 0 20px; }
.st-type-select select, .st-type-select .z-select-trigger { width: auto; min-width: 220px; max-width: 100%; padding-top: 7px; padding-bottom: 7px; font-size: var(--z-fs-sm); font-weight: 700; border-radius: 999px; }

/* Estadísticas: selector de temporadas (Todas + tres últimas + buscador) */
.st-season-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 20px; }
.st-season-filter .st-seasons { margin: 0; }
.st-season-search { flex: 0 1 240px; }
.st-season-search .z-picker { min-width: 0; }
.st-season-search .z-picker-input { padding-top: 7px; padding-bottom: 7px; font-size: var(--z-fs-sm); font-weight: 700; }
@media (max-width: 767.98px) {
    .st-season-filter { display: block; }
    .st-season-search { margin-top: 10px; }
}

/* ---------- Gestionar equipos ---------- */
.z-bulk {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 14px;
    background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius);
}
.z-bulk .form-check { display: flex; align-items: center; gap: 8px; margin-right: auto; padding-left: 0; }
.z-bulk .form-check-input { margin: 0; }
.z-bulk .form-select { width: auto; min-width: 130px; }
.z-team-rows { display: flex; flex-direction: column; gap: 8px; }
.z-team-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px;
    background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius);
}
.z-team-row.is-changed { border-color: var(--z-warning); }
.z-team-row.has-error { border-color: var(--z-danger); }
.z-team-row > .text-danger { flex-basis: 100%; }
.z-team-row-head { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; }
.z-team-row-head .form-check-input { flex-shrink: 0; margin: 0; }
.z-team-row-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.z-team-row-fields .form-select { width: auto; min-width: 120px; }
.z-team-row-group, .z-bulk .form-check { text-transform: none; letter-spacing: 0; }
.z-team-row-group { display: flex; align-items: center; gap: 8px; padding-left: 0; white-space: nowrap; }
.z-team-row-group .form-check-input { width: 2.6em; height: 1.4em; margin: 0; cursor: pointer; float: none; }
@media (max-width: 767.98px) {
    .z-bulk .form-check { flex-basis: 100%; }
    .z-bulk .form-select { flex: 1 1 calc(50% - 4px); min-width: 0; }
    .z-bulk [data-teams-apply] { flex-basis: 100%; }
    .z-team-row-fields { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .z-team-row-fields .form-select { width: 100%; min-width: 0; }
}

/* ---------- «¿Quién eres en el equipo?» (link_player.html) ---------- */
.z-claim {
    display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 14px;
    background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius);
    transition: border-color .12s, background-color .12s;
}
.z-claim[hidden] { display: none; }
.z-claim.is-free { border-color: var(--z-lime); background: rgba(var(--z-lime-rgb), .08); }
.z-claim .z-pick-name { white-space: normal; overflow-wrap: anywhere; }
.z-claim.is-free .z-pick-name { color: var(--z-lime); }
.z-claim.is-free .z-avatar { border-color: var(--z-lime); }
.z-claim.is-taken { opacity: .45; }
.z-claim.is-taken .z-pick-name { color: var(--z-muted); }
.z-claim-lock { flex-shrink: 0; color: var(--z-muted); padding: 0 6px; }
.z-claim-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-claim-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.z-claim-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.z-claim-dot.is-free { background: var(--z-lime); }
.z-claim-dot.is-taken { background: var(--z-border-strong); }
.z-claim-confirm-name { font-size: var(--z-fs-lg); font-weight: 800; color: var(--z-lime); margin-bottom: .75rem; }

/* ---------- Ajuste de la foto en el círculo (static/js/photo-crop.js) ---------- */
.z-crop-field { display: flex; align-items: center; gap: 12px; }
.z-crop-field .form-control { flex: 1; min-width: 0; }
.z-crop-stage {
    position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto;
    overflow: hidden; touch-action: none; cursor: grab; user-select: none;
    background: repeating-conic-gradient(#202020 0 25%, #171717 0 50%) 0 0 / 20px 20px;
    border-radius: var(--z-radius);
}
.z-crop-stage:active { cursor: grabbing; }
.z-crop-stage:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 3px; }
.z-crop-stage canvas { display: block; width: 100%; height: 100%; }
.z-crop-ring {
    position: absolute; inset: 8%; pointer-events: none;
    border: 2px solid var(--z-lime); border-radius: 50%;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .6);
}
.z-crop-zoom { display: flex; align-items: center; gap: 10px; width: min(100%, 360px); margin: 16px auto 0; }
.z-crop-zoom .form-range { flex: 1; }
.z-crop-zoom .form-range::-webkit-slider-thumb { background-color: var(--z-lime); }
.z-crop-zoom .form-range::-moz-range-thumb { background-color: var(--z-lime); }
.z-crop-zoom .form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--z-bg), 0 0 0 .25rem rgba(var(--z-lime-rgb), .25); }

/* ---------- Avisos de error en popup (core/templates/includes/messages_popup.html) ---------- */
.z-messages-modal .modal-header { gap: 12px; justify-content: flex-start; }
.z-messages-modal .modal-header .btn-close { margin-left: auto; }
.z-messages-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 40px; height: 40px; font-size: var(--z-fs-lg); color: var(--z-ink);
    background: var(--z-danger); border-radius: 50%;
}
.z-messages-icon.is-warning { background: var(--z-warning); }
.z-messages-list { margin: 0; padding: 0; list-style: none; }
.z-messages-list li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--z-border); }

/* Notificaciones de confirmación (éxito, información) */
.z-toasts { z-index: 1090; width: min(100%, 460px); margin-top: 56px; }
.z-toast {
    --bs-toast-max-width: 100%;
    width: 100%; padding: 14px 16px; color: var(--z-text); font-weight: 600;
    background: var(--z-surface-2); border: 1px solid var(--z-border); border-left: 4px solid var(--z-muted);
    border-radius: var(--z-radius-sm); box-shadow: var(--z-edge), var(--z-shadow-pop);
}
.z-toast.is-success { border-left-color: var(--z-lime); }
.z-toast-icon { margin-top: 3px; color: var(--z-muted); }
.z-toast.is-success .z-toast-icon { color: var(--z-lime); }

/* Tarjeta de la cuenta SNP */
.z-snp-card { max-width: 560px; }
.z-snp-fields { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; align-items: center; }
.z-snp-fields dt { font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.z-snp-fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.z-snp-password { display: flex; align-items: center; gap: 4px; }
@media (max-width: 480px) {
    .z-snp-fields { grid-template-columns: 1fr; gap: 2px; }
    .z-snp-fields dd { margin-bottom: 8px; }
}

/* ---------- Portada: primeros pasos del club nuevo (core.onboarding) ---------- */
.z-onboarding { margin-top: 2rem; margin-bottom: 24px; border-color: var(--z-lime); }
.z-onboarding-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.z-onboarding-head h2 { font-size: var(--z-fs-lg); margin: 4px 0 0; }
.z-onboarding-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.z-onboarding-steps li {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm);
}
.z-onboarding-check { font-size: var(--z-fs-xl); color: var(--z-muted); flex: none; }
.z-onboarding-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.z-onboarding-text span { color: var(--z-muted); font-size: var(--z-fs-md); }
.z-onboarding-steps .btn { flex: none; white-space: nowrap; }
.z-onboarding-steps li.is-done .z-onboarding-check { color: var(--z-lime); }
.z-onboarding-steps li.is-done strong { text-decoration: line-through; color: var(--z-muted); }
@media (max-width: 575.98px) {
    .z-onboarding-steps li { flex-wrap: wrap; }
    .z-onboarding-steps .btn { width: 100%; }
}

/* Por número de partido, sets, récords y ranking SNP (estadísticas) */
/* Mismo arranque y ritmo que «Sets» (.st-rate): las filas empiezan bajo la descripción y reparten la altura sobrante */
.st-numbers { display: flex; flex: 1; flex-direction: column; justify-content: space-between; margin: 0; padding: 0; list-style: none; }
.st-number { margin-top: 18px; }
.st-number .st-split-head small { font-weight: 500; color: var(--st-muted); }
.st-facts--sets { grid-template-columns: repeat(auto-fit, minmax(min(100%, 92px), 1fr)); gap: 10px; margin-top: 16px; }
.st-facts--numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.st-facts--numbers dd { font-size: var(--z-fs-lg); }
.st-facts--sets .st-fact, .st-facts--numbers .st-fact { padding: 12px; }
.st-facts--sets dt, .st-facts--numbers dt { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--st-muted); }
.st-facts--sets dd { margin: 4px 0 0; font-size: var(--z-fs-xl); font-weight: 800; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.st-facts--sets .st-fact-name { font-size: var(--z-fs-base); overflow-wrap: anywhere; }
.st-sets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 22px; }
/* Porcentaje plano (sin caja): título y cifra arriba, barra y descripción a ancho completo debajo */
.st-rate { display: block; min-width: 0; margin-top: 18px; }
.st-rate .st-split-head { gap: 12px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; font-size: var(--z-fs-sm); color: var(--st-muted); }
.st-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.st-legend-item::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--st-muted); }
.st-legend-item--lime::before { background: var(--z-lime); }
.st-legend-item--track::before { background: var(--z-surface-3); box-shadow: inset 0 0 0 1px var(--st-line); }
.st-legend-item--win::before { background: var(--st-win); }
.st-legend-item--loss::before { background: rgba(255, 92, 99, .45); }
.st-rate .st-split-head--sub { margin-top: 14px; }
.st-rate .st-split-head--sub b { font-size: var(--z-fs-lg); }
.st-rate .st-split-foot { overflow-wrap: break-word; }
.st-records { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.st-record-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px; background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius); }
.st-record-tile b { font-size: var(--z-fs-xl); font-weight: 800; line-height: 1.2; color: #FFFFFF; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.st-record-tile b.st-up { color: var(--st-win); }
.st-record-tile b.st-down { color: var(--st-loss); }
.st-record-tile small { font-size: var(--z-fs-sm); color: var(--st-muted); }
.st-record-tile small a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.st-snp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; align-items: start; }
.st-snp-table td:first-child { width: 2.5em; color: var(--st-muted); }
@media (max-width: 760px) { .st-snp-layout { grid-template-columns: minmax(0, 1fr); } }

/* Alineación sugerida en el formulario de parejas */
.z-lineup-suggest { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; padding: 14px 16px; background: rgba(var(--z-lime-rgb), .06); border: 1px solid rgba(var(--z-lime-rgb), .3); border-radius: var(--z-radius); }
.z-lineup-suggest-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.z-lineup-suggest [data-suggest-info] { color: var(--z-muted); }
.st-snp-table th[scope="row"], .st-snp-table thead th:nth-child(2) { text-align: left; }
.st-snp-table th[scope="row"] { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .st-snp-table th, .st-snp-table td { padding: 10px 6px; font-size: var(--z-fs-md); }
  .st-facts--sets dd { font-size: var(--z-fs-lg); }
}

/* Avisos con icono (p. ej. la posición en pista tras traer jugadores de SNP) */
.z-callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; font-size: var(--z-fs-md); color: var(--z-text); background: rgba(var(--z-lime-rgb), .08); border: 1px solid rgba(var(--z-lime-rgb), .35); border-radius: var(--z-radius-sm); }
.z-callout > i { margin-top: 3px; color: var(--z-lime); }
.z-callout--warning { background: rgba(255, 201, 64, .08); border-color: rgba(255, 201, 64, .45); }
.z-callout--warning > i { color: var(--z-warning); }

/* Registro del club: elegir cómo se crea el jugador del capitán */
.z-choice { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
.z-choice-option { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 12px 14px; cursor: pointer; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-choice-option:has(input:checked) { border-color: var(--z-lime); background: rgba(var(--z-lime-rgb), .07); }
.z-choice-option input { accent-color: var(--z-lime); }
.z-choice-option, .z-choice-option small { margin: 0; text-transform: none; letter-spacing: normal; }
.z-choice-option span { font-weight: 700; color: var(--z-text); }
.z-choice-option small { grid-column: 2; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-choice-option--taken { cursor: not-allowed; opacity: .6; }

/* Espera mientras se trae el equipo de SNP tras registrar el club */
.z-welcome-snp { text-align: center; }
.z-welcome-spinner { margin: 8px 0 18px; color: var(--z-lime); }

/* ---------- «Mi perfil» (core/templates/my_profile.html) ---------- */
.z-account { max-width: 720px; }
.z-account-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--z-border); }
.z-account-row:first-of-type { border-top: 0; padding-top: 0; }
.z-account-row > i { width: 1.25rem; text-align: center; color: var(--z-lime); }
.z-account-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.z-account-label { font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.z-account-value { font-weight: 600; overflow-wrap: anywhere; }
.z-account-note { font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-account-row > .btn { flex-shrink: 0; }
.z-account-form { max-width: 420px; }
a.z-account-player { color: inherit; text-decoration: none; }
a.z-account-player:hover { background: rgba(var(--z-lime-rgb), .14); }
a.z-account-player .btn { flex-shrink: 0; }
@media (max-width: 575.98px) {
    .z-account-btn-text { display: none; }
    .z-account-row > .btn, a.z-account-player .btn { width: 2.5rem; height: 2.5rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
}
.z-row-link { cursor: pointer; }

/* ---------- Desplegable propio de los <select> (static/js/custom-select.js) ---------- */
.z-select { display: contents; }
/* El <select> real sigue en el DOM (fuente de verdad del formulario) pero no se ve ni se pulsa */
select.z-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip-path: inset(50%) !important;
}
.z-select-trigger { text-align: left; line-height: 1.5; text-transform: none; letter-spacing: normal; }
.z-select-trigger .z-select-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-select-trigger.is-placeholder { color: var(--z-muted); }
.z-select-trigger:disabled { opacity: .55; cursor: not-allowed; }
.z-select.is-open > .z-select-trigger { border-color: var(--z-lime); box-shadow: 0 0 0 4px rgba(var(--z-lime-rgb), .16); }
.z-select.is-open > .z-select-trigger { background-position: right 1rem center; }
.z-select-list {
    position: fixed;
    z-index: 1060;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    color: var(--z-text);
    background: var(--z-surface-2);
    border: 1px solid var(--z-border-strong);
    border-radius: var(--z-radius);
    box-shadow: var(--z-edge), var(--z-shadow-pop);
}
.z-select-list[hidden] { display: none; }
.z-select-option {
    padding: 9px 12px;
    font-size: var(--z-fs-md);
    font-weight: 600;
    border-radius: var(--z-radius-sm);
    cursor: pointer;
    overflow-wrap: anywhere;
}
.z-select-option.is-empty { color: var(--z-muted); }
.z-select-option[aria-selected="true"]:not(.is-active) { color: var(--z-lime); }
.z-select-option[aria-selected="true"]::after { content: "\2713"; float: right; margin-left: 12px; font-weight: 800; }
.z-select-option.is-active { color: var(--z-ink); background: var(--z-lime); }
.z-select-option.is-disabled { opacity: .4; cursor: not-allowed; }
.z-select-option.is-disabled.is-active { color: inherit; background: none; }
.z-select-group { padding: 8px 12px 4px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
/* Card de equipo del formulario de partido: el botón transparente cubre toda la card */
.z-team-card .z-select-trigger {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

/* Elección de rol en el registro (jugador o capitán). */
.z-role-grid { display: grid; gap: 14px; margin: 18px 0; grid-template-columns: 1fr; }
@media (min-width: 640px) { .z-role-grid { grid-template-columns: 1fr 1fr; } }
.z-role-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; text-decoration: none; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); color: var(--z-text); transition: border-color .15s, background-color .15s; }
.z-role-card:hover, .z-role-card:focus-visible { border-color: var(--z-lime); background: rgba(var(--z-lime-rgb), .07); color: var(--z-text); }
.z-role-card > i { font-size: var(--z-fs-xl); color: var(--z-lime); }
.z-role-card h2 { margin: 4px 0 0; font-size: var(--z-fs-lg); }
.z-role-card p { margin: 0; color: var(--z-muted); font-size: var(--z-fs-md); }
.z-role-go { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--z-lime); }

/* ---------- Club: acceso a miembros, equipo propio, rivales y cuenta SNP (core/templates/club.html) ---------- */
.z-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.z-hub-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; color: inherit; text-decoration: none; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
a.z-hub-card:hover, a.z-hub-card:focus-visible { border-color: var(--z-lime); color: inherit; }
.z-hub-card > i { font-size: var(--z-fs-xl); color: var(--z-lime); }
.z-hub-title { font-weight: 800; color: #FFFFFF; }
.z-hub-note { font-size: var(--z-fs-sm); color: var(--z-muted); }

/* ---------- Enfrentamiento: fases, siguiente paso y estado del jugador (match/templates/call_for_match.html) ---------- */

.z-next { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 22px; padding: 14px; background: var(--z-surface-2); border: 1px solid var(--z-lime); border-radius: var(--z-radius); }
.z-next-main { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.z-next-main .btn { white-space: normal; text-align: left; }
.z-next-hint { margin: 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-more { position: relative; }
.z-more.is-up ul { top: auto; bottom: calc(100% + 6px); margin: 0; }
.z-more summary { list-style: none; cursor: pointer; }
.z-more summary::-webkit-details-marker { display: none; }
.z-more ul { position: absolute; right: 0; z-index: 20; min-width: 230px; margin: 6px 0 0; padding: 6px; list-style: none; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .7); }
.z-more li a, .z-more li button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; font: inherit; color: var(--z-text, inherit); text-align: left; text-decoration: none; background: none; border: 0; border-radius: var(--z-radius-sm); }
.z-more li a:hover, .z-more li button:hover, .z-more li a:focus-visible, .z-more li button:focus-visible { background: var(--z-surface-3); }
.z-more li i { width: 18px; color: var(--z-lime); text-align: center; }
.z-more li.z-more-title { padding: 8px 12px 2px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--z-muted); }
.z-more li.z-more-title:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--z-border); }
.z-more li.z-more-danger { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--z-border); }
.z-more li a.is-danger, .z-more li a.is-danger i { color: var(--z-danger); }
.z-more li a.is-danger:hover, .z-more li a.is-danger:focus-visible { background: rgba(255, 92, 99, .12); }

.z-mystatus { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 14px 16px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-mystatus > i { margin-top: 3px; font-size: var(--z-fs-lg); color: var(--z-muted); }
.z-mystatus.is-in { border-color: var(--z-lime); }
.z-mystatus.is-in > i { color: var(--z-lime); }
.z-mystatus strong { display: block; color: #FFFFFF; }
.z-mystatus span { display: block; font-size: var(--z-fs-sm); color: var(--z-muted); }

.z-closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 22px; padding: 14px 16px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-left: 4px solid var(--z-muted); border-radius: var(--z-radius); }
.z-closed.is-win { border-left-color: var(--z-lime); }
.z-closed.is-loss { border-left-color: var(--z-danger); }

/* Un partido por fila: así el nombre del equipo y de cada pareja se leen enteros y se ve a quién se apunta el resultado (H-14). */
.z-results-all { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 760px; gap: 14px; }
/* UX-031: formulario a la izquierda y, a partir de 1200 px, marcador vivo y acciones fijos a la derecha */
.z-results-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.z-results-main { display: grid; gap: 14px; min-width: 0; }
.z-results-side { display: grid; gap: 12px; }
.z-live-score { padding: 14px 16px; text-align: center; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-live-score-title { margin: 0 0 6px; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-muted); }
.z-live-score-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; font-size: var(--z-fs-sm); font-weight: 700; overflow-wrap: anywhere; }
.z-live-score-points { display: flex; align-items: baseline; justify-content: center; gap: 14px; margin: 4px 0; font: 400 3rem/1 var(--z-display); }
.z-live-score-points i { font-style: normal; color: var(--z-muted); }
.z-live-score-note { margin: 0; font-size: var(--z-fs-xs); color: var(--z-muted); }
.z-results-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.z-results-actions .z-close-hint { flex-basis: 100%; }
@media (min-width: 1200px) {
    .z-results-layout { grid-template-columns: minmax(0, 1fr) 320px; }
    .z-results-main .z-results-all { max-width: none; }
    .z-results-side { position: sticky; top: 24px; }
    .z-results-actions { flex-direction: column; flex-wrap: nowrap; }
    .z-results-actions .btn { width: 100%; }
}
.z-results-all .z-result-team { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.z-results-all .z-result-team small { overflow: visible; text-overflow: clip; white-space: normal; }
.z-result-card { margin: 0; padding: 14px 16px; }
/* El borde de cada tarjeta dice cómo va tu equipo en ese partido: lima gana, rojo pierde (solo cuando ya hay ganador). */
.z-result-card:is([data-own-side="0"][data-winner="0"], [data-own-side="1"][data-winner="1"]) { border-color: var(--z-lime); }
.z-result-card:is([data-own-side="0"][data-winner="1"], [data-own-side="1"][data-winner="0"]) { border-color: var(--z-danger); }
.z-result-grid .z-result-team { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.z-result-legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; }
.z-result-legend + * { clear: both; }

@media (max-width: 575.98px) {
}
/* En móvil el botón «Siguiente» se queda al alcance, justo encima de la barra inferior */
@media (max-width: 991.98px) {
    .z-next { position: sticky; bottom: calc(var(--z-nav-h) + 8px); z-index: 25; transition: bottom .25s ease; background: var(--z-surface-3); }
    /* UX-018: una sola línea (botón principal + «Más»); la ayuda solo si bloquea el paso */
    .z-next { flex-wrap: nowrap; align-items: center; gap: 8px; margin-bottom: 14px; padding: 6px 8px; }
    .z-next-main { flex: 1 1 0; }
    .z-next-main .btn { width: 100%; min-height: 44px; text-align: center; }
    .z-next-hint:not(.is-blocking) { display: none; }
    .z-next .z-more summary { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
    .z-more ul { bottom: calc(100% + 6px); left: auto; right: 0; width: max-content; min-width: min(230px, calc(100vw - 2 * var(--z-gutter, 16px))); max-width: calc(100vw - 2 * var(--z-gutter, 16px)); margin: 0; }
    .z-more li a, .z-more li button { white-space: normal; overflow-wrap: anywhere; }
}

/* Crear enfrentamiento: error en la card del rival y opciones plegadas */
.z-team-card-field.has-error .z-team-card { border-color: var(--z-danger); }
.z-more-options { margin: 0 0 8px; }
.z-more-options > summary { padding: 6px 0; font-weight: 700; color: var(--z-lime); cursor: pointer; }
.z-pick-warn-text { color: var(--z-warning, #F5B544); }
/* Regla de las fases finales LAPI en la convocatoria (includes/finals_rule.html). */
.z-finals-rule { margin: 0 0 16px; padding: 14px 16px; border: 1px solid rgba(255, 201, 64, .45); border-radius: var(--z-radius-sm); background: rgba(255, 201, 64, .06); }
.z-finals-rule-title { margin: 0 0 6px; font-size: var(--z-fs-base); font-weight: 800; color: var(--z-warning); }
.z-finals-rule p { margin: 0 0 8px; }
.z-finals-rule .form-check { margin: 4px 0 0; }

/* Copiar jugadores de otra competición (players/templates/copy_players.html) e invitación en el Inicio. */
.z-copy-route { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; color: var(--z-muted); }
.z-copy-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; }
.z-copy-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-copy-row input { flex: none; width: 22px; height: 22px; margin: 0; }
.z-copy-row label { display: grid; flex: 1; min-width: 0; cursor: pointer; }
.z-copy-row.is-disabled { opacity: .6; }
.z-copy-row.is-disabled label { cursor: default; }
.z-copy-status { font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-copy-status--invite { color: var(--z-warning); }
.z-copy-status--member { color: var(--z-lime); }
.z-copy-foot { padding: 12px 0; border-top: 1px solid var(--z-border); }
.z-copy-invite { border-left: 4px solid var(--z-lime); }

/* Inicio: bloque «Pendiente» y estado del jugador en el próximo enfrentamiento (core/templates/home.html) */
.z-pending { display: grid; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.z-pending-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 14px 16px; color: inherit; text-decoration: none; background: var(--z-surface-2); border: 1px solid var(--z-border); border-left: 4px solid var(--z-lime); border-radius: var(--z-radius); }
.z-pending-row:hover, .z-pending-row:focus-visible { color: inherit; border-color: var(--z-lime); }
.z-pending-row.is-overdue { border-left-color: var(--z-danger); }
.z-pending-main { display: grid; min-width: 0; }
.z-pending-main strong { overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; color: #FFFFFF; }
.z-pending-main small { color: var(--z-muted); }
.z-pending-row.is-overdue .z-pending-main small { color: var(--z-danger); }
.z-pending-action { flex: none; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-lime); white-space: nowrap; }
.z-next-match-me { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; font-size: var(--z-fs-md); color: var(--z-muted); background: var(--z-surface-3); border-radius: var(--z-radius-sm); }
.z-next-match-me.is-in { color: #FFFFFF; }
/* En el panel «Pendiente» las filas son listas planas, no tarjetas */
.z-home-pending .z-pending { margin: 0; gap: 0; }
.z-home-pending .z-pending-row { flex-wrap: nowrap; padding: 13px 0; background: transparent; border: 0; border-top: 1px solid var(--z-border); border-radius: 0; }
.z-home-pending .z-pending-row.is-overdue { border-left: 0; }
.z-home-pending .z-pending-main { flex: 1; }
.z-home-pending .z-pending-main strong, .z-home-pending .z-pending-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-home-pending > p { margin: 6px 0 0; font-size: var(--z-fs-sm); }
@media (max-width: 575.98px) {
    .z-home-pending .z-pending-row { flex-wrap: wrap; }
    .z-home-pending .z-pending-main { flex-basis: 100%; }
    .z-home-pending .z-pending-main strong, .z-home-pending .z-pending-main small { white-space: normal; }
}
.z-next-match-me.is-in i { color: var(--z-lime); }

/* Campo de foto: el selector nativo queda oculto tras el botón «Subir foto» (static/js/photo-crop.js) */
.z-file-native { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* Alineación en móvil: el orden de juego va justo bajo la sugerencia, para ver el efecto de cada cambio (H-31) */
@media (max-width: 991.98px) {
    .z-lineup-main { display: contents; }
    .z-lineup-main > .text-muted { order: 0; }
    .z-lineup-suggest { order: 1; }
    .z-lineup-side.pair-order-container { order: 2; margin: 0; padding: 12px 14px; }
    .z-lineup-side h2 { margin-bottom: 6px; font-size: var(--z-fs-base); }
    .z-lineup-side > p { display: none; }
    #pair-order-list li { padding: 6px 0; }
    .z-lineup-pairs { order: 3; }
    .z-lineup > .z-selector-bar { order: 4; }
}
.z-suggest-why { display: inline; }
.z-suggest-why > summary { display: inline; color: var(--z-lime); cursor: pointer; }
.z-suggest-why > span { display: block; margin-top: 4px; color: var(--z-muted); }

/* Índice de secciones de las estadísticas del equipo: fijo bajo la barra superior. */
.st-index { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; margin: 0 0 12px; background: var(--z-bg); scrollbar-width: none; }
.st-index::-webkit-scrollbar { display: none; }
.st-index a { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--z-border); color: inherit; font-size: 13px; text-decoration: none; white-space: nowrap; }
.st-index a:hover, .st-index a:focus-visible, .st-index a.is-active { border-color: var(--z-lime); }
.st-index a.is-active { color: var(--z-lime); }
.st-section, .st-board, .st-balance { scroll-margin-top: 16px; }  /* html ya suma scroll-padding-top */

/* Gestionar plantilla: tres columnas en escritorio y nombre corto a dos líneas. */
@media (min-width: 992px) { .z-selector-grid:has(.z-roster) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Ficha del jugador: pestañas Resumen / Estadísticas y racha reciente. */
.z-player-tabs { margin: 0 0 16px; }
.z-form-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.z-form-strip .z-eyebrow { margin-right: 6px; }

/* Estadísticas del equipo en escritorio: panel lateral con las secciones, fijo al hacer scroll. */
.st-side { display: none; }
@media (min-width: 1024px) {
  .st-index { display: none; }
  .st-layout { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; align-items: start; }
  .st-side { display: block; position: sticky; top: 92px; padding: 16px 0 16px 18px; border-left: 1px solid var(--z-border); }
  .st-side-title { margin: 0 0 10px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--z-muted); }
  .st-side-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
  .st-side-list a { position: relative; display: block; padding: 7px 10px; border-radius: var(--z-radius-sm); font-size: var(--z-fs-md); font-weight: 600; color: var(--z-muted); text-decoration: none; transition: color .15s, background-color .15s; }
  .st-side-list a:hover, .st-side-list a:focus-visible { color: var(--z-text); background: var(--z-surface-2); }
  .st-side-list a.is-active { color: var(--z-lime); background: var(--z-surface-2); }
  .st-side-list a.is-active::before { content: ""; position: absolute; left: -19px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--z-lime); }
}

/* ---- Registro de club por pasos (register-wizard.js) ---- */
.z-wizard-progress { margin: 0 0 18px; }
.z-wizard-count { margin: 0 0 10px; font-size: var(--z-fs-sm); font-weight: 700; letter-spacing: .01em; color: var(--z-lime); }
.z-wizard-progress ol { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.z-wizard-progress li { flex: 1 1 0; min-width: 0; display: grid; gap: 6px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-wizard-dot { display: block; height: 4px; border-radius: 4px; background: var(--z-border-strong, var(--z-border)); }
.z-wizard-progress li.is-done .z-wizard-dot, .z-wizard-progress li.is-active .z-wizard-dot { background: var(--z-lime); }
.z-wizard-progress li.is-active { color: var(--z-text); font-weight: 700; }
.z-wizard-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-wizard-summary { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--z-danger); border-radius: var(--z-radius-sm); background: rgba(255, 90, 90, .08); color: var(--z-danger); font-weight: 700; font-size: var(--z-fs-md); }
.z-wizard-summary:focus { outline: none; }
.z-wizard-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.is-wizard .z-wizard-actions { flex-direction: column-reverse; }
[aria-invalid="true"].form-control, [aria-invalid="true"].form-select, [aria-invalid="true"].z-select-trigger { border-color: var(--z-danger); }
.z-snp-match-note { margin: 0 0 12px; }
@media (max-width: 480px) {
    .z-wizard-title { display: none; }
}
.z-role-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: var(--z-fs-sm); color: var(--z-lime); }
.z-role-card .z-role-note { margin-bottom: 0; }
.z-account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.z-account-actions form { margin: 0; }

/* ---- Portada: avisos (email por confirmar, fallo de SNP) y primeros pasos ---- */
.z-notice { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: start; margin: 0 0 16px; padding: 14px 16px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-notice > i { margin-top: 3px; font-size: var(--z-fs-lg); color: var(--z-lime); }
.z-notice--warn { border-color: var(--z-danger); }
.z-notice--warn > i { color: var(--z-danger); }
.z-notice-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.z-notice-text span { color: var(--z-muted); font-size: var(--z-fs-md); }
.z-notice-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.z-notice-actions form { margin: 0; }
.z-onboarding { margin-top: 0; }
.z-onboarding-bar { height: 6px; margin: 0 0 14px; border-radius: var(--z-radius-xs); background: var(--z-border-strong, var(--z-border)); overflow: hidden; }
.z-onboarding-bar span { display: block; height: 100%; background: var(--z-lime); border-radius: var(--z-radius-xs); }
.z-onboarding-next { display: grid; gap: 12px; padding: 4px 0 12px; }
.z-onboarding-next .btn { width: 100%; }
.z-onboarding-alt { justify-self: center; font-size: var(--z-fs-md); }
@media (min-width: 576px) {
    .z-notice { grid-template-columns: auto 1fr auto; align-items: center; }
    .z-notice-actions { grid-column: auto; flex-wrap: nowrap; justify-content: flex-start; min-width: 230px; }
    .z-onboarding-next { grid-template-columns: 1fr auto; align-items: center; }
    .z-onboarding-next .btn { width: auto; }
    .z-onboarding-alt { grid-column: 1 / -1; justify-self: start; }
}
.z-danger-zone { margin: 56px 0 24px; padding-top: 20px; border-top: 1px solid var(--z-border); }
.z-danger-zone h2 { font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-danger); }
.z-rival-empty { margin: 8px 0 0; font-size: var(--z-fs-md); color: var(--z-muted); }
/* Aviso al escribir un rival que ya existe: unir con ese equipo o crear uno nuevo. */
.z-rival-match { margin: 0; padding: 0; list-style: none; }
.z-rival-match-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0; padding: 6px 0; }
.z-rival-match-row + .z-rival-match-row { border-top: 1px solid var(--z-border); }

/* El contenido enfocado o al que se salta no queda bajo la cabecera fija ni bajo la barra inferior (WCAG 2.4.11) */
html { scroll-padding-top: 84px; scroll-padding-bottom: calc(var(--z-nav-h) + 24px); }

/* Objetivos táctiles de al menos 24 × 24 px (WCAG 2.2 · 2.5.8): el lápiz de la fecha y el enlace de cada tarjeta */
.z-edit-date { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; vertical-align: middle; }
.z-fixture-open { min-height: 24px; }

/* Advertencias: motivo y detalle del formulario, lista de las ya aplicadas y botón «Deshacer» del aviso */
.z-penalty-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px 16px; margin-bottom: 16px; }
@media (max-width: 575.98px) { .z-penalty-fields { grid-template-columns: 1fr; } }
.z-penalty-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.z-penalty-list li { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-penalty-list li > span { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.z-penalty-list li > form { margin: 0; flex: 0 0 auto; }
.z-penalty-remove { min-height: 32px; white-space: nowrap; }
.z-toast-undo { background: none; border: 0; padding: 2px 4px; min-height: 24px; font-weight: 800; color: var(--z-lime); text-decoration: underline; cursor: pointer; }
.z-toast-undo:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 2px; }

/* ---- Estadísticas sin enfrentamientos cerrados (stats_empty.html) ---- */
.st-zero { display: grid; gap: 14px; max-width: 640px; margin: 24px auto; }
.st-zero h1 { margin: 0; font-size: var(--z-fs-xl); }
.st-zero .btn { justify-self: start; }
.st-zero-preview { position: relative; display: grid; gap: 14px; padding: 36px 18px 18px; border: 1px dashed var(--z-border-strong, var(--z-border)); border-radius: var(--z-radius); opacity: .75; }
.st-zero-tag { position: absolute; top: 10px; right: 12px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted); }
.st-zero-record { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.st-zero-record strong { font-size: var(--z-fs-2xl); line-height: 1; color: var(--z-lime); }
.st-zero-record small { color: var(--z-muted); margin-right: 6px; }
.st-zero-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.st-zero-bars li { display: grid; gap: 4px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.st-zero-bars i { display: block; height: 8px; border-radius: var(--z-radius-sm); background: var(--z-lime); }
@media (max-width: 575.98px) { .st-zero .btn { justify-self: stretch; } }

/* ---- Club: accesos rápidos y estado de cada tarjeta ---- */
.z-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.z-hub-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--z-fs-sm); font-weight: 800; }
.z-hub-status.is-todo { color: var(--z-lime); }
.z-hub-status.is-ok { color: var(--z-muted); }

/* ---- Bienvenida tras aceptar una invitación ---- */
.z-welcome-list { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; gap: 12px; }
.z-welcome-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-welcome-list li > i { margin-top: 3px; width: 1.25rem; text-align: center; color: var(--z-lime); }
.z-welcome-list li > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.z-welcome-label { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.z-club-legend { margin: -4px 0 18px; font-size: var(--z-fs-md); }

/* Objetivos táctiles de al menos 24 × 24 px (WCAG 2.5.8) */
.z-onboarding-alt { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 0; }
a.z-eyebrow { display: inline-flex; align-items: center; min-height: 24px; }
/* Casillas y radios de 24 px con hueco propio: el control flota a la izquierda y el texto no lo pisa */
.form-check { padding-left: 2.25rem; min-height: 1.5rem; margin-bottom: .5rem; }
.form-check .form-check-input { float: left; margin-left: -2.25rem; margin-top: 0; min-width: 1.5rem; min-height: 1.5rem; }
.form-check .form-check-label { display: block; line-height: 1.5rem; }
.form-check.form-switch { padding-left: 3.75rem; }
.form-check.form-switch .form-check-input { margin-left: -3.75rem; min-width: 2.75rem; width: 2.75rem; height: 1.5rem; }
.z-check-grid .form-check, .z-bulk .form-check, .z-team-row-head .form-check, .form-check.m-0 { padding-left: 0; min-height: 0; margin-bottom: 0; }
.z-check-grid .form-check .form-check-input, .z-bulk .form-check .form-check-input, .z-team-row-head .form-check .form-check-input, .form-check.m-0 .form-check-input { float: none; margin-left: 0; }
.form-check.m-0 { display: inline-flex; align-items: center; gap: .5rem; }
.z-home-hero + .z-notice { margin-top: 16px; }
/* Los avisos de la portada van tras la tarjeta de partidos: mismo aire (18px) que entre tarjetas y entre avisos */
.z-home-grid ~ .z-notice { margin-top: 18px; margin-bottom: 18px; }

/* Barra de progreso de la sincronización con SNP, visible en toda la web */
.z-sync { background: var(--z-surface-2); border-bottom: 1px solid var(--z-border); padding: 10px 16px; }
.z-sync-inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 6px; }
.z-sync-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--z-fs-md); }
.z-sync-stage { color: var(--z-muted); min-width: 0; overflow-wrap: anywhere; }
.z-sync-cancel { margin: 0; }
.z-sync-pct { margin-left: auto; font-weight: 800; color: var(--z-lime); font-variant-numeric: tabular-nums; }
.z-sync-track { height: 8px; background: var(--z-border); border-radius: 999px; }
.z-sync-track .progress-bar { background: var(--z-lime); border-radius: 999px; transition: width .6s ease; }
.z-sync-note { margin: 0; font-size: var(--z-fs-sm); color: var(--z-muted); }

/* «Previa» de un enfrentamiento (balance contra ese rival) */
.z-preview {
    margin: 0 0 16px; padding: 12px 16px; font-size: var(--z-fs-md);
    border: 1px dashed rgba(var(--z-lime-rgb), .6); border-radius: var(--z-radius-sm);
    background: rgba(var(--z-lime-rgb), .06);
}
.z-preview-title { margin: 0 0 4px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--z-lime); }
.z-h2h { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: center; }
.z-h2h-n { margin: 0; }
.z-h2h-n b { display: block; font: 400 2rem/1 var(--z-display); color: #FFFFFF; }
.z-h2h-n span { font-size: var(--z-fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--z-muted); }
.z-h2h-bar { display: flex; height: 6px; margin: 10px 0; background: var(--z-surface-3); }
.z-h2h-bar i { display: block; background: var(--z-muted); }
.z-h2h-bar .is-win { background: var(--z-lime); }
.z-h2h-bar .is-loss { background: var(--z-danger); }
.z-h2h-last { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: var(--z-fs-sm); }
.z-h2h-last a { display: flex; justify-content: space-between; gap: 8px; padding-top: 6px; color: var(--z-text); text-decoration: none; border-top: 1px solid var(--z-border); }
.z-h2h-last a:hover strong { text-decoration: underline; }
.z-h2h-last span { color: var(--z-muted); }
.z-h2h-last strong::first-letter { text-transform: uppercase; }
.z-h2h-last .is-win { color: var(--z-lime); }
.z-h2h-last .is-loss { color: var(--z-danger); }
.z-h2h-best { margin: 10px 0 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
.st-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }

/* Tablas de Rivales: caben en pantalla sin scroll lateral (el texto se ajusta y en móvil se compactan) */
.st-table-fit { margin-top: 12px; }
.st-table--fit { table-layout: auto; }
.st-table--fit th, .st-table--fit td { padding: 10px 8px; white-space: normal; text-align: left; }
.st-table--fit th:not(:first-child), .st-table--fit td:not(:first-child) { text-align: right; }
.st-table--fit td.st-last, .st-table--fit th:last-child, .st-table--fit td:last-child { text-align: right; }
.st-table--fit .st-score { white-space: nowrap; }
.st-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.st-search .st-input { flex: 1 1 220px; min-width: 0; }
@media (max-width: 575.98px) {
    .st-table--fit th, .st-table--fit td { padding: 8px 4px; font-size: var(--z-fs-sm); }
    .st-table--fit thead th { font-size: var(--z-fs-xs); letter-spacing: .03em; }
    .st-table--fit .z-fixture-state { padding-inline: 7px; }
}
.st-input { padding: 9px 16px; font: inherit; color: #FFFFFF; background: var(--z-surface-2); border: 1px solid var(--st-line); border-radius: 999px; }
.st-input:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 2px; }
.st-table--fit .st-nw { white-space: nowrap; }

/* Calendario de Enfrentamientos: cuadrícula en pantallas anchas y agenda por días en las estrechas */
.z-view-tabs { margin-bottom: 16px; width: fit-content; }
.z-cal-nav { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; }
.z-cal-title { margin: 0; flex: 1; text-align: center; font-size: var(--z-fs-base); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.z-cal-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; }
.z-cal-grid th { padding: 4px; text-align: center; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.z-cal-grid td { height: 96px; padding: 6px; vertical-align: top; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); overflow: hidden; }
.z-cal-grid td.is-out { opacity: .4; }
.z-cal-grid td.is-today { border-color: var(--z-lime); }
.z-cal-day { display: block; margin-bottom: 4px; font-size: var(--z-fs-sm); color: var(--z-muted); }
.is-today > .z-cal-day { color: var(--z-lime); font-weight: 800; }
.z-cal-event { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; padding: 3px 7px; font-size: var(--z-fs-xs); line-height: 1.25; font-weight: 700; color: var(--z-text); background: var(--z-surface-3); border: 1px solid var(--z-border-strong); border-radius: var(--z-radius-xs); text-decoration: none; min-width: 0; }
.z-cal-event:hover { color: var(--z-text); border-color: var(--z-lime); }
.z-cal-event .z-cal-event-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.z-cal-event time { color: inherit; opacity: .85; }
.z-cal-event.is-upcoming { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-cal-event.is-upcoming:hover { color: var(--z-ink); background: var(--z-lime-hover); }
.z-cal-event.is-open { color: var(--z-warning); background: transparent; border-color: var(--z-warning); }
.z-cal-event.is-friendly { border-style: dashed; }
.z-cal-comp { flex: none; padding: 0 4px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .03em; border-radius: 4px; }
.z-cal-comp--snp { color: var(--z-ink); background: var(--z-snp); box-shadow: 0 0 0 1px var(--z-ink); }
.z-cal-comp--lapi { color: var(--z-ink); background: var(--z-lapi); }
.z-cal-agenda { display: none; }
.z-cal-empty { margin: 16px 0; color: var(--z-muted); }
.z-cal-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.z-cal-legend .z-cal-event { margin: 0; }
@media (max-width: 767.98px) {
    .z-cal-grid { display: none; }
    .z-cal-agenda { display: grid; gap: 10px; }
    .z-cal-agenda-day { padding: 10px 12px; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
    .z-cal-agenda-day.is-today { border-color: var(--z-lime); }
  .z-cal-agenda-day h3 { margin: 0 0 6px; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
    .z-cal-agenda-day .z-cal-event { font-size: var(--z-fs-md); padding: 8px 10px; min-height: 44px; align-items: center; }
}
.z-cal-grid .z-cal-event { align-items: flex-start; }
.z-cal-grid .z-cal-event-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow: hidden; word-break: break-word; }
.z-cal-grid .z-cal-event { flex-direction: column; align-items: stretch; gap: 1px; }
.z-cal-grid .z-cal-event-name { word-break: normal; overflow-wrap: anywhere; flex: none; }

/* «Mi forma» del Inicio (data_analyse.my_form). */
.z-myform { margin-top: 2rem; display: grid; gap: 12px; }
.z-myform-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.z-myform-head .z-section-title { margin: 0; font-family: var(--z-display); font-size: var(--z-fs-2xl); font-weight: 400; letter-spacing: .01em; line-height: 1; }
.z-myform .z-form-strip { margin: 0; }
/* «Tu forma»: cuatro zonas (balance en anillo, últimos partidos, apuntado → jugado y puntos SNP) */
.z-myform { padding: 0; overflow: hidden; border-radius: var(--z-radius-lg); }
.z-myform-head, .z-myform > p { padding: 22px 26px 0; }
.z-myform > p:last-child { padding-bottom: 20px; }
.z-myform-zones { display: grid; grid-template-columns: 1fr; margin-top: 8px; }
.z-myform-zone { display: grid; align-content: center; gap: 8px; min-width: 0; padding: 18px 26px; border-top: 1px solid var(--z-border); }
.z-myform-zone .z-eyebrow { display: block; font-size: var(--z-fs-xs); color: var(--z-muted); }
.z-myform-balance { grid-auto-flow: column; grid-template-columns: auto 1fr; align-items: center; gap: 16px; }
.z-myform-balance .z-myform-ring { width: 112px; height: 112px; }
.z-myform-ring-t { font-family: var(--z-display); font-size: 17px; font-weight: 400; fill: var(--z-lime); letter-spacing: .02em; }
.z-myform-ring-l { stroke: var(--z-surface-3); }
.z-myform-pips { display: flex; flex-wrap: wrap; gap: 6px; }
.z-myform-run { margin: 0; font-weight: 700; }
.z-myform-run strong { color: var(--z-lime); }
.z-myform-big { font-family: var(--z-display); font-size: var(--z-fs-2xl); font-weight: 400; line-height: 1; }
.z-myform-big small { font-family: var(--z-body); font-size: var(--z-fs-sm); font-weight: 600; color: var(--z-muted); }
.z-myform-snp { border-top: 1px solid var(--z-border); }
@media (min-width: 992px) {
    .z-myform-zones { grid-template-columns: 250px 1fr 1fr 1.3fr; }
    .z-myform-zone { border-top: 0; border-left: 1px solid var(--z-border); }
    .z-myform-zone:first-child { border-left: 0; }
    .z-myform-zones:not(:has(.z-myform-snp)) { grid-template-columns: 250px 1fr 1fr; }
}
.z-myform-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.z-myform-kpis dt { font-size: var(--z-fs-sm); font-weight: 600; color: var(--z-muted, inherit); }
.z-myform-kpis dd { margin: 0; font-size: var(--z-fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.z-myform-kpis dd small { font-size: var(--z-fs-sm); font-weight: 600; }
.z-myform-up { color: var(--z-lime); }
.z-myform-down { color: #FF5C63; }
.z-myform-hidden { margin-top: 1.5rem; }
.z-myform-snp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.z-myform-snp-title { font-size: var(--z-fs-sm); font-weight: 600; color: var(--z-muted, inherit); }
.z-myform-snp-period { font-weight: 400; }
.z-myform-chart { position: relative; height: 96px; }
.z-myform-chart svg { display: block; width: 100%; height: 100%; }
.z-myform-area { fill: rgba(180, 241, 0, .12); }
.z-myform-line { fill: none; stroke: var(--z-lime); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.z-myform-end { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--z-lime); box-shadow: 0 0 0 3px rgba(180, 241, 0, .25); }
.z-myform-chart { cursor: crosshair; touch-action: pan-y; }
.z-myform-hover { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--z-lime); border: 2px solid var(--z-bg, #111); pointer-events: none; }
.z-myform-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); padding: 3px 8px; border-radius: var(--z-radius-xs); background: var(--z-surface, #1c1c1c); border: 1px solid var(--z-border); font: 400 var(--z-fs-xs) var(--z-body); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; z-index: 2; }
.z-myform-tip--below { transform: translate(-50%, 12px); }
.z-myform-hover[hidden], .z-myform-tip[hidden] { display: none; }
.z-myform-ymax, .z-myform-ymin { position: absolute; left: 0; font-size: var(--z-fs-xs); color: var(--z-muted, inherit); font-variant-numeric: tabular-nums; }
.z-myform-ymax { top: -2px; }
.z-myform-ymin { bottom: -2px; }
.z-myform-xaxis { display: flex; justify-content: space-between; font-size: var(--z-fs-xs); color: var(--z-muted, inherit); }
.z-myform-kpis .z-myform-seg-wrap, .z-myform-kpis .z-myform-ring-wrap { display: grid; gap: 6px; font-size: var(--z-fs-sm); font-weight: 400; }
.z-myform-kpis .z-myform-ring-wrap { grid-auto-flow: column; grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.z-myform-ring { width: 64px; height: 64px; flex: none; }
.z-myform-ring-w { stroke: var(--z-lime); }
.z-myform-seg { display: flex; height: 10px; border-radius: 999px; background: var(--z-border-strong, rgba(255, 255, 255, .15)); overflow: hidden; }
.z-myform-seg-w { display: block; height: 100%; background: var(--z-lime); }
/* «Mi forma» con varias competiciones: cada tramo y cada partido llevan el color de su competición. */
.z-myform-seg--snp { background: var(--z-snp); }
.z-myform-seg--lapi { background: var(--z-lapi); }
.z-myform-seg-detail { color: var(--z-muted); font-size: var(--z-fs-sm); }
.z-myform-pip { position: relative; margin-bottom: 6px; }
.z-myform-pip::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 4px; border-radius: 2px; transform: translateX(-50%); background: var(--z-lime); }
.z-myform-pip--snp::after { background: var(--z-snp); }
.z-myform-pip--lapi::after { background: var(--z-lapi); }
.z-myform-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--z-muted, inherit); }
.z-myform-legend--col { flex-direction: column; gap: 2px; }
.z-myform-legend strong { color: inherit; font-weight: 700; }
.z-myform-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.z-myform-dot--w { background: var(--z-lime); }
.z-myform-dot--l { background: #FF5C63; }

/* Espacios por competición: etiqueta con el color de cada una (cabecera, invitaciones, registro). */
.z-choice-legend { margin: 0 0 4px; font-size: var(--z-fs-md); font-weight: 700; color: var(--z-text); }
.z-comp-badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: var(--z-fs-xs); font-weight: 800; line-height: 1.4; letter-spacing: .01em; white-space: nowrap; border-radius: 999px; }
.z-comp-badge--snp { color: var(--z-ink); background: var(--z-snp); }
.z-comp-badge--lapi { color: var(--z-ink); background: var(--z-lapi); }
.z-user-menu .z-comp-badge { margin-left: 2px; }
.z-space-item { display: flex; align-items: center; gap: 8px; }
.z-space-item > span:not(.z-comp-badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Estadísticas «Todas»: leyenda de competiciones y una barra por competición en cada situación de sets. */
.z-comp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; list-style: none; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-comp-legend li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.z-comp-meter { display: grid; grid-template-columns: 3.2rem 1fr 2.6rem; align-items: center; gap: 8px; margin-top: 6px; }
.z-comp-meter-name { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .01em; color: var(--z-muted); }
.z-comp-meter .st-meter { margin-top: 0; }
.z-comp-meter b { text-align: right; font-size: var(--z-fs-md); }
/* «Tus equipos» del menú de usuario: solo informa (competición, equipo y papel). */
/* Solo informan (no se pueden pulsar): más pequeños y apagados que las opciones del menú (H-26). */
.z-team-item { display: flex; align-items: center; gap: 8px; min-width: 240px; padding-top: 2px; padding-bottom: 2px; font-size: var(--z-fs-sm); color: var(--z-muted); cursor: default; user-select: none; }
.z-team-item-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-team-item small { white-space: nowrap; }
.z-choice-help { margin: -8px 0 16px; }
.dropdown-item.active .z-comp-badge--snp { color: var(--z-snp); background: var(--z-ink); }
.dropdown-item.active .z-comp-badge--lapi { color: var(--z-lapi); background: var(--z-ink); }
.z-home-hero .z-comp-badge { margin: 2px 0 6px; }
/* Vistas unidas de varios espacios: etiqueta de la competición en cada tarjeta y chips del filtro */
.z-fixture-head .z-comp-badge { margin-left: 6px; }
.z-fixture-role { font-size: var(--z-fs-xs); }
.z-create-choice .dropdown-menu { min-width: 260px; }
.z-space-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.z-space-kpis > div { display: flex; flex-direction: column; padding: 14px 16px; background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius); }
.z-space-kpis b { font-size: var(--z-fs-xl); line-height: 1.1; }
.z-space-kpis span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--st-muted); }
.z-space-rows { list-style: none; margin: 0; padding: 0; }
.z-space-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--st-line); }
.z-space-rows-name { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0; font-weight: 700; }
.z-space-rows-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-space-rows-nums { color: var(--st-muted); font-variant-numeric: tabular-nums; }
.z-space-rows a { margin-left: auto; font-weight: 700; white-space: nowrap; }
.z-space-switcher { margin: 0 0 16px; }
.z-space-switcher 
/* Filtros del listado: en escritorio siempre abiertos y sin botón; en móvil, plegados tras «Filtros» (H-24). */
.z-filters > summary { list-style: none; cursor: pointer; margin-bottom: 8px; }
.z-filters > summary::-webkit-details-marker { display: none; }
@media (min-width: 768px) { .z-filters > summary { display: none; } }
.z-space-note { margin: -4px 0 12px; }

/* Filtros en una fila de desplegables (Competición, Temporada, Tipo; el rival en el listado): cada uno dice su valor
   y se marca en lima si no es «Todas». Los menús son <details> con enlaces (static/js/filter-menu.js los cierra). */
.z-fsel-wrap { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 10px 10px 0; vertical-align: top; }
.z-fsel { position: relative; }
.z-fsel > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 128px; padding: 6px 14px; border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); background: var(--z-surface-2); color: var(--z-text); }
.z-fsel > summary::-webkit-details-marker { display: none; }
.z-fsel > summary small { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.z-fsel > summary > span { font-size: var(--z-fs-sm); font-weight: 700; }
.z-fsel > summary > span::after { content: "\25BE"; margin-left: 8px; color: var(--z-muted); }
.z-fsel > summary:hover, .z-fsel[open] > summary { border-color: var(--z-lime); }
.z-fsel.is-active > summary { border-color: var(--z-lime); }
.z-fsel.is-active > summary small { color: var(--z-lime); }
.z-fsel-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: 280px; margin: 0; padding: 6px; list-style: none; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.z-fsel-menu a { display: block; padding: 8px 12px; border-radius: var(--z-radius-sm); color: var(--z-text); font-size: var(--z-fs-sm); font-weight: 600; text-decoration: none; }
.z-fsel-menu a:hover, .z-fsel-menu a:focus-visible { background: var(--z-surface-2); }
.z-fsel-menu a[aria-current="page"] { color: var(--z-lime); background: var(--z-surface-2); }
.z-fsel-wrap .st-type-select, .z-fsel-wrap .st-season-search { margin: 0; }
.z-fsel-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 10px; }
.z-fsel-row > .z-fsel-wrap, .z-fsel-row > .z-match-filters { margin: 0 0 10px; }
.z-fsel-row .z-match-filters { display: flex; align-items: center; gap: 8px; }
.z-fsel-row .z-space-note { flex: 0 0 100%; order: 9; margin: 0 0 10px; }
.z-fsel-row .z-match-filters { flex-wrap: nowrap; align-items: center; align-self: flex-start; min-height: 52px; }
.z-fsel-row .z-match-filters .st-filter-label { margin: 0; }

/* Idea «marco de competición, dato en lima»: cada competición tiene su marco (tinte suave y línea superior de su color) y
   los datos dentro van en lima, el color de Zyra. Los gráficos que comparan competiciones mantienen su color para distinguir series. */
.z-comp-frame { border: 1px solid var(--st-line, var(--z-border)); border-top: 3px solid var(--z-snp); border-radius: var(--z-radius); background: linear-gradient(180deg, rgba(var(--z-snp-rgb), .12), rgba(var(--z-snp-rgb), .03)); }
.z-comp-frame--lapi { border-top-color: var(--z-lapi); background: linear-gradient(180deg, rgba(var(--z-lapi-rgb), .12), rgba(var(--z-lapi-rgb), .03)); }
.z-comp-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.z-comp-panel { padding: 16px 18px 14px; }
.z-comp-panel > header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; min-width: 0; }
.z-comp-panel > header > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-comp-panel .z-comp-meter { grid-template-columns: minmax(6.5rem, 9rem) 1fr 2.8rem; margin-top: 10px; }
.z-comp-panel .z-comp-meter-name { font-size: var(--z-fs-sm); letter-spacing: 0; text-transform: none; color: var(--z-text); font-weight: 600; }
.z-comp-panel .st-meter span { background: var(--z-lime); }
.z-comp-panel .z-comp-meter b { color: var(--z-lime); }
.z-space-rows li.z-comp-frame { padding: 12px 16px; margin-bottom: 10px; border-bottom-width: 1px; }
.z-space-rows li.z-comp-frame:last-child { margin-bottom: 0; }

/* Explicación bajo cada dato de sets. */
.z-comp-meter-name small { display: block; margin-top: 1px; font-size: var(--z-fs-xs); font-weight: 500; line-height: 1.3; color: var(--z-muted); }

/* Crear enfrentamiento: formulario y, en escritorio, vista previa «Así se verá». */
.z-create-layout { display: grid; gap: 22px; }
.z-create-preview { display: none; }
@media (min-width: 1100px) {
    .z-create-layout { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
    .z-create-preview {
        position: sticky; top: 96px; display: grid; align-content: start; gap: 10px; min-height: 360px; padding: 26px;
        color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-lg);
    }
    .z-create-preview p { margin: 0; }
    .z-create-preview-tag { justify-self: start; padding: 5px 12px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--z-lime); background: var(--z-ink); border-radius: 999px; }
    .z-create-preview-kicker { font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
    .z-create-preview-date { font: 400 3.6rem/.95 var(--z-display); text-transform: uppercase; }
    .z-create-preview-meta { min-height: 1.3em; font-weight: 700; }
    .z-create-preview-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; margin-top: auto; padding-top: 24px; border-top: 2px solid rgba(10, 10, 10, .2); }
    .z-create-preview-teams b { display: block; font: 400 1.5rem/1.05 var(--z-display); text-transform: uppercase; overflow-wrap: anywhere; }
    .z-create-preview-teams small { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
    .z-create-preview-teams span:last-child { text-align: right; }
    .z-create-preview-teams i { padding: 3px 12px; font: 400 1.1rem/1.2 var(--z-display); font-style: normal; color: var(--z-lime); background: var(--z-ink); border-radius: 999px; }
}

/* Estadísticas (estilo «Social club»): primer dato en lima, panel de mejores parejas en lima y advertencias en ámbar */
.z-space-kpis > div:first-child { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-space-kpis > div:first-child span { color: var(--z-ink); }
.st-card--lime { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.st-card--lime .st-card-title, .st-card--lime .st-card-note, .st-card--lime .st-top-name, .st-card--lime .st-top-name a, .st-card--lime .st-top-name small, .st-card--lime .st-top-pct { color: var(--z-ink); }
.st-card--lime .st-top-row { border-color: rgba(10, 10, 10, .2); }
.st-card--lime .st-top-pos { color: var(--z-lime); background: var(--z-ink); }
.st-card--lime .st-top-row:first-child .st-top-pos { color: var(--z-lime); background: var(--z-ink); }
.st-kpi--warn { border-left-color: var(--z-warning); }
.st-kpi--warn .st-kpi-value { color: var(--z-warning); }
.st-kpi--ring { background: var(--z-lime); border-color: var(--z-lime); color: var(--z-ink); }
.st-kpi--ring .st-kpi-label, .st-kpi--ring .st-kpi-sub { color: var(--z-ink); }
.st-kpi--ring .st-ring { background: radial-gradient(closest-side, var(--z-lime) 80%, transparent 82%), conic-gradient(var(--z-ink) calc(var(--pct) * 1%), rgba(10, 10, 10, .2) 0); }
.st-kpi--ring .st-ring span { color: var(--z-ink); }

/* Mis estadísticas (mockup «Social club»): datos grandes en Anton, una tarjeta por competición con franja de color y gráficos con su color */
.z-space-kpis { gap: 12px; margin-bottom: 14px; }
.z-space-kpis > div { padding: 16px 20px; background: var(--z-surface); border-color: var(--z-border); border-radius: var(--z-radius-lg); }
.z-space-kpis b { font: 400 3rem/1 var(--z-display); }
.z-space-kpis span { margin-top: 4px; }
.z-space-rows li.z-comp-frame { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 20px; margin-bottom: 10px; background: var(--z-surface); border: 1px solid var(--z-border); border-left: 6px solid var(--z-snp); border-radius: var(--z-radius); }
.z-space-rows li.z-comp-frame--lapi { border-left-color: var(--z-lapi); }
.z-space-rows li.z-comp-frame .z-space-rows-name { grid-column: 1; flex: none; font-size: var(--z-fs-base); }
.z-space-rows li.z-comp-frame .z-space-rows-nums { grid-column: 1; font-size: var(--z-fs-sm); }
.z-space-rows li.z-comp-frame > a { grid-column: 2; grid-row: 1 / span 2; }
.z-comp-panel.z-comp-frame { background: var(--z-surface-2); border: 0; border-left: 6px solid var(--z-snp); border-radius: var(--z-radius-lg); }
.z-comp-panel.z-comp-frame--lapi { border-left-color: var(--z-lapi); }
.z-comp-panel.z-comp-frame .st-meter span { background: var(--z-snp); }
.z-comp-panel.z-comp-frame--lapi .st-meter span { background: var(--z-lapi); }
.z-comp-panel.z-comp-frame .z-comp-meter b { color: var(--z-text); font: 400 1.3rem var(--z-display); }

/* Advertencias (mockup): cada una es una tarjeta con la fecha, el jugador y el motivo, y el enfrentamiento debajo */
.st-warn-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.st-warn-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 18px; padding: 14px 20px; background: var(--z-surface-2); border-left: 6px solid var(--z-warning); border-radius: var(--z-radius); }
.st-warn-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 54px; border-radius: var(--z-radius); background: var(--z-surface-3); }
.st-warn-date b { font: 400 1.5rem/1 var(--z-display); }
.st-warn-date small { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; color: var(--z-muted); }
.st-warn-body { display: grid; gap: 2px; min-width: 0; }
.st-warn-body strong { font-weight: 800; }
.st-warn-body a { font-size: var(--z-fs-sm); color: var(--z-muted); }
.st-warn-item .st-warn-actions { display: flex; gap: 6px; }
.st-warn-item .st-warn-actions form { margin: 0; }
@media (max-width: 575.98px) { .st-warn-item { grid-template-columns: auto minmax(0, 1fr); } .st-warn-item .st-warn-actions { grid-column: 1 / -1; } }
.st-warn-reason { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.st-warn-chip { padding: 2px 10px; font-size: var(--z-fs-xs); font-weight: 800; color: var(--z-ink); background: var(--z-warning); border-radius: 999px; }
.st-kpis .st-kpi-value { font-family: var(--z-display); font-weight: 400; font-size: var(--z-fs-3xl); }
.st-kpi--warn { border-left-width: 6px; }

/* Formulario de crear rival: bloque oscuro con campos holgados, aviso lima y botón a todo el ancho */
.z-form-narrow { margin-inline: 0; padding: 28px; background: var(--z-surface-2); border-radius: var(--z-radius-lg); }
.z-form-narrow .form-label { margin-bottom: 8px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .01em; }
.z-form-narrow .form-control, .z-form-narrow .form-select { min-height: 50px; background-color: var(--z-surface); border-radius: var(--z-radius); }
.z-hint { margin: 0 0 16px; padding: 12px 16px; font-size: var(--z-fs-sm); color: var(--z-text); background: rgba(var(--z-lime-rgb), .1); border: 1px solid var(--z-lime); border-radius: var(--z-radius); }

/* ---------- Táctil (UX-027) ----------
   En pantallas táctiles los botones, chips e iconos llegan a 44 px de alto (recomendación de iOS y
   Android); el icono de 24 px conserva su tamaño visual y amplía solo el área de toque. */
@media (pointer: coarse) {
    .btn, .st-chip, .z-chip, .z-icon-btn { min-height: 44px; }
    .btn, .st-chip { display: inline-flex; align-items: center; justify-content: center; }
    .z-icon-btn { min-width: 44px; }
    .form-select-sm, .form-control-sm { font-size: max(16px, 1rem); min-height: 44px; }
    .st-tabs.z-segmented > .btn { min-height: 44px; }
}

/* ---------- Inicio en móvil (UX-003) ----------
   La tarea diaria va primero: equipos → próximo enfrentamiento y «Pendiente» → avisos y primeros pasos
   → «Mi forma». Solo cambia el orden visual; el orden de lectura y de foco sigue el del documento. */
@media (max-width: 767.98px) {
    .main-content:has(> .z-home-grid) { display: flex; flex-direction: column; }
    .main-content:has(> .z-home-grid) > * { order: 2; min-width: 0; max-width: 100%; }
    .main-content:has(> .z-home-grid) > .z-home-grid { grid-template-columns: minmax(0, 1fr); }
    .main-content:has(> .z-home-grid) > .z-home-strip,
    .main-content:has(> .z-home-grid) > .z-home-hero { order: 0; }
    .main-content:has(> .z-home-grid) > .z-home-grid { order: 1; margin-top: 16px; }
    .main-content:has(> .z-home-grid) > .z-home-grid ~ * { order: 3; }
    .main-content:has(> .z-home-grid) > .z-onboarding { margin-top: 16px; }
    /* «Primeros pasos» plegado a lo esencial: título, progreso y siguiente paso */
    .z-onboarding-head p { display: none; }
}

/* ---------- Cabeceras con acción principal y «Más» (UX-017) ----------
   En escritorio se ven los botones de siempre; en móvil la acción principal va primera y lo secundario
   se recoge en un menú «Más» a su lado, para que la lista empiece antes. */
.z-actions-more { display: none; }
@media (max-width: 767.98px) {
    .z-page-head .z-actions { flex-wrap: nowrap; align-items: stretch; }
    .z-page-head .z-actions > .z-actions-secondary { display: none; }
    .z-page-head .z-actions > .z-actions-more { display: block; flex: 0 0 auto; order: 2; }
    .z-page-head .z-actions > :not(.z-actions-more) { order: 1; flex: 1 1 0; min-width: 0; }
    .z-page-head .z-actions > :not(.z-actions-more) > .btn, .z-page-head .z-actions > .btn { overflow: hidden; text-overflow: ellipsis; }
    .z-page-head .z-actions > .z-actions-more .btn { width: auto; }
    .z-page-head .z-actions .btn { letter-spacing: 0; padding-inline: .8rem; }
}

/* ---------- Pista en el panel «Próximo enfrentamiento» por debajo de 1100 px ----------
   En escritorio el panel es la pista (2:1). En tableta y móvil se dibuja la misma pista de fondo: tumbada si el
   panel es ancho y de pie si es estrecho; las líneas se estiran con el panel (trazo fijo), el contenido no. */
@media (max-width: 1099.98px) {
    .z-home-grid .z-next-match::before {
        content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' preserveAspectRatio='none' fill='none' stroke='%230A0A0A' stroke-opacity='.15' stroke-width='2'%3E%3Crect x='3' y='6' width='194' height='88' rx='1' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M100 6V94M30.5 6V94M169.5 6V94M30.5 50H169.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    }
}
@media (max-width: 575.98px) {
    .z-home-grid .z-next-match::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 200' preserveAspectRatio='none' fill='none' stroke='%230A0A0A' stroke-opacity='.15' stroke-width='2'%3E%3Crect x='6' y='3' width='88' height='194' rx='1' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M6 100H94M6 30.5H94M6 169.5H94M50 30.5V169.5' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    }
}

/* Aviso de en qué equipo se hace un alta (UX-002) */
.z-target-team { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 10px 14px; font-size: var(--z-fs-md); background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
.z-target-team > i { color: var(--z-lime); }
.z-target-team > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Grupos del listado de enfrentamientos (UX-015): requieren acción · próximos · jugados */
.z-fixtures-head { margin: 8px 0 -4px; }
.z-fixtures-head:first-child { margin-top: 0; }
.z-fixtures-head h2 { margin: 0; font: 400 1.25rem/1.1 var(--z-display); letter-spacing: .02em; text-transform: uppercase; color: var(--z-text); }
.z-fixtures-head--action h2 { color: var(--z-danger); }
}

@layer screens {
/* ---------- Estadísticas en móvil: filtros en una fila y secciones plegables (UX-009) ---------- */
.st-section-toggle { display: inline; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-align: inherit; text-transform: inherit; background: none; border: 0; cursor: default; pointer-events: none; }
.st-section-toggle i { display: none; }
.st-filters-sheet > summary { display: none; }
@media (max-width: 767.98px) {
    .st-filters-sheet { min-width: 0; max-width: 100%; margin: 0 0 12px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
    .st-filters-sheet > summary { display: flex; align-items: baseline; gap: 8px; min-height: 44px; min-width: 0; padding: 10px 14px; font-weight: 800; cursor: pointer; list-style: none; }
    .st-filters-sheet > summary::-webkit-details-marker { display: none; }
    .st-filters-sheet > summary::after { content: "\f078"; margin-left: auto; font-family: "Font Awesome 6 Free", sans-serif; font-weight: 900; font-size: .75rem; line-height: 1; color: var(--z-lime); transition: transform .2s; }
    .st-filters-sheet[open] > summary::after { transform: rotate(180deg); }
    .st-filters-sheet > summary small { min-width: 0; overflow: hidden; font-size: var(--z-fs-sm); font-weight: 500; color: var(--z-muted); text-overflow: ellipsis; white-space: nowrap; }
    .st-filters-body { display: grid; gap: 10px; padding: 0 12px 12px; }
    .st-section-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 0; font: inherit; color: inherit; text-align: left; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; cursor: pointer; }
    .st-section-toggle { pointer-events: auto; cursor: pointer; }
    .st-section-toggle i { display: inline; flex: none; font-size: var(--z-fs-sm); color: var(--z-lime); transition: transform .2s; }
    .st-section.is-open > .st-section-title .st-section-toggle i { transform: rotate(180deg); }
    section.st-section[data-collapsible] { margin-top: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--z-border); }
}
/* Rivales en móvil (UX-041): cada fila es una tarjeta con nombre, último resultado y balance */
@media (max-width: 767.98px) {
    .st-table--cards thead { display: none; }
    .st-table--cards, .st-table--cards tbody { display: block; }
    .st-table--cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; margin: 0 0 8px; padding: 12px 14px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
    .st-table--cards th[scope="row"], .st-table--cards td { display: block; padding: 0; border: 0; background: none; }
    .st-table--cards th[scope="row"] { grid-column: 1 / 3; min-width: 0; overflow-wrap: anywhere; }
    .st-table--cards .st-c-last { grid-column: 3; grid-row: 1; text-align: right; }
    .st-table--cards .st-c-played, .st-table--cards .st-c-record, .st-table--cards .st-c-points { grid-row: 2; font-size: var(--z-fs-sm); color: var(--z-muted); }
    .st-table--cards td[data-label]::before { content: attr(data-label) ": "; }
}
/* «Pendiente» de un jugador: las filas de tareas, en minúsculas, igual que el componente del capitán. */
.z-pending-row--todo .z-pending-main strong { text-transform: none; }
/* Selector de páginas de «Pendiente»: flechas y números, caben en cualquier ancho. */
.z-pending-picker { display: flex; align-items: stretch; justify-content: center; gap: 8px; margin-top: 10px; }
.z-pending-picker[hidden] { display: none; }
.z-pending-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-width: 0; }
.z-pending-page { min-width: 44px; min-height: 44px; padding: 0 10px; font-weight: 800; color: var(--z-text); background: var(--z-surface-2); border: 1px solid var(--z-border-control); border-radius: var(--z-radius-sm); cursor: pointer; }
.z-pending-page:hover { border-color: var(--z-border-control-hover); background: var(--z-surface-3); }
.z-pending-page[aria-current="true"] { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.z-pending-page:focus-visible { outline: 2px solid var(--z-text); outline-offset: 2px; }
.z-pending-picker .z-next-arrow { width: 44px; min-height: 44px; display: grid; place-items: center; }

/* Portada: ejemplo del producto y funciones en carrusel en móvil (UX-028) */
.z-landing-preview { display: grid; gap: 20px; align-items: center; }
.z-landing-preview-text p { margin: 0; color: var(--z-muted); }
.z-preview-card { margin: 0; padding: 22px; color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-lg); }
.z-preview-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: var(--z-fs-sm); font-weight: 800; }
.z-preview-card .z-comp-badge { color: var(--z-lime); background: var(--z-ink); }
.z-preview-date { margin: 6px 0 0; font: 400 clamp(3rem, 12vw, 4.6rem)/.95 var(--z-display); text-transform: uppercase; }
.z-preview-date small { font-size: .3em; opacity: .7; }
.z-preview-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 10px 0 14px; font: 400 var(--z-fs-xl)/1 var(--z-display); text-transform: uppercase; }
.z-preview-vs { padding: 2px 10px; font-size: var(--z-fs-sm); background: var(--z-ink); color: var(--z-lime); border-radius: 999px; }
.z-preview-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; font-size: var(--z-fs-xs); font-weight: 800; text-align: center; }
.z-preview-steps li { padding: 6px 2px; border: 2px solid rgba(10, 10, 10, .35); border-radius: 999px; }
.z-preview-steps .is-done { color: var(--z-lime); background: var(--z-ink); border-color: var(--z-ink); }
.z-preview-steps .is-now { border-color: var(--z-ink); }
.z-preview-card figcaption { font-size: var(--z-fs-xs); font-weight: 600; opacity: .7; }
@media (min-width: 768px) { .z-landing-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 767.98px) {
    .z-features { display: flex; gap: 12px; margin-inline: calc(var(--z-gutter, 16px) * -1); padding: 4px var(--z-gutter, 16px) 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .z-features::-webkit-scrollbar { display: none; }
    .z-features > .z-feature { flex: 0 0 78%; scroll-snap-align: start; }
}

/* Ajustes tras revisar la fase 5 */
/* Tarjetas del selector de convocatoria: todas del mismo ancho aunque el texto sea largo */
.z-selector-grid > *, .z-pick { min-width: 0; }
/* Estadísticas sin datos: el mensaje ocupa toda la tarjeta */
.st-card--empty { display: flex; flex-direction: column; }
.st-card--empty .st-card-empty { display: grid; flex: 1; place-items: center; min-height: 160px; margin: 12px 0 0; padding: 16px; text-align: center; color: var(--z-muted); border: 1px dashed var(--z-border); border-radius: var(--z-radius-sm); }
/* «Previa»: el último enfrentamiento es un enlace */
.z-preview-last { color: inherit; text-decoration: underline; text-decoration-color: var(--z-lime); text-underline-offset: 3px; }
.z-preview-last:hover, .z-preview-last:focus-visible { color: var(--z-lime); }
.z-preview-last i { font-size: .7em; color: var(--z-lime); }
/* Roles del equipo: cada uno con su insignia */
.z-roles { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.z-role { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; background: var(--z-surface); border: 1px solid var(--z-border); border-left-width: 4px; border-radius: var(--z-radius-sm); }
.z-role.is-captain { border-left-color: var(--z-lime); }
.z-role.is-manager { border-left-color: var(--z-border-strong); }
.z-role p { margin: 0; font-size: var(--z-fs-md); color: var(--z-muted); }
.z-role strong { color: var(--z-text); }
.z-role .z-badge { justify-self: start; }
@media (max-width: 480px) { .z-role { grid-template-columns: 1fr; gap: 6px; } }
/* Portada: la tilde de «Sáb» no choca con el texto de encima */
.z-preview-date { margin-top: 14px; padding-top: .12em; line-height: 1.1; }
.z-auth-lead { text-align: center; }
/* Registro en escritorio: presentación a la izquierda y formulario a la derecha, para ver los campos sin hacer scroll */
@media (min-width: 992px) {
    .z-auth-card--split { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; column-gap: 48px; max-width: 980px; padding: 40px 44px; }
    .z-auth-card--split .z-auth-logo { margin: 0 0 14px; }
    .z-auth-card--split .z-auth-side h1, .z-auth-card--split .z-auth-side p, .z-auth-card--split .z-auth-side details { text-align: left; }
    .z-auth-card--split .z-auth-side h1 { font-size: var(--z-fs-2xl); }
    .z-auth-card--split .z-auth-main form .z-section-title:first-child { margin-top: 0; }
}
}
}
/* Crear rival: formulario y, en escritorio, la tarjeta «Así se verá» del equipo (como al crear un enfrentamiento) */
.z-team-preview { display: none; }
@media (min-width: 1100px) {
    .z-team-preview { position: sticky; top: 96px; display: grid; align-content: start; gap: 10px; min-height: 320px; padding: 26px; color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-lg); }
    .z-team-preview p { margin: 0; }
    .z-team-preview-name { font: 400 2.6rem/1 var(--z-display); text-transform: uppercase; overflow-wrap: anywhere; }
    .z-team-preview-name[data-placeholder] { opacity: .45; }
    .z-team-preview-foot { margin-top: auto; padding-top: 18px; font-size: var(--z-fs-sm); font-weight: 700; border-top: 2px solid rgba(10, 10, 10, .2); }
}

/* Fase 6: pulido */
/* UX-032: «Tu equipo» en texto, no una estrella que se lea como «ganador» */
.z-own-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: var(--z-fs-xs); font-style: normal; font-weight: 700; letter-spacing: .02em; text-transform: none; color: var(--z-muted); vertical-align: middle; border: 1px solid var(--z-border-strong); border-radius: 999px; }
/* UX-033: en escritorio, la barra de guardar parejas va en la columna lateral y no tapa la pareja 5 */
@media (min-width: 992px) {
    .z-lineup:not(.z-lineup--unordered) .z-lineup-main { grid-column: 1; grid-row: 1 / span 2; }
    .z-lineup:not(.z-lineup--unordered) .z-lineup-side { grid-column: 2; grid-row: 1; }
    .z-lineup:not(.z-lineup--unordered) > .z-selector-bar { grid-column: 2; grid-row: 2; align-self: end; bottom: 16px; border-radius: var(--z-radius-lg); }
    .z-lineup--unordered { padding-bottom: 80px; }
}
/* UX-038: «Equipo» aprovecha el ancho: accesos rápidos como botones iguales en una rejilla */
.z-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.z-quick .btn { width: 100%; min-height: 44px; font-size: var(--z-fs-md); }
/* UX-047: el cambio de página no hace esperar: fundido corto y sin retardos */
@media (prefers-reduced-motion: no-preference) {
    .main-content > :not(script, style, link, div:only-of-type),
    .main-content > div:only-of-type > :not(script, style, link) { animation-duration: .2s; }
    :is(.main-content, .main-content > div:only-of-type) > :nth-child(n of :not(script, style, link)) { --z-in-delay: 0s; }
}
/* UX-048: las líneas de la pista se desvanecen bajo el texto del hero */
.z-hero-main::before { -webkit-mask-image: linear-gradient(180deg, #000 0, #000 38%, rgba(0, 0, 0, .12) 62%); mask-image: linear-gradient(180deg, #000 0, #000 38%, rgba(0, 0, 0, .12) 62%); }
/* UX-053: Mi perfil en dos columnas en escritorio */
.z-profile-col { display: grid; gap: 0; align-content: start; }
@media (min-width: 992px) {
    .z-profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
}
/* UX-044: el texto oculto (posición absoluta) dentro de una tabla con scroll propio no amplía la página */
.z-table-wrap { position: relative; }
/* UX-054: la barra inferior no se esconde al bajar (solo la cabecera; con el teclado abierto sí) */
}

/* Mis estadísticas (diseño aprobado «Módulo estadísticas»): cabecera con filas de competición y tipo, tarjetas y gráficos */
.st-tabs .btn { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.st-tabs .btn i { display: none; }
.z-space-kpis > div { gap: 4px; padding: 18px 20px 14px; border-radius: var(--z-radius-lg); }
.z-space-kpis b { font-family: var(--z-display); font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 400; line-height: .95; }
.z-space-kpis span { order: 2; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.z-space-kpis .is-lime { background: var(--z-lime); border-color: var(--z-lime); }
.z-space-kpis .is-lime b, .z-space-kpis .is-lime span { color: var(--z-ink); }
.z-space-kpis .is-won b { color: var(--z-lime); }
.z-space-rows-text { display: flex; flex-direction: column; min-width: 0; white-space: normal; }
.z-former-tag { font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--st-muted); }
.z-space-rows-text small { font-weight: 600; font-size: var(--z-fs-xs); color: var(--st-muted); }
.z-space-rows li.z-comp-frame { border-top: 1px solid var(--st-line); border-left: 4px solid var(--z-snp); background: var(--st-card); }
.z-space-rows li.z-comp-frame--lapi { border-top-color: var(--st-line); border-left-color: var(--z-lapi); background: var(--st-card); }
.st-info-note { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 16px; font-size: var(--z-fs-sm); color: var(--z-text); border: 1px dashed var(--z-border-strong); border-radius: var(--z-radius); }
.st-info-note i { flex: none; margin-top: 2px; color: var(--z-muted); }
.z-comp-legend--dots { gap: 4px 14px; font-weight: 700; }
.z-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--z-muted); }
.z-dot--snp { background: var(--z-snp); }
.z-dot--lapi { background: var(--z-lapi); }
.z-set-compare { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.z-set-row { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr auto; align-items: center; gap: 12px; }
.z-set-row b { font-size: var(--z-fs-sm); font-weight: 700; color: #FFFFFF; }
.z-set-row b small { display: block; margin-top: 2px; font-size: var(--z-fs-xs); font-weight: 400; color: var(--st-muted); }
.z-set-row em { min-width: 4.2rem; white-space: nowrap; font-family: var(--z-display); font-style: normal; font-size: var(--z-fs-xl); text-align: right; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.z-set-bars { display: flex; flex-direction: column; gap: 3px; }
.z-set-bar { height: 8px; overflow: hidden; background: var(--z-surface-3); border-radius: 999px; }
.z-set-bar span { display: block; height: 100%; border-radius: 999px; }
.z-set-bar--snp { background: var(--z-snp); }
.z-set-bar--lapi { background: var(--z-lapi); }
.st-chart--mine { height: 220px; }
.form-check.z-check-tip { display: flex; align-items: center; gap: 8px; padding-left: 0; }
.form-check.z-check-tip .form-check-input { float: none; margin: 0; flex-shrink: 0; }
.form-check.z-check-tip .z-tip { margin-left: 0; }
.z-lineup-side-toggle { display: none; margin-left: auto; width: var(--z-stage-touch, 44px); height: var(--z-stage-touch, 44px); place-items: center; color: var(--z-text); background: none; border: 0; border-radius: 50%; }
.z-lineup-side-toggle i { transition: transform .2s; }
.z-lineup-side-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.z-lineup-side-toggle:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 2px; }
@media (max-width: 991.98px) {
    .z-lineup-side-toggle { display: inline-grid; }
    #pair-order-list.is-collapsed { display: none; }
    /* Marcador y botones de Resultados fijos abajo: el total y el guardado siempre a mano */
    .z-results-side { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; gap: 8px; padding: 10px 12px; background: rgba(28, 29, 26, .9); border: 1px solid var(--z-border-strong); border-radius: var(--z-radius); box-shadow: var(--z-edge), var(--z-shadow-pop); backdrop-filter: blur(16px) saturate(140%); }
    .z-results-side .z-live-score { padding: 0; background: none; border: 0; }
    .z-results-side .z-live-score-title, .z-results-side .z-live-score-note { display: none; }
    .z-results-side .z-live-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
    .z-results-side .z-live-score-teams { display: contents; }
    .z-results-side .z-live-score-teams span:first-child { grid-column: 1; grid-row: 1; text-align: left; }
    .z-results-side .z-live-score-teams span:last-child { grid-column: 3; grid-row: 1; text-align: right; }
    .z-results-side .z-live-score-points { grid-column: 2; grid-row: 1; margin: 0; font-size: 2rem; gap: 8px; }
    .z-results-side .z-results-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .z-results-side .z-results-actions .btn { width: 100%; }
    .z-results-side .z-results-actions .btn-outline-secondary { display: none; }
    body:has(.z-results-side) .z-bottom-nav { display: none; }
    body:has(.z-results-side) .main-content { padding-bottom: 40px; }
}
.z-stage-toggle { margin: 0; }
.z-stage-toggle-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: none; color: var(--z-muted); background: none; border: 1px solid var(--z-border-strong); border-radius: 999px; cursor: pointer; }
.z-stage-toggle-btn:hover { color: var(--z-text); }
.z-stage-toggle-btn:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 2px; }
.z-stage-toggle-track { position: relative; width: 28px; height: 16px; background: var(--z-border-strong); border-radius: 999px; transition: background .2s; }
.z-stage-toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: #FFFFFF; border-radius: 50%; transition: transform .2s; }
.z-stage-toggle-btn[aria-checked="true"] { color: var(--z-text); }
.z-stage-toggle-btn[aria-checked="true"] .z-stage-toggle-track { background: var(--z-lime); }
.z-stage-toggle-btn[aria-checked="true"] .z-stage-toggle-track::after { transform: translateX(12px); background: #0B0B0B; }
@media (prefers-reduced-motion: reduce) { .z-stage-toggle-track, .z-stage-toggle-track::after { transition: none; } }
.z-title-tip { display: flex; align-items: center; gap: 4px; }
.z-title-tip :is(h1, h2) { margin: 0; }
/* Fuente única de todos los globos «i»: la de cuerpo de la app, peso normal; nunca la del título que los contiene. */
:root { --z-tip-font: 400 var(--z-fs-xs)/1.4 var(--z-body); }
.z-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; padding: 2px; font-size: var(--z-fs-sm); line-height: 1; color: var(--z-muted); background: none; border: 0; cursor: help; }
.z-tip:hover, .z-tip:focus-visible, .z-tip.is-open { color: var(--z-lime); }
.z-tip::after { content: attr(data-tip); position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: min(240px, 70vw); padding: 8px 12px; font: var(--z-tip-font); line-height: 1.4; letter-spacing: normal; text-transform: none; font-variant-numeric: normal; white-space: normal; text-align: left; color: var(--z-text); background: var(--z-ink); border: 1px solid var(--z-border-strong); border-radius: var(--z-radius-sm); transform: translateX(-30%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s var(--z-ease); }
.z-tip:hover::after, .z-tip:focus-visible::after, .z-tip.is-open::after { opacity: 1; visibility: visible; }

/* Ficha de jugador (diseño aprobado «Módulo estadísticas»): cabecera lima, cifras, forma, local y visitante, barras */
.st-pill-note { display: inline-block; margin: 0 0 8px; padding: 8px 16px; font-size: var(--z-fs-sm); color: var(--z-muted); background: var(--z-surface-2); border-radius: 999px; }
.st-picker--bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 6px 16px; background: var(--z-surface-2); border-radius: 999px; }
.st-picker--bar .st-label { margin: 0; color: var(--z-muted); }
.st-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; margin: 0 0 12px; padding: 22px 28px; color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-lg); }
.st-hero-kicker { margin: 0; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.st-hero-name { margin: 8px 0 4px; font-family: var(--z-display); font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 400; line-height: 1.15; text-transform: uppercase; color: var(--z-ink); overflow-wrap: anywhere; }
.st-hero-sub { margin: 0; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.st-hero-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.st-hero-id > div { min-width: 0; }
.st-hero-id .z-avatar { flex: 0 0 auto; }
.st-hero-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: var(--z-fs-xs); font-weight: 700; }
.st-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.st-hero-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-lime); text-decoration: none; background: var(--z-ink); border: 2px solid var(--z-ink); border-radius: 999px; }
.st-hero-btn:hover, .st-hero-btn:focus-visible { color: var(--z-ink); background: transparent; }
.st-hero-btn--ghost { color: var(--z-ink); background: transparent; }
.st-hero-btn--ghost:hover, .st-hero-btn--ghost:focus-visible { color: var(--z-lime); background: var(--z-ink); }
.st-hero-pct { display: flex; align-items: center; gap: 10px; }
.st-hero-cap { display: none; }
.st-hero-partner::before { content: " · "; }
@media (max-width: 575.98px) {
  /* Tarjeta del jugador en móvil: foto y rol en una fila, nombre a todo el ancho, datos y botones debajo. */
  .st-hero-id { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 12px; }
  .st-hero-id > div { display: contents; }
  .st-hero-id .z-avatar { grid-row: 1; width: 52px; height: 52px; font-size: var(--z-fs-lg); }
  .st-hero-kicker { grid-column: 2; grid-row: 1; line-height: 1.35; }
  .st-hero-partner { display: block; margin-top: 2px; font-weight: 700; letter-spacing: .04em; }
  .st-hero-partner::before { content: none; }
  .st-hero-name, .st-hero-id .st-hero-sub, .st-hero-meta, .st-hero-actions { grid-column: 1 / -1; }
  .st-hero-name { margin: 10px 0 2px; font-size: clamp(1.9rem, 9vw, 2.4rem); line-height: 1.15; }
  .st-hero-meta { margin: 6px 0 0; gap: 2px 12px; }
  .st-hero-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0 0; }
  .st-hero-cap { display: block; max-width: 7ch; font-size: var(--z-fs-xs); font-weight: 800; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }
  .st-hero-btn { justify-content: center; min-height: 40px; padding: 6px 12px; font-size: var(--z-fs-xs); white-space: nowrap; }
}
.st-hero-ring { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; background: conic-gradient(var(--z-ink) calc(var(--pct) * 1%), rgba(10, 10, 10, .2) 0); border-radius: 50%; }
.st-hero-ring span { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; font-family: var(--z-display); font-size: 1.4rem; background: var(--z-lime); border-radius: 50%; }
.st-hero-balance { display: flex; flex-direction: column; align-items: flex-end; }
.st-hero-balance b { font-family: var(--z-display); font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 400; line-height: 1; }
.st-hero-balance span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.st-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.st-kpi-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius-lg); }
.st-kpi-tile b { font-family: var(--z-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.st-kpi-tile--up b { color: var(--z-lime); }
.st-kpi-tile--down b { color: var(--st-loss); }
.st-kpi-tile span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--st-muted); }
.st-kpi-tile small { font-size: var(--z-fs-xs); color: var(--st-muted); }
.st-form--lg .st-pip { width: 40px; height: 40px; font-size: var(--z-fs-md); }
.st-venue-label { margin: 10px 0 6px; font-size: var(--z-fs-xs); font-weight: 800; color: #FFFFFF; }
.st-venue-label span { color: var(--z-muted); }
.st-venue-bar { display: flex; gap: 3px; height: 34px; font-family: var(--z-display); font-size: var(--z-fs-lg); }
.st-venue-bar span { display: flex; align-items: center; min-width: 34px; padding: 0 12px; color: var(--z-ink); border-radius: 999px; }
.st-venue-win { background: var(--z-lime); }
.st-venue-loss { justify-content: flex-end; background: var(--st-loss, #FF5C63); }
.st-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.st-bar-row { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr 3.4rem; align-items: center; gap: 12px; }
.st-bar-row b { font-size: var(--z-fs-sm); font-weight: 700; color: #FFFFFF; }
.st-bar-row b small { display: block; font-size: var(--z-fs-xs); font-weight: 600; color: var(--st-muted); }
.st-bar-row b small.st-bar-base, .z-set-row b small.st-bar-base { font-weight: 400; }
.st-bars--desc .st-bar-row { grid-template-columns: minmax(7rem, 44%) 1fr 3.4rem; }
.st-bar-row em { font-family: var(--z-display); font-style: normal; font-size: var(--z-fs-xl); text-align: right; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.st-bar-row .st-meter { margin-top: 0; height: 14px; }
.st-bar-row.is-empty, .st-bars--desc .st-bar-row.is-empty { opacity: .6; grid-template-columns: minmax(7rem, 44%) 1fr 5.5rem; }
.st-bar-row.is-empty .st-meter { border: 1px dashed var(--z-border-strong); background: transparent; }
.st-bar-row.is-empty em { font-family: var(--z-body); font-size: var(--z-fs-xs); font-weight: 800; line-height: 1.2; color: var(--z-muted); }
.st-only { position: absolute; top: 18px; right: 18px; }
.st-card:has(> .st-only) { position: relative; }
.st-rate { margin-top: 14px; }
.st-rate-label { margin: 0 0 6px; font-size: var(--z-fs-xs); font-weight: 800; color: #FFFFFF; }
.st-rate-label span { color: var(--z-muted); }
.st-meter--lg { height: 16px; margin-top: 0; }
.st-eligible { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.st-eligible b { font-family: var(--z-display); font-size: 3.4rem; font-weight: 400; line-height: 1; color: var(--z-muted); }
.st-eligible b.is-ok { color: var(--z-lime); }
.st-eligible p { margin: 0; }
.st-eligible small { display: block; font-size: var(--z-fs-xs); color: var(--st-muted); }
.st-fold { margin-top: 24px; }
.st-fold > summary { cursor: pointer; font-family: var(--z-display); font-size: var(--z-fs-xl); text-transform: uppercase; }
@media (max-width: 767.98px) {
  /* El nombre ocupa la fila de arriba; debajo, el % (anillo) y el balance, para que el % se vea también en móvil. */
  .st-hero { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .st-hero-main { grid-column: 1 / -1; }
  .st-hero-ring { width: 64px; height: 64px; }
  .st-hero-ring span { width: 48px; height: 48px; font-size: 1.1rem; }
  .st-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-bar-row { grid-template-columns: minmax(5rem, 7rem) 1fr 3rem; gap: 8px; }
}

/* Estadísticas · Equipo (diseño aprobado): balance lima, puntos de liga y récords. */
.st-balance { margin: 0 0 12px; padding: 22px 28px; color: var(--z-ink); background: var(--z-lime); border-radius: var(--z-radius-lg); }
.st-balance-kicker { margin: 0 0 6px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.st-balance-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.st-balance-nums { display: flex; flex-wrap: wrap; gap: 8px 36px; }
.st-balance-nums div { display: flex; flex-direction: column; }
.st-balance-nums b { font-family: var(--z-display); font-size: clamp(3rem, 9vw, 5.4rem); font-weight: 400; line-height: .95; }
.st-balance-nums span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.st-balance-pct { font-family: var(--z-display); font-size: clamp(2.6rem, 8vw, 4.6rem); font-weight: 400; line-height: 1; }
.st-balance-track { height: 12px; margin: 14px 0 8px; overflow: hidden; background: rgba(10, 10, 10, .2); border-radius: 999px; }
.st-balance-track span { display: block; height: 100%; background: var(--z-ink); border-radius: 999px; }
.st-balance-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 0; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.st-big { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 0; font-family: var(--z-display); font-size: clamp(3rem, 8vw, 4.4rem); line-height: 1; color: var(--z-lime); }
.st-big small { font-family: var(--z-body, inherit); font-size: var(--z-fs-sm); color: var(--st-muted); }
.st-chart--points { height: 190px; margin-top: 10px; }
.st-kpi-row--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-kpi-row--two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0; }
.st-kpi-row--records { align-content: start; margin: 0; }
@media (max-width: 640px) { .st-kpi-row--three { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-balance { padding: 18px; } .st-balance-main { align-items: center; } }

/* Ficha del jugador · «Reparto por partidos» (SNP): anillo con una escala de lima, del partido 1 al 5. */
.st-row--trio { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
/* Las tres tarjetas arrancan y acaban a la misma altura: su contenido ocupa todo el alto y reparte las filas. */
.st-row--trio > .st-card > .st-bars, .st-row--trio > .st-card > .st-gs { flex: 1 1 auto; }
.st-row--trio > .st-card > .st-bars { justify-content: space-between; }
.st-gs { --gs1: var(--z-lime); --gs2: #93CC00; --gs3: #72A300; --gs4: #567C0A; --gs5: #3F5C10; display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.st-gs-ring { position: relative; width: 148px; height: 148px; margin-inline: auto; }
.st-gs-ring svg { display: block; width: 100%; height: 100%; }
.st-gs-seg { transition: opacity .15s, stroke-width .15s; }
.st-gs-c1, .st-gs-d1 { stroke: var(--gs1); background: var(--gs1); }
.st-gs-c2, .st-gs-d2 { stroke: var(--gs2); background: var(--gs2); }
.st-gs-c3, .st-gs-d3 { stroke: var(--gs3); background: var(--gs3); }
.st-gs-c4, .st-gs-d4 { stroke: var(--gs4); background: var(--gs4); }
.st-gs-c5, .st-gs-d5 { stroke: var(--gs5); background: var(--gs5); }
.st-gs-base { stroke: var(--z-surface-3); }
.st-gs-num { font: 800 11px var(--z-body); fill: var(--z-ink); pointer-events: none; }
.st-gs-t4, .st-gs-t5 { fill: var(--z-text); }
.st-gs.is-dim .st-gs-seg { opacity: .35; }
.st-gs.is-dim .st-gs-seg.is-on { opacity: 1; stroke-width: 24; }
.st-gs-mid { position: absolute; inset: 0; display: grid; place-content: center; padding: 0 30px; text-align: center; pointer-events: none; }
.st-gs-mid b { font-family: var(--z-display); font-size: 2.1rem; font-weight: 400; line-height: 1; }
.st-gs-mid small { font-size: var(--z-fs-xs); color: var(--z-muted); letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }
.st-gs-legend { display: flex; flex-direction: column; flex: 1 1 auto; justify-content: space-between; gap: 4px; margin: 0; padding: 0; list-style: none; }
.st-gs-legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 8px; align-items: center; padding: 5px 8px; font-size: var(--z-fs-md); border-radius: var(--z-radius-xs); }
.st-gs-legend li.is-on { background: var(--z-surface-3); }
.st-gs-legend li:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 1px; }
.st-gs-dot { width: 12px; height: 12px; border-radius: 4px; }
.st-gs-name { font-weight: 800; }
.st-gs-name small { font-weight: 400; color: var(--z-muted); }
.st-gs-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.st-gs-pct { text-align: right; color: var(--z-muted); font-variant-numeric: tabular-nums; }
.st-gs--empty .st-gs-legend li, .st-gs--few .st-gs-legend li { color: var(--z-muted); }
.st-gs--empty .st-gs-dot, .st-gs--few .st-gs-dot { background: var(--z-surface-3); }
@media (prefers-reduced-motion: reduce) { .st-gs-seg { transition: none; } }

/* Rivales y parejas (fases 5 y 6): tarjeta lima de cifras y empate en la racha. */
.st-kpi-tile--lime { color: var(--z-ink); background: var(--z-lime); border-color: var(--z-lime); }
.st-kpi-tile--lime span, .st-kpi-tile--lime small { color: var(--z-ink); }
.st-pip--d { color: var(--z-ink); background: #C9CBC4; }

/* Advertencias (fase 7): cifra ámbar y barras «Por motivo». */
.st-kpi-tile--warn b { color: var(--z-warning); }
.st-bars--warn .st-meter span { background: var(--z-warning); }
.st-bars--warn .st-bar-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 2ch; }
.st-bars--warn .st-bar-row em { text-align: right; font-style: normal; font-weight: 800; }
.st-kpi-row--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .st-kpi-row--five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-card > .st-warn-list { margin-top: 14px; }

/* Fase 4 · Comprender: balance de Equipo con forma y racha, bloque Liga, actualización SNP y «Mis estadísticas». */
.st-balance-rate { display: flex; flex-direction: column; align-items: flex-end; }
.st-balance-rate span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.st-balance-track { display: flex; }
.st-balance-track span { flex: none; }
.st-balance-track .st-balance-track-draw { background: rgba(10, 10, 10, .45); border-radius: 0; }
.st-balance-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.st-balance-form .st-form { margin: 0; gap: 6px; }
.st-balance-form-label, .st-balance-streak { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.st-balance-streak { margin-left: auto; }
.st-balance .st-pip { width: 30px; height: 30px; font-size: var(--z-fs-sm); }
.st-balance .st-pip--w { color: var(--z-lime); background: var(--z-ink); }
.st-balance .st-pip--l { color: var(--z-ink); background: rgba(10, 10, 10, .16); }
.st-balance .st-pip--d { color: var(--z-ink); background: rgba(255, 255, 255, .55); }
.st-missing { margin-top: 12px; font-size: var(--z-fs-sm); }
.st-missing summary { cursor: pointer; font-weight: 700; }
.st-missing ul { margin: 8px 0 0; padding: 0; list-style: none; }
.st-missing li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--st-line); }
.st-missing small { color: var(--st-muted); }
.st-snp-updated { margin: 8px 0 0; font-size: var(--z-fs-sm); color: var(--st-muted); }
.st-snp-updated.is-stale { color: var(--z-warning); font-weight: 700; }
.z-space-kpis--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 575.98px) { .z-space-kpis--four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-balance-streak { margin-left: 0; } }
.z-space-rows li.z-comp-frame .z-space-rows-calls { grid-column: 1; display: flex; align-items: baseline; gap: 6px; font-size: var(--z-fs-sm); }
.z-space-rows-calls small { color: var(--st-muted); }
.st-hero-updated { font-weight: 700; }
.st-hero-updated.is-stale { color: var(--z-ink); text-decoration: underline wavy; }
.st-hero-caps { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 575.98px) { .z-set-row { grid-template-columns: minmax(7rem, 9rem) 1fr auto; gap: 8px; } .z-set-row em { min-width: 3.4rem; font-size: var(--z-fs-md, 1rem); } }

/* Fase 5 · Tabla de plantilla (Equipo y entrada de Jugadores) y secciones plegables de «Profundizar». */
.st-roster-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.st-roster-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-roster-table small { margin-left: 4px; font-size: var(--z-fs-xs); color: var(--st-muted); }
.st-roster-table b { font-family: var(--z-display); font-size: var(--z-fs-lg); font-weight: 400; color: var(--z-lime); }
.st-roster-table thead a { color: inherit; text-decoration: none; }
.st-roster-table thead th[aria-sort="descending"] a, .st-roster-table thead th[aria-sort="ascending"] a { color: var(--z-lime); }
.st-roster-table thead th[aria-sort="descending"] a::after { content: " ▼"; font-size: .7em; }
.st-roster-table thead th[aria-sort="ascending"] a::after { content: " ▲"; font-size: .7em; }
.st-roster-low th, .st-roster-low td, .st-roster-low b { opacity: .55; }
@media (max-width: 575.98px) {
  .st-roster-table th, .st-roster-table td { padding: 10px 5px; font-size: var(--z-fs-sm); }
  .st-roster-table small { display: none; }
}
.st-fold { margin-bottom: 10px; background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius-lg); }
.st-fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 14px 18px; font-weight: 700; cursor: pointer; }
.st-fold > summary small { font-weight: 400; color: var(--st-muted); }
.st-fold > .st-card { margin: 0; border: 0; border-top: 1px solid var(--st-line); border-radius: 0 0 var(--z-radius-lg) var(--z-radius-lg); }
@media (max-width: 575.98px) {
  /* En móvil cabe sin deslizar: el V-D se pierde (los jugados y el % ya lo dicen) y el nombre puede partirse. */
  .st-roster-vd { display: none; }
  .st-roster-table tbody th { max-width: 6.8rem; white-space: normal; line-height: 1.2; }
}
.st-roster-evo { white-space: nowrap; }
.st-roster-table .st-roster-evo b { font-family: inherit; font-size: inherit; font-weight: 800; }
.st-roster-table .st-roster-evo b.st-up { color: var(--st-win); }
.st-roster-table .st-roster-evo b.st-down { color: var(--st-loss); }

/* Fase 6 · comparar: Local y visitante común, tabla de sets de «Mis estadísticas», compañeros y convocatorias. */
.st-venue-split { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.st-partners td, .st-partners th { white-space: nowrap; }
.st-partner-tag { margin-left: 6px; padding: 1px 8px; font-size: var(--z-fs-xs); font-weight: 800; border-radius: 999px; }
.st-partner-tag--best { color: #151515; background: var(--z-lime); }
.st-partner-tag--worst { color: #FFFFFF; background: var(--z-danger, #FF5C63); }
.z-commit-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.z-commit-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 12px; }
.z-commit-list b { font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; color: #FFFFFF; }
.z-commit-list.z-venue-notes small { min-width: 0; }
/* «Local y visitante» de Mis estadísticas: si la tarjeta se estira a la altura de su vecina, el gráfico crece y centra las barras y el balance queda abajo, sin hueco vacío. */
.st-card--venue-mine { display: flex; flex-direction: column; }
.st-card--venue-mine .st-chart--mine { flex: 1 1 220px; min-height: 220px; height: auto; width: 100%; }
.st-card--venue-mine .z-venue-notes { margin-top: 16px; }
/* «% de victorias por temporada» de Mis estadísticas: si la tarjeta se estira, el gráfico crece y las barras quedan centradas también en vertical. */
.st-card--years-mine { display: flex; flex-direction: column; }
.st-card--years-mine .st-chart--mine { flex: 1 1 220px; min-height: 220px; height: auto; width: 100%; }
.z-commit-list.z-venue-notes li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.z-commit-list.z-venue-notes small { text-align: right; }
.z-commit-list small { min-width: 3.4rem; text-align: right; color: var(--st-muted); }

/* Fase 7 · ficha de rival: resumen en una línea. */
.st-rival-line { margin-bottom: 16px; }
.st-rival-line p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 0; padding: 14px 18px; background: var(--st-card); border: 1px solid var(--st-line); border-radius: var(--z-radius-lg); }
.st-rival-line b { font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; color: #FFFFFF; }
.st-subtitle-sm { margin: 14px 0 4px; font-size: var(--z-fs-sm); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--st-muted); }
.st-rival-line .st-score { display: inline; margin-left: 6px; font-weight: 700; color: #FFFFFF; }

/* Fase 8 · resumen junto al título de una sección plegada (solo móvil). */
.st-section-summary { display: none; }
@media (max-width: 767.98px) {
    .st-section-summary { display: inline; margin: 0 auto 0 10px; font-family: var(--z-body, inherit); font-size: var(--z-fs-xs); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--st-muted); }
    .st-section.is-open .st-section-summary { display: none; }
}

/* Fase 8: el globo del tooltip «i» no ocupa sitio mientras está cerrado y la insignia «Solo SNP» no pisa el título. */
.z-tip:not(:hover):not(:focus-visible):not(.is-open)::after { display: none; }
.st-card:has(> .st-only) > .st-card-title { padding-right: 5.5rem; }
@media (max-width: 640px) {
  /* El globo ocupa el ancho de la pantalla (con 16 px de margen) bajo el «i»; su posición vertical la fija stats-tips.js. */
  .z-tip::after { position: fixed; left: 16px; right: 16px; bottom: auto; top: var(--tip-y, 50%); width: auto; max-width: none; transform: none; font: 400 var(--z-fs-sm)/1.4 var(--z-body); }
  .st-chart--points { height: 150px; }
  .st-balance { padding: 14px; }
}
@media (max-width: 640px) {
  .st-balance-main { flex-wrap: wrap; gap: 8px 14px; }
  .st-balance-nums { gap: 6px 18px; }
  .st-balance-nums b { font-size: 2.4rem; }
  .st-balance-pct { font-size: 2.2rem; }
  .st-balance-rate { align-items: flex-start; }
}

/* Fase 9 · Enfrentamientos: aviso de pendientes, cerrados en una línea y títulos de grupo a todo el ancho. */
.z-fixtures-head { grid-column: 1 / -1; }
.z-fixtures > .z-fixture.z-fixture--closed { grid-column: 1 / -1; grid-template-columns: 56px minmax(0, 1fr) auto 20px; grid-template-areas: none; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--z-border); }
.z-closed-date { display: flex; flex-direction: column; align-items: center; font: 400 1.15rem/1 var(--z-display); text-transform: uppercase; color: var(--z-text); }
.z-closed-date small { margin-top: 2px; font: 800 .62rem var(--z-body); letter-spacing: .06em; color: var(--z-muted); }
.z-closed-main { display: grid; gap: 4px; min-width: 0; }
.z-closed-rival { overflow: hidden; font-size: var(--z-fs-md); font-weight: 800; color: #FFFFFF; text-overflow: ellipsis; white-space: nowrap; }
.z-closed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.z-closed-result { display: inline-flex; align-items: center; gap: 8px; }
.z-closed-score { font: 400 1.5rem/1 var(--z-display); color: var(--z-text); white-space: nowrap; }
.z-fixture--closed.is-win .z-closed-score { color: var(--z-lime); }
.z-fixture--closed.is-loss .z-closed-score { color: var(--z-danger); }
.z-closed-open { color: var(--z-muted); text-decoration: none; }
@media (max-width: 575.98px) {
  .z-fixtures > .z-fixture.z-fixture--closed { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; }
  .z-closed-open { position: absolute; inset: 0; font-size: 0; }
}
.z-rival-history { margin: 0 0 16px; }
.z-rival-history a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--z-fs-sm); font-weight: 800; color: var(--z-lime); text-decoration: none; }

/* Listado de enfrentamientos: aviso del horizonte y enlace al calendario completo */
/* Resumen de lo programado más adelante: una franja con los meses y el acceso al calendario completo */
.z-ahead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; padding: 12px 16px; background: var(--z-surface-2); border: 1px dashed var(--z-border-control); border-radius: var(--z-radius); }
.z-ahead-main { display: grid; gap: 6px; min-width: 0; }
.z-ahead h2 { margin: 0; font-family: inherit; font-size: var(--z-fs-md); font-weight: 800; letter-spacing: 0; text-transform: none; }
.z-ahead h2 i { margin-right: 6px; color: var(--z-lime); }
.z-ahead-months { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; color: var(--z-muted); font-size: var(--z-fs-sm); }
.z-ahead-months b { color: var(--z-text); }
.z-horizon { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin: 16px 0; color: var(--z-muted); font-size: var(--z-fs-sm); text-align: center; }
.z-horizon a { font-weight: 800; }

/* «Pendiente»: con JS las páginas se apilan en la misma celda, así la tarjeta mide siempre lo de la más alta y el selector queda anclado abajo */
[data-pending-pages].is-paged { display: grid; grid-template-rows: 1fr auto; }
[data-pending-pages].is-paged > [data-pending-page] { grid-area: 1 / 1; }
[data-pending-pages].is-paged > [data-pending-page].is-inactive { visibility: hidden; pointer-events: none; }
[data-pending-pages].is-paged > .z-pending-picker { grid-area: 2 / 1; align-self: end; }

/* ==== Ficha del enfrentamiento (vista «previa») ====
   Un solo bloque, dentro de las capas del sistema de diseño. Escenario de carbono con foco que sigue
   al puntero (js/stage-light.js), escudos extruidos en 3D, tarjeta de datos sobre el VS, lista en filas
   (js/stage-list.js) y tarjetas de acción con relieve. Los colores del escenario son tokens --z-stage-*. */
@layer tokens {
    :root {
        --z-stage-floor-a: #1F2811;
        --z-stage-floor-b: #0D0F0A;
        --z-stage-edge: #2B2E26;
        --z-stage-card-a: #20231B;
        --z-stage-card-b: #131510;
        --z-stage-card-hover-a: #2A2E22;
        --z-stage-card-hover-b: #171912;
        --z-stage-card-border: #30332A;
        --z-stage-card-bevel: #4A4E40;
        --z-stage-drop: #070806;
        --z-stage-next-a: #33290F;
        --z-stage-next-b: #1B1608;
        --z-stage-next-hover-a: #44361A;
        --z-stage-next-hover-b: #221B0A;
        --z-stage-steel: #BECDE1;
        --z-stage-touch: 44px;
        --z-stage-court: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' fill='none' stroke='%23FFFFFF' stroke-opacity='.2' stroke-width='1.2'%3E%3Crect x='4' y='4' width='192' height='92'/%3E%3Cpath d='M100 4V96M31 4V96M169 4V96M31 50H169'/%3E%3C/svg%3E");
    }
}
@layer screens {
    /* Escenario */
    .z-versus--stage {
        --lx: 0; --ly: 0;
        position: relative;
        perspective: 1400px;
        background:
            linear-gradient(90deg, transparent 6%, rgba(var(--z-lime-rgb), .7) 50%, transparent 94%) top / 100% 1px no-repeat,
            radial-gradient(520px 320px at calc(50% + var(--lx) * 30%) calc(0% + var(--ly) * 12%), rgba(var(--z-lime-rgb), .13), transparent 70%),
            linear-gradient(115deg, transparent 46%, rgba(var(--z-lime-rgb), .05) 46% 54%, transparent 54%),
            repeating-linear-gradient(45deg, rgba(255, 255, 255, .022) 0 2px, transparent 2px 4px),
            repeating-linear-gradient(-45deg, rgba(0, 0, 0, .35) 0 2px, transparent 2px 4px),
            radial-gradient(ellipse at 50% 125%, var(--z-stage-floor-a), var(--z-stage-floor-b) 62%);
        border: 1px solid var(--z-stage-edge);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -40px 60px -30px rgba(var(--z-lime-rgb), .10), inset 0 0 0 1px rgba(0, 0, 0, .6), 0 24px 50px -24px rgba(0, 0, 0, .9);
    }
    /* La pista: plano inclinado con las líneas del pádel (::before) y, encima, la red como divisor entre
       local y visitante con un filo de luz arriba (::after). Los hijos van por encima (z-index 1). */
    .z-versus--stage > * { z-index: 1; }
    .z-versus--stage::before { content: ""; position: absolute; top: auto; left: -12%; right: -12%; bottom: -10%; aspect-ratio: 2 / 1; display: block; pointer-events: none; z-index: 0; background: var(--z-stage-court) center / 100% 100% no-repeat, radial-gradient(ellipse at 50% 60%, rgba(var(--z-lime-rgb), .16), transparent 70%); transform-origin: 50% 100%; transform: perspective(520px) rotateX(58deg); -webkit-mask-image: linear-gradient(to top, #000 45%, transparent); mask-image: linear-gradient(to top, #000 45%, transparent); }
    /* La red: el filo de luz de arriba va en el fondo del escenario. La línea vertical nace justo debajo de lo último
       que hay en el centro («Estás convocado…» o «Por convocar») y baja hasta el borde inferior, sin cruzar el VS. */
    .z-versus--stage::after { content: ""; position: absolute; grid-column: 1 / -1; grid-row: 3 / span 3; top: 0; bottom: 0; left: calc(50% - 1.5px); width: 3px; pointer-events: none; z-index: 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .45) 35%, rgba(255, 255, 255, .45)); }
    /* Alineación local/visitante: cada equipo ocupa tres filas de la rejilla del escenario (escudo, nombre,
       cinta de rol) y las comparte con el otro mediante subgrid, así que la fila de cada pieza mide lo que
       mida la más alta de las dos (nombre de 1 o 3 líneas, rol en 1 o 2 líneas) y escudos, nombres y
       cintas quedan a la misma altura en cualquier combinación. */
    .z-versus--stage .z-versus-team,
    .z-versus--stage .z-versus-team:last-child { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; justify-items: center; text-align: center; min-width: 0; }
    .z-versus--stage .z-crest-scene { align-self: center; margin-bottom: 10px; }
    .z-versus--stage .z-versus-name { display: grid; grid-template-rows: subgrid; grid-row: span 2; justify-items: stretch; align-items: end; text-align: center; min-width: 0; text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 18px rgba(0, 0, 0, .8); }
    /* «Local» y «Visitante» como cinta bajo el nombre: lima el local, acero el visitante */
    .z-versus--stage .z-versus-name small { display: flex; align-items: center; justify-content: center; align-self: stretch; justify-self: center; box-sizing: border-box; max-width: 100%; margin: 8px 0 0; padding: 3px 12px; font-size: var(--z-fs-xs); color: var(--z-text); background: rgba(0, 0, 0, .4); border-top: 2px solid var(--z-lime); text-shadow: none; }
    .z-versus--stage .z-versus-team:nth-child(4) .z-versus-name small { border-top-color: var(--z-stage-steel); }
    .z-versus--stage .z-versus-vs { color: var(--z-lime); }
    .z-versus--stage .z-versus-vs.is-loss { color: var(--z-danger); }
    .z-versus--stage .z-versus-vs.is-draw { color: #FFFFFF; }
    .z-versus--stage .z-versus-mid { grid-column: 1 / -1; grid-row: 2; }
    .z-versus--stage > .z-versus-team:nth-child(2) { grid-column: 1; grid-row: 3 / span 3; }
    .z-versus--stage > .z-versus-team:nth-child(4) { grid-column: 2; grid-row: 3 / span 3; }
    .z-ficha-top.z-ficha-top--stage { grid-template-columns: minmax(0, 1fr); }
    @media (min-width: 768px) {
        .z-versus--stage { grid-template-columns: minmax(0, 1fr) minmax(150px, 260px) minmax(0, 1fr); aspect-ratio: auto; padding: 22px 4% 34px; align-items: center; }
        .z-versus--stage .z-versus-mid { position: static; transform: none; padding: 0; background: none; display: grid; justify-items: center; grid-column: 2; }
        .z-versus--stage .z-versus-mid { grid-row: 2 / span 3; align-self: stretch; display: flex; flex-direction: column; align-items: center; }
        .z-versus--stage .z-versus-mid::before, .z-versus--stage .z-versus-mid::after { content: ""; flex: 1 1 0; min-height: 0; }
        .z-versus--stage .z-versus-mid::after { flex-grow: 1; width: 3px; margin-bottom: -34px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .45) 35%, rgba(255, 255, 255, .45)); }
        .z-versus--stage::after { display: none; }
        .z-versus--stage > .z-versus-team:nth-child(2) { grid-column: 1; grid-row: 2 / span 3; }
        .z-versus--stage > .z-versus-team:nth-child(4) { grid-column: 3; grid-row: 2 / span 3; }
        .z-versus--stage .z-versus-team:first-child, .z-versus--stage .z-versus-team:last-child { padding: 0; }
    }
    @media (min-width: 768px) and (max-width: 991px) {
        .z-versus--stage .z-crest-scene { --crest: clamp(120px, 23cqi, 190px); }
    }

    /* Línea de datos sobre los escudos */
    .z-stage-kicker { grid-column: 1 / -1; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--z-muted); }
    .z-stage-kicker p { margin: 0; }
    .z-stage-kind { display: flex; align-items: center; gap: 6px; }
    .z-stage-kind b { color: var(--z-lime); font-weight: 800; }
    .z-stage-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: var(--z-fs-sm); letter-spacing: .02em; text-transform: none; }
    .z-stage-date, .z-stage-when .z-location { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; color: inherit; background: rgba(0, 0, 0, .35); border: 1px solid var(--z-border-strong); border-radius: 999px; }
    .z-stage-when .z-location { text-decoration: none; }
    .z-stage-when .z-location:hover { border-color: var(--z-lime); }
    .z-stage-date .z-edit-date { margin-inline: 2px -8px; }
    .z-stage-when .z-edit-date, .z-stage-back { color: inherit; display: inline-flex; align-items: center; justify-content: center; min-width: var(--z-stage-touch); min-height: var(--z-stage-touch); margin-block: calc((var(--z-stage-touch) - 1.4em) / -2); }
    .z-stage-back { margin-inline: -12px 0; }
    .z-stage-sub { display: table; margin: 4px auto 0; padding: 2px 10px; background: rgba(13, 15, 10, .75); border-radius: 999px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--z-muted); text-align: center; }
    .z-stage-sub.is-win { color: var(--z-lime); }
    .z-stage-sub.is-loss { color: var(--z-danger); }
    .z-stage-count { display: inline-block; margin-top: 8px; padding: 4px 12px; font-size: var(--z-fs-sm); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--z-text); background: rgba(0, 0, 0, .45); border: 1px solid var(--z-border-strong); border-radius: 999px; }
    .z-stage-me { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 5px 12px; font-size: var(--z-fs-sm); font-weight: 700; color: var(--z-text); background: rgba(0, 0, 0, .35); border: 1px solid var(--z-border-strong); border-radius: 999px; }
    .z-stage-me.is-in { color: var(--z-lime); border-color: rgba(var(--z-lime-rgb), .5); }
    .z-stage-me.is-out { color: var(--z-warning); border-color: color-mix(in srgb, var(--z-warning) 50%, transparent); }
    .z-stage-me.is-missed { color: var(--z-danger); border-color: color-mix(in srgb, var(--z-danger) 50%, transparent); }
    .z-stage-me.is-warn { color: var(--z-warning); border-color: color-mix(in srgb, var(--z-warning) 50%, transparent); flex-wrap: wrap; }
    .z-stage-me a { color: var(--z-text); font-weight: 800; text-decoration: underline; }
    .z-closed-actions { justify-content: center; margin-top: 14px; }

    /* Escudos 3D */
    .z-crest-scene { --crest: clamp(120px, 40cqi, 260px); position: relative; display: block; width: var(--crest); height: var(--crest); perspective: 900px; transform: translate3d(calc(var(--lx, 0) * -6px), calc(var(--ly, 0) * -4px), 0) rotateX(calc(var(--ly, 0) * -6deg)) rotateY(calc(var(--lx, 0) * 8deg)); transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
    .z-crest-scene::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -14px; height: 18px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .75), transparent); filter: blur(3px); pointer-events: none; }
    .z-versus--stage .z-versus-team:nth-child(2) .z-crest-scene { filter: drop-shadow(0 0 22px rgba(var(--z-lime-rgb), .28)); }
    .z-versus--stage .z-versus-team:nth-child(4) .z-crest-scene { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--z-stage-steel) 22%, transparent)); }
    .z-crest { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; animation: z-crest-spin 26s linear infinite; }
    .z-crest--visiting { animation-direction: reverse; }
    .z-crest-layer { position: absolute; inset: 0; display: grid; place-items: center; }
    .z-crest-layer svg { width: 92%; height: 92%; object-fit: contain; overflow: visible; }
    /* Las fotos de escudo dejan un margen para que un logo recortado al borde no parezca un bloque. */
    .z-crest-layer img { width: 92%; height: 92%; object-fit: contain; }
    /* Canto continuo de dorso a cara (±5,4px entre dorso -6px y cara +6px), sin huecos entre capas. */
    .z-crest-edge { --step: 1.2px; transform: translateZ(calc((var(--i) - 4.5) * var(--step))); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
    /* Mitad cercana al dorso: girada 180° como el dorso, para no mostrar desde atrás un logo sin reflejar (cresta doble «en espejo»). */
    .z-crest-edge.is-back { transform: rotateY(180deg) translateZ(calc((4.5 - var(--i)) * var(--step))); }
    .z-crest-edge path { fill: #9FA39A; }
    .z-versus--stage .z-versus-team:nth-child(4) .z-crest-edge path { fill: #8FA0B5; }
    /* Canto de foto: el mismo logo oscurecido (lima oscuro en el de Zyra), no una silueta gris que ensucia. */
    .z-crest-edge.is-photo { filter: brightness(.55) saturate(1.1); }
    .z-crest-scene.is-loading { opacity: 0; }
    .z-crest-scene.is-loaded { transition: opacity .5s ease; }
    .z-crest.is-paused { animation-play-state: paused; }
    .z-crest-front { transform: translateZ(6px); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
    /* Con backface-visibility oculta, el dorso no asoma por los huecos entre piezas de logos fragmentados. */
    .z-crest-back { transform: rotateY(180deg) translateZ(6px); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
    /* Escudo de reserva (equipo sin foto): tono propio derivado del nombre, siglas en blanco */
    .z-crest-shield { fill: hsl(var(--h, 90) 24% 22%); stroke: hsl(var(--h, 90) 30% 72%); stroke-width: 3; }
    .z-crest-initials { font: 400 34px var(--z-display); fill: #FFFFFF; }
    @keyframes z-crest-spin { to { transform: rotateY(360deg); } }
    @keyframes z-stage-rise { from { opacity: 0; transform: translateY(18px) scale(.96); } }
    @keyframes z-stage-fade { from { opacity: 0; } }
    @keyframes z-crest-in { from { opacity: 0; transform: translateY(-26px) scale(.82); } }

    /* Tarjeta de datos sobre el VS: lista en filas, sin caja */
    .z-stage-card { display: flex; flex: 1; flex-direction: column; min-height: 0; width: 100%; margin: 0; padding: 0; text-align: left; }
    .z-stage-card h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 2px solid var(--z-warning); font: 400 1rem var(--z-display); letter-spacing: .06em; text-transform: uppercase; color: #FFFFFF; }
    .z-stage-card.is-called h2, .z-stage-card.is-pairs h2 { border-bottom-color: var(--z-lime); }
    /* Con parejas, el título repetiría el de la tarjeta enfocada: solo para lectores de pantalla */
    .z-stage-card.is-pairs h2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
    .z-stage-card h2 span { font: 600 var(--z-fs-xs) var(--z-body); letter-spacing: 0; text-transform: none; color: var(--z-muted); }
    .z-stage-list, .z-stage-card ul.z-stage-list { display: block; max-height: 19rem; overflow-y: auto; margin: 0; padding: 0; list-style: none; font-size: 1.05rem; }
    .z-stage-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 9px 2px; border-bottom: 1px solid var(--z-border); color: var(--z-text); overflow-wrap: anywhere; }
    .z-stage-list li[hidden] { display: none; }
    .z-stage-list li.is-me { color: var(--z-lime); font-weight: 800; }
    .z-stage-list li em { padding: 0; font-style: normal; font-size: var(--z-fs-xs); letter-spacing: .08em; color: var(--z-muted); }
    .z-stage-card ol.z-stage-list li { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); align-items: center; justify-content: start; gap: 12px; min-height: 58px; padding: 6px 2px; }
    .z-stage-card ol.z-stage-list li > span { color: var(--z-muted); white-space: nowrap; }
    .z-stage-card ol.z-stage-list li > strong { text-align: left; font-weight: 700; line-height: 1.25; }
    .z-stage-card ol.z-stage-list li.is-me > strong, .z-stage-card ol.z-stage-list li.is-me > span { color: var(--z-lime); }
    .z-stage-card .is-win { color: var(--z-lime); }
    .z-stage-card .is-loss { color: var(--z-danger); }
    .z-stage-names { margin: 0; font-size: var(--z-fs-md, 1rem); line-height: 1.7; color: var(--z-text); }
    .z-stage-names i { font-style: normal; color: var(--z-muted); }
    .z-stage-names em { font-style: normal; font-size: .8em; color: var(--z-muted); }
    .z-stage-names .is-me { color: var(--z-lime); font-weight: 800; }

    /* Tarjetas de acción: lista ordenada de fases */
    .z-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
    .z-menu--short { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    @media (min-width: 992px) { .z-menu { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
    @media (min-width: 992px) { .z-menu--short:not(.has-focus) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    @media (max-width: 991.98px) { .z-menu:not(.has-focus) > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
    .z-menu > li { display: grid; min-width: 0; }
    .z-menu > li > form, .z-menu > li > .z-more { display: grid; min-width: 0; }
    .z-menu button.z-menu-card { width: 100%; font: inherit; color: var(--z-text); text-align: left; cursor: pointer; }
    .z-menu .z-more { grid-template-rows: minmax(0, 1fr); }
    .z-menu .z-more summary.z-menu-card { height: 100%; list-style: none; }
    .z-menu-card { position: relative; box-sizing: border-box; display: grid; align-content: space-between; gap: 10px; min-height: 150px; padding: 18px; overflow: hidden; color: var(--z-text); text-decoration: none; background: linear-gradient(180deg, var(--z-stage-card-a), var(--z-stage-card-b)); border: 1px solid var(--z-stage-card-border); border-top-color: var(--z-stage-card-bevel); border-radius: var(--z-radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 0 -2px var(--z-stage-drop), 0 12px 20px -10px rgba(0, 0, 0, .9); transition: transform .16s cubic-bezier(.2, .7, .2, 1), box-shadow .16s, background .2s; }
    .z-menu-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .09) 50%, transparent 65%); transform: translateX(-120%); transition: transform .6s ease; }
    .z-menu-card b { font-size: var(--z-fs-base); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
    .z-menu-card small { font-size: var(--z-fs-sm); color: var(--z-muted); }
    .z-menu-ic { font-size: 1.7rem; line-height: 1; color: var(--z-muted); }
    .z-menu-card.is-done { border-top-color: var(--z-lime); box-shadow: inset 0 1px 0 rgba(var(--z-lime-rgb), .35), 0 6px 0 -2px var(--z-stage-drop), 0 12px 20px -10px rgba(0, 0, 0, .9); }
    .z-menu-card.is-done .z-menu-ic { color: var(--z-lime); }
    .z-menu-card.is-next { background: linear-gradient(180deg, var(--z-stage-next-a), var(--z-stage-next-b)); border-top-color: var(--z-warning); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--z-warning) 45%, transparent), 0 0 24px -6px color-mix(in srgb, var(--z-warning) 35%, transparent), 0 6px 0 -2px var(--z-stage-drop), 0 12px 20px -10px rgba(0, 0, 0, .9); }
    .z-menu-card.is-next .z-menu-ic { color: var(--z-warning); }
    /* Fase aún no disponible: sin relieve, sin hover y con candado */
    .z-menu-card.is-locked { cursor: not-allowed; background: transparent; border-style: dashed; border-color: var(--z-border-strong); box-shadow: none; }
    .z-menu-card.is-locked b, .z-menu-card.is-locked small, .z-menu-card.is-locked .z-menu-ic { color: var(--z-muted); }
    a.z-menu-card:hover, button.z-menu-card:not(:disabled):hover, .z-menu summary.z-menu-card:hover { transform: translateY(-3px); background: linear-gradient(180deg, var(--z-stage-card-hover-a), var(--z-stage-card-hover-b)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 9px 0 -2px var(--z-stage-drop), 0 18px 26px -10px rgba(0, 0, 0, .95); }
    .z-menu-card.is-next:hover { background: linear-gradient(180deg, var(--z-stage-next-hover-a), var(--z-stage-next-hover-b)); }
    a.z-menu-card:hover::after, button.z-menu-card:not(:disabled):hover::after, .z-menu summary.z-menu-card:hover::after { transform: translateX(120%); }
    a.z-menu-card:active, button.z-menu-card:not(:disabled):active, .z-menu summary.z-menu-card:active { transform: translateY(3px); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 2px 0 -2px var(--z-stage-drop); }
    .z-menu-card:focus-visible, .z-menu summary.z-menu-card:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 3px; }
    .z-menu button.z-menu-card:disabled { opacity: .55; filter: saturate(.4); cursor: not-allowed; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
    .z-menu-hint { margin: -4px 0 14px; }
    .z-menu-hint .z-next-hint { margin: 0; }

    /* Tarjeta enfocada: la fase con lista ocupa el doble (2 columnas y 2 filas) y la lleva dentro; las demás fases
       se reparten a su lado. En móvil y tablet ocupa todo el ancho y las demás van debajo. */
    .z-menu.has-focus { grid-auto-rows: minmax(150px, auto); }
    .z-menu.has-focus > li.is-focus { grid-column: 1 / -1; order: -1; }
    @media (min-width: 992px) {
        .z-menu.has-focus, .z-menu.z-menu--short.has-focus { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .z-menu.has-focus > li.is-focus { grid-column: 1 / 3; grid-row: 1 / 3; }
        .z-menu.has-focus > li.z-menu-link { grid-column: 3 / 5; grid-row: 2; }
    }
    /* «¿Puedes jugar?» sin jugador enlazado: ocupa el hueco bajo «Acta» (visible sin desplazarse) */
    .z-menu > li.z-menu-link { grid-column: 1 / -1; }
    .z-menu > li.z-menu-link .z-av-me { margin: 0; }
    .z-menu-focus { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px; background: linear-gradient(180deg, var(--z-stage-card-a), var(--z-stage-card-b)); border: 1px solid var(--z-stage-card-border); border-top: 3px solid var(--z-stage-card-bevel); border-radius: var(--z-radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 0 -2px var(--z-stage-drop), 0 12px 20px -10px rgba(0, 0, 0, .9); }
    .z-menu-focus:has(> .z-menu-card.is-done, > form > .z-menu-card.is-done) { border-top-color: var(--z-lime); }
    .z-menu-focus:has(> .z-menu-card.is-next, > form > .z-menu-card.is-next) { border-top-color: var(--z-warning); }
    .z-menu-focus > .z-menu-card, .z-menu-focus > form > .z-menu-card { min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; grid-template-columns: auto 1fr; grid-template-areas: "ic title" "ic sub"; align-content: start; align-items: center; column-gap: 14px; row-gap: 2px; }
    .z-menu-focus { position: relative; }
    .z-menu-share { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.35rem; color: var(--z-ink, #0A0A0A); background: var(--z-lime); text-decoration: none; transition: transform .16s ease, filter .16s; }
    .z-menu-share:hover { filter: brightness(1.08); transform: translateY(-2px); }
    .z-menu-share:focus-visible { outline: 2px solid var(--z-text); outline-offset: 3px; }
    .z-menu-focus .z-menu-ic { grid-area: ic; }
    .z-menu-focus .z-menu-card b { grid-area: title; align-self: end; }
    .z-menu-focus .z-menu-card small { grid-area: sub; align-self: start; }
    .z-menu-focus > form { display: grid; }
    .z-menu-focus .z-menu-card::after { display: none; }
    .z-menu-focus > a.z-menu-card:hover, .z-menu-focus > form > button.z-menu-card:not(:disabled):hover { transform: none; background: none; box-shadow: none; }

    /* Previa «Cara a cara» */
    .z-f2f { padding: 18px; background: linear-gradient(180deg, var(--z-stage-card-a), var(--z-stage-card-b)); border: 1px solid var(--z-stage-card-border); border-top: 3px solid var(--z-lime); border-radius: var(--z-radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 20px -10px rgba(0, 0, 0, .9); }
    .z-f2f .z-h2h-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 14px; }
    .z-f2f .z-h2h-title span { font: 600 var(--z-fs-sm) var(--z-body); letter-spacing: 0; text-transform: none; color: var(--z-muted); }
    .z-f2f-grid { display: grid; gap: 18px; }
    @media (min-width: 768px) { .z-f2f-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
    .z-f2f-main { display: grid; gap: 10px; align-content: start; min-width: 0; }
    .z-f2f .z-h2h-n b { font-size: 2.6rem; }
    .z-f2f .z-h2h-n.is-win b { color: var(--z-lime); }
    .z-f2f .z-h2h-n.is-loss b { color: var(--z-danger); }
    .z-f2f .z-h2h-bar { height: 10px; margin: 0; border-radius: 5px; overflow: hidden; }
    .z-f2f-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding-top: 8px; border-top: 1px solid var(--z-border); font-size: var(--z-fs-sm); color: var(--z-muted); }
    .z-f2f-row b { font-size: 1.05rem; color: var(--z-text); }
    .z-f2f-row em { font-style: normal; }
    .z-f2f-row em.is-win { color: var(--z-lime); }
    .z-f2f-row em.is-loss { color: var(--z-danger); }
    .z-f2f-form { display: inline-flex; gap: 6px; }
    .z-f2f-form i { width: 14px; height: 14px; border-radius: 50%; background: var(--z-muted); }
    .z-f2f-form i.is-win { background: var(--z-lime); }
    .z-f2f-form i.is-loss { background: var(--z-danger); }
    .z-f2f .z-h2h-last { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; align-content: start; }
    .z-f2f .z-h2h-last a { justify-content: stretch; display: grid; justify-items: center; gap: 2px; padding: 12px 8px; text-align: center; color: var(--z-text); text-decoration: none; background: rgba(0, 0, 0, .3); border: 1px solid var(--z-border); border-radius: 12px; transition: border-color .15s, transform .15s; }
    .z-f2f .z-h2h-last a:hover { border-color: var(--z-lime); transform: translateY(-2px); }
    .z-f2f .z-h2h-last a:focus-visible { outline: 2px solid var(--z-lime); outline-offset: 2px; }
    .z-f2f .z-h2h-last small { font-size: var(--z-fs-xs); color: var(--z-muted); }
    .z-f2f .z-h2h-last b { font: 400 2rem/1 var(--z-display); }
    .z-f2f .z-h2h-last span { font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted); }
    .z-f2f .z-h2h-last .is-win { color: var(--z-lime); }
    .z-f2f .z-h2h-last .is-loss { color: var(--z-danger); }
    @media (max-width: 575px) {
        .z-f2f .z-h2h-last { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
        .z-f2f .z-h2h-last a { padding: 10px 4px; }
        .z-f2f .z-h2h-last b { font-size: 1.6rem; }
        .z-f2f .z-h2h-last span { letter-spacing: .04em; }
    }

    /* Acta cerrada: convocatoria y partidos con el lenguaje de la ficha */
    .z-stage-closed { display: grid; gap: 14px; margin-top: 4px; }
    .z-stage-closed .z-section-title { margin: 8px 0 0; font: 400 1rem var(--z-display); letter-spacing: .06em; text-transform: uppercase; color: var(--z-lime); }
    .z-stage-closed .z-call, .z-stage-closed .z-card.z-game { background: linear-gradient(180deg, var(--z-stage-card-a), var(--z-stage-card-b)); border: 1px solid var(--z-stage-card-border); border-top-color: var(--z-stage-card-bevel); border-radius: var(--z-radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 16px -10px rgba(0, 0, 0, .9); }
    .z-stage-closed > .mt-3, .z-stage-closed > div > .mt-3 { display: grid; gap: 12px; margin-top: 0 !important; }
    @media (min-width: 992px) { .z-stage-closed .mt-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
    .z-stage-closed .z-game-row.is-winner.is-own { background: rgba(var(--z-lime-rgb), .08); box-shadow: inset 3px 0 0 var(--z-lime); }
    .z-stage-closed .z-game-row.is-lost { background: rgba(255, 92, 99, .08); box-shadow: inset 3px 0 0 var(--z-danger); }
    .z-stage-closed .z-game-row.is-lost .z-game-side { color: #FFFFFF; }
    .z-stage-closed .z-set { font-size: 1.1rem; }

    /* Previa y primer enfrentamiento bajo las tarjetas */
    .z-first-meeting { padding: 14px; background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius); }
    .z-first-meeting p { margin: 0; color: var(--z-muted); }
    .z-h2h-title { margin: 0 0 6px; font: 400 1rem var(--z-display); letter-spacing: .06em; text-transform: uppercase; color: var(--z-lime); }
    .z-stage-after { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 0 0 14px; }
    .z-stage-after .z-preview { margin: 0; padding: 14px; border: 1px solid var(--z-border); border-radius: var(--z-radius); background: var(--z-surface); }
    .z-stage-after .z-preview-title { margin-bottom: 10px; font: 400 1rem var(--z-display); letter-spacing: .06em; }

    /* Cabecera compacta de las pantallas de convocatoria, parejas y resultados */
    .z-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 14px; margin: 0 0 18px; padding: 12px 16px; background: radial-gradient(420px 160px at 50% 0%, rgba(var(--z-lime-rgb), .12), transparent 70%), linear-gradient(180deg, var(--z-stage-card-a), var(--z-stage-card-b)); border: 1px solid var(--z-stage-card-border); border-radius: var(--z-radius); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 30px -20px rgba(0, 0, 0, .9); }
    .z-strip-back { display: inline-grid; place-items: center; width: var(--z-stage-touch); height: var(--z-stage-touch); color: var(--z-lime); text-decoration: none; border-radius: 50%; border: 1px solid var(--z-stage-card-border); }
    .z-strip-back:hover, .z-strip-back:focus-visible { background: rgba(var(--z-lime-rgb), .12); outline: none; border-color: var(--z-lime); }
    .z-strip-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
    .z-strip-team { display: flex; align-items: center; gap: 10px; min-width: 0; font: 400 clamp(1rem, 3.4vw, 1.5rem)/1.05 var(--z-display); text-transform: uppercase; color: #FFFFFF; }
    .z-strip-team b { font-weight: 400; overflow-wrap: anywhere; }
    .z-strip-team--visiting { justify-content: flex-end; text-align: right; }
    .z-strip-vs { font: 400 1.4rem/1 var(--z-display); color: var(--z-lime); }
    .z-mini-crest { flex: 0 0 auto; display: block; width: 44px; height: 46px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
    .z-mini-crest :is(img, svg) { display: block; width: 100%; height: 100%; object-fit: contain; }
    .z-strip-meta { grid-column: 1 / -1; margin: 0; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted); }
    .z-strip-meta b { color: var(--z-text); }
    @media (max-width: 575px) {
        .z-strip { padding: 10px 12px; }
        .z-strip-teams { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
        .z-strip-team, .z-strip-team--visiting { flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; gap: 4px; }
        .z-strip-team--visiting .z-mini-crest { order: -1; }
        .z-mini-crest { width: 38px; height: 40px; }
    }

    /* Entrada animada y movimiento reducido */
    @media (prefers-reduced-motion: no-preference) {
        .z-versus--stage .z-crest-scene { animation: z-crest-in .8s cubic-bezier(.2, .8, .2, 1) backwards; }
        .z-versus--stage .z-versus-team:nth-child(4) .z-crest-scene { animation-delay: .12s; }
        .z-versus--stage .z-versus-vs { animation: z-stage-rise .7s cubic-bezier(.2, .8, .2, 1) .25s backwards; }
        .z-stage-card { animation: z-stage-rise .6s cubic-bezier(.2, .8, .2, 1) .35s backwards; }
        .z-menu > li { animation: z-stage-fade .5s ease backwards; }
        .z-menu > li:nth-child(2) { animation-delay: .08s; }
        .z-menu > li:nth-child(3) { animation-delay: .16s; }
        .z-menu > li:nth-child(4) { animation-delay: .24s; }
        .z-menu > li:nth-child(5) { animation-delay: .32s; }
    }
    @media (prefers-reduced-motion: reduce), (hover: none) {
        .z-crest { animation: none; transform: rotateY(-20deg); }
        .z-crest-scene { transform: none; transition: none; }
        .z-menu-card, .z-menu-card::after { transition: none; }
        .z-menu-card::after { display: none; }
    }
}
/* ---- Edición de equipo: formulario a la izquierda y escudo 3D oscilante a la derecha (js/team-crest-preview.js) ----
   Reutiliza el escudo y el escenario de la ficha del enfrentamiento; solo cambia el movimiento: oscila sin dar la vuelta. */
@layer screens {
    .z-team-edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .z-team-stage-col { order: -1; min-width: 0; }
    .z-team-edit [data-photo-preview] { display: none; }
    .z-team-edit .z-tip { margin-left: 6px; vertical-align: middle; }
    .z-team-stage { position: relative; display: grid; justify-items: center; align-content: center; padding: 22px 16px 26px; overflow: hidden; perspective: 1400px;
        background:
            radial-gradient(520px 320px at 50% 0%, rgba(var(--z-lime-rgb), .13), transparent 70%),
            linear-gradient(115deg, transparent 46%, rgba(var(--z-lime-rgb), .05) 46% 54%, transparent 54%),
            repeating-linear-gradient(45deg, rgba(255, 255, 255, .022) 0 2px, transparent 2px 4px),
            repeating-linear-gradient(-45deg, rgba(0, 0, 0, .35) 0 2px, transparent 2px 4px),
            radial-gradient(ellipse at 50% 125%, var(--z-stage-floor-a), var(--z-stage-floor-b) 62%);
        border: 1px solid var(--z-stage-edge); border-radius: var(--z-radius-lg);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -40px 60px -30px rgba(var(--z-lime-rgb), .10), 0 24px 50px -24px rgba(0, 0, 0, .9); }
    .z-team-stage::before { content: ""; position: absolute; left: -12%; right: -12%; bottom: -10%; aspect-ratio: 2 / 1; pointer-events: none; background: var(--z-stage-court) center / 100% 100% no-repeat, radial-gradient(ellipse at 50% 60%, rgba(var(--z-lime-rgb), .16), transparent 70%); transform-origin: 50% 100%; transform: perspective(520px) rotateX(58deg); -webkit-mask-image: linear-gradient(to top, #000 45%, transparent); mask-image: linear-gradient(to top, #000 45%, transparent); }
    .z-team-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 6%, rgba(var(--z-lime-rgb), .7) 50%, transparent 94%) top / 100% 1px no-repeat; }
    .z-team-stage > * { position: relative; z-index: 1; }
    .z-team-stage .z-crest-scene { --crest: clamp(150px, 26vw, 250px); margin-bottom: 12px; filter: drop-shadow(0 0 22px rgba(var(--z-lime-rgb), .28)); }
    .z-crest--sway { animation: z-crest-sway 14s ease-in-out infinite; }
    /* Oscila ±55° despacio (14 s por ciclo) alrededor del frente: nunca llega de canto ni enseña el dorso. */
    @keyframes z-crest-sway { 0%, 100% { transform: rotateY(-55deg); } 50% { transform: rotateY(55deg); } }
    .z-team-stage-name { margin: 0; text-align: center; font: 400 clamp(1.5rem, 4vw, 2.2rem)/1.05 var(--z-display); letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0, 0, 0, .6), 0 0 18px rgba(0, 0, 0, .8); overflow-wrap: anywhere; }
    .z-team-stage-role { display: inline-block; margin-top: 10px; padding: 3px 14px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: rgba(0, 0, 0, .4); border-top: 2px solid var(--z-lime); }
    .z-team-stage-role.is-rival { border-top-color: var(--z-stage-steel); }
    .z-team-stage-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
    .z-team-stage-chips span { max-width: 100%; padding: 4px 12px; font-size: var(--z-fs-sm); background: rgba(0, 0, 0, .35); border: 1px solid var(--z-border-strong); border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .z-team-stage-chips span[hidden] { display: none; }
    @media (min-width: 768px) {
        .z-team-edit { grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr); gap: 32px; align-items: start; }
        .z-team-stage-col { order: 0; position: sticky; top: 16px; }
    }
    @media (max-width: 575px) {
        .z-team-stage { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; justify-items: start; align-items: center; padding: 14px; }
        .z-team-stage .z-crest-scene { --crest: 112px; grid-row: 1 / span 3; margin: 0; }
        .z-team-stage-name { text-align: left; font-size: 1.5rem; }
        .z-team-stage-role { margin-top: 6px; }
        .z-team-stage-chips { justify-content: flex-start; margin-top: 8px; }
    }
    /* Con movimiento reducido el escudo queda quieto y ladeado, como en la ficha. */
    @media (prefers-reduced-motion: reduce) { .z-team-stage .z-crest--sway { animation: none; transform: rotateY(-20deg); } }
    .z-crest.z-crest--sway.is-paused { animation-play-state: paused; }
}
/* ---- Enlace de disponibilidad (call/templates/availability.html) ---- */
.z-av { max-width: 480px; }
.z-av-kicker { margin: 0 0 10px; text-align: center; font-size: var(--z-fs-sm); letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted); }
.z-av-vs { display: grid; gap: 6px; text-align: center; }
.z-av-team { font-family: var(--z-display); font-size: var(--z-fs-2xl); line-height: 1.1; text-transform: uppercase; color: var(--z-muted); overflow-wrap: anywhere; }
.z-av-team.is-own { color: var(--z-text); }
.z-av-sep { font-family: var(--z-brand); font-size: var(--z-fs-sm); color: var(--z-lime); }
.z-av-side { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px auto 0; padding: 6px 14px; width: fit-content; border-radius: 999px; font-weight: 800; font-size: var(--z-fs-md); }
.z-av-side.is-home { background: rgba(var(--z-lime-rgb), .16); color: var(--z-lime); }
.z-av-side.is-away { background: var(--z-surface-3); color: var(--z-text); border: 1px solid var(--z-border-strong); }
.z-av-when { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: center; margin-top: 16px; padding: 12px 14px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-av-date { font-weight: 700; text-transform: capitalize; }
.z-av-time { font-family: var(--z-display); font-size: var(--z-fs-2xl); line-height: 1; color: var(--z-lime); }
.z-av-date i, .z-av-time i { margin-right: 6px; color: var(--z-muted); font-size: .8em; }
/* UC-11: sin hora, el texto va con el mismo tamaño que la fecha y apagado, no como titular */
.z-av-time.is-tbc { font-family: inherit; font-size: inherit; font-weight: 700; line-height: inherit; color: var(--z-muted); }
.z-av-place { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px 14px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); color: var(--z-text); text-decoration: none; font-weight: 600; }
.z-av-place span { flex: 1; }
.z-av-place i:first-child { color: var(--z-lime); }
.z-av-place i:last-child { color: var(--z-muted); font-size: .8em; }
.z-av-ask { margin: 22px 0 12px; text-align: center; font-size: var(--z-fs-lg); }
.z-av-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.z-av-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 10px 14px; border: 2px solid var(--z-border-control); border-radius: var(--z-radius-sm); background: var(--z-surface-2); color: var(--z-text); font: inherit; font-weight: 800; font-size: var(--z-fs-lg); cursor: pointer; list-style: none; }
.z-av-btn::-webkit-details-marker { display: none; }
.z-av-btn.is-yes { background: var(--z-lime); border-color: var(--z-lime); color: var(--z-ink); }
.z-av-btn.is-yes:hover { background: var(--z-lime-hover); }
.z-av-btn.is-no { border-color: var(--z-danger); color: var(--z-danger); }
.z-av-btn.is-no:hover { background: rgba(255, 92, 99, .12); }
.z-av-btn.is-maybe:hover { border-color: var(--z-border-control-hover); }
.z-av-maybe { margin-top: 10px; }
.z-av-maybe[open] > .z-av-btn { border-color: var(--z-warning); color: var(--z-warning); }
.z-av-maybe p { margin: 12px 0 8px; }
.z-av-done { margin-top: 20px; padding: 18px; text-align: center; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-av-done-title { margin: 0; font-size: var(--z-fs-xl); font-weight: 800; }
.z-av-done--yes .z-av-done-title i { color: var(--z-lime); }
.z-av-done--no .z-av-done-title i { color: var(--z-danger); }
.z-av-done--maybe .z-av-done-title i { color: var(--z-warning); }
.z-av-done-note { margin: 6px 0 0; color: var(--z-muted); }
.z-av-done-ask { margin: 14px 0 10px; color: var(--z-muted); }
.z-av-back { margin: 12px 0 0; text-align: center; }
.z-auth-card h1.z-av-vs { margin: 0; font-size: inherit; }
.z-av-me { margin-bottom: 18px; }
.z-av-me-now { margin: 0 0 10px; color: var(--z-muted); }
.z-av-choices--3 { grid-template-columns: repeat(3, 1fr); }
.z-av-choices--3 .z-av-btn { font-size: var(--z-fs-base); }
.z-av-btn.is-current { outline: 3px solid var(--z-text); outline-offset: 2px; }
@media (max-width: 480px) { .z-av-choices--3 .z-av-btn { flex-direction: column; gap: 2px; min-height: 64px; } }
.z-av-group + .z-av-group { margin-top: 16px; }
.z-av-group-title { margin: 0 0 6px; font-size: var(--z-fs-md); text-transform: uppercase; letter-spacing: .06em; color: var(--z-muted); }
.z-av-group--yes .z-av-group-title { color: var(--z-lime); }
.z-av-group--no .z-av-group-title { color: var(--z-danger); }
.z-av-group--maybe .z-av-group-title { color: var(--z-warning); }
.z-availability-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.z-availability-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }

/* «¿Puedes jugar?» plegado una vez respondido: se despliega para cambiar la respuesta. */
.z-av-change > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.z-av-change > summary::-webkit-details-marker { display: none; }
.z-av-change-link { color: var(--z-lime, #B4F100); text-decoration: underline; font-weight: 600; }

/* Botones de la tarjeta de disponibilidad: todos en una línea (en pantallas muy estrechas pasan a la siguiente). */
.z-av-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.z-av-actions form { margin: 0; }
.z-av-actions .btn { white-space: nowrap; padding-inline: .6rem; }
@media (max-width: 359px) { .z-av-actions { flex-wrap: wrap; } }

/* «¿Puedes jugar?» + «Disponibilidad» arriba de la ficha: dos columnas en escritorio, apiladas en móvil. */
.z-av-row { margin: 16px 0 18px; }
.z-av-row > section { min-width: 0; }
@media (min-width: 768px) {
    .z-av-row.is-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
}
.z-av-row .z-av-me { margin-bottom: 0; }
.z-av-row .z-panel-title { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.z-av-row > section + section { margin-top: 16px; }
@media (min-width: 768px) { .z-av-row > section + section { margin-top: 0; } }

/* Alta de equipo: selector de competición con el escudo 3D. El formulario va a la izquierda y el escenario a la derecha (arriba en móvil). */
.z-auth-card--stage .z-stage { --stage: var(--z-lime); --stage-rgb: var(--z-lime-rgb); position: relative; display: grid; grid-template-rows: auto 220px auto; margin: 0 0 16px; border: 1px solid var(--z-border); border-radius: var(--z-radius); background: radial-gradient(120% 90% at 70% 20%, rgba(var(--stage-rgb), .28), transparent 60%), linear-gradient(180deg, var(--z-bg-top), var(--z-bg) 75%); transition: background .6s var(--z-ease); }
.z-stage-view { position: relative; grid-row: 2; min-height: 0; overflow: hidden; }
.z-stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.z-stage-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.z-stage-fallback span { font-family: var(--z-display); font-size: 4rem; letter-spacing: .04em; color: var(--stage); }
.z-stage-head { position: relative; grid-row: 1; z-index: 1; padding: 16px 16px 0; text-align: left; }
.z-stage-pill { display: inline-block; padding: 3px 11px; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--z-ink); background: var(--stage); border-radius: 999px; }
.z-stage-pill:empty { display: none; }
.z-auth-card--stage .z-stage .z-stage-name { margin: 6px 0 0; font-family: var(--z-display); font-size: var(--z-fs-2xl); line-height: 1; text-transform: uppercase; letter-spacing: .02em; color: var(--z-text); }
.z-auth-card--stage .z-stage .z-stage-full { margin: 4px 0 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-auth-card--stage .z-stage .z-stage-team { min-height: 1.4em; margin: 6px 0 0; font-weight: 700; color: var(--z-text); overflow-wrap: anywhere; }
.z-stage-facts { grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--z-border); border-top: 1px solid var(--z-border); }
.z-stage-facts[hidden] { display: none; }
.z-stage-facts > div { padding: 10px 12px; background: rgba(20, 21, 18, .86); min-width: 0; }
.z-stage-facts dt { display: block; white-space: nowrap; margin: 0; font-size: var(--z-fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--z-muted); }
.z-stage-facts dd { margin: 4px 0 0; font-family: var(--z-display); font-size: var(--z-fs-xl); line-height: 1.1; color: var(--z-text); }
.z-stage-facts .z-stage-types { font-family: var(--z-body); font-size: var(--z-fs-sm); font-weight: 700; line-height: 1.35; }
.z-comp-list { gap: 10px; background: none; }
.z-comp-card[hidden] { display: none; }
.z-comp-card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; cursor: pointer; text-transform: none; letter-spacing: normal; background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius); transition: transform .25s var(--z-ease), border-color .25s, background .25s; }
.z-comp-card input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.z-comp-card:hover:not(.is-locked):not(.is-unavailable) { border-color: var(--z-border-control-hover); }
.z-comp-card:has(input:focus-visible) { outline: 3px solid var(--z-lime); outline-offset: 2px; }
.z-comp-card:has(input:checked) { border-color: var(--c); background: linear-gradient(90deg, rgba(var(--c-rgb), .22), var(--z-surface-2) 75%); }
.z-comp-mini { display: grid; place-items: center; width: 44px; height: 48px; font-family: var(--z-display); font-size: var(--z-fs-lg); color: var(--z-ink); background: linear-gradient(160deg, rgba(255, 255, 255, .55), var(--c) 45%, rgba(0, 0, 0, .4)); clip-path: polygon(50% 100%, 8% 78%, 8% 8%, 92% 8%, 92% 78%); }
.z-comp-text { display: grid; gap: 2px; min-width: 0; }
.z-comp-text strong { font-family: var(--z-display); font-size: var(--z-fs-xl); font-weight: 400; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; color: var(--z-text); }
.z-comp-text small { font-size: var(--z-fs-sm); color: var(--z-muted); }
.z-comp-text small.z-comp-note[hidden] { display: none; }
.z-comp-go { color: var(--c); opacity: 0; transition: opacity .2s; }
.z-comp-card:has(input:checked) .z-comp-go { opacity: 1; }
.z-comp-card.is-locked, .z-comp-card.is-unavailable { cursor: not-allowed; }
.z-comp-card.is-locked .z-comp-mini, .z-comp-card.is-unavailable .z-comp-mini { --c: var(--z-border-control); }
.z-comp-card.is-locked .z-comp-text strong, .z-comp-card.is-unavailable .z-comp-text strong { color: var(--z-muted); }
.z-role-chip { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 12px; font-weight: 700; color: var(--z-text); background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius-sm); }
.z-role-chip > i { color: var(--z-lime); }
/* Cada paso del registro entra con un deslizamiento suave (la animación se repite cada vez que el paso pasa de oculto a visible). */
@media (prefers-reduced-motion: no-preference) {
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) { animation: z-wizard-in .42s var(--z-ease); }
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) > * { animation: z-wizard-rise .38s var(--z-ease) backwards; }
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) > :nth-child(2) { animation-delay: .06s; }
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) > :nth-child(3) { animation-delay: .11s; }
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) > :nth-child(4) { animation-delay: .16s; }
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) > :nth-child(5) { animation-delay: .21s; }
    .is-wizard.is-stepping [data-wizard-step]:not([hidden]) > :nth-child(n+6) { animation-delay: .26s; }
}
@keyframes z-wizard-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes z-wizard-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* Cabecera del alta: logotipo, título y el «i» de la introducción en una fila. */
.z-auth-card--stage .z-stage-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin: 0 0 16px; }
.z-auth-card--stage .z-stage-header .z-auth-logo { width: 48px; margin: 0; }
.z-auth-card--stage .z-stage-header h1 { margin: 0; }
.z-auth-card--stage .z-stage-header .z-tip { margin: 0; }
@media (min-width: 992px) {
    /* Como el mockup: título arriba, formulario a la izquierda y el escenario 3D grande a la derecha. */
    .z-auth-card--split.z-auth-card--stage { grid-template-columns: minmax(0, 1fr) minmax(420px, 1.1fr); grid-template-areas: "side side" "main stage"; row-gap: 20px; column-gap: 40px; max-width: 1160px; align-items: stretch; }
    .z-auth-card--stage .z-auth-side { grid-area: side; justify-content: flex-start; margin: 0; }
    .z-auth-card--stage .z-auth-side h1 { font-size: var(--z-fs-2xl); text-align: left; }
    .z-auth-card--stage .z-auth-main { grid-area: main; }
    .z-auth-card--stage .z-stage { grid-area: stage; align-self: start; position: sticky; top: 24px; grid-template-rows: auto minmax(320px, 1fr) auto; min-height: 560px; margin: 0; }
    .z-auth-card--stage .z-stage .z-stage-head { padding: 22px 24px 0; }
    .z-auth-card--stage .z-stage .z-stage-name { font-size: clamp(2.4rem, 4.4vw, 3.6rem); }
    .z-auth-card--stage .z-stage-facts > div { padding: 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { .z-comp-card, .z-auth-card--stage .z-stage { transition: none; } }

/* Globos «i» largos de la alta de equipo: más anchos y con aire para que se lean enteros. */
@media (min-width: 641px) {
  .z-stage-header .z-tip::after, .z-role-chip .z-tip::after { width: 340px; max-width: 80vw; line-height: 1.55; padding: 12px 14px; transform: translateX(-50%); }
  .z-stage-header .z-tip::after { top: calc(100% + 8px); bottom: auto; left: 0; transform: none; }
}

/* Sin recorte en la ficha del escudo: los globos «i» de los datos salen de ella y se anclan al borde de su columna. */
.z-stage-facts { border-radius: 0 0 var(--z-radius) var(--z-radius); }
.z-stage-facts > div:nth-child(odd) { border-bottom-left-radius: var(--z-radius); }
.z-stage-facts > div:nth-child(even) { border-bottom-right-radius: var(--z-radius); }
@media (min-width: 641px) {
  .z-stage-facts .z-tip::after { max-width: 230px; transform: none; left: 0; }
  .z-stage-facts > div:nth-child(even) .z-tip::after { left: auto; right: 0; }
}

/* Escudo propio del equipo: sustituye al 3D de la competición en el escenario. */
.z-stage-photo { position: absolute; inset: 10% 12%; width: 76%; height: 80%; object-fit: contain; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .55)); }
.z-stage-photo { opacity: 0; transform: scale(.92); transition: opacity .45s var(--z-ease), transform .45s var(--z-ease); pointer-events: none; }
.z-stage-canvas, .z-stage-fallback { transition: opacity .45s var(--z-ease), transform .45s var(--z-ease); }
.z-stage.has-photo .z-stage-photo { opacity: 1; transform: none; }
.z-stage.has-photo .z-stage-canvas, .z-stage.has-photo .z-stage-fallback { opacity: 0; transform: scale(1.08); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .z-stage.has-photo .z-stage-photo { animation: z-stage-float 4s ease-in-out infinite; }
  @keyframes z-stage-float { 50% { transform: translateY(-8px); } }
}

/* Escudo en imagen de la competición (back-office): sustituye al 3D salvo que el equipo suba el suyo. */
.z-stage.has-crest .z-stage-crest { opacity: 1; transform: none; }
.z-stage.has-crest .z-stage-canvas, .z-stage.has-crest .z-stage-fallback { opacity: 0; transform: scale(1.08); pointer-events: none; }
.z-stage.has-photo .z-stage-crest { opacity: 0; transform: scale(.92); animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .z-stage.has-crest:not(.has-photo) .z-stage-crest { animation: z-stage-float 4s ease-in-out infinite; }
}

/* ---- Estadísticas · «Frente a la plantilla» (includes/squad_compare.html) ---- */
.st-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-squad { container-type: inline-size; display: flex; flex-direction: column; gap: 14px; }
.st-squad-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; }
.st-squad-sum { margin: 2px 0 0; font-size: var(--z-fs-sm); color: var(--z-muted); }
.st-squad-sum strong { color: var(--z-text); }
.st-squad-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--z-fs-xs); color: var(--z-muted); align-items: center; }
.st-squad-legend i { display: inline-block; vertical-align: -2px; margin-right: 5px; }
.st-squad-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--z-lime); border: 2px solid var(--z-ink); box-shadow: 0 0 0 1px var(--z-lime); }
.st-squad-avg { width: 3px; height: 14px; border-radius: 2px; background: #FFFFFF; }
.st-squad-band { width: 22px; height: 8px; border-radius: 6px; background: var(--z-surface-3); border: 1px solid var(--z-border-strong); }
.st-squad-rows { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; list-style: none; }
.st-squad-row { position: relative; display: grid; gap: 6px; }
.st-squad-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.st-squad-label { display: flex; align-items: center; gap: 6px; font-size: var(--z-fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--z-muted); }
.st-squad-rank { padding: 3px 10px; border-radius: 999px; font-size: var(--z-fs-xs); font-weight: 800; background: var(--z-surface-3); color: var(--z-text); white-space: nowrap; }
.st-squad-rank.is-top { background: var(--z-lime); color: var(--z-ink); }
.st-squad-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.st-squad-val { font-family: var(--z-display); font-size: var(--z-fs-2xl); font-weight: 400; line-height: 1; color: #FFFFFF; }
.st-squad-base { font-size: var(--z-fs-sm); color: var(--z-muted); }
.st-squad-delta { margin-left: auto; font-size: var(--z-fs-sm); font-weight: 800; white-space: nowrap; }
.st-squad-delta.is-up { color: var(--z-lime); }
.st-squad-delta.is-down { color: var(--z-danger); }
.st-squad-delta.is-eq { color: var(--z-muted); }
.st-squad-track { position: relative; height: 12px; margin: 8px 0 2px; }
.st-squad-track::before { content: ""; position: absolute; inset: 4px 0; border-radius: 6px; background: var(--z-surface); border: 1px solid var(--z-border); }
.st-squad-range { position: absolute; top: 2px; height: 8px; border-radius: 6px; background: var(--z-surface-3); border: 1px solid var(--z-border-strong); }
.st-squad-mean { position: absolute; top: -3px; width: 3px; height: 18px; margin-left: -1px; border-radius: 2px; background: #FFFFFF; }
.st-squad-me { position: absolute; top: -2px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--z-lime); border: 3px solid var(--z-ink); box-shadow: 0 0 0 1px var(--z-lime); }
.st-squad-scale { display: flex; justify-content: space-between; gap: 8px; font-size: var(--z-fs-xs); color: var(--z-muted); font-variant-numeric: tabular-nums; }
.st-squad-scale b { font-weight: 600; color: var(--z-text); }
.st-squad-row.is-empty { opacity: .6; }
.st-squad-row.is-empty .st-squad-val { font-family: var(--z-body); font-size: var(--z-fs-md); font-weight: 800; color: var(--z-muted); }
.st-squad-row.is-empty .st-squad-track::before { border-style: dashed; border-color: var(--z-border-strong); }
@container (max-width: 460px) {
  .st-squad-delta { margin-left: 0; flex-basis: 100%; }
}
.z-stage-hidden { margin: 0; color: var(--z-muted); font-size: var(--z-fs-sm); }
.z-status4 .is-missed .z-status4-ic { color: var(--z-ink); background: var(--z-danger); }
.z-status4 .is-missed .z-status4-label { color: var(--z-text); }
@media (min-width: 0) {
    .z-menu-card.is-missed { border-top-color: var(--z-danger); }
    .z-menu-card.is-missed .z-menu-ic { color: var(--z-danger); }
}
