/* Subway Money — Responsive final layer v3
   Objetivo: consistência entre 320px -> desktop sem alterar regras/fluxos. */
:root{
  --rv3-page-x:clamp(10px,3vw,18px);
  --rv3-content:980px;
  --rv3-form:560px;
  --rv3-gap:clamp(10px,2.5vw,16px);
  --rv3-radius:clamp(10px,2.4vw,18px);
}

html{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{width:100%;max-width:100%;min-width:0;overflow-x:hidden;margin:0}
*,*::before,*::after{box-sizing:border-box}
img,picture,video,canvas,svg,iframe{max-width:100%;height:auto}
img{object-position:center}
a,button,input,select,textarea{max-width:100%}
button,a{-webkit-tap-highlight-color:transparent}
input,select,textarea{min-width:0}

/* quebra de texto / valores grandes */
h1,h2,h3,h4,h5,h6,p,span,strong,b,label,a,button,td,th{overflow-wrap:anywhere}
.sub-game-balance,.withdraw-balance-value,.aff-stat strong,.welcome-bonus-value{font-variant-numeric:tabular-nums}

/* containers principais */
.sub-home,.sub-games-page,.withdraw-page,.aff-page,.affiliate-page,.welcome-bonus-page,.sub-auth-page,.sub-game-page,.pre-sub,.hero-section,.rarity-section,.comic-book{
  width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:clip!important;
}
.sub-home-wrap,.sub-games-wrap,.withdraw-wrap,.aff-wrap,.affiliate-wrap,.sub-game-wrap,.pre-sub__wrap{
  width:min(100%,var(--rv3-content))!important;max-width:var(--rv3-content)!important;min-width:0!important;margin-left:auto!important;margin-right:auto!important;
}
.withdraw-wrap,.sub-game-wrap,.pre-sub__wrap{max-width:var(--rv3-form)!important}
.w-container,.minting-container,.properties,.rarity-row,.w-form,form,fieldset{min-width:0!important;max-width:100%!important}
.minting-container{width:min(100%,620px)!important;margin-inline:auto!important;padding-inline:var(--rv3-page-x)!important}

/* espaçamento horizontal seguro */
.sub-home,.sub-games-page,.withdraw-page,.aff-page,.affiliate-page,.sub-game-page{padding-left:var(--rv3-page-x)!important;padding-right:var(--rv3-page-x)!important}

/* imagens e banners: preserva arquivo sem cortar texto */
.sub-home-banner img,.sub-games-banner img,.withdraw-banner img,.aff-banner img,.deposit-mini__banner,.welcome-bonus-card>img,.pre-sub__banner img,.sub-game-banner img{
  width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;object-fit:contain!important;aspect-ratio:auto!important;display:block!important;
}
.sub-home-banner,.sub-games-banner,.withdraw-banner,.aff-banner,.pre-sub__banner,.sub-game-banner{
  width:100%!important;min-width:0!important;overflow:hidden!important;
}

/* grids nunca forçam viewport */
.sub-home-hero,.sub-games-hero,.sub-payments-grid,.withdraw-grid,.aff-stats,.aff-commission-grid,.aff-graphs,.aff-actions,.aff-pixel-form,.sub-game-quick,.sub-games-trust,.sub-home-badges{
  min-width:0!important;max-width:100%!important;
}
.sub-home-hero>*,.sub-games-hero>*,.sub-payments-grid>*,.withdraw-grid>*,.aff-stats>*,.aff-commission-grid>*,.aff-graphs>*,.aff-actions>*,.sub-game-quick>*,.sub-games-trust>*,.sub-home-badges>*{min-width:0!important}

/* cartões */
.sub-home-panel,.sub-games-card,.sub-live-panel,.sub-ranking-panel,.withdraw-card,.aff-card,.sub-game-card,.welcome-bonus-card,.pre-sub__card,.ig-card,.sub-auth-card{
  width:100%!important;min-width:0!important;max-width:100%!important;border-radius:var(--rv3-radius)!important;
}

/* tipografia fluida sem mudar hierarquia */
.sub-home-title,.sub-games-card h1,.withdraw-title,.aff-title,.sub-game-title,.pre-sub__card h1{font-size:clamp(17px,4.8vw,22px)!important;line-height:1.18!important}
.sub-home-text,.sub-games-text,.withdraw-sub,.aff-sub,.sub-game-text,.pre-sub__card p{font-size:clamp(12px,3.4vw,14px)!important;line-height:1.48!important}
.withdraw-balance-value,.sub-game-balance{font-size:clamp(24px,7vw,30px)!important;line-height:1.05!important}
.aff-stat strong{font-size:clamp(18px,5vw,22px)!important}
.welcome-bonus-value{font-size:clamp(30px,9vw,40px)!important}

/* inputs: evita zoom iOS e mantém altura comum */
input:not([type="checkbox"]):not([type="radio"]),select,textarea,.withdraw-input,.sub-game-input,.large-input-field,.w-input{
  width:100%!important;min-width:0!important;max-width:100%!important;font-size:16px!important;
}
input:not([type="checkbox"]):not([type="radio"]),select,.withdraw-input,.sub-game-input,.large-input-field,.w-input{min-height:44px!important;height:auto!important}
textarea{min-height:96px!important;resize:vertical!important}

/* botões/touch targets */
.primary-button,.w-button,.ig-btn,.sub-home-cta,.sub-home-cta-alt,.sub-home-small,.sub-btn-game,.sub-btn-test,.sub-btn-dark,.withdraw-submit,.welcome-bonus-btn,.welcome-bonus-btn-alt,.pre-sub__btn,.sub-game-submit{
  min-height:44px!important;line-height:1.2!important;white-space:normal!important;text-align:center!important;
}

/* depositar: amarelo + texto preto em qualquer contexto */
.sub-client-deposit,.sub-client-deposit *,.sub-btn-green,.sub-btn-green *,a.sub-client-deposit:link,a.sub-client-deposit:visited,a.sub-client-deposit:hover,a.sub-client-deposit:active{
  color:#111!important;-webkit-text-fill-color:#111!important;
}

/* tabelas */
.aff-table-wrap,.custom-table-wrap,.table-responsive,.withdraw-history{max-width:100%!important;min-width:0!important}
.aff-table-wrap,.table-responsive{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin}
.aff-table{width:100%!important;min-width:560px!important}
.custom-table{width:100%!important;max-width:100%!important;display:table!important;table-layout:auto!important}
.custom-table th,.custom-table td{white-space:normal!important;word-break:break-word!important}

/* links grandes */
.aff-link-row,.aff-link-box{min-width:0!important;max-width:100%!important}
.aff-link-row-info{min-width:0!important}
.aff-link-row-info span,.aff-link-input{max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important}

/* gráficos */
.aff-chart{width:100%!important;min-width:0!important;height:auto!important;min-height:220px!important;overflow:hidden!important}
.aff-chart canvas{width:100%!important;max-width:100%!important;height:auto!important;max-height:190px!important}

/* popups/modais */
.sub-result-popup,.sub-min-balance-modal,.welcome-bonus-modal,.sub-mobile-conversion{
  width:100%!important;max-width:100%!important;padding:clamp(10px,3vw,18px)!important;
}
.sub-result-popup__card,.sub-min-balance-modal__card,.welcome-bonus-dialog,.sub-mobile-conversion__sheet{
  width:min(100%,410px)!important;max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto!important;overscroll-behavior:contain!important;
}
.sub-result-popup__actions{width:100%!important;display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
.sub-result-popup__button{width:100%!important;min-width:0!important}

/* header público */
.sub-nav-inner,.sub-client-nav-inner{width:100%!important;max-width:1100px!important;min-width:0!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important}
.sub-logo-link,.sub-client-logo{min-width:0!important;flex:0 1 auto!important}
.sub-logo-img,.sub-client-logo img{width:auto!important;height:auto!important;max-width:clamp(105px,31vw,165px)!important;max-height:34px!important;object-fit:contain!important}
.sub-actions,.sub-client-links{min-width:0!important}
.sub-actions{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:6px!important;flex-wrap:nowrap!important}
.sub-actions .sub-btn{white-space:nowrap!important;min-width:0!important}

/* topo: nunca quebra a largura */
.sub-top-bonus,.sub-client-topbar{width:100%!important;max-width:100%!important;min-width:0!important}
.sub-top-bonus>span,.sub-client-topbar>span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

/* painel lateral legado: desativa em telas pequenas */
@media(max-width:900px){ul.playersOn{display:none!important}}

/* marketplace legado */
.__hero-section{width:100%!important;max-width:100%!important;padding-left:var(--rv3-page-x)!important;padding-right:var(--rv3-page-x)!important}
.__hero-container,.__product_list{width:100%!important;max-width:100%!important;min-width:0!important}
.__list{width:100%!important;max-width:1200px!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))!important;gap:14px!important;padding:0!important}
.__product{width:100%!important;max-width:320px!important;justify-self:center!important}
.__product .__image{width:100%!important;height:auto!important;aspect-ratio:1/1!important}
.__product_section{width:min(100%,1000px)!important;max-width:100%!important;padding-inline:0!important}
.__product_image{width:clamp(150px,42vw,220px)!important;height:auto!important;aspect-ratio:1/1!important}
.__custom_html_description{width:100%!important;max-width:100%!important;text-align:left!important;overflow-wrap:anywhere!important}
.__custom_html_description img{width:auto!important;max-width:100%!important;height:auto!important}
.__custom_html_description .table{display:block!important;max-width:100%!important;overflow-x:auto!important}

/* tela banido */
#hero{width:100%!important;min-height:100dvh!important;height:auto!important;padding:24px var(--rv3-page-x)!important}
#hero p{width:min(100%,400px)!important;max-width:100%!important}
.hero-description{width:min(100%,450px)!important;max-width:calc(100vw - 20px)!important}
.hero-description .monitor-wrapper{width:calc(100% - 20px)!important;max-width:430px!important}
.hero-description .monitor-wrapper .monitor{width:calc(100% - 30px)!important;max-width:400px!important}

/* desktop/tablet */
@media(min-width:861px){
  .sub-home-hero,.sub-games-hero{grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr)!important}
  .sub-payments-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .aff-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .aff-commission-grid,.aff-graphs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

@media(max-width:900px){
  .sub-client-links{display:none!important}
  .sub-client-menu-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important}
  .sub-home-hero,.sub-games-hero{grid-template-columns:1fr!important}
  .aff-commission-grid,.aff-graphs{grid-template-columns:1fr!important}
}

@media(max-width:760px){
  body{padding-bottom:max(72px,env(safe-area-inset-bottom))!important}
  .sub-client-menu-btn{display:none!important}
  .sub-client-mobile{
    position:fixed!important;left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;top:auto!important;z-index:9990!important;
    width:auto!important;max-width:none!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;padding:7px!important;border-radius:14px!important;
  }
  .sub-client-mobile .sub-client-link{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;min-height:42px!important;padding:5px!important;font-size:10px!important;text-align:center!important;white-space:normal!important}
  .sub-client-mobile .sub-client-link:nth-child(n+5){display:none!important}
  .aff-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .withdraw-type-grid,.withdraw-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sub-game-quick{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .sub-games-trust,.sub-home-badges{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

@media(max-width:520px){
  .sub-top-bonus,.sub-client-topbar{padding:5px 8px!important;gap:5px!important;font-size:10px!important}
  .sub-top-bonus .sub-bonus-btn,.sub-client-topbar .sub-bonus-btn{flex:0 0 auto!important;white-space:nowrap!important;padding:5px 7px!important}
  .sub-nav-inner,.sub-client-nav-inner{padding:8px 10px!important}
  .sub-actions{gap:5px!important}
  .sub-actions .sub-btn{padding:8px 9px!important;font-size:10px!important}
  .sub-home-sticky{left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:auto!important;max-width:calc(100vw - 16px)!important;transform:none!important}
  .sub-home-sticky-info{min-width:0!important}
  .sub-home-sticky-info span{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .aff-table{min-width:500px!important}
  .aff-link-row{flex-direction:column!important;align-items:stretch!important}
  .aff-copy-small{width:100%!important;min-width:0!important}
  .withdraw-row{align-items:flex-start!important}
}

@media(max-width:390px){
  :root{--rv3-page-x:9px;--rv3-gap:9px}
  .sub-logo-img,.sub-client-logo img{max-width:108px!important;max-height:28px!important}
  .sub-actions .sub-btn{padding:7px 7px!important;font-size:9px!important}
  .sub-games-trust,.sub-home-badges{gap:6px!important}
  .sub-games-trust div,.sub-home-badge{padding:10px 5px!important}
  .aff-stats{gap:7px!important}
  .aff-stat{padding:11px!important}
  .sub-result-popup__card,.sub-min-balance-modal__card,.welcome-bonus-dialog{max-width:calc(100vw - 16px)!important;padding:18px 14px!important}
}

@media(max-width:340px){
  .sub-logo-img,.sub-client-logo img{max-width:92px!important}
  .sub-actions .sub-btn{padding:7px 6px!important;font-size:9px!important}
  .sub-client-mobile{left:5px!important;right:5px!important;gap:4px!important;padding:5px!important}
  .sub-client-mobile .sub-client-link{font-size:9px!important;padding:4px 2px!important}
}

/* landscape baixo: modal e páginas não cortam conteúdo */
@media(max-height:520px) and (orientation:landscape){
  .sub-auth-shell,.welcome-bonus-page,.pre-sub{align-items:flex-start!important;padding-top:12px!important}
  .sub-result-popup__card,.sub-min-balance-modal__card,.welcome-bonus-dialog{max-height:calc(100dvh - 12px)!important}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
