/* Branch F HUD: the world fills the screen and panels float over it.
   Scoped to body.hud-f so every element and id from the older layout stays
   in place for the systems that read them. */

body.hud-f{--hud-bg:rgba(17,22,16,.86);--hud-line:rgba(215,183,92,.22);--hud-shadow:0 8px 26px rgba(0,0,0,.38)}

/* Top bar: slimmer, one row. */
body.hud-f .topbar{min-height:48px;padding:5px 10px;gap:8px}
body.hud-f .brand small{display:none}
body.hud-f .brand h1{font-size:15px;letter-spacing:.12em}
body.hud-f .brand-mark{transform:scale(.8)}
body.hud-f .top-actions button{height:30px;padding:0 10px}
body.hud-f #export-btn,body.hud-f #import-btn,body.hud-f #debug-toggle{display:none}
body.hud-f.hf-show-system #export-btn,body.hud-f.hf-show-system #import-btn,body.hud-f.hf-show-system #debug-toggle{display:inline-flex}
body.hud-f .top-actions .hf-on{border-color:var(--accent);color:var(--accent)}

/* World fills everything under the top bar. */
body.hud-f .main-grid{display:block;position:relative;padding:0;flex:1;min-height:0}
body.hud-f .game-column{position:absolute;inset:0;display:block}
body.hud-f .canvas-wrap{position:absolute;inset:0;border:0;border-radius:0}
body.hud-f .status-strip{display:none}

/* Floating columns. The column itself ignores the mouse so the map stays usable between panels. */
body.hud-f .sidebar{position:absolute;top:10px;z-index:14;max-height:calc(100% - 104px);overflow:auto;pointer-events:none;gap:8px;scrollbar-width:none}
body.hud-f .sidebar::-webkit-scrollbar{display:none}
body.hud-f .sidebar>*{pointer-events:auto}
body.hud-f .main-grid>.sidebar:first-child{left:10px;width:236px}
body.hud-f .main-grid>.sidebar:last-of-type{right:10px;width:300px}
body.hud-f .panel{background:var(--hud-bg);border-color:var(--hud-line);box-shadow:var(--hud-shadow);backdrop-filter:blur(6px)}

/* Objective: compact card. */
body.hud-f .objective-panel{padding:9px 11px}
body.hud-f .objective-panel .objective-title{font-size:15px}
body.hud-f .objective-panel .objective-copy{font-size:11.5px;line-height:1.45;max-height:4.4em;overflow:hidden}
body.hud-f .objective-panel:hover .objective-copy{max-height:none}

/* Colony stats and the job queue live behind the Colony button. */
body.hud-f .main-grid>.sidebar:first-child>.panel:not(.objective-panel):not(.settler-panel){display:none}
body.hud-f .main-grid>.sidebar:last-of-type>.panel:not(.selection-wrap):not(.alerts-panel-v370){display:none}
body.hud-f.hf-show-colony .main-grid>.sidebar:first-child>.panel,
body.hud-f.hf-show-colony .main-grid>.sidebar:last-of-type>.panel{display:block}

/* Selection only appears when something is selected. */
body.hud-f .selection-wrap{display:none}
body.hud-f.hf-has-selection .selection-wrap{display:block;max-height:calc(100vh - 230px);overflow:auto;scrollbar-width:thin}

/* Alerts: compact notifications. */
body.hud-f .alerts-panel-v370{padding:7px 9px}
body.hud-f .alerts-panel-v370 .panel-title{font-size:11px;margin-bottom:4px}
body.hud-f .alerts-panel-v370.hf-empty{display:none!important}
body.hud-f .alert-row-v370{font-size:11px;padding:5px 7px}

/* Settler cards with portrait and mood bar. */
body.hud-f .settler-panel{padding:8px}
body.hud-f .settler-panel .panel-title{margin-bottom:6px}
body.hud-f #colonist-list{display:flex;flex-direction:column;gap:4px;max-height:44vh;overflow:auto;scrollbar-width:thin}
body.hud-f .colonist-row{display:grid;grid-template-columns:34px 1fr;grid-template-rows:auto auto;column-gap:8px;align-items:center;padding:4px 6px;min-height:0;text-align:left}
body.hud-f .colonist-row .hf-portrait{grid-row:1/3;width:34px;height:34px;border-radius:6px;background:#2a3726;border:1px solid rgba(255,255,255,.08);image-rendering:auto}
body.hud-f .colonist-row>span:first-of-type{display:flex;flex-direction:column;min-width:0}
body.hud-f .colonist-row strong{font-size:12.5px}
body.hud-f .colonist-row small{display:none}
body.hud-f .colonist-row .colonist-state{grid-column:2;font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;max-width:none}
body.hud-f .colonist-row .hf-mood{grid-column:2;height:3px;border-radius:2px;background:rgba(255,255,255,.1);overflow:hidden;margin-top:3px}
body.hud-f .colonist-row .hf-mood i{display:block;height:100%;background:var(--good)}
body.hud-f .colonist-row .hf-mood i.low{background:#c99a45}
body.hud-f .colonist-row .hf-mood i.bad{background:var(--danger)}

/* Resources become a horizontal bar at top centre. */
body.hud-f .resource-overlay{left:50%;top:10px;transform:translateX(-50%);width:auto;max-width:calc(100% - 600px);border-radius:10px;background:var(--hud-bg);box-shadow:var(--hud-shadow)}
body.hud-f .resource-overlay-head{display:none}
body.hud-f .resource-overlay-grid{display:flex!important;flex-wrap:wrap;justify-content:center;gap:2px 12px;padding:6px 12px}
body.hud-f .mini-resource{display:flex;gap:5px;align-items:baseline;padding:0;background:none;border:0}
body.hud-f .mini-resource span{font-size:10.5px;color:var(--muted)}
body.hud-f .mini-resource strong{font-size:13px}
body.hud-f .mini-resource.danger strong{color:#ff9b8c}

/* Toasts sit below the resource bar. */
body.hud-f .toast-layer{padding-top:62px}

/* Build bar floats at the bottom centre. */
body.hud-f .toolbar-wrap{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:15;width:auto;max-width:calc(100% - 20px);background:var(--hud-bg);border-color:var(--hud-line);box-shadow:var(--hud-shadow);backdrop-filter:blur(6px)}
body.hud-f .tool-help{text-align:center}

/* Date and weather stay in the bottom-right corner, clear of the build bar. */
body.hud-f .world-status-float{top:auto;bottom:10px;right:10px;z-index:13}
body.hud-f .main-grid>.sidebar:last-of-type{max-height:calc(100% - 86px)}

/* Narrow screens: collapse the settler column to portraits only. */
@media (max-width:1100px){
  body.hud-f .main-grid>.sidebar:first-child{width:62px}
  body.hud-f .objective-panel{display:none}
  body.hud-f .colonist-row{grid-template-columns:34px}
  body.hud-f .colonist-row>span,body.hud-f .colonist-row .hf-mood{display:none}
  body.hud-f .resource-overlay{max-width:calc(100% - 420px)}
}

/* Start menu. */
body.hud-f .menu-card{width:min(620px,92vw);padding:34px 34px 26px}
body.hud-f .menu-card .logo{font-size:52px;letter-spacing:.12em;line-height:1;margin-top:4px}
body.hud-f .menu-card .subtitle{font-size:15px;line-height:1.5;margin:10px 0 22px;color:#c9cdbd}
body.hud-f .hf-scenarios{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}
body.hud-f .hf-scenarios button{display:flex;flex-direction:column;gap:4px;align-items:flex-start;text-align:left;padding:12px;border-radius:8px;border:1px solid var(--border);background:var(--panel2);color:var(--text);cursor:pointer;min-height:92px}
body.hud-f .hf-scenarios button strong{font-size:14px}
body.hud-f .hf-scenarios button span{font-size:11.5px;line-height:1.4;color:var(--muted)}
body.hud-f .hf-scenarios button.on{border-color:var(--accent);background:rgba(138,116,57,.22)}
body.hud-f .new-game-options label:first-child{display:none}
body.hud-f .new-game-options{margin-bottom:16px}
body.hud-f .menu-buttons button[onclick]{display:none}
@media (max-width:620px){body.hud-f .hf-scenarios{grid-template-columns:1fr}body.hud-f .menu-card .logo{font-size:40px}}

/* Choose your settlers. */
.hf-picker{position:fixed;inset:0;z-index:40;display:grid;place-items:center;background:rgba(8,11,8,.72);backdrop-filter:blur(3px);padding:16px}
.hf-picker-card{width:min(1040px,100%);max-height:calc(100vh - 32px);overflow:auto;background:#151b14;border:1px solid #4c5945;border-radius:12px;padding:24px;box-shadow:0 30px 100px rgba(0,0,0,.5)}
.hf-picker h2{margin:4px 0 4px;font-size:26px;color:#f0df9c;letter-spacing:.04em}
.hf-picker p.lead{margin:0 0 18px;color:#aab3a1;font-size:13px}
.hf-picker-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.hf-pick{background:#1d241c;border:1px solid #343e32;border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px}
.hf-pick-head{display:flex;gap:10px;align-items:center}
.hf-pick-head canvas{width:44px;height:44px;border-radius:8px;background:#2a3726}
.hf-pick-head strong{display:block;font-size:16px}
.hf-pick-head small{color:#9ea795;font-size:11.5px}
.hf-pick .traits{display:flex;flex-wrap:wrap;gap:4px}
.hf-pick .traits span{font-size:10.5px;padding:2px 6px;border-radius:10px;background:#2b3428;color:#d5d9c8;cursor:help}
.hf-pick .skills{display:grid;grid-template-columns:1fr auto;gap:2px 8px;font-size:11.5px;color:#c9cdbd}
.hf-pick .skills b{font-weight:700;color:#ecebdc}
.hf-pick .skills .p2{color:#f0c96a}.hf-pick .skills .p1{color:#d8c88e}.hf-pick .skills .pn{color:#b97d72}
.hf-pick button{margin-top:auto;height:32px;border-radius:6px;border:1px solid var(--border);background:var(--panel2);color:var(--text);cursor:pointer;font-weight:600}
.hf-pick button:hover{border-color:var(--accent)}
.hf-picker-foot{display:flex;justify-content:space-between;align-items:center;margin-top:16px;gap:10px;flex-wrap:wrap}
.hf-picker-foot small{color:#8f978a}
.hf-picker-foot button{height:44px;padding:0 26px;border-radius:7px;border:1px solid #b4984d;background:#8a7439;color:#fff5c7;font-weight:800;cursor:pointer;font-size:15px}
@media (max-width:900px){.hf-picker-grid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:520px){.hf-picker-grid{grid-template-columns:1fr}}

/* Objective hint: pulse the button the current objective needs. */
@keyframes hfPulse{0%,100%{box-shadow:0 0 0 0 rgba(240,207,100,.0)}50%{box-shadow:0 0 0 4px rgba(240,207,100,.45)}}
.hf-hint{animation:hfPulse 1.6s ease-in-out infinite;border-color:#e6c25e!important}
