/* Mobile layout overrides, loaded after the cloned bundle styles. */
@media (max-width: 960px) {
  html { -webkit-text-size-adjust: 100%; }
  html.login-scroll-lock, body.login-scroll-lock { overflow-y: auto; }
  .login-page { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .login-page__auth-stack, .login-page__modal { max-width: 100%; }
  .login-page__form-col--register { max-height: none; overflow: visible; }
  .login-field__eye { flex-basis: 44px; width: 44px; height: 44px; }
  .login-page__link { display: inline-flex; align-items: center; min-height: 44px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
  .x88-hub { flex-direction: column; height: 100dvh; max-height: 100dvh; }
  .x88-hub__mobile-header {
    display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    position: fixed; top: 0; left: 0; right: 0; z-index: 130; background: #003b0d;
    height: calc(64px + env(safe-area-inset-top, 0px));
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  }
  .x88-hub__mobile-header.is-hidden { display: none; }
  .x88-hub__mobile-logo { display: block; width: auto; height: 44px; object-fit: contain; }
  .x88-hub__hamburger { display: block; position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); top: calc(32px + env(safe-area-inset-top, 0px)); transform: translateY(-50%); }
  .x88-hub__drawer-backdrop { display: block; z-index: 110; }
  .x88-hub__sidebar {
    display: block; position: fixed; top: 0; bottom: 0; left: 0; z-index: 115;
    width: min(340px, 86vw); max-width: calc(100vw - 48px);
    transform: translateX(calc(-100% - 8px)); transition: transform .22s ease;
  }
  .x88-hub__sidebar.is-open { transform: translateX(0); }
  .x88-hub__sidebar .hub-sidebar { width: 100%; }
  .hub-sidebar__inner { overflow-y: auto; padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
  .hub-sidebar__frame, .hub-sidebar__vip-block { margin-left: 12px; margin-right: 12px; width: calc(100% - 24px); max-width: 302px; }
  .hub-sidebar__logo { max-width: calc(100% - 32px); margin-left: 16px; }
  .x88-hub__body { height: auto; padding-top: calc(64px + env(safe-area-inset-top, 0px)); padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .nh-analysis { display: flex; flex-direction: column; }
  .nh-analysis__top { order: 0; }
  .nh-analysis__body { order: 2; flex-direction: column; overflow: visible; }
  .nh-analysis__screen-wrap { padding-right: 0; }
  .nh-analysis__screen { aspect-ratio: auto; height: clamp(400px, 68dvh, 720px); min-height: 0; }
  .nh-analysis__panels { width: 100%; max-width: 100%; flex-basis: auto; border-left: 0; padding-left: 0; }
  .nh-analysis .nh-analysis__robot.nh-robot-widget {
    order: 1; position: static !important; inset: auto !important; transform: none !important;
    width: 100% !important; max-width: 440px !important; margin: 0 auto 14px;
    flex-direction: row; gap: 10px; cursor: auto; touch-action: pan-y;
  }
  .nh-analysis__robot .nh-robot-widget__bubble-wrap { flex: 1; min-width: 0; }
  .nh-analysis__robot .nh-robot-widget__img { width: 70px; max-height: 90px; }
  .nh-analysis__robot .nh-robot-widget__text { font-size: 14px; }
  .nh-analysis__robot .nh-robot-widget__tail { display: none; }
  .nh-analysis__robot--hack-open .nh-robot-widget__img { display: none; }
  .nh-analysis__robot .nh-robot-widget__top-slot { width: 100%; }
  .nh-robot-hack-input, .nh-robot-hack-loading, .nh-robot-hack-results { width: 100%; max-width: 100%; }
  .nh-analysis__panel-inner--control .nh-analysis__toggle-row { min-height: 44px; font-size: 13px; margin-bottom: 6px; }
  .nh-analysis__panel-inner--control .nh-analysis__btn, .nh-analysis__vip-btn,
  .nh-robot-hack-input__submit, .nh-slot-cats__btn, .lobby-confirm__btn { min-height: 44px; }
  .pg1-config-card { position: static !important; width: 100% !important; margin: 0 !important; max-width: 100%; box-sizing: border-box; }
  .game-gateway-toolbar button { flex: 1 1 150px; min-height: 44px; }
  .game-gateway-playing .nh-analysis__screen { min-height: 0; height: 78dvh; }
  .telegram-contact {
    bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
    min-height: 44px; box-sizing: border-box; display: flex; align-items: center;
    max-width: calc(100vw - 24px); z-index: 100 !important;
  }
  body:has(.swal2-container) .telegram-contact,
  body:has(.lobby-confirm-overlay) .telegram-contact,
  body:has(.ant-modal-wrap:not([style*="display: none"])) .telegram-contact,
  body.mobile-keyboard-open .telegram-contact { display: none !important; }
  .swal2-container, .lobby-confirm-overlay { padding: 12px !important; }
  .swal2-popup, .lobby-confirm { box-sizing: border-box; max-width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .lobby-confirm__panel { padding: 18px 14px; }
  .swal2-actions button, .lobby-confirm__close { min-height: 44px; min-width: 44px; }
  .admin-topbar { gap: 8px; padding: 12px; }
  .admin-topbar__home span, .admin-topbar__logout span { display: inline-flex; }
  .admin-topbar__home, .admin-topbar__logout { min-height: 44px; box-sizing: border-box; }
  .admin-topbar__right { flex: 1; width: auto; justify-content: flex-end; flex-wrap: wrap; }
  .admin-topbar__user { max-width: 100%; }
  .admin-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; background: #111b2c; }
  .admin-shortcuts a { position: static !important; flex: 1 1 145px; display: flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; margin: 0; text-align: center; font-size: 13px !important; }
  .admin-shell__table-wrap { overscroll-behavior-x: contain; }
  body.mobile-settings-page main { margin: 12px; padding: 20px 16px; }
  body.mobile-settings-page .actions { flex-wrap: wrap; }
  body.mobile-settings-page .actions > * { flex: 1 1 140px; min-height: 44px; text-align: center; box-sizing: border-box; }
}
@media (max-width: 480px) {
  .nh-jackpot__games { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; gap: 10px; }
  .nh-jackpot__game { padding: 10px 8px; }
  .nh-jackpot__thumb-wrap { width: 100%; }
  .nh-jackpot__game-title { font-size: 12px; }
  .nh-hero-banner { margin: 8px 0 16px; padding-top: 8px; }
  .nh-slot-search { flex-wrap: nowrap; flex-direction: row; }
  .nh-slot-search__btn { width: auto; padding: 0 12px; min-height: 44px; }
  .nh-slot-search__icon { padding-left: 10px; }
  .nh-slot-search__input { padding: 0 8px; }
  .admin-topbar__user { padding: 4px; gap: 6px; }
  .admin-topbar__home, .admin-topbar__logout { padding: 8px; gap: 5px; font-size: 12px; }
}
@media (max-width: 960px) and (max-height: 700px) {
  .login-page__robot-float { height: 100px; }
  .login-page__logo { max-height: 76px; }
  .login-page__modal { padding-top: 20px; }
}
@media (max-width: 960px) and (orientation: landscape) {
  .login-page__robot-float { display: none; }
  .login-page__logo { max-height: 64px; }
  .nh-analysis__screen { height: 80dvh; min-height: 240px; }
}
