/* ============================================================================
   STRABO FPL - Main Application Styles
   Modern Agentic AI Interface - Clean & Professional
   ============================================================================ */

/* --- CSS Variables --- Dark Theme (Unified) --- */
:root {
    /* Brand Colors */
    --strabo-navy: #0F172A;
    --accent: #00B8D9;
    --accent-light: #00E5FF;
    --accent-dark: #0097B2;
    --accent-glow: rgba(0, 184, 217, 0.15);
    --accent-dim: rgba(0, 184, 217, 0.08);
    --accent-warm: #F59E0B;
    --accent-gradient: linear-gradient(135deg, #00B8D9, #0070DD);
    --data-slate: #64748B;
    --alert-coral: #EF4444;

    /* Legacy aliases (all point to accent cyan) */
    --ascent-green: var(--accent);
    --ascent-green-light: var(--accent-light);
    --ascent-green-dark: var(--accent-dark);
    --pitch-green: var(--accent);
    --pitch-green-light: var(--accent-light);
    --pitch-green-dark: var(--accent-dark);
    --pitch-glow: var(--accent-glow);
    --fpl-green: var(--accent);
    --fpl-green-dark: var(--accent-dark);
    --node-purple: var(--accent);
    --node-purple-light: var(--accent-light);
    --node-purple-dark: var(--accent-dark);

    /* Background — Dark Theme (Phase 2 softening).
       Original palette was anchored at #09090B (near-black) and read as a
       heavy void. The new ramp is anchored at #0F1422 — a warm dark navy
       aligned with the brand's --navy-app — and lifts the whole ramp ~5%
       so cards have somewhere to elevate to, borders breathe, and the
       surface reads as a calm dark page rather than pure black. */
    --bg-primary: var(--app-bg);        /* was #0F1422 */
    --bg-secondary: var(--app-raised);  /* was #171C2C */
    --bg-tertiary: var(--app-raised);   /* was #1E2334 */
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-elevated: var(--app-raised);   /* was #22283C */
    --bg-sidebar: var(--app-bg);        /* was #0F1422 */
    --bg-header: var(--app-bg);         /* was #0F1422 */
    --bg-input: var(--app-raised);      /* was #171C2C */

    /* Dark surface aliases */
    --dark-bg: var(--app-bg);           /* was #0F1422 */
    --dark-card: var(--app-raised);     /* was #1E2334 */
    --dark-border: rgba(255, 255, 255, 0.08);
    --dark-hover: rgba(255, 255, 255, 0.04);
    --cream: var(--app-raised);          /* was #1E2334 */
    --cream-muted: rgba(30, 35, 52, 0.7);
    --canvas-white: var(--app-bg);       /* was #0F1422 */

    /* Text - Light on dark */
    --text-primary: var(--text-1);      /* was #EFEFEF */
    --text-secondary: var(--text-3);    /* was #9CA3AF */
    --text-muted: var(--text-4);        /* was #6B7280 */
    --text-dim: var(--text-4);          /* was #4B5563 */
    --text-on-dark: var(--text-1);      /* was #EFEFEF */
    --text-on-dark-secondary: var(--text-3); /* was #9BA1A8 */
    --text-on-dark-muted: var(--text-4);     /* was #6B7280 */

    /* Borders - Dark context */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.03);
    --border-focus: var(--accent);

    /* Status Colors */
    --success: var(--pos);              /* was #10B981 */
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.25);
    --warning: var(--amb);              /* was #F59E0B */
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.25);
    --danger: var(--neg);               /* was #EF4444 */
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.25);
    --info: #3B82F6;                    /* blue: no semantic alias */
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-border: rgba(59, 130, 246, 0.25);

    /* Spacing - 8px grid */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Typography Scale */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 32px;
    --text-4xl: 40px;
    --font-mono: 'Geist Mono', 'JetBrains Mono', monospace;
    --font-display: 'Geist Sans', 'Inter', -apple-system, system-ui, sans-serif;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows - Dark context */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 184, 217, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Glass morphism */
    --glass-bg: rgba(255, 255, 255, 0.035);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 12px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Geist Sans', 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--app-bg);
    color: var(--text-1);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--app-bg);
    border-right: 1px solid var(--app-hairline);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal), width var(--transition-normal);
}

.sidebar-header {
    padding: 12px var(--spacing-lg);
    border-bottom: 1px solid var(--app-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

.sidebar-logo img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
}

/* Hide logo text label */
.sidebar-logo span {
    display: none;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-2);
    padding: 8px;
    border-radius: 6px;
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--app-raised);
}

/* --- Sidebar Navigation --- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--app-raised);
    color: var(--text-1);
    border-color: var(--app-hairline);
}

.nav-item.active {
    background: var(--success-bg);
    color: var(--ascent-green);
    border-color: var(--success-border);
    font-weight: 600;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--node-purple);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.nav-badge.live {
    background: var(--danger);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--app-hairline);
}

.user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--app-raised);
    border-radius: 10px;
    margin-bottom: 12px;
}

.user-team {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-rank {
    font-size: 12px;
    color: var(--text-3);
}

.user-settings {
    color: var(--text-3);
    padding: 8px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.user-settings:hover {
    color: var(--text-1);
    background: var(--app-raised);
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--app-hairline);
    border-radius: 8px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    /* ⚠️ GROUND, NOT CARD. This painted --app-raised, the same token every
       card uses, so the light site was white cards on a white canvas with only
       a 1px hairline between them: the generic rounded-box-on-white look, and
       the two-surface model in DESIGN_SYSTEM_HANDOFF collapsed to one. The
       giveaway was .topnav and .cat-tabs, which already paint --app-bg and so
       rendered as tinted strips floating on nothing. */
    background: var(--app-bg);
}

.content-header {
    position: sticky;
    top: 0;
    min-height: var(--header-height);
    background: var(--app-bg);
    border-bottom: 1px solid var(--app-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    z-index: 50;
    box-shadow: var(--shadow-xs);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-2);
    padding: var(--spacing-sm);
}

.page-title h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

.page-title p {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 2px;
}

/* Header right - prevent overflow */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    max-width: 50%;
    overflow-x: auto;
}

/* Responsive header actions */
@media (max-width: 1200px) {
    .header-right {
        max-width: 40%;
    }
    .header-right .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .header-right select {
        padding: 6px 10px !important;
        font-size: 12px;
    }
}

.content-body {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--app-bg);   /* ground, not card — see .main-content above */
}

/* --- Cards --- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--app-raised);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-1);
    letter-spacing: -0.01em;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    background: var(--app-raised);
}

/* --- Stat Cards --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 28px;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-card .stat-change {
    font-size: 13px;
    margin-top: var(--spacing-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-card .stat-change.positive {
    color: var(--success);
}

.stat-card .stat-change.negative {
    color: var(--danger);
}

/* --- Grid Layouts --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --- Tables --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    background: var(--app-raised);
    white-space: nowrap;
}

.data-table td {
    color: var(--text-1);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--app-raised);
}

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--ascent-green);
    color: white;
    box-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    background: var(--ascent-green-dark);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--app-raised);
    color: var(--text-1);
    border: 1px solid var(--app-hairline);
}

.btn-secondary:hover {
    border-color: var(--text-3);
    background: var(--app-raised);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: none;
}

.btn-ghost:hover {
    background: var(--app-sunk);
    color: var(--text-1);
}

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

.btn-success:hover {
    background: var(--ascent-green-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--hero-focal);           /* was #B45309 amber dark */
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-purple {
    background: rgba(18, 230, 101, 0.15);
    color: var(--node-purple-light);
}

/* --- Tags (smaller badges) --- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    background: var(--app-raised);
    color: var(--text-2);
}

.tag-green, .tag-success {
    background: var(--success-bg);
    color: var(--success);
}

.tag-purple {
    background: rgba(18, 230, 101, 0.15);
    color: var(--node-purple-light);
}

.tag-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.tag-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.tag-info {
    background: var(--info-bg);
    color: var(--info);
}

/* --- Player Cards --- */
.player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--app-hairline);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.player-row:hover {
    background: var(--app-raised);
}

.player-row:last-child {
    border-bottom: none;
}

.player-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--app-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-meta {
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: right;
}

.player-stat {
    min-width: 48px;
}

.player-stat-value {
    font-weight: 600;
    font-size: 14px;
}

.player-stat-label {
    font-size: 11px;
    color: var(--text-3);
}

/* --- Pitch View --- */
.pitch-container {
    background: linear-gradient(180deg, #37C26C 0%, #38BE62 30%, #37C26C 50%, #38BE62 70%, #37C26C 100%);
    border-radius: 8px;
    padding: 32px 32px 8px 32px;
    position: relative;
    max-width: 750px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pitch-lines {
    position: absolute;
    inset: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.pitch-center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.pitch-center-line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.pitch-player {
    position: absolute;
    width: 60px;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.pitch-player:hover {
    transform: scale(1.05);
}

.pitch-player-shirt {
    width: 40px;
    height: 40px;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: var(--app-raised);
    border: 2px solid var(--app-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.pitch-player-shirt.captain {
    border-color: var(--fpl-green);
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.4);
}

.pitch-player-name {
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pitch-player-points {
    font-size: 10px;
    color: var(--fpl-green);
    font-weight: 600;
}

.pitch-player-kit {
    width: 45px;
    height: 55px;
    object-fit: contain;
    margin: 0 auto 4px;
    filter: drop-shadow(0 2px 4px rgba(5, 27, 44, 0.12));
    transition: transform var(--transition-fast);
}

.pitch-player-kit.captain {
    filter: drop-shadow(0 0 8px rgba(0, 255, 135, 0.6));
}

.pitch-player:hover .pitch-player-kit {
    transform: scale(1.1);
}

.captain-badge, .vc-badge {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    margin-right: 2px;
}

.captain-badge {
    background: var(--fpl-green);
    color: black;
}

.vc-badge {
    background: var(--text-3);
    color: white;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 27, 44, 0.15);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--app-raised);
    border: none;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-content {
    padding: 24px;
}

/* --- Player Modal Content --- */
.player-modal-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.player-modal-photo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: var(--app-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.player-modal-info h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.player-modal-info .team-pos {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 8px;
}

.player-modal-quick-stats {
    display: flex;
    gap: 16px;
}

.player-modal-quick-stat {
    text-align: center;
}

.player-modal-quick-stat .value {
    font-size: 20px;
    font-weight: 700;
}

.player-modal-quick-stat .label {
    font-size: 11px;
    color: var(--text-3);
}

/* --- Heatmap (Placeholder) --- */
.heatmap-container {
    background: var(--app-raised);
    border-radius: 8px;
    aspect-ratio: 3/2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    margin: 16px 0;
    position: relative;
    overflow: hidden;
}

.heatmap-pitch {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a3d1a 0%, #2a5a2a 100%);
    position: relative;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--app-hairline);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-1);
}

.tab.active {
    color: var(--node-purple-light);
    border-bottom-color: var(--node-purple);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- AI Agent Cards --- */
.agent-card {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all var(--transition-fast);
}

.agent-card:hover {
    border-color: var(--node-purple);
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.agent-icon {
    font-size: 22px;
}

.agent-name {
    font-weight: 600;
    font-size: 14px;
}

.agent-status {
    margin-left: auto;
    font-size: 12px;
}

.agent-status.active {
    color: var(--success);
}

.agent-status.idle {
    color: var(--text-3);
}

.agent-description {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 16px;
}

.agent-last-alert {
    font-size: 13px;
    padding: 12px;
    background: var(--app-raised);
    border-radius: 8px;
}

.agent-last-alert-time {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 4px;
}

/* --- Ontology Insight Tags --- */
.insight-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 100px;
    margin-right: 6px;
    margin-top: 8px;
}

.insight-tag.ontology {
    background: rgba(18, 230, 101, 0.15);
    color: var(--node-purple-light);
}

.insight-tag.statistical {
    background: var(--info-bg);
    color: var(--info);
}

.insight-tag.agent {
    background: var(--success-bg);
    color: var(--success);
}

/* --- Loading States --- */
.skeleton {
    background: linear-gradient(90deg, var(--app-raised) 25%, var(--bg-card-hover) 50%, var(--app-raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--app-hairline);
    border-top-color: var(--node-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Empty States --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-3);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 640px) {
    .content-body {
        padding: 16px;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
}

/* --- Utility Classes --- */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-3); }
.text-purple { color: var(--node-purple-light); }

.bg-success { background: var(--success-bg); }
.bg-warning { background: var(--warning-bg); }
.bg-danger { background: var(--danger-bg); }

.font-mono { font-family: 'SF Mono', Monaco, monospace; }

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* --- Fixture Ticker --- */
.fixture-ticker {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    background: transparent;
    border-bottom: none;
    overflow-x: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Fixture ticker in player cards on pitch */
.player-chip .fixture-ticker {
    gap: 1px;
    justify-content: center;
    margin-top: 3px;
    width: 100%;
}

.fixture-ticker::-webkit-scrollbar {
    display: none;
}

.ticker-deadline {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.ticker-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 2px;
}

.ticker-countdown {
    font-size: 18px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--fpl-green);
}

.ticker-countdown.urgent {
    color: var(--danger);
    animation: pulse 1s ease-in-out infinite;
}

.ticker-divider {
    width: 1px;
    height: 32px;
    background: var(--app-hairline);
}

.ticker-fixtures {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow-x: auto;
    padding-right: 24px;
}

.ticker-fixture {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--app-raised);
    border-radius: 8px;
    border: 1px solid var(--app-hairline);
    min-width: max-content;
    transition: all var(--transition-fast);
}

.ticker-fixture:hover {
    border-color: var(--border-light);
}

.ticker-fixture.live {
    border-color: var(--danger);
    animation: pulse 2s infinite;
}

.ticker-team {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.ticker-team img {
    width: 18px;
    height: 18px;
}

.ticker-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    min-width: 50px;
    text-align: center;
}

.ticker-time {
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
}

.ticker-live-badge {
    font-size: 9px;
    font-weight: 700;
    background: var(--danger);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

.toast.exiting {
    animation: slideOut 0.3s ease forwards;
}

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

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

.toast-icon {
    font-size: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-2);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

/* --- Keyboard Shortcuts --- */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--app-raised);
    border-radius: 8px;
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    background: var(--app-raised);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-1);
}

.shortcut-item span {
    font-size: 13px;
    color: var(--text-2);
}

/* --- Shot Map --- */
.shot-map-container {
    position: relative;
    width: 100%;
    min-height: 280px;
    background: transparent;
    border-radius: 8px;
    overflow: visible;
}

.shot-map-svg {
    width: 100%;
    height: auto;
    min-height: 250px;
    border-radius: 8px;
    display: block;
}

.goal-marker {
    animation: goalPop 0.3s ease-out forwards;
}

@keyframes goalPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.shot-map-pitch {
    position: absolute;
    inset: 0;
}

.shot-map-lines {
    position: absolute;
    inset: 5%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Penalty area */
.shot-map-lines::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16%;
    height: 44%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-right: none;
}

/* 6-yard box */
.shot-map-lines::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6%;
    height: 20%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-right: none;
}

.shot-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10;
}

.shot-marker:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 20;
}

.shot-marker.goal {
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.shot-marker.saved {
    background: var(--warning);
}

.shot-marker.miss {
    background: var(--danger);
    opacity: 0.7;
}

.shot-marker.blocked {
    background: var(--text-3);
    opacity: 0.6;
}

/* Shot tooltip */
.shot-tooltip {
    position: absolute;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.shot-marker:hover + .shot-tooltip,
.shot-tooltip:hover {
    opacity: 1;
}

.shot-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    font-size: 12px;
}

.shot-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
}

.shot-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* --- Charts --- */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
}

.chart-container.tall {
    height: 300px;
}

.mini-chart {
    height: 60px;
}

/* --- Loading Skeletons --- */
.skeleton-card {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

.skeleton-line.full {
    width: 100%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-chart {
    height: 150px;
    border-radius: 8px;
}

/* --- Page Transitions --- */
.content-body {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- FDR Colors (Fixture Difficulty 1=easy→5=hard) --- */
.fdr-1 { background: #059669 !important; color: white; } /* deep green: intentional scale */
.fdr-2 { background: #10b981 !important; color: white; } /* mid green: intentional scale */
.fdr-3 { background: #6b7280 !important; color: white; } /* neutral: intentional scale */
.fdr-4 { background: #ef4444 !important; color: white; } /* red: intentional scale */
.fdr-5 { background: #b91c1c !important; color: white; } /* deep red: intentional scale */

/* --- Multi-Week Planner Grid --- */
.planner-grid {
    display: grid;
    gap: 2px;
    background: var(--app-hairline);
    border-radius: 8px;
    overflow: hidden;
}

.planner-header-row {
    display: contents;
}

.planner-header-cell {
    background: var(--app-sunk);
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
}

.planner-row {
    display: contents;
}

.planner-player-cell {
    background: var(--app-raised);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.planner-fixture-cell {
    background: var(--app-raised);
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.planner-fixture-cell:hover {
    background: var(--bg-card-hover);
}

.planner-fixture-cell.blank {
    background: var(--app-sunk);
    color: var(--text-3);
}

.planner-fixture-cell.double {
    position: relative;
}

.planner-fixture-cell.double::after {
    content: '×2';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
    color: var(--fpl-green);
    font-weight: 700;
}

/* --- Transfer Compare --- */
.compare-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
}

.compare-player {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    padding: 20px;
}

.compare-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-3);
    padding-top: 40px;
}

.compare-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--app-hairline);
}

.compare-stat-row:last-child {
    border-bottom: none;
}

.compare-stat-label {
    font-size: 13px;
    color: var(--text-3);
}

.compare-stat-value {
    font-weight: 600;
    font-size: 14px;
}

.compare-stat-value.better {
    color: var(--success);
}

.compare-stat-value.worse {
    color: var(--danger);
}

/* --- Responsive Ticker --- */
@media (max-width: 768px) {
    .fixture-ticker {
        padding: 0;
    }
    
    .ticker-deadline {
        min-width: 80px;
    }
    
    .ticker-countdown {
        font-size: 16px;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   ONTOLOGY INSIGHTS - "The Why" Component System
   ============================================================================ */

/* --- Ontology Hero Section (Dashboard) --- */
.ontology-hero {
    background: linear-gradient(135deg, 
        rgba(18, 230, 101, 0.15) 0%, 
        rgba(0, 255, 135, 0.08) 50%, 
        rgba(18, 230, 101, 0.15) 100%);
    border: 1px solid rgba(18, 230, 101, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.ontology-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, rgba(18, 230, 101, 0.1), transparent 60%);
    pointer-events: none;
}

.ontology-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.ontology-hero-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
}

.ontology-hero-title .ontology-icon {
    font-size: 28px;
}

.ontology-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--node-purple), var(--node-purple-dark));
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    box-shadow: 0 2px 8px rgba(18, 230, 101, 0.4);
}

.ontology-badge::before {
    content: '🧠';
    font-size: 12px;
}

/* --- Ontology Insight Grid --- */
.ontology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    position: relative;
    z-index: 1;
}

/* --- Individual Insight Card --- */
.insight-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.insight-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-dim);
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--node-purple), var(--fpl-green));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.insight-card:hover::before {
    opacity: 1;
}

.insight-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.insight-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(18, 230, 101, 0.2), rgba(0, 255, 135, 0.1));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.insight-card-icon.fatigue { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.1)); }
.insight-card-icon.fixture { background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(59, 130, 246, 0.1)); }
.insight-card-icon.form { background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(18, 230, 101, 0.1)); }
.insight-card-icon.injury { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.1)); }

.insight-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.3;
}

.insight-card-type {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.insight-card-body {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
    margin-bottom: 12px;
}

.insight-card-why {
    background: rgba(18, 230, 101, 0.1);
    border-left: 3px solid var(--node-purple);
    border-radius: 0 8px 8px 0;
    padding: 10px 12px;
    margin-top: 12px;
}

.insight-card-why-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--node-purple-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.insight-card-why-text {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.4;
}

/* --- Insight Explanation Component (Reusable) --- */
.insight-explanation {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    padding: 16px;
    transition: all var(--transition-normal);
}

.insight-explanation:hover {
    border-color: rgba(18, 230, 101, 0.4);
    box-shadow: 0 4px 16px rgba(5, 27, 44, 0.08);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--app-hairline);
}

.insight-icon {
    font-size: 20px;
}

.insight-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    flex: 1;
}

.insight-factors {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

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

.factor-name {
    flex: 1;
    font-size: 12px;
    color: var(--text-2);
    min-width: 140px;
}

.factor-bar-container {
    flex: 2;
    height: 8px;
    background: var(--app-sunk);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.factor-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.factor-bar.positive {
    background: linear-gradient(90deg, var(--success), var(--fpl-green));
}

.factor-bar.negative {
    background: linear-gradient(90deg, var(--danger), #f97316);
}

.factor-bar.neutral {
    background: linear-gradient(90deg, var(--text-3), var(--text-4));
}

.factor-impact {
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.factor-impact.positive {
    color: var(--fpl-green);
}

.factor-impact.negative {
    color: var(--danger);
}

.insight-confidence {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--app-hairline);
    font-size: 12px;
}

.insight-confidence-level {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
}

.confidence-indicator {
    display: flex;
    gap: 3px;
}

.confidence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--app-raised);
}

.confidence-dot.filled {
    background: var(--fpl-green);
}

.confidence-dot.filled.medium {
    background: var(--warning);
}

.confidence-dot.filled.low {
    background: var(--danger);
}

.insight-model {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--node-purple-light);
    font-weight: 500;
}

.insight-model::before {
    content: '🧠';
    font-size: 10px;
}

/* --- Player Why Tooltip (Enhanced) --- */
.player-why-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 12px 32px rgba(5, 27, 44, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
    pointer-events: none;
}

.player-why-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--app-raised);
}

.player-why-tooltip.show,
.pitch-player:hover .player-why-tooltip,
.bench-player:hover .player-why-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.player-why-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--app-hairline);
}

.player-why-score {
    text-align: center;
}

.player-why-xpts {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--fpl-green), var(--node-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.player-why-label {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.player-why-factors {
    margin-bottom: 12px;
}

.player-why-factor {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
}

.player-why-factor-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.player-why-factor-name {
    flex: 1;
    color: var(--text-2);
}

.player-why-factor-value {
    font-weight: 600;
}

.player-why-factor-value.positive {
    color: var(--fpl-green);
}

.player-why-factor-value.negative {
    color: var(--danger);
}

.player-why-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--app-hairline);
    font-size: 11px;
}

.player-why-confidence {
    color: var(--text-3);
}

.player-why-model {
    color: var(--node-purple-light);
    font-weight: 500;
}

/* --- Ontology Insight Types --- */
.insight-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.insight-type-badge.fatigue {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amb);
}

.insight-type-badge.fixture {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.insight-type-badge.form {
    background: rgba(0, 255, 135, 0.15);
    color: var(--fpl-green);
}

.insight-type-badge.injury {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.insight-type-badge.differential {
    background: rgba(18, 230, 101, 0.15);
    color: var(--node-purple-light);
}

.insight-type-badge.rotation {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

/* --- Why Score Modal Component --- */
.why-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    background: var(--app-bg);          /* was #141416 near-black modal */
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px;
    z-index: 2000;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.why-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--app-hairline);
}

.why-modal-player-img {
    width: 60px;
    height: 72px;
    object-fit: contain;
}

.why-modal-player-info {
    flex: 1;
}

.why-modal-player-name {
    font-size: 20px;
    font-weight: 700;
}

.why-modal-player-meta {
    font-size: 13px;
    color: var(--text-3);
}

.why-modal-xpts {
    text-align: center;
}

.why-modal-xpts-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--fpl-green);
    line-height: 1;
}

.why-modal-xpts-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
}

.why-modal-section {
    margin-bottom: 20px;
}

.why-modal-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
    margin-bottom: 12px;
}

.why-modal-factor {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--app-raised);
    border-radius: 8px;
    margin-bottom: 8px;
}

.why-modal-factor:last-child {
    margin-bottom: 0;
}

.why-modal-factor-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.why-modal-factor-content {
    flex: 1;
}

.why-modal-factor-name {
    font-size: 13px;
    font-weight: 500;
}

.why-modal-factor-desc {
    font-size: 11px;
    color: var(--text-3);
}

.why-modal-factor-impact {
    font-size: 14px;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
}

.why-modal-factor-impact.positive { color: var(--fpl-green); }
.why-modal-factor-impact.negative { color: var(--danger); }

.why-modal-confidence {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(18, 230, 101, 0.1), rgba(0, 255, 135, 0.05));
    border-radius: 10px;
}

.why-modal-confidence-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.why-modal-confidence-bar {
    display: flex;
    gap: 3px;
}

.why-modal-confidence-segment {
    width: 24px;
    height: 6px;
    background: var(--app-raised);
    border-radius: 3px;
}

.why-modal-confidence-segment.filled {
    background: var(--fpl-green);
}

.why-modal-confidence-text {
    font-size: 12px;
    color: var(--text-2);
}

.why-modal-confidence-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--node-purple-light);
}

/* --- Ontology Dashboard Stats --- */
.ontology-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.ontology-stat {
    text-align: center;
    padding: 12px;
    background: rgba(5, 27, 44, 0.08);
    border-radius: 10px;
}

.ontology-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--fpl-green);
}

.ontology-stat-label {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .ontology-grid {
        grid-template-columns: 1fr;
    }
    
    .ontology-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .player-why-tooltip {
        width: 240px;
    }
}

/* ============================================================================
   X INTELLIGENCE STYLES
   ============================================================================ */

/* Dashboard Intel Section */
.intel-section {
    background: linear-gradient(135deg, var(--paper-soft) 0%, var(--paper) 50%, var(--paper-soft) 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(18, 230, 101, 0.3);
    animation: intel-border-glow 3s ease-in-out infinite;
}

@keyframes intel-border-glow {
    0%, 100% { border-color: rgba(18, 230, 101, 0.3); box-shadow: 0 0 20px rgba(18, 230, 101, 0.1); }
    50% { border-color: rgba(18, 230, 101, 0.5); box-shadow: 0 0 30px rgba(18, 230, 101, 0.2); }
}

.intel-section::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(18, 230, 101, 0.08) 0%, transparent 40%);
    animation: intel-ambient 15s linear infinite;
    pointer-events: none;
}

@keyframes intel-ambient {
    0% { transform: translate(0, 0); }
    100% { transform: translate(33%, 33%); }
}

.intel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.intel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.intel-live-dot {
    width: 10px;
    height: 10px;
    background: var(--neg);             /* was #EF4444 */
    border-radius: 50%;
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.intel-logo {
    font-size: 24px;
    font-weight: 700;
}

.intel-badge {
    background: var(--accent-gradient);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.intel-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-3);
}

.intel-link {
    color: var(--fpl-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.intel-link:hover {
    color: var(--fpl-green-dark);
}

.intel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    position: relative;
    z-index: 1;
}

@media (max-width: 1024px) {
    .intel-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.intel-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.intel-card-wide {
    grid-column: 1 / -1;
}

.intel-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
}

.intel-card-icon {
    font-size: 16px;
}

.intel-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

.intel-card-body {
    padding: 12px 16px;
    min-height: 100px;
}

.intel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 80px;
    color: var(--text-3);
    font-size: 13px;
}

.intel-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-dim);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.intel-player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.intel-player-row:last-child {
    border-bottom: none;
}

.intel-player-name {
    font-weight: 600;
    font-size: 14px;
    color: white;
    flex: 1;
}

.intel-player-team {
    font-size: 12px;
    color: var(--text-3);
    width: 60px;
}

.intel-player-reason {
    font-size: 12px;
    color: var(--text-3);
    flex: 2;
}

.intel-sentiment-bar {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.intel-sentiment-fill {
    height: 100%;
    border-radius: 3px;
}

.intel-sentiment-fill.positive {
    background: linear-gradient(90deg, #00FF87, #22C55E);
}

.intel-sentiment-fill.negative {
    background: linear-gradient(90deg, #EF4444, #F97316);
}

.intel-injury-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.intel-injury-row:last-child {
    border-bottom: none;
}

.intel-injury-status {
    flex: 1;
    font-size: 12px;
    color: var(--text-3);
}

.intel-confidence {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.intel-confidence.high {
    background: rgba(239, 68, 68, 0.2);
    color: var(--neg);                  /* was #EF4444 */
}

.intel-confidence.medium {
    background: rgba(251, 191, 36, 0.2);
    color: var(--amb);                  /* was #FBBF24 */
}

.intel-confidence.low {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-3);               /* was #9CA3AF */
}

.intel-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-4);
    font-size: 13px;
}

.intel-takes-marquee {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 230, 101, 0.3) transparent;
}

.intel-take {
    flex-shrink: 0;
    font-style: italic;
    color: var(--text-2);
    font-size: 13px;
}

.intel-take-divider {
    color: rgba(18, 230, 101, 0.5);
}

.intel-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-3);
    font-size: 14px;
}

.intel-error span {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    animation: spin 2s linear infinite;
}

/* ============================================================================
   NOTIFICATION SYSTEM
   ============================================================================ */

/* --- Notification Bell --- */
.notification-bell {
    position: relative;
    margin-right: 12px;
}

.bell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 10px;
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.bell-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-1);
    border-color: var(--border-light);
}

.bell-btn svg {
    transition: transform 0.2s ease;
}

.bell-btn:hover svg {
    transform: rotate(15deg);
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* --- Notification Dropdown --- */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.2s ease;
    z-index: 1000;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--app-raised);
    border-bottom: 1px solid var(--app-hairline);
    font-weight: 600;
    font-size: 14px;
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--node-purple);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.mark-all-read:hover {
    background: rgba(18, 230, 101, 0.1);
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

/* --- Notification Item --- */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--app-hairline);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--app-sunk);
}

.notification-item.notification-unread {
    background: rgba(18, 230, 101, 0.05);
}

.notification-item.notification-unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--node-purple);
}

.notification-item.notification-high {
    background: rgba(239, 68, 68, 0.05);
}

.notification-item.notification-high.notification-unread::before {
    background: linear-gradient(180deg, #ef4444, #f97316);
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-raised);
    border-radius: 8px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-1);
    margin-bottom: 2px;
    line-height: 1.4;
}

.notification-message {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 11px;
    color: var(--text-4);
}

.notification-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--app-raised);
    border: none;
    border-radius: 4px;
    color: var(--text-3);
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-item:hover .notification-dismiss {
    opacity: 1;
}

.notification-dismiss:hover {
    background: var(--danger);
    color: white;
}

/* --- Empty State --- */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-3);
}

.notification-empty span {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.notification-empty p {
    font-size: 13px;
    color: var(--text-4);
}

/* --- Footer --- */
.notification-footer {
    padding: 12px 16px;
    background: var(--app-raised);
    border-top: 1px solid var(--app-hairline);
    text-align: center;
}

.notification-footer a {
    color: var(--node-purple);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* --- Toast Notifications (Enhanced) --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideInToast 0.3s ease;
    transition: all 0.2s ease;
}

.toast.exiting {
    animation: slideOutToast 0.3s ease forwards;
}

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

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

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-1);
}

.toast-message {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.toast-close:hover {
    opacity: 1;
}

/* Toast types */
.toast.success {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, var(--app-raised), rgba(34, 197, 94, 0.1));
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, var(--app-raised), rgba(239, 68, 68, 0.1));
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, var(--app-raised), rgba(245, 158, 11, 0.1));
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info {
    border-color: rgba(18, 230, 101, 0.3);
    background: linear-gradient(135deg, var(--app-raised), rgba(18, 230, 101, 0.1));
}

.toast.info .toast-icon {
    color: var(--node-purple);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .notification-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }
    
    .notification-dropdown.show {
        transform: translateY(0);
    }
    
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

/* ============================================================================
   UX/LAYOUT FIXES - Scanability, Overflow Prevention, Compact Lists
   ============================================================================ */

/* --- Prevent Horizontal Overflow --- */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.content-body {
    overflow-x: hidden;
    padding-right: 24px;
}

/* --- Responsive Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

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

/* --- Card Constraints --- */
.card {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- Table Constraints --- */
.data-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
}

.data-table-compact {
    max-height: 250px;
    overflow-y: auto;
}

.data-table-mini {
    max-height: 200px;
    overflow-y: auto;
}

/* --- Compact List --- */
.compact-list {
    max-height: 300px;
    overflow-y: auto;
}

.compact-list-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--app-hairline);
}

.compact-list-item:last-child {
    border-bottom: none;
}

/* --- Show More Button --- */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 8px;
    color: var(--text-3);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    transition: all var(--transition-fast);
}

.show-more-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-1);
    border-color: var(--border-light);
}

/* --- Collapsible Section --- */
.collapsible-section {
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--app-raised);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.collapsible-header:hover {
    background: var(--bg-card-hover);
}

.collapsible-toggle {
    font-size: 12px;
    color: var(--text-3);
    transition: transform var(--transition-fast);
}

.collapsible-section.open .collapsible-toggle {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.collapsible-section.open .collapsible-content {
    max-height: 1000px;
}

/* --- Scrollable Horizontal Container --- */
.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.scroll-x::-webkit-scrollbar {
    height: 6px;
}

.scroll-x::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-x::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

/* --- Stats Row - Horizontal Compact --- */
.stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-mini {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
    padding: 12px;
    text-align: center;
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 8px;
}

.stat-mini-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-mini-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
}

/* --- List with Limit --- */
.limited-list {
    position: relative;
}

.limited-list .list-item.hidden-overflow {
    display: none;
}

.limited-list.expanded .list-item.hidden-overflow {
    display: flex;
}

/* --- Improved Section Spacing --- */
.section-gap {
    margin-bottom: 24px;
}

.section-gap-sm {
    margin-bottom: 16px;
}

.section-gap-lg {
    margin-bottom: 32px;
}

/* --- Improved Visual Hierarchy --- */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-3);
    margin-top: -12px;
    margin-bottom: 16px;
}

/* --- Mobile Responsive Enhancements --- */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-direction: column;
    }
    
    .stat-mini {
        max-width: 100%;
    }
    
    .hide-mobile {
        display: none !important;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
    
    .content-body {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card .stat-icon {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .stat-card .stat-value {
        font-size: 18px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
}

/* --- Limit Content Height with Fade --- */
.content-fade-limit {
    position: relative;
    max-height: 300px;
    overflow: hidden;
}

.content-fade-limit::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--app-raised));
    pointer-events: none;
}

.content-fade-limit.expanded {
    max-height: none;
}

.content-fade-limit.expanded::after {
    display: none;
}

/* --- Player Row Compact --- */
.player-row-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--app-hairline);
}

.player-row-compact:last-child {
    border-bottom: none;
}

.player-row-compact .player-name {
    font-size: 13px;
}

.player-row-compact .player-meta {
    font-size: 11px;
}

/* --- Tabs Compact --- */
.tabs-compact {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--app-raised);
    border-radius: 8px;
    margin-bottom: 16px;
}

.tabs-compact .tab {
    padding: 8px 16px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    margin-bottom: 0;
}

/* --- Table Row Limit Utility --- */
.table-row-limit tbody tr:nth-child(n+11) {
    display: none;
}

.table-row-limit.expanded tbody tr {
    display: table-row;
}

/* --- Insight Card Compact --- */
.insight-card-compact {
    padding: 12px;
    margin-bottom: 8px;
}

.insight-card-compact .insight-card-header {
    margin-bottom: 8px;
}

.insight-card-compact .insight-card-body {
    font-size: 12px;
    margin-bottom: 8px;
}

/* --- Price Watch Compact --- */
.price-watch-compact .player-row {
    padding: 10px 16px;
}

.price-watch-compact .player-photo {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* --- Chart Height Limits --- */
.chart-container-sm {
    height: 200px;
}

.chart-container-md {
    height: 300px;
}

.chart-container-lg {
    height: 400px;
}

/* ============================================================================
   UI POLISH & ENHANCEMENTS (Added 2025-01-31)
   ============================================================================ */

/* --- Enhanced Badge Styles --- */
.badge-gradient-success {
    background: linear-gradient(135deg, #22c55e, #10b981);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.badge-gradient-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.badge-gradient-purple {
    background: linear-gradient(135deg, var(--node-purple), var(--node-purple-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(18, 230, 101, 0.3);
}

.badge-gradient-gold {
    background: linear-gradient(135deg, #d97706, #ea580c);
    color: var(--text-1);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

/* --- Glow Effects --- */
.glow-green {
    box-shadow: 0 0 20px rgba(0, 255, 135, 0.4);
}

.glow-purple {
    box-shadow: 0 0 20px rgba(18, 230, 101, 0.4);
}

.glow-danger {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* --- Enhanced Card Hover States --- */
.card-interactive {
    transition: all var(--transition-normal);
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 27, 44, 0.1);
    border-color: var(--node-purple);
}

/* --- Risk Level Badges (for prediction display) --- */
.risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.risk-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: var(--pos);                  /* was #22c55e */
}

.risk-badge.low::before {
    content: '✓';
    font-size: 10px;
}

.risk-badge.medium {
    background: rgba(251, 191, 36, 0.15);
    color: var(--amb);                  /* was #d97706 */
}

.risk-badge.medium::before {
    content: '~';
    font-size: 12px;
    font-weight: 700;
}

.risk-badge.high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--neg);                  /* was #ef4444 */
}

.risk-badge.high::before {
    content: '!';
    font-size: 10px;
}

/* --- Injury Return Indicator --- */
.injury-return-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.15));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #22c55e;
}

.injury-return-badge::before {
    content: '🏥→✓';
    font-size: 10px;
}

/* --- Premium Player Indicator --- */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #d97706;
}

.premium-badge::before {
    content: '⭐';
    font-size: 9px;
}

/* --- xPts Display Enhancement --- */
.xpts-display {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(18, 230, 101, 0.1), rgba(0, 255, 135, 0.05));
    border: 1px solid rgba(18, 230, 101, 0.3);
    border-radius: 10px;
    min-width: 60px;
}

.xpts-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--fpl-green);
    line-height: 1;
}

.xpts-label {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.xpts-range {
    font-size: 10px;
    color: var(--text-2);
    margin-top: 4px;
}

/* --- Confidence Indicator Dots --- */
.confidence-dots {
    display: inline-flex;
    gap: 3px;
}

.confidence-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--app-sunk);
}

.confidence-dot.filled {
    background: var(--fpl-green);
}

.confidence-dots.high .confidence-dot:nth-child(-n+3) { background: var(--success); }
.confidence-dots.medium .confidence-dot:nth-child(-n+2) { background: var(--warning); }
.confidence-dots.low .confidence-dot:first-child { background: var(--danger); }

/* --- Smooth Scroll Behavior --- */
html {
    scroll-behavior: smooth;
}

/* --- Better Focus States for Accessibility --- */
*:focus-visible {
    outline: 2px solid var(--node-purple);
    outline-offset: 2px;
}

/* --- Skeleton Loading Improvements --- */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* --- Show More Button Enhancement --- */
.show-more-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--app-raised);
    border: none;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.show-more-btn:hover {
    background: var(--app-raised);
    color: var(--node-purple-light);
}

/* --- Player Row Compact --- */
.player-row-compact {
    padding: 8px 12px !important;
}

.player-row-compact .player-photo {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
}

.player-row-compact .player-name {
    font-size: 13px !important;
}

/* --- Mini Stat Display --- */
.mini-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
}

.mini-stat-value {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.mini-stat-label {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================================================
   STRABO ENHANCED COMPONENTS - Phase 1 Integration
   ============================================================================ */

/* --- xP Range Bar (Floor/Ceiling Visualization) --- */
.xp-range-container {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.xp-range-value {
    font-weight: 700;
    color: var(--fpl-green);
    min-width: 28px;
}

.xp-range-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: visible;
    position: relative;
    min-width: 40px;
}

.xp-range-fill {
    position: absolute;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, 
        var(--danger) 0%, 
        var(--warning) 50%, 
        var(--success) 100%);
}

.xp-range-marker {
    position: absolute;
    width: 2px;
    height: 8px;
    background: white;
    top: -2px;
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(15, 23, 42, 0.15);
}

.xp-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-3);
    margin-top: 2px;
}

/* --- Fixture Difficulty Rating Dots --- */
.fdr-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fdr-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.fdr-1 { background: #10b981; } /* Very easy */
.fdr-2 { background: #22c55e; } /* Easy */
.fdr-3 { background: #ea580c; } /* Medium */
.fdr-4 { background: #f97316; } /* Hard */
.fdr-5 { background: #ef4444; } /* Very hard */

.fdr-opponent {
    font-size: 10px;
    color: var(--text-2);
    text-transform: uppercase;
}

/* --- Fixture Difficulty Grid --- */
.fdr-grid {
    display: grid;
    gap: 2px;
    font-size: 10px;
}

.fdr-cell {
    padding: 4px 6px;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
}

.fdr-cell.fdr-1, .fdr-cell.fdr-2 { 
    background: rgba(16, 185, 129, 0.2); 
    color: #10b981; 
}
.fdr-cell.fdr-3 { 
    background: rgba(245, 158, 11, 0.2); 
    color: #ea580c; 
}
.fdr-cell.fdr-4, .fdr-cell.fdr-5 { 
    background: rgba(239, 68, 68, 0.2); 
    color: #ef4444; 
}

/* --- Rotation Risk Badge --- */
.risk-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.risk-high { 
    background: rgba(239, 68, 68, 0.15); 
    color: #ef4444; 
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.risk-med { 
    background: rgba(245, 158, 11, 0.15); 
    color: #ea580c; 
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.risk-low { 
    background: rgba(16, 185, 129, 0.15); 
    color: #10b981; 
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* --- Set Piece Icons --- */
.set-piece-icons {
    display: inline-flex;
    gap: 3px;
}

.set-piece-badge {
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.15);
    color: #d97706;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.set-piece-badge.pk { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.set-piece-badge.fk { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }
.set-piece-badge.ck { background: rgba(168, 85, 247, 0.15); color: #a855f7; border-color: rgba(168, 85, 247, 0.3); }

/* --- Captain Analysis Card --- */
.captain-card {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.captain-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--app-hairline);
}

.captain-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
}

.captain-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--app-raised);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.captain-pick:hover {
    background: rgba(18, 230, 101, 0.1);
}

.captain-rank {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-3);
    width: 24px;
}

.captain-pick:first-child .captain-rank {
    color: var(--primary);
}

.captain-info {
    flex: 1;
}

.captain-name {
    font-weight: 600;
    font-size: 13px;
}

.captain-meta {
    font-size: 11px;
    color: var(--text-2);
    display: flex;
    gap: 8px;
}

.captain-xp {
    text-align: right;
}

.captain-xp-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--fpl-green);
}

.captain-ceiling {
    font-size: 10px;
    color: var(--text-3);
}

/* --- Ontology Why Card --- */
.why-card {
    background: rgba(18, 230, 101, 0.08);
    border: 1px solid rgba(18, 230, 101, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.why-card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--node-purple-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.why-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.why-list li {
    font-size: 12px;
    color: var(--text-2);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.why-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--node-purple);
}

/* --- Injury/Availability Indicator --- */
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
}

.availability-badge.available {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.availability-badge.doubtful {
    background: rgba(245, 158, 11, 0.15);
    color: #ea580c;
}

.availability-badge.injured {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.availability-badge.suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* --- DGW/BGW Badges --- */
.dgw-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(34, 197, 94, 0.1));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bgw-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(248, 113, 113, 0.1));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- Enhanced Player Chip (Pitch View) --- */
.player-chip-enhanced {
    position: relative;
}

.player-chip-xp {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--fpl-green);
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

.player-chip-fdr {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
}

/* --- Quick Action Cards (Dashboard) --- */
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.quick-action-card {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.quick-action-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--node-purple);
    transform: translateY(-2px);
}

.quick-action-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.quick-action-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-1);
}

.quick-action-badge {
    font-size: 10px;
    color: var(--text-2);
    margin-top: 4px;
}

/* --- Alert Banner --- */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-banner.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.alert-banner.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.alert-banner.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #ea580c;
}

.alert-banner.dgw {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.alert-banner-icon {
    font-size: 20px;
}

.alert-banner-content {
    flex: 1;
}

.alert-banner-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-banner-text {
    font-size: 12px;
    opacity: 0.9;
}

/* Premium Upgrade Card */
.premium-upgrade-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(18, 230, 101, 0.15), rgba(18, 230, 101, 0.05));
    border: 1px solid rgba(18, 230, 101, 0.3);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    gap: 10px;
}

.premium-upgrade-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-icon {
    font-size: 20px;
}

.premium-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.premium-text strong {
    font-size: 13px;
    color: var(--text-1);
}

.premium-text span {
    font-size: 11px;
    color: var(--text-2);
}

.premium-upgrade-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.premium-upgrade-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.premium-upgrade-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Premium Badge (for premium users) */
.premium-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.premium-badge-icon {
    font-size: 18px;
}

.premium-badge-text {
    font-size: 13px;
    font-weight: 600;
    color: #d97706;
    flex: 1;
}

.premium-manage-btn {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--app-hairline);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-manage-btn:hover {
    background: var(--app-raised);
    color: var(--text-1);
}

/* Premium Gate Overlay */
/* Premium Gate Overlay — Redesigned */
.premium-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.premium-gate-content {
    background: var(--app-raised);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.premium-gate-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.premium-gate-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(0, 184, 217, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

.premium-gate-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.premium-gate-desc {
    color: var(--text-2);
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.5;
}

.premium-gate-features {
    list-style: none;
    text-align: left;
    margin-bottom: 28px;
    padding: 0;
    display: grid;
    gap: 0;
}

.premium-gate-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--app-hairline);
    font-size: 13px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-gate-features li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.premium-gate-features li:last-child {
    border-bottom: none;
}

.premium-gate-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-gradient);
    color: #0C1222;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.01em;
}

.premium-gate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 184, 217, 0.25);
}

.premium-gate-note {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 14px;
}

.premium-gated-page .content-body {
    pointer-events: none;
    user-select: none;
    opacity: 0.3;
    filter: blur(2px);
}

/* Premium Prompt Modal (inline feature gate) */
.premium-prompt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.premium-prompt-content {
    background: var(--app-raised);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 32px;
    max-width: 380px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.premium-prompt-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.premium-prompt-close:hover {
    color: var(--text-1);
}

.premium-prompt-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.premium-prompt-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.premium-prompt-content > p {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 20px;
}

.premium-prompt-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    text-align: left;
}

.premium-prompt-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-2);
    border-bottom: 1px solid var(--app-hairline);
}

.premium-prompt-features li:last-child {
    border-bottom: none;
}

.premium-prompt-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--accent-gradient);
    color: #0C1222;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-prompt-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.premium-prompt-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.premium-prompt-note {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 12px;
}

/* Premium Page Lock (for fully gated pages) */
.premium-page-lock {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

.premium-page-lock-content {
    background: var(--app-raised);
    border: 1px solid var(--app-hairline);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 500px;
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(5, 27, 44, 0.1);
}

.premium-page-lock-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.premium-page-lock-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.premium-page-lock-content > p {
    color: var(--text-2);
    font-size: 16px;
    margin-bottom: 32px;
}

.premium-page-features {
    text-align: left;
    margin-bottom: 32px;
}

.premium-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--app-hairline);
}

.premium-feature-item:last-child {
    border-bottom: none;
}

.premium-feature-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.premium-feature-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.premium-feature-item span {
    font-size: 13px;
    color: var(--text-3);
}

.premium-page-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(18, 230, 101, 0.3);
}

.premium-page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(18, 230, 101, 0.4);
}

.premium-page-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.premium-page-note {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 16px;
}

.premium-page-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    z-index: 1;
    opacity: 0.15;
}

/* Insights Upgrade CTA */
.insights-upgrade-cta {
    background: linear-gradient(135deg, rgba(18, 230, 101, 0.1), rgba(99, 102, 241, 0.05));
    border: 2px dashed rgba(18, 230, 101, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-top: 8px;
    text-align: center;
}

.insights-upgrade-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.insights-upgrade-lock {
    font-size: 28px;
}

.insights-upgrade-text {
    text-align: left;
}

.insights-upgrade-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.insights-upgrade-text span {
    font-size: 13px;
    color: var(--text-3);
}

.insights-upgrade-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.insights-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(18, 230, 101, 0.3);
}

/* Quick Picks (Free user suggestions) */
.quick-picks {
    padding: 16px;
}

.quick-picks-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-1);
}

.quick-picks-section {
    margin-bottom: 16px;
}

.quick-picks-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.quick-pick-item {
    background: var(--app-raised);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.quick-pick-item.captain {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.quick-pick-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
}

.quick-pick-out {
    color: var(--danger);
}

.quick-pick-arrow {
    color: var(--text-3);
}

.quick-pick-in {
    color: var(--success);
}

.quick-pick-captain {
    color: #d97706;
}

.quick-pick-reason {
    font-size: 12px;
    color: var(--text-3);
}

.quick-picks-upgrade {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(18, 230, 101, 0.1), rgba(99, 102, 241, 0.05));
    border: 1px dashed rgba(18, 230, 101, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-2);
    margin-top: 16px;
}

.quick-picks-upgrade span:first-child {
    font-size: 16px;
}

/* Manual Transfer Planner */
.manual-planner {
    padding: 16px 0;
}

.manual-planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--app-hairline);
}

.manual-transfers-list {
    min-height: 100px;
}

.manual-transfer-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-3);
    font-size: 13px;
}

.manual-transfer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--app-raised);
    border-radius: 8px;
    margin-bottom: 8px;
}

.manual-transfer-players {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.manual-transfer-out {
    color: var(--danger);
    font-weight: 500;
}

.manual-transfer-arrow {
    color: var(--text-3);
}

.manual-transfer-in {
    color: var(--success);
    font-weight: 500;
}

.manual-transfer-xp {
    font-size: 13px;
    color: var(--text-2);
    min-width: 80px;
    text-align: right;
}

.manual-transfer-xp.positive {
    color: var(--success);
}

.manual-transfer-xp.negative {
    color: var(--danger);
}

.manual-transfer-remove {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.manual-transfer-remove:hover {
    color: var(--danger);
}

.manual-planner-summary {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--app-raised);
    border-radius: 8px;
    margin-top: 12px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-item span:first-child {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
}

.summary-value.positive {
    color: var(--success);
}

.manual-planner-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--app-hairline);
}

/* Add Transfer Modal */
.transfer-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 27, 44, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.transfer-modal-overlay.show {
    display: flex;
}

.transfer-modal {
    background: var(--app-raised);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.transfer-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--app-hairline);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transfer-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.transfer-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-3);
    cursor: pointer;
}

.transfer-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.transfer-modal-section {
    margin-bottom: 20px;
}

.transfer-modal-section label {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.transfer-modal-select {
    width: 100%;
    padding: 12px;
    background: var(--app-sunk);
    border: 1px solid var(--app-hairline);
    border-radius: 8px;
    color: var(--text-1);
    font-size: 14px;
}

.transfer-modal-search {
    width: 100%;
    padding: 12px;
    background: var(--app-sunk);
    border: 1px solid var(--app-hairline);
    border-radius: 8px;
    color: var(--text-1);
    font-size: 14px;
}

.transfer-modal-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
}

.transfer-modal-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.transfer-modal-player:hover {
    background: var(--app-sunk);
}

.transfer-modal-player-name {
    font-weight: 500;
}

.transfer-modal-player-meta {
    font-size: 12px;
    color: var(--text-3);
}

.transfer-modal-player-xp {
    font-weight: 600;
    color: var(--success);
}

.transfer-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--app-hairline);
}
