/* module: game title dropup */

:root {
  --rtpx-dropup-title-text: var(--text);
  --rtpx-dropup-title-bg: color-mix(in srgb,var(--surface) 86%,transparent);
  --rtpx-dropup-title-border: color-mix(in srgb,var(--text) 16%,transparent);
  --rtpx-dropup-title-radius: 10px;
  --rtpx-smart-focus: color-mix(in srgb,var(--rtpx-button-accent,var(--accent,#12b857)) 72%,transparent);
  --rtpx-smart-progress-track: color-mix(in srgb,var(--text,#fff) 10%,transparent);
  --rtpx-smart-progress-fill: var(--rtpx-button-accent,var(--accent,#12b857));
  --rtpx-smart-progress-height: 2px;
}

/* module: mobile performance */

@media (max-width:820px),(pointer:coarse) {
  html {
    scroll-behavior: auto;
    overscroll-behavior-x: none;
  }
  body {
    background-attachment: scroll;
    overscroll-behavior-y: auto;
  }
  .win-proof-card, .game-pola-card {
    contain: layout paint style;
    will-change: auto;
    animation: none;
  }
  .win-proof-card {
    animation: none;
    transform: none;
    will-change: auto;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  [data-rtpx-lazy-section="loading"]::after,html.is-rtpx-scrolling body:not(.admin-page) [data-rtpx-dropup-title]::after {
    animation: none;
    transition: none;
    will-change: auto;
  }
}

/* module: smart UI */


[data-rtpx-skeleton-shimmer-visible="false"]::after {
  animation-play-state: paused;
  opacity: .28;
}

.rtpx-media-loading {
  position: relative;
  overflow: hidden;
  background: var(--rtpx-skeleton-base);
}

.rtpx-media-loading>img,.rtpx-media-loading picture>img {
  opacity: .18;
}

.rtpx-media-ready::after {
  content: none;
}

.rtpx-media-ready>img,.rtpx-media-ready picture>img {
  opacity: 1;
}

[data-rtpx-smart-tab="true"] {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease,color .18s ease,opacity .16s ease,border-color .18s ease;
}

.rtpx-lazy-section {
  content-visibility: visible;
  contain-intrinsic-size: auto;
  overflow-anchor: none;
}

.rtpx-lazy-section[data-rtpx-lazy-state="pending"],.rtpx-lazy-section[data-rtpx-lazy-state="near"],.rtpx-lazy-section[data-rtpx-lazy-state="ready"] {
  contain: layout style;
}

@media (prefers-reduced-motion:reduce) {
  .rtpx-media-loading::after {
    animation: none;
  }
}

/* module: global header first-access skeleton */
body:not(.admin-page) .rtpx-header-skeleton {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: clamp(12px,1.35vw,26px);
  width: 100%;
  height: 100%;
  padding-inline: var(--rtpx-header-pad-x,clamp(18px,2.25vw,36px));
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease,visibility .16s step-end;
  contain: layout paint style;
}

html[data-rtpx-shell-skeleton="loading"] body:not(.admin-page) .global-header .global-header__nav {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html[data-rtpx-shell-skeleton="ready"] body:not(.admin-page) .global-header .global-header__nav {
  opacity: 1;
  visibility: visible;
  transition: opacity .16s ease;
}

html[data-rtpx-shell-skeleton="loading"] body:not(.admin-page) .rtpx-header-skeleton {
  opacity: 1;
  visibility: visible;
  transition: opacity .12s ease,visibility 0s;
}

body:not(.admin-page) .rtpx-header-skeleton__block {
  display: block;
  min-width: 0;
  border: 1px solid color-mix(in srgb,var(--text,#fff) 6%,transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb,var(--text,#fff) 5%,transparent);
}

body:not(.admin-page) .rtpx-header-skeleton::after {
  animation-play-state: paused;
}

html[data-rtpx-shell-skeleton="loading"] body:not(.admin-page) .rtpx-header-skeleton::after {
  animation-play-state: running;
}

body:not(.admin-page) .rtpx-header-skeleton__logo {
  grid-column: 1;
  justify-self: start;
  width: clamp(128px,var(--rtpx-header-logo-width,170px),min(32vw,220px));
  max-width: min(34vw,220px);
  height: clamp(28px,2.45vw,34px);
  border-radius: 10px;
}

body:not(.admin-page) .rtpx-header-skeleton__nav {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: clamp(6px,.74vw,14px);
  width: min(100%,360px);
  min-width: 0;
}

body:not(.admin-page) .rtpx-header-skeleton__nav-item {
  height: 36px;
  border-radius: 11px;
}

body:not(.admin-page) .rtpx-header-skeleton__nav-item--short {
  width: 62px;
}

body:not(.admin-page) .rtpx-header-skeleton__nav-item--medium {
  width: 70px;
}

body:not(.admin-page) .rtpx-header-skeleton__nav-item--long {
  width: 118px;
}

body:not(.admin-page) .rtpx-header-skeleton__actions {
  grid-column: 3;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: var(--rtpx-header-control-gap,8px);
  min-width: max-content;
}

body:not(.admin-page) .rtpx-header-skeleton__actions--desktop {
  display: flex;
}

body:not(.admin-page) .rtpx-header-skeleton__actions--mobile {
  display: none;
}

body:not(.admin-page) .rtpx-header-skeleton__action {
  height: var(--rtpx-header-control-h,40px);
  border-radius: var(--rtpx-header-control-radius,12px);
}

body:not(.admin-page) .rtpx-header-skeleton__action--login {
  width: 68px;
}

body:not(.admin-page) .rtpx-header-skeleton__action--register {
  width: 112px;
}

@media (max-width:980px) and (min-width:768px) {
  body:not(.admin-page) .rtpx-header-skeleton {
    grid-template-columns: minmax(96px,112px) minmax(0,1fr) auto;
    gap: clamp(6px,1vw,10px);
    padding-inline: max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right));
  }

  body:not(.admin-page) .rtpx-header-skeleton__logo {
    width: 112px;
    max-width: 112px;
    height: 30px;
    border-radius: 9px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__nav {
    gap: 2px;
    width: min(100%,260px);
  }

  body:not(.admin-page) .rtpx-header-skeleton__nav-item {
    height: 32px;
    border-radius: 9px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__nav-item--short {
    width: 48px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__nav-item--medium {
    width: 54px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__nav-item--long {
    width: 88px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__actions {
    gap: 5px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action {
    height: 36px;
    border-radius: 10px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action--login {
    width: 58px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action--register {
    width: 92px;
  }
}

@media (max-width:767px) {
  body:not(.admin-page) .rtpx-header-skeleton {
    grid-template-columns: minmax(84px,max-content) minmax(0,1fr) auto;
    gap: 8px;
    padding-inline: max(var(--rtpx-header-pad-mobile-x,10px),env(safe-area-inset-left)) max(var(--rtpx-header-pad-mobile-x,10px),env(safe-area-inset-right));
  }

  body:not(.admin-page) .rtpx-header-skeleton__logo {
    width: clamp(96px,var(--rtpx-header-logo-width,124px),38vw);
    max-width: 38vw;
    height: 30px;
    border-radius: 9px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__nav,
  body:not(.admin-page) .rtpx-header-skeleton__actions--desktop {
    display: none;
  }

  body:not(.admin-page) .rtpx-header-skeleton__actions--mobile {
    display: flex;
    gap: 6px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action {
    height: var(--rtpx-header-control-mobile,38px);
    border-radius: var(--rtpx-header-control-radius-mobile,11px);
  }

  body:not(.admin-page) .rtpx-header-skeleton__action--mobile-register {
    width: 68px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action--menu {
    width: var(--rtpx-header-control-mobile,38px);
  }
}

@media (max-width:420px) {
  body:not(.admin-page) .rtpx-header-skeleton {
    gap: 6px;
    padding-inline: max(var(--rtpx-header-pad-phone-x,8px),env(safe-area-inset-left)) max(var(--rtpx-header-pad-phone-x,8px),env(safe-area-inset-right));
  }

  body:not(.admin-page) .rtpx-header-skeleton__logo {
    width: clamp(92px,var(--rtpx-header-logo-width,112px),36vw);
    max-width: 36vw;
    height: 28px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action {
    height: var(--rtpx-header-control-phone,36px);
    border-radius: 10px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action--mobile-register {
    width: 66px;
  }

  body:not(.admin-page) .rtpx-header-skeleton__action--menu {
    width: var(--rtpx-header-control-phone,36px);
  }
}

@media (prefers-reduced-motion:reduce) {
  body:not(.admin-page) .rtpx-header-skeleton,
  body:not(.admin-page) .global-header .global-header__nav {
    transition-duration: .001ms;
  }

}

/* Global responsive modal: bottom sheet pada mobile, dialog terpusat pada tablet/desktop. */
html.rtpx-modal-open,
html.rtpx-modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.rtpx-modal {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.rtpx-modal[hidden] {
  display: none;
}

.rtpx-modal.is-open {
  pointer-events: auto;
}

.rtpx-modal__backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: none;
  opacity: 0;
  cursor: default;
  pointer-events: none;
  touch-action: none;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: opacity 120ms linear;
  -webkit-appearance: none;
  appearance: none;
}

.rtpx-modal.is-open .rtpx-modal__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.rtpx-modal__sheet {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: min(86dvh, calc(100dvh - env(safe-area-inset-top)));
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  color: var(--text);
  background: var(--theme-container-bg);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: auto;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: opacity 120ms linear;
}

.rtpx-modal.is-open .rtpx-modal__sheet {
  opacity: 1;
}

.rtpx-modal__handle {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 50%;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
  transform: translateX(-50%);
}

/* Zendesk menggunakan iframe dengan stacking context tinggi. Sembunyikan hanya selama modal global aktif. */
html:is(.rtpx-modal-open,.mobile-drawer-open) #launcher,
html:is(.rtpx-modal-open,.mobile-drawer-open) #webWidget,
html:is(.rtpx-modal-open,.mobile-drawer-open) iframe[data-product="web_widget"],
html:is(.rtpx-modal-open,.mobile-drawer-open) iframe[title*="Zendesk" i],
html:is(.rtpx-modal-open,.mobile-drawer-open) iframe[title*="messaging" i] {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}

/* Native public dialogs share the same clean, blur-free rendering contract. */
body:not(.admin-page) dialog[open] {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body:not(.admin-page) dialog[open]::backdrop {
  background: rgba(0, 0, 0, 0.7);
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: none !important;
}

@media (min-width: 768px) {
  .rtpx-modal {
    display: grid;
    place-items: center;
    padding: clamp(24px, 5vw, 64px);
  }

  .rtpx-modal__sheet {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    width: min(520px, calc(100vw - 64px));
    max-height: min(78dvh, 680px);
    margin: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  }

  .rtpx-modal__handle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rtpx-modal__backdrop,
  .rtpx-modal__sheet {
    transition: none;
  }
}
