/* ============================================================
   Parcel Empire — Phase 9.9.1
   Header containment, purchase action sizing and success recovery.
============================================================ */

html,body{
  max-width:100%;
  overflow-x:clip!important;
}

@supports not (overflow:clip){
  html,body{overflow-x:hidden!important}
}

@media (max-width:1100px){
  .pe-v9-shell .gameTopbar{
    left:calc(12px + env(safe-area-inset-left,0px))!important;
    right:auto!important;
    width:62px!important;
    min-width:62px!important;
    height:62px!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    clip-path:none!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  .pe-v9-shell .brandChip.pePlayerCard{
    position:relative!important;
    inset:auto!important;
    width:62px!important;
    min-width:62px!important;
    max-width:62px!important;
    height:62px!important;
    margin:0!important;
    padding:6px!important;
    transform:none!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  .pe-v9-shell .brandChip.pePlayerCard>img{
    display:block!important;
    width:48px!important;
    min-width:48px!important;
    max-width:48px!important;
    height:48px!important;
    margin:0!important;
    padding:4px!important;
    object-fit:contain!important;
    object-position:center!important;
    transform:none!important;
    box-sizing:border-box!important;
  }
  .pe-v9-shell .statsHud>.peGpsStatCard{
    right:calc(12px + env(safe-area-inset-right,0px))!important;
  }
}

/* Both actions remain fully readable on narrow iPhones. */
.pePurchaseCard .peConfirmActions{
  grid-template-columns:minmax(116px,.42fr) minmax(0,1fr)!important;
  align-items:stretch!important;
}
.pePurchaseCard .peConfirmActions button{
  min-width:0!important;
  width:100%!important;
  padding:8px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  line-height:1.08!important;
  overflow:hidden!important;
}
.pePurchaseCard .compactGhost{
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  font-size:12px!important;
  letter-spacing:-.01em!important;
}
.pePurchaseCard .peConfirmBuyButton span:last-child{
  min-width:0!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

@media (max-width:360px){
  .pePurchaseCard .peConfirmActions{
    grid-template-columns:106px minmax(0,1fr)!important;
  }
  .pePurchaseCard .compactGhost{font-size:11px!important;padding-inline:6px!important}
}

/* The scanner and result always cover the purchase card during the handoff. */
.pe99RarityScan,
.pe99FullReveal{
  isolation:isolate;
}
body.pe99-scan-open .pePurchaseConfirm,
body.pe99-reveal-open .pePurchaseConfirm{
  visibility:hidden!important;
  pointer-events:none!important;
}
