:root {
  color-scheme: dark;
  --bg: #080705;
  --panel: #12100d;
  --panel-2: #1b1711;
  --felt: #14523a;
  --felt-dark: #082a20;
  --gold: #f4b84a;
  --orange: #ff8800;
  --red: #d91f2d;
  --blue: #3aa7ff;
  --ink: #f7f1e4;
  --muted: #b7a992;
  --line: rgba(244, 184, 74, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 136, 0, 0.12), transparent 28%),
    radial-gradient(circle at 85% 25%, rgba(58, 167, 255, 0.10), transparent 30%),
    linear-gradient(145deg, #030302, #11100c 56%, #050504);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #282015, #17120c);
  color: var(--ink);
  cursor: pointer;
  min-height: 34px;
  padding: 7px 11px;
}

button:hover,
button.is-active {
  border-color: rgba(255, 136, 0, 0.86);
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #070604;
  color: var(--ink);
  padding: 8px 10px;
}

.card-room {
  height: 100vh;
  overflow: hidden;
  padding: 12px 16px;
}

.card-room[data-view="lobby"] .game-layout,
.card-room[data-view="table"] .lobby-screen {
  display: none;
}

.topbar {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  height: 66px;
  margin: 0 auto 10px;
  max-width: 1500px;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1;
  margin: 0;
}

.beta-tag {
  border: 1px solid rgba(244, 184, 74, 0.38);
  border-radius: 999px;
  color: var(--gold);
  display: inline-flex;
  font-size: 0.38em;
  font-weight: 700;
  line-height: 1;
  margin-left: 8px;
  padding: 6px 9px;
  text-transform: uppercase;
  vertical-align: middle;
}

.panel-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
}

.connection-pill {
  align-items: center;
  justify-self: end;
  border: 1px solid rgba(125, 255, 156, 0.3);
  border-radius: 999px;
  color: #9fffc1;
  display: inline-flex;
  gap: 8px;
  padding: 8px 12px;
}

.topbar-actions {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  justify-self: end;
}

.sound-button,
.table-fullscreen-button,
.table-sound-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.08)),
    rgba(18, 16, 13, 0.92);
  border-color: rgba(244, 184, 74, 0.34);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sound-button.is-active,
.table-fullscreen-button.is-active,
.table-sound-button.is-active {
  border-color: rgba(125, 255, 156, 0.48);
  color: #9fffc1;
}

.table-fullscreen-button,
.table-sound-button {
  justify-self: end;
  min-height: 30px;
  padding: 5px 9px;
  position: absolute;
  top: 2px;
  z-index: 32;
}

.table-fullscreen-button {
  display: none;
  right: 10px;
}

.table-sound-button {
  display: none;
  right: 10px;
}

.site-back-link {
  align-items: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  min-height: 36px;
  padding: 8px 13px;
  text-decoration: none;
}

.site-back-link:hover {
  border-color: rgba(255, 136, 0, 0.62);
  color: var(--gold);
}

.status-dot {
  background: #7dff9c;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(125, 255, 156, 0.8);
  height: 8px;
  width: 8px;
}

.game-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 16px;
  height: calc(100vh - 100px);
  margin: 0 auto;
  max-width: 1500px;
  min-height: 0;
}

.lobby-screen {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr) minmax(260px, 0.85fr);
  gap: 16px;
  height: calc(100vh - 100px);
  margin: 0 auto;
  max-width: 1500px;
  min-height: 0;
}

.lobby-card {
  background: linear-gradient(180deg, rgba(18, 16, 13, 0.96), rgba(7, 6, 4, 0.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.lobby-card {
  position: relative;
}

.lobby-card::before {
  background: linear-gradient(90deg, transparent, rgba(244, 184, 74, 0.22), transparent);
  content: "";
  height: 1px;
  left: 12px;
  opacity: 0.65;
  position: absolute;
  right: 12px;
  top: 0;
}

.lobby-card .field-label {
  display: block;
  margin: 12px 0 6px;
}

.compact-code-label {
  margin-top: 4px;
}

.wide-button {
  margin-top: 14px;
  width: 100%;
}

.helper-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 12px 0 0;
}

.lobby-showcase {
  align-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 54, 201, 0.18), transparent 28%),
    radial-gradient(circle at 86% 28%, rgba(75, 255, 220, 0.15), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.12));
  border: 1px solid rgba(244, 184, 74, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 92px 1fr;
  margin-bottom: 13px;
  padding: 12px;
}

.mini-table-orbit {
  align-items: center;
  aspect-ratio: 1.35;
  background:
    radial-gradient(ellipse at center, rgba(75, 255, 220, 0.22), rgba(18, 74, 59, 0.78) 45%, rgba(7, 4, 12, 0.96) 74%);
  border: 5px solid rgba(244, 184, 74, 0.28);
  border-radius: 48%;
  display: flex;
  justify-content: center;
  position: relative;
}

.mini-table-orbit span {
  background: linear-gradient(180deg, #fff4c7, #ff36c9);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 54, 201, 0.45);
  height: 10px;
  position: absolute;
  width: 10px;
}

.mini-table-orbit span:nth-child(1) {
  left: 18%;
  top: 24%;
}

.mini-table-orbit span:nth-child(2) {
  right: 18%;
  top: 24%;
}

.mini-table-orbit span:nth-child(3) {
  bottom: 18%;
  left: 28%;
}

.mini-table-orbit span:nth-child(4) {
  bottom: 18%;
  right: 28%;
}

.mini-table-orbit strong {
  color: #fff4c7;
  font-size: 13px;
  text-shadow:
    0 0 10px rgba(75, 255, 220, 0.7),
    0 0 14px rgba(255, 54, 201, 0.55);
}

.lobby-stats {
  display: grid;
  gap: 2px;
}

.lobby-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.lobby-stats strong {
  color: #9fffc1;
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(125, 255, 156, 0.32);
}

.lobby-stats em {
  color: #fff4c7;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.room-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: calc(100vh - 265px);
  overflow-y: auto;
}

.room-row {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(244, 184, 74, 0.06), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  min-height: 58px;
  text-align: left;
}

.room-row strong,
.room-row small,
.room-row em {
  display: block;
}

.room-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.room-row em {
  background: rgba(125, 255, 156, 0.08);
  border: 1px solid rgba(125, 255, 156, 0.2);
  border-radius: 999px;
  color: #9fffc1;
  font-style: normal;
  font-weight: 700;
  padding: 4px 8px;
}

.empty-room {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
}

.auth-prompt {
  border-color: rgba(244, 184, 74, 0.3);
}

.auth-prompt strong,
.auth-prompt span {
  display: block;
}

.auth-prompt strong {
  color: var(--gold);
  font-size: 15px;
  margin-bottom: 6px;
}

.auth-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.auth-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  text-decoration: none;
}

.auth-button.primary {
  background: linear-gradient(180deg, #ff9e24, #d46a00);
  border-color: transparent;
  color: #1a0d02;
}

.side-panel {
  background: linear-gradient(180deg, rgba(18, 16, 13, 0.96), rgba(7, 6, 4, 0.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
}

.panel-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-heading span,
.field-label,
.settings-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel-heading strong {
  color: var(--gold);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 6px 0 10px;
}

.small-button {
  min-width: 58px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toggle-field {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.05));
  border: 1px solid rgba(244, 184, 74, 0.18);
  border-radius: 7px;
  color: var(--ink);
  display: flex;
  gap: 9px;
  margin-top: 10px;
  min-height: 38px;
  padding: 8px 10px;
}

.toggle-field input {
  accent-color: var(--orange);
  min-height: 18px;
  width: 18px;
}

.toggle-field span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.host-actions {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.primary-button {
  background: linear-gradient(180deg, #ff9e24, #d46a00);
  border-color: transparent;
  color: #1a0d02;
  font-weight: 700;
}

.rule-card {
  background: rgba(255, 136, 0, 0.08);
  border: 1px solid rgba(255, 136, 0, 0.22);
  border-radius: 8px;
  padding: 10px;
}

.rule-card span {
  color: var(--gold);
  font-weight: 700;
}

.rule-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin: 8px 0 0;
}

.table-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.table-status {
  align-items: center;
  background: rgba(7, 6, 4, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  grid-template-columns: 1fr auto 1fr;
  min-height: 34px;
  padding: 6px 14px;
}

.table-status strong {
  color: var(--ink);
  font-size: 14px;
}

.table-status span:last-child {
  text-align: right;
}

.felt-table {
  aspect-ratio: auto;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08), transparent 45%),
    radial-gradient(ellipse at center, #1d6b4c, var(--felt) 42%, var(--felt-dark) 74%);
  border: 13px solid #24160d;
  border-radius: 48%;
  box-shadow:
    inset 0 0 0 7px rgba(244, 184, 74, 0.22),
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    0 30px 80px rgba(0, 0, 0, 0.55);
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow: visible;
  position: relative;
}

.card-room[data-theme="graveyard"] .felt-table {
  background:
    radial-gradient(ellipse at center, rgba(189, 255, 164, 0.08), transparent 45%),
    radial-gradient(ellipse at center, #24563e, #17352e 45%, #081511 76%);
  border-color: #201916;
  box-shadow:
    inset 0 0 0 7px rgba(125, 255, 156, 0.16),
    inset 0 0 56px rgba(0, 0, 0, 0.62),
    0 30px 80px rgba(0, 0, 0, 0.58);
}

.card-room[data-theme="neon"] .felt-table {
  background:
    radial-gradient(ellipse at 55% 45%, rgba(75, 255, 220, 0.16), transparent 48%),
    radial-gradient(ellipse at center, #0d665d, #102949 48%, #08090f 76%);
  border-color: #141328;
  box-shadow:
    inset 0 0 0 7px rgba(75, 255, 220, 0.17),
    inset 0 0 56px rgba(0, 0, 0, 0.62),
    0 30px 80px rgba(0, 0, 0, 0.58);
}

.card-room[data-theme="blacklight"] .felt-table {
  background:
    radial-gradient(ellipse at 52% 46%, rgba(142, 255, 85, 0.18), transparent 24%),
    radial-gradient(ellipse at 45% 42%, rgba(35, 226, 255, 0.22), transparent 44%),
    radial-gradient(ellipse at center, #111f3d, #140c34 50%, #05040d 78%);
  border-color: #070613;
  box-shadow:
    inset 0 0 0 7px rgba(55, 236, 255, 0.16),
    inset 0 0 34px rgba(144, 255, 76, 0.16),
    inset 0 0 70px rgba(0, 0, 0, 0.68),
    0 0 34px rgba(55, 236, 255, 0.18),
    0 30px 84px rgba(0, 0, 0, 0.68);
}

.card-room[data-theme="fluoro"] .felt-table {
  background:
    radial-gradient(ellipse at 50% 44%, rgba(255, 244, 95, 0.16), transparent 24%),
    radial-gradient(ellipse at 56% 46%, rgba(255, 54, 201, 0.28), transparent 46%),
    radial-gradient(ellipse at center, #622a73, #2d1244 52%, #090413 78%);
  border-color: #17071f;
  box-shadow:
    inset 0 0 0 7px rgba(255, 54, 201, 0.22),
    inset 0 0 34px rgba(255, 244, 95, 0.14),
    inset 0 0 70px rgba(0, 0, 0, 0.62),
    0 0 36px rgba(255, 54, 201, 0.18),
    0 30px 84px rgba(0, 0, 0, 0.64);
}

.card-room[data-theme="gold"] .felt-table {
  background:
    radial-gradient(ellipse at center, rgba(255, 234, 156, 0.10), transparent 45%),
    radial-gradient(ellipse at center, #23624e, #164030 46%, #1a1208 78%);
  border-color: #3a250f;
  box-shadow:
    inset 0 0 0 7px rgba(244, 184, 74, 0.28),
    inset 0 0 58px rgba(0, 0, 0, 0.58),
    0 30px 80px rgba(0, 0, 0, 0.58);
}

.table-rail {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 48%;
  inset: 13px;
  pointer-events: none;
  position: absolute;
}

.card-room[data-theme="blacklight"] .table-rail {
  border-color: rgba(142, 255, 85, 0.24);
  box-shadow:
    inset 0 0 18px rgba(55, 236, 255, 0.15),
    0 0 18px rgba(142, 255, 85, 0.14);
}

.card-room[data-theme="fluoro"] .table-rail {
  border-color: rgba(255, 244, 95, 0.25);
  box-shadow:
    inset 0 0 18px rgba(255, 54, 201, 0.2),
    0 0 20px rgba(255, 244, 95, 0.13);
}

.card-room[data-theme="fluoro"] .pot-display {
  background: rgba(24, 4, 32, 0.55);
  border-color: rgba(255, 54, 201, 0.26);
  box-shadow:
    0 0 18px rgba(255, 54, 201, 0.14),
    inset 0 0 12px rgba(255, 244, 95, 0.08);
}

.card-room[data-theme="blacklight"] .table-center {
  filter: drop-shadow(0 0 14px rgba(55, 236, 255, 0.16));
}

.card-room[data-theme="blacklight"] .pot-display {
  background: rgba(7, 4, 18, 0.54);
  border-color: rgba(55, 236, 255, 0.2);
  box-shadow: 0 0 18px rgba(55, 236, 255, 0.12);
}

.felt-table::after {
  border-radius: inherit;
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.42);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.table-center {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, 38vw);
  z-index: 4;
}

.community-cards {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: center;
  min-height: 84px;
}

.felt-table.is-dealing .playing-card {
  animation: dealSnap 520ms ease-out both;
}

.felt-table.is-dealing .playing-card:nth-child(2) {
  animation-delay: 45ms;
}

.felt-table.is-dealing .playing-card:nth-child(3) {
  animation-delay: 90ms;
}

.felt-table.is-dealing .playing-card:nth-child(4) {
  animation-delay: 135ms;
}

.felt-table.is-dealing .playing-card:nth-child(5) {
  animation-delay: 180ms;
}

.felt-table.is-winner-moment::before {
  animation: winnerFlash 1300ms ease-out;
  background:
    radial-gradient(circle at 50% 52%, rgba(244, 184, 74, 0.34), transparent 28%),
    radial-gradient(circle at 46% 50%, rgba(125, 255, 156, 0.18), transparent 34%);
  border-radius: inherit;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 6;
}

.pot-display {
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  display: inline-flex;
  gap: 10px;
  left: 50%;
  margin-top: 6px;
  padding: 6px 14px;
  position: relative;
  transform: translateX(-50%);
}

.pot-display.is-pulsing {
  animation: potPulse 900ms ease-out;
}

.pot-display.is-pulsing::after {
  animation: chipSpark 900ms ease-out;
  border: 2px solid rgba(244, 184, 74, 0.55);
  border-radius: 50%;
  content: "";
  height: 10px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
}

.pot-display span {
  color: var(--muted);
}

.pot-display strong {
  color: var(--gold);
}

.table-message {
  color: #fff8e2;
  font-size: 12px;
  margin: 7px auto 0;
  max-width: 520px;
  min-height: 22px;
  text-align: center;
}

.waiting-state {
  align-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 255, 156, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(244, 184, 74, 0.24);
  border-radius: 8px;
  display: inline-grid;
  gap: 5px;
  justify-items: center;
  max-width: min(300px, 100%);
  padding: 9px 12px;
}

.waiting-state strong {
  color: var(--ink);
  font-size: 14px;
}

.waiting-state span {
  color: var(--muted);
  font-size: 11px;
}

.seats {
  inset: 0;
  position: absolute;
  z-index: 5;
}

.seat {
  border-radius: 50px 10px 10px 50px;
  left: var(--seat-left, 50%);
  isolation: isolate;
  min-height: 100px;
  padding: 0;
  position: absolute;
  top: var(--seat-top, 50%);
  transform: translate(-50%, -50%);
  width: 202px;
  z-index: 1;
}

.seat::before {
  border-radius: 56px 12px 12px 56px;
  content: "";
  inset: -5px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 180ms ease;
  z-index: 0;
}

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

.seat.is-active {
  z-index: 8;
}

.seat.has-action-timer::before {
  animation: actionTimer 18s linear infinite;
  background: conic-gradient(from 0deg, rgba(244, 184, 74, 0.95), rgba(255, 136, 0, 0.65), transparent 72%);
  opacity: 1;
}

.seat.is-winner {
  z-index: 9;
}

.seat.is-winner::before {
  animation: winnerGlow 1400ms ease-in-out infinite alternate;
  background: radial-gradient(circle, rgba(244, 184, 74, 0.42), transparent 64%);
  opacity: 1;
}

.seat.is-mine {
  z-index: 7;
}

.seat.is-active .seat-avatar,
.seat.is-active .seat-plate {
  border-color: rgba(244, 184, 74, 0.95);
  box-shadow:
    0 0 0 1px rgba(244, 184, 74, 0.24),
    0 0 24px rgba(244, 184, 74, 0.36);
}

.seat.is-host .seat-avatar {
  border-color: rgba(244, 184, 74, 0.82);
  box-shadow:
    0 0 0 2px rgba(244, 184, 74, 0.24),
    0 12px 24px rgba(0, 0, 0, 0.46),
    inset 0 0 18px rgba(255, 255, 255, 0.10);
}

.seat.is-all-in .seat-avatar,
.seat.is-all-in .seat-plate {
  border-color: rgba(255, 58, 72, 0.88);
  box-shadow:
    0 0 0 1px rgba(255, 58, 72, 0.32),
    0 0 28px rgba(255, 58, 72, 0.36);
}

.seat.is-winner .seat-avatar,
.seat.is-winner .seat-plate {
  border-color: rgba(244, 184, 74, 0.95);
  box-shadow:
    0 0 0 1px rgba(244, 184, 74, 0.32),
    0 0 30px rgba(244, 184, 74, 0.5),
    inset 0 0 24px rgba(244, 184, 74, 0.12);
}

.seat.is-winner .seat-avatar {
  animation: winnerPop 1200ms ease-in-out infinite alternate;
}

.seat.is-mine .seat-avatar,
.seat.is-mine .seat-plate {
  border-color: rgba(125, 255, 156, 0.58);
}

.seat.is-folded .seat-avatar,
.seat.is-folded .seat-plate,
.seat.is-folded .hand-fan {
  opacity: 0.58;
}

.seat.is-sitting-out,
.seat.is-disconnected {
  opacity: 0.76;
}

.seat.is-open {
  min-height: 74px;
}

.seat.is-disconnected .seat-badge {
  border-color: rgba(217, 31, 45, 0.42);
  color: #ffb0b0;
}

.seat.is-disconnected .seat-avatar {
  border-color: rgba(217, 31, 45, 0.62);
  box-shadow:
    0 0 0 2px rgba(217, 31, 45, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.46);
}

.seat.is-sitting-out .seat-badge {
  border-color: rgba(244, 184, 74, 0.32);
  color: var(--muted);
}

.seat-shell {
  align-items: center;
  display: grid;
  grid-template-columns: 64px 1fr;
  min-height: 66px;
  position: relative;
}

.seat-avatar {
  align-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.22), transparent 18%),
    linear-gradient(145deg, #292622, #050504);
  border: 3px solid rgba(255, 255, 255, 0.66);
  border-radius: 50%;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.46),
    inset 0 0 18px rgba(255, 255, 255, 0.10);
  color: #fff9e8;
  display: flex;
  font-size: 22px;
  font-weight: 800;
  height: 64px;
  justify-content: center;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.68);
  width: 64px;
  z-index: 3;
}

.seat-avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.seat-plate {
  background:
    linear-gradient(90deg, rgba(11, 15, 25, 0.96), rgba(28, 38, 62, 0.88) 58%, rgba(8, 9, 14, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 54%);
  border: 1px solid rgba(165, 190, 255, 0.26);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  clip-path: polygon(0 0, 100% 0, 94% 100%, 0 100%, 8px 50%);
  margin-left: -12px;
  min-width: 0;
  padding: 7px 12px 8px 21px;
  transform: skewX(-7deg);
  z-index: 2;
}

.seat-plate > * {
  transform: skewX(7deg);
}

.seat-name-row,
.seat-stack-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.seat-name {
  color: var(--ink);
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-badge {
  background: rgba(255, 136, 0, 0.16);
  border: 1px solid rgba(255, 136, 0, 0.24);
  border-radius: 999px;
  color: var(--gold);
  font-size: 10px;
  min-width: 26px;
  padding: 2px 7px;
  text-align: center;
}

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

.seat-stack-row {
  color: #f6eee0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.05;
  margin-top: 1px;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.76);
}

.seat-bet {
  color: #9fffc1;
  font-size: 11px;
  font-weight: 800;
  margin-left: 8px;
  white-space: nowrap;
}

.seat-status-ribbon {
  background: linear-gradient(180deg, #f1323e, #ba101d);
  border-radius: 2px;
  bottom: 0;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.36);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  left: 66px;
  letter-spacing: 0;
  min-width: 58px;
  padding: 2px 11px 3px;
  position: absolute;
  text-align: center;
  text-transform: uppercase;
  transform: skewX(-7deg);
  z-index: 4;
}

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

.seat-marker-tokens {
  display: flex;
  gap: 3px;
  left: 52px;
  position: absolute;
  top: -7px;
  z-index: 6;
}

.seat-marker {
  align-items: center;
  background: linear-gradient(180deg, #fff7ce, #e0ad35);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  color: #1b1004;
  display: flex;
  font-size: 10px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  min-width: 24px;
  padding: 0 4px;
}

.seat-marker.blind {
  background: linear-gradient(180deg, #bfffee, #36d9ff);
  color: #031419;
}

.hand-fan {
  height: 32px;
  margin-left: 54px;
  margin-top: 0;
  position: relative;
  width: 92px;
}

.seat-actions {
  display: flex;
  gap: 6px;
  margin-left: 58px;
  margin-top: 2px;
  width: 102px;
}

.seat-actions button {
  flex: 1;
  font-size: 11px;
  min-height: 21px;
  padding: 3px 7px;
}

.gift-picker-wrap {
  display: flex;
  flex: 1;
  min-width: 0;
  position: relative;
}

.seat-gift-toggle {
  width: 100%;
}

.gift-panel {
  background:
    linear-gradient(180deg, rgba(28, 18, 8, 0.98), rgba(6, 5, 3, 0.98));
  border: 1px solid rgba(244, 184, 74, 0.42);
  border-radius: 8px;
  bottom: calc(100% + 6px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42);
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 28px);
  left: 50%;
  padding: 6px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 20;
}

.gift-panel[hidden] {
  display: none;
}

.gift-panel button {
  align-items: center;
  border-radius: 7px;
  display: flex;
  font-size: 16px;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  padding: 0;
  width: 28px;
}

.table-gift {
  align-items: center;
  animation: giftFloat 2200ms ease-out forwards;
  display: flex;
  flex-direction: column;
  gap: 2px;
  left: var(--gift-left, 50%);
  pointer-events: none;
  position: absolute;
  top: var(--gift-top, 50%);
  transform: translate(-50%, -86px);
  z-index: 18;
}

.table-gift-icon {
  align-items: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.28), transparent 32%),
    linear-gradient(145deg, rgba(244, 184, 74, 0.96), rgba(153, 72, 0, 0.94));
  border: 2px solid rgba(255, 244, 199, 0.9);
  border-radius: 50%;
  box-shadow:
    0 0 24px rgba(244, 184, 74, 0.44),
    0 10px 22px rgba(0, 0, 0, 0.4);
  display: flex;
  font-size: 25px;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.table-gift-label {
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(244, 184, 74, 0.28);
  border-radius: 999px;
  color: #fff4c7;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.72);
}

.mobile-gift-dock {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(30, 18, 7, 0.96), rgba(7, 5, 3, 0.98));
  border: 1px solid rgba(244, 184, 74, 0.42);
  border-radius: 10px;
  bottom: 10px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.44);
  display: none;
  gap: 8px;
  left: 50%;
  max-width: calc(100% - 20px);
  padding: 7px 8px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 24;
}

.mobile-gift-dock[hidden] {
  display: none;
}

.mobile-gift-target {
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.05;
  min-width: 66px;
}

.mobile-gift-target strong {
  color: var(--ink);
  font-size: 11px;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-gift-target em {
  color: #9fffc1;
  font-size: 10px;
  font-style: normal;
  margin-top: 1px;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-gift-list {
  display: flex;
  gap: 5px;
}

.mobile-gift-list button,
.mobile-gift-close {
  align-items: center;
  border-radius: 8px;
  display: flex;
  font-size: 16px;
  height: 30px;
  justify-content: center;
  min-height: 30px;
  padding: 0;
  width: 30px;
}

.mobile-gift-close {
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.seat-profile-popover {
  background:
    linear-gradient(180deg, rgba(17, 15, 11, 0.98), rgba(7, 6, 4, 0.98));
  border: 1px solid rgba(244, 184, 74, 0.36);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.48);
  left: var(--profile-left, 50%);
  min-width: 170px;
  padding: 9px;
  position: absolute;
  top: var(--profile-top, 50%);
  transform: translate(-50%, calc(-100% - 62px));
  z-index: 25;
}

.seat-profile-popover[hidden] {
  display: none;
}

.seat-profile-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.seat-profile-head strong {
  color: var(--ink);
  font-size: 13px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-profile-head button {
  border-radius: 7px;
  font-size: 16px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  width: 26px;
}

.seat-profile-meta {
  color: var(--muted);
  display: flex;
  font-size: 11px;
  gap: 8px;
  justify-content: space-between;
  margin-top: 5px;
}

.seat-profile-gifts {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 8px;
}

.seat-profile-gifts button {
  align-items: center;
  border-radius: 7px;
  display: flex;
  font-size: 15px;
  height: 28px;
  justify-content: center;
  min-height: 28px;
  padding: 0;
}

.seat.is-open .hand-fan {
  display: none;
}

.seat.is-open .seat-actions {
  margin-left: 70px;
  margin-top: 4px;
  width: 92px;
}

@keyframes actionTimer {
  to {
    transform: rotate(360deg);
  }
}

@keyframes winnerGlow {
  from {
    filter: blur(2px);
    transform: scale(0.98);
  }

  to {
    filter: blur(7px);
    transform: scale(1.08);
  }
}

@keyframes winnerPop {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(-1px) scale(1.03);
  }
}

@keyframes giftFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -58px) scale(0.76);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -86px) scale(1.06);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, -108px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -132px) scale(0.9);
  }
}

@keyframes dealSnap {
  0% {
    filter: brightness(1.18);
    opacity: 0;
    scale: 0.92;
    translate: 0 -10px;
  }

  100% {
    filter: brightness(1);
    opacity: 1;
    scale: 1;
    translate: 0 0;
  }
}

@keyframes winnerFlash {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  24% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes potPulse {
  0% {
    box-shadow: 0 0 0 rgba(244, 184, 74, 0);
    transform: translateX(-50%) scale(1);
  }

  35% {
    box-shadow: 0 0 28px rgba(244, 184, 74, 0.42);
    transform: translateX(-50%) scale(1.08);
  }

  100% {
    box-shadow: 0 0 0 rgba(244, 184, 74, 0);
    transform: translateX(-50%) scale(1);
  }
}

@keyframes chipSpark {
  0% {
    box-shadow:
      0 0 0 rgba(244, 184, 74, 0),
      0 0 0 rgba(244, 184, 74, 0);
    opacity: 0.9;
  }

  100% {
    box-shadow:
      -42px -12px 0 -3px rgba(244, 184, 74, 0),
      38px 14px 0 -3px rgba(255, 136, 0, 0),
      -20px 24px 0 -4px rgba(244, 184, 74, 0),
      18px -25px 0 -4px rgba(255, 136, 0, 0);
    height: 34px;
    opacity: 0;
    width: 34px;
  }
}

.playing-card {
  align-items: flex-start;
  background: linear-gradient(145deg, #fffdf5, #dcd5c9);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 7px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.34);
  color: #14100c;
  display: flex;
  flex-direction: column;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  height: 70px;
  justify-content: flex-start;
  line-height: 1;
  position: relative;
  width: 50px;
  padding: 7px 0 0 8px;
}

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

.playing-card .rank {
  font-size: 18px;
  letter-spacing: 0;
}

.playing-card .suit {
  font-size: 18px;
  margin-top: 2px;
}

.playing-card::before {
  bottom: 8px;
  content: attr(data-suit);
  font-size: 22px;
  left: 50%;
  line-height: 1;
  position: absolute;
  transform: translateX(-50%);
}

.playing-card.is-hole {
  height: 42px;
  position: absolute;
  top: 1px;
  width: 31px;
  padding: 5px 0 0 5px;
}

.playing-card.is-hole .rank {
  font-size: 15px;
}

.playing-card.is-hole .suit {
  font-size: 14px;
}

.playing-card.is-hole::before {
  bottom: 4px;
  font-size: 16px;
}

.playing-card.is-hidden {
  background:
    linear-gradient(135deg, rgba(255, 136, 0, 0.16), transparent 40%),
    repeating-linear-gradient(45deg, #14100c 0 5px, #21160d 5px 10px);
  color: transparent;
  padding: 0;
}

.playing-card.is-hidden::after {
  color: var(--gold);
  content: "SH";
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
}

.playing-card.is-hidden::before {
  content: "";
}

.action-dock {
  align-items: center;
  background: rgba(7, 6, 4, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 0.9fr) auto;
  gap: 10px;
  margin-top: 0;
  padding: 10px;
}

.action-dock span,
.action-dock strong {
  display: block;
}

#activeSeatLabel {
  color: var(--ink);
  font-weight: 700;
}

#toCallLabel,
#raiseLabel {
  color: var(--muted);
  font-size: 13px;
}

.bet-control {
  align-items: center;
  display: grid;
  gap: 5px;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.panel-tab {
  flex: 1;
}

.mobile-chat-toggle,
.mobile-chat-header {
  display: none;
}

.mobile-chat-toggle-count {
  align-items: center;
  background: var(--red);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 10px;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  position: absolute;
  right: 4px;
  top: 4px;
}

.mobile-chat-toggle-count[hidden] {
  display: none;
}

.mobile-chat-header strong,
.mobile-chat-header small {
  display: block;
}

.mobile-chat-header strong {
  color: var(--ink);
  font-size: 14px;
}

.mobile-chat-header small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

#mobileChatClose {
  border-radius: 7px;
  font-size: 20px;
  height: 31px;
  line-height: 1;
  min-height: 31px;
  padding: 0;
  width: 31px;
}

.table-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel-body {
  display: none;
  min-height: 0;
}

.panel-body.is-active {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 12px;
  min-height: 0;
}

.chat-messages,
.event-log,
.rules-text {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.chat-line,
.log-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.chat-line {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  padding: 7px;
}

.chat-line-head {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: flex-start;
  min-width: 0;
}

.chat-line-head strong {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-line-text {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  padding-right: 2px;
  width: 100%;
}

.chat-line strong,
.log-line strong {
  color: var(--gold);
}

.chat-reactions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.chat-reaction,
.emoji-panel button,
.chat-emoji-toggle,
.message-emoji-toggle {
  align-items: center;
  background: rgba(255, 136, 0, 0.08);
  border: 1px solid rgba(244, 184, 74, 0.18);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  gap: 4px;
  justify-content: center;
  min-height: 24px;
  min-width: 28px;
  padding: 2px 7px;
}

.message-emoji-toggle,
.chat-emoji-toggle {
  flex: 0 0 auto;
  font-size: 14px;
  min-height: 26px;
  min-width: 30px;
  padding: 2px 7px;
}

.emoji-picker-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  position: relative;
}

.emoji-panel {
  background: rgba(12, 10, 7, 0.98);
  border: 1px solid rgba(244, 184, 74, 0.28);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.48);
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(3, 30px);
  padding: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 20;
}

.emoji-panel[hidden] {
  display: none;
}

.emoji-panel button {
  font-size: 15px;
  padding: 2px;
}

.chat-reaction {
  font-size: 13px;
}

.chat-reaction.is-counted {
  background: rgba(125, 255, 156, 0.09);
  border-color: rgba(125, 255, 156, 0.24);
}

.chat-reaction em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.chat-form {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-top: 10px;
  position: relative;
}

.chat-form .emoji-panel {
  bottom: calc(100% + 6px);
  right: 70px;
  top: auto;
}

.rules-text h3 {
  color: var(--gold);
  margin: 0 0 8px;
}

.rules-text p,
.rules-text li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.rules-text ul {
  margin: 8px 0 16px;
  padding-left: 18px;
}

@media (max-width: 1180px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .card-room {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .game-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .lobby-screen {
    grid-template-columns: 1fr;
    height: auto;
  }

  .room-list {
    max-height: none;
  }

  .side-panel {
    min-height: 0;
  }

  .table-center {
    width: min(540px, 64vw);
  }

  .table-fullscreen-button {
    display: block;
    top: 42px;
  }

  .table-sound-button {
    display: block;
    right: 64px;
    top: 42px;
  }

  .sound-button {
    display: none;
  }

  .table-panel {
    height: min(58vh, 560px);
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  .card-room {
    padding: 10px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
    height: auto;
    margin-bottom: 16px;
  }

  .connection-pill {
    max-width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    white-space: nowrap;
  }

  .topbar-actions {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-self: start;
  }

  .card-room[data-view="table"] .table-panel {
    background: transparent;
    border: 0;
    bottom: auto;
    height: min(74dvh, 560px);
    max-height: calc(100dvh - 92px);
    min-height: 390px;
    overflow: visible;
    padding: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 80px;
    transform: translateX(calc(100% - 52px));
    transition: transform 180ms ease;
    width: min(390px, 100vw);
    z-index: 40;
  }

  .card-room[data-view="table"] .table-panel.is-mobile-open {
    pointer-events: auto;
    transform: translateX(0);
  }

  .card-room[data-view="table"] .mobile-chat-toggle {
    align-items: center;
    background:
      radial-gradient(circle at 50% 35%, rgba(244, 184, 74, 0.28), transparent 58%),
      rgba(12, 9, 5, 0.96);
    border: 1px solid rgba(244, 184, 74, 0.58);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42);
    color: var(--ink);
    display: flex;
    font-size: 11px;
    font-weight: 900;
    height: 52px;
    justify-content: center;
    left: -2px;
    min-height: 52px;
    padding: 0;
    pointer-events: auto;
    position: absolute;
    text-transform: uppercase;
    top: 68px;
    width: 52px;
    z-index: 2;
  }

  .card-room[data-view="table"] .mobile-chat-header,
  .card-room[data-view="table"] .table-panel .panel-tabs,
  .card-room[data-view="table"] .table-panel .panel-body {
    margin-left: 50px;
    width: calc(100% - 50px);
  }

  .card-room[data-view="table"] .mobile-chat-header {
    align-items: center;
    background: rgba(30, 18, 7, 0.97);
    border: 1px solid rgba(244, 184, 74, 0.54);
    border-bottom: 0;
    border-radius: 10px 0 0 0;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 54px;
    padding: 9px 10px;
  }

  .card-room[data-view="table"] .table-panel .panel-tabs {
    background: rgba(7, 6, 4, 0.97);
    border-left: 1px solid rgba(244, 184, 74, 0.54);
    border-right: 0;
    gap: 6px;
    padding: 8px;
  }

  .card-room[data-view="table"] .table-panel .panel-body {
    background: rgba(7, 6, 4, 0.97);
    border: 1px solid rgba(244, 184, 74, 0.54);
    border-radius: 0 0 0 10px;
    border-top: 0;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.54);
    margin-top: 0;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
  }

  .card-room[data-view="table"] .panel-body.is-active {
    min-height: 0;
  }

  .card-room[data-view="table"] .chat-messages,
  .card-room[data-view="table"] .event-log,
  .card-room[data-view="table"] #rulesPanel .rules-text {
    min-height: 0;
    overflow-y: auto;
  }

  .lobby-showcase {
    grid-template-columns: 74px 1fr;
    padding: 10px;
  }

  .lobby-stats strong {
    font-size: 24px;
  }

  .lobby-stats em {
    font-size: 10px;
  }

  .toggle-field {
    min-height: 42px;
  }

  .felt-table {
    aspect-ratio: auto;
    border-width: 10px;
    border-radius: 28px;
    height: clamp(620px, 76vh, 720px);
    min-height: 620px;
    max-height: 680px;
    overflow: hidden;
  }

  .table-rail {
    border-radius: 22px;
  }

  .table-center {
    top: 45%;
    width: min(260px, calc(100% - 82px));
  }

  .community-cards {
    flex-wrap: nowrap;
    gap: 4px;
    min-height: 62px;
  }

  .seat {
    min-height: 72px;
    width: min(124px, 32vw);
  }

  .seat.is-open {
    min-height: 54px;
  }

  .seat-shell {
    grid-template-columns: 40px 1fr;
    min-height: 42px;
  }

  .seat-avatar {
    border-width: 2px;
    font-size: 14px;
    height: 40px;
    width: 40px;
  }

  .seat-plate {
    margin-left: -8px;
    padding: 5px 6px 6px 14px;
  }

  .seat-name {
    font-size: 9px;
  }

  .seat-stack-row {
    font-size: 11px;
    margin-top: 1px;
  }

  .seat-badge {
    font-size: 9px;
    min-width: 22px;
    padding: 1px 5px;
  }

  .seat-bet {
    font-size: 9px;
    margin-left: 5px;
  }

  .seat-status-ribbon {
    font-size: 9px;
    left: 42px;
    min-width: 44px;
    padding: 2px 7px;
  }

  .seat-marker-tokens {
    gap: 2px;
    left: 32px;
    top: -6px;
  }

  .seat-marker {
    font-size: 8px;
    height: 18px;
    min-width: 18px;
    padding: 0 3px;
  }

  .waiting-state {
    padding: 7px 9px;
  }

  .waiting-state strong {
    font-size: 12px;
  }

  .waiting-state span {
    font-size: 10px;
  }

  .hand-fan {
    height: 24px;
    margin-left: 31px;
    margin-top: 0;
    width: 66px;
  }

  .seat-actions {
    gap: 4px;
    margin-left: 33px;
    margin-top: 2px;
    width: 66px;
  }

  .seat-actions button {
    font-size: 9px;
    min-height: 21px;
    padding: 3px 6px;
  }

  .seat-actions .gift-picker-wrap {
    display: none;
  }

  .seat-actions:has(> .gift-picker-wrap:only-child) {
    display: none;
  }

  .mobile-gift-dock {
    display: flex;
  }

  .seat-profile-popover {
    display: none;
  }

  .seat.is-gift-selected .seat-avatar,
  .seat.is-gift-selected .seat-plate {
    border-color: rgba(125, 255, 156, 0.72);
    box-shadow:
      0 0 0 1px rgba(125, 255, 156, 0.28),
      0 0 24px rgba(125, 255, 156, 0.34);
  }

  .gift-panel {
    grid-template-columns: repeat(3, 24px);
    padding: 5px;
  }

  .gift-panel button {
    font-size: 14px;
    height: 24px;
    min-height: 24px;
    width: 24px;
  }

  .table-gift-icon {
    font-size: 20px;
    height: 40px;
    width: 40px;
  }

  .table-gift-label {
    display: none;
  }

  .seat.is-open .seat-actions {
    margin-left: 42px;
    margin-top: 3px;
    width: 60px;
  }

  .playing-card {
    border-radius: 6px;
    height: 58px;
    padding: 6px 0 0 7px;
    width: 42px;
  }

  .playing-card .rank,
  .playing-card .suit {
    font-size: 15px;
  }

  .playing-card::before {
    bottom: 6px;
    font-size: 18px;
  }

  .playing-card.is-hole {
    height: 34px;
    padding: 4px 0 0 4px;
    width: 25px;
  }

  .playing-card.is-hole .rank,
  .playing-card.is-hole .suit {
    font-size: 11px;
  }

  .playing-card.is-hole::before {
    bottom: 3px;
    font-size: 13px;
  }

  .action-dock {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1180px) and (orientation: landscape) {
  body {
    height: auto;
    min-height: 460px;
    min-height: max(100svh, 460px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .card-room {
    height: auto;
    min-height: 460px;
    min-height: max(100svh, 460px);
    overflow: visible;
    padding: 6px;
  }

  .card-room[data-view="table"] .topbar,
  .card-room[data-view="table"] .host-panel,
  .card-room[data-view="table"] .table-status {
    display: none;
  }

  .card-room[data-view="table"] .game-layout {
    gap: 8px;
    grid-template-columns: 1fr;
    height: auto;
    max-width: none;
    min-height: 0;
  }

  .card-room[data-view="table"] .table-wrap {
    gap: 6px;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 420px;
    height: max(420px, calc(100svh - 12px));
    min-height: 420px;
  }

  .card-room[data-view="table"] .table-fullscreen-button {
    display: none;
  }

  .card-room[data-view="table"] .table-sound-button {
    right: 8px;
    top: 8px;
  }

  .card-room[data-view="table"] .table-panel {
    background: transparent;
    border: 0;
    display: flex;
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    min-height: 260px;
    overflow: visible;
    padding: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 6px;
    transform: translateX(calc(100% - 52px));
    transition: transform 180ms ease;
    width: min(390px, 100vw);
    z-index: 40;
  }

  .card-room[data-view="table"] .table-panel.is-mobile-open {
    pointer-events: auto;
    transform: translateX(0);
  }

  .card-room[data-view="table"] .mobile-chat-toggle {
    align-items: center;
    background:
      radial-gradient(circle at 50% 35%, rgba(244, 184, 74, 0.28), transparent 58%),
      rgba(12, 9, 5, 0.96);
    border: 1px solid rgba(244, 184, 74, 0.58);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.42);
    color: var(--ink);
    display: flex;
    font-size: 11px;
    font-weight: 900;
    height: 52px;
    justify-content: center;
    left: -2px;
    min-height: 52px;
    padding: 0;
    pointer-events: auto;
    position: absolute;
    text-transform: uppercase;
    top: 74px;
    width: 52px;
    z-index: 2;
  }

  .card-room[data-view="table"] .mobile-chat-header,
  .card-room[data-view="table"] .table-panel .panel-tabs,
  .card-room[data-view="table"] .table-panel .panel-body {
    margin-left: 50px;
    width: calc(100% - 50px);
  }

  .card-room[data-view="table"] .mobile-chat-header {
    align-items: center;
    background: rgba(30, 18, 7, 0.97);
    border: 1px solid rgba(244, 184, 74, 0.54);
    border-bottom: 0;
    border-radius: 10px 0 0 0;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 48px;
    padding: 7px 9px;
  }

  .card-room[data-view="table"] .table-panel .panel-tabs {
    background: rgba(7, 6, 4, 0.97);
    border-left: 1px solid rgba(244, 184, 74, 0.54);
    gap: 6px;
    padding: 6px 8px;
  }

  .card-room[data-view="table"] .table-panel .panel-body {
    background: rgba(7, 6, 4, 0.97);
    border: 1px solid rgba(244, 184, 74, 0.54);
    border-radius: 0 0 0 10px;
    border-top: 0;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.54);
    margin-top: 0;
    overflow: hidden;
    padding: 7px;
  }

  .card-room[data-view="table"] .table-panel .panel-body.is-active {
    min-height: 0;
  }

  .card-room[data-view="table"] .chat-messages,
  .card-room[data-view="table"] .event-log {
    min-height: 0;
    overflow-y: auto;
  }

  .card-room[data-view="table"] .felt-table {
    aspect-ratio: auto;
    border-width: 8px;
    border-radius: 24px;
    height: 100%;
    max-height: none;
    min-height: 340px;
  }

  .card-room[data-view="table"] .table-center {
    top: 47%;
    width: min(310px, calc(100% - 230px));
  }

  .card-room[data-view="table"] .community-cards {
    min-height: 56px;
  }

  .card-room[data-view="table"] .seat {
    min-height: 62px;
    width: min(132px, 20vw);
  }

  .card-room[data-view="table"] .seat.is-open {
    min-height: 50px;
  }

  .card-room[data-view="table"] .seat-shell {
    grid-template-columns: 38px 1fr;
    min-height: 40px;
  }

  .card-room[data-view="table"] .seat-avatar {
    font-size: 13px;
    height: 38px;
    width: 38px;
  }

  .card-room[data-view="table"] .seat-plate {
    margin-left: -8px;
    padding: 4px 6px 5px 14px;
  }

  .card-room[data-view="table"] .seat-name {
    font-size: 9px;
  }

  .card-room[data-view="table"] .seat-marker-tokens {
    left: 30px;
  }

  .card-room[data-view="table"] .seat-stack-row {
    font-size: 11px;
  }

  .card-room[data-view="table"] .seat-actions {
    margin-left: 31px;
    margin-top: 1px;
    width: 64px;
  }

  .card-room[data-view="table"] .seat.is-open .seat-actions {
    margin-left: 40px;
    width: 58px;
  }

  .card-room[data-view="table"] .seat-actions button {
    font-size: 9px;
    min-height: 19px;
    padding: 2px 5px;
  }

  .card-room[data-view="table"] .seat-actions .gift-picker-wrap {
    display: none;
  }

  .card-room[data-view="table"] .seat-actions:has(> .gift-picker-wrap:only-child) {
    display: none;
  }

  .card-room[data-view="table"] .mobile-gift-dock {
    bottom: 66px;
    display: flex;
  }

  .card-room[data-view="table"] .seat-profile-popover {
    display: none;
  }

  .card-room[data-view="table"] .gift-panel {
    grid-template-columns: repeat(3, 23px);
    padding: 5px;
  }

  .card-room[data-view="table"] .gift-panel button {
    font-size: 13px;
    height: 23px;
    min-height: 23px;
    width: 23px;
  }

  .card-room[data-view="table"] .table-gift-icon {
    font-size: 19px;
    height: 38px;
    width: 38px;
  }

  .card-room[data-view="table"] .playing-card {
    height: 54px;
    width: 39px;
  }

  .card-room[data-view="table"] .playing-card.is-hole {
    height: 31px;
    width: 23px;
  }

  .card-room[data-view="table"] .action-dock {
    align-items: center;
    grid-template-columns: minmax(120px, 0.75fr) minmax(150px, 1fr) auto;
    min-height: 58px;
    padding: 6px;
  }

  .card-room[data-view="table"] .bet-control {
    gap: 2px;
  }

  .card-room[data-view="table"] .action-buttons {
    display: flex;
    gap: 6px;
  }

  .card-room[data-view="table"] .action-buttons button {
    min-height: 34px;
    padding: 5px 10px;
  }
}

body.cardtable-fullscreen {
  height: 100dvh;
  overflow: hidden;
}

body.cardtable-fullscreen .card-room.is-fullscreen {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding: 8px;
  width: 100vw;
}

body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .topbar {
  display: none;
}

body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .game-layout {
  height: calc(100dvh - 16px);
  max-width: none;
}

body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-wrap {
  min-height: 0;
  position: relative;
}

body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-fullscreen-button {
  position: absolute;
  right: 10px;
  top: 8px;
  z-index: 32;
}

body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-sound-button {
  right: 64px;
  top: 8px;
}

body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .mobile-chat-toggle {
  top: 88px;
}

@media (min-width: 1181px) {
  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .game-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(280px, 330px);
  }
}

@media (max-width: 1180px) {
  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .game-layout {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - 16px);
    min-height: 0;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .host-panel {
    display: none;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-wrap {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: calc(100dvh - 16px);
    min-height: 0;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-panel {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    min-height: 0;
    top: 8px;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .felt-table {
    height: 100%;
    max-height: none;
    min-height: 0;
  }
}

@media (max-width: 760px) {
  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] {
    padding: 6px;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-status {
    min-height: 28px;
    padding: 4px 10px;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-wrap {
    height: calc(100dvh - 12px);
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .felt-table {
    height: 100%;
    max-height: none;
    min-height: 0;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-panel {
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    min-height: 0;
    top: 6px;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-fullscreen-button {
    min-height: 28px;
    padding: 4px 8px;
    right: 8px;
    top: 38px;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-sound-button {
    min-height: 28px;
    padding: 4px 8px;
    right: 54px;
    top: 38px;
  }
}

@media (max-width: 1180px) and (orientation: landscape) {
  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-fullscreen-button {
    display: none;
  }

  body.cardtable-fullscreen .card-room.is-fullscreen[data-view="table"] .table-sound-button {
    right: 8px;
    top: 8px;
  }
}
