/* ===================================================
   FODINHA DO ZANESCO ONLINE - CSS COMPLETO
   Responsivo para PC e Celular
   =================================================== */

:root {
  --bg-deep: #07090c;
  --bg-dark: #0e1218;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.45);
  --gold-light: #f5d77f;
  --text-main: #f0f3f6;
  --text-muted: #8e9aab;
  --seat-bg: rgba(18, 24, 32, 0.92);
  --seat-border: rgba(212, 175, 55, 0.4);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #000000;
  color: var(--text-main);
}

/* ===================================================
   CASINO BACKGROUND AMBIENT
   =================================================== */

.casino-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.light-spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110vw;
  height: 90vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(30, 48, 40, 0.35) 0%, rgba(14, 22, 28, 0.65) 45%, rgba(7, 9, 12, 0.98) 80%);
}

.subtle-felt-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: radial-gradient(#ffffff 1px, transparent 1px);
  background-size: 18px 18px;
}

.vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
}

.hidden {
  display: none !important;
}

/* ===================================================
   SISTEMA DE TELAS COMPLETAS (SPA FULLSCREEN)
   =================================================== */

.app-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: none !important;
  overflow: hidden;
  z-index: 20;
  background-color: #000000;
}

.app-screen.active {
  display: flex !important;
  flex-direction: column;
}

.screen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

/* ===================================================
   TELA 1: MENU PRINCIPAL (FUNDO TOTALMENTE PRETO)
   =================================================== */

#screen-menu {
  background: #000000 !important;
  background-color: #000000 !important;
}

#screen-menu.active {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  overflow-y: auto;
}

.menu-screen-content {
  width: 100%;
  max-width: 420px;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  margin: auto !important;
  animation: screenFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo Oficial Fodinha do Zanesco */
.menu-logo-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.menu-table-logo {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 16px rgba(212, 175, 55, 0.35));
  animation: logoGlowPulse 3s ease-in-out infinite alternate;
}

@keyframes logoGlowPulse {
  from { filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 14px rgba(212, 175, 55, 0.3)); transform: scale(1); }
  to { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 26px rgba(212, 175, 55, 0.6)); transform: scale(1.02); }
}

/* Painel de Perfil */
.player-profile-panel {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0d1117;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.avatar-selector-box {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #141b26;
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.avatar-selector-box:hover {
  transform: scale(1.08);
  border-color: #fff;
}

.avatar-current {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
}

.avatar-badge-tag {
  position: absolute;
  bottom: -4px;
  background: #000;
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
  font-size: 0.52rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}

.nickname-input-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.profile-input-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  text-align: center;
  width: 100%;
}

.profile-text-input {
  width: 100%;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 12px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-text-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

/* Botões do Menu */
.menu-action-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
}

.menu-cta-btn {
  width: 100%;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.btn-gold {
  background: linear-gradient(135deg, #fce28d 0%, #d4af37 45%, #967015 100%);
  border: none;
  color: #0c0e12;
  padding: 14px 18px;
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  gap: 14px;
  justify-content: center;
  text-align: center;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(212, 175, 55, 0.55);
  filter: brightness(1.06);
}

.btn-cta-icon {
  font-size: 1.5rem;
  background: #0c0e12;
  color: #fce28d;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-cta-texts {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.btn-cta-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.btn-cta-sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 2px;
}

/* Caixa para Entrar com Código */
.join-room-box {
  display: flex;
  gap: 8px;
  width: 100%;
}

.room-code-input {
  flex: 1;
  background: rgba(14, 18, 26, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 12px 14px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

.room-code-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.btn-join-room {
  background: rgba(28, 38, 54, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--gold-light);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-join-room:hover {
  background: rgba(40, 54, 76, 1);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.menu-btn-outline {
  width: 100%;
  background: rgba(18, 24, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e5ed;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-btn-outline:hover {
  background: rgba(28, 36, 50, 0.9);
  border-color: rgba(212, 175, 55, 0.5);
  color: #fff;
}

.menu-status-bar {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* ===================================================
   TELA 2: LOBBY DA SALA (SALA DE ESPERA)
   =================================================== */

#screen-lobby {
  background: #000000 !important;
  background-color: #000000 !important;
}

#screen-lobby.active {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  overflow-y: auto;
}

.lobby-screen-content {
  max-width: 520px;
  width: 100%;
  margin: auto;
  gap: 16px;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.btn-back-link {
  background: rgba(18, 24, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back-link:hover {
  color: #fff;
  border-color: var(--gold-primary);
}

.lobby-badge {
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.room-code-card {
  width: 100%;
  background: rgba(18, 24, 34, 0.9);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.code-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold-light);
}

.code-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.room-big-code {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
}

.btn-copy-gold {
  background: rgba(212, 175, 55, 0.22);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-gold:hover {
  background: var(--gold-primary);
  color: #000;
}

/* Roster de Jogadores */
.lobby-players-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.players-list-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-align: left;
}

.lobby-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.roster-player-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 18, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
}

.roster-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #141b26;
  border: 1.5px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.roster-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.roster-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-role-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold-light);
}

.lobby-actions-footer {
  width: 100%;
  margin-top: auto;
}

.host-controls-group {
  display: flex;
  gap: 10px;
}

.btn-secondary-action {
  background: rgba(25, 34, 48, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.btn-start-game-gold {
  flex: 1;
  background: linear-gradient(135deg, #fce28d 0%, #d4af37 45%, #967015 100%);
  border: none;
  color: #0c0e12;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 1px;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.btn-start-game-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.55);
}

.waiting-host-notice {
  background: rgba(14, 18, 26, 0.8);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 14px;
  border-radius: 12px;
}

/* ===================================================
   TELA 3: REGRAS DO JOGO
   =================================================== */

#screen-rules {
  background: #000000 !important;
}

#screen-rules.active {
  display: flex !important;
  flex-direction: column !important;
  padding: calc(18px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  align-items: center;
}

.rules-screen-content {
  max-width: 600px;
  width: 100%;
  margin: auto;
  gap: 16px;
}

.rules-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.rules-title {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  color: #fff;
}

.rules-body-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.rule-card {
  background: rgba(18, 24, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.rule-card.highlight-card {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(24, 32, 46, 0.95);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.12);
}

.card-chip-tag {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--gold-light);
}

.rule-card h3 {
  font-size: 0.95rem;
  color: #fff;
}

.rule-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Linha da Hierarquia dos Naipes */
.suits-hierarchy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  border-radius: 10px;
  margin: 6px 0;
}

.suit-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
}

.suit-step.red-step .s-sym { color: #e53935; }
.suit-step.black-step .s-sym { color: #f5f5f5; }

.s-sym {
  font-size: 1.25rem;
  line-height: 1;
}

.s-name {
  font-size: 0.65rem;
  color: #fff;
  margin-top: 2px;
}

.s-lvl {
  font-size: 0.55rem;
  color: var(--gold-light);
}

.suit-arrow {
  font-weight: 900;
  color: var(--gold-primary);
  font-size: 1.1rem;
}

.rule-extra-tip {
  font-size: 0.74rem !important;
  color: #fff2c4 !important;
}

/* ===================================================
   TELA 4: MESA DE JOGO AO VIVO
   =================================================== */

#screen-game {
  background: #000000;
}

#screen-game.active {
  display: flex !important;
  flex-direction: column !important;
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.game-hud-bar {
  position: absolute;
  top: calc(10px + var(--safe-top));
  left: 14px;
  right: 14px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.hud-room-code {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold-light);
  background: rgba(18, 24, 34, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
}

.hud-round-pill {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: rgba(22, 30, 44, 0.9);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hud-center-msg {
  flex: 1;
  max-width: 520px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: rgba(12, 16, 24, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}

.btn-hud-exit {
  background: rgba(18, 24, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-hud-exit:hover {
  color: #fff;
  border-color: #ff5252;
}

/* ===================================================
   PALCO CENTRAL DA MESA
   =================================================== */

.table-stage {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(45px + var(--safe-top)) 14px calc(25px + var(--safe-bottom));
}

.table-tilt-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
}

.table-container {
  position: relative;
  width: 100%;
  aspect-ratio: 935 / 467;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-shadow {
  position: absolute;
  inset: 5% 4%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 75%);
  filter: blur(28px);
  transform: translateY(22px) scale(0.96);
  z-index: 1;
  pointer-events: none;
}

.table-board {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

#table-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.75));
}

/* Centro da mesa: cartas jogadas */
.table-trick-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  pointer-events: none;
}

.trick-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cardPlayDrop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardPlayDrop {
  from { opacity: 0; transform: scale(1.3) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.trick-player-tag {
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

/* ===================================================
   ASSENTOS DOS JOGADORES (8 ASSENTOS DINÂMICOS)
   =================================================== */

.table-seats {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.seat {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

/* Posições dos 8 Jogadores */
.seat-pos-0 { top: 2%;   left: 14%; } /* Top 1 */
.seat-pos-1 { top: -4%;  left: 38%; } /* Top 2 */
.seat-pos-2 { top: -4%;  left: 62%; } /* Top 3 */
.seat-pos-3 { top: 2%;   left: 86%; } /* Top 4 */
.seat-pos-4 { top: 98%;  left: 86%; } /* Bottom 4 */
.seat-pos-5 { top: 104%; left: 62%; } /* Bottom 3 (Você quando 8) */
.seat-pos-6 { top: 104%; left: 38%; } /* Bottom 2 */
.seat-pos-7 { top: 98%;  left: 14%; } /* Bottom 1 */

.seat-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  background: var(--seat-bg);
  border: 2px solid var(--seat-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
}

.avatar-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-letter {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
  letter-spacing: 0.5px;
}

.is-turn-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid #2ecc71;
  animation: turnGlow 1.8s infinite;
}

.dealer-chip {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  color: #111;
  border: 1.5px solid #d4af37;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Carta na Cabeça (Testa) - Efeito especial da Rodada 1 */
.head-card-holder {
  position: absolute;
  top: -26px;
  z-index: 20;
  animation: headCardFloat 2s ease-in-out infinite;
}

@keyframes headCardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.seat-info {
  margin-top: 3px;
  background: rgba(14, 18, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.seat-player-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.seat-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.seat-card-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Brilho da Carta Mais Forte na Mesa até o Momento */
.card.is-winning-card {
  box-shadow: 0 0 16px #ffd700, 0 0 32px rgba(255, 215, 0, 0.8) !important;
  border: 2px solid #ffd700 !important;
  animation: winningCardPulse 1.2s infinite alternate !important;
  z-index: 40 !important;
}

@keyframes winningCardPulse {
  0% {
    box-shadow: 0 0 14px #ffd700, 0 0 22px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 26px #fff2a3, 0 0 45px rgba(255, 215, 0, 0.95);
    transform: scale(1.12);
  }
}

.winning-card-glow-pill {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
  color: #000;
  font-size: 0.52rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px #ffd700;
  z-index: 45;
}

.cards-count-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.player-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.player-bid-badge {
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(212, 175, 55, 0.25);
  color: var(--gold-light);
  padding: 0 4px;
  border-radius: 4px;
}

/* Letras de FODINHA */
.player-fodinha {
  display: flex;
  align-items: center;
  gap: 2px;
}

.seat-top .player-fodinha { margin-bottom: 4px; }
.seat-bottom .player-fodinha { margin-top: 4px; }

.letter-box {
  width: 17px;
  height: 17px;
  background: rgba(12, 16, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.64rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
}

.letter-box.lost {
  background: rgba(185, 30, 30, 0.9);
  border-color: #ff5252;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(255, 82, 82, 0.6);
  font-weight: 900;
}

/* ===================================================
   CARTAS NA MÃO (LEQUE)
   =================================================== */

.player-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
}

.seat-top .player-hand { margin-top: 5px; }
.seat-bottom .player-hand { margin-bottom: 5px; }

/* Cartas dos Adversários */
.opponent-hand .card-fan {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 32px;
}

.opponent-hand .card-back {
  width: 20px;
  height: 30px;
  border-radius: 2.5px;
  background: linear-gradient(145deg, #a81c1c 0%, #680e0e 100%);
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
  margin-left: -13px;
  transform-origin: bottom center;
  transform: rotate(calc((var(--i) - 3.5) * 5deg));
}

.opponent-hand .card-back:first-child { margin-left: 0; }

.cards-badge {
  position: absolute;
  bottom: -4px;
  right: -6px;
  background: rgba(14, 18, 26, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.6);
  color: var(--gold-light);
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 999px;
}

/* Suas Cartas (Visíveis) */
.my-hand .my-cards-fan {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 68px;
}

.card-front {
  width: 44px;
  height: 64px;
  border-radius: 4.5px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 3px;
  cursor: pointer;
  position: relative;
  user-select: none;
  font-weight: 800;
  line-height: 1;
}

.my-hand .card-front {
  margin-left: -14px;
  transform-origin: bottom center;
  transform: rotate(calc((var(--i) - 3.5) * 4deg));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.my-hand .card-front:first-child { margin-left: 0; }

.my-hand .card-front:hover {
  transform: translateY(-14px) scale(1.15) !important;
  z-index: 50 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.9), 0 0 12px rgba(212, 175, 55, 0.5);
}

.my-hand .card-front.selected {
  transform: translateY(-16px) scale(1.18) !important;
  z-index: 50 !important;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.6);
}

.card-front.red-card { color: #c62828; }
.card-front.black-card { color: #111111; }

.c-rank { font-size: 0.75rem; font-family: 'Plus Jakarta Sans', sans-serif; }
.c-suit { font-size: 0.7rem; }
.c-big-suit { font-size: 1.25rem; line-height: 1; }

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-corner.top-left { align-self: flex-start; }
.card-corner.bottom-right { align-self: flex-end; transform: rotate(180deg); }
.card-center { display: flex; align-items: center; justify-content: center; flex: 1; }

/* Mini carta da vaza / na cabeça */
.mini-card {
  width: 32px;
  height: 48px;
  padding: 2px;
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}
.mini-card .c-rank { font-size: 0.62rem; }
.mini-card .c-suit { font-size: 0.58rem; }
.mini-card .c-big-suit { font-size: 0.9rem; }

/* ===================================================
   OVERLAYS DE AÇÃO (PALPITE & JOGAR CARTA)
   =================================================== */

.bid-panel-overlay {
  position: absolute;
  bottom: calc(18px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  animation: panelSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.bid-box {
  background: rgba(14, 18, 26, 0.96);
  border: 1.5px solid var(--gold-primary);
  border-radius: 18px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(12px);
}

.bid-prompt-title {
  font-family: 'Cinzel', serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.bid-prompt-sub {
  font-size: 0.72rem;
  color: #ffca28;
  font-weight: 600;
}

.bid-options-row {
  display: flex;
  gap: 6px;
}

.btn-bid-choice {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(25, 34, 48, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-bid-choice:hover:not(:disabled) {
  background: var(--gold-primary);
  color: #000;
  transform: scale(1.1);
}

.btn-bid-choice:disabled {
  opacity: 0.35;
  background: #1a1a1a;
  border-color: #444;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Botão Flutuante de Confirmação para Jogar Carta */
.action-play-bar {
  position: absolute;
  bottom: calc(16px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
}

.btn-confirm-play-card {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  border: 1.5px solid #abebc6;
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(46, 204, 113, 0.5);
  animation: pulseButton 1.5s infinite;
}

@keyframes pulseButton {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes turnGlow {
  0%, 100% { opacity: 0.5; box-shadow: 0 0 4px rgba(46, 204, 113, 0.4); }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(46, 204, 113, 0.9); }
}

/* ===================================================
   RESPONSIVIDADE (CELULAR)
   =================================================== */

@media (max-width: 768px) {
  /* ========================================================
     ARENA MOBILE EXCLUSIVA (SEM MESA REDONDA, JOGADORES EMPILHADOS)
     ======================================================== */

  /* Retira a mesa e sombra no celular */
  #table-img {
    display: none !important;
  }

  .table-shadow {
    display: none !important;
  }

  .table-stage {
    padding: calc(48px + var(--safe-top)) 10px calc(10px + var(--safe-bottom)) !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .table-tilt-wrapper {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .table-container {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: unset !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  .table-board {
    display: none !important;
  }

  /* Lista empilhada de todos os jogadores */
  .table-seats {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    overflow-y: auto !important;
    pointer-events: auto !important;
    padding: 6px 0 20px !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Cada jogador é uma linha/card limpo */
  .seat {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    background: #0d1219 !important;
    border: 1px solid rgba(212, 175, 55, 0.25) !important;
    border-radius: 12px !important;
    padding: 7px 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Seu assento fixado/destacado na parte inferior */
  .seat.is-me {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 50 !important;
    background: #141c28 !important;
    border: 2px solid var(--gold-primary) !important;
    box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.85), 0 0 15px rgba(212, 175, 55, 0.3) !important;
    margin-top: auto !important;
  }

  .seat-player-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .seat-avatar {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0 !important;
  }

  .seat-info {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 4px !important;
    align-items: flex-start !important;
  }

  .seat-name-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .player-name {
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .player-bid-badge {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    color: var(--gold-light) !important;
    background: rgba(212, 175, 55, 0.15) !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  .player-fodinha {
    display: flex !important;
    gap: 2.5px !important;
  }

  .letter-box {
    width: 14px !important;
    height: 14px !important;
    font-size: 0.55rem !important;
    font-weight: 800 !important;
    border-radius: 3px !important;
  }

  .seat-card-slot {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    flex-shrink: 0 !important;
  }

  .seat-played-card .mini-card {
    width: 36px !important;
    height: 52px !important;
    border-radius: 6px !important;
  }

  .cards-count-pill {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    padding: 2px 6px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  /* Cartas na sua mão */
  .my-hand {
    width: 100% !important;
    margin-top: 8px !important;
    display: flex !important;
    justify-content: center !important;
  }

  .my-cards-fan {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 72px !important;
    padding-bottom: 6px !important;
    max-width: 100% !important;
  }

  .my-hand .card-front {
    width: 46px !important;
    height: 66px !important;
    margin-left: -13px !important;
    padding: 3px 4px !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  .my-hand .card-front.selected {
    transform: translateY(-16px) scale(1.15) !important;
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.95) !important;
    border-color: #ffd700 !important;
    z-index: 50 !important;
  }

  .c-rank { font-size: 0.72rem !important; }
  .c-suit { font-size: 0.65rem !important; }
  .c-big-suit { font-size: 1.1rem !important; }

  /* Elementos de Menu e HUD */
  .menu-logo-container {
    max-width: 300px !important;
    margin-bottom: 12px !important;
  }

  .menu-table-logo {
    max-height: 120px !important;
  }

  .player-profile-panel {
    padding: 10px 12px !important;
    margin-bottom: 16px !important;
  }

  .avatar-selector-box {
    width: 44px !important;
    height: 44px !important;
  }

  .avatar-current {
    font-size: 1.4rem !important;
  }

  .btn-gold {
    padding: 12px 14px !important;
  }

  .btn-cta-title {
    font-size: 0.98rem !important;
  }

  .game-hud-bar {
    top: calc(6px + var(--safe-top)) !important;
    left: 8px !important;
    right: 8px !important;
  }

  .hud-center-msg {
    font-size: 0.68rem !important;
    padding: 4px 10px !important;
  }

  .action-play-bar {
    position: fixed !important;
    bottom: calc(10px + var(--safe-bottom)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 28px) !important;
    max-width: 360px !important;
    z-index: 100 !important;
  }

  .btn-confirm-play-card {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 0.92rem !important;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.7) !important;
  }

  .bid-box {
    width: calc(100% - 32px) !important;
    max-width: 340px !important;
    padding: 18px 14px !important;
    border-radius: 18px !important;
  }

  .bid-prompt-title {
    font-size: 0.92rem !important;
  }

  .bid-options-row {
    gap: 8px !important;
  }

  .btn-bid-choice {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.05rem !important;
    border-radius: 10px !important;
  }
}
