/* ============================================
   IPL Cricket Analytics — Premium Dark Theme
   ============================================ */

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

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(25, 35, 55, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-gold: #f5a623;
    --accent-gold-glow: rgba(245, 166, 35, 0.3);
    --accent-cyan: #22d3ee;
    --accent-cyan-glow: rgba(34, 211, 238, 0.2);
    --accent-green: #34d399;
    --accent-red: #f87171;

    --gradient-primary: linear-gradient(135deg, #8b5cf6, #6366f1, #3b82f6);
    --gradient-gold: linear-gradient(135deg, #f5a623, #f59e0b, #d97706);
    --gradient-cyan: linear-gradient(135deg, #22d3ee, #06b6d4, #0891b2);
    --gradient-dark: linear-gradient(180deg, #0a0e1a 0%, #111827 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.15);
    --shadow-glow-gold: 0 0 30px rgba(245, 166, 35, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --sidebar-width: 260px;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
}

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

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

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-glow-purple);
}

.sidebar-brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand .subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

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

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 12px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

.nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    font-weight: 600;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-purple);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

.page-header {
    padding: 28px 36px 20px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
}

.page-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header .breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.page-body {
    padding: 28px 36px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px 24px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-purple);
    border-color: var(--border-hover);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-card .stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.stat-card .stat-icon.gold { background: rgba(245, 166, 35, 0.15); color: var(--accent-gold); }
.stat-card .stat-icon.cyan { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); }
.stat-card .stat-icon.green { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); }

.stat-card .stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---------- Tables ---------- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: rgba(139, 92, 246, 0.06);
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
}

.data-table thead th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.data-table thead th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-glass);
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.data-table tbody td.highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.data-table tbody td a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.data-table tbody td a:hover {
    color: var(--accent-purple);
}

/* ---------- Progress / Score Bars ---------- */
.score-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--gradient-primary);
}

.score-bar-fill.gold {
    background: var(--gradient-gold);
}

.score-bar-fill.cyan {
    background: var(--gradient-cyan);
}

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

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

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ---------- Player Card ---------- */
.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.player-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow-purple);
}

.player-card .player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
}

.player-card .player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-card .player-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.player-card .player-role {
    font-size: 0.78rem;
    color: var(--accent-cyan);
    font-weight: 500;
    margin-bottom: 8px;
}

.player-card .player-team {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 12px;
    background: var(--bg-glass);
    border-radius: 20px;
    display: inline-block;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.badge-gold { background: rgba(245, 166, 35, 0.15); color: var(--accent-gold); }
.badge-cyan { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); }
.badge-green { background: rgba(52, 211, 153, 0.15); color: var(--accent-green); }
.badge-red { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); }

/* ---------- Forms / Selectors ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-select, .form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.form-select {
    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='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-select:focus, .form-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-purple-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-purple-glow);
}

.btn-gold {
    background: var(--gradient-gold);
    color: #1a1a1a;
    box-shadow: 0 4px 15px var(--accent-gold-glow);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-gold-glow);
}

.filter-bar {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 200px;
    flex: 1;
}

/* ---------- h2h form layout ---------- */
.h2h-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    width: 100%;
}

/* ---------- Player Autocomplete ---------- */
.player-ac-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.player-ac-field {
    position: relative;
    display: flex;
    align-items: center;
}

.player-ac-icon {
    position: absolute;
    left: 12px;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.player-ac-input {
    width: 100%;
    padding: 11px 36px 11px 38px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-ac-input::placeholder {
    color: var(--text-muted);
}

.player-ac-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.player-ac-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.player-ac-clear.visible {
    opacity: 1;
    pointer-events: auto;
}

.player-ac-clear:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.player-ac-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
}

.player-ac-list.open {
    display: block;
}

.player-ac-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    gap: 12px;
}

.player-ac-item:hover,
.player-ac-item.active {
    background: rgba(139, 92, 246, 0.12);
}

.player-ac-item .pac-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-ac-item .pac-team {
    font-size: 0.72rem;
    color: var(--accent-cyan);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 2px 8px;
    background: rgba(34, 211, 238, 0.08);
    border-radius: 20px;
}

.player-ac-no-result {
    padding: 12px 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}


/* ---------- Prediction / Comparison ---------- */
.vs-container {
    display: flex;
    align-items: stretch;
    gap: 24px;
    margin: 24px 0;
}

.vs-team {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.vs-team:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow-purple);
}

.vs-team h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vs-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
    box-shadow: var(--shadow-glow-gold);
}

.prob-bar {
    display: flex;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.03);
}

.prob-bar .prob-a {
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
}

.prob-bar .prob-b {
    background: var(--gradient-gold);
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
}

/* ---------- Playing XI Card ---------- */
.xi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.xi-player {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.xi-player:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px var(--accent-cyan-glow);
}

.xi-player .xi-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
}

.xi-player .xi-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.xi-player .xi-role {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-bottom: 12px;
}

.xi-player .xi-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.xi-player .xi-stats span strong {
    color: var(--text-primary);
}

/* ---------- Venue Card ---------- */
.venue-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
}

.venue-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow-gold);
}

.venue-card .venue-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    line-height: 1.3;
}

.venue-card .venue-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.venue-card .venue-stat {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
}

.venue-card .venue-stat .value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.venue-card .venue-stat .label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Phase Stats ---------- */
.phase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.phase-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.phase-card .phase-name {
    font-size: 0.78rem;
    color: var(--accent-cyan);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.phase-card .phase-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.phase-card .phase-stat-row .label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.phase-card .phase-stat-row .value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---------- Team Strength Rank ---------- */
.team-rank-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.team-rank-card:hover {
    border-color: var(--accent-purple);
    transform: translateX(6px);
    box-shadow: var(--shadow-glow-purple);
}

.team-rank-card .rank-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.team-rank-card:nth-child(1) .rank-number { background: var(--gradient-gold); color: #1a1a1a; }
.team-rank-card:nth-child(2) .rank-number { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1a1a1a; }
.team-rank-card:nth-child(3) .rank-number { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.team-rank-card:nth-child(n+4) .rank-number { background: var(--bg-glass); color: var(--text-secondary); }

.team-rank-card .rank-info {
    flex: 1;
}

.team-rank-card .rank-info h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}

.team-rank-card .rank-score {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    flex-shrink: 0;
}

.team-rank-card .score-breakdown {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.team-rank-card .score-breakdown .breakdown-item {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.team-rank-card .score-breakdown .breakdown-item strong {
    color: var(--text-secondary);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }
.animate-in:nth-child(7) { animation-delay: 0.35s; }
.animate-in:nth-child(8) { animation-delay: 0.4s; }
.animate-in:nth-child(9) { animation-delay: 0.45s; }
.animate-in:nth-child(10) { animation-delay: 0.5s; }

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

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-header, .page-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .vs-container { flex-direction: column; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-group { min-width: 100%; }
}

@media (max-width: 600px) {
    .stat-cards { grid-template-columns: 1fr; }
    .phase-grid { grid-template-columns: 1fr; }
    .xi-grid { grid-template-columns: 1fr; }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Mobile menu toggle ---------- */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .mobile-toggle { display: flex; }
    .page-header { padding-top: 70px; }
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- Winner highlight ---------- */
.winner-highlight {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    text-align: center;
    margin: 16px 0;
}

.winner-highlight h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--accent-green);
    font-size: 1.1rem;
}

/* ---------- Matchup indicator ---------- */
.matchup-positive { color: var(--accent-green); }
.matchup-negative { color: var(--accent-red); }
.matchup-neutral { color: var(--text-muted); }

/* ---------- Overlay for mobile sidebar ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}
