:root{color-scheme:dark;--ink:#eaf0e8;--muted:#a9bebf;--navy:#103440;--panel:#123b48;--edge:#ffffff1c;--gold:#e8bc73;--mint:#96d3aa;--red:#f09681;--bottom:calc(76px + env(safe-area-inset-bottom));font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}*{box-sizing:border-box}html,body,#game{width:100%;height:100%;margin:0;overflow:hidden}body{background:#174c5b}button{font:inherit;color:inherit;border:0;cursor:pointer;background:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}button:focus-visible{outline:2px solid var(--gold);outline-offset:-3px}button:disabled{opacity:.4;cursor:default}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}#world{display:block;width:100%;height:100%;touch-action:none;outline:none}.hud{position:absolute;top:0;left:0;right:0;padding:calc(12px + env(safe-area-inset-top)) 16px 10px;background:linear-gradient(180deg,#0b2e3af2 70%,#0b2e3ae8);border-bottom:1px solid var(--edge);z-index:2}.hud-main{display:flex;align-items:center;gap:8px;max-width:1200px;margin:auto}.brand{display:flex;align-items:center;gap:8px;text-align:left;margin-right:auto;padding:0;min-height:44px}.brand>svg{width:28px;height:32px;color:var(--gold)}.brand>span{font-size:15px;font-weight:700;letter-spacing:2px}.brand small{display:block;font-size:8px;letter-spacing:2px;color:var(--muted);font-weight:500;margin-top:2px}.money{text-align:right;min-width:82px;padding:0 8px}.money>span{font-size:20px;font-weight:650;letter-spacing:-.7px}.money small{display:block;font-size:11px;color:var(--mint)}.icon-button{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;background:#ffffff08}.hud-secondary{max-width:1200px;display:flex;justify-content:space-between;margin:8px auto 0;align-items:center;gap:8px}.workforce{display:flex;gap:12px;color:var(--muted);font-size:10px;min-height:32px;padding:0;text-align:left}.workforce b{color:var(--ink);font-size:13px;margin-left:3px}.stock-button{display:flex;gap:7px;font-size:11px;align-items:center;min-height:32px;color:var(--muted);white-space:nowrap}.stock-button svg{width:12px;height:12px}.objective{position:absolute;left:16px;right:16px;top:calc(119px + env(safe-area-inset-top));z-index:1;display:flex;align-items:center;gap:9px;min-height:44px;padding:9px 12px;border:1px solid #d2e6da25;border-radius:12px;background:#103743e6;box-shadow:0 5px 16px #092b3520;max-width:440px;margin:0 auto;font-size:12px;text-align:left}.objective-dot{width:6px;height:6px;background:var(--gold);border-radius:50%;flex-shrink:0}#objective-text{flex:1}#raid-count{color:var(--muted);font-size:11px;white-space:nowrap}.dock{position:absolute;bottom:0;left:0;right:0;display:flex;height:var(--bottom);padding:7px 12px calc(7px + env(safe-area-inset-bottom));gap:8px;background:#0e303bec;border-top:1px solid var(--edge);backdrop-filter:blur(14px);z-index:4}.dock-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:64px;flex:1;color:var(--muted);font-size:10px;border-radius:12px}.dock-button.active{color:var(--gold);background:#e8bc7314}.dock-button:first-child{color:var(--gold)}.time-control{display:grid;grid-template-columns:44px 42px;align-items:center;justify-content:center;min-width:90px;border-left:1px solid var(--edge);padding-left:7px;position:relative;padding-bottom:12px}.time-control button{height:38px;font-size:13px;font-weight:700}.time-control svg{width:20px;height:20px}.time-control small{position:absolute;bottom:2px;left:8px;right:0;text-align:center;font-size:9px;letter-spacing:1.2px;color:var(--muted)}#map-controls{position:absolute;right:12px;top:calc(185px + env(safe-area-inset-top));display:flex;flex-direction:column;background:#123945c7;border:1px solid var(--edge);border-radius:12px;z-index:1;overflow:hidden}#map-controls button{width:42px;height:42px;display:grid;place-items:center;font-size:24px}#map-controls button+button{border-top:1px solid var(--edge)}#map-controls svg{width:19px;height:19px}.drawer{position:absolute;bottom:var(--bottom);left:0;right:0;z-index:3;background:#103743f7;border-top:1px solid #c2d3c739;border-radius:20px 20px 0 0;max-height:56%;overflow:auto;overscroll-behavior:contain;padding:0 16px 18px;box-shadow:0 -10px 50px #08293330}.drawer-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:#103743;z-index:2;min-height:58px;border-bottom:1px solid var(--edge)}h2{font-size:18px;letter-spacing:-.4px;margin:0;font-weight:600}.close{height:44px;width:44px;font-size:26px;color:var(--muted);margin-right:-7px}.tabs{display:flex;gap:5px;overflow:auto;white-space:nowrap;padding:12px 0}.tabs button{font-size:11px;padding:10px 12px;min-height:40px;border-radius:9px;color:var(--muted)}.tabs button.active{background:#e8bc731b;color:var(--gold)}.catalogue{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.build-card{display:flex;text-align:left;align-items:center;gap:7px;min-height:78px;padding:6px;background:#fff5;border:1px solid var(--edge);border-radius:12px;background:#ffffff05}.build-card img{width:52px;height:58px;object-fit:contain}.build-card strong{display:block;font-size:12px;font-weight:600}.cost{font-size:10px;color:var(--gold);display:block;margin-top:3px}.build-card small{font-size:9px;color:var(--muted);display:block;margin-top:3px}.context{position:absolute;bottom:calc(var(--bottom) + 12px);left:12px;right:12px;background:#103743f5;border:1px solid #cbddce30;border-radius:16px;z-index:2;padding:13px 15px;box-shadow:0 8px 25px #082b3540;max-width:440px;margin:auto;max-height:41%;overflow:auto}.context-top{display:flex;align-items:center;gap:10px}.context-top img{width:52px;height:58px;object-fit:contain}.context-top>div{flex:1;min-width:0}.context strong{font-size:15px;display:block;font-weight:600}.context .close{margin:-12px -8px auto 0;flex-shrink:0}.context small,.detail-muted{font-size:11px;color:var(--muted)}.context p{font-size:12px;margin:7px 0}.context .actions{display:flex;gap:8px;margin-top:10px}.actions button,.primary,.secondary,.danger{min-height:44px;border-radius:10px;padding:10px 14px;font-size:12px;font-weight:650}.primary{background:var(--gold);color:#163440}.actions .primary{flex:1}.secondary{background:#ffffff09;border:1px solid var(--edge)}.danger{color:var(--red);background:#f0968112}.negative{color:var(--red)!important}.positive{color:var(--mint)!important}.warning{color:var(--gold);font-size:11px;padding:7px 9px;background:#e8bc7310;border-radius:7px}.need-row{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0 0}.need{font-size:10px;background:#fff7;padding:5px 7px;border-radius:6px;background:#ffffff08;color:var(--muted)}.need.ok{color:var(--mint)}.need.missing{color:var(--red)}.detail-grid{display:grid;grid-template-columns:1fr auto;gap:8px;font-size:12px;padding-top:12px}.detail-grid b{font-weight:500}.divider{height:1px;background:var(--edge);margin:14px 0}.ledger-section{padding:14px 0 0}.ledger-section h3{font-size:11px;letter-spacing:1.3px;font-weight:500;text-transform:uppercase;color:var(--muted);margin:0 0 10px}.work-row{display:grid;grid-template-columns:1fr auto auto auto;gap:14px;font-size:12px;padding:9px 0;border-bottom:1px solid var(--edge);align-items:center}.work-row b{font-weight:600}.work-header{font-size:9px;color:var(--muted)}.stock-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding-top:14px}.stock-item{background:#fff5;padding:10px;border:1px solid var(--edge);border-radius:10px;background:#ffffff04}.stock-item b{display:block;font-size:20px;line-height:1.3;font-weight:550}.stock-item span{font-size:11px;color:var(--muted)}.goal-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--edge);font-size:12px}.goal-row>span{color:var(--gold);width:20px}.goal-row div{flex:1}.goal-row small{display:block;font-size:11px;color:var(--muted);margin-top:3px}.goal-row b{font-size:13px;font-weight:600}.port-status{display:flex;justify-content:space-between;align-items:center;padding:13px 0}.bar{height:5px;background:#ffffff13;border-radius:4px;overflow:hidden;margin-top:7px}.bar span{display:block;height:100%;background:var(--mint)}.trade-line{padding:13px;border:1px solid var(--edge);border-radius:10px;display:flex;align-items:center;gap:12px;margin:10px 0}.trade-line svg{color:var(--gold)}.trade-line div{flex:1}.trade-line strong{font-size:13px}.trade-line small{display:block;font-size:11px;color:var(--muted);margin-top:3px}.trade-line button{min-width:64px;min-height:44px;font-size:11px;border-radius:9px;background:#fff1}.port-actions{display:flex;gap:8px;flex-wrap:wrap}.port-actions button{flex:1}.events{font-size:11px;color:var(--muted);margin:13px 0}.events div{padding:8px 0;border-bottom:1px solid var(--edge);display:flex;gap:14px}.events time{font-size:10px;color:#83a4ab;min-width:35px}#toast{position:absolute;left:16px;right:64px;top:calc(177px + env(safe-area-inset-top));z-index:6;max-width:410px;margin:auto;background:#e7b76d;color:#123643;border-radius:10px;padding:10px 13px;font-size:12px;opacity:0;pointer-events:none;transform:translateY(-8px);transition:opacity .2s,transform .2s}#toast.show{opacity:1;transform:translateY(0)}.modal,.intro{position:absolute;inset:0;z-index:10;background:#092c3bd4;backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;padding:24px}.modal-card{max-width:390px;width:100%;border:1px solid #bfd4c52b;background:#123b48;border-radius:20px;padding:20px;box-shadow:0 25px 100px #051f3355}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.modal-card p{font-size:13px;color:var(--muted);margin:10px 0 18px}.modal-card>.primary,.modal-card>.secondary,.modal-card>.danger{width:100%;display:block;margin-top:9px}.modal-card label{display:flex;align-items:center;justify-content:space-between;min-height:44px;font-size:12px}.modal-card input{accent-color:var(--gold);width:18px;height:18px}.intro{background:linear-gradient(180deg,#092d3b25,#082d3bde);backdrop-filter:blur(1px);align-items:flex-end;padding-bottom:calc(68px + env(safe-area-inset-bottom))}.intro-card{width:100%;max-width:420px}.eyebrow{font-size:9px;letter-spacing:3px;color:var(--gold);margin-bottom:13px}h1{font:500 clamp(44px,14.5vw,60px)/1 Georgia,"Times New Roman",serif;letter-spacing:-3px;margin:0;color:#f5f0db}h1 span{display:block;font:15px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:0;color:#bed2d0;margin-top:16px}.intro-goal{display:flex;gap:18px;margin:34px 0 23px;align-items:center;font-size:11px;color:#d3e2d8}.intro-goal span+span{padding-left:16px;border-left:1px solid #e7ecda30}.intro .primary{width:100%;display:flex;align-items:center;justify-content:space-between;font-size:14px;padding:15px 18px;height:54px}.intro .primary span{font-size:21px}.session-note{text-align:center;color:#96b4b7;font-size:10px;margin-top:14px}.hidden{display:none!important}@media(min-width:720px){.hud{padding:14px 24px 10px}.hud-main{max-width:none}.brand>span{font-size:18px}.brand small{font-size:9px}.hud-secondary{max-width:none}.workforce{font-size:12px;gap:24px}.stock-button{font-size:12px}.objective{top:121px}.dock{left:50%;right:auto;transform:translateX(-50%);width:400px;bottom:16px;border:1px solid var(--edge);border-radius:18px;height:70px;padding:7px 10px}.drawer{width:380px;left:24px;right:auto;bottom:24px;max-height:calc(100% - 200px);border:1px solid #c2d3c739;border-radius:20px}.context{bottom:103px;width:400px}.intro{align-items:center;justify-content:flex-start;padding:100px 9vw}.intro-card{max-width:440px}h1{font-size:78px}.intro-goal{font-size:12px}#map-controls{right:24px;top:170px}}@media(max-width:360px){.hud{padding-left:10px;padding-right:10px}.brand>span{font-size:13px;letter-spacing:1.4px}.brand>svg{width:23px}.workforce{gap:7px;font-size:9px}.stock-button{font-size:10px;gap:4px}.money{min-width:70px;padding:0 2px}.money>span{font-size:18px}.objective{left:10px;right:10px;font-size:11px}.dock{gap:3px;padding-left:6px;padding-right:6px}.dock-button{min-width:57px}.intro-goal{gap:10px;font-size:10px}.intro-goal span+span{padding-left:10px}.drawer{padding-left:12px;padding-right:12px}.build-card{gap:2px}.build-card img{width:42px}.build-card strong{font-size:11px}}
/* Keep every primary touch target at least 44 CSS pixels. */
.money,.workforce,.stock-button{min-height:44px}.tabs button{min-height:44px}#map-controls button{width:44px;height:44px}.time-control button{height:44px}
@media(orientation:landscape) and (max-height:520px){.context{left:auto;right:14px;width:300px;bottom:98px;max-height:calc(100% - 205px)}.drawer{left:14px;bottom:98px;max-height:calc(100% - 210px);width:360px}.objective{left:16px;right:auto;width:350px;margin:0}.intro{padding:24px 8vw;align-items:center}.intro h1{font-size:52px}.intro-goal{margin:18px 0}.intro-card{max-width:400px}}
@media(orientation:landscape) and (max-height:520px){.context[data-mode="building"]>p.detail-muted,.context[data-mode="building"]>small,.context[data-mode="building"]>.divider,.context[data-mode="building"]>.warning{display:none}.context .context-top img{width:40px;height:44px}.context .need-row{margin:4px 0}.context p.negative{font-size:10px;margin:4px 0}.context .actions{margin-top:6px}.context{padding:10px 13px}}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.workforce #highest-class{color:var(--gold)}.stock-item{text-align:left;min-height:70px}.need-row button.need{min-height:44px;padding:6px 9px}.supply-summary{display:flex;align-items:baseline;gap:9px;padding-top:16px}.supply-summary strong{font-size:34px;font-weight:550}.supply-summary span{color:var(--muted);font-size:12px}.supply-summary>b{margin-left:auto;font-size:13px}.diagnostic-row,.recipe-link{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;min-height:56px;padding:11px 0;border-bottom:1px solid var(--edge)}.diagnostic-row strong,.recipe-link span{font-size:12px;font-weight:600}.diagnostic-row small,.recipe-link small{display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:3px}.diagnostic-row b,.recipe-link b{font-size:11px;color:var(--gold);white-space:nowrap;font-weight:500}.panel-label{font-size:11px;font-weight:500;letter-spacing:1px;text-transform:uppercase;color:var(--muted);margin:14px 0 4px}.production-meta{display:flex;gap:12px;flex-wrap:wrap;font-size:10px;color:var(--muted);margin:7px 0}.logistics-meta{display:block;margin:5px 0}.context .logistics-meta+button{min-height:44px;margin-top:4px}.ledger-section+.divider+button{margin-right:6px}.modal-card{max-height:100%;overflow:auto;overscroll-behavior:contain}@media(orientation:landscape) and (max-height:520px){.context .production-meta,.context .logistics-meta,.context .logistics-meta+button{display:none}.context .need-row button.need{min-height:44px;padding:4px 6px}.context{max-height:calc(100% - 185px)}}
.promotion-check{font-size:10px;line-height:1.5;margin:3px 0}
.context .actions{position:sticky;bottom:-13px;background:#103743;padding:8px 0 0;z-index:1}@media(orientation:landscape) and (max-height:520px){.context .actions{bottom:-10px}}
.construction-tools{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}.construction-tools button{flex:1;white-space:nowrap;min-height:44px;padding:8px 10px;font-size:11px}.construction-tools .chosen{color:var(--gold);border-color:#e8bc7366;background:#e8bc7315}
@media(orientation:landscape) and (max-height:520px){.context,.drawer{max-height:calc(100% - 225px - env(safe-area-inset-top))}}
