/* Mesa da Família — visual pensado primeiro para o celular */

:root {
  --bg1: #1a1240;
  --bg2: #2e1a6b;
  --sheet: #2a1c63;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-2: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --red: #e53935;
  --yellow: #fdd835;
  --green: #43a047;
  --blue: #1e88e5;
  --accent: #ffc83d;
  --accent-ink: #3a2500;
  --danger: #ff5a5f;
  --cw: 62px; /* largura da carta na mão */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(120% 70% at 50% 0%, #3b2390 0%, var(--bg1) 70%) fixed;
  background-color: var(--bg1);
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
#app { min-height: 100dvh; max-width: 560px; margin: 0 auto; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h2 { font-size: 1.15rem; font-weight: 900; }
h2 small { font-weight: 700; color: var(--muted); font-size: 0.85rem; margin-left: 4px; }
h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 0.85rem; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; min-height: 48px; border-radius: 14px;
  background: var(--panel-2); font-weight: 800; font-size: 1rem;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.2s;
}
.btn:active { transform: translateY(2px); }
.btn.primary {
  background: linear-gradient(180deg, #ffd95a, #ffb300);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 #c27c00, 0 8px 18px rgba(255, 179, 0, 0.25);
}
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #c27c00; }
.btn.big { width: 100%; min-height: 58px; font-size: 1.15rem; border-radius: 18px; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; border: 2px dashed var(--line); }
.btn.wa { background: #25d366; color: #05361b; }
.btn.danger { background: rgba(255, 90, 95, 0.18); color: #ffd1d2; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; background: var(--panel);
  display: grid; place-items: center; font-size: 20px; font-weight: 900; flex: none;
}

.avatar {
  display: block; aspect-ratio: 1; border-radius: 50%; overflow: hidden; flex: none;
  background: #ddd; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.avatar svg { display: block; width: 100%; height: 100%; }

.screen { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); padding-top: max(16px, env(safe-area-inset-top)); }
.panel { background: var(--panel); border-radius: 20px; padding: 16px; margin-top: 14px; }
.panel h2 { margin-bottom: 12px; }
.sticky-foot {
  position: sticky; bottom: 0; margin: 18px -16px 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg1) 35%);
}

/* ---------- topo ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
}
.screen .topbar { padding: 0 0 8px; }
.topbar-title { flex: 1; text-align: center; font-weight: 900; font-size: 1.2rem; line-height: 1.1; }
.topbar-title small { display: block; font-weight: 700; font-size: 0.75rem; color: var(--muted); }

/* ---------- senha da família ---------- */
.login { max-width: 420px; margin: 0 auto; padding-top: max(40px, env(safe-area-inset-top)); }
.login-icon { border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.login-error { background: #b3261e; color: #fff; font-weight: 800; text-align: center; border-radius: 14px; padding: 10px; margin: 0 0 14px; }
.login .btn.big { margin-top: 4px; }
.login-ok { background: #2e7d32; color: #fff; font-weight: 800; text-align: center; border-radius: 14px; padding: 10px; margin: 0 0 14px; }
.admin-link { color: var(--muted); text-decoration: underline; font-weight: 700; }
.admin-pass { font-size: 1.6rem; font-weight: 900; color: var(--accent); text-align: center; letter-spacing: 0.04em; margin: 4px 0 8px; user-select: all; -webkit-user-select: all; }
.admin .sticky-foot { display: grid; gap: 10px; }
.admin .sticky-foot form { margin: 0; }

/* ---------- perfil ---------- */
.brand { text-align: center; padding: 12px 0 18px; }
.brand h1 { font-size: 2rem; font-weight: 900; margin-top: 10px; }
.brand p { margin: 6px 0 0; }
.brand-cards { display: flex; justify-content: center; --cw: 50px; height: 86px; align-items: flex-end; }
.brand-cards .card:nth-child(1) { transform: rotate(-16deg) translate(14px, 6px); }
.brand-cards .card:nth-child(2) { transform: translateY(-6px); z-index: 1; }
.brand-cards .card:nth-child(3) { transform: rotate(16deg) translate(-14px, 6px); }

.field { display: block; margin: 8px 0 22px; }
.field span { display: block; font-weight: 800; margin-bottom: 8px; }
.field input, .join-row input {
  width: 100%; font: inherit; font-size: 1.15rem; font-weight: 800; color: var(--text);
  background: rgba(0, 0, 0, 0.25); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; outline: none;
}
.field input:focus, .join-row input:focus { border-color: var(--accent); }
.profile h2 { margin-bottom: 12px; }
.profile h3 { margin: 14px 0 10px; }
.av-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.av-option { border-radius: 50%; padding: 4px; background: var(--panel); transition: transform 0.15s, background 0.15s; position: relative; }
.av-option .avatar { width: 100%; box-shadow: none; }
.av-option.sel { background: var(--accent); transform: scale(1.06); }
.av-option.sel::after {
  content: '✓'; position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 900; display: grid; place-items: center; font-size: 14px;
  border: 2px solid var(--bg1);
}

/* ---------- início ---------- */
.hub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.me-chip { flex: 1; display: flex; align-items: center; gap: 12px; text-align: left; min-width: 0; }
.me-chip .avatar { width: 56px; border: 3px solid var(--accent); }
.me-chip b { display: block; font-size: 1.2rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip small { color: var(--muted); font-weight: 700; }
.join-box { background: var(--panel); border-radius: 20px; padding: 14px 16px 16px; margin-bottom: 22px; }
.join-box label { font-weight: 800; display: block; margin-bottom: 10px; }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-size: 1.3rem; padding: 10px; min-width: 0; }
.hub > h2 { margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  border-radius: 22px; padding: 14px 12px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); position: relative; overflow: hidden; min-height: 150px;
}
.tile b { font-size: 1.15rem; font-weight: 900; margin-top: auto; }
.tile small { font-weight: 800; color: var(--muted); }
.tile .tile-desc { font-weight: 700; font-size: 0.8rem; color: rgba(255, 255, 255, 0.85); line-height: 1.2; }
.tile.ready small {
  align-self: flex-start; margin-top: 8px; background: #fff; color: #222; padding: 5px 11px; border-radius: 99px; font-size: 0.85rem;
}
.tile.t-uno {
  grid-column: span 2; min-height: 170px;
  background: linear-gradient(135deg, #ff6a3d 0%, #e53935 45%, #8e24aa 100%);
  box-shadow: 0 10px 30px rgba(229, 57, 53, 0.35);
}
.tile.t-uno b { font-size: 1.8rem; }
.tile.t-uno small { color: #b71c1c; font-size: 0.95rem; padding: 6px 12px; }
.tile.t-roubamonte { background: linear-gradient(145deg, #00a86b, #00695c); }
.tile.t-pife { background: linear-gradient(145deg, #3f7de8, #283593); }
.tile.t-pontinho { background: linear-gradient(145deg, #ff9f1c, #e65100); }
.tile.t-paciencia { background: linear-gradient(145deg, #26a69a, #37474f); }
.tile.soon { opacity: 0.8; }
.tile.soon::after {
  content: 'em breve'; position: absolute; top: 10px; right: 10px; font-size: 0.7rem; font-weight: 900; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16); padding: 3px 8px; border-radius: 99px;
}
.tile-art { height: 70px; display: flex; align-items: center; }
.suits span { font-size: 2.6rem; line-height: 1; color: #fff; text-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); margin-right: 2px; }
.suits span.red { color: #ff6b6b; }
.uno-art { position: absolute; right: 14px; top: 16px; height: auto; --cw: 58px; }
.uno-art .card { position: absolute; right: 0; top: 0; }
.uno-art .card:nth-child(1) { transform: rotate(-24deg) translate(-70px, 14px); }
.uno-art .card:nth-child(2) { transform: rotate(-8deg) translate(-36px, 2px); }
.uno-art .card:nth-child(3) { transform: rotate(10deg); }
.foot-note { margin-top: 20px; font-size: 0.9rem; }

/* ---------- sala ---------- */
.code-box { text-align: center; background: var(--panel); border-radius: 22px; padding: 16px; margin-top: 6px; }
.code-box > span { font-weight: 800; color: var(--muted); }
.code { display: block; font-size: 3.2rem; font-weight: 900; letter-spacing: 0.25em; margin: 2px 0 12px; padding-left: 0.25em; color: var(--accent); }
.share-row { display: flex; gap: 10px; }
.share-row .btn { flex: 1; }
.player-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.player-list li { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, 0.2); border-radius: 16px; padding: 8px; min-width: 0; }
.player-list li.offline { opacity: 0.55; }
.player-list .avatar { width: 44px; }
.pl-info { flex: 1; min-width: 0; line-height: 1.15; }
.pl-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-info small { color: var(--muted); font-weight: 700; font-size: 0.78rem; }
.kick { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); font-size: 0.8rem; flex: none; }
.toggle { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.toggle.readonly { cursor: default; opacity: 0.85; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle b { display: block; }
.toggle small { color: var(--muted); font-weight: 700; display: block; line-height: 1.25; margin-top: 2px; }
.switch { flex: none; width: 52px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, 0.2); position: relative; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.toggle input:checked + .switch { background: #4caf50; }
.toggle input:checked + .switch::after { transform: translateX(22px); }
.waiting { text-align: center; font-weight: 800; color: var(--muted); margin: 6px 0; }
.dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin: 0 1px; animation: dot 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
.opt-list { display: grid; gap: 16px; }
.opt-select { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.opt-select b { display: block; }
.opt-select small { color: var(--muted); font-weight: 700; display: block; line-height: 1.25; margin-top: 2px; }
.opt-select select {
  flex: none; max-width: 48%; font: inherit; font-weight: 800; color: var(--text); background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--line); border-radius: 12px; padding: 10px 8px;
}
.opt-select select option { color: #222; }
.opt-select.readonly select { opacity: 0.85; }
.opt-list + .btn, .panel > p.small { margin: 0 0 12px; }
.champ-tag { display: inline-block; margin-top: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 900; padding: 4px 14px; border-radius: 99px; letter-spacing: 0.1em; }
.last-result.champ { background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; }
.last-result { text-align: center; font-weight: 900; background: rgba(255, 200, 61, 0.16); color: var(--accent); border-radius: 14px; padding: 10px; margin-bottom: 8px; }
.score-list { list-style: none; padding: 0; margin: 0 0 12px; }
.score-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.score-list li:last-child { border-bottom: 0; }
.score-list .pos { width: 26px; font-weight: 900; color: var(--muted); }
.score-list .avatar { width: 34px; }
.score-list b { flex: 1; }
.score-list .pts { font-weight: 900; color: var(--accent); }

/* ---------- cartas ---------- */
.card {
  --cc: #333;
  width: var(--cw); height: calc(var(--cw) * 1.5); flex: none; position: relative;
  border-radius: calc(var(--cw) * 0.13); background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, filter 0.2s, box-shadow 0.2s;
  font-family: 'Nunito', 'Arial Black', system-ui, sans-serif;
}
.card .face { position: absolute; inset: calc(var(--cw) * 0.06); border-radius: calc(var(--cw) * 0.09); background: var(--cc); overflow: hidden; }
.card .oval {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--cw) * 0.62); height: calc(var(--cw) * 1.1);
  margin: calc(var(--cw) * -0.55) 0 0 calc(var(--cw) * -0.31);
  border-radius: 50%; background: #fff; transform: rotate(32deg);
}
.card .sym {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 900; font-size: calc(var(--cw) * 0.52); line-height: 1; color: var(--cc);
  -webkit-text-stroke: calc(var(--cw) * 0.018) #141414;
  text-shadow: calc(var(--cw) * 0.03) calc(var(--cw) * 0.03) 0 #141414;
}
.card .sym svg { width: calc(var(--cw) * 0.52); height: calc(var(--cw) * 0.52); filter: drop-shadow(calc(var(--cw) * 0.025) calc(var(--cw) * 0.025) 0 #141414); }
.card .corner {
  position: absolute; font-weight: 900; font-size: calc(var(--cw) * 0.2); line-height: 1; color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}
.card .corner svg { width: calc(var(--cw) * 0.22); height: calc(var(--cw) * 0.22); display: block; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.5)); }
.card .corner.tl { top: calc(var(--cw) * 0.05); left: calc(var(--cw) * 0.06); }
.card .corner.br { bottom: calc(var(--cw) * 0.05); right: calc(var(--cw) * 0.06); transform: rotate(180deg); }
.card.v-6 .sym, .card.v-9 .sym { text-decoration: underline; text-decoration-thickness: calc(var(--cw) * 0.04); text-underline-offset: calc(var(--cw) * 0.05); }
.c-red { --cc: var(--red); }
.c-yellow { --cc: var(--yellow); }
.c-green { --cc: var(--green); }
.c-blue { --cc: var(--blue); }
.c-wild { --cc: #1b1b1b; }
.c-wild .oval { background: conic-gradient(var(--red) 0 25%, var(--blue) 0 50%, var(--yellow) 0 75%, var(--green) 0); }
.c-wild .sym { color: #fff; }
.wild-dot {
  display: block; width: calc(var(--cw) * 0.16); height: calc(var(--cw) * 0.16); border-radius: 50%; border: 1.5px solid #fff;
  background: conic-gradient(var(--red) 0 25%, var(--blue) 0 50%, var(--yellow) 0 75%, var(--green) 0);
}
.card.back .face { background: #1b1b1b; }
.card.back .oval { background: var(--red); }
.card.back .sym {
  color: var(--yellow); font-size: calc(var(--cw) * 0.3); font-style: italic; transform: rotate(-24deg);
  -webkit-text-stroke: calc(var(--cw) * 0.012) #141414;
}

/* ---------- mesa do UNO ---------- */
.uno-screen { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.opps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; padding: 2px 8px 6px; }
.opp { width: 72px; display: flex; flex-direction: column; align-items: center; position: relative; }
.opp .avatar { width: 50px; border: 3px solid rgba(255, 255, 255, 0.25); transition: border-color 0.2s, box-shadow 0.2s; }
.opp.is-turn .avatar { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.3), 0 0 18px rgba(255, 200, 61, 0.7); animation: bob 1.1s ease-in-out infinite; }
.opp.offline .avatar { filter: grayscale(1); opacity: 0.6; }
.opp-name { font-size: 0.78rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.opp-count {
  position: absolute; top: 34px; right: 0; background: #fff; color: #222; font-weight: 900; font-size: 0.72rem;
  border-radius: 8px; padding: 1px 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.opp-badge {
  position: absolute; top: -4px; left: 0; background: var(--red); color: var(--yellow); font-weight: 900; font-size: 0.7rem;
  border-radius: 8px; padding: 1px 5px; transform: rotate(-10deg); border: 2px solid #fff;
}
.opp-catch {
  margin-top: 3px; background: var(--danger); color: #fff; font-size: 0.66rem; font-weight: 900; line-height: 1.1;
  border-radius: 10px; padding: 5px 6px; box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.35); animation: pulse 0.6s ease-in-out infinite alternate;
}

/* Mesa oval de feltro com borda de madeira; os jogadores ficam sentados em volta */
.uno-arena { flex: 1; min-height: 280px; position: relative; }
.uno-felt {
  --cw: clamp(56px, 8.6dvh, 80px); --cur: #888;
  position: absolute; left: 40px; right: 40px; top: 52px; bottom: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 38%, #34a065 0%, #217a49 50%, #145232 100%);
  box-shadow: 0 0 0 9px #7a5230, 0 0 0 12px #4e331d, 0 0 0 13px rgba(255, 255, 255, 0.12), 0 22px 44px rgba(0, 0, 0, 0.55), inset 0 0 50px rgba(0, 0, 0, 0.45);
}
.uno-felt::before {
  content: ''; position: absolute; inset: 18%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cur) 55%, transparent), transparent); transition: background 0.4s;
}
.uno-center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.dir-ring {
  position: absolute; left: 50%; top: 50%; width: min(86%, 300px); aspect-ratio: 1; translate: -50% -50%;
  color: rgba(255, 236, 160, 0.5); animation: spin 9s linear infinite; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.dir-ring.ccw { animation-direction: reverse; }
.dir-ring.ccw svg { transform: scaleY(-1); }
.dir-ring.flip svg { animation: dirFlip 0.6s ease-out; }
.dir-ring svg { width: 100%; height: 100%; }
@keyframes dirFlip { 0% { scale: 1; } 40% { scale: 1.25; color: #fff; } 100% { scale: 1; } }

.uno-seats, .uno-fx { position: absolute; inset: 0; pointer-events: none; }
.uno-seats .seat { pointer-events: auto; }
.seat {
  position: absolute; translate: -50% -50%; width: 78px; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
}
.seat .avatar { width: 52px; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); transition: box-shadow 0.2s, border-color 0.2s; }
.seat.is-turn .avatar { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.45), 0 0 22px rgba(255, 200, 61, 0.9); animation: bob 1.1s ease-in-out infinite; }
.seat.offline .avatar { filter: grayscale(1); opacity: 0.65; }
.seat-name {
  margin-top: -7px; position: relative; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(15, 10, 40, 0.85); border: 1px solid rgba(255, 255, 255, 0.2); padding: 1px 8px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 900;
}
.seat.is-turn .seat-name { background: var(--accent); color: var(--accent-ink); }
.seat-cards { display: flex; align-items: center; margin-top: 3px; height: 20px; }
.seat-cards i {
  width: 12px; height: 18px; border-radius: 3px; border: 1.5px solid #fff; margin-left: -7px;
  background: radial-gradient(ellipse 45% 30% at 50% 50%, var(--red) 90%, transparent 100%), #1b1b1b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.seat-cards i:first-child { margin-left: 0; }
.seat-cards b { margin-left: 5px; font-size: 0.78rem; background: #fff; color: #222; border-radius: 8px; padding: 0 5px; }
.seat-uno {
  position: absolute; top: -6px; right: 4px; background: var(--red); color: var(--yellow); font-weight: 900; font-size: 0.68rem; font-style: italic;
  border-radius: 8px; padding: 1px 5px; transform: rotate(10deg); border: 2px solid #fff;
}
.seat-catch {
  margin-top: 3px; background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 900; white-space: nowrap;
  border-radius: 10px; padding: 5px 8px; box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.35); animation: pulse 0.6s ease-in-out infinite alternate;
}
.seat.me-seat .avatar { width: 46px; }

.bubble {
  position: absolute; translate: -50% -100%; z-index: 20; white-space: nowrap;
  background: #fff; color: #222; font-weight: 900; font-size: 0.9rem; padding: 6px 12px; border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); animation: bubbleIn 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) backwards, bubbleOut 0.4s ease-in 1.6s forwards;
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; translate: -50% 0; border: 8px solid transparent; border-bottom: 0; border-top-color: inherit;
}
.bubble { border-top-color: #fff; }
.bubble.bad { background: var(--danger); color: #fff; border-top-color: var(--danger); }
.bubble.uno {
  background: var(--red); color: var(--yellow); border: 3px solid #fff; border-top-color: var(--red); font-size: 1.7rem; font-style: italic;
  padding: 4px 16px; text-shadow: 0 2px 0 #7f1414; animation: bubbleIn 0.35s cubic-bezier(0.2, 1.5, 0.4, 1) backwards, bubbleOut 0.4s ease-in 2.2s forwards;
}
.bubble.color b { padding: 2px 10px; border-radius: 99px; color: #fff; }
@keyframes bubbleIn { from { opacity: 0; transform: scale(0.3) translateY(20px); } }
@keyframes bubbleOut { to { opacity: 0; transform: translateY(-14px); } }

.card.fly { position: fixed; z-index: 60; pointer-events: none; margin: 0; }
.pile-discard .card.arriving { opacity: 0; }
.uno-status { display: flex; justify-content: center; padding: 0 12px 2px; }
.uno-status .status { margin-top: 0; }
.uno-screen .me { padding-top: 0; }
.piles { display: flex; gap: 30px; align-items: center; position: relative; }
.pile-draw { position: relative; width: var(--cw); height: calc(var(--cw) * 1.5); border-radius: calc(var(--cw) * 0.13); }
.pile-draw .card { position: absolute; left: 0; top: 0; }
.pile-draw .card.under1 { transform: translate(3px, 3px); }
.pile-draw .card.under2 { transform: translate(6px, 6px); }
.pile-draw.can .card:last-of-type { animation: glow 1.2s ease-in-out infinite; }
.pile-label {
  position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); white-space: nowrap;
  font-size: 0.72rem; font-weight: 900; color: rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.35); padding: 0 7px; border-radius: 99px;
}
.pile-draw.can .pile-label { color: var(--accent); }
.pile-discard { position: relative; width: var(--cw); height: calc(var(--cw) * 1.5); }
.pile-discard::before {
  content: ''; position: absolute; inset: -9px; border-radius: calc(var(--cw) * 0.22);
  border: 4px solid var(--cur); box-shadow: 0 0 22px var(--cur), inset 0 0 12px var(--cur); transition: border-color 0.3s, box-shadow 0.3s;
}
.pile-discard::after {
  content: attr(data-color-name); position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%);
  font-size: 0.75rem; font-weight: 900; color: var(--cur); white-space: nowrap; filter: brightness(1.3);
}
.pile-discard .card { position: absolute; left: 0; top: 0; transform: rotate(var(--rot, 0deg)); }
.pile-discard .card.pop { animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) backwards; }
.pending-badge {
  position: absolute; top: -16px; right: -20px; z-index: 2; background: var(--danger); color: #fff; font-weight: 900; font-size: 1.2rem;
  border-radius: 99px; padding: 4px 10px; border: 3px solid #fff; animation: pulse 0.6s ease-in-out infinite alternate;
}
.status {
  margin-top: 26px; font-weight: 800; font-size: 0.95rem; text-align: center; padding: 6px 14px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.3); max-width: 92%; position: relative;
}
.status.mine { background: var(--accent); color: var(--accent-ink); }

.me { padding: 4px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.3)); }
.me-bar { display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.me-avatar { width: 42px; border: 3px solid rgba(255, 255, 255, 0.3); }
.me.is-turn .me-avatar { border-color: var(--accent); box-shadow: 0 0 14px rgba(255, 200, 61, 0.7); }
.me-info { flex: 1; min-width: 0; line-height: 1.15; }
.me-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info span { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.btn-pass { min-height: 44px; padding: 8px 16px; background: #fff; color: #222; }
.btn-pass[hidden] { display: none; }
.btn-uno {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #ff6b6b, #c62828); border: 3px solid #fff;
  color: #ffe14d; font-weight: 900; font-size: 1.05rem; font-style: italic; transform: rotate(-8deg);
  text-shadow: 1px 2px 0 #7f1414; box-shadow: 0 4px 0 #7f1414, 0 6px 14px rgba(0, 0, 0, 0.4);
}
.btn-uno:disabled { filter: grayscale(0.9) brightness(0.65); box-shadow: none; }
.btn-uno.hot { animation: unoPulse 0.7s ease-in-out infinite; }
.hand {
  display: flex; overflow-x: auto; overflow-y: hidden; padding: 18px 12px 6px; min-height: calc(var(--cw) * 1.5 + 26px);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hand::-webkit-scrollbar { display: none; }
.hand .card { cursor: pointer; }
.hand .card + .card { margin-left: var(--ml, 4px); }
.hand .card:first-child { margin-left: auto; }
.hand .card:last-child { margin-right: auto; }
.hand .card.playable { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--accent), 0 10px 18px rgba(0, 0, 0, 0.45); }
.hand .card.dim { filter: brightness(0.5) saturate(0.6); }
.hand .card.drawn { box-shadow: 0 0 0 4px #fff, 0 0 22px var(--accent); }
.hand .card.enter { animation: dealIn 0.35s ease-out backwards; }
.hand .card.shake { animation: shake 0.35s; }
.hand .card.leaving { transform: translateY(-60px) scale(0.9); opacity: 0.4; }

.splash {
  position: absolute; left: 50%; top: 42%; z-index: 30; pointer-events: none; text-align: center;
  font-size: 4.2rem; font-weight: 900; font-style: italic; line-height: 1;
  color: var(--yellow); -webkit-text-stroke: 2px #7f1414; text-shadow: 0 6px 0 #7f1414, 0 12px 30px rgba(0, 0, 0, 0.6);
  animation: splash 1.3s ease-out forwards;
}
.splash small { display: block; font-size: 1.1rem; font-style: normal; color: #fff; -webkit-text-stroke: 0; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); margin-bottom: 6px; }
.splash.bad { color: #fff; -webkit-text-stroke: 2px #8b0000; text-shadow: 0 6px 0 #8b0000, 0 0 40px rgba(255, 0, 0, 0.6); }

/* ---------- baralho tradicional ---------- */
.pcard {
  --pw: 56px;
  width: var(--pw); height: calc(var(--pw) * 1.4); flex: none; position: relative;
  border-radius: calc(var(--pw) * 0.11); background: #fffdf7; color: #1d1d1f;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), 0 3px 8px rgba(0, 0, 0, 0.35);
  font-family: 'Nunito', system-ui, sans-serif; font-weight: 900; font-variant-emoji: text;
  transition: transform 0.18s ease, filter 0.2s, box-shadow 0.2s;
}
.pcard.red { color: #d32f2f; }
.pcard i { font-style: normal; }
.pc-tl, .pc-br {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  font-size: calc(var(--pw) * 0.3); line-height: 0.95; letter-spacing: -0.04em;
}
.pc-tl { top: calc(var(--pw) * 0.05); left: calc(var(--pw) * 0.06); }
.pc-br { bottom: calc(var(--pw) * 0.05); right: calc(var(--pw) * 0.06); transform: rotate(180deg); }
.pc-tl i, .pc-br i { font-size: 0.8em; }
.pc-pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--pw) * 0.62); padding-top: calc(var(--pw) * 0.12); }
.pc-face {
  position: absolute; left: 22%; right: 22%; top: 24%; bottom: 14%; border-radius: calc(var(--pw) * 0.06);
  background: linear-gradient(160deg, #fff4c2, #ffd76a); border: 1.5px solid currentColor;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: calc(var(--pw) * 0.34); line-height: 1;
}
.pc-face i { font-size: 0.75em; }
.pcard.back { background: #fff; }
.pc-backart {
  position: absolute; inset: calc(var(--pw) * 0.06); border-radius: calc(var(--pw) * 0.07);
  background: repeating-linear-gradient(45deg, #3949ab 0 5px, #5c6bc0 5px 10px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* mesas de baralho (Rouba-Monte, Pife, Pontinho) */
.gt-screen { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.board {
  flex: 1; min-height: 0; position: relative; margin: 2px 12px 0; border-radius: 26px;
  background: radial-gradient(closest-side, rgba(46, 160, 90, 0.35), transparent), rgba(0, 0, 0, 0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 12px;
  overflow: auto;
}
.gt-status { display: flex; justify-content: center; padding: 6px 12px 0; }
.gt-status .status { margin-top: 0; }
.me-actions { display: flex; gap: 8px; align-items: center; }
.me-actions .btn { min-height: 44px; padding: 8px 14px; font-size: 0.92rem; }
.me-actions .btn.white { background: #fff; color: #222; }
.me-actions .btn[hidden] { display: none; }
.phand {
  display: flex; overflow-x: auto; overflow-y: hidden; padding: 18px 12px 6px; align-items: flex-end;
  min-height: calc(56px * 1.4 + 26px); scrollbar-width: none;
}
.phand::-webkit-scrollbar { display: none; }
.phand > .pcard + .pcard, .phand > .meld-group + .pcard, .phand .meld-group > .pcard + .pcard, .phand > .pcard + .meld-group { margin-left: var(--ml, 4px); }
.phand > :first-child { margin-left: auto; }
.phand > :last-child { margin-right: auto; }
.phand .pcard { cursor: pointer; }
.phand .pcard.sel { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--accent), 0 10px 18px rgba(0, 0, 0, 0.45); }
.phand .pcard.dim { filter: brightness(0.55); }
.phand .pcard.must { box-shadow: 0 0 0 3px #fff, 0 0 18px var(--accent); }
.phand .pcard.enter { animation: dealIn 0.35s ease-out backwards; }
.phand .pcard.shake { animation: shake 0.35s; }
.meld-group { display: flex; flex: none; padding: 4px 4px 6px; margin: 0 5px; border-radius: 12px; background: rgba(76, 175, 80, 0.35); box-shadow: inset 0 0 0 2px rgba(129, 199, 132, 0.8); }
.phand > .meld-group + .meld-group, .phand > .meld-group + .pcard { margin-left: 6px; }
.pile-spot { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.pile-spot button.can .pcard { animation: glow 1.2s ease-in-out infinite; }
.stack { position: relative; }
.stack .pcard + .pcard { position: absolute; left: 0; top: 0; }
.mini-pcards { display: flex; --pw: 22px; margin-top: 3px; align-items: center; flex-wrap: wrap; gap: 2px 0; }
.mini-pcards .pcard { --pw: 22px; }
.mini-pcards .pcard + .pcard { margin-left: -8px; }
.mini-pcards .pc-br, .mini-pcards .pc-pip, .mini-pcards .pc-face { display: none; }
.mini-pcards .pc-tl { font-size: 10px; left: 3px; top: 2px; }
.mini-pcards span.more { font-size: 0.75rem; font-weight: 800; margin-left: 4px; color: var(--muted); }

.pcard.joker { color: #7b1fa2; background: linear-gradient(160deg, #fffdf7 55%, #f3e5f5); }
.pc-joker {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: calc(var(--pw) * 0.55); line-height: 1; padding-top: calc(var(--pw) * 0.1);
}
.pc-joker small { font-size: calc(var(--pw) * 0.13); letter-spacing: 0.04em; margin-top: 2px; }
.mini-pcards .pc-joker, .pt-meld-cards .pc-joker, .pcard.tiny .pc-joker { display: none; }
.pcard.tiny { --pw: 26px; }
.pcard.tiny .pc-pip, .pcard.tiny .pc-face, .pcard.tiny .pc-br { display: none; }
.pcard.tiny .pc-tl { font-size: 11px; left: 3px; top: 3px; }

/* Rouba-Monte */
.rm .board { justify-content: flex-start; }
.rm-top { align-self: stretch; display: flex; }
.rm-draw .pcard { --pw: 34px; }
.rm-table { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 10px; }
.rm-table .pcard { --pw: 60px; animation: dealIn 0.3s ease-out backwards; }
.opp-pile { display: flex; align-items: center; gap: 4px; margin-top: 3px; min-height: 38px; }
.opp-pile b { font-size: 0.85rem; }
.opp-pile .empty { font-size: 0.65rem; color: var(--muted); font-weight: 700; }
.my-pile { display: flex; align-items: center; gap: 6px; background: var(--panel); padding: 6px 10px; border-radius: 14px; font-size: 0.75rem; font-weight: 800; }
.my-pile b { font-size: 1.15rem; color: var(--accent); }
.rm .phand .pcard { --pw: 66px; }

/* Pife */
.pf-piles { display: flex; gap: 34px; align-items: flex-end; }
.pf-piles .pcard { --pw: clamp(64px, 10dvh, 86px); }
.pcard.empty-slot { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
.pf .phand .pcard, .pt .phand .pcard { --pw: 52px; }
.mini-melds { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pontinho */
.pt .board { justify-content: flex-start; }
.pt-piles { display: flex; gap: 24px; align-items: flex-end; }
.pt-piles .pcard { --pw: 54px; }
.pt-melds { align-self: stretch; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-bottom: 4px; }
.pt-meld { display: flex; align-items: center; gap: 5px; background: rgba(0, 0, 0, 0.28); border-radius: 12px; padding: 4px 8px 4px 4px; }
.pt-meld:active { background: rgba(255, 200, 61, 0.3); }
.pt-meld .avatar { width: 22px; box-shadow: none; }
.pt-meld-cards { display: flex; }
.pt-meld-cards .pcard { --pw: 34px; }
.pt-meld-cards .pcard + .pcard { margin-left: -15px; }
.pt-meld-cards .pc-pip, .pt-meld-cards .pc-face, .pt-meld-cards .pc-br { display: none; }
.pt-meld-cards .pc-tl { font-size: 12px; left: 3px; top: 3px; }
.opp-score { font-size: 0.7rem; color: var(--muted); font-weight: 800; }
.bust { color: var(--danger); }
.me[hidden] { display: none; }

/* Truco */
.tile.t-truco { background: linear-gradient(145deg, #a1887f, #4e342e); }
.tr .board { justify-content: space-between; gap: 8px; }
.tr-score, .cn-score { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tr-team { display: flex; flex-direction: column; align-items: center; min-width: 66px; padding: 4px 10px; border-radius: 14px; }
.tr-team small { font-weight: 800; font-size: 0.75rem; opacity: 0.9; }
.tr-team b { font-size: 1.9rem; line-height: 1; }
.tr-team.us { background: rgba(67, 160, 71, 0.35); }
.tr-team.them { background: rgba(229, 57, 53, 0.35); }
.tr-center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.8rem; }
.tr-center small { color: var(--muted); font-weight: 700; }
.tr-value { background: var(--accent); color: var(--accent-ink); font-weight: 900; padding: 2px 10px; border-radius: 99px; }
.tr-mid { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: center; flex: 1; min-height: 0; }
.tr-vira { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.7rem; font-weight: 800; color: var(--muted); flex: none; }
.tr-vira .pcard { --pw: 44px; }
.tr-vira b { color: var(--accent); font-size: 0.75rem; }
.tr-fixed { display: flex; flex-direction: column; gap: 2px; font-weight: 900; font-size: 0.9rem; color: #fff; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 6px 9px; font-variant-emoji: text; }
.tr-fixed .red { color: #ff8a80; }
.tr-trick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: flex-end; flex: 1; }
.tr-play { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tr-play .pcard { --pw: 58px; animation: dealIn 0.3s ease-out backwards; }
.tr-play small { font-size: 0.7rem; font-weight: 800; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-play.us small { color: #a5d6a7; }
.tr-play.them small { color: #ef9a9a; }
.tr-play.win .pcard { box-shadow: 0 0 0 3px var(--accent), 0 0 18px var(--accent); }
.tr-dots { display: flex; gap: 8px; }
.tr-dot { min-width: 46px; text-align: center; font-size: 0.72rem; font-weight: 900; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.tr-dot.us { background: #43a047; color: #fff; }
.tr-dot.them { background: #e53935; color: #fff; }
.tr-dot.tie { background: #9e9e9e; color: #fff; }
.tr-banner { align-self: stretch; background: rgba(0, 0, 0, 0.38); border-radius: 16px; padding: 10px 12px; text-align: center; animation: rise 0.25s ease-out; }
.tr-banner[hidden] { display: none; }
.tr-banner p { margin: 0 0 8px; }
.tr-banner p:last-child { margin-bottom: 0; }
.tr-big { color: var(--accent); font-size: 1.15rem; }
.tr-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tr-btns .btn { flex: 1; min-height: 46px; padding: 8px 10px; font-size: 0.95rem; }
.btn.danger-solid { background: var(--red); color: #fff; }
.tr-win { color: #a5d6a7; }
.tr-lose { color: #ef9a9a; }
.tr-partner { margin-bottom: 8px; display: flex; flex-direction: column; align-items: center; }
.tr-partner small { color: var(--muted); font-weight: 800; }
.tr-partner .mini-pcards .pcard { --pw: 32px; }
.tr-tag { font-size: 0.62rem; font-weight: 900; padding: 1px 6px; border-radius: 99px; margin-top: 2px; }
.tr-tag.us { background: #2e7d32; }
.tr-tag.them { background: #c62828; }
.me-actions .btn.tr-call { background: linear-gradient(180deg, #ff6b6b, #c62828); color: #fff; box-shadow: 0 3px 0 #7f1414; font-style: italic; font-weight: 900; }
.tr .phand .pcard { --pw: 76px; }
.tr-lobby { margin: 0 0 12px; text-align: center; font-weight: 800; }
.tr-lobby small { display: block; color: var(--muted); }
.tr-lobby.warn { color: #ffcc80; }

/* Canastra */
.tile.t-canastra { background: linear-gradient(145deg, #ec407a, #6a1b9a); }
.cn .board { justify-content: flex-start; gap: 8px; }
.cn .tr-value { font-size: 0.72rem; }
.cn-piles { display: flex; gap: 18px; align-items: flex-end; }
.cn-piles .pcard { --pw: 50px; }
.cn-hint { font-size: 0.7rem; font-weight: 800; color: #90caf9; max-width: 90px; align-self: center; line-height: 1.2; }
.cn-melds { align-self: stretch; display: grid; gap: 8px; }
.cn-side { background: rgba(0, 0, 0, 0.22); border-radius: 14px; padding: 8px; }
.cn-side.us { box-shadow: inset 0 0 0 2px rgba(67, 160, 71, 0.55); }
.cn-side.them { box-shadow: inset 0 0 0 2px rgba(229, 57, 53, 0.45); }
.cn-side h4 { margin: 0 0 6px; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.cn-side h4 small { margin-left: auto; color: var(--muted); font-weight: 800; }
.cn-red3 { background: #c62828; color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 0.7rem; font-variant-emoji: text; }
.cn-meld-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cn-meld {
  display: flex; align-items: baseline; gap: 3px; background: #fffdf7; color: #222; border-radius: 10px; padding: 5px 8px;
  font-weight: 900; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); position: relative;
}
.cn-meld b { font-size: 1.05rem; }
.cn-meld span { font-size: 0.8rem; color: #555; }
.cn-meld i { font-style: normal; font-size: 0.7rem; color: #7b1fa2; }
.cn-meld em { font-style: normal; font-size: 0.6rem; text-transform: uppercase; margin-left: 2px; }
.cn-meld.limpa { background: linear-gradient(160deg, #fff59d, #ffca28); }
.cn-meld.suja { background: linear-gradient(160deg, #eceff1, #b0bec5); }
.cn-side.us .cn-meld:active { transform: scale(0.95); }
.cn .phand .pcard { --pw: 50px; }
.meld-group.staged { background: rgba(255, 200, 61, 0.3); box-shadow: inset 0 0 0 2px var(--accent); }
.cn-res { display: block !important; }
.cn-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.cn-table th, .cn-table td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.cn-table th:first-child, .cn-table td:first-child { text-align: left; color: var(--muted); font-weight: 700; }
.cn-table td small { color: var(--muted); font-size: 0.7rem; }
.cn-table tr.sum td { font-weight: 900; color: #fff; }
.cn-table tr.total td { font-weight: 900; color: var(--accent); font-size: 1.05rem; border-bottom: 0; }

/* Buraco */
.tile.t-buraco { background: linear-gradient(145deg, #5c6bc0, #1a237e); }
.br-meld { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 4px 6px 4px 4px; }
.br-meld.limpa { background: linear-gradient(160deg, rgba(255, 245, 157, 0.55), rgba(255, 202, 40, 0.55)); }
.br-meld.suja { background: rgba(176, 190, 197, 0.45); }
.br-meld em { font-style: normal; font-size: 0.6rem; font-weight: 900; text-transform: uppercase; }
.br-morto { background: #2e7d32; color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 0.68rem; }
.br .cn-hint { color: var(--muted); }

/* Paciência */
.sol { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; --pw: 48px; }
.sol .pcard, .sol-drag .pcard { --pw: inherit; }
.sol .pc-tl, .sol-drag .pc-tl { flex-direction: row; align-items: baseline; gap: 1px; font-size: calc(var(--pw) * 0.32); left: calc(var(--pw) * 0.07); }
.sol .pc-tl i, .sol-drag .pc-tl i { font-size: 0.85em; }
.sol-top { display: flex; gap: 5px; padding: 6px 8px 0; justify-content: center; }
.sol-slot {
  width: var(--pw); height: calc(var(--pw) * 1.4); flex: none; position: relative;
  border-radius: calc(var(--pw) * 0.11); background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.sol-waste { background: none; box-shadow: none; }
.sol-gap { width: var(--pw); flex: none; }
.sol-slot .pcard { position: absolute; left: 0; top: 0; }
.sol-count { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 0.7rem; font-weight: 800; color: var(--muted); }
.sol-recycle { display: grid; place-items: center; height: 100%; font-size: 1.6rem; color: var(--muted); }
.sol-suit { display: grid; place-items: center; height: 100%; font-size: calc(var(--pw) * 0.5); color: rgba(255, 255, 255, 0.3); font-variant-emoji: text; }
.sol-suit.red { color: rgba(255, 130, 130, 0.45); }
.sol-tab { flex: 1; min-height: 0; display: flex; gap: 5px; padding: 18px 8px 8px; justify-content: center; }
.sol-col { width: var(--pw); flex: none; position: relative; }
.sol-col:empty::before {
  content: 'K'; display: grid; place-items: center; height: calc(var(--pw) * 1.4); border-radius: calc(var(--pw) * 0.11);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14); color: rgba(255, 255, 255, 0.25); font-weight: 900;
}
.sol-col .pcard { position: absolute; left: 0; cursor: pointer; }
.sol .pcard.shake { animation: shake 0.35s; }
.sol-top, .sol-tab { touch-action: none; } /* o dedo arrasta a carta em vez de rolar a tela */
.sol-drag { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; }
.sol-drag .pcard { position: absolute; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5); transform: rotate(-3deg); }
.sol-bar { display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.sol-bar .btn { flex: 1; min-height: 46px; font-size: 0.9rem; padding: 8px; }
.sol-bar .btn[hidden] { display: none; }
.sol-bar .btn:disabled { opacity: 0.45; }

/* ---------- janelas ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 6, 30, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fadeIn 0.2s;
}
.sheet {
  width: min(100%, 420px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--sheet);
  border-radius: 24px; padding: 22px 18px 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); animation: rise 0.25s ease-out;
}
.sheet h2 { margin-bottom: 12px; }
.sheet > .btn { margin-top: 10px; }
.sheet p { margin: 0 0 8px; }
.menu-list { display: grid; gap: 10px; }
.menu-list .btn { justify-content: flex-start; }
.rules { padding-left: 20px; margin: 0 0 6px; line-height: 1.45; }
.rules li { margin-bottom: 8px; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.color-grid button {
  aspect-ratio: 1.25; border-radius: 20px; font-weight: 900; font-size: 1.15rem; color: #fff;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.2);
}
.color-grid button:active { transform: scale(0.96); }
.pick-red { background: var(--red); }
.pick-yellow { background: var(--yellow); color: #4a3a00 !important; text-shadow: none !important; }
.pick-green { background: var(--green); }
.pick-blue { background: var(--blue); }

.results { text-align: center; }
.results h2 { font-size: 1.6rem; margin: 10px 0 4px; }
.avatar.big { width: 96px; margin: 0 auto; border: 4px solid var(--accent); box-shadow: 0 0 30px rgba(255, 200, 61, 0.6); }
.res-list { list-style: none; padding: 0; margin: 14px 0 6px; text-align: left; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.res-list .avatar { width: 38px; }
.res-info { flex: 1; min-width: 0; }
.res-info b { display: block; }
.res-pts { font-weight: 900; color: var(--accent); font-size: 1.1rem; text-align: right; line-height: 1; }
.res-pts small { display: block; font-size: 0.65rem; color: var(--muted); }
.mini-hand { display: flex; --cw: 20px; margin-top: 3px; align-items: center; }
.mini-hand .card + .card { margin-left: -6px; }
.mini-hand .card .corner { display: none; }
.mini-hand span { font-size: 0.75rem; font-weight: 800; margin-left: 4px; color: var(--muted); }
.mini-hand.empty { font-size: 0.85rem; font-weight: 800; color: var(--accent); }

/* ---------- avisos ---------- */
#toasts {
  position: fixed; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top)); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px;
}
body.in-game #toasts { top: 24dvh; }
.toast {
  background: rgba(20, 12, 50, 0.92); border: 1px solid var(--line); color: #fff; font-weight: 800; font-size: 0.92rem;
  padding: 9px 16px; border-radius: 99px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); animation: toastIn 0.25s ease-out;
  transition: opacity 0.4s, transform 0.4s; text-align: center; max-width: 100%;
}
.toast.warn { background: #b3261e; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast b[class^='chip-'] { padding: 1px 8px; border-radius: 99px; }
.chip-red { background: var(--red); }
.chip-yellow { background: var(--yellow); color: #4a3a00; }
.chip-green { background: var(--green); }
.chip-blue { background: var(--blue); }
.conn {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70;
  background: #b3261e; color: #fff; font-weight: 800; padding: 8px 16px; border-radius: 99px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.conn[hidden] { display: none; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }

/* ---------- animações ---------- */
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes pulse { to { transform: scale(1.08); } }
@keyframes unoPulse { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(4deg) scale(1.12); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 50% { box-shadow: 0 0 0 4px var(--accent), 0 0 24px var(--accent); } }
@keyframes pop { from { transform: rotate(var(--rot, 0deg)) scale(1.5) translateY(-30px); opacity: 0; } }
@keyframes dealIn { from { transform: translateY(40px) scale(0.7); opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes splash {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(-12deg); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.15) rotate(-6deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1) rotate(-6deg); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(0.9) rotate(-6deg); opacity: 0; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }
@keyframes dot { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

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

/* Telas baixinhas (celulares pequenos) */
@media (max-height: 700px) {
  .table { min-height: 180px; }
  :root { --cw: 56px; }
  .opp .avatar { width: 42px; }
  .opp-count { top: 28px; }
}
