:root {
            --bg: #050810;
            --surface: #0a0f1a;
            --elevated: #111827;
            --border: #1e293b;
            --coral: #ff4d4d;
            --coral-dim: #cc3333;
            --cyan: #00e5cc;
            --cyan-glow: rgba(0,229,204,.35);
            --text: #f0f4ff;
            --muted: #8892b0;
            --dim: #5a6480;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }

        /* ── Header ── */
        .header {
            background: var(--surface);
            border-bottom: 1px solid var(--border);
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }
        .header .logo {
            font-size: 1.3rem;
            font-weight: 800;
            white-space: nowrap;
        }
        .header .logo small {
            font-weight: 400;
            color: var(--muted);
            font-size: .75rem;
            margin-left: .3rem;
        }
        .back-btn {
            background: var(--elevated);
            border: 1px solid var(--border);
            color: var(--muted);
            padding: .4rem .8rem;
            border-radius: 6px;
            text-decoration: none;
            font-size: .85rem;
            transition: all .2s;
            margin-left: auto;
        }
        .back-btn:hover { color: var(--cyan); border-color: var(--cyan); }

        /* ── Map Tabs ── */
        .map-tabs {
            display: flex;
            gap: .4rem;
            flex-wrap: wrap;
            background: var(--surface);
            padding: .5rem;
            border-radius: 10px;
            border: 1px solid var(--border);
        }
        .map-tab {
            background: transparent;
            color: var(--muted);
            border: 1px solid transparent;
            padding: .45rem 1rem;
            border-radius: 8px;
            font-size: .85rem;
            cursor: pointer;
            transition: all .2s;
            display: flex;
            align-items: center;
            gap: .4rem;
        }
        .map-tab:hover { color: var(--cyan); border-color: rgba(0,229,204,.3); }
        .map-tab.active {
            background: rgba(0,229,204,.1);
            color: var(--cyan);
            border-color: var(--cyan);
            box-shadow: 0 0 8px rgba(0,229,204,.15);
        }
        .map-tag { display: inline-flex; align-items: center; gap: .3rem; }

        /* ── Container ── */
        .container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        /* ── Cards ── */
        .section {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            overflow: hidden;
        }
        .section-title {
            padding: .8rem 1.2rem;
            font-size: 1rem;
            font-weight: 700;
            color: var(--cyan);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: .5rem;
        }

        /* ── Summary Grid ── */
        .summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 1px;
            background: var(--border);
        }
        .summary-item {
            background: var(--surface);
            padding: 1rem 1.2rem;
            text-align: center;
        }
        .summary-value {
            font-size: 2rem;
            font-weight: 800;
            color: var(--coral);
            line-height: 1.2;
        }
        .summary-label {
            font-size: .78rem;
            color: var(--muted);
            margin-top: .2rem;
        }

        /* ── Generals Table ── */
        .gen-table {
            width: 100%;
            border-collapse: collapse;
        }
        .gen-table th {
            padding: .6rem 1rem;
            text-align: left;
            font-size: .75rem;
            color: var(--dim);
            text-transform: uppercase;
            letter-spacing: .05em;
            border-bottom: 1px solid var(--border);
            background: var(--elevated);
        }
        .gen-table td {
            padding: .65rem 1rem;
            font-size: .85rem;
            border-bottom: 1px solid rgba(30,41,59,.5);
        }
        .gen-table tr:hover td { background: rgba(255,255,255,.02); }
        .gen-name {
            display: flex;
            align-items: center;
            gap: .4rem;
            font-weight: 600;
        }
        .gen-emoji { font-size: 1.1rem; }
        .gen-color {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
        }
        .win-rate {
            font-weight: 700;
        }
        .rate-high { color: #22c55e; }
        .rate-mid { color: #eab308; }
        .rate-low { color: var(--muted); }

        /* ── Victory Bars ── */
        .victory-list {
            padding: 1rem 1.2rem;
            display: flex;
            flex-direction: column;
            gap: .8rem;
        }
        .victory-row {
            display: flex;
            align-items: center;
            gap: .8rem;
        }
        .victory-label {
            width: 120px;
            font-size: .85rem;
            color: var(--muted);
            flex-shrink: 0;
        }
        .victory-bar-bg {
            flex: 1;
            height: 24px;
            background: var(--elevated);
            border-radius: 6px;
            overflow: hidden;
            position: relative;
        }
        .victory-bar-fill {
            height: 100%;
            border-radius: 6px;
            transition: width .6s ease;
            display: flex;
            align-items: center;
            padding-left: .6rem;
            font-size: .75rem;
            font-weight: 700;
            color: white;
            min-width: fit-content;
        }
        .victory-count {
            font-size: .85rem;
            font-weight: 700;
            width: 30px;
            text-align: right;
            flex-shrink: 0;
        }

        /* ── Recent Games ── */
        .games-list {
            padding: 1rem 1.2rem;
            display: flex;
            flex-direction: column;
            gap: .6rem;
        }
        .game-card {
            background: var(--elevated);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: .8rem 1rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }
        .game-winner {
            font-size: 1.8rem;
            flex-shrink: 0;
        }
        .game-info {
            flex: 1;
            min-width: 150px;
        }
        .game-info .name {
            font-weight: 700;
            font-size: .9rem;
        }
        .game-info .details {
            font-size: .75rem;
            color: var(--muted);
            margin-top: .15rem;
        }
        .game-meta {
            display: flex;
            gap: .8rem;
            flex-wrap: wrap;
        }
        .game-tag {
            background: var(--surface);
            padding: .2rem .6rem;
            border-radius: 4px;
            font-size: .72rem;
            color: var(--muted);
            white-space: nowrap;
        }
        .game-tag.reason {
            color: var(--cyan);
            border: 1px solid rgba(0,229,204,.2);
        }

        /* ── Empty State ── */
        .empty {
            padding: 3rem 1.5rem;
            text-align: center;
            color: var(--dim);
        }
        .empty .icon { font-size: 3rem; margin-bottom: .5rem; }
        .empty p { font-size: .9rem; }

        /* ── Loading ── */
        .loading {
            padding: 3rem;
            text-align: center;
            color: var(--muted);
        }
        .loading::after {
            content: '';
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid var(--border);
            border-top-color: var(--cyan);
            border-radius: 50%;
            animation: spin .6s linear infinite;
            margin-left: .5rem;
            vertical-align: middle;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* ── Responsive ── */
        @media (max-width: 640px) {
            .container { padding: 1rem; gap: 1rem; }
            .summary-grid { grid-template-columns: repeat(2, 1fr); }
            .summary-value { font-size: 1.5rem; }
            .gen-table th, .gen-table td { padding: .5rem .6rem; font-size: .78rem; }
            .victory-label { width: 90px; font-size: .78rem; }
            .game-card { padding: .6rem .8rem; }
        }