/* ==========================================================================
   La Banda del Fútbol
   ========================================================================== */

:root {
    --bg: #0a120e;
    --bg-2: #0e1813;
    --panel: #12201a;
    --panel-2: #192c23;
    --line: #22362c;
    --line-2: #2e4a3c;
    --text: #eaf3ee;
    --muted: #93ab9e;
    --dim: #62806f;

    --accent: #c4f135;
    --accent-ink: #16210a;
    --accent-soft: rgba(196, 241, 53, .12);

    --win: #3fd07f;
    --draw: #9aa8a1;
    --loss: #f25f5c;
    --amarillo: #f2c14e;

    --team-a: #ff9f43;
    --team-b: #4fb3ff;

    --gold: #e9c25b;
    --silver: #c9d1d9;
    --bronze: #cf8b55;

    --radius: 14px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font: 15px/1.5 var(--font);
    color: var(--text);
    background: var(--bg) radial-gradient(1000px 440px at 50% -140px, rgba(196, 241, 53, .08), transparent 70%) no-repeat;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: .01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 18px; }
main.wrap { flex: 1; padding-top: 22px; padding-bottom: 56px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.nowrap { white-space: nowrap; }
.t-w { color: var(--win); font-weight: 700; }
.t-l { color: var(--loss); font-weight: 700; }

.link { color: var(--accent); font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }
.link-simple:hover .eq { text-decoration: underline; }

/* ---------------------------------------------------------------- Topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(10, 18, 14, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 22px; min-height: 62px; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    line-height: .95;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    flex: none;
}
.logo b { display: block; font-size: 20px; font-weight: 800; color: var(--text); }
.logo-ball { font-size: 28px; filter: drop-shadow(0 0 10px rgba(196, 241, 53, .35)); }

.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
    padding: 7px 13px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current] { color: var(--accent-ink); background: var(--accent); }

@media (max-width: 780px) {
    .topbar-in { flex-wrap: wrap; gap: 0; padding-top: 10px; }
    .nav { width: calc(100% + 36px); margin: 8px -18px 0; padding: 0 18px 10px; }
}

/* ---------------------------------------------------------------- Encabezados de página */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 0 20px;
}
.page-head h1 { font-size: clamp(36px, 6vw, 54px); text-transform: uppercase; }
.page-head-sm { margin: 30px 0 14px; align-items: center; }
.page-head-sm h2 { font-size: 26px; text-transform: uppercase; }

.eyebrow {
    margin-bottom: 4px;
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.volver { margin-bottom: 12px; }

.leyenda { margin-top: 12px; color: var(--dim); font-size: 13px; }

/* Cantidad por página (tabla) */
.por-pagina {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--panel-2);
    font-size: 13px;
    font-weight: 600;
}
.por-pagina span { padding: 0 6px 0 9px; color: var(--dim); }
.por-pagina a { padding: 4px 11px; border-radius: 999px; color: var(--muted); }
.por-pagina a:hover { color: var(--text); }
.por-pagina a[aria-current] { background: var(--accent); color: var(--accent-ink); }

/* Tabla de la home paginada sin recargar */
[data-tabla-home] { scroll-margin-top: 84px; }
[data-tabla-contenido] { transition: opacity .15s; }
[data-tabla-contenido].cargando { opacity: .45; pointer-events: none; }
.leyenda b { color: var(--muted); }

/* ---------------------------------------------------------------- Paneles */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.panel + .panel, .columna > .panel + .panel { margin-top: 18px; }

.panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 22px; text-transform: uppercase; }
.panel-body { padding: 16px; }

.vacio { padding: 34px 16px; text-align: center; color: var(--muted); }
.vacio-emoji { font-size: 34px; margin-bottom: 6px; }
.vacio-grande { padding: 80px 16px; }
.vacio-grande h1 { font-size: 48px; text-transform: uppercase; margin-bottom: 8px; color: var(--text); }
.vacio .btn { margin-top: 18px; }

/* ---------------------------------------------------------------- Selector de temporada */

.temporada select {
    appearance: none;
    padding: 7px 34px 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--text);
    font: 600 13px var(--font);
    cursor: pointer;
    background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2393ab9e' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.temporada select:hover { border-color: var(--dim); }

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

.scroll-x { overflow-x: auto; }

.tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabla th {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    color: var(--dim);
    font: 700 11px var(--font);
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}
.tabla td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla th a.orden { display: inline-flex; align-items: center; gap: 3px; color: inherit; }
.tabla th a.orden:hover { color: var(--text); }
.tabla th[aria-sort] { color: var(--accent); }
.tabla .flecha { font-size: 8px; }
.tabla tbody tr:hover { background: rgba(255, 255, 255, .02); }
.tabla .c-jug { text-align: left; width: 100%; }
.tabla th:first-child, .tabla td:first-child { padding-left: 16px; }
.tabla th:last-child, .tabla td:last-child { padding-right: 16px; }

.c-pos { width: 44px; }
.pos {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--muted);
    font: 700 16px var(--font-display);
}
.top-1 .pos { background: var(--gold); color: #2a1f05; }
.top-2 .pos { background: var(--silver); color: #1c232a; }
.top-3 .pos { background: var(--bronze); color: #2b1608; }

.c-pts strong { font: 800 21px var(--font-display); color: var(--accent); }

.wr { display: inline-flex; align-items: center; gap: 8px; }
.wr-bar { width: 46px; height: 6px; border-radius: 9px; background: var(--line-2); overflow: hidden; }
.wr-bar > span { display: block; height: 100%; border-radius: 9px; background: var(--accent); }
.wr-num { min-width: 38px; text-align: right; font-weight: 600; }

.tabla-compacta td { padding-top: 7px; padding-bottom: 7px; }
.marcador-celda { font: 700 17px var(--font-display); }

@media (max-width: 900px) { .hide-md { display: none; } }
@media (max-width: 640px) {
    .hide-sm { display: none; }
    .wr-bar { display: none; }
    .tabla td, .tabla th { padding-left: 5px; padding-right: 5px; }
    .tabla th:first-child, .tabla td:first-child { padding-left: 10px; }
    .tabla th:last-child, .tabla td:last-child { padding-right: 10px; }
    .tabla .c-jug { max-width: 0; }
    .tabla .jug { gap: 8px; }
    .tabla .jug-txt small { display: none; }
    .tabla .avatar { width: 28px; height: 28px; font-size: 11px; }
    .c-pos { width: 36px; }
    .pos { width: 24px; height: 24px; font-size: 14px; }
    .c-pts strong { font-size: 19px; }
    .wr-num { min-width: 0; }
}
@media (max-width: 400px) {
    .hide-xs { display: none; }
}

/* ---------------------------------------------------------------- Jugador (avatar + nombre) */

.jug { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; }
.jug:hover strong { color: var(--accent); }
.jug-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.jug-txt strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.jug-txt small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

.avatar {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: var(--panel-2);
    border: 1px solid var(--line-2);
}
.avatar-ini {
    display: inline-grid;
    place-items: center;
    font: 700 13px var(--font-display);
    letter-spacing: .03em;
    color: hsl(var(--h) 70% 86%);
    background: hsl(var(--h) 32% 24%);
    border-color: hsl(var(--h) 32% 33%);
}

/* ---------------------------------------------------------------- Resultados y rachas */

.res, .racha-i {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    color: #08120c;
    font: 800 13px var(--font-display);
}
.res-W { background: var(--win); }
.res-D { background: var(--draw); }
.res-L { background: var(--loss); }
.racha { display: inline-flex; gap: 3px; vertical-align: middle; }
.racha-i { width: 19px; height: 19px; font-size: 12px; border-radius: 5px; }

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

.paginacion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
}
.paginacion a, .paginacion .off, .paginacion .cur { padding: 6px 11px; border-radius: 9px; }
.paginacion a { background: var(--panel-2); }
.paginacion a:hover { background: var(--line-2); }
.paginacion .off { color: var(--dim); }
.paginacion .nums { display: flex; align-items: center; gap: 4px; }
.paginacion .cur { background: var(--accent); color: var(--accent-ink); }
.paginacion .gap { color: var(--dim); padding: 0 2px; }
@media (max-width: 520px) { .pag-flecha span { display: none; } }

/* ---------------------------------------------------------------- Inicio */

.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin: 4px 0 22px; }

.hero-text, .scoreboard {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--line-2);
    background: linear-gradient(135deg, #1b3a24, #0e1f15);
}
.hero-text { padding: 30px 28px; }
.hero-text::before, .scoreboard::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 56px, transparent 56px 112px);
    pointer-events: none;
}
.hero-text::after {
    content: "";
    position: absolute;
    right: -80px;
    top: 50%;
    width: 220px;
    height: 220px;
    border: 2px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: -110px 0 0 -108px rgba(255, 255, 255, .08);
}
.hero h1 { position: relative; font-size: clamp(46px, 8vw, 80px); font-weight: 800; line-height: .86; text-transform: uppercase; margin: 6px 0 14px; }
.hero h1 span { display: block; color: var(--accent); }
.hero-text p:last-child { position: relative; max-width: 38ch; color: var(--muted); }

.hero-cards { display: grid; gap: 14px; align-content: stretch; }
.mini {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid var(--line);
}
a.mini:hover { border-color: var(--line-2); background: var(--panel-2); }
.mini-label {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font: 700 11px var(--font);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.mini-proximo { border-color: rgba(196, 241, 53, .35); background: linear-gradient(135deg, rgba(196, 241, 53, .08), var(--panel) 60%); }
.proximo-fecha { font: 700 26px var(--font-display); text-transform: uppercase; line-height: 1.1; }
a.mini-proximo:hover { border-color: rgba(196, 241, 53, .6); background: linear-gradient(135deg, rgba(196, 241, 53, .14), var(--panel-2) 60%); }
.mini-cta { color: var(--accent); letter-spacing: .06em; }
.proximo-vs { display: flex; align-items: center; gap: 10px; font: 700 18px var(--font-display); text-transform: uppercase; }
.proximo-vs i { font-style: normal; color: var(--dim); font-size: 14px; }
.proximo-vs .eq-b { flex-direction: row-reverse; }

.marcador-grande { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.marcador-grande .eq { font: 700 22px var(--font-display); text-transform: uppercase; }
.marcador-grande .goles { font: 800 46px var(--font-display); line-height: 1; }
.marcador-grande .goles i { font-style: normal; color: var(--dim); margin: 0 6px; }

@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.grid-home { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .grid-home { grid-template-columns: 1fr; } }

/* Equipos: color de camiseta */
.eq { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.eq::before { content: ""; width: 9px; height: 9px; flex: none; border-radius: 3px; background: var(--team-a); }
.eq-b::before { background: var(--team-b); }
.marcador-grande .eq-b, .partido-linea .eq-b { flex-direction: row-reverse; justify-self: end; text-align: right; }
.pierde { color: var(--muted); }

/* ---------------------------------------------------------------- Listas */

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista .n { width: 18px; flex: none; color: var(--dim); font: 700 15px var(--font-display); }
.lista .valor { margin-left: auto; font: 800 21px var(--font-display); color: var(--accent); white-space: nowrap; }
.lista .valor small { font: 500 12px var(--font); color: var(--dim); }
.goles-jugador { font-size: 14px !important; letter-spacing: 1px; }

/* ---------------------------------------------------------------- Partidos */

.partido { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.partido:last-child { border-bottom: 0; }
.partido:hover { background: rgba(255, 255, 255, .025); }

.fecha-cal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 54px;
    flex: none;
    border-radius: 10px;
    background: var(--panel-2);
    border: 1px solid var(--line-2);
    line-height: 1;
}
.fecha-cal .dia, .fecha-cal .mes { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.fecha-cal .dia { color: var(--muted); }
.fecha-cal .mes { color: var(--accent); }
.fecha-cal .num { font: 800 22px var(--font-display); margin: 2px 0; }

.partido-cuerpo { flex: 1; min-width: 0; display: block; }
.partido-linea { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.partido-linea .eq { font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.marcador {
    padding: 1px 10px;
    border-radius: 8px;
    background: var(--bg-2);
    font: 800 22px var(--font-display);
    white-space: nowrap;
}
.marcador i { font-style: normal; color: var(--dim); margin: 0 4px; font-size: .8em; }
.partido-meta {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pendiente-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font: 700 10.5px var(--font);
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Detalle de partido */
.scoreboard { padding: 26px 18px 22px; text-align: center; }
.scoreboard > * { position: relative; }
.scoreboard-meta { color: var(--muted); font-weight: 600; }
.scoreboard-linea {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    max-width: 760px;
    margin: 12px auto 4px;
}
.scoreboard .eq-nombre { font: 800 clamp(22px, 4.5vw, 38px) var(--font-display); text-transform: uppercase; justify-self: end; }
.scoreboard .eq-nombre.eq-b { justify-self: start; }
.scoreboard .eq-nombre::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 9px; margin: 0 auto 8px; background: var(--team-a); }
.scoreboard .eq-nombre.eq-b::before { background: var(--team-b); }
.scoreboard-goles { font: 800 clamp(58px, 12vw, 108px) var(--font-display); line-height: .9; white-space: nowrap; }
.scoreboard-goles i { font-style: normal; color: var(--dim); margin: 0 .15em; font-size: .6em; vertical-align: middle; }
.veredicto { display: inline-block; margin-top: 8px; padding: 4px 14px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-weight: 700; color: var(--accent); }

.planteles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.planteles .panel + .panel { margin-top: 0; }
.planteles + .panel { margin-top: 18px; }
.equipo-a { border-top: 3px solid var(--team-a); }
.equipo-b { border-top: 3px solid var(--team-b); }
.nota-goles { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.notas { color: var(--muted); }
@media (max-width: 700px) { .planteles { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Cartas de jugador */

.cartas { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }

.carta {
    --c1: #e9b88e;
    --c2: #9a5a2e;
    --ink: #2b1608;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 14px 20px;
    overflow: hidden;
    border-radius: 18px 18px 46px 46px / 18px 18px 28px 28px;
    background: linear-gradient(160deg, var(--c1), var(--c2));
    color: var(--ink);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 0 0 2px rgba(255, 255, 255, .28);
    transition: transform .15s ease;
}
.carta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .4) 45%, transparent 60%);
    opacity: .45;
    pointer-events: none;
}
a.carta:hover { transform: translateY(-4px) rotate(-.6deg); }
.carta-oro { --c1: #f8e49c; --c2: #c49631; --ink: #2a1f05; }
.carta-plata { --c1: #f2f5f8; --c2: #98a4af; --ink: #1a2128; }

.carta-top { position: relative; align-self: stretch; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.carta-ovr { font: 800 42px var(--font-display); line-height: .85; }
.carta-pos { min-width: 0; padding-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font: 700 10px var(--font); letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.carta-foto { position: relative; width: 104px; height: 104px; margin: -2px 0 10px; }
.carta-foto .avatar { width: 100%; height: 100%; border: 3px solid rgba(255, 255, 255, .6); font-size: 36px; }
.carta-nombre {
    position: relative;
    align-self: stretch;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    font: 800 22px var(--font-display);
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.carta-stats {
    position: relative;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    gap: 1px 18px;
    margin-top: 10px;
    font: 700 14px var(--font-display);
}
.carta-stats b { font-size: 19px; margin-right: 4px; }

/* ---------------------------------------------------------------- Perfil */

.perfil { display: grid; grid-template-columns: 220px 1fr; gap: 30px; align-items: center; margin-bottom: 10px; }
.perfil h1 { font-size: clamp(42px, 7vw, 68px); font-weight: 800; text-transform: uppercase; }
.perfil-nombre { color: var(--muted); font-size: 17px; margin-top: 2px; }

.atributos { display: grid; gap: 12px; max-width: 540px; margin-top: 18px; }
.attr { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 12px; }
.attr-label { font-weight: 600; color: var(--muted); }
.attr-bar { height: 10px; border-radius: 9px; background: var(--line); overflow: hidden; }
.attr-bar > span { display: block; height: 100%; border-radius: 9px; background: var(--c); }
.attr-val { font: 800 21px var(--font-display); text-align: right; }

@media (max-width: 700px) {
    .perfil { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; }
    .perfil .carta { width: 220px; }
    .perfil-info { width: 100%; }
    .atributos { margin-left: auto; margin-right: auto; text-align: left; }
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; padding: 16px; }
.tile { padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.tile-destacado { border-color: rgba(196, 241, 53, .4); background: linear-gradient(135deg, rgba(196, 241, 53, .1), var(--panel-2)); }
.tile-label { color: var(--muted); font: 700 11px var(--font); letter-spacing: .1em; text-transform: uppercase; }
.tile-valor { margin-top: 2px; font: 800 30px var(--font-display); line-height: 1.15; }
.tile-valor small { font: 500 12.5px var(--font); color: var(--muted); }
.tile-racha { padding-top: 6px; }
.tile-racha .racha-i { width: 22px; height: 22px; font-size: 13px; }

.quimica { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 16px; }
.q { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.q-titulo { font: 800 20px var(--font-display); text-transform: uppercase; }
.q-desc { margin-top: -6px; color: var(--muted); font-size: 12.5px; }
.q-dato { color: var(--muted); font-size: 13px; }
.q-bueno .q-titulo { color: var(--win); }
.q-malo .q-titulo { color: var(--loss); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.quimica-tablas { padding: 0 16px 8px; }
.desplegable { border-top: 1px solid var(--line); }
.desplegable summary { padding: 12px 0; font-weight: 700; cursor: pointer; }
.desplegable summary:hover { color: var(--accent); }
.desplegable .tabla th:first-child, .desplegable .tabla td:first-child { padding-left: 0; }
.desplegable .tabla th:last-child, .desplegable .tabla td:last-child { padding-right: 0; }

/* ---------------------------------------------------------------- Pie */

.pie { border-top: 1px solid var(--line); padding: 20px 0; color: var(--dim); font-size: 13px; }
.pie .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.pie a:hover { color: var(--text); }

/* ==========================================================================
   Backoffice
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--accent);
    color: var(--accent-ink);
    font: 700 14px var(--font);
    white-space: nowrap;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.07); }
.btn-sec { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.btn-sec:hover { border-color: var(--dim); filter: none; }
.btn-peligro { background: transparent; color: var(--loss); border-color: rgba(242, 95, 92, .45); }
.btn-peligro:hover { background: rgba(242, 95, 92, .1); filter: none; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }

.topbar-admin { border-bottom-color: rgba(196, 241, 53, .3); }
.salir { margin: 0; }
@media (max-width: 780px) { .topbar-admin .salir { margin-left: auto; } }

.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.alerta { margin-bottom: 16px; padding: 11px 14px; border: 1px solid; border-radius: 10px; font-weight: 600; }
.alerta-ok { background: rgba(63, 208, 127, .1); border-color: rgba(63, 208, 127, .35); color: #a4f0c6; }
.alerta-error { background: rgba(242, 95, 92, .1); border-color: rgba(242, 95, 92, .4); color: #ffb9b7; }
.alerta ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }

.form { display: grid; gap: 16px; }
.fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.campo { display: grid; gap: 6px; align-content: start; }
.campo > span:first-child { color: var(--muted); font-size: 13px; font-weight: 600; }
.ayuda { color: var(--dim); font-size: 12.5px; }

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
    background: var(--bg-2);
    color: var(--text);
    font: 15px var(--font);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea.input { min-height: 84px; resize: vertical; }
select.input { cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=file].input { padding: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.atributos-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 26px; padding: 16px; }

.range-fila { display: grid; grid-template-columns: 1fr 40px; align-items: center; gap: 12px; }
.range-fila output { font: 800 22px var(--font-display); text-align: right; }

.login-box { max-width: 400px; margin: 7vh auto 0; }
.login-box .logo { justify-content: center; margin-bottom: 22px; }

.editor-jugador { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
.editor-jugador .preview { position: sticky; top: 80px; display: grid; gap: 10px; justify-items: center; }
.editor-jugador .preview .carta { width: 100%; }
@media (max-width: 760px) { .editor-jugador { grid-template-columns: 1fr; } .editor-jugador .preview { position: static; order: -1; } .editor-jugador .preview .carta { width: 200px; } }

.foto-actual { display: flex; align-items: center; gap: 12px; }
.foto-actual .avatar { width: 56px; height: 56px; }

.estado { padding: 3px 9px; border-radius: 999px; font: 700 11px var(--font); letter-spacing: .06em; text-transform: uppercase; }
.estado-on { color: var(--win); background: rgba(63, 208, 127, .12); }
.estado-off { color: var(--muted); background: var(--panel-2); }
.estado-pend { color: var(--accent); background: var(--accent-soft); }

.tabla-admin th, .tabla-admin td { text-align: left; }

/* Formulario de partido */
.marcador-form { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 14px; max-width: 520px; }
.marcador-form .sep { padding-bottom: 12px; color: var(--dim); font: 800 30px var(--font-display); }
.input-goles { height: 64px; text-align: center; font: 800 34px var(--font-display); }
.campo-eq > span:first-child { display: flex; align-items: center; gap: 8px; }
.campo-eq > span:first-child::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--team-a); }
.campo-eq-b > span:first-child::before { background: var(--team-b); }

.resumen-equipos { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.chip { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel-2); font-weight: 600; white-space: nowrap; }
.chip-a { border-color: rgba(255, 159, 67, .55); }
.chip-b { border-color: rgba(79, 179, 255, .55); }
.chip-error { border-color: var(--loss); color: #ffb9b7; }

.pick {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 92px;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--line);
}
.pick:last-child { border-bottom: 0; }
.pick.en-a { background: linear-gradient(90deg, rgba(255, 159, 67, .12), transparent 55%); }
.pick.en-b { background: linear-gradient(90deg, rgba(79, 179, 255, .12), transparent 55%); }
.pick .jug-txt small { font-size: 11.5px; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
    display: block;
    min-width: 46px;
    max-width: 110px;
    padding: 7px 11px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.seg label + label span { border-left: 1px solid var(--line-2); }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--panel-2); color: var(--text); }
.seg .seg-a input:checked + span { background: var(--team-a); color: #2a1600; }
.seg .seg-b input:checked + span { background: var(--team-b); color: #04192b; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.goles-jug { display: flex; align-items: center; gap: 6px; }
.goles-jug .input { padding: 7px 6px; text-align: center; }
.goles-jug .input:disabled { opacity: .3; }

@media (max-width: 600px) {
    .pick { grid-template-columns: minmax(0, 1fr) 80px; row-gap: 8px; }
    .pick .jug { grid-column: 1 / -1; }
}

.barra-guardar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: rgba(14, 24, 19, .94);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.zona-peligro { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
