:root {
  --felt: #1b5c45;
  --felt-deep: #0f3a2c;
  --ink: #f4efe6;
  --muted: #b9c4b8;
  --accent: #d4a017;
  --danger: #c45c4a;
  --panel: rgba(10, 18, 14, 0.72);
  --card: #f7f3ea;
  --card-red: #b42318;
  --card-black: #1d1f1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #08110d;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 160, 23, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 60% at 80% 100%, rgba(27, 92, 69, 0.35), transparent 50%),
    linear-gradient(160deg, #0a1511, #08110d 45%, #10241c);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 1.4rem 0.4rem;
}
.brand-mark {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
}
.brand-sub {
  margin-left: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.meta { color: var(--muted); font-size: 0.86rem; }

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1rem 2rem;
}

.gate {
  margin: 3rem auto 0;
  max-width: 420px;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--panel);
  border: 1px solid rgba(244, 239, 230, 0.08);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}
.gate h1 {
  margin: 0 0 0.5rem;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.8rem;
}
.gate p { color: var(--muted); line-height: 1.45; }
.gate code {
  color: var(--accent);
  font-size: 0.9em;
}
.join {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.2rem;
}
.join label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.join input {
  border: 1px solid rgba(244, 239, 230, 0.16);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font: inherit;
}
.join button, .actions button, .toolbar button {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.join button {
  background: var(--accent);
  color: #1a1405;
}
.hint { font-size: 0.85rem; margin-top: 1rem; }

.hidden { display: none !important; }

.table-wrap { display: grid; gap: 1rem; }
.table {
  padding: 0.4rem;
}
.felt {
  position: relative;
  min-height: min(62vh, 520px);
  border-radius: 999px / 48%;
  background:
    radial-gradient(ellipse at 50% 40%, #247556 0%, var(--felt) 45%, var(--felt-deep) 100%);
  box-shadow:
    inset 0 0 0 10px rgba(212, 160, 23, 0.28),
    inset 0 0 60px rgba(0, 0, 0, 0.35),
    0 25px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.board {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 0.45rem;
  min-height: 74px;
}
.pot, .street {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.pot { top: 58%; font-size: 1.05rem; }
.street { top: 66%; color: var(--muted); font-size: 0.82rem; font-weight: 500; }

.seats {
  position: absolute;
  inset: 0;
}
.seat {
  position: absolute;
  width: 140px;
  transform: translate(-50%, -50%);
  text-align: center;
}
.seat .bubble {
  display: inline-grid;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  border-radius: 14px;
  background: rgba(6, 12, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 118px;
}
.seat.active .bubble {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.35);
}
.seat .name {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat .stack { color: var(--accent); font-size: 0.9rem; font-weight: 700; }
.seat .bet {
  color: #9ad7b8;
  font-size: 0.78rem;
  min-height: 1em;
}
.seat .mini-cards {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.25rem;
  min-height: 34px;
}
.seat.you .bubble { background: rgba(20, 40, 30, 0.85); }

.card {
  width: 42px;
  height: 60px;
  border-radius: 7px;
  background: var(--card);
  color: var(--card-black);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  line-height: 1.05;
  text-align: center;
  padding: 0.15rem;
}
.card.red { color: var(--card-red); }
.card.back {
  background:
    repeating-linear-gradient(135deg, #1f3d55 0 6px, #2a5070 6px 12px);
  color: transparent;
  border: 1px solid rgba(255,255,255,0.2);
}
.card.sm { width: 26px; height: 36px; font-size: 0.7rem; border-radius: 4px; }

.panel {
  background: var(--panel);
  border: 1px solid rgba(244, 239, 230, 0.08);
  border-radius: 16px;
  padding: 0.9rem 1rem 1rem;
  display: grid;
  gap: 0.75rem;
}
.hole {
  display: flex;
  gap: 0.45rem;
  min-height: 64px;
  align-items: center;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.actions button {
  background: #e8e2d6;
  color: #171b18;
}
.actions button.fold { background: var(--danger); color: #fff; }
.actions button.raise { background: var(--accent); color: #1a1405; }
.actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.toolbar { display: flex; gap: 0.5rem; }
.toolbar .ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(244, 239, 230, 0.14);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  background: rgba(12, 16, 14, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  z-index: 20;
}

@media (max-width: 720px) {
  .felt {
    border-radius: 28px;
    min-height: 520px;
  }
  .seat { width: 120px; }
  .brand-sub { display: none; }
}
