:root {
  --bg-deep: #eceae4;
  --bg-arena: #f5f4f0;
  --surface-card: #ffffff;
  --surface-elevated: #f8f7f4;
  --surface-recessed: #ebe9e2;
  --border-light: #dfddd4;
  --border-strong: #c9c5ba;

  --gold-main: #f59e0b;
  --gold-dark: #b45309;
  --emerald-main: #16a34a;
  --emerald-dark: #15803d;
  --royal-main: #1e3a8a;
  --royal-dark: #172554;
  --crimson-main: #dc2626;
  --crimson-dark: #991b1b;
  --purple-main: #7c3aed;
  --purple-dark: #5b21b6;
  --slate-main: #475569;
  --slate-dark: #334155;

  /* Cores das Cartas estilo Mexe Mexe / Skyjo + Clássico */
  --card-blue: #3b6fd8;
  --card-cyan: #0e8fa8;
  --card-sage: #2e8563;
  --card-amber: #d97706;
  --card-red: #d94a4a;
  --card-back-top: #9e1f2d;
  --card-back-bottom: #6b111c;

  --text-main: #18191c;
  --text-muted: #5e616a;
  --font-display: 'Fredoka', system-ui, -apple-system, sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--bg-arena) 0%, var(--bg-deep) 100%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 48px;
}

.bg-decor {
  display: none;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
}

.bg-glow-1 {
  width: 420px;
  height: 420px;
  background: #3b82f6;
  top: -120px;
  left: -80px;
}

.bg-glow-2 {
  width: 420px;
  height: 420px;
  background: #f59e0b;
  bottom: -140px;
  right: -80px;
}

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--border-light);
  box-shadow: 0 2px 10px rgba(24, 25, 28, 0.06);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-emblem {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.22s ease;
}

.topbar-brand:hover .brand-logo-svg {
  transform: scale(1.08) rotate(-3deg);
}

.brand-titles h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.3px;
  color: var(--text-main);
  line-height: 1.1;
}

.gold-text {
  color: var(--royal-main);
}

.brand-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.super-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1.5px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.pill-gold {
  background: linear-gradient(180deg, #ffe066, #f59e0b);
  color: #1e1b18;
}

.pill-emerald {
  background: linear-gradient(180deg, #34d399, #10b981);
  color: #052e16;
}

.pill-royal {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  color: #ffffff;
}

.pill-slate {
  background: #334155;
  color: #e2e8f0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 2px solid var(--border-strong);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.player-profile-chip:hover {
  border-color: var(--gold-main);
  transform: translateY(-1px);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f59e0b, #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid #000;
}

.profile-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.profile-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 700;
}

.edit-icon {
  font-size: 0.85rem;
  color: var(--gold-main);
}

/* ==================== FLAT-TACTILE SUPERCELL-INSPIRED BUTTONS ==================== */
.btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease, background-color 0.12s ease;
  user-select: none;
}

.btn-3d:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-3d:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-3d:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-gold {
  background: #f59e0b;
  color: #18191c;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.btn-emerald {
  background: #16a34a;
  border-color: #15803d;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.22);
}

.btn-royal {
  background: #1e3a8a;
  border-color: #172554;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.22);
}

.btn-crimson {
  background: #dc2626;
  border-color: #b91c1c;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.22);
}

.btn-slate {
  background: #475569;
  border-color: #334155;
  box-shadow: 0 2px 5px rgba(51, 65, 85, 0.18);
}

.btn-lg {
  padding: 13px 20px;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.85rem;
  border-radius: 11px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 0.76rem;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
}

/* ==================== LAYOUT & VIEWS ==================== */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 16px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== LOBBY HERO GRID ==================== */
.arena-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .arena-hero-grid {
    grid-template-columns: 1fr;
  }
}

.super-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 16px rgba(24, 25, 28, 0.06);
  position: relative;
}

.card-royal-glow {
  border-top: 4px solid var(--royal-main);
}

.card-emerald-glow {
  border-top: 4px solid var(--emerald-main);
}

.super-card-ribbon {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.ribbon-gold {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.ribbon-emerald {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.super-card h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.card-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 16px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.label-with-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.link-mini-btn {
  background: none;
  border: none;
  color: var(--royal-main);
  font-weight: 700;
  font-size: 0.76rem;
  cursor: pointer;
  text-decoration: underline;
}

.super-input,
.super-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  outline: none;
}

.super-input:focus,
.super-select:focus {
  border-color: var(--royal-main);
  background: #ffffff;
}

.multi-game-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.game-chip.selected {
  background: var(--royal-main);
  color: #ffffff;
  border-color: var(--royal-main);
}

.hero-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .hero-btn-row {
    grid-template-columns: 1fr;
  }
}

.join-code-box {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.code-input {
  text-transform: uppercase;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 3px;
  text-align: center;
  color: var(--gold-main);
}

.open-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.public-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-light);
}

.public-room-info strong {
  display: block;
  font-size: 0.95rem;
}

.public-room-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.empty-rooms-state {
  padding: 20px;
  text-align: center;
  border-radius: 14px;
  background: var(--surface-elevated);
  border: 1.5px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==================== CATALOG GRID ==================== */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-top: 4px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 16px;
}

.catalog-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 3px 12px rgba(24, 25, 28, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(24, 25, 28, 0.09);
}

.catalog-card-top {
  margin-bottom: 14px;
}

.catalog-preview-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 78px;
  margin: 10px 0 14px;
  gap: 6px;
}

.catalog-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.catalog-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.catalog-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.catalog-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==================== ROOM & GAME BOARD ==================== */
.room-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(24, 25, 28, 0.05);
}

.room-statusbar-left,
.room-statusbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.room-badges-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

#activeRoomCodeBadge {
  cursor: pointer;
}

.room-title-block h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.room-game-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-recessed);
  padding: 5px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
}

.room-game-switcher label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--royal-main);
  white-space: nowrap;
}

.select-compact {
  padding: 6px 10px;
  font-size: 0.84rem;
  width: auto;
}

/* TURN BANNER */
.turn-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface-card);
  border: 1.5px solid var(--border-strong);
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.turn-banner.is-my-turn {
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
  border-color: var(--gold-main);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 6px 16px rgba(245, 158, 11, 0.16);
}

.turn-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.turn-quick-pill.is-mine {
  background: #16a34a;
  color: #ffffff;
}
.turn-quick-pill.is-wait {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
}

.turn-banner.is-my-turn .turn-indicator-dot {
  background: var(--emerald-main);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.22);
}

@keyframes pulseTurnDot {
  from { transform: scale(1); }
  to { transform: scale(1.28); }
}

.turn-indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold-main);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  flex-shrink: 0;
}

.turn-banner-text {
  flex: 1;
  min-width: 210px;
}

.turn-banner-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--text-main);
}

.turn-banner-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* PLAYERS STRIP */
.players-strip[hidden] {
  display: none;
}

.players-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.player-seat-chip {
  min-width: 148px;
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(24, 25, 28, 0.04);
}

.player-seat-chip.active-turn {
  border-color: var(--royal-main);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.14);
}

.seat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-strong);
}

.seat-name {
  font-weight: 700;
  font-size: 0.86rem;
  display: block;
  color: var(--text-main);
}

.seat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.seat-score-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-recessed);
  color: var(--gold-dark);
  border: 1px solid var(--border-light);
  margin-left: auto;
  flex-shrink: 0;
}

.remove-bot-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(153, 27, 27, 0.25);
  background: #fef2f2;
  color: var(--crimson-dark);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.remove-bot-btn:hover {
  background: var(--crimson-main);
  border-color: var(--crimson-dark);
  color: #ffffff;
}

.remove-bot-btn:active {
  transform: scale(0.94);
}

.kick-player-btn {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(153, 27, 27, 0.28);
  background: rgba(254, 242, 242, 0.92);
  color: var(--crimson-dark);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.kick-player-btn:hover {
  background: var(--crimson-main);
  border-color: var(--crimson-dark);
  color: #ffffff;
}

/* ==================== MODO SALA SEM POLUIÇÃO VISUAL (TELA ÚNICA) ==================== */
body.in-room {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

body.in-room .topbar {
  display: none;
}

body.in-room .app-shell {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
}

body.in-room #roomView.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.in-room .room-statusbar {
  padding: 8px 12px;
  margin-bottom: 0;
  border-radius: 14px;
  gap: 8px;
  flex-shrink: 0;
}

body.in-room .turn-banner {
  padding: 8px 12px;
  margin-bottom: 0;
  border-radius: 12px;
  gap: 8px;
  flex-shrink: 0;
}

body.in-room .board-stage {
  flex: 1;
  min-height: 0;
  padding: 8px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

body.in-room .tabletop-felt {
  flex: 1 0 auto;
  min-height: 0;
  padding: 12px 14px;
  gap: 10px;
}

body.in-room .center-arena-table {
  flex-shrink: 0;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  body.in-room .app-shell {
    padding: 6px;
  }

  body.in-room #roomView.active {
    gap: 5px;
  }

  body.in-room .room-statusbar {
    padding: 5px 8px;
    gap: 5px;
  }

  body.in-room .room-title-block h2,
  body.in-room .room-game-switcher label {
    display: none;
  }

  body.in-room #activeGameTypeBadge,
  body.in-room #activeRoundBadge {
    font-size: 0.7rem;
    padding: 2px 7px;
    white-space: nowrap;
  }

  body.in-room .room-badges-line {
    margin-bottom: 0;
    gap: 4px;
  }

  body.in-room .select-compact {
    padding: 4px 6px;
    font-size: 0.74rem;
  }

  body.in-room .btn-sm {
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  body.in-room .turn-banner {
    padding: 5px 10px;
  }

  body.in-room .turn-banner-text strong {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.in-room .turn-banner-text span {
    display: none;
  }

  body.in-room .board-stage {
    padding: 4px;
  }

  body.in-room .tabletop-felt {
    padding: 8px;
    gap: 6px;
    border-radius: 20px;
    border-width: 4px;
  }

  body.in-room .turn-sequence-bar {
    padding: 3px 8px;
    gap: 4px;
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  body.in-room .turn-seq-pill {
    font-size: 0.64rem;
    padding: 2px 6px;
    white-space: nowrap;
  }

  body.in-room .tabletop-opponents-ring {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
  }

  body.in-room .opponent-seat-card {
    min-width: 112px;
    padding: 5px 7px;
    gap: 4px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  body.in-room .opponent-seat-head {
    font-size: 0.7rem;
    gap: 4px;
  }

  body.in-room .opponent-mini-grid {
    gap: 3px;
  }

  body.in-room .playing-card.card-xs {
    width: 30px;
    height: 42px;
    border-radius: 5px;
    padding: 2px;
  }

  body.in-room .playing-card {
    width: 52px;
    height: 74px;
    border-radius: 8px;
    padding: 3px;
  }

  body.in-room .playing-card.card-lg {
    width: 58px;
    height: 82px;
    border-radius: 9px;
    padding: 3px;
  }

  body.in-room .card-corner-top,
  body.in-room .card-corner-bottom {
    font-size: 0.62rem;
  }

  body.in-room .card-center-rank {
    font-size: 1.15rem;
  }

  body.in-room .card-lg .card-center-rank {
    font-size: 1.35rem;
  }

  body.in-room .tabletop-center-zone {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 12px;
  }

  body.in-room .tabletop-piles-row {
    gap: 14px;
  }

  body.in-room .tabletop-hero-seat {
    padding: 7px 10px;
    border-radius: 14px;
  }

  body.in-room .grid-panel-header {
    margin-bottom: 6px;
    font-size: 0.82rem;
  }

  body.in-room .grid-3x2 {
    gap: 5px;
  }

  body.in-room .hand-fan {
    gap: 5px;
    margin: 4px 0;
    min-height: 0 !important;
  }

  body.in-room .action-bar-center {
    margin-top: 6px;
    gap: 6px;
  }

  body.in-room .action-bar-center .btn-3d {
    padding: 7px 11px;
    font-size: 0.78rem;
  }

  body.in-room .memory-board-grid {
    grid-template-columns: repeat(4, auto);
    gap: 5px;
    margin: 4px auto;
  }
}

/* ==================== PLAYING CARDS (BARALHO CLÁSSICO MODERNO) ==================== */
.playing-card {
  position: relative;
  width: 76px;
  height: 108px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdf9 0%, #f6f2e8 100%);
  border: 1.5px solid #d5cebe;
  box-shadow: 0 3px 8px rgba(18, 22, 28, 0.16);
  padding: 4px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.playing-card:hover:not(.disabled) {
  transform: translateY(-4px);
  box-shadow: 0 7px 14px rgba(18, 22, 28, 0.22);
}

.playing-card.selected-card {
  transform: translateY(-9px);
  border-color: var(--gold-main);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.42), 0 8px 16px rgba(18, 22, 28, 0.22);
}

.playing-card.porco-locked-card {
  opacity: 0.72;
  cursor: not-allowed;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.55);
}

.playing-card.card-xs {
  width: 44px;
  height: 62px;
  border-radius: 7px;
  padding: 2px;
}

.playing-card.card-sm {
  width: 58px;
  height: 82px;
  border-radius: 8px;
  padding: 3px;
}

.playing-card.card-lg {
  width: 88px;
  height: 124px;
  border-radius: 12px;
  padding: 5px;
}

.playing-card-inner {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
  background: transparent;
  color: #17191f;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}

.playing-card-inner.suit-red { color: #c61a27; }
.playing-card-inner.suit-black { color: #17191f; }
.playing-card-inner.suit-joker { color: #b45309; }
.playing-card-inner.suit-porco {
  color: #3f4f1c;
  background: radial-gradient(circle at 50% 48%, #f4f1d6 0%, #dce2b2 65%, #b9c383 100%);
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px #6d5333;
}
.porco-svg {
  width: 84%;
  height: 84%;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(45, 58, 16, 0.25));
}
.avatar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.avatar-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}
.avatar-badge.avatar-sm {
  width: 28px;
  height: 28px;
}
.avatar-badge.avatar-xs {
  width: 22px;
  height: 22px;
  border-width: 1.5px;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
}
.avatar-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 12px;
  border: 2px solid rgba(15, 23, 42, 0.14);
  background: #f8fafc;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.avatar-opt:hover {
  transform: scale(1.06);
}
.avatar-opt.selected {
  border-color: #f59e0b;
  background: #fef3c7;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}
.porco-letters-rack {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.porco-letter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.28);
  color: rgba(244, 241, 214, 0.85);
  border: 1px dashed rgba(244, 241, 214, 0.38);
  opacity: 0.46;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.porco-letter-chip.is-lit {
  opacity: 1;
  background: radial-gradient(circle at 50% 40%, #f4f1d6 0%, #c8e06c 62%, #84a93c 100%);
  color: #3f4f1c;
  border: 1.5px solid #6d5333;
  box-shadow:
    0 0 8px rgba(132, 204, 22, 0.65),
    inset 0 0 0 1px rgba(236, 72, 153, 0.4);
  animation: porcoLetterSquish 2.2s ease-in-out infinite;
}
@keyframes porcoLetterSquish {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    box-shadow: 0 0 7px rgba(132, 204, 22, 0.55), inset 0 0 0 1px rgba(236, 72, 153, 0.35);
  }
  25% {
    transform: scale(1.12, 0.92) rotate(-3deg);
    box-shadow: 0 0 12px rgba(163, 230, 53, 0.85), inset 0 0 0 1px rgba(236, 72, 153, 0.6);
  }
  55% {
    transform: scale(0.95, 1.08) rotate(3deg);
  }
}

.card-corner-top,
.card-corner-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 0.95;
}

.card-corner-bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.card-xs .card-corner-top,
.card-xs .card-corner-bottom {
  font-size: 0.56rem;
}

/* Miniatura legível: número no canto superior e naipe grande ao centro; sem canto inferior nem naipe duplicado. */
.card-xs .card-corner-bottom,
.card-xs .card-corner-top span:nth-child(2) {
  display: none;
}
.card-xs .card-corner-top {
  font-size: 0.68rem;
  line-height: 1;
  margin: 1px 0 0 2px;
  align-self: flex-start;
}
.card-xs .card-center-rank {
  font-size: 1.2rem;
  padding-top: 8px;
}

.card-sm .card-corner-top,
.card-sm .card-corner-bottom {
  font-size: 0.66rem;
}

.card-center-rank {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.card-xs .card-center-rank { font-size: 1.2rem; }
.card-sm .card-center-rank { font-size: 1.25rem; }
.card-lg .card-center-rank { font-size: 2.05rem; }

.card-pts-tag {
  position: absolute;
  bottom: 3px;
  left: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 4px;
  border-radius: 4px;
}

/* Carta fechada */
.playing-card.face-down {
  background: #f6f2e8;
  border-color: #d5cebe;
}

.playing-card.face-down .playing-card-inner {
  background: linear-gradient(180deg, var(--card-back-top) 0%, var(--card-back-bottom) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  align-items: center;
  justify-content: center;
}

.card-back-emblem {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #f6f2e8;
}

.card-xs .card-back-emblem {
  width: 18px;
  height: 18px;
  font-size: 0.6rem;
}

/* Carta zerada (Coluna de par igual no Mexe Mexe — mantém carta visível) */
.playing-card.removed-slot {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px dashed rgba(134, 239, 172, 0.6);
  box-shadow: none;
  cursor: default;
  align-items: center;
  justify-content: center;
  color: #bbf7d0;
  font-family: var(--font-display);
  font-size: 0.72rem;
}

.playing-card.removed-card {
  opacity: 0.82;
  border-color: #16a34a;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.22);
  cursor: default;
}

.playing-card.removed-card:hover {
  transform: none;
}

.card-zero-badge {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
  color: #ffffff;
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 2;
}

.card-xs .card-zero-badge {
  font-size: 0.46rem;
  padding: 0 3px;
  bottom: 2px;
}

/* ==================== BOARD STAGE & POKER TABLETOP ==================== */
.board-stage {
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(24, 25, 28, 0.06);
  min-height: 460px;
}

.tabletop-felt {
  background: radial-gradient(ellipse at center, #215744 0%, #14382c 100%);
  border: 8px solid #6b4c35;
  outline: 2px solid #d5cebe;
  border-radius: 64px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 510px;
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.34), 0 8px 24px rgba(18, 22, 28, 0.14);
}

@media (max-width: 680px) {
  .tabletop-felt {
    border-radius: 22px;
    border-width: 4px;
    padding: 10px 8px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }

  #openRulesModalBtn,
  #roomRulesBtn {
    display: inline-flex !important;
    flex-shrink: 0;
  }

  .room-statusbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .grid-3x2 {
    gap: 6px;
  }

  .grid-3x2 .playing-card {
    width: 64px;
    height: 90px;
    padding: 3px;
  }

  .opponent-seat-card {
    min-width: 140px;
    padding: 8px 9px;
  }

  .opponent-mini-grid .playing-card.card-xs {
    width: 34px;
    height: 48px;
  }
}

.reconnect-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(16, 185, 129, 0.12));
  border: 2px solid var(--gold-main);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.18);
}

.reconnect-banner[hidden] {
  display: none;
}

.reconnect-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reconnect-banner-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reconnect-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat-turn-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.22);
  color: #64748b;
  white-space: nowrap;
}

.opponent-seat-card .seat-turn-tag {
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.seat-turn-tag.is-current {
  background: var(--gold-main) !important;
  color: #18191c !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

.seat-turn-tag.is-next {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.opponent-seat-card .seat-turn-tag.is-next {
  color: #fde68a !important;
}

.turn-seq-pill.is-current {
  background: var(--gold-main);
  color: #18191c;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.turn-seq-pill.is-next {
  border-color: rgba(245, 158, 11, 0.55);
  color: #fde68a;
}

.turn-seq-arrow {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  font-weight: 700;
}

.tabletop-opponents-ring {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
}

.opponent-seat-card {
  background: rgba(11, 31, 24, 0.56);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 10px 12px;
  color: #f8fafc;
  min-width: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.opponent-seat-card.is-active-turn {
  border: 2.5px solid #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.42), 0 0 16px rgba(245, 158, 11, 0.35);
  animation: activeSeatPulse 1.6s ease-in-out infinite;
}

.opponent-seat-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
}

.opponent-seat-head strong {
  color: #ffffff;
  font-weight: 700;
}

.opponent-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 5px;
}

.opponent-mini-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 8px;
}

.opponent-mini-fan .playing-card {
  margin-left: -18px;
  box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.3);
}

.opponent-mini-fan .playing-card:first-child {
  margin-left: 0;
}

.tabletop-center-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(10, 28, 21, 0.34);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  text-align: center;
  color: #f8fafc;
}

.tabletop-center-zone .pile-label {
  color: #e2e8f0;
}

.tabletop-piles-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.tabletop-hero-seat {
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #e2ded3;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes activeSeatPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45), 0 8px 22px rgba(245, 158, 11, 0.25);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.42), 0 10px 28px rgba(34, 197, 94, 0.32);
  }
}

.tabletop-hero-seat.is-active-turn {
  border: 2.5px solid #f59e0b;
  animation: activeSeatPulse 1.4s ease-in-out infinite;
}

.tabletop-hero-seat.is-active-turn .seat-turn-tag.is-current,
.player-grid-panel.is-active-turn .seat-turn-tag.is-current {
  animation: pulseTurnDot 0.9s infinite alternate;
}

/* MEXE MEXE DECK + 3x2 GRIDS */
.mexe-center-well {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.pile-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pile-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mexe-grids-Arena {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
  gap: 18px;
}

.player-grid-panel {
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: 18px;
  padding: 14px;
}

.player-grid-panel.is-me {
  border-color: var(--royal-main);
}

.player-grid-panel.is-active-turn {
  border: 2.5px solid #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
  animation: activeSeatPulse 1.6s ease-in-out infinite;
}

.grid-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.grid-3x2 {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 10px;
  justify-content: center;
}

/* PRESIDENTE & PORCO & BLACKJACK HAND */
.center-arena-table {
  text-align: center;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface-recessed);
  border: 1.5px solid var(--border-strong);
  margin-bottom: 20px;
}

.hand-fan {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.action-bar-center {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

/* BOTÃO DE REFLEXO GIGANTE DO PORCO */
.porco-reflex-btn {
  font-size: 1.35rem;
  padding: 18px 34px;
  animation: pulseAlert 0.7s infinite alternate;
}

@keyframes pulseAlert {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* MEMÓRIA REAL GRID */
.memory-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 16px auto;
  justify-items: center;
}

/* ==================== MODALS & TOAST ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 9, 18, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.super-modal {
  background: var(--surface-card);
  border: 1.5px solid var(--border-light);
  border-radius: 22px;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 44px rgba(24, 25, 28, 0.22);
}

.super-modal.modal-sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border-light);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.modal-body {
  padding: 20px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-item {
  background: var(--surface-recessed);
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border-light);
}

.rule-item h4 {
  font-family: var(--font-display);
  color: var(--royal-main);
  margin-bottom: 4px;
}

.rule-item p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.avatar-opt {
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-recessed);
  font-size: 1.4rem;
  cursor: pointer;
}

.avatar-opt.selected {
  border-color: var(--royal-main);
  background: var(--surface-card);
  box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.25);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.super-toast {
  background: var(--text-main);
  border: 1.5px solid var(--gold-main);
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 20px rgba(24, 25, 28, 0.25);
  animation: fadeIn 0.2s ease;
}

button:focus-visible,
[role="button"]:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2.5px solid var(--gold-main);
  outline-offset: 2px;
}

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

/* ---- Carta perdida (troca no Mexe Mexe) ------------------------------------------------------------------ */
.lost-card-toast {
  position: fixed;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(20, 24, 36, 0.94);
  border: 1px solid rgba(253, 230, 138, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  pointer-events: none;
  animation: lost-card-in 0.28s ease-out, lost-card-out 0.35s ease-in 2.85s forwards;
}
.lost-card-body { display: flex; align-items: center; gap: 14px; }
.lost-card-text { display: flex; flex-direction: column; gap: 6px; font-size: 0.95rem; }
.lost-card-body.is-good { border-color: #84cc16; }
.lost-card-toast:has(.is-good) { border-color: #84cc16; box-shadow: 0 12px 32px rgba(132, 204, 22, 0.25); }
.lost-card-pig { position: relative; width: 64px; height: 64px; animation: lost-card-laugh 0.45s ease-in-out infinite alternate; }
.lost-card-pig .porco-svg { width: 100%; height: 100%; }
.lost-card-pig-hand { position: absolute; right: -14px; bottom: 2px; font-size: 1.4rem; }
.lost-card-taunt { margin: 0; font-weight: 700; color: #bef264; }
@keyframes lost-card-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes lost-card-out { to { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes lost-card-laugh { from { transform: rotate(-7deg) scale(1); } to { transform: rotate(7deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .lost-card-toast { animation: lost-card-out 0.01s linear 3s forwards; }
  .lost-card-pig { animation: none; }
}

/* 21: resultado por jogador no fim da rodada */
.bj-results {
  margin: 14px auto 0;
  max-width: 560px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid var(--border-strong);
}
.bj-results-head {
  font-family: var(--font-display);
  font-weight: 800;
  color: #fde68a;
  margin-bottom: 8px;
  text-align: center;
}
.bj-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.88rem;
  color: #f1f5f9;
}
.bj-result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.bj-result-status {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #334155;
}
.bj-result-row.is-win .bj-result-status { background: #10b981; color: #052e16; }
.bj-result-row.is-lose .bj-result-status { background: #475569; color: #f8fafc; }
.bj-result-row.is-bust .bj-result-status { background: #dc2626; color: #ffffff; }
.bj-result-row.is-push .bj-result-status { background: #f59e0b; color: #1e1b18; }

.pill-crimson {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #ffffff;
}

/* Carta comprada/selecionada na pilha: não sobe sobre o rótulo ("CARTA COMPRADA" ficava cortada pela borda da carta) */
.pile-box .playing-card.selected-card {
  transform: none;
}

/* Celular: alvos de toque >= 44px, oponentes sem corte lateral e headline com até 2 linhas */
@media (max-width: 768px) {
  body.in-room .btn-sm,
  body.in-room .btn-xs,
  body.in-room .action-bar-center .btn-3d,
  body.in-room .kick-player-btn,
  body.in-room .remove-bot-btn {
    min-height: 44px;
    min-width: 44px;
  }

  body.in-room .tabletop-opponents-ring {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }

  body.in-room .opponent-seat-card {
    flex: 1 1 150px;
    min-width: 0;
    max-width: 100%;
  }

  body.in-room .opponent-seat-head {
    flex-wrap: wrap;
    justify-content: center;
  }

  body.in-room .turn-banner-text strong {
    white-space: normal;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
  }
}
