/* Branch F9: one medieval interface. Warm dark-wood panels with brass trim,
   parchment text and serif headings, laid out as floating clusters around a
   full-screen world. Loaded after game.css and hud-f.css; scoped to body.hud-f. */

body.hud-f{
  --bg:#17110b;--panel:#241a11;--panel2:#2f2216;--border:#6e5233;--text:#ecdfc2;--muted:#b4a281;
  --accent:#d9b166;--accent2:#8c6a35;--danger:#c4553f;--good:#93b35c;
  --wood:linear-gradient(180deg,rgba(52,38,24,.96),rgba(33,24,15,.96));
  --wood-solid:#2a1e13;--brass:#b48a4c;--brass-hi:#e3c27c;--brass-lo:#6a4f2c;--ink:#1a120a;
  --frame:0 0 0 1px #120c06,inset 0 0 0 1px rgba(227,194,124,.16),0 6px 22px rgba(0,0,0,.45);
  --title:'Cinzel',Georgia,'Times New Roman',serif;--body:'Alegreya Sans','Segoe UI',system-ui,sans-serif;
  font-family:var(--body);color:var(--text);background:#120d08;
}
body.hud-f button,body.hud-f select,body.hud-f input{font-family:var(--body)}

/* Panels: one frame everywhere. */
body.hud-f .panel,body.hud-f .resource-overlay,body.hud-f .toolbar-wrap,body.hud-f .world-status-float,
body.hud-f .research-modal,body.hud-f .menu-card,body.hud-f .hf-picker-card,body.hud-f .tool-menu-popover{
  background:var(--wood)!important;border:1px solid var(--brass)!important;border-radius:6px!important;box-shadow:var(--frame)!important;color:var(--text)}
body.hud-f .panel-title,body.hud-f .eyebrow,body.hud-f .modal-head .eyebrow{font-family:var(--title);letter-spacing:.08em;color:var(--brass-hi)}
body.hud-f .panel-title{font-size:12px;text-transform:uppercase;border-bottom:1px solid rgba(180,138,76,.35);padding-bottom:5px;margin-bottom:7px}
body.hud-f h2,body.hud-f h3,body.hud-f .objective-title,body.hud-f .logo,body.hud-f .hf-picker h2{font-family:var(--title);color:var(--brass-hi);letter-spacing:.04em}
body.hud-f .muted,body.hud-f small{color:var(--muted)}

/* Buttons: dark leather with brass edge. */
body.hud-f button{background:linear-gradient(180deg,#3d2c1c,#2a1d12);border:1px solid var(--brass-lo);color:var(--text);border-radius:4px;box-shadow:inset 0 1px 0 rgba(255,230,180,.08);cursor:pointer}
body.hud-f button:hover:not(:disabled){border-color:var(--brass);color:#fff3d6;background:linear-gradient(180deg,#4a3622,#332416)}
body.hud-f button.active,body.hud-f button.on,body.hud-f button.hf-on,body.hud-f .tool-button.active{border-color:var(--brass-hi)!important;background:linear-gradient(180deg,#6b4e27,#4a3519)!important;color:#fff6dd!important;box-shadow:0 0 0 1px rgba(227,194,124,.35),inset 0 1px 0 rgba(255,240,200,.2)!important}
body.hud-f button:disabled{opacity:.42}
body.hud-f button.primary,body.hud-f .hf-picker-foot button,body.hud-f #draft-all-btn{background:linear-gradient(180deg,#9c7a3c,#6f5427)!important;border-color:var(--brass-hi)!important;color:#fff6dc!important}
body.hud-f select,body.hud-f input[type=text],body.hud-f input[type=number]{background:#1c140c;border:1px solid var(--brass-lo);color:var(--text);border-radius:4px}

/* Top bar dissolves into floating clusters. */
body.hud-f .topbar{position:fixed;inset:0 0 auto 0;height:0;min-height:0!important;padding:0!important;border:0;background:none;overflow:visible;z-index:30;pointer-events:none}
body.hud-f .topbar>*{pointer-events:auto}
body.hud-f .brand,body.hud-f .visual-branch-badge{display:none!important}
body.hud-f .world-status-float{position:fixed!important;top:10px!important;right:10px!important;bottom:auto!important;left:auto!important;display:flex;gap:0;padding:0!important;height:50px;z-index:31;overflow:hidden}
body.hud-f .world-status-float>div{background:none!important;border:0!important;box-shadow:none!important;padding:7px 14px!important;border-right:1px solid rgba(180,138,76,.3)!important;border-radius:0!important;min-width:0!important}
body.hud-f .world-status-float>div:last-child{border-right:0!important}
body.hud-f .world-status-float strong{font-family:var(--title);color:var(--brass-hi);font-size:14px;display:block}
body.hud-f .world-status-float span{font-size:11px;color:var(--muted)}
body.hud-f #speed-controls{position:fixed;top:68px;right:10px;display:flex;gap:3px;padding:4px;background:var(--wood);border:1px solid var(--brass);border-radius:6px;box-shadow:var(--frame)}
body.hud-f #speed-controls button{width:38px;height:28px;padding:0;font-weight:700}
body.hud-f #layer-controls{position:fixed;top:68px;right:186px;display:flex;align-items:center;gap:3px;padding:4px 6px;background:var(--wood);border:1px solid var(--brass);border-radius:6px;box-shadow:var(--frame)}
body.hud-f #layer-controls button{width:30px;height:28px;padding:0}
body.hud-f #layer-label{font-family:var(--title);font-size:11px;color:var(--brass-hi);margin-right:4px;min-width:0}
body.hud-f .top-actions{position:fixed;right:10px;bottom:10px;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px;max-width:250px;padding:6px;background:var(--wood);border:1px solid var(--brass);border-radius:6px;box-shadow:var(--frame)}
body.hud-f .top-actions button{height:30px;padding:0 9px;font-size:12px;font-weight:600}

/* Right column: alerts then selection, below the clock. */
body.hud-f .main-grid>.sidebar:last-of-type{top:110px!important;right:10px;width:300px;max-height:calc(100% - 180px)!important}

/* Left: settler portraits as a row across the top, objective beneath. */
body.hud-f .main-grid>.sidebar:first-child{left:10px;top:10px;width:auto;max-width:calc(50% - 280px);overflow:visible}
body.hud-f .settler-panel{order:1;padding:6px!important}
body.hud-f .objective-panel{order:2;width:260px}
body.hud-f .settler-panel .panel-title{display:none}
body.hud-f #colonist-list{flex-direction:row!important;flex-wrap:nowrap;gap:5px!important;max-height:none!important;overflow-x:auto;overflow-y:hidden;padding-bottom:2px;scrollbar-width:thin}
body.hud-f .colonist-row{display:flex!important;flex-direction:column;align-items:center;width:58px;min-width:58px;padding:4px 2px 5px!important;gap:2px;background:linear-gradient(180deg,#33251a,#21180f)!important;border:1px solid var(--brass-lo)!important;border-radius:5px!important}
body.hud-f .colonist-row.selected,body.hud-f .colonist-row.active{border-color:var(--brass-hi)!important}
body.hud-f .colonist-row .hf-portrait{width:44px!important;height:44px!important;border-radius:4px!important;background:radial-gradient(circle at 50% 40%,#4a5a3a,#26301f)!important;border:1px solid #120c06!important}
body.hud-f .colonist-row>span:first-of-type{width:100%;text-align:center}
body.hud-f .colonist-row strong{font-size:11px!important;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}
body.hud-f .colonist-row .colonist-state{display:none!important}
body.hud-f .colonist-row .hf-mood{width:44px;margin-top:2px!important}
body.hud-f .colonist-row.hf-busy .hf-portrait{box-shadow:0 0 0 1px rgba(147,179,92,.55)}
body.hud-f .colonist-row.hf-idle .hf-portrait{box-shadow:0 0 0 1px rgba(217,177,102,.75)}

/* Resource bar. */
body.hud-f .resource-overlay{top:10px!important}
body.hud-f .mini-resource span{font-family:var(--body);color:var(--muted)}
body.hud-f .mini-resource strong{color:var(--text);font-family:var(--body)}

/* Build bar. */
body.hud-f .toolbar-wrap{padding:6px 8px!important}
body.hud-f .tool-menu-trigger,body.hud-f .tool-quick-button{font-family:var(--title)!important;letter-spacing:.04em;font-size:12px!important}
body.hud-f .tool-menu-trigger small{background:var(--brass-lo)!important;color:#fff3d6!important}
body.hud-f .tool-menu-popover .tool-button{background:linear-gradient(180deg,#33251a,#21180f)!important;border-color:var(--brass-lo)!important}
body.hud-f .tool-menu-popover .tool-button:hover{border-color:var(--brass)!important}
body.hud-f .tool-help{color:var(--muted);font-size:11px}

/* Modals. */
body.hud-f .modal-backdrop{background:rgba(8,5,2,.66)!important;backdrop-filter:blur(2px)}
body.hud-f .modal-head{border-bottom:1px solid rgba(180,138,76,.35)!important}
body.hud-f .research-modal table,body.hud-f .workforce-content table{border-color:var(--brass-lo)}
body.hud-f .research-list>*,body.hud-f .trade-list>*{background:linear-gradient(180deg,#33251a,#21180f)!important;border:1px solid var(--brass-lo)!important;border-radius:5px}

/* Toasts and alerts. */
body.hud-f .toast{background:var(--wood)!important;border:1px solid var(--brass)!important;color:var(--text)!important;box-shadow:var(--frame)!important;font-family:var(--body)}
body.hud-f .alert-row-v370{background:linear-gradient(180deg,#33251a,#21180f)!important;border:1px solid var(--brass-lo)!important;color:var(--text)!important}
body.hud-f .alert-row-v370.critical{border-color:var(--danger)!important;box-shadow:inset 3px 0 0 var(--danger)}
body.hud-f .alert-row-v370.warning{box-shadow:inset 3px 0 0 var(--brass)}

/* Start screen. */
body.hud-f .start-screen{background:radial-gradient(circle at 50% 35%,rgba(70,50,28,.9),rgba(12,8,4,.98) 62%)!important}
body.hud-f .menu-card .logo{color:var(--brass-hi)!important;font-weight:700}
body.hud-f .hf-scenarios button{background:linear-gradient(180deg,#33251a,#21180f)!important;border-color:var(--brass-lo)!important}
body.hud-f .hf-scenarios button.on{border-color:var(--brass-hi)!important;background:linear-gradient(180deg,#5a4122,#3a2a16)!important}
body.hud-f .hf-pick{background:linear-gradient(180deg,#33251a,#21180f)!important;border-color:var(--brass-lo)!important}

/* Raid banner. */
body.hud-f .raid-banner{position:fixed;top:120px;left:50%;transform:translateX(-50%);z-index:35;background:linear-gradient(180deg,#6b1f16,#45120c)!important;border:1px solid #e08a6a!important;font-family:var(--title)}

@media (max-width:1100px){
  body.hud-f .main-grid>.sidebar:first-child{max-width:calc(100% - 340px)}
  body.hud-f .objective-panel{display:none}
  body.hud-f .resource-overlay{top:auto!important;bottom:84px;max-width:calc(100% - 20px)!important}
  body.hud-f .top-actions{max-width:180px}
}

/* Lining, tabular figures so counts line up and 0 never reads as o. */
body.hud-f{font-variant-numeric:lining-nums tabular-nums}
/* Keep the right column clear of the bottom-right menu. */
body.hud-f .main-grid>.sidebar:last-of-type{max-height:calc(100% - 290px)!important}
body.hud-f *{font-variant-numeric:lining-nums tabular-nums!important}

/* Workforce, schedule, skills and needs tables. */
body.hud-f .workforce-help{background:rgba(42,30,19,.8)!important;border:1px solid var(--brass-lo)!important}
body.hud-f .workforce-scroll,body.hud-f .workforce-content{background:#1d150d!important}
body.hud-f .research-modal th{background:#33251a!important;color:var(--brass-hi)!important;font-family:var(--title);letter-spacing:.04em;border-color:var(--brass-lo)!important}
body.hud-f .research-modal td{background:#241a11!important;border-color:rgba(110,82,51,.45)!important}
body.hud-f .research-modal tr:nth-child(even) td{background:#2a1e14!important}
body.hud-f .workforce-priority{background:linear-gradient(180deg,#3a2a1b,#281c11)!important;border-color:var(--brass-lo)!important;color:var(--text)!important}
body.hud-f .workforce-priority.priority-4{border-color:var(--brass-hi)!important;background:linear-gradient(180deg,#6b4e27,#4a3519)!important}
body.hud-f .workforce-priority.priority-3{border-color:#8e9a55!important;background:linear-gradient(180deg,#3f3b20,#2c2915)!important}
body.hud-f .workforce-priority.priority-0,body.hud-f .workforce-priority.off{opacity:.55}

/* The title screen covers the in-game clusters. */
body.hud-f .start-screen{z-index:60!important}

/* Short of materials is not an error: the build is queued until gathered. */
body.hud-f .build-cost-chip.pending{border-color:rgba(214,170,90,.7)!important;background:rgba(74,56,24,.8)!important}
body.hud-f .build-cost-chip.pending b,body.hud-f .pending-text{color:#f0cf86!important}

/* Production orders. */
body.hud-f .hf-hidden{display:none!important}
body.hud-f .hf-orders{margin-top:10px}
body.hud-f .hf-orders .mini-heading{font-family:var(--title);color:var(--brass-hi);letter-spacing:.06em;font-size:11px;margin:8px 0 5px}
body.hud-f .hf-order-list,body.hud-f .hf-order-add{display:flex;flex-direction:column;gap:4px}
body.hud-f .hf-order,body.hud-f .hf-order-opt{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:5px 7px;border:1px solid var(--brass-lo);border-radius:5px;background:linear-gradient(180deg,#33251a,#21180f)}
body.hud-f .hf-order.paused{opacity:.6}
body.hud-f .hf-order.blocked{border-color:rgba(214,170,90,.75)}
body.hud-f .hf-order-name,body.hud-f .hf-order-opt>div:first-child{display:flex;flex-direction:column;min-width:0}
body.hud-f .hf-order-name strong,body.hud-f .hf-order-opt strong{font-size:12px}
body.hud-f .hf-order-name small,body.hud-f .hf-order-opt small{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.hud-f .hf-order.blocked small{color:#f0cf86}
body.hud-f .hf-order-btns,body.hud-f .hf-order-opt>div:last-child{display:flex;align-items:center;gap:3px;flex:none}
body.hud-f .hf-order-btns b{min-width:20px;text-align:center;font-size:12px}
body.hud-f .hf-orders button{height:24px;min-width:24px;padding:0 6px;font-size:11px;font-weight:700}
body.hud-f .hf-order-opt.locked{opacity:.5}
body.hud-f .hf-order-opt em{font-size:10.5px;color:var(--muted)}
body.hud-f .hf-order-empty{font-size:11px;color:var(--muted);margin:2px 0}
body.hud-f .hf-order-name small,body.hud-f .hf-order-opt small{white-space:normal!important;overflow:visible!important;line-height:1.3}
