/* TOURNAMENT V2 - STRICTLY MATCHING INDEX V2 */

/* General overrides to ensure consistency */
.main-content {
    position: relative;
    z-index: 10;
    padding-top: 120px;
    padding-bottom: 60px;
}


/* Container Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Titles */
.tournament-title, .current-tournament-name, .bracket-column-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: white;
    letter-spacing: -1px;
    text-align: center;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-align: center;
}

.tournament-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 3rem;
}

.tournaments-header, .matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.tournaments-header .section-title, .matches-header .section-title {
    margin-bottom: 0;
    text-align: left;
}

/* Tournament Grid (like features-grid-v2) */
.tournaments-grid, .matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards (like feature-card-v2) */
.tournament-card, .match-card, .match-card-new {
    background: #0a0b10;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.tournament-card:hover, .match-card:hover, .match-card-new:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.tournament-card-title, .player-name-new, .player-name-match {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}
.tournament-card-dates, .match-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.tournament-card-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}
.tournament-stat-value, .player-score-new, .player-score {
    font-size: 1.5rem;
    font-weight: 900;
    color: #8b5cf6;
}
.tournament-stat-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

/* Buttons (like btn-cta-v2) */
.btn-primary, .btn-add-tournament, .btn-add-match, .match-update-btn, .btn-save-bracket {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #8b5cf6;
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-primary:hover, .btn-add-tournament:hover, .btn-add-match:hover, .match-update-btn:hover, .btn-save-bracket:hover {
    background: #7c3aed;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary, .btn-delete, .btn-remove-participant {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 0;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-back:hover {
    color: white;
    transform: translateX(-3px);
}

/* Tournament Header override injected JS styles */
.tournament-header-section {
    background: transparent !important;
    border: none !important;
}

/* Tabs (Pill style matching image) */
.tournament-tabs {
    display: flex !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 100px !important;
    padding: 6px !important;
    gap: 0 !important;
    margin: 40px auto !important;
    border-bottom: none !important;
    width: fit-content !important;
}

.tournament-tab, .matchday-tab {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 100px !important;
    padding: 10px 24px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-bottom: none !important;
}

.tournament-tab:hover, .matchday-tab:hover {
    color: white !important;
}

.tournament-tab.active, .matchday-tab.active {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.5) !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.5) !important;
}

/* Leaderboard (Solid table matching V2) */
.leaderboard-table {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    max-width: 1000px;
    margin: 0 auto;
    transition: all 0.3s ease;
}
.leaderboard-table:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.leaderboard-table table {
    width: 100%;
    border-collapse: collapse;
}
.leaderboard-table th {
    padding: 15px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-transform: uppercase;
}
.leaderboard-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-weight: 600; /* Increased from 500 */
    font-size: 1rem;
}
.leaderboard-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.leaderboard-table .player-name {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
}

.leaderboard-table .points-cell {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #8b5cf6 !important;
}

.position-cell {
    font-size: 1.2rem !important;
    color: #8b5cf6 !important;
    font-weight: 900 !important;
}

/* Groups Grid (Multi-group leaderboard) */
.groups-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)) !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
}

@media (min-width: 1200px) {
    .groups-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important; /* Forces 2/3 per row */
    }
}

.group-table-wrapper {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
}

.group-table-wrapper:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.group-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: white !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
    font-family: 'Outfit', sans-serif !important;
}

.group-table-wrapper .leaderboard-table {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    max-width: none !important;
}

/* Qualify Third Place (Best 4) */
.qualify-third {
    background: rgba(168, 85, 247, 0.08) !important;
    border-left-color: #a855f7 !important;
}
.qualify-third:hover {
    background: rgba(168, 85, 247, 0.15) !important;
}
.legend-color.third-place {
    background: #a855f7 !important;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }

.modal-content {
    background: #0a0b10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: white;
}
.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 20px; right: 20px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: white;
}

/* Utilities */
.admin-only { display: none; }

/* ========================================
   MATCHES STAGE STYLES (V2 SOLID)
   ======================================== */

.matches-grid-new {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important;
}

.match-card-new {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

.match-card-new:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Fix "Match 1Group A" spacing */
.match-header-new {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    margin-bottom: 1rem !important;
    font-family: 'Outfit', sans-serif !important;
}
.match-number::after {
    content: " - " !important;
}

.match-result-new {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex: 1 !important;
}

/* Truncate long names to prevent overflow */
.player-info-new {
    min-width: 0 !important; /* Required for flex children to truncate text */
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0 10px !important;
}

.player-name-new {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: white !important;
    font-family: 'Outfit', sans-serif !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
}

.player-score-new {
    font-size: 2rem !important;
    font-weight: 900 !important;
    color: #8b5cf6 !important;
    line-height: 1 !important;
}

.match-vs-new {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.3) !important;
    padding: 0 5px !important;
    flex-shrink: 0 !important;
}

/* V2 Button styling for Edit Result */
.btn-edit-result {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 100px !important;
    color: white !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    transition: all 0.3s ease !important;
    margin-top: 1.5rem !important;
    width: 100% !important;
    cursor: pointer !important;
}
.btn-edit-result:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* If button has been clicked/Update Result state */
.btn-edit-result.match-update-btn {
    background: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
}
.btn-edit-result.match-update-btn:hover {
    background: #7c3aed !important;
}

/* Inputs for edit mode */
.score-input {
    width: 50px !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: white !important;
    padding: 5px !important;
}
.score-input:focus {
    outline: none !important;
    border-color: #8b5cf6 !important;
}

/* ========================================
   KNOCKOUT STAGE STYLES (V2 SOLID)
   ======================================== */

.knockout {
    padding: 2rem 0;
}

/* Playoff Section (Separate) */
.playoff-section {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playoff-section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: white;
    font-family: 'Outfit', sans-serif;
}

.playoff-description {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.playoff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.playoff-match {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.playoff-match:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.playoff-match-header {
    text-align: center;
    font-size: 0.8rem;
    color: #8b5cf6;
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.playoff-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.playoff-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.playoff-team.winner {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.playoff-team-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.playoff-team-score {
    font-size: 1.75rem;
    font-weight: 900;
    color: white;
}

.playoff-score-input {
    width: 60px;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    text-align: center;
    font-weight: bold;
}

.playoff-score-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.playoff-vs {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.playoff-qualifier {
    margin-top: 1rem;
    padding: 0.625rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
    text-align: center;
}

.playoff-qualifier-text {
    font-size: 0.75rem;
    color: #a855f7;
    font-weight: 600;
}

.btn-edit-playoff {
    width: 100%;
    margin-top: 1rem;
    padding: 0.625rem;
    background: #8b5cf6;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit-playoff:hover {
    background: #7c3aed;
}

/* Tournament Bracket Container */
.bracket-container {
    margin-top: 3rem;
    overflow-x: auto;
    overflow-y: visible;
    padding: 2rem 0;
    width: 100%;
}

.bracket-wrapper {
    display: flex;
    gap: 220px;
    min-width: 2680px;
    width: max-content;
    padding: 2rem;
    align-items: center;
}

/* Bracket Columns */
.bracket-column {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 260px;
}

.bracket-column-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: white;
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
}

.bracket-matches {
    position: relative;
    min-height: 900px;
}

/* Bracket Match Card - Grid Layout */
.bracket-match {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    padding: 0;
    width: 260px;
    height: 90px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: absolute;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bracket-match:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    z-index: 10;
}

.bracket-team {
    display: grid;
    grid-template-columns: 2fr 28px 28px 40px;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    height: 45px;
    box-sizing: border-box;
    position: relative;
}

.bracket-team:last-child {
    border-bottom: none;
}

.bracket-team.winner {
    background: rgba(139, 92, 246, 0.1);
}

.bracket-team.winner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #a855f7;
}

.bracket-team-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 0.25rem;
    font-family: 'Outfit', sans-serif;
}

.bracket-leg-score {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    padding: 0.25rem 0.15rem;
    width: 28px;
    box-sizing: border-box;
}

.bracket-score-input {
    width: 28px;
    padding: 0.25rem 0.15rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
    text-align: center;
    font-weight: 700;
    box-sizing: border-box;
}

.bracket-score-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.bracket-agg-score {
    text-align: center;
    font-size: 1rem;
    font-weight: 900;
    color: #a855f7;
    background: transparent;
    padding: 0.25rem 0.2rem;
    width: 40px;
    box-sizing: border-box;
}

/* ABSOLUTE POSITIONING - match height = 90px, gap = 20px */
.bracket-column:nth-child(1) .bracket-match:nth-child(1) { top: 0; }
.bracket-column:nth-child(1) .bracket-match:nth-child(2) { top: 110px; }
.bracket-column:nth-child(1) .bracket-match:nth-child(3) { top: 220px; }
.bracket-column:nth-child(1) .bracket-match:nth-child(4) { top: 330px; }
.bracket-column:nth-child(1) .bracket-match:nth-child(5) { top: 440px; }
.bracket-column:nth-child(1) .bracket-match:nth-child(6) { top: 550px; }
.bracket-column:nth-child(1) .bracket-match:nth-child(7) { top: 660px; }
.bracket-column:nth-child(1) .bracket-match:nth-child(8) { top: 770px; }

.bracket-column:nth-child(2) .bracket-match:nth-child(1) { top: 0; }
.bracket-column:nth-child(2) .bracket-match:nth-child(2) { top: 110px; }
.bracket-column:nth-child(2) .bracket-match:nth-child(3) { top: 220px; }
.bracket-column:nth-child(2) .bracket-match:nth-child(4) { top: 330px; }
.bracket-column:nth-child(2) .bracket-match:nth-child(5) { top: 440px; }
.bracket-column:nth-child(2) .bracket-match:nth-child(6) { top: 550px; }
.bracket-column:nth-child(2) .bracket-match:nth-child(7) { top: 660px; }
.bracket-column:nth-child(2) .bracket-match:nth-child(8) { top: 770px; }

.bracket-column:nth-child(3) .bracket-match:nth-child(1) { top: 55px; }
.bracket-column:nth-child(3) .bracket-match:nth-child(2) { top: 275px; }
.bracket-column:nth-child(3) .bracket-match:nth-child(3) { top: 495px; }
.bracket-column:nth-child(3) .bracket-match:nth-child(4) { top: 715px; }

.bracket-column:nth-child(4) .bracket-match:nth-child(1) { top: 165px; }
.bracket-column:nth-child(4) .bracket-match:nth-child(2) { top: 605px; }

.bracket-column:nth-child(5) .bracket-match:nth-child(1) { top: 385px; }

/* When Round of 16 is hidden (e.g. 20-player tournaments), the playoff column
   has the same number of matches as Quarter Finals and connects 1:1, so its
   matches must align with the Quarter Finals positions. */
.bracket-wrapper.no-r16 .bracket-column:nth-child(1) .bracket-match:nth-child(1) { top: 55px; }
.bracket-wrapper.no-r16 .bracket-column:nth-child(1) .bracket-match:nth-child(2) { top: 275px; }
.bracket-wrapper.no-r16 .bracket-column:nth-child(1) .bracket-match:nth-child(3) { top: 495px; }
.bracket-wrapper.no-r16 .bracket-column:nth-child(1) .bracket-match:nth-child(4) { top: 715px; }

/* Winner Column */
.winner-column {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 100px;
}

.bracket-winner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    min-width: 250px;
    text-align: center;
}

.winner-trophy {
    font-size: 4rem;
    animation: trophy-bounce 2s ease-in-out infinite;
}

.winner-trophy-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.bracket-save-container {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.winner-name {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    font-family: 'Outfit', sans-serif;
}

/* TBD State */
.tbd-team {
    font-style: normal;
    color: rgba(255, 255, 255, 0.4);
}

.tbd-score {
    color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
    .bracket-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile Fixes */
@media (max-width: 768px) {
    /* Override JS-injected mobile cards and enforce standard compact table */
    .group-table-wrapper {
        padding: 10px 5px !important;
    }
    .leaderboard-table {
        overflow-x: visible !important;
        padding: 0 !important;
    }
    .leaderboard-table table {
        display: table !important;
        width: 100% !important;
        min-width: 0 !important;
        font-size: 0.75rem !important; /* Smaller font to fit everything */
        table-layout: fixed !important; /* Prevent columns from auto-expanding too much */
    }
    .leaderboard-table thead {
        display: table-header-group !important;
    }
    .leaderboard-table tbody {
        display: table-row-group !important;
    }
    .leaderboard-table tr {
        display: table-row !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    /* Sizing for columns to guarantee fit */
    .leaderboard-table th, .leaderboard-table td {
        display: table-cell !important;
        padding: 8px 2px !important; /* Minimal padding */
        text-align: center !important;
        overflow: hidden !important;
    }
    /* Let the player column take more space, rest take less */
    .leaderboard-table th:nth-child(2),
    .leaderboard-table td:nth-child(2) {
        width: 35% !important;
        text-align: left !important;
        padding-left: 5px !important;
    }
    /* Truncate long player names */
    .leaderboard-table .player-name {
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        vertical-align: middle !important;
    }
    .leaderboard-table td::before {
        display: none !important;
    }
}
