@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;800&display=swap');
        :root {
            --bg: #0a0a12;
            --surface: #0d0c18;
            --elevated: #12111f;
            --border: rgba(0,255,242,.08);
            --coral: #ff2d78;
            --coral-dim: #cc1a5e;
            --cyan: #00fff2;
            --cyan-glow: rgba(0,255,242,.35);
            --magenta: #ff00aa;
            --neon-purple: #b44dff;
            --neon-blue: #4d8dff;
            --text: #e8ecff;
            --muted: #6b7db3;
            --dim: #3d4a6b;
        }
        * { 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);
            height: 100vh; height: 100dvh;
            overflow: hidden;
            display: flex; flex-direction: column;
        }

        /* ── TOP BAR ── */
        .topbar {
            background: linear-gradient(180deg, var(--surface) 0%, rgba(13,12,24,.95) 100%);
            border-bottom: 1px solid rgba(0,255,242,.12);
            box-shadow: 0 1px 20px rgba(0,255,242,.06), inset 0 -1px 0 rgba(255,0,170,.05);
            padding: .5rem 1rem;
            display: flex; align-items: center; gap: .8rem;
            flex-wrap: wrap; z-index: 10;
        }
        .logo { font-family: 'Orbitron', sans-serif; font-size: 1.3rem; font-weight: 800; white-space: nowrap; letter-spacing: 2px; text-shadow: 0 0 10px rgba(0,255,242,.3); }
        .logo small { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-weight: 400; color: var(--muted); font-size: .7rem; margin-left: .3rem; letter-spacing: 0; }
        .turn-badge {
            background: var(--elevated); padding: .25rem .7rem; border-radius: 6px;
            font-size: .8rem; color: var(--cyan); font-weight: 600;
            font-family: 'Orbitron', monospace;
            border: 1px solid rgba(0,255,242,.15);
            box-shadow: 0 0 8px rgba(0,255,242,.1);
            text-shadow: 0 0 6px rgba(0,255,242,.4);
        }
        .current-general {
            margin-left: auto; font-size: .85rem; color: var(--muted);
            display: flex; align-items: center; gap: .3rem;
        }
        .current-general .emoji { font-size: 1.2rem; }

        /* ── SCOREBOARD ── */
        .scoreboard {
            display: flex; gap: .4rem; flex-wrap: wrap;
            padding: .35rem .8rem; background: rgba(10,10,18,.95);
            border-bottom: 1px solid rgba(0,255,242,.06);
        }
        .score-card {
            display: flex; align-items: center; gap: .35rem;
            padding: .3rem .6rem; border-radius: 6px;
            font-size: .75rem; background: var(--elevated);
            border: 1px solid rgba(255,255,255,.04); border-left: 2px solid transparent;
            transition: all .3s; position: relative; cursor: default;
        }
        .score-card.active { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow), inset 0 0 15px rgba(0,255,242,.03); }
        .score-card.dead { opacity: .25; text-decoration: line-through; filter: grayscale(1); }
        .score-emoji { font-size: 1rem; }
        .score-name { font-weight: 600; letter-spacing: .5px; }
        .score-count { color: var(--cyan); font-family: 'Orbitron', monospace; font-size: .7rem; }
        .score-cards-count { color: var(--neon-purple); font-size: .7rem; }
        .score-rank { font-family: 'Orbitron', monospace; font-size: .65rem; color: var(--dim); min-width: 18px; text-align: center; }
        .score-medal { font-size: .75rem; }
        .score-card.leader { border-left: 2px solid var(--coral) !important; background: rgba(255,45,120,.04); box-shadow: 0 0 8px rgba(255,45,120,.08); }
        .score-card { border-left: 2px solid transparent; transition: all .4s; }
        .score-bar { width: 45px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.05); overflow: hidden; }
        .score-bar-fill { height: 100%; border-radius: 3px; transition: width .5s; box-shadow: 0 0 6px currentColor; }
        .score-obj {
            display: none; position: absolute; bottom: calc(100% + 6px); left: 0;
            background: rgba(18,17,31,.95); border: 1px solid rgba(0,255,242,.15);
            padding: .4rem .6rem; border-radius: 6px; font-size: .7rem;
            color: var(--muted); white-space: nowrap; z-index: 20;
            box-shadow: 0 4px 20px rgba(0,0,0,.7), 0 0 8px rgba(0,255,242,.1); pointer-events: none;
        }
        .score-card:hover .score-obj { display: block; }

        /* ── OBJECTIVES BAR ── */
        .obj-bar {
            display: none; padding: .3rem .8rem; background: rgba(10,10,18,.9);
            border-bottom: 1px solid rgba(0,255,242,.06); font-size: .72rem;
            gap: .5rem; flex-wrap: wrap; align-items: center;
        }
        .obj-bar.show { display: flex; }
        .obj-item { color: var(--muted); display: flex; gap: .3rem; align-items: center; }
        .obj-item b { color: var(--text); }
        .obj-toggle {
            background: var(--elevated); border: 1px solid rgba(0,255,242,.1); color: var(--muted);
            padding: .2rem .5rem; border-radius: 4px; cursor: pointer; font-size: .7rem;
        }
        .obj-toggle:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 6px rgba(0,255,242,.15); }

        /* ── MAIN AREA ── */
        .main {
            flex: 1; display: grid; overflow: hidden;
            grid-template-columns: 1fr 320px;
        }

        /* ── MAP ── */
        .map-wrap {
            position: relative; overflow: hidden;
            background: var(--bg); border-right: 1px solid rgba(0,255,242,.06);
        }
        .map-wrap::after {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                0deg,
                transparent,
                transparent 2px,
                rgba(0,0,0,.03) 2px,
                rgba(0,0,0,.03) 4px
            );
            pointer-events: none;
            z-index: 1;
        }
        .map-wrap::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.6) 100%);
            pointer-events: none;
            z-index: 2;
        }
        .map-svg { width: 100%; height: 100%; }
        .adj-line { stroke: rgba(0,255,242,.04); stroke-width: .5; transition: all .3s; }
        .adj-line.lit { stroke: rgba(0,255,242,.5); stroke-width: 1.4; filter: drop-shadow(0 0 4px rgba(0,255,242,.4)); }
        .state-path.neighbor { stroke: rgba(0,255,242,.5) !important; stroke-width: 1 !important; filter: brightness(1.3) drop-shadow(0 0 3px rgba(0,255,242,.2)); }
        .state-path {
            fill: #12111f; stroke: rgba(0,255,242,.15); stroke-width: .6;
            cursor: pointer; transition: fill .5s, stroke .3s, filter .3s;
        }
        .state-path:hover { stroke: rgba(0,255,242,.3); stroke-width: .8; filter: drop-shadow(0 0 2px rgba(0,255,242,.15)); }
        .state-path.glow {
            stroke-width: 1;
            animation: glow-pulse 2s ease-in-out infinite;
        }
        .state-label {
            font-size: 5.5px; font-weight: 700; fill: rgba(200,220,255,.5);
            font-family: 'Orbitron', monospace;
            text-anchor: middle; dominant-baseline: central;
            pointer-events: none;
            paint-order: stroke; stroke: rgba(0,0,0,.9); stroke-width: 1.5px;
        }
        .troop-badge {
            pointer-events: none; transition: all .3s;
        }
        .troop-badge circle {
            fill: rgba(10,10,18,.75); stroke: rgba(0,255,242,.15); stroke-width: .5;
        }
        .troop-badge text {
            font-size: 7px; font-weight: 800; fill: rgba(255,255,255,.9);
            font-family: 'Orbitron', monospace;
            text-anchor: middle; dominant-baseline: central;
            paint-order: stroke; stroke: rgba(0,0,0,.7); stroke-width: 1px;
        }

        /* ── MAP EFFECTS ── */
        .attack-arrow {
            stroke-width: 2; fill: none; opacity: .95;
            stroke-dasharray: 500; stroke-dashoffset: 500;
            filter: drop-shadow(0 0 6px currentColor);
            animation: arrow-draw .3s ease-out forwards, arrow-fade .4s 2s forwards;
        }
        .attack-arrow-bg {
            stroke-width: 5; fill: none; opacity: .15;
            stroke-dasharray: 500; stroke-dashoffset: 500;
            filter: drop-shadow(0 0 10px currentColor);
            animation: arrow-draw .3s ease-out forwards, arrow-fade .4s 2s forwards;
        }
        @keyframes arrow-draw { to { stroke-dashoffset: 0; } }
        @keyframes arrow-fade { to { opacity: 0; } }

        .ripple {
            fill: none; stroke-width: 1.5; opacity: 0;
            filter: drop-shadow(0 0 4px currentColor);
            animation: ripple-expand .5s ease-out forwards;
        }
        @keyframes ripple-expand {
            0% { r: 5; opacity: .8; stroke-width: 2.5; }
            100% { r: 28; opacity: 0; stroke-width: .2; }
        }

        .float-text {
            font-size: 9px; font-weight: 800; text-anchor: middle;
            font-family: 'Orbitron', monospace;
            pointer-events: none; opacity: 0;
            filter: drop-shadow(0 0 4px currentColor);
            animation: float-up .8s ease-out forwards;
        }
        @keyframes float-up {
            0% { opacity: 1; transform: translateY(0); }
            100% { opacity: 0; transform: translateY(-30px); }
        }

        .conquest-ring {
            fill: none; stroke-width: 2; opacity: 0;
            filter: drop-shadow(0 0 6px currentColor);
            animation: conquest-burst .4s ease-out forwards;
        }
        @keyframes conquest-burst {
            0% { r: 4; opacity: 1; stroke-width: 3; }
            50% { opacity: .8; }
            100% { r: 30; opacity: 0; stroke-width: 0; }
        }

        .dice-group text {
            font-size: 10px; font-weight: 900; text-anchor: middle;
            dominant-baseline: central; pointer-events: none;
            font-family: 'Orbitron', monospace;
        }
        .dice-box { opacity: .95; }
        .dice-fade { animation: arrow-fade .4s 2s forwards; }

        @keyframes glow-pulse {
            0%,100% { filter: drop-shadow(0 0 3px var(--cyan-glow)); stroke-opacity: .7; }
            50% { filter: drop-shadow(0 0 10px rgba(0,255,242,.4)); stroke-opacity: 1; }
        }
        @keyframes shake {
            0%,100% { transform: translate(0,0); }
            20% { transform: translate(-2px,0); }
            40% { transform: translate(2px,0); }
            60% { transform: translate(-1px,0); }
            80% { transform: translate(1px,0); }
        }
        .shake { animation: shake .4s ease-in-out; }

        /* ── GAME LOG ── */
        .log-panel {
            background: rgba(10,10,18,.95); display: flex; flex-direction: column;
            overflow: hidden;
            border-left: 1px solid rgba(0,255,242,.04);
        }
        .log-header {
            padding: .5rem .8rem; font-weight: 700; font-size: .85rem;
            color: var(--cyan); border-bottom: 1px solid rgba(0,255,242,.08);
            display: flex; align-items: center; gap: .4rem;
            font-family: 'Orbitron', monospace; font-size: .75rem; letter-spacing: 1px;
            text-shadow: 0 0 8px rgba(0,255,242,.3);
        }
        .log-content {
            flex: 1; overflow-y: auto; padding: .4rem;
            scrollbar-width: thin; scrollbar-color: rgba(0,255,242,.1) transparent;
        }
        .log-content::-webkit-scrollbar { width: 4px; }
        .log-content::-webkit-scrollbar-thumb { background: rgba(0,255,242,.15); border-radius: 3px; }
        .log-entry {
            display: flex; gap: .4rem; padding: .35rem .4rem;
            border-radius: 5px; margin-bottom: .2rem;
            font-size: .78rem; line-height: 1.4;
            animation: log-slide .25s ease-out;
            border-left: 1px solid transparent;
        }
        .log-entry:hover { background: rgba(0,255,242,.03); }
        .log-entry .le { min-width: 20px; text-align: center; font-size: .9rem; }
        .log-entry .lt { flex: 1; color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, monospace; }
        .log-entry .lt b { color: var(--text); text-shadow: 0 0 4px rgba(255,255,255,.1); }
        .log-entry.highlight { background: rgba(0,255,242,.04); border-left: 2px solid var(--cyan); box-shadow: inset 0 0 10px rgba(0,255,242,.02); }
        .log-entry.objective { background: rgba(255,45,120,.06); border-left: 2px solid var(--coral); box-shadow: inset 0 0 10px rgba(255,45,120,.02); }
        .log-analysis {
            background: rgba(18,17,31,.8); padding: .4rem .6rem; border-radius: 5px;
            margin-top: .2rem; border-left: 3px solid var(--cyan);
            font-size: .75rem; color: var(--muted); line-height: 1.5;
            max-height: 70px; overflow-y: auto;
            font-family: monospace;
        }
        .log-analysis.typing { border-right: 2px solid var(--cyan); animation: blink 1s infinite; }
        @keyframes blink { 0%,50% { border-right-color: var(--cyan); } 51%,100% { border-right-color: transparent; } }
        @keyframes log-slide { from { opacity:0; transform:translateX(8px); } to { opacity:1; transform:translateX(0); } }

        /* ── CONTROLS ── */
        .ctrl-bar {
            position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
            z-index: 20; display: flex; flex-direction: column; align-items: center; gap: .5rem;
        }
        .map-selector {
            display: flex; gap: .4rem; background: rgba(10,15,26,.85); padding: .3rem;
            border-radius: 8px; border: 1px solid rgba(0,255,242,.15);
            position: absolute; top: .6rem; right: .6rem; z-index: 10;
            align-items: center;
        }
        .map-selector.collapsed .selector-content { display: none; }
        .map-selector.collapsed { padding: .2rem; }
        .selector-content { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: center; }
        .selector-toggle {
            background: transparent; border: none; cursor: pointer; font-size: .9rem;
            padding: .2rem .3rem; line-height: 1; opacity: .7; transition: opacity .2s;
        }
        .selector-toggle:hover { opacity: 1; }
        .scoreboard-wrap { position: relative; }
        .scoreboard-toggle {
            display: none; position: absolute; right: .5rem; top: -.1rem;
            background: rgba(10,15,26,.85); border: 1px solid rgba(0,255,242,.15);
            color: var(--cyan); cursor: pointer; font-size: .65rem; padding: .1rem .4rem;
            border-radius: 4px; z-index: 5; line-height: 1;
        }
        .scoreboard-wrap.collapsed .scoreboard { display: none; }
        .scoreboard-wrap.collapsed .scoreboard-toggle { top: -.8rem; }
        .map-selector.disabled .map-btn, .map-selector.disabled .lang-btn {
            opacity: .4; pointer-events: none; cursor: not-allowed;
        }
        .lang-btn {
            background: transparent; color: var(--dim); border: 1px solid transparent;
            padding: .3rem .5rem; border-radius: 5px; font-size: .7rem; cursor: pointer;
            font-family: 'Orbitron', sans-serif; transition: all .2s; letter-spacing: 1px;
        }
        .lang-btn:hover { color: var(--cyan); border-color: rgba(0,255,242,.3); }
        .lang-btn.active {
            background: rgba(0,255,242,.12); color: var(--cyan);
            border-color: var(--cyan); box-shadow: 0 0 6px rgba(0,255,242,.15);
        }
        .selector-sep {
            width: 1px; height: 1.2rem; background: rgba(0,255,242,.15);
            margin: 0 .2rem; align-self: center;
        }
        .map-btn {
            background: transparent; color: var(--dim); border: 1px solid transparent;
            padding: .35rem .8rem; border-radius: 6px; font-size: .8rem; cursor: pointer;
            font-family: 'Orbitron', sans-serif; transition: all .2s;
        }
        .map-btn:hover { color: var(--cyan); border-color: rgba(0,255,242,.3); }
        .map-btn.active {
            background: rgba(0,255,242,.12); color: var(--cyan);
            border-color: var(--cyan); box-shadow: 0 0 8px rgba(0,255,242,.2);
        }
        .start-btn {
            background: linear-gradient(135deg, #ff2d78, #b44dff, #00fff2);
            background-size: 200% 200%;
            animation: btn-gradient 3s ease infinite;
            color: white; border: none;
            padding: .65rem 1.8rem; border-radius: 10px; font-weight: 700;
            font-family: 'Orbitron', sans-serif; letter-spacing: 1px;
            font-size: .95rem; cursor: pointer; transition: all .2s;
            box-shadow: 0 4px 20px rgba(255,45,120,.3), 0 0 30px rgba(0,255,242,.1);
            text-shadow: 0 1px 3px rgba(0,0,0,.5);
        }
        @keyframes btn-gradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
        .start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(255,45,120,.4), 0 0 40px rgba(0,255,242,.2); filter: brightness(1.1); }
        .start-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.5); animation: none; }

        /* ── WINNER ── */
        .winner-overlay {
            position: fixed; inset: 0;
            background: radial-gradient(ellipse at center, rgba(10,10,18,.85) 0%, rgba(5,5,10,.97) 100%);
            display: flex; align-items: center; justify-content: center;
            z-index: 100; animation: fade-in .5s;
        }
        .winner-box {
            background: rgba(13,12,24,.95); padding: 2.5rem; border-radius: 16px;
            text-align: center; border: 1px solid var(--coral);
            box-shadow: 0 0 60px rgba(255,45,120,.25), 0 0 120px rgba(0,255,242,.08), inset 0 0 30px rgba(255,45,120,.03);
            max-width: 400px; position: relative; overflow: hidden;
        }
        .winner-box::before {
            content: ''; position: absolute; inset: -2px; border-radius: 18px;
            background: linear-gradient(135deg, #ff2d78, #b44dff, #00fff2, #ff2d78);
            background-size: 300% 300%;
            animation: border-glow 3s ease infinite;
            z-index: -1; opacity: .5;
        }
        @keyframes border-glow { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
        .winner-box .emoji { font-size: 3.5rem; margin-bottom: .5rem; filter: drop-shadow(0 0 15px rgba(255,45,120,.5)); }
        .winner-box h2 { font-family: 'Orbitron', sans-serif; font-size: 1.6rem; color: var(--coral); margin-bottom: .3rem; text-shadow: 0 0 20px rgba(255,45,120,.4); letter-spacing: 2px; }
        .winner-box p { color: var(--muted); margin-bottom: 1.2rem; font-size: .9rem; }
        .winner-box .reason { color: var(--cyan); font-size: .8rem; margin-bottom: 1rem; text-shadow: 0 0 8px rgba(0,255,242,.3); }
        @keyframes fade-in { from { opacity:0; transform:scale(.9); } to { opacity:1; transform:scale(1); } }

        /* ── TOOLTIP ── */
        .tooltip {
            position: fixed; background: rgba(18,17,31,.95); border: 1px solid rgba(0,255,242,.15);
            padding: .5rem .7rem; border-radius: 8px; font-size: .75rem;
            pointer-events: none; z-index: 50; display: none;
            box-shadow: 0 4px 20px rgba(0,0,0,.6), 0 0 10px rgba(0,255,242,.08); max-width: 200px;
            backdrop-filter: blur(8px);
        }
        .tooltip .tt-name { font-weight: 700; margin-bottom: .15rem; color: var(--cyan); font-family: 'Orbitron', monospace; font-size: .7rem; }
        .tooltip .tt-info { color: var(--muted); }

        /* ── INFO MODAL ── */
        .info-overlay {
            position: fixed; inset: 0;
            background: radial-gradient(ellipse at center, rgba(10,10,18,.88) 0%, rgba(5,5,10,.97) 100%);
            display: flex; align-items: center; justify-content: center;
            z-index: 200; animation: fade-in .3s;
        }
        .info-overlay.hidden { display: none; }
        .info-box {
            background: rgba(13,12,24,.95); padding: 2rem; border-radius: 16px;
            border: 1px solid rgba(0,255,242,.1); max-width: 520px; width: 90%;
            max-height: 85vh; overflow-y: auto;
            box-shadow: 0 0 50px rgba(0,255,242,.08), inset 0 0 20px rgba(0,0,0,.3);
        }
        .info-box h2 { font-family: 'Orbitron', sans-serif; color: var(--coral); font-size: 1.4rem; margin-bottom: .8rem; text-shadow: 0 0 15px rgba(255,45,120,.3); letter-spacing: 1px; }
        .info-box h3 { color: var(--cyan); font-size: .95rem; margin: 1rem 0 .4rem; text-shadow: 0 0 8px rgba(0,255,242,.2); }
        .info-box p, .info-box li { color: var(--muted); font-size: .85rem; line-height: 1.6; }
        .info-box ul { padding-left: 1.2rem; margin: .3rem 0; }
        .info-box li { margin-bottom: .3rem; }
        .info-box .info-highlight { color: var(--text); font-weight: 600; }
        .info-box .generals-preview {
            display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0;
        }
        .info-box .gen-chip {
            background: var(--elevated); padding: .3rem .6rem; border-radius: 6px;
            font-size: .8rem; border: 1px solid rgba(0,255,242,.08);
        }
        .info-close {
            background: linear-gradient(135deg, #ff2d78, #b44dff);
            color: white; border: none;
            padding: .6rem 1.5rem; border-radius: 8px; font-weight: 700;
            font-family: 'Orbitron', sans-serif; letter-spacing: 1px;
            font-size: .9rem; cursor: pointer; margin-top: 1.2rem;
            transition: all .2s; display: block; width: 100%;
            box-shadow: 0 0 20px rgba(255,45,120,.2);
        }
        .info-close:hover { filter: brightness(1.15); box-shadow: 0 0 30px rgba(255,45,120,.3); }
        .info-btn {
            background: var(--elevated); border: 1px solid rgba(0,255,242,.1); color: var(--muted);
            width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
            font-size: .85rem; display: flex; align-items: center; justify-content: center;
            transition: all .2s;
        }
        .info-btn:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 8px rgba(0,255,242,.2); }

        /* ── RESPONSIVE ── */
        @media (max-width: 800px) {
            .main { grid-template-columns: 1fr; grid-template-rows: 1fr 220px; }
            .map-wrap { border-right: none; border-bottom: 1px solid rgba(0,255,242,.06); }
            .scoreboard { gap: .3rem; padding: .25rem .5rem; }
            .score-card { padding: .2rem .4rem; font-size: .7rem; }
            .score-name { display: none; }
            .map-selector {
                padding: .2rem; gap: .2rem; flex-wrap: wrap; justify-content: center;
                max-width: 90vw; right: 50%; transform: translateX(50%);
            }
            .map-btn { padding: .25rem .5rem; font-size: .65rem; }
            .lang-btn { padding: .2rem .4rem; font-size: .6rem; }
            .selector-sep { height: 1rem; margin: 0 .1rem; }
            header h1 { font-size: 1.2rem; }
            header .subtitle { font-size: .65rem; }
            .ctrl-bar { bottom: .5rem; }
            .start-btn { font-size: .75rem; padding: .5rem 1.2rem; }
            .scoreboard-toggle { display: block; }
        }
/* Spectators bar */
.spectators-bar {
    text-align: center;
    font-size: 0.8rem;
    color: var(--cyan, #00e5cc);
    padding: 6px 0;
    letter-spacing: 0.5px;
    opacity: 1;
    text-shadow: 0 0 8px rgba(0,229,204,.4);
}
