/* ========== SHARED COMPONENTS ==========
 * Components used by 2+ pages
 * 
 * ARCHITECTURE:
 * - base.css: Global foundations (colors, variables, resets, header, buttons, utilities)
 * - styles.css: THIS FILE - Shared components used by 2+ pages
 * - [page].css: Page-specific components (index.css, live.css, etc.)
 * 
 * COMPONENTS MOVED TO OTHER FILES:
 * - Filter buttons (.filter-btn-501, .filter-btn-league) → index.css (index-only)
 * - Main content grid (.main-content) → index.css (index-only)
 * - Player header/avatar/info → player-details.css (player-details-only)
 * - Lifetime stats → player-details.css (player-details-only)
 * - Base styles (reset, body, container, header, buttons) → base.css
 * - Animations (@keyframes spin) → base.css
 */

/* Index-only styles (#closeDetails, .search-section, #playerFoundBtn, #refreshBtn) moved to index.css */

.filters-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

/* Adjust positioning of buttons in match list to align with cards, not scrollbar */
.match-list-section .filters-row {
    margin-right: 20px; /* Fine-tuned to align with match card right edge */
}

/* Adjust vertical alignment of buttons in match header to balance top and right spacing */
.match-header-row .filters-row {
    margin-top: 15px; /* Move buttons down slightly to balance top and right gaps */
    margin-bottom: 10px; /* Add bottom margin for balanced spacing */
}

/* Remove bottom margin from match header row */
.match-header-row {
    margin-bottom: 0 !important;
}

.search-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    gap: 10px;
}

.search-input {
    width: 100%;
    max-width: 350px;
    min-width: 120px;
    padding: var(--spacing-md) 15px;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition-normal);
    background: var(--color-bg-card-alt);
    color: var(--color-text-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary-dark);
}


/* .filters, #refreshBtn, #ongoingBtn moved to index.css - index-only */

.filter-select {
    padding: 10px 15px;
    border: 2px solid #ffb300;
    border-radius: 8px;
    font-size: 14px;
    background: #23234a;
    cursor: pointer;
    color: #fff;
}

.filter-select:focus {
    border-color: #ff6a00;
}

/* Date Filter Controls */
.date-filter-box {
    display: flex;
    align-items: center;
}

.date-range-select {
    padding: 10px 15px;
    border: 2px solid #ffb300;
    border-radius: 8px;
    font-size: 14px;
    background: #23234a;
    color: #fff;
    cursor: pointer;
    min-width: 120px;
}

.date-range-select:focus {
    outline: none;
    border-color: #ff6a00;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(35, 35, 74, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ffb300;
}

.date-input {
    padding: 8px 10px;
    border: 1px solid #ffb300;
    border-radius: 6px;
    font-size: 14px;
    background: #23234a;
    color: #fff;
    cursor: pointer;
}

.date-input:focus {
    outline: none;
    border-color: #ff6a00;
}

.custom-date-range span {
    color: #e0e6ed;
    font-weight: 600;
    font-size: 14px;
}

/* Match List */
/* .match-list-section base definition in index.css - shared component with page-specific overrides */

/* .match-list-scrollbox base definition in index.css with page-specific overrides */

@media (max-width: 768px) {
    .match-list-section {
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
    }
    .match-list-scrollbox {
        max-height: 35vh; /* Slightly increased for mobile */
        min-height: 0;
        overflow-y: auto;
        padding: 5px 8px 5px 0;
    }
}

/* .match-list-section h2 and .match-list defined in index.css */

.match-card {
    background: var(--gradient-horizontal);
    color: #f1f1f1;
    border-radius: var(--radius-md);
    padding: 15px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
    font-weight: 500;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.no-matches {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
    font-size: 1.1rem;
}

.match-card.ongoing {
    border-left: 4px solid var(--color-success);
}

.match-card.closed {
    border-left: 4px solid var(--color-danger);
}

.match-card.selected {
    box-shadow: 0 2px 8px #fff4, 0 0px 1px #fff1;
    outline: 2px solid #fff;
    filter: brightness(1.1);
    border-radius: 12px;
    background: #23234a;
    z-index: 2;
}

.match-card h3 {
    color: var(--color-primary) !important;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-shadow: var(--shadow-text);
    margin-bottom: var(--spacing-sm);
}

.match-card .match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--color-text-primary);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.match-card .players {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-tag {
    position: relative;
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-bg-card-alt) !important;
    border-radius: var(--radius-sm);
    padding: 2px var(--spacing-md);
    font-weight: 700;
    font-size: 1rem;
    margin: 0 var(--spacing-xs);
    min-width: 60px;
    text-align: center;
}

.winner-crown-emoji {
    position: absolute;
    top: -0.7em;
    left: -0.7em;
    font-size: 1.3em;
    line-height: 1;
    filter: drop-shadow(0 2px 4px #000a);
    margin: 0;
    vertical-align: baseline;
    pointer-events: none;
    z-index: 2;
    background: none;
    transform: rotate(-18deg);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 2px;
    margin-bottom: var(--spacing-md);
    padding-top: var(--spacing-md);
}

#pageInfo {
    font-weight: 600;
    color: #2a5298;
}

/* Match Details */
.match-details-section {
    background: var(--color-bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    /* Height managed by index.css grid layout */
}

/* League-specific styling with fixed header */
.match-details-section.league-details {
    padding: 0;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* League details container and all related styles moved to index.css - index-only */

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-header h2 {
    color: #ffb300 !important;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px #000a;
    font-size: 1.5rem;
    background: linear-gradient(90deg, #ffb300 0%, #ff6a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.match-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    color: #e0e6ed;
    font-weight: 600;
    text-shadow: 0 1px 2px #0008;
}

.status-badge {
    padding: 5px var(--spacing-md);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.ongoing {
    background: var(--color-success);
    color: var(--color-text-secondary);
}

.status-badge.closed {
    background: var(--color-danger);
    color: var(--color-text-secondary);
}

.status-badge.open {
    background: var(--color-info);
    color: var(--color-text-secondary);
}

.status-badge.completed {
    background: #7b7b8b;
    color: var(--color-text-secondary);
    font-weight: 700;
    border-radius: 16px;
    padding: var(--spacing-xs) 16px;
    font-size: 1em;
    display: inline-block;
    margin-left: var(--spacing-sm);
    letter-spacing: 1px;
    box-shadow: var(--shadow-sm);
}

/* Players Grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    row-gap: 16px;
    column-gap: 18px;
    align-items: stretch;
    justify-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 6px;
    padding: 0;
    box-sizing: border-box;
}

.player-card {
    background: var(--gradient-card);
    color: #f1f1f1;
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    border: 3px solid var(--color-primary);
    font-weight: 500;
    min-width: 280px;
    max-width: 320px;
    width: auto;
    position: relative;
    margin: var(--spacing-sm) 0;
    box-sizing: border-box;
    overflow: visible;
}

.player-card.winner {
    /* Winner styling removed - only crown indicator used */
}

.player-card h4 {
    color: #2a5298;
    margin-top: 15px;
    margin-bottom: 0px;
    font-size: 1.1rem;
    text-transform: none !important;
}

.player-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
}

.score-left-row {
    font-size: 2.1rem;
    font-weight: 900;
    color: #ffe066;
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
}

.score-left-value {
    font-size: 2.8em;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.1em;
    color: #36e36e;
    background: none;
    border-radius: 0;
    padding: 0;
    display: inline-block;
}

.score-label {
    color: #ffe066;
    font-weight: 500;
    font-size: 1rem;
    background: none !important;
    border-radius: 0;
    padding: 0;
    margin-top: 2px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-align: left;
    display: block;
}

.player-stats-row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 20px;
    width: 100%;
}

.player-card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    min-height: 100px;
    width: 100%;
    flex-wrap: nowrap;
}

.stat-label {
    color: #e0e6ed;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1.3;
    white-space: nowrap;
    text-transform: none !important;
}

.stat-label .fa-bullseye {
    color: #ffb300;
    margin-right: 2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.stat-label .fa-location-arrow {
    color: #ffb300;
    margin-right: 3px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Dart Board Section */
.dart-board-section {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 12px;
    padding: 20px;
    box-shadow: none;
    border: none;
}

.dart-board-section h3 {
    color: #2a5298;
    margin-bottom: 15px;
    text-align: center;
    background: linear-gradient(90deg, #ffb300 0%, #ff6a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    font-weight: 900;
    text-shadow: 0 2px 16px #000a, 0 0px 2px #fff2;
    color: #fff;
}

.dart-board-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto 20px auto;
    background: transparent;
    border-radius: 50%;
    box-shadow: none;
    max-width: 100%;
    border: none;
    overflow: visible;
}

#dartBoardImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#dartBoardOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.score-display {
    position: absolute;
    top: min(20px, 4%);
    left: min(20px, 4%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: min(10px, 2%) min(15px, 3%);
    border-radius: 8px;
    font-weight: 600;
    color: #e0e6ed;
    text-shadow: 0 1px 2px #0008;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
}

.current-player {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.last-throw {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    color: #e0e6ed;
    font-weight: 600;
    text-shadow: 0 1px 2px #0008;
}

.dart-history {
    max-height: 200px;
    overflow-y: auto;
    background: #181c3a;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #f1f1f1;
    font-weight: 500;
}

.dart-throw {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.dart-throw:last-child {
    border-bottom: none;
}

/* Match Statistics */
.match-stats {
    margin-top: 20px;
}

.match-stats h3 {
    margin-bottom: 15px;
    color: #fff;
    font-weight: 900;
    text-shadow: 0 2px 16px #000a, 0 0px 2px #fff2;
}

/* Leg Statistics */
.legs-stats {
    margin-bottom: 16px;
}

.legs-stats h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #ffb300;
    font-size: 1.5rem;
    font-weight: 900;
    text-shadow: 0 2px 16px #000a, 0 0px 2px #fff2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stats-grid.league-stats {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    color: #f1f1f1;
    font-weight: 500;
    border: 2px solid var(--border-primary);
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 5px;
    text-shadow: var(--shadow-text);
}

.stat-card .stat-label {
    font-size: 0.95rem;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    display: block;
    text-align: center;
    margin: 0 auto;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    background: rgba(35, 35, 74, 0.95);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 179, 0, 0.2);
}

.loading-spinner i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 8px; /* Add a little padding on mobile */
    }
    
    /* Remove all padding for modal iframe content */
    body.modal-content .container,
    iframe .container {
        padding: 8px !important;
    }
    
    .dart-board-section {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .match-details-section {
        order: -1; /* This moves match details to the top */
    }
    
    .match-list-section {
        order: 1; /* This keeps match list below */
        height: auto !important; /* Override desktop fixed height */
    }
    
    .match-details-section {
        height: auto !important; /* Override desktop fixed height */
        max-height: none; /* Remove height restriction */
        min-height: auto !important; /* Override desktop min-height */
        overflow-y: visible; /* Remove internal scrollbar */
    }
    
    /* Mobile league details - remove fixed height and scrollbar */
    .match-details-section.league-details {
        height: 100% !important;
        overflow: hidden !important;
    }
    
    .league-header-fixed {
        position: relative !important; /* Remove sticky positioning on mobile */
        border-radius: 15px !important;
    }
    
    .league-content-scrollable {
        height: 100% !important; /* Remove fixed height */
        overflow-y: auto !important; /* Remove scrollbar */
        padding: 10px 20px 20px 20px; /* Slightly more top padding for mobile */
    }
    
    /* Keep 501 and League filter buttons side by side, search box below on mobile */
    .search-filters-row {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    
    .match-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .legs-stats h2 {
        font-size: 1.3rem;
    }
    
    .league-match-detail .match-meta {
        text-align: left;
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Dart board responsive adjustments */
    .dart-board-container {
        width: min(600px, 99vw);
        height: min(600px, 99vw);
    }
    
    .score-display {
        font-size: clamp(0.7rem, 3vw, 0.9rem);
        padding: 8px 12px;
    }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .stats-grid {
        gap: 8px;
    }
    .stat-card {
        padding: 12px 8px;
    }
    .stat-card .stat-value {
        font-size: 1.3rem;
    }
    .stat-card .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 900px) {
    .search-filters-row {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }
    .filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .search-box {
        width: 100%;
        max-width: 100%;
        justify-content: stretch;
    }
    .date-filter-box {
        order: 2;
    }
    .date-range-select {
        min-width: 100px;
    }
    .custom-date-range {
        flex-wrap: wrap;
        gap: 6px;
    }
    /* Keep players in a row on tablets and larger screens */
}

@media (max-width: 600px) {
    .container {
        padding: 6px; /* Add a little padding on small screens */
    }
    
    .search-box {
        max-width: 95vw;
    }
    .search-input {
        max-width: 95vw;
    }
    
    /* Mobile phones - switch to single column for player cards */
    .players-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        justify-content: center;
    }
    
    /* Extra small screens - dart board adjustments */
    .dart-board-container {
        width: min(500px, 98vw);
        height: min(500px, 98vw);
    }
    
    .score-display {
        font-size: clamp(0.6rem, 3.5vw, 0.8rem);
        padding: 6px 10px;
        top: min(15px, 3%);
        left: min(15px, 3%);
    }
    
    /* Hide back button on mobile */
    .back-btn, #backToMainBtn {
        display: none !important;
    }
    /* Stack latest matches and top opponents vertically on mobile */
    .matches-opponents-flex {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }
    .top-opponents-list {
        margin-top: 18px !important;
    }
    /* Board stats: horizontal mode and limit buttons, board centered */
    #boardStatsModeBtnsContainer {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }
    #boardStatsModeBtns {
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
    }
    .dart-board-section {
        margin: 0 auto 12px auto !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }
    #boardStatsLimitBtnsContainer {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
        margin-top: 12px !important;
    }
    #boardStatsLimitBtns {
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;
    }
    .board-mode-btn, .board-limit-btn {
        min-width: 80px !important;
        padding: 10px 0 !important;
        font-size: 1rem !important;
        border-radius: 10px !important;
    }
    #boardStatsSection > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .container {
        padding: 5px; /* Minimal padding for very small screens */
    }
    
    .dart-board-container {
        width: min(450px, 97vw);
        height: min(450px, 97vw);
    }
    
    .score-display {
        font-size: clamp(0.5rem, 4vw, 0.7rem);
        padding: 4px 8px;
        top: min(10px, 2%);
        left: min(10px, 2%);
    }
}

/* Ultra small screens */
@media (max-width: 360px) {
    .container {
        padding: 4px; /* Ultra minimal padding */
    }
    
    .dart-board-container {
        width: min(400px, 96vw);
        height: min(400px, 96vw);
    }
    
    .score-display {
        font-size: clamp(0.4rem, 4.5vw, 0.6rem);
        padding: 3px 6px;
        top: min(8px, 2%);
        left: min(8px, 2%);
    }
}

/* Mobile horizontal scroll for set and match cards */
@media (max-width: 768px) {
    .league-cards-container {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 16px 0 24px 0;
        margin: 0 -16px 16px -16px;
        padding-left: 16px;
        padding-right: 16px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    .league-cards-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .league-cards-container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    
    .league-cards-container::-webkit-scrollbar-thumb {
        background: rgba(255, 179, 0, 0.6);
        border-radius: 3px;
    }
    
    .league-cards-container::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 179, 0, 0.8);
    }
    
    #leagueSetLegSelector {
        flex-shrink: 0;
        margin: 0;
    }
    
    #matchWinnerCard {
        flex-shrink: 0;
        margin: 0;
    }
    
    /* Add more spacing between league cards and players grid on mobile */
    .players-grid {
        margin-top: 24px;
    }
}

/* Leaderboard Tables Styling */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(35, 35, 74, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.leaderboard-table th {
    background: linear-gradient(90deg, #ffb300 0%, #ff6a00 100%);
    color: #181c3a;
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-table td {
    padding: 10px 15px;
    color: #e0e6ed;
    border-bottom: 1px solid rgba(255, 179, 0, 0.1);
    font-weight: 500;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 179, 0, 0.1);
    transition: background 0.2s ease;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* .stats-section base definition in index.css and view-stats.css with page-specific overrides */

/* Mobile responsive for leaderboard */
@media (max-width: 768px) {
    .leaderboard-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

/* Default and League panels styling - background removed for cleaner look */
#defaultDetailsPanel,
#leagueTopPlayersPanel {
    padding: 0;
}

/* Top Players background removed - cleaner look without card background */

#topPlayersTableContainer,
#leagueTopPlayersTableContainer {
    text-align: center;
    padding: 20px;
}
    
    .stats-section {
        margin-bottom: 0;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .stats-section h3 {
        font-size: 1.1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 179, 0, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(255, 179, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.8);
}

.match-details-player {
    background: rgba(35, 35, 74, 0.95) !important;
    backdrop-filter: blur(10px);
    color: #fff !important;
    border: 2px solid rgba(255, 179, 0, 0.2);
    border-radius: 16px;
    box-shadow: 0 2px 12px #0006;
    margin-bottom: 18px;
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.player-name {
    color: #ffb300 !important;
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px #000a;
    text-transform: none !important;
}
.player-stats span {
    color: #e0e6ed !important;
    font-weight: 600;
    font-size: 1.05rem;
}
.player-stats .value {
    color: #fff !important;
    font-weight: 700;
}
#matchTitle, .match-details-section h2 {
    color: #ffb300 !important;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px #000a;
}

#matchTitle span {
    color: #ffb300 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
    text-fill-color: initial !important;
}

.match-status-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-left: auto;
    min-height: 40px;
}

#matchTitle, #matchTitle * {
    color: #ffb300 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
    text-fill-color: initial !important;
}

.player-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}
.player-card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    min-height: 110px;
    width: 100%;
    flex-wrap: nowrap;
}
.score-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 70px;
    position: relative;
}
.score-left-value {
    font-size: 2.8em;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.1em;
    color: #36e36e;
    background: none;
    border-radius: 0;
    padding: 0;
    display: inline-block;
}
.score-label {
    color: #e0e6ed;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.1em;
}
.score-left-at-round {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 0.95em;
    font-weight: 400;
    opacity: 0.7;
    line-height: 1;
}
.player-stats-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 160px;
    max-width: 280px;
    overflow-wrap: break-word;
    word-break: break-word;
    margin-right: 0;
    padding: 2px 0px;
}

.player-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

/* Remove classic-layout overrides */
.player-stats.classic-layout, .player-stats.classic-layout .stat-label, .player-stats.classic-layout b {
    all: unset;
}

.winner-crown {
    position: absolute;
    top: -8px;
    left: 8px;
    font-size: 1.8rem;
    z-index: 2;
    filter: drop-shadow(0 2px 4px #000a);
    pointer-events: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    padding: 2px;
}

.dart-img {
    width: 130px;
    height: 130px;
    position: absolute;
    pointer-events: none;
    z-index: 20;
}

.league-details-cards {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.league-detail-card {
    background: linear-gradient(135deg, #23234a 60%, #2a1859 100%);
    border-radius: 12px;
    padding: 16px 22px;
    min-width: 110px;
    text-align: center;
    color: #fff;
    box-shadow: 0 2px 8px #0002;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.league-detail-card b {
    font-size: 1.05em;
    color: #ffb300;
    margin-bottom: 4px;
    font-weight: 700;
}

.league-stats-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffb300;
    margin-bottom: 12px;
    margin-top: 8px;
    letter-spacing: 1px;
}

.section-header {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    margin-top: 10px;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px #000a;
}
.participants-list {
    padding: 10px 0 10px 0;
}
.matchup-cards {
    padding: 10px 0 10px 0;
}
.league-participants, .match-stats, .league-matchups {
    padding: 14px 0 0 0;
    margin-bottom: 10px;
}

.league-round-header {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffb300;
    background: rgba(255, 179, 0, 0.08);
    border-radius: 8px;
    margin: 4px 0 10px 0;
    padding: 6px 0 6px 0;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px #0001;
}

.winner-crown-emoji {
    display: inline-block;
    font-size: 1.35em;
    margin-left: 6px;
    vertical-align: middle;
    transform: rotate(-18deg);
    line-height: 1;
    filter: drop-shadow(0 2px 4px #000a);
}

.bracket-container {
    display: flex;
    flex-direction: row;
    gap: 24px;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 32px 0;
    position: relative;
    overflow-x: auto;
    min-height: 200px;
}
.bracket-round {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}
.bracket-round-label {
    font-weight: bold;
    color: #2563eb;
    margin-bottom: 8px;
    font-size: 1.1rem;
}
.bracket-match {
    background: #dbeafe;
    border-radius: 8px;
    padding: 12px 24px;
    margin: 0 0 8px 0;
    color: #1e293b;
    font-weight: 700;
    min-width: 160px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px #0001;
    border: 2px solid #b6d0f7;
    transition: box-shadow 0.2s, border 0.2s;
}
.bracket-match.selected {
    border: 2px solid #2563eb;
    box-shadow: 0 0 12px #2563eb55;
    z-index: 2;
}
.bracket-champion {
    background: #ffe066 !important;
    color: #1e293b !important;
    border: 2px solid #ffd700 !important;
    font-weight: 900;
    box-shadow: 0 0 16px #ffd70088;
}
.bracket-match .player-tag.winner {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 8px #ffb300, 0 0 2px #fff;
}
.bracket-match .player-tag {
    margin: 2px 0;
    padding: 2px 0;
}
.bracket-round {
    min-width: 220px;
    justify-content: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#bracketLines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.league-match-detail.match-card {
    margin-bottom: 6px;
}

/* Modal Styles */
.page-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a3a 0%, #2a2a4a 100%);
    border-radius: 16px;
    width: 95%;
    height: 90%;
    max-width: 1200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 179, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 24px;
    border-bottom: 1px solid rgba(255, 179, 0, 0.2);
    background: rgba(255, 179, 0, 0.1);
    position: relative;
}

.modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-logo {
    width: 72px;
    height: auto;
    max-height: 72px;
    border-radius: 12px;
    object-fit: contain;
}

.modal-header h3 {
    color: #fff;
    margin: 0;
    font-weight: 800;
    font-size: 1.4rem;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.modal-close {
    padding: 8px 12px;
    font-size: 1.2rem;
    border-radius: 8px;
}

.modal-close:hover {
    background-color: #dc3545;
    color: #fff;
}

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Mobile adjustments for modal */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        height: 95%;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 3px 16px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-logo {
        width: 64px;
        height: auto;
        max-height: 64px;
    }
    
    .modal-header-left {
        gap: 8px;
    }
}

/* Match Statistics - Duplicate removed, using the original definition above */

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .stats-grid {
        gap: 8px;
    }
    .stat-card {
        padding: 12px 8px;
    }
    .stat-card .stat-value {
        font-size: 1.3rem;
    }
    .stat-card .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 6px;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
        justify-items: center;
        justify-content: center;
    }
} 

/* Commented-out unified card styles removed - not in use */

/* Header: constrain width and center like main page */
.header {
    max-width: 1400px;
    margin: 0 auto 20px auto;
    border-radius: 15px;
    left: 0;
    right: 0;
    position: relative;
} 


/* Removed: Conflicting scrollbox rules - using index.css definitions instead */ 

/* Remove underline from clickable player names */
.player-link, .player-link:visited, .player-link:active {
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
} 

.player-link-btn {
    text-decoration: none !important;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.player-link-btn:hover {
    color: #ffb300;
    text-decoration: underline;
    background: rgba(255, 179, 0, 0.10);
    border-radius: 6px;
}

.section-card {
  background: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  color: #f1f1f1;
  border: 2px solid rgba(255,179,0,0.2);
  padding-top: 16px;
  padding-bottom: 16px;
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 32px;
} 

/* --- Stats Tab Bar Styles --- */
.stats-tab-bar {
    display: inline-flex !important;
    width: auto !important;
    background: #23234a;
    border-radius: 10px 10px 0 0;

    box-shadow: none;
    padding: 0 !important;
    overflow: visible;
    flex: none !important;
    align-self: flex-start !important;
}
#gameStatsCard {
    padding-top: 28px !important;
}
.stats-tab {
    background: transparent;
    color: #ffb300;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 20px 8px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-bottom 0.2s;
    border-bottom: 2px solid transparent;
    margin-right: 2px;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}
.stats-tab.active {
    background: #181c3a;
    border-bottom: 2px solid #ffb300;
    color: #fff;
}
.stats-tab:not(.active):hover {
    background: #181c3a;
    color: #ffb300;
} 

.matches-opponents-flex {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-top: 0;
    margin-bottom: 18px;
}
.latest-matches-table {
    flex: 1 1 0%;
    min-width: 0;
}
.top-opponents-block {
    flex: 0 0 220px;
    max-width: 220px;
    margin-left: 12px;
    background: rgba(24,28,58,0.8);
    border-radius: 10px;
    border: 2px solid rgba(255,179,0,0.2);
    padding: 14px 16px;
    font-size: 0.98rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.matches-opponents-flex .section-title {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 5px;
    padding-bottom: 5px;
}
.matches-opponents-flex .matches-table th, .matches-opponents-flex .matches-table td {
    padding: 7px 10px;
    font-size: 0.97rem;
    vertical-align: middle;
    display: table-cell;
} 

.blank-panel {
    background: linear-gradient(135deg, #23234a 0%, #2a2a5a 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,179,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #e0e6ed;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    min-height: 220px;
} 

/* Unify all table styles to match Game Stats look */
.matches-table, .total-games-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border-width: 2.5px;
    border-style: solid;
    border-color: #ffb300;
}
.matches-table th, .total-games-table th,
.matches-table td, .total-games-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: middle;
    color: #e0e6ed;
    font-size: 1rem;
    display: table-cell;
    line-height: 1.2;
}
.matches-table th, .total-games-table th {
    background: #23234a;
    color: #ffb300;
    font-size: 1rem;
    font-weight: 900;
    border-bottom: 2px solid rgba(255,179,0,0.2);
    border-top: none;
    text-align: center !important;
    vertical-align: middle;
}
.matches-table td, .total-games-table td {
    background: #181c3a;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,179,0,0.12); /* Slight line for separation */
}
.matches-table tr:nth-child(even) td, .total-games-table tr:nth-child(even) td {
    background: #181c3a; /* Remove stripe, use single color */
}
.matches-table tr:last-child td, .total-games-table tr:last-child td {
    border-bottom: none;
} 

/* Mobile-specific table styling removed - tables now match desktop exactly */ 

/* .panel-loading-overlay defined in index.css */
/* Removed duplicate - .right-panel defined in index.css with proper overflow constraints */
/* .match-details-section display:none defined in index.css */

/* Enhanced clickable player styles */
.clickable-player {
    cursor: pointer;
    color: #e0e6ed;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
    position: relative;
}

.clickable-player:hover {
    color: #ffb300;
    background: rgba(255, 179, 0, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.2);
}


/* .panel-loading-overlay duplicate removed - defined in index.css */

/* Top Players loading overlay - no background, just spinner */
.top-players-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through */
}

.top-players-loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border: 6px solid #ffb300;
    border-top: 6px solid #ff6a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
/* .leaderboard-grid defined in index.css */

/* Marquee effect for long player names */
.marquee-player {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.marquee-player:hover {
    max-width: none;
    overflow: visible;
    position: relative;
    z-index: 10;
    background: rgba(24, 28, 58, 0.95);
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Enhanced leaderboard table styling */
.leaderboard-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 2px;
    margin-bottom: 2px;
    background: rgba(24, 28, 58, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 179, 0, 0.3);
    position: relative;
}

.leaderboard-table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffb300 0%, #ff6a00 100%);
    z-index: 1;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 10px;
    text-align: left;
    color: #e0e6ed;
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

/* Default column widths for 2-column tables (Most Matches, Most Wins, Most Losses) */
.leaderboard-table th:first-child,
.leaderboard-table td:first-child {
    width: 70%;
    max-width: 140px;
    padding-left: 15px;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
    width: 30%;
    text-align: center;
    padding-right: 15px;
}

/* Specific widths for 3-column tables (Most Bullseyes) */
.leaderboard-table:has(th:nth-child(3)) th:first-child,
.leaderboard-table:has(th:nth-child(3)) td:first-child {
    width: 55%;
    max-width: 140px;
    padding-left: 15px;
}

.leaderboard-table:has(th:nth-child(3)) th:nth-child(2),
.leaderboard-table:has(th:nth-child(3)) td:nth-child(2) {
    width: 10%;
    text-align: center;
    padding-right: 5px;
}

.leaderboard-table:has(th:nth-child(3)) th:nth-child(3),
.leaderboard-table:has(th:nth-child(3)) td:nth-child(3) {
    width: 35%;
    text-align: center;
    padding-right: 15px;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #ffb300 0%, #ff6a00 100%);
    color: #181c3a;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 15px 10px;
    position: relative;
}

.leaderboard-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.leaderboard-table tbody tr {
    background: rgba(35, 35, 74, 0.6);
    border-bottom: 1px solid rgba(255, 179, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: rgba(42, 42, 84, 0.6);
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

.leaderboard-table tbody tr:hover {
    background: rgba(255, 179, 0, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.2);
}

.leaderboard-table tbody tr:first-child {
    background: rgba(255, 179, 0, 0.1);
    border-left: 3px solid #ffb300;
}

.leaderboard-table tbody tr:nth-child(2) {
    background: rgba(255, 179, 0, 0.05);
    border-left: 3px solid #ff6a00;
}

.leaderboard-table tbody tr:nth-child(3) {
    background: rgba(255, 179, 0, 0.03);
    border-left: 3px solid #ff8c00;
}

/* .stats-section duplicate removed - defined in index.css */

.leaderboard-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.leaderboard-title {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px #000a;
}

.leaderboard-subtitle {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffc107;
  margin-top: 0.2rem;
  display: block;
}

/* .match-list-section margin handled in index.css or page-specific CSS */

/* .right-panel and .top-players-section fully defined in index.css - no overrides needed */

/* Make leaderboard/stat panels more compact - gap defined in index.css */

/* .stats-section padding/border override removed - defined in index.css */

.leaderboard-table {
  font-size: 1rem;
}

/* Reduce padding/margin for panel containers */
#topPlayersTableContainer, #leagueTopPlayersTableContainer {
  padding: 0;
  margin: 0;
}

/* If there is a box-shadow or border, make it thinner */
/* .stats-section overrides removed - handled in index.css */

/* Decrease the border-radius of the leaderboard table header for a less beveled look */
.leaderboard-table thead tr,
.leaderboard-table thead th {
  border-radius: 0 !important;
}
.leaderboard-table thead th {
  border-radius: 0 !important;
}

/* Decrease gap between stat section title and table */
/* .stats-section h3 margin override removed - handled in index.css */

/* Allow player names to use available space in leaderboard tables */
.leaderboard-table td {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

.marquee-player, .clickable-player {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  max-width: none !important;
  display: inline;
}

/* All .stats-section overrides consolidated in index.css */

#topPlayersTableContainer, #leagueTopPlayersTableContainer {
  margin: 0 !important;
  padding: 0 !important;
}

.leaderboard-table th {
  background: rgba(35, 35, 74, 0.85) !important;
  color: #e0e6ed !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0.2px !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  .match-list-section {
    order: 1;
  }
  .top-players-section {
    order: 2;
  }
}

@media (max-width: 768px) {
  .leaderboard-grid,
  #topPlayersTableContainer .leaderboard-grid,
  #leagueTopPlayersTableContainer .leaderboard-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
}

/* Abandoned player styles - only badge, no card changes */

.abandoned-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  background: #e74c3c;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 20;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Winner badge styles */
.winner-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f39c12 0%, #27ae60 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 20;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tournament Modal Styles */
/* Tournament bracket styles moved to tournament-bracket.css */

.player.abandoned {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    opacity: 0.7;
}

.player-name {
    color: #e0e6ed;
    font-weight: 600;
    flex: 1;
}

.abandoned-badge {
    background: #f44336;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Header actions styling */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.completed-badge {
    background: #27ae60;
    color: #fff;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px #27ae6022;
}

.winning-dart-emoji {
  position: absolute;
  top: -2px;
  left: -2px;
  font-size: 0.95em;
  pointer-events: none;
  z-index: 3;
}

.dart-throw-cell {
  position: relative;
}

.score-left-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #23234a;
    border-radius: 12px;
    box-shadow: 0 4px 16px 2px #0006;
    padding: 0.1em 0.4em 0.1em 0.4em;
    width: 110px;
    min-height: 70px;
    margin-bottom: 0.2em;
}

.match-card-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.match-id-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 600px) {
  .match-card-row {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .match-date {
    text-align: left;
    margin-bottom: 2px;
  }
  .match-id-status {
    justify-content: flex-end;
    /* Remove text-align: right; */
  }
  .match-id {
    text-align: left;
    flex-grow: 1;
  }
  
  .match-card.tournament .tournament-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important; /* Increased gap between rows */
    padding: 12px !important; /* More padding on mobile */
    margin: 12px 0 !important; /* More margin on mobile */
    flex-wrap: nowrap !important; /* Override desktop flex-wrap */
  }
  
  .match-card.tournament .tournament-info-item {
    width: 100% !important; /* Full width to ensure each item takes its own row */
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: left !important;
    white-space: normal !important; /* Allow text wrapping on mobile */
    flex: none !important; /* Override desktop flex: 1 */
    min-width: auto !important; /* Override desktop min-width: 0 */
  }
  
  .match-card.tournament .tournament-info span {
    font-size: 0.9rem !important; /* Slightly larger text on mobile */
    line-height: 1.4 !important; /* Better line height for readability */
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  
  .match-card.tournament h3 {
    font-size: 1.2rem; /* Larger title on mobile */
    margin-bottom: 12px;
  }
  
  .match-card.tournament .match-meta {
    flex-direction: column; /* Stack date and status vertically on mobile */
    align-items: flex-start;
    gap: 8px;
  }
  
  .match-card.tournament .date-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
}

/* Tournament cards in league history */
.match-card.tournament {
  border-left: 4px solid #ffb300;
  background: linear-gradient(90deg, #23234a 60%, #1e3c72 100%);
}

.match-card.tournament h3 {
  color: #ffb300;
}

.match-card.tournament .tournament-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin: 8px 0;
  padding: 8px;
  background: rgba(255, 179, 0, 0.1);
  border-radius: 6px;
  flex-wrap: wrap;
}

.match-card.tournament .tournament-info span {
  font-size: 0.85rem;
  color: #e0e6ed;
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-card.tournament .tournament-info-item {
  flex: 1;
  text-align: center;
  min-width: 0;
  white-space: nowrap;
}

.tournament-queue-preview {
  margin-top: 8px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border: 1px solid #444;
}

.queue-count {
  font-size: 0.8rem;
  color: #ffb300;
  font-weight: 600;
}

/* Tournament details styles */
.tournament-details-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tournament-details-header {
  flex-shrink: 0;
  padding: 20px 20px 0 20px;
  background: inherit;
  z-index: 10;
}

.tournament-details-scrollable {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.tournament-info-section {
  margin-bottom: 30px;
}

.tournament-info-section h3 {
  color: #ffb300;
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: 2px solid #ffb300;
  padding-bottom: 8px;
}

.tournament-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.tournament-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255, 179, 0, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 179, 0, 0.3);
}

.meta-label {
  font-weight: 600;
  color: #ffb300;
}

.meta-value {
  color: #e0e6ed;
  font-weight: 500;
}

.tournament-queue-section {
  margin-top: 20px;
}

.tournament-queue-section h3 {
  color: #ffb300;
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.queue-players-list {
  max-height: 300px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.queue-player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(255, 179, 0, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 179, 0, 0.2);
}

.queue-player-item:last-child {
  margin-bottom: 0;
}

.join-time {
  font-size: 0.8rem;
  color: #888;
}

.no-players {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 20px;
}

.tournament-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* When tournament details are shown, ensure full width */
.match-details-section:has(.tournament-details-content) {
  width: 100%;
  max-width: none;
}

/* Status badges for tournaments */
/* .status-badge variants duplicate removed - defined above at line 343 */

.status-badge.scheduled {
  background: #f39c12;
  color: var(--color-text-secondary);
}

.divider {
  color: #ffb300 !important;
  font-weight: bold !important;
  margin: 0 8px !important;
  opacity: 0.8 !important;
}

.tournament-info-item .divider {
  color: #ffb300 !important;
  font-weight: bold !important;
  margin: 0 8px !important;
  opacity: 0.8 !important;
  display: inline-block !important;
  font-size: 1.2em !important;
  text-shadow: 0 0 3px rgba(255, 179, 0, 0.5) !important;
}

/* Yellow styling for Players and Format in tournament details */
.tournament-meta-item .meta-value.yellow-text {
  color: #ffb300 !important;
  font-weight: bold !important;
}

.tournament-meta-item .meta-label.yellow-text {
  color: #ffb300 !important;
  font-weight: bold !important;
}

/* League Sets and Legs Chart Styles */
.set-card {
    background: linear-gradient(135deg, #2a2a5a 0%, #23234a 100%);
    border: 2px solid rgba(255, 179, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    min-width: 200px;
    transition: all 0.3s ease;
}

.set-card.active {
    border-color: rgba(255, 179, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 179, 0, 0.2);
}

.set-card.completed {
    border-color: rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, #2a5a2a 0%, #234a23 100%);
}

.set-header {
    margin-bottom: 12px;
}

.set-title {
    color: #e0e6ed;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.legs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leg-item {
    display: flex;
    justify-content: center;
}

.leg-text {
    /* Basic layout and spacing */
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed back to space-between for proper alignment */
    padding: 4px 16px; /* Further reduced padding for more compact rows */
    margin: 0 8px; /* Remove vertical margin to prevent gaps */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease; /* Increased transition time for smoother animations */
    min-height: 28px; /* Further reduced height for more compact rows */
    
    /* Text styling */
    color: #e0e6ed;
    font-size: 0.95rem;
    font-weight: 500;
    
    /* Prevent text overflow */
    overflow: hidden;
    white-space: nowrap;
    
    /* Add transparent border to prevent layout shift */
    border: 1px solid transparent;
}

/* Add proper spacing for first leg from top border */
.leg-text:first-child {
    margin-top: 6px; /* Added more space above the first leg for better separation from badge */
}

/* Ensure proper spacing for Set Winner from bottom border */
.set-winner-section {
    border-top: 1px solid #665c4a;
    padding: 6px 16px; /* Further reduced padding for more compact layout */
    margin: 0 8px;
    background: rgba(255, 179, 0, 0.02);
    border-radius: 0 0 6px 6px;
    margin-top: 1px; /* Further reduced gap above Set Winner */
    margin-bottom: 1px; /* Further reduced gap below Set Winner */
}

/* Subtle background effect on click for selected leg */
.leg-text.active {
    background: rgba(255, 179, 0, 0.15) !important; /* More visible background */
    border-color: rgba(255, 179, 0, 0.4) !important; /* More visible border */
    box-shadow: inset 0 1px 3px rgba(255, 179, 0, 0.2), 0 0 8px rgba(255, 179, 0, 0.1) !important; /* Enhanced shadow */
    transform: scale(1.02); /* Slight scale effect */
}

/* Hover effect - very subtle */
.leg-text:hover {
    background: rgba(255, 179, 0, 0.04);
}

/* Ensure text containers don't overlap */
.leg-text > div {
    padding: 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leg-text > div:first-child {
    text-align: left;
    margin-right: 16px;
    flex: 0 0 auto; /* Don't grow, don't shrink */
    min-width: 60px;
}

.leg-text > div:last-child {
    text-align: right;
    margin-left: auto; /* Push to the right */
    flex: 0 0 auto; /* Don't grow, don't shrink */
}

.set-winner-section > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 24px; /* Ensure consistent height */
}

.set-winner-section > div > div:first-child {
    font-weight: 600;
    color: #e0e6ed;
    font-size: 1rem;
}

.set-winner-section > div > div:last-child {
    font-size: 1.05rem;
    color: #aaa;
    font-weight: 400;
}

/* Style the winner text spans */
.set-winner-section span {
    font-size: 1.05rem;
    font-weight: 400;
}

/* Queue Status Indicator Styles */
.queue-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.active {
    background: #27ae60;
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.6);
}

.status-dot.inactive {
    background: #95a5a6;
}

.status-text {
    font-size: 0.9rem;
    color: #bdc3c7;
    font-weight: 500;
}

/* Enhanced Tournament Queue Styles */
.tournament-queue-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.queue-players-list {
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.queue-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin: 8px 0;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out;
}

.queue-player-item:hover {
    background: rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.queue-player-item .player-tag {
    font-weight: 600;
    color: #e0e6ed;
    font-size: 1rem;
}

.join-time {
    font-size: 0.85rem;
    color: #95a5a6;
    font-style: italic;
}

.no-players {
    text-align: center;
    padding: 30px;
    color: #95a5a6;
    font-style: italic;
    background: rgba(149, 165, 166, 0.1);
    border-radius: 6px;
    border: 1px dashed rgba(149, 165, 166, 0.3);
}

/* Animation for new players joining */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for players leaving */
.queue-player-item.leaving {
    animation: fadeOutDown 0.3s ease-in forwards;
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Tournament Actions */
.tournament-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(52, 152, 219, 0.2);
}

/* Notification Styles */
.notification-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 300px;
    word-wrap: break-word;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== ALL PLAYERS PAGE - COMPACT CARDS ========== */

/* Layout the filters row with search on left */
.filters-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    margin-left: 0;
    padding-left: 0;
    flex-wrap: wrap;
}

.filters-row .search-box {
    flex-shrink: 0;
    margin-left: 0;
}

.filters-row .filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
}

/* Responsive player cards grid */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    width: 100%;
}

.players-grid .player-card {
    padding: 12px 16px;
    min-height: auto;
    position: relative;
}

/* Platform label that overlaps the top border */
.platform-label {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Platform-specific colors */
.platform-oculus {
    background: linear-gradient(90deg, #ffffff 0%, #f0f0f0 100%);
    color: #333;
}

.platform-psvr {
    background: linear-gradient(90deg, #0070f3 0%, #0051cc 100%);
    color: white;
}

.platform-playstation {
    background: linear-gradient(90deg, #0070f3 0%, #0051cc 100%);
    color: white;
}

.platform-steam {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

/* Clickable logo styling */
.clickable-logo {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.clickable-logo:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.player-name {
    font-size: 16px;
    margin-bottom: 4px;
    color: #ff6a00;
}

.player-name.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.player-name.clickable:hover {
    color: #ff8a00;
    text-decoration: underline;
}

/* Online player indicator - green border */
.player-card.online-player {
    border: 3px solid #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.player-stats {
    margin-bottom: 8px;
}

.player-stats .stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.player-stats .stat-label {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.player-stats .stat-value {
    font-size: 14px;
    color: #e0e6ed;
    font-weight: 500;
}

/* Infinite scroll loader */
.infinite-scroll-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #ffb300;
    font-size: 14px;
}

.infinite-scroll-loader i {
    font-size: 16px;
}

/* Status label */
.status-label {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.status-online {
    background: #28a745;
    color: white;
}

.status-offline {
    background: #6c757d;
    color: white;
}

.status-away {
    background: #ffc107;
    color: #2a1c59;
}

.status-busy {
    background: #dc3545;
    color: white;
}

.status-in-game {
    background: #007bff;
    color: white;
}

/* Online toggle button */
.online-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #ffb300;
    background: transparent;
    color: #ffb300;
    transition: all 0.3s ease;
    min-width: 180px;
    justify-content: center;
}

.online-toggle:hover {
    background: #ffb300;
    color: #2a1c59;
}

.online-toggle.active {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.online-toggle i {
    font-size: 8px;
}

/* Social sections */
.player-social {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.social-section {
    flex: 1;
}

.social-section h4 {
    font-size: 12px;
    color: #ff6a00;
    margin-bottom: 4px;
}

.friends-list, .blocked-list {
    font-size: 10px;
    color: #ccc;
    line-height: 1.3;
}

.friend-item {
    color: #4CAF50;
}

.blocked-item {
    color: #f44336;
}

.more-count {
    color: #999;
    font-style: italic;
}

.no-data {
    color: #666;
    font-style: italic;
}

/* Responsive breakpoints for player cards */
@media (max-width: 768px) {
    .players-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 12px;
    }
}

@media (min-width: 1025px) and (max-width: 1400px) {
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 12px;
    }
}

@media (min-width: 1401px) {
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 12px;
    }
}

/* Desktop view - datetime information display */
@media (min-width: 1025px) {
    /* League details: Hide both start and close dates */
    .league-details-container .match-meta {
        display: none !important;
    }
    
    /* 501 details: Hide start date, keep close date */
    .match-details-section:not(.league-details) .match-meta span[id="matchDate"] {
        display: none !important;
    }
    
    /* Tournament matches within league: Always show dates */
    .league-match-detail .match-meta {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
}

/* Opponent search input placeholder styling - only when not focused */
#opponent-search-501:not(:focus)::placeholder,
#opponent-search-zombies:not(:focus)::placeholder,
#opponent-search-killstreak:not(:focus)::placeholder,
#opponent-search-league:not(:focus)::placeholder {
    color: #ffb300;
    opacity: 1;
    font-weight: 900;
}

