/* Alpha Husky — Echo Wardens Living HQ P0 */
#factionHQLivingP0{display:none}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0{
  --ew-gold:var(--hq-accent,255,211,77);
  position:absolute;inset:0;z-index:2;display:block;overflow:hidden;pointer-events:none;color:#fff;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-scene{
  position:absolute;inset:0;
  background-image:
    linear-gradient(180deg,rgba(2,4,7,.10) 0%,rgba(2,4,7,.06) 44%,rgba(2,4,7,.72) 82%,rgba(2,4,7,.92) 100%),
    var(--hq-scene),
    var(--hq-fallback);
  background-size:cover,cover,cover;background-position:center,center,center;
  transform:scale(1.018);animation:lhqBreath 14s ease-in-out infinite alternate;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-scene::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(circle at 50% 31%,rgba(var(--ew-gold),.13),transparent 19%),
             radial-gradient(ellipse at 50% 58%,transparent 0 42%,rgba(0,0,0,.34) 76%,rgba(0,0,0,.68) 100%);
}
#factionHQLivingP0 .lhq-scan{position:absolute;left:-10%;right:-10%;top:0;height:2px;opacity:.24;
  background:linear-gradient(90deg,transparent,rgba(var(--ew-gold),.88),transparent);
  box-shadow:0 0 22px rgba(var(--ew-gold),.55);animation:lhqScan 7.8s linear infinite}
#factionHQLivingP0 .lhq-core{
  position:absolute;left:50%;top:30.5%;width:min(31vw,146px);aspect-ratio:1;transform:translate(-50%,-50%);
  display:grid;place-items:center;border-radius:50%;pointer-events:none;
}
#factionHQLivingP0 .lhq-core::before,#factionHQLivingP0 .lhq-core::after{
  content:"";position:absolute;inset:2%;border:1px solid rgba(var(--ew-gold),.42);border-radius:50%;
  box-shadow:0 0 24px rgba(var(--ew-gold),.16),inset 0 0 24px rgba(var(--ew-gold),.08);
  animation:lhqRing 12s linear infinite}
#factionHQLivingP0 .lhq-core::after{inset:15%;border-style:dashed;animation-direction:reverse;animation-duration:8s}
#factionHQLivingP0 .lhq-sigil{
  width:62%;height:62%;object-fit:contain;opacity:.92;
  filter:sepia(1) saturate(3.8) hue-rotate(2deg) brightness(1.35) drop-shadow(0 0 12px rgba(var(--ew-gold),.72));
  animation:lhqSigil 5.6s ease-in-out infinite}
#factionHQLivingP0 .lhq-conduit{position:absolute;left:50%;top:36%;width:1px;height:26%;transform:translateX(-50%);
 background:linear-gradient(to bottom,rgba(var(--ew-gold),.9),rgba(var(--ew-gold),.12),transparent);
 box-shadow:0 0 15px rgba(var(--ew-gold),.65);opacity:.64}
#factionHQLivingP0 .lhq-conduit.c2{left:47.8%;opacity:.28}.lhq-conduit.c3{left:52.2%;opacity:.28}
#factionHQLivingP0 .lhq-front{
  position:absolute;left:50%;top:57%;width:min(72vw,360px);height:120px;transform:translate(-50%,-50%);
  pointer-events:auto;cursor:pointer;border:0;background:transparent;color:#fff;
}
#factionHQLivingP0 .lhq-front::before{
  content:"";position:absolute;left:8%;right:8%;top:36%;height:52%;border-radius:50%;
  border:1px solid rgba(var(--ew-gold),.46);
  background:radial-gradient(ellipse,rgba(var(--ew-gold),.11),transparent 62%);
  box-shadow:0 0 28px rgba(var(--ew-gold),.12);animation:lhqFrontPulse 4.8s ease-in-out infinite}
#factionHQLivingP0 .lhq-front-copy{position:absolute;left:50%;bottom:0;transform:translateX(-50%);min-width:190px;text-align:center;
 text-shadow:0 2px 12px #000}
#factionHQLivingP0 .lhq-kicker{font-size:9px;font-weight:900;letter-spacing:.24em;color:rgba(var(--ew-gold),.82)}
#factionHQLivingP0 .lhq-front-title{margin-top:4px;font-size:17px;font-weight:950;letter-spacing:.08em}
#factionHQLivingP0 .lhq-front-state{margin-top:3px;font-size:10px;letter-spacing:.16em;color:rgba(255,255,255,.68)}
#factionHQLivingP0 .lhq-personal{
  position:absolute;right:18px;bottom:calc(max(90px,env(safe-area-inset-bottom) + 72px));width:min(43vw,180px);max-width:180px;
  padding:9px 11px 8px;border:1px solid rgba(var(--ew-gold),.22);border-radius:12px;
  background:rgba(5,7,10,.56);backdrop-filter:blur(8px);text-align:left;pointer-events:auto;
  appearance:none;-webkit-appearance:none;color:#fff;cursor:pointer;
}
#factionHQLivingP0 .lhq-personal strong{display:block;margin-top:3px;font-size:11px;line-height:1.1;letter-spacing:.07em}
#factionHQLivingP0 .lhq-personal small{display:flex;align-items:center;gap:5px;font-size:7px;line-height:1.15;letter-spacing:.12em;color:rgba(var(--ew-gold),.78);white-space:nowrap}
#factionHQLivingP0 .lhq-pack-activity{display:block;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:8px;line-height:1.2;color:rgba(255,255,255,.64)}
#factionHQLivingP0 .lhq-personal em{display:block;margin-top:4px;font-style:normal;font-size:7px;line-height:1;letter-spacing:.12em;color:rgba(255,255,255,.38)}
#factionHQLivingP0 .lhq-presence-dot{display:inline-block;flex:0 0 auto;width:6px;height:6px;border-radius:50%;background:rgba(var(--ew-gold),.42);box-shadow:0 0 0 rgba(var(--ew-gold),0)}
#factionHQLivingP0 .lhq-pack-signal[data-presence-state="recent_signal"] .lhq-presence-dot{background:rgba(var(--ew-gold),.88);box-shadow:0 0 9px rgba(var(--ew-gold),.30)}
#factionHQLivingP0 .lhq-pack-signal[data-presence-state="pack_moving"] .lhq-presence-dot{background:rgba(var(--ew-gold),1);box-shadow:0 0 11px rgba(var(--ew-gold),.42);animation:lhqPresencePulse 2.8s ease-in-out infinite}
#factionHQLivingP0 .lhq-pack-signal:active{transform:translateY(1px)}
#factionHQLivingP0 .lhq-pack-signal[aria-disabled="true"]{cursor:default;opacity:.74}
#factionHQLivingP0 .lhq-top{
  position:absolute;left:16px;right:16px;top:max(14px,env(safe-area-inset-top));display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
}
#factionHQLivingP0 .lhq-title{font-size:13px;font-weight:950;letter-spacing:.11em}.lhq-creed{margin-top:3px;font-size:9px;letter-spacing:.2em;color:rgba(var(--ew-gold),.78)}
#factionHQLivingP0 .lhq-close{pointer-events:auto;width:38px;height:38px;border-radius:12px;border:1px solid rgba(255,255,255,.18);background:rgba(0,0,0,.34);color:#fff;font-size:18px}

#factionHQLivingP0 .lhq-lunar-host{
  position:absolute;
  left:14px;
  right:14px;
  top:calc(max(14px,env(safe-area-inset-top)) + 54px);
  z-index:25;
  display:flex;
  justify-content:flex-start;
  pointer-events:none;
}
#factionHQLivingP0 .lhq-lunar{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:8px;
  align-items:center;
  width:min(78vw,300px);
  padding:7px 9px;
  border:1px solid rgba(var(--ew-gold),.20);
  border-radius:12px;
  background:linear-gradient(180deg,rgba(4,6,10,.66),rgba(4,6,10,.82));
  box-shadow:0 10px 24px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter:blur(8px);
}
#factionHQLivingP0 .lhq-lunar.is-loading{display:block;width:auto;padding:7px 10px}
#factionHQLivingP0 .lhq-lunar-moon{
  width:34px;height:34px;object-fit:contain;
  filter:drop-shadow(0 0 10px rgba(var(--ew-gold),.22));
}
#factionHQLivingP0 .lhq-lunar-copy{min-width:0}
#factionHQLivingP0 .lhq-lunar-kicker{
  display:block;font-size:6px;font-weight:950;letter-spacing:.18em;color:rgba(var(--ew-gold),.78)
}
#factionHQLivingP0 .lhq-lunar-copy strong{
  display:block;margin-top:1px;font-size:10px;line-height:1.05;letter-spacing:.07em;color:#f4f7fa
}
#factionHQLivingP0 .lhq-lunar-copy small{
  display:block;margin-top:2px;font-size:7px;line-height:1.1;letter-spacing:.05em;color:rgba(255,255,255,.56)
}
#factionHQLivingP0 .lhq-lunar-copy em{
  display:block;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-style:normal;font-size:6px;line-height:1.1;letter-spacing:.08em;color:rgba(var(--ew-gold),.74)
}
#factionHQLivingP0 .lhq-lunar[data-phase="full_blood_moon"]{
  border-color:rgba(228,91,67,.34);
  box-shadow:0 10px 24px rgba(0,0,0,.20),0 0 20px rgba(184,54,42,.10),inset 0 1px 0 rgba(255,255,255,.035);
}
#factionHQLivingP0 .lhq-recognition{position:absolute;inset:0;display:grid;place-items:center;text-align:center;pointer-events:none;
 background:radial-gradient(circle at center,rgba(var(--ew-gold),.10),transparent 35%);animation:lhqRecognize 1.9s ease both}
#factionHQLivingP0 .lhq-recognition strong{display:block;font-size:22px;letter-spacing:.11em;text-shadow:0 0 22px rgba(var(--ew-gold),.42)}
#factionHQLivingP0 .lhq-recognition small{display:block;margin-bottom:8px;font-size:9px;letter-spacing:.25em;color:rgba(255,229,150,.82)}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"]{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;padding:0!important;overflow:visible!important;pointer-events:none}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"] > :not(.hq-v3-command-nav):not(.hq-v3-sheet-layer){display:none!important}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"] .hq-v3-command-nav{pointer-events:auto}

/* Support/aux sheets are children of #factionHQRoot.
   HOME intentionally disables pointer events on that root for the Living HQ scene,
   so explicitly re-enable the root only while a sheet is open. */
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"][data-sheet-open="1"]{
  pointer-events:auto!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"][data-sheet-open="1"] .hq-v3-sheet-layer,
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"][data-sheet-open="1"] .hq-v3-sheet-backdrop,
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"][data-sheet-open="1"] .hq-v3-sheet-panel,
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"][data-sheet-open="1"] .hq-v3-sheet-panel button,
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"][data-sheet-open="1"] .hq-v3-sheet-panel input{
  pointer-events:auto!important;
}
@keyframes lhqBreath{to{transform:scale(1.028) translateY(-.25%)}}
@keyframes lhqScan{0%{top:6%;opacity:0}10%{opacity:.28}90%{opacity:.18}100%{top:91%;opacity:0}}
@keyframes lhqRing{to{transform:rotate(360deg)}}
@keyframes lhqSigil{0%,100%{opacity:.76;transform:scale(.98)}50%{opacity:1;transform:scale(1.035)}}
@keyframes lhqFrontPulse{0%,100%{opacity:.54;transform:scale(.98)}50%{opacity:1;transform:scale(1.03)}}
@keyframes lhqPresencePulse{0%,100%{opacity:.64;box-shadow:0 0 6px rgba(var(--ew-gold),.18)}50%{opacity:1;box-shadow:0 0 13px rgba(var(--ew-gold),.48)}}
@keyframes lhqRecognize{0%{opacity:0}16%,68%{opacity:1}100%{opacity:0;visibility:hidden}}
@media(prefers-reduced-motion:reduce){
 #factionHQLivingP0 *{animation:none!important;transition:none!important}
 #factionHQLivingP0 .lhq-recognition{display:none!important}
 #factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-scene{transform:none}
}

/* P0.1 — composition polish after live-device review */
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"]{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  border-radius:0!important;
  padding:0!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"] .hq-v3-command-nav{
  position:absolute!important;
  left:12px!important;
  right:12px!important;
  bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
  z-index:90!important;
  margin:0!important;
  padding:7px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:16px!important;
  background:rgba(4,6,10,.78)!important;
  box-shadow:0 16px 34px rgba(0,0,0,.34),inset 0 1px 0 rgba(255,255,255,.05)!important;
  backdrop-filter:blur(16px)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"] .hq-v3-command-nav button{
  min-height:42px!important;
  padding:7px 6px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-personal{
  bottom:calc(86px + env(safe-area-inset-bottom,0px))!important;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-front{
  top:60%!important;
  height:108px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-front-copy{
  bottom:6px!important;
  min-width:210px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-front-title{
  font-size:15px!important;
  letter-spacing:.11em!important;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-front-state{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin-top:6px!important;
  padding:4px 8px!important;
  border:1px solid rgba(var(--ew-gold),.24)!important;
  border-radius:999px!important;
  background:rgba(5,7,10,.42)!important;
  font-size:8px!important;
  letter-spacing:.18em!important;
  color:rgba(var(--ew-gold),.82)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"],
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"]{
  padding-bottom:88px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot .hq-v3-legacy-close{
  display:none!important;
}


/* P0.2 — FRONT / PACK premium shell closure */
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"],
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"]{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:72px 12px calc(126px + env(safe-area-inset-bottom,0px))!important;
  scroll-padding-bottom:calc(126px + env(safe-area-inset-bottom,0px))!important;
  overscroll-behavior-y:contain;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  background:
    linear-gradient(180deg,rgba(3,5,8,.10) 0%,rgba(3,5,8,.34) 26%,rgba(3,5,8,.82) 74%,rgba(3,5,8,.96) 100%)!important;
  backdrop-filter:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-v3-command-nav,
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-v3-command-nav{
  position:fixed!important;
  left:12px!important;
  right:12px!important;
  bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
  z-index:95!important;
  margin:0!important;
  padding:7px!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:16px!important;
  background:linear-gradient(180deg,rgba(4,6,10,.94),rgba(4,6,10,.98))!important;
  box-shadow:0 -20px 30px rgba(3,5,8,.58),0 16px 34px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.05)!important;
  backdrop-filter:blur(16px)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-grid,
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-grid{
  width:min(100%,520px)!important;
  margin:0 auto!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-current-front{
  min-height:0!important;
  margin:0!important;
  padding:16px!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(8,10,14,.78),rgba(8,10,14,.58))!important;
  border:1px solid rgba(var(--ew-gold),.18)!important;
  box-shadow:0 18px 36px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.04)!important;
  backdrop-filter:blur(10px)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-front-metrics{
  gap:8px!important;
  margin-top:14px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-front-metrics > div{
  padding:11px 8px!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.035)!important;
  border:1px solid rgba(255,255,255,.06)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-note{
  background:rgba(255,255,255,.035)!important;
  border-color:rgba(255,255,255,.06)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="front"] .hq-v3-calm-line{
  margin-top:12px!important;
  padding:16px 12px!important;
  background:rgba(var(--ew-gold),.035)!important;
  border:1px solid rgba(var(--ew-gold),.10)!important;
  color:rgba(var(--ew-gold),.70)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-grid.two{
  width:min(100%,520px)!important;
  margin:0 auto!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-grid.two > [data-hq-section="pack"]:last-child{
  margin-bottom:18px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] [data-hq-section="pack"]{
  margin:0 0 10px!important;
  padding:14px!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(8,10,14,.78),rgba(8,10,14,.58))!important;
  border:1px solid rgba(var(--ew-gold),.14)!important;
  box-shadow:0 14px 30px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.035)!important;
  backdrop-filter:blur(10px)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-card-title{
  margin-bottom:10px!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-note{
  background:rgba(255,255,255,.03)!important;
  border-color:rgba(255,255,255,.055)!important;
}
#factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="pack"] .hq-kpi{
  background:rgba(255,255,255,.025)!important;
  border-color:rgba(255,255,255,.055)!important;
}


/* Premium faction occupation layers — shared Echo master structure */
#factionHQBack.hq-living-inner #factionHQLivingP0{--hq-accent:64,196,255}
#factionHQBack.hq-living-rogue #factionHQLivingP0{--hq-accent:255,59,59}
#factionHQBack.hq-living-burners #factionHQLivingP0{--hq-accent:255,122,26}
#factionHQBack.hq-living-echo #factionHQLivingP0{--hq-accent:255,211,77}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-scan{animation-duration:3.4s;opacity:.38}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-sigil{animation-duration:2.8s}
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-core::before{animation-duration:16s}
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-sigil{animation-duration:7.5s}
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-front::before{animation-duration:3.2s}
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-sigil{animation-duration:4s}


/* === Faction HQ Runtime Integration V2 — final scene-aware composition === */
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-scene{
  background-position:center center, var(--hq-scene-position,50% 50%), var(--hq-scene-position,50% 50%)!important;
  background-size:cover,cover,cover!important;
}
#factionHQBack[class*="hq-living-"] #factionHQLivingP0 .lhq-scene::after{
  background:
    linear-gradient(180deg,rgba(2,4,7,.44) 0%,rgba(2,4,7,.04) 18%,rgba(2,4,7,.02) 50%,rgba(2,4,7,.36) 72%,rgba(2,4,7,.88) 100%),
    radial-gradient(ellipse at var(--hq-focus-x,50%) var(--hq-focus-y,38%),transparent 0 28%,rgba(0,0,0,.10) 54%,rgba(0,0,0,.42) 100%)!important;
}
#factionHQBack.hq-living-echo #factionHQLivingP0{--hq-scene-position:50% 50%;--hq-focus-x:50%;--hq-focus-y:31%}
#factionHQBack.hq-living-inner #factionHQLivingP0{--hq-scene-position:50% 50%;--hq-focus-x:50%;--hq-focus-y:33%}
#factionHQBack.hq-living-rogue #factionHQLivingP0{--hq-scene-position:50% 49%;--hq-focus-x:49%;--hq-focus-y:37%}
#factionHQBack.hq-living-burners #factionHQLivingP0{--hq-scene-position:50% 50%;--hq-focus-x:50%;--hq-focus-y:45%}

#factionHQLivingP0 .lhq-top{
  z-index:24;
  padding:7px 8px;
  margin:-7px -8px;
  border-radius:12px;
  text-shadow:0 2px 14px rgba(0,0,0,.96);
}
#factionHQLivingP0 .lhq-title{font-size:12px;line-height:1.15}
#factionHQLivingP0 .lhq-creed{color:rgba(var(--ew-gold),.82)!important;text-shadow:0 2px 12px rgba(0,0,0,.95)}
#factionHQLivingP0 .lhq-close{background:rgba(4,6,10,.58);backdrop-filter:blur(10px);box-shadow:0 8px 20px rgba(0,0,0,.22)}
#factionHQLivingP0 .lhq-personal{
  z-index:24;
  border-color:rgba(var(--ew-gold),.25)!important;
  background:linear-gradient(180deg,rgba(5,7,10,.66),rgba(5,7,10,.82))!important;
  box-shadow:0 12px 28px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.035);
}
#factionHQLivingP0 .lhq-personal small{color:rgba(var(--ew-gold),.76)!important}
#factionHQLivingP0 .lhq-kicker{color:rgba(var(--ew-gold),.84)!important}
#factionHQLivingP0 .lhq-front-copy{
  padding:7px 12px 8px;
  border-radius:12px;
  background:linear-gradient(180deg,rgba(3,5,8,.16),rgba(3,5,8,.68));
  box-shadow:0 12px 26px rgba(0,0,0,.18);
  backdrop-filter:blur(4px);
}
#factionHQLivingP0 .lhq-front-state{border-color:rgba(var(--ew-gold),.24)!important;color:rgba(var(--ew-gold),.82)!important}

/* The final art already carries each faction hero object. Do not stamp a generic Echo-style core over it. */
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-core,
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-conduit,
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-core,
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-conduit,
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-core,
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-conduit{display:none!important}

/* CURRENT FRONT sits on each environment's natural interaction plane. */
#factionHQBack.hq-living-echo #factionHQLivingP0 .lhq-front{top:60%!important}
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-front{top:61%!important}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-front{top:63%!important}
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-front{top:61.5%!important}

/* Inner Howl: quiet resonance — no generic scanning beam. */
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-scan{opacity:.10;animation-duration:12s}
#factionHQBack.hq-living-inner #factionHQLivingP0 .lhq-front::before{
  left:18%;right:18%;top:47%;height:34%;border:0;border-top:1px solid rgba(var(--ew-gold),.30);border-radius:50%;
  background:radial-gradient(ellipse,rgba(var(--ew-gold),.07),transparent 68%);box-shadow:0 -6px 22px rgba(var(--ew-gold),.08)
}

/* Rogue Byte: hacked signal should feel fractured, not like a second reactor ring. */
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-scan{left:5%;right:18%;height:1px;opacity:.28;animation-duration:4.2s}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-front::before{
  left:15%;right:10%;top:49%;height:28%;border:0;border-left:1px solid rgba(var(--ew-gold),.34);border-bottom:1px solid rgba(var(--ew-gold),.24);border-radius:2px;
  background:linear-gradient(90deg,rgba(var(--ew-gold),.07),transparent 72%);box-shadow:none
}

/* Pack Burners: heat under pressure, not a floating hologram. */
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-scan{display:none!important}
#factionHQBack.hq-living-burners #factionHQLivingP0 .lhq-front::before{
  left:18%;right:18%;top:52%;height:22%;border:0;border-top:1px solid rgba(var(--ew-gold),.34);border-bottom:1px solid rgba(var(--ew-gold),.15);border-radius:4px;
  background:linear-gradient(90deg,transparent,rgba(var(--ew-gold),.09),transparent);box-shadow:0 0 20px rgba(var(--ew-gold),.08)
}

/* Mobile runtime protection: keep real artwork readable but reserve the nav dock. */
@media(max-width:480px){
  #factionHQLivingP0 .lhq-top{left:14px;right:14px}
  #factionHQLivingP0 .lhq-personal{right:14px;width:min(43vw,165px);max-width:165px;padding:8px 10px}
  #factionHQLivingP0 .lhq-front{width:min(78vw,340px)}
  #factionHQBack[class*="hq-living-"] #factionHQRoot[data-hq-view="hq"] .hq-v3-command-nav{left:10px!important;right:10px!important}
}


/* === HQ BUILD PROGRESSION RECOVERY === */
#factionHQLivingP0 .lhq-build{
  position:absolute;
  left:16px;
  bottom:calc(86px + env(safe-area-inset-bottom,0px));
  z-index:24;
  width:min(48vw,210px);
  padding:10px 11px;
  border:1px solid rgba(var(--ew-gold),.24);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(5,7,10,.72),rgba(5,7,10,.88));
  color:#fff;
  text-align:left;
  pointer-events:auto;
  box-shadow:0 12px 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter:blur(10px);
}
#factionHQLivingP0 .lhq-build-kicker{display:block;font-size:8px;font-weight:950;letter-spacing:.18em;color:rgba(var(--ew-gold),.82)}
#factionHQLivingP0 .lhq-build-level{display:block;margin-top:3px;font-size:13px;font-weight:950;letter-spacing:.05em}
#factionHQLivingP0 .lhq-build-level b{color:rgba(var(--ew-gold),.88);padding:0 3px}
#factionHQLivingP0 .lhq-build-stage{display:block;margin-top:2px;font-size:7px;line-height:1.2;letter-spacing:.09em;color:rgba(255,255,255,.48);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#factionHQLivingP0 .lhq-build-bars{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:7px}
#factionHQLivingP0 .lhq-build-meter{display:grid;gap:3px;min-width:0}
#factionHQLivingP0 .lhq-build-meter em{font-style:normal;font-size:6px;line-height:1;letter-spacing:.08em;color:rgba(255,255,255,.46);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#factionHQLivingP0 .lhq-build-meter>span{height:3px;border-radius:99px;background:rgba(255,255,255,.08);overflow:hidden}
#factionHQLivingP0 .lhq-build-bars i{display:block;height:100%;border-radius:99px;background:rgba(var(--ew-gold),.78);box-shadow:0 0 8px rgba(var(--ew-gold),.22)}
#factionHQLivingP0 .lhq-build-cta{display:inline-flex;margin-top:7px;padding:4px 7px;border-radius:999px;border:1px solid rgba(var(--ew-gold),.22);font-size:7px;font-weight:950;letter-spacing:.12em;color:rgba(var(--ew-gold),.86)}
#factionHQLivingP0 .lhq-build:active{transform:translateY(1px)}

/* === LAYERED HQ GROWTH SYSTEM V1 ===
   Blueprint rule: levels add real visible modules / activity layers; they do not just recolor the same image. */
#factionHQLivingP0 .lhq-growth{
  position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden;
}
#factionHQLivingP0 .lhq-growth-layer{position:absolute;inset:0;opacity:0;transition:opacity .55s ease,filter .55s ease}
#factionHQLivingP0[data-hq-level="2"] .lhq-growth-l2,
#factionHQLivingP0[data-hq-level="3"] .lhq-growth-l2,
#factionHQLivingP0[data-hq-level="4"] .lhq-growth-l2,
#factionHQLivingP0[data-hq-level="5"] .lhq-growth-l2,
#factionHQLivingP0[data-hq-level="6"] .lhq-growth-l2{opacity:1}
#factionHQLivingP0[data-hq-level="3"] .lhq-growth-l3,
#factionHQLivingP0[data-hq-level="4"] .lhq-growth-l3,
#factionHQLivingP0[data-hq-level="5"] .lhq-growth-l3,
#factionHQLivingP0[data-hq-level="6"] .lhq-growth-l3{opacity:1}
#factionHQLivingP0[data-hq-level="4"] .lhq-growth-l4,
#factionHQLivingP0[data-hq-level="5"] .lhq-growth-l4,
#factionHQLivingP0[data-hq-level="6"] .lhq-growth-l4{opacity:1}
#factionHQLivingP0[data-hq-level="5"] .lhq-growth-l5,
#factionHQLivingP0[data-hq-level="6"] .lhq-growth-l5{opacity:1}
#factionHQLivingP0[data-hq-level="6"] .lhq-growth-l6{opacity:1}

/* LV1 — RAW CORE: same physical place, mostly dormant. */
#factionHQLivingP0[data-hq-level="1"] .lhq-scene{filter:brightness(.82) saturate(.82) contrast(1.035)}
#factionHQLivingP0[data-hq-level="1"] .lhq-scan{opacity:.07!important}
#factionHQLivingP0[data-hq-level="1"] .lhq-front::before{opacity:.48}
#factionHQLivingP0:not([data-hq-level="1"]) .lhq-scene{filter:none}

/* Shared structural vocabulary. */
#factionHQLivingP0 .g-node{
  position:absolute;width:10px;height:10px;border:1px solid rgba(var(--ew-gold),.50);border-radius:3px;
  background:rgba(4,7,10,.72);box-shadow:0 0 12px rgba(var(--ew-gold),.18),inset 0 0 7px rgba(var(--ew-gold),.10);
}
#factionHQLivingP0 .g-node::after{content:"";position:absolute;inset:3px;border-radius:1px;background:rgba(var(--ew-gold),.74);box-shadow:0 0 7px rgba(var(--ew-gold),.65)}
#factionHQLivingP0 .g-node.n1{left:15%;top:25%}.g-node.n2{right:15%;top:27%}
#factionHQLivingP0 .g-node.n3{left:11%;top:43%}.g-node.n4{right:11%;top:41%}

#factionHQLivingP0 .g-rail{
  position:absolute;height:2px;border-radius:99px;
  background:linear-gradient(90deg,transparent,rgba(var(--ew-gold),.62),transparent);
  box-shadow:0 0 11px rgba(var(--ew-gold),.22);
}
#factionHQLivingP0 .g-rail.r1{left:18%;right:18%;top:30%}
#factionHQLivingP0 .g-rail.r2{left:8%;width:25%;top:47%;transform:rotate(-7deg)}
#factionHQLivingP0 .g-rail.r3{right:8%;width:25%;top:47%;transform:rotate(7deg)}

#factionHQLivingP0 .g-link{
  position:absolute;width:1px;height:15%;top:31%;
  background:linear-gradient(180deg,rgba(var(--ew-gold),.56),rgba(var(--ew-gold),.04));
  box-shadow:0 0 10px rgba(var(--ew-gold),.20);
}
#factionHQLivingP0 .g-link.l1{left:22%;transform:rotate(9deg)}.g-link.l2{right:22%;transform:rotate(-9deg)}
#factionHQLivingP0 .g-link.l3{left:34%;top:36%;height:20%}.g-link.l4{right:34%;top:36%;height:20%}

#factionHQLivingP0 .g-brace{
  position:absolute;top:34%;width:18%;height:17%;border-top:2px solid rgba(var(--ew-gold),.26);
  border-bottom:1px solid rgba(var(--ew-gold),.12);opacity:.82;
}
#factionHQLivingP0 .g-brace::before,#factionHQLivingP0 .g-brace::after{
  content:"";position:absolute;top:-2px;width:12px;height:calc(100% + 3px);
  border:1px solid rgba(var(--ew-gold),.18);background:linear-gradient(180deg,rgba(8,11,15,.66),rgba(2,4,7,.24));
}
#factionHQLivingP0 .g-brace.b1{left:5%;transform:skewY(-8deg)}#factionHQLivingP0 .g-brace.b1::after{right:0}
#factionHQLivingP0 .g-brace.b2{right:5%;transform:skewY(8deg)}#factionHQLivingP0 .g-brace.b2::before{left:0}

#factionHQLivingP0 .g-core-pulse{
  position:absolute;left:50%;top:42%;width:min(33vw,170px);aspect-ratio:1;transform:translate(-50%,-50%);
  border-radius:50%;border:1px solid rgba(var(--ew-gold),.18);
  box-shadow:0 0 38px rgba(var(--ew-gold),.10),inset 0 0 24px rgba(var(--ew-gold),.06);
  animation:lhqTierCore 4.8s ease-in-out infinite;
}
#factionHQLivingP0 .g-prestige{
  position:absolute;left:50%;top:18%;width:1px;height:42%;transform:translateX(-50%);
  background:linear-gradient(180deg,transparent,rgba(var(--ew-gold),.26),rgba(var(--ew-gold),.06),transparent);
  box-shadow:0 0 20px rgba(var(--ew-gold),.16);animation:lhqPrestige 6s ease-in-out infinite;
}
#factionHQLivingP0 .g-orbit{
  position:absolute;left:50%;top:42%;width:min(45vw,220px);aspect-ratio:1;transform:translate(-50%,-50%);
  border:1px solid rgba(var(--ew-gold),.13);border-radius:50%;
}
#factionHQLivingP0 .g-orbit.o1{animation:lhqOrbit 18s linear infinite}
#factionHQLivingP0 .g-orbit.o2{width:min(55vw,270px);opacity:.55;animation:lhqOrbit 26s linear infinite reverse}

/* Faction occupation layer: same progression system, four materially different readings. */
#factionHQBack.hq-living-echo #factionHQLivingP0 .g-brace{border-radius:2px}
#factionHQBack.hq-living-echo #factionHQLivingP0 .g-node{transform:rotate(45deg)}
#factionHQBack.hq-living-echo #factionHQLivingP0 .g-node::after{transform:rotate(-45deg)}
#factionHQBack.hq-living-echo #factionHQLivingP0 .g-core-pulse{border-style:dashed}

#factionHQBack.hq-living-inner #factionHQLivingP0 .g-node{border-radius:50%;opacity:.65}
#factionHQBack.hq-living-inner #factionHQLivingP0 .g-rail{height:1px;opacity:.62}
#factionHQBack.hq-living-inner #factionHQLivingP0 .g-brace{opacity:.32;border-color:rgba(var(--ew-gold),.14)}
#factionHQBack.hq-living-inner #factionHQLivingP0 .g-core-pulse{width:min(40vw,190px);border-color:rgba(var(--ew-gold),.12);animation-duration:7.5s}
#factionHQBack.hq-living-inner #factionHQLivingP0 .g-orbit{opacity:.32}

#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-rail.r1{left:12%;right:31%;transform:rotate(-4deg)}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-rail.r2{left:7%;width:36%;transform:rotate(11deg)}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-rail.r3{right:12%;width:18%;transform:rotate(-13deg)}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-node.n2{right:25%;top:23%}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-node.n3{left:7%;top:47%}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-brace.b1{width:25%;transform:skewY(-13deg)}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-brace.b2{width:12%;transform:skewY(6deg)}
#factionHQBack.hq-living-rogue #factionHQLivingP0 .g-core-pulse{border-radius:8px;transform:translate(-50%,-50%) rotate(2deg);animation-duration:3.1s}

#factionHQBack.hq-living-burners #factionHQLivingP0 .g-node{top:auto;bottom:41%;width:16px;height:7px;border-radius:2px}
#factionHQBack.hq-living-burners #factionHQLivingP0 .g-rail.r1{top:auto;bottom:46%;left:13%;right:13%;height:3px}
#factionHQBack.hq-living-burners #factionHQLivingP0 .g-brace{top:39%;height:12%;width:23%;border-top-width:3px}
#factionHQBack.hq-living-burners #factionHQLivingP0 .g-core-pulse{top:48%;width:min(48vw,230px);aspect-ratio:2.4;border-radius:50%;animation-duration:3.8s}
#factionHQBack.hq-living-burners #factionHQLivingP0 .g-orbit{top:48%;width:min(56vw,270px);aspect-ratio:2.5}

/* Confirmed upgrade beat — only after the backend returns success. */
#factionHQLivingP0 .lhq-upgrade-moment{
  position:absolute;inset:0;z-index:70;display:grid;place-items:center;pointer-events:none;
  background:radial-gradient(circle at 50% 45%,rgba(var(--ew-gold),.13),rgba(2,4,7,.22) 35%,rgba(2,4,7,.72) 100%);
  animation:lhqUpgradeMoment 2.55s ease both;
}
#factionHQLivingP0 .lhq-upgrade-surge{
  position:absolute;left:50%;top:45%;width:1px;height:62%;transform:translate(-50%,-50%);
  background:linear-gradient(180deg,transparent,rgba(var(--ew-gold),.92),transparent);
  box-shadow:0 0 34px rgba(var(--ew-gold),.75);
  animation:lhqUpgradeSurge 1.15s ease-out both;
}
#factionHQLivingP0 .lhq-upgrade-copy{
  position:absolute;left:50%;top:53%;width:min(84vw,420px);transform:translate(-50%,-50%);text-align:center;
  text-shadow:0 3px 20px rgba(0,0,0,.95);
}
#factionHQLivingP0 .lhq-upgrade-copy small{display:block;color:rgba(var(--ew-gold),.92);font-size:9px;font-weight:950;letter-spacing:.22em}
#factionHQLivingP0 .lhq-upgrade-copy strong{display:block;margin-top:8px;font-size:17px;line-height:1.15;letter-spacing:.06em}
#factionHQLivingP0.is-upgrading .lhq-growth{filter:brightness(1.45)}
#factionHQLivingP0.is-upgrading .lhq-scene{animation-duration:1.1s}

@keyframes lhqTierCore{0%,100%{opacity:.34;transform:translate(-50%,-50%) scale(.98)}50%{opacity:.85;transform:translate(-50%,-50%) scale(1.025)}}
@keyframes lhqPrestige{0%,100%{opacity:.22}50%{opacity:.72}}
@keyframes lhqOrbit{to{transform:translate(-50%,-50%) rotate(360deg)}}
@keyframes lhqUpgradeMoment{0%{opacity:0}12%,76%{opacity:1}100%{opacity:0}}
@keyframes lhqUpgradeSurge{0%{opacity:0;transform:translate(-50%,-50%) scaleY(.05)}35%{opacity:1;transform:translate(-50%,-50%) scaleY(1)}100%{opacity:.08;transform:translate(-50%,-50%) scaleY(1.08)}}

@media(prefers-reduced-motion:reduce){
  #factionHQLivingP0 .lhq-growth *{animation:none!important}
  #factionHQLivingP0 .lhq-upgrade-moment{animation-duration:.35s}
  #factionHQLivingP0 .lhq-upgrade-surge{animation:none}
}

@media(max-width:390px){
  #factionHQLivingP0 .lhq-build{left:12px;width:min(47vw,184px);padding:9px 10px}
  #factionHQLivingP0 .lhq-personal{right:12px;width:min(42vw,158px);max-width:158px}
  #factionHQLivingP0 .lhq-pack-activity{font-size:7px}
}


/* === HQ VISUAL PROGRESSION PREVIEW HARNESS === */
#factionHQLivingP0[data-hq-preview="1"] .lhq-preview-chip{
  position:absolute;
  top:calc(56px + env(safe-area-inset-top,0px));
  left:50%;
  transform:translateX(-50%);
  z-index:28;
  padding:5px 8px;
  border-radius:999px;
  border:1px solid rgba(var(--ew-gold),.24);
  background:rgba(4,6,10,.72);
  backdrop-filter:blur(10px);
  color:rgba(var(--ew-gold),.90);
  font-size:7px;
  font-weight:950;
  letter-spacing:.16em;
  pointer-events:none;
}
#factionHQLivingP0[data-hq-preview="1"] .lhq-build{
  opacity:.72;
}
#factionHQLivingP0[data-hq-preview="1"] .lhq-build{
  cursor:default;
}
#factionHQLivingP0[data-hq-preview="1"] .lhq-build-preview-note{
  display:block;
  margin-top:6px;
  font-size:6px;
  line-height:1.25;
  letter-spacing:.10em;
  color:rgba(255,255,255,.42);
}

/* Rogue Byte master progression: prioritize silhouette + physical infrastructure over glow. */
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="1"] .lhq-growth-layer{opacity:0!important}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="1"] .lhq-scan{opacity:.04!important}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="1"] .lhq-front::before{opacity:.35!important}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="1"] .lhq-scene{
  filter:brightness(.72) saturate(.72) contrast(1.08)!important;
}

/* LV3 — visible network activation without fortress mass yet. */
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="3"] .lhq-growth-l2,
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="3"] .lhq-growth-l3{opacity:1!important}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="3"] .g-node{
  box-shadow:0 0 14px rgba(var(--ew-gold),.26),inset 0 0 8px rgba(var(--ew-gold),.16);
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="3"] .g-link{
  opacity:.85;
}

/* LV4 — structural jump: stronger clamps, side mass, perimeter routing. */
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="4"] .g-brace{
  width:24%;
  height:20%;
  opacity:.95;
  border-top-width:3px;
  border-bottom-color:rgba(var(--ew-gold),.22);
  box-shadow:0 8px 20px rgba(0,0,0,.28);
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="4"] .g-brace.b1{left:3%}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="4"] .g-brace.b2{right:3%}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="4"] .g-rail.r2,
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="4"] .g-rail.r3{
  height:3px;
  box-shadow:0 0 15px rgba(var(--ew-gold),.28);
}

/* LV6 — prestige: refined, controlled depth. */
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-brace{
  width:24%;
  height:20%;
  opacity:.92;
  border-top-width:3px;
  border-bottom-color:rgba(var(--ew-gold),.20);
  box-shadow:0 8px 20px rgba(0,0,0,.24);
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-brace.b1{left:3%}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-brace.b2{right:3%}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-rail.r2,
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-rail.r3{
  height:3px;
  opacity:.82;
  box-shadow:0 0 13px rgba(var(--ew-gold),.22);
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-prestige{
  width:2px;
  opacity:.85;
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-orbit.o1{
  opacity:.42;
  transform:translate(-50%,-50%) rotate(8deg);
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-orbit.o2{
  opacity:.22;
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .g-core-pulse{
  box-shadow:0 0 52px rgba(var(--ew-gold),.16),inset 0 0 28px rgba(var(--ew-gold),.08);
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-preview="1"][data-hq-level="6"] .lhq-scene{
  filter:brightness(1.01) saturate(1.03) contrast(1.03)!important;
}


/* === ROGUE BYTE AUTHENTICATED STRUCTURAL ART PASS ===
   Real HQ state stays authoritative. LV2 temporarily reuses LV1 art and LV5 reuses LV4
   until dedicated First Expansion / Energy Core assets are approved. */
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-progress-art="1"] .lhq-scene{
  background-size:cover,contain,cover!important;
  background-position:center center,50% 50%,var(--hq-scene-position,50% 49%)!important;
  background-repeat:no-repeat,no-repeat,no-repeat!important;
}
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-progress-art="1"] .lhq-growth{
  display:none!important;
}
/* Keep the transparent structural asset dominant while the existing Rogue warroom
   remains underneath as atmosphere / depth rather than a competing hero object. */
#factionHQBack.hq-living-rogue #factionHQLivingP0[data-hq-progress-art="1"] .lhq-scene::after{
  background:
    linear-gradient(180deg,rgba(2,4,7,.54) 0%,rgba(2,4,7,.12) 19%,rgba(2,4,7,.04) 50%,rgba(2,4,7,.42) 74%,rgba(2,4,7,.90) 100%),
    radial-gradient(ellipse at 50% 45%,transparent 0 31%,rgba(0,0,0,.08) 56%,rgba(0,0,0,.46) 100%)!important;
}

/* In-HQ authenticated visual selector. Hidden unless ?hqselector=1 is present.
   It only swaps presentation state; it never writes HQ level, resources or backend state. */
#factionHQLivingP0 .lhq-visual-selector{
  position:absolute;
  left:50%;
  top:calc(54px + env(safe-area-inset-top,0px));
  z-index:42;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:4px;
  max-width:calc(100vw - 24px);
  padding:5px 6px;
  border:1px solid rgba(var(--ew-gold),.25);
  border-radius:999px;
  background:rgba(4,6,10,.86);
  box-shadow:0 10px 28px rgba(0,0,0,.30),inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter:blur(12px);
  pointer-events:auto;
}
#factionHQLivingP0 .lhq-visual-selector>span{
  padding:0 3px 0 4px;
  font-size:6px;
  font-weight:950;
  letter-spacing:.14em;
  color:rgba(var(--ew-gold),.72);
}
#factionHQLivingP0 .lhq-visual-selector button{
  min-width:34px;
  height:26px;
  padding:0 7px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  background:rgba(255,255,255,.035);
  color:rgba(255,255,255,.66);
  font-size:7px;
  font-weight:950;
  letter-spacing:.08em;
}
#factionHQLivingP0 .lhq-visual-selector button[aria-pressed="true"]{
  border-color:rgba(var(--ew-gold),.48);
  background:rgba(var(--ew-gold),.13);
  color:rgba(var(--ew-gold),.96);
  box-shadow:0 0 12px rgba(var(--ew-gold),.12);
}
#factionHQLivingP0 .lhq-visual-selector + .lhq-preview-chip{
  top:calc(91px + env(safe-area-inset-top,0px));
}
@media(max-width:390px){
  #factionHQLivingP0 .lhq-visual-selector{
    gap:3px;
    padding:4px 5px;
  }
  #factionHQLivingP0 .lhq-visual-selector button{
    min-width:31px;
    height:24px;
    padding:0 6px;
  }
}


/* Rogue Byte hidden real-device selector trigger.
   Give the five-tap gesture a phone-sized invisible hit area instead of relying
   on the text glyph box. The close button remains a separate sibling target. */
#factionHQBack.hq-living-rogue #factionHQLivingP0 .lhq-title-zone{
  pointer-events:auto;
  touch-action:manipulation;
  user-select:none;
  -webkit-user-select:none;
  min-width:min(62vw,240px);
  max-width:calc(100% - 58px);
  min-height:44px;
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:10px 18px 10px 8px;
  margin:-10px 0 -10px -8px;
}

/* P0-C acceptance follow-up: FRONT/PACK use the persistent top-right X as BACK to HOME.
   HOME keeps the same X as the true HQ exit. Lunar World state is surfaced directly
   in the Living HQ layer because the legacy HOME card is intentionally hidden. */
#factionHQBack[class*="hq-living-"] #factionHQLivingP0:has(+ #factionHQRoot[data-hq-view="front"]) .lhq-lunar-host,
#factionHQBack[class*="hq-living-"] #factionHQLivingP0:has(+ #factionHQRoot[data-hq-view="pack"]) .lhq-lunar-host{
  display:none;
}
@media(max-width:420px){
  #factionHQLivingP0 .lhq-lunar-host{left:12px;right:56px}
  #factionHQLivingP0 .lhq-lunar{width:min(76vw,280px)}
}
