:root {
  --bg: #0b0d0e;
  --panel: #151719;
  --panel-2: #202326;
  --felt: #115b2a;
  --felt-light: #1f8a42;
  --rail: #222326;
  --rail-edge: #060707;
  --gold: #e0a72f;
  --chip: #db3d35;
  --blue: #3a9ed8;
  --green: #5dd884;
  --text: #f3f4ef;
  --muted: #9da7a6;
  --line: rgba(255,255,255,.12);
  --shadow: 0 22px 70px rgba(0,0,0,.44);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; background: var(--bg); }
body { margin: 0; color: var(--text); font-family: Inter, system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }

.landing {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: clamp(32px, 7vw, 90px);
  padding: clamp(28px, 6vw, 86px);
  background:
    radial-gradient(circle at 20% 18%, rgba(31,138,66,.32), transparent 34%),
    radial-gradient(circle at 72% 80%, rgba(224,167,47,.16), transparent 30%),
    linear-gradient(130deg, #090a0b, #171a1d 62%, #090a0b);
}

.brand { max-width: 720px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(76px, 13vw, 180px);
  line-height: .8;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 8px 30px rgba(0,0,0,.38);
}
.tagline {
  max-width: 560px;
  margin: 34px 0 0;
  color: #d4dad5;
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.35;
  font-weight: 600;
}

.entry-panel {
  padding: 28px;
  background: rgba(21,23,25,.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
label { display: block; color: #dce3df; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
label span { display: block; margin-bottom: 8px; }
input {
  width: 100%;
  height: 54px;
  padding: 0 15px;
  color: var(--text);
  background: #0c0e0f;
  border: 1px solid #3a3e42;
  border-radius: 6px;
  outline: none;
  font-weight: 800;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(224,167,47,.13); }
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.primary, .secondary, .danger, .rebuy, .controls button {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  color: white;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.primary { width: 100%; margin-top: 18px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(180deg, #e13f35, #a91f1b); }
.secondary { background: #2e3437; }
.danger { width: 100%; background: #8f2420; }
.rebuy { width: 100%; background: #0f7f3d; }
.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.join-row { display: grid; grid-template-columns: 1fr 100px; gap: 10px; }
#room-code { font-family: "Barlow Condensed", sans-serif; font-size: 26px; letter-spacing: .18em; text-transform: uppercase; }
.error { min-height: 20px; margin: 12px 0 0; color: #ff817a; font-size: 13px; font-weight: 700; }

.game { min-height: 100vh; display: grid; grid-template-columns: 1fr 330px; background: radial-gradient(circle at 50% 30%, #1c1e20, #080909 72%); }
.topbar {
  grid-column: 1 / -1;
  height: 68px;
  padding: 0 clamp(16px, 4vw, 42px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8,9,9,.86);
  backdrop-filter: blur(14px);
}
.logo { color: white; text-decoration: none; font-family: "Barlow Condensed", sans-serif; font-size: 34px; font-weight: 900; text-transform: uppercase; }
.room-pill { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.room-pill button { margin-left: 8px; padding: 8px 12px; color: white; background: #111315; border: 1px solid var(--line); border-radius: 6px; font-weight: 900; letter-spacing: .14em; }
.connection { font-family: "Barlow Condensed", sans-serif; font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.connection i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(93,216,132,.12); }
.connection.offline i { background: #e54d46; box-shadow: 0 0 0 5px rgba(229,77,70,.12); }

.table-shell { min-width: 0; padding: clamp(14px, 2vw, 28px); }
.score-strip {
  max-width: 1100px;
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.score-strip div {
  min-height: 58px;
  padding: 10px 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
}
.score-strip span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.score-strip b { display: block; margin-top: 2px; color: white; font-family: "Barlow Condensed", sans-serif; font-size: 28px; line-height: 1; }

.felt-stage {
  position: relative;
  height: min(72vh, 650px);
  min-height: 520px;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}
.rail {
  position: absolute;
  width: min(92%, 980px);
  aspect-ratio: 2.15 / 1;
  border-radius: 999px;
  background: linear-gradient(180deg, #303235, #151719 64%, #080909);
  box-shadow: inset 0 22px 30px rgba(255,255,255,.05), inset 0 -18px 26px rgba(0,0,0,.8), 0 30px 60px rgba(0,0,0,.56);
}
.felt {
  position: relative;
  width: min(82%, 860px);
  aspect-ratio: 2.05 / 1;
  border-radius: 999px;
  overflow: visible;
  background:
    radial-gradient(ellipse at center, rgba(31,138,66,.85), rgba(17,91,42,.9) 56%, rgba(7,52,23,.96)),
    var(--felt);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 0 60px rgba(0,0,0,.45);
}
.felt::after {
  content: "";
  position: absolute;
  inset: 36px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: inherit;
  pointer-events: none;
}
.center-pot {
  position: absolute;
  left: 50%;
  top: 31%;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 5px 16px;
  color: #ffd25a;
  background: rgba(0,0,0,.3);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.community {
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: 3;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(5, clamp(48px, 6vw, 72px));
  gap: clamp(6px, 1vw, 10px);
}
.card, .mini-card {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: start;
  justify-items: start;
  background: #f8f7f1;
  color: #111;
  border-radius: 6px;
  box-shadow: 0 5px 10px rgba(0,0,0,.34);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
}
.card { width: clamp(48px, 6vw, 72px); aspect-ratio: .72 / 1; padding: 6px; font-size: clamp(22px, 3vw, 34px); }
.mini-card { width: 36px; height: 50px; padding: 4px; font-size: 20px; }
.card i, .mini-card i { align-self: end; font-style: normal; font-size: .82em; }
.red { color: #d12525; }
.black { color: #111; }
.slot { opacity: .23; background: rgba(255,255,255,.22); border: 1px dashed rgba(255,255,255,.32); box-shadow: none; }
.back {
  display: block;
  background:
    linear-gradient(135deg, rgba(255,255,255,.2) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(135deg, transparent 75%, rgba(255,255,255,.18) 75%) 0 0 / 10px 10px,
    #1d5c9c;
  border: 2px solid #e8eef5;
}

.seats { position: absolute; inset: 0; pointer-events: none; }
.seat {
  position: absolute;
  width: 190px;
  min-height: 112px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  align-items: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.seat-0 { left: 50%; top: 104%; }
.seat-1 { left: 18%; top: 83%; }
.seat-2 { left: 4%; top: 50%; }
.seat-3 { left: 18%; top: 16%; }
.seat-4 { left: 50%; top: -4%; }
.seat-5 { left: 82%; top: 16%; }
.seat-6 { left: 96%; top: 50%; }
.seat-7 { left: 82%; top: 83%; }
.seat-8 { left: 50%; top: 10%; }
.avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: linear-gradient(145deg, #3a3f44, #101214);
  color: white;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 25px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0,0,0,.46);
}
.player-pod {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(7,8,8,.7);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.seat.me .player-pod { border-color: rgba(224,167,47,.65); box-shadow: 0 0 0 4px rgba(224,167,47,.1), 0 8px 20px rgba(0,0,0,.3); }
.seat.active .avatar { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(224,167,47,.2), 0 8px 20px rgba(0,0,0,.46); }
.seat.folded { opacity: .58; }
.pod-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pod-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.stack { color: var(--blue); font-weight: 900; white-space: nowrap; }
.hole { display: flex; gap: 5px; min-height: 54px; margin: 5px 0; }
.meta-line { min-height: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.dealer-chip, .blind-chip {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #111;
  background: var(--gold);
  border: 2px solid #8e5e10;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  font-weight: 900;
}
.blind-chip { width: auto; padding: 0 5px; border-radius: 999px; background: #dfe8ec; }
.host-tag { padding: 2px 5px; border-radius: 999px; color: #111; background: var(--gold); text-transform: uppercase; }
.offline-dot { width: 9px; height: 9px; border-radius: 50%; background: #e54d46; }
.bet-chip {
  position: absolute;
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  padding: 5px 11px;
  color: white;
  background: #b92a2a;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(0,0,0,.32);
}

.side-panel {
  min-height: calc(100vh - 68px);
  padding: 20px;
  background: rgba(10,11,12,.88);
  border-left: 1px solid rgba(255,255,255,.08);
}
.status-message {
  margin: 0 0 16px;
  padding: 15px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: #e9efe9;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}
.controls { display: grid; gap: 10px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.controls button { background: #2a3033; }
.controls button:hover:not(:disabled), .secondary:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.action-grid button:nth-child(1) { background: #432626; }
.action-grid button:nth-child(2) { background: #24313a; }
.action-grid button:nth-child(3) { background: #1f633d; }
.action-grid button:nth-child(4) { background: #a82420; }
.raise-row { display: grid; grid-template-columns: 1fr 118px; gap: 8px; }
.raise-row button { background: var(--gold); color: #111; }
.timer-controls, .timer-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
}
.timer-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timer-heading span, .timer-status span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.timer-heading strong, .timer-status strong {
  color: white;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 28px;
  line-height: 1;
}
.timer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: #dce3df;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
}
.timer-toggle input { width: auto; height: auto; accent-color: var(--gold); }
.timer-row { display: grid; grid-template-columns: 1fr 98px; gap: 8px; }
.timer-row button { background: var(--gold); color: #111; font-size: 18px; }
.timer-status {
  grid-template-columns: 1fr auto;
  align-items: center;
  border-color: rgba(224,167,47,.36);
  background: rgba(124,77,20,.18);
}
.timer-status strong.urgent { color: #ff817a; }
.blind-controls {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
}
.blind-controls span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.blind-controls strong {
  display: block;
  margin-top: 2px;
  color: white;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 28px;
  line-height: 1;
}
.blind-controls > button { background: #7c4d14; }
.blind-edit-row { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.blind-edit-row button { background: var(--gold); color: #111; font-size: 18px; }
.hint { margin: 0; padding: 12px 14px; color: var(--muted); background: rgba(255,255,255,.045); border-radius: 8px; font-size: 13px; font-weight: 700; }
.standings {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.standings h2 { margin: 0 0 12px; font-family: "Barlow Condensed", sans-serif; font-size: 30px; text-transform: uppercase; }
.standings ul { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; }
.standings li { color: #f4f0df; font-size: 13px; font-weight: 800; }
.standings li span { display: block; color: var(--muted); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
td:nth-child(3), td:nth-child(4), th:nth-child(3), th:nth-child(4) { text-align: right; }

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -140%);
  max-width: min(520px, calc(100vw - 24px));
  padding: 12px 16px;
  color: white;
  background: #b92a2a;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 800;
  transition: .2s ease;
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .game { grid-template-columns: 1fr; }
  .side-panel { min-height: auto; border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .felt-stage { height: 620px; }
}

@media (max-width: 760px) {
  .landing { grid-template-columns: 1fr; padding: 24px; }
  .entry-panel { padding: 20px; }
  .money-grid { grid-template-columns: 1fr; }
  .topbar { height: auto; min-height: 64px; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
  .score-strip { grid-template-columns: 1fr 1fr 1fr; }
  .score-strip b { font-size: 22px; }
  .table-shell { padding: 12px 8px; overflow-x: hidden; }
  .felt-stage {
    height: 790px;
    min-height: 0;
    max-width: 100%;
    display: block;
    padding-bottom: 6px;
  }
  .rail {
    left: 50%;
    top: 0;
    width: min(96vw, 430px);
    aspect-ratio: 1.42 / 1;
    transform: translateX(-50%);
  }
  .felt {
    width: min(82vw, 365px);
    aspect-ratio: 1.28 / 1;
    margin: 18px auto 0;
  }
  .felt::after { inset: 18px; }
  .center-pot {
    top: 27%;
    max-width: calc(100% - 28px);
    padding: 4px 12px;
    font-size: 13px;
  }
  .community {
    top: 52%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(72vw, 315px);
    gap: 5px;
  }
  .card {
    width: 100%;
    min-width: 0;
    max-width: 58px;
    justify-self: center;
    font-size: clamp(20px, 6.2vw, 28px);
  }
  .seats {
    position: absolute;
    inset: auto;
    left: 50%;
    top: calc(100% + 24px);
    z-index: 4;
    width: min(100vw - 16px, 430px);
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: auto;
  }
  .seat,
  .seat-0,
  .seat-1,
  .seat-2,
  .seat-3,
  .seat-4,
  .seat-5,
  .seat-6,
  .seat-7,
  .seat-8 {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    min-height: 86px;
    transform: none;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 6px;
  }
  .seat.me {
    grid-column: 1 / -1;
    order: -1;
  }
  .avatar { width: 38px; height: 38px; font-size: 19px; }
  .player-pod { padding: 7px; }
  .pod-line { padding-right: 58px; }
  .pod-line strong { font-size: 13px; }
  .stack { flex: 0 0 auto; font-size: 13px; }
  .hole { min-height: 42px; gap: 4px; margin: 4px 0; }
  .mini-card { width: 30px; height: 42px; font-size: 17px; }
  .meta-line { min-height: 18px; font-size: 10px; }
  .dealer-chip, .blind-chip { height: 19px; min-width: 19px; font-size: 11px; }
  .bet-chip {
    left: auto;
    right: 8px;
    top: -8px;
    transform: none;
    padding: 4px 9px;
    font-size: 11px;
  }
  .side-panel { padding: 14px; }
}
