/* JTforME V76 — 5.5 Pro flagship layout reset
   Purpose: make the direct game route feel like a real full-browser game,
   remove nested scroll traps, and keep the arcade page a static launchpad. */

/* ---------- direct route: app, not article ---------- */
body.psg76-game-page{
  min-height:100dvh!important;
  overflow:hidden!important;
  background:#050b11!important;
}
body.psg76-game-page .psg65-page-header{
  position:fixed!important;
  top:0;left:0;right:0;
  height:56px!important;
  min-height:56px!important;
  z-index:2147483000!important;
  padding:8px clamp(10px,1.2vw,22px)!important;
  display:flex!important;
  align-items:center!important;
  border-bottom:1px solid rgba(255,255,255,.11)!important;
  box-shadow:0 8px 22px rgba(0,0,0,.28)!important;
}
body.psg76-game-page .psg65-page-brand{min-width:max-content!important;line-height:1.05!important}
body.psg76-game-page .psg65-page-brand strong{font-size:.93rem!important;letter-spacing:.12em!important}
body.psg76-game-page .psg65-page-brand small{font-size:.61rem!important;letter-spacing:.14em!important;color:#ffd96f!important}
body.psg76-game-page .psg65-page-nav{margin-left:auto;display:flex!important;align-items:center!important;gap:8px!important;white-space:nowrap!important;overflow-x:auto!important;scrollbar-width:none!important;max-width:65vw!important}
body.psg76-game-page .psg65-page-nav::-webkit-scrollbar{display:none!important}
body.psg76-game-page .psg65-page-nav a{min-height:36px!important;padding:7px 10px!important;border-radius:999px!important;background:rgba(255,255,255,.035)!important;color:#d8e4ec!important;text-decoration:none!important}
body.psg76-game-page .psg65-page-nav a:hover,body.psg76-game-page .psg65-page-nav a:focus-visible{background:rgba(255,255,255,.10)!important;color:#fff!important}
body.psg76-game-page .psg65-page-wrap{
  position:fixed!important;
  inset:56px 0 0 0!important;
  height:calc(100dvh - 56px)!important;
  padding:0!important;
  overflow:hidden!important;
  background:#050b11!important;
}
body.psg76-game-page .psg75-boundary{
  display:none!important;
}
body.psg76-game-page .psg75-noscript{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3}

/* ---------- full browser game frame ---------- */
.psg76-direct-host,
.psg76-direct-host .psg65-shell,
.psg76-direct-host .psg65-game{
  width:100vw!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
}
.psg76-direct-host{
  height:100%!important;
  display:block!important;
}
.psg76-direct-host .psg65-shell{
  height:100%!important;
  display:block!important;
  isolation:isolate!important;
}
.psg76-direct-host .psg65-game{
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  border-radius:0!important;
  border-left:0!important;
  border-right:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
.psg76-direct-host .psg65-topbar{
  flex:0 0 auto!important;
  min-height:58px!important;
  padding:9px clamp(10px,1.2vw,18px)!important;
}
.psg76-direct-host .psg65-stage-wrap{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  display:grid!important;
  place-items:center!important;
  position:relative!important;
  contain:layout paint!important;
}
.psg76-direct-host .psg65-canvas{
  display:block!important;
  max-width:100%!important;
  max-height:100%!important;
  aspect-ratio:auto!important;
  margin:auto!important;
  touch-action:none!important;
}
.psg76-direct-host .psg65-touch-controls{
  flex:0 0 auto!important;
  min-width:0!important;
  width:100%!important;
}

/* ---------- direct overlays: one scroll owner, no modal-in-modal nonsense ---------- */
.psg76-direct-host .psg65-overlay{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  padding:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
  background:linear-gradient(180deg,rgba(3,8,13,.70),rgba(3,8,13,.94))!important;
}
.psg76-direct-host .psg65-overlay[hidden]{display:none!important}
.psg76-direct-host .psg65-panel{
  width:min(1240px,calc(100% - 44px))!important;
  max-width:1240px!important;
  min-width:0!important;
  min-height:min-content!important;
  max-height:none!important;
  margin:22px auto!important;
  overflow:visible!important;
  border-radius:24px!important;
  padding:clamp(20px,2.4vw,34px)!important;
  box-shadow:0 26px 80px rgba(0,0,0,.44)!important;
}
.psg76-direct-host .psg65-panel-actions{
  position:sticky!important;
  bottom:0!important;
  z-index:10!important;
  margin:18px -4px -8px!important;
  padding:14px 4px 8px!important;
  background:linear-gradient(180deg,rgba(8,19,29,0),rgba(8,19,29,.95) 36%,rgba(8,19,29,1))!important;
}
.psg76-direct-host .psg65-panel-actions .psg65-button{min-height:48px!important}
.psg76-direct-host .psg66-mode-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:stretch!important}
.psg76-direct-host .psg66-mode-card,.psg76-direct-host .psg66-mode-card.featured,.psg76-direct-host .psg66-mode-card.mobile{grid-column:auto!important;min-height:150px!important;min-width:0!important}
.psg76-direct-host .psg68-quickstart{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important}
.psg76-direct-host .psg68-chapters{grid-template-columns:repeat(5,minmax(0,1fr))!important}
.psg76-direct-host .psg71-trilogy{grid-template-columns:repeat(3,minmax(0,1fr))!important}

/* Big desktop menus should breathe and not clip the title. */
@media(min-width:1300px) and (min-height:820px){
  .psg76-direct-host .psg65-panel{margin-block:30px!important}
  .psg76-direct-host .psg66-menu-head h2{font-size:clamp(3.4rem,4.5vw,5.9rem)!important;line-height:.95!important}
  .psg76-direct-host .psg66-dashboard{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

/* Avoid the giant blank direct page: when the game is live, fill the whole available stage. */
.psg76-direct-host.psg75-is-live .psg65-overlay[hidden]+*,
.psg76-direct-host[data-psg-state="aim"] .psg65-stage-wrap,
.psg76-direct-host[data-psg-state="flight"] .psg65-stage-wrap,
.psg76-direct-host[data-psg-state="work"] .psg65-stage-wrap,
.psg76-direct-host[data-psg-state="extract"] .psg65-stage-wrap,
.psg76-direct-host[data-psg-state="finale"] .psg65-stage-wrap{
  background:radial-gradient(circle at center,#071928 0,#03070a 75%)!important;
}

/* ---------- arcade page: flagship is a launch card only ---------- */
.psg65-flagship-zone [data-psg-host],
.psg65-flagship-zone .psg65-shell,
.psg65-flagship-zone .psg65-game{
  display:none!important;
}
.psg65-flagship-zone .arcade-games-grid{
  display:block!important;
  width:100%!important;
  max-width:none!important;
}
.psg65-flagship-zone .psg65-arcade-feature{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  overflow:visible!important;
}
.psg65-flagship-zone .psg74-launchpad{
  display:grid!important;
  grid-template-columns:minmax(280px,.92fr) minmax(320px,1.08fr)!important;
  align-items:center!important;
  width:100%!important;
  max-width:1180px!important;
  margin:22px auto 0!important;
}
.psg65-flagship-zone .psg74-launch-art img{display:block!important;width:100%!important;height:auto!important;border-radius:18px!important}
.psg65-flagship-zone .psg74-launch-actions{display:flex!important;flex-wrap:wrap!important;gap:12px!important}

@media(max-width:1020px){
  .psg76-direct-host .psg66-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .psg65-flagship-zone .psg74-launchpad{grid-template-columns:1fr!important}
}
@media(max-width:760px){
  body.psg76-game-page .psg65-page-header{height:52px!important;min-height:52px!important}
  body.psg76-game-page .psg65-page-wrap{inset-top:52px!important;height:calc(100dvh - 52px)!important}
  body.psg76-game-page .psg65-page-nav{max-width:54vw!important;gap:4px!important}
  body.psg76-game-page .psg65-page-nav a{min-height:34px!important;font-size:.68rem!important;padding:5px 7px!important}
  body.psg76-game-page .psg65-page-brand strong{font-size:.84rem!important}
  body.psg76-game-page .psg65-page-brand small{font-size:.54rem!important;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .psg76-direct-host .psg65-topbar{min-height:54px!important;padding:7px 8px!important}
  .psg76-direct-host .psg65-panel{width:calc(100% - 14px)!important;margin:7px auto!important;border-radius:16px!important;padding:13px!important}
  .psg76-direct-host .psg66-menu-head{display:block!important}
  .psg76-direct-host .psg66-menu-head h2{font-size:clamp(1.75rem,9.2vw,2.6rem)!important}
  .psg76-direct-host .psg68-quickstart{grid-template-columns:1fr!important}
  .psg76-direct-host .psg66-mode-grid,.psg76-direct-host .psg68-chapters,.psg76-direct-host .psg71-trilogy{grid-template-columns:1fr!important}
  .psg76-direct-host .psg66-mode-card,.psg76-direct-host .psg66-mode-card.featured,.psg76-direct-host .psg66-mode-card.mobile{min-height:0!important}
  .psg76-direct-host .psg65-panel-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;margin-inline:0!important}
  .psg76-direct-host .psg65-panel-actions .psg65-button{width:100%!important;min-height:48px!important}
  .psg65-flagship-zone .psg74-launchpad{padding:16px!important;border-radius:16px!important}
  .psg65-flagship-zone .psg74-launch-actions{display:grid!important;grid-template-columns:1fr!important}
}
@media(max-height:620px) and (orientation:landscape){
  body.psg76-game-page .psg65-page-header{height:44px!important;min-height:44px!important;padding-block:4px!important}
  body.psg76-game-page .psg65-page-brand small{display:none!important}
  body.psg76-game-page .psg65-page-wrap{inset-top:44px!important;height:calc(100dvh - 44px)!important}
  .psg76-direct-host .psg65-topbar{min-height:44px!important;padding-block:4px!important}
  .psg76-direct-host .psg65-panel{width:calc(100% - 18px)!important;margin:8px auto!important;padding:12px!important}
  .psg76-direct-host .psg66-mode-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .psg76-direct-host .psg66-mode-card{min-height:108px!important}
}
