/* ============ TrucoRaiz — celular na vertical (estilo app) ============
 * Carrega depois do style.css e do theme-bilhete.css. Tudo aqui só vale até 760px de largura.
 */
.botnav { display: none; }

@media (max-width: 760px) {
  html, body { font-size: 14px; -webkit-tap-highlight-color: transparent; }
  button, a { touch-action: manipulation; }

  /* ---------- topo compacto ---------- */
  .topbar { position: sticky; top: 0; flex-wrap: nowrap !important; gap: 8px !important; padding: 8px 10px !important; padding-top: max(8px, env(safe-area-inset-top)) !important; }
  .topbar .brand-logo { height: 34px !important; }
  .topbar .mainnav, .topbar .cupbtn, .topbar #btn-mute, .topbar #btn-logout, .topbar .spacer:first-of-type { display: none !important; }
  .topbar .spacer { flex: 1; }
  .wallet { padding: 4px 4px 4px 10px !important; gap: 6px !important; margin-left: auto; }
  .wallet .label { display: none; }
  .wallet .amount { font-size: 14px !important; }
  .topbar .userchip { padding: 3px !important; gap: 4px !important; }
  .topbar .userchip .avatar { width: 32px; height: 32px; }
  .topbar .uc-emb { width: 28px !important; height: 28px !important; }
  .bellbtn { width: 36px !important; height: 34px !important; flex-shrink: 0; }
  .toasts { left: 10px !important; right: 10px !important; top: auto !important; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  /* ---------- navegação de baixo ---------- */
  .botnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(43, 100, 132, .97), rgba(29, 67, 96, .99));
    border-top: 1px solid rgba(244, 240, 230, .12); box-shadow: 0 -10px 30px rgba(3, 12, 20, .45); backdrop-filter: blur(10px); }
  .bn-it { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; border-radius: 12px; color: var(--muted); font-size: 10.5px; font-weight: 800; text-decoration: none; }
  .bn-ic { width: 24px; height: 24px; display: grid; place-items: center; } .bn-ic svg { width: 22px; height: 22px; }
  .bn-it.on { color: var(--ink); background: var(--paper-tex); box-shadow: 0 2px 0 #b9b2a2; }
  .bn-it.cup { color: #ffd75e; } .bn-it.cup .bn-ic svg { width: 26px; height: 26px; }
  .bn-it.cup.on { color: #6b4a06; }
  #page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* ---------- páginas ---------- */
  .page { padding: 16px 12px 24px !important; }
  .page h2.title { font-size: 32px !important; }
  .lobby { grid-template-columns: 1fr !important; gap: 14px !important; }
  .modetoggle .modetab { padding: 10px 8px !important; gap: 8px !important; }
  .modetoggle .modetab b { font-size: 21px !important; }
  .modetoggle .modetab .mt-ic { width: 30px !important; }
  .modetoggle .modetab small { display: none; }
  .practice-banner { padding: 14px !important; gap: 10px !important; }
  .practice-banner .pb-cards { display: none; }
  .section-title { flex-wrap: wrap; gap: 6px; }
  #stakes { grid-template-columns: 1fr !important; gap: 12px !important; }
  .ticket { grid-template-columns: 1fr 78px !important; }
  .tk-stub { padding: 10px 6px !important; gap: 10px !important; }
  .tk-live b { font-size: 26px !important; }
  .tk-live span { font-size: 8.5px !important; letter-spacing: .08em !important; }
  .tk-prize { gap: 6px; } .tk-prize span { font-size: 9px !important; } .tk-prize b { white-space: nowrap; font-size: 20px !important; }
  .tk-fine { flex-wrap: wrap; justify-content: center; row-gap: 2px; font-size: 9px !important; }
  .tk-main .tk-btn { font-size: 22px !important; }
  .tk-main .tk-btn.q-lock { font-size: 12px !important; }
  .side .box { margin-bottom: 10px; }

  /* ranking */
  .rk-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .rk-filter::-webkit-scrollbar { display: none; }
  .rkf { flex-shrink: 0; }
  table.grid.rk th:nth-child(5), table.grid.rk td:nth-child(5), table.grid.rk th:nth-child(6), table.grid.rk td:nth-child(6) { display: none; }
  table.grid.rk th:nth-child(3), table.grid.rk td:nth-child(3) { width: 26% !important; }
  table.grid.rk .lg-badge { font-size: 0; padding: 2px; gap: 0; } table.grid.rk .lg-badge i { width: 24px; height: 24px; }
  table.grid.rk td, table.grid.rk th { padding: 9px 4px !important; }
  table.grid.rk .rk-player { width: auto; gap: 6px; } table.grid.rk .rk-player .avatar { width: 30px; height: 30px; }
  table.grid.rk .rk-player b { font-size: 13px; max-width: 90px; }
  .rk-medal { width: 34px !important; height: 44px !important; } .rk-medal.m1 { width: 40px !important; height: 50px !important; }
  table.grid.rk tr.top .rk-pts { font-size: 20px; }
  .rk-soon { padding: 14px !important; gap: 10px !important; }
  .rks-tx b { font-size: 22px !important; } .rks-stamp { width: 82px !important; height: 82px !important; }
  .rk-pager { flex-wrap: wrap; }
  .rk-layout { grid-template-columns: 1fr !important; }

  /* tabelas (extrato, etc.): rolam de lado em vez de espremer */
  .panel:has(> table.grid:not(.rk)) { overflow-x: auto; }
  table.grid:not(.rk) { min-width: 560px; font-size: 13px; }
  .stats { grid-template-columns: 1fr 1fr !important; }

  /* campeonatos */
  .tz-hero { padding: 18px !important; }
  .tz-hero h1 { font-size: 30px !important; }
  .tz-hero .tz-trophy, .tz-hero .tz-badge { display: none; }
  .tz-grid { grid-template-columns: 1fr !important; }
  .tzr-cards { grid-template-columns: 1fr !important; }
  .tzr-ex { font-size: 12px; }
  .tzb { overflow-x: auto; }
  .tz-big .tzg-left, .tz-big .tzg-mid, .tz-big .tzg-right { padding-left: 14px !important; padding-right: 14px !important; }

  /* login */
  .landing { grid-template-columns: 1fr !important; }
  .landing .hero { min-height: 0 !important; padding: 22px 18px 8px !important; }
  .landing .hero .brand-logo { height: 70px !important; }
  .landing .hero h1 { font-size: 40px !important; margin: 14px 0 8px; }
  .landing .hero .lead { font-size: 14px; }
  .landing .feats { grid-template-columns: 1fr 1fr !important; gap: 12px !important; margin-top: 14px; }
  .landing .feat b { font-size: 22px !important; }
  .authbox { padding: 8px 14px 28px !important; }
  .authcard { padding: 30px 18px 20px !important; }

  /* ---------- painéis e janelas: viram "folhas" de baixo pra cima ---------- */
  .notes-panel, .friends-panel, .profile-pop { left: 8px !important; right: 8px !important; width: auto !important; top: var(--tb-bottom, calc(62px + env(safe-area-inset-top))) !important; max-height: calc(100dvh - var(--tb-bottom, 62px) - 92px - env(safe-area-inset-bottom)) !important; }
  .overlay { align-items: end !important; place-items: end center !important; padding: 0 !important; }
  .overlay .modal { width: 100% !important; max-width: 100% !important; border-radius: 20px 20px 0 0 !important; max-height: 92vh; overflow-y: auto !important;
    padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important; animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1); }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
  .overlay.tkm .modal::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(21, 33, 43, .25); margin: 8px auto -2px; position: relative; z-index: 2; }
  .tkm-price b { font-size: 52px !important; }
  .overlay.wallet .modal { width: 100% !important; }
  .pix-box { grid-template-columns: 1fr !important; justify-items: center; text-align: center; }
  .end-ticket { place-items: end center !important; }
  .end-ticket .et { width: 100% !important; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .et-result b { font-size: 50px !important; } .et-side b { font-size: 44px !important; }
  .et-teams { grid-template-columns: 1fr !important; }

  /* ================= MESA na vertical ================= */
  .game { height: 100dvh; }
  .game-top { gap: 8px !important; padding: 6px 8px !important; padding-top: max(6px, env(safe-area-inset-top)) !important; }
  .game-top .brand-logo { height: 28px !important; }
  .game-top .info { gap: 6px !important; font-size: 11px !important; min-width: 0; overflow: hidden; }
  .game-top .info > span:not(:first-child), .game-top .info a, .game-top .info .badge { display: none !important; }
  .game-top .info > span:first-child { white-space: nowrap; }
  .game-top > span.muted { display: none; }
  .game-top .btn { padding: 6px 9px !important; font-size: 12px !important; }
  .game-top #btn-hints { font-size: 0 !important; } .game-top #btn-hints::before { content: '💡'; font-size: 15px; }

  /* placar vira uma faixa compacta no topo da mesa */
  .scoreboard.sb2 { position: fixed !important; left: 8px !important; right: 8px !important; top: calc(46px + env(safe-area-inset-top)) !important; z-index: 21 !important;
    display: grid !important; grid-template-columns: auto 1fr; align-items: center; border-radius: 12px !important; transform: none !important; }
  .sb2 .sb-head { display: none !important; }
  .sb2 .sb-body { padding: 5px 8px !important; gap: 2px !important; border-bottom: 0 !important; border-right: 2px dashed #b9b2a2; }
  .sb2 .sb-body::before, .sb2 .sb-body::after { display: none; }
  .sb-team { min-width: 0 !important; padding: 0 4px !important; display: flex; flex-direction: column; align-items: center; }
  .sb-team .n { font-size: 9px !important; }
  .sb-team .p { font-size: 26px !important; margin: 0 !important; padding: 1px 7px 0 !important; }
  .sb-pips { display: none !important; }
  .sb2 .x { font-size: 18px !important; padding: 0 2px !important; }
  .sb-rounds { padding: 4px 8px !important; border-radius: 0 !important; }
  .sb-rl { display: none !important; }
  .sb-rd { gap: 4px !important; }
  .sb2 .rd { padding: 2px 1px 3px !important; }
  .sb2 .rd small { font-size: 8.5px !important; } .sb2 .rd b { font-size: 12px !important; }
  .handinfo { top: auto !important; bottom: 8px !important; right: 8px !important; }
  .valbadge { padding: 5px 9px !important; font-size: 10px !important; border-radius: 9px !important; }
  .valbadge b { font-size: 19px !important; }
  .special-banner { top: 6px !important; font-size: 10px !important; padding: 4px 10px !important; }

  /* feltro ocupa a tela; jogadores nas bordas */
  .felt { width: 100% !important; height: 100% !important; border-radius: 34px !important; }
  .felt::before { inset: 12px !important; border-radius: 26px !important; }
  .felt .watermark { width: 70% !important; }
  .seat { gap: 4px !important; }
  .seat .plate { padding: 3px 6px 3px 3px !important; gap: 5px !important; }
  .seat .plate .avatar { width: 30px; height: 30px; }
  .seat .plate .nm { font-size: 11.5px !important; max-width: 74px !important; }
  .seat .plate .tm { display: none !important; }
  .seat .plate .pl-lg { font-size: 10px !important; }
  .plate .plate-emb, .plate.lgp-5 .plate-emb, .plate.lgp-6 .plate-emb, .plate.lgp-7 .plate-emb { width: 24px !important; height: 24px !important; margin: 0 !important; }
  .plate-secs { top: -10px !important; right: 6px !important; font-size: 9.5px !important; }
  .seat.pos-2 { top: 26px !important; flex-direction: row !important; }
  .seat.pos-1 { right: 6px !important; top: 47% !important; }
  .seat.pos-3 { left: 6px !important; top: 47% !important; }
  .seat .backs .card { width: 26px !important; margin-left: -16px !important; }
  .seat .backs .card:first-child { margin-left: 0 !important; }
  .dealer-chip { transform: scale(.8); }
  .played { width: 58px !important; }
  .played .who { display: none; }
  .vira-zone { left: 50% !important; top: auto !important; bottom: 10px !important; transform: translateX(-50%) scale(.6) !important; transform-origin: bottom center; }
  .manilhas-fixas { left: 8px !important; bottom: 8px !important; padding: 5px 6px !important; gap: 3px !important; }
  .manilhas-fixas .card { width: 22px !important; }
  .manilhas-fixas span { font-size: 8px !important; margin-right: 2px !important; }
  .chatlog { display: none !important; }

  /* minha área: flutua POR CIMA da mesa (a mesa não muda de tamanho quando as cartas acabam).
     plaquinha + botões em cima, cartas embaixo */
  :root { --cw: min(23vw, 92px); --cov: calc(var(--cw) * 1.4 + 70px); } /* --cov: quanto da mesa a mão cobre */
  .felt-wrap { padding: 66px 6px calc(6px + env(safe-area-inset-bottom)) !important; }
  .myarea { position: absolute !important; left: 0; right: 0; bottom: 0; z-index: 10;
    display: grid !important; grid-template-columns: auto 1fr; grid-template-areas: "me act" "hand hand"; align-items: center; gap: 6px 10px !important;
    margin: 0 !important; padding: 6px 12px calc(10px + env(safe-area-inset-bottom)) !important; }
  .myarea > div:nth-child(2) { grid-area: hand; }
  .me-plate { grid-area: me; flex-direction: row !important; align-items: center !important; gap: 6px !important; }
  .me-plate .yourturn { order: 2; font-size: 10px; }
  .me-plate .yourturn[style] { display: none; }
  .me-plate .plate { padding: 3px 8px 3px 3px !important; gap: 6px !important; }
  .me-plate .plate .avatar { width: 32px; height: 32px; }
  .me-plate .plate .nm { font-size: 12px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .me-plate .plate .tm { display: none; }
  .actions { grid-area: act; display: flex !important; flex-direction: row !important; gap: 8px !important; justify-content: flex-end; min-width: 0 !important; }
  .myhand { gap: 8px !important; justify-content: center; min-height: calc(var(--cw) * 1.4); }
  .myhand .card { width: var(--cw) !important; }
  .myhand.can .card:hover { transform: none; }
  .myhand.can .card:active { transform: translateY(-10px); }
  .btn-truco { font-size: 22px !important; padding: 7px 16px !important; }
  .btn-cover { padding: 6px 10px !important; }
  .btn-cover small { display: none; }
  /* o que ficava no rodapé da mesa sobe pra cima da mão */
  .center { width: 72vw !important; height: 34vh !important; top: 39% !important; }
  .vira-zone { bottom: calc(var(--cov) + 2px) !important; transform: translateX(-50%) scale(.55) !important; }
  .handinfo { bottom: calc(var(--cov) + 8px) !important; }
  .manilhas-fixas { bottom: calc(var(--cov) + 8px) !important; }
  .quickchat { right: 8px !important; left: auto !important; bottom: calc(var(--cov) + 8px) !important; }
  .felt:has(.manilhas-fixas) .quickchat { bottom: calc(var(--cov) + 72px) !important; }
  .quickchat .menu { right: 0 !important; left: auto !important; }
  .hint-tip { font-size: 12px !important; }

  /* janelas da mesa */
  .overlay.pop { padding: 0 !important; }
  .overlay.pop .modal { max-width: 100% !important; border-radius: 20px 20px 0 0 !important; }
  .tq-title h3 { font-size: 34px !important; }
  .overlay.soft .modal { position: fixed !important; top: auto !important; bottom: 210px !important; left: 50% !important; transform: translateX(-50%); width: auto !important; border-radius: 14px !important; }
  .hb-card { min-width: 0 !important; width: 86vw; padding: 0 18px 14px !important; }
  .hb-team { margin: 0 -18px 6px !important; }
  .hb-points { font-size: 84px !important; }
  .waiting .box.wt { width: calc(100% - 16px) !important; }
  .wt-body { grid-template-columns: 1fr !important; }
  .wt-main { border-right: 0 !important; border-bottom: 2px dashed #b9b2a2; padding: 14px 12px 10px !important; }
  .wt-stub { flex-direction: row !important; gap: 8px; padding: 10px !important; flex-wrap: wrap; }
  .wt-stub b { font-size: 44px !important; }
  .wt-route b { font-size: 26px !important; }
  .wt-actions { flex-direction: column; }
  .waiting .box.wt { -webkit-mask: none !important; mask: none !important; }
  .wt .teams { flex-direction: row !important; gap: 6px !important; }
  .wt .teambox { padding: 8px 6px 4px !important; }
  .wt .ws .avatar { width: 40px; height: 40px; }
  .wt .empty-seat { width: 40px !important; height: 40px !important; }
  .waiting { overflow-y: auto; overflow-x: hidden; justify-content: flex-start !important; padding: 10px 0 20px; }
  /* nada pode vazar da largura do bilhete */
  .waiting .box.wt { max-width: calc(100% - 16px) !important; box-sizing: border-box; overflow: hidden; }
  .wt-head { padding: 8px 12px !important; font-size: 11px; }
  .wt-head span { min-width: 0; overflow-wrap: anywhere; }
  .wt-main { min-width: 0; }
  .wt-route { gap: 10px !important; flex-wrap: wrap; }
  .wt-route b { font-size: 22px !important; }
  .wt .teams { gap: 4px !important; margin: 10px 0 4px !important; }
  .wt .teambox { flex: 1 1 0; min-width: 0; padding: 7px 4px 3px !important; }
  .wt .teambox .team-lbl { font-size: 9px; letter-spacing: .06em; line-height: 1.3; }
  .wt .vs-big { flex: none; font-size: 22px; }
  .wt .wait-seats { gap: 4px !important; margin: 8px 0 4px !important; }
  .wt .wait-seats .ws { width: auto !important; flex: 1 1 0; min-width: 0; gap: 5px; }
  .wt .wait-seats .ws small { max-width: 100% !important; font-size: 10.5px; }
  .wt-fine { font-size: 10.5px !important; }
  .wt-stub { justify-content: center; align-items: baseline !important; }
  .wt-stub em { margin-top: 0 !important; flex-basis: 100%; }
  .wt-actions { padding: 10px 12px 12px !important; }
  .wt-actions .btn { width: 100%; }
}

/* telas bem estreitas */
@media (max-width: 380px) {
  .wallet .amount { font-size: 13px !important; }
  .topbar .uc-emb { display: none; }
  .wt-route { flex-wrap: nowrap !important; gap: 6px !important; }
  .wt-route b { font-size: 18px !important; }
  .wt-route small { font-size: 8.5px !important; letter-spacing: .08em !important; }
}
@media (max-width: 760px) {
  .topbar { gap: 6px !important; }
  .topbar .uc-emb { display: none !important; }
  .topbar .userchip { border-radius: 50% !important; padding: 2px !important; }
  .wallet { padding: 3px 3px 3px 8px !important; }
  .wallet .amount { font-size: 13px !important; }
  .bellbtn { width: 32px !important; height: 32px !important; }
  .bellbtn svg { width: 17px !important; height: 17px !important; }
  .topbar .brand-logo { height: 30px !important; }
  .game-top #btn-leave, .game-top .btn { white-space: nowrap; }
}
@media (max-width: 760px) { .landing .feat span { white-space: normal !important; } .landing .feats { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 760px) {
  body { overflow-x: clip; } /* clip não cria área de rolagem (hidden travava o toque em alguns celulares) */
  .rk-layout > *, .lobby > *, .page > * { min-width: 0; }
  .rk-filter { max-width: 100%; }
}
@media (max-width: 760px) {
  table.grid.rk th { font-size: 9px !important; letter-spacing: .04em !important; }
  table.grid.rk th:nth-child(1) { width: 13% !important; } table.grid.rk th:nth-child(2) { width: 41% !important; }
  table.grid.rk th:nth-child(3) { width: 14% !important; } table.grid.rk th:nth-child(4) { width: 16% !important; } table.grid.rk th:nth-child(7) { width: 16% !important; }
  table.grid.rk .rk-player { justify-content: flex-start; }
}
@media (max-width: 760px) { .pp-mob { display: flex; gap: 8px; justify-content: space-between; margin-top: 10px; } }
@media (max-width: 760px) {
  /* extrato: cada movimentação vira um cartão (descrição inteira, valor à direita) */
  #txs { overflow: visible !important; }
  #txs table.grid { min-width: 0 !important; width: 100%; }
  #txs thead { display: none; }
  #txs tbody, #txs tr { display: block; }
  #txs tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "desc val" "type bal" "date bal"; column-gap: 12px; row-gap: 2px;
    padding: 11px 12px; border-bottom: 1px dashed rgba(244, 240, 230, .12); }
  #txs td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  #txs td:nth-child(3) { grid-area: desc; font-weight: 700; font-size: 13.5px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
  #txs td:nth-child(4) { grid-area: val; text-align: right !important; font-weight: 900; font-size: 14px; white-space: nowrap; }
  #txs td:nth-child(2) { grid-area: type; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  #txs td:nth-child(1) { grid-area: date; font-size: 11px; }
  #txs td:nth-child(5) { grid-area: bal; align-self: end; text-align: right !important; font-size: 11px; color: var(--muted); white-space: nowrap; }
  #txs td:nth-child(5)::before { content: 'saldo '; }
}
@media (max-width: 760px) {
  *:has(> .panel.stat) { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .panel.stat { padding: 10px 12px !important; }
  .panel.stat .v { font-size: 24px !important; }
}

/* tela de entrar/criar conta no celular: logo e frase centralizadas */
@media (max-width: 760px) {
  .landing .hero > .brand { justify-content: center; align-self: center; }
  .landing .hero h1, .landing .hero .lead { text-align: center; }
  .landing .hero .lead { margin-left: auto; margin-right: auto; }
}

/* iPhone/Safari: quem rola é o documento (não o body). Com body height:100% o Safari
   trata o body como área de rolagem e a barra dele cobre o menu fixo de baixo. */
@media (max-width: 760px) {
  html, body { height: auto; min-height: 100%; }
  .botnav { transform: translateZ(0); }
}

/* destaques da tela inicial: com número ímpar, o último ocupa a linha inteira */
@media (max-width: 760px) {
  .landing .feats .feat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* celular: as 4 pastilhas ficam embaixo da janela de conta (mesma ordem do computador) */
@media (max-width: 760px) {
  .authbox .feats { margin-top: 16px !important; }
  .authbox { padding-bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 760px) {
  /* iPhone: campo com letra < 16px faz o Safari dar zoom ao tocar e a tela fica "comida" nos lados */
  input, select, textarea, .fp-add input, .pix-copy input { font-size: 16px !important; }

  /* nada pode empurrar a página pro lado */
  html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
}


/* ---------- topo no celular: recarga colada na esquerda, logo no meio ---------- */
@media (max-width: 760px) {
  .topbar .wallet { order: -1; margin-left: -10px !important; flex-direction: row; border-left: 0 !important;
    border-radius: 0 999px 999px 0 !important; padding: 3px 4px 3px 12px !important; }
  .topbar .brand { position: absolute; left: 50%; transform: translateX(-50%);
    top: max(8px, env(safe-area-inset-top)); bottom: 8px; display: flex; align-items: center; z-index: 1; }
}


/* ---------- tela de entrar (computador): logo e frase no centro, pastilhas embaixo da janela ---------- */
@media (min-width: 761px) {
  .landing .hero.hero-center { justify-content: center; align-items: center; text-align: center; gap: 28px; }
  .landing .hero.hero-center .lead { margin-left: auto; margin-right: auto; }
  .landing .hero.hero-center .fan { position: relative; right: auto; top: auto; justify-content: center; padding-left: 62px; margin-top: 18px; }
  .authbox { flex-direction: column; gap: 22px; }
  .authbox .feats { width: 100%; max-width: 520px; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (min-width: 761px) and (max-width: 980px) { .landing .hero.hero-center { min-height: 0; } }

/* carteira no celular: dentro da tela (sem margem negativa), pílula inteira, respeitando a borda do iPhone */
@media (max-width: 760px) {
  .topbar { padding-left: max(10px, env(safe-area-inset-left)) !important; padding-right: max(10px, env(safe-area-inset-right)) !important; }
  .topbar .wallet { margin-left: 0 !important; border-left: 1px solid rgba(244, 240, 230, .12) !important; border-radius: 999px !important;
    padding: 3px 4px 3px 10px !important; flex-shrink: 0; max-width: 42vw; }
  .topbar .wallet .amount { overflow: hidden; text-overflow: ellipsis; }
}

/* topo no celular: logo um pouco maior, valor do saldo um pouco menor */
@media (max-width: 760px) {
  .topbar .brand-logo { height: 38px !important; }
  .topbar .wallet .amount { font-size: 12px !important; }
}

/* ---------- carteira = um botão só (abre a recarga); o "$" é a ponta verde do próprio slot ---------- */
.topbar .wallet { font: inherit; color: var(--text); cursor: pointer; text-align: left; appearance: none; -webkit-appearance: none;
  display: flex; align-items: stretch; gap: 0 !important; padding: 0 !important; overflow: hidden; border-radius: 12px;
  transition: border-color .15s ease, transform .15s ease; }
.topbar .wallet:hover { border-color: rgba(120, 200, 150, .6); }
.topbar .wallet:active { transform: translateY(1px); }
.topbar .wallet:focus-visible { outline: 2px solid #8fd6a8; outline-offset: 2px; }
.topbar .wallet .w-info { display: flex; flex-direction: column; justify-content: center; padding: 6px 12px 6px 14px; min-width: 0; }
.topbar .wallet .label, .topbar .wallet .amount { display: block; }
.topbar .wallet .w-cash { display: flex; align-items: center; justify-content: center; min-width: 40px; padding: 0 10px;
  background: #2f9e5b; color: #fff; font-size: 19px; font-weight: 900; line-height: 1; }
.topbar .wallet:hover .w-cash { background: #36ad66; }
@media (max-width: 760px) {
  .topbar .wallet { padding: 0 !important; border-radius: 999px !important; height: 32px; }
  .topbar .wallet .w-info { padding: 0 9px 0 11px; }
  .topbar .wallet .label { display: none; }
  .topbar .wallet .w-cash { min-width: 32px; padding: 0 8px; font-size: 16px; }
}

/* tela de entrar: janela de conta e pastilhas sempre empilhadas (uma embaixo da outra), em qualquer tela */
.authbox { flex-direction: column !important; align-items: center; }
.authbox .authcard, .authbox .feats { width: 100%; }
@media (max-width: 760px) { .authbox .feats { max-width: 400px; } }

/* slot do saldo: "R$" verde na ESQUERDA, valor (sem R$) à direita */
.topbar .wallet .w-cash { font-size: 15px; letter-spacing: .02em; padding: 0 11px; }
.topbar .wallet .w-info { padding: 6px 14px 6px 12px; }
@media (max-width: 760px) {
  .topbar .wallet .w-cash { font-size: 12.5px; min-width: 0; padding: 0 8px; }
  .topbar .wallet .w-info { padding: 0 12px 0 8px; }
}

/* ---------- balões / avisos da mesa: pequenos, só pra informar ---------- */
.bubble { font-size: 12px !important; padding: 5px 10px !important; border-radius: 10px !important; max-width: min(220px, 64vw); white-space: normal !important; text-align: center; line-height: 1.25; }
.bubble.truco { font-size: 22px !important; padding: 3px 12px 1px !important; letter-spacing: .04em; white-space: nowrap !important; }
.bubble::after { width: 9px !important; height: 9px !important; }
.bubble.tail-0::after { left: calc(50% - 4.5px) !important; bottom: -5px !important; }
.bubble.tail-2::after { left: calc(50% - 4.5px) !important; top: -5px !important; }
.bubble.tail-1::after { right: -5px !important; top: calc(50% - 4.5px) !important; }
.bubble.tail-3::after { left: -5px !important; top: calc(50% - 4.5px) !important; }
.rb-tag { font-family: inherit !important; font-size: 11px !important; font-weight: 800; letter-spacing: .02em !important; padding: 3px 9px !important; border-radius: 999px !important; border-width: 1.5px !important; box-shadow: 0 4px 12px rgba(3, 12, 20, .45) !important; }
.rb-star { margin-right: 4px !important; }
.rb .ring { width: 44px !important; height: 44px !important; margin: -22px 0 0 -22px !important; border-width: 2px !important; }
.rb-tie { padding: 5px 12px !important; border-radius: 10px !important; border-width: 1.5px !important; }
.rb-tie b { font-size: 16px !important; display: inline !important; margin-right: 6px; }
.rb-tie span { font-size: 10px !important; letter-spacing: .06em !important; }
.win-badge { font-size: 9.5px !important; padding: 2px 7px !important; max-width: 110%; overflow: hidden; text-overflow: ellipsis; }
.special-banner { font-size: 10px !important; padding: 4px 10px !important; letter-spacing: .08em !important; }
/* fim de mão: cartãozinho compacto no meio da mesa */
.hb-card { min-width: 0 !important; width: auto !important; max-width: min(300px, 86vw) !important; padding: 0 18px 10px !important; border-radius: 14px !important; }
.hb-card::before { inset: 5px !important; border-radius: 10px !important; }
.hb-team { margin: 0 -18px 4px !important; padding: 5px 0 !important; font-size: 10px !important; letter-spacing: .2em !important; }
.hb-points { font-size: 46px !important; margin: 0 !important; }
.hb-sub { font-size: 12px !important; }
.hb-who { gap: 6px !important; margin-top: 6px !important; flex-wrap: wrap; }
.hb-who span { font-size: 11px !important; padding: 2px 8px 2px 2px !important; gap: 5px !important; }
.hb-who .avatar { width: 20px !important; height: 20px !important; }
.hb-score { gap: 10px !important; margin-top: 8px !important; padding-top: 6px !important; }
.hb-score small { font-size: 8.5px !important; }
.hb-score em { font-size: 24px !important; }
.hb-rays { opacity: .2 !important; }
.hand-banner .cf { width: 14px !important; height: 14px !important; }
@media (max-width: 760px) { .hb-card { width: auto !important; } .hb-points { font-size: 40px !important; } }

/* ---------- celular: jogadores da esquerda e da direita iguais ao de cima ---------- */
@media (max-width: 760px) {
  .seat .plate { flex-direction: row !important; border-radius: 999px !important; padding: 3px 7px 3px 3px !important; gap: 5px !important; text-align: left !important; }
  .seat .plate .nm { max-width: 60px !important; }
  .seat .plate .pl-lg { font-size: 9px !important; }
  .plate .plate-emb, .plate.lgp-5 .plate-emb, .plate.lgp-6 .plate-emb, .plate.lgp-7 .plate-emb { width: 20px !important; height: 20px !important; }
  .seat.pos-1, .seat.pos-3 { top: 46% !important; flex-direction: column !important; align-items: center; gap: 4px !important; }
  .seat.pos-1 { right: 6px !important; align-items: flex-end; }
  .seat.pos-3 { left: 6px !important; align-items: flex-start; }
  /* cartas da mesa um pouco menores e mais juntas pra não bater nas plaquinhas */
  .played { width: 64px !important; }
  .played.p1 { left: 85% !important; }
  .played.p3 { left: 15% !important; }
  .center { width: 64vw !important; top: 35% !important; }
}

/* menu do perfil: som do jogo (liga/desliga), logo antes de "Ver todas as ligas" */
.pp-sound { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0; padding: 9px 12px; border-radius: 12px; cursor: pointer;
  font: inherit; color: inherit; text-align: left; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .09); }
.pp-sound:hover { border-color: rgba(141, 180, 198, .45); }
.pp-sound:focus-visible { outline: 2px solid #8db4c6; outline-offset: 2px; }
.pps-ic { font-size: 17px; width: 22px; text-align: center; }
.pps-tx { flex: 1; display: flex; flex-direction: column; font-weight: 800; font-size: 13px; color: #cfe6fb; }
.pps-tx small { font-weight: 600; font-size: 11px; color: var(--muted); }
.pps-sw { position: relative; width: 40px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .14); transition: background .18s ease; flex-shrink: 0; }
.pps-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #f4f0e6; transition: transform .18s ease; }
.pp-sound.on .pps-sw { background: #5caccc; }
.pp-sound.on .pps-sw::after { transform: translateX(18px); }
@media (max-width: 760px) { .pp-mob { justify-content: flex-end !important; } }

/* celular: sem o quadro de manilhas, o "Valendo" fica no meio embaixo; a vira (Paulista) vai pro canto esquerdo */
@media (max-width: 760px) {
  .handinfo { left: 50% !important; right: auto !important; bottom: calc(var(--cov) + 6px) !important; transform: translateX(-50%); align-items: center !important; }
  .vira-zone { left: 8px !important; bottom: calc(var(--cov) + 4px) !important; transform: scale(.55) !important; transform-origin: bottom left !important; }
}

/* celular: janela de truco/mão de onze fica ACIMA da mão (as cartas continuam visíveis pra decidir) e mais compacta */
@media (max-width: 760px) {
  .overlay.pop { place-items: end center !important; padding: 0 8px calc(var(--cov) + 14px + env(safe-area-inset-bottom)) !important; background: none !important; }
  .overlay.pop .modal { width: 100% !important; max-width: 420px !important; border-radius: 16px !important; padding: 0 14px 12px !important; max-height: calc(100dvh - var(--cov) - 140px); overflow-y: auto !important;
    box-shadow: 0 14px 40px rgba(3, 12, 20, .6) !important; }
  .overlay.pop .modal::before { display: none !important; }
  .overlay.pop .tq-caller { margin: 8px auto 2px !important; padding: 3px 10px 3px 3px !important; }
  .overlay.pop .tq-caller > :first-child { width: 26px !important; height: 26px !important; }
  .overlay.pop .tq-title h3 { font-size: 34px !important; }
  .overlay.pop .tq-sub { margin: 2px 0 8px !important; font-size: 12px !important; }
  .overlay.pop .cards-row .card { width: 44px !important; }
}

/* celular: pedido de truco aparece EM CIMA, logo abaixo do placar — não tampa as cartas da mesa nem as da mão.
   A mão de onze continua acima da mão (ela já mostra as cartas). */
@media (max-width: 760px) {
  .overlay.pop:has(.tq-title) { place-items: start center !important; align-items: start !important; padding: calc(100px + env(safe-area-inset-top)) 8px 0 !important; }
  .overlay.pop .modal:has(.tq-title) { width: 100% !important; max-width: 420px !important; max-height: none !important; overflow: hidden !important;
    border-radius: 14px !important; padding: 10px 10px 16px !important; animation: tq-drop .25s cubic-bezier(.2, .9, .3, 1) !important;
    display: grid !important; grid-template-columns: 1fr 1fr 1.25fr; grid-template-areas: 'cal tit tit' 'row row rai'; gap: 8px; align-items: center; text-align: left; }
  @keyframes tq-drop { from { transform: translateY(-24px); opacity: 0; } }
  .overlay.pop .modal:has(.tq-title):not(:has(.tq-raise)) { grid-template-areas: 'cal tit tit' 'row row row'; }
  .overlay.pop .modal:has(.tq-title) > .pop-timer { position: absolute !important; top: auto !important; bottom: 0; left: 0; right: 0; height: 7px !important; margin: 0 !important; border-radius: 0 !important; order: 0; }
  .overlay.pop .modal:has(.tq-title) > .pop-timer span { display: none; }
  .overlay.pop .modal:has(.tq-title) .tq-caller { grid-area: cal; margin: 0 !important; padding: 2px 8px 2px 2px !important; gap: 6px; min-width: 0; justify-self: start; }
  .overlay.pop .modal:has(.tq-title) .tq-caller > :first-child { width: 22px !important; height: 22px !important; }
  .overlay.pop .modal:has(.tq-title) .tq-caller b { font-size: 11.5px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .overlay.pop .modal:has(.tq-title) .tq-caller span { font-size: 8.5px; letter-spacing: .1em; }
  .overlay.pop .modal:has(.tq-title) .tq-title { grid-area: tit; justify-content: flex-end; gap: 8px; }
  .overlay.pop .modal:has(.tq-title) .tq-title h3 { font-size: 26px !important; }
  .overlay.pop .modal:has(.tq-title) .tq-val { padding: 2px 8px; font-size: 10px; } .overlay.pop .modal:has(.tq-title) .tq-val b { font-size: 17px; }
  .overlay.pop .modal:has(.tq-title) .tq-sub, .overlay.pop .modal:has(.tq-title) .hint-tip { display: none !important; }
  .overlay.pop .modal:has(.tq-title) .tq-row { grid-area: row; gap: 8px; }
  .overlay.pop .modal:has(.tq-title) .tq-btn { padding: 9px 4px; font-size: 17px; letter-spacing: .04em; }
  .overlay.pop .modal:has(.tq-title) .tq-raise { grid-area: rai; margin: 0 !important; padding: 7px 6px !important; gap: 5px; height: 100%; }
  .overlay.pop .modal:has(.tq-title) .tq-up { font-size: 11px; }
  .overlay.pop .modal:has(.tq-title) .tq-rl { font-size: 17px; letter-spacing: .04em; }
  .overlay.pop .modal:has(.tq-title) .tq-jump { padding: 1px 6px; gap: 3px; }
  .overlay.pop .modal:has(.tq-title) .tq-jump s, .overlay.pop .modal:has(.tq-title) .tq-jump i { font-size: 10px; }
  .overlay.pop .modal:has(.tq-title) .tq-jump b { font-size: 16px; }

  /* minha área: sem o 'Sua vez' (o timer na plaquinha já mostra); TRUCO no centro acima das cartas, coberta à direita */
  .me-plate .yourturn { display: none !important; }
  .myarea { grid-template-columns: 1fr auto 1fr !important; grid-template-areas: 'me tru cov' 'hand hand hand' !important; }
  .me-plate { justify-self: start; }
  .actions { display: contents !important; }
  .btn-truco { grid-area: tru; justify-self: center; }
  .btn-cover { grid-area: cov; justify-self: end; }
}

/* som do jogo: interruptor liga/desliga na barra da mesa (ao lado do Abandonar) */
.gmute .gm-sw { display: none; }
@media (max-width: 760px) {
  .game-top #btn-gmute { display: inline-flex !important; align-items: center; gap: 5px; padding: 4px 6px 4px 7px !important; flex-shrink: 0; }
  .gmute .gm-ic { font-size: 14px; line-height: 1; }
  .gmute .gm-sw { display: block; position: relative; width: 30px; height: 17px; border-radius: 999px; background: rgba(255, 255, 255, .16); transition: background .18s ease; }
  .gmute .gm-sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #f4f0e6; transition: transform .18s ease; }
  .gmute.on .gm-sw { background: #5caccc; }
  .gmute.on .gm-sw::after { transform: translateX(13px); }
}

/* balão de "pensando" acima da pastilha de segundos (não tampa o timer) */
.plate .thinking { top: -30px; z-index: 4; }
@media (max-width: 760px) { .plate .thinking { top: -27px; padding: 4px 7px; } }

/* ranking (celular): o brilho do pódio ficava preso na tela inteira — alguns navegadores (Safari) não aceitam
   linha de tabela como referência de posição. Aqui ele nasce da 1ª célula da linha e a tabela corta o que sobrar. */
@media (max-width: 760px) {
  table.grid.rk { clip-path: inset(0); }
  table.grid.rk tr.top::after { content: none !important; display: none !important; }
  table.grid.rk tr.top td:first-child { position: relative; }
  table.grid.rk tr.top td:first-child::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: calc(100vw - 24px); pointer-events: none; z-index: 1;
    background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--pc) 30%, rgba(255, 255, 255, .22)) 50%, transparent 65%) no-repeat;
    background-size: 40% 100%; background-position: -60% 0; animation: rk-row-sweep 4.2s ease-in-out infinite; }
  table.grid.rk tr.top2 td:first-child::after { animation-delay: 1.2s; }
  table.grid.rk tr.top3 td:first-child::after { animation-delay: 2.4s; }
}

/* celular: botão "Jogar coberta" do tamanho do texto, sem sobrar espaço e sem vazar da tela */
@media (max-width: 760px) {
  .myarea { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important; }
  .btn-cover { width: max-content; max-width: 100%; min-width: 0; gap: 6px !important; padding: 6px 9px 6px 7px !important; font-size: 12.5px !important; line-height: 1.15; white-space: nowrap; }
  .btn-cover .bc-card { width: 14px !important; height: 20px !important; border-radius: 3px !important; }
}
/* "Descartar carta" (ligado) quebra em 2 linhas no celular em vez de vazar da tela */
@media (max-width: 760px) { .btn-cover { white-space: normal !important; width: fit-content !important; max-width: 100% !important; text-align: left; } }

/* mão de onze no celular */
@media (max-width: 760px) {
  .overlay.pop .modal:has(.oz-hands)::before { display: block !important; }
  .overlay.pop .oz-title h3 { font-size: 30px !important; }
  .oz-hands { margin: 2px -14px 12px; padding: 8px 6px 4px; }
  .overlay.pop .oz-h .cards-row .card { width: 42px !important; }
  .oz-h small { font-size: 9px; letter-spacing: .08em; }
}

/* topo no celular: [perfil][amigos][notificações] ... logo no meio ... [saldo] */
@media (max-width: 760px) {
  .topbar .userchip { order: -3; }
  .topbar #btn-friends { order: -2; }
  .topbar #btn-bell { order: -1; }
  .topbar .wallet { order: 5 !important; margin-left: auto !important; }
}
/* telas bem estreitas: botões e logo menores pro logo não encostar no sininho */
@media (max-width: 380px) {
  .topbar { gap: 5px !important; }
  .topbar .brand-logo { height: 30px !important; }
  .topbar .bellbtn { width: 31px !important; height: 31px !important; }
  .topbar .userchip .avatar { width: 28px; height: 28px; }
  .topbar .wallet .w-cash { padding: 0 5px; }
}

/* tela de entrar/criar conta (computador): logo bem maior e mais pra cima */
@media (min-width: 761px) {
  .landing .hero.hero-center .brand-lg .brand-logo { height: 180px; }
  .landing .hero.hero-center .brand-lg { margin-top: -48px; }
}

/* ---------- celular: emblema da liga maior na plaquinha dos jogadores (o resto da plaquinha fica igual) ---------- */
@media (max-width: 760px) {
  .plate .plate-emb, .plate.lgp-5 .plate-emb, .plate.lgp-6 .plate-emb, .plate.lgp-7 .plate-emb { width: 30px !important; height: 30px !important; margin: -2px -2px -2px 1px !important; }
}
