        :root {
            --bg-main: #06060a;
            --bg-panel: #0d0d14;
            --bg-panel-light: #141420;
            --border-muted: rgba(255, 255, 255, 0.05);
            --border-focus: rgba(16, 185, 129, 0.4);
            --pitch-base: #0a1a08;
            --pitch-stripe: #10260d;
            --pitch-lines: rgba(255, 255, 255, 0.07);
            --emerald-400: #34d399;
            --emerald-500: #10b981;
            --amber-400: #fbbf24;
            --slate-300: #cbd5e1;
            --slate-400: #94a3b8;
            --slate-500: #64748b;
            --rarity-bronze: linear-gradient(135deg, #a16207 0%, #451a03 100%);
            --rarity-silver: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
            --rarity-gold: linear-gradient(135deg, #eab308 0%, #854d0e 100%);
            --rarity-epic: linear-gradient(135deg, #a855f7 0%, #6b21a8 100%);
            --rarity-legend: linear-gradient(135deg, #f43f5e 0%, #9f1239 100%);
            --rarity-icon: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #0f172a 100%);
        }
        * { box-sizing: border-box; }
        body {
            margin: 0;
            font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
            background-color: var(--bg-main);
            color: #f8fafc;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
        }
        #startScreen {
            position: relative;
            background: radial-gradient(circle at top, #141424 0%, var(--bg-main) 75%);
            z-index: 1;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding: 3rem 2rem 2rem;
            min-height: 100vh;
        }
        .header { display: none; }
        .container { display: none; }
        .setup-card {
            background-color: rgba(13, 13, 20, 0.9);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 2rem;
            max-width: 680px;
            width: 100%;
            padding: 3rem;
            box-shadow: 0 25px 60px rgba(0,0,0,0.8);
            backdrop-filter: blur(12px);
            text-align: center;
        }
        .challenge-badge {
            display: inline-block;
            background: linear-gradient(90deg, #db2777, #9333ea);
            color: white;
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            padding: 0.5rem 1.25rem; border-radius: 9999px; letter-spacing: 0.1em; margin-bottom: 1.5rem;
        }
        .setup-group { margin: 2.5rem 0; text-align: left; }
        .setup-label { display: block; font-size: 0.813rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate-400); margin-bottom: 1rem; border-left: 3px solid var(--emerald-500); padding-left: 0.5rem; }
        .option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
        .opt-btn { background-color: rgba(255,255,255,0.02); border: 1px solid var(--border-muted); border-radius: 1rem; padding: 1.25rem 1rem; color: var(--slate-300); font-weight: 700; font-size: 0.938rem; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 0.25rem; transition: all 0.2s; }
        .opt-btn span:last-child { font-size: 0.75rem; color: var(--slate-500); font-weight: 500; }
        .opt-btn:hover { border-color: rgba(255,255,255,0.15); background-color: rgba(255,255,255,0.04); }
        .opt-btn.active { border-color: var(--emerald-400); background-color: rgba(16, 185, 129, 0.06); color: #fff; box-shadow: 0 0 16px rgba(16, 185, 129, 0.15); }
        .header { padding: 2.5rem 1rem 1.5rem; text-align: center; }
        .badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(251, 191, 36, 0.05); border: 1px solid rgba(251, 191, 36, 0.12); border-radius: 9999px; padding: 0.5rem 1.25rem; font-size: 0.75rem; font-weight: 700; color: var(--amber-400); margin-bottom: 0.75rem; }
        .badge-pulse { width: 6px; height: 6px; background-color: var(--amber-400); border-radius: 50%; animation: pulse 1.5s infinite; }
        @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
        .live-ticker-wrap { display: flex; gap: 0.75rem; margin-bottom: 1rem; justify-content: flex-start; }
        .ticker-pill { background: #06060a; border: 1px solid var(--border-muted); padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.813rem; font-weight: 700; color: var(--slate-400); display: flex; align-items: center; gap: 0.5rem; }
        .ticker-pill strong { font-size: 0.938rem; }
        .tk-w strong { color: var(--emerald-400); }
        .tk-d strong { color: var(--amber-400); }
        .tk-l strong { color: #f43f5e; }
        .container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1.5rem 3rem; flex: 1; }
        .main-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 1.5rem; align-items: start; }
        @media (max-width: 1024px) { .main-grid { grid-template-columns: 1fr; } }
        .panel { background-color: var(--bg-panel); border: 1px solid var(--border-muted); border-radius: 1.25rem; padding: 1.75rem; }
        .panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
        .panel-title-area h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
        .panel-title-area p { margin: 0.25rem 0 0; font-size: 0.813rem; color: var(--slate-500); }
        .counter-pill { font-weight: 700; background-color: #06060a; padding: 0.5rem 1rem; border-radius: 0.5rem; border: 1px solid var(--border-muted); font-size: 0.875rem; white-space: nowrap; }
        .pitch-wrapper {
            background: linear-gradient(160deg, #0a1208 0%, #060e04 50%, #0a1208 100%);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 1rem;
            padding: 1.25rem;
            box-shadow: 0 8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
        }
        .pitch-container {
            position: relative; width: 100%; aspect-ratio: 3/4;
            background:
                repeating-linear-gradient(
                    180deg,
                    #0d2010 0px, #0d2010 44px,
                    #0b1c0e 44px, #0b1c0e 88px
                );
            border: 2px solid rgba(255,255,255,0.12);
            border-radius: 0.75rem;
            overflow: hidden;
            box-shadow:
                inset 0 0 80px rgba(0,0,0,0.5),
                inset 0 0 20px rgba(0,100,0,0.15),
                0 4px 30px rgba(0,0,0,0.8);
        }
        /* White pitch border inside the container */
        .pitch-container::before {
            content: '';
            position: absolute;
            inset: 6%;
            border: 1.5px solid rgba(255,255,255,0.18);
            border-radius: 2px;
            pointer-events: none;
            z-index: 1;
        }
        .pitch-center-circle {
            position: absolute; top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 22%; aspect-ratio: 1;
            border: 1.5px solid rgba(255,255,255,0.18);
            border-radius: 50%; pointer-events: none; z-index: 2;
        }
        .pitch-center-dot {
            position: absolute; top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 3%; aspect-ratio: 1;
            background: rgba(255,255,255,0.3);
            border-radius: 50%; pointer-events: none; z-index: 2;
        }
        .pitch-center-line {
            position: absolute; top: 50%; left: 6%; right: 6%;
            height: 1.5px;
            background: rgba(255,255,255,0.18);
            transform: translateY(-50%); pointer-events: none; z-index: 2;
        }
        .pitch-box-top, .pitch-box-bottom {
            position: absolute; left: 50%; transform: translateX(-50%);
            width: 44%; height: 14%;
            border: 1.5px solid rgba(255,255,255,0.18);
            pointer-events: none; z-index: 2;
        }
        .pitch-box-top { top: 6%; border-top: none; }
        .pitch-box-bottom { bottom: 6%; border-bottom: none; }
        /* 6-yard box */
        .pitch-goal-top, .pitch-goal-bottom {
            position: absolute; left: 50%; transform: translateX(-50%);
            width: 20%; height: 5%;
            border: 1.5px solid rgba(255,255,255,0.14);
            pointer-events: none; z-index: 2;
        }
        .pitch-goal-top { top: 6%; border-top: none; }
        .pitch-goal-bottom { bottom: 6%; border-bottom: none; }
        /* Penalty spots */
        .pitch-spot-top, .pitch-spot-bottom {
            position: absolute; left: 50%; transform: translateX(-50%);
            width: 1.8%; aspect-ratio: 1;
            background: rgba(255,255,255,0.25);
            border-radius: 50%; pointer-events: none; z-index: 2;
        }
        .pitch-spot-top { top: 18%; }
        .pitch-spot-bottom { bottom: 18%; }
        
        /* Chemistry lines */
        
        /* Position swap */
        .pitch-slot.swap-target {
            animation: swapGlow 0.7s ease-in-out infinite alternate;
            cursor: pointer !important;
            z-index: 30;
        }
        .pitch-slot.swap-source { border-color: rgba(251,191,36,0.9) !important; }
        @keyframes swapGlow {
            0%  { border-color: rgba(251,191,36,0.4); box-shadow: 0 0 6px rgba(251,191,36,0.2); }
            100%{ border-color: #fbbf24; box-shadow: 0 0 18px rgba(251,191,36,0.6); transform: translate(-50%,-53%) scale(1.05); }
        }
        .swap-btn {
            position: absolute; bottom: 3px; right: 3px;
            font-size: 0.55rem; background: rgba(255,255,255,0.12);
            border-radius: 3px; padding: 1px 3px; cursor: pointer;
            color: rgba(255,255,255,0.6); z-index: 20; line-height: 1;
            transition: background 0.15s;
        }
        .swap-btn:hover { background: rgba(255,255,255,0.25); color: #fff; }
        .chem-line { transition: opacity 0.3s; }
        .chem-dot { transition: opacity 0.3s; }
        .pitch-slot {
            position: absolute; transform: translate(-50%, -50%); width: 14.5%; aspect-ratio: 3/4.2;
            background: rgba(0, 0, 0, 0.55);
            border: 1.5px dashed rgba(255, 255, 255, 0.22);
            border-radius: 0.5rem; display: flex; flex-direction: column; justify-content: center;
            align-items: center; z-index: 10; backdrop-filter: blur(6px); padding: 0.25rem; cursor: default;
            transition: box-shadow 0.2s, border-color 0.2s;
        }
        @keyframes slotGlow {
            0% { border-color: rgba(52,211,153,0.35); box-shadow: 0 0 6px rgba(52,211,153,0.15); }
            100% { border-color: #34d399; box-shadow: 0 0 22px rgba(52,211,153,0.6), 0 0 6px rgba(52,211,153,0.3); transform: translate(-50%, -53%) scale(1.06); }
        }
        .pitch-slot.valid-target { animation: slotGlow 0.75s ease-in-out infinite alternate; border-style: solid; cursor: pointer; z-index: 30; background: rgba(16,185,129,0.15); }
        .slot-pos-label { font-size: 0.7rem; font-weight: 800; color: var(--slate-400); text-transform: uppercase; pointer-events: none; text-align: center; }
        .pitch-slot.filled {
            border: 1.5px solid rgba(255,255,255,0.2);
            box-shadow: 0 6px 20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
            justify-content: space-between; align-items: center; text-align: center;
            background: linear-gradient(160deg, rgba(14,20,34,0.97) 0%, rgba(6,10,16,0.98) 100%);
            padding: 0.3rem 0.1rem;
        }
        .pitch-slot.filled.captain-slot {
            border-color: rgba(251,191,36,0.7) !important;
            box-shadow: 0 6px 20px rgba(0,0,0,0.7), 0 0 12px rgba(251,191,36,0.3) !important;
        }

        /* Club color accent — applied via JS as inline background on filled slot */
        .pitch-slot.filled.captain-slot { border-color: rgba(251,191,36,0.7) !important; box-shadow: 0 6px 20px rgba(0,0,0,0.7), 0 0 12px rgba(251,191,36,0.3) !important; }
        .filled .min-rating { font-size: 1.05rem; font-weight: 900; line-height: 1.1; margin-top: 0.1rem; color: #ffffff; }
        .filled .min-name { font-size: 0.5rem; font-weight: 700; width: 100%; white-space: normal; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0 2px; color: #ffffff; }
        .filled .min-club { font-size: 0.45rem; font-weight: 600; opacity: 0.7; color: #cbd5e1; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; margin-bottom: 0.1rem; }
        .captain-badge { font-size: 0.42rem; font-weight: 900; color: #fbbf24; letter-spacing: 0.03em; line-height: 1; }
        .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 0.75rem; min-height: 200px; margin-top: 1rem; }
        .placeholder-text { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--slate-500); font-size: 0.813rem; font-style: italic; text-align: center; padding: 2rem 1rem; gap: 1rem; }
        .card {
            position: relative; aspect-ratio: 3/4.2; border-radius: 0.5rem; padding: 0.75rem 0.5rem; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 4px 10px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
        }
        .card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.85) 100%); z-index: 1; pointer-events: none; }
        .card:hover:not(.pos-locked) { transform: translateY(-4px); box-shadow: 0 12px 20px rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.3); }
        .card.selected-card { border: 2px solid var(--emerald-400) !important; box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important; transform: scale(0.96); }
        .card.pos-locked { filter: grayscale(1) brightness(0.4); opacity: 0.35; cursor: not-allowed; pointer-events: none; border: 1px dashed rgba(255,255,255,0.1); }
        .lock-indicator { display: none; font-size: 0.563rem; font-weight: 900; background: rgba(244, 63, 94, 0.85); color: white; padding: 2px 4px; border-radius: 3px; text-transform: uppercase; z-index: 5; margin-top: 2px; letter-spacing: 0.03em; }
        .card.pos-locked .lock-indicator { display: inline-block; }
        .fallback-avatar-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; font-weight: 900; opacity: 0.06; color: #fff; z-index: 0; pointer-events: none; }
        .bg-bronze { background: var(--rarity-bronze); color: #fef3c7; }
        .bg-silver { background: var(--rarity-silver); color: #ffffff; }
        .bg-gold   { background: var(--rarity-gold); color: #ffffff; }
        .bg-epic   { background: var(--rarity-epic); color: #ffffff; }
        .bg-legend { background: var(--rarity-legend); color: #ffffff; }
        .bg-icon   { background: var(--rarity-icon); color: #fef08a; border: 1px solid rgba(234, 179, 8, 0.4) !important; }
        .card-rating { font-size: 1.6rem; font-weight: 900; z-index: 2; line-height: 1; letter-spacing: -0.04em; display: flex; justify-content: space-between; align-items: flex-start; color: #ffffff; }
        .card-pos-badge { font-size: 0.625rem; font-weight: 800; background: rgba(0,0,0,0.25); padding: 0.125rem 0.375rem; border-radius: 0.25rem; color: #fff; text-transform: uppercase; }
        .card-footer { z-index: 2; width: 100%; }
        .card-name-text { font-size: 0.82rem; font-weight: 800; margin: 0 0 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ffffff !important; }
        .card-club { font-size: 0.68rem; font-weight: 700; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; color: #cbd5e1; display:flex; align-items:center; gap:4px; }
        button.btn-primary { width: 100%; padding: 1rem; border-radius: 0.75rem; border: none; background-color: var(--emerald-500); color: white; font-size: 0.938rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3); transition: all 0.2s; }
        button.btn-primary:hover:not(:disabled) { background-color: var(--emerald-400); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(52, 211, 153, 0.4); }
        button.btn-spin { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); color: #000; font-weight: 800; text-transform: uppercase; border: none; box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3); font-size: 0.875rem; padding: 0.625rem 1.25rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; }
        button.btn-spin:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(251, 191, 36, 0.5); }
        button.btn-respin { background: linear-gradient(135deg, #a855f7 0%, #6b21a8 100%); color: #fff; font-weight: 700; text-transform: uppercase; border: none; box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3); font-size: 0.813rem; padding: 0.625rem 1rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
        button.btn-respin:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(168, 85, 247, 0.5); }
        button.btn-reset { background: rgba(244,63,94,0.15); color: #f87171; font-weight: 600; text-transform: uppercase; border: 1px solid rgba(244,63,94,0.3); box-shadow: none; font-size: 0.7rem; padding: 0.35rem 0.75rem; border-radius: 0.375rem; cursor: pointer; display: none; transition: all 0.2s; letter-spacing: 0.03em; }
        button.btn-reset:hover { background: rgba(244,63,94,0.25); border-color: rgba(244,63,94,0.5); }
        button:disabled { background: #1a1a26 !important; border-color: transparent !important; color: var(--slate-500) !important; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
        .sim-layout { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; width: 100%; }
        .table-scroll { overflow-x: auto; border: 1px solid var(--border-muted); border-radius: 0.5rem; background-color: rgba(0,0,0,0.2); width: 100%; }
        table { width: 100%; border-collapse: collapse; font-size: 0.813rem; text-align: left; }
        th { background-color: #09090f; padding: 0.75rem; color: var(--slate-400); font-weight: 600; border-bottom: 1px solid var(--border-muted); }
        td { padding: 0.625rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.02); color: var(--slate-300); }
        tr.user-row td { background-color: rgba(16, 185, 129, 0.08); color: var(--emerald-400); font-weight: 700; }
        tr.user-row td:first-child { border-left: 3px solid var(--emerald-500); }
        #feed { max-height: 280px; overflow-y: auto; background-color: rgba(0,0,0,0.3); border-radius: 0.5rem; border: 1px solid var(--border-muted); width: 100%; }
        .feed-item { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.02); font-size: 0.813rem; line-height: 1.4; }
        .feed-win { background: rgba(16, 185, 129, 0.12) !important; border-left: 4px solid var(--emerald-400); }
        .feed-draw { background: rgba(251, 191, 36, 0.12) !important; border-left: 4px solid var(--amber-400); }
        .feed-loss { background: rgba(239, 68, 68, 0.12) !important; border-left: 4px solid #ef4444; }
        @keyframes cardSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .spin-reel { grid-column: 1 / -1; width: 100%; display:flex; align-items:center; justify-content:center; min-height: 200px; }
        .spin-reel-card { width: 100%; box-sizing: border-box; padding: 1.75rem 2.25rem; background: linear-gradient(135deg, #1e1e2f, #2b2b3f); border: 2px solid var(--emerald-400); border-radius: 0.875rem; font-weight: 800; font-size: 1.3rem; text-align: center; color: #fff; box-shadow: 0 0 24px rgba(16,185,129,0.25); }
        @keyframes spinFlip { 0% { transform: translateY(-6px) scale(0.96); opacity: 0.5; } 60% { transform: translateY(1px) scale(1.02); opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
        .spin-reel-flip { animation: spinFlip 0.14s ease-out; }
        @keyframes spinLandPulse { 0% { transform: scale(1.12); box-shadow: 0 0 40px rgba(251,191,36,0.55); } 100% { transform: scale(1); box-shadow: 0 0 24px rgba(251,191,36,0.35); } }
        .spin-reel-landed { border-color: var(--amber-400) !important; animation: spinLandPulse 0.45s ease; }
        .spin-dots { display:flex; gap:0.4rem; justify-content:center; margin-top:0.85rem; }
        .spin-dots span { width:6px; height:6px; border-radius:50%; background: var(--slate-500); animation: spinDotPulse 0.9s infinite ease-in-out; }
        .spin-dots span:nth-child(2) { animation-delay: 0.15s; }
        .spin-dots span:nth-child(3) { animation-delay: 0.3s; }
        .spin-stuck-link { display: block; margin: 0.875rem auto 0; background: none; border: none; color: var(--slate-500); font-size: 0.7rem; text-decoration: underline; cursor: pointer; padding: 0.25rem; }
        .spin-stuck-link:hover { color: var(--slate-300); }
        @keyframes spinDotPulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }
        .update-banner { position: relative; z-index: 150; display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 0.625rem 2.5rem; background: linear-gradient(90deg, rgba(16,185,129,0.18), rgba(52,211,153,0.1)); border-bottom: 1px solid rgba(52,211,153,0.3); font-size: 0.813rem; font-weight: 600; color: #d1fae5; text-align: center; }
        .update-banner-close { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: #d1fae5; font-size: 1.25rem; cursor: pointer; line-height: 1; padding: 0.25rem 0.5rem; opacity: 0.7; }
        .update-banner-close:hover { opacity: 1; }
        .coach-name-input { width: 100%; box-sizing: border-box; background: #06060a; border: 1px solid var(--border-muted); border-radius: 0.5rem; padding: 0.75rem 0.875rem; color: #fff; font-size: 0.938rem; font-weight: 600; margin-bottom: 0.625rem; }
        .coach-name-input:focus { outline: none; border-color: var(--emerald-400); }
        .coach-name-input::placeholder { color: var(--slate-500); font-weight: 500; }
        .leaderboard-link-btn { width: 100%; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); color: var(--amber-400); font-weight: 700; font-size: 0.875rem; padding: 0.625rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; }
        .leaderboard-link-btn:hover { background: rgba(251,191,36,0.16); }
        .leaderboard-modal-overlay { position: fixed; inset: 0; background: rgba(2,2,6,0.78); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1.25rem; }
        .leaderboard-modal-card { background: #0c0c14; border: 1px solid var(--border-muted); border-radius: 1rem; width: 100%; max-width: 480px; max-height: 80vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
        .lb-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.125rem 1.25rem; border-bottom: 1px solid var(--border-muted); }
        .lb-modal-header h2 { margin: 0; font-size: 1.125rem; font-weight: 800; }
        .lb-close-btn { background: none; border: none; color: var(--slate-400); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0 0.25rem; }
        .lb-close-btn:hover { color: #fff; }
        .lb-tabs { display: flex; gap: 0.5rem; padding: 0.875rem 1.25rem 0; }
        .lb-tab-btn { flex: 1; background: #15151f; border: 1px solid var(--border-muted); color: var(--slate-400); font-weight: 700; font-size: 0.813rem; padding: 0.5rem; border-radius: 0.5rem; cursor: pointer; transition: all 0.2s; }
        .lb-tab-btn.active { background: rgba(16,185,129,0.12); border-color: var(--emerald-400); color: #fff; }
        .lb-modal-body { padding: 1rem 1.25rem 1.25rem; overflow-y: auto; flex: 1; }
        .lb-rows { display: flex; flex-direction: column; gap: 0.5rem; }
        .lb-row { display: grid; grid-template-columns: 1.75rem 1fr auto auto; align-items: center; gap: 0.625rem; background: #14141e; border: 1px solid var(--border-muted); border-radius: 0.5rem; padding: 0.625rem 0.75rem; font-size: 0.875rem; }
        .lb-row-you { border-color: var(--emerald-400); background: rgba(16,185,129,0.08); }
        .lb-rank { font-weight: 800; color: var(--slate-400); }
        .lb-name { font-weight: 700; }
        .lb-meta { font-size: 0.7rem; color: var(--slate-400); text-transform: capitalize; }
        .lb-score { font-weight: 800; color: var(--amber-400); }
        .header-lb-btn { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); color: var(--amber-400); font-weight: 700; font-size: 0.8rem; padding: 0.5rem 1rem; border-radius: 0.5rem; cursor: pointer; margin-top: 0.75rem; }
        .header-lb-btn:hover { background: rgba(251,191,36,0.16); }
        .card-animate { animation: cardSlideIn 0.3s ease forwards; }

        .pitch-slot.filled {
            border: 2px solid rgba(255,255,255,0.25);
            box-shadow: 0 4px 16px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
            justify-content: flex-start; align-items: center; text-align: center;
            flex-direction: column;
            padding: 3px 2px 2px;
            gap: 0;
        }
        .pitch-slot.filled.captain-slot {
            border-color: rgba(251,191,36,0.8) !important;
            box-shadow: 0 0 14px rgba(251,191,36,0.4) !important;
        }
        /* Row: rating + flag */
        .slot-top-row { display:flex; justify-content:space-between; align-items:center; width:100%; padding:0 3px; }
        .slot-flag { display:flex; align-items:center; flex-shrink:0; }
        .slot-flag svg { border-radius:2px; display:block; }
        .filled .min-rating { font-size: 1.1rem; font-weight: 900; line-height:1; color:#fff; }
        .filled .min-name {
            font-size: 0.58rem; font-weight: 800; width:100%; color:#fff;
            white-space:normal; line-height:1.15;
            display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
            overflow:hidden; padding:0 2px; margin-top:1px;
        }
        .slot-pos-tag { font-size:0.48rem; font-weight:700; color:var(--emerald-400); letter-spacing:.03em; text-transform:uppercase; }
        /* Chemistry pips row */
        .chem-pips { display:flex; gap:1px; margin-top:2px; flex-wrap:wrap; justify-content:center; }
        .chem-pip { width:4px; height:4px; border-radius:50%; display:inline-block; }
        .captain-badge { font-size:0.48rem; font-weight:900; color:#fbbf24; }
        .swap-btn {
            position:absolute; bottom:2px; right:2px;
            font-size:0.65rem; background:rgba(255,255,255,0.15);
            border:none; border-radius:3px; padding:1px 4px; cursor:pointer;
            color:rgba(255,255,255,0.8); z-index:20; line-height:1;
        }
        .swap-btn:hover { background:rgba(255,255,255,0.3); color:#fff; }

        /* ══ PITCH SLOT FILLED — clean definitive styles ══════════════════ */
        .pitch-slot.filled {
            border: 1.5px solid rgba(255,255,255,0.22);
            box-shadow: 0 4px 16px rgba(0,0,0,0.6);
            justify-content: center; align-items: center; text-align: center;
            flex-direction: column; padding: 3px 2px 2px; gap: 1px;
        }
        .slot-rating-row {
            display: flex; justify-content: space-between; align-items: center;
            width: 100%; padding: 0 3px;
        }
        .pitch-slot .min-rating {
            font-size: 0.95rem; font-weight: 900; line-height: 1; color: #fff;
        }
        .pitch-slot .slot-pos-tag {
            font-size: 0.48rem; font-weight: 800; color: var(--emerald-400);
            letter-spacing: .04em; text-transform: uppercase;
        }
        .pitch-slot .min-name {
            font-size: 0.52rem; font-weight: 700; width: 100%; color: #fff;
            white-space: normal; line-height: 1.15; text-align: center;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
            overflow: hidden; padding: 0 2px;
        }
        .slot-badges-row {
            display: flex; gap: 3px; align-items: center; justify-content: center;
            margin-top: 1px;
        }
        .slot-badges-row svg { border-radius: 2px; display: block; }
        .captain-badge { font-size: 0.55rem; font-weight: 900; color: #fbbf24; }
        .swap-btn {
            position: absolute; bottom: 2px; right: 2px;
            font-size: 1.1rem; background: rgba(255,255,255,0.14);
            border: none; border-radius: 3px; padding: 1px 5px;
            cursor: pointer; color: rgba(255,255,255,0.85); z-index: 20;
            line-height: 1; font-weight: 700; min-width: 22px; text-align: center;
        }
        .swap-btn:hover { background: rgba(255,255,255,0.28); color: #fff; }

        /* ══ MOBILE: pitch takes full width ════════════════════════════════ */
        @media (max-width: 767px) {
            .panel { padding: 1rem 0.75rem; }
            .pitch-wrapper { padding: 0.5rem; }
            /* Pitch fills the screen better on phones */
            .pitch-container { aspect-ratio: 3/4.6; }
            .pitch-slot { width: 16%; }
            .pitch-slot .min-name { font-size: 0.58rem; }
            .pitch-slot .min-rating { font-size: 1.05rem; }
        }
        @media (min-width: 768px) and (max-width: 1023px) {
            /* Tablet: pitch panel takes full width */
            .pitch-container { aspect-ratio: 3/4.2; }
        }

        /* ── FLAG & LOGO SIZES ──────────────────────────────────────────── */
        /* Selection cards: small flags */
        .card-flag-svg svg { width: 16px; height: 11px; border-radius: 1px; vertical-align: middle; }
        .card-club-svg svg { width: 13px; height: 14px; vertical-align: middle; }

        /* Pitch slots: bigger flags and logos */
        .slot-badges-row .flag-svg svg { width: 20px; height: 14px; border-radius: 2px; }
        .slot-badges-row .club-svg svg { width: 16px; height: 18px; }

        @media (max-width: 767px) {
            .pitch-slot { width: 16% !important; }
            .pitch-slot .min-rating { font-size: 1.05rem !important; }
            .pitch-slot .min-name { font-size: 0.58rem !important; }
            .pitch-slot .slot-pos-tag { font-size: 0.52rem !important; }
        }

        /* ══ DESKTOP: bigger text + badges inside the existing slot size ═══ */
        @media (min-width: 768px) {
            .pitch-slot.filled .min-rating   { font-size: 1.45rem !important; font-weight: 900; }
            .pitch-slot.filled .slot-pos-tag { font-size: 0.72rem !important; font-weight: 800; }
            .pitch-slot.filled .min-name     { font-size: 0.72rem !important; font-weight: 700; }
            .pitch-slot.filled .flag-svg svg  { width: 28px !important; height: 19px !important; border-radius: 2px; }
            .pitch-slot.filled .club-svg svg  { width: 24px !important; height: 26px !important; }
            .pitch-slot.filled .slot-badges-row { gap: 5px; margin-top: 3px; }
        }

        /* ══ MOBILE: smaller slots + compact swap inside ══════════════════ */
        @media (max-width: 767px) {
            .pitch-slot { overflow: hidden !important; width: 15% !important; }
            .swap-btn {
                position: absolute !important;
                bottom: 1px !important; right: 1px !important;
                left: auto !important; transform: none !important;
                font-size: 0.65rem !important; padding: 1px 3px !important;
                background: rgba(20,20,40,0.85) !important;
                border: 1px solid rgba(255,255,255,0.2) !important;
                border-radius: 3px; z-index: 25; min-width: 14px;
            }
            .pitch-slot.filled .min-rating   { font-size: 0.9rem !important; }
            .pitch-slot.filled .slot-pos-tag { font-size: 0.44rem !important; }
            .pitch-slot.filled .min-name     { font-size: 0.44rem !important; }
            .pitch-slot.filled .flag-svg svg  { width: 16px !important; height: 11px !important; }
            .pitch-slot.filled .club-svg svg  { width: 13px !important; height: 15px !important; }
        }

        /* ── League About Section ── */
        .league-about {
            text-align: left;
            color: rgba(255,255,255,0.75);
            padding: 2.5rem 0 1rem;
            border-top: 1px solid rgba(255,255,255,0.08);
            margin-top: 2rem;
        }
        .league-about .about-inner { max-width: 100%; }
        .league-about h2 {
            font-size: 1.25rem;
            font-weight: 900;
            letter-spacing: -0.03em;
            color: #fff;
            margin: 0 0 0.5rem;
            text-transform: uppercase;
            text-align: left;
        }
        .league-about h2 span { color: #f43f5e; }
        .league-about .about-intro {
            font-size: 0.875rem;
            line-height: 1.7;
            color: rgba(255,255,255,0.6);
            margin: 0 0 1.75rem;
            text-align: left;
        }
        .league-about .about-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1rem;
            margin-bottom: 1.75rem;
        }
        .league-about .about-card {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.07);
            border-radius: 0.75rem;
            padding: 1rem 1rem 0.875rem;
            text-align: left;
        }
        .league-about .about-card h3 {
            font-size: 0.7rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #f43f5e;
            margin: 0 0 0.5rem;
            text-align: left;
        }
        .league-about .about-card p {
            font-size: 0.8rem;
            line-height: 1.6;
            margin: 0;
            color: rgba(255,255,255,0.55);
            text-align: left;
            font-weight: 400;
        }
        .league-about .legend-list {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            margin-top: 0.6rem;
        }
        .league-about .legend-pill {
            background: rgba(244,63,94,0.1);
            border: 1px solid rgba(244,63,94,0.22);
            border-radius: 100px;
            padding: 0.2rem 0.6rem;
            font-size: 0.7rem;
            font-weight: 700;
            color: #fda4af;
        }
        .league-about .faq-list {
            margin: 0;
            padding: 0;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }
        .league-about .faq-list li {
            background: rgba(255,255,255,0.02);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 0.5rem;
            padding: 0.75rem 0.875rem;
            text-align: left;
        }
        .league-about .faq-list li strong {
            display: block;
            font-size: 0.8rem;
            font-weight: 700;
            color: #fff;
            margin-bottom: 0.25rem;
            text-align: left;
        }
        .league-about .faq-list li span {
            font-size: 0.775rem;
            line-height: 1.6;
            color: rgba(255,255,255,0.5);
            font-weight: 400;
        }
