:root{
  --hud-ink:#132521;
  --hud-panel:#1b3028;
  --hud-recess:#142721;
  --hud-line:#565d46;
  --hud-brass:#c3a46e;
  --hud-gold:#f0cf90;
  --hud-paper:#f5e9ce;
  --hud-muted:#c2cbb5;
  --hud-ease:cubic-bezier(.16,1,.3,1);
}

.game-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
.game-shell .topbar{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:auto;gap:16px;
  min-height:62px;padding:8px max(19px,env(safe-area-inset-right)) 9px max(19px,env(safe-area-inset-left));
  border-color:#a28758;background:linear-gradient(177deg,#253a2f,var(--hud-ink) 76%);
  box-shadow:0 4px 16px #10221ca1;
}
.game-shell .topbar::after{bottom:0;background:linear-gradient(90deg,transparent,#d8bb80b3 31%,#f1cc86 50%,#d8bb80b3 69%,transparent)}
.game-shell .wordmark{
  gap:9px;font-size:clamp(20px,2.06vw,30px);letter-spacing:-.034em;color:#ffebbf;
  text-shadow:0 2px 4px #0a1a14;
}
.game-shell .wordmark img{width:39px;height:39px}
.game-shell .stocks{
  min-width:0;border-color:#56654b;border-radius:5px;
  background:var(--hud-recess);box-shadow:inset 0 4px 6px #0a1c1760;
}
.game-shell .stock{
  gap:6px;min-height:40px;padding:5px 5px 6px;border-color:#374f41;align-self:stretch;
}
.game-shell .stock b{font-size:clamp(14px,1.36vw,20px);line-height:1;color:#fff0ce}
.game-shell .stock small{margin-top:3px;color:#bdc8ac;line-height:1;letter-spacing:.067em}
.game-shell .stock svg{width:19px;height:19px}
.game-shell .stock:first-child svg{color:#f3cc83}
.game-shell .stocks.steam .stock svg{width:16px;height:16px}
.game-shell .top-actions{gap:5px}
.game-shell .top-actions .button{background:linear-gradient(#314435,#21352b);border-color:#726747}
.game-shell .top-actions .button:hover{background:#405342;border-color:#bd9c65}
.game-shell .diamond-open{color:#b8e7df;border-color:#58796d}
.game-shell .top-actions .research-open{gap:5px}
.game-shell .top-actions strong{font-variant-numeric:tabular-nums}

.game-shell .ledger{
  left:max(18px,env(safe-area-inset-left));top:16px;width:274px;
  border-color:#b29561;border-radius:7px;background:#182c24;box-shadow:0 5px 13px #10221782;
}
.game-shell .ledger-heading{
  gap:8px;min-height:50px;padding:7px 8px 7px 10px;
  background:linear-gradient(111deg,#384838,#273d31 68%);border-color:#8f7951;
}
.game-shell .ledger h1{font-size:18px;text-wrap:balance;line-height:1.14}
.game-shell .seal{
  width:36px;height:36px;color:#f5cf8e;border-color:#9f895e;
  background:#20352a;box-shadow:inset 0 0 0 2px #172b21;
}
.game-shell #charter-toggle{width:34px;height:34px;min-width:34px;min-height:34px}
.game-shell #charter-toggle svg{transition:transform .2s var(--hud-ease)}
.game-shell .ledger.expanded .ledger-body{animation:charter-reveal .22s var(--hud-ease)}
.game-shell .ledger:not(.expanded) .mobile-goal{
  padding:8px 11px;color:#f0ddb0;background:#1c3328;line-height:1.25;
}
.game-shell .ledger:not(.expanded)::after{
  content:"";position:absolute;inset:auto 0 0;height:2px;background:#dcb875;pointer-events:none;
  transform:scaleX(var(--charter-progress,0));transform-origin:left;transition:transform .32s var(--hud-ease);
}
.game-shell .step{padding:5px 6px}
.game-shell .step.current{background:#334737;border-color:#816c45}
.game-shell .step.done .step-icon{background:#283e31}
.game-shell .progress{background:#12251e;border-color:#50604c}
.game-shell .progress i{transition:transform .32s var(--hud-ease)}
@keyframes charter-reveal{from{opacity:.3;clip-path:inset(0 0 44%)}to{opacity:1;clip-path:inset(0)}}

.game-shell .map-tools{
  right:max(15px,env(safe-area-inset-right));bottom:37px;gap:6px;z-index:4;
}
.camera-controls{
  display:grid;grid-template-columns:repeat(2,38px);gap:1px;padding:3px;
  background:#172c25;border:1px solid #968058;border-radius:6px;box-shadow:0 4px 12px #11272065;
}
.game-shell .camera-controls .button{
  width:38px;height:35px;min-width:0;min-height:0;border-color:transparent;border-radius:3px;
  background:#243d33;box-shadow:none;color:#e2c792;
}
.game-shell .camera-controls .button:hover,.game-shell .camera-controls .button[aria-pressed=true]{
  background:#3f5240;color:#ffe6a6;border-color:#938053;
}
.game-shell .camera-controls .button:active{background:#142a22}
.office-switchboard{position:relative}
.game-shell .office-switch{
  width:100%;min-height:38px;gap:5px;padding-inline:6px;color:#efd2a0;
  border-color:#9a8054;background:linear-gradient(#32483a,#223a30);font-size:12px;font-weight:700;
}
.office-switch[aria-expanded=true]{background:#4b563e;color:#ffefc1;border-color:#dfb978}
.office-shortcuts{
  position:absolute;right:0;bottom:calc(100% + 8px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;
  width:min(315px,calc(100vw - 32px));padding:7px;background:#172d25;border:1px solid #a98d5b;border-radius:7px;
  max-height:calc(100cqh - 86px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;
  box-shadow:0 5px 12px #10211995;animation:panel-settle .2s var(--hud-ease);transform-origin:bottom right;
}
.game-shell .office-shortcuts .office-shortcut{
  min-height:43px;width:auto;padding:4px 7px;justify-content:flex-start;text-align:left;gap:6px;
  line-height:1.11;font-size:13px;font-weight:700;color:#e8d3aa;background:#263f34;border-color:#556a50;
}
.game-shell .office-shortcuts .office-shortcut:hover{background:#3d543f;border-color:#b89a62}
.office-shortcut svg{width:17px;height:17px;color:#e1bc7b;flex:none}
.game-shell .map-caption{right:max(16px,env(safe-area-inset-right));bottom:13px;letter-spacing:.12em}

.game-shell .map-feedback{left:max(18px,env(safe-area-inset-left));bottom:12px;width:min(426px,calc(100% - 121px))}
.game-shell .map-feedback .inspect,.game-shell .placement-panel{
  background:#193129;border:1px solid #ab905d;border-radius:6px;
  box-shadow:0 5px 12px #10261d88;
}
.game-shell .map-feedback .inspect:not(.hidden),.game-shell .placement-panel:not(.hidden){animation:panel-settle .23s var(--hud-ease)}
.game-shell .inspect h2{color:#f8e4b9;font-size:18px;line-height:1.13}
.game-shell .inspect-header{padding:0 0 6px;border-bottom:1px solid #64714f}
.game-shell .inspect-status{margin-top:6px}
.game-shell .placement-panel .placement-confirm{
  min-width:72px;background:linear-gradient(#f1d395,#d9aa68);border-color:#f7d795;color:#292d21;
  box-shadow:0 2px 5px #10281d65;font-weight:700;
}
.game-shell .placement-panel .placement-confirm:disabled{color:#abb7a3;background:#34493a;border-color:#67795b;box-shadow:none}
.game-shell .map-feedback .toast{
  width:max-content;max-width:100%;padding:6px 10px;color:#f6e4c1;background:#22392e;border-color:#a28654;
  text-wrap:pretty;animation:panel-settle .23s var(--hud-ease);
}
.game-shell .map-feedback .toast.error{background:#57372c;color:#ffe5d2;border-color:#cb926c}

.game-shell .buildbar{
  display:block;padding:0;position:relative;isolation:isolate;border-top:1px solid #997b50;
  background:linear-gradient(172deg,#273a2e,#182c24 35%,#142720);box-shadow:0 -5px 18px #142a21a1;
}
.game-shell .buildbar::before{top:0;background:linear-gradient(90deg,#86714b 0%,#b5a06b 29%,#e0bc78 50%,#b5a06b 71%,#86714b)}
.construction-deck{--construction-card-height:96px;position:relative;max-width:1170px;margin-inline:auto;padding:5px 15px 3px}
.construction-heading{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;
  margin:0 0 4px;min-height:36px;
}
.construction-toggle{
  gap:6px;padding:3px 8px;min-height:34px;font-weight:700;background:linear-gradient(#7c653c,#594b30);
  color:#fff0c6;border-color:#ad915d;text-shadow:0 1px 2px #3b3021;
}
.construction-toggle:hover,.construction-toggle[aria-expanded=false]{background:#685731;border-color:#d1ad70}
.construction-toggle #construction-chevron svg{width:12px;height:12px;transition:transform .2s var(--hud-ease)}
.construction-toggle[aria-expanded=true] #construction-chevron svg{transform:rotate(180deg)}
.construction-tabs{
  display:flex;gap:3px;align-items:stretch;min-width:0;overflow-x:auto;overflow-y:hidden;
  scrollbar-width:none;scrollbar-color:#9b8459 transparent;touch-action:pan-x;
}
.construction-tabs::-webkit-scrollbar{display:none}
.construction-tabs[data-more=true]{mask-image:linear-gradient(to right,#000 calc(100% - 13px),transparent)}
.construction-tab{
  position:relative;display:flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:35px;
  padding:4px 11px 5px;color:var(--hud-muted);background:none;border:1px solid transparent;border-bottom-color:#677053;
  border-radius:4px 4px 1px 1px;white-space:nowrap;font-size:13px;font-weight:600;line-height:1;
  transition:color .15s,border-color .15s,background .15s;
}
.construction-tab svg{width:15px;height:15px;color:#bfa46f}
.construction-tab:hover{background:#344b38;color:#f7dfae}
.construction-tab[aria-pressed=true]{
  color:#ffe9ba;background:linear-gradient(#405340,#2c4436);font-weight:700;border-color:#8b794f;border-bottom-color:#efc780;
}
.construction-tab[aria-pressed=true] svg{color:#f2c985}
.construction-tab:focus-visible,.game-shell .build-card:focus-visible{outline-offset:-3px}
.construction-pages{display:flex;gap:3px}
.construction-pages .button{
  width:30px;height:30px;min-width:0;min-height:0;border-color:#786749;background:#283f34;box-shadow:none;
}
.construction-pages .button:disabled{opacity:.38;cursor:default}
.construction-pages:has(.button:enabled) .button:enabled:hover{border-color:#c39f63;background:#3c513e}
.construction-pages:not(:has(.button:enabled)){visibility:hidden}
.construction-deck:has(.construction-toggle[aria-expanded=false]) .construction-pages{display:none}
.construction-deck:has(.construction-toggle[aria-expanded=false]) .construction-heading{margin-bottom:0}
.construction-shelf:not([hidden]){animation:deck-open .23s var(--hud-ease);transform-origin:bottom}
@keyframes deck-open{from{clip-path:inset(28% 0 0);opacity:.65}to{clip-path:inset(0);opacity:1}}

.game-shell .build-options{
  grid-area:auto;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:clamp(87px,7.15vw,107px);
  justify-content:start;gap:6px;width:100%;min-width:0;height:auto;min-height:0;
  padding:1px 2px 4px;align-items:stretch;overflow-x:auto;overflow-y:hidden;
  scrollbar-width:thin;scrollbar-color:#997c4f #1b3228;overscroll-behavior-x:contain;
}
.game-shell .build-card{
  height:var(--construction-card-height);min-height:var(--construction-card-height);
  padding:3px 4px 6px;gap:3px;border-radius:5px;border-color:#727051;
  background:linear-gradient(165deg,#3a4b3a,#263d32 60%,#1d3229 74%);
}
.game-shell .build-card.is-filtered{display:none}
.game-shell .build-card:hover,.game-shell .build-card.selected{
  border-color:#dcb878;background:linear-gradient(165deg,#4b6244,#38503b 60%,#2b4838 74%);
}
.game-shell .build-card.selected::after{
  content:"";position:absolute;left:21%;right:21%;bottom:0;height:2px;background:#efc582;
}
.game-shell .build-card.locked{background:linear-gradient(#31463a,#23382e 62%);border-color:#606e53}
.game-shell .build-card.locked:hover{border-color:#a49261}
.game-shell .build-art{height:57px;padding:1px 2px 2px}
.game-shell .build-art::before{width:100%;height:85%;top:6%;opacity:.76}
.game-shell .build-art>svg{width:29px;height:29px;color:#f1c581}
.game-shell .build-art img{filter:drop-shadow(0 3px 2px #0a241b82)}
.game-shell .build-card:hover .build-art img{transform:translateY(-1px)}
.game-shell .build-card.selected .build-art img{transform:none}
.game-shell .build-card.locked .build-art img{filter:saturate(.80) brightness(.96) drop-shadow(0 3px 2px #0a241b82)}
.game-shell .build-card:active .build-art img{transform:translateY(1px) scale(.97)}
.game-shell .build-card strong{
  flex:none;max-width:100%;line-height:1.1;font-size:12px;color:#fff0d1;
  white-space:normal;text-wrap:balance;text-overflow:clip;overflow-wrap:anywhere;
}
.game-shell .build-card.locked strong{color:#d4d9c0}
.game-shell .build-card .cost{font-size:10px;column-gap:4px;color:#d7c69e;line-height:1.05}
.game-shell .build-card .key{top:4px;left:4px;background:#1e3328;color:#c2cdb3;border-color:#637357}
.building-cover.cover-unavailable{visibility:hidden}

.office-catalog .catalog-item{grid-template-rows:49px auto auto;padding:5px}
.office-catalog .catalog-item .office-art{width:min(100%,86px);height:100%}
.office-catalog .catalog-item strong{max-width:100%;line-height:1.12;text-wrap:balance}
.office-catalog .catalog-item small{max-width:100%;line-height:1.15;text-wrap:pretty}

.construction-empty{
  min-height:var(--construction-card-height);display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:8px 14px;background:#172e25;border:1px solid #4c624e;border-radius:5px;
  color:#dccfae;font-size:13px;
}
.construction-empty .button{flex:none;padding:4px 9px}
.construction-tooltip{
  position:absolute;z-index:8;bottom:calc(100% + 7px);width:min(254px,calc(100% - 16px));padding:9px 11px;
  border:1px solid #b1955f;border-radius:6px;background:#172d24;color:#eee5ca;
  box-shadow:0 4px 12px #10251b99;pointer-events:none;animation:panel-settle .16s var(--hud-ease);
}
.construction-tooltip strong{display:block;color:#f9ddaa;font:700 16px/1.15 var(--display)}
.construction-tooltip p{margin:4px 0 0;font-size:13px;line-height:1.25}
.construction-tooltip small{display:block;margin-top:4px;color:#f4c38d;font-size:12px}

.command-strip{
  display:grid;grid-template-columns:minmax(0,1fr) max-content minmax(0,1fr);align-items:center;gap:9px;
  padding:4px max(15px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(15px,env(safe-area-inset-left));
  border-top:1px solid #4f624a;background:linear-gradient(#1f372c,#172b23);
}
.game-shell .command-strip .work-tools{grid-area:auto;justify-self:start}
.game-shell .field-tools{display:flex;gap:4px}
.game-shell .command-strip .work-tools .button,.game-shell .command-strip .tool-line .button{
  width:35px;height:32px;min-width:35px;min-height:32px;box-shadow:none;background:#253e33;border-color:#686a4e;
}
.game-shell .command-strip .tool-line .clock-open{width:auto;min-width:64px}
.game-shell .command-strip .button:hover,.game-shell .command-strip .button.selected{background:#41543f;border-color:#ad935d;color:#ffeab4}
.game-shell .command-strip .game-tools{grid-area:auto;justify-self:end}
.session-mark{display:flex;justify-content:center;align-items:center;gap:8px;min-width:0}
.session-build{display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.game-shell .session-mark .save-text{font-size:11px;color:#c5cdb5}
.game-version,.frame-rate{
  color:#d6c39c;font-size:11px;font-variant-numeric:tabular-nums;font-weight:600;line-height:1.1;
}
.game-version{padding-left:8px;border-left:1px solid #686749}
.frame-rate{color:#abd6bc;min-inline-size:6ch;text-align:end}

dialog{
  --dialog-surface:#1c322a;
  color:var(--hud-paper);border-color:#b49862;border-radius:8px;
  background:linear-gradient(135deg,#243b31,var(--dialog-surface) 36%);box-shadow:0 6px 14px #081811b0;
}
dialog[open]{animation:panel-settle .24s var(--hud-ease)}
dialog[open]::backdrop{background:#0d1e18ba;animation:shade-in .21s ease-out}
@keyframes shade-in{from{opacity:0}to{opacity:1}}
@keyframes panel-settle{from{opacity:.25;transform:translateY(7px) scale(.988)}to{opacity:1;transform:translateY(0) scale(1)}}
dialog .dialog-heading{
  padding:0 0 9px;margin:0 0 2px;border-bottom:1px solid #a38c5d;min-width:0;
}
dialog .dialog-heading h2{
  min-width:0;overflow-wrap:anywhere;line-height:1.07;font-size:clamp(23px,2.2vw,29px);color:#fae3b3;
}
dialog .dialog-heading .icon-button{box-shadow:none;border-color:#827552}
dialog :is(.frontier-tabs,.sea-tabs,.district-tabs){
  display:flex;flex-wrap:wrap;gap:5px;padding-bottom:5px;border-color:#596b50;
}
dialog :is(.frontier-tabs,.sea-tabs,.district-tabs) .button{
  min-height:32px;padding:4px 8px;color:#dcc9a2;background:#20382d;border-color:#596b50;box-shadow:none;
}
dialog :is(.frontier-tabs,.sea-tabs,.district-tabs) .button[aria-pressed=true]{
  border-color:#9b8659;border-bottom-color:#ebc684;background:#3b4e3b;color:#ffebbb;
}
dialog :is(.frontier-status,.sea-summary,.research-top,.clock-overview){
  background:#142b22;border-color:#657755;color:#dfd8ba;
}
dialog .office-card{background:#253e33;border-color:#637454}
dialog .gem-wallet{background:#244641;border-color:#71948a}
dialog :is(input,select){accent-color:#e6bd78;caret-color:#f3d7a5}
dialog :is(.frontier-body,.sea-list,.district-list,.research-list,.clock-scroll,.cities-scroll,.settings-scroll){
  scrollbar-width:thin;scrollbar-color:#8d7c53 #1c342b;
}

@media(max-width:1090px){
  .game-shell .topbar{gap:9px;padding-inline:max(12px,env(safe-area-inset-left))}
  .game-shell .stock{gap:4px;padding-inline:2px}
  .game-shell .stock b{font-size:15px}
  .game-shell .stock svg,.game-shell .stocks.steam .stock svg{width:14px;height:14px}
  .game-shell .research-label{display:none}
}
@media(max-width:760px){
  .game-shell .topbar{
    grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;min-height:0;
    gap:5px;padding:5px max(7px,env(safe-area-inset-right)) 6px max(7px,env(safe-area-inset-left));
  }
  .game-shell .wordmark{min-width:0;gap:5px;font-size:clamp(17px,5.1vw,23px)}
  .game-shell .wordmark img{width:30px;height:30px}
  .game-shell .top-actions{gap:4px}
  .game-shell .top-actions .button{height:33px;min-height:33px}
  .game-shell .stocks{border-radius:4px}
  .game-shell .stocks .stock{gap:4px;min-height:32px;padding:3px 1px 4px}
  .game-shell .stock b,.game-shell .stocks.steam .stock:nth-child(6) b{font-size:13px}
  .game-shell .stock small{font-size:9px;letter-spacing:.02em;margin-top:2px}
  .game-shell .stock svg,.game-shell .stocks.steam .stock svg{width:12px;height:12px}

  .game-shell .ledger{top:7px;left:max(7px,env(safe-area-inset-left));width:235px}
  .game-shell .ledger-heading{min-height:45px;padding:5px 6px 5px 8px;gap:6px}
  .game-shell .ledger h1{font-size:16px;text-wrap:wrap}
  .game-shell .seal{width:30px;height:30px}
  .game-shell .seal svg{width:17px;height:17px}
  .game-shell .ledger:not(.expanded) .mobile-goal{padding:5px 8px 6px;font-size:12px}
  .game-shell .map-tools{right:max(6px,env(safe-area-inset-right));bottom:24px;gap:4px}
  .camera-controls{grid-template-columns:repeat(2,40px);padding:2px}
  .game-shell .camera-controls .button{width:40px;height:39px;min-width:0;min-height:0}
  .game-shell .office-switch{min-height:34px;height:34px;line-height:1}
  .game-shell .office-shortcuts .office-shortcut{height:42px;min-height:42px}
  .game-shell .map-caption{display:flex;right:7px;bottom:4px;font-size:11px;letter-spacing:.055em}
  .game-shell .map-feedback{left:max(6px,env(safe-area-inset-left));bottom:7px;width:calc(100% - 104px - env(safe-area-inset-right))}
  .game-shell .inspect h2{font-size:15px}
  .game-shell .inspect-header{padding-bottom:3px}

  .construction-deck{--construction-card-height:84px;padding:4px max(5px,env(safe-area-inset-right)) 2px max(5px,env(safe-area-inset-left))}
  .construction-heading{gap:4px;min-height:33px;margin-bottom:3px}
  .construction-toggle{min-height:33px;min-width:0;padding:3px 5px;gap:3px;font-size:13px}
  .construction-toggle svg{width:14px;height:14px}
  .construction-tab{min-height:33px;padding:3px 7px 4px;font-size:12px;gap:4px}
  .construction-tab svg{width:12px;height:12px}
  .construction-pages .button{width:24px;height:29px}
  .construction-pages .button svg{width:14px;height:14px}
  .game-shell .build-options{gap:5px;grid-auto-columns:76px;padding:1px 1px 3px}
  .game-shell .build-card{gap:2px;padding:2px 3px 4px}
  .game-shell .build-art{height:49px;padding:0 1px 1px}
  .game-shell .build-card strong{font-size:11px}
  .game-shell .build-card .cost{font-size:9px;column-gap:3px}
  .game-shell .build-card .key{display:none}
  .construction-empty{padding:6px 8px;font-size:12px}
  .construction-empty .button{max-width:44%;line-height:1.1}
  .command-strip{gap:4px;padding:3px max(5px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left))}
  .game-shell .field-tools{gap:2px}
  .game-shell .command-strip .work-tools .button,.game-shell .command-strip .tool-line .button{width:32px;height:34px;min-width:32px;min-height:34px}
  .game-shell .command-strip .tool-line .clock-open{min-width:59px}
  .session-mark{flex-direction:column;align-items:center;gap:1px}
  .game-shell .session-mark .save-text{font-size:11px;white-space:nowrap;line-height:1.1}
  .game-version{padding-left:0;border-left:0;font-size:11px}
  dialog .dialog-heading{padding-bottom:6px}
}
@media(max-width:370px){
  .session-build{flex-direction:column;gap:0}
  .frame-rate{text-align:center}
}
@media(max-width:355px){
  .game-shell .stock b,.game-shell .stocks.steam .stock:nth-child(6) b{font-size:12px}
  .game-shell .stock small{font-size:8px}
  .game-shell .topbar{padding-inline:max(5px,env(safe-area-inset-left)) max(5px,env(safe-area-inset-right))}
  .game-shell .wordmark{font-size:15px;gap:3px;letter-spacing:-.04em}
  .game-shell .wordmark img{width:22px;height:22px}
  .game-shell .top-actions .research-open{padding-inline:5px;gap:4px}
  .game-shell .command-strip .work-tools .button,.game-shell .command-strip .tool-line .button{width:28px;min-width:28px}
  .game-shell .command-strip .tool-line .clock-open{min-width:55px}
}
@media(max-height:510px){
  .game-shell .topbar{min-height:48px;padding-block:4px 5px}
  .game-shell .stock{min-height:32px}
  .construction-deck{--construction-card-height:63px}
  .game-shell .build-options{grid-auto-columns:clamp(103px,7.15vw,107px)}
  .game-shell .build-card{padding:2px 3px 4px;gap:2px}
  .game-shell .build-art{height:35px}
  .game-shell .build-card strong{font-size:11px}
  .game-shell .build-card .cost{font-size:9px}
  .game-shell .build-card .cost svg{width:8px;height:8px}
  .game-shell .map-tools{bottom:6px}
  .game-shell .map-caption{display:none}
  .camera-controls{grid-template-columns:repeat(3,33px)}
  .game-shell .camera-controls .button{width:33px;height:31px}
  .game-shell .office-shortcuts{width:min(339px,calc(100vw - 35px));grid-template-columns:repeat(4,minmax(0,1fr))}
  .game-shell .office-shortcuts .office-shortcut{flex-direction:column;gap:2px;text-align:center}
}
@media(prefers-reduced-motion:reduce){
  dialog[open],.office-shortcuts,.construction-shelf:not([hidden]),.construction-tooltip,
  .game-shell .ledger.expanded .ledger-body,.game-shell .map-feedback .toast,
  .game-shell .map-feedback .inspect:not(.hidden),.game-shell .placement-panel:not(.hidden){animation:none}
}

.game-shell .camera-controls .cinematic-switch{
  grid-column:1/-1;width:auto;height:32px;gap:5px;
  font-size:12px;font-weight:700;
}
.cinematic-switch svg{width:15px;height:15px}
.game-shell.is-cinematic{grid-template-rows:minmax(0,1fr)}
.game-shell.is-cinematic > :is(.topbar,.buildbar),
.is-cinematic :is(.ledger,.map-feedback,.map-caption,.pickup-badge,.collection-layer,.parcel-layer,.office-switchboard,#see-through,#recenter),
.is-cinematic .stage::after{display:none}
.is-cinematic .map.placing canvas{cursor:grab}
.is-cinematic .map.placing canvas:active{cursor:grabbing}
.game-shell.is-cinematic .map-tools{
  top:max(10px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));bottom:auto;
}
.is-cinematic .camera-controls{
  display:flex;align-items:center;padding:3px;gap:1px;
  background:#172d25de;border-color:#b7a17a;border-radius:7px;
}
.game-shell.is-cinematic .camera-controls .button{width:37px;height:37px;background:transparent}
.game-shell.is-cinematic .camera-controls .button:hover{background:#405343}
.game-shell.is-cinematic .camera-controls .cinematic-switch{
  width:auto;padding:0 8px;margin-left:2px;color:#fff0cc;border-left:1px solid #b7a17a7a;
}
@media(prefers-reduced-motion:no-preference){
  .game-shell.is-cinematic .map-tools{animation:panel-settle .22s var(--hud-ease)}
}
