/* =========================================
   INSTITUTIONAL COLORS & VARIABLES
   ========================================= */
:root {
    /* Primary Institutional Colors */
    --institutional-blue: #002D56;
    --institutional-gold: #FFD700;
    --institutional-white: #FFFFFF;

    /* Chart Color System - Cohesive & Professional */
    /* Medal Rankings (Top 3 Positions) */
    --chart-medal-gold: #FFD700;
    /* 1st place */
    --chart-medal-silver: #C0C0C0;
    /* 2nd place */
    --chart-medal-bronze: #CD7F32;
    /* 3rd place */

    /* Secondary Institutional - Non-Medal Bars (4th and Below) */
    --chart-secondary-institutional: #5B7C99;
    /* Muted blue-slate for regular bars */

    /* Accent & Trend Lines */
    --chart-accent-cyan: #17A2B8;
    /* Trend lines, interactive elements */

    /* Neutral & Support Colors */
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --dark-gray: #343A40;
    --success-green: #28A745;
    --info-blue: #17A2B8;
    --warning-orange: #FFC107;
    --danger-red: #DC3545;

    /* Animation & Transitions */
    --transition-speed: 0.3s;
}

/* =========================================
   GLOBAL STYLES
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    min-height: 100vh;
}

/* =========================================
   LOADING SCREEN
   ========================================= */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--institutional-blue), #004080);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity var(--transition-speed), visibility var(--transition-speed);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    text-align: center;
}

/* Updated logo styles: loader, navbar, and modal */
.loader-logo {
    max-width: 260px;
    width: 100%;
    height: auto;
}

.loader-container p {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* =========================================
   INSTITUTIONAL STYLES
   ========================================= */
.bg-institutional {
    background-color: var(--institutional-blue) !important;
}

.text-institutional {
    color: var(--institutional-blue) !important;
}

.bg-gold {
    background-color: var(--institutional-gold) !important;
}

.text-gold {
    color: var(--institutional-gold) !important;
}

/* =========================================
   NAVIGATION
   ========================================= */
.navbar-brand img {
    transition: transform var(--transition-speed);
}

.navbar-logo {
    max-height: 110px;
    width: auto;
    object-fit: contain;
}

.navbar-title {
    color: var(--institutional-white);
    line-height: 1.15;
}

/* Mobile/tablet auto-hide navbar animation (Bootstrap lg breakpoint) */
@media (max-width: 991.98px) {
    .navbar.sticky-top {
        transition: transform 0.28s ease;
        will-change: transform;
    }

    .navbar.sticky-top.navbar-hidden-on-scroll {
        transform: translateY(-100%);
    }
}

@media (min-width: 992px) {
    .navbar.sticky-top {
        transform: translateY(0) !important;
    }
}

/* Mobile menu redesign: modern accessible hamburger */
.custom-toggler {
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    padding: 0.45rem 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.custom-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.45);
}

.custom-toggler .toggler-icon {
    display: block;
    width: 1.35rem;
    height: 2px;
    border-radius: 999px;
    background-color: var(--institutional-white);
    margin: 0 auto;
    transition: transform var(--transition-speed), opacity var(--transition-speed), background-color var(--transition-speed);
}

.custom-toggler[aria-expanded="true"] .toggler-icon {
    background-color: var(--institutional-gold);
}

.custom-toggler[aria-expanded="true"] .toggler-icon:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.custom-toggler[aria-expanded="true"] .toggler-icon:nth-child(2) {
    opacity: 0;
}

.custom-toggler[aria-expanded="true"] .toggler-icon:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.modal-logo {
    max-height: 34px;
    width: auto;
    object-fit: contain;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    transition: all var(--transition-speed);
    position: relative;
    padding: 0.5rem 1rem !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--institutional-gold);
    transition: all var(--transition-speed);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--institutional-gold) !important;
}

/* Smooth mobile collapse transitions */
.navbar-collapse {
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.navbar-collapse.collapsing {
    opacity: 0;
    transform: translateY(-8px);
}

.navbar-collapse.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   CARDS & PANELS
   ========================================= */
.card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 3px solid var(--institutional-gold);
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* =========================================
   FORMS & INPUTS
   ========================================= */
.form-label {
    font-weight: 600;
    color: var(--institutional-blue);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control,
.form-select {
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all var(--transition-speed);
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--institutional-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 45, 86, 0.15);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-speed);
    border: none;
}

.btn-primary {
    background-color: var(--institutional-blue);
    color: var(--institutional-white);
}

.btn-primary:hover {
    background-color: #004080;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 45, 86, 0.3);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-outline-secondary {
    border: 2px solid var(--medium-gray);
    color: var(--medium-gray);
}

.btn-outline-secondary:hover {
    background-color: var(--medium-gray);
    color: white;
}

/* =========================================
   ACTIVE FILTER CHIPS
   ========================================= */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--institutional-blue);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.filter-chip:hover {
    background-color: #004080;
    transform: scale(1.05);
}

.filter-chip i {
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.filter-chip i:hover {
    transform: rotate(90deg) scale(1.2);
}

/* =========================================
   RANKING FILTER EXPERIENCE
   ========================================= */
.advanced-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-color: var(--institutional-blue);
    color: var(--institutional-blue);
    font-weight: 600;
}

.advanced-filters-toggle:hover {
    background-color: var(--institutional-blue);
    color: var(--institutional-white);
}

.advanced-filters-grid {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 45, 86, 0.12);
}

.ranking-category-accordion .accordion-item {
    border: 1px solid rgba(0, 45, 86, 0.18);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(0, 45, 86, 0.08), 0 6px 18px rgba(0, 45, 86, 0.12);
}

.ranking-category-accordion .accordion-button {
    background: linear-gradient(135deg, rgba(0, 45, 86, 0.2), rgba(0, 45, 86, 0.08));
    color: var(--institutional-blue);
    font-size: 0.98rem;
    font-weight: 700;
    padding: 0.9rem 1rem;
}

.ranking-category-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(0, 45, 86, 0.12);
    color: var(--institutional-blue);
    box-shadow: inset 0 -1px 0 rgba(0, 45, 86, 0.08);
}

.ranking-category-accordion .accordion-body {
    background-color: #ffffff;
    padding: 0.95rem;
}

.ranking-current-selection {
    color: var(--institutional-blue);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
    margin: 0;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid rgba(0, 45, 86, 0.15);
}

.category-tap-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 0 0.6rem;
    color: var(--institutional-blue);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
}

.category-tap-hint-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 45, 86, 0.1);
    box-shadow: 0 0 0 0 rgba(0, 45, 86, 0.28);
    animation: tapHintPulse 1.8s ease-in-out infinite;
}

.category-tap-hint-icon i {
    font-size: 0.95rem;
    color: var(--institutional-blue);
    animation: tapHintNudge 1.8s ease-in-out infinite;
}

.category-tap-hint.hidden {
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

@keyframes tapHintPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 45, 86, 0.24);
    }

    70% {
        transform: scale(1.04);
        box-shadow: 0 0 0 10px rgba(0, 45, 86, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 45, 86, 0);
    }
}

@keyframes tapHintNudge {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.92;
    }

    50% {
        transform: translateY(1px);
        opacity: 1;
    }
}

#categoryOnboardingModal .modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0, 45, 86, 0.2);
}

#categoryOnboardingModal.show .modal-content {
    animation: onboardingModalFadeIn 0.35s ease;
}

#categoryOnboardingModal .modal-header {
    border-bottom: 0;
    padding: 1rem 1.25rem 0.75rem;
}

#categoryOnboardingModal .modal-title {
    font-weight: 700;
    line-height: 1.25;
}

.onboarding-modal-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 280px;
    gap: 0.8rem;
    padding: 1.25rem;
}

.onboarding-modal-subtitle {
    margin: 0;
    color: var(--institutional-blue);
    font-weight: 700;
    font-size: 1rem;
}

.onboarding-modal-message {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.onboarding-category-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

#onboardingCategorySelector .onboarding-category-btn {
    min-height: 52px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0, 45, 86, 0.12);
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#onboardingCategorySelector .onboarding-category-btn:hover,
#onboardingCategorySelector .onboarding-category-btn:focus-visible {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 45, 86, 0.18);
}

#onboardingCategorySelector .onboarding-category-btn.active {
    background-color: var(--institutional-blue);
    border-color: var(--institutional-blue);
    color: var(--institutional-white);
}

#categoryOnboardingModal .modal-footer {
    border-top: 0;
    padding: 0.25rem 1.25rem 1.25rem;
}

#onboardingApplyCategoryBtn {
    font-weight: 700;
    min-width: 190px;
}

.onboarding-modal-note {
    color: #6b7280;
    font-size: 0.88rem;
}

@keyframes onboardingModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ranking-quick-search .input-group-text {
    background-color: rgba(0, 45, 86, 0.08);
    border-color: rgba(0, 45, 86, 0.2);
    color: var(--institutional-blue);
}

.ranking-quick-search .form-control {
    border-color: rgba(0, 45, 86, 0.2);
    min-height: 44px;
}

.ranking-quick-search .form-control:focus {
    border-color: var(--institutional-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 45, 86, 0.15);
}

.ranking-status-widget {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    font-family: system-ui;
    color: #101828;
    font-size: 13px;
    z-index: 9999;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transform: translate3d(0, 0, 0);
}

.ranking-status-widget:active,
.ranking-status-widget.dragging {
    cursor: grabbing;
}

.ranking-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.ranking-status-close {
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
    line-height: 1;
    color: #555;
    padding: 0 2px;
}

.ranking-status-close:hover {
    opacity: 1;
}

.ranking-status-text {
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.4;
    white-space: pre-line;
}

.ranking-refresh-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    background: #0a7c3b;
    color: #ffffff;
    transition: opacity var(--transition-speed);
}

.ranking-refresh-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.ranking-refresh-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ranking-category-buttons .category-toggle-btn {
    min-height: 42px;
    padding: 0.55rem 0.95rem;
}

.advanced-filters-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 0.95rem;
    box-shadow: 0 3px 10px rgba(0, 45, 86, 0.18);
}

.tournament-global-select {
    background: #ffffff;
    border: 1px solid rgba(0, 45, 86, 0.14);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(0, 45, 86, 0.08);
}

#tournamentControlsContent .card {
    margin-bottom: 0;
}

.tournament-results-table {
    margin-top: 0;
}

/* =========================================
   TOURNAMENT VIEW CATEGORY SELECTOR
   ========================================= */
.category-toggle-btn {
    border-radius: 20px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    transition: all var(--transition-speed);
}

.category-toggle-btn.btn-outline-primary {
    border-color: var(--institutional-blue);
    color: var(--institutional-blue);
}

.category-toggle-btn.btn-outline-primary:hover {
    background-color: var(--institutional-blue);
    color: var(--institutional-white);
    transform: scale(1.04);
}

.category-toggle-btn.btn-primary {
    background-color: var(--institutional-blue);
    border-color: var(--institutional-blue);
    color: var(--institutional-white);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 45, 86, 0.2);
}

.category-toggle-btn.btn-primary:hover {
    background-color: #004080;
    border-color: #004080;
    color: var(--institutional-white);
    transform: scale(1.05);
}

/* =========================================
   TABLE STYLES
   ========================================= */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--institutional-blue);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody tr {
    transition: all var(--transition-speed);
}

.table tbody tr:hover {
    background-color: rgba(0, 45, 86, 0.05);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table td {
    padding: 1rem;
    vertical-align: middle;
}

.ranking-pos-cell {
    white-space: nowrap;
}

.ranking-pos-content {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: max-content;
}

.ranking-pos-number {
    font-weight: 700;
    line-height: 1;
}

.ranking-actions-cell {
    min-width: 170px;
}

.ranking-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem !important;
}

.sortable::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
    transition: all var(--transition-speed);
}

.sortable:hover::after {
    opacity: 1;
}

.sortable.asc::after {
    content: '\F148';
    opacity: 1;
}

.sortable.desc::after {
    content: '\F145';
    opacity: 1;
}

/* =========================================
   MEDALS & BADGES
   ========================================= */
.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.medal-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.medal-silver {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.5);
}

.medal-bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.5);
}

.zone-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.zone-gado {
    background-color: #f2c94c;
    color: #1f2937;
}

.zone-centro {
    background-color: #eb5757;
    color: #ffffff;
}

.zone-norte {
    background-color: #9b51e0;
    color: #ffffff;
}

.zone-sur {
    background-color: #27ae60;
    color: #ffffff;
}

.zone-pacifico {
    background-color: #6c757d;
    color: #ffffff;
}

.zone-valle {
    background-color: #2f80ed;
    color: #ffffff;
}

.zone-sureste {
    background-color: #f2994a;
    color: #ffffff;
}

.zone-default {
    background-color: #e9ecef;
    color: #334155;
}

.badge {
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* =========================================
   PLAYER CARD STYLES
   ========================================= */
.player-card {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--institutional-blue), #004080);
    color: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.player-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--institutional-gold);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    margin: 0 auto 1rem;
    display: block;
}

.player-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--institutional-gold);
}

.player-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.info-item {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-label {
    font-size: 0.85rem;
    color: var(--medium-gray);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--institutional-blue);
}

/* =========================================
   COMPARISON STYLES
   ========================================= */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comparison-card {
    background: white;
    border: 2px solid var(--institutional-blue);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all var(--transition-speed);
}

.comparison-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 45, 86, 0.2);
}

#detailedRankingTableModalBody {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

#detailedRankingTableModalBody #topScrollContainer {
    height: 12px;
    margin-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

#detailedRankingTableModalBody #topScrollContent {
    height: 1px;
}

#detailedRankingTableModalBody .table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

#detailedRankingTableModalBody .table-responsive table {
    min-width: max-content;
    width: auto;
}

#detailedRankingTableModal #footerScrollContainer {
    height: 12px;
    margin-top: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

#detailedRankingTableModal #footerScrollContent {
    height: 1px;
}

.remove-player-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--danger-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.remove-player-btn:hover {
    background-color: #c82333;
    transform: rotate(90deg) scale(1.1);
}

.highlight-best {
    background-color: #d4edda;
    font-weight: bold;
}

/* =========================================
   SVG CHARTS
   ========================================= */
.svg-chart-container {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.chart-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--institutional-blue);
    margin-bottom: 1.5rem;
    text-align: center;
}

.svg-chart {
    width: 100%;
    height: auto;
    overflow: visible;
}

.comparison-chart-container {
    padding: 1.75rem;
}

.evolution-chart-container {
    padding: 1.75rem;
}

.best-performance-badge {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    background: rgba(0, 45, 86, 0.08);
    border: 1px solid rgba(0, 45, 86, 0.25);
    border-left: 4px solid var(--institutional-blue);
    color: #1e293b;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    margin: 0 auto 1rem auto;
    font-size: 0.92rem;
    line-height: 1.35;
}

.best-performance-label-title {
    font-weight: 700;
    color: var(--institutional-blue);
}

.best-performance-label-value {
    font-weight: 600;
}

.chart-selection-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 auto 1rem auto;
}

.chart-selection-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.chart-selection-pill.counted {
    color: #7c5c00;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(179, 143, 0, 0.22);
}

.chart-selection-pill.ignored {
    color: #64748b;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.chart-grid-line {
    stroke: rgba(15, 23, 42, 0.15);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.chart-axis-label {
    fill: #334155;
    font-size: 12px;
    font-weight: 500;
}

.chart-x-label {
    font-size: 11px;
}

.chart-value-label {
    fill: #1e293b;
    font-size: 11px;
    font-weight: 600;
}

@keyframes draw-trend-line {
    to {
        stroke-dashoffset: 0;
    }
}

.bar-chart-bar {
    transition: all var(--transition-speed);
    cursor: pointer;
}

.bar-chart-bar:hover {
    opacity: 0.8;
}

.comparison-bar:hover {
    opacity: 0.9;
    filter: brightness(1.05);
}

.evolution-bar {
    transition: filter 240ms ease, opacity 240ms ease;
}

.counted-evolution-bar {
    opacity: 1;
}

.ignored-evolution-bar {
    opacity: 0.32;
}

.evolution-bar:hover {
    opacity: 0.95;
    filter: brightness(1.09) drop-shadow(0 2px 4px rgba(0, 45, 86, 0.18));
}

.evolution-trend-line {
    fill: none;
    stroke: #17A2B8;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-trend-line 0.75s ease-out 0.25s forwards;
    pointer-events: none;
}

.evolution-point-marker {
    fill: #ffffff;
    stroke: #17A2B8;
    stroke-width: 2;
    transition: transform 240ms ease, filter 240ms ease;
    transform-origin: center;
    transform-box: fill-box;
}

.evolution-point-marker:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 2px rgba(23, 162, 184, 0.45));
}

.counted-point-marker {
    fill: #ffffff;
    stroke: #17A2B8;
    opacity: 1;
}

.ignored-point-marker {
    fill: #e2e8f0;
    stroke: #94a3b8;
    opacity: 0.45;
}

.best-point-marker {
    stroke: #b38f00;
    fill: #FFD700;
}

.best-performance-bar {
    stroke: #b38f00;
    stroke-width: 1.2;
}

.best-performance-label {
    fill: #8a6d00;
    font-weight: 700;
}

.counted-chart-value-label {
    fill: #0f172a;
}

.ignored-chart-value-label {
    fill: #94a3b8;
}

/* Tournament Chart Styles */
.tournament-chart-wrapper {
    position: relative;
}

.tournament-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
}

.tournament-bar {
    transition: all 240ms ease;
    cursor: pointer;
}

.tournament-bar:hover {
    opacity: 0.9;
    filter: brightness(1.08) drop-shadow(0 2px 6px rgba(0, 45, 86, 0.2));
}

.medal-gold {
    filter: drop-shadow(0 1px 3px rgba(255, 215, 0, 0.3));
}

.medal-gold:hover {
    filter: brightness(1.1) drop-shadow(0 2px 6px rgba(255, 215, 0, 0.4));
}

.medal-silver {
    filter: drop-shadow(0 1px 3px rgba(192, 192, 192, 0.2));
}

.medal-silver:hover {
    filter: brightness(1.1) drop-shadow(0 2px 6px rgba(192, 192, 192, 0.3));
}

.medal-bronze {
    filter: drop-shadow(0 1px 3px rgba(205, 127, 50, 0.2));
}

.medal-bronze:hover {
    filter: brightness(1.1) drop-shadow(0 2px 6px rgba(205, 127, 50, 0.3));
}

.tournament-name-label {
    fill: #334155;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.015em;
    text-rendering: geometricPrecision;
}

.tournament-trend-line {
    fill: none;
    stroke: #17A2B8;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-tournament-trend-line 0.8s ease-out 0.2s forwards;
    pointer-events: none;
}

.tournament-point-marker {
    fill: #ffffff;
    stroke: #17A2B8;
    stroke-width: 2;
    transition: transform 240ms ease, filter 240ms ease;
    transform-origin: center;
    transform-box: fill-box;
    cursor: pointer;
}

.tournament-point-marker:hover {
    transform: scale(1.25);
    filter: drop-shadow(0 1px 3px rgba(23, 162, 184, 0.5));
}

@keyframes draw-tournament-trend-line {
    from {
        stroke-dashoffset: 100;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* =========================================
   ACTION BUTTONS IN TABLE
   ========================================= */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    border-radius: 8px;
    border: none;
    transition: all var(--transition-speed);
}

.action-btn:hover {
    transform: translateY(-1px);
}

.btn-premium-profile {
    background: linear-gradient(135deg, #1c4587, #2f6fe4);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(28, 69, 135, 0.18);
}

.btn-premium-profile:hover {
    color: #ffffff;
    box-shadow: 0 7px 14px rgba(0, 45, 86, 0.22);
    filter: saturate(1.05);
}

.btn-premium-profile:focus-visible {
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(47, 111, 228, 0.25), 0 6px 14px rgba(0, 45, 86, 0.2);
}

.btn-compare {
    background-color: var(--warning-orange);
    color: var(--dark-gray);
    box-shadow: 0 3px 8px rgba(176, 126, 23, 0.14);
}

.btn-compare:hover {
    background-color: #e0a800;
}

.btn-compare.active {
    background-color: var(--success-green);
    color: white;
}

/* =========================================
   TOURNAMENT TABLE
   ========================================= */
.tournament-table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.tournament-table th {
    background-color: var(--institutional-blue);
    color: white;
    padding: 0.8rem;
    text-align: center;
}

.tournament-table td {
    text-align: center;
    padding: 0.8rem;
}

.tournament-table tr:nth-child(even) {
    background-color: #F8F9FA;
}

.tournament-status-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
}

.tournament-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tournament-status-badge.counted {
    color: #7c5c00;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(179, 143, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.tournament-status-badge.ignored {
    color: #64748b;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.counted-tournament-row {
    position: relative;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), rgba(255, 255, 255, 0.98));
}

.counted-tournament-row td:first-child {
    border-left: 4px solid rgba(255, 215, 0, 0.95);
}

.ignored-tournament-row {
    opacity: 0.68;
}

.ignored-tournament-row:hover,
.counted-tournament-row:hover {
    opacity: 1;
}

/* =========================================
   RESPONSIVE UTILITIES
   ========================================= */
@media (max-width: 1099.98px) {
    .navbar-brand span {
        font-size: 1rem;
    }

    .navbar-logo {
        max-height: 100px;
    }

    .loader-logo {
        max-width: 210px;
    }

    .modal-logo {
        max-height: 28px;
    }

    .card-header h5 {
        font-size: 1rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table td,
    .table th {
        padding: 0.5rem;
    }

    .tournament-status-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .tournament-status-badge {
        align-self: flex-start;
    }

    .ranking-pos-content {
        gap: 0.35rem;
    }

    .ranking-actions-cell {
        min-width: 150px;
    }

    .zone-badge {
        min-height: 28px;
        padding: 0.2rem 0.6rem;
        font-size: 0.78rem;
    }

    .ranking-action-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
    }

    .ranking-status-widget {
        width: min(220px, calc(100vw - 20px));
    }

    .action-btn {
        width: 100%;
        justify-content: center;
        white-space: nowrap;
    }

    .player-name {
        font-size: 1.4rem;
    }

    .info-value {
        font-size: 1.1rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .player-info-grid {
        grid-template-columns: 1fr;
    }

    .comparison-chart-container {
        padding: 1rem;
        margin-top: 1.25rem;
    }

    .evolution-chart-container {
        padding: 1rem;
        margin-top: 1.25rem;
    }

    .best-performance-badge {
        display: flex;
        width: 100%;
        font-size: 0.84rem;
        padding: 0.5rem 0.65rem;
        margin-bottom: 0.9rem;
    }

    .chart-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .chart-axis-label {
        font-size: 11px;
    }

    .chart-x-label {
        font-size: 10px;
    }

    .chart-value-label {
        font-size: 10px;
    }

    .advanced-filters-toggle {
        width: 100%;
        justify-content: center;
    }

    .advanced-filters-launch-btn {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }

    .ranking-category-accordion .accordion-button {
        font-size: 0.92rem;
        padding: 0.85rem 0.8rem;
    }

    .tournament-global-select {
        padding: 0.85rem;
    }

    .ranking-current-selection {
        font-size: 1rem;
        padding-bottom: 0.35rem;
    }

    .ranking-category-buttons .category-toggle-btn {
        min-height: 46px;
        font-size: 0.92rem;
        padding: 0.65rem 0.95rem;
    }

    .tournament-chart-wrapper {
        padding: 0 0.5rem;
    }

    .tournament-name-label {
        font-size: 10.5px;
        letter-spacing: 0.01em;
    }

    .tournament-trend-line {
        stroke-width: 2;
    }

    .tournament-point-marker {
        stroke-width: 1.5;
    }

    .tournament-bar-group {
        animation-delay: inherit;
    }
}

@media (max-width: 1099.98px) {

    .navbar-expand-lg .navbar-toggler {
        display: inline-flex;
    }

    .navbar-expand-lg .navbar-collapse:not(.show):not(.collapsing) {
        display: none !important;
    }

    .navbar-expand-lg .navbar-collapse.show,
    .navbar-expand-lg .navbar-collapse.collapsing {
        display: block !important;
    }

    .navbar-expand-lg .navbar-nav {
        flex-direction: column;
    }

    /* Mobile header layout updated: logo above title, balanced spacing */
    .navbar .container-fluid {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .navbar-brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        margin-right: 0;
        max-width: calc(100% - 64px);
        white-space: normal;
    }

    .navbar-brand .navbar-logo {
        margin-right: 0 !important;
        max-height: 110px;
    }

    .navbar-title {
        display: block;
        font-size: 0.96rem;
    }

    .navbar-collapse {
        width: 100%;
        margin-top: 0.5rem;
    }

    .navbar-nav {
        background-color: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        padding: 0.45rem;
    }

    .navbar-nav .nav-item {
        opacity: 0;
        transform: translateY(-6px);
        transition: opacity 0.28s ease, transform 0.28s ease;
    }

    .navbar-collapse.show .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-collapse.show .nav-item:nth-child(1) {
        transition-delay: 0.04s;
    }

    .navbar-collapse.show .nav-item:nth-child(2) {
        transition-delay: 0.08s;
    }

    .navbar-collapse.show .nav-item:nth-child(3) {
        transition-delay: 0.12s;
    }

    .navbar-collapse.show .nav-item:nth-child(4) {
        transition-delay: 0.16s;
    }
}

@media (max-width: 1099.98px) {
    .navbar .container-fluid {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        row-gap: 0.3rem;
    }

    .navbar-brand {
        grid-column: 1 / 3;
        grid-row: 1 / 3;
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        display: grid;
        grid-template-rows: auto auto;
        justify-items: center;
        align-items: center;
        gap: 0.25rem;
        text-align: center;
    }

    .navbar-brand .navbar-logo {
        grid-row: 1;
        margin-right: 0 !important;
        max-height: 110px;
    }

    .navbar-brand .navbar-title {
        grid-row: 2;
        width: 100%;
        margin-top: 4px;
        font-size: 1rem;
        text-align: center;
    }

    .navbar-toggler,
    .custom-toggler {
        grid-column: 2 / 3;
        grid-row: 1;
        justify-self: end;
        z-index: 2;
    }

    .navbar-collapse {
        grid-column: 1 / 3;
        grid-row: 3;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .navbar-title {
        font-size: 0.88rem;
    }

    .navbar-logo {
        max-height: 34px;
    }

    .loader-logo {
        max-width: 170px;
    }

    .filter-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* =========================================
   SCROLLBAR STYLING
   ========================================= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F1F1F1;
}

::-webkit-scrollbar-thumb {
    background: var(--institutional-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #004080;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.text-center {
    text-align: center;
}

.fw-bold {
    font-weight: bold;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.no-data-message {
    text-align: center;
    padding: 3rem;
    color: var(--medium-gray);
    font-size: 1.2rem;
}

.no-data-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

@media (min-width: 1100px) {
    .navbar-expand-lg .navbar-toggler {
        display: none;
    }

    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }

    .navbar-expand-lg .navbar-nav {
        flex-direction: row;
    }
}