:root {
  --bg: #0b1322;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #eef2f7;
  --muted: #a7b2c5;
  --accent: #f3b63b;
  --accent-dark: #c98f14;
  --green: #2fbf71;
  --red: #ff5c6c;
  --blue: #4f8cff;
  --felt1: #2f9d66;
  --felt2: #1f7a4b;
  --felt3: #0d3b27;
  --radius: 6px;
  --font: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --display: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --hand-w: clamp(70px, 7.2vw, 108px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 15% 10%, #1a2f4f 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 95%, #123a2a 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--display); margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.4em; margin: 10px 0 0; font-weight: 600; }

/* telas respeitam o notch e a barra de gestos (viewport-fit=cover) */
.screen {
  position: fixed; inset: 0; display: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; align-items: center; justify-content: center; }

/* ---------- botões ---------- */
.btn {
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #ffcc5c, var(--accent));
  color: #3d2a00;
  box-shadow: 0 8px 20px rgba(243, 182, 59, 0.3);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffd674, #f7bd45); }
.btn-xl { font-size: 1.6rem; padding: 18px 64px; border-radius: 4px; letter-spacing: 1px; font-family: var(--display); }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.top-actions {
  position: fixed; z-index: 80; display: flex; align-items: center; gap: 8px;
  top: calc(10px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
}
@media (display-mode: fullscreen), (display-mode: standalone) { #btn-fullscreen { display: none; } }
.btn-icon {
  width: 40px; height: 40px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 1.1rem;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.lang-switch {
  display: inline-flex; height: 40px; padding: 4px; gap: 3px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(255, 255, 255, 0.04);
}
.lang-switch button {
  border: 0; border-radius: 4px; padding: 0 13px; background: transparent;
  color: var(--muted); font-size: 0.9rem; font-weight: 800; letter-spacing: 0.5px;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--accent); color: #3d2a00; }

/* ---------- painéis ---------- */
.panel {
  width: min(92vw, 560px);
  background: rgba(16, 24, 40, 0.82);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
 
}
.panel-sm { text-align: center; }
.panel h2 { font-size: 1.7rem; margin-bottom: 16px; }

/* ---------- tela 1 ---------- */
#screen-splash { overflow: hidden; }
.splash-bg { position: absolute; inset: 0; pointer-events: none; }
.float-card {
  position: absolute;
  width: clamp(90px, 10vw, 150px);
  opacity: 0.8;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
  animation: floaty 7s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -1.3s);
  transform: rotate(var(--rot));
}
@keyframes floaty {
  from { transform: translateY(0) rotate(var(--rot)); }
  to { transform: translateY(-28px) rotate(calc(var(--rot) + 6deg)); }
}
.splash-content { position: relative; text-align: center; z-index: 1; }
.logo {
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.logo span, .logo-small span {
  background: linear-gradient(180deg, #ffe08a, var(--accent) 60%, #d99a1f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--muted); font-size: 1.15rem; margin: 14px 0 34px; }
.splash-foot { color: var(--muted); margin-top: 26px; font-size: 0.9rem; }

/* ---------- tela 2 ---------- */
#name-form { display: flex; gap: 10px; }
#name-input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1.1rem; font-weight: 700;
  padding: 12px 16px; border-radius: 6px;
  border: 2px solid var(--panel-border); background: rgba(0, 0, 0, 0.3); color: var(--text);
  outline: none;
}
#name-input:focus { border-color: var(--accent); }
#btn-back-splash { margin-top: 14px; }

/* ---------- tela 3 ---------- */
/* criar ou entrar numa sala */
.panel-rooms h2 { margin-bottom: 4px; }
.rooms-sub { margin: 0 0 18px; min-height: 1.2em; }
.rooms-choice { display: flex; flex-direction: column; gap: 12px; }
.rooms-choice .btn { width: 100%; padding: 16px; font-size: 1.1rem; }
.create-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.create-form .btn { margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.field small { font-weight: 600; }
.field input, .room-pw input {
  font: inherit; font-size: 1rem; font-weight: 700;
  padding: 11px 14px; border-radius: 6px; min-width: 0;
  border: 2px solid var(--panel-border); background: rgba(0, 0, 0, 0.3); color: var(--text);
  outline: none;
}
.field input:focus, .room-pw input:focus { border-color: var(--accent); }
.room-list {
  list-style: none; margin: 0; padding: 0; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  max-height: min(50vh, 420px); overflow-y: auto;
}
.room-list li { border: 1px solid var(--panel-border); border-radius: 6px; background: rgba(0, 0, 0, 0.22); }
.room-list li.open { border-color: var(--accent); }
.room-list li.open.del { border-color: var(--red); }
.room-row { display: flex; align-items: stretch; }
.room-row .room-item { flex: 1; min-width: 0; }
.room-del {
  flex: none; width: 46px; border: 0; border-left: 1px solid var(--panel-border);
  background: transparent; color: var(--muted); font-size: 1rem; opacity: 0.6;
}
.room-del:hover { opacity: 1; background: rgba(255, 92, 108, 0.14); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #ff7482; }
.room-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 0; background: transparent; color: var(--text); text-align: left;
}
.room-item:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); }
.room-item:disabled { opacity: 0.5; cursor: not-allowed; }
.room-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-lock { margin-right: 6px; }
.room-meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.room-pw { display: flex; gap: 8px; padding: 0 14px 12px; }
.room-pw input { flex: 1; }
.room-empty { margin: 8px 0; }
#btn-back-rooms { margin-top: 14px; }

/* ---------- tela 4 ---------- */
/* Lobby: dois passos lado a lado (1. baralho, 2. sala) e a ação principal fixa no rodapé */
.panel-lobby {
  width: min(96vw, 1060px); max-height: 94vh; max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  padding: 22px 24px 0; display: flex; flex-direction: column;
}
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.lobby-head h2 { margin-bottom: 2px; }
.lobby-head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn-ghost-danger:hover:not(:disabled) { color: var(--red); }
.lobby-delete {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 10px 12px; border-radius: 6px;
  border: 1px solid var(--red); background: rgba(255, 92, 108, 0.08);
}
.lobby-delete-text { flex: 1 1 220px; font-weight: 700; }
.lobby-delete input {
  flex: 1 1 180px; min-width: 0; font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 6px;
  border: 2px solid var(--panel-border); background: rgba(0, 0, 0, 0.3); color: var(--text); outline: none;
}
.lobby-delete input:focus { border-color: var(--red); }
.lobby-delete .error { flex-basis: 100%; margin: 0; min-height: 0; }
.lobby-delete .error:empty { display: none; }
.lobby-steal { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lobby-steal input:focus { border-color: var(--accent); }
.lobby-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lobby-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 6px; padding: 16px; min-width: 0; }
.sec-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 0 0 12px; }
.step-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #3d2a00; font-family: var(--font); font-size: 0.78rem; font-weight: 900;
}

/* baralho escolhido em destaque, com os poderes explicados ao lado (proximidade) */
.deck-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center;
  padding: 14px 16px; margin-bottom: 14px; border-radius: 6px;
  background: radial-gradient(ellipse at 20% 40%, rgba(243, 182, 59, 0.12), transparent 60%), rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(243, 182, 59, 0.25);
}
.hero-cards { position: relative; width: 146px; height: 132px; flex: none; }
.hero-cards .hc { position: absolute; width: 72px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.hero-cards .hc.back { left: 0; top: 18px; transform: rotate(-11deg); }
.hero-cards .hc.f1 { left: 37px; top: 4px; transform: rotate(1deg); z-index: 1; }
.hero-cards .hc.f2 { left: 74px; top: 18px; transform: rotate(12deg); z-index: 2; }
.hero-info { min-width: 0; }
.hero-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--display); font-size: 1.45rem; line-height: 1.1; }
.hero-badge {
  font-family: var(--font); font-size: 0.62rem; font-weight: 900; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--green); background: rgba(47, 191, 113, 0.14); padding: 2px 8px; border-radius: 4px;
}
.power-cards { display: grid; gap: 7px; margin-top: 10px; }
.power-card {
  --pc: var(--accent);
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 8px 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.28); border-left: 3px solid var(--pc);
}
.power-card.global { --pc: #5aa8ff; }
.pc-icon { font-size: 1.35rem; line-height: 1.2; text-align: center; }
.pc-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pc-head b { font-size: 0.92rem; }
.pc-tag { font-size: 0.58rem; font-weight: 900; letter-spacing: 0.6px; text-transform: uppercase; color: var(--pc); }
.power-card p { margin: 2px 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.hero-note { margin: 8px 0 0; font-size: 0.74rem; color: #ffb08a; }

.lobby-share { margin: 12px 0 0; font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.lobby-share b { color: var(--accent); user-select: all; -webkit-user-select: all; }
.banner { background: rgba(79, 140, 255, 0.15); border: 1px solid rgba(79, 140, 255, 0.4); padding: 10px 14px; border-radius: 5px; margin-bottom: 14px; font-weight: 600; }
.player-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.player-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06);
}
.player-list li.me { border-color: rgba(243, 182, 59, 0.45); background: rgba(243, 182, 59, 0.06); }
.player-list .pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.player-list .pname { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-list .pdeck { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.player-list .pskin { width: 14px; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.player-list .status { flex: none; font-size: 0.75rem; font-weight: 800; padding: 3px 9px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.player-list .status.ready { background: rgba(47, 191, 113, 0.18); color: var(--green); }
.player-list .status.leader { background: rgba(243, 182, 59, 0.18); color: var(--accent); }
.player-list .status.off { background: rgba(255, 92, 108, 0.18); color: var(--red); }
.player-list .status.bot { background: rgba(79, 140, 255, 0.16); color: #9cc0ff; }
.bot-kind { flex: none; display: inline-flex; gap: 2px; padding: 2px; border-radius: 4px; background: rgba(0, 0, 0, 0.3); }
.bot-kind button {
  border: 0; border-radius: 3px; padding: 3px 7px; background: transparent;
  color: var(--muted); font-size: 0.72rem; font-weight: 800; white-space: nowrap;
}
.bot-kind button.active { background: var(--blue); color: #fff; }
.bot-remove {
  flex: none; width: 26px; height: 26px; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); font-weight: 900;
}
.bot-remove:hover { background: rgba(255, 92, 108, 0.16); color: var(--red); }
.deck-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.deck-head .sec-title { margin-bottom: 0; }
.deck-set button { padding: 4px 12px; font-size: 0.8rem; }
.bot-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.bot-controls .settings-label { margin-right: auto; }
.bot-note { flex-basis: 100%; font-size: 0.78rem; }
.avatar {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-family: var(--display);
  background: linear-gradient(135deg, hsl(var(--hue) 70% 55%), hsl(calc(var(--hue) + 40) 70% 42%));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.crown { font-size: 0.95rem; margin-left: 4px; }
.lobby-settings {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 5px; background: rgba(0, 0, 0, 0.2);
}
.settings-text { display: flex; flex-direction: column; line-height: 1.25; }
.settings-label { font-weight: 800; color: var(--text); }
.settings-text small { font-size: 0.72rem; }
.segmented { display: inline-flex; background: rgba(0, 0, 0, 0.3); border-radius: 5px; padding: 4px; gap: 4px; }
.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 4px; padding: 6px 14px; font-weight: 800; }
.segmented button.active { background: var(--accent); color: #3d2a00; }
.segmented button:disabled { cursor: default; }

/* vidas: número livre, com − e + */
.lives-stepper { display: inline-flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, 0.3); border-radius: 5px; padding: 4px; }
.lives-stepper .step {
  width: 34px; height: 34px; border: 0; border-radius: 4px; font-size: 1.2rem; font-weight: 900; line-height: 1;
  background: rgba(255, 255, 255, 0.08); color: var(--text);
}
.lives-stepper .step:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.lives-stepper .step:disabled { opacity: 0.35; cursor: default; }
.lives-field { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; color: #ff6b7a; font-weight: 900; }
#lives-input {
  width: 46px; padding: 6px 2px; border: 0; border-radius: 8px; text-align: center;
  font: inherit; font-family: var(--display); font-size: 1.1rem; font-weight: 700;
  background: transparent; color: var(--text); -moz-appearance: textfield; appearance: textfield;
}
#lives-input::-webkit-outer-spin-button, #lives-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#lives-input:focus { outline: 2px solid var(--accent); background: rgba(0, 0, 0, 0.3); }
#lives-input:disabled { color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }

/* grade de baralhos: só o verso + nome; o selecionado ganha borda dourada e ✓ */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.skin-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.04); border: 2px solid transparent;
  color: var(--text); font-weight: 800; font-size: 0.74rem; line-height: 1.15; text-align: center;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.skin-tile:hover:not(:disabled) { transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); }
.skin-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skin-tile .tile-art { width: 46px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); transition: transform 0.15s ease; }
.skin-tile:hover .tile-art { transform: rotate(-4deg) scale(1.04); }
.skin-tile .tile-icons { font-size: 0.72rem; letter-spacing: 3px; opacity: 0.75; }
.skin-tile.selected { border-color: var(--accent); background: rgba(243, 182, 59, 0.12); }
.skin-tile.selected::after {
  content: '✓'; position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #3d2a00; font-size: 0.68rem; font-weight: 900;
}
.skin-tile.locked { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.skin-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* rodapé fixo: a frase diz o que falta; o botão é a única ação principal */
.lobby-footer {
  position: sticky; bottom: 0; z-index: 2;
  margin: 16px -24px 0; padding: 12px 24px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.75), rgba(16, 24, 40, 0.98) 35%);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
 
}
.start-hint { margin: 0; flex: 1; min-width: 200px; font-size: 0.9rem; color: var(--muted); }
.start-hint b { color: var(--text); }
.lobby-actions { display: flex; align-items: center; gap: 10px; }
.lobby-actions .btn { min-width: 210px; padding: 14px 24px; font-size: 1.02rem; }
.btn-ready.active { background: rgba(47, 191, 113, 0.18); color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.rules { margin-top: 12px; color: var(--muted); font-size: 0.86rem; }
.rules summary { cursor: pointer; font-weight: 700; color: var(--text); }
.rules ul { padding-left: 18px; line-height: 1.5; }

/* ---------- tela 5 ---------- */
#screen-game.active { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
#screen-game { background: radial-gradient(1400px 900px at 50% 110%, #0f2a1e 0%, transparent 55%), #070d18; }

/* ambiente: holofote, vinheta e partículas */
.ambient { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient::before {
  content: ''; position: absolute; left: 50%; top: -35%; width: 140vw; height: 110vh; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 38%, rgba(255, 214, 140, 0.17) 0%, rgba(255, 214, 140, 0.05) 36%, transparent 64%);
}
.ambient::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 55%, transparent 48%, rgba(0, 0, 0, 0.6) 100%);
}
.ambient i {
  position: absolute; bottom: -12px; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 224, 160, 0.55); box-shadow: 0 0 8px rgba(255, 224, 160, 0.6);
  opacity: 0; animation: rise linear infinite;
}
.ambient i:nth-child(1) { left: 6%; animation-duration: 26s; animation-delay: -4s; }
.ambient i:nth-child(2) { left: 14%; animation-duration: 31s; animation-delay: -12s; width: 3px; height: 3px; }
.ambient i:nth-child(3) { left: 23%; animation-duration: 24s; animation-delay: -20s; }
.ambient i:nth-child(4) { left: 31%; animation-duration: 35s; animation-delay: -7s; width: 4px; height: 4px; }
.ambient i:nth-child(5) { left: 42%; animation-duration: 28s; animation-delay: -16s; width: 3px; height: 3px; }
.ambient i:nth-child(6) { left: 51%; animation-duration: 33s; animation-delay: -2s; }
.ambient i:nth-child(7) { left: 60%; animation-duration: 27s; animation-delay: -22s; width: 4px; height: 4px; }
.ambient i:nth-child(8) { left: 68%; animation-duration: 30s; animation-delay: -9s; }
.ambient i:nth-child(9) { left: 76%; animation-duration: 25s; animation-delay: -14s; width: 3px; height: 3px; }
.ambient i:nth-child(10) { left: 84%; animation-duration: 34s; animation-delay: -5s; }
.ambient i:nth-child(11) { left: 91%; animation-duration: 29s; animation-delay: -18s; width: 4px; height: 4px; }
.ambient i:nth-child(12) { left: 96%; animation-duration: 32s; animation-delay: -11s; }
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 0.8; }
  88% { opacity: 0.35; }
  100% { transform: translate(28px, -108vh); opacity: 0; }
}

/* topo limpo: uma linha discreta de informação, a mensagem da vez no centro e só 1-2 chips */
.hud {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 8px 100px 8px 20px; min-height: 52px;
  background: linear-gradient(180deg, rgba(4, 8, 16, 0.6), transparent);
}
.hud-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hud-btn {
  padding: 4px 11px; font-size: 0.74rem; font-weight: 800; border-radius: 4px;
  background: transparent; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.12);
}
.hud-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.logo-small, .hud-right { display: none; }
.pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud-info { font-size: 0.82rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.hud-info b { color: var(--text); font-weight: 800; }
.hud-info .sep { opacity: 0.4; margin: 0 6px; }
.pill { font-size: 0.74rem; font-weight: 800; padding: 3px 10px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); white-space: nowrap; }
.pill.bets { background: rgba(79, 140, 255, 0.16); color: #c9dcff; }
.pill.bets.over { background: rgba(255, 92, 108, 0.18); color: #ffc2c8; }
.pill.bets.under { background: rgba(47, 191, 113, 0.16); color: #b6efcf; }
.hud-center { font-family: var(--display); font-size: 1.2rem; text-align: center; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hud-center.mine { color: var(--accent); animation: pulse-text 1.6s ease-in-out infinite; }
@keyframes pulse-text { 50% { opacity: 0.65; } }

/* placar: escondido por padrão, abre no botão "Placar" (também mostra a ordem de força) */
.scoreboard {
  position: absolute; z-index: 7; width: 250px; display: none;
  left: calc(14px + env(safe-area-inset-left)); top: calc(60px + env(safe-area-inset-top));
  padding: 10px; border-radius: 6px;
  background: rgba(9, 14, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
 
}
.scoreboard.toggled { display: block; }
/* desktop: placar sempre aberto (no celular continua no botão "Placar") */
@media (min-width: 701px) and (min-height: 521px) {
  .scoreboard { display: block; }
  #btn-scoreboard { display: none; }
}
.sb-order { margin: 10px 4px 2px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.07); font-size: 0.72rem; color: var(--muted); }
.sb-order .label { display: block; margin-bottom: 4px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; font-size: 0.6rem; }
.order { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.order i { font-style: normal; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); color: var(--text); font-weight: 700; }
.order b { padding: 1px 7px; border-radius: 5px; background: var(--accent); color: #3d2a00; }
.order .arrow { opacity: 0.5; }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-size: 1rem; margin: 0 4px 8px; color: var(--accent); }
.sb-head span { font-family: var(--font); font-size: 0.72rem; color: var(--muted); font-weight: 700; }
#sb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#sb-list li {
  display: grid; grid-template-columns: 28px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 2px; align-items: center;
  padding: 4px 6px; border-radius: 4px; border: 1px solid transparent;
}
#sb-list li .avatar { width: 28px; height: 28px; font-size: 0.85rem; grid-row: 1 / span 2; }
#sb-list li .sb-name { font-weight: 800; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
#sb-list li .lives { grid-column: 2; }
#sb-list li .score-pill { grid-column: 3; grid-row: 1 / span 2; }
#sb-list li.turn { border-color: rgba(243, 182, 59, 0.6); background: rgba(243, 182, 59, 0.1); }
#sb-list li.me { background: rgba(255, 255, 255, 0.05); }
#sb-list li.out { opacity: 0.45; }

/* A área da mesa é um container: a mesa se dimensiona pelo espaço que sobra de verdade
   (cqw/cqh), em qualquer tela. --ratio é largura/altura da mesa; --seat-* e --trick-*
   são os raios (em % da mesa) lidos pelo JS para posicionar jogadores e cartas. */
.table-area {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  container-type: size;
}
.table {
  --ratio: 1.55;
  --seat-rx: 50; --seat-ry: 54; --seat-ry-bottom: 49;
  --trick-rx: 29; --trick-ry: 25;
  position: relative;
  width: min(84vw, calc((100vh - 312px) * 1.55));
  width: min(84cqw, calc((100cqh - 102px) * var(--ratio)));
  aspect-ratio: var(--ratio);
  container-type: inline-size;
}
/* desktop deitado: o placar fica sempre aberto à esquerda, então a mesa deixa espaço para ele */
@media (min-width: 701px) and (min-height: 521px) and (orientation: landscape) {
  .table { width: min(84cqw, max(62cqw, calc(100cqw - 560px)), calc((100cqh - 102px) * var(--ratio))); }
}
.table-rim {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 26%, #a87842 0%, #6e4422 42%, #3b2210 78%, #22130a 100%);
  box-shadow:
    0 50px 90px rgba(0, 0, 0, 0.7), 0 12px 30px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.14), inset 0 -8px 20px rgba(0, 0, 0, 0.55);
}
.table-rim::after {
  content: ''; position: absolute; inset: 1.7cqw; border-radius: 50%;
  border: 0.42cqw solid #c9a24a;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.table-felt {
  position: absolute; inset: 2.45cqw; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.014) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse at 50% 38%, var(--felt1) 0%, var(--felt2) 45%, #155a3b 74%, var(--felt3) 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.55), inset 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.table-felt::before {
  content: ''; position: absolute; inset: 6.5%; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.12);
}

.vira-slot {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; z-index: 1;
}
.vira-card { width: 5.3cqw; min-width: 40px; margin: 0 auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)); }
.vira-label { margin-top: 5px; font-size: clamp(10px, 1.15cqw, 12px); font-weight: 800; color: rgba(227, 247, 234, 0.75); white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.vira-label b { color: var(--accent); }

.card-svg { display: block; width: 100%; height: auto; }

/* cartas jogadas na mesa */
.trick-card {
  position: absolute; width: 6.8cqw; min-width: 48px; z-index: 2;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5));
}
.trick-card.drop { animation: drop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes drop {
  from { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot, 0deg)) scale(1.25); opacity: 0; }
  to { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); opacity: 1; }
}
.trick-card.winner { z-index: 3; filter: drop-shadow(0 0 16px rgba(255, 215, 90, 0.95)) drop-shadow(0 0 4px #ffd75a); }
.trick-card.cancelled { opacity: 0.45; filter: grayscale(1); }
.trick-name {
  position: absolute; left: 50%; bottom: -15px; transform: translateX(-50%);
  font-size: clamp(9px, 1cqw, 11px); font-weight: 800; white-space: nowrap; color: rgba(238, 242, 247, 0.8);
  background: rgba(0, 0, 0, 0.35); padding: 0 6px; border-radius: 6px;
}
.trick-card.winner .trick-name { background: var(--accent); color: #3d2a00; }
.trick-card.cancelled .trick-name { text-decoration: line-through; }

/* assentos dos outros jogadores */
.seat { position: absolute; transform: translate(-50%, -50%); z-index: 4; }
.seat-fan {
  position: absolute; left: 50%; top: 50%; z-index: -1;
  display: flex; align-items: flex-end;
  /* --cx/--cy: direção do centro da mesa; o leque fica entre o jogador e o centro */
  --fdx: 6cqw; --fdy: 4.2cqw;
  transform: translate(calc(-50% + var(--cx, 0) * var(--fdx)), calc(-50% + var(--cy, 0) * var(--fdy)));
}
/* cartas abertas (rodada de 1 carta): saem de trás do crachá para ficarem visíveis */
.seat-fan.open { --fdx: 11cqw; --fdy: 9cqw; }
@media (max-width: 700px), (max-height: 520px) {
  .seat-fan.open { --fdx: 6cqw; --fdy: 4.2cqw; }
}
.mini-card { width: 3.7cqw; min-width: 26px; margin-left: -1.9cqw; transform: rotate(var(--mrot, 0deg)); transform-origin: 50% 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.mini-card:first-child { margin-left: 0; }
.mini-card.revealed { width: 6.6cqw; min-width: 46px; margin-left: -2.8cqw; }
.mini-card.revealed:first-child { margin-left: 0; }
/* crachá limpo: vidro escuro, 2 linhas (nome / vidas + placar), avatar ocupando as duas */
.seat-badge {
  display: grid; grid-template-columns: auto auto auto; grid-template-areas: "av nm nm" "av lv sc" "av fl fl";
  align-items: center; column-gap: 8px; row-gap: 3px;
  padding: 7px 12px 7px 7px; border-radius: 6px;
  background: rgba(9, 14, 27, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
 
  white-space: nowrap;
}
.seat .seat-info { display: contents; }
.seat .avatar { grid-area: av; width: 34px; height: 34px; font-size: 0.95rem; }
.seat .seat-name { grid-area: nm; }
.seat .lives { grid-area: lv; }
.seat .score-pill { grid-area: sc; justify-self: start; }
.seat .flag-chips { grid-area: fl; }
.seat .heart { width: 14px; height: 14px; }
.seat.turn .seat-badge {
  border-color: rgba(243, 182, 59, 0.85);
  box-shadow: 0 0 0 3px rgba(243, 182, 59, 0.16), 0 0 22px rgba(243, 182, 59, 0.3);
  animation: glow 1.8s ease-in-out infinite;
}
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(243, 182, 59, 0.08), 0 0 30px rgba(243, 182, 59, 0.45); } }
.seat.out { opacity: 0.45; filter: grayscale(0.9); }
.off-tag { margin-left: 4px; font-size: 0.6rem; font-weight: 900; color: var(--red); background: rgba(255, 92, 108, 0.15); padding: 1px 5px; border-radius: 6px; text-transform: uppercase; }
.seat-info { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.seat-name { font-weight: 800; font-size: 0.88rem; display: flex; align-items: center; gap: 5px; }
.chip {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  font-size: 0.58rem; font-weight: 900; background: rgba(255, 255, 255, 0.85); color: #111;
}

/* vidas */
.lives { display: inline-flex; align-items: center; gap: 2px; }
.heart { width: 16px; height: 16px; display: block; flex: none; overflow: visible; }
.heart path { fill: #ff4d5e; }
.heart .shine { fill: rgba(255, 255, 255, 0.55); }
.heart.on { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.heart.off path { fill: #1f2636; stroke: rgba(255, 255, 255, 0.22); stroke-width: 6; }
.heart.off .shine { display: none; }
.lives-num { font-weight: 900; font-size: 0.8rem; margin-left: 4px; color: #ffb3bb; font-family: var(--display); }
.me-badge .heart { width: 22px; height: 22px; }
.me-badge .lives-num { font-size: 1.05rem; }
.lives-num small { font-size: 0.72em; opacity: 0.6; font-weight: 800; }
.lives.many .heart.hit { animation: heart-hit 0.9s ease both; animation-delay: calc(var(--i, 0) * 110ms + 1s); }
@keyframes heart-hit {
  0% { transform: scale(1); }
  30% { transform: scale(1.6) rotate(-14deg); filter: brightness(1.8); }
  60% { transform: scale(0.85) rotate(8deg); }
  100% { transform: scale(1); }
}
#sb-list .heart { width: 13px; height: 13px; }
#sb-list .lives-num { font-size: 0.75rem; }
.modal .heart { width: 20px; height: 20px; }

/* placar de aposta x vazas */
.score-pill {
  display: inline-flex; align-items: baseline; gap: 2px; align-self: flex-start;
  padding: 1px 8px; border-radius: 4px; font-weight: 900; font-size: 0.78rem; line-height: 1.3;
  background: rgba(255, 255, 255, 0.07); color: var(--muted);
}
.score-pill .sc-won { font-size: 1.1em; color: var(--text); }
.score-pill .sc-sep { opacity: 0.6; }
.score-pill.hit { background: rgba(47, 191, 113, 0.22); color: #9fe7bf; }
.score-pill.hit .sc-won { color: #4ade80; }
.score-pill.under { background: rgba(243, 182, 59, 0.18); color: #ffd58a; }
.score-pill.under .sc-won { color: #ffd58a; }
.score-pill.over { background: rgba(255, 92, 108, 0.22); color: #ffb3bb; }
.score-pill.over .sc-won { color: #ff7a88; }
.score-pill.none, .score-pill.out { font-weight: 700; font-size: 0.7rem; background: transparent; padding: 0 2px; }
.me-badge .score-pill { font-size: 0.95rem; padding: 2px 11px; }

/* barra inferior: eu, minha mão, ações */
.bottom-bar {
  position: relative; z-index: 6;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
  padding: 0 22px 12px; height: 178px; margin-top: -24px;
  background: linear-gradient(180deg, transparent, rgba(3, 6, 12, 0.45) 70%);
}
.me-badge {
  justify-self: start; align-self: end;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: 6px;
  background: rgba(9, 14, 27, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
 
}
.me-badge.turn { border-color: rgba(243, 182, 59, 0.85); animation: glow 1.8s ease-in-out infinite; }
.me-badge .avatar { width: 46px; height: 46px; font-size: 1.15rem; }
.me-badge .seat-name { font-size: 1rem; }
.me-badge .seat-info { gap: 5px; }
.me-badge.out { opacity: 0.55; filter: grayscale(0.9); }

.my-hand { display: flex; align-items: flex-end; justify-content: center; height: 100%; padding-bottom: 6px; min-width: var(--hand-w); }
/* a barra de baixo sobe um pouco sobre a mesa: a área vazia dela não pode roubar cliques/toques
   do painel de aposta; só as cartas e os botões recebem o toque */
.bottom-bar, .my-hand { pointer-events: none; }
.bottom-bar > *:not(.my-hand), .my-hand .hcard, .my-hand .eliminated-note { pointer-events: auto; }
.hcard {
  position: relative; width: var(--hand-w); margin-left: calc(var(--hand-w) * -0.38);
  transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
  transform-origin: 50% 130%;
  transition: transform 0.16s ease, filter 0.16s ease;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}
.hcard:first-child { margin-left: 0; }
.hcard.blind::after {
  content: '?'; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 2.6rem; color: #ffe08a; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.my-hand.can-play .hcard { cursor: pointer; }
/* mouse: a carta sobe ao passar por cima; toque: o 1º toque seleciona (sobe), o 2º joga */
@media (hover: hover) {
  .my-hand.can-play .hcard:hover {
    transform: rotate(var(--rot, 0deg)) translateY(calc(var(--lift, 0px) - 30px)) scale(1.07);
    z-index: 100 !important;
    filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(243, 182, 59, 0.7));
  }
}
.my-hand.can-play .hcard.selected {
  transform: rotate(var(--rot, 0deg)) translateY(calc(var(--lift, 0px) - 28px)) scale(1.07);
  z-index: 100 !important;
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 12px rgba(243, 182, 59, 0.95));
}
.my-hand.can-play .hcard.selected::before {
  content: 'toque p/ jogar'; position: absolute; left: 50%; top: -22px; z-index: 2;
  transform: translateX(-50%); white-space: nowrap;
  font-size: 0.66rem; font-weight: 900; letter-spacing: 0.3px;
  padding: 2px 8px; border-radius: 4px; background: var(--accent); color: #3d2a00;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.my-hand.waiting .hcard { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55)) brightness(0.85); }
/* arrastar livre: a carta segue o dedo/mouse em qualquer direção; na mão reorganiza, na mesa joga */
.my-hand .hcard { touch-action: none; user-select: none; -webkit-user-select: none; }
.my-hand .hcard { cursor: grab; }
.my-hand.sorting, .my-hand.sorting .hcard { cursor: grabbing !important; }
.my-hand .hcard.dragging {
  z-index: 200 !important; animation: none !important; transform-origin: 50% 40%;
  transform: rotate(0deg) translateY(-22px) scale(1.15) !important;
  filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(243, 182, 59, 0.6)) !important;
}
.my-hand.sorting .hcard:not(.dragging) { transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)) !important; animation: none !important; }
.my-hand.sorting .hcard.selected::before { display: none; }
.eliminated-note { color: var(--muted); font-weight: 700; padding-bottom: 30px; }

/* o status já aparece no topo; o painel só aparece quando tem uma ação (ex.: jogar por quem caiu) */
.action-panel {
  display: none;
  justify-self: end; align-self: end; text-align: right;
  min-width: 220px; max-width: 420px;
  padding: 12px 16px; border-radius: 6px;
  background: rgba(9, 14, 27, 0.85); border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.action-panel.has-action { display: block; }
.ap-title { font-family: var(--display); font-size: 1.15rem; }
.ap-title.highlight { color: var(--accent); }
.ap-sub { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.bet-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }
.bet-btn {
  width: 44px; height: 44px; border-radius: 5px; border: 2px solid transparent;
  background: linear-gradient(180deg, #ffcc5c, var(--accent)); color: #3d2a00; font-weight: 900; font-size: 1.15rem;
  transition: transform 0.1s ease;
}
.bet-btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.05); }
.bet-btn:disabled { background: rgba(255, 255, 255, 0.08); color: var(--muted); cursor: not-allowed; text-decoration: line-through; }

/* overlay de fim de rodada / partida */
.overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 16, 0.6);
  animation: fade 0.3s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(92vw, 580px);
  background: rgba(16, 24, 40, 0.96); border: 1px solid var(--panel-border);
  border-radius: 8px; padding: 26px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.modal h2 { font-size: 1.8rem; margin-bottom: 14px; }
.modal table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.modal th, .modal td { padding: 8px 6px; text-align: center; vertical-align: middle; }
.modal th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.modal td:first-child, .modal th:first-child { text-align: left; font-weight: 800; }
.modal td .lives { justify-content: center; }
.modal tr.hit td.res { color: var(--green); font-weight: 800; }
.modal tr.miss td.res { color: var(--red); font-weight: 800; }
.modal tr.elim td { color: var(--muted); }
.modal tr.elim td.res { color: var(--red); font-weight: 800; }
.trophy { font-size: 3.4rem; line-height: 1; }
.ranking { list-style: none; padding: 0; margin: 0 0 10px; text-align: left; }
.ranking li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 4px; margin-bottom: 4px; background: rgba(255, 255, 255, 0.05); }
.ranking li:first-child { background: rgba(243, 182, 59, 0.2); font-weight: 800; }
.ranking li span { color: var(--muted); }
.ranking li .pos { color: var(--text); margin-right: 8px; }

/* toasts e conexão */
.toasts {
  position: fixed; z-index: 90; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
  top: calc(64px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right));
}
.toast {
  background: rgba(8, 14, 26, 0.92); border: 1px solid var(--panel-border);
  padding: 10px 14px; border-radius: 5px; font-weight: 700; font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slide 0.25s ease;
  max-width: 320px;
}
.toast.error { border-color: var(--red); color: #ffb3bb; }
.toast.good { border-color: var(--green); }
.toast.gold { border-color: var(--accent); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }
.conn-banner {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 95;
  background: var(--red); color: #fff; font-weight: 800; padding: 8px 16px; border-radius: 4px;
}
/* aberto em outra aba: o aviso é um botão (toque para jogar nesta aba) */
.tab-banner { border: 0; font: inherit; font-weight: 800; cursor: pointer; max-width: calc(100vw - 32px); }

/* =====================================================================
   Animações
   ===================================================================== */
.seat.turn .avatar::after, .me-badge.turn .avatar::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px dashed var(--accent); animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* entrada das telas */
.screen.active .panel { animation: pop-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes pop-in { from { opacity: 0; transform: translateY(26px) scale(0.96); } }
#screen-game.active .table-area { animation: table-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes table-in { from { opacity: 0; transform: scale(0.86); } }
#screen-game.active .hud { animation: slide-down 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
#screen-game.active .bottom-bar { animation: slide-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
#screen-game.active .scoreboard { animation: slide-left 0.5s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-30px); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(40px); } }
@keyframes slide-left { from { opacity: 0; transform: translateX(-30px); } }
/* só quem acabou de entrar anima (trocar de baralho redesenha a linha sem repetir a animação) */
.player-list li.enter { animation: row-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 60ms); }

/* tela inicial */
.logo { animation: logo-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes logo-in { from { opacity: 0; transform: translateY(30px) scale(0.9); } }
.tagline { animation: fade-up 0.7s 0.25s backwards; }
.splash-foot { animation: fade-up 0.7s 0.6s backwards; }
#btn-play { animation: fade-up 0.7s 0.4s backwards, btn-pulse 2.4s 1.4s ease-in-out infinite; }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } }
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(243, 182, 59, 0.3), 0 0 0 0 rgba(243, 182, 59, 0.45); }
  70% { box-shadow: 0 8px 20px rgba(243, 182, 59, 0.3), 0 0 0 18px rgba(243, 182, 59, 0); }
}

/* monte de cartas ao lado da vira */
.deck {
  position: absolute; left: 40.5%; top: 50%; z-index: 1;
  width: 5.3cqw; min-width: 40px; aspect-ratio: 5 / 7;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
}
.deck .deck-card { position: absolute; inset: 0; }
.deck .deck-card:nth-child(2) { transform: translate(-2px, -3px) rotate(-2deg); }
.deck .deck-card:nth-child(3) { transform: translate(2px, -6px) rotate(3deg); }

/* distribuição: cartas saem do monte */
@keyframes deal-in {
  0% { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(0deg) scale(0.5); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)) scale(1); opacity: 1; }
}
@keyframes deal-mini {
  0% { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(0deg) scale(0.6); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: rotate(var(--mrot, 0deg)) scale(1); opacity: 1; }
}
.mini-card.deal { animation: deal-mini 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay, 0ms); }
.vira-card.flip { animation: flip-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay, 0ms); }
@keyframes flip-in {
  0% { transform: perspective(500px) rotateY(90deg) scale(0.8); opacity: 0; }
  100% { transform: perspective(500px) rotateY(0deg) scale(1); opacity: 1; }
}

/* minha mão: convite quando é minha vez, carta voando ao jogar */
@keyframes nudge {
  0% { transform: rotate(var(--rot, 0deg)) translateY(calc(var(--lift, 0px) + 18px)); }
  100% { transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)); }
}
.my-hand.can-play .hcard { animation: nudge 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.my-hand .hcard.deal { animation: deal-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay, 0ms); pointer-events: none; }
.my-hand .hcard.flying { animation: fly 0.3s ease-in forwards; pointer-events: none; }
@keyframes fly { to { transform: rotate(var(--rot, 0deg)) translateY(calc(var(--lift, 0px) - 140px)) scale(0.9); opacity: 0; } }

/* botões de aposta */
.bet-btn { animation: pop 0.4s cubic-bezier(0.2, 1.5, 0.3, 1) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
.bet-btn.chosen { background: var(--green); color: #052e16; opacity: 1; text-decoration: none; }
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.22); opacity: 1; }
  100% { transform: scale(1); }
}
.score-pill.pop { animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.3, 1); }

/* vaza: cartas voam para quem levou, ou tremem e somem no empate */
.trick-card.collect { animation: collect 0.55s ease-in 1.75s forwards; }
.trick-card.drop.collect { animation: drop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), collect 0.55s ease-in 1.75s forwards; }
@keyframes collect {
  to { transform: translate(calc(-50% + var(--wx, 0px)), calc(-50% + var(--wy, 0px))) rotate(var(--rot, 0deg)) scale(0.4); opacity: 0; }
}
.trick-card.tied { animation: tied 1s ease-in 1.5s forwards; }
.trick-card.drop.tied { animation: drop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), tied 1s ease-in 1.5s forwards; }
@keyframes tied {
  0% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
  15% { transform: translate(calc(-50% - 8px), -50%) rotate(calc(var(--rot, 0deg) - 6deg)); }
  30% { transform: translate(calc(-50% + 8px), -50%) rotate(calc(var(--rot, 0deg) + 6deg)); }
  45% { transform: translate(calc(-50% - 5px), -50%) rotate(var(--rot, 0deg)); }
  60% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.5); opacity: 0; }
}
.trick-card.winner .card-svg { animation: win-glow 0.7s ease-in-out 2; }
@keyframes win-glow { 50% { transform: scale(1.08); } }
.seat.won .seat-badge, .me-badge.won { animation: bounce 0.6s cubic-bezier(0.2, 1.5, 0.3, 1) 2.15s; }
@keyframes bounce { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* faixa grande no meio da mesa */
.big-banner {
  position: absolute; left: 50%; top: 40%; z-index: 40;
  transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
  font-family: var(--display); font-size: clamp(1.5rem, 3.6vw, 3rem);
  padding: 12px 38px; border-radius: 4px; white-space: nowrap;
  background: rgba(8, 14, 26, 0.9); border: 2px solid var(--accent); color: var(--accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(243, 182, 59, 0.25);
}
.big-banner.good { border-color: var(--green); color: var(--green); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(47, 191, 113, 0.3); }
.big-banner.bad { border-color: var(--red); color: var(--red); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 92, 108, 0.3); }
.big-banner.show { animation: banner 2s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  20% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(1.04); }
}

/* poderes: dois botões ao lado do meu crachá (pessoal dourado, global azul) */
.me-zone { justify-self: start; align-self: end; display: flex; align-items: flex-end; gap: 10px; }
.me-zone .me-badge { justify-self: auto; align-self: auto; }
.power-btns { display: flex; gap: 8px; }
/* botões de poder: só o ícone + "pessoal"/"global"; o estado vem da cor, do pulso e de um selinho */
.ult-btn {
  --pc: var(--accent); --pc-rgb: 243, 182, 59; --pc-open: #4a3608;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 60px; height: 60px; padding: 0 0 10px; border-radius: 6px;
  border: 1.5px solid rgba(var(--pc-rgb), 0.3); color: var(--muted);
  background: rgba(9, 14, 27, 0.78);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
 
  transition: transform 0.12s ease, border-color 0.15s ease, opacity 0.2s ease;
}
.ult-btn.global { --pc: #5aa8ff; --pc-rgb: 90, 168, 255; --pc-open: #0c2a52; }
.ult-btn .ult-kind {
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  font-size: 0.46rem; font-weight: 900; letter-spacing: 0.8px; color: var(--pc); opacity: 0.8;
}
.ult-btn .ult-icon { font-size: 1.45rem; line-height: 1; opacity: 0.6; transition: transform 0.15s ease; }
.ult-btn .ult-label, .ult-btn .ult-state { display: none; }
.ult-btn.ready { border-color: var(--pc); color: var(--text); cursor: pointer; animation: ult-pulse 1.6s ease-in-out infinite; }
.ult-btn.ready .ult-icon { opacity: 1; transform: scale(1.12); }
.ult-btn.ready:hover { transform: translateY(-3px) scale(1.04); }
.ult-btn.open { background: linear-gradient(180deg, var(--pc-open), #05080f); }
.ult-btn.used { border-color: rgba(var(--pc-rgb), 0.7); }
.ult-btn.used .ult-icon { opacity: 0.85; }
.ult-btn.locked { opacity: 0.35; }
.ult-btn.used::after, .ult-btn.locked::after {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.62rem; font-weight: 900; line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.ult-btn.used::after { content: '✓'; background: var(--green); color: #052e16; }
.ult-btn.locked::after { content: '🔒'; background: #1b2235; font-size: 0.55rem; }
.ult-btn.none { opacity: 0.35; }
.ult-btn:disabled { cursor: default; }
.ult-btn.idle, .ult-btn.used, .ult-btn.locked { cursor: help; }
@keyframes ult-pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(var(--pc-rgb), 0.45); }
  60% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 0 10px rgba(var(--pc-rgb), 0); }
}
/* nos crachás dos outros, do poder só aparece o que já foi usado */
.ult-tag { font-size: 0.75rem; margin-left: 2px; }
.ult-tag:not(.used) { display: none; }
/* efeitos ativos: só o ícone (o texto fica na dica ao passar o mouse) */
.flag-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.flag-chips span { font-size: 0.72rem; padding: 0 5px; border-radius: 4px; background: rgba(243, 182, 59, 0.16); white-space: nowrap; }
.flag-chips i { display: none; }
.pill.mod { background: rgba(90, 168, 255, 0.2); color: #d6e8ff; }
.pill.mod.next { background: transparent; color: var(--muted); padding: 3px 4px; }
.no-manilha { padding: 1px 7px; border-radius: 5px; background: rgba(255, 92, 108, 0.25); color: #ffb3bb; font-weight: 800; }
.trick-card.boosted::before {
  content: '🌀'; position: absolute; top: -14px; right: -10px; z-index: 2; font-size: 1.2rem;
  filter: drop-shadow(0 0 6px #a855f7);
}
.trick-card.boosted { filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(168, 85, 247, 0.85)); }
.big-banner.global { border-color: #5aa8ff; color: #8cc4ff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(90, 168, 255, 0.35); }
.bet-prompt.ult {
  flex-wrap: wrap; justify-content: center;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(243, 182, 59, 0.18), 0 18px 40px rgba(0, 0, 0, 0.65), 0 0 40px rgba(243, 182, 59, 0.35);
  animation: bet-in 0.45s cubic-bezier(0.2, 1.3, 0.3, 1) backwards;
}
.bet-prompt.ult.global {
  border-color: #5aa8ff;
  background: linear-gradient(180deg, rgba(8, 24, 48, 0.97), rgba(4, 12, 26, 0.97));
  box-shadow: 0 0 0 4px rgba(90, 168, 255, 0.18), 0 18px 40px rgba(0, 0, 0, 0.65), 0 0 40px rgba(90, 168, 255, 0.35);
}
.bet-prompt.ult.global .bp-title { color: #8cc4ff; }
.bet-prompt.ult .bp-sub { max-width: 340px; white-space: normal; }
.bet-prompt .bp-sub.warn { color: #ffb08a; }
.bet-prompt .bp-kind { font-family: var(--font); font-size: 0.62rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-left: 6px; }
.bet-prompt .bet-btn.current { opacity: 0.5; text-decoration: none; outline: 2px dashed var(--accent); }
.ult-confirm { font-size: 1.05rem; padding: 12px 22px; }

/* painel de aposta em destaque (acima da mão, longe da vira) */
.bet-prompt {
  position: absolute; left: 50%; bottom: 4px; z-index: 8;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
  padding: 12px 18px 12px 22px; border-radius: 8px; max-width: min(94vw, 600px);
  background: linear-gradient(180deg, rgba(38, 28, 8, 0.97), rgba(18, 13, 4, 0.97));
  border: 2px solid var(--accent); color: var(--text);
  box-shadow: 0 0 0 4px rgba(243, 182, 59, 0.18), 0 18px 40px rgba(0, 0, 0, 0.65), 0 0 40px rgba(243, 182, 59, 0.35);
  animation: bet-in 0.45s cubic-bezier(0.2, 1.3, 0.3, 1) backwards, bet-glow 1.6s ease-in-out 0.5s infinite;
}
.bet-prompt .bp-title { font-family: var(--display); font-size: clamp(1.1rem, 1.6vw, 1.45rem); color: var(--accent); line-height: 1.1; white-space: nowrap; }
.bet-prompt .bp-sub { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.bet-prompt .bp-sub b { color: var(--red); }
.bet-prompt .bet-buttons { margin: 0; justify-content: center; flex-wrap: nowrap; }
.bet-prompt .bet-btn { width: 52px; height: 52px; font-size: 1.35rem; border-radius: 6px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4); }
@keyframes bet-in { from { opacity: 0; transform: translate(-50%, 30px) scale(0.9); } }
@keyframes bet-glow { 50% { box-shadow: 0 0 0 8px rgba(243, 182, 59, 0.08), 0 18px 40px rgba(0, 0, 0, 0.65), 0 0 64px rgba(243, 182, 59, 0.55); } }

/* fim de rodada: linhas entram, corações quebram */
.modal tbody tr { animation: row-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 110ms + 0.15s); }
@keyframes row-in { from { opacity: 0; transform: translateX(-18px); } }
.res-tag { display: inline-block; animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.3, 1) backwards; animation-delay: calc(var(--i, 0) * 110ms + 0.8s); }
/* coração perdido: pulsa vermelho, treme e assenta cinza no tamanho normal */
.heart.lost { --hd: calc(var(--i, 0) * 110ms + 1s + var(--h, 0) * 160ms); animation: heart-break 1s ease both; animation-delay: var(--hd); transform-origin: 50% 50%; }
.heart.lost path { fill: #ff4d5e; animation: heart-fill 1s ease both; animation-delay: var(--hd); }
.heart.lost .shine { animation: shine-out 1s ease both; animation-delay: var(--hd); }
@keyframes heart-break {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.7) rotate(-16deg); }
  45% { transform: scale(0.9) rotate(10deg); }
  65% { transform: scale(1.15) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes heart-fill {
  0%, 45% { fill: #ff4d5e; stroke-width: 0; }
  100% { fill: #1f2636; stroke: rgba(255, 255, 255, 0.22); stroke-width: 6; }
}
@keyframes shine-out { 0%, 45% { opacity: 1; } 100% { opacity: 0; } }

/* fim de jogo */
.overlay .modal { position: relative; z-index: 1; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.trophy { display: inline-block; animation: trophy 0.9s cubic-bezier(0.2, 1.4, 0.3, 1) backwards; }
@keyframes trophy { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0deg); } }
.modal.win h2 { animation: fade-up 0.6s 0.3s backwards; }
.ranking li { animation: row-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; animation-delay: calc(var(--i, 0) * 120ms + 0.5s); }

/* =====================================================================
   Responsivo: tablets, celular em pé e celular deitado
   ===================================================================== */
#screen-game { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@keyframes bet-in-side { from { opacity: 0; transform: translateX(30px) scale(0.94); } }

/* lobby em uma coluna quando não cabe lado a lado (baralho primeiro, depois a sala) */
@media (max-width: 860px) {
  .lobby-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
/* celular bem estreito: prévia do baralho em cima, poderes embaixo */
@media (max-width: 400px) {
  .deck-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: left; }
  .hero-info { width: 100%; }
  .hero-name { justify-content: center; }
}

/* telas médias (tablets, notebooks pequenos): menos coisa no topo e na barra inferior */
@media (max-width: 1100px) {
  .bottom-bar { grid-template-columns: auto 1fr auto; }
  .ult-btn { width: 56px; height: 56px; }
  .me-badge .heart { width: 19px; height: 19px; }
}

/* em pé (qualquer tamanho): mesa oval na vertical, monte acima da vira */
@media (orientation: portrait) {
  .table {
    --ratio: 0.8;
    --seat-rx: 44; --seat-ry: 50; --seat-ry-bottom: 47;
    --trick-rx: 24; --trick-ry: 26;
    width: min(86vw, calc((100vh - 330px) * 0.8));
    width: min(88cqw, calc((100cqh - 110px) * var(--ratio)));
  }
  .deck { left: 50%; top: 37%; }
  .vira-slot { top: 55%; }
}

/* celulares (em pé ou deitado) */
@media (max-width: 700px), (max-height: 520px) {
  :root { --hand-w: clamp(52px, 15.5vw, 74px); }
  .top-actions { gap: 6px; }
  .btn-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 4px; }
  .lang-switch { height: 36px; }
  .lang-switch button { padding: 0 10px; font-size: 0.82rem; }

  /* splash, nome e lobby */
  .panel { padding: 20px 16px; }
  .panel h2 { font-size: 1.35rem; margin-bottom: 12px; }
  .float-card { width: clamp(56px, 16vw, 110px); }
  .tagline { font-size: 1rem; margin: 10px 0 26px; }
  .btn-xl { font-size: 1.35rem; padding: 15px 52px; }
  #name-form { flex-direction: column; }
  .room-pw { flex-direction: column; }
  .panel-lobby { padding: 14px 12px 0; }
  .lobby-head { margin-bottom: 10px; }
  .lobby-head h2 { font-size: 1.25rem; margin: 0; }
  .lobby-card { padding: 12px; border-radius: 6px; }
  .sec-title { font-size: 0.98rem; margin-bottom: 10px; }
  .deck-hero { gap: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .hero-cards { width: 104px; height: 96px; }
  .hero-cards .hc { width: 52px; }
  .hero-cards .hc.back { top: 14px; }
  .hero-cards .hc.f1 { left: 26px; }
  .hero-cards .hc.f2 { left: 52px; top: 14px; }
  .hero-name { font-size: 1.15rem; }
  .power-card { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 7px 8px; }
  .pc-icon { font-size: 1.1rem; }
  .power-card p { font-size: 0.74rem; }
  .skin-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
  .skin-tile .tile-art { width: 40px; }
  .player-list li { padding: 6px 8px; gap: 8px; }
  .player-list .status { font-size: 0.7rem; padding: 3px 7px; }
  .lobby-settings { flex-wrap: wrap; }
  .lobby-footer { margin: 12px -12px 0; padding: 10px 12px 12px; }
  .start-hint { flex-basis: 100%; min-width: 0; font-size: 0.82rem; }
  .lobby-actions { flex: 1 1 100%; }
  .lobby-actions .btn { flex: 1; min-width: 0; padding: 13px 16px; }

  /* topo */
  .hud { grid-template-columns: 1fr; gap: 3px; padding: 6px 10px 5px; min-height: 0; }
  .hud-left { gap: 5px; margin-right: 74px; flex-wrap: wrap; }
  .pills { gap: 6px; }
  .pill { font-size: 0.66rem; padding: 2px 7px; }
  .hud-info { font-size: 0.72rem; }
  .hud-info .sep { margin: 0 4px; }
  .hi-cards, .mod-name { display: none; }
  .hud-btn { padding: 2px 9px; font-size: 0.68rem; }
  .hud-center { font-size: 0.98rem; }

  /* adversários: crachá compacto em grade (avatar pequeno ao lado do nome; ♥ + número e placar embaixo) */
  .seat-badge {
    display: grid; grid-template-columns: auto 1fr; grid-template-areas: "av nm" "lv sc" "fl fl";
    align-items: center; column-gap: 4px; row-gap: 2px;
    width: 88px; padding: 4px 6px 5px; border-radius: 6px;
  }
  .seat .seat-info { display: contents; }
  .seat .avatar { grid-area: av; width: 18px; height: 18px; font-size: 0.6rem; box-shadow: none; }
  .seat.turn .avatar::after { inset: -3px; border-width: 1.5px; }
  .seat .seat-name { grid-area: nm; font-size: 0.7rem; gap: 2px; min-width: 0; }
  .seat .lives { grid-area: lv; }
  .seat .score-pill { grid-area: sc; justify-self: end; }
  .seat .flag-chips { grid-area: fl; }
  .seat .nm { max-width: 56px; overflow: hidden; text-overflow: ellipsis; }
  .seat .chip { width: 14px; height: 14px; font-size: 0.55rem; }
  .seat .ult-tag { font-size: 0.62rem; margin-left: 0; }
  .seat .off-tag { margin-left: 0; font-size: 0.5rem; padding: 0 4px; }
  .seat .lives .heart:not(:first-child) { display: none; }
  .seat .lives .heart:first-child path { fill: #ff4d5e; stroke: none; }
  .seat .heart { width: 12px; height: 12px; }
  .seat .lives-num { font-size: 0.72rem; margin-left: 2px; }
  .seat .score-pill { font-size: 0.66rem; padding: 1px 6px; }
  .seat .flag-chips { justify-content: center; }
  .flag-chips span { padding: 0 4px; font-size: 0.7rem; }
  /* leque de cartas acima do crachá (ou ao lado, para quem está no topo da mesa) */
  .seat-fan { top: 0; transform: translate(-50%, calc(-100% + 10px)); }
  .seat.fan-side .seat-fan { left: 100%; top: 50%; transform: translate(-8px, -50%); }
  .mini-card { min-width: 20px; }
  .trick-card { min-width: 42px; }
  .trick-name { font-size: 9px; bottom: -13px; padding: 0 5px; }
  .vira-card, .deck { min-width: 34px; }
  .vira-label { font-size: 9px; padding: 1px 5px; }

  /* eu */
  .me-badge { gap: 8px; padding: 6px 12px 6px 6px; border-radius: 6px; }
  .me-badge .avatar { width: 34px; height: 34px; font-size: 0.95rem; }
  .me-badge .seat-info { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 2px; }
  .me-badge .seat-name { flex-basis: 100%; font-size: 0.85rem; }
  .me-badge .nm { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  .me-badge .heart { width: 15px; height: 15px; }
  .me-badge .lives-num { font-size: 0.85rem; }
  .me-badge .score-pill { font-size: 0.78rem; padding: 1px 8px; }
  .power-btns { gap: 6px; }
  .ult-btn { width: 50px; height: 50px; padding: 0 0 8px; border-radius: 6px; }
  .ult-btn .ult-kind { font-size: 0.4rem; bottom: 4px; letter-spacing: 0.5px; }
  .ult-btn .ult-icon { font-size: 1.2rem; }
  .eliminated-note { padding-bottom: 12px; font-size: 0.85rem; text-align: center; }

  /* painéis de aposta e de poder */
  .bet-prompt {
    flex-direction: column; align-items: stretch; gap: 8px; text-align: center;
    padding: 10px 12px; border-radius: 6px; width: min(calc(100% - 16px), 420px);
  }
  .bet-prompt .bp-title { white-space: normal; font-size: 1.1rem; }
  .bet-prompt .bp-sub { font-size: 0.75rem; }
  .bet-prompt .bet-buttons { flex-wrap: wrap; }
  .bet-prompt .bet-btn { width: 44px; height: 44px; font-size: 1.15rem; }
  .bet-prompt.ult .bp-sub { max-width: none; }

  /* faixa, avisos, placar e resumos */
  .big-banner {
    font-size: clamp(1rem, 5.4vw, 1.6rem); white-space: normal; text-align: center;
    width: max-content; max-width: 88vw; padding: 8px 18px; border-radius: 6px;
  }
  .toasts { top: calc(env(safe-area-inset-top) + 74px); left: 8px; right: 8px; align-items: center; }
  .toast { font-size: 0.78rem; padding: 7px 11px; max-width: 92vw; }
  .scoreboard {
    width: auto; max-height: 60%; overflow: auto;
    left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right));
    top: calc(env(safe-area-inset-top) + 64px);
  }
  .modal { padding: 16px 12px; max-height: calc(100% - 24px); overflow: auto; }
  .modal h2 { font-size: 1.3rem; margin-bottom: 8px; }
  .modal th, .modal td { padding: 5px 3px; font-size: 0.78rem; }
  .modal th { font-size: 0.6rem; letter-spacing: 0; }
  .modal .heart { width: 13px; height: 13px; }
  .modal td:first-child { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .trophy { font-size: 2.6rem; }
  .ranking li { padding: 6px 10px; font-size: 0.85rem; }
}

/* celular em pé: eu + poderes numa linha, mão embaixo (alcance do polegar) */
@media (max-width: 700px) and (orientation: portrait) {
  .table {
    --seat-rx: 40; --seat-ry: 48; --seat-ry-bottom: 46;
    --trick-rx: 24; --trick-ry: 29;
    width: min(88cqw, calc((100cqh - 96px) * var(--ratio)));
  }
  /* painel de aposta baixo, para não esconder os crachás de baixo da mesa */
  .bet-prompt { bottom: 8px; gap: 6px; padding: 8px 10px; }
  .bet-prompt .bp-title { font-size: 1rem; }
  .bet-prompt:not(.ult) .bp-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bet-prompt .bet-btn { width: 42px; height: 42px; }
  .bottom-bar {
    grid-template-columns: 1fr; grid-template-areas: "me" "hand" "act";
    height: auto; margin-top: -4px; padding: 0 8px 8px; gap: 4px;
  }
  .me-zone { grid-area: me; justify-self: center; align-items: center; gap: 8px; }
  .my-hand { grid-area: hand; height: calc(var(--hand-w) * 1.4 + 22px); padding-bottom: 2px; }
  .action-panel.has-action { grid-area: act; justify-self: center; text-align: center; min-width: 0; padding: 8px 12px; }
}

/* celular em pé e baixinho (ex.: 360x640): cartas da mão menores e painel de aposta enxuto
   (o botão proibido já aparece riscado, então a linha de dica pode sair) */
@media (max-width: 700px) and (orientation: portrait) and (max-height: 720px) {
  :root { --hand-w: clamp(48px, 13.5vw, 64px); }
  .table {
    --seat-rx: 43; --seat-ry-bottom: 44;
    width: min(88cqw, calc((100cqh - 84px) * var(--ratio)));
  }
  .bet-prompt { bottom: 2px; }
  .bet-prompt:not(.ult) .bp-sub { display: none; }
  .bet-prompt .bp-title { font-size: 0.95rem; }
  .bet-prompt .bet-btn { width: 40px; height: 40px; font-size: 1.05rem; }
}

/* celular deitado: mão e eu sobrepostos à parte de baixo, painéis no canto direito */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --hand-w: clamp(46px, 7vw, 60px); }
  .hud { grid-template-columns: auto 1fr; padding: 4px 92px 4px 10px; }
  .hud-left { margin-right: 0; flex-wrap: nowrap; }
  .hud-center { font-size: 0.95rem; }
  .table {
    --ratio: 1.7;
    --seat-rx: 50; --seat-ry: 52; --seat-ry-bottom: 50;
    --trick-rx: 27; --trick-ry: 25;
    width: min(calc(100cqw - 300px), calc((100cqh - 88px) * var(--ratio)));
  }
  /* meu crachá estreito, para caber no canto sem encostar nos assentos de baixo */
  .me-badge { max-width: 176px; }
  .me-badge .nm { max-width: 100px; }
  .me-badge .heart { width: 13px; height: 13px; }
  .bet-prompt .bp-title { font-size: 0.95rem; }
  .bet-prompt:not(.ult) .bp-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .deck { left: 40.5%; top: 50%; }
  .vira-slot { top: 50%; }
  .bottom-bar {
    position: absolute; height: auto; margin: 0; padding: 0 8px 6px;
    left: env(safe-area-inset-left); right: env(safe-area-inset-right); bottom: env(safe-area-inset-bottom);
    grid-template-columns: 1fr auto 1fr; align-items: end; background: none; pointer-events: none;
  }
  .me-zone { flex-direction: column; align-items: flex-start; gap: 6px; }
  .my-hand { height: auto; padding-bottom: 0; }
  .action-panel.has-action { justify-self: end; max-width: 200px; padding: 8px 10px; }
  .bet-prompt {
    left: auto; right: 8px; bottom: 6px; transform: none; width: 178px;
    animation-name: bet-in-side, bet-glow;
  }
  .bet-prompt.ult { animation-name: bet-in-side; }
  .bet-prompt .bet-btn { width: 40px; height: 40px; font-size: 1.05rem; }
  .toasts { left: auto; right: calc(8px + env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 44px); align-items: flex-end; }
  .scoreboard { left: calc(8px + env(safe-area-inset-left)); right: auto; width: 270px; top: calc(env(safe-area-inset-top) + 44px); max-height: calc(100% - 56px); }
}

/* celular deitado e estreito (ex.: iPhone SE 667x375): cantos mais estreitos */
@media (max-height: 520px) and (orientation: landscape) and (max-width: 760px) {
  .me-badge { max-width: 150px; padding: 5px 8px 5px 5px; gap: 6px; }
  .me-badge .avatar { width: 28px; height: 28px; font-size: 0.8rem; }
  .me-badge .nm { max-width: 80px; }
  .me-badge .heart { width: 12px; height: 12px; }
  .bet-prompt { width: 150px; padding: 8px; }
  .bet-prompt .bet-btn { width: 38px; height: 38px; font-size: 1rem; }
  .bet-prompt .bp-title { font-size: 0.88rem; }
}


/* ---------- manilha matou manilha (public/clash.js) ----------
   3 s: canvas de fundo atrás da mesa, canvas de frente por cima, título, mesa tingida
   pela cor do baralho de quem venceu (--clash-color) e tremor a cada tempo forte. */
.clash-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; will-change: transform, opacity; }
.clash-bg { z-index: 0; }
.clash-fg { z-index: 70; }
.clash-title {
  position: fixed; left: 50%; top: 22%; z-index: 71; pointer-events: none;
  transform: translate(-50%, -50%); text-align: center; white-space: nowrap;
  animation: clash-title-in 0.5s cubic-bezier(0.2, 0.9, 0.2, 1) both;
  will-change: transform, opacity;
}
.clash-title .ct-main {
  font-family: var(--display); font-weight: 900; letter-spacing: 0.04em;
  font-size: clamp(2rem, 7.5vw, 5.6rem); line-height: 1;
  color: #fff; -webkit-text-stroke: 2px var(--clash-color);
  text-shadow: 0 0 18px var(--clash-color), 0 0 50px var(--clash-color), 0 8px 0 rgba(0, 0, 0, 0.55);
}
.clash-title .ct-sub {
  margin-top: 10px; font-weight: 800; font-size: clamp(0.9rem, 2vw, 1.3rem); color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 14px var(--clash-color);
  animation: clash-sub-in 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) 0.4s both;
}
@keyframes clash-title-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes clash-sub-in { from { opacity: 0; transform: translateY(12px); letter-spacing: 0.3em; } }

/* cada letra do título cai no lugar, uma depois da outra */
.clash-title .ct-ch {
  display: inline-block; will-change: transform, opacity;
  animation: ct-letter 0.5s cubic-bezier(0.2, 1.4, 0.3, 1) both;
  animation-delay: calc(var(--i) * 35ms);
}
@keyframes ct-letter {
  0% { opacity: 0; transform: translateY(-0.9em) scale(1.9) rotate(-12deg); }
  100% { opacity: 1; transform: none; }
}

/* saídas do título (últimos 0,6 s), no mesmo estilo da saída do baralho */
.clash-title.ct-out-iris { animation: ct-out-iris 0.6s cubic-bezier(0.5, 0, 0.8, 0.4) forwards; }
@keyframes ct-out-iris {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}
.clash-title.ct-out-crt { animation: ct-out-crt 0.6s ease-in forwards; }
@keyframes ct-out-crt {
  0% { transform: translate(-50%, -50%) scale(1, 1); }
  55% { transform: translate(-50%, -50%) scale(1.1, 0.02); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0, 0.02); opacity: 0; }
}
.clash-title.ct-out-implode { animation: ct-out-implode 0.6s cubic-bezier(0.6, 0, 0.9, 0.5) forwards; }
@keyframes ct-out-implode {
  0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, 60%) scale(0) rotate(140deg); opacity: 0.4; }
}
.clash-title.ct-out-tear { animation: ct-out-fade 0.6s ease-in forwards; }
.clash-title.ct-out-tear .ct-ch:nth-child(odd) { animation: ct-tear-a 0.55s cubic-bezier(0.5, 0, 0.9, 0.5) forwards; }
.clash-title.ct-out-tear .ct-ch:nth-child(even) { animation: ct-tear-b 0.55s cubic-bezier(0.5, 0, 0.9, 0.5) forwards; }
@keyframes ct-tear-a { to { transform: translate(-60px, -50px) rotate(-25deg); opacity: 0; } }
@keyframes ct-tear-b { to { transform: translate(60px, 50px) rotate(25deg); opacity: 0; } }
.clash-title.ct-out-burn { animation: ct-out-fade 0.6s ease-in forwards; }
.clash-title.ct-out-burn .ct-ch { animation: ct-burn 0.55s ease-in forwards; animation-delay: calc(var(--i) * 25ms); }
@keyframes ct-burn {
  40% { color: #ffb030; text-shadow: 0 0 18px #ff6a00, 0 0 40px #ff6a00; }
  100% { color: #2a1c0f; opacity: 0; transform: translateY(-14px) scale(0.9); }
}
@keyframes ct-out-fade { to { opacity: 0; } }

/* pulso de luz na mesa a cada tempo forte */
.table.clash-pulse { animation: clash-pulse 0.4s cubic-bezier(0.2, 0.9, 0.2, 1); }
@keyframes clash-pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

/* variações de título por baralho */
.clash-title-neon .ct-main { font-style: italic; color: #ffe1f0; position: relative; }
.clash-title-neon .ct-main::before, .clash-title-neon .ct-main::after {
  content: attr(data-text); position: absolute; inset: 0; -webkit-text-stroke: 0; text-shadow: none; mix-blend-mode: screen;
}
.clash-title-neon .ct-main::before { color: #5ee7ff; animation: clash-rgb 0.18s steps(2) infinite; }
.clash-title-neon .ct-main::after { color: #ff3d81; animation: clash-rgb 0.22s steps(2) infinite reverse; }
@keyframes clash-rgb { 0% { transform: translate(-4px, 1px); clip-path: inset(0 0 55% 0); } 100% { transform: translate(4px, -1px); clip-path: inset(45% 0 0 0); } }
.clash-title-pt .ct-main { color: #ffd200; -webkit-text-stroke: 2px #7a080c; font-size: clamp(1.6rem, 5.6vw, 4.2rem); }
.clash-title-pl .ct-main { color: #ffdf00; -webkit-text-stroke: 2px #002776; text-shadow: 0 0 20px #009c3b, 0 8px 0 #002776; }
.clash-title-lain .ct-main { font-family: 'Courier New', monospace; font-size: clamp(1.3rem, 4.6vw, 3.4rem); color: #d9ffe6; -webkit-text-stroke: 0; animation: clash-flicker 0.12s steps(2) infinite; }
@keyframes clash-flicker { 50% { opacity: 0.75; transform: translateX(2px); } }
.clash-title-jjk .ct-main { font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'Noto Serif JP', serif; color: #f5e9ff; -webkit-text-stroke: 1px #ff2a4a; font-size: clamp(2.6rem, 10vw, 7rem); letter-spacing: 0.12em; }
.clash-title-monster .ct-main { color: #0b0b0b; -webkit-text-stroke: 3px #95d600; transform: skewX(-10deg); }
.clash-title-classic .ct-main { color: #fff3c4; font-family: Georgia, 'Times New Roman', serif; }

/* mesa durante a animação */
#screen-game.clash-on .table-rim { box-shadow: 0 0 0 4px var(--clash-color), 0 0 80px var(--clash-color), 0 50px 90px rgba(0, 0, 0, 0.7); transition: box-shadow 0.2s; }
#screen-game.clash-on .table-felt { transition: filter 0.25s; }
#screen-game.clash-classic .table-felt { filter: sepia(0.7) saturate(1.8) brightness(1.05); }
#screen-game.clash-neon .table-felt { animation: clash-hue 1s steps(8) infinite; }
@keyframes clash-hue { from { filter: hue-rotate(0deg) saturate(2); } to { filter: hue-rotate(360deg) saturate(2); } }
#screen-game.clash-pt .table-felt { filter: hue-rotate(-150deg) saturate(1.8); }
#screen-game.clash-pl .table-felt { filter: saturate(1.6) brightness(1.1); }
#screen-game.clash-lain .table-felt { filter: grayscale(1) sepia(1) hue-rotate(80deg) saturate(3) brightness(0.55); }
#screen-game.clash-jjk .table-felt { filter: hue-rotate(140deg) saturate(1.6) brightness(0.55); }
#screen-game.clash-monster .table-felt { filter: grayscale(1) brightness(0.35); }
#screen-game.clash-on .scoreboard, #screen-game.clash-on .hud, #screen-game.clash-on .bottom-bar { transition: opacity 0.2s; opacity: 0.35; }

.table-area.clash-shake { animation: clash-shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes clash-shake {
  0%, 100% { transform: none; }
  15% { transform: translate(-9px, 5px) rotate(-0.6deg); }
  30% { transform: translate(8px, -6px) rotate(0.5deg); }
  45% { transform: translate(-6px, -3px); }
  60% { transform: translate(5px, 4px); }
  80% { transform: translate(-2px, 1px); }
}

/* cartas: a manilha que venceu cresce e brilha, a que morreu racha e cai; a coleta espera 3 s */
.trick-card.clash-win { z-index: 4; }
.trick-card.clash-win .card-svg { animation: clash-win 3s cubic-bezier(0.2, 1.2, 0.3, 1) both; }
@keyframes clash-win {
  0% { transform: scale(1); }
  12% { transform: scale(1.55) rotate(-4deg); filter: drop-shadow(0 0 22px var(--clash-color)) brightness(1.3); }
  20%, 85% { transform: scale(1.35); filter: drop-shadow(0 0 16px var(--clash-color)) brightness(1.1); }
  100% { transform: scale(1.1); filter: none; }
}
.trick-card.clash-lose .card-svg { animation: clash-lose 3s ease-in both; }
@keyframes clash-lose {
  0%, 8% { transform: none; filter: none; }
  12% { transform: translateX(-7px) rotate(-8deg); filter: brightness(2.2); }
  16% { transform: translateX(6px) rotate(6deg); }
  22% { transform: translate(0, 6px) rotate(-14deg) scale(0.92); filter: grayscale(1) brightness(0.55); }
  80% { transform: translate(0, 18px) rotate(-18deg) scale(0.86); filter: grayscale(1) brightness(0.45); opacity: 0.85; }
  100% { transform: translate(0, 26px) rotate(-22deg) scale(0.8); filter: grayscale(1) brightness(0.4); opacity: 0.5; }
}
.trick-card.collect.clash-hold { animation: collect 0.55s ease-in 3.05s forwards; }
.trick-card.drop.collect.clash-hold { animation: drop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), collect 0.55s ease-in 3.05s forwards; }
@media (prefers-reduced-motion: reduce) {
  .table-area.clash-shake, .table.clash-pulse, .clash-title .ct-ch { animation: none; }
}

/* ---------- opções da partida (lobby) ---------- */
.match-opt { margin-top: 8px; }
.opt-value { min-width: 40px; text-align: center; font-family: var(--display); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.segmented button[aria-checked='true']:disabled { opacity: 1; }
.segmented button:disabled:not(.active) { opacity: 0.45; }

/* ---------- palpite: quem vai perder vida (canto inferior direito da mesa) ---------- */
.side-bet {
  position: absolute; right: 12px; bottom: 10px; z-index: 45;
  max-width: min(300px, 86vw); font-size: 0.85rem; color: var(--text);
  background: rgba(8, 14, 26, 0.94); border: 1.5px solid rgba(243, 182, 59, 0.55); border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 22px rgba(243, 182, 59, 0.18);
  animation: sb-in 0.35s cubic-bezier(0.2, 1.3, 0.3, 1);
}
@keyframes sb-in { from { opacity: 0; transform: translateY(14px) scale(0.95); } }
.side-bet.closed { border-radius: 4px; }
.side-bet.placed, .side-bet.done { padding: 8px 12px; }
.side-bet.done { border-color: var(--green); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 22px rgba(47, 191, 113, 0.3); }
.side-bet.open { padding: 10px 12px 12px; }
.sb-open {
  border: 0; background: transparent; color: var(--accent); font-weight: 900; padding: 8px 14px; border-radius: 4px;
  animation: sb-pulse 2s ease-in-out infinite;
}
@keyframes sb-pulse { 50% { box-shadow: 0 0 0 4px rgba(243, 182, 59, 0.18); } }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--accent); }
.sb-x { border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); width: 26px; height: 26px; border-radius: 50%; font-size: 1rem; line-height: 1; }
.sb-desc { margin: 6px 0 8px; font-size: 0.76rem; color: var(--muted); line-height: 1.3; }
.sb-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.sb-pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05); color: var(--text); font-weight: 800;
}
.sb-pick .avatar { width: 24px; height: 24px; font-size: 0.75rem; }
.sb-pick.active { border-color: var(--accent); background: rgba(243, 182, 59, 0.16); }
.sb-confirm { width: 100%; }
.sb-confirm:disabled { opacity: 0.5; }
@media (max-width: 700px) {
  .side-bet { right: 6px; bottom: 6px; font-size: 0.8rem; }
}

/* Ratke: filme antigo (manilha matou manilha) e faixa dourada do Tão Comigo? */
.clash-title-ratke .ct-main { font-family: Georgia, 'Times New Roman', serif; font-style: italic; color: #f4ead5; -webkit-text-stroke: 2px #5a4026; text-shadow: 0 0 18px #d8b878, 0 6px 0 #2a1c0f; }
.clash-title-ukiyo .ct-main { font-family: Georgia, 'Times New Roman', serif; letter-spacing: 6px; color: #f3ead6; -webkit-text-stroke: 2px #1f3b5a; text-shadow: 0 0 0 #c8402e, 4px 4px 0 #c8402e, 0 0 24px rgba(31, 59, 90, 0.9); }
.clash-title-astro .ct-main { font-family: Georgia, 'Times New Roman', serif; letter-spacing: 10px; color: #eef2ff; text-shadow: 0 0 14px #8fa8ff, 0 0 40px #5b6fff, 0 0 80px rgba(207, 216, 255, 0.6); }
.clash-title-steam .ct-main { font-family: Georgia, 'Times New Roman', serif; letter-spacing: 3px; color: #f1d394; -webkit-text-stroke: 2px #6e4a1e; text-shadow: 0 3px 0 #3a2410, 0 0 22px rgba(217, 163, 90, 0.8); }
.clash-title-norse .ct-main { font-family: Georgia, 'Times New Roman', serif; letter-spacing: 5px; color: #e9e4d8; -webkit-text-stroke: 2px #16222b; text-shadow: 0 0 16px #7fd1c7, 0 0 42px rgba(127, 209, 199, 0.55), 0 5px 0 #0f1a21; }
#screen-game.clash-ratke .table-felt { filter: sepia(1) saturate(0.8) brightness(0.9); }
#screen-game.clash-on.clash-ratke .table-rim { animation: clash-flicker-table 0.15s steps(2) infinite; }
@keyframes clash-flicker-table { 50% { filter: brightness(0.9) sepia(0.3); } }
.big-banner.gold { border-color: var(--accent); color: var(--accent); }

/* ---------- fundo pegando fogo (public/heat.js) ----------
   O canvas fica logo atrás da mesa; a mesa e o aviso do topo esquentam junto. */
.heat-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; }
.clash-bg { z-index: 1; }
.heat-badge {
  flex: none;
  padding: 3px 12px; border-radius: 4px; font-size: 0.82rem; font-weight: 800; white-space: nowrap;
  color: #ffe2b0; background: rgba(40, 8, 0, 0.82); border: 1.5px solid #ff7a1a;
  box-shadow: 0 0 18px rgba(255, 110, 0, 0.45); pointer-events: none;
  animation: heat-badge-in 0.4s cubic-bezier(0.2, 1.4, 0.3, 1);
}
.heat-badge b { color: #fff; }
.heat-badge.lvl-3 { border-color: #ff3b1a; box-shadow: 0 0 26px rgba(255, 60, 0, 0.6); animation: heat-badge-in 0.4s cubic-bezier(0.2, 1.4, 0.3, 1), heat-throb 0.9s ease-in-out infinite; }
.heat-badge.lvl-4 {
  border-color: #ff1a1a; color: #fff; background: rgba(90, 0, 0, 0.9);
  box-shadow: 0 0 34px rgba(255, 0, 0, 0.8); animation: heat-badge-in 0.4s cubic-bezier(0.2, 1.4, 0.3, 1), heat-alarm 0.5s steps(2) infinite;
}
@keyframes heat-badge-in { from { opacity: 0; transform: scale(0.7); } }
@keyframes heat-throb { 50% { box-shadow: 0 0 40px rgba(255, 80, 0, 0.9); } }
@keyframes heat-alarm { 50% { background: rgba(200, 0, 0, 0.95); } }

/* a mesa esquenta */
#screen-game.heat-2 .table-rim { box-shadow: 0 0 40px rgba(255, 110, 0, 0.45), 0 50px 90px rgba(0, 0, 0, 0.7); }
#screen-game.heat-3 .table-rim { box-shadow: 0 0 40px rgba(255, 70, 0, 0.5), 0 50px 90px rgba(0, 0, 0, 0.7); }
#screen-game.heat-3 .table-rim::before, #screen-game.heat-4 .table-rim::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 70px rgba(255, 70, 0, 0.75); will-change: opacity;
  animation: heat-rim 1.2s ease-in-out infinite;
}
#screen-game.heat-3 .table-felt { filter: saturate(1.15) sepia(0.25); }
#screen-game.heat-4 .table-rim { box-shadow: 0 0 60px rgba(255, 30, 0, 0.7), 0 50px 90px rgba(0, 0, 0, 0.7); }
#screen-game.heat-4 .table-rim::before { box-shadow: 0 0 110px rgba(255, 30, 0, 0.95); animation-duration: 0.6s; }
#screen-game.heat-4 .table-felt { filter: sepia(0.6) saturate(1.6) hue-rotate(-30deg) brightness(0.85); }
@keyframes heat-rim { 50% { opacity: 0.35; } }
#screen-game.heat-on { background: #070302; }
/* tremor de cada detonação do apocalipse (a animação de manilha matou manilha tem prioridade) */
.table-area.heat-quake:not(.clash-shake) { animation: heat-quake 0.9s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes heat-quake {
  0%, 100% { transform: none; }
  10% { transform: translate(-12px, 6px) rotate(-0.8deg); }
  20% { transform: translate(11px, -8px) rotate(0.7deg); }
  30% { transform: translate(-9px, -4px); }
  45% { transform: translate(7px, 5px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(2px, -1px); }
}
.heat-badge.hidden { display: none; }
@media (max-width: 700px) {
  .heat-badge { padding: 2px 8px; font-size: 0.72rem; }
  .heat-badge .hb-long { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .table-area.heat-quake, .heat-badge { animation: none; }
}

/* posição de cada carta na vaza enquanto as cartas caem: quem está levando brilha, sobe um
   pouco e ganha a etiqueta "👑 levando"; as outras mostram 2º, 3º...; empate no topo, "anulada" */
.trick-card.nulled { opacity: 0.6; filter: grayscale(0.85) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); }
.trick-rank {
  position: absolute; left: 50%; top: -11px; transform: translateX(-50%); z-index: 2;
  min-width: 22px; padding: 1px 7px; border-radius: 4px; text-align: center; white-space: nowrap;
  font-family: var(--display); font-size: clamp(10px, 1.1cqw, 13px); font-weight: 800; line-height: 1.5;
  color: #e7ecf5; background: rgba(8, 14, 26, 0.88); border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  animation: rank-pop 0.3s cubic-bezier(0.2, 1.5, 0.3, 1) both;
}
.trick-rank.nul { color: #ffd7dc; background: rgba(90, 10, 20, 0.92); border-color: #ff5c6c; }
@keyframes rank-pop { from { opacity: 0; transform: translateX(-50%) scale(0.4); } }
@media (max-width: 700px) {
  .trick-rank { font-size: 9px; top: -9px; padding: 0 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .trick-rank { animation: none; }
}

/* Balatro: título em pixel, saída em blocos, e as cartinhas do Jimbo no painel de aposta */
.clash-title-balatro .ct-main {
  font-family: 'Courier New', Courier, monospace; font-weight: 900; letter-spacing: 0.06em;
  color: #f0c040; -webkit-text-stroke: 2px #1c1d2b;
  text-shadow: 4px 4px 0 #e2474f, 8px 8px 0 #1c1d2b, 0 0 30px rgba(240, 192, 64, 0.6);
}
.clash-title.ct-out-pixel { animation: ct-out-fade 0.6s steps(6) forwards; }
.clash-title.ct-out-pixel .ct-ch { animation: ct-pixel 0.45s steps(4) forwards; animation-delay: calc(var(--i) * 30ms); }
@keyframes ct-pixel { to { transform: scale(0.2) translateY(20px); opacity: 0; } }
#screen-game.clash-balatro .table-felt { animation: clash-hue 2.4s steps(10) infinite; }

.bet-prompt.jimbo { flex-wrap: wrap; justify-content: center; }
.jimbo-row { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed rgba(240, 192, 64, 0.45); }
.jimbo-title { font-weight: 800; color: #f0c040; font-size: 0.85rem; max-width: 170px; line-height: 1.25; }
.jimbo-cards { display: flex; gap: 6px; }
.jimbo-card { width: 46px; padding: 0; border: 0; background: none; transition: transform 0.12s ease; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.jimbo-card:hover:not(:disabled) { transform: translateY(-6px) scale(1.08); filter: drop-shadow(0 0 10px rgba(240, 192, 64, 0.9)); }
.jimbo-card:disabled { opacity: 0.5; }
@media (max-width: 700px) {
  .jimbo-row { flex-direction: column; gap: 6px; }
  .jimbo-title { max-width: none; text-align: center; }
  .jimbo-cards { flex-wrap: wrap; justify-content: center; }
  .jimbo-card { width: 38px; }
}

/* arrasto mirando a mesa: na sua vez a mesa acende e a carta brilha; fora da vez fica vermelha */
.my-hand .hcard.dragging.armed {
  transform: rotate(0deg) translateY(-22px) scale(1.25) !important;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(255, 215, 90, 1)) !important;
}
.my-hand .hcard.dropped { animation: card-dropped 0.2s ease-in forwards !important; pointer-events: none; }
@keyframes card-dropped { to { opacity: 0; transform: scale(0.7); } }
.table.drop-ready .table-felt { box-shadow: inset 0 0 0 4px rgba(255, 215, 90, 0.9), inset 0 0 80px rgba(255, 215, 90, 0.45), inset 0 0 90px rgba(0, 0, 0, 0.55); }
.table.drop-no .table-felt { box-shadow: inset 0 0 0 4px rgba(255, 92, 108, 0.85), inset 0 0 70px rgba(255, 92, 108, 0.3), inset 0 0 90px rgba(0, 0, 0, 0.55); }
.table.drop-ready::after, .table.drop-no::after {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  padding: 6px 16px; border-radius: 4px; font-family: var(--display); font-size: clamp(0.9rem, 1.6cqw, 1.3rem); white-space: nowrap;
  animation: drop-hint 0.2s ease-out;
}
.table.drop-ready::after { content: 'Solte para jogar'; background: var(--accent); color: #3d2a00; box-shadow: 0 0 24px rgba(255, 215, 90, 0.7); }
.table.drop-no::after { content: 'Ainda não é sua vez'; background: rgba(90, 10, 20, 0.92); color: #ffd7dc; border: 1.5px solid #ff5c6c; }
@keyframes drop-hint { from { opacity: 0; transform: translate(-50%, 8px); } }

/* cartão com os poderes de um jogador (tocar no crachá na mesa, no placar ou no seu) */
#seats .seat-badge, #sb-list li[data-pid], #me-badge { cursor: pointer; }
.power-peek {
  position: fixed; z-index: 65; width: min(320px, calc(100vw - 16px));
  padding: 12px 12px 10px; border-radius: 6px; color: var(--text);
  background: linear-gradient(180deg, rgba(14, 22, 38, 0.98), rgba(7, 12, 22, 0.98));
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  animation: peek-in 0.22s cubic-bezier(0.2, 1.3, 0.3, 1);
}
@keyframes peek-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }
.pk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pk-back { width: 30px; flex: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
.pk-title { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.pk-title b { font-family: var(--display); font-size: 1.05rem; }
.pk-title small { color: var(--muted); font-size: 0.75rem; }
.pk-x { border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); width: 28px; height: 28px; border-radius: 50%; font-size: 1.1rem; line-height: 1; }
.pk-power { display: flex; gap: 10px; padding: 8px; border-radius: 5px; margin-top: 6px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(243, 182, 59, 0.35); }
.pk-power.global { border-color: rgba(90, 168, 255, 0.4); }
.pk-power.used, .pk-power.locked { opacity: 0.55; filter: grayscale(0.6); }
.pk-icon { font-size: 1.5rem; line-height: 1.2; }
.pk-body { flex: 1; min-width: 0; }
.pk-name { font-weight: 800; font-size: 0.9rem; }
.pk-kind { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--accent); margin-left: 4px; }
.pk-power.global .pk-kind { color: #8cc4ff; }
.pk-desc { font-size: 0.78rem; line-height: 1.3; margin-top: 2px; }
.pk-when { font-size: 0.7rem; color: var(--muted); margin-top: 3px; }
.pk-state { display: inline-block; margin-top: 5px; padding: 1px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 800; background: rgba(255, 255, 255, 0.1); }
.pk-power.ready .pk-state { background: var(--green); color: #052e16; }
.pk-power.used .pk-state { background: rgba(255, 92, 108, 0.25); color: #ffd7dc; }
.pk-rule { margin: 8px 2px 0; font-size: 0.68rem; color: var(--muted); line-height: 1.3; }
.pk-none { margin: 6px 2px; color: var(--muted); font-size: 0.8rem; }
.pk-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 0.72rem; color: var(--muted); }
.pk-flags .flag-chips { position: static; display: flex; gap: 4px; flex-wrap: wrap; }
.pk-flags .flag-chips i { display: inline !important; }

/* aparelho fraco (public/fx.js liga a classe lowfx no <html>): desliga filtros e brilhos animados
   e as sombras de texto muito largas; o resto das animações continua */
.lowfx #screen-game.clash-neon .table-felt, .lowfx #screen-game.clash-balatro .table-felt { animation: none; }
.lowfx #screen-game.heat-3 .table-rim::before, .lowfx #screen-game.heat-4 .table-rim::before { animation: none; }
.lowfx .clash-title .ct-main { text-shadow: 0 0 14px var(--clash-color), 0 6px 0 rgba(0, 0, 0, 0.55); }
.lowfx #screen-game.clash-on.clash-ratke .table-rim { animation: none; }
.lowfx .heat-badge.lvl-3, .lowfx .heat-badge.lvl-4 { animation: heat-badge-in 0.4s cubic-bezier(0.2, 1.4, 0.3, 1); }
/* o vidro fosco (backdrop-filter) dos painéis da mesa é refeito a cada quadro quando há animação
   por trás (fogo das apostas, manilha matou manilha): nessas horas, e em aparelho fraco, sai */
#screen-game.heat-on :is(.scoreboard, .seat-badge, .me-badge, .ult-btn),
#screen-game.clash-on :is(.scoreboard, .seat-badge, .me-badge, .ult-btn),
.lowfx #screen-game :is(.scoreboard, .seat-badge, .me-badge, .ult-btn) {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

/* Brilhos que pulsam sem parar (vez do jogador, botões de poder, painel de aposta, palpite, aviso do
   fogo, botão Play): antes animavam a sombra, o que repinta o elemento inteiro a cada quadro durante
   a partida toda. Agora a sombra fica parada numa camada própria e só a transparência (ou a escala)
   anima, coisa que o navegador faz sem repintar. Mesmo visual. */
.seat-badge, .me-badge, .sb-open, .heat-badge, #btn-play { position: relative; }
@keyframes glow-fade { 50% { opacity: 1; } }
@keyframes ring-out { 0% { transform: scale(1); opacity: 0.9; } 60%, 100% { transform: scale(1.3); opacity: 0; } }

.seat.turn .seat-badge, .me-badge.turn { animation: none; }
.seat.turn .seat-badge::before, .me-badge.turn::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 5px rgba(243, 182, 59, 0.08), 0 0 30px rgba(243, 182, 59, 0.45);
  opacity: 0; will-change: opacity; animation: glow-fade 1.8s ease-in-out infinite;
}

.ult-btn.ready { animation: none; }
.ult-btn.ready::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 3px rgba(var(--pc-rgb), 0.55);
  will-change: transform, opacity; animation: ring-out 1.6s ease-out infinite;
}

.bet-prompt { animation: bet-in 0.45s cubic-bezier(0.2, 1.3, 0.3, 1) backwards; }
.bet-prompt:not(.ult)::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 8px rgba(243, 182, 59, 0.08), 0 0 64px rgba(243, 182, 59, 0.55);
  opacity: 0; will-change: opacity; animation: glow-fade 1.6s ease-in-out 0.5s infinite;
}

.sb-open { animation: none; }
.sb-open::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(243, 182, 59, 0.18);
  opacity: 0; will-change: opacity; animation: glow-fade 2s ease-in-out infinite;
}

.heat-badge.lvl-3 { animation: heat-badge-in 0.4s cubic-bezier(0.2, 1.4, 0.3, 1); }
.heat-badge.lvl-3::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 40px rgba(255, 80, 0, 0.9);
  opacity: 0; will-change: opacity; animation: glow-fade 0.9s ease-in-out infinite;
}

#btn-play { animation: fade-up 0.7s 0.4s backwards; }
#btn-play::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(243, 182, 59, 0.45);
  will-change: transform, opacity; animation: ring-out 2.4s 1.4s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .seat.turn .seat-badge::before, .me-badge.turn::before, .bet-prompt::before, .sb-open::before, .heat-badge::before { animation: none; opacity: 0.6; }
  .ult-btn.ready::before, #btn-play::before { animation: none; opacity: 0; }
}

/* ---------- ambientes em volta da mesa (public/env.js) ----------
   Fica atrás de tudo. Com fogo das apostas volta o fundo escuro (o ambiente some com uma
   transição); a animação de manilha cobre a tela e, na saída, revela o lugar de novo. */
.env-layer { position: absolute; inset: 0; z-index: 0; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity 0.8s ease, visibility 0.8s; }
.env-layer svg { display: block; }
#screen-game.env-on .env-layer { opacity: 1; visibility: visible; }
#screen-game.env-on.heat-on .env-layer { opacity: 0; visibility: hidden; pointer-events: none; }
.ambient { transition: opacity 0.8s ease; }
#screen-game.env-on:not(.heat-on) .ambient { opacity: 0; }
/* texto do topo legível em cenário claro */
#screen-game.env-on:not(.heat-on) .hud { background: linear-gradient(180deg, rgba(5, 8, 14, 0.78), rgba(5, 8, 14, 0)); }
/* os cliques nas faixas vazias da tela chegam nos objetos do ambiente */
#screen-game.env-on .table-area, #screen-game.env-on .hud { pointer-events: none; }
#screen-game.env-on .table-area > :not(.big-banner), #screen-game.env-on .hud > * { pointer-events: auto; }
#screen-game.env-on .hud > .hud-center { pointer-events: none; } /* só texto: deixa clicar no quadro, no mar... */

/* detalhes que se mexem sozinhos (poucos e baratos: só transform/opacity) */
.env-layer .ev-anim, .env-layer .ev-hot { transform-box: fill-box; transform-origin: center !important; }
.env-layer .ev-wave { animation: ev-wave 4.5s ease-in-out infinite alternate; }
@keyframes ev-wave { to { transform: translate(-40px, 6px); } }
.env-layer .ev-glint { animation: ev-glint 3s ease-in-out infinite alternate; }
@keyframes ev-glint { to { opacity: 0.15; } }
.env-layer .ev-ripple { animation: ev-ripple 3s ease-out infinite; }
@keyframes ev-ripple { from { transform: scale(0.4); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.env-layer .ev-blink { animation: ev-blink 1.6s steps(2) infinite; }
@keyframes ev-blink { 50% { opacity: 0.35; } }
.env-layer .ev-caustic { animation: ev-caustic 3.5s ease-in-out infinite alternate; }
@keyframes ev-caustic { to { transform: translate(14px, -6px); opacity: 0.6; } }
.env-layer .ev-embers, .env-layer .ev-flicker { animation: ev-flicker 0.9s ease-in-out infinite alternate; }
@keyframes ev-flicker { to { opacity: 0.55; } }
.env-layer .ev-smoke { animation: ev-smoke 3.2s ease-out infinite; }
@keyframes ev-smoke { from { transform: translate(0, 10px) scale(0.8); opacity: 0.9; } to { transform: translate(20px, -60px) scale(1.6); opacity: 0; } }
.env-layer .ev-flame { animation: ev-flame 0.45s ease-in-out infinite alternate; }
@keyframes ev-flame { to { transform: scale(1.18) rotate(8deg); } }
.env-layer .ev-firefly { animation: ev-blink 2.4s ease-in-out infinite; }
.env-layer .ev-spin { animation: ev-spin 9s linear infinite; }
@keyframes ev-spin { to { transform: rotate(360deg); } }

/* objetos interativos: reagem ao clicar/tocar (sem efeito ao passar o mouse) */
.env-layer .ev-do-shake { animation: ev-shake 0.6s ease-in-out; }
@keyframes ev-shake { 15% { transform: rotate(-8deg) scale(1.04); } 35% { transform: rotate(7deg); } 55% { transform: rotate(-5deg); } 75% { transform: rotate(3deg); } }
.env-layer .ev-do-spin { animation: ev-spin-fast 1.1s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes ev-spin-fast { to { transform: rotate(720deg); } }
.env-layer .ev-do-bounce { animation: ev-bounce 0.7s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes ev-bounce { 30% { transform: translateY(-34px) scale(1.08); } 60% { transform: translateY(0) scale(0.96, 1.04); } 80% { transform: translateY(-10px); } }
.env-layer .ev-do-pop { animation: ev-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes ev-pop { 40% { transform: scale(1.14); } }
.env-layer .ev-do-flash { animation: ev-flash 0.9s steps(2) 3; }
@keyframes ev-flash { 50% { opacity: 0.3; } }
.env-layer .ev-p {
  position: absolute; z-index: 1; pointer-events: none; font-size: 24px; line-height: 1;
  transform: translate(-50%, -50%); animation: ev-p 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}
@keyframes ev-p {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(0.85); }
}
/* aparelho fraco ou quem prefere menos movimento: o cenário fica parado (os cliques seguem) */
.lowfx .env-layer .ev-anim { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .env-layer .ev-anim { animation: none !important; } }

/* lobby: escolha do ambiente (mesmo visual dos outros controles do lobby) */
.lobby-settings.env-opt { flex-direction: column; align-items: stretch; }
.env-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.env-chips button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.3); color: var(--muted);
  font: inherit; font-size: 0.82rem; font-weight: 800; cursor: pointer;
}
.env-chips button span { font-size: 1rem; }
.env-chips button:hover:not(:disabled) { border-color: rgba(243, 182, 59, 0.5); color: var(--text); }
.env-chips button.active { background: var(--accent); border-color: var(--accent); color: #3d2a00; }
.env-chips button:disabled { cursor: default; }
.env-chips button:disabled:not(.active) { opacity: 0.55; }

/* ---------- mesa, cartas e crachás maiores; fundo com menos destaque ----------
   (por cima das regras de tamanho lá de cima, em cada formato de tela) */
:root { --hand-w: clamp(78px, 8vw, 120px); }
.table { width: min(90cqw, calc((100cqh - 84px) * var(--ratio))); }
@media (min-width: 701px) and (min-height: 521px) and (orientation: landscape) {
  .table { width: min(90cqw, max(66cqw, calc(100cqw - 500px)), calc((100cqh - 84px) * var(--ratio))); }
}
.trick-card { width: 7.8cqw; min-width: 54px; }
.vira-card { width: 6cqw; min-width: 44px; }
.mini-card { width: 4.2cqw; min-width: 28px; margin-left: -2.1cqw; }
.seat-badge { zoom: 1.15; }
.me-badge { zoom: 1.08; }

@media (max-width: 700px), (max-height: 520px) {
  :root { --hand-w: clamp(58px, 17vw, 82px); }
  .trick-card { min-width: 48px; }
  .mini-card { min-width: 22px; }
  .seat-badge { zoom: 1.12; }
  .me-badge { zoom: 1; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .table { width: min(94cqw, calc((100cqh - 84px) * var(--ratio))); }
}
@media (max-width: 700px) and (orientation: portrait) and (max-height: 720px) {
  :root { --hand-w: clamp(52px, 15vw, 70px); }
  .table { width: min(94cqw, calc((100cqh - 74px) * var(--ratio))); }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --hand-w: clamp(50px, 7.6vw, 66px); }
  .seat-badge { zoom: 1; } /* tela muito baixa: crachás no tamanho original para não encostar no seu */
  /* os crachás laterais vêm um pouco para dentro: o de baixo à esquerda encostava no seu (já antes) */
  .table { --seat-rx: 45; }
}

/* o lugar em volta fica mais apagado (mais escuro nas bordas) para a mesa se destacar;
   camada parada, sem custo por quadro, e os cliques atravessam até os objetos */
.env-layer::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 72% 68% at 50% 50%, rgba(8, 12, 20, 0.28) 0%, rgba(8, 12, 20, 0.5) 65%, rgba(8, 12, 20, 0.68) 100%);
}

/* a mesa fica sempre no centro da tela. Se algum crachá cair embaixo do placar aberto, o placar
   vira o botão "Placar" no topo (como no celular) e abre quando você quiser (app.js: fitScoreboard) */
#screen-game.sb-collapsed .scoreboard:not(.toggled) { display: none; }
#screen-game.sb-collapsed #btn-scoreboard { display: inline-block; }
/* com o botão Placar e o aviso do fogo, o canto esquerdo do topo quebra linha em vez de invadir a
   mensagem do meio */
.hud-left { flex-wrap: wrap; row-gap: 4px; }

/* ---------- lobby ocupando a tela inteira ----------
   O painel não rola: cabeçalho em cima, rodapé (botão de começar) sempre embaixo, e cada cartão
   (baralho e sala) rola sozinho no meio. A grade de baralhos fica em cima e a descrição embaixo. */
.panel-lobby {
  height: calc(100vh - 24px); height: calc(100dvh - 24px); max-height: none;
  overflow: hidden;
}
.lobby-head, .lobby-footer, #lobby-banner { flex: none; }
.lobby-body { flex: 1 1 auto; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.lobby-card { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lobby-footer { position: static; }
.deck-hero { margin-bottom: 0; margin-top: 14px; }
@media (max-width: 860px) {
  /* uma coluna: os dois cartões dividem a altura, cada um com sua rolagem */
  .lobby-body { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 700px), (max-height: 520px) {
  .panel-lobby { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border-left: 0; border-right: 0; }
  .deck-hero { margin-top: 10px; }
}

/* ---------- barra de rolagem no estilo do jogo ----------
   fina, dourada translúcida sobre fundo escuro, arredondada; mais forte ao passar o mouse */
* { scrollbar-width: thin; scrollbar-color: rgba(243, 182, 59, 0.45) rgba(255, 255, 255, 0.04); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); border-radius: 4px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 215, 120, 0.55), rgba(243, 182, 59, 0.4));
  border-radius: 4px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(255, 224, 138, 0.85), rgba(243, 182, 59, 0.7)); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
/* "No fim da sequência" tem três opções: os botões ficam numa linha própria, com a largura toda */
.lobby-settings.end-opt { flex-direction: column; align-items: stretch; gap: 8px; }
.end-opt .segmented { display: flex; width: 100%; }
.end-opt .segmented button { flex: 1 1 0; padding: 7px 8px; white-space: nowrap; }

/* ---------- lobby no estilo do baralho escolhido ----------
   Cada baralho define a cor de destaque (--accent), a cor do texto sobre ela (--accent-ink), o
   fundo da tela e o painel. O resto do lobby usa essas variáveis. */
#screen-lobby {
  --accent-ink: #3d2a00; --accent-hi: #ffd674;
  --lobby-bg: radial-gradient(1200px 800px at 15% 10%, #1a2f4f 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, #123a2a 0%, transparent 60%), #0b1220;
  --lobby-panel: rgba(16, 24, 40, 0.86); --lobby-solid: rgba(16, 24, 40, 0.98);
  background: var(--lobby-bg);
}
#screen-lobby[data-skin="neon"] {
  --accent: #ff3d81; --accent-hi: #ff7aa8; --accent-ink: #fff;
  --lobby-bg: radial-gradient(1100px 700px at 12% 8%, rgba(139, 92, 246, 0.35) 0%, transparent 60%), radial-gradient(900px 700px at 92% 95%, rgba(94, 231, 255, 0.22) 0%, transparent 60%), #07081a;
  --lobby-panel: rgba(12, 12, 32, 0.88); --lobby-solid: rgba(12, 12, 32, 0.98);
}
#screen-lobby[data-skin="pt"] {
  --accent: #e3262e; --accent-hi: #ff5a60; --accent-ink: #fff;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(196, 22, 28, 0.45) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(255, 210, 0, 0.12) 0%, transparent 60%), #1a0507;
  --lobby-panel: rgba(38, 10, 12, 0.88); --lobby-solid: rgba(38, 10, 12, 0.98);
}
#screen-lobby[data-skin="pl"] {
  --accent: #f7d117; --accent-hi: #ffe45c; --accent-ink: #12306f;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(27, 63, 143, 0.55) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(0, 156, 59, 0.3) 0%, transparent 60%), #071330;
  --lobby-panel: rgba(12, 26, 62, 0.88); --lobby-solid: rgba(12, 26, 62, 0.98);
}
#screen-lobby[data-skin="lain"] {
  --accent: #19ff6a; --accent-hi: #7dffab; --accent-ink: #032010;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(25, 255, 106, 0.12) 0%, transparent 60%), #020403;
  --lobby-panel: rgba(4, 12, 7, 0.9); --lobby-solid: rgba(4, 12, 7, 0.98);
}
#screen-lobby[data-skin="jjk"] {
  --accent: #a855f7; --accent-hi: #c084fc; --accent-ink: #fff;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(168, 85, 247, 0.35) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(255, 42, 74, 0.15) 0%, transparent 60%), #0a0712;
  --lobby-panel: rgba(18, 12, 32, 0.88); --lobby-solid: rgba(18, 12, 32, 0.98);
}
#screen-lobby[data-skin="monster"] {
  --accent: #95d600; --accent-hi: #c6ff3a; --accent-ink: #0b1400;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(149, 214, 0, 0.18) 0%, transparent 60%), #050605;
  --lobby-panel: rgba(12, 14, 10, 0.9); --lobby-solid: rgba(12, 14, 10, 0.98);
}
#screen-lobby[data-skin="ratke"] {
  --accent: #d8b878; --accent-hi: #ecd3a0; --accent-ink: #2a1c0f;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(216, 184, 120, 0.22) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(47, 74, 99, 0.45) 0%, transparent 60%), #15100a;
  --lobby-panel: rgba(36, 28, 18, 0.9); --lobby-solid: rgba(36, 28, 18, 0.98);
}
#screen-lobby[data-skin="balatro"] {
  --accent: #f0c040; --accent-hi: #ffd86a; --accent-ink: #1c1d2b;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(192, 48, 63, 0.4) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(47, 168, 160, 0.3) 0%, transparent 60%), #14151f;
  --lobby-panel: rgba(28, 29, 43, 0.9); --lobby-solid: rgba(28, 29, 43, 0.98);
}
#screen-lobby[data-skin="deco"] {
  --accent: #d4af37; --accent-hi: #f0d36a; --accent-ink: #12100a;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(212, 175, 55, 0.2) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(30, 80, 70, 0.3) 0%, transparent 60%), #0a0a0c;
  --lobby-panel: rgba(16, 15, 14, 0.9); --lobby-solid: rgba(16, 15, 14, 0.98);
}
#screen-lobby[data-skin="ukiyo"] {
  --accent: #c8402e; --accent-hi: #e2664f; --accent-ink: #fff;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(31, 59, 90, 0.55) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(200, 64, 46, 0.18) 0%, transparent 60%), #0c1622;
  --lobby-panel: rgba(18, 30, 44, 0.9); --lobby-solid: rgba(18, 30, 44, 0.98);
}
#screen-lobby[data-skin="tarot"] {
  --accent: #e8c76a; --accent-hi: #f5dd95; --accent-ink: #2a1236;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(59, 29, 74, 0.6) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(232, 199, 106, 0.14) 0%, transparent 60%), #140a1a;
  --lobby-panel: rgba(30, 16, 38, 0.9); --lobby-solid: rgba(30, 16, 38, 0.98);
}
#screen-lobby[data-skin="steam"] {
  --accent: #d9a35a; --accent-hi: #eec089; --accent-ink: #1e140c;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(192, 138, 62, 0.25) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(80, 110, 100, 0.25) 0%, transparent 60%), #120c08;
  --lobby-panel: rgba(32, 22, 14, 0.9); --lobby-solid: rgba(32, 22, 14, 0.98);
}
#screen-lobby[data-skin="norse"] {
  --accent: #7fd1c7; --accent-hi: #a8e6de; --accent-ink: #0f1a21;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(127, 209, 199, 0.18) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(120, 90, 200, 0.18) 0%, transparent 60%), #0a1116;
  --lobby-panel: rgba(16, 26, 32, 0.9); --lobby-solid: rgba(16, 26, 32, 0.98);
}
#screen-lobby[data-skin="egito"] {
  --accent: #e3b94a; --accent-hi: #f2d27a; --accent-ink: #0d2250;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(20, 48, 107, 0.6) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(227, 185, 74, 0.16) 0%, transparent 60%), #08142e;
  --lobby-panel: rgba(14, 26, 54, 0.9); --lobby-solid: rgba(14, 26, 54, 0.98);
}
#screen-lobby[data-skin="astro"] {
  --accent: #8fa8ff; --accent-hi: #b9c8ff; --accent-ink: #050a1c;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(143, 168, 255, 0.2) 0%, transparent 60%), radial-gradient(900px 700px at 90% 95%, rgba(150, 90, 220, 0.2) 0%, transparent 60%), #040817;
  --lobby-panel: rgba(10, 16, 38, 0.9); --lobby-solid: rgba(10, 16, 38, 0.98);
}
#screen-lobby[data-skin="noir"] {
  --accent: #e8e8e8; --accent-hi: #ffffff; --accent-ink: #111;
  --lobby-bg: radial-gradient(1100px 700px at 15% 10%, rgba(255, 255, 255, 0.08) 0%, transparent 60%), repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 14px, transparent 14px 34px), #0b0b0b;
  --lobby-panel: rgba(20, 20, 20, 0.92); --lobby-solid: rgba(20, 20, 20, 0.98);
}
#screen-lobby .panel-lobby {
  background: var(--lobby-panel);
  border-color: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.08));
}
#screen-lobby .lobby-footer { background: linear-gradient(180deg, transparent, var(--lobby-solid) 35%); }
#screen-lobby .btn-primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
#screen-lobby .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, var(--accent-hi), var(--accent-hi)); }
#screen-lobby .step-n, #screen-lobby .segmented button.active, #screen-lobby .env-chips button.active { color: var(--accent-ink); }
#screen-lobby .skin-tile.selected { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#screen-lobby .player-list li.me { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
#screen-lobby .deck-hero {
  background: radial-gradient(ellipse at 20% 40%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), rgba(0, 0, 0, 0.22);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
#screen-lobby * { scrollbar-color: color-mix(in srgb, var(--accent) 50%, transparent) rgba(255, 255, 255, 0.04); }
#screen-lobby ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 55%, transparent); background-clip: padding-box; }

/* desempenho do lobby: o painel e o rodapé já são quase opacos, então o vidro fosco (desfoque do
   fundo, refeito a cada troca de baralho) sai; a troca de estilo é instantânea, sem repintar o
   painel inteiro durante uma transição */
#screen-lobby .panel-lobby, #screen-lobby .lobby-footer { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- interface mais sóbria: menos arredondado, sem vidro, sem brilho decorativo ----------
   Painéis sólidos, botões de cor chapada, sombras curtas. Os efeitos de JOGO (carta vencedora,
   fogo, animações de manilha) continuam como estão. */
.panel { background: #121b2c; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.seat-badge, .me-badge, .ult-btn { background: rgba(10, 15, 27, 0.95); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.scoreboard { background: rgba(10, 15, 27, 0.97); }
.lobby-card { background: rgba(255, 255, 255, 0.025); }
.btn-primary { background: var(--accent); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.btn-primary:hover:not(:disabled) { background: #ffc94f; }
#screen-lobby .btn-primary { background: var(--accent); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
#screen-lobby .btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
.bet-prompt { background: #1a1408; }
.big-banner, .big-banner.good, .big-banner.bad, .big-banner.global, .big-banner.gold { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); }
.deck-hero, #screen-lobby .deck-hero { background: rgba(0, 0, 0, 0.25); }
.power-peek { background: #0e1626; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6); }
.side-bet { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
.heat-badge { box-shadow: none; }
.toast { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
/* celular: o lobby ocupa a tela toda, então o cabeçalho deixa espaço para os botões fixos de som e
   tela cheia no canto (senão "Sair da sala" fica embaixo deles) */
@media (max-width: 700px), (max-height: 520px) {
  .lobby-head { padding-right: 84px; }
}

/* "Quantas vazas você vai fazer?" com muitas opções: os botões descem para baixo do texto e quebram
   em mais linhas dentro do painel, em vez de passar da borda (vale também para a Recontagem) */
.bet-prompt { flex-wrap: wrap; justify-content: center; }
.bet-prompt .bet-buttons { flex-wrap: wrap; min-width: 0; max-width: 100%; justify-content: center; row-gap: 6px; }
/* tela estreita: com o painel de aposta aberto (que pode ter várias linhas de botões), o Palpite
   sobe para o canto de cima da mesa em vez de ficar por cima dos botões de aposta */
@media (max-width: 900px) {
  #bet-prompt:not(.hidden) ~ #side-bet { bottom: auto; top: 8px; }
}

/* ---------- animação de uso de poder (public/powerfx.js) ----------
   Carta do poder entra girando no centro da mesa (cor do baralho de quem usou), com anéis, o
   movimento próprio do ícone e partículas. Só transform/opacity. */
.pfx { position: fixed; z-index: 64; width: 0; height: 0; pointer-events: none; }
.pfx-card {
  position: absolute; left: 0; top: 0; width: 150px; padding: 16px 10px 12px; text-align: center;
  transform: translate(-50%, -50%); background: #0e1626; border: 2px solid var(--pc); border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6), 0 0 0 4px color-mix(in srgb, var(--pc) 18%, transparent);
  animation: pfx-card 1.7s cubic-bezier(0.2, 0.9, 0.2, 1) both; will-change: transform, opacity;
}
.pfx-global .pfx-card { border-style: dashed; }
@keyframes pfx-card {
  0% { opacity: 0; transform: translate(-50%, -50%) perspective(600px) rotateY(90deg) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) perspective(600px) rotateY(0deg) scale(1.06); }
  28%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -75%) scale(0.92); }
}
.pfx-icon { font-size: 56px; line-height: 1.1; height: 66px; display: grid; place-items: center; }
.pfx-icon span { display: inline-block; will-change: transform, opacity; }
.pfx-name { margin-top: 6px; font-family: var(--display); font-size: 1.05rem; color: #fff; line-height: 1.15; }
.pfx-who { margin-top: 4px; font-size: 0.72rem; font-weight: 800; color: var(--pc); text-transform: uppercase; letter-spacing: 0.4px; }
.pfx-ring {
  position: absolute; left: 0; top: 0; width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 50%;
  border: 3px solid var(--pc); opacity: 0; animation: pfx-ring 0.8s ease-out 0.15s both; will-change: transform, opacity;
}
.pfx-ring2 { animation-delay: 0.32s; border-width: 2px; }
@keyframes pfx-ring { from { opacity: 0.9; transform: scale(0.3); } to { opacity: 0; transform: scale(2.6); } }
.pfx-p {
  position: absolute; left: 0; top: 0; font-size: 26px; line-height: 1; transform: translate(-50%, -50%);
  animation: pfx-p 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; will-change: transform, opacity;
}
@keyframes pfx-p {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(1); }
}

/* o movimento de cada poder (no ícone da carta, depois que ela vira) */
.pfx-icon span { animation: 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) 0.3s both; }
.pfx-m-slam .pfx-icon span { animation-name: pfx-slam; }
@keyframes pfx-slam { 0% { transform: scale(2.4) translateY(-30px); opacity: 0; } 40% { transform: scale(0.9); opacity: 1; } 55% { transform: scale(1.1) rotate(-4deg); } 70% { transform: rotate(4deg); } 100% { transform: none; } }
.pfx-m-sweep .pfx-icon span { animation-name: pfx-sweep; }
@keyframes pfx-sweep { 0% { transform: translateX(-50px) rotate(-35deg); } 35% { transform: translateX(45px) rotate(30deg); } 65% { transform: translateX(-25px) rotate(-15deg); } 100% { transform: none; } }
.pfx-m-charge .pfx-icon span { animation-name: pfx-charge; animation-timing-function: steps(1); }
@keyframes pfx-charge { 0% { transform: scale(0.7); opacity: 0.4; } 25% { transform: scale(0.85); opacity: 0.6; } 50% { transform: scale(1); opacity: 0.8; } 75% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
.pfx-m-glitch .pfx-icon span { animation-name: pfx-glitch; animation-timing-function: steps(1); text-shadow: -3px 0 #5ee7ff, 3px 0 #ff3d81; }
@keyframes pfx-glitch { 0% { transform: translate(-6px, 2px); } 15% { transform: translate(5px, -3px) skewX(12deg); } 30% { transform: translate(-3px, 0) scaleY(0.7); } 45% { transform: translate(6px, 3px); } 60% { transform: skewX(-15deg); } 75% { transform: translate(-2px, -2px); } 100% { transform: none; } }
.pfx-m-punch .pfx-icon span { animation-name: pfx-punch; }
@keyframes pfx-punch { 0% { transform: translateY(40px) scale(0.6); } 35% { transform: translateY(-34px) scale(1.4); } 60% { transform: translateY(-20px) scale(1.25); } 100% { transform: none; } }
.pfx-m-tilt .pfx-icon span { animation-name: pfx-tilt; animation-duration: 1.1s; }
@keyframes pfx-tilt { 0% { transform: rotate(-24deg); } 30% { transform: rotate(20deg); } 55% { transform: rotate(-12deg); } 78% { transform: rotate(6deg); } 100% { transform: none; } }
.pfx-m-shake .pfx-icon span { animation-name: pfx-shake; animation-timing-function: linear; }
@keyframes pfx-shake { 10%, 50%, 90% { transform: translateX(-10px) rotate(-6deg); } 30%, 70% { transform: translateX(10px) rotate(6deg); } 100% { transform: none; } }
.pfx-m-spin .pfx-icon span { animation-name: pfx-spin; animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes pfx-spin { from { transform: rotate(-360deg) scale(0.5); } to { transform: none; } }
.pfx-m-open .pfx-icon span { animation-name: pfx-open; }
@keyframes pfx-open { 0% { transform: scaleY(0.05) scaleX(1.3); } 40% { transform: scaleY(0.05) scaleX(1.3); } 70% { transform: scaleY(1.25); } 100% { transform: none; } }
.pfx-m-waves .pfx-icon span { animation-name: pfx-waves; animation-iteration-count: 2; animation-duration: 0.5s; }
@keyframes pfx-waves { 50% { transform: scale(1.22); } }
.pfx-m-waves .pfx-ring { animation-iteration-count: 2; }
.pfx-m-expand .pfx-icon span { animation-name: pfx-expand; }
@keyframes pfx-expand { 0% { transform: scale(0.2) rotate(-180deg); opacity: 0; } 50% { transform: scale(2.2) rotate(30deg); opacity: 1; } 100% { transform: none; } }
.pfx-m-expand .pfx-ring { border-width: 6px; }
.pfx-m-stamp .pfx-icon span { animation-name: pfx-stamp; animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
@keyframes pfx-stamp { 0% { transform: scale(3.2) rotate(-25deg); opacity: 0; } 45% { transform: scale(0.92) rotate(-12deg); opacity: 1; } 60% { transform: scale(1.05) rotate(-12deg); } 100% { transform: rotate(-12deg); } }
.pfx-m-crush .pfx-icon span { animation-name: pfx-crush; }
@keyframes pfx-crush { 0% { transform: translateY(-40px); } 30% { transform: none; } 50% { transform: scaleY(0.3) scaleX(1.5); } 70% { transform: scaleY(0.45) scaleX(1.35); } 100% { transform: scaleY(0.5) scaleX(1.3); } }
.pfx-m-zap .pfx-icon span { animation-name: pfx-zap; animation-timing-function: steps(1); }
@keyframes pfx-zap { 0% { opacity: 0; transform: scale(1.4); } 15% { opacity: 1; } 30% { opacity: 0.2; } 45% { opacity: 1; transform: scale(1.25); } 60% { opacity: 0.3; } 75% { opacity: 1; transform: scale(1.1); } 100% { transform: none; } }
.pfx-m-talk .pfx-icon span { animation-name: pfx-talk; animation-iteration-count: 3; animation-duration: 0.35s; animation-timing-function: ease-in-out; }
@keyframes pfx-talk { 50% { transform: translateY(-10px) rotate(-6deg) scale(1.08); } }
.pfx-m-shake2 .pfx-icon span { animation-name: pfx-shake2; }
@keyframes pfx-shake2 { 0% { transform: scale(0.6); } 25% { transform: translateY(-12px) scale(1.15); } 45% { transform: translateY(8px); } 65% { transform: translateY(-8px); } 85% { transform: translateY(4px); } 100% { transform: none; } }
.pfx-m-flip .pfx-icon span { animation-name: pfx-flip; animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes pfx-flip { from { transform: perspective(300px) rotateY(-720deg) scale(0.6); } to { transform: none; } }
.pfx-m-fan .pfx-icon span { animation-name: pfx-fan; }
@keyframes pfx-fan { 0% { transform: rotate(-60deg) translateX(-20px); opacity: 0; } 50% { transform: rotate(20deg); opacity: 1; } 100% { transform: none; } }

.lowfx .pfx-ring2 { display: none; }
@media (prefers-reduced-motion: reduce) { .pfx-icon span, .pfx-ring, .pfx-p { animation: none !important; } }

/* ---------- chat da sala (botão 💬 entre o som e a tela cheia) ---------- */
.chat-btn { position: relative; }
.chat-btn.active { background: rgba(243, 182, 59, 0.16); color: var(--text); border-color: rgba(243, 182, 59, 0.45); }
.chat-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 4px;
  background: var(--red); color: #fff; font-size: 0.66rem; font-weight: 900; line-height: 17px; text-align: center;
}
.chat-badge.hidden { display: none; }
.chat-panel {
  position: fixed; z-index: 85; right: calc(12px + env(safe-area-inset-right)); top: calc(54px + env(safe-area-inset-top));
  width: min(340px, calc(100vw - 24px)); height: min(62vh, 520px);
  display: flex; flex-direction: column;
  background: #0f1727; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  animation: chat-in 0.18s ease-out;
}
.chat-panel.hidden { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(-6px); } }
.chat-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.chat-head b { font-family: var(--display); font-size: 1rem; }
.chat-head small { flex: 1; font-size: 0.7rem; }
.chat-x { border: 0; background: rgba(255, 255, 255, 0.07); color: var(--text); width: 26px; height: 26px; border-radius: 4px; font-size: 1rem; line-height: 1; }
.chat-list { list-style: none; margin: 0; padding: 8px 10px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.chat-msg { padding: 6px 8px; border-radius: 4px; }
.chat-msg + .chat-msg { margin-top: 4px; }
.chat-msg.mine { background: rgba(243, 182, 59, 0.07); }
.chat-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 0.72rem; }
.chat-meta b { font-size: 0.82rem; color: hsl(var(--hue) 75% 68%); }
.chat-where { padding: 0 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); color: var(--muted); font-weight: 800; }
.chat-time { color: rgba(167, 178, 197, 0.6); margin-left: auto; }
.chat-text { margin-top: 2px; font-size: 0.9rem; line-height: 1.3; overflow-wrap: anywhere; }
.chat-empty { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 24px 8px; }
.chat-form { display: flex; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.chat-form input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3); color: var(--text); font: inherit; font-size: 0.9rem;
}
.chat-form input:focus { outline: none; border-color: rgba(243, 182, 59, 0.6); }
@media (max-width: 700px) {
  .chat-panel { height: min(56vh, 440px); }
}

/* ---------- histórico de avisos (botão 📜, mesmo painel do chat) ---------- */
.log-btn.active { background: rgba(243, 182, 59, 0.16); color: var(--text); border-color: rgba(243, 182, 59, 0.45); }
.log-msg { border-left: 3px solid rgba(255, 255, 255, 0.14); border-radius: 0 4px 4px 0; }
.log-msg + .log-msg { margin-top: 3px; }
.log-msg .chat-text { margin-top: 1px; font-size: 0.86rem; }
.log-gold { border-left-color: #f3b63b; }
.log-good { border-left-color: #3ecf74; background: rgba(62, 207, 116, 0.06); }
.log-bad { border-left-color: #e5484d; }
.log-global { border-left-color: #8b7bff; }

/* =====================================================================
   Animações refinadas (mesmo núcleo de antes; só transform/opacity)
   ===================================================================== */
/* carta jogada: nasce na mão (ou no crachá de quem jogou), faz um arco curto e assenta na mesa */
.trick-card.drop { animation: drop 0.52s cubic-bezier(0.3, 0.7, 0.3, 1); }
.trick-card.from-hand { --o0: 1; }
@keyframes drop {
  0% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) rotate(var(--rot0, var(--rot, 0deg))) scale(var(--s0, 0.55)); opacity: var(--o0, 0); }
  22% { opacity: 1; }
  68% { transform: translate(-50%, calc(-50% - 7px)) rotate(var(--rot, 0deg)) scale(1.07); }
  84% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.97); }
  100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); opacity: 1; }
}
/* anel no feltro quando a carta encosta */
.trick-card.drop::after {
  content: ''; position: absolute; left: -12%; right: -12%; top: -8%; bottom: -8%; z-index: -1;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.5); pointer-events: none;
  opacity: 0; animation: land-ring 0.5s ease-out 0.36s;
}
@keyframes land-ring { 0% { opacity: 0.75; transform: scale(0.88); } 100% { opacity: 0; transform: scale(1.35); } }
/* a minha carta fica parada (levemente erguida) até a mesa receber a jogada */
.my-hand .hcard.flying { animation: fly-hold 0.16s ease-out forwards; pointer-events: none; }
@keyframes fly-hold { to { transform: rotate(var(--rot, 0deg)) translateY(calc(var(--lift, 0px) - 10px)) scale(1.04); } }
.my-hand .hcard.dropped { animation: none !important; pointer-events: none; }

/* vaza decidida: perdedoras apagam um pouco, todas se juntam embaixo da vencedora e voam juntas */
.trick-card.loser:not(.clash-lose) .card-svg { animation: trick-dim 0.35s ease 0.25s forwards; }
@keyframes trick-dim { to { opacity: 0.62; } }
.trick-card.collect { animation: collect 0.95s 1.45s forwards; }
.trick-card.drop.collect { animation: drop 0.52s cubic-bezier(0.3, 0.7, 0.3, 1), collect 0.95s 1.45s forwards; }
.trick-card.collect.clash-hold { animation: collect 0.95s 2.75s forwards; }
.trick-card.drop.collect.clash-hold { animation: drop 0.52s cubic-bezier(0.3, 0.7, 0.3, 1), collect 0.95s 2.75s forwards; }
@keyframes collect {
  0% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1); }
  38% { transform: translate(calc(-50% + var(--gx, 0px)), calc(-50% + var(--gy, 0px))) rotate(calc(var(--rot, 0deg) * 0.4)) scale(0.94); opacity: 1; }
  52% { transform: translate(calc(-50% + var(--gx, 0px)), calc(-50% + var(--gy, 0px))) rotate(calc(var(--rot, 0deg) * 0.4)) scale(0.94); opacity: 1; animation-timing-function: cubic-bezier(0.55, 0, 0.8, 0.45); }
  88% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--wx, 0px)), calc(-50% + var(--wy, 0px))) rotate(0deg) scale(0.3); opacity: 0; }
}
.seat.won .seat-badge, .me-badge.won { animation: bounce 0.6s cubic-bezier(0.2, 1.5, 0.3, 1) 2.3s; }
/* empate: tremem e escorregam para o centro sumindo */
.trick-card.tied { animation: tied 1.1s ease-in-out 1.4s forwards; }
.trick-card.drop.tied { animation: drop 0.52s cubic-bezier(0.3, 0.7, 0.3, 1), tied 1.1s ease-in-out 1.4s forwards; }
@keyframes tied {
  0% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); }
  10% { transform: translate(calc(-50% - 7px), -50%) rotate(calc(var(--rot, 0deg) - 6deg)); }
  20% { transform: translate(calc(-50% + 7px), -50%) rotate(calc(var(--rot, 0deg) + 6deg)); }
  30% { transform: translate(calc(-50% - 4px), -50%) rotate(var(--rot, 0deg)); }
  40% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); opacity: 1; animation-timing-function: cubic-bezier(0.5, 0, 0.75, 0.3); }
  100% { transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) rotate(calc(var(--rot, 0deg) * -2)) scale(0.45); opacity: 0; }
}

/* distribuição: a carta sai girando do monte, passa um pouco do lugar e assenta */
@keyframes deal-in {
  0% { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(-28deg) scale(0.45); opacity: 0; }
  14% { opacity: 1; }
  72% { transform: rotate(var(--rot, 0deg)) translateY(calc(var(--lift, 0px) - 10px)) scale(1.04); }
  100% { transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)) scale(1); opacity: 1; }
}
@keyframes deal-mini {
  0% { transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(-28deg) scale(0.5); opacity: 0; }
  14% { opacity: 1; }
  72% { transform: rotate(var(--mrot, 0deg)) scale(1.06); }
  100% { transform: rotate(var(--mrot, 0deg)) scale(1); opacity: 1; }
}
.my-hand .hcard.deal { animation-duration: 0.62s; }
.mini-card.deal { animation-duration: 0.62s; }
/* vira: cai virando, passa do ponto e volta */
.vira-card.flip { animation-duration: 0.75s; }
@keyframes flip-in {
  0% { transform: perspective(500px) translateY(-18px) rotateY(90deg) scale(1.15); opacity: 0; }
  45% { opacity: 1; }
  60% { transform: perspective(500px) translateY(-4px) rotateY(-14deg) scale(1.06); }
  100% { transform: perspective(500px) translateY(0) rotateY(0deg) scale(1); opacity: 1; }
}

/* faixa do meio: sobe um pouco ao entrar, um brilho passa por ela, sai subindo */
.big-banner { overflow: hidden; }
.big-banner::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 60%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-120%) skewX(-12deg);
}
.big-banner.show::after { animation: banner-shine 0.8s cubic-bezier(0.3, 0, 0.3, 1) 0.22s; }
@keyframes banner-shine { to { transform: translateX(260%) skewX(-12deg); } }
@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, calc(-50% + 14px)) scale(0.82); }
  11% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  19% { transform: translate(-50%, -50%) scale(1); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(0.97); }
}

/* avisos: entram com uma molinha, saem deslizando e o espaço fecha sem pulo */
.toast { animation: toast-in 0.38s cubic-bezier(0.2, 1.25, 0.3, 1) backwards; }
@keyframes toast-in { from { transform: translateX(26px) scale(0.96); opacity: 0; } }
.toast.out { overflow: hidden; animation: toast-out 0.42s ease-in forwards; }
@keyframes toast-out {
  0% { height: var(--h); }
  50% { height: var(--h); opacity: 0; transform: translateX(26px); }
  100% { height: 0; opacity: 0; transform: translateX(26px); padding-top: 0; padding-bottom: 0; margin-top: -8px; border-width: 0; }
}

/* resumo da rodada e fim de partida: o cartão sobe ao abrir e some suave ao fechar */
.overlay .modal { animation: modal-in 0.5s cubic-bezier(0.2, 1.15, 0.3, 1) backwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(26px) scale(0.94); } }
.overlay.leaving { animation: fade-out 0.28s ease-in forwards; pointer-events: none; }
.overlay.leaving .modal { animation: modal-out 0.28s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(-14px) scale(0.97); } }

/* painel de aposta: o número escolhido salta e o painel desce sumindo */
.bet-btn.chosen { animation: chosen-pop 0.3s cubic-bezier(0.2, 1.5, 0.3, 1); }
@keyframes chosen-pop { 50% { transform: scale(1.18); } }
.bet-prompt.leaving { animation: bet-out 0.22s ease-in forwards; pointer-events: none; }
.bet-prompt.leaving::before { display: none; }
@keyframes bet-out { to { opacity: 0; translate: 0 18px; scale: 0.96; } }

.lowfx .trick-card.drop::after, .lowfx .big-banner::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  .trick-card.drop::after, .big-banner::after { display: none; }
  .trick-card.drop, .toast, .overlay .modal { animation-duration: 0.01s; }
}

/* =====================================================================
   Celular 100%: topo com os 4 botões (som, chat, histórico, tela cheia), crachás sempre dentro da
   tela, cartas da vaza longe dos crachás laterais, lobby/aposta/poderes no celular deitado
   ===================================================================== */
body:not(.in-room) #btn-chat, body:not(.in-room) #btn-log { display: none; }
.power-peek { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; }

@media (max-width: 700px), (max-height: 520px) {
  /* 4 botões de 30px: ocupam ~144px no canto direito (o resto do topo desvia deles) */
  .top-actions { gap: 4px; top: calc(8px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
  .btn-icon { width: 30px; height: 30px; font-size: 0.9rem; }
  .chat-badge { top: -5px; right: -5px; }
}

/* celular em pé */
@media (max-width: 700px) and (orientation: portrait) {
  /* placar e pílulas quebram linha antes dos botões; o recado do meio fica embaixo deles */
  .hud-left { margin-right: 140px; min-height: 32px; align-content: flex-start; }
  /* crachás dos lados um pouco para dentro e cartas da vaza mais juntas no meio (sem encostar neles) */
  .table { --seat-rx: 38; --trick-rx: 17; --trick-ry: 29; }
  .trick-card { min-width: 44px; }
  /* lobby: o cabeçalho desce para baixo da fileira de botões */
  .panel-lobby { padding-top: calc(46px + env(safe-area-inset-top)); }
  .lobby-head { padding-right: 0; }
  .toasts { top: calc(env(safe-area-inset-top) + 84px); }
  /* Palpite com o painel de aposta aberto: canto de cima à esquerda (à direita fica o leque de quem
     senta no topo) */
  #bet-prompt:not(.hidden) ~ #side-bet { left: 6px; right: auto; }
}

/* celular deitado */
@media (max-height: 520px) and (orientation: landscape) {
  .hud { padding-right: calc(150px + env(safe-area-inset-right)); }
  .lobby-head { padding-right: 150px; }
  /* lobby em duas colunas (baralho | sala), cada uma com sua rolagem */
  .lobby-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 10px; }
  .panel-lobby { padding-top: 10px; }
  .lobby-head { margin-bottom: 8px; }
  .lobby-footer { margin-top: 8px; padding-top: 8px; padding-bottom: 8px; }
  .lobby-actions .btn { padding: 10px 16px; }
  /* painel de aposta estreito no canto: o texto quebra linha em vez de ser cortado */
  .bet-prompt .bp-title { white-space: normal; line-height: 1.15; }
  .bet-prompt:not(.ult) .bp-sub { white-space: normal; overflow: visible; font-size: 0.68rem; line-height: 1.25; }
  /* cartas decorativas da tela inicial na medida da altura */
  .float-card { width: clamp(40px, 13vh, 72px); }
  /* poderes de alguém: os dois lado a lado (cabe na altura) */
  .power-peek { width: min(560px, calc(100vw - 16px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 8px; }
  .power-peek > .pk-head, .power-peek > .pk-rule, .power-peek > .pk-flags, .power-peek > .pk-none { grid-column: 1 / -1; }
  .power-peek .pk-power { margin-top: 4px; }
}

/* celular deitado: mais espaço útil (lobby compacto, recado do topo em 2 linhas, mão inteira) */
@media (max-height: 520px) and (orientation: landscape) {
  .heat-badge .hb-long { display: none; }
  .hud-center { white-space: normal; line-height: 1.1; font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .my-hand { padding-bottom: 12px; }
  /* lobby: título e contagem numa linha, dica e botão lado a lado no rodapé */
  .lobby-head > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
  .lobby-head h2 { font-size: 1.1rem; }
  .lobby-head p { margin: 0; font-size: 0.82rem; }
  .lobby-footer { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
  .start-hint { flex: 1 1 auto; margin: 0; }
  .lobby-actions { flex: 0 0 auto; }
  .lobby-actions .btn { flex: none; min-width: 210px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* tela inicial deitada: as duas cartas do meio caíam em cima do logo e do texto */
  #splash-cards .float-card:nth-child(3), #splash-cards .float-card:nth-child(4) { display: none; }
}
@media (max-width: 700px) and (orientation: portrait) {
  /* as cartas das pontas do leque descem um pouco: folga embaixo para a mão aparecer inteira */
  .my-hand { padding-bottom: 9px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* painel de aposta baixo, para não cobrir o crachá do lado direito (a soma já está no topo:
     "Apostas x/y"; o número proibido aparece riscado) */
  .bet-prompt:not(.ult) .bp-sub { display: none; }
  .bet-prompt { gap: 6px; }
  .bet-prompt .bp-title { font-size: 0.85rem; }
  .bet-prompt .bet-btn { width: 36px; height: 36px; font-size: 0.98rem; }
  .bet-prompt .bet-buttons { gap: 5px; }
}

/* celular: lobby com uma rolagem só (o miolo inteiro rola; título em cima e "Começar partida"
   embaixo ficam parados). No computador cada cartão continua rolando sozinho. */
@media (max-width: 700px), (max-height: 520px) {
  .lobby-body {
    overflow-y: auto; overscroll-behavior: contain;
    grid-template-rows: none; grid-auto-rows: auto; align-items: start; align-content: start;
  }
  .lobby-card { overflow: visible; min-height: auto; }
}

/* poderes novos: aposta secreta (🎭), carta virada na mesa (🎩/🌃), vira oculta (🌑), +1 vida no resumo */
.pill.bets.secret { background: rgba(168, 85, 247, 0.18); color: #e2c8ff; }
.score-pill.secret { font-weight: 800; font-size: 0.72rem; background: rgba(168, 85, 247, 0.2); color: #e2c8ff; padding: 0 6px; }
.trick-hidden {
  position: absolute; right: -6px; bottom: -6px; z-index: 2; font-size: clamp(12px, 1.3cqw, 16px); line-height: 1;
  padding: 2px 3px; border-radius: 50%; background: rgba(8, 14, 26, 0.85); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.vira-card.eclipse { filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45)) brightness(0.7) saturate(0.6); }
.modal tr.gain td.res { color: var(--accent); }
