/* Art Deco Empire components. The original HUD deliberately keeps its existing font/layout. */
body #game.smooth-ux { font-family:Arial,sans-serif; }
body #game.smooth-ux #panel { box-sizing:border-box; overflow:hidden; }
body #game.smooth-ux #panel .panel-head { flex:none; min-height:52px; gap:10px; }
body #game.smooth-ux #panelTitle { margin:0; font-size:clamp(17px,2.1vw,24px); line-height:1.2; }
body #game.smooth-ux #panelBody { min-width:0; min-height:0; overscroll-behavior:contain; overflow-y:auto; padding:10px 12px!important; font-size:14px; line-height:1.45; }
body #game.smooth-ux #hud .cash-counter[role=button] { pointer-events:auto; cursor:pointer; }
body #game.smooth-ux #panelBody :is(.game-card-grid,.master-grid,.world-goods-grid,.cards-three,.cards-four,.office-upgrade-grid,.kontor-card-track) {
 display:grid; width:100%; max-width:none; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:12px; align-items:stretch;
}
/* A single adaptive mobile panel is also used by development browsers. */
body #game.smooth-ux #panelBody :is(.card,.clipboard-card,.handset-team-card) { min-width:0; box-sizing:border-box; }
body #game.smooth-ux #panelBody :is(.game-card-grid,.world-goods-grid,.office-upgrade-grid) > article { display:flex; flex-direction:column; gap:6px; }
body #game.smooth-ux #panelBody article > :is(.handset-team-actions,.world-good-actions) { margin-top:auto; }
body #game.smooth-ux #panelBody article > button:last-child { margin-top:auto; }
body #game.smooth-ux #panelBody :is(h3,strong,p,small) { overflow-wrap:anywhere; }
body #game.smooth-ux #panelBody :is(.card,.world-good-card) :is(p,small) { font-size:13px; line-height:1.4; }
body #game.smooth-ux #panelBody .world-good-card h3 { min-height:40px; font:700 15px/1.3 var(--deco-font); }
body #game.smooth-ux :is(#panel,#dialog,#globalChatDrawer) button {
 box-sizing:border-box; min-height:44px; min-width:44px; border-radius:12px; font:650 13px/1.2 var(--deco-font);
 white-space:nowrap; overflow:hidden; text-overflow:ellipsis; touch-action:manipulation;
}
body #game.smooth-ux #panel #panelBody button > span { min-width:0; white-space:nowrap!important; overflow:hidden; text-overflow:ellipsis; overflow-wrap:normal!important; word-break:normal; }
body #game.smooth-ux:has(#panel:not([hidden])) > #globalChatToggle { visibility:hidden; pointer-events:none; }
body #game.smooth-ux #panelBody .world-good-card button { min-height:44px; font-size:13px; padding:8px; }
body #game.smooth-ux #panel #panelBody button {
 background-image:none!important; background-color:var(--window-button)!important; color:var(--window-ink)!important;
 border:1px solid #b8a675; text-shadow:none!important; box-shadow:inset 0 1px #ffffff26,0 2px 5px #15282020;
}
body #game.smooth-ux #panel #panelBody button:is(.danger,[data-action^="confirmFire:"],[data-action^="fire:"]) { background-color:#813f37!important; color:#fff8e9!important; }
body #game.smooth-ux #panel #panelBody button:disabled { opacity:.6; cursor:default; }
body #game.smooth-ux #panel #panelBody nav button { background:var(--window-card)!important; color:#253e36!important; border-color:#aa9870; }
body #game.smooth-ux #panel #panelBody nav button:is(.primary,.selected,.active,[aria-pressed="true"],[aria-selected="true"],[aria-current="page"]) { background:#e7dfc9!important; box-shadow:inset 0 -2px #b8a16b; }
body #game.smooth-ux #panelBody .world-good-actions { flex-wrap:wrap; gap:6px; }
body #game.smooth-ux #panelBody .world-good-actions button { flex:1 1 140px; }
body #game.smooth-ux #panel :is(.settings-tabs,.master-tabs,.handset-team-tabs,.branch-tabs,.quest-book-tabs,.bank-service-tabs) {
 display:flex; flex-wrap:wrap; gap:6px; padding:6px; background:transparent;
}
body #game.smooth-ux #panel :is(.settings-tabs,.master-tabs,.handset-team-tabs,.branch-tabs,.quest-book-tabs,.bank-service-tabs) button,
body #game.smooth-ux #panel #panelBody :is(.master-tabs,.handset-team-tabs,.branch-tabs,.quest-book-tabs,.bank-service-tabs) button {
 flex:1 1 auto; background:var(--window-card)!important; color:#253e36!important; border:1px solid #aa9870; box-shadow:inset 0 1px #fff9e7;
}
body #game.smooth-ux #panel :is(.settings-tabs,.master-tabs,.handset-team-tabs,.branch-tabs,.quest-book-tabs,.bank-service-tabs) button:is(.primary,.settings-selected,[aria-pressed="true"],[aria-current="page"]),
body #game.smooth-ux #panel #panelBody :is(.master-tabs,.handset-team-tabs,.branch-tabs,.quest-book-tabs,.bank-service-tabs) button:is(.primary,.settings-selected,[aria-pressed="true"],[aria-current="page"]) {
 background:#e7dfc9!important; border:1px solid var(--window-brass); box-shadow:inset 0 -3px #174e49;
}
body #game.smooth-ux :is(button,input,summary):focus-visible { outline:3px solid #3879ad; outline-offset:3px; }
body #game.smooth-ux #panelBody progress { width:100%; height:12px; accent-color:#376a56; }
body #game.smooth-ux #panelBody .ux-filtered-out { display:none!important; }
.ux-card-search { margin:0 0 12px; }
.ux-card-search label { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-weight:700; }
.ux-card-search input { flex:1; min-width:120px; min-height:44px; max-width:460px; font:16px Arial; border:1px solid #9e997f; border-radius:10px; padding:8px 12px; background:#fff9e9; color:#203f34; }
.ux-card-search [role=status] { display:block; font-size:13px; min-height:0; }
body #uxQuickAccess { position:relative; flex:none; margin:0; color:#243f35; order:2; }
body #uxQuickAccess summary { box-sizing:border-box; min-height:44px; padding:12px 8px; cursor:pointer; font-size:13px; font-weight:700; border:1px solid #a89c79; border-radius:10px; background:#eee1be; }
body #uxQuickAccess nav { position:absolute; right:0; top:48px; z-index:20; width:min(440px,70vw); max-height:180px; overflow:auto; display:flex; flex-wrap:wrap; gap:6px; padding:12px; background:#f6efd9; border:1px solid #a89c79; border-radius:12px; box-shadow:0 8px 24px #0005; }
body #game.smooth-ux #closePanel { order:3; }
body #uxQuickAccess nav strong { width:100%; font-size:13px; }
body #uxQuickAccess button { background:#eee1be; color:#243f35; border:1px solid #a89c79; padding:8px 12px; }
body #uxMoneyHelp { display:block; width:auto; min-height:28px; padding:2px 8px; margin:2px 0 0; color:#fff6df; background:rgba(22,58,49,.84); border:1px solid #b6a675; border-radius:8px; font:700 12px Arial; cursor:pointer; }
body #uxFinance { width:min(560px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); overflow:auto; box-sizing:border-box; padding:20px; border:1px solid #b3a373; border-radius:18px; background:#f6efd9; color:#203c32; font:15px/1.5 Arial; }
body #uxFinance::backdrop { background:rgba(12,28,26,.65); }
body #uxFinance dl { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
body #uxFinance dd { margin:0; font-weight:700; }
body #uxFinance button { min-height:44px; margin:4px; border-radius:10px; padding:8px 12px; }
.ux-work-summary { margin-block:10px; }
.ux-production-state { font-weight:700; }
.ux-missing-materials { padding-left:18px; font-size:13px; }
body #game.smooth-ux #lithium-scene .mine-inspect { background:#f6efd9; color:#203e35; border-radius:16px; overflow:auto; overscroll-behavior:contain; }
body #game.smooth-ux #lithium-scene .mine-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:10px; }
body #game.smooth-ux #lithium-scene button { min-height:44px; min-width:44px; font:700 13px/1.2 Arial,sans-serif; border-radius:12px; white-space:nowrap; }
body #game.smooth-ux #lithium-scene .mine-inspect :is(p,small) { color:#2b493e; font:13px/1.4 Arial,sans-serif; }
body #game.smooth-ux #lithium-scene .mine-card-grid > article { display:flex; flex-direction:column; min-width:0; }
body #game.smooth-ux #lithium-scene .mine-card-grid > article > button:last-child { margin-top:auto; }
body #game.smooth-ux .quest-book-spread { min-height:0; }
body #game.smooth-ux .quest-book-detail { min-width:0; }
@media(min-width:1100px) {
 body #game.smooth-ux #panelBody :is(.master-grid,.world-goods-grid,.cards-four,.kontor-card-track) { grid-template-columns:repeat(4,minmax(0,1fr)); }
 body #game.smooth-ux #panel[data-kind="team"] #panelBody .game-card-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
 body #game.smooth-ux #lithium-scene .mine-card-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:700px) {
 body #game.smooth-ux #panel .panel-head { flex-wrap:wrap; }
 body #game.smooth-ux #panel .settings-tabs { order:3; width:100%; }
 body #game.smooth-ux .quest-book-spread { display:flex; flex-direction:column; }
 body #game.smooth-ux .quest-book-index { max-height:120px; overflow:auto; flex:none; }
 body #game.smooth-ux #panelBody :is(.game-card-grid,.master-grid,.world-goods-grid,.cards-three,.cards-four,.office-upgrade-grid,.kontor-card-track) { grid-template-columns:repeat(auto-fit,minmax(min(100%,165px),1fr)); }
 body #game.smooth-ux #uxQuickAccess summary { min-height:44px; }
 body #uxQuickAccess summary { font-size:0; }
 body #uxQuickAccess summary::after { content:'⋯'; font-size:22px; }
 body #game.smooth-ux #uxMoneyHelp { min-height:36px; }
}
@media(max-width:520px) {
 body.phone.tablet #game.smooth-ux > #hud {
  left:8px!important; right:8px!important; top:max(8px,env(safe-area-inset-top))!important;
  width:auto!important; min-width:0!important; max-width:calc(100% - 16px)!important;
  height:auto!important; min-height:0!important; display:grid!important; padding:0!important;
  grid-template-columns:minmax(0,1fr) 92px!important; grid-template-rows:auto auto auto!important;
  grid-template-areas:"identity controls" "money money" "week week"!important; gap:6px!important;
 }
 body.phone.tablet #game.smooth-ux > #hud #identity { width:100%!important; height:48px; min-width:0; }
 body.phone.tablet #game.smooth-ux > #hud #identity #portrait { width:40px; height:48px; flex-basis:40px; }
 body.phone.tablet #game.smooth-ux > #hud #identity .level-row small { display:none; }
 body.phone.tablet #game.smooth-ux > #hud #hudControls { width:92px!important; min-width:0; height:56px!important; display:flex; gap:4px; align-items:start; }
 body.phone.tablet #game.smooth-ux > #hud #hudControls > button { position:relative!important; inset:auto!important; width:44px!important; min-width:44px; height:44px!important; margin:0!important; transform:none!important; }
 body.phone.tablet #game.smooth-ux > #hud :is(#hudFullscreen,#hudShop) { display:none!important; }
 body.phone.tablet #game.smooth-ux > #hud .money { min-height:0!important; display:grid!important; grid-template-columns:minmax(0,1fr)!important; grid-template-rows:auto 14px 14px!important; grid-template-areas:"balance" "income" "depot"!important; }
 body.phone.tablet #game.smooth-ux > #hud .balance-line { grid-area:balance!important; display:grid!important; min-width:0; width:100%; grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-areas:"cash cash" "marks gems"; gap:4px; }
 body.phone.tablet #game.smooth-ux > #hud :is(.cash-counter,#lindenburgMarksHud,#jewelBalance) { position:static!important; width:100%!important; min-width:0; height:32px!important; min-height:32px!important; }
 body.phone.tablet #game.smooth-ux > #hud .cash-counter { grid-area:cash!important; }
 body.phone.tablet #game.smooth-ux > #hud #lindenburgMarksHud { grid-area:marks!important; }
 body.phone.tablet #game.smooth-ux > #hud #jewelBalance { grid-area:gems!important; }
 body.phone.tablet #game.smooth-ux > #hud .clock { width:100%!important; min-width:0; height:28px; padding:0; }
 body.phone.tablet #game.smooth-ux > #hud #week { width:100%!important; max-width:260px; }
 body.phone.tablet #game.smooth-ux #panel .panel-head {
  display:grid!important; grid-template-columns:44px minmax(0,1fr) 44px 44px;
  grid-template-areas:"back title quick close" "tabs tabs tabs tabs"; gap:6px; padding:8px!important;
 }
 body.phone.tablet #game.smooth-ux #panel .panel-head:has(#panelBack[hidden]) { grid-template-columns:minmax(0,1fr) 44px 44px; grid-template-areas:"title quick close" "tabs tabs tabs"; }
 body.phone.tablet #game.smooth-ux #panel .panel-head > div { grid-area:title; min-width:0; }
 body.phone.tablet #game.smooth-ux #panel #panelTitle { font-size:17px!important; overflow-wrap:normal; }
 body.phone.tablet #game.smooth-ux #panel #panelBack { grid-area:back; }
 body.phone.tablet #game.smooth-ux #panel #closePanel { grid-area:close; }
 body.phone.tablet #game.smooth-ux #panel #sectionTabs { grid-area:tabs; }
 body.phone.tablet #game.smooth-ux #panel #uxQuickAccess { grid-area:quick; }
 body.phone.tablet #game.smooth-ux #panel #panelBody :is(.game-card-grid,.master-grid,.world-goods-grid,.cards-three,.cards-four,.office-upgrade-grid,.kontor-card-track) { grid-template-columns:minmax(0,1fr)!important; }
}
@media(prefers-reduced-transparency:reduce) { body #game.smooth-ux :is(#hud > *,#globalChatDrawer,#dock > button) { backdrop-filter:none!important; background-color:#203e35!important; } }
@media(prefers-reduced-motion:reduce) { body #game.smooth-ux * { scroll-behavior:auto!important; } }

/* Player banners must remain visible beneath the full-row profile hit target. */
body #game.smooth-ux #panel[data-kind="global"] #panelBody .rank-board .ranking-profile-hit {
 background:transparent!important;border:0!important;box-shadow:none!important;
}
body #game.smooth-ux #panel[data-kind="global"] #panelBody .rank-board .ranking-row {
 background-color:transparent!important;background-image:var(--rank-profile-header)!important;
}

body #game.smooth-ux #panel[data-kind="global"] .ranking-row :is(.ranking-rank,.ranking-nickname,.ranking-world) {
 color:#fff8e8!important;text-shadow:0 1px 3px #000,0 0 5px #000!important;
}
body #game.smooth-ux #panel[data-kind="global"] .podium-place .ranking-wealth { color:#243e36!important; }
@media(min-width:600px) {
 body #game.smooth-ux #panel[data-kind="global"] .panel-head {
  display:grid!important;grid-template-columns:minmax(0,1fr) auto 44px!important;
  grid-template-areas:"tabs quick close"!important;align-items:center;
 }
 body #game.smooth-ux #panel[data-kind="global"] #sectionTabs { grid-area:tabs;min-width:0; }
 body #game.smooth-ux #panel[data-kind="global"] #uxQuickAccess { grid-area:quick; }
 body #game.smooth-ux #panel[data-kind="global"] #closePanel { grid-area:close; }
}

/* Experience guidance reuses the existing Smooth cards without an extra modal. */
body #game.smooth-ux :is(.experience-time,.experience-cost,.experience-route,.experience-recognition) {
 box-sizing:border-box;min-width:0;max-width:100%;margin:8px 0;padding:9px 11px;
 color:#233f35;background:rgba(245,237,214,.96);border:1px solid #b9a57b;border-radius:12px;
 font:13px/1.4 Arial,sans-serif;overflow-wrap:anywhere;
}
body #game.smooth-ux :is(.experience-time,.experience-cost) summary { cursor:pointer;font-weight:700;min-height:44px;display:list-item;line-height:44px;list-style-position:inside; }
body #game.smooth-ux .experience-cost dl { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:5px 8px;margin:8px 0; }
body #game.smooth-ux .experience-cost :is(dt,dd) { margin:0;min-width:0; }
body #game.smooth-ux .experience-cost dd { text-align:right;font-weight:700; }
body #game.smooth-ux .experience-cost select { width:100%;min-width:0;max-width:100%;min-height:44px;font:inherit;color:#233f35;background:#fff8e6;padding:7px;border:1px solid #b9a57b;border-radius:8px; }
body #game.smooth-ux :is(.experience-time,.experience-cost,.experience-route,.experience-recognition) p { margin:6px 0; }
body #game.smooth-ux :is(.experience-caption,.experience-coverage) { font:12px/1.4 Arial,sans-serif; }
body #game.smooth-ux .quest-step.recognized { border-color:#a89566;background:#eee5cc;color:#35483b; }
body #game.smooth-ux .quest-step.recognized b { white-space:normal; }
