@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,400,0,0&display=swap');
:root{color-scheme:light;--bg:#f3f5f9;--surface:#fff;--surface-2:#f7f8fc;--line:#e2e6ef;--line-soft:#edf0f5;--text:#202534;--muted:#697386;--blue:#315efb;--blue-soft:#eaf0ff;--health:#12a39a;--food:#e5a126;--cohesion:#8960d8;--order:#e05b76;--knowledge:#3978df;--amber:#c48b28;--shadow:0 5px 22px #25324a0c;--radius:16px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font:400 14px/1.5 "Google Sans",Arial,sans-serif;-webkit-font-smoothing:antialiased}body{padding:0 28px}button{font:inherit;color:inherit}.material-symbols-rounded{font-family:"Material Symbols Rounded";font-weight:normal;font-style:normal;font-size:22px;line-height:1;display:inline-flex;vertical-align:middle;white-space:nowrap;font-feature-settings:"liga";-webkit-font-smoothing:antialiased}
.topbar{min-height:88px;max-width:1900px;margin:auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:22px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:13px;min-width:0}.brand-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:#eaf0ff;color:var(--blue);font-size:26px}.brand strong{display:block;font-size:16px;font-weight:700;letter-spacing:.13em}.brand small{display:block;margin-top:3px;color:var(--muted);font-size:14px;letter-spacing:.045em}.time-center{display:flex;align-items:center;gap:25px}.clock{display:grid;grid-template-columns:25px auto;column-gap:9px;align-items:center;padding-right:24px;border-right:1px solid var(--line)}.clock .material-symbols-rounded{grid-row:span 2;color:var(--blue);font-size:23px}.clock strong{font-size:19px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.2}.clock small{font-size:14px;color:var(--muted)}.calendar{display:flex;align-items:center;gap:10px}.calendar>.material-symbols-rounded{font-size:29px;color:var(--amber)}.calendar>div{display:flex;flex-direction:column;line-height:1.35}.calendar small{font-size:14px;color:var(--muted);letter-spacing:.06em}.calendar strong{font-size:16px;font-weight:600}.calendar span:last-child{font-size:14px;color:var(--amber)}.runstate{justify-self:end;display:flex;align-items:center;gap:9px;color:#2876bd;font-size:14px;white-space:nowrap}.runstate i,.map-live i{width:8px;height:8px;border-radius:50%;background:#2998dc;box-shadow:0 0 0 4px #2998dc18}.runstate.paused{color:var(--muted)}.runstate.paused i{background:#9aa3b2;box-shadow:none}
.dashboard{max-width:1900px;margin:24px auto 34px;display:grid;grid-template-columns:minmax(0,1.72fr) minmax(390px,.88fr);align-items:start;gap:22px}.map-column,.info-column{min-width:0}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:13px;margin-bottom:13px}.section-heading h1,.section-heading h2{display:flex;align-items:center;gap:9px;margin:5px 0 0;font-weight:600;letter-spacing:-.025em}.section-heading h1{font-size:23px}.section-heading h2{font-size:18px}.section-heading h1 .material-symbols-rounded,.section-heading h2 .material-symbols-rounded{color:var(--blue);font-size:24px}.eyebrow{font-size:14px;color:var(--muted);letter-spacing:.09em}.map-live{display:flex;align-items:center;gap:8px;color:#2876bd;font-size:14px;letter-spacing:.06em;white-space:nowrap}
.map-frame{position:relative;overflow:hidden;padding:7px;background:#dcecf3;border:1px solid #c8d8e2;border-radius:var(--radius);box-shadow:var(--shadow)}#map{display:block;width:100%;height:auto;aspect-ratio:1280/880;object-fit:cover;border-radius:11px}.map-chip{position:absolute;top:19px;left:19px;display:flex;align-items:center;gap:9px;max-width:calc(100% - 85px);padding:10px 14px;background:#ffffffed;color:#263247;border:1px solid #fff;border-radius:11px;box-shadow:0 3px 13px #172b2b18;backdrop-filter:blur(8px);font-size:14px;font-weight:600}.map-chip .material-symbols-rounded{font-size:20px;color:#3978b9}.map-chip b{font-size:14px;font-weight:400;color:#68768a;border-left:1px solid #dce2e9;padding-left:9px;white-space:nowrap}.map-compass{position:absolute;right:18px;top:16px;width:40px;height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;border-radius:10px;background:#ffffffed;color:#45546a;box-shadow:0 2px 9px #172b2b18}.map-compass span:first-child{font-size:14px;font-weight:700}.map-compass .material-symbols-rounded{font-size:22px;transform:rotate(-45deg);color:#3978b9}.map-legend{display:flex;align-items:center;gap:17px;flex-wrap:wrap;padding:13px 5px 16px;color:var(--muted);font-size:14px}.map-legend span{display:flex;align-items:center;gap:7px;white-space:nowrap}.map-legend i{width:10px;height:10px;border-radius:3px;display:inline-block}.legend-water{background:#77b6d4}.legend-territory{background:#526fbd}.legend-settlement{background:#d45d54;border:2px solid #fff}.legend-neighbor{background:#9b875d}.legend-explored{background:#4b91c8;opacity:.55}.legend-discovery{background:#247ba0;border:2px solid #fff}
.weather-strip{display:grid;grid-template-columns:auto minmax(0,1fr) auto minmax(130px,.7fr);align-items:center;gap:14px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.weather-symbol{width:47px;height:47px;border-radius:14px;display:grid;place-items:center;background:#fff4dd;color:#d69a25}.weather-symbol .material-symbols-rounded{font-size:30px}.weather-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.weather-copy small,.day-progress small{font-size:14px;color:var(--muted);letter-spacing:.06em}.weather-copy strong{font-size:16px;font-weight:600}.weather-copy span{font-size:14px;color:var(--muted)}.sun-state{display:flex;align-items:center;gap:9px;border-left:1px solid var(--line);padding-left:14px}.sun-state>.material-symbols-rounded{font-size:27px;color:#d69a25}.sun-state div{display:flex;flex-direction:column;gap:2px}.sun-state strong{font-size:15px}.sun-state small{font-size:14px;color:var(--muted)}.day-progress>div{display:flex;justify-content:space-between;gap:8px;margin-bottom:8px}.day-progress b{font-size:14px;color:var(--blue);font-variant-numeric:tabular-nums}.day-progress>i{height:6px;display:block;background:#e9edf4;border-radius:10px;overflow:hidden}.day-progress>i b{display:block;width:0;height:100%;background:var(--blue);border-radius:10px;transition:width .4s}
.info-column{display:flex;flex-direction:column;gap:13px}.population-card,.info-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:17px 19px;box-shadow:var(--shadow)}.population-card{background:linear-gradient(125deg,#edf3ff,#fff 78%);border-color:#dce6fb}.population-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.population-top>div{display:flex;flex-direction:column}.population-top strong{font-size:39px;line-height:1.15;letter-spacing:-.045em;font-weight:600;font-variant-numeric:tabular-nums}.population-top small{font-size:14px;color:var(--muted)}.population-icon{font-size:38px;color:var(--blue);padding:10px;background:#315efb0d;border-radius:14px}.quick-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:15px;padding-top:14px;border-top:1px solid #dce4f2}.quick-stats>div{display:grid;grid-template-columns:22px 1fr;column-gap:6px;align-items:center;min-width:0}.quick-stats .material-symbols-rounded{grid-row:span 3;color:var(--blue);font-size:20px}.quick-stats small{font-size:14px;color:var(--muted)}.quick-stats strong{font-size:17px;font-weight:600;font-variant-numeric:tabular-nums;overflow:hidden;text-overflow:ellipsis}.quick-stats em{font-style:normal;font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.info-card .section-heading{margin-bottom:15px}.meters{display:flex;flex-direction:column;gap:14px}.meter>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:7px}.meter>div:first-child span{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:14px}.meter>div:first-child .material-symbols-rounded{font-size:19px}.meter b{font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}.track{height:8px;background:#edf0f5;border-radius:10px;overflow:hidden}.track i{display:block;width:0;height:100%;border-radius:10px;transition:width .3s}.meter:has(#health-bar) .material-symbols-rounded,.meter:has(#health-bar)>div:first-child b{color:var(--health)}#health-bar{background:var(--health)}.meter:has(#food-bar) .material-symbols-rounded,.meter:has(#food-bar)>div:first-child b{color:var(--food)}#food-bar{background:var(--food)}.meter:has(#cohesion-bar) .material-symbols-rounded,.meter:has(#cohesion-bar)>div:first-child b{color:var(--cohesion)}#cohesion-bar{background:var(--cohesion)}.meter:has(#order-bar) .material-symbols-rounded,.meter:has(#order-bar)>div:first-child b{color:var(--order)}#order-bar{background:var(--order)}.meter:has(#knowledge-bar) .material-symbols-rounded,.meter:has(#knowledge-bar)>div:first-child b{color:var(--knowledge)}#knowledge-bar{background:var(--knowledge)}
.facts{display:flex;flex-direction:column;gap:10px;margin:0}.facts>div{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;font-size:14px}.facts dt{flex:0 0 38%;color:var(--muted)}.facts dd{max-width:62%;margin:0;text-align:right;color:var(--text);font-weight:500;overflow-wrap:anywhere}.social-grid,.record-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.social-grid>div,.record-grid>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:10px 11px;background:var(--surface-2);border:1px solid var(--line-soft);border-radius:11px}.social-grid small,.record-grid small{font-size:14px;color:var(--muted)}.social-grid strong,.record-grid strong{font-size:18px;color:var(--blue);font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.minor-facts{display:flex;flex-direction:column;gap:7px;margin-top:12px;padding-top:11px;border-top:1px solid var(--line);font-size:14px;color:var(--muted)}.minor-facts span{display:flex;justify-content:space-between;gap:12px}.minor-facts b{color:var(--text);font-weight:500;text-align:right}.record-grid strong{font-size:19px}.era-label{font-size:14px;color:var(--amber);letter-spacing:.04em;white-space:nowrap}
.controls{display:flex;gap:7px;flex-wrap:wrap}.controls button{min-height:40px;padding:0 13px;display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#f6f7fa;border:1px solid var(--line);border-radius:10px;color:var(--text);font-size:14px;cursor:pointer;transition:background .15s,border-color .15s}.controls button:hover{background:#eef2fb;border-color:#bdc9e3}.controls .primary{min-width:105px;background:var(--blue);border-color:var(--blue);color:#fff;font-weight:600}.controls .primary:hover{background:#244de0}.controls .primary .material-symbols-rounded{font-size:19px}.controls .speed.selected{background:#eaf0ff;border-color:#9eb4ff;color:#244de0}.note{font-size:14px;color:var(--muted);line-height:1.55;margin:11px 0 14px}.save-line{display:flex;justify-content:space-between;align-items:center;gap:10px;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:14px}.save-actions{display:flex;align-items:center;gap:13px}.save-line button{display:inline-flex;align-items:center;gap:5px;padding:3px;background:none;border:0;color:var(--blue);font-size:14px;font-weight:600;cursor:pointer}.save-line #reset-world{color:var(--muted)}.save-line button .material-symbols-rounded{font-size:18px}
.history-panel{margin-top:19px;padding:18px 19px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.compact{margin-bottom:12px}.muted{font-size:14px;color:var(--muted)}.events{display:flex;flex-direction:column;max-height:420px;overflow:auto}.event{display:grid;grid-template-columns:112px minmax(0,1fr);gap:14px;padding:13px 3px;border-bottom:1px solid var(--line-soft)}.event:last-child{border-bottom:0}.event time{font-size:14px;color:#b27a20;padding-top:2px;white-space:nowrap}.event strong{display:block;margin-bottom:4px;font-size:15px;font-weight:600}.event p{margin:0;color:var(--muted);font-size:14px;line-height:1.55}.event.empty{display:block;padding:15px 3px;color:var(--muted)}
footer{max-width:1900px;min-height:48px;margin:0 auto;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:14px}footer b{margin:0 8px;color:var(--blue)}
@media(max-width:1350px){body{padding:0 18px}.dashboard{grid-template-columns:minmax(0,1.45fr) minmax(350px,.9fr);gap:15px}.population-card,.info-card{padding:15px}.weather-strip{grid-template-columns:auto minmax(0,1fr) auto}.day-progress{grid-column:1/-1}.time-center{gap:15px}.clock{padding-right:15px}}
@media(max-width:980px){.dashboard{grid-template-columns:1fr}.info-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.population-card,.control-card{grid-column:1/-1}.events{max-height:340px}}
@media(max-width:640px){body{padding:0 11px}.topbar{min-height:75px;padding:11px 0;display:flex;flex-wrap:wrap;gap:10px}.brand-icon{width:39px;height:39px}.brand strong{font-size:14px}.brand small{font-size:14px}.time-center{order:3;width:100%;justify-content:space-between;padding-top:9px;border-top:1px solid var(--line)}.clock{gap:6px;padding-right:10px;grid-template-columns:22px auto}.clock strong{font-size:17px}.clock small{font-size:14px}.calendar{gap:7px}.calendar strong{font-size:14px}.calendar small,.calendar span:last-child{font-size:14px}.runstate{font-size:14px}.dashboard{margin-top:15px;gap:14px}.section-heading h1{font-size:20px}.section-heading h2{font-size:17px}.map-live{font-size:14px}.map-frame{padding:5px;border-radius:13px}.map-chip{top:12px;left:12px;gap:6px;padding:7px 9px;font-size:14px}.map-chip b{display:none}.map-compass{right:11px;top:10px;transform:scale(.88);transform-origin:top right}.map-legend{gap:10px;padding:11px 3px 14px}.weather-strip{grid-template-columns:auto minmax(0,1fr) auto;gap:9px;padding:11px}.weather-symbol{width:41px;height:41px}.weather-symbol .material-symbols-rounded{font-size:27px}.weather-copy strong{font-size:15px}.weather-copy small,.weather-copy span,.sun-state small{font-size:14px}.sun-state{gap:6px;padding-left:9px}.sun-state>.material-symbols-rounded{font-size:24px}.day-progress{grid-column:1/-1}.history-panel{padding:14px}.event{grid-template-columns:82px minmax(0,1fr);gap:9px;padding:11px 1px}.info-column{grid-template-columns:1fr;gap:10px}.population-card,.control-card{grid-column:auto}.population-card,.info-card{padding:14px}.population-top strong{font-size:35px}.quick-stats{gap:5px}.quick-stats>div{grid-template-columns:19px 1fr;column-gap:4px}.quick-stats small,.quick-stats em{font-size:14px}.quick-stats strong{font-size:16px}.social-grid,.record-grid{gap:6px}.social-grid>div,.record-grid>div{padding:9px}.save-line{align-items:flex-start;flex-direction:column}.save-actions{width:100%;justify-content:space-between}footer{align-items:flex-start;flex-direction:column;padding:11px 0}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Interactive real-world globe */
.map-mode-controls{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 10px}
.map-mode-controls button{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:9px;padding:8px 13px;font:inherit;cursor:pointer}
.map-mode-controls button.selected{background:#eaf0ff;border-color:#9eb4ff;color:#244de0;font-weight:600}
.map-frame{padding:0!important;overflow:hidden;background:#dcecf3}
#map{width:100%;height:clamp(440px,62vh,760px);min-height:440px;border-radius:var(--radius)}
.map-chip{z-index:2;pointer-events:none}.map-compass{z-index:2}
.maplibregl-ctrl-group{border-radius:10px!important;box-shadow:0 2px 10px #172b2b22!important}
.maplibregl-ctrl-attrib{font-size:11px}
.start-wizard{position:fixed;inset:0;z-index:1000;background:#111827a8;display:grid;place-items:center;padding:20px}
.start-wizard[hidden]{display:none}
.start-panel{width:min(1100px,100%);padding:24px;background:#fff;border-radius:18px;box-shadow:0 22px 80px #0004}
.start-panel h1{margin:5px 0 7px;font-size:25px}.start-panel p{margin:0 0 15px;color:var(--muted)}
#start-map{height:min(62vh,620px);min-height:360px;border-radius:12px;overflow:hidden;background:#dcecf3}
.start-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;padding-top:15px}
#start-coordinates{color:var(--muted);font-variant-numeric:tabular-nums}
#begin-world{border:0;border-radius:10px;padding:12px 18px;background:var(--blue);color:#fff;font:inherit;font-weight:600;cursor:pointer}
#begin-world:disabled{opacity:.4;cursor:not-allowed}
@media(max-width:640px){#map{height:56vh;min-height:380px}.start-wizard{padding:8px}.start-panel{padding:15px}.start-panel h1{font-size:20px}#start-map{height:58vh;min-height:330px}.start-footer{align-items:flex-start;flex-direction:column}.start-footer button{width:100%}}

.language-select{appearance:none;max-width:118px;padding:8px 28px 8px 11px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font:inherit;font-size:13px;cursor:pointer}
.language-select:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
@media(max-width:760px){.topbar{grid-template-columns:1fr auto}.time-center{grid-column:1/-1;grid-row:2;justify-content:center;padding:10px 0}.runstate{grid-column:2;grid-row:1}.language-select{max-width:105px}}

/* MapLibre needs a concrete container height to render reliably. */
#map{height:clamp(460px,58vw,760px);min-height:460px;aspect-ratio:auto}
@media(max-width:760px){#map{height:62vh;min-height:420px}}

.map-view-controls{display:flex;justify-content:flex-end;gap:7px;margin:0 0 9px}
.map-view-controls button{padding:7px 13px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--muted);font:inherit;font-size:13px;cursor:pointer}
.map-view-controls button.selected{background:#eaf0ff;border-color:#9eb4ff;color:#244de0;font-weight:600}
#map,#start-map{position:relative}
#map .cesium-viewer,#start-map .cesium-viewer{width:100%;height:100%;overflow:hidden}
#map .cesium-widget,#start-map .cesium-widget,#map canvas,#start-map canvas{width:100%;height:100%}
.cesium-viewer-toolbar,.cesium-viewer-animationContainer,.cesium-viewer-timelineContainer,.cesium-viewer-fullscreenContainer{display:none!important}
