/**
 * Chinesinha777 — UI Polish (design system overlay)
 * Tokens + componentes reutilizáveis + recharge + responsivo
 * Compatível com o rem do tema RioSlots (max 461px / 4.61rem).
 * v=ch7-21
 */
:root {
  --ch7-bg: #171512;
  --ch7-bg-elevated: #1e1c18;
  --ch7-bg-card: #241813;
  --ch7-bg-card-2: #163a6e;
  --ch7-gold: #f6cf87;
  --ch7-gold-bright: #ffe13c;
  --ch7-gold-btn-top: #ffe566;
  --ch7-gold-btn-mid: #f0b429;
  --ch7-gold-btn-bot: #d4920a;
  --ch7-orange: #e46f2f;
  --ch7-text: #ffffff;
  --ch7-text-muted: #aeb7bb;
  --ch7-text-dim: rgba(255, 255, 255, 0.55);
  --ch7-border: rgba(246, 207, 135, 0.28);
  --ch7-border-soft: rgba(255, 255, 255, 0.08);
  --ch7-success: #7bfe7c;
  --ch7-danger: #f87171;
  --ch7-radius: 0.1rem;
  --ch7-radius-lg: 0.14rem;
  --ch7-radius-pill: 999px;
  --ch7-space-1: 0.06rem;
  --ch7-space-2: 0.1rem;
  --ch7-space-3: 0.14rem;
  --ch7-space-4: 0.2rem;
  --ch7-shadow: 0 0.08rem 0.24rem rgba(0, 0, 0, 0.35);
  --ch7-max: 4.61rem;
}

/* ═══════════════════════════════════════════════════════════
   COMPONENTES REUTILIZÁVEIS (Card / Banner / Button)
   ═══════════════════════════════════════════════════════════ */

.ch7-card {
  border-radius: var(--ch7-radius) !important;
  box-sizing: border-box !important;
  background: var(--ch7-bg-card);
  border: 1px solid var(--ch7-border-soft);
  overflow: hidden;
}

.ch7-banner {
  display: block;
  width: 100%;
  border-radius: var(--ch7-radius) !important;
  overflow: hidden;
}

.ch7-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
}

.ch7-btn {
  appearance: none;
  border: 0;
  border-radius: var(--ch7-radius-pill);
  padding: 0.1rem 0.18rem;
  font: 800 0.14rem/1.2 system-ui, sans-serif;
  cursor: pointer;
  background: linear-gradient(
    180deg,
    var(--ch7-gold-btn-top),
    var(--ch7-gold-btn-mid) 55%,
    var(--ch7-gold-btn-bot)
  );
  color: #1a1208;
  box-shadow: 0 0.02rem 0.06rem rgba(0, 0, 0, 0.25);
}

.ch7-btn:active {
  transform: scale(0.98);
}

.ch7-btn.ghost {
  background: transparent;
  color: var(--ch7-gold);
  border: 1px solid var(--ch7-border);
  box-shadow: none;
}

.ch7-btn.block {
  width: 100%;
  min-height: 0.48rem;
  font-size: 0.17rem;
}

/* ── Base / shell ─────────────────────────────────────────── */
html,
body,
#q-app {
  background: var(--ch7-bg) !important;
  color: var(--ch7-text);
  -webkit-tap-highlight-color: transparent;
}

.custom-layout {
  margin: 0 auto !important;
  max-width: var(--ch7-max) !important;
  width: 100% !important;
  min-height: 100vh;
  background: var(--ch7-bg) !important;
}

.custom-layout.game-iframe-layout {
  max-width: 100vw !important;
}

/* ── Botões dourados padrão (SPA) ─────────────────────────── */
.cocos-btn,
.myBtnStyle1,
button.cocos-btn,
.q-btn.cocos-btn {
  border-radius: var(--ch7-radius-pill) !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

/* ── Cards genéricos SPA ─────────────────────────────────── */
.bonusContent,
.recharge-grid-container,
.stats-container,
.invite-link-container {
  border-radius: var(--ch7-radius) !important;
  box-sizing: border-box !important;
}

/* ── Banners home / swiper ───────────────────────────────── */
.q-carousel,
.swiper,
.homeBanner,
[class*='banner'] {
  border-radius: var(--ch7-radius) !important;
  overflow: hidden;
}

.q-carousel__slide img,
.swiper-slide img,
.homeBanner img,
[class*='banner'] img {
  border-radius: var(--ch7-radius) !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  object-fit: cover;
}

.q-carousel__slide,
.swiper-slide {
  overflow: hidden;
}

/* ── Game cards ──────────────────────────────────────────── */
.gameImgBox,
.game-img,
[class*='GameImg'],
.q-img.game {
  border-radius: 0.1rem !important;
  overflow: hidden;
}

/* ── Bottom nav safe area (iPhone) ───────────────────────── */
.q-footer,
.bottom-navigation,
[class*='BottomNavigation'] {
  padding-bottom: env(safe-area-inset-bottom, 0) !important;
}

/* ═══════════════════════════════════════════════════════════
   PÁGINA DE DEPÓSITO / RECHARGE  (#/recharge)
   Espaçamentos alinhados ao tema original RioSlots
   ═══════════════════════════════════════════════════════════ */

.recharge-dialog {
  width: 100% !important;
  max-width: var(--ch7-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.recharge-dialog .dialog-content {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Tabs Depósito / Retirada */
.recharge-dialog .my-tabs,
.recharge-dialog .q-tabs.my-tabs {
  margin: 0 0.1rem !important;
  border-radius: 0.1rem !important;
  overflow: hidden;
  height: 0.51rem !important;
}

.recharge-dialog .q-tab-panel,
.recharge-dialog .q-tab-panels {
  background: transparent !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Banner bônus nativo — NÃO forçar margin extra que bagunça */
.bonusContent {
  position: relative !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  max-width: 100% !important;
}

.bonusContent .bonusContent-bg,
.bonusContent img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

.bonusContent .Bonus {
  font-size: 0.18rem !important;
  line-height: 1.2 !important;
  word-break: break-word;
}

.bonusContent .Receba {
  font-size: 0.12rem !important;
  line-height: 1.3 !important;
}

/* Grid de valores PIX — 3 colunas estáveis */
.recharge-grid-container {
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.recharge-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.08rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.recharge-grid .amount-container,
.recharge-grid > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
  overflow: hidden !important;
}

.recharge-grid .main-amount {
  font-size: 0.15rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.recharge-grid .bonus-text,
.recharge-grid .bonus {
  font-size: 0.11rem !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Input valor custom */
.input-container,
.custom-input {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.input-container .q-field,
.custom-input .q-field {
  width: 100% !important;
}

/* Linha "Você recebe" */
.received-amount,
.deposit {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* Botão principal Depositar */
.btn-container {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

.btn-container .cocos-btn,
.btn-container .q-btn {
  width: 100% !important;
  min-height: 0.48rem !important;
  border-radius: var(--ch7-radius-pill) !important;
  font-size: 0.17rem !important;
  font-weight: 800 !important;
}

/* Checkbox bônus */
.checkbox-content {
  align-items: flex-start !important;
  gap: 0.06rem !important;
  box-sizing: border-box !important;
}

.checkbox-label {
  font-size: 0.12rem !important;
  line-height: 1.35 !important;
  color: var(--ch7-text-muted) !important;
  word-break: break-word !important;
}

/* Atalhos instruções / pedidos */
.instructions,
.orders-item {
  border-radius: var(--ch7-radius) !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
}

/* ── Promo banners inject (Cartão Dourado) ───────────────── */
#ch7-deposit-promos {
  margin: 0.08rem 0.12rem 0.12rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.08rem !important;
  width: auto !important;
  max-width: calc(100% - 0.24rem) !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}

#ch7-deposit-promos .ch7-promo-card,
#ch7-deposit-promos .ch7-card {
  position: relative !important;
  border-radius: var(--ch7-radius) !important;
  overflow: hidden !important;
  background: linear-gradient(135deg, #3a2208 0%, #1a1208 55%, #0e0c0a 100%) !important;
  border: 1px solid var(--ch7-border) !important;
  box-shadow: var(--ch7-shadow) !important;
  max-width: 100% !important;
}

#ch7-deposit-promos .ch7-promo-card img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 1.1rem !important;
  object-fit: cover !important;
}

#ch7-deposit-promos .ch7-promo-body {
  padding: 0.08rem 0.12rem 0.1rem !important;
}

#ch7-deposit-promos .ch7-promo-title {
  font: 700 0.14rem/1.25 system-ui, sans-serif !important;
  color: var(--ch7-gold) !important;
  margin: 0 0 0.04rem !important;
  word-break: break-word !important;
}

#ch7-deposit-promos .ch7-promo-meta {
  font: 600 0.11rem/1.3 system-ui, sans-serif !important;
  color: var(--ch7-gold-bright) !important;
  margin: 0 0 0.04rem !important;
}

#ch7-deposit-promos .ch7-promo-msg {
  font: 400 0.11rem/1.4 system-ui, sans-serif !important;
  color: var(--ch7-text-dim) !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

#ch7-deposit-promos .ch7-promo-msg.open {
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  display: block !important;
}

#ch7-deposit-promos .ch7-promo-actions {
  display: flex !important;
  gap: 0.08rem !important;
  margin-top: 0.06rem !important;
  flex-wrap: wrap !important;
}

#ch7-deposit-promos .ch7-promo-btn {
  appearance: none !important;
  border: 0 !important;
  border-radius: var(--ch7-radius-pill) !important;
  padding: 0.06rem 0.12rem !important;
  cursor: pointer !important;
  font: 700 0.11rem/1 system-ui, sans-serif !important;
  background: linear-gradient(
    180deg,
    var(--ch7-gold-btn-top),
    var(--ch7-gold-btn-mid)
  ) !important;
  color: #1a1208 !important;
}

#ch7-deposit-promos .ch7-promo-btn.ghost {
  background: transparent !important;
  color: var(--ch7-gold) !important;
  border: 1px solid var(--ch7-border) !important;
}

/* ── Iframe PIX ──────────────────────────────────────────── */
.iframe-container {
  background: var(--ch7-bg) !important;
}

.iframe-container iframe.iframe2,
.iframe-container iframe.ch7-pix-iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 70vh !important;
  border: 0 !important;
  background: var(--ch7-bg) !important;
}

/* ── Página Convite ──────────────────────────────────────── */
.invitedPage,
.invitedBox {
  padding: 0 0.1rem 0.2rem !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.invitedPage .share-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0.1rem !important;
}

.invitedPage .share-item {
  min-width: 0 !important;
  text-align: center !important;
}

.invitedPage .invite-link-container {
  display: flex !important;
  align-items: center !important;
  gap: 0.06rem !important;
  overflow: hidden !important;
  max-width: 100% !important;
}

.invitedPage .link-text {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 0.11rem !important;
}

/* ── Check-in inject ─────────────────────────────────────── */
#ch7-checkin-root .ch7-ci-panel {
  width: min(420px, 100%) !important;
  max-width: 100% !important;
}

/* ── FAB baú (não sobrepor bottom nav) ───────────────────── */
#ch7-checkin-fab {
  bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px)) !important;
  right: 0.12rem !important;
  width: 0.52rem !important;
  height: 0.52rem !important;
}

/* ── Dialogs / modais ────────────────────────────────────── */
.q-dialog__inner > div {
  max-width: min(100vw - 16px, 4.61rem) !important;
}

/* ── Tipografia utilitária ───────────────────────────────── */
.text-muted,
.muted {
  color: var(--ch7-text-muted) !important;
}

/* ── Esconde lixo de debug ───────────────────────────────── */
#rg-fab,
#rg-panel,
.rg-fab,
button[data-rg-fab],
.jogos-rg-fab,
#ch7-boot.hid {
  display: none !important;
}

/* ── Desktop wide: centraliza shell mobile ───────────────── */
@media (min-width: 480px) {
  .custom-layout:not(.game-iframe-layout) {
    max-width: 461px !important;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04),
      0 20px 60px rgba(0, 0, 0, 0.45);
  }

  body {
    background: #0a0908 !important;
  }

  #ch7-deposit-promos .ch7-promo-card img {
    max-height: 130px !important;
  }
}

/* ── Tablet ──────────────────────────────────────────────── */
@media (min-width: 361px) and (max-width: 479px) {
  .recharge-grid .main-amount {
    font-size: 0.14rem !important;
  }
}

/* ── Mobile estreito ─────────────────────────────────────── */
@media (max-width: 360px) {
  .recharge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.06rem !important;
  }

  .recharge-grid .main-amount {
    font-size: 0.13rem !important;
  }

  .btn-container .cocos-btn {
    font-size: 0.15rem !important;
  }

  #ch7-deposit-promos .ch7-promo-title {
    font-size: 0.13rem !important;
  }
}

/* ── Landscape phone ─────────────────────────────────────── */
@media (max-height: 420px) and (orientation: landscape) {
  .bonusContent {
    min-height: auto !important;
    padding: 0.06rem 0.1rem !important;
  }

  .recharge-grid-container {
    margin-bottom: 0.08rem !important;
  }

  #ch7-deposit-promos .ch7-promo-card img {
    max-height: 0.7rem !important;
  }
}

/* ── Scrollbars discretas ────────────────────────────────── */
.recharge-dialog,
.invitedPage,
.q-page {
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 207, 135, 0.25) transparent;
}

/* ── Imagens nunca estouram ──────────────────────────────── */
img,
.q-img {
  max-width: 100%;
}

/* ── Loading iframe ──────────────────────────────────────── */
.q-inner-loading {
  background: rgba(23, 21, 18, 0.65) !important;
}

/* ── Home: seções com gap uniforme ───────────────────────── */
.home-page .q-page > *,
.q-page.home-page > * {
  max-width: 100%;
}

/* ── Evita horizontal scroll no app ──────────────────────── */
html,
body {
  overflow-x: hidden;
}

#q-app,
.q-page {
  overflow-x: hidden;
  max-width: 100vw;
}
