/* ==========================================================================
   Design tokens — reuse these in lobby/poker pages instead of new colours.
   ========================================================================== */
:root {
  /* Surfaces */
  --felt-900: #04140d;
  --felt-800: #072a1b;
  --felt-700: #0b3d27;
  --felt-600: #11553a;
  --lacquer: #0a0c0b;
  --panel: rgba(6, 18, 12, 0.82);
  --panel-solid: #0a1a12;

  /* Metal and ink */
  --gold-300: #f4dfa6;
  --gold-400: #e5c77f;
  --gold-500: #c9a45c;
  --gold-600: #a07c3a;
  --ivory: #f3ecdc;
  --ivory-dim: #b9b09c;
  --ivory-faint: #7d7868;

  /* Accents */
  --ruby: #a3263a;
  --ruby-soft: #f0b8c0;
  --emerald-ok: #5fbf8a;

  /* Lines and depth */
  --hairline: rgba(201, 164, 92, 0.35);
  --hairline-strong: rgba(201, 164, 92, 0.7);
  --shadow-deep: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
  --glow-gold: 0 0 0 3px rgba(229, 199, 127, 0.18);

  /* Type */
  --font-display: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Elements with a display rule of their own (.btn, .action-bar, .raise-controls) would
   otherwise override the browser's [hidden] { display: none }, so room.js could not hide
   them by setting .hidden. */
[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ivory);
  background-color: var(--felt-900);
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 35%, var(--felt-600) 0%, var(--felt-700) 35%, var(--felt-800) 65%, var(--felt-900) 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 4px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Soft vignette, like lamplight over a table. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--gold-400);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold-300);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
}

h1 {
  font-size: 2.2rem;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 32px;
  background: linear-gradient(180deg, #111412 0%, var(--lacquer) 100%);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6), 0 10px 30px -10px rgba(0, 0, 0, 0.8);
}

.navbar a {
  color: var(--ivory-dim);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.navbar a:hover {
  color: var(--gold-300);
}

.navbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--gold-400);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  font-style: normal;
  font-size: 1.05rem;
  color: var(--gold-300);
  background: radial-gradient(circle at 35% 30%, #1d2a22, #050806);
}

.navbar .spacer {
  flex: 1;
}

.username {
  color: var(--ivory);
  font-weight: 500;
}

/* Chip balance: a small casino chip next to the amount. */
.chips {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(201, 164, 92, 0.08);
  color: var(--gold-300);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ruby) 0 38%, var(--ivory) 38% 46%, var(--ruby) 46% 100%);
  border: 2px dashed var(--ivory);
  box-shadow: 0 0 0 1px var(--ruby);
}

.logout-form {
  margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn,
.logout-form button,
.auth-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-gold,
.auth-form button {
  padding: 14px 22px;
  border: 1px solid var(--gold-300);
  color: #1b1405;
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-500) 55%, var(--gold-600) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 18px -8px rgba(201, 164, 92, 0.7);
}

.btn-gold:hover,
.auth-form button:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 26px -10px rgba(229, 199, 127, 0.8);
}

.btn-gold:active,
.auth-form button:active {
  transform: translateY(0);
}

.btn-ghost,
.logout-form button {
  padding: 7px 14px;
  border: 1px solid var(--hairline-strong);
  color: var(--gold-400);
  background: transparent;
}

.btn-ghost:hover,
.logout-form button:hover {
  background: rgba(201, 164, 92, 0.12);
  color: var(--gold-300);
}

/* ==========================================================================
   Panels — the gold-rimmed card used for forms and boxes.
   ========================================================================== */
.panel {
  position: relative;
  padding: 40px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-deep);
}

/* Inner hairline, Art Deco style. */
.panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--hairline);
  border-radius: calc(var(--radius) - 5px);
  pointer-events: none;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.suit-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 26px;
  color: var(--gold-500);
  font-size: 0.85rem;
  letter-spacing: 0.4em;
}

.suit-divider::before,
.suit-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-strong), transparent);
}

.suit-divider .red {
  color: #c8505f;
}

.muted {
  color: var(--ivory-dim);
}

/* ==========================================================================
   Messages
   ========================================================================== */
.messages {
  list-style: none;
  width: 100%;
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0 24px;
}

.message {
  padding: 12px 18px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.8);
}

.message + .message {
  margin-top: 8px;
}

.message.success {
  border-left-color: var(--emerald-ok);
}

.message.error {
  border-left-color: var(--ruby);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* form.as_div renders label, help text, errors, input; show the input right under its label. */
.auth-form > div,
.form-row > div {
  display: flex;
  flex-direction: column;
}

.auth-form > div > label,
.form-row > div > label {
  order: 0;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.auth-form > div > input,
.auth-form > div > select,
.form-row > div > input {
  order: 1;
}

.auth-form > div > .errorlist,
.form-row > div > .errorlist {
  order: 2;
}

.auth-form > div > .helptext,
.form-row > div > .helptext {
  order: 3;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"],
.auth-form select {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  color: var(--ivory);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 164, 92, 0.28);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-400) 50%), linear-gradient(135deg, var(--gold-400) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.auth-form select option {
  color: #15110b;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--gold-400);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: var(--glow-gold);
}

.auth-form input[aria-invalid="true"] {
  border-color: var(--ruby);
}

.helptext {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ivory-faint);
}

.helptext ul {
  margin: 0;
  padding-left: 16px;
}

.errorlist {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.84rem;
  color: var(--ruby-soft);
}

.errorlist li::before {
  content: "♦ ";
  color: var(--ruby);
}

/* Non-field errors (e.g. wrong password) sit above the fields as a banner. */
.auth-form > .errorlist.nonfield {
  padding: 12px 16px;
  margin: 0;
  border: 1px solid rgba(163, 38, 58, 0.6);
  border-radius: var(--radius-sm);
  background: rgba(163, 38, 58, 0.14);
}

.auth-form button {
  margin-top: 6px;
  width: 100%;
}

/* ==========================================================================
   Auth pages: hero on the left, form on the right.
   ========================================================================== */
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 220px);
}

.auth-hero h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 18px;
}

.auth-hero h1 em {
  color: var(--gold-400);
}

.auth-hero p {
  max-width: 420px;
  font-size: 1.05rem;
  color: var(--ivory-dim);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  justify-self: end;
}

.auth-card h2 {
  font-size: 1.9rem;
}

.auth-switch {
  margin: 24px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ivory-dim);
}

/* Fanned playing cards and a chip stack, drawn in CSS. */
.showcase {
  position: relative;
  height: 230px;
  margin-top: 40px;
}

.playing-card {
  position: absolute;
  width: 120px;
  height: 170px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(160deg, #fffdf7 0%, #f1e9d6 100%);
  box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  font-family: var(--font-display);
  color: #15110b;
}

.playing-card .corner {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.playing-card .corner span {
  display: block;
  font-size: 1.1rem;
}

.playing-card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.6rem;
}

.playing-card.red {
  color: #b3192f;
}

.playing-card.one {
  left: 0;
  top: 20px;
  transform: rotate(-10deg);
}

.playing-card.two {
  left: 78px;
  top: 6px;
  transform: rotate(7deg);
}

.chip-stack {
  position: absolute;
  left: 240px;
  bottom: 10px;
}

.chip-stack i {
  display: block;
  width: 84px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, var(--ruby) 0 12px, var(--ivory) 12px 18px);
  box-shadow: 0 3px 0 #5d1320, 0 6px 10px rgba(0, 0, 0, 0.5);
}

.chip-stack i:nth-child(2n) {
  background: repeating-linear-gradient(90deg, #13233f 0 12px, var(--gold-300) 12px 18px);
  box-shadow: 0 3px 0 #0a1424, 0 6px 10px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
  .navbar {
    flex-wrap: wrap;
    gap: 14px 20px;
    padding: 12px 16px;
  }

  main {
    padding: 28px 16px 48px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: 0;
  }

  .auth-card {
    justify-self: stretch;
    max-width: none;
  }

  .panel {
    padding: 28px 22px;
  }

  .showcase {
    display: none;
  }
}

/* ==========================================================================
   Room: seat list (rendered by static/js/room.js)
   ========================================================================== */
.seat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.seat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
}

.seat.taken {
  border-color: var(--hairline-strong);
  background: linear-gradient(160deg, rgba(201, 164, 92, 0.12), rgba(0, 0, 0, 0.35));
}

.seat.empty {
  border-style: dashed;
  color: var(--ivory-faint);
}

.seat-number {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.seat-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.seat.empty .seat-name {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
}

.seat-stack {
  color: var(--gold-300);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.seat-stack::before {
  content: "◉ ";
  color: var(--ruby);
}

/* Online dot (D3), from the seat's "connected" flag. */
.presence {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--ivory-faint);
  vertical-align: middle;
}

.presence.online {
  background: var(--emerald-ok);
  box-shadow: 0 0 6px var(--emerald-ok);
}

.badge-host {
  padding: 2px 8px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-400);
  vertical-align: middle;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-faint);
}

.live-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ivory-faint);
}

.live-status[data-state="live"] {
  color: var(--emerald-ok);
}

.live-status[data-state="live"]::before {
  background: var(--emerald-ok);
  box-shadow: 0 0 8px var(--emerald-ok);
}

/* ==========================================================================
   Lobby and room pages (lobby/templates/lobby/)
   ========================================================================== */
.lobby-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel h2 {
  font-size: 1.5rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
}

/* Join-by-code: the input and the button on one line. */
.auth-form > .form-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.form-row > div {
  flex: 1;
}

.form-row > div > input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.auth-form .form-row button {
  width: auto;
  margin-top: 26px; /* line up with the input, below its label */
  padding: 13px 22px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th {
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--hairline-strong);
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold-300);
}

/* Bankroll strip above "My rooms": label, big number, note on one line. */
.balance-panel {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 22px 40px;
}

.balance-panel .eyebrow,
.balance-panel p {
  margin: 0;
}

.balance {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.room-head h1 {
  margin-bottom: 4px;
}

.room-code {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-code .code {
  padding: 6px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  font-size: 1.6rem;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-top: 18px;
  color: var(--ivory-dim);
  font-size: 0.9rem;
}

.settings b {
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn[disabled]:hover {
  transform: none;
}

.btn-danger {
  padding: 13px 22px;
  border: 1px solid rgba(163, 38, 58, 0.7);
  color: var(--ruby-soft);
  background: rgba(163, 38, 58, 0.14);
}

.btn-danger:hover {
  background: rgba(163, 38, 58, 0.28);
}

/* ==========================================================================
   Table page (lobby/templates/lobby/_table.html), redrawn by static/js/room.js
   ========================================================================== */
.table-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.table-head h1 {
  margin: 0;
  font-size: 1.7rem;
}

.table-head .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding-bottom: 6px;
  color: var(--ivory-dim);
  font-size: 0.88rem;
}

.table-head .meta b {
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}

/* The felt is an ellipse; seats, bets and the dealer button sit on rings around its
   centre. Each gets --i (position clockwise from the viewer, who is at the bottom)
   and --n (seats at the table); the angle starts at 90deg because y grows downward. */
.felt-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  /* The viewer's seat hangs below the ellipse, so the bottom margin clears it. */
  margin: 76px 100px 120px;
}

.felt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 42%, var(--felt-600) 0%, var(--felt-700) 55%, var(--felt-800) 100%);
  box-shadow:
    inset 0 0 0 12px #2b1a0f,
    inset 0 0 0 14px var(--gold-600),
    inset 0 0 60px rgba(0, 0, 0, 0.45),
    var(--shadow-deep);
}

.felt::before {
  content: "";
  position: absolute;
  inset: 34px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  pointer-events: none;
}

.table-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.pot {
  padding: 5px 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.pot b {
  margin-left: 6px;
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
}

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.stage {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

/* Cards. A slot is an outline until a card lands in it; a back is any card the
   viewer may not see. room.js builds faces as rank over suit, red for hearts and diamonds. */
.card {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 68px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
}

.card.slot {
  border: 1px dashed var(--hairline);
  background: rgba(0, 0, 0, 0.18);
}

.card.face {
  background: linear-gradient(160deg, #fffdf7 0%, #f1e9d6 100%);
  color: #15110b;
  box-shadow: 0 8px 14px -8px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.card.face.red {
  color: #b3192f;
}

.card.face small {
  display: block;
  margin-top: 2px;
  font-size: 0.85em;
}

.card.back {
  background: repeating-linear-gradient(45deg, var(--ruby) 0 3px, #701a29 3px 6px);
  box-shadow: inset 0 0 0 3px #fffdf7, inset 0 0 0 4px rgba(0, 0, 0, 0.25), 0 8px 14px -8px rgba(0, 0, 0, 0.8);
}

.table-seats,
.table-bets {
  list-style: none;
  margin: 0;
  padding: 0;
}

.table-seat,
.table-bet,
.dealer-button {
  --angle: calc(90deg + var(--i) * 360deg / var(--n));
  position: absolute;
  transform: translate(-50%, -50%);
}

.table-seat {
  left: calc(50% + 52% * cos(var(--angle)));
  top: calc(50% + 58% * sin(var(--angle)));
  width: 150px;
  padding: 10px 12px 12px;
  text-align: center;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-solid);
  box-shadow: var(--shadow-deep);
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.table-seat.empty {
  border-style: dashed;
  background: rgba(0, 0, 0, 0.3);
  color: var(--ivory-faint);
  box-shadow: none;
}

.table-seat.you {
  border-color: var(--gold-400);
}

.table-seat.to-act {
  box-shadow: 0 0 0 3px var(--gold-400), 0 0 28px rgba(229, 199, 127, 0.55);
}

.table-seat.folded {
  opacity: 0.55;
}

.table-seat.winner {
  border-color: var(--emerald-ok);
  box-shadow: 0 0 0 3px var(--emerald-ok), 0 0 28px rgba(95, 191, 138, 0.5);
}

.table-seat .seat-cards {
  display: flex;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  margin-bottom: 8px;
}

.table-seat .seat-cards .card {
  width: 25px;
  height: 36px;
  border-radius: 3px;
  font-size: 0.68rem;
}

.table-seat.you .seat-cards {
  min-height: 62px;
}

.table-seat.you .seat-cards .card {
  width: 44px;
  height: 62px;
  border-radius: 5px;
  font-size: 1.05rem;
}

.table-seat .seat-name {
  display: block;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-seat .seat-stack {
  display: block;
}

.table-seat .seat-number {
  display: block;
}

.seat-status {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 9px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.seat-status:empty {
  display: none;
}

.seat-status[data-status="all_in"] {
  border-color: var(--ruby);
  color: var(--ruby-soft);
}

.seat-status[data-status="to_act"] {
  border-color: var(--gold-400);
  color: var(--gold-300);
}

.seat-status[data-status="busted"] {
  border-color: var(--ruby);
  color: var(--ruby-soft);
}

.seat .seat-status {
  align-self: flex-start;
  margin-top: 0;
}

.seat-status[data-status="winner"] {
  border-color: var(--emerald-ok);
  color: var(--emerald-ok);
}

/* Errors the server sends back over the socket, above whichever view is showing. */
.room-message {
  margin: 0 0 20px;
  padding: 12px 18px;
  border: 1px solid rgba(163, 38, 58, 0.7);
  border-radius: var(--radius-sm);
  background: rgba(163, 38, 58, 0.18);
  color: var(--ruby-soft);
}

/* A player's bet this street, as a chip on the felt in front of their seat. */
.table-bet {
  left: calc(50% + 31% * cos(var(--angle)));
  top: calc(50% + 32% * sin(var(--angle)));
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-bet::before {
  content: "◉ ";
  color: var(--ruby);
}

.dealer-button {
  --angle: calc(90deg + var(--i) * 360deg / var(--n) + 16deg);
  left: calc(50% + 40% * cos(var(--angle)));
  top: calc(50% + 44% * sin(var(--angle)));
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ivory);
  color: #15110b;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.8);
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 18px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--panel);
}

.action-bar .btn {
  padding: 12px 20px;
}

.action-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.raise-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid var(--hairline);
}

.raise-to {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ivory-dim);
  white-space: nowrap;
}

.raise-to input {
  width: 110px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 164, 92, 0.28);
  border-radius: var(--radius-sm);
  outline: none;
}

.raise-to input:focus {
  border-color: var(--gold-400);
  box-shadow: var(--glow-gold);
}

#raise-slider {
  flex: 1;
  min-width: 120px;
  accent-color: var(--gold-400);
}

.action-log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 440px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.action-log li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.action-log li.street {
  margin-top: 6px;
  font-weight: 600;
  color: var(--gold-400);
}

.action-log li.to-act {
  color: var(--gold-300);
  background: rgba(229, 199, 127, 0.1);
}

.action-log li.muted {
  border: 0;
  font-family: var(--font-body);
  font-style: italic;
}

@media (max-width: 1000px) {
  .lobby-grid,
  .room-grid,
  .table-page {
    grid-template-columns: 1fr;
  }

  .felt-wrap {
    margin: 70px 80px 60px;
  }
}

@media (max-width: 700px) {
  .felt-wrap {
    aspect-ratio: 1 / 1;
    margin: 60px 54px 50px;
  }

  .table-seat {
    width: 108px;
    padding: 8px 8px 10px;
  }

  .table-seat .seat-name {
    font-size: 0.9rem;
  }
}
