:root{--bg-deep: #0d1117;--bg-panel: rgba(20, 25, 32, .94);--bg-panel-solid: #161c24;--bg-card: #1d242e;--border-steel: #303a47;--border-brass: #b8944f;--text-main: #e6e2d5;--text-muted: #98a3b3;--brass: #d4ae5e;--blue-faction: #6ea6df;--red-faction: #df6e6e;--green-ok: #4ade80;--orange-hp: #f59e0b;--danger: #e05252}*{box-sizing:border-box;user-select:none}html,body,#root{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:var(--bg-deep);color:var(--text-main);font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:13px}.app-shell{position:relative;width:100vw;height:100vh;overflow:hidden}.map-canvas-container{position:absolute;inset:0;width:100%;height:100%;cursor:grab}.map-canvas-container:active{cursor:grabbing}.top-bar{position:absolute;top:0;left:0;right:0;height:52px;background:linear-gradient(180deg,#12171efa,#0e1218f0);border-bottom:1px solid var(--border-steel);box-shadow:0 4px 16px #00000073;display:flex;align-items:center;justify-content:space-between;padding:0 12px;z-index:20;gap:10px}.top-bar-left,.top-bar-right{display:flex;align-items:center;gap:10px}.faction-badge{display:flex;align-items:center;gap:8px;padding-right:12px;border-right:1px solid var(--border-steel)}.faction-title{font-family:Georgia,Times New Roman,serif;font-weight:700;font-size:13px;letter-spacing:.06em;color:var(--brass)}.faction-sub{font-size:11px;color:var(--text-muted)}.brass-icon{color:var(--brass)}.muted-icon{color:var(--text-muted)}.stat-group{display:flex;align-items:center;gap:6px}.stat-pill{display:flex;align-items:center;gap:5px;background:var(--bg-card);border:1px solid var(--border-steel);border-radius:4px;padding:4px 8px;font-size:12px}.stat-pill.stat-warn{border-color:var(--orange-hp)}.stat-label{font-size:10px;font-weight:700;color:var(--text-muted);letter-spacing:.05em}.stat-value{font-weight:700;font-variant-numeric:tabular-nums}.stat-value.blue{color:var(--blue-faction)}.stat-value.red{color:var(--red-faction)}.stat-value.gold{color:var(--brass)}.stat-sep,.stat-muted{color:var(--text-muted);font-size:11px}.alert-pill{display:flex;align-items:center;gap:5px;padding:4px 9px;border-radius:4px;font-size:11px;font-weight:700;letter-spacing:.04em;animation:pulse-alert 1.8s infinite}.alert-pill.danger{background:#b9262647;border:1px solid #ef4444;color:#fca5a5}.alert-pill.success{background:#228b4e47;border:1px solid #4ade80;color:#bbf7d0}@keyframes pulse-alert{0%,to{opacity:1}50%{opacity:.65}}.clock-box{display:flex;flex-direction:column;align-items:flex-end;padding:2px 8px;background:var(--bg-card);border:1px solid var(--border-steel);border-radius:4px;min-width:118px}.clock-date{font-weight:700;font-size:12px;color:var(--text-main)}.clock-hour{font-size:10px;color:var(--brass);font-variant-numeric:tabular-nums}.speed-controls{display:flex;align-items:center;gap:4px}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;background:var(--bg-card);border:1px solid var(--border-steel);border-radius:4px;color:var(--text-main);cursor:pointer;transition:background .12s,border-color .12s}.icon-btn:hover{background:#273140;border-color:var(--brass)}.icon-btn.active-warn{background:#d9770640;border-color:#f59e0b;color:#fcd34d}.icon-btn.active-ok{background:#22c55e33;border-color:#4ade80;color:#86efac}.speed-pips{display:flex;align-items:center;gap:3px;background:var(--bg-card);border:1px solid var(--border-steel);border-radius:4px;padding:3px 6px}.speed-pip{width:20px;height:22px;border:1px solid #333e4d;background:#12171e;color:var(--text-muted);border-radius:2px;font-size:11px;font-weight:700;cursor:pointer}.speed-pip.on{background:var(--border-brass);border-color:var(--brass);color:#11151b}.inspector-panel{position:absolute;top:62px;left:12px;width:300px;max-height:calc(100vh - 180px);display:flex;flex-direction:column;gap:8px;z-index:15;pointer-events:auto}.panel-section{background:var(--bg-panel);border:1px solid var(--border-steel);border-left:3px solid var(--border-brass);border-radius:4px;padding:10px 12px;box-shadow:0 6px 20px #00000080}.panel-title-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.panel-title{font-family:Georgia,serif;font-size:15px;font-weight:700;color:var(--text-main)}.panel-subtitle{display:flex;align-items:center;gap:5px;font-size:11px;font-weight:700;letter-spacing:.05em;color:var(--brass)}.panel-owner{font-size:11px;font-weight:600}.vp-badge{background:#d4ae5e29;border:1px solid var(--border-brass);color:var(--brass);font-size:11px;font-weight:700;padding:2px 6px;border-radius:3px}.prov-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.prov-kv{background:#0d1117b3;border:1px solid #262f3b;border-radius:3px;padding:5px 7px;display:flex;flex-direction:column;gap:2px}.prov-kv span{font-size:10px;color:var(--text-muted);display:flex;align-items:center;gap:3px}.prov-kv strong{font-size:12px}.text-danger{color:#f87171}.text-ok{color:#4ade80}.text-warn{color:#fbbf24}.inline-alert.danger{margin-top:8px;display:flex;align-items:center;gap:6px;background:#b9262640;border:1px solid #ef4444;color:#fecaca;font-size:11px;padding:5px 8px;border-radius:3px}.mini-action-btn{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;font-size:11px;background:#272f3b;border:1px solid var(--border-steel);color:var(--text-main);border-radius:3px;cursor:pointer}.mini-action-btn:hover{border-color:var(--danger);color:#fca5a5}.div-cards-scroll{display:flex;flex-direction:column;gap:6px;max-height:290px;overflow-y:auto;padding-right:2px}.div-card{background:var(--bg-card);border:1px solid #2b3441;border-radius:3px;padding:7px 8px;cursor:pointer}.div-card:hover{border-color:var(--brass)}.div-card-top{display:flex;align-items:center;gap:6px;margin-bottom:5px}.tpl-tag{font-family:ui-monospace,monospace;font-size:10px;font-weight:700;background:#284666;color:#e6effa;padding:1px 5px;border-radius:2px}.div-card-name{font-weight:600;font-size:12px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.div-card-width{font-size:10px;color:var(--text-muted)}.div-gauges{display:flex;flex-direction:column;gap:3px;margin-bottom:5px}.gauge-row{display:grid;grid-template-columns:28px 1fr 44px;align-items:center;gap:5px;font-size:10px;color:var(--text-muted)}.gauge-track{height:5px;background:#0d1117;border-radius:2px;overflow:hidden}.gauge-fill.org{height:100%;background:var(--green-ok)}.gauge-fill.hp{height:100%;background:var(--orange-hp)}.div-meta-row{display:flex;justify-content:space-between;font-size:10px;color:var(--text-muted)}.div-order-line{margin-top:4px;font-size:11px;color:#86efac;display:flex;align-items:center;gap:4px}.div-order-line.danger{color:#fca5a5;font-weight:700}.event-log{position:absolute;top:62px;right:12px;width:310px;background:var(--bg-panel);border:1px solid var(--border-steel);border-radius:4px;z-index:15;box-shadow:0 6px 20px #00000073}.event-log-header{width:100%;display:flex;align-items:center;justify-content:space-between;padding:7px 10px;background:#1b222c;border:none;border-bottom:1px solid var(--border-steel);color:var(--brass);font-size:11px;font-weight:700;letter-spacing:.05em;cursor:pointer}.event-log-header span{display:flex;align-items:center;gap:6px}.event-log-list{max-height:220px;overflow-y:auto;padding:6px 8px;display:flex;flex-direction:column;gap:5px}.event-item{font-size:11px;line-height:1.35;padding:4px 6px;border-radius:3px;background:#0d1117a6;border-left:2px solid var(--border-steel);cursor:pointer}.event-item.event-encirclement{border-left-color:#ef4444;background:#b9262638}.event-item.event-capture{border-left-color:var(--brass)}.event-item.event-victory{border-left-color:#4ade80;background:#22c55e33}.event-date{color:var(--brass);font-weight:700;margin-right:6px;font-size:10px}.army-bar{position:absolute;bottom:0;left:0;right:0;height:92px;background:linear-gradient(0deg,#0e1218fa,#141921f2);border-top:1px solid var(--border-steel);display:flex;align-items:center;justify-content:space-between;padding:0 14px;gap:14px;z-index:20}.marshal-card{min-width:175px;padding:8px 12px;background:var(--bg-card);border:1px solid var(--border-brass);border-radius:4px}.marshal-title{font-family:Georgia,serif;font-size:12px;font-weight:700;color:var(--brass)}.marshal-sub{font-size:11px;color:var(--text-muted)}.marshal-bonus{margin-top:3px;font-size:11px;color:#86efac;font-weight:600}.armies-list{display:flex;align-items:center;gap:10px;flex:1;justify-content:center}.army-card{width:280px;background:var(--bg-card);border:1px solid var(--border-steel);border-top-width:3px;border-radius:4px;padding:6px 9px}.army-card.selected{box-shadow:0 0 0 1px var(--brass)}.army-card-header{display:flex;align-items:center;justify-content:space-between;cursor:pointer;margin-bottom:6px}.army-name{font-weight:700;font-size:12px}.army-gen{font-size:11px;color:var(--text-muted)}.army-count{color:var(--text-main);font-weight:700}.order-badge{font-size:10px;font-weight:700;padding:2px 6px;border-radius:3px;background:#252e3a;color:var(--text-muted)}.order-badge.order-offensive,.order-badge.order-spearhead{background:#22c55e33;color:#86efac}.order-badge.order-frontline{background:#3b82f638;color:#93c5fd}.army-orders{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.order-btn{display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:4px;font-size:10.5px;font-weight:600;background:#141920;border:1px solid #2e3745;color:var(--text-muted);border-radius:3px;cursor:pointer}.order-btn:hover{color:var(--text-main);border-color:var(--brass)}.order-btn.active{background:#d4ae5e38;border-color:var(--brass);color:var(--brass)}.map-mode-switcher{display:flex;flex-direction:column;align-items:flex-end;gap:5px}.mode-header{display:flex;align-items:center;gap:5px;font-size:10px;font-weight:700;color:var(--brass);letter-spacing:.05em}.mode-buttons{display:flex;gap:5px}.mode-btn{display:inline-flex;align-items:center;gap:4px;padding:5px 9px;background:var(--bg-card);border:1px solid var(--border-steel);color:var(--text-muted);border-radius:4px;font-size:11px;font-weight:600;cursor:pointer}.mode-btn.active,.mode-btn:hover{border-color:var(--brass);color:var(--text-main);background:#26303d}.controls-hint{display:flex;align-items:center;gap:4px;font-size:10px;color:var(--text-muted)}.battle-modal{position:absolute;top:72px;left:50%;transform:translate(-50%);width:640px;max-width:calc(100vw - 32px);background:var(--bg-panel-solid);border:1px solid var(--border-brass);border-radius:5px;box-shadow:0 14px 40px #000000b8;z-index:30;overflow:hidden}.battle-modal-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:#1c232d;border-bottom:1px solid var(--border-steel)}.battle-title{font-family:Georgia,serif;font-size:15px;font-weight:700;color:var(--brass);letter-spacing:.04em}.battle-subtitle{font-size:11px;color:var(--text-muted)}.battle-progress-wrap{padding:10px 14px 6px}.battle-progress-bar{height:10px;display:flex;border-radius:3px;overflow:hidden;border:1px solid #0b0f14}.battle-progress-label{display:flex;justify-content:space-between;font-size:11px;color:var(--text-muted);margin-top:5px}.battle-columns{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:10px 14px 14px}.battle-col{background:#12171e;border:1px solid #262f3b;border-radius:4px;padding:8px 10px}.battle-side-hdr{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:700;padding-bottom:5px;margin-bottom:6px;border-bottom:2px solid}.casualty-tag{margin-left:auto;color:#fca5a5;font-variant-numeric:tabular-nums}.tactic-row{font-size:11px;color:var(--brass);margin-bottom:6px}.modifiers-list{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.mod-chip{font-size:10px;font-weight:600;padding:2px 5px;border-radius:3px}.mod-chip.pos{background:#22c55e2e;color:#86efac}.mod-chip.neg{background:#ef44442e;color:#fca5a5}.mod-neutral{font-size:10px;color:var(--text-muted)}.div-section-title{font-size:10px;font-weight:700;text-transform:uppercase;color:var(--text-muted);margin:6px 0 4px}.battle-div-row{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:4px 5px;background:#1a212b;border-radius:3px;margin-bottom:4px;font-size:11px}.battle-div-row.is-reserve{opacity:.65}.battle-div-name{display:flex;align-items:center;gap:5px;overflow:hidden}.badge-encircled{background:#b91c1c;color:#fff;font-size:9px;font-weight:700;padding:1px 4px;border-radius:2px}.battle-bars{display:flex;flex-direction:column;gap:2px;width:68px}.mini-bar{height:4px;background:#0b0e13;border-radius:1px;overflow:hidden}.mini-bar-fill.org{height:100%;background:var(--green-ok)}.mini-bar-fill.hp{height:100%;background:var(--orange-hp)}.modal-backdrop{position:absolute;inset:0;background:#05080cb8;display:flex;align-items:center;justify-content:center;z-index:40}.help-modal,.victory-modal{width:560px;max-width:calc(100vw - 32px);background:var(--bg-panel-solid);border:1px solid var(--border-brass);border-radius:5px;box-shadow:0 18px 45px #000c;overflow:hidden}.help-content{padding:14px 18px;line-height:1.5}.help-content h4{margin:0 0 6px;color:var(--brass);font-family:Georgia,serif}.help-content ul{margin:0 0 12px;padding-left:18px;color:var(--text-main)}.help-content code{background:#0d1117;border:1px solid var(--border-steel);padding:1px 5px;border-radius:3px;color:var(--brass);font-size:11px}.victory-body{padding:18px;text-align:center}.victory-body p{font-size:14px;margin-bottom:16px}.primary-btn{background:var(--border-brass);color:#11151b;border:none;padding:8px 18px;border-radius:4px;font-weight:700;cursor:pointer}.primary-btn:hover{background:var(--brass)}.loading-screen{display:flex;align-items:center;justify-content:center;width:100vw;height:100vh;font-family:Georgia,serif;color:var(--brass);font-size:18px;letter-spacing:.08em}
