:root {
  --poker-panel: linear-gradient(180deg, rgba(15, 30, 53, 0.96), rgba(10, 18, 31, 0.96));
  --poker-border: 1px solid rgba(232, 244, 255, 0.12);
  --poker-shadow: 0 26px 60px rgba(3, 9, 19, 0.45);
}

body[data-page-key="play-power-play-poker"] .page-content {
  padding-bottom: 156px;
}

.poker-page-shell {
  display: grid;
  gap: 20px;
}

.poker-topbar,
.poker-table-card,
.poker-info-card {
  background: var(--poker-panel);
  border: var(--poker-border);
  border-radius: 24px;
  box-shadow: var(--poker-shadow);
}

.poker-topbar {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.poker-topbar-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(232, 244, 255, 0.04);
  border: 1px solid rgba(232, 244, 255, 0.08);
}

.poker-topbar-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-stone);
}

.poker-topbar-value {
  font-family: "Space Mono", monospace;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.poker-table-card,
.poker-info-card {
  padding: 22px;
}

.poker-table-toolbar,
.poker-bottom-grid,
.poker-raise-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.poker-table-toolbar h1,
.poker-info-card h2 {
  margin: 0 0 10px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  line-height: 1.02;
}

.poker-lead {
  margin: 0;
  color: rgba(232, 244, 255, 0.82);
}

.poker-chip-row,
.poker-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.poker-chip,
.poker-action-button,
.poker-raise-slider {
  border-radius: 12px;
}

.poker-chip,
.poker-action-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(232, 244, 255, 0.16);
  background: rgba(232, 244, 255, 0.05);
  color: var(--color-ice-white);
  font-weight: 600;
  transition:
    transform var(--transition-base),
    background var(--transition-base),
    border-color var(--transition-base),
    opacity var(--transition-base);
}

.poker-chip.is-active,
.poker-action-button:not(.is-muted) {
  background: rgba(0, 91, 187, 0.28);
  border-color: rgba(0, 91, 187, 0.8);
}

.poker-action-button.is-danger {
  background: rgba(200, 40, 28, 0.18);
  border-color: rgba(200, 40, 28, 0.45);
  color: #ffb3ae;
}

.poker-chip:hover:not(:disabled),
.poker-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.poker-chip:disabled,
.poker-action-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.poker-table-shell {
  position: relative;
  margin-top: 20px;
}

.poker-table {
  position: relative;
  min-height: 720px;
  padding: 28px;
  overflow: hidden;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 50%, rgba(27, 94, 32, 0.94), rgba(14, 37, 22, 0.96)),
    linear-gradient(180deg, rgba(15, 30, 53, 0.96), rgba(10, 18, 31, 0.98));
  border: 1px solid rgba(232, 244, 255, 0.08);
}

.poker-table::before {
  content: "";
  position: absolute;
  inset: 18% 12%;
  border-radius: 46% / 38%;
  border: 16px solid rgba(106, 76, 47, 0.95);
  box-shadow:
    inset 0 0 0 2px rgba(232, 244, 255, 0.12),
    0 20px 40px rgba(0, 0, 0, 0.3);
}

.poker-community {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 16px;
}

.poker-pot,
.poker-phase {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(10, 18, 31, 0.72);
  border: 1px solid rgba(232, 244, 255, 0.12);
  text-align: center;
}

.poker-pot strong {
  display: block;
  margin-top: 4px;
  font-family: "Space Mono", monospace;
}

.poker-community-cards,
.poker-seat-cards {
  display: flex;
  gap: 10px;
}

.poker-card {
  position: relative;
  width: 72px;
  height: 102px;
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #edf5ff);
  color: #09111f;
  border: 1px solid rgba(10, 18, 31, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  transition:
    transform 220ms var(--transition-base),
    opacity 220ms var(--transition-base);
}

.poker-card.is-red {
  color: #b51611;
}

.poker-card.is-back {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(0, 91, 187, 0.94), rgba(15, 30, 53, 0.96)),
    linear-gradient(45deg, transparent 48%, rgba(254, 203, 2, 0.22) 48%, rgba(254, 203, 2, 0.22) 52%, transparent 52%);
  color: var(--color-ice-white);
  letter-spacing: 0.12em;
  font-size: 0.9rem;
}

.poker-card.is-empty {
  border-style: dashed;
  background: rgba(232, 244, 255, 0.04);
  box-shadow: none;
}

.poker-card-rank {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.poker-card-suit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 1.55rem;
}

.poker-seat {
  position: absolute;
  z-index: 2;
  width: 220px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(10, 18, 31, 0.78);
  border: 1px solid rgba(232, 244, 255, 0.1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.poker-seat-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.poker-seat-stack,
.poker-seat-bet {
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
}

.poker-seat-status,
.poker-seat-hand {
  margin-top: 8px;
  color: rgba(232, 244, 255, 0.72);
  font-size: 0.9rem;
}

.poker-seat.is-turn {
  border-color: rgba(254, 203, 2, 0.58);
  box-shadow: 0 0 0 2px rgba(254, 203, 2, 0.18), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.poker-seat.is-folded {
  opacity: 0.5;
}

.poker-seat.is-all-in .poker-seat-status {
  color: #ffd27d;
}

.poker-seat-0 {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

.poker-seat-1 {
  left: 22px;
  bottom: 120px;
}

.poker-seat-2 {
  left: 78px;
  top: 44px;
}

.poker-seat-3 {
  right: 78px;
  top: 44px;
}

.poker-seat-4 {
  right: 22px;
  bottom: 120px;
}

.poker-action-panel {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.poker-raise-tools {
  display: grid;
  gap: 12px;
}

.poker-raise-slider {
  width: 100%;
}

.poker-bottom-grid {
  display: grid;
  gap: 20px;
}

.poker-history-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.poker-history-item,
.poker-history-empty {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(232, 244, 255, 0.04);
  border: 1px solid rgba(232, 244, 255, 0.08);
}

.poker-summary-list {
  display: grid;
  gap: 10px;
}

.poker-summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(232, 244, 255, 0.04);
  border: 1px solid rgba(232, 244, 255, 0.08);
}

.viktor-shell {
  position: absolute;
  right: 28px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  justify-items: end;
}

.viktor-avatar {
  width: 110px;
}

.viktor-bubble {
  max-width: 280px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 16px 16px 4px 16px;
  background: rgba(232, 244, 255, 0.98);
  color: #09111f;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.viktor-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 960px) {
  .poker-topbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .poker-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 959px) {
  .poker-table {
    min-height: 980px;
  }

  .poker-seat {
    width: calc(50% - 24px);
  }

  .poker-seat-0 {
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: calc(100% - 36px);
  }

  .poker-seat-1 {
    left: 18px;
    bottom: 210px;
  }

  .poker-seat-2 {
    left: 18px;
    top: 28px;
  }

  .poker-seat-3 {
    right: 18px;
    top: 28px;
  }

  .poker-seat-4 {
    right: 18px;
    bottom: 210px;
  }

  .poker-community {
    top: 50%;
    width: calc(100% - 36px);
  }

  .viktor-shell {
    right: 16px;
    bottom: 140px;
  }
}

@media (max-width: 639px) {
  body[data-page-key="play-power-play-poker"] .page-content {
    padding-bottom: 174px;
  }

  .poker-table-card,
  .poker-info-card {
    padding: 18px;
  }

  .poker-table {
    min-height: 1180px;
    padding: 18px;
  }

  .poker-seat,
  .poker-seat-0 {
    width: calc(100% - 12px);
  }

  .poker-seat-1,
  .poker-seat-2,
  .poker-seat-3,
  .poker-seat-4 {
    left: 6px;
    right: 6px;
  }

  .poker-seat-2 {
    top: 18px;
  }

  .poker-seat-3 {
    top: 210px;
  }

  .poker-seat-4 {
    bottom: 320px;
  }

  .poker-seat-1 {
    bottom: 520px;
  }

  .poker-seat-0 {
    bottom: 18px;
  }

  .poker-community {
    top: 53%;
  }

  .poker-community-cards,
  .poker-seat-cards {
    flex-wrap: wrap;
  }

  .poker-card {
    width: 60px;
    height: 90px;
  }
}
