/* ══════════════════════════════════════════════════════════════
   NextPlay - Premium Dark Sports Theme v2.0
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Orbitron:wght@700;800;900&display=swap');

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

:root {
    --bg: #0f1520;
    --bg-2: #111820;
    --bg-card: #161d28;
    --bg-card-hover: #1c2536;
    --bg-input: #1a2230;
    --bg-elevated: #1e2638;
    --accent: #ff6b35;
    --accent-dim: rgba(255,107,53,0.12);
    --accent-glow: rgba(255,107,53,0.25);
    --accent-bright: #ff8c5a;
    --accent-gradient: linear-gradient(135deg, #ff6b35, #ff9a6c);
    --blue: #4da6ff;
    --blue-dim: rgba(77,166,255,0.12);
    --green: #3fb950;
    --green-dim: rgba(63,185,80,0.12);
    --yellow: #f0b429;
    --yellow-dim: rgba(240,180,41,0.12);
    --purple: #bc8ff3;
    --purple-dim: rgba(188,143,243,0.12);
    --red: #f85149;
    --red-dim: rgba(248,81,73,0.12);
    --text: #f0f3f6;
    --text-2: #9ba4b0;
    --text-3: #5c6370;
    --border: rgba(255,255,255,0.06);
    --border-subtle: rgba(255,255,255,0.04);
    --border-2: rgba(255,255,255,0.1);
    --border-3: rgba(255,255,255,0.15);
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --radius-lg: 20px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-sm: 0 2px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    --shadow-glow: 0 4px 24px rgba(255,107,53,0.2);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --glass: rgba(22,29,40,0.7);
    --glass-border: rgba(255,255,255,0.08);
    --sidebar-w: 270px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Arena background image - focused on the court */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('/static/img/arena.jpg') center 25% / cover no-repeat;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-bright); }

::selection {
    background: rgba(255,107,53,0.3);
    color: #fff;
}

/* ── Layout ─────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    z-index: 1;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: linear-gradient(180deg, rgba(13,18,25,0.97), rgba(17,24,32,0.97));
    border-inline-end: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.35s var(--ease);
}

.sidebar-brand {
    padding: 28px 24px 22px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: -1px;
    inset-inline-start: 24px;
    inset-inline-end: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
}
.sidebar-brand img,
.sidebar-brand svg.brand-basketball-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    filter: drop-shadow(0 4px 16px rgba(255,107,53,0.4));
    transition: transform 0.3s var(--ease);
}
.sidebar-brand:hover img,
.sidebar-brand:hover svg.brand-basketball-icon {
    transform: rotate(-10deg) scale(1.05);
}
.sidebar-brand h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 0.12em;
    margin-top: 12px;
    text-shadow: 0 0 20px rgba(255,107,53,0.3);
}

.sidebar-team {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.sidebar-team .team-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-team .team-league {
    font-size: 0.8rem;
    color: var(--text-2);
    margin-top: 2px;
}

/* ── Team Switcher Dropdown ── */
.team-switcher {
    position: relative;
}
.team-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md, 8px);
    padding: 6px 12px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    width: 100%;
    transition: border-color 0.2s;
    overflow: hidden;
}
.team-switcher-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.team-switcher-btn:hover {
    border-color: var(--accent);
}
.team-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface, #1a1e2a);
    border: 1px solid var(--border);
    border-radius: var(--r-md, 8px);
    margin-top: 4px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-height: 240px;
    overflow-y: auto;
}
.team-dropdown.open {
    display: block;
}
.team-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--r-sm, 6px);
    transition: background 0.15s;
}
.team-dropdown-item:hover {
    background: var(--surface-2, rgba(255,255,255,0.06));
}
.team-dropdown-item.active {
    color: var(--accent);
    font-weight: 700;
}
.team-dropdown-item small {
    margin-left: auto;
    color: var(--text-2);
    font-size: 0.75rem;
}
.sidebar-stats {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.sidebar-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.sidebar-stat.orange { background: var(--accent-dim); color: var(--accent); }
.sidebar-stat.blue { background: var(--blue-dim); color: var(--blue); }

.trial-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 16px;
    padding: 8px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255,170,0,0.15), rgba(255,120,0,0.10));
    border: 1px solid rgba(255,170,0,0.3);
    color: #ffaa00;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.trial-banner:hover {
    background: linear-gradient(135deg, rgba(255,170,0,0.25), rgba(255,120,0,0.18));
    border-color: rgba(255,170,0,0.5);
}
/* Expired-state variant: red-orange to signal urgency without screaming. */
.trial-banner.trial-banner-expired {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(255, 87, 34, 0.12));
    border-color: rgba(239, 68, 68, 0.4);
    color: #ff7a6e;
}
.trial-banner.trial-banner-expired:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(255, 87, 34, 0.20));
    border-color: rgba(239, 68, 68, 0.6);
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s var(--ease);
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}
.sidebar-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    opacity: 0;
    background: linear-gradient(135deg, var(--accent-dim), transparent);
    transition: opacity 0.25s var(--ease);
}
.sidebar-nav a:hover {
    color: var(--text);
}
.sidebar-nav a:hover::before {
    opacity: 1;
}
.sidebar-nav a.active {
    color: var(--accent);
    background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(255,107,53,0.05));
    box-shadow: inset 3px 0 0 var(--accent);
}
[dir="rtl"] .sidebar-nav a.active,
.rtl .sidebar-nav a.active {
    box-shadow: inset -3px 0 0 var(--accent);
}
.sidebar-nav a.active::before { opacity: 0; }
.sidebar-nav a img,
.sidebar-nav a svg.nav-icon {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.3s var(--ease);
    flex-shrink: 0;
}
.sidebar-nav a:hover img,
.sidebar-nav a.active img,
.sidebar-nav a:hover svg.nav-icon,
.sidebar-nav a.active svg.nav-icon {
    opacity: 1;
    transform: scale(1.1);
}
.sidebar-nav a span {
    position: relative;
    z-index: 1;
}

/* "Add Team" button shown in team switcher area when user has 0 teams */
.btn-add-first-team {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 24px);
    margin: 4px 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #ff6b35, #e85d26);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255,107,53,0.28);
    transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-add-first-team:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255,107,53,0.4);
}
.btn-add-first-team:active { transform: translateY(0); }
.btn-add-first-team svg { width: 16px; height: 16px; }

/* Onboarding welcome banner (home page, no profile yet) */
.welcome-banner {
    text-align: center;
    padding: 44px 32px;
    background: linear-gradient(135deg, rgba(255,107,53,0.06), rgba(255,107,53,0.02));
    border: 1.5px solid rgba(255,107,53,0.25);
    position: relative;
    overflow: hidden;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -40%; left: 50%;
    width: 420px; height: 420px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255,107,53,0.12), transparent 65%);
    pointer-events: none;
    z-index: 0;
}
.welcome-banner > * { position: relative; z-index: 1; }
.welcome-icon-wrap {
    width: 72px; height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(255,107,53,0.05));
    border: 1.5px solid rgba(255,107,53,0.3);
    box-shadow: 0 4px 20px rgba(255,107,53,0.18);
}
.welcome-title {
    margin: 0 0 10px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.welcome-title .welcome-name {
    background: linear-gradient(135deg, #ff8c5a, #ff6b35);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.welcome-sub {
    color: var(--text-2);
    margin: 0 auto 24px;
    font-size: 0.98rem;
    max-width: 520px;
    line-height: 1.55;
}
.welcome-sub strong {
    color: var(--accent);
    font-weight: 700;
}
.welcome-cta {
    padding: 13px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 8px;
}
@media (max-width: 640px) {
    .welcome-banner { padding: 32px 20px; }
    .welcome-title { font-size: 1.3rem; }
    .welcome-sub { font-size: 0.9rem; }
}

.sidebar-upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 16px;
    padding: 10px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f48c25, #e07010);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.3s, background 0.4s;
    box-shadow: 0 2px 10px rgba(244,140,37,0.3);
    background-size: 100% 100%;
}
.sidebar-upgrade-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #ff4500, #ff8c00, #ffd700, #ff6347, #ff4500);
    background-size: 300% 300%;
    animation: flameShift 1.5s ease infinite;
    box-shadow: 0 4px 20px rgba(255,69,0,0.5), 0 0 30px rgba(255,140,0,0.3);
    color: #fff;
}
@keyframes flameShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.sidebar-manage-plan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 16px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--border-subtle);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.sidebar-manage-plan:hover {
    background: var(--glass-border);
    border-color: var(--border-3);
    color: var(--text-1);
}
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-3);
    text-align: center;
    letter-spacing: 0.02em;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    inset-inline-start: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease);
    box-shadow: var(--shadow-sm);
}
.mobile-menu-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}
.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

/* ── Main Content ───────────────────────────────────────────── */
.main {
    flex: 1;
    margin-inline-start: var(--sidebar-w);
    min-height: 100vh;
    padding: 36px 48px 48px;
    max-width: 1200px;
    position: relative;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.page-header img,
.page-header svg.page-header-icon {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 4px 12px rgba(255,107,53,0.25));
    transition: transform 0.3s var(--ease);
    flex-shrink: 0;
}
.page-header:hover img,
.page-header:hover svg.page-header-icon {
    transform: rotate(-5deg) scale(1.05);
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}
.page-header p {
    color: var(--text-2);
    font-size: 0.85rem;
    margin-top: 3px;
    line-height: 1.4;
}

/* ── Hero Banner ────────────────────────────────────────────── */
.hero {
    border-radius: var(--radius-lg);
    padding: 0;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(255,107,53,0.3);
    box-shadow:
        0 0 30px rgba(255,107,53,0.08),
        inset 0 0 60px rgba(0,0,0,0.3);
}

/* Hero base background */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #0a0704;
    z-index: 0;
}

/* Dark overlay on top of court SVG for readability */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(10,14,20,0.2) 0%,
            rgba(10,14,20,0.45) 40%,
            rgba(10,14,20,0.7) 70%,
            rgba(10,14,20,0.85) 100%);
    z-index: 1;
}

/* Court image as hero background */
.hero-court-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.5;
}
.hero-court-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Accent light strip at top */
.hero-top-light {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 20%,
        var(--accent-bright) 50%,
        var(--accent) 80%,
        transparent 100%);
    z-index: 3;
    opacity: 0.8;
}

/* Scoreboard-style content wrapper */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 48px 40px 44px;
    width: 100%;
}

.hero-icon {
    position: relative;
    margin-bottom: 16px;
    z-index: 2;
}
.hero-icon img,
.hero-icon svg {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 4px 20px rgba(255,107,53,0.5));
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #ff6b35 40%, #ff9a6c 60%, #ffffff 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
    position: relative;
    z-index: 2;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(255,107,53,0.3);
}
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 300% center; }
}
@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.08) rotate(2deg); }
}

.hero p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    position: relative;
    z-index: 2;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
    letter-spacing: 0.02em;
}

/* Decorative court line circle behind text */
.hero-court-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}
.hero-court-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -40%;
    width: 180%;
    height: 1px;
    background: var(--border-subtle);
}

/* Bottom stats strip */
.hero-stats {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}
.hero-stat {
    text-align: center;
}
.hero-stat .hs-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
}
.hero-stat .hs-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all 0.3s var(--ease);
    position: relative;
}
.card:hover {
    border-color: var(--border-2);
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}
.card-header img,
.card-header svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Glass card variant */
.card-glass {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: linear-gradient(145deg, var(--bg-card), #1a2232);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 18px 22px;
    text-align: center;
    transition: all 0.35s var(--ease);
    cursor: default;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: radial-gradient(circle at 50% 0%, var(--accent-dim) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}
.stat-card:hover {
    border-color: rgba(255,107,53,0.3);
    box-shadow: 0 8px 32px rgba(255,107,53,0.12);
    transform: translateY(-4px);
}
.stat-card:hover::before { opacity: 1; }
.stat-card img,
.stat-card svg.stat-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.stat-card .number {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    line-height: 1.1;
}
.stat-card .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* ── Agent Cards ────────────────────────────────────────────── */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}
.agent-card {
    background: linear-gradient(145deg, var(--bg-card), #1a2232);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 22px;
    transition: all 0.35s var(--ease);
    position: relative;
    overflow: hidden;
    cursor: default;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.agent-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    transition: height 0.3s var(--ease);
}
.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--border-2);
}
.agent-card:hover::after { height: 4px; }
.agent-card.gm::after { background: linear-gradient(90deg, #ff6b35, #ff9a6c); }
.agent-card.scout::after { background: linear-gradient(90deg, #4da6ff, #7ec4ff); }
.agent-card.analytics::after { background: linear-gradient(90deg, #3fb950, #6dd880); }
.agent-card.tactics::after { background: linear-gradient(90deg, #f0b429, #ffd666); }
.agent-card.training::after { background: linear-gradient(90deg, #bc8ff3, #d4b3ff); }

.agent-card .icon {
    margin-bottom: 14px;
    transition: transform 0.3s var(--ease);
}
.agent-card:hover .icon { transform: scale(1.1) rotate(-5deg); }
.agent-card .icon img,
.agent-card .icon svg {
    width: 36px;
    height: 36px;
}
.agent-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 14px;
    border: 2px solid var(--border-2);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.agent-card:hover .agent-photo {
    transform: scale(1.06);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}
.agent-card .role {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.role-gm { background: var(--accent-dim); color: var(--accent-bright); border: 1px solid rgba(255,107,53,0.2); }
.role-scout { background: var(--blue-dim); color: #7ec4ff; border: 1px solid rgba(77,166,255,0.2); }
.role-analytics { background: var(--green-dim); color: #6dd880; border: 1px solid rgba(63,185,80,0.2); }
.role-tactics { background: var(--yellow-dim); color: #ffd666; border: 1px solid rgba(240,180,41,0.2); }
.role-training { background: var(--purple-dim); color: #d4b3ff; border: 1px solid rgba(188,143,243,0.2); }

.agent-card .name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: -0.01em;
}
.agent-card .desc {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.5;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    min-height: 48px;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #e85d26);
    color: white;
    box-shadow: 0 2px 12px rgba(255,107,53,0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255,107,53,0.35);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255,107,53,0.2);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-2);
}
.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(248,81,73,0.15);
}
.btn-danger:hover {
    background: rgba(248,81,73,0.2);
    border-color: rgba(248,81,73,0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid transparent;
}
.btn-ghost:hover {
    color: var(--text);
    background: var(--border-subtle);
}

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; min-height: 36px; font-size: 0.82rem; }

/* Button loading spinner */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}
.btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-inline-end: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Form Inputs ────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.25s var(--ease);
    outline: none;
}
.form-input:hover, .form-textarea:hover, .form-select:hover {
    border-color: var(--border-2);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(26,34,48,0.8);
}
.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-3);
}
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%239ba4b0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 14px) center;
    padding-inline-end: 36px;
}
[dir="rtl"] .form-select {
    background-position: 14px center;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Chat ───────────────────────────────────────────────────── */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 96px);
}

/* Chat header override for chat page */
.chat-container .page-header {
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    padding-bottom: 20px;
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    scroll-behavior: smooth;
}

.chat-msg {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    animation: msgSlideIn 0.35s var(--ease);
    padding: 0 4px;
}
@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg .avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.2s var(--ease);
}
.chat-msg:hover .avatar { transform: scale(1.05); }
.chat-msg .avatar img,
.chat-msg .avatar svg {
    width: 28px;
    height: 28px;
}
.chat-msg.user .avatar {
    background: linear-gradient(135deg, rgba(77,166,255,0.15), rgba(77,166,255,0.08));
    border: 1px solid rgba(77,166,255,0.15);
}
.chat-msg.assistant .avatar {
    background: linear-gradient(135deg, var(--accent-dim), rgba(255,107,53,0.06));
    border: 1px solid rgba(255,107,53,0.15);
}

.chat-msg .msg-content {
    flex: 1;
    min-width: 0;
}
.chat-msg .msg-sender {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-msg.user .msg-sender { color: var(--blue); }
.chat-msg.assistant .msg-sender { color: var(--accent); }
.chat-msg .msg-sender .msg-time {
    font-weight: 500;
    color: var(--text-3);
    font-size: 0.72rem;
}

.chat-msg .bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px var(--radius) var(--radius) var(--radius);
    padding: 16px 20px;
    max-width: 90%;
    line-height: 1.75;
    font-size: 0.9rem;
    position: relative;
    transition: border-color 0.2s var(--ease);
}
[dir="rtl"] .chat-msg .bubble {
    border-radius: var(--radius) 4px var(--radius) var(--radius);
}
.chat-msg:hover .bubble {
    border-color: var(--border-2);
}
.chat-msg.user .bubble {
    background: linear-gradient(135deg, rgba(26,37,64,0.8), rgba(30,45,72,0.6));
    border-color: rgba(77,166,255,0.1);
    border-radius: var(--radius) 4px var(--radius) var(--radius);
}
[dir="rtl"] .chat-msg.user .bubble {
    border-radius: 4px var(--radius) var(--radius) var(--radius);
}

.chat-msg .bubble p { margin-bottom: 10px; direction: auto; unicode-bidi: plaintext; }
.chat-msg .bubble p:last-child { margin-bottom: 0; }
.chat-msg .bubble strong { color: var(--accent); font-weight: 700; }
.chat-msg .bubble code {
    background: var(--border);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.85rem;
    border: 1px solid var(--border-subtle);
}
.chat-msg .bubble ul, .chat-msg .bubble ol {
    margin: 8px 0;
    padding-inline-start: 20px;
}
.chat-msg .bubble li { margin-bottom: 4px; }

/* Chat input bar */
.chat-input-bar {
    display: flex;
    gap: 12px;
    padding: 20px 0 4px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    align-items: flex-end;
}
.chat-input-bar #chatInput {
    flex: 1;
    padding: 12px 22px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 22px;
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
    max-height: 144px;
    resize: none;
    overflow-y: auto;
    outline: none;
    transition: border-color 0.25s var(--ease),
                box-shadow 0.25s var(--ease),
                background 0.25s var(--ease);
}
.chat-input-bar #chatInput:hover {
    border-color: var(--border-2);
}
.chat-input-bar #chatInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(26,34,48,0.9);
}
.chat-input-bar #chatInput::placeholder { color: var(--text-3); }

.chat-input-bar .btn-send {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35, #e85d26);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease);
    box-shadow: 0 4px 16px rgba(255,107,53,0.3);
    position: relative;
    overflow: hidden;
}
.chat-input-bar .btn-send::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.chat-input-bar .btn-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(255,107,53,0.45);
}
.chat-input-bar .btn-send:hover::after { opacity: 1; }
.chat-input-bar .btn-send:active {
    transform: scale(0.95);
}
.chat-input-bar .btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.chat-input-bar .btn-send svg {
    width: 20px;
    height: 20px;
    fill: white;
    position: relative;
    z-index: 1;
    transition: transform 0.2s var(--ease);
}
[dir="rtl"] .chat-input-bar .btn-send svg {
    transform: scaleX(-1);
}
.chat-input-bar .btn-send:hover svg {
    transform: translateX(2px);
}
[dir="rtl"] .chat-input-bar .btn-send:hover svg {
    transform: scaleX(-1) translateX(2px);
}

/* Quick actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-2);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    font-family: inherit;
    white-space: nowrap;
}
.quick-action:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.1);
}
.quick-action:active {
    transform: translateY(0);
}
.quick-action img,
.quick-action svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Chat loading — high-visibility "agent is thinking" indicator.
   Designed so the coach immediately sees that something is happening
   in the background, even on slow networks. */
.chat-loading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, var(--bg-card), rgba(22,29,40,0.6));
    border: 1.5px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 24px;
    animation: msgSlideIn 0.35s var(--ease), chatLoadingPulse 1.8s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.5);
    position: relative;
}
@keyframes chatLoadingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.35),
                    0 4px 16px rgba(255, 107, 53, 0.10);
        border-color: var(--accent);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.0),
                    0 6px 24px rgba(255, 107, 53, 0.18);
        border-color: var(--accent-hover, #ff8c5a);
    }
}
.chat-loading .avatar img {
    animation: chatLoadingAvatar 1.6s ease-in-out infinite;
}
@keyframes chatLoadingAvatar {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
    50%      { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.25); }
}
.chat-loading .dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chat-loading .dots span {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.5);
    animation: chatLoadingBounce 1.2s infinite ease-in-out both;
}
.chat-loading .dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-loading .dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes chatLoadingBounce {
    0%, 80%, 100% { transform: translateY(0) scale(0.85); opacity: 0.55; }
    40%           { transform: translateY(-4px) scale(1.1); opacity: 1; }
}

/* Jump to bottom arrow */
.jump-to-bottom {
    position: absolute;
    bottom: 105px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10;
    padding: 6px;
    line-height: 0;
}
.jump-to-bottom svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.55;
    transition: opacity 0.2s ease, transform 0.2s ease;
    filter: drop-shadow(0 1px 6px rgba(255,107,53,0.3));
}
.jump-to-bottom.visible {
    opacity: 1;
    pointer-events: auto;
}
.jump-to-bottom:hover svg {
    opacity: 1;
    transform: translateY(2px);
    filter: drop-shadow(0 2px 8px rgba(255,107,53,0.5));
}

/* Welcome/empty chat state */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 48px 24px;
    text-align: center;
}
.chat-welcome .welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent-dim), rgba(255,107,53,0.05));
    border: 1px solid rgba(255,107,53,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: float 4s ease-in-out infinite;
}
.chat-welcome .welcome-icon img,
.chat-welcome .welcome-icon svg {
    width: 44px;
    height: 44px;
}
.chat-welcome h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.chat-welcome p {
    color: var(--text-2);
    font-size: 0.9rem;
    max-width: 400px;
    line-height: 1.6;
}

/* ── Resume profiling CTA (under Brad's opening when pending players exist) ── */
.resume-profiling-cta {
    align-self: flex-start;
    max-width: 540px;
    margin: 4px 0 12px 56px;  /* aligns with assistant message bubble */
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255,107,53,0.08), rgba(255,107,53,0.03));
    border: 1px solid rgba(255,107,53,0.25);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
[dir="rtl"] .resume-profiling-cta { margin: 4px 56px 12px 0; }
.resume-profiling-text {
    font-size: 0.86rem;
    color: var(--text-2);
    line-height: 1.5;
}
.resume-profiling-text strong {
    color: var(--accent);
    font-weight: 800;
    font-size: 0.95rem;
}
.resume-profiling-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.resume-profiling-actions .btn-link {
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.resume-profiling-actions .btn-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}
@media (max-width: 640px) {
    .resume-profiling-cta { margin-left: 16px; margin-right: 16px; max-width: none; }
    [dir="rtl"] .resume-profiling-cta { margin-right: 16px; margin-left: 16px; }
}

/* ── Onboarding banner inside chat page ─────────────────── */
.onboarding-chat-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 0 0 12px;
    background: linear-gradient(90deg, rgba(255,107,53,0.10), rgba(255,107,53,0.04));
    border: 1px solid rgba(255,107,53,0.25);
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    color: var(--text-2);
}
.onboarding-chat-banner-icon {
    color: var(--accent);
    font-weight: 800;
    flex-shrink: 0;
}
.onboarding-chat-banner-text { flex: 1; min-width: 0; }
.onboarding-chat-banner-skip {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-2);
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.onboarding-chat-banner-skip:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
}

/* ── Team Setup onboarding guidance card ─────────────────── */
.setup-guidance-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 28px 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(255,107,53,0.06), rgba(255,107,53,0.02));
    border: 1.5px solid rgba(255,107,53,0.22);
    border-radius: var(--radius);
}
.setup-guidance-card .guidance-icon {
    width: 56px; height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,107,53,0.12);
    color: var(--accent);
    margin-bottom: 4px;
}
.setup-guidance-card .guidance-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}
.setup-guidance-card .guidance-sub {
    margin: 0 auto;
    max-width: 480px;
    color: var(--text-2);
    font-size: 0.92rem;
    line-height: 1.55;
}
.setup-guidance-card .guidance-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.setup-guidance-card .guidance-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    line-height: 0;
    transition: color 0.15s, background 0.15s;
}
.setup-guidance-card .guidance-dismiss:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
}
[dir="rtl"] .setup-guidance-card .guidance-dismiss { right: auto; left: 10px; }

/* ── Brad CTA banner (after roster has un-profiled players) ── */
.brad-cta-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(77,166,255,0.06), rgba(255,107,53,0.04));
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}
[dir="rtl"] .brad-cta-banner { border-left: 1px solid var(--border); border-right: 3px solid var(--accent); }
.brad-cta-banner .brad-cta-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,107,53,0.3);
}
.brad-cta-banner .brad-cta-text {
    flex: 1;
    min-width: 0;
}
.brad-cta-banner .brad-cta-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.brad-cta-banner .brad-cta-sub {
    font-size: 0.84rem;
    color: var(--text-2);
    line-height: 1.45;
}
.brad-cta-banner .brad-cta-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.brad-cta-banner .btn-link {
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s;
}
.brad-cta-banner .btn-link:hover { color: var(--text); }
@media (max-width: 640px) {
    .brad-cta-banner { flex-wrap: wrap; }
    .brad-cta-banner .brad-cta-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ── File Upload ────────────────────────────────────────────── */
/* Roster template download row (inside CSV import modal) */
.template-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255,107,53,0.06);
    border: 1px solid rgba(255,107,53,0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.template-download-text { min-width: 0; flex: 1; }
.template-step-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 3px;
}
.template-step-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.template-step-sub {
    font-size: 0.78rem;
    color: var(--text-2);
}
.template-download-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.template-download-btns .btn {
    padding: 7px 12px;
    font-size: 0.78rem;
    gap: 4px;
}
@media (max-width: 520px) {
    .template-download-row { flex-direction: column; align-items: stretch; }
    .template-download-btns { justify-content: stretch; }
    .template-download-btns .btn { flex: 1; justify-content: center; }
}

.upload-zone {
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 44px 24px;
    text-align: center;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    background: rgba(22,29,40,0.3);
    position: relative;
    overflow: hidden;
}
.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-dim) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(255,107,53,0.04);
}
.upload-zone:hover::before, .upload-zone.dragover::before { opacity: 1; }
.upload-zone img,
.upload-zone svg {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    opacity: 0.5;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s, transform 0.3s var(--ease);
}
.upload-zone:hover img,
.upload-zone:hover svg {
    opacity: 0.8;
    transform: translateY(-4px);
}
.upload-zone p {
    color: var(--text-2);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}
.upload-zone .hint {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-top: 6px;
}

/* File list */
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.25s var(--ease);
}
.file-item:hover {
    border-color: var(--border-2);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}
[dir="rtl"] .file-item:hover {
    transform: translateX(-4px);
}
.file-item img,
.file-item svg.file-type-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}
.file-item .file-info { flex: 1; min-width: 0; }
.file-item .file-name {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-item .file-meta {
    font-size: 0.78rem;
    color: var(--text-2);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-orange { background: var(--accent-dim); color: var(--accent); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }

/* ── Player Row - Sports Lineup Card ──────────────────────── */
.player-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--bg-card), rgba(26,34,50,0.6));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}
.player-row::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.player-row:hover {
    border-color: var(--border-2);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.player-row:hover::before { opacity: 1; }

.player-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 48px;
    text-align: center;
    line-height: 1;
}
.player-info { flex: 1; min-width: 0; }
.player-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 3px;
}
.player-details {
    font-size: 0.8rem;
    color: var(--text-2);
    line-height: 1.6;
}
.player-details .player-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.player-details .strength-tag {
    color: var(--green);
    font-size: 0.78rem;
}
.player-details .weakness-tag {
    color: var(--red);
    font-size: 0.78rem;
}
.player-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    background: rgba(17,24,32,0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
}
.tab {
    flex: 1;
    padding: 10px 20px;
    text-align: center;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    border: none;
    background: none;
    font-family: inherit;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tab.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* ── Session List ───────────────────────────────────────────── */
.session-item {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.session-item:hover {
    border-color: rgba(255,107,53,0.2);
    background: rgba(255,107,53,0.04);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.session-date {
    font-weight: 600;
    font-size: 0.9rem;
}
.session-preview {
    font-size: 0.82rem;
    color: var(--text-3);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.4;
}
.session-count {
    font-size: 0.78rem;
    color: var(--text-2);
    background: var(--bg-2);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Session messages container */
.session-messages {
    border-inline-start: 2px solid var(--border);
    margin-inline-start: 20px;
    padding-inline-start: 20px;
    margin-bottom: 8px;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 24px;
    inset-inline-end: 24px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    z-index: 10000;
    animation: toastSlideIn 0.35s var(--ease-spring);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast-success {
    background: rgba(26,58,42,0.9);
    color: var(--green);
    border: 1px solid rgba(63,185,80,0.25);
}
.toast-error {
    background: rgba(58,26,26,0.9);
    color: var(--red);
    border: 1px solid rgba(248,81,73,0.25);
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-2);
}
.empty-state img,
.empty-state svg {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    margin-bottom: 20px;
    filter: grayscale(0.3);
}
.empty-state p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,107,53,0.4); }

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}

/* ── RTL ────────────────────────────────────────────────────── */
[dir="rtl"], .rtl {
    direction: rtl;
    text-align: right;
}

/* RTL chat bubbles - Hebrew content */
.bubble.rtl {
    direction: rtl;
    text-align: right;
}
.bubble.rtl p,
.bubble.rtl li,
.bubble.rtl h1, .bubble.rtl h2, .bubble.rtl h3, .bubble.rtl h4,
.bubble.rtl span,
.bubble.rtl div {
    direction: rtl;
    text-align: right;
}
/* Keep numbers and English inline fragments LTR inside RTL */
.bubble.rtl code,
.bubble.rtl .ltr-inline {
    direction: ltr;
    unicode-bidi: isolate;
}

/* ── Section Titles ─────────────────────────────────────────── */
.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-2);
    margin-bottom: 16px;
    padding-inline-start: 4px;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ── Spacing Utilities ──────────────────────────────────────── */
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-16 { margin-top: 16px; }
.gap-16 { gap: 16px; }

/* ── Team Profile Info Grid ─────────────────────────────────── */
.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.profile-info-item {
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.profile-info-item .info-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 6px;
}
.profile-info-item .info-value {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
}
.profile-info-item .info-value.profile-list {
    white-space: pre-line;
}
.profile-bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.profile-bullet-list li {
    position: relative;
    padding-inline-start: 16px;
    margin-bottom: 6px;
    line-height: 1.5;
    unicode-bidi: plaintext;
}
.profile-bullet-list li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Player Profile Page ──────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

.player-profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 12px;
}
.player-profile-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    min-width: 80px;
    text-align: center;
}
.player-profile-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}
.player-profile-stats {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-2);
}

.radar-card {
    text-align: center;
    margin-bottom: 28px;
}
.radar-card canvas {
    max-width: 100%;
    height: auto;
}
.radar-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.radar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
}
.radar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.metric-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.metric-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    color: var(--cat-color, var(--text));
}
.metric-category-avg {
    margin-inline-start: auto;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cat-color, var(--text));
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.metric-item label {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-2);
    font-weight: 500;
    white-space: nowrap;
}
.metric-item input[type="range"] {
    flex: 2;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}
.metric-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cat-color, var(--accent));
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.15s ease;
}
.metric-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.metric-item input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cat-color, var(--accent));
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.metric-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 24px;
    text-align: center;
    color: var(--cat-color, var(--text));
}

.btn-save-metrics {
    position: sticky;
    bottom: 20px;
    width: 100%;
    max-width: 400px;
    margin: 24px auto 0;
    display: block;
}

.player-row-link {
    transition: border-color 0.2s, background 0.2s;
}
.player-row-link:hover {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.03);
}
.player-row-link:hover .player-name {
    color: var(--accent);
}

.player-mini-radar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-inline-start: auto;
    margin-inline-end: 8px;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
}
.player-mini-radar:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ── NextPlay Styled Dialog ── */
.np-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.np-dialog-overlay.visible { opacity: 1; }
.np-dialog {
    background: var(--surface, #1a1e2a);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}
.np-dialog-overlay.visible .np-dialog { transform: scale(1); }
.np-dialog-icon { margin-bottom: 12px; }
.np-dialog-icon .material-symbols-outlined {
    font-size: 48px;
    color: var(--accent, #f48c25);
}
.np-dialog-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
    margin-bottom: 8px;
}
.np-dialog-msg {
    font-size: 0.9rem;
    color: var(--text-2, #94a3b8);
    line-height: 1.5;
    margin-bottom: 20px;
}
.np-dialog-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg, #0f1923);
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 8px;
    color: var(--text, #e2e8f0);
    font-size: 0.9rem;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
}
.np-dialog-input:focus { border-color: var(--accent, #f48c25); }
.np-dialog-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.np-dialog-btn {
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.np-dialog-cancel {
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    color: var(--text-2, #94a3b8);
}
.np-dialog-cancel:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.np-dialog-ok {
    background: var(--accent, #f48c25);
    color: #fff;
}
.np-dialog-ok:hover { background: #e07b1a; }
.np-dialog-ok.danger { background: #ef4444; }
.np-dialog-ok.danger:hover { background: #dc2626; }

