/* COMMAND CENTER - HIGH END TACTICAL UI */
#start {
    --bf-bg: #030405;
    --bf-panel: rgba(10, 12, 14, 0.85);
    --bf-panel-solid: #0a0c0e;
    --bf-accent: #FFB300;
    --bf-accent-hover: #FFC940;
    --bf-text: #E0E4E8;
    --bf-muted: #6B737A;
    --bf-border: rgba(255, 179, 0, 0.2);
    --bf-border-subtle: rgba(255, 255, 255, 0.08);
    --bf-font: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --phos: var(--bf-text);
    --phos-dim: var(--bf-muted);
    
    background: var(--bf-bg);
    color: var(--bf-text);
    font-family: var(--bf-font);
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    z-index: 100;
}

#start.screen {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
}

#start [hidden], 
#start [style*="display: none"], 
#start [style*="display:none"] {
    display: none !important;
}

#start::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 179, 0, 0.03) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

#start .bf-layout {
    display: grid;
    grid-template-columns: 240px 1fr 400px;
    grid-template-rows: 80px minmax(0, 1fr) auto;
    grid-template-areas: 
        "header header header"
        "nav stage panels"
        "footer footer footer";
    width: 100%;
    height: 100%;
    position: relative;
    min-width: 0;
    min-height: 0;
    z-index: 1;
    transition: grid-template-columns 0.3s ease;

    background-color: var(--bf-bg);
    background-image:
        linear-gradient(180deg, rgba(3,4,5,0.2) 0%, rgba(3,4,5,0.85) 100%),
        var(--bf-lobby-bg, url("/menu/hangar-bg.jpg"));
    background-size: cover;
    background-position: center;
}

#start .bf-layout:not(.show-hero) {
    grid-template-columns: 240px 0fr 1fr;
}
#start .bf-layout:not(.show-hero) .bf-stage {
    display: none;
}

#start .bf-header { 
    grid-area: header; 
    display: flex; align-items: center; padding: 0 32px;
    background: linear-gradient(180deg, rgba(3,4,5,0.9) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

#start .bf-nav { 
    grid-area: nav; 
    display: flex; flex-direction: column; gap: 2px; padding: 32px 0;
    background: linear-gradient(90deg, rgba(3,4,5,0.8) 0%, transparent 100%);
}

#start .bf-stage { 
    grid-area: stage; 
    position: relative; 
}
#start .bf-hero-bg {
    position: absolute; inset: 0;
    display: flex; justify-content: center; align-items: center;
}
#start .bf-hero-bg::after { display: none; }

#start .bf-hero-stage {
    position: absolute; inset: 0; z-index: 0;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
#start .bf-layout.show-hero .bf-hero-stage {
    opacity: 1; pointer-events: auto;
}

#start .armoryAvatar {
    width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; z-index: 2;
    flex: none; border: 0; background: transparent; box-shadow: none; padding: 0;
}
#start .armoryFallback {
    position: absolute; inset: 0; z-index: 1;
    display: flex; justify-content: center; align-items: center;
    pointer-events: none; transition: opacity 0.3s;
}
#start .armoryFallback img {
    max-height: 90%; max-width: 90%; object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
}
#start .armoryFallback.hidden { opacity: 0; }
#start #avatarCanvas {
    width: 100%; max-width: 600px; height: 100%; max-height: 800px;
    object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
    position: relative; z-index: 2; transition: opacity 0.3s;
}

#start .avCreds, #start .gearToast {
    position: absolute; bottom: 15%; padding: 8px 16px; border-radius: 0;
    background: rgba(0,0,0,0.6); border: 1px solid var(--bf-border-subtle);
    color: var(--bf-accent); font-weight: bold; backdrop-filter: blur(4px);
    text-align: center;
}
#start .avCreds { left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 4; margin: 0; white-space: nowrap; }
#start .bf-preview-note { position: absolute; bottom: 51px; left: 8px; right: 8px; z-index: 4; margin: 0; font-size: 10px; color: #b8bec6; text-align: center; background: #090d13bb; padding: 5px; pointer-events: none; }

#start .bf-panels {
    grid-area: panels;
    position: relative;
    overflow-y: auto; overflow-x: hidden;
    background: linear-gradient(90deg, rgba(10,12,14,0.6) 0%, rgba(10,12,14,0.95) 100%);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--bf-border-subtle);
    min-width: 0; min-height: 0;
}
#start #lobby.bf-panels { width: 100%; max-width: none; height: 100%; margin: 0; }
#start .armory { display: block; width: 100%; }
#start .armoryPanel { width: 100%; }
#start .armoryPanel > .secLabel { display: none !important; }
#start #lockNote { position: absolute; top: 64px; left: 16px; z-index: 25; pointer-events: none; }
#start button:focus-visible { outline: 1px solid var(--bf-text); outline-offset: 2px; }
#start .bf-panels .tabPanel {
    display: none; animation: fadeIn 0.3s ease;
}
#start .bf-panels .tabPanel.on { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

#start .bf-footer {
    grid-area: footer; display: flex; align-items: center; justify-content: flex-end;
    padding: 10px 40px; gap: 16px;
    background: linear-gradient(0deg, rgba(3,4,5,0.9) 0%, transparent 100%);
    border-top: 1px solid rgba(255,255,255,0.03);
    position: relative; z-index: 20;
}

/* TOP BAR */
#start .opBar { width: 100%; display: flex; justify-content: space-between; align-items: center; }
#start .opId { display: flex; align-items: center; gap: 16px; }
#start .opAvatar {
    width: 48px; height: 48px; border-radius: 0;
    background: rgba(255,255,255,0.05); color: var(--bf-text);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 20px; border: 1px solid var(--bf-border-subtle);
}
#start .opMeta { display: flex; flex-direction: column; }
#start .opName { font-size: 18px; font-weight: 900; letter-spacing: 0.05em; color: #FFF; text-transform: uppercase; }
#start .opRank { font-size: 11px; color: var(--bf-accent); font-weight: 700; letter-spacing: 0.1em; }
#start .opXpBar { width: 140px; height: 4px; background: rgba(255,255,255,0.1); margin-top: 6px; border-radius: 0; overflow: hidden; }
#start .opXpBar span { display: block; height: 100%; background: var(--bf-accent); }

#start .opWallet { display: flex; gap: 32px; }
#start .wCell { display: flex; flex-direction: column; align-items: flex-end; }
#start .wCell b { font-size: 18px; color: #FFF; font-weight: bold; }
#start .wCell small { font-size: 10px; color: var(--bf-muted); letter-spacing: 0.1em; }

#start .opBrand { font-size: 26px; font-weight: 900; letter-spacing: 0.15em; font-style: italic; color: #FFF; }
#start .opBrand span { color: var(--bf-accent); }

/* NAV TABS */
#start .tabBar { display: flex; flex-direction: column; width: 100%; }
#start .tabBtn {
    background: transparent; border: none; color: var(--bf-muted);
    font-weight: 600; font-size: 16px; letter-spacing: 0.15em; text-align: left;
    padding: 16px 32px; cursor: pointer; transition: all 0.2s ease;
    position: relative; font-family: inherit; text-transform: uppercase;
    white-space: normal; overflow-wrap: anywhere; min-width: 0;
    border-left: 4px solid transparent;
}
#start .tabBtn:hover { color: #FFF; background: rgba(255,255,255,0.02); }
#start .tabBtn.on { color: #FFF; background: rgba(255,255,255,0.05); border-left-color: var(--bf-accent); }

/* CARDS */
#start .bf-card-section {
    background: rgba(0,0,0,0.4); border: 1px solid var(--bf-border-subtle);
    border-radius: 0; margin: 16px 20px; overflow: hidden;
}
#start .bf-card-section > h3 {
    background: rgba(255,255,255,0.03); padding: 8px 12px; margin: 0;
    font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
    color: var(--bf-text); border-bottom: 1px solid var(--bf-border-subtle);
}
#start .bf-card-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* LEGACY COMPONENT OVERRIDES */
#start .mapGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
#start .mapCard { background: rgba(0,0,0,0.7); border: 1px solid var(--bf-border-subtle); border-radius: 0; cursor: pointer; overflow: hidden; transition: 0.2s; }
#start .mapCard:hover { border-color: rgba(255,255,255,0.2); }
#start .mapCard.sel { border-color: var(--bf-text); box-shadow: none; }
#start .mapCard .swatch { height: 80px; position: relative; }
#start .mapCard .swatch img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
#start .mapCard .reconTag { position: absolute; bottom: 4px; left: 4px; font-size: 9px; font-weight: bold; background: rgba(0,0,0,0.7); padding: 2px 6px; border-radius: 0; }
#start .mapCard .mn { font-weight: 800; font-size: 14px; padding: 8px 8px 4px; }
#start .mapCard .md { font-size: 10px; color: var(--bf-muted); padding: 0 8px 8px; }
#start .mapCard .chips { display: flex; gap: 4px; padding: 0 8px 8px; flex-wrap: wrap; }
#start .mapCard .chip { font-size: 8px; background: rgba(255,255,255,0.1); padding: 2px 4px; border-radius: 0; }

#start .sideRow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#start .sidePick { background: rgba(0,0,0,0.7); border: 1px solid var(--bf-border-subtle); border-radius: 0; padding: 16px; cursor: pointer; text-align: center; transition: 0.2s; }
#start .sidePick:hover { border-color: rgba(255,255,255,0.2); }
#start .sidePick.sel { border-color: var(--bf-text); background: rgba(255,255,255,0.05); }
#start .sidePick .fn { font-weight: 800; font-size: 16px; margin-bottom: 4px; }
#start .sidePick .fd { font-size: 11px; color: var(--bf-muted); }

#start .factionRow { display: flex; gap: 8px; flex-wrap: wrap; }
#start .factionRow .miniBtn {
    flex: 1; min-width: 80px; padding: 12px; font-weight: bold; font-size: 12px;
    border-radius: 0; border: 1px solid; text-align: center; cursor: pointer; transition: 0.2s;
}

#start .ctrlRow { display: flex; flex-direction: column; gap: 12px; }
#start .ctrlItem { display: flex; flex-direction: column; gap: 8px; font-size: 12px; font-weight: bold; color: var(--bf-muted); }
#start .ctrlItem span b { color: #FFF; }
#start .ctrlItem input[type=range] { accent-color: var(--bf-accent); width: 100%; }
#start .ctrlItem.invert { flex-direction: row; align-items: center; gap: 12px; }
#start .txtField { background: rgba(0,0,0,0.7); border: 1px solid var(--bf-border-subtle); color: #FFF; padding: 12px; border-radius: 0; font-family: inherit; font-size: 14px; outline: none; transition: 0.2s; }
#start .txtField:focus { border-color: var(--bf-text); }

/* Buttons */
#start .btn {
    background: rgba(255,255,255,0.05); color: var(--bf-text); border: 1px solid var(--bf-border-subtle);
    padding: 16px 40px; font-size: 16px; font-weight: 700;
    letter-spacing: 0.1em; cursor: pointer; border-radius: 0; text-transform: uppercase;
    transition: all 0.2s; box-shadow: none;
}
#start .btn:hover { background: rgba(255,255,255,0.15); border-color: var(--bf-text); }
#start .btn.ghost { background: transparent; color: var(--bf-muted); border: 1px solid var(--bf-border-subtle); }
#start .btn.ghost:hover { color: #FFF; border-color: rgba(255,255,255,0.4); }
#start .miniBtn { background: rgba(255,255,255,0.05); color: var(--bf-text); border: 1px solid var(--bf-border-subtle); padding: 8px 16px; border-radius: 0; font-size: 11px; font-weight: bold; cursor: pointer; transition: 0.2s; text-transform: uppercase; }
#start .miniBtn:hover { background: rgba(255,255,255,0.15); border-color: var(--bf-text); }
#start .miniBtn.quick { background: rgba(255,255,255,0.9); color: #000; }
#start .miniBtn.on { background: var(--bf-text); color: #000; }

#start #deployBtn { background: var(--bf-accent); color: #000; border: none; font-size: 24px; padding: 16px 80px; font-weight: 900; }
#start #deployBtn:hover { background: var(--bf-text); }
#start #skipTrain { font-size: 14px; padding: 16px 32px; }
#start #loadnote { font-size: 11px; color: var(--bf-muted); letter-spacing: 0.1em; position: static; flex: 1 1 200px; min-width: 0; margin: 0; overflow-wrap: anywhere; }

/* OP CUSTOMIZATION */
#start .bf-op-customization {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--bf-border-subtle); border-radius: 0; margin: 16px 20px; padding: 16px;
}
#start .bf-op-cust-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--bf-border-subtle); padding-bottom: 12px; margin-bottom: 16px; }
#start .bf-op-cust-header h2 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.15em; color: var(--bf-text); }
#start .bf-op-cust-status { font-size: 10px; font-weight: bold; letter-spacing: 0.1em; color: var(--bf-muted); transition: color 0.3s; }
#start .bf-op-cust-body { display: flex; flex-direction: column; gap: 20px; }
#start .bf-op-group label { display: block; font-size: 10px; font-weight: bold; color: var(--bf-muted); letter-spacing: 0.1em; margin-bottom: 8px; }
#start .bf-toggle-group { display: flex; background: transparent; border-radius: 0; overflow: hidden; border: 1px solid var(--bf-border-subtle); }
#start .bf-tog { flex: 1; padding: 12px; background: rgba(0,0,0,0.5); border: none; border-right: 1px solid var(--bf-border-subtle); color: var(--bf-muted); font-weight: bold; font-size: 12px; cursor: pointer; transition: 0.2s; }
#start .bf-tog:last-child { border-right: none; }
#start .bf-tog.active { background: rgba(255,255,255,0.1); color: #FFF; border-bottom: 2px solid var(--bf-text); }

#start .bf-wardrobe-fields { display: flex; flex-direction: column; gap: 8px; }
#start .bf-authored-equipment { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
#start .bf-authored-equipment label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; font-weight: bold; color: var(--bf-muted); letter-spacing: 0.1em; }
#start .bf-gear-select { background: rgba(0,0,0,0.7); border: 1px solid var(--bf-border-subtle); color: #FFF; padding: 10px 12px; border-radius: 0; font-family: inherit; font-size: 12px; font-weight: bold; outline: none; transition: 0.2s; cursor: pointer; appearance: none; }
#start .bf-gear-select:hover, #start .bf-gear-select:focus { border-color: var(--bf-text); background: rgba(255,255,255,0.05); }
#start .bf-gear-select option { background: var(--bf-panel-solid); color: #FFF; font-weight: normal; }

#start .bf-palette-group { display: flex; gap: 12px; flex-wrap: wrap; }
#start .bf-pal-btn { width: 44px; height: 44px; border-radius: 0; background: transparent; border: 2px solid transparent; padding: 4px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
#start .bf-pal-btn:hover { border-color: rgba(255,255,255,0.3); }
#start .bf-pal-btn.active { border-color: var(--bf-text); }
#start .bf-pal-color { width: 100%; height: 100%; border-radius: 0; }

/* CLASS GRID */
#start .classGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
#start .classCard { background: rgba(0,0,0,0.7); border: 1px solid var(--bf-border-subtle); border-radius: 0; padding: 12px; text-align: center; cursor: pointer; transition: 0.2s; }
#start .classCard:hover { border-color: rgba(255,255,255,0.2); }
#start .classCard.sel { border-color: var(--bf-text); box-shadow: none; background: rgba(255,255,255,0.05); }
#start .classPrev { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
#start .classCard .cn { font-weight: 900; font-size: 14px; margin-top: 8px; }
#start .classCard small { font-size: 10px; color: var(--bf-muted); }

/* RESPONSIVE MOBILE */
@media (max-width: 900px) {
    #start .bf-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 70px minmax(0, 1fr) 60px;
        grid-template-areas: "header" "panels" "nav";
        background-position: left center;
    }
    #start .bf-layout:not(.show-hero) {
        grid-template-columns: 1fr;
    }
    #start .bf-header { padding: 0 16px; background: rgba(3,4,5,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,0.05); }
    #start .opWallet, #start .opBrand { display: none; }
    #start .bf-stage { position: absolute; inset: 70px 0 auto; height: 50vh; }
    #start .bf-layout[data-active-tab="character"] .bf-stage { height: 35vh; }
    
    #start .bf-nav {
        flex-direction: row; padding: 0; background: var(--bf-panel-solid);
        border-top: 1px solid var(--bf-border-subtle); z-index: 20;
    }
    #start .tabBar { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    #start .tabBtn { padding: 16px; font-size: 11px; white-space: nowrap; text-align: center; border-left: none; border-bottom: 3px solid transparent; }
    #start .tabBtn.on { background: rgba(255,255,255,0.05); border-left: none; border-bottom-color: var(--bf-accent); }

    #start .bf-panels {
        border-left: none; background: transparent; backdrop-filter: none; margin-bottom: 20px;
        padding-bottom: 80px;
    }
    #start .bf-layout:not(.show-hero) .bf-panels {
        background: transparent;
    }
    #start .bf-layout.show-hero .bf-panels { pointer-events: none; }
    #start .bf-layout.show-hero .tabPanel.on { pointer-events: auto; padding-top: 50vh; background: linear-gradient(to top, rgba(3,4,5,0.95) 0%, rgba(3,4,5,0.9) 60%, transparent 100%); min-height: 100%; }
    #start .bf-layout.show-hero[data-active-tab="character"] .tabPanel.on { padding-top: 35vh; }
    
    #start .bf-footer {
        position: absolute; bottom: 70px; right: 16px; z-index: 30;
        background: none; border: none; padding: 0; justify-content: flex-end;
        width: auto; height: auto;
    }
    #start #loadnote { display: none; }
    #start #deployBtn { font-size: 20px; padding: 12px 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.8); }
    #start #skipTrain { font-size: 10px; padding: 12px; max-width: 128px; letter-spacing: .04em; }
    
    #start .bf-card-section { margin: 16px 12px; background: rgba(10,12,14,0.95); backdrop-filter: blur(10px); border-radius: 0; }
}

@media (max-width: 900px) and (orientation: landscape), (max-height: 500px) {
    #start .bf-layout {
        grid-template-columns: 80px 1fr 340px;
        grid-template-rows: 50px minmax(0, 1fr);
        grid-template-areas: "nav header header" "nav stage panels";
    }
    #start .bf-layout:not(.show-hero) {
        grid-template-columns: 80px 0fr 1fr;
    }
    #start .bf-nav { flex-direction: column; border-top: none; border-right: 1px solid var(--bf-border-subtle); overflow-y: auto; padding: 8px 0; }
    #start .bf-stage { position: relative; inset: auto; height: 100%; }
    #start .bf-layout[data-active-tab="character"] .bf-stage { height: 100%; }
    #start .tabBar { flex-direction: column; overflow-x: visible; }
    #start .tabBtn { padding: 16px 8px; font-size: 9px; white-space: normal; border-bottom: none; border-left: 3px solid transparent; }
    #start .tabBtn.on { border-bottom: none; border-left-color: var(--bf-accent); }
    
    #start .bf-layout.show-hero .bf-panels {
        pointer-events: auto; background: var(--bf-panel); margin: 0;
    }
    #start .bf-layout.show-hero .tabPanel.on {
        padding-top: 0; background: none; min-height: auto;
    }
    #start .bf-layout.show-hero[data-active-tab="character"] .tabPanel.on { padding-top: 0; }
    #start .bf-footer {
        bottom: 16px; right: 360px;
        flex-direction: column; gap: 8px;
    }
}
@media (prefers-reduced-motion: reduce) {
    #start *, #start *::before, #start *::after { animation: none !important; transition: none !important; }
}

/* Preserve the existing command-center composition, but reserve footer space in the
   grid instead of painting deployment actions over whichever tab is scrolled. */
#start .bf-layout { box-sizing: border-box; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#start .bf-nav { min-height: 0; overflow-y: auto; }
#start .bf-panels { overscroll-behavior: contain; scroll-padding-block: 16px; }
#start .bf-footer { flex-wrap: wrap; min-width: 0; }
#start .bf-footer #deploymentPolicyNotice {
    flex: 1 1 100%; width: 100%; max-width: 560px; margin: 0 auto; box-sizing: border-box;
}
#start .opId, #start .opMeta { min-width: 0; }
#start .opName { overflow-wrap: anywhere; }
#start .bf-card-body, #start .tabPanel, #start .ctrlItem { min-width: 0; overflow-wrap: anywhere; }
#start .txtField { max-width: 100%; box-sizing: border-box; }
#start button, #start select { min-height: 44px; }
#start .bf-panels .gsWorkbench, #start .bf-panels .tkWorkbench { max-width: 100%; }
@media (max-width: 900px) {
    #start .bf-layout { grid-template-rows: auto minmax(0,1fr) auto auto; grid-template-areas: "header" "panels" "footer" "nav"; }
    #start .bf-header { min-height: 70px; }
    #start .bf-footer { position: relative; inset: auto; padding: 12px 16px; background: rgba(3,4,5,0.95); border-top: 1px solid rgba(255,255,255,0.05); gap: 8px; }
    #start .bf-panels { padding-bottom: 16px; }
    #start .bf-nav { min-width: 0; }
    #start .tabBar { flex-wrap: nowrap; margin-bottom: 0; justify-content: flex-start; min-width: 0; overflow-x: auto; }
    #start .tabBtn { flex: 0 0 auto; }
    #start #loadnote { display: block; position: static; flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
}
@media (max-width: 900px) and (orientation: landscape), (max-height: 500px) {
    #start .bf-layout { grid-template-columns: 80px minmax(0,1fr) minmax(220px,340px); grid-template-rows: auto minmax(0,1fr) auto; grid-template-areas: "nav header header" "nav stage panels" "nav footer footer"; }
    #start .bf-layout:not(.show-hero) { grid-template-columns: 80px 0 minmax(0,1fr); }
    #start .bf-header { min-height: 50px; }
    #start .bf-footer { position: relative; inset: auto; flex-direction: row; padding: 6px 16px; }
    #start .bf-panels { padding-bottom: 12px; }
    #start .tabBar { flex-wrap: nowrap; }
    #start #deployBtn { font-size: 18px; padding: 10px 24px; }
}
@media (min-width: 901px) and (max-width: 1200px) {
    #start .bf-layout { grid-template-columns: 180px minmax(0,1fr) minmax(280px,360px); }
    #start .bf-layout:not(.show-hero) { grid-template-columns: 180px 0 minmax(0,1fr); }
    #start .gsWorkbench, #start .tkWorkbench { grid-template-columns: minmax(0,1fr); }
}
/* FOCUS CONTROLS */
#start .bf-focus-controls {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    background: transparent;
    padding: 8px;
    border-radius: 0;
    border: none;
    backdrop-filter: none;
}
#start .bf-focus-btn {
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--bf-border-subtle);
    color: var(--bf-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.2s;
    writing-mode: horizontal-tb;
    transform: none;
    min-width: 52px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#start .bf-focus-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #FFF;
    border-color: rgba(255,255,255,0.2);
}
#start .bf-focus-btn.active {
    color: #000;
    background: var(--bf-text);
    border-color: var(--bf-text);
}

@media (max-width: 900px) {
    #start .bf-focus-controls {
        right: auto;
        left: 8px;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        padding: 4px;
    }
    #start .bf-focus-btn {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 8px 6px;
    }
}
@media (max-width: 900px) and (orientation: landscape), (max-height: 500px) {
    #start .bf-focus-controls {
        right: auto;
        left: 8px;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        padding: 4px;
    }
    #start .bf-focus-btn {
        writing-mode: horizontal-tb;
        transform: none;
        padding: 6px 6px;
    }
}

/* ARMORY CONSOLIDATION SCOPED ADDITIONS */
#armoryUpgrades #upgradeList > .upSlot > .upTiers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
#armoryUpgrades #upgradeList > .upSlot > h3 {
    background: rgba(255,255,255,0.03);
    padding: 8px 12px;
    margin: 0 0 12px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--bf-text);
    border-bottom: 1px solid var(--bf-border-subtle);
    text-transform: uppercase;
}
#armoryUpgrades .bf-wardrobe-status {
    padding: 12px;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--bf-border-subtle);
    color: var(--bf-accent);
    font-weight: bold;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.1em;
}
#armoryUpgrades .bf-cosmetic-card,
#armoryUpgrades .bf-protective-card {
    min-width: 0;
    overflow-wrap: anywhere;
}
#armoryUpgrades .bf-protective-card {
    margin: 0;
}
#armoryUpgrades .bf-protective-card > .upTiers {
    display: flex;
    flex-direction: column;
    margin: 0;
}
#armoryUpgrades .bf-protective-card > .upTiers > .upTier {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 900px) and (orientation: portrait) {
    /* The preview stays behind the controls when jumping down to the Armory. */
    #start .bf-layout[data-active-tab="character"] .bf-panels {
        z-index: 3;
    }
    #start .bf-layout[data-active-tab="character"] .tabPanel[data-panel="character"] {
        pointer-events: none;
    }
    #start .bf-layout[data-active-tab="character"] .armory {
        pointer-events: auto;
    }
}

/* [b512] TWO-SCREEN MENU: OPERATOR (identity · wardrobe · protection · role) and ARSENAL (weapons · stash). */
#start .bf-loadout-summary {
    display: grid;
    /* Six cells as full rows (3 x 2, or 2 x 3 on phones) so no empty grid track shows the gap colour. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 12px;
    background: var(--bf-border-subtle);
    border: 1px solid var(--bf-border-subtle);
}
@media (max-width: 520px) {
    #start .bf-loadout-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#start .bf-loadout-summary:empty { display: none; }
#start .bf-ls-cell:only-child { grid-column: 1 / -1; }
#start .bf-ls-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 8px 10px;
    background: #0f1417;
}
#start .bf-ls-cell > span { font-size: 9px; letter-spacing: 0.14em; color: var(--bf-muted); }
#start .bf-ls-cell > b { font-size: 12px; font-weight: 600; color: var(--bf-text); overflow-wrap: anywhere; }
#start .bf-loadout-summary.blocked { border-color: #d0574f; }
#start .bf-ls-cell > b.bad { color: #ff8a80; }
#start .bf-subnav { margin: 8px 20px 4px; }
#start [data-operator-section][hidden] { display: none !important; }
#start .bf-section-note { margin: 0 0 8px; color: var(--bf-muted); font-size: 12px; line-height: 1.5; }

/* Wardrobe: list plus a sticky inspection pane; the pane only appears once an item is inspected. */
#start .bf-wardrobe-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
#start .bf-wardrobe-layout > #upgradeList { flex: 1 1 320px; min-width: 0; }
#start .bf-wardrobe-layout > .bf-wardrobe-status { flex: 1 1 100%; margin-bottom: 0; }
#start #armoryPreviewPane {
    flex: 0 0 240px;
    height: 240px;
    max-width: 100%;
    position: sticky;
    top: 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bf-border-subtle);
    background: rgba(4, 8, 5, 0.85);
    box-sizing: border-box;
}
#armoryUpgrades #armoryFilters { margin-bottom: 4px; }

/* Bonus tiers keep the grid they had inside the old combined armory list. */
#bonusTierList > .upSlot > .upTiers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
#bonusTierList details.bf-stat-upgrade-slot > summary .lbl::before { content: none; }

/* Multiplayer: JOIN beside HOST on wide screens, room status and ranks full width below. */
#start .bf-mp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 12px 20px; }
#start .bf-mp-grid > .bf-card-section { margin: 0; }
#start .bf-mp-group { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#start .bf-mp-row { gap: 8px; }
#start .bf-mp-select {
    cursor: pointer;
    min-height: 44px;
    background: #171d21;
    color: var(--bf-text);
    border: 1px solid var(--bf-border-subtle);
}
#start .bf-mp-browser-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bf-muted);
}
#start .bf-mp-browser-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#start #refreshRooms { min-height: 44px; padding: 4px 12px; font-size: 11px; }
#start .bf-room-info { color: var(--bf-accent); font-size: 12px; letter-spacing: 0.14em; }
#start .bf-room-info:empty { display: none; }
#start details.mpNote > summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--bf-text);
}
#start details.mpNote > p { margin: 4px 0 0; }
@media (min-width: 1100px) {
    #start .bf-mp-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 900px) {
    #start .bf-subnav { margin: 8px 12px 4px; }
    #start .bf-mp-grid { margin: 10px 12px; }
}
@media (max-width: 700px) {
    /* Narrow screens: the inspected item stays docked at the bottom while the list scrolls. */
    #start #armoryPreviewPane { flex: 1 1 100%; height: 200px; top: auto; bottom: 0; z-index: 2; }
}
