/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* FPL Official Brand Colors */
    --primary-color: #37003c;       /* PL deep violet */
    --primary-light: #56106b;       /* lighter violet for hover states */
    --secondary-color: #00ff87;     /* PL neon green (split-complement) */
    --secondary-dark: #00cc6a;      /* readable green on white */
    --accent-color: #ff2882;        /* PL hot pink (split-complement) */
    --accent-light: #ff6baa;        /* lighter pink */

    /* Grass / pitch tones (retained for field elements only) */
    --grass-dark: #1a6b2e;
    --grass-light: #2d8f3f;
    --grass-bright: #00cc6a;

    /* Page & surface colors — light, like official FPL site */
    --bg-color: #e8e5ee;            /* very light lavender-grey: tint of primary */
    --bg-surface: #f4f2f7;          /* slightly lighter surface */
    --card-bg: #ffffff;
    --card-border: rgba(55, 0, 60, 0.12);

    /* Text */
    --text-color: #1a1a2e;          /* near-black with blue-purple tint */
    --text-muted: #5a5070;          /* muted purple-grey */
    --text-light: #8b7fa0;

    /* Borders & dividers */
    --border-color: #dbd5e5;
    --divider: rgba(55, 0, 60, 0.08);

    /* Shadows — purple-tinted */
    --shadow-sm: 0 2px 8px rgba(55, 0, 60, 0.08);
    --shadow: 0 4px 16px rgba(55, 0, 60, 0.12);
    --shadow-hover: 0 8px 28px rgba(55, 0, 60, 0.18);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #37003c 0%, #56106b 100%);
    --gradient-secondary: linear-gradient(135deg, #00cc6a 0%, #00ff87 100%);
    --gradient-accent: linear-gradient(135deg, #ff2882 0%, #ff6baa 100%);
    --gradient-grass: linear-gradient(180deg, #1a6b2e 0%, #2d8f3f 50%, #1a6b2e 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    background-image:
        linear-gradient(135deg, #e8e5ee 0%, #ede8f5 50%, #e3e0ec 100%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(55, 0, 60, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 204, 106, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 28px;
    text-align: center;
    padding: 56px 40px 44px;
    border-bottom: 4px solid var(--secondary-color);
    box-shadow: 0 8px 32px rgba(55, 0, 60, 0.45);
    /* Stadium photo — large screen */
    background-image: url('https://images.pexels.com/photos/46798/the-ball-stadion-football-the-pitch-46798.jpeg?auto=compress&cs=tinysrgb&w=1920');
    background-size: cover;
    background-position: center 40%;
}

/* Purple gradient overlay */
header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(55, 0, 60, 0.82) 0%,
        rgba(20, 0, 40, 0.90) 60%,
        rgba(0, 80, 40, 0.55) 100%
    );
    z-index: 0;
}

header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 65%);
    animation: stadiumLight 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Add trophy icon decoration */
header h1::before {
    display: none;
}

@keyframes trophyShine {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes stadiumLight {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    50% { transform: translate(10%, 10%); opacity: 0.6; }
}

header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 3em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    color: #fff;
    text-shadow:
        2px 4px 8px rgba(0, 0, 0, 0.85),
        0 1px 2px rgba(0, 0, 0, 0.9);
}

.header-eyebrow {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72em;
    font-weight: 400;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.header-content {
    position: relative;
    z-index: 1;
}

.team-subtitle {
    font-size: 1em;
    opacity: 0.75;
    position: relative;
    z-index: 1;
    font-weight: 300;
    letter-spacing: 0.04em;
}

.team-id {
    font-size: 1.1em;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.cards-grid > .card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Decorative top-right tint */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(55, 0, 60, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.card-header,
.card-content {
    position: relative;
    z-index: 1;
}

.card:hover {
    box-shadow: var(--shadow-hover), 0 0 0 2px var(--secondary-dark);
    transform: translateY(-4px);
    border-color: var(--secondary-dark);
}

/* Card color themes */
.card[data-card="team"] {
    background: #ffffff;
    border-top: 3px solid var(--primary-color);
}

.card[data-card="performance"] {
    background: #ffffff;
    border-top: 3px solid var(--secondary-dark);
}

.card[data-card="database"] {
    background: #ffffff;
    border-top: 3px solid var(--primary-light);
}

.card[data-card="prediction"] {
    background: #ffffff;
    border-top: 3px solid #f59e0b;
}

.card[data-card="transfers"] {
    background: #ffffff;
    border-top: 3px solid var(--accent-color);
}

.card-large {
    grid-column: span 2;
    min-height: 500px;
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-bottom: 3px solid var(--secondary-color);
}

.card-header h2 {
    font-size: 1.6em;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Add icons to card headers */
.card[data-card="team"] .card-header h2::before {
    content: '⚽';
    font-size: 1.2em;
}

.card[data-card="performance"] .card-header h2::before {
    content: '📊';
    font-size: 1.2em;
}

.card[data-card="database"] .card-header h2::before {
    content: '🗂️';
    font-size: 1.2em;
}

.card[data-card="prediction"] .card-header h2::before {
    content: '🔮';
    font-size: 1.2em;
}

.card[data-card="transfers"] .card-header h2::before {
    content: '🔄';
    font-size: 1.2em;
}

.expand-btn {
    background: rgba(0, 255, 135, 0.15);
    border: 2px solid var(--secondary-color);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.25s ease;
    font-weight: bold;
}

.expand-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 255, 135, 0.35);
}

.card-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Transfer card never scrolls — fit content only */
.card[data-card="transfers"] .card-content {
    overflow: hidden;
}

/* Compact content for dashboard cards */
.card-content .football-field {
    padding: 15px 10px;
    min-height: auto;
}

.card-content .field-line {
    margin: 10px 0;
    min-height: 80px;
}

.card-content .field-player {
    width: 74px;
}

.card-content .player-shirt-box {
    padding: 4px 7px;
}

.card-content .player-shirt {
    width: 38px;
    height: 38px;
}

.card-content .player-kit-img {
    width: 38px;
    height: 38px;
}

.card-content .stats-grid {
    gap: 10px;
}

.card-content .stat-card {
    padding: 12px;
}

.card-content .stat-card-value {
    font-size: 1.5em;
}

.card-content .table-container {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.card-content .table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.card-content .table-container::-webkit-scrollbar-track {
    background: rgba(55, 0, 60, 0.06);
    border-radius: 3px;
}

.card-content .table-container::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 3px;
}

.card-content .table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 1.1em;
    position: relative;
}

.loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid rgba(55, 0, 60, 0.12);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Container */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#player-search {
    flex: 2;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

#player-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(55, 0, 60, 0.08), var(--shadow-sm);
    transform: translateY(-1px);
}

#position-filter,
#team-filter {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: white;
    color: var(--text-color);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

#position-filter:hover,
#team-filter:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

#position-filter:focus,
#team-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(55, 0, 60, 0.08);
}

/* Stats Info Box */
.stats-info {
    background: linear-gradient(135deg, rgba(55, 0, 60, 0.04) 0%, rgba(86, 16, 107, 0.03) 100%);
    border: 1px solid rgba(55, 0, 60, 0.12);
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    padding: 18px 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.stats-info h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 700;
}

.stats-info p {
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 0.9em;
}

.stats-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    margin-top: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--card-border);
}

/* Compact dashboard table - fits viewport without horizontal scroll */
table.table-compact {
    width: 100%;
    min-width: unset;
    table-layout: auto;
}

table.table-compact th,
table.table-compact td {
    padding: 7px 4px;
    font-size: 0.78em;
    white-space: nowrap;
    width: auto;
}

/* Name col gets remaining space but won't push numeric cols off-screen */
table.table-compact th:first-child,
table.table-compact td:first-child {
    text-align: left;
    width: 99%;      /* grabs all browser-allocated slack */
    max-width: 180px;
}

/* Responsive column hiding for compact table */
/* ≤1024px: hide xGI, Tck, TSB% */
@media (max-width: 1024px) {
    .col-hide-lg { display: none; }
}

/* ≤768px: also hide Goals, Ast  — visible: Name · Team · Pos · £ · Pts · Form */
@media (max-width: 768px) {
    .col-hide-lg { display: none; }
    .col-hide-md { display: none; }
    table.table-compact th:first-child,
    table.table-compact td:first-child { max-width: 140px; }
}

/* ≤480px: also hide Team, Pos, £ — visible: Name · Goals · Assists · Pts · Form */
@media (max-width: 480px) {
    .col-hide-lg { display: none; }
    .col-hide-md { display: table-cell; }  /* re-show Goals + Assists */
    .col-hide-sm { display: none; }
    table.table-compact th:first-child,
    table.table-compact td:first-child { max-width: 110px; }
}

.table-container::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #4a0050;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 3500px;
}

th {
    background: var(--primary-color);
    color: white;
    padding: 12px 8px;
    text-align: center;
    cursor: help;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background 0.2s ease, color 0.2s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    white-space: nowrap;
}

th:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    text-align: left;
    background: var(--primary-color);
}

th:hover {
    background: var(--primary-light);
    color: var(--secondary-color);
}

td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85em;
    white-space: nowrap;
    color: var(--text-color);
}

td:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    text-align: left;
    font-weight: 600;
    box-shadow: 2px 0 6px rgba(55, 0, 60, 0.06);
    color: var(--primary-color);
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(55, 0, 60, 0.04);
    box-shadow: inset 3px 0 0 var(--primary-color);
}

tbody tr:hover td:first-child {
    background: rgba(55, 0, 60, 0.04);
}

/* Form-based row shading — green=good, red=poor, good contrast on white */
tbody tr.row-form-elite {
    background: rgba(0, 204, 106, 0.14);
    border-left: 3px solid #00a854;
}
tbody tr.row-form-elite td:first-child {
    background: rgba(0, 204, 106, 0.14);
    color: #00622f;
}

tbody tr.row-form-good {
    background: rgba(0, 204, 106, 0.07);
    border-left: 3px solid #00cc6a;
}
tbody tr.row-form-good td:first-child {
    background: rgba(0, 204, 106, 0.07);
}

tbody tr.row-form-avg {
    background: rgba(245, 158, 11, 0.09);
    border-left: 3px solid #d97706;
}
tbody tr.row-form-avg td:first-child {
    background: rgba(245, 158, 11, 0.09);
}

tbody tr.row-form-low {
    background: rgba(255, 40, 130, 0.07);
    border-left: 3px solid #ff2882;
}
tbody tr.row-form-low td:first-child {
    background: rgba(255, 40, 130, 0.07);
}

tbody tr.row-form-poor {
    background: rgba(220, 38, 38, 0.08);
    border-left: 3px solid #dc2626;
}
tbody tr.row-form-poor td:first-child {
    background: rgba(220, 38, 38, 0.08);
}

/* Team Display */
.team-grid {
    display: grid;
    gap: 10px;
}

.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    border-left: 4px solid var(--primary-light);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.player-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(55, 0, 60, 0.06) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.player-row:hover::before {
    width: 100%;
}

.player-row:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.player-row.captain {
    border-left-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 245, 248, 0.8) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.player-row.vice-captain {
    border-left-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(245, 255, 249, 0.8) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.player-meta {
    font-size: 0.9em;
    color: #666;
}

.player-stats {
    display: flex;
    gap: 15px;
    font-size: 0.95em;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
}

.stat-value {
    font-weight: bold;
    color: var(--primary-color);
}

/* Football Field Visualization */
.football-field {
    background:
        repeating-linear-gradient(
            90deg,
            #1a8c3a 0px,
            #1a8c3a 60px,
            #16732f 60px,
            #16732f 120px
        ),
        linear-gradient(to bottom, #1a8c3a 0%, #12662a 50%, #1a8c3a 100%);
    border-radius: 16px;
    padding: 30px 20px;
    margin: 20px 0;
    position: relative;
    min-height: 550px;
    box-shadow:
        inset 0 4px 16px rgba(0,0,0,0.4),
        0 8px 24px rgba(0,0,0,0.3);
    border: 4px solid #1a5c28;
}

/* Halfway line */
.football-field::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5%;
    right: 5%;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Center circle */
.football-field::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.field-line {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    min-height: 110px;
    z-index: 1;
}

.field-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 82px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.field-player:hover {
    transform: scale(1.05) translateY(-4px);
}

.field-player:hover .player-kit-img {
    transform: scale(1.04);
}

/* ── Gameweek banner above team field ── */
.team-gw-banner {
    text-align: center;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-color);
    opacity: 0.6;
    margin-bottom: 8px;
    padding: 3px 0;
}

/* ── Purple box around jersey + name + pts only ── */
.player-shirt-box {
    background: rgba(80, 0, 92, 0.65);
    border-radius: 10px;
    padding: 6px 9px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    box-shadow:
        0 4px 14px rgba(55, 0, 62, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

/* ── Player shirt: transparent wrapper for kit image ── */
.player-shirt {
    width: 46px;
    height: 46px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: visible;
}

/* Actual kit image */
.player-kit-img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.55));
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Captain – pink glow on the kit image */
.player-shirt.captain .player-kit-img {
    filter: drop-shadow(0 0 7px rgba(255,40,130,0.9)) drop-shadow(0 2px 5px rgba(0,0,0,0.5));
    animation: pulse-captain-kit 2s infinite;
}

@keyframes pulse-captain-kit {
    0%, 100% { filter: drop-shadow(0 0 7px rgba(255,40,130,0.85)) drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
    50%       { filter: drop-shadow(0 0 12px rgba(255,40,130,1))   drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
}

/* Vice-captain – green glow */
.player-shirt.vice-captain .player-kit-img {
    filter: drop-shadow(0 0 7px rgba(0,255,135,0.85)) drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

/* Captain badge */
.player-shirt.captain::after {
    content: 'C';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    font-weight: 900;
    border: 1.5px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 10;
}

/* Vice-captain badge */
.player-shirt.vice-captain::after {
    content: 'V';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--secondary-color);
    color: #37003c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65em;
    font-weight: 900;
    border: 1.5px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 10;
}

/* ── Clickable players ── */
.player-clickable {
    cursor: pointer;
}
.player-clickable:hover .player-kit-img {
    filter: drop-shadow(0 0 6px rgba(0,255,135,0.6)) drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}
.player-clickable:hover .player-name-field {
    color: var(--secondary-color);
}

/* Club badge – removed, replaced by fixture chips */
.player-club-badge { display: none; }

/* ── Single next-fixture pill ── */
.player-fixtures-row {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 3px;
}
/* ── Fixture chip: FDR-coloured [badge][H/A] ── */
.fp-fix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 20px;
    font-size: 0.49em;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1;
    padding: 3px 7px 3px 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.45);
    background: rgba(70,70,80,0.85);
    width: 100%;
}
/* FDR color coding on chip background */
.fp-fdr-1 { background: rgba(0, 120, 48, 0.92); }
.fp-fdr-2 { background: rgba(0, 145, 58, 0.92); }
.fp-fdr-3 { background: rgba(148, 108, 0, 0.95); }
.fp-fdr-4 { background: rgba(195, 60, 0, 0.95); }
.fp-fdr-5 { background: rgba(175, 0, 0, 0.95); }
/* Home: slightly lighter chip, Away: slightly darker */
.fp-ha-away.fp-fdr-1 { background: rgba(0, 90, 35, 0.92); }
.fp-ha-away.fp-fdr-2 { background: rgba(0, 110, 44, 0.92); }
.fp-ha-away.fp-fdr-3 { background: rgba(110, 82, 0, 0.95); }
.fp-ha-away.fp-fdr-4 { background: rgba(155, 45, 0, 0.95); }
.fp-ha-away.fp-fdr-5 { background: rgba(130, 0, 0, 0.95); }
/* Club badge circle */
.fp-badge {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255,255,255,0.95);
    padding: 1px;
    flex-shrink: 0;
    display: block;
}
/* H / A label */
.fp-ha {
    color: #fff;
    font-weight: 900;
    font-size: 1em;
    letter-spacing: 0.02em;
}
.fp-ha-abbr { display: none; }
.fp-ha-full { display: inline; text-transform: uppercase; }
.row-clickable {
    cursor: pointer;
}
.row-clickable:hover td {
    background: rgba(0,255,135,0.06) !important;
    color: var(--text-color);
}

.player-name-field {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.60em;
    font-weight: 700;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.player-points-field {
    color: var(--secondary-color);
    font-size: 0.58em;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Bench Section */
.bench-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.bench-title {
    color: white;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.bench-players {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    flex-wrap: wrap;
}

.bench-player {
    opacity: 0.85;
    transition: opacity 0.3s;
}

.bench-player:hover {
    opacity: 1;
}

.player-points-field {
    color: var(--secondary-color);
    font-size: 0.85em;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    margin-top: 2px;
}

.bench-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.bench-title {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.bench-players {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.bench-player {
    opacity: 0.7;
}

/* Performance Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: var(--gradient-primary);
    color: white;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }
    50% { transform: translate(0%, 0%) rotate(180deg); opacity: 1; }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(55, 0, 60, 0.35);
}

.stat-card-value {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.stat-card-label {
    font-size: 0.9em;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

/* Transfer Suggestions */
.transfer-item {
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border-left: 4px solid var(--secondary-dark);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.transfer-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(0, 204, 106, 0.12) 0%, transparent 100%);
    transition: width 0.3s ease;
}

.transfer-item:hover::before {
    width: 100%;
}

.transfer-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.transfer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.transfer-players {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.transfer-out,
.transfer-in {
    flex: 1;
}

.transfer-arrow {
    font-size: 1.5em;
    color: var(--accent-color);
}

.transfer-reason {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.expected-points {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: bold;
}

/* Prediction */
.fixtures-list {
    margin-top: 15px;
}

.fixture-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    border-left: 3px solid rgba(55, 0, 60, 0.3);
    transition: all 0.3s ease;
}

.fixture-item:hover {
    background: rgba(255, 255, 255, 0.98);
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

.fixture-teams {
    font-weight: 500;
}

.fixture-difficulty {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.difficulty-1 { background: #00ff87; color: #000; }
.difficulty-2 { background: #01fc7e; color: #000; }
.difficulty-3 { background: #e7e7e7; color: #000; }
.difficulty-4 { background: #ff1751; color: #fff; }
.difficulty-5 { background: #c10035; color: #fff; }

/* Responsive Design */
@media (max-width: 1024px) {
    .card-large {
        grid-column: span 1;
    }

    .cards-grid {
        height: auto;
        grid-auto-rows: auto;
    }

    .card {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    header {
        padding-top: 56px;
        padding-bottom: 28px;
        padding-left: 20px;
        padding-right: 20px;
        /* Smaller image for mobile */
        background-image: url('https://images.pexels.com/photos/46798/the-ball-stadion-football-the-pitch-46798.jpeg?auto=compress&cs=tinysrgb&w=800');
        text-align: center;
    }

    header h1 {
        font-size: 1.9em;
        letter-spacing: 0.06em;
    }

    .header-eyebrow {
        font-size: 0.62em;
        letter-spacing: 0.22em;
    }

    .search-container {
        flex-direction: column;
    }

    #player-search,
    #position-filter,
    #team-filter {
        width: 100%;
        text-align: center;
    }

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

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        justify-items: center;
    }

    .stat-card {
        text-align: center;
        width: 100%;
    }

    .card-content {
        padding: 12px;
    }

    .card-header {
        padding: 16px;
        text-align: center;
    }

    .card-header h2 {
        font-size: 1.3em;
    }

    /* Smaller jerseys on tablet */
    .player-shirt {
        width: 45px;
        height: 45px;
    }

    .player-kit-img {
        width: 45px;
        height: 45px;
    }

    .card-content .player-shirt {
        width: 38px;
        height: 38px;
    }

    .card-content .player-kit-img {
        width: 38px;
        height: 38px;
    }

    .field-player {
        width: 76px;
    }

    .card-content .field-player {
        width: 68px;
    }

    .player-shirt-box {
        padding: 5px 8px;
    }

    .card-content .player-shirt-box {
        padding: 4px 6px;
    }

    .field-line {
        min-height: 90px;
        margin: 12px 0;
    }

    /* Center field on mobile */
    .football-field {
        padding: 10px;
    }

    /* Center bench players */
    .bench-section {
        text-align: center;
    }

    .bench-title {
        text-align: center;
    }

    .bench-players {
        justify-content: center;
    }

    /* Center transfer items */
    .transfer-item {
        text-align: center;
    }

    /* Better table on mobile */
    table {
        font-size: 0.75em;
    }

    th, td {
        padding: 6px 4px;
    }

    /* Center info sections */
    .stats-info {
        text-align: center;
        padding: 15px;
    }

    .stats-info h4 {
        font-size: 1.1em;
    }

    .stats-info p {
        font-size: 0.85em;
        text-align: left;
    }

    /* Better spacing for top performers on mobile */
    #top-performers > div {
        gap: 10px;
        grid-template-columns: 1fr 1fr;
    }

    /* Center loading states */
    .loading {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    header {
        padding: 56px 12px 18px;
    }

    header h1 {
        font-size: 1.4em;
        letter-spacing: 0.05em;
    }

    .header-eyebrow {
        font-size: 0.55em;
        letter-spacing: 0.18em;
        margin-bottom: 5px;
    }

    .team-subtitle {
        font-size: 0.82em;
    }

    .card-content {
        padding: 10px;
    }

    /* Compact field players for mobile – full info, scaled down */
    .football-field {
        padding: 8px 4px;
        border-radius: 8px;
    }

    .field-player {
        width: 60px;
    }

    .card-content .field-player {
        width: 54px;
    }

    .player-shirt {
        width: 30px;
        height: 30px;
    }

    .player-kit-img {
        width: 30px;
        height: 30px;
    }

    .card-content .player-shirt,
    .card-content .player-kit-img {
        width: 26px;
        height: 26px;
    }

    /* Scale down the C / V badge */
    .player-shirt.captain::after,
    .player-shirt.vice-captain::after {
        width: 12px;
        height: 12px;
        font-size: 0.5em;
        top: -3px;
        right: -3px;
        border-width: 1px;
    }

    .field-line {
        min-height: 82px;
        margin: 8px 0;
    }

    /* Card mobile sizing */
    .player-shirt-box {
        padding: 4px 6px;
    }

    .player-name-field {
        font-size: 0.54em;
    }

    .player-points-field {
        font-size: 0.50em;
    }

    /* Fixture chips on mobile: hide badge, just coloured H/A letter */
    .player-club-badge {
        display: none;
    }

    .player-fixtures-row {
        margin-top: 2px;
    }

    .fp-fix {
        font-size: 0.43em;
        padding: 2px 6px 2px 3px;
        gap: 2px;
        border-radius: 20px;
    }

    .fp-badge {
        width: 10px;
        height: 10px;
    }

    .fp-ha-full { display: none; }
    .fp-ha-abbr { display: inline; }

    .fp-ha {
        font-size: 1em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    th, td {
        padding: 6px 3px;
        font-size: 0.75em;
    }

    /* Top performers cards stacked on small screens */
    #top-performers > div {
        grid-template-columns: 1fr !important;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(55, 0, 60, 0.06);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
}

/* ─── Back Button (subpages) ─────────────────────────────────────────────── */
.back-btn {
    position: absolute;
    top: 12px;
    left: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    line-height: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.30);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.back-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.1);
}

/* ─── Theme Toggle Button ─────────────────────────────────────────────────── */
.theme-toggle {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15em;
    line-height: 1;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.30);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.1);
}

/* ─── Language Switcher ────────────────────────────────────────────────────── */
.lang-switcher {
    position: absolute;
    top: 12px;
    right: 58px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.lang-btn {
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    padding: 3px 5px;
    font-size: 1.3em;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.2s, transform 0.15s, background 0.2s;
    backdrop-filter: blur(6px);
}
.lang-btn:hover {
    opacity: 0.85;
    transform: scale(1.12);
}
.lang-btn--active {
    opacity: 1;
    background: rgba(255,255,255,0.26);
    border-color: rgba(255,255,255,0.55);
    box-shadow: 0 0 0 1.5px rgba(0,255,135,0.45);
}

/* ─── Site Footer ─────────────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 22px 20px;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 0.82em;
    border-top: 1px solid var(--divider);
    letter-spacing: 0.2px;
}
.site-footer .heart {
    color: var(--accent-color);
    font-size: 1.1em;
}
.site-footer strong {
    color: var(--primary-color);
    font-weight: 700;
}
.site-footer .footer-sep {
    margin: 0 12px;
    opacity: 0.35;
}

/* ─── Player Comparison ───────────────────────────────────────────────────── */
.compare-search-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.compare-input {
    flex: 1;
    min-width: 90px;
    padding: 7px 10px;
    border: 1.5px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.83em;
    background: var(--card-bg, #fff);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s;
}
.compare-input:focus {
    border-color: var(--primary-light);
}

#cmp-dropdowns {
    position: relative;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cmp-dropdown {
    flex: 1;
    min-width: 90px;
    background: var(--card-bg, #fff);
    border: 1.5px solid var(--card-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 180px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}
.cmp-dropdown.open { display: block; }
.cmp-dropdown-item {
    padding: 7px 12px;
    font-size: 0.82em;
    cursor: pointer;
    border-bottom: 1px solid var(--divider);
    transition: background 0.15s;
}
.cmp-dropdown-item:last-child { border-bottom: none; }
.cmp-dropdown-item:hover {
    background: rgba(55, 0, 60, 0.06);
}
[data-theme="dark"] .cmp-dropdown-item:hover {
    background: rgba(0, 255, 135, 0.08);
}
.cmp-dropdown-item strong { color: var(--primary-color); }
.cmp-dropdown-item span   { color: var(--text-muted); font-size: 0.9em; }

.cmp-hint {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85em;
    padding: 20px 10px;
}

/* Comparison table */
.cmp-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
    border-radius: 10px;
    border: 1.5px solid var(--card-border);
}
.cmp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 280px;
    font-size: 0.82em;
}
.cmp-table th {
    background: var(--primary-color);
    color: white;
    padding: 9px 10px;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}
.cmp-table th:first-child {
    text-align: left;
    background: var(--primary-color);
    position: sticky;
    left: 0;
    z-index: 6;
}
.cmp-table td {
    padding: 7px 10px;
    text-align: center;
    border-bottom: 1px solid var(--divider);
    white-space: nowrap;
}
.cmp-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9em;
    background: var(--card-bg, #fff);
    position: sticky;
    left: 0;
    z-index: 2;
}
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table tbody tr:nth-child(even) { background: rgba(55, 0, 60, 0.025); }
[data-theme="dark"] .cmp-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.03); }

/* Best / worst highlights */
.cmp-best {
    background: rgba(0, 204, 106, 0.18) !important;
    color: #15803d;
    font-weight: 700;
    border-radius: 5px;
}
.cmp-worst {
    background: rgba(255, 40, 130, 0.13) !important;
    color: #be185d;
    font-weight: 700;
    border-radius: 5px;
}
[data-theme="dark"] .cmp-best  { color: #4ade80; }
[data-theme="dark"] .cmp-worst { color: #f472b6; }

/* Player header row in comparison table */
.cmp-player-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.cmp-player-name {
    font-weight: 700;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}
.cmp-player-meta {
    font-size: 0.78em;
    opacity: 0.8;
}
.cmp-remove-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
    margin-top: 2px;
    line-height: 1;
    transition: color 0.15s;
}
.cmp-remove-btn:hover { color: #ff2882; }

/* card colour */
.card[data-card="comparison"] {
    background: #ffffff;
    border-top: 3px solid var(--primary-light);
}
[data-theme="dark"] .card[data-card="comparison"] {
    background: var(--card-bg) !important;
}

[data-theme="dark"] {
    --bg-color: #0d0818;
    --bg-surface: #16102a;
    --card-bg: #1c1436;
    --card-border: rgba(0, 255, 135, 0.14);
    --text-color: #f0ecfa;
    --text-muted: #9a88bc;
    --text-light: #6a5888;
    --border-color: #2e2245;
    --divider: rgba(0, 255, 135, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
    --shadow-hover: 0 8px 28px rgba(0, 255, 135, 0.14);
    /* Override primary so inline color:var(--primary-color) is readable */
    --primary-color: #c084fc;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #0d0818 0%, #120c22 50%, #0a0616 100%);
}

[data-theme="dark"] body::before {
    background-image:
        radial-gradient(circle at 20% 20%, rgba(55, 0, 60, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 204, 106, 0.08) 0%, transparent 50%);
}

/* Cards */
[data-theme="dark"] .card {
    background: var(--card-bg) !important;
    border-color: var(--card-border);
}
[data-theme="dark"] .card[data-card] {
    background: var(--card-bg) !important;
    border-color: var(--card-border);
}

/* Table */
[data-theme="dark"] .table-container {
    background: var(--bg-surface);
    border-color: var(--card-border);
}
[data-theme="dark"] th {
    background: rgba(55, 0, 60, 0.85) !important;
    color: rgba(240, 236, 250, 0.95) !important;
    border-color: var(--border-color) !important;
}
[data-theme="dark"] td {
    color: var(--text-color);
    border-color: var(--border-color);
}
[data-theme="dark"] td:first-child {
    color: var(--secondary-color);
    background: var(--card-bg);
}
[data-theme="dark"] tbody tr:hover td:first-child {
    background: rgba(0, 255, 135, 0.07);
}

[data-theme="dark"] tbody tr:hover {
    background-color: rgba(0, 255, 135, 0.07) !important;
}

/* ── Form badge (light mode) ── */
.form-badge {
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 700;
    color: white;
    display: inline-block;
}
.form-badge-elite { background: #15803d; }
.form-badge-good  { background: #16a34a; }
.form-badge-avg   { background: #ca8a04; }
.form-badge-low   { background: #ea580c; }
.form-badge-poor  { background: #dc2626; }

/* Form row shading — adjusted for dark background */
[data-theme="dark"] tbody tr.row-form-elite { background-color: rgba(0, 204, 106, 0.14) !important; }
[data-theme="dark"] tbody tr.row-form-good  { background-color: rgba(0, 204, 106, 0.09) !important; }
[data-theme="dark"] tbody tr.row-form-avg   { background-color: rgba(245, 158, 11, 0.10) !important; }
[data-theme="dark"] tbody tr.row-form-low   { background-color: rgba(234, 88, 12, 0.12) !important; }
[data-theme="dark"] tbody tr.row-form-poor  { background-color: rgba(220, 38, 38, 0.16) !important; }
/* Fix td:first-child name color — light-mode rule (color:#00622f) wins on specificity, must beat it */
[data-theme="dark"] tbody tr.row-form-elite td:first-child { color: #4ade80 !important; background: rgba(0, 204, 106, 0.14) !important; }
[data-theme="dark"] tbody tr.row-form-good  td:first-child { color: #86efac !important; background: rgba(0, 204, 106, 0.09) !important; }
[data-theme="dark"] tbody tr.row-form-avg   td:first-child { color: #fcd34d !important; background: rgba(245, 158, 11, 0.10) !important; }
[data-theme="dark"] tbody tr.row-form-low   td:first-child { color: #fb923c !important; background: rgba(234, 88, 12, 0.12) !important; }
[data-theme="dark"] tbody tr.row-form-poor  td:first-child { color: #f87171 !important; background: rgba(220, 38, 38, 0.16) !important; }
/* ── Form badge dark mode overrides ── */
[data-theme="dark"] .form-badge-elite { background: #00cc6a; color: #0a1a10; }
[data-theme="dark"] .form-badge-good  { background: #22c55e; color: #0a1a10; }
[data-theme="dark"] .form-badge-avg   { background: #f59e0b; color: #1a1200; }
[data-theme="dark"] .form-badge-low   { background: #f97316; color: #1a0800; }
[data-theme="dark"] .form-badge-poor  { background: #ef4444; color: #fff; }

/* Inputs */
[data-theme="dark"] #player-search,
[data-theme="dark"] #position-filter,
[data-theme="dark"] #team-filter {
    background: var(--bg-surface);
    color: var(--text-color);
    border-color: var(--border-color);
}
[data-theme="dark"] #player-search::placeholder {
    color: var(--text-muted);
}

/* Transfer & player rows */
[data-theme="dark"] .transfer-item {
    background: var(--bg-surface) !important;
    border-left-color: var(--secondary-dark);
}
[data-theme="dark"] .player-row {
    background: rgba(255, 255, 255, 0.04) !important;
    border-left-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .fixture-item {
    background: rgba(255, 255, 255, 0.04) !important;
    border-left-color: rgba(86, 16, 107, 0.8);
}
[data-theme="dark"] .fixture-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-left-color: var(--primary-light);
}

/* Stats info box */
[data-theme="dark"] .stats-info {
    background: rgba(55, 0, 60, 0.25);
    border-left-color: var(--primary-light);
    color: var(--text-color);
}

/* Loading */
[data-theme="dark"] .loading {
    color: var(--text-muted);
}

/* Scrollbars in dark mode */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2e1a50 0%, #3d2468 100%);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
}

/* Footer in dark mode */
[data-theme="dark"] .site-footer strong {
    color: var(--secondary-color);
}

/* Stat cards — use a subtler dark version instead of the full violet gradient */
[data-theme="dark"] .stat-card {
    background: linear-gradient(135deg, #2a1448 0%, #1c1436 100%) !important;
    border-color: rgba(0, 255, 135, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 6px 22px rgba(0, 255, 135, 0.15);
}

/* stat-value / stat-label / player-meta visibility in dark mode */
[data-theme="dark"] .stat-value {
    color: #00ff87;
}
[data-theme="dark"] .stat-label,
[data-theme="dark"] .player-meta {
    color: var(--text-muted);
}

/* Expand button on dashboard cards */
[data-theme="dark"] .expand-btn {
    background: rgba(0, 255, 135, 0.12);
    color: var(--secondary-color);
    border-color: rgba(0, 255, 135, 0.25);
}
[data-theme="dark"] .expand-btn:hover {
    background: rgba(0, 255, 135, 0.22);
}

/* Card headers ("My Team", "Transfer Suggestions" etc) in dark mode */
[data-theme="dark"] .card-header {
    border-bottom-color: var(--border-color);
}
[data-theme="dark"] .card-header h2 {
    color: var(--text-color);
}

/* Subpage search container */
[data-theme="dark"] .search-container {
    background: transparent;
}

/* Inner scrollbar override */
[data-theme="dark"] .card-content .table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}
