/* Shared mobile shell. Game geometry and settlement remain game-owned. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
[data-mobile-surface] { min-width: 0; }
[data-mobile-surface] button,[data-mobile-surface] a { touch-action: manipulation; }
[data-mobile-surface=slot] #buy,[data-mobile-surface=slot] #buySuper { min-height: 44px; }
[data-mobile-surface] dialog {
  box-sizing: border-box;
  max-width: calc(100% - 24px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
[data-mobile-surface] dialog button { min-height: 44px; }
[data-mobile-surface] dialog input,[data-mobile-surface] dialog select { font-size: 16px; min-height: 44px; max-width: 100%; }
@media(max-width: 720px), (pointer: coarse) {
  body[data-mobile-surface=slot],body[data-mobile-surface=online] {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    padding: env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);
  }
  [data-mobile-surface=slot] .controls > button:not(.slot-spin-button),
  [data-mobile-surface=slot] .bottom-controls > button,
  [data-mobile-surface=slot] .subline > button { min-height: 44px; min-width: 44px; }
  [data-mobile-surface=slot] select,[data-mobile-surface=slot] input[type=number] { font-size: 16px; }
  [data-mobile-surface=slot] .meters > *,[data-mobile-surface=slot] .wallet > * { min-width: 0; }
  [data-mobile-surface=slot] .meters strong,[data-mobile-surface=slot] .wallet strong { overflow-wrap: anywhere; }
  [data-mobile-surface=online] .topbar > a,[data-mobile-surface=online] .topbar > button { min-height: 44px; min-width: 44px; }
  [data-mobile-surface=lobby]:not(.embedded-game) .workspace {
    padding-left: env(safe-area-inset-left,0px);
    padding-right: env(safe-area-inset-right,0px);
    padding-top: env(safe-area-inset-top,0px);
  }
  [data-mobile-surface=lobby] .play-heading button { min-height: 44px; }
  [data-mobile-surface=lobby] .mine-reward-banner > div { min-width: 0; }
  [data-mobile-surface=lobby] .mine-reward-actions { flex-wrap: wrap; }
}
/* Lucky uses a tall painted surface. Never shrink touch targets to fit a short
   landscape viewport: keep the art's aspect ratio and let the page scroll. */
[data-slot-layout=lucky] .game-shell { width: min(100%,540px); }
@media(min-width:560px) and (min-aspect-ratio:6/5) {
  [data-slot-layout=lucky] .game-shell { width: min(100%,760px); }
  [data-slot-layout=lucky] .controls { grid-template-rows: minmax(0,1fr) 44px; }
  [data-slot-layout=lucky] .controls > button:not(.slot-spin-button) { width: 44px; height: 44px; }
}
@media(max-width: 360px) {
  [data-slot-layout=lucky] .controls { left: 2%; width: 96%; gap: 2px; }
  [data-slot-layout=lucky] .controls > button:not(.slot-spin-button) { width: 44px; height: 44px; }
  [data-slot-layout=lucky] .buy-button { font-size: 12px; top: 63%; }
}
/* Avoid stale 100dvh-only declarations on older embedded browser engines. */
@supports not (height: 100dvh) {
  [data-mobile-surface=lobby] .workspace { min-height: 100vh; }
  [data-mobile-surface=lobby].embedded-game .workspace { height: 100%; min-height: 0; }
}
