/* Shared menu appearance: phone, tablet and browser use the same Smooth glass. */
body #game #mapShortcuts > button,
body #game #globalChatToggle,
body #game #applicationsHint,
body #startScreen .start-screen-menu > button {
 background:linear-gradient(155deg,rgba(110,145,137,.42),rgba(21,57,52,.76))!important;
 border:1px solid rgba(237,223,184,.46)!important;
 border-radius:14px!important;
 box-shadow:inset 0 1px rgba(255,255,255,.22),0 4px 14px rgba(5,24,21,.22)!important;
 -webkit-backdrop-filter:blur(14px) saturate(125%);
 backdrop-filter:blur(14px) saturate(125%);
 color:#fff7e4!important;
 text-shadow:0 1px 3px #102a29;
}
body #game nav#dock > button {
 background:rgba(248,243,229,.94)!important; color:#173d30!important; border:1px solid #b8a16b!important; border-image:none; border-radius:14px!important; box-shadow:0 4px 12px #10251e30!important; text-shadow:none; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
}
body #game nav#dock > button.city-dock-button:not([hidden]) {
 background:linear-gradient(150deg,rgba(108,164,199,.55),rgba(22,66,104,.82))!important;
 border-color:rgba(177,213,237,.7)!important;
 color:#fff8e9!important;
}
body #game nav#dock > button > span {
 display:block; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis;
 white-space:nowrap; font:700 clamp(10px,1.2vw,13px)/1.2 system-ui,sans-serif; letter-spacing:0;
}
body #game nav#dock > button { min-height:56px; min-width:78px; padding:6px 10px; }
body #game nav#dock > button :is(img,.smooth-icon,.dock-glyph) { filter:drop-shadow(0 2px 2px #092b2c60); }
body #game nav#dock > button::after { display:none; }
body #game :is(nav#dock > button,#mapShortcuts > button,#globalChatToggle):focus-visible,
body #startScreen .start-screen-menu > button:focus-visible { outline:3px solid #ffe4a0; outline-offset:3px; }
body #game :is(nav#dock > button,#mapShortcuts > button,#globalChatToggle):hover:enabled { filter:brightness(1.13); }
body #game #mapShortcuts[data-expanded="true"] {
 background:rgba(52,77,76,.42); border-color:rgba(224,235,228,.35);
 -webkit-backdrop-filter:blur(18px) saturate(115%); backdrop-filter:blur(18px) saturate(115%);
}
body #game #mapShortcuts > button:not(#quickMenuToggle) { width:46px; height:46px; margin:2px; border-radius:11px!important; }
/* Internal menu tabs remain warm beige, with the same translucent material. */
body #game :is(#sectionTabs,#pauseMenu .settings-tabs,.handset-tabs,.office-tabs,.hotel-tabs,.chat-tabs,.radio-navigation) > button {
 background:linear-gradient(150deg,rgba(255,248,228,.94),rgba(224,211,184,.78));
 color:#173d38; border:1px solid rgba(171,151,110,.65); border-radius:10px;
 -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
}
body #game :is(#sectionTabs,#pauseMenu .settings-tabs,.handset-tabs,.office-tabs,.hotel-tabs,.chat-tabs,.radio-navigation) > button:is(.selected,.primary,.settings-selected,[aria-current="page"]) {
 background:linear-gradient(150deg,rgba(255,253,242,.98),rgba(240,222,177,.92));
 box-shadow:inset 0 2px #c7a56b; color:#173d38;
}
/* Tablet geometry shares the phone's menu model without phone-sized scenes. */
body.phone.tablet #game #hud { grid-template-columns:minmax(180px,240px) minmax(260px,400px) 140px 104px; justify-content:space-between; gap:10px; }
body.phone.tablet #game nav#dock { gap:10px; background:none; border:0; box-shadow:none; padding:0; max-height:28dvh; overflow-y:auto; }
body.phone.tablet #game nav#dock > button:not([hidden]) { width:100px; height:70px!important; min-width:80px; flex:0 0 auto; display:flex!important; flex-direction:column; justify-content:center; align-items:center; gap:4px; box-sizing:border-box; }
body.phone.tablet #game nav#dock > button > :is(i,img,.dock-glyph) { position:static!important; width:30px!important; height:30px!important; min-height:30px; margin:0!important; object-fit:contain; flex:0 0 30px; }
body.phone.tablet #game nav#dock > button > span { position:static!important; line-height:16px!important; min-height:16px; flex:0 0 16px; margin:0; }
body.phone.tablet #game #mainAction { bottom:calc(var(--touch-bottom) + var(--dock-height,70px) + 12px); }
body.phone.tablet #game #questTracker { max-width:min(250px,32vw); bottom:calc(var(--touch-bottom) + var(--dock-height,70px) + 12px); }
body.phone.tablet #game #panel #panelBody { font-size:14px; }
body.phone.tablet #game #panel #panelBody :is(.master-grid,.game-card-grid,.team-grid,.team-clipboard-grid,.office-upgrade-grid,.more-grid) {
 grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; align-items:stretch;
}
body.phone.tablet #game #panel #panelBody .card { min-width:0; }
body.phone.tablet #game #panel #panelBody :is(.master-grid,.game-card-grid,.office-upgrade-grid) > article { display:flex; flex-direction:column; }
body.phone.tablet #game #panel #panelBody :is(.master-grid,.game-card-grid,.office-upgrade-grid) > article > button:last-child { margin-top:auto; }
@media(max-width:1000px) {
 body.phone.tablet #game #hud { grid-template-columns:minmax(140px,1fr) minmax(260px,1.8fr) 104px; }
}
@media(max-width:700px) {
 body.phone.tablet #game #panel #panelBody :is(.master-grid,.game-card-grid,.team-grid,.team-clipboard-grid,.office-upgrade-grid,.more-grid) { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.phone.tablet #game nav#dock > button { width:88px; height:64px!important; }
 body.phone.tablet #game #questTracker { max-width:48vw; }
}
@media(max-width:600px) {
 body.phone.tablet #game #hud { grid-template-columns:minmax(100px,1fr) 100px 104px; }
}
@media(prefers-reduced-transparency:reduce) {
 body #game :is(nav#dock > button,#mapShortcuts > button,#globalChatToggle),body #startScreen .start-screen-menu > button { background:#234c45!important; backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@media(min-width:601px) and (max-width:1000px) {
 body.phone.tablet #game #hud { grid-template-areas:"identity money controls" "week week week"; }
}
body.phone.tablet #game:not(.hank-preview):not(.city-guide-running):has(> #panel:not([hidden])) > :is(#dock,#mapShortcuts,#globalChatToggle,#mainAction) { visibility:hidden; }
/* The scene fills landscape tablets; fitted maps get an atmospheric extension. */
#mapBackdrop { display:none; pointer-events:none; }
body.phone.tablet #game #mapViewport { overflow:hidden; background:#183a35; }
body.phone.tablet #game #mapViewport.tablet-map-fitted #mapBackdrop {
 display:block; position:absolute; inset:-18px; width:calc(100% + 36px); height:calc(100% + 36px);
 filter:blur(14px) brightness(.8); pointer-events:none;
}
/* A single centred navigation cluster, including Logistics. */
body.phone.tablet #game:has(#world[data-scene]) nav#dock {
 left:50%!important; right:auto!important; bottom:var(--touch-bottom)!important;
 transform:translateX(-50%)!important; width:max-content!important;
 max-width:calc(100% - var(--touch-left) - var(--touch-right))!important; min-width:0;
 display:flex!important; justify-content:center!important; align-items:center;
 flex-wrap:wrap; gap:8px; padding:6px!important; border-radius:18px;
 background:none; -webkit-backdrop-filter:none; backdrop-filter:none;
}
body.phone.tablet #game nav#dock > button:not([hidden]) {
 position:relative!important; inset:auto!important; margin:0!important; transform:none!important;
 align-self:auto; order:0; width:clamp(88px,9vw,110px); height:66px!important;
}
body.phone.tablet #game #questTracker {
 right:auto!important; left:var(--touch-left)!important;
 bottom:var(--touch-bottom)!important; width:clamp(180px,21vw,240px); max-width:24vw;
 font-size:12px; padding:10px; border-radius:14px; background:rgba(20,54,48,.82);
 -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
}
body.phone.tablet #game #mapShortcuts { top:calc(var(--hud-bottom,80px) + 12px)!important; right:var(--touch-right)!important; }
@media(max-width:900px) {
 body.phone.tablet #game #questTracker { left:var(--touch-left)!important; bottom:calc(var(--touch-bottom) + var(--dock-height,80px) + 10px)!important; max-width:42vw; width:220px; }
}
@media(orientation:portrait) {
 body.phone.tablet #game #questTracker { max-width:calc(100% - 24px); width:min(260px,60vw); }
 body.phone.tablet #game nav#dock > button:not([hidden]) { width:88px; height:64px!important; }
}
/* One HUD contract in every tablet scene, including mines and interiors. */
body.phone.tablet #game > #hud {
 position:absolute!important; top:var(--touch-top)!important; left:var(--touch-left)!important;
 right:var(--touch-right)!important; bottom:auto!important; transform:none!important;
 z-index:22; min-height:92px; align-items:start;
 display:grid!important; grid-template-columns:minmax(180px,240px) minmax(260px,400px) 140px 104px!important;
 grid-template-areas:"identity money week controls"!important; gap:10px!important; justify-content:space-between;
}
body.phone.tablet #game > #hud #identity { grid-area:identity!important; width:100%!important; align-items:flex-start; }
body.phone.tablet #game > #hud #identity > span { padding-top:4px; }
body.phone.tablet #game > #hud .money {
 grid-area:money!important; height:auto!important; min-height:92px!important; display:grid!important; position:relative!important; padding:0!important;
 inset:auto!important; margin:0!important; transform:none!important;
 grid-template-columns:minmax(0,1fr) 76px 76px!important;
 grid-template-areas:"cash marks gems" "income income income" "depot depot depot" "ore ore ore"!important;
 grid-template-rows:38px 14px 14px 20px!important;
}
body.phone.tablet #game > #hud .cash-counter { grid-area:cash!important; width:100%!important; position:static!important; }
body.phone.tablet #game > #hud :is(.cash-counter,#lindenburgMarksHud,#jewelBalance) { height:38px!important; min-height:38px!important; align-self:start!important; margin:0!important; transform:none!important; }
body.phone.tablet #game > #hud :is(#lindenburgMarksHud,#jewelBalance) { width:76px!important; }
body.phone.tablet #game > #hud .clock { grid-area:week!important; }
body.phone.tablet #game > #hud #hudControls { grid-area:controls!important; }
body.phone.tablet #game > #hud #oreStocks { position:static!important; transform:none!important; }
body.phone.tablet #game > #hud :is(#income,#depotValue) {
 display:block!important; position:static!important; margin:0!important; width:max-content; max-width:100%;
 padding:0 4px; border-radius:4px; background:rgba(15,42,36,.78); color:#fff3d5;
 font:700 11px/14px Arial,sans-serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
body.phone.tablet #game > #hud #income { grid-area:income!important; color:#c3f1cf; }
body.phone.tablet #game > #hud #depotValue { grid-area:depot!important; }
body.phone.tablet #game > #hud :is(#income,#depotValue).loss { color:#ffb7ad; }
body.phone.tablet #game > #hud #oreStocks { width:100%!important; max-width:100%; gap:3px; }
body.phone.tablet #game > #hud #oreStocks > span { min-width:0; height:20px; padding:1px 3px; background:rgba(15,42,36,.78); }
body.phone.tablet #game > #hud #oreStocks b { font-size:11px; }
body.phone.tablet #game:has(nav#dock > button:nth-child(4 of :not([hidden]))) #questTracker {
 bottom:calc(var(--touch-bottom) + var(--dock-height,80px) + 10px)!important;
}
@media(max-width:600px) {
 body.phone.tablet #game > #hud { min-height:126px; }
 body.phone.tablet #game > #hud .money { min-height:74px; }
}
@media(min-width:601px) and (max-width:1000px) {
 body.phone.tablet #game > #hud { grid-template-columns:minmax(130px,1fr) minmax(260px,1.8fr) 104px!important; grid-template-areas:"identity money controls" "week week week"!important; }
}
@media(max-width:600px) {
 body.phone.tablet #game > #hud { grid-template-columns:minmax(100px,1fr) 100px 104px!important; grid-template-areas:"identity week controls" "money money money"!important; }
}
/* Preserve the original right-side HUD material. Window/navigation components own their new styles. */
body #game #mapShortcuts > button:not([hidden]) {
 background:linear-gradient(155deg,rgba(104,143,133,.38),rgba(20,53,49,.68))!important;
 border:1px solid rgba(242,230,198,.48)!important; border-radius:14px!important;
 color:#fff7e4!important; text-shadow:0 1px 3px #102a29!important;
 box-shadow:inset 0 1px rgba(255,255,255,.24),0 4px 14px #071e2338!important;
 -webkit-backdrop-filter:blur(14px) saturate(125%); backdrop-filter:blur(14px) saturate(125%);
}
body #startScreen .start-screen-menu > button[data-start] { padding:10px 16px; min-height:46px; font-family:system-ui,sans-serif; background:rgba(248,243,229,.96)!important; color:#173d30!important; border:1px solid #b8a16b!important; border-image:none; text-shadow:none; box-shadow:0 4px 12px #10251e30!important; }
body #startScreen .start-screen-menu > button[data-start]::before,
body #startScreen .start-screen-menu > button[data-start]::after { display:none!important; }
body #startScreen .start-screen-menu > button[data-start]:hover { filter:brightness(1.1); }
body #game nav#dock > button.city-dock-button:not([hidden]) {
 background:linear-gradient(150deg,rgba(108,164,199,.55),rgba(22,66,104,.72))!important;
}
body #game #panel :is(nav,.profile-menu-tabs) button[data-action]:is(.primary,.selected,[aria-pressed="true"]),
body #game #pauseMenu .settings-tabs > button:is(.primary,.selected) { outline:1px solid #f0dfad; outline-offset:-3px; }
body #game > #hud {
 overflow:visible!important; background:none!important;
 border:0!important; border-radius:0; box-shadow:none!important;
 -webkit-backdrop-filter:none!important; backdrop-filter:none!important;
}
body #game > #hud :is(.money,.balance-line,.clock,#hudControls) { background:none!important; border:0!important; box-shadow:none!important; }
body #game > #hud :is(.cash-counter,#identity .level-row,#week > span) {
 background:rgba(22,57,50,.64)!important; border-radius:9px;
 -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
 box-shadow:inset 0 0 0 1px #e1d2a940;
}
body #game > #hud #jewelBalance { background:rgba(67,39,78,.64)!important; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); }
body #game > #hud #lindenburgMarksHud { background:rgba(28,57,80,.64)!important; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); }
body #game > #hud #week > span.active { background:rgba(207,171,87,.83)!important; color:#1e352b; }
/* The material belongs to the controls, never to a second tray underneath. */
body #game:has(#world[data-scene]) nav#dock,
body #game #mapShortcuts,
body #game #mapShortcuts[data-expanded="true"],
body #startScreen .start-screen-menu {
 background:none!important; border:0!important; outline:0; box-shadow:none!important;
 -webkit-backdrop-filter:none!important; backdrop-filter:none!important;
}
body #game > #hud > #oreStocks:not([hidden]),
body.phone.tablet #game > #hud > #oreStocks:not([hidden]) {
 position:absolute!important; inset:var(--resource-top,72px) auto auto 0!important;
 width:max-content!important; max-width:calc(100vw - 24px)!important; height:auto!important;
 display:flex!important; flex-direction:column!important; flex-wrap:nowrap!important; align-items:flex-start!important;
 gap:5px!important; transform:none!important; margin:0!important; padding:0!important;
 grid-area:auto!important; overflow:visible!important;
}
body #game > #hud > #oreStocks > span,
body.phone.tablet #game > #hud > #oreStocks > span {
 flex:none!important; width:max-content!important; min-width:0!important; max-width:none!important;
 display:inline-flex; align-items:center; gap:5px; height:26px; padding:3px 7px!important;
 border:1px solid #eee1bd66; border-radius:8px; background:rgba(23,57,50,.62)!important; color:#fff7e4;
 -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); box-shadow:inset 0 1px #ffffff26;
}
body #game > #hud > #oreStocks > span img { width:19px!important; height:19px!important; object-fit:contain; }
body #game > #hud > #oreStocks > span b { font:700 12px/18px Arial,sans-serif!important; white-space:nowrap; }
body.phone.tablet #game > #hud { min-height:72px; }
body.phone.tablet #game > #hud .money {
 min-height:72px!important; grid-template-rows:38px 14px 14px!important;
 grid-template-areas:"cash marks gems" "income income income" "depot depot depot"!important;
}
body.phone.chat-keyboard #game #globalChatDrawer {
 position:fixed!important; top:var(--handset-visible-top,0px)!important; left:0!important; bottom:auto!important;
 height:var(--handset-visible-height,100dvh)!important; max-height:var(--handset-visible-height,100dvh)!important;
 min-height:0!important; width:min(620px,100vw); max-width:100vw;
 display:flex; flex-direction:column; overflow:hidden; z-index:65;
}
body.phone.chat-keyboard #game #globalChatDrawer > header { flex:0 0 auto; min-height:44px; padding-block:2px; }
body.phone.chat-keyboard #game #globalChatDrawer > header button { min-height:44px; height:44px; min-width:44px; }
body.phone.chat-keyboard #game #globalChatDrawer :is(.global-chat-body,.radio-channel) { display:flex; flex:1 1 auto; flex-direction:column; min-height:0!important; overflow:hidden!important; }
body.phone.chat-keyboard #game #globalChatDrawer .radio-chat { flex:1 1 auto; min-height:0!important; max-height:none!important; overflow-y:auto!important; overscroll-behavior:contain; }
body.phone.chat-keyboard #game #globalChatDrawer .radio-compose { flex:0 0 auto; padding-bottom:4px; }
body.phone.chat-keyboard #game #globalChatDrawer .radio-compose :is(input,button) { min-height:44px; font-size:16px; }
body.phone.chat-keyboard #game #globalChatDrawer .chat-tabs { flex:0 0 auto; }
body.phone.chat-keyboard #game #panel[data-kind="radio"] { top:calc(var(--handset-visible-top,0px) + 4px)!important; bottom:auto!important; height:calc(var(--handset-visible-height,100dvh) - 8px)!important; max-height:none!important; }
@media(prefers-reduced-transparency:reduce) {
 body #game > #hud :is(.cash-counter,#identity .level-row,#week > span,#jewelBalance,#lindenburgMarksHud),body #game > #hud > #oreStocks > span { background:#20483f!important; backdrop-filter:none; -webkit-backdrop-filter:none; }
}
body.phone.handset-landscape #game:has(> #hud.has-resource-rail) > #globalChatToggle {
 top:auto!important; bottom:calc(var(--touch-bottom,8px) + var(--dock-height,50px) + 8px)!important;
 transform:none!important; width:44px; height:44px; min-height:44px;
}
/* Open and focused chat use the same flush left edge. Safe padding is inside. */
body #game #globalChatDrawer {
 left:0!important; top:0!important; bottom:0!important; margin:0!important; transform:none!important;
 max-width:100%!important; border-inline-start:0!important; border-top-left-radius:0!important; border-bottom-left-radius:0!important;
}
body #game #globalChatDrawer > header {
 box-sizing:border-box; flex:0 0 auto; height:auto!important;
 min-height:44px; padding-block-start:max(12px,env(safe-area-inset-top,0px),var(--native-safe-top,0px))!important;
 padding-inline-start:max(12px,env(safe-area-inset-left,0px),var(--native-safe-left,0px));
 padding-inline-end:12px; padding-block-end:6px;
}
body.phone.tablet #game #globalChatDrawer > header {
 padding-block-start:max(28px,env(safe-area-inset-top,0px),var(--native-safe-top,0px))!important;
}
body #game #globalChatDrawer > header button { flex:none; width:44px!important; height:44px!important; min-width:44px; min-height:44px; margin:0; }
