/* Hub (UX redesign 2026-10-06): Home is the hub, the bottom tabs and the computer sidebar are gone (html.ux2, js/ui/hub.js).
   Layout: background + logo; the stage (rig + Bubba) on the left; Store card, launch button + strip and the menu stack on the
   right; the player card bottom left; Today + Horde Night cards bottom right. Phones stack it in one column. */

/* ---------- no tabs, no sidebar ---------- */
html.ux2 #uiNav { display:none !important; }
html.ux2.lay-desk #ui.on { grid-template-columns:minmax(0,1fr); grid-template-areas:"top" "view"; }
html.ux2.lay-desk #ui.bare { grid-template-areas:"top" "view"; }
html.ux2.lay-desk #toasts, html.ux2.lay-desk #sheet { left:0; }
html.ux2 #ui.on ~ #toasts { bottom:calc(24px + env(safe-area-inset-bottom)); }
/* the back button that replaces the tabs on screens without their own */
.hbBack { flex:none; display:flex; align-items:center; gap:4px; height:44px; padding:0 14px 0 8px; margin-right:6px; border-radius:14px; border:3px solid var(--ol);
  background:linear-gradient(180deg,var(--pn1),var(--pn2) 60%,var(--pn3)); color:#fff; font:400 17px/1 var(--fh); text-shadow:var(--so2); box-shadow:var(--panelSh); cursor:pointer; }
.hbBack svg { width:22px; height:22px; }
.hbBack:active { transform:translateY(2px); }

/* ---------- Home ---------- */
#ui.homeScr #uiView { overflow:hidden; }
.hub { position:relative; height:100%; min-height:100%; overflow:hidden; display:grid;
  grid-template-columns:minmax(0,1fr) clamp(300px, 26vw, 400px); grid-template-rows:auto minmax(0,1fr) auto;
  grid-template-areas:"logo side" "stage side" "me cards"; gap:12px 18px; padding:14px 18px calc(14px + env(safe-area-inset-bottom)); box-sizing:border-box; }
.hbBg { position:absolute; inset:0; z-index:0; background:linear-gradient(180deg,rgba(10,30,70,.15),rgba(6,16,40,.55)), url("../assets/ui/bg-garage.webp") 50% 40%/cover no-repeat, #0b1f40; }
.hub > *:not(.hbBg) { position:relative; z-index:1; }
.hbLogo { grid-area:logo; align-self:start; }
.hbLogo .logoArt { width:clamp(150px, 16vw, 230px); height:auto; filter:drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.hbLogo .txtLogo { font:400 34px/1 var(--fh); color:#fff; text-shadow:var(--so); }
.hub > .hbIcons { position:absolute; top:14px; right:calc(clamp(300px, 26vw, 400px) + 36px); display:flex; gap:8px; z-index:2; }
.hbIco { position:relative; width:48px; height:48px; border-radius:50%; border:3px solid var(--ol); background:radial-gradient(circle at 50% 30%,#4fa8f0,#1b5aa8 70%);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.45), 0 3px 0 rgba(0,0,0,.3); display:flex; align-items:center; justify-content:center; padding:6px; cursor:pointer; font-size:22px; }
.hbIco img, .hbIco .art { width:100%; height:100%; object-fit:contain; }
.hbIco .dot { position:absolute; top:-6px; right:-6px; }

/* stage: the 3D rig on its turntable with Bubba in front */
.hbStage { grid-area:stage; position:relative; min-height:0; container-type:size; }
.hbCar3 { position:absolute; left:16%; left:max(16%, calc(2cqw + min(56cqh, 40cqw) - 6cqw)); right:0; top:4%; bottom:0; cursor:pointer; } /* Bucket 1: the car starts where Bubba ends, so a narrow window never stacks them */
.hbBubba { position:absolute; left:2%; bottom:2%; height:84%; height:min(84cqh, 60cqw); aspect-ratio:2/3; padding:0; border:0; background:none; cursor:pointer; filter:drop-shadow(0 10px 14px rgba(0,0,0,.45)); transition:transform .15s; }
.hbBubba img { width:100%; height:100%; object-fit:contain; object-position:50% 100%; }
.hbBubba:hover { transform:translateY(-4px) scale(1.02); }
.hbBubba.none { display:none; }

/* right column */
.hbSide { grid-area:side; display:flex; flex-direction:column; gap:10px; min-height:0; padding-top:62px; }
.hbStore { position:relative; text-align:left; padding:12px 16px 12px 16px; border-radius:18px; border:3px solid #6a3a00; cursor:pointer; color:#fff;
  background:linear-gradient(135deg,#ff5fa2,#8a45e8 55%,#3b2a9a); box-shadow:inset 0 2px 0 rgba(255,255,255,.4), 0 4px 0 rgba(0,0,0,.35); display:flex; flex-direction:column; gap:2px; }
.hbStore b { font:400 22px/1.05 var(--fh); text-shadow:var(--so2); }
.hbStore small { font:800 13px/1.2 var(--fb); opacity:.92; }
.hbStore .hsTag { position:absolute; top:-10px; right:12px; padding:3px 10px 4px; border-radius:10px; border:2px solid var(--ol); background:linear-gradient(180deg,var(--yl1),var(--yl3)); color:#3a1d00; font:400 13px/1 var(--fh); }
.hbStore:active { transform:translateY(2px); }
.hbGoBox { display:flex; flex-direction:column; gap:0; }
.hbGo { height:clamp(66px, 9vh, 84px); } /* B1 (review 2026-10-07): fixed height, the job name is one ellipsised line */
.hbGo { position:relative; display:flex; align-items:center; gap:10px; min-height:clamp(66px, 9vh, 84px); padding:6px 14px 8px 8px; border-radius:20px 20px 0 0; border:4px solid #3a0f02; cursor:pointer;
  background:linear-gradient(180deg,var(--or1),var(--or2) 55%,var(--or3)); box-shadow:inset 0 3px 0 rgba(255,240,200,.65), inset 0 -5px 0 rgba(140,30,0,.3); color:#fff; text-align:left; }
.hbGo .hgI { width:clamp(46px, 6vh, 60px); height:clamp(46px, 6vh, 60px); flex:none; display:flex; align-items:center; justify-content:center; font-size:34px; }
.hbGo .hgI img, .hbGo .hgI .art { width:100%; height:100%; object-fit:contain; }
.hbGo .hgT { flex:1; min-width:0; display:flex; flex-direction:column; }
.hbGo .hgT b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font:400 clamp(26px, 3.6vh, 34px)/1 var(--fh); letter-spacing:1px; text-shadow:0 3px 0 #3a0f02,0 -2px 0 #3a0f02,2px 0 0 #3a0f02,-2px 0 0 #3a0f02; }
.hbGo .hgT small { font:800 13px/1.2 var(--fb); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 0 #3a0f02; }
.hbGo:active { transform:translateY(2px); }
.hbStrip { display:flex; align-items:center; gap:8px; justify-content:space-between; padding:7px 10px; border-radius:0 0 16px 16px; border:3px solid var(--ol); border-top:0;
  background:linear-gradient(180deg,#123a73,#0b2650); font:800 13px/1.2 var(--fb); color:#fff; }
.hbCar { border:0; background:none; color:#ffd23f; font:400 15px/1.1 var(--fh); text-shadow:var(--so2); cursor:pointer; padding:0; text-align:left; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.hbIns { display:flex; align-items:center; gap:6px; white-space:nowrap; cursor:pointer; }
.hbIns input { width:18px; height:18px; accent-color:#7ff05a; }
.hbIns.ok { color:#7ff05a; cursor:default; } .hbIns.dim { color:var(--dim); cursor:default; }
.hbIns svg { width:16px; height:16px; }
.hbMenu { display:flex; flex-direction:column; gap:7px; min-height:0; }
.hbM { position:relative; display:flex; align-items:center; gap:10px; min-height:clamp(44px, 6.2vh, 58px); padding:4px 14px 6px 8px; border-radius:16px; border:3px solid var(--ol); cursor:pointer;
  background:linear-gradient(180deg,var(--pn1),var(--pn2) 60%,var(--pn3)); box-shadow:var(--panelSh); color:#fff; text-align:left; }
.hbM .hmI { width:40px; height:36px; flex:none; display:flex; align-items:center; justify-content:center; font-size:24px; }
.hbM .hmI img, .hbM .hmI .art { width:100%; height:100%; object-fit:contain; }
.hbM .hmT { flex:1; font:400 clamp(18px, 2.5vh, 23px)/1 var(--fh); letter-spacing:.5px; text-shadow:var(--so2); }
.hbM:hover { filter:brightness(1.1); } .hbM:active { transform:translateY(2px); }
.hbM .dot { position:absolute; top:-6px; left:34px; right:auto; }
.hub .dkK { display:none; }
html.lay-mouse .hub .dkK { display:block; flex:none; min-width:22px; padding:1px 6px 2px; border-radius:6px; background:rgba(4,14,34,.55); border:2px solid rgba(8,20,45,.9); color:#ffd23f; font:900 11px/1.3 var(--fb); text-align:center; }

/* player card (opens Community + Career) */
.hbMe { grid-area:me; justify-self:start; display:flex; align-items:center; gap:12px; max-width:min(100%, 620px); padding:8px 16px 8px 8px; border-radius:20px; border:3px solid var(--ol); cursor:pointer;
  background:linear-gradient(180deg,var(--pn1),var(--pn2) 60%,var(--pn3)); box-shadow:var(--panelSh); color:#fff; text-align:left; }
.hbAv { width:64px; height:64px; flex:none; border-radius:16px; border:3px solid var(--ol); overflow:hidden; background:linear-gradient(160deg,#6fd0ff,#2a7fd6); display:flex; align-items:center; justify-content:center; }
.hbAv img, .hbAv .art { width:100%; height:100%; object-fit:cover; object-position:50% 20%; }
.hbAv b { font:400 28px/1 var(--fh); text-shadow:var(--so); }
.hbWho { display:flex; flex-direction:column; gap:5px; min-width:120px; }
.hbWho > b { font:400 22px/1 var(--fh); text-shadow:var(--so2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:200px; }
.hbXp { position:relative; height:16px; width:clamp(120px, 14vw, 200px); border:2.5px solid var(--ol); border-radius:8px; background:#0b2346; overflow:hidden; }
.hbXp i { position:absolute; left:0; top:0; bottom:0; background:linear-gradient(180deg,#8ff0ff,#1fb6e8); }
.hbXp em { position:absolute; inset:0; font:900 9.5px/11px var(--fb); font-style:normal; text-align:center; color:#fff; text-shadow:0 1px 0 var(--ol),0 -1px 0 var(--ol),1px 0 0 var(--ol),-1px 0 0 var(--ol); }
.hbRank { width:46px; height:52px; flex:none; display:flex; align-items:center; justify-content:center; padding-bottom:4px; font:400 22px/1 var(--fh); color:#fff; text-shadow:var(--so2);
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 36'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff27a'/%3E%3Cstop offset='.5' stop-color='%23ffc21a'/%3E%3Cstop offset='1' stop-color='%23f08a0a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 2 L29 6.5 Q29.5 23 16 34 Q2.5 23 3 6.5 Z' fill='url(%23g)' stroke='%230b1a33' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat; }
.hbCash { display:flex; flex-direction:column; padding-left:12px; border-left:2px solid rgba(8,20,45,.6); }
.hbCash .coin { display:none; }
.hbCash small { font:900 11px/1 var(--fb); color:var(--mut); letter-spacing:.5px; }
.hbCash b { font:400 26px/1.05 var(--fh); color:#ffe46a; text-shadow:var(--so2); }

/* bottom-right cards */
.hbCards { grid-area:cards; display:flex; gap:10px; align-items:stretch; justify-content:flex-end; }
.hbToday, .hbHorde { display:flex; flex-direction:column; justify-content:center; padding:8px 16px; border-radius:18px; border:3px solid var(--ol); cursor:pointer; color:#fff; box-shadow:var(--panelSh); text-align:center; }
.hbToday { background:linear-gradient(180deg,var(--pn1),var(--pn3)); min-width:90px; }
.hbHorde { flex:1; background:linear-gradient(135deg,#5a0e1c,#2a0610); border-color:#1a0306; }
.hbToday b, .hbHorde b { font:400 15px/1 var(--fh); letter-spacing:.5px; text-shadow:var(--so2); }
.hbToday span, .hbHorde span { font:400 24px/1.1 var(--fh); color:#ffd23f; text-shadow:var(--so2); }
.hbHorde.soon span { color:#ff9a3a; } .hbHorde.live span { color:#ff5a44; animation:hbPulse 1s infinite; }
@keyframes hbPulse { 50% { opacity:.55; } }
@media (prefers-reduced-motion: reduce) { .hbHorde.live span { animation:none; } .hbBubba { transition:none; } }

/* ---------- phones and tall, narrow windows: one column ---------- */
/* Bucket 1 (2026-10-08): was max-width 860px / aspect 1:1, which sent a half-width computer window to the phone column */
@media (max-width: 640px), (max-aspect-ratio: 3/4) {
  #ui.homeScr #uiView { overflow-y:auto; }
  .hub { grid-template-columns:minmax(0,1fr); grid-template-rows:auto clamp(220px, 38vh, 360px) auto auto auto; grid-template-areas:"logo" "stage" "side" "me" "cards"; height:auto; padding:10px 12px 18px; }
  .hub > .hbIcons { right:12px; top:10px; }
  .hbIco { width:42px; height:42px; }
  .hbSide { padding-top:0; }
  .hbMenu { display:grid; grid-template-columns:1fr 1fr; }
  .hbMe { justify-self:stretch; max-width:none; }
  .hbCash { margin-left:auto; }
  .hbCards { justify-content:stretch; }
}
/* rank gate on the Home player card (audit run 2): the XP bar is full, this says what unlocks the next rank */
.hbGate { display:inline-flex; align-items:center; gap:5px; margin-top:4px; padding:3px 9px; border-radius:9px; border:2px solid var(--ol); background:#ffb43c; color:#2a1600; font:900 12px/1.2 var(--fb); white-space:nowrap; cursor:pointer; }
.hbGate:hover { background:#ffc966; }
.hbGate svg, .hbGate img { width:13px; height:13px; }
.hbGate.hbLegend { background:#2a1f5c; color:#ffd23f; cursor:default; }
.hbGate.hbLegend:hover { background:#2a1f5c; }
/* K1/M1 (review 2026-10-07): the top bar on every full-chrome page = back arrow + page title (as .pgHead), Cash + mail on the right */
#uiTop .tPg { flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:10px; }
#uiTop .tPg .pgT { margin:0; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#uiTop.tPgOn .tRight { flex:none; }
.hbM .dot.gold { background:linear-gradient(180deg,#ffe066,#f2a516); color:#3a1d00; border-color:#7a4a00; min-width:auto; padding:0 6px; } /* H1/C6: something to claim or spend */
/* Progression kit (admin test accounts): the XP bank card and sheet */
.hbKit { display:flex; flex-direction:column; justify-content:center; padding:8px 14px; border-radius:18px; border:3px solid #7a3500; cursor:pointer; color:#2a1200; text-align:center; background:linear-gradient(180deg,#ffc04d,#ff8a1f); box-shadow:var(--panelSh); }
.hbKit b { font:400 15px/1 var(--fh); letter-spacing:.5px; }
.hbKit span { font:900 13px/1.2 var(--fb); }
.kitRow { display:flex; justify-content:space-between; gap:10px; padding:6px 0; border-bottom:1px solid rgba(255,255,255,.08); font-variant-numeric:tabular-nums; }
.kitGate { margin:10px 0; }
.kitGate p { margin:4px 0 8px; }
.kitFinBtn { background:linear-gradient(180deg,#ffc04d,#ff8a1f) !important; border-color:#7a3500 !important; color:#2a1200 !important; text-shadow:none !important; }
.bzDock #baseKitFin { width:calc(100% - 16px); margin:6px 8px 4px; }

/* Bucket 1 (2026-10-08): ultra-wide windows keep Home composed: the content stays within ~1800 px (layout px, x the menu scale)
   and the garage background fills the rest, instead of Bubba and the menu drifting to opposite edges */
html.lay-desk .hub { padding-left:max(18px, calc((100% - 1800px) / 2)); padding-right:max(18px, calc((100% - 1800px) / 2)); }
@media (min-width: 641px) and (min-aspect-ratio: 3/4) { html.lay-desk .hub > .hbIcons { right:calc(max(18px, calc((100% - 1800px) / 2)) + clamp(300px, 26vw, 400px) + 18px); } } /* the icons sit just left of the menu column, inside the capped width */
