.mexico-demo {
  --game-teal: #004d40;
  --game-teal-light: #0092a4;
  --game-gold: #f5c842;
  --game-felt: linear-gradient(145deg, #0a3d36 0%, #004d40 40%, #00695c 100%);
  --played-card-w: clamp(56px, 14vw, 88px);
  --hand-card-w: clamp(42px, 9vw, 64px);
  --hand-overlap: 0.32;
  border-radius: 18px;
  overflow: hidden;
  background: var(--game-felt);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 40%, rgba(0, 146, 164, 0.15) 0%, transparent 70%),
    var(--game-felt);
  color: #fff;
  box-shadow: 0 18px 48px rgba(0, 40, 34, 0.28);
}

.demo-status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.625rem 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-status-chip {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.demo-status-player {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--game-gold);
}

.demo-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0 1rem;
}

.demo-opponents {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0.25rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.demo-pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(245, 200, 66, 0.35);
  min-width: 64px;
}

.demo-trump-badge {
  width: 28px;
  height: auto;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.demo-trump-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.demo-bet-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--game-gold);
  min-height: 1.25em;
}

.demo-play-area {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0.75rem;
}

.demo-played-cards {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.25rem, 2vw, 1rem);
  padding: 0.5rem 1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  min-height: calc(var(--played-card-w) * 1.45);
}

.demo-played-slot {
  width: var(--played-card-w);
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.demo-played-card {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  display: block;
  opacity: 0;
  transform: scale(0.75);
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.demo-played-card.visible {
  opacity: 1;
  transform: none;
}

.demo-played-card.from-left { transform: translate(-72px, -24px) scale(0.75); }
.demo-played-card.from-right { transform: translate(72px, -24px) scale(0.75); }
.demo-played-card.from-bottom { transform: translateY(56px) scale(0.75); }
.demo-played-card.winner {
  box-shadow: 0 0 0 2px var(--game-gold), 0 6px 18px rgba(0, 0, 0, 0.55);
}

.demo-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 140px;
  width: 100%;
  justify-self: center;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.demo-seat.active {
  border-color: var(--game-teal-light);
  animation: seatPulse 1.2s ease-in-out infinite alternate;
}

@keyframes seatPulse {
  from { box-shadow: 0 0 8px rgba(0, 146, 164, 0.4); }
  to { box-shadow: 0 0 16px rgba(0, 146, 164, 0.75); }
}

.demo-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: rgba(0, 146, 164, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.demo-seat-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.demo-seat-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
}

.stat-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  min-width: 1.5rem;
  text-align: center;
}

.stat-pill.total {
  background: rgba(245, 200, 66, 0.25);
  color: var(--game-gold);
}

.stat-pill.round {
  background: rgba(76, 175, 80, 0.25);
  color: #a5d6a7;
}

.stat-pill.bet {
  background: rgba(255, 152, 0, 0.25);
  color: #ffcc80;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.stat-pill.bet.visible {
  opacity: 1;
  transform: scale(1);
}

.demo-mini-hand {
  display: flex;
  margin-top: 0.2rem;
}

.demo-mini-hand img {
  width: 18px;
  margin-left: -8px;
  border-radius: 2px;
}

.demo-mini-hand img:first-child {
  margin-left: 0;
}

.demo-trump-picker {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem auto;
  padding: 0.5rem 0.75rem;
  max-width: 340px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.demo-trump-picker.visible {
  display: flex;
}

.demo-trump-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.demo-trump-suits {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.demo-trump-suit {
  flex: 1;
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.demo-trump-suit.picked {
  border-color: var(--game-gold);
  box-shadow: 0 0 0 2px rgba(245, 200, 66, 0.45);
}

.demo-trump-suit img {
  width: 100%;
  height: auto;
  max-height: 36px;
  object-fit: contain;
}

.demo-me-row {
  display: flex;
  justify-content: center;
  padding: 0.35rem 0.5rem;
}

.demo-seat.me {
  flex-direction: row;
  max-width: none;
  width: auto;
  gap: 0.5rem;
}

.demo-hand {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0.5rem 1.25rem;
  overflow: visible;
}

.demo-hand-inner {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.demo-hand-card {
  width: var(--hand-card-w);
  border-radius: 5px;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.5);
  margin-left: calc(var(--hand-card-w) * var(--hand-overlap) * -1);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.demo-hand-inner .demo-hand-card:first-child {
  margin-left: 0;
}

.demo-hand-card.played {
  opacity: 0;
  transform: translateY(-28px) scale(0.4);
}

@media (min-width: 901px) {
  .mexico-demo {
    --played-card-w: clamp(70px, 8vw, 96px);
    --hand-card-w: clamp(48px, 5.5vw, 68px);
  }

  .demo-seat {
    max-width: 180px;
  }

  .demo-avatar {
    width: 72px;
    height: 72px;
  }

  .demo-bet-value {
    font-size: 1.75rem;
  }
}

@media (max-width: 600px) {
  .mexico-demo {
    --played-card-w: clamp(62px, 20vw, 88px);
    --hand-overlap: 0.42;
  }

  .demo-status-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 0.75rem;
  }

  .demo-seat {
    max-width: 120px;
    padding: 0.4rem;
  }

  .demo-avatar {
    width: 48px;
    height: 48px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .mexico-demo {
    --played-card-w: clamp(52px, 20vw, 76px);
    --hand-card-w: clamp(36px, 12vw, 52px);
  }

  .demo-played-cards {
    width: 100%;
    border-radius: 0;
    justify-content: space-evenly;
    padding: 0.4rem 0.25rem;
  }
}
