/*
 * Estilo de Pull Finura sobre AdminLTE 4.
 * Colores corporativos de Finura Pádel & Gym (finurapadelgym.com):
 * azul #1B53C4, verde #51B300, texto #2D2D2D.
 */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow:wght@400;500;600;700&display=swap');

:root {
    --finura-blue: #1b53c4;
    --finura-blue-dark: #15429c;
    --finura-blue-soft: #e8eefb;
    --finura-navy: #0c2558;
    --finura-navy-dark: #081a40;
    --finura-green: #51b300;
    --finura-green-dark: #3f8c00;
    --finura-green-soft: #ebf7df;
    --finura-text: #2d2d2d;

    --surface-page: #f3f5f9;
    --surface-card: #ffffff;
    --card-radius: .875rem;
    --card-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --card-shadow-hover: 0 4px 12px rgba(16, 24, 40, .08);
    --font-display: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;

    --bs-font-sans-serif: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-primary: var(--finura-blue);
    --bs-primary-rgb: 27, 83, 196;
    --bs-success: var(--finura-green);
    --bs-success-rgb: 81, 179, 0;
    --bs-link-color: var(--finura-blue);
    --bs-link-color-rgb: 27, 83, 196;
    --bs-link-hover-color: var(--finura-blue-dark);
    --bs-link-hover-color-rgb: 21, 66, 156;
}

[data-bs-theme="dark"] {
    --surface-page: #10141c;
    --surface-card: #171c26;
    --finura-blue-soft: #1a2a4d;
    --finura-green-soft: #1f3312;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, .5);
}

body {
    font-family: var(--bs-body-font-family);
    font-size: 1rem;
}

/* Texto corporativo solo en modo claro (AdminLTE pone el tema en <html>). */
:root:not([data-bs-theme="dark"]) body {
    --bs-body-color: var(--finura-text);
    color: var(--finura-text);
}

.app-main {
    background-color: var(--surface-page);
}

/* ---------- Botones y formularios ---------- */

.btn {
    font-weight: 600;
    border-radius: .55rem;
    transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}

.btn-primary {
    --bs-btn-bg: var(--finura-blue);
    --bs-btn-border-color: var(--finura-blue);
    --bs-btn-hover-bg: var(--finura-blue-dark);
    --bs-btn-hover-border-color: var(--finura-blue-dark);
    --bs-btn-active-bg: var(--finura-blue-dark);
    --bs-btn-active-border-color: var(--finura-blue-dark);
    --bs-btn-disabled-bg: var(--finura-blue);
    --bs-btn-disabled-border-color: var(--finura-blue);
    --bs-btn-focus-shadow-rgb: 27, 83, 196;
    box-shadow: 0 1px 2px rgba(27, 83, 196, .25);
}

.btn-success {
    --bs-btn-bg: var(--finura-green);
    --bs-btn-border-color: var(--finura-green);
    --bs-btn-hover-bg: var(--finura-green-dark);
    --bs-btn-hover-border-color: var(--finura-green-dark);
    --bs-btn-active-bg: var(--finura-green-dark);
    --bs-btn-active-border-color: var(--finura-green-dark);
    --bs-btn-disabled-bg: var(--finura-green);
    --bs-btn-disabled-border-color: var(--finura-green);
    --bs-btn-focus-shadow-rgb: 81, 179, 0;
    box-shadow: 0 1px 2px rgba(81, 179, 0, .3);
}

.btn-outline-primary {
    --bs-btn-color: var(--finura-blue);
    --bs-btn-border-color: rgba(27, 83, 196, .35);
    --bs-btn-hover-bg: var(--finura-blue);
    --bs-btn-hover-border-color: var(--finura-blue);
    --bs-btn-active-bg: var(--finura-blue);
    --bs-btn-active-border-color: var(--finura-blue);
}

.btn-sm {
    border-radius: .45rem;
}

/* Botones de acción con solo icono: área táctil mínima. */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

.form-control,
.form-select {
    border-radius: .55rem;
}

.form-label {
    font-weight: 600;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #8daae2;
    box-shadow: 0 0 0 .25rem rgba(27, 83, 196, .2);
}

.form-check-input:checked {
    background-color: var(--finura-blue);
    border-color: var(--finura-blue);
}

/* ---------- Sidebar y barra superior ---------- */

.app-sidebar {
    --lte-sidebar-bg: var(--finura-navy) !important;
    background: linear-gradient(180deg, var(--finura-navy) 0%, var(--finura-navy-dark) 100%) !important;
}

.app-sidebar .sidebar-brand {
    background-color: rgba(0, 0, 0, .15);
    border-bottom: 3px solid var(--finura-green) !important;
}

.app-sidebar .brand-image {
    background-color: #fff;
    border-radius: .4rem;
    padding: 2px;
    opacity: 1 !important;
}

.app-sidebar .brand-text {
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600 !important;
    letter-spacing: .02em;
}

.app-sidebar .nav-link {
    color: rgba(255, 255, 255, .78);
    border-radius: .55rem;
    margin: 2px 8px;
    font-weight: 500;
    transition: background-color .15s, color .15s;
}

.app-sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .08);
}

.app-sidebar .nav-link.active {
    background-color: var(--finura-blue) !important;
    color: #fff !important;
    box-shadow: inset 4px 0 0 var(--finura-green), 0 4px 12px rgba(0, 0, 0, .25);
}

.app-sidebar .nav-header {
    color: rgba(255, 255, 255, .45);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-header {
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}

/* ---------- Cabecera de página ---------- */

.app-content-header {
    padding-top: 1.5rem;
    padding-bottom: .75rem;
}

.app-content-header h1,
.page-heading h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    letter-spacing: .01em;
    margin-bottom: 0;
}

.page-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    justify-content: space-between;
}

.page-heading .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.page-eyebrow {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--finura-green-dark);
}

[data-bs-theme="dark"] .page-eyebrow {
    color: var(--finura-green);
}

.page-subtitle {
    color: var(--bs-secondary-color);
    margin: .25rem 0 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: .35rem;
}

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

.card {
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background-color: var(--surface-card);
}

.card-outline {
    border-top: 1px solid var(--bs-border-color-translucent) !important;
}

.card > .card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    padding: .9rem 1.25rem;
}

/* AdminLTE añade un clearfix que en un contenedor flex cuenta como un elemento más. */
.card .card-header::after,
.card .card-footer::after {
    display: none;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: .01em;
    margin: 0;
    float: none;
}

.card-link {
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
}

.card > .card-footer {
    background: transparent;
    border-top: 1px solid var(--bs-border-color-translucent);
    border-radius: 0 0 var(--card-radius) var(--card-radius);
}

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

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > thead th {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    padding: .7rem 1rem;
}

.table-hover > tbody > tr {
    transition: background-color .12s;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(16, 24, 40, .018);
}

/* ---------- Avisos ---------- */

.alert {
    border: 0;
    border-radius: .75rem;
    border-left: 4px solid currentColor;
}

.alert-success {
    background-color: var(--finura-green-soft);
    color: #2c5e00;
}

[data-bs-theme="dark"] .alert-success {
    color: #a6dd78;
}

/* ---------- Insignias ---------- */

.badge {
    font-weight: 600;
    border-radius: 999px;
    padding: .38em .7em;
}

.text-bg-primary,
.bg-primary {
    background-color: var(--finura-blue) !important;
}

.text-bg-success,
.bg-success {
    background-color: var(--finura-green) !important;
}

.badge-soft-success {
    background-color: var(--finura-green-soft);
    color: #2c5e00;
}

.badge-soft-muted {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

[data-bs-theme="dark"] .badge-soft-success {
    color: #a6dd78;
}

/* ---------- Dashboard: cifras clave ---------- */

.stat-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.1rem 1.25rem;
    border-radius: var(--card-radius);
    background-color: var(--surface-card);
    border: 1px solid var(--bs-border-color-translucent);
    box-shadow: var(--card-shadow);
    transition: box-shadow .2s, transform .2s;
}

.stat-tile:has(.stretched-link):hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}

.stat-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 3rem;
    height: 3rem;
    border-radius: .75rem;
    font-size: 1.35rem;
}

.stat-blue .stat-icon { background: var(--finura-blue-soft); color: var(--finura-blue); }
.stat-green .stat-icon { background: var(--finura-green-soft); color: var(--finura-green-dark); }
.stat-navy .stat-icon { background: #e6e9f2; color: var(--finura-navy); }
.stat-amber .stat-icon { background: #fff3d6; color: #a86a00; }

[data-bs-theme="dark"] .stat-navy .stat-icon { background: #222b40; color: #9fb4e6; }
[data-bs-theme="dark"] .stat-amber .stat-icon { background: #3d3115; color: #f2c25c; }
[data-bs-theme="dark"] .stat-green .stat-icon { color: var(--finura-green); }
[data-bs-theme="dark"] .stat-blue .stat-icon { color: #8daae2; }

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label,
.stat-label a {
    color: var(--bs-secondary-color);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
}

/* ---------- Próximo pull ---------- */

.next-pull-card {
    color: #fff;
    border: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(81, 179, 0, .45) 0, transparent 45%),
        linear-gradient(135deg, var(--finura-blue) 0%, var(--finura-navy) 100%);
}

.next-pull-date {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    margin-top: .25rem;
}

.next-pull-meta {
    color: rgba(255, 255, 255, .8);
}

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

.list-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .75rem 1.25rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    transition: background-color .12s;
}

.list-row:last-child {
    border-bottom: 0;
}

a.list-row:hover {
    background-color: var(--bs-tertiary-bg);
}

.min-w-0 {
    min-width: 0;
}

.date-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 3rem;
    height: 3rem;
    border-radius: .65rem;
    background-color: var(--finura-blue-soft);
    color: var(--finura-blue);
    line-height: 1;
}

[data-bs-theme="dark"] .date-chip {
    color: #8daae2;
}

.date-day {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
}

.date-month {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.avatar-initials {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--finura-blue-soft);
    color: var(--finura-blue);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

[data-bs-theme="dark"] .avatar-initials {
    color: #8daae2;
}

.rank-badge {
    display: grid;
    place-items: center;
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

.rank-1 { background: linear-gradient(135deg, #ffe58a, #e6b422); color: #5c4300; }
.rank-2 { background: linear-gradient(135deg, #f1f3f5, #b9c0c8); color: #3b4248; }
.rank-3 { background: linear-gradient(135deg, #f6c99a, #c9824a); color: #4d2a0c; }

.points {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.points span {
    font-family: var(--bs-body-font-family);
    font-size: .75rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-left: .2rem;
}

.empty-state {
    text-align: center;
    color: var(--bs-secondary-color);
    padding: 2rem 1rem;
}

.empty-state > i {
    font-size: 2rem;
    opacity: .5;
}

.empty-state p {
    margin: .5rem 0 0;
}

/* ---------- Podio ---------- */

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: .75rem;
}

.podium-step {
    text-align: center;
    padding: 1rem .75rem;
    border-radius: .75rem;
    border: 1px solid var(--bs-border-color-translucent);
    background-color: var(--bs-tertiary-bg);
}

.podium-1 {
    padding-top: 1.6rem;
    padding-bottom: 1.6rem;
    background: linear-gradient(180deg, #fff6d6 0%, var(--surface-card) 100%);
    border-color: #f0d77a;
}

.podium-2 { background: linear-gradient(180deg, #f1f3f5 0%, var(--surface-card) 100%); }
.podium-3 { background: linear-gradient(180deg, #fbe7d4 0%, var(--surface-card) 100%); }

[data-bs-theme="dark"] .podium-1 { background: linear-gradient(180deg, #4a3d10 0%, var(--surface-card) 100%); border-color: #6b5714; }
[data-bs-theme="dark"] .podium-2 { background: linear-gradient(180deg, #343941 0%, var(--surface-card) 100%); }
[data-bs-theme="dark"] .podium-3 { background: linear-gradient(180deg, #4a3018 0%, var(--surface-card) 100%); }

.podium-medal {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin: 0 auto .6rem;
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

.podium-1 .podium-medal { background: linear-gradient(135deg, #ffe58a, #e6b422); color: #5c4300; width: 3.1rem; height: 3.1rem; font-size: 1.7rem; }
.podium-2 .podium-medal { background: linear-gradient(135deg, #f1f3f5, #b9c0c8); color: #3b4248; }
.podium-3 .podium-medal { background: linear-gradient(135deg, #f6c99a, #c9824a); color: #4d2a0c; }

.podium-names {
    font-weight: 600;
    line-height: 1.3;
}

.podium-meta {
    margin-top: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
}

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

    .podium-1 { order: -1; }
}

/* ---------- Cabecera de liga ---------- */

.league-hero {
    color: #fff;
    border: 0;
    border-radius: var(--card-radius);
    padding: 1.5rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(81, 179, 0, .4) 0, transparent 40%),
        linear-gradient(135deg, var(--finura-blue) 0%, var(--finura-navy) 100%);
    box-shadow: var(--card-shadow);
}

.league-hero .hero-stat-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}

.league-hero .hero-stat-label {
    color: rgba(255, 255, 255, .75);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.league-hero .hero-description {
    color: rgba(255, 255, 255, .85);
    white-space: pre-line;
    margin: .5rem 0 0;
}

/* ---------- Login ---------- */

.finura-auth {
    min-height: 100vh;
    background-color: var(--surface-page);
}

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(81, 179, 0, .55) 0, transparent 38%),
        radial-gradient(circle at 10% 95%, rgba(27, 83, 196, .9) 0, transparent 45%),
        linear-gradient(160deg, var(--finura-blue) 0%, var(--finura-navy) 60%, var(--finura-navy-dark) 100%);
}

.auth-court {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .14;
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    transform: rotate(-8deg) scale(1.15);
}

.auth-court .net {
    stroke: var(--finura-green);
    stroke-width: 5;
}

.auth-brand-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    height: 100%;
    max-width: 34rem;
    padding: 3rem clamp(2rem, 5vw, 4.5rem);
}

.auth-logo-card {
    align-self: flex-start;
    background: #fff;
    border-radius: 1rem;
    padding: .5rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.auth-logo-card img {
    display: block;
    height: auto;
}

.auth-kicker {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #b9f08a;
}

.auth-headline {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 3.6vw, 3.25rem);
    font-weight: 700;
    line-height: 1.05;
    margin: .5rem 0 1.75rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .85rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .9);
}

.auth-features i {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-right: .6rem;
    border-radius: .55rem;
    background: rgba(255, 255, 255, .14);
    color: #b9f08a;
}

.auth-brand-footer {
    font-size: .85rem;
    color: rgba(255, 255, 255, .65);
}

.auth-form-wrap {
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-form {
    width: 100%;
    max-width: 24rem;
}

.auth-mobile-logo {
    display: none;
    height: auto;
    margin: 0 auto 1.5rem;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0;
}

.auth-subtitle {
    color: var(--bs-secondary-color);
    margin: .25rem 0 2rem;
}

.auth-input {
    position: relative;
}

.auth-input > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
    pointer-events: none;
}

.auth-input .form-control {
    padding-left: 2.75rem;
    padding-right: 3rem;
    border-radius: .7rem;
    font-size: 1rem;
    min-height: 3.1rem;
    background-color: var(--surface-card);
}

/* El icono de error de Bootstrap chocaría con el botón de mostrar contraseña. */
.auth-input .form-control.is-invalid {
    background-image: none;
    padding-right: 3rem;
}

.auth-toggle {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: .55rem;
    background: transparent;
    color: var(--bs-secondary-color);
    cursor: pointer;
}

.auth-toggle:hover,
.auth-toggle:focus-visible {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.finura-auth .btn-lg {
    min-height: 3.1rem;
    border-radius: .7rem;
}

.auth-help {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: .85rem;
    color: var(--bs-secondary-color);
}

@media (max-width: 991.98px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

    /* En móvil, franja con el degradado de la marca y el logo en una tarjeta encima. */
    .auth-form-wrap {
        place-items: start center;
        padding-top: 2rem;
        background:
            radial-gradient(circle at 90% 0%, rgba(81, 179, 0, .5) 0, transparent 45%) top / 100% 6.5rem no-repeat,
            linear-gradient(160deg, var(--finura-blue) 0%, var(--finura-navy) 100%) top / 100% 6.5rem no-repeat,
            var(--surface-page);
    }

    .auth-mobile-logo {
        display: block;
        box-sizing: content-box;
        padding: .5rem 1rem;
        border-radius: 1rem;
        background: #fff;
        box-shadow: 0 10px 25px rgba(8, 26, 64, .25);
        margin-bottom: 2rem;
    }

    .auth-title,
    .auth-subtitle {
        text-align: center;
    }
}

/* ---------- Respeta la preferencia de menos movimiento ---------- */

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

/* Clasificación de la liga: una columna por pull; el podio de cada pull en oro, plata y bronce. */
:root {
    --result-gold: #fff1b8;
    --result-silver: #e4e6ea;
    --result-bronze: #f6d6b3;
}

[data-bs-theme="dark"] {
    --result-gold: #5c4d12;
    --result-silver: #4a4d52;
    --result-bronze: #5e3e1f;
}

.league-standings {
    width: auto;
    white-space: nowrap;
}

.league-standings .pull-col {
    min-width: 3.5rem;
}

.league-standings .pull-col a {
    text-decoration: none;
}

.league-standings .sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: var(--bs-body-bg);
}

.league-standings .sticky-col-2 {
    left: 3.5rem;
    box-shadow: inset -2px 0 0 var(--bs-border-color);
}

/* Los puntos quedan siempre a la vista en el borde derecho. */
.league-standings .sticky-col-end {
    position: sticky;
    right: 0;
    z-index: 1;
    background-color: var(--bs-body-bg);
    box-shadow: inset 2px 0 0 var(--bs-border-color);
}

.league-standings .result-gold,
.legend-swatch.result-gold { --bs-table-bg: var(--result-gold); background-color: var(--result-gold); font-weight: 600; }
.league-standings .result-silver,
.legend-swatch.result-silver { --bs-table-bg: var(--result-silver); background-color: var(--result-silver); font-weight: 600; }
.league-standings .result-bronze,
.legend-swatch.result-bronze { --bs-table-bg: var(--result-bronze); background-color: var(--result-bronze); font-weight: 600; }

.legend-swatch {
    display: inline-block;
    width: .9rem;
    height: .9rem;
    vertical-align: -.1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .2rem;
}

/* Tarjetas de liga en el listado. */
.league-card {
    transition: box-shadow .2s, transform .2s;
}

.league-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* Insignia de posición dentro de tablas ("1º"). */
.table .rank-badge {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1rem;
}

/* Título de la cabecera de liga con la tipografía de titulares. */
.league-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    line-height: 1.05;
    margin: 0;
}

/* En móvil el icono de las cifras va encima para que quepan las etiquetas largas. */
@media (max-width: 575.98px) {
    .stat-tile {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
        padding: 1rem;
    }

    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.15rem;
    }
}

/* En móvil solo el nombre queda fijo y los puntos van debajo, para dejar sitio a los pulls. */
@media (max-width: 575.98px) {
    .league-standings .sticky-col:not(.sticky-col-2) {
        position: static;
    }

    .league-standings .sticky-col-2 {
        left: 0;
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .league-standings .sticky-col-end {
        display: none;
    }
}

/* La tabla de clasificación es densa: celdas más compactas que el resto de tablas. */
.league-standings > :not(caption) > * > * {
    padding: .45rem .6rem;
}

@media (max-width: 575.98px) {
    .league-standings > :not(caption) > * > * {
        padding: .4rem .45rem;
    }

    .league-standings .pull-col {
        min-width: 2.6rem;
    }

    .league-standings th:first-child,
    .league-standings td:first-child {
        width: 2.2rem !important;
    }
}

/* ---------- Ficha de jugador ---------- */

.avatar-initials.avatar-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.2rem;
}

.flex-none {
    flex: none;
}

/* Nombres de jugador enlazados a su ficha sin cambiar el aspecto del texto. */
a.player-link {
    color: inherit;
    text-decoration: none;
}

a.player-link:hover {
    color: var(--bs-link-color);
    text-decoration: underline;
}

/* En el historial del jugador se mezclan años, así que la fecha lleva el año debajo. */
.date-chip:has(.date-year) {
    height: auto;
    padding: .4rem 0;
}

.date-year {
    font-size: .62rem;
    font-weight: 600;
    opacity: .75;
}

/* ---------- SweetAlert2 ---------- */

.swal2-popup {
    font-family: var(--bs-body-font-family);
    border-radius: var(--card-radius);
}

.swal2-popup .swal2-title {
    font-family: var(--font-display);
    font-weight: 700;
}

.swal2-popup.swal2-toast .swal2-title {
    font-family: var(--bs-body-font-family);
    font-size: .95rem;
    font-weight: 600;
}

.swal2-timer-progress-bar {
    background: var(--finura-green);
}

.swal2-container {
    z-index: 2000;
}

[data-bs-theme="dark"] .swal2-popup {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .swal2-popup .swal2-title,
[data-bs-theme="dark"] .swal2-popup .swal2-html-container {
    color: var(--bs-body-color);
}

/* ---------- Clasificación pública ---------- */

.finura-public {
    min-height: 100vh;
    background-color: var(--surface-page);
}

.public-container {
    max-width: 72rem;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.public-header {
    padding: .85rem 0;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(81, 179, 0, .45) 0, transparent 40%),
        linear-gradient(135deg, var(--finura-blue) 0%, var(--finura-navy) 100%);
}

.public-logo {
    flex: none;
    padding: .3rem .6rem;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 6px 18px rgba(8, 26, 64, .25);
}

.public-logo img {
    display: block;
    width: 3.5rem;
    height: auto;
}

.public-kicker {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}

.public-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

.public-main {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
}

.public-footer {
    padding-top: 1rem;
    padding-bottom: 2rem;
    text-align: center;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.public-search {
    position: relative;
    width: 14rem;
    max-width: 100%;
}

.public-search > i {
    position: absolute;
    left: .65rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.public-search .form-control {
    padding-left: 1.9rem;
}

.public-league-link {
    color: inherit;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
}

.public-league-link:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1px);
}

.public-league-icon {
    background: var(--finura-green-soft);
    color: var(--finura-green-dark);
}

@media (max-width: 575.98px) {
    .public-search {
        width: 100%;
    }

    .finura-public .league-hero {
        padding: 1.25rem;
    }
}

/* ---------- Compartir por WhatsApp ---------- */

.btn-whatsapp {
    --bs-btn-color: #fff;
    --bs-btn-bg: #1fa855;
    --bs-btn-border-color: #1fa855;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #178a45;
    --bs-btn-hover-border-color: #178a45;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #127038;
    --bs-btn-active-border-color: #127038;
}

.share-preview {
    max-height: 50vh;
    overflow: auto;
    margin: 0;
    padding: .9rem 1rem;
    text-align: left;
    white-space: pre-wrap;
    font-family: var(--bs-body-font-family);
    font-size: .9rem;
    line-height: 1.5;
    border-radius: .75rem;
    background-color: #e7f8ec;
    color: var(--finura-text);
}

[data-bs-theme="dark"] .share-preview {
    background-color: #173322;
    color: var(--bs-body-color);
}

.public-player-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    margin: 0;
}

/* En las páginas públicas el historial no enlaza: sin efecto al pasar el ratón. */
div.list-row:hover {
    background-color: transparent;
}

/* ---------- Liga del pull (formulario de nuevo pull) ---------- */

.pull-league-banner {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.25rem;
    color: #fff;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(81, 179, 0, .45) 0, transparent 45%),
        linear-gradient(135deg, var(--finura-blue) 0%, var(--finura-navy) 100%);
}

.pull-league-banner > i {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, .15);
}

.pull-league-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .75);
}

.pull-league-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.pull-league-meta {
    font-size: .85rem;
    color: rgba(255, 255, 255, .8);
}

/* ---------- Ligas finalizadas ---------- */

.section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .75rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.badge-finished {
    background-color: rgba(255, 255, 255, .18);
    color: #fff;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
}

.league-champion {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: .65rem;
    background-color: #fff6db;
}

.league-champion > i {
    font-size: 1.15rem;
    color: #c99a06;
}

[data-bs-theme="dark"] .league-champion {
    background-color: #3d3115;
}

/* ---------- Temporadas ---------- */

.season-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.25rem;
    padding: .75rem 1rem;
    border-radius: .85rem;
    background: rgba(255, 255, 255, .1);
}

.season-bar-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .75);
}

.btn-season {
    --bs-btn-color: var(--finura-navy);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #fff;
    --bs-btn-hover-color: var(--finura-navy);
    --bs-btn-hover-bg: #eef2fb;
    --bs-btn-active-bg: #eef2fb;
    --bs-btn-active-color: var(--finura-navy);
    --bs-btn-active-border-color: #fff;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    padding: .2rem .8rem;
}

.badge-live {
    background-color: rgba(81, 179, 0, .9);
    color: #fff;
    font-weight: 600;
}

.badge-live .bi-circle-fill,
.badge-soft-success .bi-circle-fill {
    font-size: .5em;
    vertical-align: middle;
}

.pull-league-season {
    margin-top: .15rem;
    font-size: .85rem;
    font-weight: 600;
    color: #d6f5bd;
}

.new-season-card {
    border-color: var(--finura-green);
    border-style: dashed;
}

.badge-champion {
    background-color: #fff1b8;
    color: #6b5000;
    font-weight: 700;
}

[data-bs-theme="dark"] .badge-champion {
    background-color: #5c4d12;
    color: #ffe58a;
}

/* Cabecera de grupo dentro de una lista (temporadas por liga en la ficha del jugador). */
.list-divider {
    padding: .45rem 1.25rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

/* ---------- Buscador del listado de jugadores ---------- */

.player-search {
    position: relative;
    width: 100%;
    max-width: 24rem;
}

.player-search > i {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary-color);
}

.player-search .form-control {
    padding-left: 2.3rem;
}
