.game-container {
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.game-table {
  flex: 1;
  position: relative;
  background: radial-gradient(ellipse at center, var(--felt) 0%, var(--felt-dark) 100%);
  overflow: hidden;
}

/* Cards */
.card {
  width: 52px;
  height: 74px;
  border: 1px solid #bbb;
  border-radius: 5px;
  background: #fff;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, margin 0.15s ease;
  position: relative;
  font-size: 13px;
  flex-shrink: 0;
}
.card .card-rank {
  font-size: 16px;
  font-weight: bold;
  color: #111;
}
.card .card-suit {
  font-size: 20px;
  line-height: 1;
}
.card .card-corner {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 9px;
  font-weight: bold;
}
.card.selected {
  transform: translateY(-16px);
  box-shadow: 2px 4px 10px rgba(0,0,0,0.35);
  border-color: #f1c40f;
  border-width: 2px;
}
.card.playable:hover {
  transform: translateY(-4px);
  box-shadow: 2px 3px 8px rgba(0,0,0,0.3);
}
.card.playable.selected:hover {
  transform: translateY(-16px);
}
.card-back {
  background: repeating-linear-gradient(
    45deg,
    #1565C0,
    #1565C0 4px,
    #1976D2 4px,
    #1976D2 8px
  );
  border-color: #0D47A1;
}
.card-back .card-rank,
.card-back .card-suit,
.card-back .card-corner {
  display: none;
}

/* Texas Hold'em Table */
.texas-table {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 40px 20px 40px 200px;
}

/* Community cards area */
.community-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.community-cards {
  display: flex;
  gap: 8px;
  min-height: 78px;
  align-items: center;
}
.community-cards .placeholder {
  width: 52px;
  height: 74px;
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 5px;
}
.community-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Pot */
.pot-display {
  font-size: 18px;
  font-weight: bold;
  color: var(--gold);
  padding: 6px 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  margin-bottom: 8px;
}

/* Player list - left sidebar */
.seats-container {
  position: absolute;
  left: 10px;
  top: 100px;
  bottom: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  z-index: 10;
  max-width: 200px;
}
.player-row {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: rgba(0,0,0,0.35);
  border: 2px solid transparent;
  transition: border-color 0.3s, opacity 0.3s;
  min-width: 160px;
}
.player-row.is-me { background: rgba(233,69,96,0.15); border-color: rgba(233,69,96,0.3); }
.player-row.active-turn { border-color: var(--gold); animation: pulse 1.5s ease infinite; }
.player-row.folded { opacity: 0.4; filter: grayscale(1); }
.player-row.folded .player-name { text-decoration: line-through; }

.player-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.player-name { font-size: 12px; font-weight: bold; }
.player-chips { font-size: 11px; color: var(--gold); }
.player-bet { font-size: 10px; color: var(--text-dim); }
.player-allin { font-size: 10px; color: #e74c3c; font-weight: bold; }
.player-cooldown { font-size: 10px; color: #f39c12; font-weight: bold; }
.player-winner { font-size: 10px; color: #f1c40f; font-weight: bold; }
.player-won { font-size: 10px; color: #2ecc71; }
.player-lost { font-size: 10px; color: #e74c3c; }
.player-sd-choice { font-size: 10px; }

.player-cards {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}
.player-cards .card {
  width: 30px;
  height: 44px;
  font-size: 9px;
  cursor: default;
}
.player-cards .card .card-rank { font-size: 10px; }
.player-cards .card .card-suit { font-size: 12px; }
.player-cards .card .card-corner { display: none; }
.player-cards .card:hover { transform: none; }
.player-cards .card-back { opacity: 0.7; }

.seat-role {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
}

@keyframes pulse {
  0%, 100% { border-color: var(--gold); }
  50% { border-color: rgba(241, 196, 15, 0.4); }
}

/* Player hand area */
.my-hand-area {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.my-hand {
  display: flex;
  justify-content: center;
}
.my-hand .card {
  margin-left: -16px;
}
.my-hand .card:first-child {
  margin-left: 0;
}
.my-hand .card:hover {
  z-index: 10;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.action-bar button {
  min-width: 60px;
  padding: 8px 16px;
  font-size: 13px;
}

/* Raise buttons group */
.raise-btns {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.raise-quick {
  font-size: 12px;
  padding: 8px 12px;
}
.raise-input {
  display: flex;
  gap: 4px;
  align-items: center;
}
.raise-input input {
  width: 70px;
  padding: 6px 8px;
  font-size: 13px;
  text-align: center;
}

/* Winner announcement */
.winner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 24px 40px;
  background: rgba(0,0,0,0.85);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  text-align: center;
  z-index: 100;
}
.winner-overlay .winner-name {
  font-size: 24px;
  color: var(--gold);
  font-weight: bold;
}
.winner-overlay .winner-hand {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Timer */
.turn-timer {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: var(--radius);
  background: rgba(0,0,0,0.5);
}
.turn-timer.urgent {
  color: var(--danger);
  animation: pulse 0.5s ease infinite;
}

/* Message area */
.game-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  padding: 8px 20px;
  background: rgba(0,0,0,0.7);
  border-radius: 20px;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* Card dealing animation */
@keyframes dealCardIn {
  0% {
    transform: translateY(-180px) scale(0.6);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.card.dealing {
  animation: dealCardIn 0.35s ease-out both;
}

/* Run It Twice display */
.run-it-twice-section {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}
.run-it-twice-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.run-it-twice-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.run-it-twice-cards {
  display: flex;
  gap: 4px;
}
.run-it-twice-cards .card {
  width: 42px;
  height: 60px;
  font-size: 11px;
}
.run-it-twice-cards .placeholder {
  width: 42px;
  height: 60px;
}
.run-it-twice-cards .card .card-rank { font-size: 13px; }
.run-it-twice-cards .card .card-suit { font-size: 16px; }
.run-it-twice-cards .card .card-corner { font-size: 8px; }
.run-it-twice-winner {
  color: #f1c40f;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* Stats panel */
.btn-stats-toggle {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-stats-toggle:hover { background: rgba(0,0,0,0.7); }

.stats-panel {
  position: absolute;
  bottom: 60px;
  left: 10px;
  min-width: 220px;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 12px;
  z-index: 50;
}
.stats-title {
  font-size: 13px;
  color: var(--gold);
  font-weight: bold;
  margin-bottom: 8px;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stats-row:last-child { border-bottom: none; }
.stats-name { flex: 1; color: #ddd; }
.stats-detail { color: var(--text-dim); font-size: 11px; margin-right: 10px; }
.stats-profit { color: #2ecc71; font-weight: bold; }
.stats-loss { color: #e74c3c; font-weight: bold; }

/* Rebuy UI */
.rebuy-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.rebuy-area input {
  width: 70px;
  padding: 6px;
  font-size: 12px;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .texas-table { padding-left: 160px; }
  .card { width: 40px; height: 58px; font-size: 11px; }
  .card .card-rank { font-size: 13px; }
  .card .card-suit { font-size: 16px; }
  .card .card-corner { font-size: 7px; top: 2px; left: 3px; }
  .card.selected { transform: translateY(-10px); }
  .community-cards .placeholder { width: 40px; height: 58px; }
  .community-cards { gap: 4px; }
  .seats-container { max-width: 150px; left: 6px; top: 60px; bottom: 140px; }
  .player-row { min-width: 120px; padding: 4px 8px; }
  .player-cards .card { width: 24px; height: 36px; }
  .pot-display { font-size: 15px; }
  .my-hand .card { margin-left: -20px; }
  .my-hand .card:first-child { margin-left: 0; }
  .action-bar { gap: 4px; }
  .action-bar button { padding: 6px 10px; font-size: 11px; min-width: 48px; }
  .raise-btns { gap: 3px; }
  .raise-input input { width: 55px; padding: 4px 6px; font-size: 11px; }
  .raise-quick { padding: 6px 8px; font-size: 10px; }
  .stats-panel { min-width: 180px; padding: 8px; }
  .stats-row { font-size: 11px; }
  .turn-timer { font-size: 18px; top: 5px; right: 5px; }
  .game-top-bar { font-size: 11px; padding: 6px 10px; }
  .btn-stats-toggle { width: 34px; height: 34px; font-size: 15px; bottom: 6px; left: 6px; }
  .stats-panel { bottom: 50px; left: 6px; }
}

@media (max-width: 480px) {
  .texas-table { padding-left: 130px; }
  .card { width: 34px; height: 50px; font-size: 10px; }
  .card .card-rank { font-size: 11px; }
  .card .card-suit { font-size: 14px; }
  .community-cards .placeholder { width: 34px; height: 50px; }
  .seats-container { max-width: 120px; left: 2px; top: 50px; bottom: 130px; }
  .player-row { min-width: 100px; padding: 3px 6px; }
  .player-name { font-size: 10px; }
  .player-chips { font-size: 9px; }
  .player-cards .card { width: 22px; height: 32px; }
  .my-hand-area { bottom: 6px; }
  .my-hand .card { margin-left: -24px; width: 34px; height: 50px; }
  .my-hand .card:first-child { margin-left: 0; }
  .action-bar { gap: 2px; }
  .action-bar button { padding: 5px 8px; font-size: 10px; }
  .raise-btns { width: 100%; justify-content: center; }
  .win p { font-size: 14px; padding: 10px 20px; }
  .game-container { height: calc(100vh - 40px); }
}
