/* Modern Player Profile Styles with Consistent Spacing */
:root {
    --primary-color: var(--player-primary-color, #0A1931);
    --secondary-color: var(--player-secondary-color, var(--player-primary-color, #0A1931));
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Consistent Spacing Variables */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}
    
    /* Align container with global layout system */
    .container {
        overflow-x: visible;
    }
    
    /* Profile Page Wrapper - RESPONSIVE */
    .profile-page-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
    }

    /* Hero Section - Matching query bubble */
    .hero-section {
        background: var(--primary-color);
        padding: var(--spacing-2xl) var(--spacing-lg) 0; /* Remove bottom padding so image can sit flush */
        margin-bottom: 0.25rem;
        position: relative;
    }

    .hero-background {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0.2;
        background:
            radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 52%),
            radial-gradient(circle at 82% 8%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 48%);
        z-index: 0;
    }

    .hero-content {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: flex-end; /* Bottom align items for a flush edge */
        justify-content: center;
        gap: 2rem;  /* Match home-gap */
        height: 100%;
    }

    .player-header {
        display: flex;
        align-items: center;
        gap: 2rem;
        flex: 1;
    }

    .player-image-container {
        position: relative;
        flex-shrink: 0;
        width: min(300px, 24vw); /* Larger image */
        max-width: 300px;
        height: min(300px, 24vw);
        margin-bottom: 0; /* Keep flush with bottom of colored hero */
        z-index: 3;
        align-self: auto;
    }

    .player-main-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
        border: none;
        outline: none;
        box-shadow: none;
    }

    .jersey-number {
        position: absolute;
        bottom: -5%;
        right: -5%;
        background: white;
        color: var(--primary-color);
        width: min(40px, 4vw);
        height: min(40px, 4vw);
        min-width: 30px;
        min-height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: clamp(0.8rem, 1.5vw, 1.1rem);
        box-shadow: var(--shadow-md);
        border: 2px solid var(--primary-color);
    }

    .player-info-header {
        color: white;
        flex: 1;
    }

    .player-info-header .player-name {
        font-size: clamp(1.6rem, 3.2vw, 2.4rem); /* Noticeably larger */
        font-weight: 700;
        margin: 0;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    }

    .player-meta-info {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
        margin-top: 0.75rem;
        opacity: 0.95;
    }

    .meta-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: clamp(1rem, 1.7vw, 1.1rem); /* Larger for readability */
    }

    .meta-item i {
        opacity: 0.8;
    }

    /* Quick Stats */
    .quick-stats {
        display: flex;
        gap: 2rem;
        flex-wrap: wrap;
    }

    .stat-item {
        text-align: center;
        color: white;
    }

    .stat-value {
        font-size: 2.4rem; /* Larger */
        font-weight: 700;
        margin: 0;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
        color: white;
    }

    .stat-label {
        font-size: clamp(0.8rem, 1.3vw, 0.95rem); /* Larger */
        opacity: 0.9;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: white;
    }

    /* Bookmark Button - Top Right Icon */
    .bookmark-btn {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        z-index: 10;
    }

    .bookmark-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
        border-color: rgba(255, 255, 255, 0.5);
    }

    .bookmark-btn i {
        font-size: 1.3rem;
        color: white;
        transition: all 0.3s ease;
    }

    /* Bookmarked State */
    .bookmark-btn.bookmarked {
        background: white;
        border-color: white;
        /* Animation defined in bookmark-bubble.css */
    }

    .bookmark-btn.bookmarked i {
        color: var(--primary-color);
    }

    .bookmark-btn.bookmarked:hover {
        background: rgba(255, 255, 255, 0.9);
        transform: scale(1.1) rotate(5deg);
    }

    /* Animations are defined globally in bookmark-bubble.css */

    /* Profile Navigation */
    #player-profile [data-testid="tabs-menu"] {
        position: relative;
        margin-top: 0 !important;
    }

    #player-profile [data-testid="player-tabs"] {
        display: flex !important;
        gap: var(--spacing-sm) !important;
        padding: calc(var(--spacing-md) + 4px) var(--spacing-lg) var(--spacing-sm) !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
        border: 1px solid #E5E7EB !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative !important;
        margin-top: 0 !important;
        margin-bottom: var(--spacing-lg) !important;
    }

    #player-profile [data-testid="player-tabs"]::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(
            90deg,
            var(--primary-color, var(--team-primary, var(--brand-blue))),
            var(--primary-color, var(--team-primary, var(--brand-blue))),
            var(--primary-color, var(--team-primary, var(--brand-blue)))
        ) !important;
        border-radius: 16px 16px 0 0;
        pointer-events: none;
    }
    
    #player-profile [data-testid="player-tabs"]::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        background: none;
        border: none;
        padding: 0.75rem 1.5rem;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-secondary);
        white-space: nowrap;
    }

    .nav-tab.active {
        background: var(--primary-color);
        color: white;
        box-shadow: var(--shadow-md);
    }

    .nav-tab:hover:not(.active) {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }

    /* Content Sections - ALIGNED with hero */
    .tab-content {
        display: none;
        animation: fadeIn 0.3s ease-in;
        position: relative;
        padding: 1.5rem;
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    /* No special width for game-log tab */
    #game-log {
        /* Inherits standard tab-content styling */
    }
    
    /* Ensure game log content card matches other cards exactly */
    #game-log .content-card {
        overflow: visible; /* Allow tooltip to extend outside */
        width: 100%;
        box-sizing: border-box;
        position: relative; /* Create stacking context */
    }
    
    /* Ensure all children respect boundaries */
    #game-log .content-card > * {
        max-width: 100%;
        box-sizing: border-box;
    }

    .tab-content.active {
        display: block;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Card Components */
    .content-card {
        background: white;
        border-radius: 16px;
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
        box-shadow: var(--shadow-md);
        border: 1px solid var(--border-color);
        transition: all 0.3s ease;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* Contain content within card */
        position: relative;
    }
    
    /* Allow overflow for cards with tooltips */
    .content-card:has(.stat-guide-hover-container),
    .content-card.has-tooltip {
        overflow: visible;
    }
    
    /* Remove all debug styles */
    
    /* Debug styles removed */

    .content-card:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }

    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--spacing-lg);
        position: relative;
    }

    .card-title {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .card-icon {
        color: var(--primary-color);
        font-size: 1.1rem;
    }

    /* Overview Grid - FIXED for no cutoff */
    .overview-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
        gap: clamp(0.5rem, 2vw, 1.5rem);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding-right: 0;
    }

    .overview-latest-bio-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(0.5rem, 2vw, 1.5rem);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .overview-latest-bio-grid > .content-card:only-child {
        grid-column: 1 / -1;
    }

    .overview-bio-card .bio-text {
        color: var(--text-primary);
        line-height: 1.6;
    }

    .overview-bio-card .bio-text p {
        margin: 0;
    }

    .overview-bio-card .bio-text p + p {
        margin-top: 0.75rem;
    }

    .player-search-prompts-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 0.55rem;
    }

    .player-search-prompt-item {
        line-height: 1.35;
    }

    .player-search-prompt-link {
        color: #06b6d4;
        text-decoration: underline;
        text-decoration-color: #06b6d4;
        text-decoration-thickness: 2px;
        text-underline-offset: 2px;
        font-weight: 700;
        transition: color 0.2s ease, text-decoration-color 0.2s ease;
    }

    .player-search-prompt-link:hover,
    .player-search-prompt-link:focus-visible {
        color: #0e7490;
        text-decoration-color: #0e7490;
    }

    /* Bio Info Grid */
    .bio-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-md);
    }

    .bio-item {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .bio-label {
        font-size: clamp(0.65rem, 1.1vw, 0.75rem); /* Reduced size */
        color: var(--text-secondary);
        font-weight: 500;
    }

    .bio-value {
        font-size: clamp(0.75rem, 1.3vw, 0.9rem); /* Reduced size */
        color: var(--text-primary);
        font-weight: 600;
    }

    /* Recent Performance */
    .latest-game-header {
        margin: 0 0 var(--spacing-md);
        padding: 0.65rem 0.8rem;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        background: var(--bg-secondary);
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }

    .latest-game-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .latest-game-title {
        margin: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        color: var(--text-primary);
        font-weight: 700;
        line-height: 1.25;
    }

    .latest-game-prefix {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2rem;
        padding: 0.15rem 0.45rem;
        border-radius: 999px;
        background: rgba(10, 25, 49, 0.08);
        color: var(--primary-color);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .latest-game-opponent {
        font-weight: 700;
    }

    .latest-game-venue {
        margin: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        color: var(--text-secondary);
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .latest-game-venue i {
        color: var(--primary-color);
        opacity: 0.85;
        font-size: 0.85rem;
    }

    .latest-game-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.3rem 0.7rem;
        border-radius: 999px;
        border: 1px solid rgba(10, 25, 49, 0.25);
        background: #fff;
        color: var(--primary-color);
        font-size: 0.78rem;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
        transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    }

    .latest-game-link::after {
        content: '->';
        font-size: 0.72rem;
        line-height: 1;
    }

    .latest-game-link:hover {
        background: rgba(10, 25, 49, 0.08);
        box-shadow: var(--shadow-sm);
        transform: translateY(-1px);
        text-decoration: none;
    }

    .latest-game-link.match-centre-link,
    .latest-game-link.match-centre-link:link,
    .latest-game-link.match-centre-link:visited,
    .latest-game-link.match-centre-link:active {
        color: var(--primary-color);
        font-size: 0.78rem;
        font-weight: 700;
        text-decoration: none;
        letter-spacing: 0;
    }

    .latest-game-link.match-centre-link:hover {
        text-decoration: none;
    }

    .latest-game-link.is-disabled {
        opacity: 0.55;
        cursor: default;
        pointer-events: none;
    }

    .latest-game-link.is-disabled::after {
        content: '';
    }

    .performance-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: clamp(0.3rem, 1.5vw, 1rem); /* Smaller gap */
        text-align: center;
        width: 100%;
    }

    .performance-stat {
        padding: clamp(0.5rem, 2vw, 1rem); /* Responsive padding */
        background: var(--bg-secondary);
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .performance-stat:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

    .performance-number {
        font-size: clamp(1.2rem, 3vw, 1.5rem); /* Reduced and responsive */
        font-weight: 700;
        margin: 0;
    }

    .performance-label {
        font-size: clamp(0.6rem, 1.1vw, 0.75rem); /* Reduced size */
        opacity: 0.8;
        margin-top: 0.2rem;
    }

    /* Accolades list in Player Information card */
    .player-info-accolades {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .player-info-accolades-title {
        margin: 0 0 0.75rem 0;
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    .player-info-accolades-list {
        margin: 0;
        padding-left: 1.2rem;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .player-info-accolades-item {
        color: var(--text-primary);
        line-height: 1.45;
    }

    .player-info-accolade-link {
        color: #06b6d4;
        text-decoration: underline;
        text-decoration-color: #06b6d4;
        text-decoration-thickness: 2px;
        text-underline-offset: 2px;
        font-weight: 700;
        transition: color 0.2s ease, text-decoration-color 0.2s ease;
    }

    button.player-info-accolade-link {
        background: none;
        border: 0;
        padding: 0;
        font-family: inherit;
        font-size: inherit;
        line-height: inherit;
        text-align: left;
        cursor: pointer;
    }

    .player-info-accolade-link:hover,
    .player-info-accolade-link:focus-visible {
        color: #0e7490;
        text-decoration-color: #0e7490;
    }

    @media (min-width: 768px) {
        .player-info-accolades-list {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            column-gap: 1rem;
        }
    }

    @media (min-width: 1200px) {
        .player-info-accolades-list {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            column-gap: 1.25rem;
        }
    }

    .player-info-accolades-toggle {
        margin-top: 0.7rem;
        padding: 0.45rem 0.75rem;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: #ffffff;
        color: var(--primary-color);
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }

    .player-info-accolades-toggle:hover {
        background: var(--bg-secondary);
        border-color: var(--primary-color);
    }

    /* Stats Table Wrapper */
    .stats-table-wrapper {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden; /* Changed from visible to prevent vertical scrollbar */
        -webkit-overflow-scrolling: touch;
        margin-top: 1rem;
        max-height: none; /* Ensure no height constraints */
    }
    
    /* Season Stats Table */
    .stats-table-container {
        border-radius: 12px;
        border: 1px solid var(--border-color);
        position: relative;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure scrollbar is visible */
    .stats-table-wrapper::-webkit-scrollbar {
        height: 12px;
    }
    
    .stats-table-wrapper::-webkit-scrollbar-track {
        background: var(--bg-secondary);
        border-radius: 6px;
    }
    
    .stats-table-wrapper::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 6px;
    }
    
    .stats-table-wrapper::-webkit-scrollbar-thumb:hover {
        background: var(--text-secondary);
    }

    .stats-table {
        width: auto;
        border-collapse: collapse;
        min-width: 100%;
    }

    .stats-table th {
        background: var(--bg-secondary);
        color: var(--text-primary);
        padding: 0.75rem 0.5rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-bottom: 2px solid var(--border-color);
        white-space: nowrap;
    }
    
    /* Make first column sticky */
    .stats-table th:first-child,
    .stats-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
    }
    
    .stats-table th:first-child {
        background: var(--bg-secondary);
    }
    
    .stats-table td:first-child {
        background: white;
    }
    
    .stats-table tr:hover td:first-child {
        background: var(--bg-secondary);
    }

    .stats-table td {
        padding: var(--spacing-xs) var(--spacing-xs);
        border-bottom: 1px solid var(--border-color);
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .stats-table tbody tr:hover {
        background: var(--bg-secondary);
        transition: background-color 0.2s ease;
    }

    .stats-table tr:last-child td {
        border-bottom: none;
    }

    /* Stat Filter Section Styles */
    .stat-filter-section {
        background: #f8f9fa;
        border-radius: 12px;
        padding: var(--spacing-lg);
        margin: var(--spacing-lg) 0;
        border: 1px solid #e5e7eb;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Advanced Stat Filter: compact height while keeping layout tidy */
    #game-log .stat-filter-section {
        padding-top: var(--spacing-sm);
        padding-bottom: var(--spacing-sm);
        display: grid;
        grid-template-rows: auto 1fr; /* header then controls */
    }

    /* Increase spacing between header texts and controls */
    #game-log .stat-filter-header {
        margin-bottom: 1rem;
    }

    /* Center the control group vertically within the section */
    #game-log .stat-filter-controls {
        margin-top: 0;
        display: flex;
        flex-direction: column;
        justify-content: center; /* vertical centering */
        min-height: 100%;
    }

    /* Explicitly center the input row inside the controls area */
    #game-log .stat-filter-input-group {
        margin-top: auto;
        margin-bottom: auto;
    }
    
    .stat-filter-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.25rem;
    }
    
    .stat-filter-title {
        font-size: 0.95rem;
        font-weight: 600;
        color: #1f2937;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .stat-filter-title.profile-filter-title i {
        color: var(--primary-color);
        font-size: 0.85rem;
    }

    .stat-filter-help {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .stat-filter-help-btn {
        border: 1px solid #d1d5db;
        background: #ffffff;
        color: var(--text-secondary);
        font-size: 0.78rem;
        font-weight: 600;
        border-radius: 999px;
        padding: 0.32rem 0.62rem;
        cursor: pointer;
        transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
        white-space: nowrap;
    }

    .stat-filter-help-btn:hover,
    .stat-filter-help-btn:focus-visible {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background: #f8fafc;
        outline: none;
    }

    .stat-filter-help-popup {
        position: absolute;
        top: calc(100% + 0.45rem);
        right: 0;
        width: min(330px, calc(100vw - 2rem));
        border: 1px solid #d1d5db;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
        padding: 0.8rem 0.9rem;
        z-index: 1500;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
        pointer-events: none;
    }

    .stat-filter-help-popup.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .stat-filter-help-popup-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .stat-filter-help-popup-header h5 {
        margin: 0;
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .stat-filter-help-close {
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-size: 1.05rem;
        line-height: 1;
        padding: 0;
        cursor: pointer;
    }

    .stat-filter-help-popup p {
        margin: 0;
        color: var(--text-secondary);
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .stat-filter-help-popup p + p {
        margin-top: 0.45rem;
    }

    .stat-filter-info {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        color: #6b7280;
        font-size: 0.8rem;
    }
    
    .stat-filter-info i {
        color: #9ca3af;
        font-size: 0.85rem;
    }

    @media (max-width: 820px) {
        .stat-filter-help-popup {
            left: 0;
            right: auto;
            width: min(320px, calc(100vw - 2rem));
        }

        .stat-filter-help-btn {
            font-size: 0.74rem;
            padding: 0.3rem 0.56rem;
        }
    }
    
    .stat-filter-controls {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-filter-input-group {
        display: flex;
        align-items: center;
        gap: 0.75rem; /* column gap */
        flex-wrap: wrap;
    }

    /* When the control line wraps to a second line, increase vertical spacing */
    #game-log .stat-filter-input-group {
        row-gap: var(--spacing-xl);
    }
    
    .stat-filter-label {
        font-size: 0.85rem;
        font-weight: 500;
        color: #4b5563;
        white-space: nowrap;
    }
    
    .stat-filter-select,
    .stat-filter-operator {
        padding: 0.5rem 0.75rem;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 0.85rem;
        background: white;
        color: #1f2937;
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    .stat-filter-select {
        min-width: 180px;
    }
    
    .stat-filter-operator {
        min-width: 110px;
    }
    
    .stat-filter-select:hover,
    .stat-filter-operator:hover {
        border-color: var(--primary-color);
    }
    
    .stat-filter-select:focus,
    .stat-filter-operator:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(10, 25, 49, 0.1);
    }
    
    .stat-filter-value {
        width: clamp(60px, 8vw, 80px);
        padding: 0.5rem;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 0.85rem;
        background: white;
        color: #1f2937;
        transition: all 0.2s ease;
    }
    
    .stat-filter-value:hover {
        border-color: var(--primary-color);
    }
    
    .stat-filter-value:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(10, 25, 49, 0.1);
    }
    
    .stat-filter-apply,
    .stat-filter-clear {
        padding: 0.5rem 1rem;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 500;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }
    
    .stat-filter-apply {
        background: var(--primary-color);
        color: white;
    }
    
    .stat-filter-apply:hover {
        background: #132A4D;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(10, 25, 49, 0.2);
    }
    
    .stat-filter-clear {
        background: #ef4444;
        color: white;
    }
    
    .stat-filter-clear:hover {
        background: #dc2626;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }
    
    .stat-filter-active {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .stat-filter-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
        background: var(--primary-color);
        color: white;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 500;
    }
    
    .stat-filter-badge i {
        font-size: 0.75rem;
    }
    
    .stat-filter-remove {
        background: none;
        border: none;
        color: white;
        font-size: 1.2rem;
        line-height: 1;
        cursor: pointer;
        padding: 0;
        margin-left: 0.25rem;
        opacity: 0.8;
        transition: opacity 0.2s;
    }
    
    .stat-filter-remove:hover {
        opacity: 1;
    }
    
    /* Stat Guide positioning for Game Log */
    #game-log .card-header {
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: var(--spacing-sm);
    }

    #game-log .stat-guide-hover-container {
        position: relative;
        top: auto;
        right: auto;
        margin-left: auto;
        z-index: 1100;
    }
    
    /* Ensure tooltip appears above sticky table headers */
    #game-log .stat-guide-hover-tooltip {
        z-index: 10000 !important;
    }
    
    /* Tooltip that appears on hover */
    .stat-guide-hover-tooltip {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        background: white;
        border: 1px solid #d1d5db;
        border-radius: 12px;
        padding: 2rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        width: max-content;
        min-width: 100%;
        overflow-x: auto;
        max-width: min(900px, calc(100vw - 60px));
        box-sizing: border-box;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        pointer-events: none;
        z-index: 1000;
    }
    
    /* Responsive adjustments */
    @media (max-width: 1200px) {
        .stat-guide-hover-tooltip {
            right: auto;
            left: 50%;
            transform: translateX(-50%) translateY(-10px);
            min-width: 600px;
        }
    }
    
    @media (max-width: 750px) {
        .stat-guide-hover-tooltip {
            min-width: unset;
            width: calc(100vw - 40px);
            padding: 1.5rem 1rem;
        }
    }
    
    @media (max-width: 500px) {
        .stat-guide-hover-tooltip {
            width: calc(100vw - 20px);
            padding: 1rem 0.75rem;
        }
    }

    @media (max-width: 820px) {
        .stat-guide-hover-tooltip {
            position: fixed;
            top: var(--gutter-mobile);
            left: 50%;
            right: auto;
            width: calc(100vw - (2 * var(--gutter-mobile)));
            max-width: calc(100vw - (2 * var(--gutter-mobile)));
            max-height: calc(100vh - (2 * var(--gutter-mobile)));
            min-width: unset;
            overflow-y: auto;
            transform: translateX(-50%) translateY(-10px);
        }

        .stat-tooltip-arrow {
            display: none;
        }

        .stat-guide-hover-container:hover .stat-guide-hover-tooltip,
        .stat-guide-hover-container:focus-within .stat-guide-hover-tooltip {
            transform: translateX(-50%) translateY(0);
        }
    }
    
    /* Show tooltip on hover */
    .stat-guide-hover-container:hover .stat-guide-hover-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    @media (max-width: 1200px) {
        .stat-guide-hover-container:hover .stat-guide-hover-tooltip {
            transform: translateX(-50%) translateY(0);
        }
    }
    
    /* Arrow pointing up */
    .stat-tooltip-arrow {
        position: absolute;
        top: -8px;
        right: 20px;
        width: 16px;
        height: 16px;
        background: white;
        border-left: 1px solid #d1d5db;
        border-top: 1px solid #d1d5db;
        transform: rotate(45deg);
    }
    
    .stat-tooltip-header {
        margin-bottom: var(--spacing-sm);
        padding-bottom: var(--spacing-xs);
        border-bottom: 2px solid #f3f4f6;
    }
    
    .stat-tooltip-header h5 {
        margin: 0;
        font-size: 0.9rem;
        font-weight: 600;
        color: #1f2937;
    }
    
    .stat-tooltip-content {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md) var(--spacing-xl);
        overflow: visible;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Responsive layout for smaller screens */
    @media (max-width: 1100px) {
        .stat-tooltip-content {
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem 1.5rem;
        }
    }
    
    @media (max-width: 750px) {
        .stat-tooltip-content {
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }
    }
    
    .stat-tooltip-column {
        min-width: 200px;
        overflow: visible;
    }
    
    .stat-tooltip-column h6 {
        margin: 0 0 0.5rem 0;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--primary-color);
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
    
    .stat-guide-hover-tooltip .stat-item {
        display: flex;
        align-items: baseline;
        margin-bottom: 0.3rem;
        font-size: 0.75rem;
        color: #4b5563;
        line-height: 1.3;
        gap: 0.75rem;
        white-space: nowrap;
    }
    
    .stat-guide-hover-tooltip .stat-abbr {
        font-weight: 600;
        color: #1f2937;
        min-width: 40px;
        padding: 0.1rem 0.4rem;
        background: #f9fafb;
        border-radius: 4px;
        font-size: 0.7rem;
        text-align: center;
        border: 1px solid #e5e7eb;
        flex-shrink: 0;
    }
    
    
    /* Removed unused game-log-item styles - not used anywhere in HTML */

    .opponent-logo {
        width: 20px;
        height: 20px;
        object-fit: contain;
        flex-shrink: 0;
    }

    .game-match-info {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
    }

    .game-opponent {
        font-weight: 600;
        color: var(--text-primary);
        font-size: 0.8rem;
    }

    .game-scores {
        font-size: 0.7rem;
        color: var(--text-secondary);
    }

    .game-venue {
        font-size: 0.7rem;
        color: var(--text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
        padding-left: 0.75rem;
        padding-right: 1.25rem;
    }
    
    .game-player-score {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-primary);
        text-align: center;
    }

    .game-date-result {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }

    .game-date {
        font-size: 0.7rem;
        color: var(--text-secondary);
    }

    .game-result {
        font-weight: 600;
        padding: 0.1rem 0.4rem;
        border-radius: 10px;
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: inline-block;
    }

    .game-result.win {
        background: #D1FAE5;
        color: #065F46;
    }

    .game-result.loss {
        background: #FEE2E2;
        color: #991B1B;
    }

    .game-result.draw {
        background: #FEF3C7;
        color: #92400E;
    }

    .game-all-stats {
        display: flex;
        gap: 0.5rem;
        font-size: 0.65rem;
        color: var(--text-secondary);
        flex-wrap: nowrap;
        align-items: center;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .game-all-stats::-webkit-scrollbar {
        display: none;
    }
    
    .stat-item-mini {
        display: inline-flex;
        align-items: baseline;
        gap: 0.15rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .stat-item-mini strong {
        color: var(--text-primary);
        font-weight: 700;
    }
    
    .stat-item-mini span {
        opacity: 0.7;
        font-weight: 500;
    }

    /* Controls */
    .controls-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.25rem;
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    #player-profile #statistics .stats-header-controls {
        margin-left: auto;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 1rem;
        flex-wrap: nowrap;
    }

    #player-profile #statistics .stats-header-controls .toggle-group {
        margin-left: 0;
        align-self: center;
    }

    #player-profile #statistics .stats-header-controls .stat-guide-hover-container {
        position: static;
        align-self: center;
    }

    .toggle-group {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }
    
    .toggle-group span {
        font-size: 0.875rem !important;
        font-weight: 600 !important;
        color: #4B5563 !important;
        font-family: var(--font-sans) !important;
        border: none !important;
        outline: none !important;
    }

    /* Clean Toggle Switch */
    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 50px;
        height: 24px;
        background-color: #E5E7EB !important;
        border-radius: 12px;
        cursor: pointer;
        transition: background-color 0.3s;
        border: 0 !important;
        outline: none !important;
        padding: 0;
        margin: 0;
        box-shadow: none !important;
        --toggle-knob-size: 20px;
    }

    .toggle-switch.active {
        background-color: var(--primary-color) !important;
    }

    .toggle-slider {
        position: absolute;
        top: 50%;
        left: 2px;
        width: var(--toggle-knob-size);
        height: var(--toggle-knob-size);
        background-color: #ffffff;
        border-radius: 10px;
        transform: translateY(-50%);
        transition: left 0.3s;
        border: none;
        outline: none;
        box-shadow: none;
    }

    .toggle-switch.active .toggle-slider {
        left: calc(100% - var(--toggle-knob-size) - 2px);
    }
    
    /* Remove any inherited styles */
    .toggle-switch * {
        box-shadow: none !important;
        border: none !important;
        outline: none !important;
    }
    
    .toggle-switch::before,
    .toggle-switch::after,
    .toggle-slider::before,
    .toggle-slider::after {
        display: none !important;
    }

    .filter-select {
        padding: 0.5rem 0.75rem;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: white;
        color: var(--text-primary);
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 150px;
    }

    .filter-select:hover {
        border-color: var(--primary-color);
    }

    .filter-select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
    }
    
    /* Active filter styling with team colors */
    .filter-select.active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
        font-weight: 600;
    }
    
    .filter-select.active:hover {
        background: var(--secondary-color);
        border-color: var(--secondary-color);
    }
    
    /* Game Log Filters */
    .filters-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Increase vertical spacing between rows of filter elements on Game Log tab */
    #game-log .filters-grid {
        row-gap: var(--spacing-xl); /* make row gap clearly noticeable */
        column-gap: var(--spacing-sm);
    }
    
    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .filter-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .filter-select.small {
        padding: 0.375rem 0.75rem;
        font-size: clamp(0.7rem, 1.3vw, 0.875rem);
    }
    
    @media (max-width: 768px) {
        .filters-grid {
            grid-template-columns: 1fr;
        }
    }
    
    /* Pagination Styles */
    .pagination-container {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-2xl);
        padding: var(--spacing-xl) var(--spacing-md);
        border-top: 2px solid var(--border-color);
        background: var(--bg-secondary);
        border-radius: 12px;
        position: relative;
    }
    
    /* Add spacing after the last game log item */
    #gameLogContainer {
        padding-bottom: 0;
    }
    
    .pagination-btn {
        background: white;
        border: 2px solid var(--border-color);
        border-radius: 10px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 45px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .pagination-btn:hover:not(:disabled) {
        background: var(--bg-secondary);
        border-color: var(--primary-color);
        color: var(--primary-color);
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .pagination-btn.active {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.3);
    }
    
    .pagination-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        box-shadow: none;
    }
    
    .pagination-info {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin: 0 1.5rem;
        font-weight: 500;
    }
    
    .pagination-dots {
        color: var(--text-secondary);
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }

    /* Stats Info Button */
    .stats-info-wrapper {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 200;
    }
    
    .stats-info-btn {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: help;
        font-size: 0.75rem;
        color: var(--text-secondary);
        transition: all 0.2s ease;
    }
    
    .stats-info-btn:hover {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    /* Original tooltips in the HTML - keep hidden */
    .stats-info-wrapper .stats-legend-tooltip {
        display: none !important;
    }
    
    /* Tooltip styles for the cloned version */
    #tooltip-container .stats-legend-tooltip {
        position: absolute;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 1.5rem 2rem;
        width: auto;
        min-width: 400px;
        max-width: min(600px, calc(100vw - 40px));
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        font-size: 0.75rem;
        overflow: visible;
    }
    
    /* Removed CSS hover - handled by JavaScript instead */
    
    .stats-legend-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(200px, 1fr));
        gap: 1rem 2rem;
        width: 100%;
        min-width: 100%; /* Responsive width */
        overflow-x: auto;
        box-sizing: border-box;
        padding: 0.5rem;
    }
    
    /* Responsive layout */
    @media (max-width: 1000px) {
        .stats-legend-grid {
            grid-template-columns: repeat(2, minmax(200px, 1fr));
            min-width: 450px;
        }
    }
    
    @media (max-width: 700px) {
        .stats-legend-grid {
            grid-template-columns: 1fr;
            min-width: 300px;
        }
    }
    
    .stat-definition {
        display: flex;
        gap: var(--spacing-xs);
        color: var(--text-secondary);
        white-space: nowrap; /* Prevent text wrapping */
        overflow: visible;
    }
    
    .stat-definition strong {
        color: var(--text-primary);
        min-width: 40px;
        flex-shrink: 0;
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        .hero-section {
            padding: var(--spacing-xl) var(--spacing-md);
            margin-bottom: var(--spacing-lg);
        }

        .overview-latest-bio-grid {
            grid-template-columns: 1fr;
        }

        #player-profile [data-testid="player-tabs"] {
            padding: calc(var(--spacing-sm) + 4px) var(--spacing-sm) var(--spacing-xs) !important;
            gap: var(--spacing-xs) !important;
            margin-bottom: var(--spacing-md) !important;
        }

        .tab-content {
            padding: var(--spacing-md);
        }
        
        /* Removed duplicate #game-log style */
        
        /* DON'T override content-area - let layout.html handle it */
        
        .sidebar {
            display: none;
        }

        .hero-content {
            flex-direction: column;
            text-align: center;
        }

        .player-header {
            flex-direction: column;
            text-align: center;
        }

        .player-image-container {
            width: 160px;
            height: 160px;
            margin-bottom: 0; /* Keep flush within the hero bubble */
        }

        .player-info-header .player-name {
            font-size: clamp(1.2rem, 3vw, 1.7rem);
        }

        .quick-stats {
            justify-content: center;
        }

        #player-profile [data-testid="player-tabs"] {
            gap: var(--spacing-xs) !important;
        }

        .nav-tab {
            padding: var(--spacing-xs) var(--spacing-md);
            font-size: clamp(0.7rem, 1.3vw, 0.875rem);
        }

        .overview-grid {
            grid-template-columns: 1fr;
        }

        .performance-grid {
            grid-template-columns: 1fr;
        }

        /* Removed unused game-log-item responsive styles */

        .game-stats {
            width: 100%;
            justify-content: space-between;
        }
    }

    @media (max-width: 820px) {
        #player-profile .tab-content {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

        #player-profile .content-card .card-title {
            font-size: clamp(0.95rem, 3.9vw, 1.05rem);
            gap: 0.4rem;
        }

        #player-profile .content-card .card-icon {
            font-size: clamp(0.82rem, 3.2vw, 0.92rem);
        }

        #player-profile .player-search-prompt-item {
            line-height: 1.3;
        }

        #player-profile .player-search-prompt-link,
        #player-profile .player-info-accolade-link {
            font-size: 0.84rem;
            text-decoration-thickness: 1.5px;
            text-underline-offset: 1.5px;
        }

        #player-profile .player-info-accolades-title {
            font-size: 0.92rem;
            gap: 0.4rem;
        }

        #player-profile .player-info-accolades-title i {
            font-size: 0.8rem;
        }

        #player-profile .player-info-accolades-item {
            font-size: 0.82rem;
            line-height: 1.35;
        }

        #player-profile .player-info-accolades-toggle {
            font-size: 0.78rem;
            padding: 0.38rem 0.62rem;
        }

        #player-profile .stat-guide-hover-btn {
            padding: 0.4rem 0.72rem;
            gap: 0.34rem;
            min-height: 30px;
            font-size: 0.75rem;
            border-radius: 7px;
        }

        #player-profile .stat-guide-hover-btn i {
            font-size: 0.76rem;
        }

        #player-profile .content-card .card-header {
            margin-bottom: var(--spacing-md);
        }

        #player-profile #statistics .card-header {
            align-items: flex-start;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        #player-profile #statistics .stats-header-controls {
            width: 100%;
            margin-left: 0;
            align-items: center;
            justify-content: space-between;
            gap: 0.6rem;
            flex-wrap: nowrap;
        }

        #player-profile #statistics .toggle-switch {
            width: 24px;
            height: 11.2px;
            border-radius: 5.6px;
            --toggle-knob-size: 9.6px;
        }

        #player-profile [data-testid="player-banner"] {
            position: relative;
            --banner-inset: 12px;
            overflow: visible;
            padding: 0 !important;
        }

        #player-profile [data-testid="player-banner"] .hero-content {
            position: relative !important;
            display: block !important;
            align-items: stretch !important;
            justify-content: center !important;
            min-height: 100% !important;
            height: 100% !important;
            padding: 0 !important;
        }

        #player-profile [data-testid="player-banner"] .player-header {
            position: relative !important;
            width: 100%;
            min-height: 100% !important;
            height: 100% !important;
            display: block !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="banner-text"] {
            position: absolute !important;
            top: calc(var(--banner-inset) + 6px);
            left: var(--banner-inset);
            right: var(--banner-inset);
            transform: none !important;
            text-align: left !important;
            z-index: 5;
            width: auto !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: flex-start !important;
            padding: 0 !important;
        }

        #player-profile [data-testid="player-banner"] .player-title-row {
            display: flex !important;
            flex-direction: column !important;
            align-items: flex-start !important;
            gap: 0.35rem !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="player-name"] {
            margin: 0 !important;
            text-align: left !important;
            font-size: clamp(1.4rem, 5vw, 2rem) !important;
            line-height: 1.1 !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="player-meta"] {
            display: flex !important;
            flex-wrap: nowrap !important;
            align-items: center !important;
            gap: 0 !important;
            margin-top: 0.2rem !important;
            text-align: left !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            max-width: 100% !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="player-meta"] .meta-item {
            display: inline-flex !important;
            align-items: center !important;
            justify-content: flex-start !important;
            font-size: 0.9rem !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="player-meta"] .meta-item + .meta-item::before {
            content: " | ";
            margin: 0 0.4rem;
            opacity: 0.9;
        }

        #player-profile [data-testid="player-banner"] [data-testid="player-meta"] .meta-item[data-testid="player-status"] {
            display: none !important;
        }

        #player-profile [data-testid="player-banner"] .player-image-container {
            position: absolute !important;
            left: var(--banner-inset) !important;
            bottom: 0 !important;
            margin-left: 0 !important;
            width: auto !important;
            height: 70% !important;
            max-height: 70% !important;
            max-width: 55% !important;
            margin: 0 !important;
            display: flex !important;
            align-items: flex-end !important;
            z-index: 2;
        }

        #player-profile [data-testid="player-banner"] [data-testid="player-image"] {
            width: auto !important;
            height: 100% !important;
            max-height: 100% !important;
            max-width: 100% !important;
            object-fit: contain !important;
            display: block !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="quick-stats"] {
            display: none !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="bookmark-btn"] {
            width: var(--bookmark-size-mobile) !important;
            height: var(--bookmark-size-mobile) !important;
        }

        #player-profile [data-testid="player-banner"] [data-testid="bookmark-btn"] i {
            font-size: var(--bookmark-icon-mobile) !important;
        }

        #player-profile [data-testid="player-tabs"] {
            display: grid !important;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 8px;
            width: 100%;
            overflow: visible !important;
            padding: calc(var(--spacing-sm) + 4px) var(--spacing-sm) var(--spacing-sm) !important;
            padding-right: var(--spacing-sm) !important;
            white-space: normal !important;
        }

        #player-profile [data-testid="player-tabs"] .nav-tab {
            width: 100%;
            min-width: 0;
            min-height: 36px;
            padding: 0.5rem 0.4rem !important;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #player-profile [data-testid="tabs-menu"] .tabs-more-indicator {
            display: none !important;
        }

        #player-profile [data-testid="player-info-stats"] {
            display: grid !important;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 10px;
        }

        #player-profile [data-testid="player-info-stats"] .bio-item {
            min-width: 0;
        }

        #player-profile .stat-filter-info {
            display: none !important;
        }
    }

    @media (max-width: 480px) {
        #player-profile .content-card .card-title {
            font-size: 0.9rem;
        }

        #player-profile .content-card .card-icon {
            font-size: 0.78rem;
        }

        #player-profile .player-search-prompt-link,
        #player-profile .player-info-accolade-link {
            font-size: 0.76rem;
            text-decoration-thickness: 1.25px;
        }

        #player-profile .player-info-accolades-title {
            font-size: 0.84rem;
            gap: 0.35rem;
        }

        #player-profile .player-info-accolades-title i {
            font-size: 0.72rem;
        }

        #player-profile .player-info-accolades-item {
            font-size: 0.74rem;
            line-height: 1.32;
        }

        #player-profile .player-info-accolades-toggle {
            font-size: 0.7rem;
            padding: 0.32rem 0.52rem;
        }

        #player-profile .stat-guide-hover-btn {
            padding: 0.32rem 0.58rem;
            gap: 0.28rem;
            min-height: 27px;
            font-size: 0.68rem;
        }

        #player-profile .stat-guide-hover-btn i {
            font-size: 0.69rem;
        }
    }

    /* Loading State */
    .loading-skeleton {
        background: #e0e0e0;
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 4px;
    }

    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    /* Empty State */
    .empty-state {
        text-align: center;
        padding: 3rem;
        color: var(--text-secondary);
    }
    
    /* Team Links */
    .team-link {
        color: inherit;
        text-decoration: none;
        transition: all 0.2s ease;
    }
    
    .team-link:hover {
        text-decoration: underline;
        opacity: 0.8;
    }

    .empty-icon {
        font-size: 3rem;
        opacity: 0.3;
        margin-bottom: 1rem;
    }

    .empty-text {
        font-size: 1.1rem;
        margin: 0;
    }

/* Career Timeline */
.career-timeline {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(32px, 5vw, 52px);
    gap: var(--spacing-md);
    align-items: stretch;
    --timeline-visible-count: 5;
}

.career-timeline.timeline--static {
    grid-template-columns: minmax(0, 1fr);
}

.career-timeline.timeline--static .timeline-viewport {
    overflow: visible;
    height: auto;
    min-height: auto;
}

.career-timeline.timeline--static .timeline-scroll,
.career-timeline.timeline--static .timeline-count {
    display: none;
}

.timeline-viewport {
    position: relative;
    overflow: hidden;
    min-height: calc(var(--timeline-visible-count, 5) * 110px);
    padding: var(--spacing-sm) 0;
    padding-right: 0.25rem;
}

.timeline-viewport::before {
    content: '';
    position: absolute;
    top: var(--spacing-sm);
    bottom: var(--spacing-sm);
    left: calc(var(--spacing-md) + 2px);
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.05));
    pointer-events: none;
}

.timeline-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: transform;
}

.timeline-event {
    position: relative;
    background: var(--bg-primary);
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    padding-left: calc(var(--spacing-lg) + 6px);
    display: grid;
    gap: 0.45rem;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: var(--spacing-md);
    top: var(--spacing-sm);
    bottom: var(--spacing-sm);
    width: 4px;
    border-radius: 999px;
    background: var(--primary-color);
    opacity: 0.75;
}

.timeline-event-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: space-between;
    flex-wrap: wrap;
}

.timeline-event-date {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.timeline-event-tags {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.timeline-event-badge,
.timeline-event-category {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-event-category {
    color: var(--text-secondary);
}

.timeline-event-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-event-summary {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline-event-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.85;
}

.timeline-event-match-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.timeline-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.timeline-round-chip {
    background: rgba(10, 25, 49, 0.08);
    color: var(--primary-color);
    border-color: rgba(10, 25, 49, 0.16);
}

.timeline-opponent-chip {
    background: #ffffff;
    color: var(--text-primary);
    border-color: #d1d5db;
}

.timeline-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    padding: 0.14rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.timeline-result-badge.win {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.timeline-result-badge.loss {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.timeline-result-badge.draw {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.timeline-score-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.timeline-score-link:hover .timeline-score-display {
    background: rgba(10, 25, 49, 0.08);
    border-color: rgba(10, 25, 49, 0.26);
}

.timeline-score-display {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(10, 25, 49, 0.18);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    padding: 0.25rem 0.58rem;
}

.timeline-score-display .winning-score {
    color: #059669;
}

.timeline-score-display .losing-score {
    color: #991b1b;
}

.timeline-event-meta i {
    color: var(--primary-color);
    opacity: 0.8;
    margin-right: 0.25rem;
}

.timeline-event-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.timeline-match-centre-link {
    font-size: 0.73rem;
    padding: 0.26rem 0.62rem;
}

.timeline-scroll {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    user-select: none;
}

.timeline-track {
    position: relative;
    width: 10px;
    flex: 1 1 auto;
    min-height: clamp(140px, calc(var(--timeline-visible-count, 5) * 35px), 320px);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.05));
    touch-action: none;
    cursor: pointer;
}

.timeline-thumb {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 4px solid #ffffff;
    box-shadow: var(--shadow-md);
    cursor: grab;
    touch-action: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-thumb:active,
.timeline-thumb.is-dragging {
    cursor: grabbing;
    transform: translate(-50%, 0) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.timeline-thumb:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 4px;
}

.timeline-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    user-select: none;
    pointer-events: none;
}

.timeline-count .count-divider {
    color: var(--text-secondary);
}

.timeline-count .count-current {
    color: var(--primary-color);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .career-timeline {
        grid-template-columns: minmax(0, 1fr) clamp(28px, 7vw, 46px);
    }
}

@media (max-width: 640px) {
    .timeline-viewport {
        min-height: calc(var(--timeline-visible-count, 5) * 96px);
    }

    .timeline-event-match-row {
        gap: 0.34rem;
    }

    .timeline-chip,
    .timeline-result-badge {
        font-size: 0.62rem;
    }

    .timeline-score-display {
        font-size: 0.72rem;
        padding: 0.22rem 0.5rem;
    }

    .timeline-match-centre-link {
        font-size: 0.69rem;
        padding: 0.23rem 0.54rem;
    }
}

    /* Stats Visualization */
    .stats-chart-container {
        height: 300px;
        margin-top: 1.5rem;
        position: relative;
        background: var(--bg-secondary);
        border-radius: 12px;
        padding: 1rem;
    }

    /* Comparison Mode */
    .comparison-prompt {
        background: var(--primary-color);
        color: white;
        padding: 1rem;
        border-radius: 12px;
        text-align: center;
        margin-top: 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .comparison-prompt:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    /* Trends Tab */
    .trends-card .card-header {
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-sm);
        flex-wrap: wrap;
    }

    .trends-header-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .trend-subtitle {
        margin: 0;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .trend-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin-top: var(--spacing-md);
    }

    .trend-controls.two-col {
        grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
        align-items: start;
    }

    .trend-control {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .trend-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    .trend-scope {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.45rem 0.75rem;
        border-radius: 999px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .trend-select {
        position: relative;
    }

    .trend-select-button {
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.55rem 0.85rem;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        background: #ffffff;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .trend-select-button:hover {
        border-color: var(--primary-color);
    }

    .trend-select-button:focus-visible {
        outline: 2px solid var(--secondary-color);
        outline-offset: 2px;
    }

    .trend-select-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .trend-select-menu {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        max-height: 260px;
        overflow-y: auto;
        background: #ffffff;
        border-radius: 14px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        padding: 0.4rem 0;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-4px);
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 20;
    }

    .trend-select.is-open .trend-select-menu {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .trend-option {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.45rem 0.85rem;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .trend-option:hover {
        background: var(--bg-secondary);
    }

    .trend-option input {
        width: 16px;
        height: 16px;
        accent-color: var(--primary-color);
        cursor: pointer;
    }

    .trend-option.disabled {
        color: #9ca3af;
        cursor: not-allowed;
    }

    .trend-option.disabled input {
        cursor: not-allowed;
        accent-color: #cbd5f5;
    }

    .trend-hint {
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .trend-hint.is-warning {
        color: #b45309;
    }

    .trend-chart-shell {
        margin-top: var(--spacing-lg);
        padding: var(--spacing-md);
        border-radius: 16px;
        background: linear-gradient(180deg, rgba(243, 244, 246, 0.9), rgba(255, 255, 255, 0.9));
        border: 1px solid var(--border-color);
    }

    .trend-header-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        align-items: center;
        justify-content: space-between;
    }

    .trend-legend {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        align-items: center;
    }

    .trend-legend-item {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-primary);
    }

    .trend-legend-swatch {
        width: 14px;
        height: 14px;
        border-radius: 4px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
    }

    .trend-summary {
        margin-left: auto;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

    .trend-chart {
        position: relative;
        margin-top: var(--spacing-md);
        height: 320px;
        background: #ffffff;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        overflow: hidden;
    }

    .trend-svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .trend-grid-line {
        stroke: rgba(15, 23, 42, 0.08);
        stroke-width: 1;
    }

    .trend-axis {
        stroke: rgba(15, 23, 42, 0.2);
        stroke-width: 1.2;
    }

    .trend-axis-label {
        fill: var(--text-secondary);
        font-size: 11px;
        font-weight: 600;
    }

    .trend-axis-label--x {
        font-size: 10px;
    }

    .trend-line {
        fill: none;
        stroke-width: 2.6;
    }

    .trend-point {
        stroke: rgba(15, 23, 42, 0.25);
        stroke-width: 1.5;
    }

    .trend-hover-line {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 1px;
        background: rgba(15, 23, 42, 0.2);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .trend-tooltip {
        position: absolute;
        top: 12px;
        min-width: 160px;
        max-width: 220px;
        background: #0f172a;
        color: #ffffff;
        padding: 0.65rem 0.75rem;
        border-radius: 12px;
        font-size: 0.8rem;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        pointer-events: none;
        transform: translateY(6px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .trend-tooltip.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    .trend-tooltip-title {
        font-weight: 700;
        margin-bottom: 0.35rem;
    }

    .trend-tooltip-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .trend-tooltip-row + .trend-tooltip-row {
        margin-top: 0.25rem;
    }

    .trend-tooltip-swatch {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        margin-right: 0.4rem;
        flex-shrink: 0;
    }

    .trend-empty {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        font-size: 0.95rem;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.95));
    }

    .trend-empty.hidden {
        display: none;
    }

    @media (max-width: 768px) {
        .trend-controls.two-col {
            grid-template-columns: 1fr;
        }
        .trend-summary {
            width: 100%;
            margin-left: 0;
        }
        .trend-chart {
            height: 260px;
        }
        .trend-axis-label--x {
            font-size: 9px;
        }

        /* Keep advanced stat filter controls inside card bounds on mobile */
        #game-log .profile-filter-title {
            font-size: 0.7rem;
        }

        #game-log .profile-filter-row {
            align-items: stretch;
        }

        #game-log .profile-filter-row .profile-filter-label {
            width: 100%;
            text-align: left;
            align-self: flex-start;
        }

        #game-log .profile-filter-row .profile-filter-select,
        #game-log .profile-filter-row .profile-filter-input {
            width: 100%;
            min-width: 0;
            max-width: 100%;
            box-sizing: border-box;
        }
    }

    @media (max-width: 820px) {
        #game-log .profile-filter-title {
            font-size: 0.7rem;
        }

        #game-log .profile-filter-row .profile-filter-label {
            width: 100%;
            text-align: left;
            align-self: flex-start;
        }

        #player-profile #trends .trend-toggle-group {
            display: inline-flex;
            margin-left: 0;
            align-self: flex-start;
        }

        #player-profile #trends .trend-controls + .trend-toggle-group {
            margin-top: 0.35rem;
            padding-top: 0.3rem;
            padding-bottom: 0.3rem;
        }

        #player-profile #trends .trend-controls + .trend-toggle-group + .trend-chart-shell {
            margin-top: 0.5rem;
        }
    }

