/* ============================================================
   Parcel Empire — Phase 9.1 screenshot-inspired dashboard shell
   Bottom rarity strip intentionally omitted.
============================================================ */
:root{
  --pe9-bg:#071522;
  --pe9-panel:rgba(7,24,38,.94);
  --pe9-panel-soft:rgba(13,35,51,.91);
  --pe9-border:rgba(94,199,237,.18);
  --pe9-text:#f5fbff;
  --pe9-muted:#9db3c4;
  --pe9-cyan:#31e8ef;
  --pe9-green:#22e96f;
  --pe9-green-dark:#0aa949;
  --pe9-radius:18px;
  --pe9-shadow:0 16px 44px rgba(0,0,0,.42);
  --pe9-rail:390px;
  --pe9-left:92px;
}

body.pe-v9-shell{
  overflow:hidden;
  color:var(--pe9-text);
  background:var(--pe9-bg);
}
body.pe-v9-shell::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:2;
  background:
    linear-gradient(180deg,rgba(4,14,25,.26),transparent 24%,transparent 70%,rgba(3,14,24,.28)),
    radial-gradient(circle at 42% 42%,transparent 0 33%,rgba(2,12,20,.16) 70%);
}

/* Map becomes the central workspace, leaving room for both rails. */
.pe-v9-shell #map{
  top:112px!important;
  left:var(--pe9-left)!important;
  right:var(--pe9-rail)!important;
  bottom:96px!important;
  width:auto!important;
  height:auto!important;
  border-radius:22px;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(93,209,242,.11),0 20px 54px rgba(0,0,0,.28);
}
.pe-v9-shell .worldShade,
.pe-v9-shell .scanGlow{
  top:112px;
  left:var(--pe9-left);
  right:var(--pe9-rail);
  bottom:96px;
  border-radius:22px;
}

/* Player card and status cards. */
.pe-v9-shell .gameTopbar{
  position:fixed!important;
  z-index:42!important;
  left:18px!important;
  top:18px!important;
  width:270px!important;
  height:76px!important;
  display:block!important;
  padding:0!important;
  background:none!important;
  border:0!important;
  pointer-events:none;
}
.pe-v9-shell .brandChip.pePlayerCard{
  width:100%;
  height:100%;
  display:grid!important;
  grid-template-columns:54px 1fr;
  grid-template-rows:auto auto;
  align-items:center;
  column-gap:12px;
  padding:10px 14px!important;
  border:1px solid var(--pe9-border)!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,rgba(9,27,42,.97),rgba(5,19,31,.93))!important;
  box-shadow:var(--pe9-shadow)!important;
  pointer-events:auto;
}
.pe-v9-shell .brandChip.pePlayerCard>img{
  grid-row:1/3;
  width:50px!important;
  height:50px!important;
  padding:7px;
  border-radius:50%;
  border:2px solid #e9bb35;
  background:#123349;
}
.pe-v9-shell .brandChip.pePlayerCard>span{
  align-self:end;
  font-size:16px!important;
  font-weight:850!important;
  letter-spacing:-.02em;
}
.pe-v9-shell .brandChip.pePlayerCard>span em{
  color:#f5c73d;
  font-style:normal;
  margin-left:4px;
}
.pe-v9-shell .levelHud{
  position:static!important;
  inset:auto!important;
  width:auto!important;
  min-width:0!important;
  display:grid!important;
  grid-template-columns:auto 1fr;
  grid-template-areas:"badge text" "bar bar";
  gap:2px 8px;
  margin:1px 0 0!important;
  padding:0!important;
  border:0!important;
  background:none!important;
  box-shadow:none!important;
}
.pe-v9-shell .levelBadge{grid-area:badge;font-size:10px!important;color:#cfe2ee!important;background:none!important;padding:0!important;border:0!important}
.pe-v9-shell .xpTrack{grid-area:bar;height:7px!important;border-radius:99px;background:#162f40!important;margin:0!important}
.pe-v9-shell .xpTrack i{background:linear-gradient(90deg,#16c9e9,#51f184)!important}
.pe-v9-shell .levelHud small{grid-area:text;font-size:9px!important;text-align:right!important;color:#9cb7c8!important}
.pe-v9-shell .topChips{display:none!important}

.pe-v9-shell .statsHud{
  position:fixed!important;
  z-index:41!important;
  top:18px!important;
  left:306px!important;
  right:calc(var(--pe9-rail) + 14px)!important;
  width:auto!important;
  height:76px!important;
  display:grid!important;
  grid-template-columns:repeat(5,minmax(116px,1fr))!important;
  gap:10px!important;
  padding:0!important;
  background:none!important;
  border:0!important;
}
.pe-v9-shell .statsHud .statCard{
  min-width:0!important;
  height:76px!important;
  margin:0!important;
  padding:12px 14px!important;
  display:flex!important;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  border:1px solid var(--pe9-border)!important;
  border-radius:18px!important;
  background:linear-gradient(145deg,rgba(10,29,44,.97),rgba(5,20,32,.94))!important;
  box-shadow:var(--pe9-shadow)!important;
  color:var(--pe9-text)!important;
}
.pe-v9-shell .statsHud .statCard span{
  color:#b7c7d2!important;
  font-size:10px!important;
  font-weight:800!important;
  letter-spacing:.11em!important;
  text-transform:uppercase;
}
.pe-v9-shell .statsHud .statCard strong{
  color:#edf9ff!important;
  font-size:21px!important;
  line-height:1!important;
  white-space:nowrap;
}
.pe-v9-shell .statsHud .statCard:nth-child(1) strong,
.pe-v9-shell .peGpsStatCard strong{color:var(--pe9-green)!important}
.pe-v9-shell .peGpsStatCard{
  background:linear-gradient(145deg,rgba(8,78,54,.97),rgba(7,55,41,.94))!important;
  border-color:rgba(44,237,126,.26)!important;
}

/* Left quick navigation. */
.peLeftRail{
  position:fixed;
  z-index:39;
  left:18px;
  top:112px;
  bottom:112px;
  width:64px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  padding:9px 6px;
  border:1px solid var(--pe9-border);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(7,24,38,.96),rgba(5,18,29,.94));
  box-shadow:var(--pe9-shadow);
}
.peLeftRail button{
  min-height:66px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:6px 2px;
  border:0;
  border-radius:13px;
  color:#e9f6fc;
  background:transparent;
  cursor:pointer;
}
.peLeftRail button:hover,.peLeftRail button:focus-visible{background:rgba(35,226,235,.12);outline:1px solid rgba(49,232,239,.25)}
.peLeftRail button span{font-size:23px;line-height:1}
.peLeftRail button b{font-size:9px;font-weight:750}

/* Right dashboard rail. */
.peRightRail{
  position:fixed;
  z-index:40;
  top:18px;
  right:16px;
  bottom:18px;
  width:358px;
  display:grid;
  grid-template-rows:minmax(350px,44%) minmax(0,1fr);
  gap:12px;
  pointer-events:auto;
}
.peRightCard{
  position:relative;
  min-height:0;
  overflow:hidden;
  border:1px solid var(--pe9-border);
  border-radius:20px;
  background:linear-gradient(160deg,rgba(8,28,43,.97),rgba(5,19,31,.97));
  box-shadow:var(--pe9-shadow);
}
.peRightCard>header{
  height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid rgba(114,199,226,.12);
}
.peRightCard>header small{display:block;color:#7e9bad;font-size:9px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.peRightCard>header h2{margin:2px 0 0;font-size:17px;letter-spacing:.02em}
.peRightCard>header strong{font-size:11px;color:var(--pe9-green)}
.peDockStatus{font-size:9px;font-weight:850;color:#38eb84;border:1px solid rgba(56,235,132,.25);padding:5px 8px;border-radius:99px}
.peRevealEmpty{
  height:calc(100% - 62px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:26px;
  color:var(--pe9-muted);
  background:radial-gradient(circle at 50% 42%,rgba(27,234,111,.13),transparent 48%);
}
.peRevealEmpty .peEmptyModel{width:98px;height:98px;display:grid;place-items:center;border-radius:24px;font-size:44px;color:#51e98b;border:1px dashed rgba(81,233,139,.35);background:rgba(11,54,43,.32);margin-bottom:14px}
.peRevealEmpty strong{color:#eaf8ff;font-size:16px}
.peRevealEmpty p{max-width:250px;margin:7px 0 0;font-size:12px;line-height:1.5}
.pePurchaseDock.hasReveal .peRevealEmpty{display:none}

/* Existing reveal becomes a real right-side purchase card on desktop. */
.pe-v9-shell .pePurchaseDock #rarityReveal{
  position:absolute!important;
  inset:62px 0 0!important;
  z-index:2!important;
  width:auto!important;
  height:auto!important;
  display:block;
  background:transparent!important;
  backdrop-filter:none!important;
  padding:0!important;
}
.pe-v9-shell .pePurchaseDock #rarityReveal[hidden]{display:none!important}
.pe-v9-shell .pePurchaseDock .revealCard{
  position:relative!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:13px 18px 15px!important;
  display:grid!important;
  grid-template-rows:auto minmax(150px,1fr) auto auto auto auto!important;
  align-content:stretch!important;
  border:0!important;
  border-radius:0!important;
  background:radial-gradient(circle at 50% 34%,rgba(24,229,105,.24),transparent 43%)!important;
  box-shadow:none!important;
  transform:none!important;
  overflow:hidden;
}
.pe-v9-shell .pePurchaseDock .revealEyebrow{font-size:10px!important;color:#5ce995!important;letter-spacing:.12em!important}
.pe-v9-shell .pePurchaseDock .revealModelStage{min-height:150px!important;height:auto!important;margin:0!important;border:0!important;background:transparent!important}
.pe-v9-shell .pePurchaseDock .revealCard h2{font-size:18px!important;margin:0!important;text-align:left!important}
.pe-v9-shell .pePurchaseDock .revealParcelName{font-size:14px!important;text-align:left!important;color:#f4fbff!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pe-v9-shell .pePurchaseDock .revealParcelId{font-size:10px!important;text-align:left!important;color:#89a7b8!important}
.pe-v9-shell .pePurchaseDock .revealCard p{margin:5px 0 8px!important;text-align:left!important;color:#4bf18f!important;font-weight:750!important}
.pe-v9-shell .pePurchaseDock #closeReveal{height:42px!important;margin:0!important;border-radius:12px!important;background:linear-gradient(180deg,#29db63,#0ca742)!important;border:1px solid rgba(131,255,170,.4)!important;font-weight:850!important}
.peRevealTopClose{position:absolute;top:8px;right:10px;z-index:4;width:32px;height:32px;border:0;border-radius:10px;background:rgba(2,15,24,.68);color:white;font-size:22px;cursor:pointer}

.pePortfolioPreview{display:grid;grid-template-rows:62px auto 1fr 50px}
.pePortfolioTabs{display:grid;grid-template-columns:repeat(5,1fr);gap:4px;padding:10px 10px 4px}
.pePortfolioTabs button{min-width:0;padding:7px 2px;border:1px solid rgba(107,193,223,.10);border-radius:8px;background:#0a2132;color:#9bb1bf;font-size:8px;font-weight:850;cursor:pointer}
.pePortfolioTabs button.active{background:linear-gradient(180deg,#17cfc6,#0d9e9b);color:white;border-color:rgba(67,255,239,.36)}
.pePortfolioThumbs{min-height:0;overflow:hidden;display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:1fr;gap:8px;padding:9px 12px 11px}
.pePortfolioThumbs img{width:100%;height:100%;min-height:54px;object-fit:cover;border-radius:10px;border:1px solid rgba(41,230,111,.42);background:#173421}
.peOpenPortfolio{height:40px;margin:0 12px 10px;border:1px solid rgba(48,235,118,.32);border-radius:12px;background:linear-gradient(180deg,rgba(29,210,91,.92),rgba(8,145,57,.96));color:white;font-weight:850;cursor:pointer}

/* Selected parcel card kept compact over the map. */
.pe-v9-shell .parcelCard{
  left:calc(var(--pe9-left) + 18px)!important;
  top:136px!important;
  right:auto!important;
  bottom:auto!important;
  width:320px!important;
  max-height:calc(100vh - 260px)!important;
  border-radius:18px!important;
  background:rgba(6,24,38,.96)!important;
  border:1px solid rgba(49,232,239,.30)!important;
  box-shadow:var(--pe9-shadow)!important;
}

/* Central purchase controls. */
.pe-v9-shell .atlasStatusStrip{
  position:fixed!important;
  z-index:35!important;
  left:calc(var(--pe9-left) + 96px)!important;
  right:calc(var(--pe9-rail) + 96px)!important;
  bottom:106px!important;
  width:auto!important;
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:10px!important;
  padding:0!important;
  background:none!important;
  border:0!important;
  box-shadow:none!important;
}
.pe-v9-shell .atlasStatusStrip>div{height:66px!important;padding:10px 12px!important;border:1px solid var(--pe9-border)!important;border-radius:16px!important;background:rgba(7,24,38,.94)!important;box-shadow:0 10px 28px rgba(0,0,0,.28)!important}
.pe-v9-shell .atlasStatusStrip>div:nth-child(4){display:none!important}
.pe-v9-shell .atlasStatusStrip span{font-size:9px!important;color:#9eb2c0!important;letter-spacing:.08em!important}
.pe-v9-shell .atlasStatusStrip strong{font-size:15px!important;color:#59f398!important}
.pe-v9-shell .buyLandButton{
  position:fixed!important;
  z-index:38!important;
  left:50%!important;
  right:auto!important;
  bottom:112px!important;
  width:330px!important;
  height:76px!important;
  transform:translateX(calc(-50% - var(--pe9-rail)/2 + var(--pe9-left)/2))!important;
  border-radius:22px!important;
  border:1px solid rgba(150,255,174,.44)!important;
  background:linear-gradient(180deg,#31ec69,#0db640)!important;
  box-shadow:0 12px 34px rgba(9,228,83,.28),inset 0 1px rgba(255,255,255,.28)!important;
}
.pe-v9-shell .buyLandButton strong{font-size:25px!important}
.pe-v9-shell .buyLandButton small{font-size:10px!important}

/* Five-item navigation only; no bottom rarity strip. */
.pe-v9-shell .bottomNav.peFiveNav{
  position:fixed!important;
  z-index:44!important;
  left:50%!important;
  right:auto!important;
  bottom:18px!important;
  width:620px!important;
  height:70px!important;
  transform:translateX(calc(-50% - var(--pe9-rail)/2 + var(--pe9-left)/2))!important;
  display:grid!important;
  grid-template-columns:repeat(5,1fr)!important;
  gap:4px!important;
  padding:6px!important;
  border:1px solid var(--pe9-border)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(7,24,38,.97),rgba(4,17,28,.97))!important;
  box-shadow:var(--pe9-shadow)!important;
}
.pe-v9-shell .bottomNav .peNavHidden{display:none!important}
.pe-v9-shell .bottomNav button{height:58px!important;min-width:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;border-radius:13px!important;color:#c3d3dc!important;background:transparent!important}
.pe-v9-shell .bottomNav button.active{color:#55f4d9!important;background:rgba(30,205,195,.12)!important}
.pe-v9-shell .bottomNav button .peNavIcon{font-size:21px;line-height:1}
.pe-v9-shell .bottomNav button>span:last-child{font-size:10px!important;font-weight:700!important}

/* Existing utility controls. */
.pe-v9-shell .gpsButton{right:calc(var(--pe9-rail) + 20px)!important;bottom:126px!important}
.pe-v9-shell .onlineStatus{display:none!important}
.pe-v9-shell .mapboxgl-ctrl-top-right{top:126px!important;right:calc(var(--pe9-rail) + 16px)!important}
.pe-v9-shell .mapboxgl-ctrl-bottom-left{left:calc(var(--pe9-left) + 12px)!important;bottom:110px!important}

/* Existing sheets remain functional above the new shell. */
.pe-v9-shell .sheetPanel{z-index:110!important}
.pe-v9-shell .confirmOverlay,.pe-v9-shell .tutorialOverlay,.pe-v9-shell .milestonePopup{z-index:150!important}

@media (max-width:1380px){
  :root{--pe9-rail:340px;--pe9-left:78px}
  .peRightRail{width:316px}
  .pe-v9-shell .gameTopbar{width:240px}
  .pe-v9-shell .statsHud{left:272px;grid-template-columns:repeat(5,minmax(100px,1fr))}
  .pe-v9-shell .statsHud .statCard strong{font-size:18px!important}
  .peLeftRail{width:56px}
  .pe-v9-shell .bottomNav.peFiveNav{width:560px}
}

@media (max-width:1100px){
  :root{--pe9-rail:0px;--pe9-left:0px}
  .peLeftRail{display:none}
  .peRightRail{
    z-index:120;
    top:auto;
    right:0;
    bottom:calc(82px + env(safe-area-inset-bottom));
    left:0;
    width:auto;
    height:auto;
    display:block;
    pointer-events:none;
  }
  .peRightRail .pePortfolioPreview,.peRightRail .pePurchaseDock>header,.peRightRail .peRevealEmpty{display:none!important}
  .peRightRail .pePurchaseDock{border:0;background:none;box-shadow:none;overflow:visible}
  .peRightRail .pePurchaseDock.hasReveal{pointer-events:auto}
  .pe-v9-shell .pePurchaseDock #rarityReveal{position:fixed!important;inset:auto 10px calc(88px + env(safe-area-inset-bottom)) 10px!important;height:min(66vh,620px)!important;border-radius:22px!important;background:rgba(5,21,33,.98)!important;box-shadow:0 20px 70px rgba(0,0,0,.65)!important;overflow:hidden}
  .pe-v9-shell .pePurchaseDock .revealCard{grid-template-rows:auto minmax(170px,1fr) auto auto auto auto!important;border-radius:22px!important}

  .pe-v9-shell #map,.pe-v9-shell .worldShade,.pe-v9-shell .scanGlow{left:0!important;right:0!important;top:188px!important;bottom:150px!important;border-radius:0!important}
  .pe-v9-shell .gameTopbar{left:12px!important;top:calc(10px + env(safe-area-inset-top))!important;width:188px!important;height:68px!important}
  .pe-v9-shell .brandChip.pePlayerCard{grid-template-columns:44px 1fr;padding:8px 10px!important}
  .pe-v9-shell .brandChip.pePlayerCard>img{width:42px!important;height:42px!important}
  .pe-v9-shell .brandChip.pePlayerCard>span{font-size:13px!important}
  .pe-v9-shell .levelHud{display:none!important}
  .pe-v9-shell .statsHud{top:calc(86px + env(safe-area-inset-top))!important;left:10px!important;right:10px!important;height:84px!important;display:flex!important;overflow-x:auto!important;gap:8px!important;scrollbar-width:none}
  .pe-v9-shell .statsHud::-webkit-scrollbar{display:none}
  .pe-v9-shell .statsHud .statCard{flex:0 0 142px!important;height:74px!important}
  .pe-v9-shell .statsHud .statCard strong{font-size:18px!important}
  .pe-v9-shell .statsHud .peGpsStatCard{position:fixed;top:calc(12px + env(safe-area-inset-top));right:10px;width:160px;height:64px!important}

  .pe-v9-shell .atlasStatusStrip{left:14px!important;right:14px!important;bottom:164px!important;gap:7px!important}
  .pe-v9-shell .atlasStatusStrip>div{height:58px!important}
  .pe-v9-shell .buyLandButton{left:50%!important;bottom:166px!important;width:min(78vw,390px)!important;height:70px!important;transform:translateX(-50%)!important}
  .pe-v9-shell .bottomNav.peFiveNav{left:10px!important;right:10px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;width:auto!important;height:72px!important;transform:none!important;border-radius:21px!important}
  .pe-v9-shell .gpsButton{right:14px!important;bottom:170px!important}
  .pe-v9-shell .parcelCard{left:10px!important;right:10px!important;top:auto!important;bottom:250px!important;width:auto!important;max-height:44vh!important}
  .pe-v9-shell .mapboxgl-ctrl-top-right{top:202px!important;right:10px!important}
  .pe-v9-shell .mapboxgl-ctrl-bottom-left{left:10px!important;bottom:242px!important}
}

@media (max-width:560px){
  .pe-v9-shell .gameTopbar{width:74px!important}
  .pe-v9-shell .brandChip.pePlayerCard{display:flex!important;justify-content:center!important;padding:7px!important}
  .pe-v9-shell .brandChip.pePlayerCard>span{display:none!important}
  .pe-v9-shell .statsHud .peGpsStatCard{width:160px}
  .pe-v9-shell .statsHud .statCard{flex-basis:130px!important}
  .pe-v9-shell #map,.pe-v9-shell .worldShade,.pe-v9-shell .scanGlow{top:178px!important;bottom:145px!important}
  .pe-v9-shell .atlasStatusStrip{bottom:153px!important}
  .pe-v9-shell .atlasStatusStrip>div{padding:8px 5px!important}
  .pe-v9-shell .atlasStatusStrip strong{font-size:12px!important}
  .pe-v9-shell .buyLandButton{bottom:151px!important;height:66px!important}
  .pe-v9-shell .buyLandButton strong{font-size:21px!important}
  .pe-v9-shell .gpsButton{bottom:155px!important}
  .pe-v9-shell .bottomNav button .peNavIcon{font-size:18px}
  .pe-v9-shell .bottomNav button>span:last-child{font-size:9px!important}
}
