/* ReelQuanta security/responsive hardening — 2026-08-05 */
html,
body {
  width: 100%;
  min-width: 0 !important;
  min-height: 100%;
  overflow-x: hidden;
}

body.game-page,
body.game-page.arcade-game-page,
body.game-page .rq-cabinet,
.df-page,
.wwr-page,
.pht-page,
.vv-page,
.dd-page,
.mw-page,
.tnd-page,
.pgs-page {
  min-width: 0 !important;
}

body.game-page {
  min-height: 100dvh;
}

body.game-page main,
body.game-page [class$="-main"] {
  min-height: 0 !important;
  height: calc(100dvh - var(--rq-header-height, 48px));
  padding-left: max(4px, env(safe-area-inset-left));
  padding-right: max(4px, env(safe-area-inset-right));
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

body.game-page [class$="-cabinet"],
body.game-page .rq-cabinet {
  width: min(100%, 1500px);
  max-width: 100%;
  min-width: 0 !important;
  min-height: 0;
  max-height: 100%;
}

body.game-page canvas,
body.game-page .reel-window,
body.game-page [class$="-reel-window"],
body.game-page [class*="reel-window"] {
  max-width: 100%;
  max-height: 100%;
}

body.game-page button,
body.game-page a[role="button"],
body.game-page .rq-toolbar a,
body.game-page .rq-toolbar button {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

.rq-rotate-notice {
  display: none;
}

@media (orientation: portrait) and (max-width: 760px) {
  body.game-page > :not(.rq-rotate-notice):not(.toast-container):not(.rq-platform-modal):not(.rq-rescue-backdrop) {
    visibility: hidden !important;
  }

  .rq-rotate-notice {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    background:
      radial-gradient(circle at 50% 15%, rgba(87, 73, 255, .28), transparent 42%),
      #050816;
    color: #fff;
    text-align: center;
    overflow: auto;
  }

  .rq-rotate-notice > div {
    width: min(420px, 100%);
    border: 1px solid rgba(124, 228, 255, .45);
    border-radius: 22px;
    padding: 28px;
    background: rgba(7, 13, 36, .94);
    box-shadow: 0 18px 70px rgba(0, 0, 0, .5);
  }

  .rq-rotate-notice strong {
    display: block;
    margin-bottom: 12px;
    font-size: clamp(1.4rem, 8vw, 2.3rem);
    letter-spacing: .08em;
  }

  .rq-rotate-notice p {
    margin: 0;
    line-height: 1.55;
    color: #cbd7ff;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  body.game-page main,
  body.game-page [class$="-main"] {
    height: calc(100dvh - var(--rq-header-height, 42px));
  }

  body.game-page button,
  body.game-page a[role="button"] {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}
