:root {
  --ink: #07090c;
  --paper: #f4f0e8;
  --gold: #e8c547;
  --felt: #0f4a32;
  --felt-deep: #083324;
  --wood: #5a3418;
  --signal: #ff4d2e;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
}
.atmosphere {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232, 197, 71, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 10% 100%, rgba(15, 74, 50, 0.45), transparent 50%),
    linear-gradient(180deg, #0a0c10, #12151a);
}

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
}
.back { color: rgba(244,240,232,.55); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--gold); }
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.08em;
  font-weight: 400;
}
.top-meta { display: flex; gap: 1.2rem; font-size: 0.85rem; color: rgba(244,240,232,.55); }
.top-meta strong { color: var(--gold); }

.felt {
  position: relative;
  width: min(920px, calc(100% - 1.5rem));
  height: min(52vw, 420px);
  min-height: 320px;
  margin: 0 auto;
  background:
    radial-gradient(ellipse at 50% 40%, #1a6b48, var(--felt-deep) 70%);
  border: 14px solid var(--wood);
  border-radius: 50%;
  box-shadow:
    0 24px 60px rgba(0,0,0,.55),
    inset 0 0 80px rgba(0,0,0,.35),
    inset 0 0 0 6px rgba(232,197,71,.18);
}
.felt-rim {
  position: absolute; inset: 10px; border-radius: 50%;
  border: 2px dashed rgba(232,197,71,.2); pointer-events: none;
}
.board {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  text-align: center; z-index: 2;
}
.pot { font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.pot strong { font-size: 1.35rem; }
.community { display: flex; gap: 0.4rem; justify-content: center; min-height: 88px; margin: 0.55rem 0 0.35rem; }
.street { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(244,240,232,.5); }

.seat {
  position: absolute; width: 150px; text-align: center; z-index: 3;
}
.seat .name { font-weight: 700; font-size: 0.92rem; }
.seat .stack { font-size: 0.8rem; color: var(--gold); }
.seat .bet {
  display: inline-block; margin-top: 0.2rem; padding: 0.12rem 0.45rem;
  background: rgba(0,0,0,.4); border-radius: 999px; font-size: 0.75rem;
}
.seat .status { font-size: 0.72rem; color: rgba(244,240,232,.55); min-height: 1.1em; }
.seat .cards { display: flex; justify-content: center; gap: 0.25rem; margin-top: 0.3rem; }
.seat.is-turn .name { color: var(--gold); text-shadow: 0 0 12px rgba(232,197,71,.55); }
.seat.is-fold { opacity: 0.42; }
.seat.is-hero { width: 170px; }
.seat-0 { left: 50%; bottom: 4%; transform: translateX(-50%); }
.seat-1 { right: 4%; top: 52%; transform: translateY(-50%); }
.seat-2 { right: 14%; top: 8%; }
.seat-3 { left: 50%; top: 4%; transform: translateX(-50%); }
.seat-4 { left: 14%; top: 8%; }
.seat-5 { left: 4%; top: 52%; transform: translateY(-50%); }
.n-2.seat-1 { left: 50%; right: auto; top: 6%; transform: translateX(-50%); }
.n-3.seat-1 { right: 6%; top: 22%; }
.n-3.seat-2 { left: 6%; right: auto; top: 22%; }
.n-4.seat-1 { right: 4%; top: 42%; }
.n-4.seat-2 { left: 50%; right: auto; top: 6%; transform: translateX(-50%); }
.n-4.seat-3 { left: 4%; top: 42%; }
.n-5.seat-3 { left: 16%; top: 8%; transform: none; }
.n-5.seat-4 { left: 4%; top: 52%; transform: translateY(-50%); }
.badge {
  display: inline-block; margin-left: 0.25rem; font-size: 0.65rem; letter-spacing: 0.08em;
  padding: 0.05rem 0.35rem; border: 1px solid var(--gold); border-radius: 4px; color: var(--gold);
}
.ai { font-size: 0.62rem; color: rgba(244,240,232,.45); font-weight: 500; }

.lobby {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: rgba(6, 8, 12, .72);
}
.lobby[hidden] { display: none; }
.lobby-card {
  width: min(420px, calc(100% - 2rem));
  background: #12161c;
  border: 1px solid rgba(232,197,71,.28);
  border-radius: 16px;
  padding: 1.4rem 1.3rem 1.2rem;
  display: grid; gap: 0.7rem;
}
.lobby-card h2 {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-weight: 400;
  font-size: 2rem;
}
.field { display: grid; gap: 0.3rem; font-size: 0.85rem; color: rgba(244,240,232,.6); }
.lobby-card input, .join-row input {
  appearance: none; border: 1px solid rgba(244,240,232,.2);
  background: #0c0f14; color: var(--paper);
  font: inherit; padding: 0.65rem 0.75rem; border-radius: 10px;
}
.join-row { display: flex; gap: 0.45rem; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: 0.16em; }
.lobby-err { min-height: 1.2em; color: var(--signal); font-size: 0.85rem; }

.room-bar {
  display: flex; flex-wrap: wrap; gap: 0.65rem 1rem;
  align-items: center; justify-content: center;
  width: min(920px, calc(100% - 1.5rem));
  margin: 0 auto 0.7rem;
  font-size: 0.85rem; color: rgba(244,240,232,.7);
}
.room-bar[hidden] { display: none; }
.room-bar strong { color: var(--gold); letter-spacing: 0.12em; }
.invite-row { display: flex; gap: 0.4rem; flex: 1 1 280px; min-width: min(280px, 100%); }
.invite-row input {
  flex: 1; appearance: none; border: 1px solid rgba(244,240,232,.2);
  background: #0c0f14; color: var(--paper);
  font: inherit; padding: 0.45rem 0.65rem; border-radius: 8px;
}

.pcard {
  position: relative;
  width: 52px; height: 74px;
  background: #f7f3ea;
  color: #1a1a1a;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
  font-weight: 800;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 4px 6px;
  font-size: 0.95rem;
  line-height: 1;
}
.pcard .suit { font-size: 1.15rem; align-self: center; }
.pcard.red { color: #c4122f; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, #6b1020 0 6px, #8a1a2e 6px 12px);
  color: transparent;
  border: 2px solid #e8c547;
}
.pcard.ghost {
  background: rgba(255,255,255,.06);
  box-shadow: none;
  color: transparent;
  border: 1px dashed rgba(255,255,255,.15);
}
.hero-hand .pcard { width: 64px; height: 90px; font-size: 1.15rem; }

.dock {
  width: min(920px, calc(100% - 1.5rem));
  margin: 1rem auto 1.5rem;
  display: grid; gap: 0.65rem; justify-items: center;
}
.log {
  min-height: 1.4em; font-size: 0.92rem; color: rgba(244,240,232,.75); text-align: center;
}
.hero-hand { display: flex; gap: 0.4rem; }
.hero-combo { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); min-height: 1.1em; }
.actions, .next-row, .raise-row {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; align-items: center;
}
.raise-row { width: min(420px, 100%); }
.raise-row input { flex: 1; accent-color: var(--gold); }
.btn {
  appearance: none; border: 0; cursor: pointer;
  background: #1e6b4a; color: #fff;
  font: inherit; font-weight: 700;
  padding: 0.7rem 1.05rem; border-radius: 10px;
  min-height: 44px;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.gold { background: var(--gold); color: #1a1408; }
.btn.ghost { background: transparent; color: var(--paper); border: 1px solid rgba(244,240,232,.25); }
.btn.danger { background: var(--signal); }

@media (max-width: 720px) {
  .felt { height: 380px; border-width: 10px; }
  .seat { width: 118px; }
  .seat .name { font-size: 0.8rem; }
  .pcard { width: 42px; height: 60px; font-size: 0.8rem; }
  .hero-hand .pcard { width: 54px; height: 76px; }
  .seat-2 { right: 8%; }
  .seat-3 { left: 8%; }
}
