*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}:root{--ui-text: #e0e0e0;--ui-muted: #aeb8cc;--ui-bg-panel: rgba(18, 20, 28, .92);--ui-bg-topbar: rgba(20, 20, 30, .85);--ui-bg-button: rgba(40, 40, 55, .8);--ui-bg-button-hover: rgba(60, 60, 80, .9);--ui-bg-button-active: rgba(80, 120, 200, .5);--ui-border-soft: rgba(255, 255, 255, .12);--ui-focus: rgba(120, 170, 255, .95);--ui-shadow-panel: 0 8px 22px rgba(0, 0, 0, .34);--ui-motion-fast: .14s;--ui-motion-mid: .18s}html,body{width:100%;height:100%;overflow:hidden;background:#000;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;color:#e0e0e0;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}#game-container{position:relative;width:100vw;height:100vh;height:100dvh;overflow:hidden}#game-canvas{position:absolute;top:0;left:0;width:100%;height:100%;display:block;touch-action:none}#ui-overlay{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:10}#ui-overlay>*{pointer-events:auto}#top-bar{position:absolute;top:0;left:0;width:100%;height:40px;background:#14141ed9;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:space-between;padding:env(safe-area-inset-top) 12px 0;border-bottom:1px solid rgba(255,255,255,.08);font-size:16px;z-index:20}#bottom-toolbar{position:absolute;bottom:0;left:0;width:100%;height:68px;background:linear-gradient(180deg,#161b27f2,#0e121ef5);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:flex-start;gap:8px;padding:0 12px env(safe-area-inset-bottom);border-top:1px solid rgba(153,180,230,.28);box-shadow:0 -8px 24px #02081480;z-index:20;overflow-x:auto}#inspect-panel{position:absolute;top:50px;right:10px;width:220px;max-height:300px;background:#14141eeb;backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.1);border-radius:6px;padding:10px;font-size:14px;overflow-y:auto;z-index:25}.inspect-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-weight:600}.inspect-key{background:#ffffff0f;border:1px solid rgba(255,255,255,.1);border-radius:4px;padding:4px 6px;margin-bottom:4px}.inspect-key .stat{color:#e8e8e8}.inspect-details{margin:4px 0}.inspect-details summary{cursor:pointer;font-size:13px;color:#9ab0d8;user-select:none;padding:2px 0}.inspect-details summary:hover{color:#c0d4f0}.hotkey-row{display:flex;justify-content:space-between;gap:8px;padding:2px 0;font-size:13px;color:#c8c8d8}.hotkey-row b{color:#9ab0d8;font-weight:600}#event-log{position:absolute;left:10px;top:50px;width:min(300px,calc(100vw - 20px));max-height:200px;overflow-y:auto;background:#12141cd6;border:1px solid rgba(255,255,255,.1);border-radius:6px;padding:8px;font-size:13px;z-index:24}#event-log .log-toolbar{flex-wrap:wrap}#top-bar.compact{height:32px;font-size:14px}#top-bar.compact .stat{font-size:13px}#top-bar.compact .time-btn{width:24px;height:24px;font-size:14px}.log-toolbar{display:flex;gap:6px;margin-bottom:6px}#event-log .log-toolbar .set-btn{width:auto;margin-bottom:0;padding:4px 8px}.log-hint{flex:1;font-size:12px;color:#9faac0;display:flex;align-items:center}.log-select,.log-input{flex:1;min-width:0;border:1px solid rgba(255,255,255,.12);background:#10121aeb;color:#dce4f2;border-radius:4px;padding:4px 6px;font-size:12px}.log-list{max-height:138px;overflow-y:auto}#kingdom-relations-panel{position:absolute;right:10px;top:50px;width:220px;max-height:220px;overflow-y:auto;background:#12141ce6;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:8px;z-index:24}#management-panel{position:absolute;right:240px;top:50px;width:320px;max-height:260px;overflow-y:auto;background:#12141ceb;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:8px;z-index:24}#ecology-panel{position:absolute;left:320px;top:310px;width:300px;max-height:220px;overflow-y:auto;background:#12141ceb;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:8px;z-index:24}#chronicle-panel:not(.hidden){position:absolute;left:320px;top:50px;width:360px;max-height:380px;overflow:hidden;display:flex;flex-direction:column;background:#12141cf0;border:1px solid rgba(255,255,255,.14);border-radius:8px;padding:10px;box-shadow:0 4px 16px #0006;z-index:25}#chronicle-panel .panel-header{display:flex;justify-content:space-between;align-items:center}.chronicle-btn{padding:3px 8px;border-radius:4px;border:1px solid rgba(255,255,255,.16);background:#2d3446cc;color:#dce4f2;font-size:11px;cursor:pointer;transition:background .15s ease}.chronicle-btn:hover{background:#414e69e6}.chronicle-filter-bar{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}.chronicle-cat-group{display:flex;flex-wrap:wrap;gap:4px}.chronicle-filter-btn{padding:2px 6px;font-size:11px;border-radius:3px;border:1px solid rgba(255,255,255,.1);background:#191e2acc;color:#aeb8cc;cursor:pointer}.chronicle-filter-btn:hover{color:#fff;background:#283246e6}.chronicle-filter-btn.active{background:#3f51b5;color:#fff;border-color:#5c6bc0}.chronicle-select{padding:3px 6px;border-radius:4px;border:1px solid rgba(255,255,255,.12);background:#10121aeb;color:#dce4f2;font-size:12px}.chronicle-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:6px;padding-right:4px}.chronicle-empty{color:#7e8b9b;font-size:12px;text-align:center;padding:20px 0}.chronicle-entry{padding:6px 8px;background:#191c26b3;border:1px solid rgba(255,255,255,.06);border-radius:6px}.chronicle-entry-meta{display:flex;align-items:center;gap:6px;margin-bottom:4px}.chronicle-year{font-size:11px;font-weight:700;color:#ffb74d}.chronicle-tag{font-size:10px;padding:1px 4px;border-radius:3px;font-weight:600}.chronicle-coord-btn{margin-left:auto;font-size:10px;padding:1px 5px;border:1px solid rgba(120,170,255,.3);border-radius:3px;background:#4678dc33;color:#90caf9;cursor:pointer}.chronicle-coord-btn:hover{background:#4678dc66;color:#fff}.chronicle-msg{font-size:12px;color:#cfd8dc;line-height:1.4}.eco-chart{width:100%;height:96px;display:block;margin-bottom:6px}.eco-dot{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:5px;vertical-align:middle}#minimap{position:absolute;right:10px;bottom:84px;width:180px;height:180px;border:1px solid rgba(255,255,255,.2);border-radius:6px;background:#0f121aeb;z-index:24}#overlay-legend{position:absolute;left:10px;top:258px;width:300px;background:#12141ce6;border:1px solid rgba(255,255,255,.1);border-radius:6px;padding:8px;z-index:24}#settings-panel{position:absolute;right:10px;top:280px;width:min(280px,calc(100vw - 20px));max-height:calc(100vh - 364px);overflow-y:auto;background:#12141ceb;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:8px;z-index:24}#debug-panel{position:absolute;left:320px;top:50px;width:260px;max-height:240px;overflow-y:auto;background:#12141ceb;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:8px;z-index:24}.set-title,.dbg-title{font-size:13px;color:#d4dceb;font-weight:600;margin-bottom:6px}.set-btn{width:100%;margin-bottom:6px;border:1px solid rgba(255,255,255,.12);background:#282837cc;color:#dce3f0;border-radius:4px;padding:6px;font-size:13px;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,transform .14s ease}.set-btn:hover{background:#3c3c50e6}.set-btn:active,.time-btn:active,.tool-btn:active{transform:translateY(1px)}.set-btn:focus-visible,.time-btn:focus-visible,.tool-btn:focus-visible,.log-select:focus-visible,.log-input:focus-visible,.set-input:focus-visible{outline:2px solid rgba(120,170,255,.95);outline-offset:1px}.set-slot{border:1px solid rgba(255,255,255,.08);border-radius:4px;padding:6px;margin-bottom:6px}.set-slot-title{font-size:12px;color:#d8e1f0;font-weight:700}.set-slot-info{font-size:12px;color:#aeb8cc;margin:4px 0 6px}.set-row{display:block;font-size:13px;color:#d2dbeb;margin:6px 0}#achievements-panel:not(.hidden){position:absolute;left:320px;top:50px;width:360px;max-height:520px;overflow:hidden;display:flex;flex-direction:column;background:#12141cf0;border:1px solid rgba(255,214,112,.28);border-radius:8px;padding:10px;box-shadow:0 4px 16px #0006;z-index:25}.achievement-summary{color:#f0c878;font-size:12px;margin-bottom:8px}.achievement-list{overflow-y:auto}.achievement-row{padding:7px 8px;margin-bottom:5px;border:1px solid rgba(255,255,255,.08);border-radius:5px;background:#10121a6b}.achievement-row.achievement-done{border-color:#f0c87861;background:#48361857}.achievement-main{display:flex;justify-content:space-between;gap:8px}.achievement-name{color:#e6edf8;font-size:13px;font-weight:700}.achievement-percent{color:#f0c878;font-size:11px}.achievement-desc{color:#aeb8cc;font-size:11px;margin:3px 0 5px}.achievement-progress{height:4px;overflow:hidden;border-radius:3px;background:#ffffff1a}.achievement-progress span{display:block;height:100%;border-radius:inherit;background:#f0c878}.set-law-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:8px}.set-law-group{padding:6px 8px;border:1px solid rgba(255,255,255,.08);border-radius:5px;background:#10121a59}.set-law-group-title{color:#f0c878;font-size:12px;font-weight:700;margin-bottom:4px}.set-law-row{margin:5px 0}@media(max-width:640px){.set-law-groups{grid-template-columns:1fr}}.set-input{width:100%;box-sizing:border-box;border:1px solid rgba(255,255,255,.12);background:#10121ae6;color:#dce4f2;border-radius:4px;padding:5px 6px;margin-bottom:6px;font-size:13px}.tutorial-panel{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:320px;background:#0c0e14f0;border:1px solid rgba(255,255,255,.16);border-radius:8px;padding:12px;z-index:80}.tutorial-title{color:#e3ebf9;font-size:16px;font-weight:700;margin-bottom:8px}.tutorial-line{color:#c9d3e8;font-size:13px;margin-bottom:4px}.dbg-line{font-size:13px;color:#c7d0df;padding:1px 0}.dbg-line.dbg-error{color:#e08a7a;word-break:break-word}.mg-title{font-size:13px;font-weight:600;color:#d4dceb;margin:4px 0}.mg-line{font-size:13px;color:#c7d0df;padding:1px 0}.rel-title{font-size:13px;color:#cfd7e4;margin-bottom:6px;font-weight:600}.rel-row{display:flex;justify-content:space-between;font-size:13px;padding:2px 0}.rel-ally{color:#81d885}.rel-neutral{color:#d3d8e4}.rel-enemy{color:#e78383}.log-entry{color:#d7deea;padding:2px 0;border-bottom:1px dashed rgba(255,255,255,.08)}.log-entry.active{background:#76a0e62e}.log-entry.log-warn{color:#f0cb7a}.log-entry.log-critical{color:#f28f8f}.log-tag{display:inline-block;padding:0 4px;margin-right:4px;border:1px solid rgba(255,255,255,.16);border-radius:3px;color:#c5cfdf;font-size:11px}.legend-title{font-size:13px;color:#d8e1f0;font-weight:700;margin-bottom:6px}.legend-note{font-size:12px;color:#aeb8cc;margin-bottom:6px}#overlay-legend .panel-header{display:flex;align-items:center;justify-content:space-between;gap:8px}#overlay-legend .legend-collapse{cursor:pointer;padding:2px 8px;height:24px;font-size:12px}.legend-body{animation:panel-enter var(--ui-motion-mid) ease}.legend-collapsed .legend-body{display:none}.legend-disabled .legend-row{opacity:.55}.legend-disabled .legend-row:hover{background:transparent}.legend-row{display:flex;align-items:center;gap:6px;font-size:13px;color:#c7d0df;padding:2px 0;cursor:pointer}.legend-row.active{color:#eef4ff}.legend-row:focus-visible,.log-entry:focus-visible{outline:2px solid rgba(120,170,255,.95);outline-offset:1px}.legend-dot{width:10px;height:10px;border-radius:2px;display:inline-block}.legend-name{flex:1}.legend-state{font-size:12px;opacity:.9}.panel-header{font-size:13px;color:#d8e1f0;font-weight:700;margin:-2px -2px 8px;padding:2px 2px 6px;border-bottom:1px solid rgba(255,255,255,.1);cursor:move}.log-list,.set-slot-info,.mg-line,.rel-row,.dbg-line,.stat{user-select:text;-webkit-user-select:text}.hidden{display:none}.panel-draggable{touch-action:pan-x pan-y}.panel-dragging{opacity:.94;cursor:move}.panel-resizable{position:absolute}.panel-resizing{opacity:.96}.panel-resize-handle{position:absolute;right:0;bottom:0;width:14px;height:14px;cursor:nwse-resize;border-right:2px solid rgba(195,214,240,.8);border-bottom:2px solid rgba(195,214,240,.8);border-radius:0 0 6px;background:#789bd22e}.panel-resize-handle:hover{background:#789bd247}.tool-btn{width:48px;height:40px;border:1px solid rgba(255,255,255,.12);border-radius:6px;background:linear-gradient(180deg,#363e54f2,#252c41f2);color:#ccc;font-size:25px;cursor:pointer;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:4px;white-space:nowrap;transition:background .15s,border-color .15s,box-shadow .15s}.tool-btn:hover{background:linear-gradient(180deg,#454f6cf2,#2d364ef2);border-color:#a5c0f38c;box-shadow:0 0 0 1px #789ce040 inset}.tool-btn.active{background:linear-gradient(180deg,#5a85d6b8,#4068b7b8);border-color:#7fadffe0;color:#fff}.tool-btn .label{font-size:12px;margin-top:0;line-height:1}.category-btn{width:62px;height:50px;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:2px 4px;flex:0 0 auto}.category-btn .icon{font-size:19px;line-height:1}.category-btn .label{font-size:12px;color:#d7e0f0;line-height:1}.toolbar-spacer{flex:1 1 auto;min-width:6px}.tool-panel-head{width:100%;margin-bottom:6px}.tool-search{width:100%;border:1px solid rgba(255,255,255,.12);background:#10121aeb;color:#dce4f2;border-radius:4px;padding:4px 6px;font-size:13px}.tool-favorites,.tool-list,.tool-recents{width:100%;display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:6px}.tool-recents{display:flex;flex-wrap:nowrap;overflow-x:auto}.tool-recents .tool-item{flex:0 0 108px;width:108px}.tool-favorites{margin-bottom:4px}.tool-fav-title{width:100%;font-size:12px;color:#c6d1e2}.tool-item{width:100%;min-width:0;height:36px;padding:0 10px;justify-content:flex-start;font-size:18px}.tool-item .label{font-size:13px;color:#e3ebfb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tool-star-wrap{margin-left:auto}.tool-star{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:3px;border:1px solid rgba(255,255,255,.14);color:#8f98a8}.tool-star:hover,.tool-star:focus-visible,.tool-star.active{color:#ffce66;border-color:#ffce66cc;background:#ffce6629}.top-left,.top-center,.top-right{display:flex;align-items:center;gap:10px}.top-center{position:absolute;left:50%;transform:translate(-50%)}.time-btn{width:28px;height:28px;border:1px solid rgba(255,255,255,.12);border-radius:4px;background:#282837cc;color:#aaa;font-size:17px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .14s ease}.time-btn:hover{background:#3c3c50e6;color:#fff}.time-btn.active{background:#5078c880;color:#fff}.time-btn:disabled{opacity:.45;cursor:not-allowed}.stat{font-size:15px;color:#aaa}.stat-value{color:#e0e0e0;font-weight:600}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#ffffff26;border-radius:2px}.tool-category-panel{position:absolute;bottom:74px;left:50%;transform:translate(-50%);width:min(1100px,calc(100vw - 20px));max-height:min(44vh,340px);background:linear-gradient(180deg,#131823f5,#0d121cf5);backdrop-filter:blur(6px);border:1px solid rgba(160,186,236,.3);border-radius:8px;padding:10px;display:flex;flex-wrap:wrap;gap:8px;overflow-y:auto;z-index:22;transition:opacity .18s ease,transform .18s ease}.brush-size{font-size:14px;color:#cfd8ec;min-width:24px}.brush-controls{display:flex;align-items:center;gap:8px;flex:0 0 auto;padding-left:10px;border-left:1px solid rgba(160,186,236,.24)}.brush-label{font-size:13px;color:#d3ddf3}.brush-btn-group{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}.brush-btn{width:auto;min-width:34px;height:30px;padding:0 10px;font-size:13px;border-radius:5px}.trait-selector{position:absolute;left:12px;right:12px;bottom:72px;display:flex;flex-wrap:wrap;gap:6px;padding:8px;background:#131823f5;border:1px solid rgba(160,186,236,.3);border-radius:8px;z-index:21}.trait-selector.hidden{display:none}.trait-select-btn{border:1px solid rgba(160,186,236,.28);border-radius:5px;background:#2d384ec7;color:#dbe6ff;padding:5px 8px;cursor:pointer;font-size:12px}.trait-select-btn:hover,.trait-select-btn.active{border-color:#76a9ff;background:#4168aadb}.kbd-conflict-hint{font-size:11px;color:var(--ui-muted);margin-left:8px;white-space:nowrap}.panel-art{height:32px;border-radius:6px;margin-bottom:8px;border:1px solid rgba(255,255,255,.12);opacity:.9}.panel-art-settings{background:linear-gradient(120deg,#7296ff47,#41548438)}.panel-art-management{background:linear-gradient(120deg,#ffb26038,#8854323d)}.panel-art-relations{background:linear-gradient(120deg,#a0dcff33,#587ab83d)}html,body{color:var(--ui-text)}#top-bar{background:var(--ui-bg-topbar)}#inspect-panel,#event-log,#kingdom-relations-panel,#ecology-panel,#management-panel,#overlay-legend,#settings-panel,#debug-panel,.tutorial-panel{background:var(--ui-bg-panel);border-color:var(--ui-border-soft);box-shadow:var(--ui-shadow-panel);animation:panel-enter var(--ui-motion-mid) ease}.set-btn,.time-btn{border-color:var(--ui-border-soft);background:var(--ui-bg-button);transition:background-color var(--ui-motion-mid) ease,border-color var(--ui-motion-mid) ease,color var(--ui-motion-mid) ease,transform var(--ui-motion-fast) ease,box-shadow var(--ui-motion-mid) ease}.set-btn:hover,.time-btn:hover{background:var(--ui-bg-button-hover)}.time-btn.active{background:var(--ui-bg-button-active)}.set-btn:focus-visible,.time-btn:focus-visible,.tool-btn:focus-visible,.log-select:focus-visible,.log-input:focus-visible,.set-input:focus-visible{outline-color:var(--ui-focus)}.tool-category-panel{animation:panel-enter var(--ui-motion-mid) ease}@keyframes panel-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media(max-width:1024px){#top-bar{height:36px;font-size:14px;padding:0 8px}#bottom-toolbar{justify-content:flex-start;overflow-x:auto;padding:0 8px;gap:6px}.category-btn{width:58px;height:46px}.tool-category-panel{width:calc(100vw - 16px)}.tool-favorites,.tool-list,.tool-recents{grid-template-columns:repeat(auto-fill,minmax(104px,1fr))}#management-panel{right:10px;top:92px;width:min(320px,calc(100vw - 20px));max-height:220px}#settings-panel{width:min(280px,calc(100vw - 20px));top:324px;max-height:calc(100vh - 400px)}#minimap{width:160px;height:160px;bottom:76px}}@media(max-width:768px){#top-bar{height:34px;font-size:13px;gap:6px}.top-left,.top-center,.top-right{gap:6px}.stat{font-size:13px}.top-center{position:static;transform:none;margin-left:auto}#bottom-toolbar{height:60px;gap:5px;padding:0 6px}.toolbar-spacer{min-width:0;width:0;flex:0 0 0}.brush-controls{padding-left:6px;gap:6px}.kbd-conflict-hint{display:none}.brush-btn{min-width:30px;height:28px;padding:0 8px}#event-log,#overlay-legend,#debug-panel,#management-panel,#kingdom-relations-panel,#ecology-panel,#inspect-panel,#settings-panel{left:8px;right:8px;width:auto;max-width:none}#event-log{top:42px;max-height:156px}#overlay-legend{top:206px}#kingdom-relations-panel{top:332px;max-height:160px}#ecology-panel{top:498px;max-height:180px}#management-panel{top:42px;max-height:220px}#settings-panel{top:270px;max-height:calc(100vh - 330px)}#debug-panel{top:42px;max-height:180px}#minimap{right:8px;bottom:60px;width:132px;height:132px}.tool-category-panel{left:8px;right:8px;bottom:58px;transform:none;max-width:none}}.history-ui-root{position:absolute;inset:0;pointer-events:none;font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;z-index:20}.history-ui-root>*{pointer-events:auto}.history-panel{position:absolute;background:var(--ui-bg-panel);border:1px solid var(--ui-border-soft);border-radius:8px;box-shadow:var(--ui-shadow-panel);color:var(--ui-text);padding:10px 12px;font-size:12px;line-height:1.5;overflow:hidden}.history-panel-header{font-size:13px;color:#d8e1f0;font-weight:700;padding-bottom:6px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,.1)}.history-panel-body{display:flex;flex-direction:column;gap:4px}.history-mobile-tabs{display:none}.history-topbar{position:absolute;top:0;left:0;width:100%;height:40px;display:flex;align-items:center;justify-content:space-between;gap:10px;background:#14141ed9;backdrop-filter:blur(4px);border-bottom:1px solid rgba(255,255,255,.08);padding:0 12px;color:var(--ui-text);z-index:20}.history-top-left,.history-top-right{display:flex;align-items:center;gap:8px}.history-top-center{position:absolute;left:50%;transform:translate(-50%);display:flex;align-items:center;gap:8px}.history-title{font-weight:700;color:#d8e1f0;font-size:14px}.history-year{font-family:monospace;font-size:14px;color:#ffd76a;min-width:90px;text-align:center}.history-btn{border:1px solid var(--ui-border-soft);background:var(--ui-bg-button);color:var(--ui-text);border-radius:5px;padding:3px 10px;font-size:12px;cursor:pointer;transition:background-color var(--ui-motion-mid) ease,border-color var(--ui-motion-mid) ease}.history-btn:hover{background:var(--ui-bg-button-hover)}.history-icon-btn{width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:16px}.history-speed-bar{display:flex;gap:4px}.history-speed-btn.active{background:var(--ui-bg-button-active);border-color:var(--ui-focus)}.history-topbar.compact .history-year{min-width:60px;font-size:12px}.history-topbar.compact .history-speed-btn{padding:2px 6px;font-size:11px}.history-settings-panel{position:absolute;top:50px;right:12px;width:240px;z-index:30}.history-pause-banner{position:absolute;top:48px;left:50%;transform:translate(-50%);z-index:40;background:#d64545d9;color:#fff;font-size:12px;padding:5px 14px;border-radius:6px;box-shadow:0 2px 10px #00000059;pointer-events:none;white-space:nowrap}.history-pause-banner.hidden{display:none}.history-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;font-size:13px}.history-row select{background:var(--ui-bg-button);border:1px solid var(--ui-border-soft);border-radius:4px;color:var(--ui-text);padding:3px 6px;font-size:12px;font-family:inherit}.history-row-check{justify-content:flex-start;gap:6px;cursor:pointer}.history-save-title{font-size:12px;opacity:.7;padding:8px 0 2px}.history-save-status{font-size:12px;color:var(--ui-focus);padding:4px 0}.history-save-status.hidden{display:none}.timeline-panel{position:absolute;bottom:20px;left:50%;transform:translate(-50%);width:620px;max-width:calc(100% - 40px)}.timeline-controls{display:flex;align-items:center;gap:8px}.timeline-play-btn.active{background:var(--ui-bg-button-active);border-color:var(--ui-focus)}.timeline-slider-wrap{position:relative;flex:1;height:20px}.timeline-slider{position:absolute;inset:0;width:100%;margin:0;accent-color:var(--ui-focus)}.timeline-markers{position:absolute;top:0;left:0;right:0;height:100%;pointer-events:none}.timeline-marker{position:absolute;top:50%;transform:translate(-50%,-50%);width:8px;height:8px;border-radius:50%;background:#e0a83c;border:1px solid rgba(0,0,0,.4);box-shadow:0 0 4px #e0a83c99}.timeline-year{min-width:70px;text-align:center}.nation-panel{top:60px;right:20px;width:280px}.nation-name{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:700;color:#d8e1f0;margin-bottom:6px}.nation-color-dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex:0 0 auto}.nation-row{display:flex;justify-content:space-between;gap:8px}.nation-row span:first-child{color:var(--ui-muted)}.nation-row span:last-child{text-align:right;color:var(--ui-text)}.event-log-panel{top:60px;left:20px;width:340px;max-height:260px;display:flex;flex-direction:column}.history-event-list{overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:2px}.history-event-filter{display:flex;gap:4px;align-items:center;padding:4px 0}.history-event-search{flex:1;min-width:0;font-size:11px;padding:2px 6px;background:#ffffff0f;border:1px solid rgba(255,255,255,.15);border-radius:4px;color:var(--ui-text)}.history-event-type-select,.history-event-importance-select{font-size:11px;padding:2px 4px;background:#ffffff0f;border:1px solid rgba(255,255,255,.15);border-radius:4px;color:var(--ui-text);max-width:90px}.history-event-row{display:flex;gap:6px;font-size:11px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-event-year{color:var(--ui-muted);font-family:monospace;flex:0 0 auto}.history-event-type{flex:0 0 auto}.history-event-title{color:var(--ui-text);overflow:hidden;text-overflow:ellipsis}.ranking-panel{top:60px;left:380px;width:250px}.history-sort-bar{display:flex;gap:4px;margin-bottom:6px}.history-sort-btn{border:1px solid var(--ui-border-soft);background:var(--ui-bg-button);color:var(--ui-muted);border-radius:4px;padding:2px 8px;font-size:11px;cursor:pointer}.history-sort-btn.active{background:var(--ui-bg-button-active);color:var(--ui-text)}.history-ranking-table{display:flex;flex-direction:column;gap:2px}.history-rank-row{display:flex;gap:8px;font-size:11px}.history-rank-row>span:first-child{width:18px;color:var(--ui-muted);text-align:right}.history-rank-row>span:nth-child(2){flex:1;display:flex;align-items:center;gap:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-rank-row>span:last-child{width:70px;text-align:right;font-family:monospace;color:var(--ui-text)}.history-rank-entry{cursor:pointer;border-radius:3px;padding:1px 2px}.history-rank-entry:hover{background:#ffffff14}.history-rank-head{color:var(--ui-muted);font-weight:600;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:2px}.world-stats-panel{top:60px;left:650px;width:220px}.history-row{display:flex;justify-content:space-between;gap:8px}.history-row span:first-child{color:var(--ui-muted)}.history-row span:last-child{font-family:monospace;color:var(--ui-text);text-align:right}.intervention-panel{bottom:20px;right:20px;width:220px;display:flex;flex-direction:column;gap:6px}.history-intervention-hint{font-size:10px;color:var(--ui-muted)}.history-target-select{background:var(--ui-bg-button);border:1px solid var(--ui-border-soft);color:var(--ui-text);border-radius:5px;padding:3px 6px;font-size:11px;max-width:100%}.history-intervention-status{font-size:11px;color:var(--ui-muted);min-height:16px}.history-intervention-status.error{color:#d64545}.history-intervention-status.success{color:#5cb85c}@media(max-width:768px){.history-topbar{top:0;left:0;right:0;transform:none;justify-content:flex-start;flex-wrap:nowrap;height:40px;padding:0 8px}.history-year{min-width:72px;font-size:12px}.history-speed-btn{padding:2px 6px;font-size:11px}.nation-panel,.event-log-panel,.ranking-panel,.world-stats-panel{left:8px;right:8px;width:auto;max-width:none}.event-log-panel{top:96px;max-height:160px}.nation-panel,.ranking-panel,.world-stats-panel{top:268px}.history-mobile-tabs{display:flex;position:absolute;top:40px;left:8px;right:8px;gap:4px;z-index:21}.history-mobile-tab{flex:1;padding:6px 0;font-size:12px;border:1px solid var(--ui-border-soft);background:#14141ed9;color:var(--ui-muted);border-radius:5px;cursor:pointer;touch-action:manipulation}.history-mobile-tab.active{color:var(--ui-text);background:#283042e6;border-color:var(--ui-accent)}.history-mobile-tab:active{background:#3c465cf2}.event-log-panel.mobile-hidden,.ranking-panel.mobile-hidden,.world-stats-panel.mobile-hidden{display:none}}.launcher-root{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;background:radial-gradient(ellipse at 50% 30%,#1a1f2e,#0d0f16 70%);font-family:Segoe UI,Tahoma,Geneva,Verdana,sans-serif;color:var(--ui-text);padding:16px;overflow-y:auto}.launcher-header{text-align:center;margin-bottom:2px}.launcher-title{font-size:28px;font-weight:800;letter-spacing:1px;color:#e6ecf7;text-shadow:0 0 24px rgba(120,170,255,.35)}.launcher-subtitle{margin-top:4px;font-size:13px;color:var(--ui-muted)}.launcher-mode-cards{display:flex;gap:18px;justify-content:center;flex-wrap:wrap}.launcher-card{width:230px;padding:14px 16px;background:var(--ui-bg-panel);border:1px solid var(--ui-border-soft);border-radius:12px;color:var(--ui-text);cursor:pointer;text-align:left;transition:border-color var(--ui-motion-mid),transform var(--ui-motion-mid),box-shadow var(--ui-motion-mid);font-family:inherit}.launcher-card:hover{border-color:var(--ui-focus);transform:translateY(-2px);box-shadow:var(--ui-shadow-panel)}.launcher-card.active{border-color:var(--ui-focus);background:var(--ui-bg-button-active);box-shadow:0 0 0 1px var(--ui-focus)}.launcher-card-icon{font-size:26px;margin-bottom:6px}.launcher-card-name{font-size:16px;font-weight:700;margin-bottom:4px}.launcher-card-desc{font-size:11px;color:var(--ui-muted);line-height:1.4}.launcher-config{display:flex;flex-direction:column;gap:10px;width:300px;max-width:90vw}.launcher-config-row{display:flex;flex-direction:column;gap:4px}.launcher-config-row.hidden{display:none}.launcher-label{font-size:13px;color:var(--ui-muted)}.launcher-input{padding:9px 12px;background:var(--ui-bg-button);border:1px solid var(--ui-border-soft);border-radius:6px;color:var(--ui-text);font-size:14px;font-family:inherit;outline:none}.launcher-input:focus{border-color:var(--ui-focus)}.launcher-template-select{cursor:pointer}.launcher-size-group{display:flex;gap:8px}.launcher-size-btn{flex:1;padding:9px 0;background:var(--ui-bg-button);border:1px solid var(--ui-border-soft);border-radius:6px;color:var(--ui-text);font-size:13px;cursor:pointer;font-family:inherit;transition:background var(--ui-motion-fast),border-color var(--ui-motion-fast)}.launcher-size-btn:hover{background:var(--ui-bg-button-hover)}.launcher-size-btn.active{background:var(--ui-bg-button-active);border-color:var(--ui-focus)}.launcher-import-row{padding-top:2px}.launcher-import-controls{display:flex;flex-direction:column;gap:6px}.launcher-map-status{font-size:12px;color:var(--ui-warn);min-height:16px}.launcher-map-status.ok{color:var(--ok-color, #6fbf6f)}.launcher-enter-btn{margin-top:2px;padding:10px 44px;background:var(--ui-bg-button-active);border:1px solid var(--ui-focus);border-radius:8px;color:#fff;font-size:15px;font-weight:700;cursor:pointer;font-family:inherit;transition:background var(--ui-motion-mid),transform var(--ui-motion-mid)}.launcher-enter-btn:hover{background:var(--ui-focus);transform:translateY(-1px)}.launcher-history-worlds{margin:10px 0 2px;width:300px;max-width:90vw}.launcher-history-worlds.hidden{display:none}.launcher-worlds-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:8px 12px;background:#1416288c;border:1px solid rgba(255,255,255,.12);border-radius:6px;color:#fff;font-family:inherit;font-size:13px;cursor:pointer;transition:background var(--ui-motion-mid),border-color var(--ui-motion-mid)}.launcher-worlds-toggle:hover{background:#1e223ccc;border-color:var(--ui-focus)}.launcher-worlds-toggle .launcher-label{font-weight:600}.launcher-worlds-caret{font-size:11px;color:var(--ui-text-dim, rgba(255, 255, 255, .45));transition:transform var(--ui-motion-mid)}.launcher-worlds-toggle.open .launcher-worlds-caret{transform:rotate(180deg)}.launcher-worlds-list{max-height:0;overflow:hidden;display:flex;flex-direction:column;gap:4px;opacity:0;transition:max-height var(--ui-motion-mid),opacity var(--ui-motion-mid),margin-top var(--ui-motion-mid)}.launcher-worlds-list.open{max-height:120px;overflow-y:auto;opacity:1;margin-top:6px}.launcher-world-item{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background:#1416288c;border:1px solid rgba(255,255,255,.08);border-radius:6px;cursor:pointer;transition:background var(--ui-motion-mid),border-color var(--ui-motion-mid)}.launcher-world-item:hover{background:#1e223ccc;border-color:var(--ui-focus)}.launcher-world-name{font-weight:600;color:#fff;font-size:13px}.launcher-world-meta{font-size:11px;color:var(--ui-text-dim, rgba(255, 255, 255, .45))}.launcher-world-actions{display:flex;gap:4px}.launcher-world-btn{padding:3px 8px;border:1px solid rgba(255,255,255,.18);border-radius:4px;background:transparent;color:#cfd8e8;font-size:11px;cursor:pointer;font-family:inherit;transition:background var(--ui-motion-mid)}.launcher-world-btn:hover{background:#ffffff1f}.launcher-world-btn.enter{border-color:var(--ui-focus);color:var(--ui-focus)}.launcher-world-btn.danger:hover{background:#dc354559;border-color:var(--ui-warn);color:#fff}.launcher-world-empty{font-size:12px;color:var(--ui-text-dim, rgba(255, 255, 255, .4));padding:8px 4px}.trends-panel{top:60px;right:320px;width:340px;display:flex;flex-direction:column;gap:6px}.trends-toolbar{display:flex;gap:4px;align-items:center}.trends-btn{padding:2px 8px;font-size:11px;white-space:nowrap}.trends-legend{display:flex;flex-wrap:wrap;gap:8px;font-size:11px;color:var(--ui-muted)}.trends-legend-item{display:inline-flex;align-items:center;gap:4px;cursor:default}.trends-legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex:0 0 auto}.trends-canvas{width:100%;height:190px;border:1px solid rgba(255,255,255,.1);border-radius:6px;background:#10121cb8;cursor:crosshair;touch-action:none}.trends-hover{font-size:11px;color:var(--ui-text);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:16px}@media(max-width:768px){.trends-panel{left:8px;right:8px;width:auto;max-width:none;top:268px;height:auto}.trends-canvas{height:160px}}.overlay-panel{top:60px;right:320px;width:180px;display:flex;flex-direction:column;gap:6px}.overlay-mode-bar{display:flex;flex-wrap:wrap;gap:4px}.overlay-mode-btn{padding:2px 7px;font-size:11px;white-space:nowrap}.overlay-mode-btn.active{border-color:var(--accent, #5aa2ff);color:var(--accent, #5aa2ff)}.overlay-legend{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--ui-muted)}.overlay-legend-title{color:var(--ui-text)}.overlay-legend-bar{height:10px;border-radius:3px;border:1px solid rgba(255,255,255,.15)}.overlay-legend-labels{display:flex;justify-content:space-between;color:var(--ui-muted)}.nation-trend-canvas{width:100%;height:150px;border:1px solid rgba(255,255,255,.1);border-radius:6px;background:#10121cb8;cursor:crosshair;touch-action:none;margin-top:6px}.nation-actions{display:flex;gap:6px;margin-top:8px}.nation-locate-btn{font-size:11px}@media(max-width:768px){.overlay-panel{left:8px;right:8px;width:auto;max-width:none;top:268px}.nation-trend-canvas{height:130px}}@media(max-width:720px){#top-bar{height:40px;padding:env(safe-area-inset-top) 4px 0;gap:4px;overflow-x:auto;scrollbar-width:none}#top-bar::-webkit-scrollbar{display:none}.top-left,.top-right,.top-center{gap:4px}.top-center{margin-left:auto}.top-right{flex:0 0 auto}.stat{font-size:12px;white-space:nowrap}.stat-fps{display:none}.time-btn{width:32px;height:32px;font-size:16px;touch-action:manipulation}#top-bar.compact .time-btn{width:30px;height:30px;font-size:15px}#bottom-toolbar{height:56px;padding:0 6px env(safe-area-inset-bottom);gap:5px}.category-btn{width:52px;height:44px;touch-action:manipulation}.category-btn .icon{font-size:18px}.category-btn .label{font-size:11px}.brush-btn{min-width:36px;height:36px;padding:0 8px;font-size:13px;touch-action:manipulation}.brush-label{display:none}.tool-category-panel{left:6px;right:6px;bottom:64px;max-height:min(56vh,380px);padding:8px}.tool-favorites,.tool-list{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}.tool-item{height:44px;font-size:16px;touch-action:manipulation}.tool-item .label{font-size:12px}.tool-search{font-size:14px;padding:6px 8px}#inspect-panel,#event-log,#overlay-legend,#kingdom-relations-panel,#ecology-panel,#management-panel,#settings-panel,#debug-panel{left:6px;right:6px;width:auto;max-width:none}#event-log{top:46px;max-height:120px}#overlay-legend{top:176px}#kingdom-relations-panel{top:46px;max-height:130px}#ecology-panel{top:46px;max-height:150px}#management-panel{top:46px;max-height:180px}#settings-panel{top:236px;max-height:calc(100dvh - 300px)}#debug-panel{top:46px;max-height:140px}.set-btn{min-height:40px;font-size:14px;padding:8px 6px;touch-action:manipulation}.log-list{max-height:100px}#minimap{right:6px;bottom:64px;width:110px;height:110px}.history-topbar{height:42px;padding:env(safe-area-inset-top) 4px 0;gap:4px}.history-topbar.compact{height:38px}.history-top-left,.history-top-right{gap:4px}.history-btn{touch-action:manipulation}.history-icon-btn{width:34px;height:34px;font-size:17px}.history-speed-btn{padding:4px 8px;font-size:12px;min-height:32px}.timeline-panel{bottom:calc(12px + env(safe-area-inset-bottom));left:8px;right:8px;width:auto;max-width:none;transform:none}.nation-panel,.ranking-panel,.world-stats-panel{left:8px;right:8px;width:auto;max-width:none;max-height:130px}.event-log-panel{left:8px;right:8px;width:auto;max-width:none;top:46px;max-height:110px}.nation-panel{top:170px}.ranking-panel{top:300px}.world-stats-panel{top:430px}.intervention-panel{left:8px;right:8px;width:auto;bottom:calc(80px + env(safe-area-inset-bottom))}}@media(max-width:900px){#ui-overlay{--mobile-panel-top: calc(56px + env(safe-area-inset-top)) ;--mobile-panel-bottom: calc(68px + env(safe-area-inset-bottom)) }#top-bar{display:grid;grid-template-columns:max-content max-content minmax(0,1fr);justify-content:initial;height:calc(48px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 6px 0;gap:6px;overflow:hidden}#top-bar .top-left,#top-bar .top-center,#top-bar .top-right{min-width:0;gap:4px}#top-bar .top-left{min-width:max-content;flex:0 0 auto}#top-bar .top-center{position:static;transform:none;margin:0;min-width:max-content}#top-bar .top-right{overflow-x:auto;overflow-y:hidden;justify-content:flex-start;scrollbar-width:none}#top-bar .top-right::-webkit-scrollbar{display:none}#top-bar .top-right .time-btn{flex:0 0 32px}#inspect-panel,#kingdom-relations-panel,#ecology-panel,#management-panel,#chronicle-panel,#settings-panel,#debug-panel,#scenario-panel,#achievements-panel{left:8px!important;right:8px!important;top:var(--mobile-panel-top)!important;bottom:var(--mobile-panel-bottom)!important;width:auto!important;height:auto!important;max-width:none!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;z-index:45!important}#chronicle-panel:not(.hidden),#achievements-panel:not(.hidden){display:flex;flex-direction:column;overflow:hidden!important}#chronicle-panel .chronicle-list,#achievements-panel .achievement-list{min-height:0;overflow-y:auto}#inspect-panel .panel-header,#kingdom-relations-panel .panel-header,#ecology-panel .panel-header,#management-panel .panel-header,#chronicle-panel .panel-header,#settings-panel .panel-header,#debug-panel .panel-header,#scenario-panel .panel-header,#achievements-panel .panel-header{padding-right:42px;cursor:default}.panel-resize-handle,.mobile-panel-secondary{display:none!important}#overlay-legend{left:8px!important;right:8px!important;top:calc(var(--mobile-panel-top) + 170px)!important;bottom:auto!important;width:auto!important;max-width:none!important;max-height:54px!important;overflow:hidden!important;z-index:24!important}#overlay-legend:not(.legend-collapsed){top:var(--mobile-panel-top)!important;bottom:var(--mobile-panel-bottom)!important;max-height:none!important;overflow-y:auto!important;z-index:45!important}#event-log{left:8px!important;right:8px!important;top:var(--mobile-panel-top)!important;width:auto!important;max-width:none!important;max-height:min(180px,30dvh)!important;z-index:24!important}#minimap{right:8px;bottom:calc(68px + env(safe-area-inset-bottom));width:min(110px,30vw);height:min(110px,30vw)}#bottom-toolbar{height:calc(60px + env(safe-area-inset-bottom));padding:0 6px env(safe-area-inset-bottom)}.tool-category-panel{left:8px!important;right:8px!important;bottom:calc(66px + env(safe-area-inset-bottom))!important;width:auto!important;max-width:none!important;max-height:min(56dvh,380px);transform:none;z-index:42}.trait-selector{left:8px;right:8px;bottom:calc(66px + env(safe-area-inset-bottom));max-height:min(34dvh,220px);overflow-y:auto;z-index:43}#ui-overlay.mobile-panel-open>#event-log,#ui-overlay.mobile-panel-open>#minimap,#ui-overlay.mobile-panel-open>.tool-category-panel,#ui-overlay.mobile-panel-open>.trait-selector,#ui-overlay.mobile-panel-open>#overlay-legend.legend-collapsed{display:none!important}.mobile-panel-close{display:none;position:absolute;top:calc(var(--mobile-panel-top) + 8px);right:16px;width:34px;height:34px;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.24);border-radius:6px;background:#282837f0;color:#eef4ff;font-size:24px;line-height:1;cursor:pointer;z-index:60;touch-action:manipulation}#mobile-panel-close:not(.hidden){display:flex}.tutorial-panel{width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow-y:auto}}#error-banner-host{position:absolute;top:0;left:50%;transform:translate(-50%);z-index:100;display:flex;flex-direction:column;gap:6px;padding:8px;max-width:min(760px,94vw);pointer-events:none}#error-banner-host>*{pointer-events:auto}.error-banner{display:flex;align-items:flex-start;gap:8px;padding:8px 10px;border-radius:6px;border:1px solid;background:var(--ui-bg-panel);box-shadow:var(--ui-shadow-panel);font-size:12px;line-height:1.5;color:var(--ui-text)}.error-banner-fatal{border-color:#d64545d9;background:linear-gradient(#781e1e8c,#12141cf0)}.error-banner-warn{border-color:#e0a83ccc;background:linear-gradient(#78581466,#12141cf0)}.error-banner-text{flex:1;word-break:break-word}.error-banner-count{flex:none;align-self:center;font-variant-numeric:tabular-nums;color:var(--ui-muted)}.error-banner-count[data-count="1"]{display:none}.error-banner-close{flex:none;width:20px;height:20px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--ui-muted);font-size:15px;line-height:1;cursor:pointer;transition:background var(--ui-motion-fast),color var(--ui-motion-fast)}.error-banner-close:hover{background:var(--ui-bg-button-hover);color:var(--ui-text)}.history-speed-current,.history-more-btn,.history-mobile-more,.history-mobile-close{display:none}@media(max-width:900px){.history-ui-root{--history-mobile-top: calc(56px + env(safe-area-inset-top)) ;--history-mobile-nav: calc(52px + env(safe-area-inset-bottom)) ;--history-mobile-dock: 58px}.history-topbar{top:0;left:0;right:0;width:100%;height:calc(48px + env(safe-area-inset-top));display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;align-items:center;gap:6px;padding:env(safe-area-inset-top) 8px 0;z-index:70}.history-top-left,.history-top-right{min-width:0;gap:4px}.history-top-center{position:static;min-width:0;transform:none;justify-content:flex-start;gap:6px}.history-year{min-width:auto;font-size:12px;white-space:nowrap}.history-btn,.history-mobile-more-item,.history-mobile-tab{min-height:44px;touch-action:manipulation}.history-play-btn,.history-speed-current,.history-icon-btn{width:44px;min-width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center}.history-top-right .history-icon-btn:not(.history-more-btn){display:none}.history-top-right .history-icon-btn.history-home-btn,.history-more-btn,.history-speed-current{display:inline-flex}.history-speed-menu{position:static}.history-speed-menu .history-speed-bar{display:none;position:fixed;top:calc(54px + env(safe-area-inset-top));left:8px;right:8px;z-index:100;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:8px;border:1px solid var(--ui-border-soft);border-radius:10px;background:#12141efa;box-shadow:var(--ui-shadow-panel)}.history-speed-menu.open .history-speed-bar{display:grid}.history-speed-btn{min-width:0;min-height:44px;padding:4px 2px}.history-mobile-more{display:none;position:fixed;top:calc(54px + env(safe-area-inset-top));right:8px;width:min(190px,calc(100vw - 16px));z-index:100;flex-direction:column;gap:4px;padding:8px;border:1px solid var(--ui-border-soft);border-radius:10px;background:#12141efa;box-shadow:var(--ui-shadow-panel)}.history-mobile-more.open{display:flex}.history-mobile-more-item{border:1px solid var(--ui-border-soft);border-radius:6px;background:var(--ui-bg-button);color:var(--ui-text);font:inherit;text-align:left;padding:0 12px}.history-panel.mobile-hidden{display:none!important}.history-panel.mobile-active:not(.timeline-panel){display:flex!important;flex-direction:column;position:absolute;left:8px!important;right:8px!important;top:auto!important;bottom:calc(var(--history-mobile-nav) + var(--history-mobile-dock) + 8px)!important;width:auto!important;max-width:none!important;max-height:min(70dvh,calc(100dvh - var(--history-mobile-top) - var(--history-mobile-nav) - var(--history-mobile-dock) - 8px))!important;min-height:0;overflow-x:hidden!important;overflow-y:auto!important;z-index:60!important;border-radius:12px;padding:10px}.history-panel.mobile-active .history-panel-header{position:sticky;top:-10px;z-index:2;flex:0 0 auto;margin:-10px -10px 8px;padding:12px 48px 8px 12px;background:#12141efa}.history-mobile-close{display:flex;position:absolute;top:6px;right:6px;width:36px;height:36px;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.24);border-radius:6px;background:var(--ui-bg-button);color:var(--ui-text);font-size:22px;line-height:1;cursor:pointer}.event-log-panel.mobile-active{max-height:min(38dvh,360px)!important}.event-log-panel.mobile-active .history-event-list{min-height:0;overflow-y:auto}.history-event-filter{flex-wrap:wrap}.history-event-search{flex:1 1 100%;min-height:40px;font-size:14px}.history-event-type-select,.history-event-importance-select,.history-target-select{flex:1 1 0;min-width:0;min-height:40px;font-size:13px}.history-event-row{font-size:12px;line-height:1.5}.trends-panel.mobile-active{max-height:min(62dvh,560px)!important}.trends-canvas{height:min(30dvh,190px);min-height:130px}.trends-toolbar{overflow-x:auto;padding-bottom:2px}.trends-btn{flex:0 0 auto;min-height:44px}.intervention-panel.mobile-active{max-height:min(70dvh,620px)!important}.intervention-panel.mobile-active .history-intervention-hint{font-size:12px}.intervention-panel.mobile-active .history-target-select{width:100%}.intervention-action-group{display:flex;flex-direction:column;gap:5px;margin-top:8px}.intervention-action-group-title{color:var(--ui-muted);font-size:12px;font-weight:700}.intervention-action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.intervention-action-btn{min-width:0;min-height:44px;padding:7px 4px;font-size:13px}.timeline-panel{display:flex!important;position:absolute;left:8px!important;right:8px!important;bottom:calc(var(--history-mobile-nav) + 6px)!important;width:auto!important;max-width:none!important;max-height:var(--history-mobile-dock);transform:none;overflow:hidden;z-index:65!important;padding:6px 8px}.timeline-panel .history-panel-header{display:none}.timeline-controls{min-height:42px;gap:6px}.timeline-play-btn,.timeline-ff-btn{flex:0 0 auto;min-width:44px;min-height:40px;padding:0 8px}.timeline-slider-wrap{min-width:0;height:24px}.timeline-year{min-width:56px;font-size:11px}.history-mobile-tabs{display:flex;position:absolute;top:auto;left:8px;right:8px;bottom:env(safe-area-inset-bottom);gap:4px;z-index:75;padding:4px;border:1px solid var(--ui-border-soft);border-radius:10px;background:#12141ef5}.history-mobile-tab{flex:1 1 0;min-width:0;padding:0 2px;border:1px solid var(--ui-border-soft);border-radius:6px;background:var(--ui-bg-button);color:var(--ui-muted);font:inherit;font-size:12px;white-space:nowrap}.history-mobile-tab.active{border-color:var(--ui-accent);background:var(--ui-bg-button-active);color:var(--ui-text)}#game-container.history-mobile-panel-open #minimap{display:none!important}}@media(max-width:400px){.history-topbar{gap:3px;padding-left:4px;padding-right:4px}.history-mobile-tabs{left:4px;right:4px;gap:2px}.history-mobile-tab{font-size:11px}}
