/* The Felt — a private card room. Warm, dim, intimate; brass + muted jade.
   Mobile-first. The chip-disc and the lamp-lit jade table are the signature. */
:root {
  --ink: #15120e;
  --surface: #211c16;
  --surface-2: #2c261d;
  --line: #3a3229;
  --brass: #d2a24c;
  --brass-dim: #8c6e33;
  --jade: #1e3a33;
  --jade-edge: #142a25;
  --text: #ece4d3;
  --muted: #9a8f7c;
  --red: #cf6048;
  --win: #6bb083;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(120% 80% at 50% -10%, #241e16 0%, var(--ink) 60%) fixed;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: "Bricolage Grotesque", "Inter", sans-serif; font-weight: 700; letter-spacing: -0.01em; }
.mono { font-family: "Space Mono", ui-monospace, monospace; }
a { color: var(--brass); }
button { font: inherit; cursor: pointer; }

/* ---- layout shell ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(21, 18, 14, 0.9);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 0.02em; }
.brand b { color: var(--brass); }
.spacer { flex: 1; }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px 96px; }

/* ---- chips ---- */
.chip-amt { display: inline-flex; align-items: center; gap: 6px; font-family: "Space Mono", monospace; }
.chip-amt::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0c878, var(--brass) 55%, var(--brass-dim));
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px var(--brass-dim);
}

/* ---- buttons ---- */
.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 11px 16px; border-radius: 11px; font-weight: 600; transition: transform .06s ease, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #e6b660, var(--brass)); color: #2a1f08; border-color: var(--brass-dim); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #5a3027; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- inputs ---- */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input, select {
  width: 100%; padding: 12px 14px; border-radius: 11px; color: var(--text);
  background: var(--ink); border: 1px solid var(--line); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--brass); outline-offset: 1px; }

/* ---- panels / cards ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }

/* ---- auth ---- */
.auth { min-height: 80vh; display: grid; place-items: center; }
.auth .panel { width: min(420px, 92vw); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { flex: 1; background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 10px; border-radius: 10px; }
.tabs button.on { background: var(--surface-2); color: var(--text); border-color: var(--brass-dim); }

/* ---- lobby ---- */
.hero { text-align: center; padding: 26px 18px; }
.hero .bal { font-family: "Space Mono", monospace; font-size: 40px; color: var(--brass); }
.tbl-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.tbl-item:first-of-type { border-top: 0; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.poker { color: #d7a35a; border-color: #5a4521; }
.pill.blackjack { color: #8fb6a6; border-color: #2c4a40; }

/* ---- the table ---- */
.felt {
  position: relative; margin: 8px 0 16px;
  background: radial-gradient(120% 120% at 50% 25%, #2a4f45 0%, var(--jade) 45%, var(--jade-edge) 100%);
  border: 2px solid #0e211d; border-radius: 120px / 80px;
  box-shadow: inset 0 2px 30px rgba(0,0,0,.45), inset 0 0 60px rgba(210,162,76,.06);
  padding: 26px 16px; text-align: center;
}
.felt .pot { font-family: "Space Mono", monospace; color: var(--brass); font-size: 14px; margin-bottom: 10px; }
.board, .dealer-cards { display: flex; gap: 6px; justify-content: center; min-height: 62px; align-items: center; flex-wrap: wrap; }
.dealer-label { font-size: 12px; color: #bfe0d3; letter-spacing: .1em; text-transform: uppercase; margin-top: 8px; }

/* ---- playing cards ---- */
.card {
  width: 42px; height: 60px; border-radius: 7px; background: #f6f1e6; color: #1a1a1a;
  display: flex; flex-direction: column; justify-content: space-between; padding: 4px 5px;
  font-family: "Space Mono", monospace; font-weight: 700; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.card.red { color: var(--red); }
.card .b { align-self: flex-end; transform: rotate(180deg); }
.card.back {
  background: repeating-linear-gradient(45deg, #3a2b12, #3a2b12 5px, #4a3717 5px, #4a3717 10px);
  border: 2px solid var(--brass-dim);
}
.card.sm { width: 30px; height: 43px; font-size: 11px; padding: 3px; }

/* ---- seats ---- */
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.seat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; position: relative;
}
.seat.me { border-color: var(--brass-dim); background: var(--surface-2); }
.seat.toact { box-shadow: 0 0 0 2px var(--brass); }
.seat.out { opacity: .5; }
.seat.empty { display: grid; place-items: center; border-style: dashed; min-height: 92px; }
.seat .who { display: flex; align-items: center; gap: 9px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #1a1a1a; font-size: 13px; flex: none; }
.seat .nm { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .stk { font-family: "Space Mono", monospace; font-size: 13px; color: var(--brass); }
.seat .act { position: absolute; top: 10px; right: 10px; font-size: 11px; color: var(--muted); }
.seat .hand { display: flex; gap: 4px; margin-top: 9px; }
.seat .bet { margin-top: 6px; font-size: 12px; }
.seat .hand-total { margin-top: 6px; font-size: 12px; font-family: "Space Mono", monospace; color: var(--brass); }
.yourhand { text-align: center; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.yourhand b { color: var(--brass); font-family: "Space Mono", monospace; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--win); }
.dot.off { background: #6b3a31; }

/* ---- action dock ---- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(21,18,14,.6), var(--ink) 40%);
  border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.dock .inner { max-width: 720px; margin: 0 auto; }
.dock .my-cards { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.raise { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.raise input[type=range] { flex: 1; accent-color: var(--brass); }
.sizes { display: flex; gap: 6px; margin-top: 6px; }
.chipbtn { flex: 1; padding: 9px 4px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 9px; font-size: 13px; font-weight: 600; }
.chipbtn:active { background: var(--brass-dim); }
.amount { font-family: "Space Mono", monospace; color: var(--brass); min-width: 64px; text-align: right; }

/* ---- results banner ---- */
.results { background: var(--surface-2); border: 1px solid var(--brass-dim); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.results .ln { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; }
.net.win { color: var(--win); }
.net.lose { color: var(--red); }

/* ---- table list rows in admin/profile ---- */
.list .li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list .li:first-child { border-top: 0; }
.tx-amt { font-family: "Space Mono", monospace; margin-left: auto; }

/* ---- toast / modal ---- */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  background: #3a241f; color: #f3d4cb; border: 1px solid var(--red); padding: 10px 16px; border-radius: 10px;
  z-index: 50; box-shadow: var(--shadow); max-width: 90vw; font-size: 14px;
}
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { width: min(420px, 94vw); }
.code { font-family: "Space Mono", monospace; letter-spacing: .12em; color: var(--brass); }
.nav-btn { background: transparent; border: 0; color: var(--muted); padding: 6px; }
.nav-btn.on { color: var(--brass); }
