:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #07130f;
  color: #f7f3e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(230, 181, 74, 0.18), transparent 34rem),
    linear-gradient(145deg, #07130f 0%, #10251b 48%, #190f0d 100%);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 18px 14px 118px;
}

.topbar,
.balance-card,
.table-header,
.banker-row,
.community-row,
.chip-dock,
.history p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #e8c775;
  font-size: 12px;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 24px;
}

.balance-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(232, 199, 117, 0.28);
  border-radius: 8px;
  background: rgba(7, 19, 15, 0.76);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.balance-card span {
  display: block;
  color: #9fb6a8;
  font-size: 12px;
}

.balance-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.game-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.game-tabs button {
  min-height: 72px;
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.game-tabs button.active {
  border-color: rgba(232, 199, 117, 0.75);
  background: linear-gradient(180deg, #d7a93d, #9c6820);
  color: #120b08;
}

.game-tabs strong,
.game-tabs span {
  display: block;
}

.game-tabs strong {
  font-size: 14px;
}

.game-tabs span {
  margin-top: 4px;
  color: rgba(247, 243, 232, 0.68);
  font-size: 10px;
  line-height: 1.25;
}

.game-tabs .active span {
  color: rgba(18, 11, 8, 0.72);
}

.table-panel {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(17, 64, 43, 0.88), rgba(11, 41, 32, 0.92)),
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(255, 255, 255, 0.02) 12px, rgba(255, 255, 255, 0.02) 24px);
}

.phase {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(232, 199, 117, 0.16);
  color: #f2d384;
  font-size: 12px;
}

.rules {
  margin: 12px 0;
  color: #bed0c4;
  font-size: 13px;
  line-height: 1.55;
}

.banker-row,
.community-row {
  min-height: 72px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
}

.banker-row span,
.community-row span {
  min-width: 46px;
  color: #e8c775;
  font-size: 13px;
}

.banker-row strong {
  min-width: 58px;
  text-align: right;
}

.cards {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

.card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 46px;
  border-radius: 6px;
  background: #f8f3e7;
  color: #111711;
  font-style: normal;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.22);
}

.card.red {
  color: #b9222d;
}

.card.back {
  background: linear-gradient(145deg, #a7352e, #6f191d);
  color: #f4d778;
}

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

.bet-area {
  min-height: 156px;
  padding: 12px 8px;
  border: 1px solid rgba(232, 199, 117, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.bet-area span,
.bet-area strong,
.bet-area em {
  display: block;
}

.bet-area span {
  color: #f2d384;
  font-weight: 800;
}

.bet-area .cards {
  min-height: 52px;
  margin: 10px 0;
}

.bet-area strong {
  min-height: 22px;
}

.bet-area em {
  margin-top: 6px;
  color: #9fb6a8;
  font-style: normal;
  font-size: 12px;
}

.bet-area.won {
  border-color: rgba(91, 219, 129, 0.74);
  background: rgba(45, 135, 70, 0.24);
}

.bet-area.lost {
  border-color: rgba(232, 91, 91, 0.62);
  background: rgba(154, 38, 43, 0.22);
}

.bet-area.push {
  border-color: rgba(219, 219, 219, 0.42);
}

.chip-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(5, 11, 9, 0.92);
  backdrop-filter: blur(16px);
}

.chips {
  display: flex;
  gap: 7px;
}

.chip {
  width: 45px;
  height: 45px;
  border: 3px dashed rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: #243d35;
  color: #f7f3e8;
  font-weight: 900;
}

.chip.active {
  background: #d7a93d;
  color: #120b08;
}

.actions {
  display: flex;
  gap: 8px;
}

.ghost-btn,
.primary-btn {
  min-width: 70px;
  height: 45px;
  border-radius: 8px;
  font-weight: 800;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.1);
}

.primary-btn {
  background: linear-gradient(180deg, #e6c469, #ad7624);
  color: #120b08;
}

.history {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.history p {
  padding: 8px 0;
  color: #bed0c4;
  font-size: 13px;
}

.win {
  color: #68df8c;
}

.lose {
  color: #ff8585;
}

.pulse {
  animation: pulse 0.28s ease-in-out;
}

@keyframes pulse {
  50% {
    transform: scale(1.015);
    box-shadow: 0 0 0 4px rgba(232, 199, 117, 0.22);
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .balance-card strong {
    font-size: 17px;
  }

  .chip-dock {
    align-items: stretch;
    flex-direction: column;
  }

  .chips,
  .actions {
    justify-content: space-between;
  }

  .primary-btn,
  .ghost-btn {
    flex: 1;
  }
}
