/* Host controls belong outside the game surface, at every viewport size. */
.casino-game-shell__stage > .casino-game-mobile-fullscreen,
.casino-game-shell__stage > .casino-studio-game-control {
  display: none !important;
  pointer-events: none !important;
}

/* During a provider preloader, retain launch errors above the video without
   reserving a separate empty row. The footer and native API state stay owned. */
.casino-game-shell--provider:has(> .casino-game-shell__stage .casino-runtime-preloader) {
  position: relative;
}
.casino-game-shell--provider:has(> .casino-game-shell__stage .casino-runtime-preloader) > .casino-api-alert {
  position: absolute;
  z-index: 40;
  inset-block-start: 0;
  inset-inline: 0;
  margin: 0;
  box-sizing: border-box;
}

/* A frameless native catalogue placeholder has no runtime to reload. */
.casino-game-shell--non-poker:not(.casino-game-shell--provider):not(:has(.casino-game-shell__stage iframe)) .casino-runtime-preloader__error > button {
  display: none;
}

/* A presentation preloader may precede an admitted runtime iframe. The shared
   header must already yield to the existing compact immersive surface then. */
@media (max-width: 1024px), (pointer: coarse) and (hover: none) {
  html body .app-frame.is-mobile-casino-immersive:has(.casino-runtime-preloader) .public-shell-header-stack {
    display: none !important;
  }
}

/* Keep mode selection visible without a resting glow after pointer exit. */
html body .casino-game-shell .casino-game-shell__mode-actions [role="group"] > button:not(:hover):not(:focus-visible) {
  box-shadow: none !important;
}

/* The selected segment follows the authoritative active mode in either direction. */
html body #app .casino-game-shell--non-poker .casino-mode-segment {
  position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px;
}
html body #app .casino-game-shell--non-poker .casino-mode-segment::before {
  content: ''; position: absolute; z-index: -1; inset-block: 3px; inset-inline-start: 3px;
  inline-size: calc((100% - 9px) / 2); border-radius: 5px; background: #315164;
  transition: inset-inline-start 160ms ease-out; pointer-events: none;
}
html body #app .casino-game-shell--non-poker .casino-mode-segment[data-mode="real"]::before { inset-inline-start: calc(50% + 1.5px); }
html body #app .casino-game-shell--non-poker .casino-mode-segment > button { background: transparent !important; }
html body #app .casino-game-shell--non-poker .casino-mode-segment > button[aria-pressed="true"] { color: #fff; }
@media (max-width: 700px) {
  html body #app .app-frame.is-casino-game-route:not(.is-mobile-casino-immersive) .casino-game-shell.is-design-game.casino-game-shell--non-poker > .casino-game-shell__footer {
    flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important;
    min-block-size: 50px !important; gap: 4px !important; padding: 4px 6px !important;
  }
  html body #app .casino-game-shell--non-poker .casino-game-shell__mode-actions { flex: 0 0 clamp(86px,27vw,112px); min-inline-size: 0; }
  html body #app .casino-game-shell--non-poker .casino-mode-segment { inline-size: 100%; }
  html body #app .casino-game-shell--non-poker .casino-mode-segment > button {
    min-inline-size: 0 !important; padding-inline: 3px !important; font-size: 11px !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html body #app .casino-game-shell--non-poker .casino-game-actions { flex: 0 1 auto; flex-wrap: nowrap; gap: 2px; min-inline-size: 0; }
  html body #app .casino-game-shell--non-poker .casino-game-actions > button {
    flex: 0 1 32px !important; inline-size: 32px !important; min-inline-size: 26px !important; min-block-size: 40px !important;
  }
  html body #app .casino-game-shell--non-poker .casino-game-actions img { inline-size: 23px; block-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { html body #app .casino-mode-segment::before { transition: none; } }

.blackjack-fun-recharge { display: inline-flex; align-items: center; justify-content: center; gap: 3px; flex: none; min-height: 28px; padding: 3px 6px; border: 1px solid #608b8a; border-radius: 6px; background: #214846; color: #e8ffff; font: 400 11px/1 'Segoe UI',sans-serif; cursor: pointer; }
.blackjack-fun-recharge .icon { width: 13px; height: 13px; }
.blackjack-fun-recharge:disabled { opacity: .6; cursor: wait; }
