:root {
  --accent-a: #667eea;
  --accent-b: #764ba2;
  --accent-c: #9c27b0;
  --success: #4caf50;
  --danger: #f44336;
  --warning: #ff9800;
  --ink: #333;
  --muted: #666;
  --soft: #f7f7fb;
  --line: #e8e8ef;
  --card: rgba(255, 255, 255, 0.96);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
}

a {
  color: inherit;
}

.page {
  width: min(1680px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px 20px;
  border-radius: 15px;
  background: var(--card);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
}

.home-link {
  padding: 10px 18px;
  border-radius: 10px;
  background: #f0f0f0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.home-link:hover {
  background: #e3e3e3;
}

.game-lobby {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1fr);
  gap: 30px;
  align-items: start;
}

body.is-room-view .game-lobby {
  display: block;
}

body.is-room-view .lobby-view {
  display: none !important;
}

.hero-copy {
  padding: 34px 10px;
  color: #fff;
  animation: fadeIn 0.45s ease;
}

.round-label {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.hero-line {
  max-width: 560px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 20px;
  line-height: 1.5;
}

.quick-rules {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.quick-rules span {
  width: max-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
}

.play-card,
.room-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: slideUp 0.45s ease;
}

.play-card {
  display: grid;
  gap: 20px;
  padding: 30px;
}

.game-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.game-tile {
  display: grid;
  gap: 14px;
  min-height: 170px;
  padding: 24px 18px;
  border: 2px solid transparent;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.game-tile:hover:not(.is-disabled) {
  transform: translateY(-6px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.2);
}

.game-tile.is-selected {
  border-color: var(--accent-a);
  box-shadow: 0 12px 34px rgba(102, 126, 234, 0.28);
}

.game-tile.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: grayscale(0.4);
}

.game-tile strong,
.game-tile small {
  display: block;
}

.game-tile strong {
  font-size: 24px;
}

.game-tile small {
  margin-top: 6px;
  color: var(--muted);
}

.card-stack {
  position: relative;
  display: block;
  width: 78px;
  height: 86px;
  margin: 0 auto;
}

.card-stack i {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 70px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.card-stack i:first-child {
  left: 4px;
  top: 12px;
  transform: rotate(-8deg);
}

.card-stack i:last-child {
  right: 2px;
  top: 0;
  color: var(--danger);
  transform: rotate(8deg);
}

.room-form,
.field {
  display: grid;
  gap: 12px;
}

.field span {
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}

.button,
.copy-button,
.inline-action {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 700;
}

.button.primary,
.copy-button,
.inline-action {
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
  color: #fff;
}

.button.secondary {
  background: #f0f0f0;
  color: var(--ink);
}

.button:hover:not(:disabled),
.copy-button:hover,
.inline-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.room-result {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 15px;
  background: var(--soft);
}

.result-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-top span,
#room-badge,
.game-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 13px;
  font-weight: 800;
}

.result-top strong {
  font-size: 17px;
}

.room-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.room-card {
  min-height: calc(100vh - 136px);
  padding: 20px;
}

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#room-badge {
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
  color: #fff;
}

.room-head h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.2;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.start-button {
  min-width: 128px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff8e1;
  color: #f57c00;
  font-size: 13px;
  font-weight: 800;
}

.connection-pill.is-online {
  background: #e8f5e9;
  color: #388e3c;
}

.connection-pill.is-error {
  background: #ffebee;
  color: #d32f2f;
}

.room-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}

.room-meta span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.player-list {
  float: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 230px;
  max-height: calc(100vh - 260px);
  margin-right: 20px;
  padding: 15px;
  overflow-y: auto;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.player-list::before {
  content: "玩家";
  display: block;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  color: var(--ink);
  font-weight: 800;
}

.player-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
}

.player-card strong,
.player-card span,
.player-card small {
  display: block;
}

.player-card strong {
  color: var(--ink);
  font-size: 16px;
}

.player-card span,
.player-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.player-card small {
  color: var(--accent-c);
}

.kick-button {
  width: max-content;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffebee;
  color: #d32f2f;
  font-size: 12px;
  font-weight: 900;
}

.kick-button:hover {
  background: #f44336;
  color: #fff;
}

.game-state {
  min-height: calc(100vh - 260px);
  margin-left: 250px;
  padding: 16px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.game-state h3 {
  margin: 0 0 16px;
  font-size: 28px;
}

.waiting-room-panel {
  display: grid;
  gap: 18px;
  min-height: 260px;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.waiting-room-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 38px);
}

.waiting-room-panel p {
  margin: 0;
  font-size: 16px;
}

.waiting-room-code {
  display: grid;
  gap: 8px;
  width: min(100%, 560px);
  padding: 16px;
  border: 2px dashed #d9d9e5;
  border-radius: 14px;
  background: var(--soft);
}

.waiting-room-code span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.waiting-room-code b {
  overflow-wrap: anywhere;
  color: var(--accent-a);
  font-size: 18px;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.seat-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  background: #fff;
  text-align: left;
}

.seat-card b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-a) 0%, var(--accent-b) 100%);
  color: #fff;
}

.seat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.seat-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-card.is-self {
  border-color: var(--accent-c);
  background: #f3e5f5;
}

.seat-card.is-empty {
  align-content: center;
  border-style: dashed;
  background: #fafafa;
  text-align: center;
}

.seat-card.is-empty strong {
  color: #aaa;
}

.host-control-panel {
  display: grid;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border: 2px solid #e8e8ef;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.host-control-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.host-control-head strong,
.host-control-head span {
  display: block;
}

.host-control-head strong {
  color: var(--ink);
  font-size: 18px;
}

.host-control-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.danger-lite {
  background: #ffebee !important;
  color: #d32f2f !important;
}

.danger-lite:hover {
  background: #f44336 !important;
  color: #fff !important;
}

.host-setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px)) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}

.host-setting-grid label {
  display: grid;
  gap: 7px;
}

.host-setting-grid label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.host-setting-grid input {
  min-height: 44px;
}

.host-setting-hint {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.host-control-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.poker-table-stage {
  display: grid;
  gap: 16px;
}

.poker-felt {
  position: relative;
  min-height: clamp(580px, calc(100vh - 310px), 680px);
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08), transparent 55%),
    linear-gradient(135deg, #18492e 0%, #2f6743 100%);
  box-shadow:
    inset 0 0 0 12px rgba(82, 48, 24, 0.58),
    inset 0 0 0 18px rgba(255, 255, 255, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.24);
}

.table-rail {
  position: absolute;
  inset: 68px 92px 100px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.table-center-area {
  position: absolute;
  top: 45%;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 22px;
  transform: translate(-50%, -50%);
}

.community-cards-new {
  display: flex;
  min-width: 330px;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.table-info-right {
  display: grid;
  gap: 10px;
  width: 152px;
}

.phase-info-card,
.current-action-card {
  padding: 11px 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.74);
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
}

.phase-title {
  color: #ffd54f;
  font-size: 13px;
  font-weight: 900;
}

.pot-display {
  margin: 4px 0;
  color: #69f0ae;
  font-size: 23px;
  font-weight: 900;
}

.pot-display::before {
  content: "底池 ";
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.current-bet-display {
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.current-action-card {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
  animation: gentlePulse 2.4s ease-in-out infinite;
}

.current-action-card.is-urgent {
  background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
  animation: urgentPulse 0.8s ease-in-out infinite;
}

.current-action-card span,
.current-action-card strong,
.current-action-card b {
  display: block;
}

.current-action-card span {
  font-size: 12px;
  opacity: 0.82;
}

.current-action-card strong {
  margin: 4px 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-action-card b {
  width: max-content;
  margin: 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 12px;
}

@keyframes gentlePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(76, 175, 80, 0.34);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.52);
  }
}

@keyframes urgentPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.82;
  }
}

.table-seat {
  position: absolute;
  z-index: 8;
}

.table-seat.position-1 {
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
}

.table-seat.position-2 {
  top: 72px;
  left: 7%;
}

.table-seat.position-3 {
  top: 72px;
  right: 7%;
}

.table-seat.position-4 {
  top: 47%;
  left: 18px;
  transform: translateY(-50%);
}

.table-seat.position-5 {
  top: 47%;
  right: 18px;
  transform: translateY(-50%);
}

.table-seat.position-6 {
  bottom: 80px;
  left: 10%;
}

.table-seat.position-7 {
  right: 10%;
  bottom: 80px;
}

.table-seat.empty {
  opacity: 0.38;
}

.empty-seat-indicator {
  display: grid;
  min-width: 112px;
  gap: 5px;
  padding: 11px 13px;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.empty-seat-indicator span {
  font-size: 12px;
  font-weight: 700;
}

.empty-seat-indicator strong {
  font-size: 16px;
}

.seat-content,
.self-player-card {
  position: relative;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
}

.seat-content {
  display: grid;
  gap: 7px;
  min-width: 190px;
  padding: 10px 12px;
}

.seat-row-1,
.seat-row-2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seat-row-2 {
  min-height: 28px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.player-info-compact {
  display: grid;
  gap: 4px;
  min-width: 78px;
}

.player-name-compact {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips-compact {
  color: var(--accent-a);
  font-size: 12px;
  font-weight: 800;
}

.hole-cards-inline,
.self-hole-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dealer-chip {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  font-weight: 950;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.5);
}

.turn-indicator-border {
  position: absolute;
  inset: -9px;
  z-index: -1;
  pointer-events: none;
  border: 4px solid #4caf50;
  border-radius: 20px;
  animation: glowBorder 1.8s ease-in-out infinite;
}

@keyframes glowBorder {
  0%, 100% {
    box-shadow: 0 0 18px rgba(76, 175, 80, 0.65);
  }
  50% {
    box-shadow: 0 0 34px rgba(76, 175, 80, 0.95);
  }
}

.action-display,
.bet-display {
  padding: 5px 11px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.action-normal {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.action-bet {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.action-raise {
  background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
}

.action-fold {
  background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
}

.bet-display {
  background: rgba(244, 67, 54, 0.95);
}

.self-player-card {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 11;
  width: min(450px, calc(100% - 40px));
  padding: 14px 18px;
  border-color: #9c27b0;
  background: linear-gradient(135deg, #f3e5f5 0%, #fff 100%);
  transform: translateX(-50%);
}

.self-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(156, 39, 176, 0.2);
}

.self-player-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 900;
}

.you-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #9c27b0;
  color: #fff;
  font-size: 12px;
}

.self-chips-display {
  color: var(--accent-a);
  font-size: 20px;
  font-weight: 950;
}

.self-chips-display::before {
  content: "筹码 ";
  color: var(--muted);
  font-size: 12px;
}

.self-bet-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 2px solid rgba(156, 39, 176, 0.2);
  text-align: center;
}

.self-bet-info span,
.self-bet-info strong {
  display: block;
}

.self-bet-info span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.self-bet-info strong {
  margin-top: 3px;
  color: var(--danger);
}

.texas-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.texas-board > div,
.community-row,
.texas-player,
.result-card,
.muted-action {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.texas-board > div {
  min-height: 82px;
  padding: 14px;
}

.state-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.texas-board strong {
  font-size: 24px;
}

.community-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.community-row > span {
  color: var(--ink);
  font-weight: 800;
}

.playing-card {
  display: inline-flex;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 78px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.playing-card.small {
  width: 34px;
  height: 48px;
  border-width: 1px;
  border-radius: 6px;
}

.playing-card.red {
  color: #d32f2f;
}

.playing-card.black {
  color: #212121;
}

.playing-card.gray {
  color: #999;
}

.playing-card.card-back {
  overflow: hidden;
  border-color: #667eea;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.18) 75%, transparent 75%),
    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 12px 12px, auto;
  color: transparent;
}

.card-rank {
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.playing-card.small .card-rank {
  font-size: 12px;
}

.card-suit {
  margin-top: 4px;
  font-size: 25px;
  line-height: 1;
}

.playing-card.small .card-suit {
  margin-top: 2px;
  font-size: 15px;
}

.texas-player-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.texas-player,
.result-card {
  display: grid;
  gap: 10px;
  min-height: 132px;
  padding: 14px;
}

.texas-player.is-current {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.14);
}

.texas-player.is-self {
  border-color: var(--accent-c);
  background: #f3e5f5;
}

.texas-player.is-folded {
  opacity: 0.58;
}

.texas-player-top,
.texas-numbers {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.texas-player-top strong {
  font-size: 18px;
}

.texas-player-top span,
.texas-numbers span,
.result-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.action-strip {
  display: grid;
  gap: 14px;
  position: sticky;
  bottom: 12px;
  z-index: 10;
  padding: 16px;
  border: 3px solid transparent;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.active-action {
  border-color: #4caf50;
  animation: softGlow 2.4s ease-in-out infinite;
}

@keyframes softGlow {
  0%, 100% {
    box-shadow: 0 8px 26px rgba(76, 175, 80, 0.22);
  }
  50% {
    box-shadow: 0 12px 34px rgba(76, 175, 80, 0.38);
  }
}

.action-info {
  display: grid;
  grid-template-columns: 1.2fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.action-info strong {
  color: #2e7d32;
  font-size: 17px;
}

.action-info span {
  color: var(--muted);
  font-weight: 700;
}

.timer-badge {
  padding: 5px 12px;
  border-radius: 999px;
  background: #ff9800;
  color: #fff !important;
  font-weight: 900;
}

.timer-badge.urgent {
  background: #f44336;
  animation: urgentPulse 0.8s ease-in-out infinite;
}

.action-buttons {
  display: grid;
  grid-template-columns: minmax(86px, 0.8fr) minmax(96px, 0.9fr) 136px 92px minmax(260px, 1.5fr);
  gap: 10px;
}

.action-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.fold-btn {
  background: #f44336;
}

.check-btn {
  background: #2196f3;
}

.call-btn {
  background: #4caf50;
}

.bet-btn {
  background: #ff9800;
}

.raise-btn {
  background: #ff5722;
}

.bet-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(54px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f8f8fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bet-input-wrap input {
  min-height: 36px;
  min-width: 0;
  text-align: center;
}

.quick-raise-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-raise-buttons button {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  background: #fff3e0;
  color: #e65100;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 112, 67, 0.22);
}

.quick-raise-buttons button:hover {
  background: #ffe0b2;
  transform: translateY(-1px);
}

.muted-action {
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
}

.result-card.winner {
  border-color: var(--warning);
  background: #fff8e1;
}

.game-log {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  margin-left: 250px;
  padding: 16px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.game-log h3 {
  margin: 0;
  font-size: 18px;
}

#game-log-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

#game-log-list article,
.empty-log {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
}

#game-log-list article {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

#game-log-list time {
  color: var(--accent-a);
  font-size: 12px;
  font-weight: 800;
}

#game-log-list span,
.empty-log {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .page {
    width: min(100% - 24px, 760px);
    padding-top: 12px;
  }

  .topbar,
  .room-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-lobby {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-copy {
    padding: 18px 4px 4px;
  }

  .play-card,
  .room-card {
    padding: 18px;
    border-radius: 16px;
  }

  .game-switch,
  .actions,
  .texas-board,
  .texas-player-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .player-list {
    float: none;
    width: 100%;
    max-height: none;
    margin: 0 0 16px;
  }

  .game-state {
    min-height: auto;
    margin-left: 0;
  }

  .game-log {
    margin-left: 0;
  }

  .action-strip {
    grid-template-columns: 1fr;
  }

  .poker-felt {
    display: grid;
    gap: 12px;
    min-height: auto;
    padding: 14px;
  }

  .table-rail {
    display: none;
  }

  .table-center-area,
  .self-player-card,
  .table-seat {
    position: static;
    transform: none;
  }

  .table-center-area {
    display: grid;
    order: 1;
    gap: 12px;
  }

  .table-info-right,
  .community-cards-new {
    width: 100%;
    min-width: 0;
  }

  .table-seats {
    display: grid;
    order: 2;
    gap: 10px;
  }

  .seat-content,
  .empty-seat-indicator {
    min-width: 0;
    width: 100%;
  }

  .self-player-card {
    order: 3;
    width: 100%;
  }

  .action-info,
  .action-buttons {
    grid-template-columns: 1fr;
  }

  .quick-raise-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .host-control-head,
  .host-setting-grid {
    grid-template-columns: 1fr;
  }

  .host-control-head {
    align-items: stretch;
    flex-direction: column;
  }

  .link-box {
    grid-template-columns: 1fr;
  }
}
