:root {
  --bg: #07110e;
  --felt: #0f2a20;
  --felt-2: #14382b;
  --panel: #0c1b15;
  --panel-2: #10251c;
  --line: #28483a;
  --text: #f4efe3;
  --muted: #9bb0a3;
  --gold: #e7c46a;
  --gold-2: #c9a84e;
  --green: #69d18c;
  --red: #ff7b72;
  --blue: #7fb7ff;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 50% -10%, #1b4a36 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #122b22 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

body { min-height: 100vh; }

button, input { font: inherit; }

button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #17362a;
  color: var(--text);
  padding: 9px 14px;
  cursor: pointer;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
button:hover { background: #1d4435; border-color: #3c6b54; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.armed {
  outline: 2px solid #fff3c4;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(231, 196, 106, .18);
  touch-action: manipulation;
}

button.primary {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  border-color: #f3da96;
  color: #1b1608;
  font-weight: 700;
}
button.primary:hover { background: linear-gradient(180deg, #f0d27e, #d4b258); }
button.secondary { background: #143226; }
button.danger { background: #4a1f1c; border-color: #7a3330; color: #ffd7d3; }
button.tiny { padding: 3px 7px; font-size: 12px; border-radius: 6px; }
button.wide { width: 100%; }

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #081510;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 196, 106, .12); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 18px; font-size: 13px; }

.screen { min-height: 100vh; }

/* Lobby */
.lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 40px;
  gap: 22px;
}
.brand { text-align: center; }
.logo {
  width: 64px; height: 64px; margin: 0 auto 10px;
  display: grid; place-items: center;
  font-size: 38px; color: var(--gold);
  border: 1px solid #3e604e; border-radius: 18px;
  background: #0b1d15;
  box-shadow: var(--shadow);
}
.brand h1 { margin: 0; font-size: 30px; letter-spacing: .06em; }
.brand .sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.panel {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(16, 37, 28, .96), rgba(9, 22, 16, .96));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.field { display: block; margin-bottom: 13px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.avatar-field > span {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.avatar-field > span small { color: #789183; font-size: 10px; font-weight: 400; }
.avatar-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px;
}
.avatar-choice {
  position: relative; padding: 0; overflow: hidden;
  aspect-ratio: 1; border-radius: 10px;
  border: 1px solid #315846; background: #091912;
  line-height: 1;
}
.avatar-choice img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.avatar-choice .avatar-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 13px 2px 4px; text-align: center;
  font-size: 10px; font-weight: 600; color: #fff8e9;
  background: linear-gradient(transparent, rgba(2, 8, 5, .88));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.avatar-choice.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(231, 196, 106, .3);
}
.avatar-choice:disabled {
  opacity: .34; filter: grayscale(.8); cursor: not-allowed;
}
.avatar-choice .avatar-used {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #ffd9b0; background: rgba(5, 10, 7, .35);
  font-size: 11px; font-weight: 700;
  text-shadow: 0 1px 3px #000;
}
.divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px; margin: 20px 0 14px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.disclaimer {
  width: min(520px, 100%);
  margin: 0; text-align: center;
  color: #7f9689; font-size: 12px; line-height: 1.7;
}

/* Room */
.room { padding: 14px; }
.room-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; max-width: 1280px; margin: 0 auto 12px;
}
.room-brand {
  font-size: 16px; font-weight: 700; color: var(--gold);
  letter-spacing: .05em; white-space: nowrap;
}
.room-brand small { color: var(--muted); font-size: 10px; font-weight: 400; margin-left: 4px; }
.room-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-id b { font-size: 18px; letter-spacing: .12em; color: var(--gold); }
#leaveBtn { margin-left: 2px; }
.conn { font-size: 12px; color: var(--muted); }
.conn.ok { color: var(--green); }

.layout {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px;
  align-items: start;
}

.table-surface { display: contents; }

.table-wrap {
  min-width: 0;
  background:
    radial-gradient(900px 420px at 50% 20%, #1a4a36 0%, transparent 62%),
    linear-gradient(180deg, var(--felt-2), var(--felt));
  border: 1px solid #2c5a43;
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.seats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.seat {
  min-height: 150px;
  background: rgba(4, 14, 10, .58);
  border: 1px solid #2b4c3c;
  border-radius: 14px;
  padding: 9px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.seat.empty {
  min-height: 150px;
  border-style: dashed;
  display: grid; place-items: center;
  color: #5f7b6c; font-size: 13px;
}
.seat.you { border-color: #4e8f6c; }
.seat.actor {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(231, 196, 106, .16);
}
.seat.folded { opacity: .48; }
.seat.sitting-out { opacity: .72; }
.seat-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.seat-avatar {
  display: block;
  width: calc(100% + 12px);
  height: 72px;
  margin: -6px -6px 3px;
  border-radius: 9px 9px 0 0;
  object-fit: cover;
  object-position: center 32%;
  background: #0c2118;
  border: 0;
  border-bottom: 2px solid rgba(231, 196, 106, .5);
  box-shadow: none;
  pointer-events: none;
}
.seat.hero .seat-avatar {
  height: 84px;
  border-radius: 9px 9px 0 0;
}
.seat-avatar-fallback,
.avatar-fallback {
  display: grid; place-items: center; color: var(--gold);
  font-size: 10px; font-weight: 700; background: #0c2118;
}
.seat-no {
  flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center;
  border-radius: 50%; background: #1d3b2d; color: #b9cfc2; font-size: 11px;
}
.seat-name {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600; font-size: 13px;
}
.badge {
  flex: 0 0 auto; font-size: 10px; padding: 1px 5px; border-radius: 999px;
  background: #3b3320; color: var(--gold); border: 1px solid #6b5a2d;
}
.badge.host { background: #203a2c; color: #b7e1c5; border-color: #3b6b50; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #5a6f63; flex: 0 0 auto; }
.dot.on { background: var(--green); box-shadow: 0 0 6px rgba(105, 209, 140, .8); }
.dot.off { background: #6b4a46; }

.seat-cards {
  display: flex; align-items: center; gap: 4px; min-height: 58px;
  flex-wrap: wrap;
}
.no-cards { color: #6d8677; font-size: 12px; }

.card {
  position: relative;
  width: 38px; height: 54px; border-radius: 5px;
  background: #f7f2e5; color: #17130c;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; border: 1px solid #d8d0bd;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  user-select: none;
}
.card .rank { font-size: 15px; font-weight: 800; }
.card .suit { font-size: 17px; margin-top: 2px; }
.card.red { color: #c22a2a; }
.card.black { color: #17130c; }
.card.back {
  background:
    repeating-linear-gradient(45deg, #173d2d 0 4px, #123326 4px 8px);
  border-color: #2e624a;
  box-shadow: inset 0 0 0 3px #0c2118;
}
.card.hole {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  box-shadow: 0 0 14px rgba(231, 196, 106, .25);
}
.hole-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 15px; height: 15px; padding: 0 3px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--gold); color: #1b1608;
  font-size: 10px; font-weight: 800;
  border: 1px solid #fff0bd;
}

.seat-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; font-size: 11px; color: #b6c9bd; }

.score-flip {
  height: 22px; margin-top: 1px; cursor: pointer;
  perspective: 500px;
  user-select: none;
}
.score-flip-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .32s ease;
  transform-style: preserve-3d;
}
.score-flip.flipped .score-flip-inner { transform: rotateY(180deg); }
.score-face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 10px; line-height: 1;
  backface-visibility: hidden;
  white-space: nowrap; overflow: hidden;
}
.score-front {
  background: #12291f; border: 1px solid #2a4c3b; color: #93a99c;
}
.score-back {
  transform: rotateY(180deg);
  background: #2a2412; border: 1px solid #6b5a2d; color: var(--gold);
}

.seat-status { font-size: 11px; color: var(--gold); min-height: 14px; }
.seat-status.folded { color: #8c9c92; }

.center {
  margin: 14px 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(3, 12, 8, .62);
  border: 1px solid #2d5842;
  text-align: center;
}
.phase { font-size: 14px; color: #cfe1d6; letter-spacing: .03em; }
.pot { font-size: 15px; color: var(--muted); margin-top: 6px; }
.pot b { font-size: 28px; color: var(--gold); margin-left: 6px; }
.hand-info { font-size: 12px; margin-top: 6px; }
.timer { min-height: 18px; margin-top: 5px; color: var(--gold); font-size: 13px; }
.result {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #2c4f3e;
  color: #f3e6c6; font-size: 13px; line-height: 1.55;
  max-height: 230px; overflow: auto;
}
.result-summary { font-weight: 600; color: #f3e6c6; }
.showdown-list { margin-top: 7px; text-align: left; }
.showdown-row {
  display: grid; grid-template-columns: 1.1fr 1.4fr auto;
  gap: 8px; align-items: center;
  padding: 4px 6px; border-radius: 6px;
  font-size: 11px; color: #b9cec1;
}
.showdown-row + .showdown-row { border-top: 1px dashed rgba(60, 95, 76, .28); }
.showdown-row.winner { background: rgba(231, 196, 106, .09); color: #f4e3b8; }
.showdown-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showdown-hand { color: #9fb6a9; }
.showdown-row.winner .showdown-hand { color: #f0d38e; }
.showdown-tag { color: #8ea79a; font-size: 10px; }
.showdown-row.winner .showdown-tag { color: var(--gold); font-weight: 700; }
.seat.winner {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(231, 196, 106, .18);
}

.actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px; border-radius: 14px;
  background: rgba(4, 14, 10, .5);
  border: 1px solid #2a4c3b;
  min-height: 58px;
}
.actions .hint { color: var(--muted); font-size: 13px; }
.actions .hint.warn { color: #f0c98a; }
.bet-stats {
  flex: 1 0 100%;
  padding-bottom: 8px;
  margin-bottom: 2px;
  border-bottom: 1px dashed rgba(60, 95, 76, .35);
  color: #b9cec1;
  font-size: 12px;
}
.bet-stats b { color: var(--gold); font-weight: 600; }
.quick-raise { display: flex; gap: 4px; }
.quick-raise button { padding: 4px 7px; font-size: 11px; }
.vote-counts { flex: 1 0 100%; font-size: 12px; color: var(--muted); }
.request-card {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #3b5c49;
  border-radius: 10px;
  background: rgba(18, 42, 31, .75);
  font-size: 12px;
  color: #d9e8de;
}
.request-card .request-actions { display: flex; gap: 6px; margin-left: auto; }
.request-avatar {
  width: 24px; height: 24px; border-radius: 6px; object-fit: cover;
  border: 1px solid #3d6b53; flex: 0 0 auto;
}
.raise-box {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 10px;
  background: #0a1a13;
}
.raise-box input[type="range"] { width: 120px; accent-color: var(--gold); }
.raise-box .raise-label { font-size: 12px; color: #d8e6dc; min-width: 58px; }

/* Side panels */
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side-box {
  background: rgba(9, 23, 16, .92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  min-width: 0;
}
.side-box h3 { margin: 0 0 8px; font-size: 13px; color: #c7dbcf; font-weight: 600; }
.scroll { overflow-y: auto; overscroll-behavior: contain; }
.log { height: 210px; font-size: 12px; line-height: 1.55; color: #a9bfb2; }
.log .line { padding: 2px 0; border-bottom: 1px dashed rgba(60, 95, 76, .25); }
.history { height: 120px; font-size: 12px; line-height: 1.55; color: #a9bfb2; }
.history .line { padding: 2px 0; border-bottom: 1px dashed rgba(60, 95, 76, .25); }
.chat { height: 180px; font-size: 12px; line-height: 1.55; }
.chat .line { padding: 3px 0; display: flex; align-items: flex-start; gap: 5px; }
.chat-avatar {
  width: 18px; height: 18px; border-radius: 4px; object-fit: cover;
  border: 1px solid #355d48; flex: 0 0 auto; margin-top: 1px;
}
.chat .who { color: var(--gold); margin-right: 2px; flex: 0 0 auto; }
.chat-text { min-width: 0; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { padding: 7px 9px; font-size: 12px; }
.chat-form button { padding: 7px 10px; font-size: 12px; }

/* Seat change modal */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #3b5c49;
  background: linear-gradient(180deg, #10271c, #081710);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}
.modal-card h3 { margin: 0 0 6px; color: var(--gold); font-size: 18px; }
.modal-note { margin: 0 0 14px; font-size: 12px; line-height: 1.5; }
.seat-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.seat-choice {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px; border-radius: 10px; font-size: 12px;
  background: #123326; border: 1px solid #3b5c49;
}
.seat-choice small { color: var(--muted); font-size: 10px; }
.seat-choice:disabled { opacity: .55; }
.seat-choice.current { border-color: var(--gold); }
.seat-choice.free { border-style: dashed; }
.modal-card .wide { margin-top: 2px; }
.ledger-card { width: min(560px, 100%); }
.ledger-rows {
  display: flex; flex-direction: column;
  max-height: 430px; overflow: auto;
  margin-bottom: 12px;
}
.ledger-row {
  display: grid; grid-template-columns: 1.5fr .7fr .8fr .55fr .8fr;
  gap: 6px; align-items: center;
  padding: 6px 4px; font-size: 12px;
  border-bottom: 1px dashed rgba(60, 95, 76, .28);
}
.ledger-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.ledger-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-avatar {
  width: 20px; height: 20px; border-radius: 5px; object-fit: cover;
  border: 1px solid #355d48; flex: 0 0 auto;
}
.ledger-head { color: var(--muted); font-size: 10px; border-bottom-color: #3b5c49; }
.ledger-row small { color: var(--muted); font-size: 10px; }
.ledger-row .positive { color: #8fe0a8; }
.ledger-row .negative { color: #ff9d94; }
.ledger-total {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #3b5c49;
  color: #cfe1d6; font-size: 12px;
}
.ledger-total.warn { color: #ffb2a8; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%);
  z-index: 50; max-width: min(520px, 92vw);
  padding: 10px 14px; border-radius: 10px;
  background: #241a10; border: 1px solid #7a5a2c; color: #ffe6b8;
  box-shadow: var(--shadow); font-size: 13px;
}

@media (max-width: 1200px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .room-brand { display: none; }
}

@media (max-width: 800px) {
  .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .room { padding: 8px; }
  .room-header { margin-bottom: 8px; }
  .table-wrap { border-radius: 14px; padding: 8px; }
  .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .seat, .seat.empty { min-height: 128px; padding: 7px; }
  .card { width: 31px; height: 45px; }
  .card .rank { font-size: 13px; }
  .card .suit { font-size: 14px; }
  .seat-cards { min-height: 48px; }
  .center { margin: 9px 0; padding: 10px; }
  .pot b { font-size: 22px; }
  .actions {
    position: sticky; bottom: 0; z-index: 10;
    background: rgba(5, 16, 11, .96);
    backdrop-filter: blur(6px);
    padding: 8px;
    gap: 6px;
  }
  .actions button { flex: 1 1 auto; min-width: 88px; padding: 10px 8px; }
  .raise-box { flex: 1 1 100%; }
  .raise-box input[type="range"] { flex: 1 1 auto; width: auto; }
  .side { grid-template-columns: 1fr; }
  .log { height: 150px; }
  .history { height: 110px; }
  .chat { height: 130px; }
}

/* ---------------------------------------------------------------------------
   Desktop oval table (the mobile/tablet grid above remains unchanged)
   --------------------------------------------------------------------------- */
@media (min-width: 820px) {
  .room { padding: 12px 18px 18px; }
  .room-header {
    max-width: 1400px;
    margin-bottom: 10px;
  }
  .layout {
    max-width: 1400px;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    height: calc(100vh - 82px);
    min-height: 760px;
    align-items: stretch;
  }
  .table-wrap {
    position: relative;
    height: 100%;
    min-height: 760px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .table-surface {
    display: block;
    position: absolute;
    left: 50%;
    top: 43%;
    transform: translate(-50%, -50%);
    width: min(980px, 92%);
    aspect-ratio: 1.9;
    border-radius: 50%;
    background:
      radial-gradient(ellipse at 50% 38%, #22664b 0%, #154433 46%, #0b2a1e 78%, #071b13 100%);
    border: 13px solid #3b2a18;
    box-shadow:
      0 0 0 2px #8f6e39,
      0 0 0 7px #24180d,
      0 26px 65px rgba(0, 0, 0, .55),
      inset 0 0 80px rgba(0, 0, 0, .5);
  }
  .table-surface::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(231, 196, 106, .24);
    box-shadow: inset 0 0 55px rgba(0, 0, 0, .28);
    pointer-events: none;
  }
  .table-surface::after {
    content: "♠";
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    font-size: 170px;
    color: rgba(231, 196, 106, .055);
    pointer-events: none;
  }

  .seats {
    position: absolute;
    inset: 0;
    display: block;
  }
  .seat {
    position: absolute;
    width: 140px;
    min-height: 0;
    padding: 6px;
    gap: 4px;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, rgba(12, 31, 22, .97), rgba(5, 15, 10, .98));
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .36);
    z-index: 3;
  }
  .seat.empty {
    min-height: 104px;
    width: 128px;
    font-size: 11px;
    background: rgba(6, 20, 13, .4);
    border-color: #345846;
  }
  .seat.you { border-color: #5d9b76; }
  .seat.actor, .seat.winner {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(231, 196, 106, .18);
  }
  .seat[data-pos] {
    left: var(--seat-left, 50%);
    top: var(--seat-top, 50%);
  }
  .seat.hero { width: 178px; }

  .seat-no { width: 18px; height: 18px; font-size: 10px; }
  .seat-name { font-size: 12px; }
  .seat-top { gap: 4px; }
  .badge { font-size: 9px; padding: 0 4px; }
  .seat-cards { min-height: 35px; gap: 2px; flex-wrap: nowrap; }
  .card { width: 23px; height: 33px; border-radius: 4px; }
  .card .rank { font-size: 10px; }
  .card .suit { font-size: 11px; }
  .hole-badge { min-width: 13px; height: 13px; font-size: 8px; top: -5px; right: -5px; }
  .seat.hero .card { width: 30px; height: 43px; }
  .seat.hero .card .rank { font-size: 13px; }
  .seat.hero .card .suit { font-size: 14px; }
  .seat.hero .seat-cards { min-height: 46px; }
  .seat-meta { gap: 3px 7px; font-size: 9.5px; }
  .score-flip { height: 19px; }
  .score-face { font-size: 9px; }
  .seat-status { font-size: 9.5px; min-height: 12px; }

  .center {
    position: absolute;
    left: 50%;
    top: 44%;
    transform: translate(-50%, -50%);
    width: 340px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    text-align: center;
    z-index: 2;
  }
  .phase { font-size: 13px; }
  .pot { font-size: 12px; margin-top: 4px; }
  .pot b { font-size: 34px; }
  .hand-info { font-size: 10px; margin-top: 4px; }
  .timer { font-size: 11px; margin-top: 4px; }
  .result {
    max-height: 230px;
    padding: 10px 12px;
    border: 1px solid #2d5842;
    border-radius: 12px;
    background: rgba(3, 12, 8, .72);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  }

  .actions {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    width: min(980px, 94%);
    z-index: 8;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  }

  .side {
    height: 100%;
    min-height: 760px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
  }
  .side-box { flex: 0 0 auto; }
  .side-box:first-child { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .side-box:first-child .log { flex: 1 1 auto; height: auto; min-height: 150px; }
  .log { height: 210px; }
  .history { height: 126px; }
  .chat { height: 150px; }
}

/* Tablet / narrow desktop: same oval table, side panels below. */
@media (min-width: 820px) and (max-width: 1279px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    align-items: stretch;
  }
  .table-wrap { height: 680px; min-height: 0; }
  .table-surface { width: min(760px, 92%); }
  .seat { width: 110px; }
  .seat.hero { width: 148px; }
  .seat-avatar {
    height: 58px;
    margin: -6px -6px 2px;
    border-radius: 7px 7px 0 0;
  }
  .seat.hero .seat-avatar {
    height: 68px;
    border-radius: 7px 7px 0 0;
  }
  .seat-cards { min-height: 30px; gap: 1px; }
  .card { width: 18px; height: 27px; }
  .card .rank { font-size: 8px; }
  .card .suit { font-size: 9px; }
  .seat.hero .card { width: 24px; height: 34px; }
  .seat.hero .seat-cards { min-height: 36px; }
  .seat-meta { font-size: 8.5px; }
  .score-flip { height: 16px; }
  .score-face { font-size: 8px; }
  .seat-status { font-size: 8.5px; }
  .center { width: 300px; }
  .actions { position: absolute; width: 94%; bottom: 8px; }
  .side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: auto;
    min-height: 0;
  }
  .side-box:first-child { display: block; }
  .side-box:first-child .log { height: 180px; }
  .log { height: 180px; }
  .history { height: 120px; }
  .chat { height: 150px; }
}

/* Phone: compact vertical oval, fixed action bar, side panels below. */
@media (max-width: 819px) {
  .room { padding: 8px 8px 112px; }
  .room-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 4px;
    margin-bottom: 6px;
  }
  .room-id { grid-column: 1; gap: 4px; }
  .room-id b { font-size: 15px; }
  .room-id .tiny { padding: 2px 5px; font-size: 10px; }
  .conn {
    grid-column: 2;
    grid-row: 1;
    padding-top: 4px;
    font-size: 9px;
    white-space: nowrap;
  }
  .layout {
    display: block;
    max-width: none;
    height: auto;
    min-height: 0;
  }
  .table-wrap {
    position: relative;
    height: calc(min(520px, 92vw) / 0.72 + 32px);
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  .table-surface {
    display: block;
    position: absolute;
    left: 50%;
    top: 4px;
    transform: translateX(-50%);
    width: min(520px, 92vw);
    aspect-ratio: .72;
    border-radius: 50%;
    background:
      radial-gradient(ellipse at 50% 40%, #22664b 0%, #154433 46%, #0b2a1e 78%, #071b13 100%);
    border: 9px solid #3b2a18;
    box-shadow:
      0 0 0 2px #8f6e39,
      0 0 0 5px #24180d,
      0 16px 38px rgba(0, 0, 0, .5),
      inset 0 0 55px rgba(0, 0, 0, .5);
  }
  .table-surface::before {
    content: "";
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    border: 1.2px solid rgba(231, 196, 106, .24);
  }
  .table-surface::after {
    content: "♠";
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: rgba(231, 196, 106, .055);
  }
  .seats { position: absolute; inset: 0; display: block; }
  .seat {
    position: absolute;
    width: 82px;
    min-height: 0;
    padding: 4px;
    gap: 2px;
    transform: translate(-50%, -50%);
    background: linear-gradient(180deg, rgba(12, 31, 22, .97), rgba(5, 15, 10, .98));
    border-radius: 7px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, .36);
    z-index: 3;
  }
  .seat[data-pos] {
    left: var(--seat-left, 50%);
    top: var(--seat-top, 50%);
  }
  .seat.hero { width: 116px; padding: 5px; }
  .seat-avatar {
    width: calc(100% + 8px);
    height: 42px;
    margin: -4px -4px 2px;
    border-radius: 5px 5px 0 0;
  }
  .seat.hero .seat-avatar {
    height: 50px;
    border-radius: 5px 5px 0 0;
  }
  .seat-head { gap: 2px; }
  .avatar { width: 16px; height: 16px; font-size: 7px; }
  .hero .avatar { width: 20px; height: 20px; font-size: 8px; }
  .seat-name { font-size: 8px; }
  .seat-no { width: 15px; height: 15px; font-size: 7px; }
  .badge { font-size: 7px; padding: 0 3px; }
  .seat-cards { min-height: 19px; gap: 1px; flex-wrap: nowrap; }
  .card { width: 12px; height: 17px; border-radius: 2px; }
  .card .rank { font-size: 7px; }
  .card .suit { font-size: 8px; }
  .hole-badge { min-width: 9px; height: 9px; font-size: 6px; top: -3px; right: -3px; }
  .seat.hero .card { width: 18px; height: 25px; }
  .seat.hero .card .rank { font-size: 8px; }
  .seat.hero .card .suit { font-size: 9px; }
  .seat.hero .seat-cards { min-height: 27px; }
  .seat-meta { font-size: 7px; gap: 2px 4px; }
  .score-flip { height: 15px; }
  .score-face { font-size: 7px; }
  .seat-status { font-size: 7.5px; min-height: 10px; }
  .center {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: 220px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    text-align: center;
    z-index: 2;
  }
  .phase { font-size: 9px; }
  .pot { font-size: 9px; margin-top: 3px; }
  .pot b { font-size: 21px; }
  .hand-info { font-size: 7.5px; margin-top: 2px; }
  .timer { font-size: 8px; margin-top: 3px; min-height: 12px; }
  .result {
    margin-top: 6px;
    padding: 7px;
    max-height: 150px;
    border: 1px solid #2d5842;
    border-radius: 8px;
    background: rgba(3, 12, 8, .74);
    font-size: 8.5px;
  }
  .showdown-row { font-size: 7.5px; gap: 4px; padding: 2px 3px; }
  .showdown-tag { font-size: 7px; }
  .actions {
    position: fixed;
    left: 6px;
    right: 6px;
    bottom: 6px;
    transform: none;
    width: auto;
    z-index: 30;
    padding: 7px;
    gap: 5px;
    max-height: 160px;
    overflow: auto;
    background: rgba(5, 16, 11, .98);
    border: 1px solid rgba(231, 196, 106, .24);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  }
  .actions button { padding: 7px 8px; font-size: 10px; min-width: 0; }
  .bet-stats { font-size: 9px; padding-bottom: 4px; }
  .raise-box { flex: 1 1 100%; gap: 5px; padding: 4px 6px; }
  .raise-box .raise-label { font-size: 9px; min-width: 50px; }
  .quick-raise button { padding: 3px 5px; font-size: 9px; }
  .side {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    margin-top: 10px;
  }
  .log { height: 160px; }
  .history { height: 100px; }
  .chat { height: 130px; }
}

/* ---------------------------------------------------------------------------
   Player card with a square avatar attached on the left.
   The avatar and the player info share one outer frame, like a horizontal ID card.
   --------------------------------------------------------------------------- */
.seat {
  width: 220px;
  min-height: 0;
  padding: 0;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}
.seat.hero { width: 240px; }
.seat-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.seat-avatar {
  position: static;
  flex: 0 0 100px;
  align-self: center;
  width: 100px;
  height: 100px;
  margin: 0;
  border: 0;
  border-right: 1px solid rgba(231, 196, 106, .45);
  border-radius: 9px 0 0 9px;
  object-fit: cover;
  object-position: center 30%;
  background: #0c2118;
  box-shadow: none;
  pointer-events: none;
}
.seat.hero .seat-avatar {
  flex-basis: 110px;
  width: 110px;
  height: 110px;
}
.seat .seat-top { gap: 4px; }
.seat .seat-no { width: 18px; height: 18px; font-size: 10px; }
.seat .seat-name { font-size: 12px; }
.seat .badge { font-size: 8px; padding: 0 3px; }
.seat .dot { width: 6px; height: 6px; }
.seat .seat-cards { min-height: 27px; gap: 2px; flex-wrap: nowrap; }
.seat .card { width: 18px; height: 26px; border-radius: 3px; }
.seat .card .rank { font-size: 8px; }
.seat .card .suit { font-size: 9px; }
.seat.hero .card { width: 22px; height: 31px; }
.seat.hero .card .rank { font-size: 10px; }
.seat.hero .card .suit { font-size: 11px; }
.seat .hole-badge { min-width: 10px; height: 10px; font-size: 6px; top: -3px; right: -3px; }
.seat .seat-meta { font-size: 8.5px; gap: 2px 5px; }
.seat .score-flip { height: 14px; }
.seat .score-face { font-size: 8px; }
.seat .seat-status { font-size: 8.5px; min-height: 11px; }
.seat .no-cards { font-size: 9px; }

@media (min-width: 820px) and (max-width: 1279px) {
  .seat { width: 180px; }
  .seat.hero { width: 195px; }
  .seat-avatar {
    flex-basis: 84px;
    width: 84px;
    height: 84px;
    border-radius: 8px 0 0 8px;
  }
  .seat.hero .seat-avatar {
    flex-basis: 92px;
    width: 92px;
    height: 92px;
  }
  .seat-main { padding: 3px 5px; gap: 2px; }
  .seat .seat-no { width: 16px; height: 16px; font-size: 9px; }
  .seat .seat-name { font-size: 10px; }
  .seat .badge { font-size: 7px; }
  .seat .seat-cards { min-height: 23px; gap: 1px; }
  .seat .card { width: 15px; height: 22px; }
  .seat .card .rank { font-size: 7px; }
  .seat .card .suit { font-size: 8px; }
  .seat.hero .card { width: 18px; height: 26px; }
  .seat .seat-meta { font-size: 7.5px; }
  .seat .score-flip { height: 12px; }
  .seat .score-face { font-size: 7px; }
  .seat .seat-status { font-size: 7.5px; min-height: 9px; }
}

@media (max-width: 819px) {
  .seat { width: 142px; }
  .seat.hero { width: 154px; }
  .seat-avatar {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    border-radius: 6px 0 0 6px;
  }
  .seat.hero .seat-avatar {
    flex-basis: 70px;
    width: 70px;
    height: 70px;
  }
  .seat-main { padding: 3px 4px; gap: 1px; }
  .seat .seat-no { width: 14px; height: 14px; font-size: 7px; }
  .seat .seat-name { font-size: 8px; }
  .seat .badge { font-size: 7px; padding: 0 2px; }
  .seat .seat-cards { min-height: 18px; gap: 1px; }
  .seat .card { width: 11px; height: 17px; border-radius: 2px; }
  .seat .card .rank { font-size: 6px; }
  .seat .card .suit { font-size: 7px; }
  .seat.hero .card { width: 13px; height: 19px; }
  .seat .seat-meta { font-size: 6.5px; gap: 1px 3px; }
  .seat .score-flip { height: 11px; }
  .seat .score-face { font-size: 6px; }
  .seat .seat-status { font-size: 6.5px; min-height: 8px; }
  .seat .no-cards { font-size: 7px; }
}


/* Dense 5-8 player tables: keep the side-by-side player card inside the oval. */
@media (min-width: 820px) {
  .seats[data-count="5"] .seat { width: 185px; }
  .seats[data-count="5"] .seat.hero { width: 195px; }
  .seats[data-count="5"] .seat-avatar { flex-basis: 78px; width: 78px; height: 78px; }
  .seats[data-count="5"] .seat.hero .seat-avatar { flex-basis: 82px; width: 82px; height: 82px; }

  .seats[data-count="6"] .seat { width: 170px; }
  .seats[data-count="6"] .seat.hero { width: 180px; }
  .seats[data-count="6"] .seat-avatar { flex-basis: 72px; width: 72px; height: 72px; }
  .seats[data-count="6"] .seat.hero .seat-avatar { flex-basis: 78px; width: 78px; height: 78px; }

  .seats[data-count="7"] .seat { width: 160px; }
  .seats[data-count="7"] .seat.hero { width: 170px; }
  .seats[data-count="7"] .seat-avatar { flex-basis: 68px; width: 68px; height: 68px; }
  .seats[data-count="7"] .seat.hero .seat-avatar { flex-basis: 74px; width: 74px; height: 74px; }

  .seats[data-count="8"] .seat { width: 150px; }
  .seats[data-count="8"] .seat.hero { width: 160px; }
  .seats[data-count="8"] .seat-avatar { flex-basis: 64px; width: 64px; height: 64px; }
  .seats[data-count="8"] .seat.hero .seat-avatar { flex-basis: 70px; width: 70px; height: 70px; }

  .seats[data-count="8"] .seat-main { padding: 3px 4px; gap: 1px; }
  .seats[data-count="8"] .seat .seat-no { width: 15px; height: 15px; font-size: 8px; }
  .seats[data-count="8"] .seat .seat-name { font-size: 9px; }
  .seats[data-count="8"] .seat .badge { font-size: 6.5px; padding: 0 2px; }
  .seats[data-count="8"] .seat .seat-cards { min-height: 20px; gap: 1px; }
  .seats[data-count="8"] .seat .card { width: 12px; height: 18px; }
  .seats[data-count="8"] .seat .card .rank { font-size: 6.5px; }
  .seats[data-count="8"] .seat .card .suit { font-size: 7px; }
  .seats[data-count="8"] .seat.hero .card { width: 14px; height: 20px; }
  .seats[data-count="8"] .seat .seat-meta { font-size: 6.8px; gap: 1px 3px; }
  .seats[data-count="8"] .seat .score-flip { height: 11px; }
  .seats[data-count="8"] .seat .score-face { font-size: 6px; }
  .seats[data-count="8"] .seat .seat-status { font-size: 6.8px; min-height: 8px; }
  .seats[data-count="8"] .seat .no-cards { font-size: 7px; }
}

/* Phone: keep the compact vertical card; the side-by-side card is too wide here. */
@media (max-width: 819px) {
  .seat {
    width: 82px;
    flex-direction: column;
    align-items: stretch;
  }
  .seat.hero { width: 116px; }
  .seat-avatar {
    flex: 0 0 auto;
    width: calc(100% + 8px);
    height: 40px;
    margin: -4px -4px 1px;
    border-right: 0;
    border-bottom: 1px solid rgba(231, 196, 106, .45);
    border-radius: 5px 5px 0 0;
  }
  .seat.hero .seat-avatar {
    width: calc(100% + 10px);
    height: 48px;
    margin: -5px -5px 1px;
    border-radius: 6px 6px 0 0;
  }
  .seat-main { padding: 2px 4px; gap: 1px; }
}

/* v2 player card: square avatar + score column on the left, larger cards on the right. */
.seat { width: 240px; }
.seat.hero { width: 260px; }
.seat-side {
  flex: 0 0 100px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  border-right: 1px solid rgba(231, 196, 106, .45);
  background: #0a1a12;
}
.seat-avatar {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  align-self: auto;
  border: 0;
  border-bottom: 1px solid rgba(231, 196, 106, .45);
  border-radius: 9px 0 0 0;
  object-fit: cover;
  object-position: center 30%;
}
.seat.hero .seat-avatar {
  flex-basis: 110px;
  width: 110px;
  height: 110px;
}
.seat-side .score-flip {
  flex: 1 1 auto;
  width: 100%;
  height: 24px;
  margin: 0;
  min-height: 22px;
}
.seat-side .score-face { font-size: 9px; }
.seat-main { padding: 4px 7px; gap: 3px; }
.seat .card { width: 25px; height: 35px; }
.seat .card .rank { font-size: 10px; }
.seat .card .suit { font-size: 11px; }
.seat.hero .card { width: 28px; height: 39px; }
.seat.hero .card .rank { font-size: 11px; }
.seat.hero .card .suit { font-size: 12px; }
.seat .seat-cards { min-height: 36px; gap: 2px; }
.seat .seat-name { font-size: 12px; }
.seat .seat-meta { font-size: 9px; }
.seat .seat-status { font-size: 9px; min-height: 11px; }

@media (min-width: 820px) and (max-width: 1279px) {
  .seat { width: 190px; }
  .seat.hero { width: 205px; }
  .seat-side { flex-basis: 80px; }
  .seat-avatar { flex-basis: 80px; width: 80px; height: 80px; }
  .seat.hero .seat-avatar { flex-basis: 88px; width: 88px; height: 88px; }
  .seat-side .score-flip { height: 22px; min-height: 20px; }
  .seat-main { padding: 3px 5px; gap: 2px; }
  .seat .card { width: 20px; height: 28px; }
  .seat.hero .card { width: 22px; height: 31px; }
  .seat .seat-cards { min-height: 29px; }
  .seat .seat-name { font-size: 10px; }
  .seat .seat-meta { font-size: 7.5px; }
  .seat .seat-status { font-size: 7.5px; min-height: 9px; }
}

@media (min-width: 820px) {
  .seats[data-count="5"] .seat { width: 220px; }
  .seats[data-count="5"] .seat.hero { width: 230px; }
  .seats[data-count="5"] .seat-side { flex-basis: 88px; }
  .seats[data-count="5"] .seat-avatar { flex-basis: 88px; width: 88px; height: 88px; }
  .seats[data-count="5"] .seat.hero .seat-avatar { flex-basis: 94px; width: 94px; height: 94px; }
  .seats[data-count="5"] .seat .card { width: 21px; height: 29px; }

  .seats[data-count="6"] .seat { width: 210px; }
  .seats[data-count="6"] .seat.hero { width: 220px; }
  .seats[data-count="6"] .seat-side { flex-basis: 82px; }
  .seats[data-count="6"] .seat-avatar { flex-basis: 82px; width: 82px; height: 82px; }
  .seats[data-count="6"] .seat.hero .seat-avatar { flex-basis: 88px; width: 88px; height: 88px; }
  .seats[data-count="6"] .seat .card { width: 20px; height: 28px; }

  .seats[data-count="7"] .seat { width: 200px; }
  .seats[data-count="7"] .seat.hero { width: 210px; }
  .seats[data-count="7"] .seat-side { flex-basis: 76px; }
  .seats[data-count="7"] .seat-avatar { flex-basis: 76px; width: 76px; height: 76px; }
  .seats[data-count="7"] .seat.hero .seat-avatar { flex-basis: 82px; width: 82px; height: 82px; }
  .seats[data-count="7"] .seat .card { width: 19px; height: 27px; }

  .seats[data-count="8"] .seat { width: 190px; }
  .seats[data-count="8"] .seat.hero { width: 200px; }
  .seats[data-count="8"] .seat-side { flex-basis: 70px; }
  .seats[data-count="8"] .seat-avatar { flex-basis: 70px; width: 70px; height: 70px; }
  .seats[data-count="8"] .seat.hero .seat-avatar { flex-basis: 76px; width: 76px; height: 76px; }
  .seats[data-count="8"] .seat-side .score-flip { height: 20px; min-height: 18px; }
  .seats[data-count="8"] .seat-main { padding: 3px 5px; gap: 2px; }
  .seats[data-count="8"] .seat .card { width: 19px; height: 27px; }
  .seats[data-count="8"] .seat.hero .card { width: 20px; height: 28px; }
  .seats[data-count="8"] .seat .card .rank { font-size: 8px; }
  .seats[data-count="8"] .seat .card .suit { font-size: 9px; }
  .seats[data-count="8"] .seat .seat-cards { min-height: 28px; gap: 1px; }
  .seats[data-count="8"] .seat .seat-name { font-size: 9px; }
  .seats[data-count="8"] .seat .seat-meta { font-size: 7px; }
  .seats[data-count="8"] .seat .seat-status { font-size: 7px; min-height: 9px; }
}

@media (max-width: 819px) {
  .seat { width: 120px; flex-direction: row; }
  .seat.hero { width: 132px; }
  .seat-side { flex: 0 0 52px; border-right: 1px solid rgba(231, 196, 106, .4); }
  .seat-avatar {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    border-bottom: 1px solid rgba(231, 196, 106, .4);
    border-radius: 5px 0 0 0;
  }
  .seat.hero .seat-avatar { flex-basis: 58px; width: 58px; height: 58px; }
  .seat-side .score-flip { height: 16px; min-height: 14px; }
  .seat-side .score-face { font-size: 6px; }
  .seat-main { padding: 2px 3px; gap: 1px; }
  .seat .card { width: 10px; height: 15px; }
  .seat .seat-cards { min-height: 17px; gap: 1px; }
  .seat .seat-name { font-size: 7px; }
  .seat .seat-no { width: 13px; height: 13px; font-size: 6px; }
  .seat .badge { font-size: 6px; padding: 0 2px; }
  .seat .seat-meta { font-size: 6px; gap: 1px 2px; }
  .seat .seat-status { font-size: 6px; min-height: 8px; }
  .seat .no-cards { font-size: 6px; }
}

/* Final player-card polish: top info pinned, cards in the middle, status pinned. */
.badge.idle {
  background: #1b2822; color: #a9bbb0; border-color: #3c5146;
}
.seat-main {
  justify-content: space-between;
  gap: 0;
}
.seat .seat-top { flex: 0 0 auto; }
.seat .seat-cards {
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
}
.seat .seat-status {
  flex: 0 0 auto;
  margin-top: 0;
  text-align: center;
}
.seat .card { width: 26px; height: 36px; }
.seat .card .rank { font-size: 10px; }
.seat .card .suit { font-size: 11px; }
.seat.hero .card { width: 28px; height: 39px; }

.seats[data-count="5"] .seat .card { width: 24px; height: 34px; }
.seats[data-count="6"] .seat .card { width: 23px; height: 33px; }
.seats[data-count="7"] .seat .card { width: 23px; height: 32px; }
.seats[data-count="8"] .seat .card { width: 22px; height: 31px; }
.seats[data-count="8"] .seat.hero .card { width: 23px; height: 32px; }
.seats[data-count="8"] .seat .seat-cards { min-height: 0; }
.seats[data-count="8"] .seat .seat-status { min-height: 9px; }

@media (min-width: 820px) and (max-width: 1279px) {
  .seat .card { width: 20px; height: 29px; }
  .seat.hero .card { width: 22px; height: 31px; }
}

@media (max-width: 819px) {
  .seat .card { width: 11px; height: 17px; }
  .seat.hero .card { width: 13px; height: 19px; }
}

/* Keep the 庄/闲 and 房主 badges next to the name; push only the online dot right. */
.seat .seat-name { flex: 0 1 auto; }
.seat .dot { margin-left: auto; }

/* One extra card-size notch, with player cards widened so five cards never overflow. */
.seat { width: 260px; }
.seat.hero { width: 280px; }
.seat .card { width: 27px; height: 38px; }
.seat.hero .card { width: 29px; height: 40px; }

.seats[data-count="5"] .seat { width: 235px; }
.seats[data-count="5"] .seat.hero { width: 245px; }
.seats[data-count="5"] .seat .card { width: 26px; height: 37px; }

.seats[data-count="6"] .seat { width: 225px; }
.seats[data-count="6"] .seat.hero { width: 235px; }
.seats[data-count="6"] .seat .card { width: 25px; height: 36px; }

.seats[data-count="7"] .seat { width: 215px; }
.seats[data-count="7"] .seat.hero { width: 225px; }
.seats[data-count="7"] .seat .card { width: 24px; height: 35px; }

.seats[data-count="8"] .seat { width: 205px; }
.seats[data-count="8"] .seat.hero { width: 215px; }
.seats[data-count="8"] .seat .card { width: 23px; height: 32px; }

@media (min-width: 820px) and (max-width: 1279px) {
  .seat { width: 200px; }
  .seat.hero { width: 215px; }
  .seat .card { width: 20px; height: 29px; }
  .seat.hero .card { width: 22px; height: 31px; }
}

@media (max-width: 819px) {
  .seat { width: 120px; }
  .seat.hero { width: 132px; }
  .seat .card { width: 11px; height: 17px; }
  .seat.hero .card { width: 13px; height: 19px; }
}

/* Personal chip tray + compact right rail. */
.side { gap: 10px; }
.chip-tray-box {
  padding: 10px;
  overflow: hidden;
}
.tray-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.tray-title h3 { margin-bottom: 2px; }
#trayTotal {
  color: #f0cf83;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .02em;
}
.tray-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.tray-actions .tiny { padding: 4px 6px; font-size: 10px; }
.tray-scroll {
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #385b48 #07170f;
  border-radius: 8px;
  margin: 2px -2px 0;
  padding: 0 2px;
}
.tray-scroll::-webkit-scrollbar { width: 6px; }
.tray-scroll::-webkit-scrollbar-track { background: #07170f; }
.tray-scroll::-webkit-scrollbar-thumb { background: #385b48; border-radius: 4px; }
#trayCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: pan-y;
}
.tray-note {
  margin-top: 3px;
  color: #6e897b;
  font-size: 9px;
  text-align: right;
}
.chat-box { padding: 10px; }
.chat-box h3 { margin-bottom: 5px; }
.chat-box .chat { height: 122px; }
.chat-box .chat-form { margin-top: 6px; }
.chat-box .chat-form input { padding: 6px 8px; font-size: 11px; }
.chat-box .chat-form button { padding: 6px 8px; font-size: 11px; }

.info-drawer {
  position: fixed;
  z-index: 75;
  top: 74px;
  right: 18px;
  width: min(360px, calc(100vw - 30px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  border: 1px solid #3f644f;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #10281c, #07150e);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drawer-head b { color: var(--gold); font-size: 15px; }
.drawer-section { margin-top: 12px; }
.drawer-section h3 { margin-bottom: 5px; }
.info-drawer .log { height: 240px; }
.info-drawer .history { height: 170px; }

@media (max-width: 1279px) {
  .tray-scroll { max-height: 430px; }
}
@media (max-width: 819px) {
  .tray-scroll { max-height: 300px; }
  .info-drawer { top: 62px; right: 10px; }
}

/* ---------------------------------------------------------------------------
   Square table + 3x3 ring layout (desktop)
   --------------------------------------------------------------------------- */
@media (min-width: 820px) {
  .table-surface {
    top: 47%;
    width: min(940px, 92%);
    aspect-ratio: 1.65;
    border-radius: 22px;
    border-width: 10px;
    background:
      radial-gradient(ellipse at 50% 42%, #256a4e 0%, #174a36 45%, #0d3022 76%, #071b13 100%);
  }
  .table-surface::before {
    inset: 12px;
    border-radius: 15px;
    border: 1px dashed rgba(231, 196, 106, .24);
  }
  .table-surface::after {
    content: "♠";
    left: 50%;
    top: 48%;
    font-size: 130px;
    color: rgba(231, 196, 106, .05);
  }

  .seats { inset: 0; }

  .seat,
  .seat.hero {
    width: 300px;
    min-height: 0;
    padding: 0;
    gap: 3px;
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translate(-50%, -50%);
    overflow: visible;
    z-index: 5;
  }
  .seat[data-pos] { left: var(--seat-left, 50%); top: var(--seat-top, 50%); }

  .seat-info {
    flex: 0 0 48px;
    width: 48px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 3px 0;
  }
  .seat-info .seat-no {
    width: 16px;
    height: 16px;
    font-size: 9px;
    flex: 0 0 auto;
  }
  .seat-info .seat-name {
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9.5px;
    line-height: 1.1;
  }
  .seat-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
  .seat-tags .badge { font-size: 7px; padding: 0 3px; line-height: 14px; }
  .seat-tags .dot { width: 7px; height: 7px; }

  .seat-side {
    flex: 0 0 60px;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0;
  }
  .seat-avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 3px 10px rgba(0,0,0,.45);
  }
  .score-flip { width: 58px; height: 18px; }
  .score-face { font-size: 8px; }
  .score-front { font-weight: 700; }

  .seat-cards {
    flex: 0 0 auto;
    min-height: 48px;
    padding: 4px 5px;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: center;
    border: 1px dashed rgba(231, 196, 106, .34);
    border-radius: 8px;
    background: rgba(4, 18, 11, .28);
    box-shadow: inset 0 0 12px rgba(0,0,0,.18);
  }
  .seat .card,
  .seat.hero .card {
    width: 28px;
    height: 40px;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,.3);
  }
  .seat .card .rank { font-size: 12px; }
  .seat .card .suit { font-size: 12px; }
  .seat.hero .card .suit { font-size: 13px; }
  .seat-cards .no-cards { font-size: 8px; padding: 0 4px; }

  .seat-status {
    flex: 0 0 18px;
    width: 18px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 1px;
    font-size: 8px;
    line-height: 1;
    color: #9fb5a7;
    border-radius: 5px;
    background: rgba(5, 20, 12, .42);
  }
  .seat.actor .seat-status {
    color: #f0cf83;
    background: rgba(73, 55, 19, .65);
    box-shadow: 0 0 0 1px rgba(231,196,106,.5);
  }
  .seat.actor .seat-avatar {
    box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(231,196,106,.45);
  }
  .seat.actor .seat-cards {
    border-color: rgba(231,196,106,.8);
    background: rgba(39, 43, 23, .3);
  }
  .seat.you .seat-avatar { border: 1px solid rgba(120,210,155,.55); }
  .seat.folded { opacity: .56; }
  .seat.sitting-out { opacity: .6; }
  .seat.winner .seat-avatar { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(231,196,106,.5); }

  .center {
    top: 47%;
    width: 300px;
  }
  .center .pot b { font-size: 32px; }

  .actions {
    width: min(940px, 94%);
  }
}

@media (min-width: 820px) and (max-width: 1279px) {
  .seat, .seat.hero { width: 278px; }
  .seat-info { flex-basis: 42px; width: 42px; }
  .seat-side { flex-basis: 56px; width: 56px; }
  .seat-avatar { width: 54px; height: 54px; flex-basis: 54px; }
  .seat .card, .seat.hero .card { width: 25px; height: 36px; }
  .seat-cards { padding: 3px 4px; }
  .seat-status { flex-basis: 16px; width: 16px; font-size: 7px; }
}

/* Chip canvas overlays */
.pot-fx,
.chip-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.pot-fx { z-index: 1; }
.chip-fx { z-index: 7; }
#pot.pot-bump { animation: potBump .32s ease-out; }
@keyframes potBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); text-shadow: 0 0 18px rgba(255,219,126,.65); }
  70% { transform: scale(.98); }
  100% { transform: scale(1); }
}

@media (min-width: 820px) {
  .seat .seat-side {
    background: transparent;
    border: 0;
    align-self: center;
  }
  .seat .seat-avatar,
  .seat.hero .seat-avatar {
    border: 0;
    border-radius: 8px;
  }
  .seat .seat-side .score-flip {
    flex: 0 0 18px;
    width: 58px;
    height: 18px;
    min-height: 0;
    margin: 1px 0 0;
    background: transparent;
  }
  .seat .seat-side .score-face { font-size: 8px; }
}

/* Keep the cards readable: larger faces, slight overlap instead of shrinking. */
@media (min-width: 820px) {
  .seat .seat-cards,
  .seat.hero .seat-cards {
    min-height: 64px;
    padding: 4px 6px;
    gap: 0;
  }
  .seat .card,
  .seat.hero .card {
    width: 36px;
    height: 52px;
    border-radius: 4px;
  }
  .seat .seat-cards .card + .card { margin-left: -8px; }
  .seat .card .rank { font-size: 13px; }
  .seat .card .suit { font-size: 14px; }
  .seat.hero .card .rank { font-size: 14px; }
  .seat.hero .card .suit { font-size: 15px; }
  .seat .seat-cards .card { z-index: 1; }
  .seat .seat-cards .card:nth-child(2) { z-index: 2; }
  .seat .seat-cards .card:nth-child(3) { z-index: 3; }
  .seat .seat-cards .card:nth-child(4) { z-index: 4; }
  .seat .seat-cards .card:nth-child(5) { z-index: 5; }
}
@media (min-width: 820px) and (max-width: 1279px) {
  .seat .card,
  .seat.hero .card { width: 32px; height: 46px; }
  .seat .seat-cards .card + .card { margin-left: -7px; }
  .seat .seat-cards { min-height: 56px; }
  .seat .card .rank { font-size: 11px; }
  .seat .card .suit { font-size: 12px; }
}

/* Final card size / avatar trim / keep everything inside the square table. */
@media (min-width: 820px) {
  .seat,
  .seat.hero { width: 300px; }

  .seat-info {
    flex: 0 0 42px;
    width: 42px;
  }
  .seat-info .seat-name { max-width: 42px; font-size: 9px; }
  .seat-info .badge { font-size: 6.5px; }

  .seat-side {
    flex: 0 0 48px;
    width: 48px;
  }
  .seat-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 7px;
  }
  .seat .seat-side .score-flip {
    width: 48px;
    flex-basis: 17px;
    height: 17px;
  }
  .seat .seat-side .score-face { font-size: 7px; }

  .seat .seat-cards,
  .seat.hero .seat-cards {
    min-height: 66px;
    padding: 4px 5px;
    gap: 0;
  }
  .seat .card,
  .seat.hero .card {
    width: 40px;
    height: 58px;
    border-radius: 4px;
  }
  .seat .seat-cards .card + .card { margin-left: -8px; }
  .seat .card .rank { font-size: 14px; }
  .seat .card .suit { font-size: 15px; }
  .seat.hero .card .rank { font-size: 15px; }
  .seat.hero .card .suit { font-size: 16px; }

  .seat-status {
    flex: 0 0 16px;
    width: 16px;
    height: 54px;
    font-size: 7.5px;
  }
}

@media (min-width: 820px) and (max-width: 1279px) {
  .seat .card,
  .seat.hero .card { width: 36px; height: 52px; }
  .seat .seat-cards .card + .card { margin-left: -7px; }
  .seat .seat-cards { min-height: 58px; }
  .seat .card .rank { font-size: 12px; }
  .seat .card .suit { font-size: 13px; }
}

/* Bigger still; smaller avatar/info; left side uses the outer gap. */
@media (min-width: 820px) {
  .seat,
  .seat.hero { width: 302px; }

  .seat-info {
    flex: 0 0 34px;
    width: 34px;
  }
  .seat-info .seat-name { max-width: 34px; font-size: 8px; }
  .seat-info .seat-no { width: 14px; height: 14px; font-size: 8px; }
  .seat-info .badge { font-size: 6px; padding: 0 2px; }
  .seat-tags { gap: 2px; }

  .seat-side {
    flex: 0 0 40px;
    width: 40px;
  }
  .seat-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 6px;
  }
  .seat .seat-side .score-flip {
    width: 40px;
    flex-basis: 15px;
    height: 15px;
  }
  .seat .seat-side .score-face { font-size: 6.5px; }

  .seat .seat-cards,
  .seat.hero .seat-cards {
    min-height: 72px;
    padding: 4px 5px;
    gap: 0;
  }
  .seat .card,
  .seat.hero .card {
    width: 46px;
    height: 64px;
    border-radius: 4px;
  }
  .seat .seat-cards .card + .card { margin-left: -10px; }
  .seat .card .rank { font-size: 16px; }
  .seat .card .suit { font-size: 17px; }
  .seat.hero .card .rank { font-size: 17px; }
  .seat.hero .card .suit { font-size: 18px; }

  .seat-status {
    flex: 0 0 12px;
    width: 12px;
    height: 60px;
    font-size: 6.5px;
    letter-spacing: 0;
  }
}

@media (min-width: 820px) and (max-width: 1279px) {
  .seat .card,
  .seat.hero .card { width: 42px; height: 58px; }
  .seat .seat-cards .card + .card { margin-left: -9px; }
  .seat .seat-cards { min-height: 64px; }
  .seat-avatar { width: 38px; height: 38px; flex-basis: 38px; }
  .seat-side { flex-basis: 38px; width: 38px; }
  .seat-info { flex-basis: 32px; width: 32px; }
}

/* Largest readable cards that still stay inside the square table. */
@media (min-width: 820px) {
  .seat,
  .seat.hero { width: 310px; }
  .seat .seat-cards,
  .seat.hero .seat-cards { min-height: 80px; padding: 4px 5px; }
  .seat .card,
  .seat.hero .card { width: 50px; height: 70px; }
  .seat .seat-cards .card + .card { margin-left: -12px; }
  .seat .card .rank { font-size: 17px; }
  .seat .card .suit { font-size: 18px; }
  .seat.hero .card .rank { font-size: 18px; }
  .seat.hero .card .suit { font-size: 19px; }
}
@media (min-width: 820px) and (max-width: 1279px) {
  .seat .card,
  .seat.hero .card { width: 46px; height: 64px; }
  .seat .seat-cards .card + .card { margin-left: -11px; }
  .seat .seat-cards { min-height: 72px; }
}

/* Overlapping cards need their rank at the visible left edge. */
@media (min-width: 820px) {
  .seat .card,
  .seat.hero .card {
    display: block;
    box-sizing: border-box;
    padding: 3px 5px;
    text-align: left;
  }
  .seat .card .rank,
  .seat.hero .card .rank {
    display: block;
    text-align: left;
    line-height: 1;
  }
  .seat .card .suit,
  .seat.hero .card .suit {
    display: block;
    text-align: left;
    line-height: 1;
    margin-top: 2px;
  }
}

/* No overlap: avatar/info row + full five-card row. */
@media (min-width: 820px) {
  .seat,
  .seat.hero {
    width: 260px;
    display: grid;
    grid-template-columns: 50px 40px 38px;
    grid-template-areas:
      "info side status"
      "cards cards cards";
    justify-content: center;
    align-items: center;
    row-gap: 3px;
    column-gap: 3px;
  }
  .seat.seat-bottom {
    grid-template-areas:
      "cards cards cards"
      "info side status";
  }

  .seat-info {
    grid-area: info;
    flex: none;
    width: 50px;
    padding: 0;
  }
  .seat-info .seat-name { max-width: 50px; font-size: 8.5px; }
  .seat-info .seat-no { width: 14px; height: 14px; font-size: 7.5px; }
  .seat-info .badge { font-size: 6px; padding: 0 2px; }
  .seat-tags { gap: 2px; }

  .seat-side {
    grid-area: side;
    flex: none;
    width: 40px;
  }
  .seat-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
  .seat .seat-side .score-flip {
    width: 40px;
    flex: 0 0 14px;
    height: 14px;
    min-height: 0;
  }
  .seat .seat-side .score-face { font-size: 6px; }

  .seat-status {
    grid-area: status;
    flex: none;
    width: 38px;
    height: auto;
    min-height: 32px;
    padding: 3px 2px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: 0;
    font-size: 7px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }

  .seat .seat-cards,
  .seat.hero .seat-cards {
    grid-area: cards;
    width: 100%;
    min-height: 70px;
    padding: 3px 5px;
    gap: 4px;
    justify-content: center;
    align-content: center;
  }
  .seat .card,
  .seat.hero .card {
    width: 44px;
    height: 62px;
    margin: 0 !important;
    flex: 0 0 44px;
  }
  .seat .seat-cards .card + .card { margin-left: 0 !important; }
  .seat .card .rank { font-size: 16px; }
  .seat .card .suit { font-size: 16px; }
  .seat.hero .card .rank { font-size: 17px; }
  .seat.hero .card .suit { font-size: 17px; }
  .seat .card { display: flex; align-items: flex-start; justify-content: flex-start; }
}

@media (min-width: 820px) and (max-width: 1279px) {
  .seat, .seat.hero { width: 240px; grid-template-columns: 44px 38px 34px; }
  .seat-info { width: 44px; }
  .seat-info .seat-name { max-width: 44px; }
  .seat .card, .seat.hero .card { width: 40px; height: 57px; flex-basis: 40px; }
  .seat .seat-cards { gap: 3px; min-height: 65px; }
  .seat .card .rank { font-size: 14px; }
  .seat .card .suit { font-size: 14px; }
}

/* Final: compact horizontal seat, five cards fully visible, no overlap. */
@media (min-width: 820px) {
  .seat,
  .seat.hero {
    width: 308px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    row-gap: 0;
    column-gap: 3px;
  }
  .seat.seat-bottom {
    display: flex;
    flex-direction: row;
    grid-template-areas: none;
  }
  .seat-info {
    flex: 0 0 32px;
    width: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .seat-info .seat-name { max-width: 32px; font-size: 8px; }
  .seat-info .seat-no { width: 13px; height: 13px; font-size: 7px; }
  .seat-info .badge { font-size: 5.5px; padding: 0 1.5px; }
  .seat-tags { gap: 1.5px; }

  .seat-side {
    flex: 0 0 36px;
    width: 36px;
  }
  .seat-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 6px;
  }
  .seat .seat-side .score-flip {
    width: 36px;
    flex: 0 0 13px;
    height: 13px;
    min-height: 0;
  }
  .seat .seat-side .score-face { font-size: 5.5px; }

  .seat .seat-cards,
  .seat.hero .seat-cards {
    flex: 0 0 auto;
    width: auto;
    min-height: 64px;
    padding: 3px 5px;
    gap: 2px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .seat .card,
  .seat.hero .card {
    width: 40px;
    height: 58px;
    flex: 0 0 40px;
    margin: 0 !important;
  }
  .seat .seat-cards .card + .card { margin-left: 0 !important; }
  .seat .card .rank { font-size: 14px; }
  .seat .card .suit { font-size: 15px; }
  .seat.hero .card .rank { font-size: 15px; }
  .seat.hero .card .suit { font-size: 16px; }

  .seat-status {
    flex: 0 0 12px;
    width: 12px;
    height: 54px;
    min-height: 0;
    padding: 0;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0;
    font-size: 6.5px;
    line-height: 1;
    text-align: center;
  }
}

@media (min-width: 820px) and (max-width: 1279px) {
  .seat, .seat.hero { width: 286px; }
  .seat-info { flex-basis: 30px; width: 30px; }
  .seat-info .seat-name { max-width: 30px; }
  .seat-side { flex-basis: 34px; width: 34px; }
  .seat-avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .seat .card, .seat.hero .card { width: 36px; height: 52px; flex-basis: 36px; }
  .seat .seat-cards { gap: 1px; min-height: 58px; padding: 2px 3px; }
}

/* Higher-specificity final override; the old dense-seat rules were still winning. */
@media (min-width: 820px) {
  .table-wrap .seats .seat,
  .table-wrap .seats .seat.hero,
  .table-wrap .seats .seat.seat-bottom {
    width: 310px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    grid-template-areas: none !important;
  }
  .table-wrap .seats .seat .seat-info {
    flex: 0 0 32px !important;
    width: 32px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  .table-wrap .seats .seat .seat-info .seat-name {
    max-width: 32px !important;
    font-size: 8px !important;
  }
  .table-wrap .seats .seat .seat-info .badge { font-size: 5.5px !important; }
  .table-wrap .seats .seat .seat-side {
    flex: 0 0 36px !important;
    width: 36px !important;
    background: transparent !important;
    border: 0 !important;
  }
  .table-wrap .seats .seat .seat-avatar {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    border: 0 !important;
    border-radius: 6px !important;
  }
  .table-wrap .seats .seat .seat-side .score-flip {
    width: 36px !important;
    flex: 0 0 13px !important;
    height: 13px !important;
    min-height: 0 !important;
    margin: 1px 0 0 !important;
  }
  .table-wrap .seats .seat .seat-side .score-face { font-size: 5.5px !important; }

  .table-wrap .seats .seat .seat-cards {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 64px !important;
    padding: 3px 5px !important;
    gap: 2px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-content: center !important;
  }
  .table-wrap .seats .seat .seat-cards .card,
  .table-wrap .seats .seat.hero .seat-cards .card {
    width: 40px !important;
    height: 58px !important;
    flex: 0 0 40px !important;
    margin: 0 !important;
    border-radius: 4px !important;
  }
  .table-wrap .seats .seat .seat-cards .card + .card {
    margin-left: 0 !important;
  }
  .table-wrap .seats .seat .card .rank { font-size: 14px !important; }
  .table-wrap .seats .seat .card .suit { font-size: 15px !important; }
  .table-wrap .seats .seat.hero .card .rank { font-size: 15px !important; }
  .table-wrap .seats .seat.hero .card .suit { font-size: 16px !important; }

  .table-wrap .seats .seat .seat-status {
    flex: 0 0 12px !important;
    width: 12px !important;
    height: 54px !important;
    min-height: 0 !important;
    padding: 0 !important;
    writing-mode: vertical-rl !important;
    text-orientation: upright !important;
    font-size: 6.5px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
  }
}

@media (min-width: 820px) and (max-width: 1279px) {
  .table-wrap .seats .seat,
  .table-wrap .seats .seat.hero,
  .table-wrap .seats .seat.seat-bottom { width: 288px !important; }
  .table-wrap .seats .seat .card,
  .table-wrap .seats .seat.hero .card {
    width: 36px !important;
    height: 52px !important;
    flex-basis: 36px !important;
  }
}

/* Give adjacent seats a real gutter: shrink only the side info/status strips. */
@media (min-width: 820px) {
  .table-wrap .seats .seat,
  .table-wrap .seats .seat.hero,
  .table-wrap .seats .seat.seat-bottom {
    width: 306px !important;
    gap: 2px !important;
  }
  .table-wrap .seats .seat .seat-info {
    flex: 0 0 28px !important;
    width: 28px !important;
    gap: 1px !important;
  }
  .table-wrap .seats .seat .seat-info .seat-name {
    max-width: 28px !important;
    font-size: 7.5px !important;
  }
  .table-wrap .seats .seat .seat-info .seat-no {
    width: 12px !important;
    height: 12px !important;
    font-size: 6.5px !important;
  }
  .table-wrap .seats .seat .seat-info .badge { font-size: 5px !important; padding: 0 1px !important; }
  .table-wrap .seats .seat .seat-tags { gap: 1px !important; }

  .table-wrap .seats .seat .seat-status {
    flex: 0 0 8px !important;
    width: 8px !important;
    font-size: 5.5px !important;
    padding: 0 !important;
  }
}
@media (min-width: 820px) and (max-width: 1279px) {
  .table-wrap .seats .seat,
  .table-wrap .seats .seat.hero,
  .table-wrap .seats .seat.seat-bottom { width: 284px !important; }
}

/* Center text/timer above the phase line, pot/chips below. */
@media (min-width: 820px) {
  .center {
    top: 40% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .center #handInfo { order: -2; max-width: 320px; margin: 0 !important; }
  .center #timer { order: -1; margin: 0 !important; }
  .center #phaseLabel { order: 0; }
  .center .pot { order: 1; margin-top: 2px !important; }
  .center #result { order: 2; margin-top: 6px !important; }
}

/* Lift the whole center text block closer to the top players' cards. */
@media (min-width: 820px) {
  .center { top: 34% !important; }
}

@media (min-width: 820px) {
  .center { top: 32% !important; }
}

@media (min-width: 820px) {
  .center { top: 30% !important; }
}

@media (min-width: 820px) {
  .center { top: 32% !important; }
}

/* Put the two small info lines above the table, in the header gap. */
.table-top-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 6px auto 0;
  text-align: center;
}
.table-top-status .hand-info {
  max-width: min(900px, 92%);
  margin: 0;
}
.table-top-status .timer { margin: 0; }

@media (min-width: 820px) {
  .table-top-status {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: min(920px, 92%);
    margin: 0;
    z-index: 20;
    pointer-events: none;
  }
  .table-surface { top: 40% !important; }
}

/* No header info/timer; use the saved space to lift the table. */
@media (min-width: 820px) {
  .table-surface { top: 35% !important; }

  /* Self stays gold; the acting player is brighter mint-white. */
  .table-wrap .seats .seat.you .seat-avatar {
    box-shadow: 0 0 0 1px rgba(231, 196, 106, .78), 0 0 12px rgba(231, 196, 106, .28) !important;
  }
  .table-wrap .seats .seat.actor .seat-avatar {
    box-shadow: 0 0 0 2px #c7ffe3, 0 0 22px rgba(125, 255, 200, .78) !important;
  }
  .table-wrap .seats .seat.actor .seat-cards {
    border-color: rgba(140, 255, 210, .92) !important;
    background: rgba(18, 70, 48, .42) !important;
    box-shadow: 0 0 0 1px rgba(140, 255, 210, .2), 0 0 16px rgba(120, 255, 200, .12);
  }
  .table-wrap .seats .seat.actor .seat-status {
    color: #d8ffed !important;
    background: rgba(18, 86, 58, .85) !important;
    box-shadow: 0 0 0 1px rgba(140, 255, 210, .55);
  }
}

.award-fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 90;
}

.deal-fx {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 80;
}
.card.card-pending {
  opacity: 0;
  transform: translateY(-18px) scale(.86);
}
.card.card-dealt {
  animation: cardDealt .26s ease-out;
}
@keyframes cardDealt {
  0% { opacity: 0; transform: translateY(-10px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card.showdown-hidden {
  background:
    repeating-linear-gradient(45deg, #173d2d 0 4px, #123326 4px 8px) !important;
  border-color: #2e624a !important;
  box-shadow: inset 0 0 0 3px #0c2118 !important;
}
.card.showdown-hidden .rank,
.card.showdown-hidden .suit,
.card.showdown-hidden .hole-badge {
  visibility: hidden !important;
}
.card.showdown-reveal {
  animation: showdownReveal .38s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes showdownReveal {
  0% { transform: rotateY(70deg) scale(.92); filter: brightness(.7); }
  55% { transform: rotateY(-8deg) scale(1.06); filter: brightness(1.25); }
  100% { transform: rotateY(0) scale(1); filter: brightness(1); }
}

/* Ready phase */
.ready-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  margin-bottom: 2px;
}
.ready-pill {
  border: 1px solid #355746;
  border-radius: 999px;
  padding: 2px 7px;
  color: #aebfb4;
  background: rgba(7, 24, 16, .5);
  font-size: 10px;
}
.ready-pill.dealer { border-color: #8d7237; color: #e8c878; }
.ready-pill.paid { border-color: #3d7357; color: #bfe7cf; }
.ready-pill.skipped { border-color: #554a3c; color: #9b9184; text-decoration: line-through; }
.ready-status + button { margin-top: 2px; }

/* Readable seat micro-info without making the whole seat huge. */
@media (min-width: 820px) {
  .table-wrap .seats .seat .seat-info {
    flex: 0 0 36px !important;
    width: 36px !important;
    gap: 2px !important;
  }
  .table-wrap .seats .seat .seat-info .seat-name {
    max-width: 36px !important;
    font-size: 9.5px !important;
    line-height: 1.15 !important;
  }
  .table-wrap .seats .seat .seat-info .seat-no {
    width: 15px !important;
    height: 15px !important;
    font-size: 8px !important;
  }
  .table-wrap .seats .seat .seat-info .badge {
    font-size: 6.5px !important;
    padding: 0 2px !important;
  }
  .table-wrap .seats .seat .seat-side .score-flip {
    flex-basis: 17px !important;
    height: 17px !important;
  }
  .table-wrap .seats .seat .seat-side .score-face {
    font-size: 7px !important;
  }
  .table-wrap .seats .seat .seat-status {
    flex: 0 0 10px !important;
    width: 10px !important;
    font-size: 7px !important;
  }
}

/* Raise slider: dark at the left, progressively brighter/gold toward max. */
.raise-box {
  --raise-progress: 25%;
  --raise-glow: .12;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.raise-box.maxed {
  border-color: rgba(244, 207, 119, .8);
  background: linear-gradient(180deg, #241f11, #0d1b13);
  box-shadow: 0 0 24px rgba(231, 196, 106, .28);
}
.raise-box input[type="range"] {
  flex: 0 0 auto;
  width: 150px;
  height: 22px;
  padding: 0;
  margin: 0;
  accent-color: unset;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.raise-box input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 99px;
  border: 1px solid rgba(231, 196, 106, .24);
  background: linear-gradient(
    90deg,
    #705329 0%,
    #c89e4c var(--raise-progress, 25%),
    #16271e var(--raise-progress, 25%),
    #16271e 100%
  );
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, .55),
    0 0 calc(var(--raise-glow, .12) * 16px) rgba(244, 205, 112, calc(var(--raise-glow, .12) * .5));
  transition: box-shadow .12s linear;
}
.raise-box input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  border: 1px solid #f4dda0;
  background: radial-gradient(circle at 35% 28%, #fff6d2 0%, #f1d27e 30%, #b48735 72%, #5f4319 100%);
  box-shadow:
    0 0 calc(2px + var(--raise-glow, .12) * 18px) rgba(255, 218, 130, calc(.2 + var(--raise-glow, .12) * .7)),
    0 1px 3px rgba(0, 0, 0, .6);
  transition: box-shadow .12s linear, transform .12s ease;
}
.raise-box input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.08);
}
.raise-box input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 99px;
  border: 1px solid rgba(231, 196, 106, .24);
  background: #16271e;
}
.raise-box input[type="range"]::-moz-range-progress {
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, #705329, #d8ae5d);
}
.raise-box input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #f4dda0;
  background: radial-gradient(circle at 35% 28%, #fff6d2, #f1d27e 35%, #b48735 80%);
  box-shadow: 0 0 calc(2px + var(--raise-glow, .12) * 18px) rgba(255, 218, 130, .8);
}
.raise-box.maxed .raise-label { color: #ffe6a7; text-shadow: 0 0 10px rgba(255, 214, 126, .5); }

/* Progressive raise track: a real fill layer grows and brightens with the thumb. */
.raise-box .raise-track {
  position: relative;
  flex: 0 0 150px;
  width: 150px;
  height: 22px;
}
.raise-box .raise-track::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 6px;
  height: 10px;
  border-radius: 99px;
  background: #15251c;
  border: 1px solid rgba(231, 196, 106, .2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
}
.raise-box .raise-fill {
  position: absolute;
  left: 0; top: 6px;
  height: 10px;
  width: var(--raise-progress, 25%);
  border-radius: 99px;
  background: linear-gradient(90deg, #5d451e 0%, #b88c3d 45%, #f2d486 100%);
  box-shadow:
    0 0 calc(var(--raise-glow, .12) * 20px) rgba(255, 215, 125, calc(var(--raise-glow, .12) * .75)),
    inset 0 0 5px rgba(255, 239, 181, .28);
  filter: brightness(calc(.62 + var(--raise-glow, .12) * .75));
  transition: width .08s linear, box-shadow .08s linear, filter .08s linear;
  z-index: 1;
  pointer-events: none;
}
.raise-box input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 22px;
  margin: 0;
  z-index: 2;
}
.raise-box input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.raise-box input[type="range"]::-moz-range-track {
  height: 10px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.raise-box.maxed .raise-fill {
  background: linear-gradient(90deg, #8d6827 0%, #e0b858 45%, #fff0b8 100%);
  box-shadow:
    0 0 24px rgba(255, 222, 135, .9),
    inset 0 0 7px rgba(255, 247, 204, .55);
}

/* View another player's chip tray */
.chip-tray-box { position: relative; }
.tray-actions { flex-wrap: wrap; justify-content: flex-end; }
.tray-picker {
  position: absolute;
  z-index: 30;
  top: 58px;
  left: 12px;
  right: 12px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #3f644f;
  border-radius: 12px;
  background: linear-gradient(180deg, #10281c, #07150e);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .68);
}
.tray-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tray-picker-head b { color: #e7c46a; font-size: 13px; }
.tray-picker-list { display: flex; flex-direction: column; gap: 5px; }
.tray-player-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #2f5240;
  border-radius: 9px;
  background: rgba(9, 30, 20, .72);
  color: #dfe9e1;
  font: 600 12px "Microsoft YaHei", sans-serif;
  text-align: left;
  cursor: pointer;
}
.tray-player-row:hover { border-color: #8f7133; background: #17291d; }
.tray-player-row.active { border-color: #e7c46a; color: #f0cf83; }
.tray-player-row .avatar-mini {
  width: 24px; height: 24px; border-radius: 6px; object-fit: cover;
  flex: 0 0 24px; background: #0c2118;
}
.tray-player-row .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-player-row .chips { color: #e7c46a; font-variant-numeric: tabular-nums; }
.tray-player-row .dealer { color: #e7c46a; font-size: 10px; }

/* Larger, always-populated action console. */
@media (min-width: 820px) {
  .actions {
    width: min(1120px, 96%) !important;
    min-height: 96px;
    padding: 14px 16px !important;
    gap: 9px !important;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(7, 27, 18, .97), rgba(4, 15, 10, .98)) !important;
    border-color: #315642 !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .55) !important;
  }
  .actions button {
    min-height: 34px;
    padding: 8px 12px;
  }
  .actions button:disabled,
  .actions button.disabled {
    opacity: .3;
    filter: grayscale(.55) saturate(.45);
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
  }
  .actions button.action-primary {
    box-shadow:
      0 0 0 1px rgba(255, 225, 150, .75),
      0 0 22px rgba(231, 196, 106, .4) !important;
    transform: translateY(-1px);
  }
  .actions button.action-allin {
    border-color: #8e5e4b;
  }
  .actions .hint { font-size: 12px; }
  .raise-box { flex: 1 1 100%; }
}

/* Match the action console to the table width and use the vertical gap. */
@media (min-width: 820px) {
  .actions {
    width: min(940px, 92%) !important;
    min-height: 232px;
    bottom: 9px;
    padding: 16px 18px !important;
    gap: 9px 10px !important;
    justify-content: center;
    align-content: space-evenly;
  }
  .actions button {
    min-height: 40px;
    padding: 9px 16px;
    font-size: 14px;
  }
  .actions .hint {
    flex: 0 1 auto;
    text-align: center;
  }
  .raise-box {
    flex: 1 1 100%;
    justify-content: center;
    padding: 10px 14px;
  }
  .raise-box .raise-label { font-size: 13px; }
  .quick-raise button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
}

/* On tall screens, anchor the table just above the action console instead of
   leaving a viewport-dependent gap between them. */
@media (min-width: 820px) and (min-height: 900px) {
  .actions {
    height: 260px;
    min-height: 260px;
  }
  .table-surface {
    top: auto !important;
    bottom: 283px !important;
    transform: translateX(-50%) !important;
  }
}

/* Revert the oversized console: keep the table where it was, and make the
   action panel compact with its left/right edges matching the table. */
@media (min-width: 820px) {
  .table-surface {
    top: 35% !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
  }
  .actions {
    width: min(940px, 92%) !important;
    height: auto !important;
    min-height: 0 !important;
    bottom: 6px !important;
    padding: 9px 10px !important;
    gap: 7px !important;
    justify-content: center !important;
    align-content: normal !important;
  }
  .actions button {
    min-height: 30px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .actions .hint {
    font-size: 11px !important;
    flex: 0 1 auto;
    text-align: center;
  }
  .raise-box {
    flex: 1 1 100%;
    padding: 6px 9px !important;
    gap: 6px !important;
  }
  .raise-box .raise-label { font-size: 11px !important; }
  .quick-raise button {
    min-height: 26px !important;
    padding: 3px 7px !important;
    font-size: 10px !important;
  }
}

/* Slightly larger than the compact version, lifted a little from the bottom. */
@media (min-width: 820px) {
  .actions {
    width: min(940px, 92%) !important;
    height: auto !important;
    min-height: 180px !important;
    bottom: 28px !important;
    padding: 11px 12px !important;
    gap: 8px !important;
  }
  .actions button {
    min-height: 34px !important;
    padding: 7px 12px !important;
    font-size: 13px !important;
  }
  .actions .hint { font-size: 11px !important; }
  .raise-box { padding: 7px 10px !important; }
  .raise-box .raise-label { font-size: 12px !important; }
  .quick-raise button {
    min-height: 28px !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
}

/* Per-player current-round bet, visible on every seat. */
@media (min-width: 820px) {
  .table-wrap .seats .seat .seat-info {
    flex: 0 0 40px !important;
    width: 40px !important;
  }
  .table-wrap .seats .seat .seat-info .seat-name {
    max-width: 40px !important;
  }
  .table-wrap .seats .seat .seat-bet {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 21px;
    margin-top: 1px;
    border: 1px solid rgba(231, 196, 106, .3);
    border-radius: 5px;
    background: rgba(8, 26, 17, .78);
    color: #d7c48a;
    font-size: 7px;
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .table-wrap .seats .seat .seat-bet b {
    color: #f5d68e;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.05;
  }
}

/* Desktop seat reflow: use the full seat width for readable metadata without
   widening the seat and colliding with neighbours at 8 players. */
@media (min-width: 820px) {
  .table-wrap .seats .seat,
  .table-wrap .seats .seat.hero,
  .table-wrap .seats .seat.seat-bottom {
    width: 310px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 12px !important;
    grid-template-rows: 21px minmax(0, 1fr) !important;
    grid-template-areas:
      "side info status"
      "side cards status" !important;
    column-gap: 4px !important;
    row-gap: 2px !important;
    align-items: center !important;
    justify-content: stretch !important;
    padding: 3px 5px !important;
  }
  .table-wrap .seats .seat .seat-info {
    grid-area: info !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
    width: auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .table-wrap .seats .seat .seat-info .seat-no {
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 8.5px !important;
  }
  .table-wrap .seats .seat .seat-info .seat-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11.5px !important;
    line-height: 1.1 !important;
  }
  .table-wrap .seats .seat .seat-info .seat-tags {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 2px !important;
  }
  .table-wrap .seats .seat .seat-info .badge {
    font-size: 7.5px !important;
    padding: 0 2px !important;
    white-space: nowrap !important;
  }
  .table-wrap .seats .seat .seat-info .seat-bet {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 2px !important;
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 1px 3px !important;
    border: 1px solid rgba(231, 196, 106, .34) !important;
    border-radius: 4px !important;
    background: rgba(8, 26, 17, .8) !important;
    color: #dbc68a !important;
    font-size: 7.5px !important;
    line-height: 1 !important;
  }
  .table-wrap .seats .seat .seat-info .seat-bet b {
    font-size: 10px !important;
    line-height: 1 !important;
  }
  .table-wrap .seats .seat .seat-side {
    grid-area: side !important;
    flex: none !important;
    width: 44px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
  }
  .table-wrap .seats .seat .seat-avatar,
  .table-wrap .seats .seat.hero .seat-avatar {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    border-radius: 7px !important;
  }
  .table-wrap .seats .seat .seat-side .score-flip {
    width: 44px !important;
    flex: 0 0 18px !important;
    height: 18px !important;
    margin-top: 1px !important;
  }
  .table-wrap .seats .seat .seat-side .score-face {
    font-size: 8px !important;
  }
  .table-wrap .seats .seat .seat-cards,
  .table-wrap .seats .seat.hero .seat-cards {
    grid-area: cards !important;
    width: auto !important;
    min-height: 62px !important;
    padding: 2px 3px !important;
    justify-content: center !important;
    align-content: center !important;
  }
  .table-wrap .seats .seat .seat-cards .card,
  .table-wrap .seats .seat.hero .seat-cards .card {
    width: 40px !important;
    height: 58px !important;
  }
  .table-wrap .seats .seat .seat-status {
    grid-area: status !important;
    width: 12px !important;
    flex: none !important;
    min-height: 100% !important;
    padding: 2px 0 !important;
    font-size: 7.5px !important;
  }
}

/* Bump the new horizontal seat plate one more notch for readability. */
@media (min-width: 820px) {
  .table-wrap .seats .seat .seat-info .seat-name { font-size: 12px !important; }
  .table-wrap .seats .seat .seat-info .seat-no { font-size: 9px !important; }
  .table-wrap .seats .seat .seat-info .badge { font-size: 8px !important; }
  .table-wrap .seats .seat .seat-info .seat-bet { font-size: 8px !important; }
  .table-wrap .seats .seat .seat-info .seat-bet b { font-size: 10.5px !important; }
  .table-wrap .seats .seat .seat-side .score-flip {
    flex-basis: 20px !important;
    height: 20px !important;
  }
  .table-wrap .seats .seat .seat-side .score-face { font-size: 9px !important; }
}

/* Mobile: large player info strip instead of tiny text inside each seat. */
.mobile-players { display: none; }

@media (max-width: 819px) {
  .mobile-players {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 7px 8px;
    margin: 0 0 6px;
    border: 1px solid #2f5240;
    border-radius: 12px;
    background: rgba(5, 18, 12, .94);
    scrollbar-width: thin;
  }
  .mobile-player {
    flex: 0 0 158px;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid #2f5240;
    border-radius: 9px;
    background: rgba(9, 30, 20, .72);
  }
  .mobile-player.dealer { border-color: rgba(231, 196, 106, .55); }
  .mobile-avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 6px;
    object-fit: cover;
  }
  .mobile-player-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
  }
  .mobile-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #eef5ef;
    font-size: 12.5px;
    line-height: 1.1;
  }
  .mobile-tags {
    color: #e7c46a;
    font-size: 9px;
    line-height: 1.1;
  }
  .mobile-meta {
    color: #c6d8ca;
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .seat .seat-info,
  .seat .seat-bet,
  .seat .seat-side .score-flip {
    display: none !important;
  }
}

/* The taller seat plate now ends around the old phase label position; move the
   center block down so the hand/stage line is never covered by a seat. */
@media (min-width: 820px) {
  .table-surface .center {
    transform: translate(-50%, calc(-50% + 26px)) !important;
  }
}

/* Own hole card sits face-down by default; hover peeks at it. Other players'
   hidden cards are already server-hidden and are not given this class. */
.card.own-hole-card {
  perspective: 320px;
  cursor: help;
}
.card.own-hole-card .rank,
.card.own-hole-card .suit,
.card.own-hole-card .hole-badge {
  visibility: hidden;
}
.card.own-hole-card::before {
  content: "♠";
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid #2e624a;
  background:
    radial-gradient(circle at 50% 50%, rgba(231, 196, 106, .16), transparent 58%),
    repeating-linear-gradient(45deg, #173d2d 0 4px, #123326 4px 8px);
  color: #d8b965;
  font-size: 20px;
  line-height: 1;
  transform-origin: left center;
  transition: transform .26s cubic-bezier(.2,.8,.3,1), opacity .18s ease;
  backface-visibility: hidden;
}
.card.own-hole-card:hover::before {
  transform: rotateY(-96deg) skewY(-1deg);
  opacity: 0;
}
.card.own-hole-card:hover .rank,
.card.own-hole-card:hover .suit,
.card.own-hole-card:hover .hole-badge {
  visibility: visible;
}

/* Mobile action console: wrap instead of clipping on narrow screens. */
@media (max-width: 819px) {
  .actions {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .actions button {
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }
  .raise-box {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .raise-box .raise-track {
    flex: 1 1 120px !important;
    width: auto !important;
    min-width: 90px !important;
  }
  .raise-box .raise-label { flex: 0 0 auto !important; }
}

@media (max-width: 819px) {
  .actions {
    width: auto !important;
    max-width: calc(100vw - 12px) !important;
    left: 6px !important;
    right: 6px !important;
    box-sizing: border-box !important;
  }
}

/* Landscape phone, 7–8 players: a 4×2 player board instead of the ring.
   Desktop and portrait layouts are untouched. */
.landscape-hud { display: none; }

@media (orientation: landscape) and (pointer: coarse) and (max-width: 1400px) and (max-height: 1000px) {
  #room.landscape-eight {
    overflow-y: auto !important;
    padding-bottom: 4px;
  }
  #room.landscape-eight .mobile-players {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding: 4px;
    margin: 0 4px 4px;
    border-radius: 8px;
  }
  #room.landscape-eight .mobile-player {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-areas:
      "avatar text"
      "cards cards";
    align-items: center;
    gap: 2px 4px;
    min-width: 0;
    padding: 4px;
  }
  #room.landscape-eight .mobile-avatar {
    grid-area: avatar;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }
  #room.landscape-eight .mobile-player-text {
    grid-area: text;
    min-width: 0;
  }
  #room.landscape-eight .mobile-name { font-size: 11px; }
  #room.landscape-eight .mobile-tags { font-size: 8px; }
  #room.landscape-eight .mobile-meta { font-size: 8.5px; }
  #room.landscape-eight .mobile-cards {
    grid-area: cards;
    display: flex;
    justify-content: center;
    gap: 1px;
    min-height: 34px;
    margin-top: 1px;
  }
  #room.landscape-eight .mobile-cards .card {
    width: 21px;
    height: 31px;
    border-radius: 3px;
    flex: 0 0 21px;
  }
  #room.landscape-eight .mobile-cards .card .rank { font-size: 8px; }
  #room.landscape-eight .mobile-cards .card .suit { font-size: 9px; }
  #room.landscape-eight .landscape-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 8px 4px;
    padding: 3px 8px;
    border: 1px solid #3a5b48;
    border-radius: 7px;
    background: rgba(5, 20, 13, .9);
    color: #d7e7da;
    font-size: 10px;
  }
  #room.landscape-eight .landscape-phase { color: #b9cec1; }
  #room.landscape-eight .landscape-pot { color: #f2d486; }
  #room.landscape-eight .landscape-result { color: #ffc36b; }
  #room.landscape-eight .table-surface {
    display: none !important;
  }
  #room.landscape-eight .side {
    display: none !important;
  }
  #room.landscape-eight .layout {
    display: block !important;
    height: auto !important;
    margin: 0 !important;
  }
  #room.landscape-eight .table-wrap {
    height: auto !important;
    min-height: 0 !important;
  }
  #room.landscape-eight .actions {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 6px !important;
    gap: 4px !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
    z-index: auto;
  }
  #room.landscape-eight .actions button {
    min-height: 26px !important;
    padding: 3px 7px !important;
    font-size: 10px !important;
  }
  #room.landscape-eight .actions .raise-box {
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding: 4px 6px !important;
  }
  #room.landscape-eight .actions .raise-box .raise-track {
    flex: 1 1 100px !important;
    width: auto !important;
    min-width: 80px !important;
  }
  #room.landscape-eight .actions .hint { font-size: 9px !important; }
}

/* Foldable inner screen, 8 players, landscape: keep the board, scale the
   cards/text up because this screen has much more room than a phone. */
@media (orientation: landscape) and (pointer: coarse) and (min-width: 700px) and (max-width: 1400px) and (min-height: 600px) and (max-height: 1000px) {
  #room.landscape-eight .mobile-players {
    gap: 7px;
    padding: 7px;
    margin: 0 8px 6px;
  }
  #room.landscape-eight .mobile-player {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 4px 7px;
    padding: 8px;
  }
  #room.landscape-eight .mobile-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  #room.landscape-eight .mobile-name { font-size: 14px; }
  #room.landscape-eight .mobile-tags { font-size: 10px; }
  #room.landscape-eight .mobile-meta { font-size: 10.5px; }
  #room.landscape-eight .mobile-cards {
    gap: 2px;
    min-height: 46px;
    margin-top: 3px;
  }
  #room.landscape-eight .mobile-cards .card {
    width: 29px;
    height: 42px;
    flex-basis: 29px;
    border-radius: 4px;
  }
  #room.landscape-eight .mobile-cards .card .rank { font-size: 10px; }
  #room.landscape-eight .mobile-cards .card .suit { font-size: 11px; }
  #room.landscape-eight .landscape-hud {
    font-size: 13px;
    padding: 5px 12px;
    margin: 0 8px 6px;
  }
  #room.landscape-eight .actions {
    padding: 9px 12px !important;
    gap: 7px !important;
  }
  #room.landscape-eight .actions button {
    min-height: 34px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
  }
  #room.landscape-eight .actions .hint { font-size: 11px !important; }
}

/* Foldable inner screen: desktop-like split with the chip tray on the right. */
@media (orientation: landscape) and (pointer: coarse) and (min-width: 700px) and (max-width: 1400px) and (min-height: 600px) and (max-height: 1000px) {
  #room.landscape-eight .mobile-players {
    width: calc(100% - 284px);
    margin-right: 284px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  #room.landscape-eight .landscape-hud,
  #room.landscape-eight .actions {
    width: calc(100% - 284px) !important;
    box-sizing: border-box;
  }
  #room.landscape-eight .side {
    display: flex !important;
    position: fixed;
    z-index: 45;
    top: 62px;
    right: 8px;
    bottom: 8px;
    width: 260px;
    height: auto;
    min-height: 0;
    margin: 0;
    gap: 8px;
  }
  #room.landscape-eight .side .chat-box {
    display: none !important;
  }
  #room.landscape-eight .side .chip-tray-box {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  #room.landscape-eight .side .chip-tray-box .tray-scroll {
    flex: 1 1 auto;
    min-height: 0;
  }
  #room.landscape-eight .side .tray-actions .tiny {
    font-size: 9px;
    padding: 2px 4px;
  }
  #room.landscape-eight .side .tray-title h3 { font-size: 12px; }
  #room.landscape-eight .side .tray-total { font-size: 16px; }
}

/* Foldable inner screen, pass 2: a real felt table with pot/chip cards in the
   left column, action console pinned to the bottom, chip tray on the right. */
@media (orientation: landscape) and (pointer: coarse) and (min-width: 700px) and (max-width: 1400px) and (min-height: 600px) and (max-height: 1000px) {
  #room.landscape-eight .landscape-hud {
    display: none !important;
  }
  #room.landscape-eight .table-surface {
    display: block !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: calc(100% - 284px - 16px) !important;
    height: clamp(220px, 38vh, 340px) !important;
    aspect-ratio: auto !important;
    margin: 0 8px 8px !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }
  #room.landscape-eight .table-surface .seats {
    display: none !important;
  }
  #room.landscape-eight .table-surface .center {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, calc(-50% - 30px)) !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
  }
  #room.landscape-eight .table-surface .pot b {
    font-size: 30px;
  }
  #room.landscape-eight .actions {
    position: fixed !important;
    left: 8px !important;
    right: 284px !important;
    bottom: 8px !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    transform: none !important;
    z-index: 50 !important;
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  #room.landscape-eight .actions button {
    min-height: 31px !important;
    padding: 5px 10px !important;
    font-size: 12px !important;
  }
  #room.landscape-eight .actions .raise-box {
    flex-wrap: wrap !important;
    justify-content: center !important;
    padding: 5px 8px !important;
  }
}

/* Quick voice panel */
.voice-box { min-height: 0; }
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  max-height: 178px;
  overflow-y: auto;
  padding-right: 2px;
}
.voice-grid button {
  width: 100%;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid #2f5240;
  border-radius: 7px;
  background: rgba(9, 30, 20, .74);
  color: #dbe9df;
  font-size: 10px;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.voice-grid button:hover {
  border-color: #b99449;
  color: #f0d38e;
  background: #17301f;
}
.voice-grid button:active { transform: scale(.98); }
.voice-empty {
  grid-column: 1 / -1;
  margin: 4px 0;
  color: #879d8e;
  font-size: 10px;
}
@media (max-width: 819px) {
  .voice-grid { max-height: 130px; }
  .voice-grid button { font-size: 9px; min-height: 27px; }
}

/* Lobby side statements: big, readable, desktop-only. */
.lobby { position: relative; }
.lobby-side { display: none; }

@media (min-width: 1200px) {
  .lobby .disclaimer { display: none; }
  .lobby-side {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: min(20vw, 255px);
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
  }
  .lobby-side-left { left: clamp(18px, 5vw, 100px); align-items: flex-start; }
  .lobby-side-right { right: clamp(18px, 5vw, 100px); align-items: flex-end; text-align: right; }
  .side-kicker {
    color: #8aa394;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .28em;
  }
  .side-big {
    color: #e7c46a;
    font-size: clamp(30px, 3.2vw, 48px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: .08em;
    text-shadow: 0 0 24px rgba(231, 196, 106, .18);
  }
  .side-warn {
    color: #e47765;
    text-shadow: 0 0 26px rgba(228, 119, 101, .22);
  }
  .side-rule {
    width: 86%;
    height: 1px;
    background: linear-gradient(90deg, rgba(231, 196, 106, .7), transparent);
  }
  .lobby-side-right .side-rule {
    background: linear-gradient(270deg, rgba(228, 119, 101, .7), transparent);
  }
  .side-body {
    margin: 4px 0 0;
    color: #c9b37b;
    font-size: clamp(13px, 1.15vw, 17px);
    line-height: 1.65;
    letter-spacing: .03em;
  }
  .side-small {
    margin: 2px 0 0;
    color: #8fa698;
    font-size: 11px;
    line-height: 1.55;
  }
  .side-stamp {
    margin-top: 4px;
    padding: 4px 10px;
    border: 2px solid rgba(228, 119, 101, .8);
    border-radius: 4px;
    color: #e47765;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .16em;
    transform: rotate(-5deg);
    box-shadow: 0 0 18px rgba(228, 119, 101, .12);
  }
}

/* Make the lobby side statements unmistakable. */
@media (min-width: 1200px) {
  .lobby-side {
    width: min(22vw, 280px);
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(4, 16, 11, .55);
  }
  .lobby-side-left {
    border: 1px solid rgba(231, 196, 106, .5);
    box-shadow: 0 0 34px rgba(231, 196, 106, .08);
  }
  .lobby-side-right {
    border: 1px solid rgba(255, 127, 107, .55);
    box-shadow: 0 0 34px rgba(255, 127, 107, .09);
  }
  .side-kicker {
    color: #e2cb94;
    font-size: 12px;
  }
  .side-big {
    color: #ffe29a;
    font-size: clamp(36px, 3.8vw, 58px);
    text-shadow:
      0 0 16px rgba(255, 213, 120, .35),
      0 2px 0 rgba(0, 0, 0, .35);
  }
  .side-warn {
    color: #ff7f6b;
    text-shadow:
      0 0 18px rgba(255, 127, 107, .4),
      0 2px 0 rgba(0, 0, 0, .35);
  }
  .side-body {
    color: #f2e2b4;
    font-size: clamp(15px, 1.3vw, 19px);
    font-weight: 600;
    line-height: 1.6;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
  }
  .side-small {
    color: #c9d8ce;
    font-size: 13px;
    font-weight: 600;
  }
  .side-stamp {
    font-size: 18px;
    padding: 5px 12px;
    border-color: #ff8d78;
    color: #ff9a86;
    text-shadow: 0 0 10px rgba(255, 127, 107, .35);
  }
}

/* Medium desktop windows: show smaller side statements before 1200px. */
@media (min-width: 900px) and (max-width: 1199px) {
  .lobby .disclaimer { display: none; }
  .lobby-side {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: min(19vw, 195px);
    flex-direction: column;
    gap: 6px;
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(4, 16, 11, .55);
    pointer-events: none;
  }
  .lobby-side-left {
    left: clamp(10px, 2vw, 28px);
    align-items: flex-start;
    border: 1px solid rgba(231, 196, 106, .45);
  }
  .lobby-side-right {
    right: clamp(10px, 2vw, 28px);
    align-items: flex-end;
    text-align: right;
    border: 1px solid rgba(255, 127, 107, .5);
  }
  .side-kicker { font-size: 9px; color: #e2cb94; }
  .side-big {
    color: #ffe29a;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: .05em;
    text-shadow: 0 0 14px rgba(255, 213, 120, .3);
  }
  .side-warn {
    color: #ff7f6b;
    text-shadow: 0 0 16px rgba(255, 127, 107, .35);
  }
  .side-rule { width: 82%; height: 1px; background: rgba(231, 196, 106, .55); }
  .lobby-side-right .side-rule { background: rgba(255, 127, 107, .55); }
  .side-body {
    margin: 2px 0 0;
    color: #f2e2b4;
    font-size: clamp(12px, 1.3vw, 15px);
    line-height: 1.55;
    font-weight: 600;
  }
  .side-small { margin: 1px 0 0; color: #c9d8ce; font-size: 10px; line-height: 1.45; }
  .side-stamp {
    margin-top: 2px;
    padding: 3px 7px;
    border: 2px solid rgba(255, 141, 120, .9);
    border-radius: 4px;
    color: #ff9a86;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .1em;
    transform: rotate(-5deg);
  }
}

/* Mobile/tablet lobby: show the anti-gambling notice prominently. */
.lobby-mobile-warning { display: none; }

@media (max-width: 899px) {
  .lobby-mobile-warning {
    display: block;
    width: min(420px, 100%);
    padding: 12px 14px;
    border: 1px solid rgba(255, 127, 107, .7);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(70, 20, 18, .55), rgba(25, 11, 10, .62));
    box-shadow: 0 0 28px rgba(255, 108, 88, .1);
    text-align: center;
  }
  .lobby-mobile-warning .mobile-ban {
    display: block;
    color: #ff8773;
    font-size: clamp(26px, 8vw, 34px);
    font-weight: 900;
    letter-spacing: .16em;
    line-height: 1.1;
    text-shadow: 0 0 16px rgba(255, 120, 96, .32);
  }
  .lobby-mobile-warning p {
    margin: 7px 0 4px;
    color: #f1d7b5;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.65;
  }
  .lobby-mobile-warning span {
    color: #d7c1b7;
    font-size: 11px;
    line-height: 1.45;
  }
  .lobby .disclaimer {
    display: block;
    max-width: 420px;
    color: #c7b4aa;
    font-size: 12px;
    line-height: 1.65;
  }
}

/* Phone lobby: lock the panel to the viewport so the 4 avatar columns do not clip. */
@media (max-width: 899px) {
  .lobby {
    padding-left: 12px;
    padding-right: 12px;
    gap: 16px;
  }
  .lobby .panel,
  .lobby .lobby-mobile-warning {
    width: calc(100vw - 24px) !important;
    max-width: 420px !important;
    min-width: 0 !important;
  }
  .lobby .avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Keep the room header visible; the felt/seat layer must never cover it. */
.room-header {
  position: sticky !important;
  top: 0;
  z-index: 80 !important;
  background: rgba(5, 18, 12, .96) !important;
  backdrop-filter: blur(8px);
}

/* Portrait phone: 2×4 player board instead of the old oval table. */
@media (max-width: 899px) and (orientation: portrait) {
  #room.landscape-eight {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
  }
  #room.landscape-eight .mobile-players {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: auto;
    margin: 0 8px 8px;
    padding: 7px;
    overflow: visible;
  }
  #room.landscape-eight .mobile-player {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-areas:
      "avatar text"
      "cards cards";
    align-items: center;
    gap: 3px 6px;
    width: auto;
    min-width: 0;
    padding: 7px;
  }
  #room.landscape-eight .mobile-avatar {
    grid-area: avatar;
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  #room.landscape-eight .mobile-player-text { grid-area: text; min-width: 0; }
  #room.landscape-eight .mobile-name { font-size: 12px; }
  #room.landscape-eight .mobile-tags { font-size: 8.5px; }
  #room.landscape-eight .mobile-meta { font-size: 9px; }
  #room.landscape-eight .mobile-cards {
    grid-area: cards;
    display: flex;
    justify-content: center;
    gap: 1px;
    min-height: 35px;
    margin-top: 2px;
  }
  #room.landscape-eight .mobile-cards .card {
    width: 22px;
    height: 32px;
    flex-basis: 22px;
    border-radius: 3px;
  }
  #room.landscape-eight .mobile-cards .card .rank { font-size: 8px; }
  #room.landscape-eight .mobile-cards .card .suit { font-size: 9px; }
  #room.landscape-eight .landscape-hud {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 8px 7px;
    padding: 5px 8px;
    border: 1px solid #3a5b48;
    border-radius: 8px;
    background: rgba(5, 20, 13, .94);
    color: #d7e7da;
    font-size: 11px;
  }
  #room.landscape-eight .landscape-pot { color: #f2d486; }
  #room.landscape-eight .table-surface { display: none !important; }
  #room.landscape-eight .side { display: none !important; }
  #room.landscape-eight .layout { display: block; height: auto; margin: 0; }
  #room.landscape-eight .table-wrap { height: auto; min-height: 0; }
  #room.landscape-eight .actions {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 8px;
    padding: 8px !important;
    gap: 6px !important;
  }
  #room.landscape-eight .actions button {
    min-height: 32px !important;
    padding: 6px 9px !important;
    font-size: 11px !important;
  }
  #room.landscape-eight .actions .raise-box {
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  #room.landscape-eight .actions .raise-track {
    flex: 1 1 100px !important;
    width: auto !important;
    min-width: 80px !important;
  }
}

/* Portrait board: clear self / acting / readable cards. */
.mobile-status {
  display: inline-block;
  margin-top: 2px;
  color: #91a99a;
  font-size: 9px;
  line-height: 1.1;
}
#room.landscape-eight .mobile-player.you {
  border-color: rgba(231, 196, 106, .9) !important;
  box-shadow: 0 0 0 1px rgba(231, 196, 106, .38), 0 0 16px rgba(231, 196, 106, .14);
}
#room.landscape-eight .mobile-player.actor {
  border-color: #c7ffe3 !important;
  box-shadow: 0 0 0 2px rgba(199, 255, 227, .8), 0 0 22px rgba(125, 255, 200, .34);
}
#room.landscape-eight .mobile-player.actor .mobile-status {
  color: #c7ffe3;
  font-weight: 700;
}
#room.landscape-eight .mobile-player.you .mobile-status {
  color: #e7c46a;
  font-weight: 600;
}

#room.landscape-eight .mobile-cards .card {
  overflow: hidden;
}
#room.landscape-eight .mobile-cards .hole-badge {
  top: auto;
  right: 1px;
  bottom: 1px;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  font-size: 7px;
}
#room.landscape-eight .mobile-cards .own-hole-card:hover .hole-badge {
  display: none;
}

@media (max-width: 899px) and (orientation: portrait) {
  #room.landscape-eight .mobile-cards .card {
    width: 30px !important;
    height: 44px !important;
    flex-basis: 30px !important;
  }
  #room.landscape-eight .mobile-cards .card .rank { font-size: 10px !important; }
  #room.landscape-eight .mobile-cards .card .suit { font-size: 11px !important; }
  #room.landscape-eight .mobile-status { font-size: 10px; }
}

/* Remove the mobile white tap flash on the chip canvas. */
#trayCanvas,
.tray-scroll {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
#trayCanvas {
  touch-action: pan-y;
  user-select: none;
}

/* Acting player: keep a mint outline even when it is also yourself. */
#room.landscape-eight .mobile-player.actor {
  outline: 2px solid #c7ffe3;
  outline-offset: 2px;
}

/* Phone player-board must not remove the chip tray, voice panel or chat. */
#room.landscape-eight .side {
  display: flex !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 8px !important;
  gap: 10px !important;
  z-index: auto !important;
}
#room.landscape-eight .side .chat-box {
  display: block !important;
}
#room.landscape-eight .side .chip-tray-box {
  height: auto !important;
  min-height: 0 !important;
}
#room.landscape-eight .side .tray-scroll {
  max-height: 300px;
}

/* Touch devices must use a click toggle, not sticky :hover. */
.card.own-hole-card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.card.own-hole-card.peeking::before {
  transform: rotateY(-96deg) skewY(-1deg) !important;
  opacity: 0 !important;
}
.card.own-hole-card.peeking .rank,
.card.own-hole-card.peeking .suit,
.card.own-hole-card.peeking .hole-badge {
  visibility: visible !important;
}
.card.own-hole-card.peeking .hole-badge {
  display: none !important;
}
@media (hover: none) {
  .card.own-hole-card:hover:not(.peeking)::before {
    transform: none;
    opacity: 1;
  }
  .card.own-hole-card:hover:not(.peeking) .rank,
  .card.own-hole-card:hover:not(.peeking) .suit,
  .card.own-hole-card:hover:not(.peeking) .hole-badge {
    visibility: hidden;
  }
}

/* Touch devices: never let a sticky :hover reveal the hole card. */
body.touch-ui .card.own-hole-card:hover:not(.peeking)::before {
  transform: none !important;
  opacity: 1 !important;
}
body.touch-ui .card.own-hole-card:hover:not(.peeking) .rank,
body.touch-ui .card.own-hole-card:hover:not(.peeking) .suit,
body.touch-ui .card.own-hole-card:hover:not(.peeking) .hole-badge {
  visibility: hidden !important;
}
body.touch-ui .card.own-hole-card.peeking:hover::before {
  transform: rotateY(-96deg) skewY(-1deg) !important;
  opacity: 0 !important;
}
body.touch-ui .card.own-hole-card.peeking:hover .rank,
body.touch-ui .card.own-hole-card.peeking:hover .suit,
body.touch-ui .card.own-hole-card.peeking:hover .hole-badge {
  visibility: visible !important;
}
