:root {
  --bg: #07170f;
  --felt: #0f5a36;
  --felt-dark: #083a22;
  --wood: #5b3313;
  --gold: #f3c24b;
  --gold-dark: #b8860b;
  --red: #e0413a;
  --txt: #f4f1e6;
  --muted: #9fb8a9;
  --us: #3ddc97;
  --them: #ff6b5e;
  --cw: clamp(54px, 15vw, 88px);
  --radius: 14px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt); font-family: var(--font);
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; }
[hidden] { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* ---------- botões ---------- */
.btn { padding: 12px 22px; border-radius: 12px; font-weight: 800; letter-spacing: .5px;
  transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.96); }
.btn.gold { background: linear-gradient(180deg, #ffd972, var(--gold) 45%, var(--gold-dark));
  color: #2b1a00; box-shadow: 0 4px 0 #7a5600, 0 8px 18px rgba(0,0,0,.35); }
.btn.red { background: linear-gradient(180deg, #ff6a5f, var(--red) 50%, #a3221c); color: #fff;
  box-shadow: 0 4px 0 #6d140f, 0 8px 18px rgba(0,0,0,.35); }
.btn.green { background: linear-gradient(180deg, #57e6a6, #22b673 50%, #137a4b); color: #04220f;
  box-shadow: 0 4px 0 #0b4d2e, 0 8px 18px rgba(0,0,0,.35); }
.btn.ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.btn.big { font-size: 1.15rem; padding: 15px 26px; }
.btn.block { width: 100%; }
.btn:disabled { filter: grayscale(1) brightness(.6); pointer-events: none; }
.link { color: var(--gold); text-decoration: underline; margin-top: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08); font-size: 18px; }

.logo { font-weight: 900; font-size: 3rem; letter-spacing: 2px; color: var(--gold);
  text-shadow: 0 3px 0 #7a5600, 0 10px 30px rgba(243,194,75,.35); line-height: 1; }
.logo span { display: block; font-size: .32em; letter-spacing: 8px; color: var(--txt); text-shadow: none; font-weight: 600; text-align: right; }
.logo.sm { font-size: 1.6rem; }
.logo.sm span { font-size: .38em; letter-spacing: 4px; }

/* ---------- entrar ---------- */
#auth { align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #145f3a 0%, var(--bg) 70%); }
.auth-box { width: min(360px, 90vw); text-align: center; }
.suits-deco { font-size: 1.6rem; letter-spacing: 10px; margin: 14px 0 26px; color: rgba(255,255,255,.4); }
#auth-form { display: flex; flex-direction: column; gap: 12px; }
#auth-form input { padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.35); color: var(--txt); outline: none; }
#auth-form input:focus { border-color: var(--gold); }
.auth-err { color: var(--them); min-height: 1.2em; margin: 0; font-size: .9rem; }

/* ---------- lobby ---------- */
#lobby { background: radial-gradient(ellipse at 50% -10%, #145f3a 0%, var(--bg) 60%); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; }
.top-right { display: flex; gap: 10px; align-items: center; }
.balance-chip { background: rgba(0,0,0,.4); border: 1px solid rgba(243,194,75,.4); border-radius: 12px;
  padding: 5px 14px; text-align: right; }
.balance-chip small { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.balance-chip b { color: var(--gold); font-size: 1.05rem; }
.lobby-main { flex: 1; overflow-y: auto; padding: 0 18px 30px; max-width: 560px; width: 100%; margin: 0 auto; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); margin: 22px 0 10px; }
.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.history li { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); font-size: .9rem; }
.history .w { color: var(--us); font-weight: 700; }
.history .l { color: var(--them); font-weight: 700; }
.muted { color: var(--muted); }

/* cartas */
.card { width: var(--cw); aspect-ratio: 5 / 7; border-radius: calc(var(--cw) * .1); position: relative;
  background: linear-gradient(160deg, #ffffff, #efeae0); color: #1b1b1b;
  box-shadow: 0 2px 0 rgba(0,0,0,.15), 0 6px 14px rgba(0,0,0,.4); flex-shrink: 0; font-weight: 800; }
.card.red { color: #d0261d; }
.card .tl { position: absolute; top: 5%; left: 8%; line-height: .95; font-size: calc(var(--cw) * .24); text-align: center; }
.card .tl i { display: block; font-style: normal; font-size: .8em; }
.card .mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .5); }
.card .br { position: absolute; bottom: 5%; right: 8%; line-height: .95; font-size: calc(var(--cw) * .24); transform: rotate(180deg); text-align: center; }
.card .br i { display: block; font-style: normal; font-size: .8em; }
.card.manilha { background: linear-gradient(160deg, #fffbe8, #f7e3a4); box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0,0,0,.4); }
.card.manilha::after { content: '★'; position: absolute; top: 3%; right: 7%; font-size: calc(var(--cw) * .17); color: var(--gold-dark); }
.card.back { background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 3px, transparent 3px 7px),
    linear-gradient(145deg, #b3261e, #6e0f0a);
  border: calc(var(--cw) * .05) solid #fff; }
.card.hidden-mine { opacity: .75; }
.card.hidden-mine::before { content: 'coberta'; position: absolute; bottom: -1.4em; left: 50%; transform: translateX(-50%);
  font-size: .6rem; color: #fff; white-space: nowrap; }

/* sobreposições */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; }
.modal { background: linear-gradient(180deg, #123d28, #0a2618); border: 2px solid rgba(243,194,75,.5); border-radius: 20px;
  padding: 26px 24px; width: min(360px, 90vw); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.7); animation: pop2 .25s; }
@keyframes pop2 { from { transform: scale(.85); opacity: 0; } }
.modal h2 { margin: 12px 0 4px; }
.modal p { color: var(--muted); margin: 0 0 14px; }
.modal .row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.spinner { font-size: 2.6rem; color: var(--gold); animation: spin 1.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotateY(360deg); } }
.queue-dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.queue-dots i { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.3); display: grid; place-items: center; font-style: normal; }
.queue-dots i.on { border: 2px solid var(--us); background: rgba(61,220,151,.2); }
.end-title { font-size: 2.4rem; font-weight: 900; }
.end-title.win { color: var(--gold); text-shadow: 0 0 30px rgba(243,194,75,.6); }
.end-title.lose { color: var(--them); }
.end-score { font-size: 1.4rem; margin: 6px 0; }
.end-pay { font-size: 1.2rem; font-weight: 700; }
.end-pay.pos { color: var(--us); } .end-pay.neg { color: var(--them); }

.toasts { position: fixed; bottom: calc(env(safe-area-inset-bottom) + 150px); left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: 92vw; }
.toast { background: rgba(0,0,0,.85); border: 1px solid rgba(255,255,255,.15); padding: 8px 16px; border-radius: 20px; font-size: .9rem;
  animation: toast 3s forwards; text-align: center; }
.toast.error { border-color: var(--red); color: #ffb3ad; }
.toast.auto { border-color: var(--gold); color: var(--gold); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.callout { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 70; pointer-events: none;
  font-size: clamp(2.5rem, 12vw, 5rem); font-weight: 900; color: var(--gold); letter-spacing: 3px;
  text-shadow: 0 5px 0 #7a1a12, 0 0 40px rgba(224,65,58,.8); opacity: 0; white-space: nowrap; }
.callout.show { animation: callout 1.3s ease-out; }
@keyframes callout { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.5) rotate(-8deg); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
  75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1.1) rotate(-4deg); } }

/* bônus de cadastro */
.bonus-tag { margin: -8px auto 18px; display: inline-block; padding: 8px 16px; border-radius: 30px; font-weight: 800;
  background: linear-gradient(180deg, rgba(61,220,151,.25), rgba(61,220,151,.1)); border: 1px solid var(--us); color: var(--us);
  animation: pulse 1.8s infinite; }
.bonus-tag b { color: #fff; }
.welcome .gift { font-size: 3.2rem; animation: pop2 .5s; }
.welcome .amount { font-size: 2.4rem; font-weight: 900; color: var(--gold); text-shadow: 0 0 24px rgba(243,194,75,.5); margin: 4px 0 8px; }

/* ---------- lobby no padrão de cards por mesa ---------- */
#lobby { background:
    radial-gradient(ellipse at 50% -20%, rgba(243,194,75,.08), transparent 55%),
    linear-gradient(180deg, #2b3036, #1d2126); }
#lobby .topbar { border-bottom: 1px solid rgba(255,255,255,.06); gap: 12px; flex-wrap: wrap; }
.online-pill { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; font-size: .85rem; }
.online-pill b { color: var(--gold); font-size: 1.05rem; }
.online-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--us); box-shadow: 0 0 10px var(--us); animation: pulse 1.6s infinite; }
.user-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); padding: 5px 12px 5px 5px; border-radius: 30px; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900;
  background: linear-gradient(145deg, #f3c24b, #b8860b); color: #2b1a00; }
.lobby-main { max-width: 1240px; padding: 0 20px 40px; }
.lobby-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 22px 0 6px; }
.lobby-head h1 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 800; }
.mode-pills { display: flex; gap: 8px; }
.pill { padding: 7px 18px; border-radius: 30px; border: 2px solid rgba(255,255,255,.25); font-weight: 700; transition: .15s; }
.pill.sel { background: linear-gradient(180deg, #e6c27a, #b8904a); border-color: #e6c27a; color: #2b1a00; }
.variant { border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; margin-top: 14px; }
.variant-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.variant-title small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.tcard { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; padding: 14px 8px 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: #3a3f45; overflow: hidden;
  background: linear-gradient(180deg, #e9ecee, #9aa1a8);
  box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.6); transition: transform .12s, box-shadow .12s; }
.tcard::before { content: ''; position: absolute; inset: 0; opacity: .18; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.7) 0 2px, transparent 2px 9px); }
.tcard:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,.45); }
.tcard:active { transform: scale(.97); }
.tcard .amt { font-size: clamp(1.25rem, 3.4vw, 1.75rem); font-weight: 800; letter-spacing: -.5px; white-space: nowrap; }
.tcard .sep { width: 86%; border-top: 1px solid rgba(0,0,0,.18); text-align: center; line-height: 0; margin: 4px 0 6px; }
.tcard .sep span { background: inherit; font-size: .62rem; color: rgba(0,0,0,.4); padding: 0 6px; position: relative; top: -1px; }
.tcard .fee { font-size: .9rem; font-weight: 600; }
.tcard .q { display: flex; align-items: center; gap: 5px; background: #3a3f45; color: #fff; border-radius: 20px; padding: 3px 12px; font-weight: 700; font-size: .9rem; }
.tcard .q.hot { background: #1e8a57; }
.tcard.t-green { background: linear-gradient(180deg, #e3eccd, #8cbf45); }
.tcard.t-gold { background: linear-gradient(180deg, #f1e3c4, #b89760); }
.tcard.t-teal { background: linear-gradient(180deg, #d9eef0, #5fb8c2); }
.tcard.locked { filter: grayscale(.7) brightness(.7); }
.tcard .lock { position: absolute; top: 6px; right: 7px; color: rgba(0,0,0,.55); }
.tcard .lock .ico { width: 15px; height: 15px; }
.tcard.queued { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 520px) {
  .tables { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .online-pill { order: 3; width: 100%; justify-content: center; font-size: .75rem; }
  .user-chip b { display: none; }
}
@media (min-width: 1100px) { .tables { grid-template-columns: repeat(10, 1fr); } }

#leave-ov .gift { font-size: 2.6rem; }
.toast.bot { border-color: #8aa; color: #d8f3ff; }
.toast.back { border-color: var(--us); color: var(--us); }

/* ---------- amigos, dupla e convites ---------- */
.party-box { margin-left: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1); border-radius: 40px; padding: 5px 6px 5px 5px; }
.pb-slot { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.05rem; position: relative;
  background: linear-gradient(145deg, #f3c24b, #b8860b); color: #2b1a00; }
.pb-slot.partner { background: linear-gradient(145deg, #3ddc97, #1c8a5a); color: #04220f; }
.pb-slot.partner.off { filter: grayscale(1) brightness(.6); }
.pb-slot.empty { background: rgba(243,194,75,.15); border: 2px dashed var(--gold); color: var(--gold); font-size: 1.4rem; cursor: pointer; }
.pb-slot small { position: absolute; bottom: -15px; font-size: .55rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pb-friends { position: relative; height: 42px; padding: 0 14px; border-radius: 30px; background: rgba(0,0,0,.3); font-weight: 700; font-size: .85rem; }
.pb-friends .badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: .65rem; min-width: 18px; height: 18px;
  border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.party-note { margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(61,220,151,.1); border: 1px solid rgba(61,220,151,.35);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .9rem; }
.party-note button { color: #ffb3ad; font-weight: 700; font-size: .85rem; }
.pill:disabled { opacity: .35; pointer-events: none; }

.drawer-ov { place-items: stretch end; }
.drawer { width: min(380px, 100vw); height: 100%; background: linear-gradient(180deg, #262b31, #1b1f24); border-left: 1px solid rgba(255,255,255,.08);
  padding: calc(env(safe-area-inset-top) + 16px) 16px 20px; overflow-y: auto; animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; }
.add-friend { display: flex; gap: 8px; margin: 16px 0 6px; }
.add-friend input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.35); color: var(--txt); outline: none; }
.add-friend input:focus { border-color: var(--gold); }
.add-friend .btn { padding: 10px 14px; }
.fr-section { margin-top: 18px; }
.fr-section h4 { margin: 0 0 8px; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.fr { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255,255,255,.04); margin-bottom: 6px; }
.fr .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: linear-gradient(145deg, #2c3e50, #1a252f); position: relative; flex-shrink: 0; }
.fr .av i { position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #22272c; background: #666; }
.fr .av i.online { background: var(--us); } .fr .av i.playing, .fr .av i.queue { background: var(--gold); }
.fr .info { flex: 1; min-width: 0; }
.fr .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr .info small { color: var(--muted); font-size: .75rem; }
.fr .acts { display: flex; gap: 6px; }
.fr .acts button { padding: 6px 10px; border-radius: 9px; font-size: .78rem; font-weight: 700; background: rgba(255,255,255,.08); }
.fr .acts .duo { background: rgba(61,220,151,.18); color: var(--us); }
.fr .acts .duel { background: rgba(224,65,58,.18); color: #ffb3ad; }
.fr .acts .ok { background: rgba(61,220,151,.25); color: var(--us); }
.fr .acts .rm { background: none; color: var(--muted); padding: 6px 4px; }
.fr-empty { color: var(--muted); font-size: .88rem; padding: 6px 2px; }

.duel-variants { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.duel-stakes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.duel-stakes button, .duel-variants button { padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-weight: 700; font-size: .85rem; }
.duel-variants button { padding: 8px 14px; }
.duel-stakes button.sel, .duel-variants button.sel { background: var(--gold); color: #2b1a00; border-color: var(--gold); }
.duel-stakes button:disabled { opacity: .3; }
.invite-timer { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.invite-timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
@keyframes shrink { to { transform: scaleX(0); } }
@media (max-width: 520px) {
  .party-box { margin-left: 0; }
  .duel-stakes { grid-template-columns: repeat(4, 1fr); }
}

/* =================== MESA (layout novo) =================== */
#game { background:
    radial-gradient(ellipse at 50% 35%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(180deg, #2b3036, #1b1f24);
  --cw: clamp(48px, 11vw, 74px); }
.g-top { position: relative; display: flex; align-items: flex-start; justify-content: center; padding: 8px 12px 0; gap: 10px; }
.g-score { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.g-title { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .5px; }
.scorepanel { display: flex; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 5px 4px; }
.sp { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 clamp(8px, 3vw, 22px); }
.sp + .sp { border-left: 1px solid rgba(255,255,255,.12); }
.sp small { font-size: .7rem; font-weight: 700; color: #e8e8e8; }
.pips { display: flex; gap: 4px; }
.pips i { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); }
.pips i.w { background: var(--us); border-color: var(--us); }
.pips i.l { background: var(--them); border-color: var(--them); }
.pips i.t { background: #b9b9b9; border-color: #b9b9b9; }
.tentos { min-width: 30px; height: 21px; padding: 0 8px; border-radius: 12px; border: 2px solid #d9b27c; color: #fff; font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
.tentos.hot { background: var(--red); border-color: var(--red); animation: pulse 1s infinite; }
.pontos { display: flex; gap: 4px; }
.pontos b { min-width: 28px; height: 21px; border-radius: 12px; display: grid; place-items: center; font-size: .85rem; color: #fff; padding: 0 6px; }
.pontos .us { background: #1fa971; } .pontos .them { background: #e0413a; }
.pontos b.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.5); } }
.leave-btn { position: absolute; left: 12px; top: 12px; background: rgba(224,65,58,.15); border: 1px solid rgba(224,65,58,.5); color: #ffb3ad;
  border-radius: 10px; padding: 7px 10px; font-weight: 700; font-size: .8rem; }
.g-prize { position: absolute; right: 12px; top: 10px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.35);
  border: 1px solid rgba(243,194,75,.35); border-radius: 12px; padding: 4px 10px; }
.g-prize span { font-size: 1.2rem; }
.g-prize small { display: block; font-size: .58rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.g-prize b { color: var(--gold); font-size: .95rem; }

/* mesa retangular com borda de madeira e leve perspectiva */
.table-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px clamp(10px, 4vw, 40px) 4px; }
.felt { position: relative; width: 100%; max-width: 860px; height: 100%; max-height: 470px; }
.felt-bg { position: absolute; inset: 0; border-radius: 34px; transform: perspective(1100px) rotateX(14deg); transform-origin: 50% 100%;
  background: radial-gradient(ellipse at 50% 40%, #3f9b64 0%, #2a7a4b 45%, #1c5c37 100%);
  border: clamp(10px, 2.2vw, 18px) solid #c99b62;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 6px 30px rgba(0,0,0,.45),
    0 0 0 3px #8c6538, 0 3px 0 5px #6f4d27, 0 26px 50px rgba(0,0,0,.55); }
.felt-bg::after { content: ''; position: absolute; inset: 0; border-radius: 22px; opacity: .08;
  background: repeating-radial-gradient(circle at 50% 50%, #000 0 1px, transparent 1px 3px); }

/* assentos */
.seat { position: absolute; z-index: 4; }
.seat-inner { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#seat-top { top: 0; left: 50%; transform: translate(-50%, -34%); }
.mode1 #seat-top { left: 9%; transform: translate(-30%, -34%); }
.mode1 #seat-top .seat-inner { flex-direction: row; align-items: flex-start; gap: 6px; }
.mode1 #seat-top .who { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#seat-left { left: 0; top: 46%; transform: translate(-28%, -50%); }
#seat-right { right: 0; top: 46%; transform: translate(28%, -50%); }
.who { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.avatar { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.3rem;
  background: linear-gradient(145deg, #3a4a5c, #1f2a36); border: 3px solid rgba(255,255,255,.3); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.avatar img, .avatar-sm img, .pb-slot img, .fr .av img, .queue-dots img, .profile-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.team-us .avatar { border-color: var(--us); }
.team-them .avatar { border-color: var(--them); }
.avatar .ring { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); display: none; }
.avatar .ring circle { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 188.5; }
.seat.active .ring { display: block; }
@keyframes ring { to { stroke-dashoffset: 188.5; } }
.secs { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; font-size: .68rem; font-weight: 800;
  padding: 1px 7px; border-radius: 10px; z-index: 2; white-space: nowrap; }
.secs.low { background: var(--red); }
.dealer { position: absolute; bottom: -3px; left: -5px; background: #fff; color: #222; font-size: .6rem; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 900; z-index: 2; }
.seat .name { font-size: .74rem; font-weight: 700; background: rgba(0,0,0,.55); padding: 2px 9px; border-radius: 10px; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .status { font-size: .6rem; font-weight: 800; text-transform: uppercase; padding: 1px 7px; border-radius: 8px; }
.seat .status.offline { background: var(--red); color: #fff; }
.seat .status.inactive { background: #7a6a2a; color: #ffe9a8; }
.seat .status.left { background: #444; color: #ddd; }
.seat.bot .avatar img, .seat.bot .avatar > .ini { filter: grayscale(.8) brightness(.7); }
.bot-badge { position: absolute; bottom: -5px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: #20303c; color: #9fe3ff;
  display: grid; place-items: center; border: 2px solid #1b1f24; filter: none; }
.bot-badge .ico { width: 13px; height: 13px; }
.backs { display: flex; margin-top: 6px; }
.backs .card { --cw: 18px; margin-left: -6px; }
.backs .card:first-child { margin-left: 0; }

/* balões de fala e reações */
.bubble-slot { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; pointer-events: none; z-index: 8; }
.mode1 #seat-top .bubble-slot, #seat-left .bubble-slot { left: 100%; bottom: auto; top: 0; transform: none; margin: 0 0 0 8px; }
#seat-right .bubble-slot { left: auto; right: 100%; bottom: auto; top: 0; transform: none; margin: 0 8px 0 0; }
#seat-top .bubble-slot { bottom: auto; top: 100%; margin: 8px 0 0; }
.bubble { background: #fff; color: #222; font-weight: 700; font-size: .85rem; padding: 7px 12px; border-radius: 14px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: bub 2.8s forwards; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.bubble.truco { background: var(--red); color: #fff; font-size: 1rem; letter-spacing: 1px; }
.bubble.accept { background: #1fa971; color: #fff; }
.bubble.run { background: #555; color: #fff; }
.bubble.bot, .bubble.auto { background: #20303c; color: #d8f3ff; font-size: .75rem; }
.bubble.back { background: #1fa971; color: #fff; font-size: .75rem; }
.bubble.emoji { background: none; box-shadow: none; font-size: 2.6rem; padding: 0; }
@keyframes bub { 0% { opacity: 0; transform: scale(.6); } 8% { opacity: 1; transform: scale(1.05); } 14% { transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* centro */
.vira-box { position: absolute; left: 14%; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; z-index: 2; }
.vira-box .card { --cw: clamp(36px, 7.5vw, 54px); transform: rotate(-8deg); }
.vira-box small { font-size: .6rem; letter-spacing: 2px; color: rgba(255,255,255,.65); text-transform: uppercase; }
.manilha-tag { font-size: .66rem; background: rgba(0,0,0,.45); padding: 1px 7px; border-radius: 8px; color: var(--gold); white-space: nowrap; }
.trick { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); width: calc(var(--cw) * 3); height: calc(var(--cw) * 2.9); z-index: 3; }
.slot { position: absolute; }
.s-bottom { left: 50%; bottom: 0; transform: translateX(-50%); }
.s-top { left: 50%; top: 0; transform: translateX(-50%); }
.s-left { left: 0; top: 50%; transform: translateY(-50%); }
.s-right { right: 0; top: 50%; transform: translateY(-50%); }
.mode1 .trick { width: calc(var(--cw) * 2.3); height: calc(var(--cw) * 1.6); }
.mode1 .s-top { left: 0; top: 50%; transform: translateY(-50%) rotate(-4deg); }
.mode1 .s-bottom { left: auto; right: 0; bottom: auto; top: 50%; transform: translateY(-50%) rotate(4deg); }
.slot .card { --cw: clamp(44px, 10vw, 68px); }
.slot .card.win { box-shadow: 0 0 0 3px var(--gold), 0 0 24px 6px rgba(243,194,75,.7); z-index: 2; }
.slot .card.lose { filter: brightness(.55); }
.s-bottom .card.enter { animation: from-bottom .28s ease-out; }
.s-top .card.enter { animation: from-top .28s ease-out; }
.s-left .card.enter { animation: from-left .28s ease-out; }
.s-right .card.enter { animation: from-right .28s ease-out; }
@keyframes from-bottom { from { transform: translateY(140%) scale(1.2); opacity: 0; } }
@keyframes from-top { from { transform: translateY(-140%) scale(.8); opacity: 0; } }
@keyframes from-left { from { transform: translateX(-140%) scale(.8); opacity: 0; } }
@keyframes from-right { from { transform: translateX(140%) scale(.8); opacity: 0; } }
.info-pill { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); z-index: 5; background: rgba(0,0,0,.72); color: #fff;
  padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: .88rem; text-align: center; max-width: 86%; animation: pop2 .2s; }
.info-pill b.g { color: var(--us); } .info-pill b.r { color: var(--them); }

/* painel de decisão (truco, mão de onze...) — mostra a vira, a mesa e a sua mão */
.panel { position: absolute; inset: 6% 5%; z-index: 7; background: rgba(26,48,36,.94); border: 1px solid rgba(255,255,255,.12); border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: pop2 .2s; overflow: auto; }
.panel h2 { margin: 0; font-size: clamp(1.8rem, 7vw, 3rem); font-weight: 900; letter-spacing: 3px; color: #e9cf8e;
  text-shadow: 0 3px 0 rgba(0,0,0,.35); line-height: 1; }
.panel h2.red { color: #ff8a7f; } .panel h2.green { color: #6ee7b0; }
.panel .sub { font-size: 1rem; font-weight: 700; }
.panel .sub em { font-style: normal; color: var(--us); } .panel .sub i { font-style: normal; color: #e9cf8e; }
.pbar { width: min(420px, 90%); height: 4px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.pbar i { display: block; height: 100%; background: #d9b27c; transform-origin: left; }
.pcards { display: flex; gap: clamp(10px, 4vw, 34px); flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.pc { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pc small { color: rgba(255,255,255,.6); font-size: .75rem; }
.pc .row-cards { display: flex; }
.pc .card { --cw: clamp(34px, 8vw, 52px); }
.pc .row-cards .card + .card { margin-left: -10px; }
.panel .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.panel .btn { padding: 10px 18px; }

/* minha área */
.me-area { position: relative; display: flex; justify-content: center; align-items: flex-end; padding: 4px 12px 0; min-height: calc(var(--cw) * 1.35 + 8px); }
.hand { display: flex; gap: 8px; justify-content: center; align-items: flex-end; }
.hand .card { --cw: clamp(60px, 17vw, 88px); transition: transform .15s, box-shadow .15s; }
.hand.myturn .card { cursor: pointer; }
.hand.myturn .card:hover { transform: translateY(-10px); }
.hand.myturn .card:active { transform: translateY(-16px) scale(1.04); }
.hand:not(.myturn) .card { filter: brightness(.8); }
.seat.me { position: absolute; right: clamp(8px, 4vw, 40px); bottom: 0; z-index: 4; }
.seat.me .avatar { width: 50px; height: 50px; }
.chat-btn { position: absolute; top: -6px; right: -10px; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #222; font-size: .8rem;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); z-index: 3; }
.seat.me .bubble-slot { left: auto; right: 0; transform: none; }

/* botões de ação */
.action-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 12px); min-height: 70px; }
.abtn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 12px; font-weight: 800; font-size: 1.05rem;
  transition: transform .08s; }
.abtn:active { transform: scale(.96); }
.abtn:disabled { opacity: .35; pointer-events: none; }
.abtn.run { background: linear-gradient(180deg, #5d646d, #454b52); box-shadow: 0 4px 0 #2d3136; justify-self: start; min-width: 120px; }
.abtn.truco { background: linear-gradient(180deg, #ecd3a5, #c9a468); color: #3a2a10; box-shadow: 0 4px 0 #8c6a33; justify-self: end; min-width: 120px; }
.abtn.flip { background: linear-gradient(180deg, #7ad7e6, #3fb3c7); color: #0d3440; box-shadow: 0 4px 0 #237282; padding: 11px 14px; font-size: .92rem; }
.abtn.flip.on { background: linear-gradient(180deg, #ffd972, var(--gold)); color: #2b1a00; box-shadow: 0 4px 0 #7a5600; }
.turn-txt { color: var(--muted); font-size: .9rem; text-align: center; }

/* chat */
.chat-pop { position: fixed; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 140px); width: min(320px, calc(100vw - 24px)); max-height: 55vh;
  background: #2c3238; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; z-index: 40; display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: pop2 .18s; }
.chat-pop header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.08); font-weight: 800; }
.chat-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.chat-list button { background: #454c54; border-radius: 10px; padding: 9px; font-weight: 600; }
.chat-emojis { display: flex; justify-content: space-around; padding: 8px; border-top: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.chat-emojis button { font-size: 1.7rem; padding: 2px 4px; }

/* perfil */
.user-chip { cursor: pointer; }
.profile-photo { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; font-size: 2.6rem; font-weight: 900;
  background: linear-gradient(145deg, #f3c24b, #b8860b); color: #2b1a00; border: 3px solid var(--gold); }
.queue-dots i { width: 46px; height: 46px; overflow: hidden; font-size: 1.1rem; font-weight: 800; }

@media (max-width: 560px) {
  .felt { max-height: none; }
  .felt-bg { border-radius: 26px; transform: perspective(700px) rotateX(10deg); }
  .avatar { width: 44px; height: 44px; font-size: 1.05rem; }
  .seat.me .avatar { width: 42px; height: 42px; }
  .vira-box { left: 8%; }
  .abtn { padding: 11px 12px; font-size: .95rem; }
  .abtn.run, .abtn.truco { min-width: 96px; }
  .g-prize { padding: 3px 7px; } .g-prize span { display: none; }
  .leave-btn { padding: 6px 8px; font-size: .72rem; }
  .sp { padding: 0 7px; }
  .panel { inset: 3% 2%; }
}
@media (max-height: 640px) {
  #game { --cw: clamp(40px, 9vh, 60px); }
  .hand .card { --cw: clamp(52px, 13vh, 76px); }
}

/* ícones */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex-shrink: 0; }
.pill, .pb-friends, .leave-btn, .abtn, .btn, .variant-title, .party-note span, .tcard .q { display: inline-flex; align-items: center; gap: 6px; }
.btn { justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; }
.icon-btn .ico { width: 18px; height: 18px; }
.gift .ico, #invite-icon .ico { width: 44px; height: 44px; color: var(--gold); }
.panel h2 .ico { width: 1em; height: 1em; }
.g-prize span .ico { width: 22px; height: 22px; color: var(--gold); }
.chat-btn .ico { width: 14px; height: 14px; }
.chat-pop header { gap: 8px; } .chat-pop header button { margin-left: auto; display: grid; }
.toast { display: flex; align-items: center; gap: 8px; }
.toast .ico { width: 16px; height: 16px; }
.toast.offline, .toast.inactive { border-color: #8aa; color: #d8f3ff; }
.bubble { display: inline-flex; align-items: center; gap: 6px; }
.bubble .ico { width: 15px; height: 15px; }
.bubble.offline, .bubble.inactive, .bubble.info { background: #20303c; color: #d8f3ff; font-size: .75rem; }
.fr .acts .rm .ico { width: 16px; height: 16px; }
.bonus-tag { display: inline-flex; align-items: center; gap: 8px; }

/* carteira */
.balance-chip { cursor: pointer; }
.withdraw-btn { padding: 9px 14px; font-size: .9rem; }
@media (max-width: 520px) { .withdraw-btn span { display: none; } .withdraw-btn { padding: 9px 10px; } }
.modal.wallet { width: min(440px, 94vw); max-height: 90vh; overflow-y: auto; text-align: left; padding: 18px; }
.w-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.w-head small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; }
.w-head b { font-size: 1.9rem; color: var(--gold); }
.w-sec { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 12px; }
.w-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.w-form { display: flex; flex-direction: column; gap: 8px; }
.w-form input { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(0,0,0,.35); color: var(--txt); outline: none; width: 100%; }
.w-form input:focus { border-color: var(--gold); }
.w-form .row { display: flex; gap: 8px; }
.w-hint { margin: 0; font-size: .78rem; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: rgba(0,0,0,.3); padding: 4px; border-radius: 10px; }
.seg button { padding: 8px 4px; border-radius: 8px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.seg button.sel { background: var(--gold); color: #2b1a00; }
.pix-card { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px; }
.pix-card .ico { width: 26px; height: 26px; color: #32bcad; }
.pix-card div { flex: 1; min-width: 0; }
.pix-card b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pix-card small { color: var(--muted); }
.pix-card button { color: var(--gold); font-weight: 700; font-size: .85rem; }
.money-in { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 0 12px; }
.money-in span { color: var(--muted); font-weight: 700; }
.money-in input { border: 0 !important; background: none !important; padding: 12px 0 !important; font-size: 1.2rem; font-weight: 800; }
.money-in .link { white-space: nowrap; margin: 0; font-size: .8rem; }
.w-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.w-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); font-size: .88rem; }
.w-list small { display: block; color: var(--muted); font-size: .74rem; }
.badge-st { font-size: .7rem; font-weight: 800; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; white-space: nowrap; }
.badge-st.pending { background: rgba(243,194,75,.18); color: var(--gold); }
.badge-st.paid { background: rgba(61,220,151,.18); color: var(--us); }
.badge-st.rejected { background: rgba(224,65,58,.18); color: #ffb3ad; }

/* encaixe: mão encosta na borda da mesa (como no padrão de referência) */
.felt { max-height: 560px; }
.table-wrap { padding-bottom: 0; }
.me-area { margin-top: -26px; z-index: 6; }
.seat.me .status { display: none; }
@media (max-width: 560px) {
  .felt { max-height: 520px; }
  .me-area { margin-top: -18px; }
}

/* depósito e bônus travado */
.w-lock { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(243,194,75,.1); border: 1px solid rgba(243,194,75,.3);
  font-size: .85rem; display: flex; gap: 8px; align-items: flex-start; }
.w-lock .ico { color: var(--gold); margin-top: 2px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chips button { padding: 9px 4px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-weight: 800; }
.chips button:hover { border-color: var(--gold); }
.dep-box { background: rgba(50,188,173,.08); border: 1px solid rgba(50,188,173,.35); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.dep-box .amt { font-size: 1.5rem; font-weight: 900; color: #5fe0d1; }
.dep-box .kv { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.3); border-radius: 8px; padding: 8px 10px; }
.dep-box .kv div { flex: 1; min-width: 0; }
.dep-box .kv small { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; }
.dep-box .kv b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-box .kv button { color: var(--gold); display: grid; place-items: center; padding: 4px; }
.dep-box .steps { margin: 0; padding-left: 18px; font-size: .82rem; color: var(--muted); }
.dep-box .foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.dep-box .foot button { color: #ffb3ad; font-weight: 700; }
.badge-st.approved { background: rgba(61,220,151,.18); color: var(--us); }
.badge-st.canceled { background: rgba(255,255,255,.08); color: var(--muted); }

/* valores: entrada e ganho */
.tcard .fee.sm { font-size: .72rem; font-weight: 600; opacity: .75; margin-top: -4px; }
.end-pay small { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); margin-top: 4px; }

/* app instalado (PWA) */
html, body { overscroll-behavior: none; }
body { -webkit-touch-callout: none; }
.install-btn { background: rgba(243,194,75,.15); color: var(--gold); }
.app-ico { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.ios-steps { text-align: left; margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.ios-share { display: inline-block; width: 16px; height: 20px; vertical-align: -4px; border: 2px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.ios-share::before { content: ''; position: absolute; left: 50%; top: -9px; width: 2px; height: 14px; background: currentColor; transform: translateX(-50%); }
.ios-share::after { content: ''; position: absolute; left: 50%; top: -9px; width: 7px; height: 7px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: translateX(-50%) rotate(45deg); }
@media (display-mode: standalone) { .install-btn { display: none !important; } }

/* ===== cor única do app (tema = fundo) e altura correta no iPhone instalado ===== */
:root { --app-top: #2b3036; --app-bottom: #1b1f24; --bg: #1b1f24; }
html, body { background: var(--app-bottom); }
/* todas as telas usam o mesmo degradê: topo = cor do tema (barra de status), base = barra de navegação */
#auth, #lobby, #game {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(63,160,106,.16), transparent 60%),
    linear-gradient(180deg, var(--app-top), var(--app-bottom));
}
#auth { background:
    radial-gradient(ellipse at 50% 32%, rgba(63,160,106,.28), transparent 62%),
    linear-gradient(180deg, var(--app-top), var(--app-bottom)); }
/* iOS em modo app às vezes calcula a altura errada depois de atualizar: usamos a altura real medida pelo JS */
.screen { inset: auto; top: 0; left: 0; right: 0; height: var(--app-h, 100dvh); }

.install-btn { padding: 9px 12px; font-size: .85rem; border-radius: 10px; }
@media (max-width: 520px) { .install-btn span { display: none; } }
.modal.install { text-align: center; }
.inst-opt { text-align: left; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.inst-opt h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* Menu do lobby no celular; o conteúdo rola no espaço acima da navegação. */
.mobile-nav { display: none; }
@media (max-width: 760px) {
  #lobby { padding-bottom: 0; }
  #lobby .topbar { flex-shrink: 0; padding: 12px 14px 10px; gap: 8px; }
  #lobby .top-right { gap: 6px; margin-left: auto; }
  #lobby .user-chip, #lobby .withdraw-btn { display: none; }
  #lobby .top-right .icon-btn, #lobby .install-btn { min-width: 44px; min-height: 44px; }
  #lobby .install-btn { padding: 10px; justify-content: center; }
  #lobby .install-btn span { display: none; }
  #lobby .balance-chip { min-height: 44px; padding: 5px 10px; }
  #lobby .online-pill { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; gap: 5px; font-size: .65rem; }
  #lobby .online-pill b { font-size: .85rem; }
  #lobby .lobby-main { min-height: 0; padding: 0 14px 24px; overscroll-behavior-y: contain; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex-shrink: 0;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom)); gap: 4px;
    background: #202a2b; border-top: 1px solid rgba(243,194,75,.18);
    box-shadow: 0 -8px 24px rgba(0,0,0,.16);
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; min-width: 0; min-height: 56px; padding: 2px 4px; border-radius: 12px;
    color: #b6c3bc; font-size: .72rem; font-weight: 600; touch-action: manipulation;
  }
  .mobile-nav-icon {
    position: relative; display: grid; place-items: center; width: 52px; height: 30px;
    border-radius: 12px; transition: background-color .15s, color .15s;
  }
  .mobile-nav-icon > .ico { width: 22px; height: 22px; }
  .mobile-nav-item[aria-current], .mobile-nav-item[aria-expanded="true"] { color: var(--gold); }
  .mobile-nav-item[aria-current] .mobile-nav-icon, .mobile-nav-item[aria-expanded="true"] .mobile-nav-icon {
    color: #2b1a00; background: var(--gold); box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
  }
  .mobile-nav-item:active { background: rgba(243,194,75,.1); }
  .mobile-nav-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
  .mobile-nav-avatar {
    display: grid; place-items: center; width: 24px; height: 24px; overflow: hidden;
    border-radius: 50%; background: #d5b465; color: #2b1a00; font-size: .8rem; font-weight: 800;
  }
  .mobile-nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .mobile-nav-badge {
    position: absolute; top: -3px; right: 1px; display: grid; place-items: center;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 10px;
    background: #b8322c; color: #fff; border: 2px solid #202a2b; font-size: .55rem; font-weight: 800;
  }
}
@media (prefers-reduced-motion: reduce) { .mobile-nav-icon { transition: none; } }

/* Duplas no celular: manilha no canto superior e espaço próprio para cada assento. */
@media (max-width: 760px) and (orientation: portrait) {
  #game[data-mode="2"] .g-top { flex-shrink: 0; padding-top: 46px; }
  #game[data-mode="2"] .g-title { font-size: .66rem; }
  #game[data-mode="2"] .table-wrap { align-items: stretch; padding: 76px 24px 0; }
  #game[data-mode="2"] .felt { max-height: none; }
  #game[data-mode="2"] #seat-top { transform: translate(-50%, -72%); }
  #game[data-mode="2"] #seat-left { left: -16px; top: 52%; transform: translateY(-50%); }
  #game[data-mode="2"] #seat-right { right: -16px; top: 52%; transform: translateY(-50%); }
  #game[data-mode="2"] .seat .name { max-width: 80px; padding: 2px 6px; font-size: .7rem; }
  #game[data-mode="2"] .vira-box { left: 18px; top: -8px; transform: none; gap: 2px; }
  #game[data-mode="2"] .vira-box .card { --cw: clamp(30px, 7.5vw, 42px); }
  #game[data-mode="2"] .vira-box small { font-size: .5rem; }
  #game[data-mode="2"] .manilha-tag { font-size: .58rem; padding: 2px 5px; }
  #game[data-mode="2"] .trick { top: 56%; width: calc(var(--cw) * 2.6); height: calc(var(--cw) * 2.9); }
  #game[data-mode="2"] .me-area { flex-shrink: 0; margin-top: -12px; padding: 4px 76px 0 12px; }
  #game[data-mode="2"] .hand { gap: 6px; }
  #game[data-mode="2"] .hand .card { --cw: clamp(48px, 15vw, 76px); }
  #game[data-mode="2"] .seat.me { right: 12px; }
  #game[data-mode="2"] .action-bar { flex-shrink: 0; gap: 6px; padding-left: 10px; padding-right: 10px; }
  #game[data-mode="2"] .abtn { min-width: 0; gap: 4px; padding: 11px 9px; font-size: .85rem; }
  #game[data-mode="2"] .turn-txt { min-width: 0; font-size: .75rem; overflow-wrap: anywhere; }
}
.modal.install > .btn { margin-top: 14px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
