:root{color-scheme:dark;--bg:#081221;--panel:#101e2e;--panel2:#142638;--border:#243347;--text:#edf5f4;--sub:#8b9dab;--muted:#668094;--mint:#80eac4;--gold:#ffd27b;--pink:#f090de;--radius:17px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse 75% 24% at 15% -2%,#12324b 0%,transparent 75%),var(--bg);font:14px/1.46 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif;color:var(--text);-webkit-font-smoothing:antialiased}button,select{font:inherit;color:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,select:focus-visible,input:focus-visible,canvas:focus-visible{outline:2px solid var(--mint);outline-offset:2px}.app{max-width:1120px;margin:auto;padding:0 23px}.topbar{display:flex;align-items:center;justify-content:space-between;min-height:88px;border-bottom:1px solid #263746}.brand{display:flex;align-items:center;gap:12px}.brand-icon{display:grid;place-items:center;width:38px;height:38px;border:1px solid #3d8b82;border-radius:12px;font-size:27px;color:#a3f9d3;background:#163c3f;box-shadow:0 0 28px #40cb9333}.brand-title{font-size:13px;letter-spacing:1.8px;font-weight:850}.brand-title span{color:var(--mint)}.brand-sub{color:#8298a7;font-size:10px;letter-spacing:.45px;margin-top:2px}.right-head{display:flex;align-items:center;gap:14px}.live-pill{font-size:11px;letter-spacing:1.5px;font-weight:800;color:#9bf3ca;background:#153b36;border:1px solid #2b6854;padding:7px 11px;border-radius:999px}.pulse{width:7px;height:7px;background:#82ecc0;display:inline-block;border-radius:50%;margin-right:6px;box-shadow:0 0 0 4px #70eeb11f;animation:pulse 1.8s infinite}@keyframes pulse{50%{opacity:.4}}.icon-btn{width:30px;height:30px;border:1px solid #425467;background:transparent;border-radius:50%;font-weight:bold;color:#9aafbd}.hero{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:29px 0 24px}.eyebrow,.section-label{color:#78dfc0;letter-spacing:2px;font-weight:800;font-size:10px}.point-star{margin-left:3px;color:#f2c47d}.hero h1{font-size:clamp(31px,5vw,50px);line-height:1.13;letter-spacing:-1.65px;margin:10px 0}.green-dot{color:var(--mint)}.hero p{font-size:13px;color:var(--sub);margin:0;max-width:420px}.world-age{flex-shrink:0;text-align:right}.world-age>span{display:block;font-size:10px;color:#758fa0;letter-spacing:1.8px;font-weight:750}.world-age strong{display:block;font-size:21px;letter-spacing:-.5px}.world-age small{color:#a0b4c2;font-size:11px}.panel{background:linear-gradient(155deg,#132335 0%,#0e1b2b 90%);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 10px 36px #00000014}.world-wrap{overflow:hidden}.world-top{padding:14px 17px;display:flex;justify-content:space-between;align-items:center;gap:7px}.title-group{display:flex;align-items:center;gap:8px;min-width:0}.title-group b{font-size:11px;letter-spacing:1.1px;white-space:nowrap}.camera-dot{background:var(--mint);width:7px;height:7px;border-radius:50%;box-shadow:0 0 6px #80eac48c}.minor{font-size:11px;color:#9aacbd;margin-left:9px;white-space:nowrap}.top-actions{display:flex;gap:7px}.top-actions button,.top-actions select{background:#172a3c;border:1px solid #2a4352;border-radius:7px;padding:7px 10px;font-size:11px;font-weight:650}.top-actions select{max-width:102px}.viewport{height:min(50vw,470px);min-height:300px;position:relative;overflow:hidden;background:#142f30;touch-action:none;user-select:none}canvas{width:100%;height:100%;display:block;touch-action:none;cursor:grab}canvas:active{cursor:grabbing}.vignette{pointer-events:none;position:absolute;inset:0;box-shadow:inset 0 0 75px 14px #06132685;z-index:1}.map-legend{position:absolute;bottom:14px;left:16px;z-index:2;background:#0b1a27d9;padding:7px 11px;display:flex;gap:12px;border:1px solid #35505d;border-radius:8px;backdrop-filter:blur(4px)}.map-legend span{display:flex;align-items:center;gap:5px;font-size:10px;color:#c4d5d6}.map-legend i,.species-mark{display:inline-block;width:8px;height:8px;border-radius:50%;box-shadow:0 0 10px currentColor}.zoom-controls{position:absolute;right:13px;top:13px;z-index:3;display:flex;flex-direction:column;align-items:center;gap:5px}.zoom-controls button{background:#0c2033df;border:1px solid #457083;color:#e0f9f0;border-radius:7px;width:32px;height:32px;font-size:20px;font-weight:500;display:grid;place-items:center}.zoom-controls span{font-size:10px;font-weight:800;text-shadow:0 1px 3px #000;color:white}.world-hint{position:absolute;top:14px;left:14px;padding:6px 9px;border-radius:6px;color:#e4f6e7;background:#102b2ab3;border:1px solid #477466;font-size:10px;pointer-events:none}.world-foot{min-height:56px;padding:10px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px}.world-foot strong{font-size:19px;margin-left:6px}.muted-small{color:#8ca2b1;font-size:10px;letter-spacing:1px}.sim-time{font-size:11px;color:#8ca8b4;display:flex;align-items:center;gap:6px;text-align:right}.sun-circle{color:#f9d784;font-size:16px}.away-notice{display:flex;align-items:center;gap:12px;background:#16352f;border:1px solid #3f9276;border-radius:13px;margin-top:12px;padding:11px 14px}.away-notice[hidden],.inspector[hidden]{display:none}.away-notice>span{font-size:24px;color:#c7ef9b}.away-notice div{flex:1}.away-notice strong{font-size:13px}.away-notice p{font-size:11px;color:#acd2c7;margin:2px 0 0}.away-notice button{border:0;background:transparent;font-size:24px;color:#bad8cb}.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:15px 0}.stat{padding:17px 18px}.stat-label{font-size:10px;color:#c3d4da;letter-spacing:1.2px;font-weight:800;display:flex;align-items:center;gap:7px}.stat-count{font-size:31px;font-weight:850;margin:4px 0 0;letter-spacing:-1px}.stat-desc{font-size:11px;color:#839cac}.stat-change{float:right;color:#75dbaa}.stat-change.down{color:#efa3ac}.section{padding:21px;margin-bottom:15px}.section-head{display:flex;justify-content:space-between;gap:10px;align-items:start}.section h2{font-size:21px;letter-spacing:-.5px;margin:5px 0 3px}.section p{font-size:12px;color:#8ba2b1;margin:3px 0}.section-head h2 span{color:#a8dfab;font-size:17px}.gift-credits{color:#a4f2c9;font-size:28px;line-height:1;text-align:center}.gift-credits small{font-size:8px;display:block;letter-spacing:1px;color:#6dae9c}.gift-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:9px;margin-top:19px}.gift{min-width:0;min-height:115px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:9px 4px;border-radius:13px;background:#122a37;border:1px solid #2a4454;transition:background .2s,border .2s,transform .12s}.gift:hover{transform:translateY(-2px);background:#18394b}.gift.selected{outline:2px solid #99edd2;border-color:#7ad9bc}.gift-icon{font-size:28px;width:45px;height:45px;display:grid;place-items:center;border-radius:12px;margin-bottom:6px}.gift-icon.rain{color:#87d1ff;background:#193b56}.gift-icon.food{color:#ffbe9c;background:#553431}.gift-icon.pond{color:#76d8e9;background:#1d4d58}.gift-icon.shelter{color:#f8d18a;background:#59462d}.gift-icon.mutation{color:#cfb1ff;background:#48345d}.gift-icon.immigrate{color:#a2e5ac;background:#244e3b}.gift strong{font-size:11px}.gift small{color:#849eab;font-size:9px;margin-top:3px;text-align:center}.gift-help{border:1px dashed #33536a;border-radius:9px;margin-top:15px;padding:11px 13px;color:#9eb5c2;font-size:11px}.wild-toggle{border-top:1px solid #253e4a;display:flex;align-items:center;gap:12px;margin-top:15px;padding-top:14px;cursor:pointer}.wild-toggle input{position:absolute;opacity:0;pointer-events:none}.toggle-track{width:38px;height:22px;border-radius:20px;background:#34485b;position:relative;flex-shrink:0;transition:background .2s}.toggle-track:before{content:"";position:absolute;width:16px;height:16px;border-radius:50%;background:#d4e6e9;left:3px;top:3px;transition:transform .2s}.wild-toggle input:checked+.toggle-track{background:#32a781}.wild-toggle input:checked+.toggle-track:before{transform:translateX(16px)}.wild-toggle strong{font-size:12px;display:block}.wild-toggle small{font-size:10px;color:#88a5b1;display:block}.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:15px}.two-cols .section{min-height:365px}.tiny-badge{font-size:9px;letter-spacing:1px;color:#7eafa7;border:1px solid #3b625c;border-radius:6px;padding:5px 7px}.chart{height:157px;margin-top:10px}.chart svg{width:100%;height:100%}.chart-legend{display:flex;gap:14px;font-size:10px}.little-metrics{border-top:1px solid #243849;display:flex;justify-content:space-between;gap:5px;margin-top:15px;padding-top:14px;font-size:11px;color:#829aa8}.little-metrics b{color:#dfeeea;margin-left:6px;font-size:14px}.journal{margin-top:13px;max-height:254px;overflow:auto;scrollbar-width:thin}.event{display:grid;grid-template-columns:29px 1fr;gap:9px;border-bottom:1px solid #263849;padding:9px 0}.event:first-child{padding-top:0}.event-icon{width:28px;height:28px;display:grid;place-items:center;border-radius:9px;background:#1c3946;font-size:13px}.event strong{display:block;color:#dce8ea;font-weight:630;font-size:11px}.event small{display:block;color:#718b9d;font-size:10px;margin-top:3px}.text-btn{border:none;background:transparent;color:#8ecbb9;font-size:11px}.dna-icon{font-size:30px;color:#a0e4d1}.gene-bars{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin:20px 0 10px}.gene-row{margin:7px 0 14px}.gene-row .line{display:flex;justify-content:space-between;font-size:11px;color:#afc2c7;margin-bottom:6px}.gene-row .line b{color:#d1eee5}.bar{height:7px;background:#213a4e;border-radius:8px;overflow:hidden}.bar span{height:100%;display:block;border-radius:8px;background:#75e0bc}.footnote{color:#688396!important;font-size:10px!important;line-height:1.55}.saved-dot{color:#80bdac;font-size:10px;white-space:nowrap}.settings-buttons{display:flex;flex-wrap:wrap;gap:9px;margin:17px 0}.action-outline,.action-danger,.primary-btn{border:1px solid #416170;border-radius:9px;background:#193344;padding:10px 14px;font-weight:650;font-size:12px;display:inline-flex;justify-content:center;align-items:center;min-height:39px}.action-outline:hover{background:#254b57}.action-danger{background:#2e2430;color:#f8b5b8;border-color:#5b3445}.action-danger:hover{background:#503343}.file-label{cursor:pointer}.primary-btn{background:#6ddab6;color:#082b26;border-color:#6ddab6;font-weight:850}.inspector{margin:15px 0;padding:17px}.inspector h2{margin:5px 0}.inspect-main{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:8px 0}.inspector .info-line{font-size:12px;color:#b5c7cd}.inspector .info-line strong{color:white}.inspect-genes{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:12px 0}.inspect-genes div{padding:9px;background:#172e3e;border-radius:9px;text-align:center;font-size:9px;color:#91a8b6}.inspect-genes b{display:block;font-size:15px;color:#e4f8ef}.inspector .action-outline{width:100%}footer{text-align:center;padding:23px 0 33px;color:#506779;letter-spacing:1.2px;font-size:9px}footer span{color:#76c2a3}dialog{width:min(450px,calc(100% - 28px));border:1px solid #3a6a69;border-radius:18px;color:#e8f8ed;background:#102536;box-shadow:0 28px 90px #000c;padding:0}dialog::backdrop{background:#050d19cf;backdrop-filter:blur(4px)}.modal-inner{padding:26px}.modal-inner h2{font-size:27px;margin:7px 0 15px}.modal-inner h3{font-size:15px;margin:15px 0 3px}.modal-inner p{color:#abc1cd;font-size:12px}.modal-inner .primary-btn{margin-top:15px;width:100%}.modal-close{float:right;border:none;background:#213b49;font-size:23px;border-radius:7px;width:30px;height:30px}.toast{position:fixed;bottom:calc(22px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%,30px);opacity:0;pointer-events:none;z-index:60;background:#1a3d3a;border:1px solid #509988;color:#e2fff0;border-radius:11px;padding:11px 17px;max-width:calc(100vw - 25px);font-size:12px;box-shadow:0 8px 35px #0009;transition:all .3s}.toast.shown{opacity:1;transform:translate(-50%,0)}
@media(max-width:770px){.app{padding:0 14px}.topbar{min-height:73px}.hero{margin:22px 0}.world-age strong{font-size:17px}.world-top{padding:11px 10px}.minor{display:none}.viewport{height:420px}.gift-grid{grid-template-columns:repeat(3,1fr)}.two-cols{grid-template-columns:1fr}.two-cols .section{min-height:0}.gene-bars{grid-template-columns:1fr;gap:3px}.gene-bars>div{display:grid;grid-template-columns:65px 1fr;column-gap:13px}.gene-bars h3{margin:6px 0}.section{padding:16px}.map-legend{gap:9px}.map-legend span{font-size:9px}}
@media(max-width:430px){.brand-title{font-size:11px;letter-spacing:1px}.brand-sub{font-size:9px}.hero h1{font-size:29px}.hero p{font-size:11px}.hero{gap:7px}.world-age{max-width:95px}.world-age>span{font-size:9px}.world-age small{font-size:9px}.world-top b{font-size:10px}.top-actions button,.top-actions select{font-size:10px;padding:7px 6px}.top-actions select{max-width:85px}.viewport{height:390px;min-height:330px}.cards{gap:7px}.stat{padding:11px 9px}.stat-label{font-size:9px;letter-spacing:0}.stat-count{font-size:26px}.stat-desc{font-size:9px}.stat-change{float:none;display:inline}.map-legend{left:7px;bottom:7px;padding:6px}.world-hint{font-size:9px;left:8px;top:8px}.world-foot{padding:9px}.sim-time{font-size:9px}.little-metrics{font-size:10px}.settings-buttons{flex-direction:column}.gift-grid{gap:7px}.gift{min-height:103px}.gift-icon{height:39px;width:39px;font-size:23px}.inspector .inspect-genes{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important;transition:none!important}}

/* The enhanced living region — larger viewer, autonomous village and optional powers */
.viewport{height:min(62vw,610px);min-height:390px}
.cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.map-legend{flex-wrap:wrap;max-width:calc(100% - 55px)}
.settlement-bar{display:flex;align-items:center;gap:12px;padding:12px 18px;background:linear-gradient(90deg,#193c35,#1a3038);border-top:1px solid #2d574d}
.settle-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:9px;background:#3b6756;color:#ffe0ae;font-size:23px}
.settlement-bar>div{display:flex;flex-direction:column;min-width:0;flex:1}.settlement-bar strong{font-size:12px}.settlement-bar small{font-size:10px;color:#a7c6b6}
.observer-pill{border:1px solid #386c5c;color:#91d9b4;border-radius:999px;padding:5px 8px;font-size:9px;font-weight:800;letter-spacing:1px;white-space:nowrap}
.gifts-panel{padding:0;overflow:hidden}
.gift-disclosure{list-style:none;cursor:pointer;display:flex;flex-direction:column;gap:4px;padding:17px 22px;background:linear-gradient(90deg,#112534,#193344)}
.gift-disclosure::-webkit-details-marker{display:none}.gift-disclosure:after{content:'⌄';position:absolute;right:29px;transform:translateY(9px);font-size:21px;color:#9ac6b7}.gift-disclosure{position:relative;padding-right:48px}
.gifts-panel[open] .gift-disclosure:after{content:'⌃'}
.gift-disclosure span{font-size:10px;letter-spacing:1.7px;color:#77d3ae;font-weight:800}.gift-disclosure strong{font-size:18px}.gift-disclosure small{font-size:11px;color:#a5bac7}
.gift-inner{padding:18px 22px 22px}
.chart-legend{flex-wrap:wrap}
@media(max-width:770px){.viewport{height:500px}.cards{grid-template-columns:repeat(4,minmax(0,1fr))}.map-legend{gap:7px}.gift-inner{padding:14px}}
@media(max-width:520px){.viewport{height:470px;min-height:390px}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.stat{padding:14px 12px}.map-legend{bottom:8px;left:8px;padding:7px;gap:7px 10px}.map-legend span{font-size:10px}.world-hint{max-width:66%;line-height:1.3}.top-actions{gap:4px}.top-actions button,.top-actions select{padding:7px 5px}.settlement-bar{padding:10px}.observer-pill{font-size:8px;padding:4px 6px}.gift-disclosure{padding:15px 40px 15px 14px}.gift-inner{padding:12px}}
