:root {
  --felt: #0b5c3a;
  --felt-dark: #073d27;
  --gold: #e0b04c;
  --panel: #1c1f26;
  --panel2: #262a33;
  --text: #f1f1f1;
  --muted: #9aa0aa;
  --danger: #d9534f;
  --accent: #3d8bfd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #22262f, #14161b 70%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: .55em 1.1em;
  background: var(--panel2);
  color: var(--text);
}
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--accent); font-weight: 600; }
button.danger { background: var(--danger); }
button.gold { background: var(--gold); color: #221; font-weight: 700; }
input {
  font: inherit;
  background: var(--panel2);
  border: 1px solid #3a3f4a;
  color: var(--text);
  border-radius: 8px;
  padding: .5em .7em;
}

.top {
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .7em 1.2em;
  background: var(--panel);
  border-bottom: 1px solid #000;
}
.top h1 { font-size: 1.2em; margin: 0; }
.top .grow { flex: 1; }
.top a { color: var(--muted); text-decoration: none; }

.center-screen {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1em;
}

.card-box {
  background: var(--panel);
  border-radius: 14px;
  padding: 1.4em;
  width: min(360px, 92vw);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.card-box h2 { margin-top: 0; }
.card-box form, .card-box .row { display: flex; flex-direction: column; gap: .6em; }
.card-box .row-inline { display: flex; gap: .6em; }
.card-box .row-inline input { flex: 1; width: 0; }

.lobby-list { display: flex; flex-direction: column; gap: .8em; padding: 1em; max-width: 480px; margin: 0 auto; }
.lobby-row {
  display: flex;
  align-items: center;
  gap: .8em;
  background: var(--panel);
  border-radius: 10px;
  padding: .8em 1em;
}
.hint { color: var(--muted); }

/* --- table --- */
.table-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1em;
  gap: 1em;
}
.table-oval {
  position: relative;
  width: min(720px, 94vw);
  height: min(420px, 60vh);
  background: radial-gradient(ellipse at center, var(--felt), var(--felt-dark) 90%);
  border: 10px solid #3a2417;
  border-radius: 50%;
  margin: 2.5em auto 1em;
}
.pot-area {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.pot-amount {
  background: rgba(0,0,0,.4);
  border-radius: 20px;
  padding: .3em 1em;
  font-weight: 700;
  color: var(--gold);
}
.community { display: flex; gap: .3em; margin-top: .5em; justify-content: center; }

.seat {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translate(var(--sx), var(--sy));
  width: 128px;
  text-align: center;
}
.seat .seat-card {
  background: var(--panel);
  border-radius: 10px;
  padding: .4em .5em;
  border: 2px solid transparent;
}
.seat.to-act .seat-card { border-color: var(--gold); box-shadow: 0 0 12px var(--gold); }
.seat.folded .seat-card { opacity: .45; }
.seat .name { font-weight: 600; font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .stack { color: var(--gold); font-size: .8em; }
.seat .bet-chip {
  margin-top: .3em;
  font-size: .75em;
  background: rgba(0,0,0,.5);
  border-radius: 10px;
  display: inline-block;
  padding: .1em .6em;
}
.seat .hole { display: flex; gap: .2em; justify-content: center; margin-top: .3em; }
.seat .dealer-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--gold);
  color: #221;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: .65em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.playing-card {
  width: 32px;
  height: 46px;
  border-radius: 5px;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85em;
  flex-direction: column;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.playing-card.red { color: #c0392b; }
.playing-card.back {
  background: repeating-linear-gradient(45deg, #2a4d8f, #2a4d8f 4px, #1c3564 4px, #1c3564 8px);
}
.playing-card.big { width: 46px; height: 64px; font-size: 1.05em; }

.action-bar {
  display: flex;
  gap: .5em;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--panel);
  border-radius: 12px;
  padding: .8em 1em;
  width: min(720px, 94vw);
}
.action-bar input[type=range] { flex: 1; min-width: 120px; }
.action-bar .amount { min-width: 3.2em; text-align: center; color: var(--gold); font-weight: 700; }

.hint-line { color: var(--muted); text-align: center; }
.log-panel {
  width: min(720px, 94vw);
  max-height: 140px;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 10px;
  padding: .6em 1em;
  font-size: .85em;
  color: var(--muted);
}
.log-panel div { padding: .1em 0; }

.result-banner {
  background: rgba(224,176,76,.15);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: .6em 1em;
  width: min(720px, 94vw);
  text-align: center;
}

.toasts, #toasts {
  position: fixed;
  top: 1em;
  right: 1em;
  display: flex;
  flex-direction: column;
  gap: .5em;
  z-index: 50;
}
.toast {
  background: var(--panel2);
  border-radius: 8px;
  padding: .6em 1em;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.toast.error { background: var(--danger); }

.error-text { color: #ff8a80; }
