/* =========================================================
   PREFERENCIAS PAGE · CSS PARA LA VERSIÓN DINÁMICA ACTUAL
   ========================================================= */


/* =========================================================
   BASE PAGE
   ========================================================= */

#preferencias-page,
.preferencias-page {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    color: #fff;
}

.pref-container {
    max-width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.pref-gallery {
    margin: 0 auto;
    padding: 0 8px;
}

.pref-gallery-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pref-page-bottom-spacer {
    height: 40px;
}


/* =========================================================
   RAW DEBUG
   ========================================================= */

.pref-raw-card {
    margin-bottom: 1rem;
    background: #111719;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.pref-raw-card .card-header {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px;
}

.pref-raw-toggle-btn {
    width: 100%;
    border-radius: 10px;
}

.pref-raw-container {
    width: 100%;
    background: #141a1c;
    border: 1px solid #1f6f52;
    border-radius: 8px;
    padding: 10px;
    max-height: 50vh;
    overflow: auto;
}

.pref-raw-pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 1.45;
    color: #dbeafe;
}

.pref-loading-alert {
    margin: 0;
    border-radius: 14px;
}


/* =========================================================
   BOTÓN ABRIR EDITOR
   ========================================================= */

.pref-open-editor-wrap {
    max-width: 340px;
    margin: 0 auto 18px;
}

.pref-open-editor-btn {
    width: 100%;
    border-radius: 9999px !important;
    font-weight: 700 !important;
    height: 40px !important;
    line-height: 40px !important;
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow:
        0 8px 22px rgba(0,0,0,0.35),
        0 6px 16px rgba(25,135,84,0.35) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    font-size: 14px !important;
}

.pref-open-editor-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}


/* =========================================================
   VARIABLES POR CATEGORÍA
   ========================================================= */

[data-cat] {
    --cat-accent: rgba(255,255,255,0.35);
    --cat-soft: rgba(255,255,255,0.10);
    --cat-border: rgba(255,255,255,0.18);
}

[data-cat="SENIOR"] {
    --cat-accent: rgba(255,215,64,.65);
    --cat-soft: rgba(255,215,64,.12);
    --cat-border: rgba(255,215,64,.32);
}

[data-cat="JUVENIL"] {
    --cat-accent: rgba(255,71,71,.60);
    --cat-soft: rgba(255,71,71,.12);
    --cat-border: rgba(255,71,71,.32);
}

[data-cat="CADETE"] {
    --cat-accent: rgba(168,85,247,.60);
    --cat-soft: rgba(168,85,247,.12);
    --cat-border: rgba(168,85,247,.32);
}

[data-cat="INFANTIL"] {
    --cat-accent: rgba(34,211,238,.65);
    --cat-soft: rgba(34,211,238,.12);
    --cat-border: rgba(34,211,238,.32);
}

[data-cat="ALEVIN"],
[data-cat="ALEVIN_F7"] {
    --cat-accent: rgba(34,197,94,.60);
    --cat-soft: rgba(34,197,94,.12);
    --cat-border: rgba(34,197,94,.32);
}

[data-cat="BENJAMIN"],
[data-cat="BENJAMIN_F7"] {
    --cat-accent: rgba(249,115,22,.80);
    --cat-soft: rgba(249,115,22,.12);
    --cat-border: rgba(249,115,22,.34);
}

[data-cat="PREBENJAMIN"],
[data-cat="PREBENJAMIN_F7"] {
    --cat-accent: rgba(120,72,32,.80);
    --cat-soft: rgba(120,72,32,.14);
    --cat-border: rgba(120,72,32,.34);
}

[data-cat="DEBUTANTE"] {
    --cat-accent: rgba(156,163,175,.70);
    --cat-soft: rgba(156,163,175,.12);
    --cat-border: rgba(156,163,175,.32);
}


/* =========================================================
   GALERÍA · FEDERACIÓN
   ========================================================= */

.pref-fed-section {
    background: #151a1c;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,.16);
    margin-bottom: 12px;
    cursor: pointer;
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.pref-fed-section:hover {
    transform: translateY(-1px);
    border-color: rgba(46,204,113,.28);
    background: #171f21;
    box-shadow:
        0 10px 26px rgba(0,0,0,.26),
        0 0 0 1px rgba(46,204,113,.10);
}

.pref-fed-section.has-data {
    border-color: rgba(46,204,113,.16);
}

.pref-fed-section.no-data {
    opacity: .92;
}

.pref-fed-section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px 2px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-weight: 800;
    color: white;
    min-width: 0;
}

.pref-fed-section-flag-wrap {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
    background: #000;
}

.pref-fed-section-flag-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pref-fed-section-flag-img.is-spain {
    object-fit: cover;
    transform: scale(1.25);
    transform-origin: center center;
}

.pref-fed-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.pref-fed-section-title {
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: .3px;
    font-weight: 800;
    margin: 0;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pref-fed-section-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ddd;
    opacity: .96;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.pref-fed-section-badge.has-data {
    color: #bfffd6;
    border-color: rgba(46,204,113,.32);
    background: rgba(46,204,113,.08);
}

.pref-fed-section-badge.no-data {
    opacity: .72;
}


/* =========================================================
   GALERÍA · BLOQUES POR MODALIDAD
   ========================================================= */

.pref-fed-section-scopes-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 4px 4px;
}

.pref-fed-section-scopes-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.pref-scope-block {
    border-radius: 18px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    flex-shrink: 0;
    flex-basis: 520px;
    min-width: max-content;
    align-self: stretch;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.02);
}

.pref-scope-block.scope-f11 {
    background: linear-gradient(180deg, rgba(46,204,113,.10) 0%, rgba(0,0,0,.14) 60%);
    border: 1px solid rgba(46,204,113,.30);
}

.pref-scope-block.scope-f7 {
    background: linear-gradient(180deg, rgba(52,152,219,.10) 0%, rgba(0,0,0,.14) 60%);
    border: 1px solid rgba(52,152,219,.30);
}

.pref-scope-block.scope-debut {
    background: linear-gradient(180deg, rgba(155,89,182,.10) 0%, rgba(0,0,0,.14) 60%);
    border: 1px solid rgba(155,89,182,.30);
}

.pref-scope-title-chip {
    width: max-content;
    font-weight: 700;
    font-size: 12.5px;
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: .2px;
    color: white;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
}

.scope-f11 > .pref-scope-title-chip {
    background: linear-gradient(90deg, rgba(46,204,113,.10) 0%, rgba(255,255,255,.04) 100%);
    border-color: rgba(46,204,113,.40);
}

.scope-f7 > .pref-scope-title-chip {
    background: linear-gradient(90deg, rgba(52,152,219,.10) 0%, rgba(255,255,255,.04) 100%);
    border-color: rgba(52,152,219,.40);
}

.scope-debut > .pref-scope-title-chip {
    background: linear-gradient(90deg, rgba(155,89,182,.10) 0%, rgba(255,255,255,.04) 100%);
    border-color: rgba(155,89,182,.40);
}

.pref-scope-cards-row {
    flex: 1 1 auto;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: max-content;
    min-width: max-content;
    align-items: stretch;
    justify-content: center;
}

.pref-scope-empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    opacity: .60;
    color: white;
    font-size: 12px;
    padding: 6px;
}


/* =========================================================
   GALERÍA · CATEGORÍAS SELECCIONADAS
   ========================================================= */

.pref-summary-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: max-content;
    border-radius: 18px;
    padding: 6px 10px;
    background: linear-gradient(180deg, var(--cat-soft) 0%, rgba(0,0,0,.12) 100%);
    border: 1px solid var(--cat-border);
    box-shadow: 0 0 0 1px rgba(255,255,255,.02);
}

.pref-summary-cat-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 2px;
    color: white;
    width: 100%;
    padding: 2px 2px 0;
}

.pref-summary-cat-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.pref-summary-cat-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .3px;
    line-height: 1;
    white-space: nowrap;
}

.pref-summary-cols-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: center;
    width: max-content;
    padding: 2px 6px 4px;
}

.pref-summary-league-col-wrap {
    display: inline-flex;
    flex-direction: column;
}

.pref-summary-league-col {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    padding: 0 4px;
}

.pref-summary-league-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px;
    margin: 0 2px 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cat-soft) 0%, rgba(255,255,255,.02) 100%);
    border: 1px solid var(--cat-accent);
    color: white;
    font-size: 13px;
    white-space: nowrap;
    align-self: center;
    box-shadow: 0 0 0 1px rgba(255,255,255,.02);
}

.pref-summary-league-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.pref-summary-league-label {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pref-summary-groups-row {
    display: flex;
    gap: 6px;
    margin-top: 0;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0 2px;
}

.pref-summary-group-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cat-soft) 0%, rgba(255,255,255,.02) 100%);
    border: 1px solid var(--cat-accent);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    align-self: center;
    margin: 2px;
}

.pref-summary-group-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.pref-summary-empty-groups {
    opacity: .70;
    font-size: 12px;
    text-align: center;
    padding: 6px 0;
}


/* =========================================================
   FEDERACIONES SIN SELECCIÓN
   ========================================================= */

.pref-compact-block {
    padding: 6px 2px;
    border-radius: 12px;
}

.pref-compact-title {
    font-size: 12px;
    opacity: .75;
    margin: 6px 0 2px 2px;
    color: white;
}

.pref-compact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pref-compact-fed-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.02);
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    color: white;
    transition:
        transform .16s ease,
        background .16s ease,
        border-color .16s ease;
}

.pref-compact-fed-chip:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.06);
    border-color: rgba(46,204,113,.35);
}

.pref-compact-fed-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}


/* =========================================================
   MODAL BASE
   ========================================================= */

#modal-prefedit .modal-dialog {
    max-width: 95% !important;
    min-width: 95% !important;
    max-height: 88% !important;
    min-height: 88% !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    overflow: hidden !important;
    margin: 0 !important;
}

#modal-prefedit .modal-content {
    height: 100%;
    max-height: 88vh;
    background: #151a1c;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

.prefedit-modal-header,
#modal-prefedit .modal-header {
    padding: 0 !important;
    background: #151a1c !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    zoom: .80;
}

.prefedit-modal-header-inner {
    width: 95%;
}

.prefedit-modal-body,
#prefedit-body {
    width: 95%;
    padding: 0 !important;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
    display: block;
    background: #151a1c;
    padding-bottom: 44px !important;
    box-sizing: border-box;
    min-width: 0;
    zoom: .80;
}

.prefedit-zoom-wrapper,
#prefedit-zoom-wrapper {
    zoom: .80;
    transform-origin: top center;
    margin: 0 auto;
    width: 100%;
    display: block;
    min-width: 0;
}

.prefedit-modal-footer,
#modal-prefedit .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 4px 10px !important;
    background: rgba(0,0,0,.20) !important;
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255,255,255,.08) !important;
    zoom: .80;
}

.prefedit-footer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.prefedit-footer-left {
    display: flex;
    align-items: center;
}

.prefedit-footer-center {
    justify-self: center;
}

.prefedit-footer-right {
    justify-self: end;
    display: flex;
    align-items: center;
}

.prefedit-footer-help {
    color: #9fb;
    font-size: 12px;
    opacity: .9;
}


/* =========================================================
   MODAL · FED BAR
   ========================================================= */

.pref-feds-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,.04);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.pref-feds-strip-wrap {
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
}

.pref-feds-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    min-width: max-content;
}

.pref-fed-action {
    width: 42px;
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
    padding: 0;
    cursor: pointer;
    transition:
        transform .16s ease,
        background .16s ease,
        border-color .16s ease;
}

.pref-fed-action:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.08);
    border-color: rgba(46,204,113,.35);
}

.pref-fed-action-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.pref-fed-chip {
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    cursor: pointer;
    opacity: .58;
    position: relative;
    transition:
        opacity .16s ease,
        transform .16s ease,
        background .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}

.pref-fed-chip:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.pref-fed-chip.selected {
    opacity: 1;
    background: rgba(46,204,113,.12);
    border-color: rgba(46,204,113,.55);
    box-shadow:
        0 0 0 1px rgba(46,204,113,.10),
        0 0 18px rgba(46,204,113,.14);
}

.pref-fed-chip.has-data::after {
    content: "";
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46,204,113,.7);
}

.pref-fed-chip.no-data::after {
    content: "";
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.20);
}

.pref-fed-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}


/* =========================================================
   MODAL · TABS
   ========================================================= */

.prefedit-tabs,
#prefedit-tabs {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: white;
    margin-top: 8px;
}

#prefedit-tabs .nav-link,
.prefedit-tabs .nav-link {
    color: rgba(255,255,255,.68);
    border: none;
    border-radius: 999px;
    margin: 4px 4px 8px;
    padding: 6px 14px;
    background: rgba(255,255,255,.04);
}

#prefedit-tabs .nav-link.active,
.prefedit-tabs .nav-link.active {
    color: white;
    background: rgba(46,204,113,.16);
    border: 1px solid rgba(46,204,113,.35);
}

.prefedit-body-pane {
    width: 100%;
    min-width: 0;
}

.prefedit-body-pane.is-visible {
    display: block;
}

.prefedit-body-pane.is-hidden {
    display: none;
}


/* =========================================================
   MODAL · COLUMNAS CATEGORÍAS
   ========================================================= */

.prefedit-empty-scope {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: .70;
    font-size: 13px;
}

.prefedit-modal-cols-outer {
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 0;
    box-sizing: border-box;
}

.prefedit-modal-cols-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.prefedit-category-col {
    flex: 0 0 19.1%;
    max-width: 19.1%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 18px;
    padding: 6px 8px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.02);
    margin-bottom: 1rem;
    background: linear-gradient(180deg, var(--cat-soft) 0%, rgba(0,0,0,.16) 100%);
    border: 1px solid var(--cat-border);
}

.prefedit-category-inner {
    min-width: 0;
}

.prefedit-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    margin-top: 2px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--cat-border);
    padding-bottom: 6px;
}

.prefedit-category-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.prefedit-category-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.prefedit-category-title {
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: .3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prefedit-cat-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.prefedit-cat-action-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
    color: #fff;
    line-height: 18px;
    height: 22px;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}

.prefedit-cat-action-btn + .prefedit-cat-action-btn {
    margin-left: 6px;
}

.prefedit-cat-action-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.10);
    border-color: rgba(46,204,113,.35);
}


/* =========================================================
   MODAL · TARJETAS DE LIGA
   ========================================================= */

.prefedit-league-card {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.02);
    margin-bottom: 8px;
    overflow: hidden;
    transition:
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

.prefedit-league-card.is-selected {
    background: rgba(6,190,132,.06);
    border: 1px solid rgba(6,190,132,.35);
}

.prefedit-league-card.is-dirty {
    border: 1px solid rgba(86,180,255,.65);
    box-shadow: inset 0 0 0 2px rgba(86,180,255,.20);
}

.prefedit-league-header-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,.06);
    border: none;
    cursor: pointer;
    color: white;
    text-align: left;
}

.prefedit-league-header-btn.is-selected {
    background: rgba(6,190,132,.18);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.10);
}

.prefedit-league-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.prefedit-league-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
}

.prefedit-league-icon {
    width: 35px;
    height: 35px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.prefedit-league-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

.prefedit-league-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.15);
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

.prefedit-league-header-btn:not(.is-selected) .prefedit-league-badge {
    opacity: .70;
}

.prefedit-league-chevron {
    transition: transform .2s ease;
    opacity: .80;
    flex-shrink: 0;
}

.prefedit-league-header-btn.is-selected .prefedit-league-chevron {
    transform: rotate(180deg);
}

.prefedit-league-body {
    padding: 8px 12px 12px;
    background: transparent;
}

.prefedit-group-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255,255,255,.06);
}

.prefedit-groups-label {
    font-size: 12px;
    opacity: .80;
}

.prefedit-group-action-btn {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: white;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease;
}

.prefedit-group-action-btn:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(46,204,113,.35);
}

.prefedit-groups-wrap {
    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
    row-gap: 8px;
    margin-top: 4px;
}

.prefedit-group-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18);
    background: transparent;
    color: white;
    opacity: .65;
    transition: all .15s ease;
}

.prefedit-group-btn.is-selected {
    opacity: 1;
    border-color: rgba(255,255,255,.35);
    background: rgba(6,190,132,.20);
}

.prefedit-group-btn.is-dirty {
    border: 1px solid rgba(86,180,255,.65);
    background: rgba(86,180,255,.08);
}


/* =========================================================
   MODAL · FOOTER BUTTONS
   ========================================================= */

.prefedit-footer-btn {
    border-radius: 9999px !important;
    height: 24px !important;
    line-height: 24px !important;
    font-size: 12px !important;
    padding: 0 10px !important;
    background: rgba(255,255,255,.06) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.prefedit-footer-btn + .prefedit-footer-btn {
    margin-left: 6px;
}

.prefedit-footer-btn:hover {
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(46,204,113,.35) !important;
    color: #fff !important;
}

.prefedit-save-btn {
    border-radius: 9999px !important;
    font-weight: 700 !important;
    height: 28px !important;
    line-height: 28px !important;
    background: linear-gradient(180deg,#2ecc71 0%,#27ae60 100%) !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    box-shadow:
        0 4px 12px rgba(0,0,0,.26),
        0 3px 10px rgba(25,135,84,.28) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    font-size: 12.5px !important;
}

.prefedit-save-btn:hover {
    filter: brightness(1.05);
}


/* =========================================================
   POPOVER GALERÍA
   ========================================================= */

.popover.pref-popover-card {
    background: rgba(18,24,27,.98);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    color: white;
    box-shadow: 0 14px 35px rgba(0,0,0,.45);
    max-width: 420px;
}

.popover.pref-popover-card .popover-body {
    padding: 10px;
    color: white;
}

.pref-popover-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pref-popover-age-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.pref-popover-league-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.pref-popover-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pref-popover-title {
    font-size: 13px;
    font-weight: 800;
    color: white;
    line-height: 1.15;
}

.pref-popover-subtitle {
    font-size: 11px;
    opacity: .72;
    color: white;
    line-height: 1.15;
}

.pref-popover-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pref-popover-group-chip {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.pref-popover-group-chip.is-on {
    color: white;
    background: rgba(46,204,113,.18);
    border: 1px solid rgba(46,204,113,.42);
}

.pref-popover-group-chip.is-off {
    color: rgba(255,255,255,.58);
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
}

.pref-popover-empty {
    opacity: .70;
    font-size: 11px;
}


/* =========================================================
   SCROLLBARS
   ========================================================= */

.pref-fed-section-scopes-scroll::-webkit-scrollbar,
.pref-feds-strip-wrap::-webkit-scrollbar,
.prefedit-modal-body::-webkit-scrollbar,
.pref-raw-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.pref-fed-section-scopes-scroll::-webkit-scrollbar-track,
.pref-feds-strip-wrap::-webkit-scrollbar-track,
.prefedit-modal-body::-webkit-scrollbar-track,
.pref-raw-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,.03);
    border-radius: 999px;
}

.pref-fed-section-scopes-scroll::-webkit-scrollbar-thumb,
.pref-feds-strip-wrap::-webkit-scrollbar-thumb,
.prefedit-modal-body::-webkit-scrollbar-thumb,
.pref-raw-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.16);
    border-radius: 999px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1400px) {
    .prefedit-category-col {
        flex-basis: 24%;
        max-width: 24%;
    }
}

@media (max-width: 1100px) {
    .prefedit-category-col {
        flex-basis: 32%;
        max-width: 32%;
    }

    .pref-fed-section-title-wrap {
        flex-wrap: wrap;
    }

    .pref-fed-section-title {
        font-size: 19px;
    }
}

@media (max-width: 800px) {
    #modal-prefedit .modal-dialog {
        max-width: 98% !important;
        min-width: 98% !important;
        max-height: 94% !important;
        min-height: 94% !important;
    }

    .prefedit-category-col {
        flex-basis: 82%;
        max-width: 82%;
    }

    .prefedit-modal-cols-track {
        overflow-x: auto;
    }

    .prefedit-footer-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .prefedit-footer-left,
    .prefedit-footer-center,
    .prefedit-footer-right {
        justify-self: center;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pref-fed-section-title-wrap {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .pref-fed-section-scopes-track {
        width: max-content;
    }

    .pref-scope-block {
        flex-basis: 440px;
    }
}