/* =========================================================
   1) RESET GERAL
   ---------------------------------------------------------
   Remove espaçamentos padrão e define box model previsível.
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Palco fixo do jogo, no estilo portal cl?ssico */
.game-frame {
  width: 920px;
  aspect-ratio: 16 / 9;
  height: 580px;
  margin: auto;
  position: absolute;
  overflow: hidden;
  border-radius: 18px;
  background: #101418;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

/* Configurações em Tela Cheia */

.game-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
}

.game-frame:fullscreen .game-shell {
  padding: 32px;
  grid-template-columns: 220px 1fr;
  gap: 32px;
}

.game-frame:fullscreen .playfield-stage {
  --stage-width: min(1100px, 100%);
  --stage-height: clamp(520px, 60vh, 1280px);
  --table-width: clamp(650px, 52vw, 1920px);
  --bottom-seat-gap: -28px;
}

.game-frame:fullscreen .game-table-wrapper {
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0px;
  padding: 18px 12px 18px;
}

.game-frame:fullscreen .player-hand-zone {
  width: min(860px, 100%);
  height: 260px;
  top: -86px;
}

@media (max-width: 1366px) {
  .game-frame:fullscreen .player-hand-zone {
    top: -140px;
  }
}

.game-frame:fullscreen #player-hand {
  width: min(700px, 100%);
  height: 128px;
}

.game-frame:fullscreen .status-box {
  width: min(100%, 760px);
  min-height: 52px;
  top: -25px;
}

.game-frame:fullscreen .game-sidebar {
  max-width: 200px;
  gap: 22px;
}

.game-frame:fullscreen .top-controls {
  gap: 12px;
}



/* =========================================================
   2) BASE DO DOCUMENTO
   ---------------------------------------------------------
   O jogo deve sempre ocupar a viewport inteira, sem scroll.
   ========================================================= */
/* html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 16px;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background: #ffffff;
} */


/* =========================================================
   3) FUNDO / CENÁRIO
   ---------------------------------------------------------
   Fundo preparado para imagem real.
   Se a imagem não existir, o gradiente continua como base.
   ========================================================= */
.background-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;

  background:
    linear-gradient(rgba(8, 12, 16, 0.34), rgba(8, 12, 16, 0.52)),
    url("images/bg.png"),
    linear-gradient(180deg, #52675a 2%, #38483d 34%, #1f2a24 56%, #11171d 80%);

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.background-scene::before {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 35%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.008) 0px,
      rgba(255, 255, 255, 0.008) 2px,
      transparent 2px,
      transparent 10px
    );

  opacity: 0.25;
}

.background-scene::after {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.28) 56%, rgba(0, 0, 0, 0.54) 100%);
}


/* =========================================================
   4) TELA INICIAL
   ---------------------------------------------------------
   Overlay da tela inicial com campo de nome e botão iniciar.
   ========================================================= */
.screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  border-radius: inherit;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(6px);
}

.start-box {
  width: min(92%, 420px);
  padding: 28px 24px;

  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);

  background: rgba(19, 25, 31, 0.84);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);

  text-align: center;
}

.result-overlay {
  z-index: 80;
  background: rgba(6, 10, 14, 0.4);
  backdrop-filter: blur(10px);
}

.result-modal {
  width: min(92%, 440px);
  padding: 26px 24px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(25, 33, 40, 0.82) 0%,
    rgba(16, 22, 28, 0.76) 100%
  );
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  text-align: center;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-title {
  font-size: clamp(1.7rem, 3.2vw, 2.15rem);
  line-height: 1.05;
  margin-bottom: 10px;
  color: #dfe9ff;
}

.result-message {
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.84);
  margin-bottom: 20px;
}

.result-action-btn {
  min-width: 210px;
}

.result-modal.is-win .result-title {
  color: #f7d45b;
}

.result-modal.is-loss .result-title {
  color: #ffb0b0;
}

.result-modal.is-cat .result-title {
  color: #ffd36f;
}

.result-modal.is-draw .result-title {
  color: #dfe9ff;
}


.trump-modal {
  width: min(92%, 420px);
}

.trump-modal .result-title:empty {
  display: none;
}

.trump-popup-card {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
}

.trump-popup-card .card {
  width: 86px;
  height: 124px;
  transform: none !important;
  position: relative;
  left: auto;
  bottom: auto;
}

/* Visual do HUD de preparação da rodada e da barra de progresso dos passos com loading. */
.round-flow-modal {
  width: min(92%, 500px);
  color: #f4f0da;
}

.round-flow-modal .result-title {
  color: #f4f0da;
  -webkit-text-fill-color: #f4f0da;
  font-size: clamp(1.45rem, 2.9vw, 1.95rem);
  line-height: 1.1;
  margin-bottom: 8px;
}

.round-flow-modal .result-message {
  color: rgba(255, 255, 255, 0.88);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.88);
}

.round-flow-modal .result-message.hidden,
.round-flow-progress.hidden {
  display: none;
}

.round-flow-progress {
  width: 100%;
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.round-flow-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4c95d 0%, #ffe79c 100%);
  box-shadow: 0 0 18px rgba(244, 201, 93, 0.35);
}

.destrunfo-modal {
  width: min(92%, 430px);
}

.destrunfo-modal .result-title {
  color: #f4f0da;
}

.destrunfo-modal .result-message {
  color: rgba(255, 255, 255, 0.9);
}

.result-action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: stretch;
}

.result-action-row .result-action-btn {
  flex: 1 1 0;
  min-width: 0;
}

.destrunfo-modal .result-action-btn {
  width: auto;
  min-width: 0;
  height: 48px;
}

.destrunfo-modal .secondary-btn,
.destrunfo-modal .primary-btn {
  flex: 1 1 0;
}

.destrunfo-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  user-select: none;
  line-height: 1.3;
  text-align: center;
}

.destrunfo-checkbox-row span {
  color: inherit;
}

.destrunfo-checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: #f7d45b;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .destrunfo-modal {
    width: min(94%, 420px);
    padding: 22px 18px 20px;
  }

  .destrunfo-modal .result-title {
    font-size: clamp(1.4rem, 4.4vw, 1.8rem);
  }

  .destrunfo-modal .result-message {
    font-size: 0.96rem;
    margin-bottom: 16px;
  }

  .destrunfo-modal .result-action-row {
    gap: 10px;
  }

  .destrunfo-modal .result-action-btn {
    min-width: 0;
    padding: 0 10px;
    font-size: 0.95rem;
  }

  .destrunfo-checkbox-row {
    margin-top: 14px;
    font-size: 0.88rem;
  }
}

.game-title {
  font-size: clamp(1.7rem, 2vw, 2rem);
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 10px;
}

.game-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-bottom: 20px;
}

.input-group label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.86);
}

.input-group input {
  width: 100%;
  height: 48px;
  padding: 0 14px;

  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);

  background: rgba(255, 255, 255, 0.08);
  color: white;
  outline: none;
  font-size: 1rem;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.input-group input:focus {
  border-color: rgba(244, 211, 94, 0.85);
  box-shadow: 0 0 0 3px rgba(244, 211, 94, 0.16);
}

.input-group input.input-error-state {
  border-color: rgba(236, 93, 93, 0.92);
  box-shadow: 0 0 0 3px rgba(236, 93, 93, 0.18);
}

.input-error {
  min-height: 18px;
  font-size: 0.84rem;
  color: #ff8d8d;
  line-height: 1.35;
}


/* =========================================================
   5) BOTÕES GERAIS
   ---------------------------------------------------------
   Botões base do jogo.
   ========================================================= */
button {
  border: none;
  outline: none;
  cursor: pointer;
  transition: 0.2s ease;
  font-weight: bold;
  font-size: 0.95rem;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
}

button:active {
  transform: translateY(0);
}

.primary-btn {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  background: #f4d35e;
  color: #1c1c1c;
}

.secondary-btn {
  min-width: 132px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.10);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.danger-btn {
  background: rgba(190, 58, 58, 0.22);
  border-color: rgba(255, 100, 100, 0.25);
}


/* =========================================================
   6) CASCO PRINCIPAL DO JOGO
   ---------------------------------------------------------
   Estrutura principal. Sempre ocupa a tela inteira.
   ========================================================= */
.game-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 24px;

  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: stretch;
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  width: 100%;
  max-width: 180px;
}





/* =========================================================
   7) HUDS LATERAIS
   ---------------------------------------------------------
   Pain?is superiores com informa??es importantes.
   ========================================================= */
.hud {
  position: static;
  z-index: auto;

  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.hud-left,
.hud-right {
  width: 100%;
  max-width: none;
}

.hud-card {
  padding: 12px 14px;
  border-radius: 18px;

  background: linear-gradient(
    180deg,
    rgba(25, 33, 40, 0.72) 0%,
    rgba(16, 22, 28, 0.64) 100%
  );

  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);

  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.game-sidebar .hud-card {
  width: 100%;
}
.hud-card-score {
  padding: 14px 14px 12px;
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(12, 16, 20, 0.92) 0%,
    rgba(7, 10, 14, 0.88) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.hud-score-label {
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}

.score-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.score-team-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.score-team-names span {
  font-size: 0.9rem;
  line-height: 1.15;
  color: #ffffff;
  font-weight: 700;
}

.score-team-points {
  font-size: clamp(2.2rem, 4vw, 2.8rem);
  line-height: 0.9;
  color: #ffffff;
  font-weight: 800;
  min-width: 26px;
  text-align: right;
}

.score-divider {
  height: 2px;
  margin: 10px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
}

.hud-card-trump {
  min-height: 142px;
  padding: 16px 14px 14px;
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(12, 16, 20, 0.94) 0%,
    rgba(7, 10, 14, 0.9) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.hud-trump-label {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.hud-trump-value {
  margin: 0;
  font-size: clamp(4rem, 8vw, 5.2rem);
  line-height: 0.85;
  color: #ffffff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}


.hud-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.56);
  margin-bottom: 6px;
}

.hud-value {
  font-size: clamp(0.92rem, 1vw, 1rem);
  line-height: 1.4;
  color: #ffffff;
  font-weight: 600;
}

.hud-value-small {
  font-size: clamp(0.8rem, 0.95vw, 0.88rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}


/* =========================================================
   8) ?REA CENTRAL DO JOGO
   ---------------------------------------------------------
   Estrutura central com propor??es fixas por viewport.
   Tudo precisa caber sem scroll.
   ========================================================= */
.game-table-wrapper {
  width: 100%;
  height: 100%;

  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  justify-items: center;
  align-items: start;
  align-content: start;
  gap: clamp(12px, 35px, 35px);

  padding: 12px 10px 10px;
}

/* Palco unico para mesa + badges, com controles individuais */
.playfield-stage {
  --stage-width: min(720px, 100%);
  --stage-height: 320px;
  --seat-gap: -25px;
  --table-height: calc(var(--table-width) * 9 / 16);
  --table-left-edge: calc(var(--table-left) - (var(--table-width) / 2));
  --table-right-edge: calc(var(--table-left) + (var(--table-width) / 2));
  --table-center-y: calc(var(--table-top) + (var(--table-height) / 2));
  --table-bottom-edge: calc(var(--table-top) + var(--table-height));

  --left-seat-adjust: 14px;
  --right-seat-adjust: -25px;

  --table-width: 520px;
  --table-top: 6%;
  --table-left: 50%;

  --bottom-seat-gap: -18px;
  --bottom-seat-adjust: 0px;
  --bottom-seat-width: clamp(106px, 11.5vw, 138px);

  position: relative;
  width: var(--stage-width);
  height: var(--stage-height);

}

.seat {
  position: absolute;
  z-index: 10;
}

.seat-top {
  top: calc(var(--table-top) - var(--seat-gap));
  left: var(--table-left);
  transform: translate(-50%, -100%);
}


.seat-left {
  top: var(--table-center-y);
  left: calc(var(--table-left-edge) - var(--seat-gap) + var(--left-seat-adjust));
  transform: translate(-100%, -50%);
}


.seat-right {
  top: var(--table-center-y);
  left: calc(var(--table-right-edge) + var(--seat-gap) + var(--right-seat-adjust));
  transform: translateY(-50%);
}

.seat-badge {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(26, 34, 40, 0.76) 0%,
    rgba(16, 22, 28, 0.72) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  text-align: center;
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.seat-top .seat-badge {
  width: var(--top-seat-width);
}

.seat-left .seat-badge {
  width: var(--left-seat-width);
  transform: rotate(-90deg);
  transform-origin: center;
}

.seat-right .seat-badge {
  width: var(--right-seat-width);
  transform: rotate(90deg);
  transform-origin: center;
}

.player-hand-header .seat-badge {
  width: var(--bottom-seat-width);
}

.seat-badge h2 {
  font-size: clamp(0.82rem, 1vw, 0.98rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  word-break: break-word;
  white-space: nowrap;
}

.seat-role {
  position: relative;
  display: block;
  font-size: clamp(0.58rem, 0.8vw, 0.68rem);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255, 255, 255, 0.58);
}

.player-badge {
  background: linear-gradient(
    180deg,
    rgba(33, 43, 51, 0.84) 0%,
    rgba(20, 28, 34, 0.78) 100%
  );
  border-color: rgba(255, 255, 255, 0.10);
}

.table-middle-row {
  display: none;
}

.table-stage {
  --mesa-card-width: clamp(40px, calc(var(--table-width) * 0.104), 80px);
  --mesa-card-height: calc(var(--mesa-card-width) * 1.45);
  --mesa-card-slot-width: calc(var(--mesa-card-width) * 1.18);
  --mesa-card-slot-height: calc(var(--mesa-card-height) * 0.60);
  --mesa-card-side-shift: calc(var(--table-width) * 0.055);
  --mesa-inner-padding: clamp(32px, calc(var(--table-width) * 0.1), 64px);
  --mesa-side-padding: clamp(12px, calc(var(--table-width) * 0.04), 24px);

  position: absolute;
  top: var(--table-top);
  left: var(--table-left);
  transform: translateX(-50%);
  width: var(--table-width);
}

.table-surface {
  position: relative;
  
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
  border-radius: clamp(26px, 3vw, 40px);
  border: 4px solid rgba(122, 88, 47, 0.96);
  background:
    radial-gradient(circle at center, rgba(82, 128, 76, 0.877) 0%, rgba(50, 92, 52, 0.877) 54%, rgba(31, 56, 34, 0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.05),
    inset 0 18px 50px rgba(255,255,255,0.02),
    inset 0 -18px 50px rgba(0,0,0,0.18),
    0 26px 50px rgba(0,0,0,0.30);
}

.table-surface::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: clamp(18px, 2.6vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.table-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 48%);
  pointer-events: none;
}

#mesa-area {
  width: 100%;
  height: 100%;
  padding: var(--mesa-inner-padding);
  display: grid;
  grid-template-columns: minmax(calc(var(--mesa-card-slot-width) * 0.85), var(--mesa-card-slot-width)) 1fr minmax(calc(var(--mesa-card-slot-width) * 0.85), var(--mesa-card-slot-width));
  grid-template-rows: minmax(calc(var(--mesa-card-slot-height) * 0.9), 1fr) auto minmax(calc(var(--mesa-card-slot-height) * 0.9), 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(10px, 2.8%, 18px);
}

#mesa-top {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.mesa-linha {
  grid-column: 1 / 4;
  grid-row: 2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--mesa-side-padding);
}

#mesa-left {
  transform: translateX(calc(var(--mesa-card-side-shift) * -1)) rotate(90deg);
}

#mesa-right {
  transform: translateX(var(--mesa-card-side-shift)) rotate(-90deg);
}

#mesa-bottom {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
}

.mesa-posicao {
  min-width: 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
}

.status-box {
  position: relative;
  z-index: 20;
  width: min(100%, 620px);
  min-height: 44px;
  padding: 10px 18px;
  margin-top: 2px;
  border-radius: 14px;
  background: rgba(20, 28, 36, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

#status-message {
  font-size: clamp(0.84rem, 1vw, 0.95rem);
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.35;
  font-weight: 500;
}

.player-hand-zone {
  position: relative;
  width: min(645px, 100%);
  height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-inline: clamp(8px, 2vw, 20px);
}

.player-hand-header {
  position: absolute;
  top: calc(var(--table-bottom-edge) + var(--bottom-seat-gap) + var(--bottom-seat-adjust));
  left: var(--table-left);
  z-index: 15;
  transform: translate(-50%, 0);
}

#player-hand {
  position: relative;
  width: min(520px, 100%);
  height: 96px;
  border-radius: 24px;
  background: rgba(14, 20, 26, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  overflow: visible;
  z-index: 100;
}


/* =========================================================
   15) BOT?ES DE CONTROLE DA PARTIDA
   ---------------------------------------------------------
   Bot?es fixos no canto inferior direito, fora da ?rea
   jog?vel principal.
   ========================================================= */
.top-controls {
  position: static;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.top-controls button {
  width: 100%;
}


.game-controls {
  display: none;
}


/* =========================================================
   16) CARTAS
   ---------------------------------------------------------
   Cartas com escala fluida e suporte ao leque premium.
   ========================================================= */
.card {
  width: clamp(50px, 4.2vw, 72px);
  height: clamp(76px, 6.2vw, 104px);

  border-radius: 14px;
  border: 2px solid #d8d8d8;

  background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 100%);
  color: #111111;

  padding: clamp(5px, 0.6vw, 8px);

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  font-weight: bold;

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.card-top,
.card-bottom {
  font-size: clamp(0.72rem, 0.85vw, 1rem);
  line-height: 1;
}

.card-center {
  text-align: center;
  font-size: clamp(1.25rem, 1.8vw, 1.8rem);
  line-height: 1;
}

.red {
  color: #c62828;
}

.black {
  color: #111111;
}

.player-hand-card {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: clamp(65px, 5vw, 100px);
  height: clamp(88px, 6.5vw, 200px);
  transform-origin: bottom center;
  will-change: transform;
}

.mesa-posicao .card {
  width: var(--mesa-card-width);
  height: var(--mesa-card-height);
  padding: clamp(4px, 0.35vw, 6px);
  border-radius: 12px;
}

.player-hand-card.playable:hover {
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.36);
}

.player-hand-card.playable-outline {
  box-shadow:
    0 0 0 3px rgba(241, 197, 77, 0.92),
    0 0 24px rgba(241, 197, 77, 0.34),
    0 8px 20px rgba(0, 0, 0, 0.26);
}

.player-hand-card.playable-outline:hover {
  box-shadow:
    0 0 0 3px rgba(248, 214, 104, 1),
    0 0 30px rgba(248, 214, 104, 0.42),
    0 20px 34px rgba(0, 0, 0, 0.36);
}

.player-hand-card.blocked {
  cursor: not-allowed !important;
}

.player-hand-card.inactive {
  cursor: default !important;
  filter: grayscale(0.18) saturate(0.72) brightness(0.88);
}

.player-hand-card.inactive.red {
  color: #9c7b7b;
}

.player-hand-card.inactive.black {
  color: #6f7680;
}

.mesa-posicao .card:hover {
  transform: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}

#mesa-left .card,
#mesa-right .card {
  transform-origin: center;
}

.card-leaving-hand {
  pointer-events: none;
  animation: cardLeavingHand 240ms ease-in forwards;
}

.card-npc-entering {
  animation: cardNpcEntering 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.card-winning-highlight {
  animation: cardWinningPulse 900ms ease-in-out both;
  box-shadow:
    0 0 0 3px rgba(244, 211, 94, 0.9),
    0 0 30px rgba(244, 211, 94, 0.4),
    0 10px 26px rgba(0, 0, 0, 0.3);
}

@keyframes cardLeavingHand {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-72px) scale(0.96);
  }
}

@keyframes cardNpcEntering {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.86);
  }

  70% {
    opacity: 1;
    transform: translateY(4px) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardWinningPulse {
  0% {
    transform: translateY(0) scale(1);
  }

  35% {
    transform: translateY(-8px) scale(1.08);
  }

  100% {
    transform: translateY(-2px) scale(1.03);
  }
}
/* =========================================================
   17) ESTADOS AUXILIARES
   ---------------------------------------------------------
   Classe utilitária para esconder elementos.
   ========================================================= */
.hidden {
  display: none !important;
}




.game-frame.mobile-embed-mode {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 920px;
  height: 580px;
  margin: 0;
  transform: translate(-50%, -50%) scale(var(--mobile-embed-scale, 1));
  transform-origin: center center;
}

.game-frame.mobile-embed-mode .top-controls #fullscreen-btn {
  display: none;
}



@media (hover: none), (pointer: coarse) {
  button:hover {
    transform: none;
    opacity: 1;
  }

  .player-hand-card.playable:hover {
    box-shadow: none;
  }

  .player-hand-card.playable-outline:hover {
    box-shadow:
      0 0 0 3px rgba(241, 197, 77, 0.92),
      0 0 24px rgba(241, 197, 77, 0.34),
      0 8px 20px rgba(0, 0, 0, 0.26);
  }

  .mesa-posicao .card:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
  }
}
