/* Layout extensions & full H5 mobile/landscape adaptive system */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body, input, button, select {
  font-family: "Outfit", "Segoe UI", "Noto Sans SC", "Noto Sans Thai", "Noto Sans Lao", "Noto Sans Khmer", "Microsoft YaHei", "Leelawadee UI", Tahoma, sans-serif;
}

[hidden] { display: none !important; }

/* Prevent vertical 1-character text wrapping in header badges, nav items & action buttons */
.brand-logo,
.brand-text,
.brand-title,
.brand-subtitle,
.nav-item,
.header-actions,
.wallet-badge,
.wallet-label,
.wallet-balance,
.btn-action-primary,
.btn-action-secondary,
.theme-switch-btn,
.marquee-badge {
  white-space: nowrap;
  flex-shrink: 0;
}

.integration-notice {
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  color: var(--gold-primary);
  background: var(--bg-secondary);
}

.integration-empty {
  padding: 26px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  min-height: 150px;
}

.integration-empty h2 { color: var(--text-primary); margin-bottom: 14px; }
.integration-empty p { margin: 12px 0 18px; }
.integration-muted, .integration-contact { color: var(--text-secondary); font-size: 13px; margin: 12px 0; line-height: 1.7; }

.integration-game-art {
  display: grid;
  place-items: center;
  padding-top: 0;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 30%, #12516a, var(--bg-primary));
  position: relative;
  overflow: hidden;
}

.integration-game-symbol { font-size: 86px; color: var(--gold-primary); text-shadow: var(--shadow-glow-gold); }
.slot-card { height: 100%; display: flex; flex-direction: column; }
.slot-info { display: flex; flex-direction: column; flex: 1; justify-content: space-between; padding: 12px; gap: 4px; min-height: 112px; }
.slot-title { font-size: 13.5px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.slot-provider { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.integration-play { margin-top: 10px; width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }

.slot-img-wrap.is-localized-cover .slot-img {
  object-fit: cover;
  object-position: center center;
}

.slot-img-locale-badge {
  display: none !important;
}

button:disabled { opacity: .55; cursor: not-allowed; }
.integration-service { display: flex; align-items: center; gap: 12px; margin: 22px 0; flex-wrap: wrap; }

/* Global filter bar across all game catalog pages (Slots, Fishing, Cards, Live, Lotto, Cockfight) */
.slot-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.slot-filter-bar > span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.slot-filter-bar label {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  flex: 1 1 220px;
  max-width: min(100%, 420px);
}

.slot-filter-bar label span {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.slot-filter-bar input.stake-input,
.slot-filter-bar select.stake-input {
  flex: 1 1 120px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}

.profile-content-panel p { margin: 12px 0; line-height: 1.7; }

/* ============================================================================
   Game Modal Dialog: Adaptive Portrait (9:16) & Landscape (16:9) + Mobile 100%
   ============================================================================ */
html.game-modal-open,
body.game-modal-open {
  overflow: hidden !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

.integration-game-dialog {
  background: #05070e;
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  width: min(520px, 96vw, calc(min(920px, 95dvh) * 0.5625));
  height: min(920px, 95dvh);
  max-width: 96vw;
  max-height: 95dvh;
  margin: auto;
  padding: 0;
  box-shadow: 0 14px 48px rgba(0, 0, 0, .88), 0 0 28px rgba(255, 184, 0, .25);
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}

/* Desktop Widescreen 16:9 container for Landscape Games (Fishing, Cards, Baccarat, Arcade) */
.integration-game-dialog.is-landscape-game,
.integration-game-dialog[data-rotate-mode="landscape"] {
  width: min(1440px, 96vw, calc(min(840px, 94dvh) * 1.7787));
  height: min(840px, 94dvh, calc(min(1440px, 96vw) * 0.5622));
  max-width: 96vw;
  max-height: 94dvh;
}

.integration-game-dialog::backdrop {
  background: rgba(0, 0, 0, .92);
  backdrop-filter: blur(8px);
}

.integration-game-dialog[open] {
  display: flex;
  flex-direction: column;
}

/* Hide redundant top exit bar since all MJHL/JILI/728/63 games have built-in exit buttons */
.integration-game-head {
  display: none !important;
}

.integration-game-head button {
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 6px;
}

.integration-game-frame {
  width: 100%;
  height: 100%;
  flex: 1;
  border: 0;
  background: #05070e;
  min-height: 0;
  display: block;
  overflow: hidden;
  touch-action: none;
}

.integration-game-dialog:fullscreen,
.integration-game-dialog:-webkit-full-screen {
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-width: 100dvw !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* ============================================================================
   Full-Viewport Game Modal on ALL Mobile / Tablet / Touch Devices
   (Covers both Portrait AND Landscape phone orientations, zero vertical scroll)
   ============================================================================ */
@media (max-width: 960px), (max-height: 600px), (hover: none) and (pointer: coarse) {
  .integration-game-dialog,
  .integration-game-dialog.is-landscape-game,
  .integration-game-dialog.is-portrait-game,
  .integration-game-dialog[data-rotate-mode="landscape"],
  .integration-game-dialog[data-rotate-mode="portrait"] {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    width: var(--u88-vvw, 100dvw) !important;
    height: var(--u88-vvh, 100dvh) !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    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) !important;
    box-sizing: border-box !important;
    background: #05070e !important;
    box-shadow: none !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
  }

  .integration-game-head {
    padding: max(4px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left));
    min-height: 34px;
  }

  .integration-game-head button {
    padding: 4px 12px;
    font-size: 11.5px;
  }
}

/* On narrow Desktop windows (non-touch mouse/trackpad in portrait window), keep Landscape Games in 16:9 widescreen so PC users never see black bars or sideways games */
@media (max-width: 960px) and (hover: hover) and (pointer: fine) and (orientation: portrait) {
  .integration-game-dialog.is-landscape-game,
  .integration-game-dialog[data-rotate-mode="landscape"] {
    width: min(98vw, var(--u88-vvw, 100dvw)) !important;
    height: min(var(--u88-vvh, 95dvh), calc(min(98vw, var(--u88-vvw, 100dvw)) * 0.5625 + 36px)) !important;
    margin: auto !important;
    border: 1px solid var(--border-gold) !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 48px rgba(0, 0, 0, .88), 0 0 28px rgba(255, 184, 0, .25) !important;
  }
}

/* ============================================================================
   H5 Mobile Tablet & Phone Responsive Layout (<= 1024px & <= 768px & <= 480px)
   ============================================================================ */
@media (max-width: 1024px) {
  .main-header {
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 6px;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .header-actions {
    margin-left: auto;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .top-bar {
    height: auto;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 12px;
  }

  .top-bar-left {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .top-bar-right {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 8px;
  }

  .top-bar-right .lang-selector {
    flex: 1;
    min-width: 0;
  }

  .top-bar-right .lang-selector label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
  }

  .top-bar-right select[data-locale] {
    flex: 1;
    min-width: 0;
    width: 0;
  }

  .top-bar-right .theme-switch-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .main-header {
    padding: 8px 12px;
    gap: 8px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    font-size: 8.5px;
    letter-spacing: 0.8px;
  }

  .header-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .wallet-badge {
    padding: 3px 9px;
    gap: 6px;
  }

  .wallet-label {
    font-size: 10px;
  }

  .wallet-balance {
    font-size: 12.5px;
  }

  .btn-action-primary,
  .btn-action-secondary {
    padding: 6px 11px;
    font-size: 12px;
  }

  .nav-item {
    padding: 6px 11px;
    font-size: 12.5px;
  }

  .app-container {
    padding: 14px 12px 56px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 24px;
  }

  .hero-slider-card {
    min-height: 250px;
    padding: 22px 18px;
  }

  .hero-decor-art {
    width: 160px;
    height: 160px;
    right: 10px;
    top: 10px;
    opacity: 0.35;
  }

  .hero-title {
    font-size: clamp(22px, 6vw, 30px);
  }

  .hero-desc {
    font-size: 12.5px;
    margin-bottom: 16px;
  }

  .hero-btn-group {
    flex-wrap: wrap;
    gap: 10px;
  }

  .jackpot-box {
    padding: 16px;
  }

  .jackpot-value {
    font-size: clamp(24px, 6.5vw, 32px);
  }

  .section-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 19px;
  }

  .slot-filter-bar {
    padding: 12px 14px;
    gap: 10px;
    margin-bottom: 16px;
  }

  .slot-filter-bar label {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .slots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
  }

  .slot-info {
    padding: 10px;
    min-height: 98px;
  }

  .slot-title {
    font-size: 12.5px;
  }

  .slot-provider {
    font-size: 10.5px;
  }

  .integration-play {
    margin-top: 6px;
    padding-inline: 6px;
    font-size: 11.5px;
  }

  .game-feature-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .casino-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .vip-table-arena {
    padding: 12px;
  }

  .baccarat-felt {
    padding: 16px 12px;
    border-radius: 20px;
    border-width: 4px;
  }

  .bet-slip-drawer {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
  }

  .profile-layout {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .profile-sidebar {
    flex-direction: column;
    overflow-x: visible;
    padding: 6px;
    gap: 4px;
    position: sticky;
    top: 52px;
  }

  .profile-sidebar [data-account-name] {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    margin: 2px 0 4px;
    text-align: center;
  }

  .profile-sidebar::-webkit-scrollbar {
    display: none;
  }

  .profile-tab-btn {
    white-space: normal;
    word-break: break-word;
    padding: 8px 6px;
    font-size: 12px;
    line-height: 1.25;
    text-align: left;
    justify-content: flex-start;
    border-left: 2px solid transparent;
    border-bottom: none;
  }

  .profile-tab-btn:hover,
  .profile-tab-btn.active {
    border-left: 2px solid var(--gold-primary);
    border-bottom: none;
  }

  .profile-content-panel {
    min-width: 0;
    padding: 12px;
    overflow-x: auto;
  }

  .login-card-wrap,
  .register-card-wrap {
    margin: 20px auto !important;
    padding: 24px 16px !important;
    width: 100%;
  }

  .master-footer {
    padding: 28px 14px;
    margin-top: 36px;
  }
}

@media (max-width: 480px) {
  .brand-subtitle {
    display: none;
  }

  .wallet-label {
    display: none;
  }

  .table-body {
    grid-template-columns: 1fr;
  }

  .dealer-stream-preview {
    height: 140px;
  }
}

/* ============================================================================
   H5 Mobile Landscape Mode (Phone held horizontally, height <= 540px)
   ============================================================================ */
@media (max-height: 540px) and (orientation: landscape) {
  .integration-game-head {
    padding: 2px max(10px, env(safe-area-inset-right)) 2px max(10px, env(safe-area-inset-left));
    min-height: 30px;
    gap: 6px;
  }

  .integration-game-head strong {
    font-size: 11.5px;
  }

  .integration-game-head > span {
    font-size: 11px;
  }

  .integration-game-head button {
    padding: 2px 8px;
    font-size: 11px;
    min-height: 24px;
  }

  .integration-game-guide-panel {
    max-height: 68dvh;
    padding: 8px 12px;
    font-size: 11.5px;
  }

  .top-bar {
    padding: 3px 12px;
    min-height: 28px;
  }

  .main-header {
    padding: 6px 12px;
    gap: 8px;
  }

  .app-container {
    padding: 10px max(12px, env(safe-area-inset-right)) 32px max(12px, env(safe-area-inset-left));
  }

  .hero-slider-card {
    min-height: 190px;
    padding: 16px 20px;
  }

  .hero-title {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .hero-desc {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .matches-grid,
  .sports-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .bet-drawer {
    max-height: 92dvh;
    overflow-y: auto;
    padding: 12px 18px 16px;
    gap: 10px;
  }

  .modal-dialog,
  .modal-content-card {
    max-height: 92dvh;
    overflow-y: auto;
  }
}

/* === U88 1688 VIP SKIN, REBATE & AI SUPPORT EXTENSIONS === */
.brand-icon {
  width: 44px;
  height: 44px;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  overflow: visible;
}
.brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.announcement-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
}
.announcement-row:last-child {
  border-bottom: none;
}
.announcement-bullet {
  color: var(--gold-primary);
  font-weight: 900;
  margin-top: 2px;
}

/* Home Sports Preview Cards */
.home-match-vs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.home-match-team {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-match-team:last-child {
  text-align: right;
}
.home-match-score {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid var(--border-gold);
  color: var(--gold-primary);
  font-weight: 800;
  font-size: 12px;
}
.home-match-odds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.home-odd-pill {
  text-align: center;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--gold-secondary);
  font-weight: 700;
}

/* Turnover Rebate & Affiliate Grids */
.rebate-stats-grid,
.affiliate-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.rebate-stat-card,
.affiliate-tier-card {
  background: linear-gradient(145deg, rgba(22, 21, 29, 0.96), rgba(12, 12, 16, 0.96));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
}
.rebate-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.rebate-stat-value {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold-primary);
}
.rebate-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin: 18px 0;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
}

/* Floating Movable AI Customer Service Widget */
.u88-ai-support-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe066 0%, #d4af37 55%, #aa7c11 100%);
  color: #120d00;
  border: 1.5px solid #fff3b0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 20px rgba(212, 175, 55, 0.45);
  font-size: 13.5px;
  font-weight: 900;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.u88-ai-support-fab:active {
  cursor: grabbing;
  transform: scale(0.97);
}
.ai-fab-icon {
  font-size: 18px;
  line-height: 1;
}

.u88-ai-support-panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 9991;
  width: min(390px, calc(100vw - 24px));
  max-height: min(620px, calc(100dvh - 110px));
  background: #0d0d13;
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 28px rgba(212, 175, 55, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.u88-ai-support-panel[hidden] {
  display: none !important;
}
.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22), rgba(14, 14, 20, 0.98));
  border-bottom: 1px solid var(--border-gold);
}
.ai-panel-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ai-panel-title {
  font-size: 14.5px;
  font-weight: 900;
  color: var(--gold-primary);
}
.ai-panel-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}
.ai-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-panel-nav {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}
.ai-chips-title {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}
.ai-nav-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 88px;
  overflow-y: auto;
}
.ai-nav-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-secondary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.ai-nav-chip:hover {
  background: var(--gold-gradient);
  color: #120d00;
}
.ai-chat-body {
  flex: 1;
  min-height: 200px;
  max-height: 310px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
}
.ai-msg-bot {
  align-self: flex-start;
  background: #171722;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.ai-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.14));
  border: 1px solid var(--border-gold);
  color: #fff;
}
.ai-msg-text {
  margin: 0;
  overflow-wrap: anywhere;
}
.ai-jump-btn {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
  font-size: 12px;
  padding: 7px 12px;
}
.ai-contact-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.ai-contact-heading {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 6px;
}
.ai-contact-item {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}
.ai-contact-line {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.ai-contact-link {
  display: inline-block;
  font-size: 12px;
  color: var(--gold-secondary);
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.ai-contact-qr-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.ai-contact-qr {
  display: block;
  width: 168px;
  height: 168px;
  max-width: 100%;
  object-fit: contain;
  padding: 6px;
  background: #ffffff;
  border-radius: 10px;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.ai-ticket-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-contact-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
}
.ai-arrange-btn {
  width: 100%;
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
}
.ai-ticket-status {
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
}
.ai-panel-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  background: #12121a;
}
.ai-chat-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 12.5px;
}
.ai-chat-send {
  padding: 8px 14px;
  font-size: 12.5px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .u88-ai-support-fab {
    right: 12px;
    bottom: 16px;
    padding: 10px 14px;
    font-size: 12px;
  }
  .u88-ai-support-panel {
    right: 12px;
    left: 12px;
    bottom: 68px;
    width: auto;
    max-height: calc(100dvh - 84px);
  }
  .promo-grid {
    grid-template-columns: 1fr !important;
  }
}


/* === THAI BEAUTY + ROYAL CEREMONIAL ELEPHANT HERO & LIVE SUPPORT CHAT === */
body.theme-1688-vip .hero-slider-card {
  background-image: linear-gradient(90deg, rgba(6, 26, 19, 0.92) 0%, rgba(7, 36, 26, 0.72) 42%, rgba(7, 36, 26, 0.14) 72%, rgba(7, 36, 26, 0.04) 100%), url('../assets/hero-thai-beauty-elephant.jpg?v=20261203i') !important;
  background-size: cover !important;
  background-position: right center !important;
  background-repeat: no-repeat !important;
  border: 1.5px solid var(--border-gold) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
body.theme-1688-vip .hero-slider-card .hero-content {
  max-width: min(56%, 620px);
  width: 100%;
}
body.theme-1688-vip .hero-bg-overlay {
  background: radial-gradient(circle at 18% 50%, rgba(212, 175, 55, 0.12), transparent 65%) !important;
}
body.theme-1688-vip .hero-decor-art {
  display: none !important;
}
@media (max-width: 768px) {
  body.theme-1688-vip:not(.u88-force-desktop) .hero-slider-card {
    background-image: linear-gradient(90deg, rgba(6, 26, 19, 0.94) 0%, rgba(7, 36, 26, 0.78) 44%, rgba(7, 36, 26, 0.16) 66%, rgba(7, 36, 26, 0.02) 100%), url('../assets/hero-thai-beauty-elephant.jpg?v=20261203i') !important;
    background-position: right center !important;
  }
}
body.theme-u88-thai.u88-force-mobile .hero-slider-card {
  background-image: linear-gradient(90deg, rgba(6, 26, 19, 0.94) 0%, rgba(7, 36, 26, 0.78) 44%, rgba(7, 36, 26, 0.16) 66%, rgba(7, 36, 26, 0.02) 100%), url('../assets/hero-thai-beauty-elephant.jpg?v=20261203i') !important;
  background-position: right center !important;
}

.ai-fab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.ai-msg-admin {
  border-color: var(--gold-primary) !important;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(20, 20, 28, 0.96)) !important;
}

.ai-admin-sender {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

/* === PC & MOBILE CROSS-VIEWPORT / SAFE-AREA ALIGNMENT === */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
@media (max-width: 480px) {
  .top-bar {
    padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
    gap: 8px;
  }
  .main-header {
    padding: 10px max(10px, env(safe-area-inset-right)) 10px max(10px, env(safe-area-inset-left));
    gap: 10px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .wallet-badge {
    min-width: 0;
    flex: 1 1 auto;
  }
  .app-container, .sports-container {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .bet-drawer {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .main-nav {
    flex-wrap: wrap;
    gap: 6px;
  }
  .venue-wallet-grid, .rebate-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === WAVE B1 UX MODULES: CAROUSEL, RECENT RAIL, MODALS & MOBILE DOCK === */
body.theme-u88-thai .slot-title {
  color: #0B3D2E;
}

body.theme-u88-thai .u88-ai-support-fab {
  background: linear-gradient(135deg, #0E6B4E 0%, #0B4F3A 100%);
  color: #FFE9A8;
  border: 2px solid #F5C451;
  box-shadow: 0 10px 28px rgba(11, 79, 58, 0.45), 0 0 16px rgba(245, 196, 81, 0.4);
}

/* Favorite Heart Toggle on Slot Cards */
.slot-img-wrap {
  position: relative;
}

.u88-card-fav {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(7, 56, 40, 0.78);
  border: 1.5px solid rgba(245, 196, 81, 0.65);
  color: #FFE9A8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.u88-card-fav:hover {
  transform: scale(1.1);
}

.u88-card-fav.is-active {
  background: #D9383A;
  border-color: #FFF3BE;
  color: #FFFFFF;
}

/* Category Hero Animated Banner Carousel */
.u88-carousel {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #D4A017;
  background: #083B2B;
  box-shadow: 0 14px 32px -12px rgba(11, 79, 58, 0.35);
  margin-bottom: 22px;
}

.u88-carousel-viewport {
  width: 100%;
  aspect-ratio: 1306 / 315;
  min-height: 0;
  max-height: 330px;
  overflow: hidden;
  position: relative;
}

.u88-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.u88-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: block;
}

.u88-carousel-slide img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1306 / 315;
  object-fit: cover;
  display: block;
}

.u88-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(7, 56, 40, 0.78);
  border: 1.5px solid #F5C451;
  color: #FFE9A8;
  font-size: 20px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}

.u88-carousel-btn:hover {
  background: #0E6B4E;
  transform: translateY(-50%) scale(1.06);
}

.u88-carousel-btn.prev { left: 12px; }
.u88-carousel-btn.next { right: 12px; }

.u88-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(7, 56, 40, 0.72);
  border: 1px solid rgba(245, 196, 81, 0.45);
}

.u88-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transition: width 0.2s ease, background 0.2s ease;
}

.u88-carousel-dot.active {
  width: 22px;
  background: #F5C451;
}

/* Recent & Favorite Games Horizontal Rail */
.u88-recent-rail-section {
  background: #FFFFFF;
  border: 1.5px solid #E5CFA0;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  box-shadow: 0 10px 24px -10px rgba(11, 79, 58, 0.12);
}

.u88-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.u88-recent-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.u88-recent-title {
  font-size: 16px;
  font-weight: 900;
  color: #0B3D2E;
}

.u88-recent-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.u88-rail-filter-btn {
  padding: 5px 12px;
  border-radius: 999px;
  background: #FAF6EA;
  border: 1.5px solid #DFC793;
  color: #0B3D2E;
  font-size: 12px;
  font-weight: 800;
}

.u88-rail-filter-btn.active {
  background: linear-gradient(135deg, #0E6B4E 0%, #0B4F3A 100%);
  border-color: #D4A017;
  color: #FFE9A8;
}

.u88-rail-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0E6B4E;
  border: 1px solid #D4A017;
  color: #FFE9A8;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.u88-recent-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
}

.u88-recent-track::-webkit-scrollbar {
  height: 6px;
}

.u88-recent-card {
  flex: 0 0 132px;
  background: #FAF6EA;
  border: 1.5px solid #E5CFA0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.u88-recent-card:hover {
  transform: translateY(-2px);
  border-color: #D4A017;
}

.u88-recent-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.u88-recent-card-name {
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: #0B3D2E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.u88-recent-empty {
  font-size: 12.5px;
  color: #466A5C;
  padding: 8px 4px;
}

/* Shared U88 Revamp Modals (Screen Selector, Report Unfair Site, Promo Popup) */
.u88-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: rgba(5, 31, 22, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.u88-modal-backdrop[hidden] {
  display: none !important;
}

.u88-modal-card {
  position: relative;
  width: min(460px, 100%);
  background: #FFFFFF;
  border: 2px solid #D4A017;
  border-radius: 22px;
  padding: 24px 22px 22px;
  color: #0B3D2E;
  box-shadow: 0 24px 54px rgba(4, 24, 17, 0.5);
}

.u88-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F4EFE0;
  border: 1px solid #D4A017;
  color: #0B3D2E;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.u88-modal-title {
  font-size: 20px;
  font-weight: 900;
  color: #0B4F3A;
  margin-bottom: 6px;
  padding-right: 34px;
}

.u88-modal-subtitle {
  font-size: 13px;
  color: #3E6657;
  margin-bottom: 18px;
  line-height: 1.5;
}

.u88-screen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.u88-screen-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 14px;
  border-radius: 16px;
  background: #FAF6EA;
  border: 2px solid #E5CFA0;
  color: #0B3D2E;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.u88-screen-option:hover,
.u88-screen-option.active {
  background: linear-gradient(160deg, #0E6B4E 0%, #0B4F3A 100%);
  border-color: #D4A017;
  color: #FFFFFF;
  transform: translateY(-2px);
}

.u88-screen-option.active .u88-screen-opt-desc {
  color: #D8F5E9;
}

.u88-screen-opt-icon {
  font-size: 32px;
  line-height: 1;
}

.u88-screen-opt-label {
  font-size: 15px;
  font-weight: 900;
}

.u88-screen-opt-desc {
  font-size: 11.5px;
  color: #466A5C;
  line-height: 1.4;
}

.u88-report-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.u88-report-qr {
  width: min(220px, 75%);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 14px;
  border: 2px solid #D4A017;
  background: #FAF6EA;
  padding: 6px;
}

.u88-report-text {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FAF6EA;
  border: 1px solid #DFC793;
  color: #0B3D2E;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.u88-promo-modal-card {
  width: min(440px, 100%);
  padding: 0;
  overflow: hidden;
  background: #083B2B;
}

.u88-promo-img-link {
  display: block;
  width: 100%;
  cursor: pointer;
}

.u88-promo-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.u88-promo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #0E6B4E 0%, #0B4F3A 100%);
  border-top: 1.5px solid #D4A017;
}

/* Mobile Dock Bottom Bar + PC / Mobile View Mode Switch */
.u88-mobile-dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9985;
  background: linear-gradient(180deg, #0E6B4E 0%, #073828 100%);
  border-top: 2px solid #D4A017;
  padding: 6px 8px max(8px, env(safe-area-inset-bottom));
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  box-shadow: 0 -8px 24px rgba(7, 56, 40, 0.45);
}

.u88-mobile-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 2px;
  border-radius: 10px;
  color: #DDF7ED;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u88-mobile-dock-item.active {
  background: rgba(245, 196, 81, 0.2);
  color: #FFE9A8;
}

.u88-mobile-dock-icon {
  font-size: 16px;
  line-height: 1;
}

body.u88-force-mobile {
  max-width: 440px;
  margin: 0 auto;
  border-left: 2px solid #D4A017;
  border-right: 2px solid #D4A017;
  box-shadow: 0 0 50px rgba(11, 79, 58, 0.25);
  padding-bottom: 78px;
}

body.u88-force-mobile .main-header {
  padding: 10px 12px;
  flex-wrap: wrap;
  gap: 10px;
}

body.u88-force-mobile .main-nav {
  overflow-x: auto;
  width: 100%;
  padding-bottom: 4px;
}

body.u88-force-mobile .hero-section,
body.theme-u88-thai.u88-force-mobile .u88-cat-grid,
body.u88-force-mobile .slots-grid,
body.u88-force-mobile .casino-grid,
body.u88-force-mobile .profile-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.u88-force-mobile .hero-section,
body.u88-force-mobile .casino-grid,
body.u88-force-mobile .profile-layout {
  grid-template-columns: 1fr;
}

body.u88-force-mobile .u88-mobile-dock {
  display: grid;
  max-width: 440px;
  margin: 0 auto;
}

body.u88-force-mobile .u88-ai-support-fab {
  bottom: 84px;
}

@media (max-width: 768px) {
  body.theme-u88-thai:not(.u88-force-desktop) {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-mobile-dock {
    display: grid;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-ai-support-fab {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card {
    padding: clamp(10px, 2.8vw, 18px) clamp(12px, 3.6vw, 20px);
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-content {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    width: 58%;
    max-width: 58%;
  }
  .u88-carousel-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card {
  padding: clamp(10px, 2.8vw, 18px) clamp(12px, 3.6vw, 20px);
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-content {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  width: 58%;
  max-width: 58%;
}

body.theme-u88-thai .u88-modal-card:not(.u88-promo-modal-card) .btn-action-secondary {
  color: #0B3D2E !important;
  background: #F1F8F4 !important;
  border: 1px solid #0E6B4E !important;
}

body.theme-u88-thai .u88-modal-card:not(.u88-promo-modal-card) .btn-action-secondary:hover {
  background: #0E6B4E !important;
  color: #FFFFFF !important;
}

/* === WAVE R1 REVAMP: COMPACT HEADER, 3D ANIMATED ICONS, ONLINE/RTP BADGES & CENTERED FOOTER === */
@keyframes u88-ico-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)) brightness(1);
  }
  50% {
    transform: translateY(-1.5px) scale(1.06);
    filter: drop-shadow(0 3px 6px rgba(245, 196, 81, 0.5)) brightness(1.08);
  }
}

.u88-ico-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  animation: u88-ico-float 3.2s ease-in-out infinite;
}

.u88-ico-3d-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.u88-copy-label {
  display: inline-block;
}

.u88-recent-title,
.u88-rail-filter-btn,
.ai-contact-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.u88-card-fav {
  width: 28px;
  height: 28px;
  padding: 5px;
}

.u88-fav-heart-svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* Online count (top-left) + RTP diamond (top-right, 80% of cards) + inline favorite heart+ */
.u88-card-online-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 20, 15, 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(22, 217, 71, 0.5);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.u88-online-svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  display: block;
}

.u88-card-rtp-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 20, 15, 0.82);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 140, 0, 0.55);
  color: #FFE082;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.u88-rtp-diamond-svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: block;
}

.slot-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.slot-title-row .slot-title {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.u88-card-fav-inline {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(14, 107, 78, 0.16);
  background: rgba(14, 107, 78, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.u88-card-fav-inline:hover {
  transform: scale(1.08);
  border-color: rgba(14, 107, 78, 0.45);
}

.u88-card-fav-inline.is-active {
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.48);
}

/* Zero-scrollbar post-login Promo Modal */
.u88-modal-backdrop {
  overflow: hidden;
}

.u88-promo-modal-card {
  width: min(420px, 92vw);
  max-height: 88dvh;
  padding: 0;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  background: #083B2B;
}

.u88-promo-img-link {
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #083B2B;
}

.u88-promo-img {
  width: 100%;
  height: auto;
  max-height: calc(88dvh - 64px);
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
}

.u88-promo-actions {
  flex-shrink: 0;
}

/* Centered 2-line Royalgoal Footer linking to profile.html */
body.theme-u88-thai .footer-bottom-centered {
  border-top: none;
  padding-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.u88-footer-copyright {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #FFE9A8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
  transition: opacity 0.18s ease;
}

.u88-footer-copyright:hover {
  opacity: 0.85;
  text-decoration: underline;
}

/* Compact Desktop & Mobile Top Navigation Chrome */
body.theme-u88-thai .u88-utility-bar {
  padding: 3px 16px;
  gap: 6px;
  font-size: 11px;
}

body.theme-u88-thai .u88-utility-left,
body.theme-u88-thai .u88-utility-right {
  gap: 6px;
}

body.theme-u88-thai .u88-capsule-btn {
  padding: 3px 9px;
  gap: 4px;
  font-size: 11px;
  min-height: 26px;
}

body.theme-u88-thai .u88-flag-select {
  padding: 2px 7px 2px 5px;
  gap: 4px;
}

body.theme-u88-thai .u88-font-capsule {
  padding: 1px 5px 1px 8px;
  gap: 3px;
}

body.theme-u88-thai .u88-font-btn {
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  font-size: 10.5px;
}

body.theme-u88-thai .main-header {
  padding: 6px 12px;
  gap: 8px;
}

body.theme-u88-thai .brand-logo {
  gap: 7px;
  flex-shrink: 0;
}

body.theme-u88-thai .brand-icon {
  width: 32px;
  height: 32px;
  font-size: 15px;
}

body.theme-u88-thai .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

body.theme-u88-thai .brand-title {
  font-size: 17px;
}

body.theme-u88-thai .brand-subtitle {
  font-size: 9px;
  letter-spacing: 1.1px;
}

body.theme-u88-thai .main-nav {
  gap: 1px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.theme-u88-thai .main-nav::-webkit-scrollbar {
  display: none;
}

body.theme-u88-thai .nav-item {
  padding: 4px 5px;
  gap: 3px;
  font-size: 11.5px;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 28px;
}

body.theme-u88-thai .header-actions {
  gap: 6px;
  flex-shrink: 0;
}

body.theme-u88-thai .wallet-badge {
  padding: 3px 8px;
  font-size: 11.5px;
}

body.theme-u88-thai .main-header .btn-action-primary,
body.theme-u88-thai .main-header .btn-action-secondary {
  padding: 5px 10px;
  font-size: 11.5px;
  min-height: 30px;
}

body.theme-u88-thai .top-bar {
  padding: 4px 16px;
  gap: 8px;
  min-height: 30px;
}

body.theme-u88-thai .u88-report-btn {
  padding: 3px 10px;
  gap: 4px;
  font-size: 11px;
}

@media (max-width: 768px) {
  body.theme-u88-thai:not(.u88-force-desktop) .u88-utility-bar {
    padding: 2px 8px;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-utility-bar::-webkit-scrollbar {
    display: none;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-utility-left {
    flex-wrap: nowrap;
    gap: 4px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-font-label {
    display: none;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .main-header {
    padding: 4px 8px;
    gap: 4px 6px;
    flex-wrap: wrap;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .brand-icon {
    width: 24px;
    height: 24px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .brand-title {
    font-size: 14px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .brand-subtitle {
    display: none;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .header-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 4px;
  }
  body.theme-u88-thai[data-auth="false"]:not(.u88-force-desktop) .wallet-badge {
    display: none;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .wallet-badge {
    padding: 2px 6px;
    font-size: 10.5px;
    flex: 0 0 auto;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .wallet-label {
    display: none;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .main-header .btn-action-primary,
  body.theme-u88-thai:not(.u88-force-desktop) .main-header .btn-action-secondary {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 28px;
    white-space: nowrap;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .main-nav {
    order: 3;
    width: 100%;
    padding: 1px 0 0;
    gap: 2px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .nav-item {
    padding: 3px 6px;
    font-size: 11px;
    min-height: 26px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .top-bar {
    padding: 2px 8px;
    gap: 5px;
    min-height: 26px;
    flex-wrap: nowrap;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .top-bar-left {
    width: auto !important;
    max-width: none !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center;
    gap: 5px;
    overflow: hidden;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .top-bar-right {
    width: auto !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .marquee-badge {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    padding: 2px 6px;
    font-size: 10px;
    white-space: nowrap;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .marquee-content {
    display: block !important;
    flex: 1 1 0% !important;
    min-width: 0 !important;
    font-size: 10.5px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-report-btn {
    padding: 2px 7px;
    font-size: 10px;
  }
}

body.theme-u88-thai.u88-force-mobile .u88-utility-bar {
  padding: 2px 8px;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

body.theme-u88-thai.u88-force-mobile .u88-utility-left {
  flex-wrap: nowrap;
  gap: 4px;
}

body.theme-u88-thai.u88-force-mobile .u88-font-label,
body.theme-u88-thai.u88-force-mobile .brand-subtitle,
body.theme-u88-thai.u88-force-mobile .wallet-label,
body.theme-u88-thai.u88-force-mobile[data-auth="false"] .wallet-badge {
  display: none;
}

body.theme-u88-thai.u88-force-mobile .main-header {
  padding: 4px 8px;
  gap: 4px 6px;
  flex-wrap: wrap;
}

body.theme-u88-thai.u88-force-mobile .brand-icon {
  width: 24px;
  height: 24px;
}

body.theme-u88-thai.u88-force-mobile .brand-title {
  font-size: 14px;
}

body.theme-u88-thai.u88-force-mobile .header-actions {
  width: auto;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 4px;
}

body.theme-u88-thai.u88-force-mobile .wallet-badge {
  padding: 2px 6px;
  font-size: 10.5px;
}

body.theme-u88-thai.u88-force-mobile .main-header .btn-action-primary,
body.theme-u88-thai.u88-force-mobile .main-header .btn-action-secondary {
  padding: 4px 8px;
  font-size: 11px;
  min-height: 28px;
  white-space: nowrap;
}

body.theme-u88-thai.u88-force-mobile .main-nav {
  order: 3;
  width: 100%;
  padding: 1px 0 0;
  gap: 2px;
}

body.theme-u88-thai.u88-force-mobile .nav-item {
  padding: 3px 6px;
  font-size: 11px;
  min-height: 26px;
}

body.theme-u88-thai.u88-force-mobile .profile-layout {
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

body.theme-u88-thai.u88-force-mobile .profile-sidebar {
  flex-direction: column;
  overflow-x: visible;
  padding: 6px;
  gap: 4px;
  position: sticky;
  top: 52px;
}

body.theme-u88-thai.u88-force-mobile .profile-sidebar [data-account-name] {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  margin: 2px 0 4px;
  text-align: center;
}

body.theme-u88-thai.u88-force-mobile .profile-tab-btn {
  white-space: normal;
  word-break: break-word;
  padding: 8px 6px;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  justify-content: flex-start;
  border-left: 2px solid transparent;
  border-bottom: none;
}

body.theme-u88-thai.u88-force-mobile .profile-tab-btn:hover,
body.theme-u88-thai.u88-force-mobile .profile-tab-btn.active {
  border-left: 2px solid var(--gold-primary);
  border-bottom: none;
}

body.theme-u88-thai.u88-force-mobile .profile-content-panel {
  min-width: 0;
  padding: 12px;
  overflow-x: auto;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card {
  aspect-ratio: 16 / 9;
  min-height: clamp(190px, 52vw, 236px);
  height: auto;
  padding: clamp(10px, 2.8vw, 18px) clamp(12px, 3.6vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background-size: cover !important;
  background-position: right center !important;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-content {
  width: 58%;
  max-width: 58%;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-tag {
  font-size: clamp(8px, 2.1vw, 10px);
  padding: 2px 8px;
  margin-bottom: 5px;
  max-width: 100%;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-title {
  font-size: clamp(14px, 4vw, 20px);
  line-height: 1.18;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  margin-bottom: 4px;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-desc,
body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-subtitle {
  font-size: clamp(9.5px, 2.5vw, 11.5px);
  line-height: 1.25;
  margin-top: 2px !important;
  margin-bottom: 3px !important;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .hero-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

body.theme-u88-thai.u88-force-mobile .hero-slider-card .btn-action-primary,
body.theme-u88-thai.u88-force-mobile .hero-slider-card .btn-action-secondary {
  font-size: clamp(9.5px, 2.5vw, 11px);
  padding: 4px 8px;
  min-height: 25px;
  border-radius: 7px;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 768px) {
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card {
    aspect-ratio: 16 / 9;
    min-height: clamp(190px, 52vw, 236px);
    height: auto;
    padding: clamp(10px, 2.8vw, 18px) clamp(12px, 3.6vw, 20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background-size: cover !important;
    background-position: right center !important;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-content {
    width: 58%;
    max-width: 58%;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-tag {
    font-size: clamp(8px, 2.1vw, 10px);
    padding: 2px 8px;
    margin-bottom: 5px;
    max-width: 100%;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-title {
    font-size: clamp(14px, 4vw, 20px);
    line-height: 1.18;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin-bottom: 4px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-desc,
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-subtitle {
    font-size: clamp(9.5px, 2.5vw, 11.5px);
    line-height: 1.25;
    margin-top: 2px !important;
    margin-bottom: 3px !important;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .btn-action-primary,
  body.theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .btn-action-secondary {
    font-size: clamp(9.5px, 2.5vw, 11px);
    padding: 4px 8px;
    min-height: 25px;
    border-radius: 7px;
    line-height: 1.15;
    white-space: nowrap;
  }
}

@media (min-width: 769px) and (max-width: 1180px) {
  body.theme-u88-thai:not(.u88-force-mobile) .main-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  body.theme-u88-thai:not(.u88-force-mobile) .main-nav {
    order: 3;
    width: 100%;
  }
}

body.theme-u88-thai.u88-force-mobile .top-bar {
  padding: 2px 8px;
  gap: 5px;
  min-height: 26px;
  flex-wrap: nowrap;
}

body.theme-u88-thai.u88-force-mobile .top-bar-left {
  width: auto !important;
  max-width: none !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

body.theme-u88-thai.u88-force-mobile .top-bar-right {
  width: auto !important;
  flex: 0 0 auto !important;
  justify-content: flex-end !important;
}

body.theme-u88-thai.u88-force-mobile .marquee-badge {
  display: inline-flex !important;
  flex-shrink: 0 !important;
  padding: 2px 6px;
  font-size: 10px;
  white-space: nowrap;
}

body.theme-u88-thai.u88-force-mobile .marquee-content {
  display: block !important;
  flex: 1 1 0% !important;
  min-width: 0 !important;
  font-size: 10.5px;
}

body.theme-u88-thai.u88-force-mobile .u88-report-btn {
  padding: 2px 7px;
  font-size: 10px;
}

/* === AFFILIATE FULL-CARD, COMPACT MOBILE CAROUSEL & HD PROMO GALLERY === */
body[data-page="affiliate"] .hero-slider-card {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: auto !important;
  justify-content: flex-start !important;
}

body[data-page="affiliate"] .hero-slider-card .hero-content {
  width: 100% !important;
  max-width: 100% !important;
}

.u88-promo-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.u88-promo-gallery a {
  display: block;
}

.u88-promo-gallery img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #E5CFA0;
  display: block;
}

@media (max-width: 768px) {
  body.theme-u88-thai:not(.u88-force-desktop) .u88-carousel-dots {
    bottom: 5px;
    padding: 2px 7px;
    gap: 4px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-carousel-dot {
    width: 6px;
    height: 6px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-carousel-dot.active {
    width: 16px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-carousel-btn {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-carousel-btn.prev { left: 6px; }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-carousel-btn.next { right: 6px; }
  body.theme-u88-thai:not(.u88-force-desktop) .u88-promo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .hero-slider-card {
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: auto !important;
    padding: 18px 14px !important;
    background-image: linear-gradient(180deg, rgba(6, 26, 19, 0.90) 0%, rgba(7, 36, 26, 0.86) 55%, rgba(6, 26, 19, 0.94) 100%), url('../assets/hero-thai-beauty-elephant.jpg?v=20261203i') !important;
    background-position: right top !important;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-title {
    font-size: 20px !important;
    line-height: 1.28 !important;
    margin-bottom: 8px !important;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .hero-slider-card .hero-desc {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .affiliate-tier-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 14px 0 !important;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .affiliate-tier-card {
    height: auto !important;
    padding: 14px !important;
    overflow: visible !important;
  }
  body[data-page="affiliate"].theme-u88-thai:not(.u88-force-desktop) .affiliate-tier-card .rebate-stat-value {
    font-size: 14px !important;
    line-height: 1.45 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
  }
}

body.theme-u88-thai.u88-force-mobile .u88-carousel-dots {
  bottom: 5px;
  padding: 2px 7px;
  gap: 4px;
}

body.theme-u88-thai.u88-force-mobile .u88-carousel-dot {
  width: 6px;
  height: 6px;
}

body.theme-u88-thai.u88-force-mobile .u88-carousel-dot.active {
  width: 16px;
}

body.theme-u88-thai.u88-force-mobile .u88-carousel-btn {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

body.theme-u88-thai.u88-force-mobile .u88-carousel-btn.prev { left: 6px; }
body.theme-u88-thai.u88-force-mobile .u88-carousel-btn.next { right: 6px; }

body.theme-u88-thai.u88-force-mobile .u88-promo-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .hero-slider-card {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: auto !important;
  padding: 18px 14px !important;
  background-image: linear-gradient(180deg, rgba(6, 26, 19, 0.90) 0%, rgba(7, 36, 26, 0.86) 55%, rgba(6, 26, 19, 0.94) 100%), url('../assets/hero-thai-beauty-elephant.jpg?v=20261203i') !important;
  background-position: right top !important;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .hero-slider-card .hero-content {
  width: 100% !important;
  max-width: 100% !important;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .hero-slider-card .hero-title {
  font-size: 20px !important;
  line-height: 1.28 !important;
  margin-bottom: 8px !important;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .hero-slider-card .hero-desc {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .affiliate-tier-grid {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  margin: 14px 0 !important;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .affiliate-tier-card {
  height: auto !important;
  padding: 14px !important;
  overflow: visible !important;
}

body[data-page="affiliate"].theme-u88-thai.u88-force-mobile .affiliate-tier-card .rebate-stat-value {
  font-size: 14px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
}

@media (prefers-reduced-motion: reduce) {
  .u88-ico-3d {
    animation: none;
  }
}
