:root {
  --bg: #0b2a1c;
  --felt: #13603d;
  --felt-dark: #0d4a2f;
  --rail: #3b2414;
  --text: #f3f1e8;
  --muted: #a9c2b4;
  --gold: #e8b94a;
  --red: #d8433b;
  --card: #fbfaf5;
  --panel: #0f1f18;
  --btn: #23382e;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at top, #134a31, var(--bg) 70%);
  color: var(--text);
  font: 16px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; }

/* Login */
#login { align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.logo { font-size: 28px; letter-spacing: 8px; color: var(--gold); }
h1 { margin: 8px 0 4px; font-size: 32px; }
.sub { color: var(--muted); margin: 4px 0 20px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#name {
  font-size: 18px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid #2f5545; background: #0c1c15; color: var(--text); text-align: center;
}

/* Buttons */
.btn {
  flex: 1; border: 0; border-radius: 12px; padding: 14px 8px;
  font: 600 16px system-ui, sans-serif; color: var(--text); background: var(--btn);
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; }
.btn.primary { background: #2e8b57; }
.btn.danger { background: #7a2a26; }
.btn.gold { background: var(--gold); color: #2a1d05; }
.btn.ghost { background: transparent; border: 1px solid #3d6151; }
.btn.small { flex: 0 0 auto; padding: 6px 12px; font-size: 14px; }
.btn.big { width: 100%; padding: 16px; font-size: 18px; }
.row { display: flex; gap: 8px; }

/* Top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 16px 4px; color: var(--muted); font-size: 14px;
}

/* Table */
.table-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 16px; min-height: 0; }
.felt {
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 0.82;
  max-height: 100%;
  border-radius: 46% / 40%;
  background: radial-gradient(ellipse at center, var(--felt), var(--felt-dark) 75%);
  border: 10px solid var(--rail);
  box-shadow: inset 0 0 30px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.5);
}
.center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.pot { font-weight: 700; color: var(--gold); min-height: 20px; }
.banner {
  background: rgba(0,0,0,.6); border-radius: 10px; padding: 6px 10px; font-size: 14px;
}
.banner strong { color: var(--gold); }

/* Seats */
.seat {
  position: absolute; transform: translate(-50%, -50%);
  width: 84px; text-align: center; transition: opacity .2s;
}
.seat .box {
  background: rgba(8, 20, 15, .85); border: 2px solid #2b4a3d; border-radius: 10px;
  padding: 3px 4px; position: relative;
}
.seat.turn .box { border-color: var(--gold); box-shadow: 0 0 12px var(--gold); }
.seat.you .box { border-color: #4fb37e; }
.seat.folded, .seat.out { opacity: .45; }
.seat .name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .stack { font-size: 12px; color: var(--muted); }
.seat .tag { font-size: 10px; color: var(--gold); min-height: 12px; }
.seat .bet {
  position: absolute; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #2a1d05; font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 1px 7px; white-space: nowrap;
}
.seat .bet.down { top: calc(100% + 3px); }
.seat .kick {
  margin-top: 4px; width: 100%; border: 0; border-radius: 8px; padding: 5px 0;
  background: #7a2a26; color: #fff; font: 600 12px system-ui, sans-serif;
}
.seat .bet.up { bottom: calc(100% + 3px); }
.seat .bet.right { left: calc(100% + 14px); top: 50%; transform: translateY(-50%); }
.seat .bet.left { left: auto; right: calc(100% + 14px); top: 50%; transform: translateY(-50%); }
.chip {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  background: #fff; color: #222; border: 2px solid #999;
}
.chip.sb, .chip.bb { background: #2b6cb0; color: #fff; border-color: #90cdf4; font-size: 9px; }

/* Street prompt for the live dealer */
.street { font-size: 22px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.hint { font-size: 13px; color: var(--muted); }

/* Awarding */
.award { display: flex; flex-direction: column; gap: 10px; }
.award-title { font-weight: 700; color: var(--gold); }
#award-pots { display: flex; flex-direction: column; gap: 10px; max-height: 40dvh; overflow-y: auto; }
.award-head { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.award-note { font-size: 14px; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.pick { flex: 1 1 30%; padding: 12px 6px; border: 2px solid #3d6151; background: transparent; }
.btn.pick.on { background: var(--gold); color: #2a1d05; border-color: var(--gold); }

/* Panel */
.panel {
  background: var(--panel); border-top: 1px solid #22392f;
  padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px;
}
.me-row { display: flex; align-items: center; }
.me-info { flex: 1; min-width: 0; }
.my-stack { font-size: 20px; font-weight: 700; }
.status { color: var(--muted); font-size: 14px; min-height: 18px; }
.status.your-turn { color: var(--gold); font-weight: 700; }

.controls { display: flex; flex-direction: column; gap: 8px; }
.raise-box { display: flex; flex-direction: column; gap: 10px; }
.raise-head { display: flex; justify-content: space-between; align-items: baseline; }
.raise-head strong { font-size: 24px; color: var(--gold); }
#raise-slider { width: 100%; accent-color: var(--gold); height: 28px; }
.quick { display: flex; gap: 6px; justify-content: space-between; }
.quick .btn { flex: 1; }

.toast {
  position: fixed; left: 16px; right: 16px; top: 16px; z-index: 10;
  background: var(--red); color: #fff; padding: 12px 16px; border-radius: 12px; text-align: center;
}
