/* Shared game chrome. These rules supersede the earlier independent overlays. */
:root { --menu-paper:#e7dfc9; --menu-muted:#aab5a1; --menu-gold:#ceb477; --menu-edge:#4b5140; --menu-ink:#141c17; }
#magic-panel[hidden], #hud-root #magic-mana[hidden] { display:none !important; }
#hud-root #magic-mana .fill { background-color:#496c91 !important; }
#magic-status-effects { display:flex; gap:8px; }
#magic-status-effects:empty { display:none; }
#magic-status-effects span { color:#d3ceb7; font:inherit; }
.building-choices { display:flex; flex-wrap:wrap; gap:16px; margin:16px 0; }
.building-choices[hidden] { display:none; }
.building-choices label { display:flex; flex-direction:column; gap:4px; color:var(--menu-muted); }
.building-choices select { min-height:36px; padding:6px 10px; }
#game-menu[hidden], #game-menu-toggle[hidden], #explore-controls[hidden] { display:none !important; }
#ui-action-bar, #field-guide-dock, #resource-quick-panel { display:none !important; }
#game-menu { position:fixed; z-index:220; inset:50% auto auto 50%; transform:translate(-50%,-50%); width:min(1160px,calc(100vw - 48px)); height:min(760px,calc(100dvh - 48px)); display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--menu-edge); border-top:3px solid var(--menu-gold); border-radius:8px; background:var(--menu-ink); box-shadow:0 22px 100px #000b; color:var(--menu-paper); font:14px/1.5 "Segoe UI",sans-serif; }
#game-menu *, #game-menu-toggle, #explore-controls { box-sizing:border-box; }
#game-menu button, #game-menu input, #game-menu select { font:inherit; letter-spacing:0; text-transform:none; color:var(--menu-paper); background:#202b23; border:1px solid var(--menu-edge); border-radius:4px; box-shadow:none; animation:none; transform:none; text-shadow:none; }
#game-menu button { min-height:36px; cursor:pointer; padding:7px 12px; }
#game-menu button:hover:not(:disabled) { background:#344333; border-color:var(--menu-gold); }
#game-menu button:disabled { opacity:.42; cursor:not-allowed; }
#game-menu :focus-visible, #game-menu-toggle:focus-visible { outline:2px solid #e7c778; outline-offset:3px; }
#game-menu kbd, #game-menu-toggle kbd, #explore-controls kbd { display:inline-block; border:1px solid #6a7259; border-radius:3px; padding:0 5px; color:#e4d8b3; font:11px/1.6 "Segoe UI",sans-serif; background:#ffffff08; }
.game-menu-heading { flex:none; display:flex; align-items:center; gap:24px; padding:18px 26px; border-bottom:1px solid var(--menu-edge); background:#1c251e; }
.game-menu-heading>div:first-child { flex:1; }
.game-menu-heading small { color:var(--menu-gold); letter-spacing:.22em; font-size:10px; }
#game-menu-title { margin:0; padding:0; font:normal 28px/1.2 Georgia,serif; color:var(--menu-paper); text-transform:none; letter-spacing:0; }
#game-menu-wallet { color:var(--menu-gold); font-variant-numeric:tabular-nums; }
#game-menu-resume kbd { margin-left:10px; }
.game-menu-layout { display:grid; grid-template-columns:170px minmax(0,1fr); min-height:0; flex:1; }
#game-menu-nav { padding:18px 10px; border-right:1px solid var(--menu-edge); background:#101812; display:flex; flex-direction:column; gap:5px; overflow:auto; }
#game-menu-nav button { display:flex; align-items:center; justify-content:space-between; gap:10px; text-align:left; background:none; border-color:transparent; color:var(--menu-muted); }
#game-menu-nav button.is-active { color:var(--menu-paper); background:#303d2a; border-color:#63704f; border-left:3px solid var(--menu-gold); }
#game-menu-nav kbd { opacity:.55; }
#game-menu-pages { min-width:0; min-height:0; overflow:auto; padding:24px; scrollbar-color:#58654a transparent; }
#game-menu .ui-modal { position:static !important; transform:none !important; width:100% !important; max-width:none !important; height:auto !important; max-height:none !important; margin:0 !important; padding:0 !important; overflow:visible !important; border:0 !important; border-radius:0 !important; background:none !important; box-shadow:none !important; animation:none !important; }
#game-menu .ui-modal::before, #game-menu .ui-modal::after { display:none; }
#game-menu .ui-modal-head { display:none; }
#game-menu .group { background:none; border:0; padding:0; box-shadow:none; }
#game-menu-foot { padding:9px 24px; border-top:1px solid var(--menu-edge); color:var(--menu-muted); font-size:11px; }
body.game-menu-open::after { content:""; position:fixed; inset:0; z-index:205; background:#04090480; pointer-events:none; }
body.game-menu-open #ui-modal-backdrop { z-index:210; background:transparent; }
body.game-menu-open #zone-panel, body.game-menu-open #minimap-panel, body.game-menu-open #inventory-hotbar, body.game-menu-open #hud-root, body.game-menu-open #game-menu-toggle, body.game-menu-open #explore-controls { visibility:hidden; }
#game-menu-toggle { position:fixed; left:20px; bottom:20px; z-index:70; display:flex; align-items:center; gap:20px; padding:11px 15px; border:1px solid #7a8161; border-radius:5px; background:#141d16ed; color:#eee7d2; font:600 14px/1.4 "Segoe UI",sans-serif; text-transform:none; box-shadow:0 4px 16px #0005; cursor:pointer; }
#game-menu-toggle.debug-active::before { content:"∞"; color:#eed08e; font-size:20px; }
#explore-controls { position:fixed; bottom:23px; right:20px; z-index:65; display:flex; flex-wrap:wrap; align-items:center; gap:15px; padding:8px 12px; color:#d6dacb; font:11px/1.5 "Segoe UI",sans-serif; background:#111b12dd; border:1px solid #45513d; border-radius:5px; pointer-events:none; }
#explore-controls kbd { margin-right:4px; }
/* Keep the landscape dominant at large resolutions too. */
#zone-panel { width:310px !important; padding:7px 12px !important; top:12px !important; }
#zone-title { font-size:20px !important; line-height:1.2 !important; letter-spacing:.06em !important; margin:0 0 6px !important; }
#zone-meta, #zone-territory-meta, #ingame-compass-head { display:none !important; }
#ingame-compass-panel { padding:0 !important; margin:0 !important; border:0 !important; }
#ingame-compass-ribbon { height:25px !important; }
#minimap-panel { width:176px !important; padding:8px !important; top:12px !important; right:16px !important; }
#minimap-title { font-size:9px !important; }
#minimap-zone-label, #minimap-player-list { display:none !important; }
#minimap-hint { font-size:0 !important; }
#minimap-hint::after { content:"World map · M"; font-size:10px; color:#c7cbb8; }
#minimap-svg { height:112px !important; }
/* Journal, crafting and base interactions are pages of the same menu. */
#browserlands-react-root { display:none; }
#game-menu #browserlands-react-root { position:static; width:100%; visibility:visible !important; color:inherit; font:inherit; }
#game-menu #browserlands-react-root:has(.is-expanded) { display:block; }
#game-menu .frontier-dock { border:0; background:none; border-radius:0; box-shadow:none; }
#game-menu .frontier-heading, #game-menu .frontier-tabs, #game-menu .frontier-footer { display:none; }
#game-menu .frontier-body { max-height:none; overflow:visible; padding:0; }
#game-menu .frontier-lead { font-size:14px; margin:0 0 20px; max-width:660px; color:var(--menu-muted); }
#game-menu .frontier-goal { padding:17px 0; grid-template-columns:28px 1fr 55px; gap:12px; }
#game-menu .frontier-goal h3, #game-menu .frontier-recipe h3 { font-size:16px; color:var(--menu-paper); }
#game-menu .frontier-goal p, #game-menu .frontier-recipe p { font-size:13px; }
#game-menu .frontier-goal progress { width:70%; margin-top:12px; }
#game-menu .frontier-recipe { grid-template-columns:56px 1fr 90px; padding:15px 0; }
#game-menu .frontier-item-icon { width:46px; height:46px; }
#game-menu .frontier-recipe button, #game-menu .frontier-transfer button, #game-menu .frontier-trade button { font-size:13px; }
#game-menu .frontier-transfer, #game-menu .frontier-trade { font-size:14px; gap:14px; }
#game-menu .frontier-section-heading { font-size:13px; margin:0 0 16px; }
#game-menu .frontier-section-heading button { font-size:12px; }
/* Inventory: supplies on the left, selected item's purpose/actions on the right. */
#game-menu #inventory-tabs, #game-menu #inventory-help, #game-menu #inventory-counts { display:none !important; }
#game-menu #inventory-panel { padding:0; }
#game-menu #inventory-overview { padding:0 0 16px; margin:0; border:0; justify-content:flex-start; }
#game-menu #inventory-tool-status { color:var(--menu-muted); font-size:12px; }
#game-menu #inventory-filter-bar { display:flex; gap:6px; padding:0 0 16px; border:0; }
#game-menu #inventory-filter-bar .inventory-filter { flex:1; width:auto !important; min-width:60px; font-size:12px !important; text-transform:none !important; letter-spacing:0 !important; font-weight:500 !important; background:#202b23 !important; box-shadow:none !important; }
#game-menu #inventory-filter-bar .inventory-filter.is-active { background:#44533a !important; color:#efe6cc !important; border-color:#8b9467 !important; }
#game-menu #inventory-items-layout { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:16px; align-items:start; }
#game-menu #inventory-item-column { display:contents; }
#game-menu .bl-pack-toolbar { grid-column:1; grid-row:1; grid-template-columns:1fr; margin:0; }
#game-menu .bl-pack-sort { display:none; }
#game-menu .bl-pack-search { padding:9px 12px; background:#0f1811; width:100%; }
#game-menu .bl-pack-result-count { color:var(--menu-muted); font-size:11px; padding-top:6px; }
#game-menu #inventory-list { grid-column:1; grid-row:2; min-height:180px; max-height:340px !important; overflow:auto; padding:10px; background:#0d1610; border:1px solid #364432; border-radius:4px; grid-template-columns:repeat(auto-fill,minmax(94px,1fr)); gap:8px; }
#game-menu #inventory-item-detail { grid-column:2; grid-row:1 / span 3; padding:18px; background:#222c20; border:1px solid #4a573e; border-radius:4px; min-height:280px; }
#game-menu .bl-item-detail { display:flex; flex-direction:column; align-items:stretch; gap:16px; padding:0; background:none; border:0; }
#game-menu .bl-item-detail-icon { width:90px; height:90px; align-self:center; border:0; background:none; }
#game-menu .bl-item-detail-name { font:22px Georgia,serif; color:#eee3c6; }
#game-menu .bl-item-detail-meta { font-size:11px; color:#bfc7a9; margin:6px 0; }
#game-menu .bl-item-detail-description { font-size:13px; line-height:1.6; }
#game-menu .bl-item-detail-actions { display:flex; flex-wrap:wrap; gap:8px; }
#game-menu .bl-item-detail-actions>button { flex:1 0 100%; }
#game-menu .bl-item-detail-tip { font-size:11px; color:var(--menu-muted); }
#game-menu .inventory-ground-panel { grid-column:1; grid-row:3; padding:12px; background:none; border:1px solid #354230; border-radius:4px; }
#game-menu .inventory-ground-panel .bl-inventory-empty { min-height:0; padding:0; border:0; display:none; }
#game-menu #inventory-floor-list:has(.bl-inventory-empty) { display:none; }
#game-menu .inventory-subtitle { font-size:11px; color:var(--menu-gold); }
#game-menu #inventory-floor-hint { font-size:12px; color:var(--menu-muted); }
#game-menu .bl-item-slot { background:#182419; border:1px solid #414e37; border-radius:4px; min-height:106px; }
#game-menu .bl-item-slot.is-selected { background:#34462c; border-color:#b7bd83; }
#game-menu .settings-root-actions { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
#game-menu #settings-resume, #game-menu .settings-help:last-child { margin-top:10px; }
#game-menu #settings-resume { display:none; }
#game-menu #settings-modal:not([data-view="root"]) .settings-head { display:flex; justify-content:flex-start; margin:0 0 16px; padding:0; border:0; }
#game-menu #settings-modal .settings-head h3 { font-size:18px; }
#game-menu #debug-resource-card { margin-top:24px; padding:20px; border:1px solid #7a714c; border-radius:4px; background:#302d1d; }
#game-menu #debug-resource-card h3 { font:20px Georgia,serif; color:#e7d196; margin:0 0 8px; }
#game-menu #debug-resource-card p { font-size:13px; color:#c6c4af; margin:0 0 12px; }
@media(max-width:850px) {
  #game-menu { width:calc(100vw - 20px); height:calc(100dvh - 20px); }
  .game-menu-heading { padding:12px 16px; gap:12px; }
  #game-menu-title { font-size:24px; }
  .game-menu-layout { grid-template-columns:126px minmax(0,1fr); }
  #game-menu-pages { padding:16px; }
  #game-menu-nav { padding:12px 6px; }
  #game-menu-nav button { font-size:12px; padding:6px 8px; }
  #game-menu-nav kbd { display:none; }
  #game-menu #inventory-items-layout { grid-template-columns:1fr; }
  #game-menu #inventory-item-detail { grid-column:1; grid-row:3; min-height:0; }
  #game-menu .inventory-ground-panel { grid-row:4; }
  #game-menu #inventory-list { max-height:230px !important; }
  #game-menu-wallet { display:none; }
  #explore-controls { bottom:74px; left:20px; right:auto; gap:8px; }

  #minimap-panel { display:none !important; }
}

#game-menu button { background-image:none !important; text-transform:none !important; font-family:"Segoe UI",sans-serif !important; font-weight:500; }
@media(max-width:600px) {
  .game-menu-layout { display:flex; flex-direction:column; }
  #game-menu-nav { display:grid; grid-template-columns:repeat(3,1fr); flex:none; padding:8px; border-right:0; border-bottom:1px solid var(--menu-edge); gap:3px; }
  #game-menu-nav button { min-height:30px; padding:4px 8px; }
  #game-menu-pages { flex:1; padding:14px; }
  #game-menu-resume { font-size:11px !important; padding:6px !important; }
  #game-menu-resume kbd { display:none; }
  #game-menu .frontier-transfer, #game-menu .frontier-trade { flex-wrap:wrap; gap:8px; }
  #game-menu .frontier-trade>span:nth-child(2) { min-width:130px; }
  #game-menu .frontier-trade button { flex:1; }
  #game-menu .settings-root-actions { grid-template-columns:1fr; }
  #game-menu #inventory-filter-bar { flex-wrap:wrap; }
  #game-menu #inventory-filter-bar button { min-width:60px; }
}



#build-mode-dock { bottom:78px !important; }

/* One theme for legacy pages, React station pages, and the native-created HUD.
   These scoped rules deliberately outrank the older per-screen theme passes. */
:root { --menu-paper:#e4e9dd; --menu-muted:#acb9a6; --menu-gold:#b6c68f; --menu-edge:#3b4a3e; --menu-ink:#131b17; --menu-surface:#1c2820; --menu-font:"Segoe UI",sans-serif; }
html body #game-menu {
  --ui-font-ui:var(--menu-font); --ui-font-display:var(--menu-font); --bl-font-ui:var(--menu-font);
  --ui-ink:var(--menu-paper); --ui-ink-dim:var(--menu-muted); --ui-gold:var(--menu-gold);
  --bl-ink:var(--menu-paper); --bl-ink-muted:var(--menu-muted);
  border:1px solid var(--menu-edge); border-radius:7px; font:14px/1.5 var(--menu-font);
}
html body #game-menu :is(h1,h2,h3,h4,p,label,button,input,select,small,strong) { font-family:var(--menu-font) !important; letter-spacing:normal !important; text-transform:none !important; text-shadow:none !important; }
html body #game-menu :is(button,input,select) { min-width:0 !important; max-width:100%; font-size:13px !important; line-height:1.4 !important; border:1px solid var(--menu-edge); border-radius:4px !important; background:#243329 !important; color:var(--menu-paper) !important; box-shadow:none !important; text-shadow:none !important; }
html body #game-menu button { width:auto; min-height:36px !important; padding:7px 12px; font-weight:500 !important; }
html body #game-menu button:hover:not(:disabled) { background:#354735 !important; border-color:#91a67c !important; }
html body #game-menu button:is(.is-active,[aria-pressed="true"]) { background:#3b503b !important; border-color:#80966d !important; }
html body #game-menu button:disabled { opacity:.5; }
html body #game-menu :is(input,select) { background:#101a14 !important; padding:8px 10px; }
html body #game-menu input[type="checkbox"] { min-height:0 !important; accent-color:var(--menu-gold); }
html body #game-menu-title { font:600 23px/1.25 var(--menu-font) !important; color:var(--menu-paper); }
html body #game-menu :is(.game-menu-heading,.game-menu-layout,#game-menu-pages) { min-width:0; }
html body #game-menu .game-menu-heading { background:var(--menu-surface); padding:16px 24px; }
html body #game-menu .game-menu-heading small { font-size:10px; letter-spacing:.16em !important; }
html body #game-menu-nav button { background:transparent !important; border-color:transparent; color:var(--menu-muted) !important; }
html body #game-menu-nav button.is-active { border-left:2px solid var(--menu-gold); color:var(--menu-paper) !important; }
html body #game-menu :is(.group-title,.inventory-subtitle,.settings-control-title,.build-detail-kicker) { font:600 13px/1.4 var(--menu-font) !important; color:var(--menu-paper) !important; letter-spacing:0 !important; text-transform:none !important; }
html body #game-menu :is(.settings-help,#town-summary,#town-claim-status,#market-listings-summary,#market-status) { font:13px/1.55 var(--menu-font) !important; color:var(--menu-muted); letter-spacing:0 !important; text-transform:none !important; }
html body #game-menu :is(.settings-section,.settings-control-block,#town-controls>div,#town-policy-grid,#town-members,#build-browser) { border:0 !important; background:none !important; box-shadow:none !important; border-radius:0 !important; }
html body #game-menu :is(.settings-control-block,#town-controls>div) { padding:14px 0 !important; border-bottom:1px solid var(--menu-edge) !important; }
html body #game-menu :is(.settings-control-head,.settings-toggle) { gap:12px; }
html body #game-menu :is(#debug-resource-card,#build-detail,#inventory-item-detail) { background:var(--menu-surface) !important; border:1px solid var(--menu-edge) !important; border-radius:5px !important; box-shadow:none !important; }
html body #game-menu :is(#debug-resource-card h3,.bl-item-detail-name,.build-detail-name,.build-detail-title) { font:600 18px/1.35 var(--menu-font) !important; color:var(--menu-paper) !important; }
html body #game-menu .bl-item-detail-meta { color:var(--menu-muted); }
html body #game-menu :is(.bl-item-detail-description,.build-detail-description,.build-detail-help) { font:13px/1.6 var(--menu-font) !important; color:var(--menu-muted) !important; }
html body #game-menu .bl-pack-toolbar { grid-template-columns:minmax(0,1fr) auto; gap:8px; }
html body #game-menu .bl-pack-sort { display:block; max-width:130px; }
html body #game-menu :is(.bl-pack-search,.bl-pack-sort) { font-size:12px !important; }
html body #game-menu #inventory-filter-bar { flex-wrap:wrap; }
html body #game-menu #inventory-filter-bar .inventory-filter { font:500 12px/1.4 var(--menu-font) !important; background:#243329 !important; color:var(--menu-muted) !important; border-color:var(--menu-edge) !important; }
html body #game-menu #inventory-filter-bar .inventory-filter.is-active { color:var(--menu-paper) !important; background:#3b503b !important; border-color:#80966d !important; }
html body #game-menu :is(#inventory-list,.bl-item-slot,.inventory-ground-panel) { box-shadow:none !important; border-color:var(--menu-edge) !important; border-radius:4px !important; }
html body #game-menu .bl-item-slot { background:#1b2a20 !important; }
html body #game-menu .bl-item-slot.is-selected { background:#334b33 !important; border-color:#91aa79 !important; }
html body #game-menu :is(.bl-item-name,.bl-item-slot-label) { font:500 12px/1.3 var(--menu-font) !important; color:var(--menu-paper) !important; }
html body #game-menu #build-panel { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:16px; }
html body #game-menu #build-category-tabs { display:flex; flex-wrap:wrap; gap:6px; border:0; padding:0 0 16px; }
html body #game-menu #build-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:8px; padding:0; max-height:460px; overflow:auto; }
html body #game-menu :is(.build-card,.build-item,.build-option) { background:var(--menu-surface) !important; border:1px solid var(--menu-edge) !important; border-radius:4px !important; box-shadow:none !important; padding:12px !important; }
html body #game-menu :is(.build-card.is-selected,.build-item.is-selected) { background:#334b33 !important; border-color:#91aa79 !important; }
html body #game-menu :is(.build-card-label,.build-card-name,.build-item-name) { font:600 13px/1.4 var(--menu-font) !important; color:var(--menu-paper) !important; }
html body #game-menu #build-detail { padding:18px; min-width:0; }
html body #game-menu :is(#town-controls,#town-policy-grid,.market-row) { gap:14px; min-width:0; }
html body #game-menu #town-controls { grid-template-columns:1fr; }
html body #game-menu :is(#town-controls label,#town-controls select) { font-size:13px !important; }
html body #game-menu #town-controls select { width:100%; }
/* The map has one drawing surface and an unframed information column. */
html body #game-menu #travel-shell { display:grid !important; grid-template-columns:minmax(0,1fr) 260px !important; gap:20px !important; align-items:start; }
html body #game-menu :is(#travel-worldmap-panel,#travel-side-panel) { min-width:0 !important; width:auto !important; padding:0 !important; border:0 !important; border-radius:0 !important; background:none !important; box-shadow:none !important; max-height:none !important; overflow:visible !important; }
html body #game-menu #travel-worldmap-panel>.group-title { margin:0 0 10px !important; }
html body #game-menu #travel-map-toolbar { position:static !important; display:flex !important; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:6px; padding:0 0 10px !important; border:0 !important; background:none !important; box-shadow:none !important; }
html body #game-menu #travel-map-toolbar button { flex:none; min-width:36px !important; width:auto !important; font-size:13px !important; }
html body #game-menu #travel-map-zoom-value { margin-left:auto; font:12px/1.4 var(--menu-font) !important; color:var(--menu-muted) !important; }
html body #game-menu #travel-worldmap { display:block; position:relative; width:100%; height:clamp(300px,45vh,450px) !important; min-height:0 !important; padding:0 !important; overflow:hidden !important; background:#18231c !important; border:1px solid var(--menu-edge) !important; border-radius:5px !important; box-shadow:none !important; }
html body #game-menu #travel-worldmap::before, html body #game-menu #travel-map-compass { display:none !important; }
html body #game-menu #travel-worldmap svg { display:block; width:100% !important; height:100% !important; min-height:0 !important; background:none !important; }
html body #game-menu :is(.worldmap-node text,.worldmap-node-label) { fill:var(--menu-paper) !important; font-family:var(--menu-font) !important; font-size:15px !important; font-weight:500; text-shadow:none !important; letter-spacing:0 !important; }
html body #game-menu .worldmap-node .worldmap-node-kicker { fill:#c9d3c2 !important; font-size:11px !important; }
html body #game-menu .worldmap-node.current :is(circle,polygon) { fill:#6c8454 !important; stroke:#d2ddb2 !important; }
html body #game-menu .worldmap-node.neighbor :is(circle,polygon) { fill:#354f3c !important; stroke:#7f9e76 !important; }
html body #game-menu .worldmap-edge { stroke:#4b5e4a !important; }
html body #game-menu .worldmap-edge-active { stroke:#a5be85 !important; }
html body #game-menu #travel-map-meta { display:grid !important; grid-template-columns:1fr 1fr !important; gap:12px; padding:0 0 14px; margin:0 0 16px; border-bottom:1px solid var(--menu-edge); }
html body #game-menu :is(.travel-meta-cell,#travel-zone-card,#travel-map-legend,.travel-zone-fact) { border:0 !important; border-radius:0 !important; background:none !important; box-shadow:none !important; padding:0 !important; min-width:0; }
html body #game-menu :is(.travel-meta-k,#travel-zone-subtitle,.travel-zone-fact .k) { font:12px/1.4 var(--menu-font) !important; color:var(--menu-muted) !important; letter-spacing:0 !important; text-transform:none !important; }
html body #game-menu :is(.travel-meta-v,.travel-zone-fact .v) { font:500 13px/1.45 var(--menu-font) !important; color:var(--menu-paper) !important; margin-top:3px !important; overflow-wrap:anywhere; }
html body #game-menu #travel-zone-title { font:600 20px/1.3 var(--menu-font) !important; color:var(--menu-paper) !important; margin:10px 0 6px !important; letter-spacing:0 !important; text-transform:none !important; }
html body #game-menu #travel-zone-subtitle { display:none; }
html body #game-menu #travel-zone-description { font:13px/1.6 var(--menu-font) !important; color:var(--menu-muted) !important; min-height:0 !important; margin:0 0 16px !important; }
html body #game-menu #travel-zone-badge-row { gap:6px; margin:0; flex-wrap:wrap; }
html body #game-menu .travel-badge { font:11px/1.4 var(--menu-font) !important; letter-spacing:0 !important; text-transform:none !important; color:#c5d5b8 !important; background:#293b2d !important; border:1px solid #486044 !important; border-radius:3px !important; padding:3px 6px !important; }
html body #game-menu #travel-zone-facts { display:grid; grid-template-columns:1fr 1fr; gap:12px !important; }
html body #game-menu #travel-zone-action-row { margin-top:16px; }
html body #game-menu #travel-zone-action { width:100%; }
html body #game-menu #travel-map-legend { margin-top:20px !important; padding-top:14px !important; border-top:1px solid var(--menu-edge) !important; }
html body #game-menu .travel-legend-row { font:11px/1.4 var(--menu-font) !important; color:var(--menu-muted) !important; margin:8px 0; gap:8px; }
html body #game-menu .travel-legend-row>span:last-child { display:none; }
html body #game-menu .travel-legend-swatch { width:9px; height:9px; border-radius:2px; }
html body #game-menu .travel-legend-swatch.current { background:#91ab70 !important; }
html body #game-menu #zone-travel-status { font:12px/1.5 var(--menu-font) !important; color:var(--menu-muted); padding:10px 0 0; min-height:0; }
/* Explicit station identity, with no implicit nearest-station replacement. */
html body #game-menu :is(.frontier-station-context,.frontier-empty-context) { margin-bottom:18px; }
html body #game-menu .frontier-station-context { display:flex; flex-wrap:wrap; align-items:start; justify-content:space-between; gap:12px; padding:0 0 18px; border-bottom:1px solid var(--menu-edge); }
html body #game-menu .frontier-station-context>div { min-width:0; flex:1 1 190px; }
html body #game-menu :is(.frontier-station-context h2,.frontier-empty-context h2) { margin:4px 0 8px; font:600 20px/1.3 var(--menu-font); color:var(--menu-paper); }
html body #game-menu .frontier-station-context p { margin:4px 0; font-size:12px; color:var(--menu-muted); }
html body #game-menu .frontier-station-identity { overflow-wrap:anywhere; }
html body #game-menu .frontier-eyebrow { font:12px/1.4 var(--menu-font); color:var(--menu-gold); }
html body #game-menu .frontier-station-context .frontier-notice { flex:1 0 100%; margin-top:4px; }
html body #game-menu .frontier-primary { color:var(--menu-paper) !important; background:#3b503b !important; }
html body #game-menu .frontier-recipe>div { min-width:0; }
html body #game-menu :is(.frontier-recipe small,.frontier-transfer small,.frontier-trade small) { font-size:12px; color:var(--menu-muted); }
/* Native HUD uses this same surface; specificity also beats its late injected CSS. */
html body #hud-root { padding:12px 16px !important; font:12px/1.4 var(--menu-font) !important; color:var(--menu-paper) !important; text-shadow:none !important; }
html body #hud-root :is(.hud-panel,.hud-floating-label,.hud-harvest-popup), html body :is(#zone-panel,#minimap-panel,#build-mode-dock,#game-menu-toggle,#explore-controls,#action-toast) { font-family:var(--menu-font) !important; color:var(--menu-paper) !important; background:#131b17ed !important; background-image:none !important; border:1px solid var(--menu-edge) !important; border-radius:5px !important; box-shadow:0 3px 12px #0003 !important; text-shadow:none !important; backdrop-filter:none !important; }
html body #hud-root .hud-panel.status { font-family:var(--menu-font) !important; border-radius:5px !important; background:#131b17ed !important; width:224px !important; max-width:224px !important; padding:10px 12px !important; }
html body #hud-root :is(.hud-status-connection,.hud-status-map) { font:11px/1.4 var(--menu-font) !important; letter-spacing:0 !important; text-transform:none !important; color:var(--menu-muted) !important; text-shadow:none !important; }
html body #hud-root .hud-status-map { margin-top:7px !important; }
html body #hud-root .hud-bar { height:17px !important; margin-top:6px !important; border:1px solid #445343 !important; border-radius:3px !important; background:#101913 !important; box-shadow:none !important; }
html body #hud-root .hud-bar .fill { background:#546f50 !important; border-radius:0 !important; box-shadow:none !important; }
html body #hud-root .hud-bar.hp .fill { background:#814e48 !important; }
html body #hud-root .hud-bar .label { font:11px/1.3 var(--menu-font) !important; color:#f1f1e8 !important; text-shadow:none !important; }
html body #zone-panel { width:260px !important; padding:9px 12px !important; }
html body #zone-title { font:600 15px/1.3 var(--menu-font) !important; color:var(--menu-paper) !important; text-shadow:none !important; text-transform:none !important; letter-spacing:0 !important; }
html body #ingame-compass-ribbon { border:0 !important; background:#101913 !important; border-radius:3px !important; box-shadow:none !important; }
html body #ingame-compass-track :is(.compass-label,.compass-cardinal,.compass-degree) { font-family:var(--menu-font) !important; color:var(--menu-muted) !important; text-shadow:none !important; }
html body #minimap-title { font:500 11px/1.4 var(--menu-font) !important; color:var(--menu-muted) !important; letter-spacing:0 !important; text-transform:none !important; }
html body #minimap-svg { border:0 !important; border-radius:3px !important; background:#101913 !important; box-shadow:none !important; }
html body #minimap-hint { margin:3px 0 8px !important; }
html body #explore-controls { font-size:11px !important; }
@media(max-width:1000px) {
  html body #game-menu #travel-shell { grid-template-columns:minmax(0,1fr) 220px !important; gap:14px !important; }
  html body #game-menu #build-panel { grid-template-columns:minmax(0,1fr) 240px; }
}
@media(max-width:850px) {
  html body #game-menu #travel-shell, html body #game-menu #build-panel { grid-template-columns:1fr !important; }
  html body #game-menu #travel-worldmap { height:340px !important; }
  html body #game-menu #travel-map-legend { display:none; }
  html body #game-menu #travel-side-panel { display:grid; grid-template-columns:1fr 2fr; gap:16px; }
  html body #game-menu #travel-map-meta { display:flex !important; flex-direction:column; border:0; }
  html body #game-menu #build-detail { min-height:0; }
  html body #zone-panel { width:210px !important; }
}
@media(max-width:600px) {
  html body #game-menu .game-menu-heading { padding:12px 14px; }
  html body #game-menu-title { font-size:20px !important; }
  html body #game-menu-nav button { min-height:32px !important; font-size:12px !important; padding:5px 8px; }
  html body #game-menu #travel-side-panel { display:block; }
  html body #game-menu #travel-map-meta { display:grid !important; grid-template-columns:1fr 1fr !important; border-bottom:1px solid var(--menu-edge); }
  html body #game-menu #travel-worldmap { height:280px !important; }
  html body #game-menu #travel-zone-title { font-size:18px !important; }
  html body #game-menu .bl-pack-toolbar { grid-template-columns:1fr; }
  html body #game-menu .bl-pack-sort { max-width:none; }
  html body #game-menu .frontier-recipe { grid-template-columns:36px minmax(0,1fr) 58px; gap:10px; }
  html body #game-menu .frontier-item-icon { width:34px; height:34px; }
  html body #game-menu .frontier-recipe h3 { font-size:14px; }
  html body #game-menu .frontier-recipe button { padding:7px 5px; }
  html body #game-menu .market-row { display:flex; flex-wrap:wrap; }
  html body #game-menu .market-row>* { flex:1 1 100px; }
  html body #hud-root .hud-panel.status { width:176px !important; max-width:176px !important; padding:8px 10px !important; }
  html body #zone-panel { width:174px !important; top:116px !important; left:16px !important; transform:none !important; }
  html body #zone-title { font-size:13px !important; }
  html body #explore-controls { display:none !important; }
}

html body #game-menu :is(button,input,select) { border-color:var(--menu-edge) !important; }
html body #game-menu :focus-visible { outline:2px solid var(--menu-gold) !important; outline-offset:3px; }
html body #game-menu kbd { border-color:#576b50 !important; color:var(--menu-muted) !important; }
html body #game-menu :is(#zone-travel-status,#travel-map-zoom-value) { border:0 !important; background:none !important; box-shadow:none !important; padding:8px 0 !important; }
html body #game-menu :is(.worldmap-node text,.worldmap-node-label) { stroke:none !important; filter:none !important; }

html body #hud-root .hud-panel.status { border-color:var(--menu-edge) !important; }
html body :is(#zone-panel,#minimap-panel) { box-sizing:border-box !important; }
html body #zone-title { border:0 !important; background:none !important; box-shadow:none !important; padding:0 !important; }
html body #minimap-hint::after { font:11px/1.4 var(--menu-font) !important; text-transform:none !important; color:var(--menu-muted); }

/* Construction cards need their own rows; the older three-column badge layout
   clipped names when the catalog gained modular pieces. */
html body #game-menu #build-list { grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr)) !important; grid-auto-rows:minmax(96px,auto); align-items:stretch; }
html body #game-menu .build-card { grid-template-columns:60px minmax(0,1fr) !important; grid-template-rows:auto auto; gap:5px 12px !important; height:auto !important; min-height:96px !important; align-content:center; }
html body #game-menu .build-card-icon { width:60px; height:60px; grid-column:1; grid-row:1 / span 2; background:none; border:0; }
html body #game-menu .build-card-copy { grid-column:2; grid-row:1; align-self:end; }
html body #game-menu .build-card-copy strong { font:600 14px/1.35 var(--menu-font) !important; overflow-wrap:anywhere; }
html body #game-menu .build-card-copy>span { display:none; }
html body #game-menu .build-card-state { grid-column:2; grid-row:2; align-self:start; justify-self:start; padding:0; border:0; background:none; font:12px/1.4 var(--menu-font) !important; color:#d4a498; text-transform:none !important; letter-spacing:0 !important; }
html body #game-menu .build-card.is-ready .build-card-state { color:var(--menu-gold); }
html body #game-menu #build-detail h4 { font:600 20px/1.3 var(--menu-font) !important; margin:4px 0; }
html body #game-menu :is(#build-detail .ui-kicker,.build-section-title,.frontier-section-heading,.frontier-reward,.frontier-active-step) { color:var(--menu-gold) !important; font-family:var(--menu-font) !important; letter-spacing:0 !important; text-transform:none !important; }
html body #game-menu :is(.build-requirement,.build-facts span) { background:#142019; border:1px solid var(--menu-edge); border-radius:4px; }
html body #game-menu :is(.build-detail-icon,.build-requirement-icon) { background:none; border:0; }
html body #game-menu .frontier-notice { border-color:var(--menu-gold); background:#243429; }
/* World building and help share the menu's controls and type scale. */
html body #game-menu #build-detail { display:none !important; }
html body #game-menu #build-panel { display:block !important; }
html body #game-menu #build-list { max-height:none !important; overflow:visible !important; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)) !important; }
html body #game-menu .build-card-copy>span { display:block; color:var(--menu-muted); font:12px/1.5 var(--menu-font); margin-top:5px; }
html body #game-menu .build-card:disabled { opacity:.62; cursor:not-allowed; }
html body #game-menu .build-card:hover:not(:disabled) { border-color:var(--menu-gold) !important; background:#2b3e30 !important; }
html body #game-menu [hidden], #build-mode-dock [hidden] { display:none !important; }
#build-world-guides { position:fixed; inset:0; width:100vw; height:100vh; pointer-events:none; z-index:50; }
html body #build-mode-dock { width:max-content !important; max-width:calc(100vw - 40px) !important; padding:12px 16px !important; gap:12px !important; align-items:center; flex-wrap:wrap; }
html body #build-mode-dock button, #world-interact { border:1px solid var(--menu-edge); background:#243329; color:var(--menu-paper); border-radius:4px; padding:9px 12px; font:600 13px/1.4 var(--menu-font); cursor:pointer; }
html body #build-mode-dock button:hover, html body #build-mode-dock button[aria-pressed="true"] { border-color:var(--menu-gold); background:#3e5035; }
html body #build-mode-dock kbd { padding:1px 4px; border:1px solid var(--menu-edge); border-radius:2px; font:11px/1.4 var(--menu-font); margin-left:6px; }
html body #build-mode-label { font:600 15px/1.4 var(--menu-font) !important; text-transform:none !important; }
html body #build-mode-status { font:13px/1.4 var(--menu-font) !important; letter-spacing:0 !important; text-transform:none !important; max-width:380px; color:#e9b59d !important; }
html body #build-mode-dock.is-placeable #build-mode-status { color:#b6d4a7 !important; }
html body #build-mode-controls { font:11px/1.4 var(--menu-font) !important; color:var(--menu-muted); margin-top:4px; }
#explore-controls #world-interact { pointer-events:auto; padding:3px 7px; font-size:11px; }
#explore-controls #world-interact:disabled { background:none; border-color:transparent; color:var(--menu-muted); cursor:default; }
#explore-controls #world-interact.is-ready { background:#3d5132; border-color:#b7c581; color:#f1edcf; box-shadow:0 0 0 2px #b7c58122; }
#game-help h3 { font:600 23px/1.3 var(--menu-font); margin:0 0 10px; }
#game-help>p { color:var(--menu-muted); margin-bottom:24px; }
.help-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:20px; }
.help-grid section { padding:18px; background:var(--menu-surface); border:1px solid var(--menu-edge); border-radius:4px; }
.help-grid h4 { font:600 16px/1.4 var(--menu-font); color:var(--menu-paper); margin:0 0 10px; }
.help-grid p { font:13px/1.65 var(--menu-font); color:var(--menu-muted); margin:0 0 12px; }
.help-grid p:last-child { margin-bottom:0; }
@media(max-width:720px) { html body #build-mode-dock { bottom:95px !important; gap:8px !important; } #build-mode-icon { display:none; } }

html body #build-world-guides { background:transparent !important; box-shadow:none !important; border:0 !important; }
#build-world-guides[hidden] { display:none !important; }

html body #build-mode-dock { display:flex !important; width:min(820px,calc(100vw - 40px)) !important; flex-wrap:wrap; }
#build-mode-icon { flex:0 0 44px; }
#build-mode-copy { flex:1 1 230px; min-width:0; }
html body #build-mode-dock button { flex:0 0 auto; white-space:nowrap; }
body.build-placement-active #explore-controls { visibility:hidden; }

/* Gear belongs in the world, with one selected item and no instruction paragraph. */
html body #inventory-hotbar { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); right:auto; width:auto; padding:5px; border:1px solid var(--menu-edge); background:#131b17e8; border-radius:5px; z-index:65; }
html body #inventory-hotbar[hidden], body.game-menu-open #inventory-hotbar { display:none !important; }
html body #inventory-hotbar-list { display:flex; gap:4px; }
html body #inventory-hotbar .hotbar-slot { position:relative; width:54px; height:54px; min-width:0; padding:5px; display:grid; place-items:center; background:#213026; border:1px solid #44513f; border-radius:3px; }
html body #inventory-hotbar .hotbar-slot.equipped { background:#3d5138; border:2px solid #c1cf91; box-shadow:0 0 0 1px #111; }
html body #inventory-hotbar .hotbar-slot-icon { width:40px; height:40px; display:grid; place-items:center; }
html body #inventory-hotbar img { width:40px; height:40px; object-fit:contain; image-rendering:pixelated; }
html body #inventory-hotbar kbd { position:absolute; left:3px; top:0; border:0; background:none; font:10px sans-serif; color:#b7c1ae; }
html body #inventory-hotbar .active-gear-name { position:absolute; bottom:100%; padding-bottom:7px; width:100%; text-align:center; color:#edf2df; font:12px var(--menu-font); text-shadow:0 1px 3px #000; }
html body #inventory-hotbar .hands-icon { font-size:24px; filter:grayscale(.6); }
html body #game-menu-foot:empty { display:none; }
html body #explore-controls { bottom:94px; left:50%; right:auto; transform:translateX(-50%); padding:0; border:0; }
html body #game-menu .game-menu-heading small, html body #inventory-item-detail .inventory-detail-hint { display:none; }

#entry-character-name[hidden] {display:none!important} #character-roster {width:100%;padding:10px;background:#17221b;color:#e4e9dd;border:1px solid #53634b;border-radius:4px;font:16px system-ui}
.character-local-note{display:block;color:#acb9a6;font:11px system-ui;margin-top:5px}#character-preview{display:block;margin:8px auto;image-rendering:pixelated;width:135px;height:150px}
#character-panel{font-family:var(--menu-font);background:#17221b!important;border:1px solid #53634b!important;border-radius:6px!important}#character-panel h2{font:600 22px var(--menu-font)!important}
#game-menu .bl-item-detail-meta{font-size:12px;text-transform:none;letter-spacing:0}#game-menu .bl-item-detail-description{display:none}#game-menu .bl-item-detail-hint{display:none}

.hotbar-worn{display:grid;place-items:center;width:32px;border-left:1px solid #52634a;margin-left:4px}html body #inventory-hotbar .hotbar-worn img{width:28px;height:28px}

html body #minimap-panel {bottom:auto!important;width:194px!important;padding:4px!important;border:1px solid #52634b!important;border-radius:5px!important;background:#17231c!important;overflow:hidden}
html body #minimap-svg {display:block;height:184px!important;width:184px!important;border:0!important;border-radius:2px!important;margin:0!important}
html body #minimap-title {position:absolute;bottom:8px;right:8px;font:11px system-ui!important;background:#142119dc;padding:3px 6px;border-radius:3px}
html body #minimap-hint {display:none!important}

/* Keep character selection together at every viewport size. */
#entry-panel .entry-copy, #entry-panel .entry-side-stack, #entry-panel .entry-atlas-label, #entry-panel .entry-mark-sub, #entry-panel .entry-section-title { display:none!important; }
html body #entry-panel { place-items:center; overflow:auto; padding:24px; box-sizing:border-box; }
#entry-panel .entry-menu-shell { width:min(800px,100%)!important; height:auto; min-height:0; padding:24px; gap:20px; grid-template-rows:auto auto auto; background:#111c16; border:1px solid #43503b; border-radius:6px; }
#entry-panel .entry-menu-topline { flex-wrap:wrap; gap:12px; padding-bottom:16px; }
#entry-panel .entry-top-status { font-size:10px!important; }
#entry-panel .entry-menu-content { display:block!important; width:100%; padding:0!important; margin:0; }
#entry-panel .entry-world-card { display:block; width:100%; max-width:none; padding:0!important; border:0!important; background:none!important; }
#entry-panel .entry-world-shot-wide { width:100%; height:240px; min-height:0; max-height:none!important; aspect-ratio:auto; }
#entry-panel .entry-menu-footer { display:grid; grid-template-columns:1fr; gap:18px; padding:18px 0 0; margin:0; border:0; border-top:1px solid #43503b; }
#entry-panel .entry-setup-shell { display:block; width:100%; min-width:0; }
#entry-panel .entry-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; }
#entry-panel .entry-field { min-width:0; }
#entry-panel :is(#character-roster,#entry-zone-id) { width:100%; min-height:42px; box-sizing:border-box; margin:0; font:14px var(--menu-font); }
#entry-panel #entry-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; width:100%; margin:0; }
#entry-panel #entry-actions button { min-width:0; width:100%; min-height:42px; padding:8px; font:600 13px var(--menu-font); letter-spacing:0; text-transform:none; }
#entry-panel #entry-status { position:static; min-height:0; margin:0; text-align:center; }
#entry-panel #entry-status:empty { display:none; }
@media(max-width:600px) {
  html body #entry-panel { padding:12px; }
  #entry-panel .entry-menu-shell { padding:16px; gap:14px; }
  #entry-panel .entry-world-shot-wide { height:160px; }
  #entry-panel #entry-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-height:650px) {
  html body #entry-panel { align-items:start; padding:12px; }
  #entry-panel .entry-menu-shell { padding:16px; gap:12px; }
  #entry-panel .entry-world-shot-wide { height:140px; }
}

html body #inventory-hotbar {overflow:visible!important;min-width:0!important;max-width:calc(100vw - 40px)!important}
html body #inventory-hotbar #inventory-hotbar-list{width:auto!important;display:flex!important;grid-template-columns:none!important}
html body #inventory-hotbar #inventory-hotbar-list .hotbar-slot{width:54px!important;min-width:54px!important;max-width:54px!important;height:54px!important;min-height:54px!important;padding:4px!important;flex:0 0 54px!important}

html body #inventory-hotbar #inventory-hotbar-list .hotbar-slot{grid-template-columns:1fr!important;gap:0!important}
html body #hud-root .hud-status-connection:not(.offline), html body #hud-root .hud-status-map{display:none!important}
html body #hud-root .hud-panel.status {width:174px!important;max-width:174px!important;padding:8px!important}
html body #game-menu .bl-item-detail-tip {display:none!important}

#game-menu .frontier-lead{display:none}#game-menu .frontier-goal h3+p{display:block;color:var(--menu-muted);max-width:65ch}

/* One readable terminal treatment for character creation and game panels. */
:root { --menu-font:Consolas,"Lucida Console",monospace; }
html body :is(#game-menu,#character-panel,.entry-menu-shell) { border-radius:0!important; border-style:double!important; border-width:3px!important; box-shadow:none!important; }
html body :is(#game-menu,#character-panel) :is(button,input,select) { border-radius:0!important; font:14px/1.4 var(--menu-font)!important; letter-spacing:0!important; text-transform:none!important; }
html body #game-menu :is(h2,h3,h4,kbd) { font-family:var(--menu-font)!important; }
html body #game-menu button.is-active::before { content:">"; color:#c4d895; }
html body #game-menu .build-card { opacity:1; text-align:left; }
html body #game-menu .build-card[data-can-build="false"] { cursor:help; }
.build-materials { display:grid; gap:3px; text-transform:none!important; letter-spacing:0!important; }
.build-materials .has-material { color:#b6ce91; }
.build-materials .needs-material { color:#e0b99b; }
#game-menu .build-card-state { white-space:normal; text-transform:none; }
#game-menu .build-card.show-requirements { outline:2px solid #d4af7c; }
html body #character-panel { width:min(640px,calc(100vw - 24px))!important; max-height:calc(100dvh - 24px)!important; padding:20px!important; overflow:auto!important; box-sizing:border-box; }
html body #character-panel #character-preview { position:static!important; inset:auto!important; transform:none!important; display:block!important; width:162px!important; height:216px!important; margin:12px auto 20px!important; background:none!important; pointer-events:none; }
html body #character-panel h2 { margin:0 0 12px!important; font:600 20px var(--menu-font)!important; }
html body #character-panel .row { display:grid!important; gap:6px!important; margin:0 0 12px!important; }
html body #character-panel .grid { display:grid!important; grid-template-columns:1fr 1fr!important; gap:12px!important; }
html body #character-panel label { font:13px var(--menu-font)!important; }
html body #character-panel :is(input,select) { min-width:0!important; width:100%!important; height:40px!important; padding:8px!important; box-sizing:border-box; }
html body #character-panel .actions { display:flex!important; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin:12px 0 0!important; }
html body #character-panel button { background:#293a2b!important; border:1px solid #6a7956!important; color:#e5e8d9!important; padding:9px 12px!important; }
html body #character-panel #character-save { background:#b5c388!important; color:#152019!important; }
.entry-settings-open #game-menu { z-index:1250; }
.entry-settings-open #game-menu .game-menu-layout { grid-template-columns:1fr; }
.entry-settings-open :is(#game-menu-nav,#game-menu-wallet) { display:none!important; }

#combat-veil { position:fixed; inset:0; z-index:180; background:radial-gradient(ellipse,#140c0c70,#100708e8); pointer-events:none; opacity:0; transition:opacity .35s; }
.combat-down #combat-veil { opacity:1; }
.combat-down #browserlands_canvas { filter:grayscale(.8) brightness(.55); }
html body.combat-down #combat-status { z-index:230; top:50%; bottom:auto; transform:translate(-50%,-50%); min-width:260px; text-align:center; padding:28px; border:3px double #ac8b74; border-radius:0; }
html body.combat-down #combat-status strong { font:600 26px var(--menu-font); }
html body.combat-down #combat-status button { margin:18px auto 0; font-family:var(--menu-font); border-radius:0; }

html body #game-menu #build-list { grid-template-columns:repeat(auto-fill,minmax(min(250px,100%),1fr)); }
html body #game-menu .build-card { min-height:136px; }
html body #game-menu .build-card .build-materials { display:grid!important; gap:4px; font-size:12px!important; letter-spacing:0!important; text-transform:none!important; }
html body #game-menu .build-card .build-materials span { display:block!important; font:12px/1.4 var(--menu-font)!important; letter-spacing:0!important; text-transform:none!important; }

html body #inventory-hotbar .active-gear-name {left:50%;width:max-content;max-width:220px;transform:translateX(-50%);}
html body #game-menu .build-card.is-ready,html body #game-menu .frontier-recipe.is-ready {border-color:#839e67!important;background:#293b29!important;}
/* Keep missing-material explanations as readable as craftable recipes. */
html body #game-menu .frontier-recipe.is-missing {opacity:1;}
#swing-cooldown{position:fixed;bottom:118px;left:50%;transform:translateX(-50%);width:48px;height:5px;z-index:90;accent-color:#ded797;pointer-events:none;border:1px solid #243025;}
#swing-cooldown[hidden]{display:none}.flying-arrow{position:fixed;pointer-events:none;color:#f4dfac;font:20px Consolas;text-shadow:1px 1px #231b12;z-index:28;}
#swing-cooldown { appearance:none; -webkit-appearance:none; border-radius:0; background:#17251b; overflow:hidden; }
#swing-cooldown::-webkit-progress-bar { background:#17251b; border-radius:0; }
#swing-cooldown::-webkit-progress-value { background:#ded797; border-radius:0; }
#swing-cooldown::-moz-progress-bar { background:#ded797; border-radius:0; }
html body #hud-root .hud-harvest-cooldown, html body #hud-root .hud-harvest-cooldown .fill {border-radius:0!important;box-shadow:none!important;}
#map-mode-tabs{display:flex;gap:6px;margin-bottom:12px}#map-mode-tabs button[aria-pressed="true"]{background:#48603b!important;border-color:#c1ce98!important}#local-map-controls{margin-left:auto;display:flex;gap:4px}
html body #game-menu #travel-shell.local-map-open{grid-template-columns:1fr!important}
.local-map-open #travel-side-panel,.local-map-open #travel-map-toolbar,.local-map-open #travel-map-compass{display:none!important}
html body #game-menu #travel-shell.local-map-open #travel-worldmap{height:min(48vh,520px)!important;max-height:none!important;background:#172c30!important;aspect-ratio:auto!important}
#local-map-svg{width:100%;height:100%;touch-action:none;cursor:grab;image-rendering:pixelated}
#local-map-legend{display:flex;justify-content:center;flex-wrap:wrap;gap:18px;padding:10px;font:12px var(--menu-font);color:#cbd2b6}
#travel-shell:not(.local-map-open) :is(#local-map-legend,#local-map-controls){display:none}
html body #game-menu #travel-worldmap .worldmap-node image{opacity:.92}html body #game-menu #travel-worldmap .worldmap-node.current image{opacity:1}
html body #game-menu #travel-shell.local-map-open :is(#travel-map-toolbar,#travel-side-panel){display:none!important}
html body #game-menu #travel-shell.local-map-open #zone-travel-status{display:none!important}
html body #game-menu #travel-map-meta{display:none!important}
html body #game-menu #travel-worldmap .worldmap-node.state-unknown image{opacity:.35}
html body #game-menu #travel-worldmap .worldmap-node.state-unknown polygon{fill:#20322b!important;stroke:none!important}
html body #game-menu #travel-worldmap .worldmap-node.state-unknown path{stroke:none!important}
html body #game-menu #travel-worldmap .worldmap-node-label{font-size:9px!important;stroke:#15261b!important;stroke-width:2px!important;paint-order:stroke;}

/* Square, stepped panels and inset slots share the world's pixel rhythm. */
#game-menu, #entry-panel, .hud-panel, #zone-panel, #minimap-panel, #inventory-hotbar, #game-menu-toggle {
  border-radius:0!important;border:2px solid #59664a!important;
  box-shadow:inset 0 0 0 2px #11190f,0 0 0 2px #080d08,4px 4px 0 #080d0890!important;
  background-color:#142016f5!important;font-family:Consolas,"Lucida Console",monospace!important;
}
#game-menu button, #entry-panel button {border-radius:0!important;box-shadow:inset 2px 2px #ffffff0d,inset -2px -2px #0005;font-family:inherit!important;}
#game-menu button:hover, #entry-panel button:hover {border-color:#ddcf88!important;background-color:#34432b!important;}
#game-menu button:active, #entry-panel button:active {box-shadow:inset 2px 2px #0008;transform:translateY(1px);}
#game-menu input, #game-menu select {border-radius:0!important;font-family:inherit!important;}
#game-menu kbd, .hud-bar, .hud-bar .fill {border-radius:0!important;}
#game-menu .frontier-reward {display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:4px;}
#game-menu .goal-track {width:100%;font-size:20px;padding:0;line-height:28px;}
#game-menu .goal-track[aria-pressed="true"] {color:#f0d486;border-color:#f0d486;}
#tracked-journal {width:190px;max-width:35vw;display:grid;gap:6px;pointer-events:auto;}
#tracked-journal:empty {display:none;}
#tracked-journal button {display:grid;grid-template-columns:1fr auto;gap:3px 8px;text-align:left;padding:6px;background:#142016dc;color:#e7dfc9;border:0;border-left:2px solid #cfb878;font:11px/1.3 Consolas,monospace;}
#tracked-journal small {color:#cfb878;font-size:10px;}
#tracked-journal progress {grid-column:1/-1;width:100%;height:3px;accent-color:#cfb878;}
@media(max-width:700px) {
  #game-menu {width:calc(100vw - 16px);height:calc(100dvh - 16px);}
  #game-menu header {padding:10px 12px;} #game-menu header h2 {font-size:18px;}
  .game-menu-layout {grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);}
  #game-menu-nav {flex-direction:row;flex-wrap:nowrap;padding:6px;gap:4px;border-right:0;border-bottom:1px solid var(--menu-edge);}
  #game-menu-nav button {white-space:nowrap;flex:0 0 auto;font-size:11px;padding:6px;} #game-menu-nav kbd {display:none;}
  #game-menu-pages {padding:12px;} #game-menu-foot {display:none;}
  #zone-panel {top:8px!important;width:160px!important;} #zone-title {font-size:12px!important;}
  #minimap-panel {top:78px!important;right:8px!important;width:112px!important;} #minimap-svg {height:90px!important;}
  #hud-root .hud-panel.status {max-width:132px;padding:6px;} #tracked-journal {width:132px;max-width:34vw;}
  #tracked-journal button {font-size:10px;} #tracked-journal small {font-size:9px;}
  .inventory-layout, .frontier-storage {grid-template-columns:1fr!important;}
}
@media(max-height:540px) {#game-menu{height:calc(100dvh - 12px);}#game-menu header{padding:8px 12px;}#game-menu-pages{padding:12px;}#game-menu-foot{display:none;}}

/* Override the older stacked-overlay mobile layout. */
html body #hud-root .hud-row.top>.hud-stack.left {margin-top:0!important;}
html body #hud-root :is(.hud-panel,.hud-floating-label,.hud-harvest-popup),html body :is(#zone-panel,#minimap-panel,#build-mode-dock,#action-toast) {border-radius:0!important;border:2px solid #59664a!important;box-shadow:inset 0 0 0 2px #11190f,2px 2px 0 #080d08!important;}
html body #inventory-hotbar {width:max-content!important;}
@media(max-width:700px){
 html body #hud-root {padding:8px!important;}
 html body #hud-root .hud-panel.status:not(.hidden) {display:block!important;width:132px!important;min-width:132px!important;max-width:132px!important;padding:6px!important;}
 html body #zone-panel {top:8px!important;left:auto!important;right:8px!important;bottom:auto!important;transform:none!important;width:min(210px,calc(100vw - 158px))!important;}
 html body #minimap-panel {top:88px!important;bottom:auto!important;right:8px!important;width:112px!important;}
 html body #inventory-hotbar #inventory-hotbar-list {max-width:calc(100vw - 36px)!important;overflow-x:auto;}
 html body #inventory-hotbar #inventory-hotbar-list .hotbar-slot {width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;flex-basis:44px!important;}
 html body #game-menu-toggle {bottom:90px;left:8px;padding:6px 9px;font-size:11px;}
}
@media(min-width:701px) and (max-width:1260px){
 html body #zone-panel {top:8px!important;left:50%!important;right:auto!important;bottom:auto!important;transform:translateX(-50%)!important;width:210px!important;}
}

@media(max-width:700px){html body #inventory-hotbar{bottom:18px!important;}html body #game-menu-toggle{bottom:86px!important;}}

/* CP437 box frames, inset pixel slots and bracketed selection. */
html body #game-menu,html body #entry-panel {
 border:4px double #9aa779!important;
 box-shadow:0 0 0 2px #0a100b,6px 6px 0 #080d08!important;
 background-image:repeating-linear-gradient(0deg,#ffffff02 0 1px,transparent 1px 4px)!important;
}
html body #game-menu .game-menu-heading {border-bottom:3px double #677452;}
html body #game-menu #game-menu-nav {border-right:3px double #677452;}
html body #game-menu #game-menu-nav button {border-color:transparent!important;box-shadow:none!important;position:relative;padding-left:20px;}
html body #game-menu #game-menu-nav button::before {content:'>';position:absolute;left:5px;visibility:hidden;color:#e5d38c;}
html body #game-menu #game-menu-nav button:is(.active,[aria-current="page"],[aria-pressed="true"])::before,
html body #game-menu #game-menu-nav button:hover::before {visibility:visible;}
html body #game-menu :is(.inventory-card,.build-card,.storage-slot) {border-radius:0!important;box-shadow:inset 2px 2px #080d08,inset -2px -2px #63725055!important;}
html body #game-menu button:focus-visible,html body #inventory-hotbar button:focus-visible {outline:2px dashed #f0d486;outline-offset:2px;}
html body #inventory-hotbar .hotbar-slot.equipped {border:3px double #f0d486!important;box-shadow:0 0 0 2px #10190d!important;}
html body #hud-root .hud-bar {border:1px solid #74815d!important;box-shadow:inset 1px 1px #0008;}
html body #hud-root .hud-bar .fill {background-image:repeating-linear-gradient(90deg,transparent 0 9px,#07130945 9px 10px)!important;}
#tracked-journal {width:228px;max-width:40vw;}
#tracked-journal button {border:3px double #6d7953;padding:7px;background:#111c13ef;box-shadow:2px 2px #091009;}
#tracked-journal .tracked-title {color:#e6dcae;}
#tracked-journal .tracked-step,#tracked-journal .tracked-hint {grid-column:1/-1;}
#tracked-journal .tracked-step {color:#f3eedb;}
#tracked-journal .tracked-step::before {content:'> ';color:#d6bd72;}
#tracked-journal .tracked-hint {color:#aebba0;font-size:10px;}
#tracked-journal progress {height:4px;}
#game-menu .journal-steps {list-style:none;margin:10px 0;padding:0;display:grid;gap:9px;}
#game-menu .journal-steps li {display:flex;gap:8px;color:#a8b09d;font:12px/1.4 var(--menu-font);}
#game-menu .journal-steps li.is-current {color:#f1dda0;}
#game-menu .journal-steps li.is-complete {color:#9daf81;}
#game-menu .journal-steps small {display:block;color:#a8b09d;margin-top:2px;}
@media(max-width:700px){
 #tracked-journal {width:154px;max-width:40vw;}
 #tracked-journal button {padding:5px;gap:4px;}
 #tracked-journal .tracked-hint {font-size:9px;}
 html body #game-menu #game-menu-nav {border-right:0;border-bottom:3px double #677452;}
}

/* Crisp map pixels and an explicit, terrain-free unexplored atlas tile. */
#local-map-svg image,#minimap-svg image,[data-region-terrain]{image-rendering:pixelated;}
html body #game-menu #travel-worldmap .worldmap-node.state-unknown polygon{fill:#19251c!important;stroke:#687354!important;stroke-dasharray:2 3;}
html body #game-menu #travel-worldmap .worldmap-node.state-unknown{opacity:1!important;}

#waypoint-controls{display:flex;gap:6px;margin:8px 0;flex-wrap:wrap;}#waypoint-controls input{min-width:90px;width:150px;}#waypoint-controls select{max-width:200px;}#waypoint-pin[aria-pressed="true"]{outline:2px solid #f0d486;}#waypoint-bearing{border:0;background:transparent;color:#f0d486;font:11px Consolas,monospace;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}[data-waypoint]{cursor:pointer;}
/* Audio controls share the same compact, readable layout. */
#settings-audio-view .settings-audio-row { display:grid; grid-template-columns:120px minmax(0,1fr) 54px; align-items:center; gap:12px; margin:12px 0; }
#settings-audio-view .settings-audio-row input { width:100%; accent-color:#c8bd7d; }
#settings-audio-view .settings-audio-row output { text-align:right; font-variant-numeric:tabular-nums; }
#waypoint-controls {display:block;}
#waypoint-list {display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;}
#waypoint-list button[aria-pressed="true"] {border-color:#f0d486;color:#f0d486;}
#waypoint-editor {display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px;margin:8px 0;border:2px solid #8b9468;background:#17251b;}
#waypoint-editor[hidden] {display:none;}
#waypoint-editor strong {flex-basis:100%;}
#waypoint-editor input {flex:1;min-width:120px;}
#travel-shell:not(.local-map-open) #waypoint-controls {display:none;}

/* Map editing floats over the map; creating/saving a pin never moves it. */
#waypoint-controls {position:relative;}
#waypoint-list {height:34px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;}
#waypoint-list button {flex-shrink:0;}
#waypoint-editor {position:absolute;z-index:30;top:64px;left:8px;right:8px;margin:0;box-shadow:4px 4px #080d08;}
.view-zoom-control {display:grid;grid-template-columns:1fr auto;gap:12px;}
.view-zoom-control input,.view-zoom-control p {grid-column:1/-1;}
.view-zoom-control output {color:#eed18b;font-variant-numeric:tabular-nums;}
.view-zoom-control input[type=range] {appearance:none;width:100%;height:8px;background:#30452f;border:1px solid #8b9468;border-radius:0;}
.view-zoom-control input::-webkit-slider-thumb {appearance:none;width:14px;height:20px;background:#eed18b;border:2px solid #17251b;border-radius:0;}
.view-zoom-control input::-moz-range-thumb {width:12px;height:18px;background:#eed18b;border:2px solid #17251b;border-radius:0;}
.view-zoom-control p {margin:0;color:#b5bea6;}
html body #game-menu .settings-control-block[hidden] {display:none!important;}
html body #game-menu #town-panel {min-width:0;width:100%;}
html body #game-menu #town-controls {display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,1fr);gap:20px;min-width:0;}
html body #game-menu #town-controls>div {grid-column:1;grid-row:auto;min-width:0;width:auto;}
html body #game-menu #town-controls #town-territory-section {grid-column:2;grid-row:1/span 4;}
html body #game-menu #town-territory-map {display:block;width:100%;min-width:0;padding:0;background:#15251b;border:1px solid #8b9468;border-radius:0;}
#town-terrain-svg {display:block;width:100%;height:auto;aspect-ratio:1;overflow:hidden;}
#town-overview {border-bottom:3px double #677452;padding:4px 0 16px;margin-bottom:16px;}
#town-overview p,#town-policy-grid p {font:12px/1.6 var(--menu-font);color:#b5bea6;}
#town-facts {color:#eed18b;line-height:1.8;}
#town-overview form {display:flex;gap:8px;align-items:end;margin:12px 0;}
#town-overview form[hidden] {display:none;}
#town-overview label {display:grid;gap:6px;}
#town-overview input {max-width:100%;}
#town-overview #town-fund-amount {width:110px;}
#town-overview {display:grid;grid-template-columns:1fr 1fr;gap:4px 16px;}
#town-overview>p,#town-overview>#town-facts {grid-column:1/-1;}
#town-overview form {margin:4px 0;}
html body #game-menu #town-controls [hidden] {display:none!important;}
html body #game-menu #town-controls .town-row {display:flex;flex-wrap:wrap;}
html body #game-menu #town-controls .town-row select {min-width:100px;flex:1;}
@media(max-width:850px){html body #game-menu #town-controls {grid-template-columns:minmax(0,1fr);}html body #game-menu #town-controls #town-territory-section {grid-column:1;grid-row:auto;}#town-overview form {flex-wrap:wrap;}}
@media(max-width:650px){#town-overview {grid-template-columns:1fr;}}
body.world-arriving #browserlands_canvas { visibility: hidden; }
#world-loading-panel {position:fixed;inset:0;z-index:20000;display:grid;place-items:center;padding:24px;background:#0b140ef5;color:#e0e7d7;font:14px monospace;}
#world-loading-panel[hidden] {display:none;}
.loading-card {width:min(520px,100%);box-sizing:border-box;padding:30px;border:1px solid #7d9069;outline:3px solid #152318;outline-offset:4px;background:#1b2b20;box-shadow:0 16px 70px #0009;}
.loading-card small {color:#c8b478;letter-spacing:.12em;font-size:11px;}
.loading-card h1 {font:700 24px monospace;line-height:1.3;margin:18px 0 12px;}
.loading-detail {color:#b7c5a9;min-height:2em;}
.loading-card progress {display:block;width:100%;height:7px;accent-color:#aabf8b;}
.loading-card progress[hidden] {display:none;}
.loading-recovery {border-top:1px solid #516146;margin-top:24px;padding-top:12px;font-size:12px;line-height:1.6;}
.loading-recovery button {font:inherit;color:#e0e7d7;background:#354a32;border:1px solid #87996e;padding:9px 12px;margin:6px 8px 0 0;cursor:pointer;}
.loading-recovery button:focus-visible {outline:2px solid #e4cf88;outline-offset:3px;}
.harvest-receipt {position:fixed;z-index:25;pointer-events:none;padding:6px 9px;display:grid;gap:4px;background:#17251eed;border:1px solid #7d9069;color:#e0e7d7;box-shadow:0 2px 0 #080e0a;font:700 12px/1.4 monospace;white-space:nowrap;}
.harvest-receipt[hidden] {display:none;}
html body #status {background:#1b2b20;color:#e0e7d7;border:1px solid #7d9069;padding:18px 24px;font:14px monospace;}
html body #progress {accent-color:#aabf8b;}

#interior-shade {background:transparent;position:fixed;inset:0;width:100%;height:100%;z-index:4;pointer-events:none;opacity:0;transition:opacity .35s ease;}
.interior-setting {display:flex;gap:10px;align-items:center;padding:16px 0;}
html body #action-toast.is-error {top:auto;bottom:110px;border-color:#cf9770!important;background:#281b15f5!important;max-width:min(500px,calc(100vw - 24px));padding:12px 16px;}
html body #action-toast.is-error #action-toast-title {color:#f3c8a7;font-size:15px;}
.game-credits {margin-top:24px;border-top:1px solid var(--menu-edge);padding-top:16px;}
/* Compact receipts follow the measured compass, including pinned waypoints. */
html body #action-toast:not(.is-error) {top:var(--action-toast-top,120px);min-height:0;padding:6px 10px;gap:7px;max-width:min(540px,calc(100vw - 24px));}
html body #action-toast:not(.is-error).has-icon {grid-template-columns:26px minmax(0,1fr);}
html body #action-toast:not(.is-error) #action-toast-icon {width:24px;height:24px;border:0;border-radius:0;}
html body #action-toast:not(.is-error) #action-toast-icon .bl-item-art-row {font-size:5px;}
#action-toast-detail:empty {display:none;}

/* Spell art and compact finish choices use the shared menu chrome. */
#magic-spells .spell-preview {position:static;inset:auto;pointer-events:none;transform:none;display:block;width:100%;max-width:240px;height:90px;background:transparent;border:0;box-shadow:none;margin:8px 0 14px;}
.building-choices {display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;}
.building-finishes {display:flex;flex-wrap:wrap;gap:5px;align-items:center;}
.building-finishes>span {color:var(--menu-muted);margin-right:4px;}
#game-menu .building-finishes button {min-height:28px;padding:3px 8px;}
#game-menu .building-finishes button[aria-pressed=true] {border-color:var(--menu-gold);background:#344333;}
.build-card-state:empty {display:none;}
html body #game-menu .build-card.is-undiscovered {border-style:dashed!important;background:#18241d!important;}
html body #game-menu .build-discovery-badge {display:table;margin:6px 0;padding:2px 6px;border:1px solid var(--menu-gold);color:var(--menu-gold);background:#343825;font:700 11px/1.4 var(--menu-font);}
html body #game-menu .build-card.is-undiscovered .build-card-state {color:var(--menu-gold);font-weight:700!important;}
html body #game-menu .build-card.is-undiscovered .build-materials {display:none!important;}
html body #game-menu .build-card.is-undiscovered .build-card-icon {opacity:.55;}

#inventory-hotbar #active-spell-label {position:absolute;bottom:calc(100% + 25px);left:50%;transform:translateX(-50%);width:max-content;max-width:220px;text-align:center;font:12px var(--menu-font);text-shadow:0 1px 3px #000;}
