:root {
  --bg: #0a1018;
  --bg-deep: #04070c;
  --felt: #08643f;
  --felt-dark: #042a1e;
  --felt-light: #16855a;
  --rail: #1c2b40;
  --rail-light: #3d5b7d;
  --rail-dark: #0a121e;
  --gold: #e9c66d;
  --gold-strong: #ffe39a;
  --ruby: #c4453a;
  --teal: #63d0c4;
  --blue: #4b93f0;
  --green: #7dcca6;
  --text: #f2f5fa;
  --muted: #a7b6ca;
  --line: rgba(150, 190, 230, 0.16);
  --card-face: #f8f5ec;
  --ink: #171513;
  --hand-zone: clamp(116px, 17dvh, 142px);
  --card-w: clamp(62px, 5vw, 74px);
  --card-h: calc(var(--card-w) * 1.42);
  --card-step: calc(var(--card-w) * 0.66);
}

body[data-table-theme="red"] {
  --felt: #70172c;
  --felt-dark: #350912;
  --felt-light: #a52a44;
  --green: #f2aaa5;
}

body[data-table-theme="midnight"] {
  --felt: #173b60;
  --felt-dark: #081726;
  --felt-light: #275987;
  --rail: #26313f;
  --rail-light: #667186;
  --rail-dark: #11151c;
  --gold: #d7dde8;
  --gold-strong: #f6f8fb;
  --teal: #9bc8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Figtree", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(75, 147, 240, 0.22), transparent 46%),
    radial-gradient(ellipse at 85% 15%, rgba(99, 208, 196, 0.14), transparent 50%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, #101c2c 0%, #060c14 58%, #020408 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px);
  background-size: 5px 5px, 7px 7px;
  mix-blend-mode: overlay;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='%234b93f0' fill-opacity='0.05' font-family='Georgia,serif'%3E%3Ctext x='10' y='60' font-size='54' transform='rotate(-14 10 60)'%3E%E2%99%A0%3C/text%3E%3Ctext x='130' y='40' font-size='40' transform='rotate(10 130 40)'%3E%E2%99%A6%3C/text%3E%3Ctext x='150' y='150' font-size='58' transform='rotate(-8 150 150)'%3E%E2%99%A3%3C/text%3E%3Ctext x='30' y='170' font-size='42' transform='rotate(16 30 170)'%3E%E2%99%A5%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 220px 220px;
}

.app-shell {
  position: relative;
  z-index: 1;
}

body.game-active {
  height: 100dvh;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

button.primary {
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  color: #261800;
  box-shadow: 0 8px 24px rgba(230, 195, 106, 0.24);
}

button.secondary {
  background: linear-gradient(180deg, rgba(247, 241, 227, 0.12), rgba(255, 255, 255, 0.04));
  color: var(--text);
  border: 1px solid var(--line);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

input,
select {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 12px;
}

select option {
  color: #1c140e;
  background: #f7f1e3;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
}

h1 {
  font-size: clamp(2rem, 3vw, 2.7rem);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.site-credit {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.site-credit a {
  color: var(--gold-strong);
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 48px;
}

body.game-active .app-shell {
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px 22px;
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(255, 225, 169, 0.075), transparent 28%),
    linear-gradient(180deg, rgba(16, 22, 32, 0.97), rgba(4, 6, 10, 0.98));
  border: 1px solid rgba(214, 164, 82, 0.25);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 235, 188, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.7);
}

.topbar::after {
  content: "LIVE TABLE";
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  opacity: 0.85;
}

body.game-active .topbar {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-toggle,
.invite-btn {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
  text-transform: uppercase;
  background: rgba(247, 241, 227, 0.08);
  color: var(--gold);
  border: 1px solid var(--line);
  position: relative;
}

.table-chat-log {
  flex: 1;
  min-height: 80px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  font-size: 13px;
}

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

.table-chat-input-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.table-chat-input-row input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
}

.table-chat-input-row button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 10px;
}

.last-trick-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.last-trick-card-box {
  width: min(420px, 92vw);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 22, 32, 0.98), rgba(4, 6, 10, 0.99));
  border: 1px solid rgba(233, 198, 109, 0.3);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  padding: 16px;
}

.game-picker {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

.game-picker h2 {
  text-align: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  color: var(--gold-strong);
  margin: 0 0 40px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.game-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.game-picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 32px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(28, 43, 64, 0.85), rgba(10, 18, 30, 0.92));
  border: 2px solid rgba(233, 198, 109, 0.25);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 235, 188, 0.12);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.game-picker-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(233, 198, 109, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.game-picker-card:hover {
  transform: translateY(-4px);
  border-color: rgba(233, 198, 109, 0.5);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 235, 188, 0.2);
}

.game-picker-card:hover::before {
  opacity: 1;
}

.game-picker-card:active {
  transform: translateY(-2px);
}

.game-picker-icon {
  font-size: 72px;
  color: var(--gold);
  text-shadow: 0 4px 12px rgba(233, 198, 109, 0.4);
  position: relative;
  z-index: 1;
}

.game-picker-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-strong);
  position: relative;
  z-index: 1;
}

.game-picker-tagline {
  font-size: 14px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}


.last-trick-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold-strong);
  margin-bottom: 8px;
}

.last-trick-winner {
  text-align: center;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 12px;
}

.last-trick-cards {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.last-trick-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.last-trick-winning-card .mini-card {
  box-shadow: 0 0 0 3px var(--gold-strong), 0 11px 18px rgba(0, 0, 0, 0.42);
}

.last-trick-name {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.room-peek-box {
  width: min(820px, 94vw);
  max-height: 84vh;
  overflow-y: auto;
}

.room-peek-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.room-peek-grid {
  flex: 1;
  max-height: 60vh;
}

.room-peek-roster {
  width: 200px;
  flex: 0 0 200px;
}

@media (max-width: 760px) {
  .room-peek-body {
    flex-direction: column;
  }

  .room-peek-roster {
    width: 100%;
    flex: 0 0 auto;
  }
}

.sound-toggle[aria-pressed="false"] {
  color: var(--muted);
  opacity: 0.7;
}

.status-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(125, 204, 166, 0.15);
  border: 1px solid rgba(125, 204, 166, 0.35);
  color: var(--green);
  font-weight: 700;
  position: relative;
}

.status-badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(125, 204, 166, 0.6);
  animation: statusPulse 1.8s ease-out infinite;
  vertical-align: middle;
}

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 204, 166, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(125, 204, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 204, 166, 0); }
}

.table-call {
  position: fixed;
  left: 50%;
  top: 15%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.9);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.table-call.hidden,
.hidden {
  display: none;
}

.content {
  display: grid;
}

body.game-active .content {
  height: 100%;
}

.panel {
  display: none;
  background:
    linear-gradient(110deg, rgba(255, 225, 169, 0.075), transparent 28%),
    linear-gradient(180deg, rgba(16, 22, 32, 0.97), rgba(4, 6, 10, 0.98));
  border: 1px solid rgba(214, 164, 82, 0.25);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel.active {
  display: block;
}

#lobby.panel {
  position: relative;
  overflow: hidden;
}

.auth-row,
.button-row {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.join-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.error-box {
  margin-top: 18px;
  background: rgba(196, 69, 58, 0.12);
  border: 1px solid rgba(196, 69, 58, 0.35);
  color: #ffd1d1;
  border-radius: 12px;
  padding: 12px 14px;
}

body.auth-gate-active .app-shell,
body.room-select-active .app-shell,
body.room-browsing .app-shell {
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

body.auth-gate-active .content,
body.room-select-active .content,
body.room-browsing .content {
  flex: 1;
  min-height: 0;
  display: flex;
}

#roomSelect.panel.active,
#authGate.panel.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  text-align: center;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(120, 200, 255, 0.1), transparent 42%),
    radial-gradient(ellipse at 82% 92%, rgba(255, 208, 123, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(10, 14, 20, 0.55), rgba(4, 6, 10, 0.7));
  border-color: rgba(214, 164, 82, 0.14);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(340px, 86vw);
  margin: 22px auto 0;
  text-align: left;
}

.auth-form.hidden {
  display: none;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-form input {
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(233, 198, 109, 0.3);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
}

.auth-switch-btn {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

.account-chip.hidden {
  display: none;
}

.account-screen-name {
  font-weight: 800;
  color: var(--gold-strong);
  font-size: 13px;
}

.account-rating {
  font-size: 12px;
  color: var(--teal);
}

.account-rating::before {
  content: "Elo ";
  color: var(--muted);
}

.account-logout-btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11px;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 50vh;
  overflow-y: auto;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.leaderboard-rank {
  width: 26px;
  flex: 0 0 26px;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}

.leaderboard-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
}

.leaderboard-rating {
  font-weight: 800;
  color: var(--teal);
}

.leaderboard-empty {
  padding: 12px 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.seat-crown {
  margin-right: 4px;
}


.table-option-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(233, 198, 109, 0.24);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-option-toggle input {
  accent-color: var(--gold-strong);
}

.owner-menu-wrap {
  position: relative;
  display: inline-flex;
}

.owner-menu-btn {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(233, 198, 109, 0.45);
  background: rgba(14, 10, 2, 0.72);
  color: var(--gold-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 170, 0.08);
}

.owner-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 14;
  min-width: 128px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(233, 198, 109, 0.34);
  background: rgba(6, 6, 6, 0.96);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

.owner-menu button {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.owner-menu button:hover {
  background: rgba(233, 198, 109, 0.13);
  color: var(--gold-strong);
}

.table-options-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  padding: 14px;
}

.table-options-menu.hidden {
  display: none;
}

.table-options-close {
  position: absolute;
  top: 6px;
  right: 8px;
  min-height: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(233, 198, 109, 0.4);
  background: rgba(0, 0, 0, 0.5);
  color: var(--gold-strong);
  font-size: 16px;
  line-height: 1;
}

.table-options-close:hover {
  background: rgba(233, 198, 109, 0.25);
}

.table-options-play {
  margin-top: 14px;
}

.owner-drawer {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 999;
  width: min(320px, 80vw);
  padding: 10px;
  border-radius: 10px;
  background: rgba(6, 6, 6, 0.95);
  border: 1px solid rgba(233, 198, 109, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.owner-drawer-input {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(233, 198, 109, 0.3);
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold-strong);
  font-family: monospace;
}

.owner-drawer-output {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: pre-wrap;
}

.confetti-burst {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confettiFall var(--fall-duration) ease-in var(--fall-delay) forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0.3; }
}

#roomView.panel.active.roomview-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

#table.panel.active {
  display: block;
  width: 100%;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(12, 8, 6, 0.54), rgba(2, 2, 2, 0.72)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 18px),
    radial-gradient(ellipse at 50% 50%, rgba(11, 87, 58, 0.32), transparent 64%),
    #080604;
  box-shadow: none;
}

.game-client {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 4px minmax(0, 1fr);
  overflow: hidden;
}

.table-hud {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 16px;
  background:
    linear-gradient(180deg, rgba(26, 18, 13, 0.96), rgba(8, 6, 5, 0.95));
  border-bottom: 1px solid rgba(233, 198, 109, 0.22);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  position: relative;
  z-index: 20;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hud-row-main {
  justify-content: space-between;
}

.hud-row-settings {
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(233, 198, 109, 0.14);
}

.hud-settings-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.room-share {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.rank-mode-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(233, 198, 109, 0.13);
  border: 1px solid rgba(233, 198, 109, 0.35);
  color: var(--gold-strong);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.room-share h3 {
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  color: var(--gold-strong);
  line-height: 1;
}

.table-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  width: min(100%, 380px);
  flex: 1;
  max-width: 380px;
}

.score-box {
  min-width: 0;
  padding: 4px 8px;
  text-align: center;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 23, 24, 0.92), rgba(7, 10, 12, 0.96));
  border: 1px solid rgba(233, 198, 109, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.score-label,
.stake-chip span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.score-box strong,
.stake-chip strong {
  display: block;
  margin-top: 1px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  line-height: 1;
}

.center-box strong {
  color: var(--teal);
}

.turn-timer-label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.turn-timer-label select {
  min-height: 30px;
  padding: 3px 8px;
  font-size: 12px;
}

.stake-chip {
  min-width: 64px;
  padding: 4px 10px;
  text-align: center;
  border-radius: 999px;
  color: var(--gold-strong);
  border: 1px solid rgba(233, 198, 109, 0.25);
  background: rgba(247, 241, 227, 0.08);
}

.hand-meter-shell {
  position: relative;
  z-index: 21;
  width: 100%;
  background: rgba(0, 0, 0, 0.34);
}

.hand-meter-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hand-meter-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transition: width 0.25s ease;
}

.table-body {
  display: flex;
  min-height: 0;
  height: 100%;
}

.table-sidebar {
  width: 240px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid var(--line);
}

.table-sidebar-section {
  flex: 0 0 auto;
}

.table-roster-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 13px;
}

.table-roster-list li {
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}

.table-roster-empty {
  padding: 3px 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.table-sidebar-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.table-sidebar-chat .table-chat-log {
  flex: 1;
}

.casino-stage {
  --stage-pad: clamp(10px, 1.9dvh, 22px);
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.casino-stage::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: calc(var(--hand-zone) + 46px);
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.46) 34%, rgba(0, 0, 0, 0.78));
  pointer-events: none;
  z-index: 3;
}

.table-rail {
  width: min(clamp(760px, 78vw, 1120px), calc((100dvh - 92px - var(--hand-zone)) * 1.86));
  aspect-ratio: 1.86 / 1;
  position: absolute;
  left: 50%;
  top: clamp(18px, 3.4dvh, 40px);
  transform: translateX(-50%);
  border-radius: 50%;
  padding: clamp(20px, 2.2vw, 30px);
  background:
    radial-gradient(ellipse at 31% 10%, rgba(180, 210, 255, 0.28), transparent 23%),
    linear-gradient(155deg, var(--rail-light) 0%, #2d4360 23%, var(--rail) 52%, var(--rail-dark) 100%);
  box-shadow:
    0 34px 62px rgba(0, 0, 0, 0.66),
    0 5px 0 rgba(2, 4, 8, 0.8),
    inset 0 3px 1px rgba(200, 222, 255, 0.3),
    inset 0 -15px 20px rgba(0, 0, 0, 0.5),
    inset 0 0 0 2px rgba(6, 12, 22, 0.5);
  z-index: 2;
}

.table-rail::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(255, 224, 166, 0.22);
  box-shadow: inset 0 0 18px rgba(255, 208, 123, 0.14);
}

.table-felt {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: visible;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(117, 178, 110, 0.18), transparent 45%),
    repeating-linear-gradient(98deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(8deg, rgba(0, 0, 0, 0.045) 0 2px, transparent 2px 6px),
    radial-gradient(ellipse at 50% 46%, var(--felt-light) 0%, var(--felt) 54%, var(--felt-dark) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(17, 102, 68, 0.65),
    inset 0 0 42px rgba(0, 0, 0, 0.58),
    inset 0 -20px 36px rgba(0, 0, 0, 0.24);
}

.table-felt::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(191, 221, 166, 0.17);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), inset 0 0 24px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.table-glow {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(238, 190, 86, 0.22), transparent 49%),
    radial-gradient(ellipse at 50% 50%, rgba(99, 208, 196, 0.11), transparent 70%);
  filter: blur(22px);
  pointer-events: none;
  opacity: 0.75;
}

.table-message {
  position: absolute;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(64%, 470px);
  padding: 8px 13px;
  border-radius: 999px;
  text-align: center;
  background: rgba(8, 13, 11, 0.68);
  border: 1px solid rgba(233, 198, 109, 0.23);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.table-message p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
  font-size: clamp(0.82rem, 1.25vw, 1rem);
}

.table-message span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.table-message strong {
  color: var(--gold-strong);
}

.table-pit {
  position: absolute;
  left: 50%;
  top: 54%;
  width: clamp(230px, 25vw, 330px);
  height: clamp(160px, 17vw, 220px);
  transform: translate(-50%, -50%);
  z-index: 4;
}

.pot-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 96px;
  padding: 7px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(25, 31, 27, 0.82), rgba(8, 13, 11, 0.9));
  border: 1px solid rgba(231, 198, 105, 0.3);
  text-align: center;
  box-shadow: 0 13px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pot-box span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.pot-box strong {
  display: block;
  margin-top: 2px;
  font-size: 1.12rem;
  font-family: "Fraunces", Georgia, serif;
}

.trick-slot {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
}

.trick-slot.north { left: 50%; top: 0; transform: translateX(-50%); }
.trick-slot.east { right: 4px; top: 50%; transform: translateY(-50%); }
.trick-slot.south { left: 50%; bottom: 0; transform: translateX(-50%); }
.trick-slot.west { left: 4px; top: 50%; transform: translateY(-50%); }

.trick-card,
.mini-card,
.card-btn {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 9px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.72), transparent 30%),
    repeating-linear-gradient(0deg, rgba(84, 68, 42, 0.025) 0 1px, transparent 1px 3px),
    var(--card-face);
  color: #161616;
  border: 1px solid #b8b5aa;
  box-shadow:
    0 11px 18px rgba(0, 0, 0, 0.42),
    0 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    inset 0 0 10px rgba(89, 71, 43, 0.08);
  display: flex;
  flex-direction: column;
  padding: 4px 5px 3px;
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  line-height: 0.9;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px rgba(255, 255, 255, 0.7);
}

.trick-card,
.mini-card {
  animation: cardPop 0.28s ease;
  transform: rotate(-2deg);
}

.trick-slot.north .trick-card { animation: throwFromNorth 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both; transform: rotate(-2deg); }
.trick-slot.east .trick-card { animation: throwFromEast 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both; transform: rotate(7deg); }
.trick-slot.south .trick-card { animation: throwFromSouth 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both; transform: rotate(3deg); }
.trick-slot.west .trick-card { animation: throwFromWest 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both; transform: rotate(-7deg); }

@keyframes throwFromNorth {
  0% { opacity: 0; transform: translateY(-70px) rotate(-2deg) scale(0.85); }
  100% { opacity: 1; transform: translateY(0) rotate(-2deg) scale(1); }
}

@keyframes throwFromSouth {
  0% { opacity: 0; transform: translateY(70px) rotate(3deg) scale(0.85); }
  100% { opacity: 1; transform: translateY(0) rotate(3deg) scale(1); }
}

@keyframes throwFromEast {
  0% { opacity: 0; transform: translateX(70px) rotate(7deg) scale(0.85); }
  100% { opacity: 1; transform: translateX(0) rotate(7deg) scale(1); }
}

@keyframes throwFromWest {
  0% { opacity: 0; transform: translateX(-70px) rotate(-7deg) scale(0.85); }
  100% { opacity: 1; transform: translateX(0) rotate(-7deg) scale(1); }
}

.trick-card.red,
.mini-card.red,
.card-btn.red {
  color: #c41e3a;
}

.pc-index {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 17px;
  font-size: 13px;
  z-index: 1;
}

.pc-index b {
  font-size: 13px;
  font-weight: 800;
}

.pc-index i {
  font-size: 11px;
  font-style: normal;
}

.pc-index.bot {
  transform: rotate(180deg);
  align-self: end;
  margin-top: auto;
}

.pc-pips {
  position: absolute;
  inset: 16px 8px 16px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(7, 1fr);
  pointer-events: none;
}

.pip {
  display: grid;
  place-items: center;
  font-size: 15px;
}

.pip.tl { grid-area: 1 / 1; }
.pip.t  { grid-area: 1 / 2; }
.pip.tr { grid-area: 1 / 3; }
.pip.tc { grid-area: 2 / 2; }
.pip.ul { grid-area: 3 / 1; }
.pip.ur { grid-area: 3 / 3; }
.pip.ml { grid-area: 4 / 1; }
.pip.c  { grid-area: 4 / 2; font-size: 22px; }
.pip.mr { grid-area: 4 / 3; }
.pip.ll { grid-area: 5 / 1; transform: rotate(180deg); }
.pip.lr { grid-area: 5 / 3; transform: rotate(180deg); }
.pip.bc { grid-area: 6 / 2; transform: rotate(180deg); }
.pip.bl { grid-area: 7 / 1; transform: rotate(180deg); }
.pip.bi { grid-area: 7 / 2; transform: rotate(180deg); }
.pip.br { grid-area: 7 / 3; transform: rotate(180deg); }

.pc-court {
  position: absolute;
  inset: 18px 10px 18px 20px;
  border: 1px solid rgba(37, 34, 28, 0.28);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.6), transparent 35%),
    linear-gradient(180deg, #fffefa, #eeeade);
}

.pc-court-rank {
  font-size: 28px;
  line-height: 0.8;
}

.pc-court-suit {
  font-size: 16px;
}

.chip-panel {
  position: absolute;
  right: 12%;
  bottom: 17%;
  z-index: 4;
  display: flex;
  gap: 7px;
  align-items: end;
  filter: drop-shadow(0 9px 8px rgba(0, 0, 0, 0.42));
}

.chip-stack {
  width: clamp(34px, 3.8vw, 46px);
  height: clamp(34px, 3.8vw, 46px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: white;
  border: 3px dashed rgba(255, 240, 188, 0.58);
  outline: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.13),
    inset 0 -7px 0 rgba(0, 0, 0, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  opacity: 0.45;
  transform: scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.chip-stack.active-chip {
  opacity: 1;
  transform: scale(1.08);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    inset 0 -7px 0 rgba(0, 0, 0, 0.28),
    0 0 16px rgba(255, 215, 137, 0.45),
    0 4px 0 rgba(255, 255, 255, 0.25);
}

.chip-panel.jingle .chip-stack.active-chip {
  animation: chipJingle 0.4s ease;
}

@keyframes chipJingle {
  0%, 100% { transform: scale(1.08) rotate(0deg); }
  25% { transform: scale(1.14) rotate(-6deg); }
  75% { transform: scale(1.14) rotate(6deg); }
}

.chip-stack::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.chip-stack-red { background: linear-gradient(180deg, #d94545, #891c2a); }
.chip-stack-gold { background: linear-gradient(180deg, #f7d783, #c98a17); color: #1f1400; }
.chip-stack-blue { background: linear-gradient(180deg, #58a7ff, #1d4f9e); }

.chip-panel .chip-stack:nth-child(2) { transform: translateY(-5px); }
.chip-panel .chip-stack:nth-child(3) { transform: translateY(-9px); }

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

.seat-card {
  --seat-w: clamp(132px, 13vw, 170px);
  position: absolute;
  width: var(--seat-w);
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  transform: translate(-50%, -50%);
  padding: 7px 9px 7px 7px;
  border-radius: 999px;
  background:
    linear-gradient(105deg, rgba(245, 194, 91, 0.15), transparent 28%),
    linear-gradient(180deg, rgba(24, 31, 31, 0.96), rgba(7, 13, 15, 0.98));
  border: 1px solid rgba(222, 179, 87, 0.28);
  box-shadow:
    0 13px 22px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.seat-card:hover {
  transform: translate(-50%, -50%) translateY(-2px);
  border-color: rgba(230, 195, 106, 0.48);
}

.seat-card.empty {
  opacity: 0.64;
}

.seat-card.current-turn {
  border-color: var(--gold-strong);
  box-shadow:
    0 0 0 2px rgba(233, 198, 109, 0.18),
    0 0 34px rgba(233, 198, 109, 0.35),
    0 14px 25px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 240, 186, 0.25);
}

.seat-card.disconnected {
  filter: saturate(0.7);
  opacity: 0.72;
  border-color: rgba(233, 198, 109, 0.45);
}

.seat-card.dealer::after {
  content: "D";
  position: absolute;
  right: -3px;
  top: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #f9f2d4, #d1a63d 48%, #7d5a18 100%);
  color: #231800;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.32);
}

.seat-north { top: 11%; }
.seat-south { top: 88%; }
.seat-west,
.seat-east { --seat-w: clamp(118px, 12vw, 152px); }

.seat-medallion {
  grid-row: 1 / -1;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  color: #201300;
  background:
    radial-gradient(circle at 33% 25%, #fff4c0, #e6b84e 48%, #91651e 100%);
  border: 2px solid rgba(255, 239, 186, 0.75);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 6px 12px rgba(0, 0, 0, 0.28);
}

.bot-seat .seat-medallion {
  color: #071719;
  background: radial-gradient(circle at 33% 25%, #d6fffb, var(--teal) 52%, #26766f 100%);
}

.empty-medallion {
  color: rgba(255, 255, 255, 0.58);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.18);
}

.seat-copy {
  min-width: 0;
}

.seat-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 900;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  color: #fff5dc;
}

.seat-stats {
  display: flex;
  gap: 7px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.seat-stats strong {
  color: var(--text);
}

.seat-badge {
  grid-column: 2;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(230, 195, 106, 0.12);
  border: 1px solid rgba(230, 195, 106, 0.2);
  color: var(--gold);
  font-size: 9px;
  line-height: 1.25;
  text-transform: uppercase;
}

.is-you .seat-badge { color: var(--teal); border-color: rgba(99, 208, 196, 0.34); }
.partner-seat .seat-badge { color: var(--green); border-color: rgba(125, 204, 166, 0.32); }

.watcher-list {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.watcher-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px 1px 7px;
  border-radius: 999px;
  background: rgba(99, 208, 196, 0.14);
  border: 1px solid rgba(99, 208, 196, 0.35);
  color: var(--teal);
  font-size: 9px;
}

.watcher-boot-btn {
  min-height: 0;
  padding: 0 3px;
  border-radius: 999px;
  background: transparent;
  color: var(--teal);
  font-size: 11px;
  line-height: 1;
}

.watcher-boot-btn:hover {
  background: rgba(99, 208, 196, 0.25);
  transform: none;
  box-shadow: none;
}

.vote-kick-btn {
  grid-column: 2;
  justify-self: start;
  margin-top: 4px;
  min-height: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(196, 69, 58, 0.14);
  border: 1px solid rgba(196, 69, 58, 0.4);
  color: #ffb4ae;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.disconnected .seat-badge { color: #e9c66d; border-color: rgba(233, 198, 109, 0.35); }

.sit-here-btn {
  grid-column: 2;
  justify-self: start;
  margin-top: 4px;
  min-height: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(233, 198, 109, 0.16);
  border: 1px solid rgba(233, 198, 109, 0.55);
  color: #e9c66d;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.sit-here-btn:hover { background: rgba(233, 198, 109, 0.28); }
.empty .sit-here-btn { grid-column: 1 / -1; justify-self: center; margin-top: 6px; }

.bid-row {
  position: absolute;
  left: 50%;
  bottom: calc(var(--hand-zone) - 9px);
  transform: translateX(-50%);
  z-index: 12;
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 7, 0.86);
  border: 1px solid rgba(233, 198, 109, 0.33);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#table.is-bidding.show-normal-bid .bid-row {
  display: flex;
}

.bid-row label {
  display: block;
  min-width: auto;
  color: var(--gold-strong);
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
}

.bid-row select {
  min-width: 76px;
  min-height: 36px;
  border-radius: 999px;
  padding: 5px 10px;
}

.bid-row button {
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 13px;
}

.hand-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--hand-zone);
  z-index: 10;
  padding: 7px clamp(18px, 4vw, 48px) 24px;
  display: flex;
  align-items: end;
  justify-content: center;
  pointer-events: none;
}

.hand-area {
  width: min(100%, calc(var(--card-w) + 12 * var(--card-step) + 32px));
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  overflow: visible;
  padding-top: 26px;
  pointer-events: auto;
  perspective: 900px;
}

.card-btn {
  margin-left: calc(var(--card-step) - var(--card-w));
  z-index: 1;
  flex: 0 0 auto;
  cursor: pointer;
  transform: rotate(var(--fan-angle)) translateY(var(--fan-lift));
  transform-origin: 50% 100%;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.card-btn:first-child {
  margin-left: 0;
}

.card-btn:hover:not(:disabled),
.card-btn:focus-visible:not(:disabled) {
  z-index: 40;
  transform: rotate(0deg) translateY(-26px) scale(1.035);
  filter: brightness(1.04);
  border-color: #8a6a1a;
  box-shadow: 0 22px 30px rgba(0, 0, 0, 0.5), 0 2px 0 rgba(255, 255, 255, 0.82);
}

.card-btn:disabled {
  opacity: 1;
  cursor: default;
  filter: saturate(0.72) brightness(0.82);
  border-color: #8f8c83;
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.44),
    inset 0 0 12px rgba(30, 26, 20, 0.12);
}

@keyframes cardPop {
  0% { opacity: 0; transform: translateY(10px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dealIn {
  0% {
    opacity: 0;
    transform: translateY(-220px) translateX(-40px) rotate(-40deg) scale(0.6);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(var(--fan-angle)) translateY(var(--fan-lift));
  }
}

.card-btn.card-dealt {
  animation: dealIn 0.42s cubic-bezier(0.18, 0.82, 0.28, 1) both;
  animation-delay: var(--deal-delay, 0ms);
}

@media (max-width: 900px) {
  :root {
    --card-w: clamp(54px, 7vw, 64px);
    --hand-zone: 126px;
  }

  .table-hud {
    padding-inline: 10px;
  }

  .table-scoreboard {
    width: 260px;
  }

  .table-sidebar {
    display: none;
  }

  .stake-chip span {
    display: none;
  }

  .seat-card {
    --seat-w: 124px;
    min-height: 56px;
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 6px;
  }

  .seat-medallion {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 760px) {
  body.game-active {
    min-height: 100dvh;
    height: auto;
    overflow: auto;
  }

  body.game-active .app-shell,
  #table.panel.active,
  .game-client {
    min-height: 100dvh;
    height: auto;
  }

  .game-client {
    grid-template-rows: auto 4px 640px;
  }

  .table-hud {
    padding: 8px 10px;
  }

  .hud-row-main {
    flex-wrap: wrap;
  }

  .table-scoreboard {
    width: 100%;
    order: 3;
  }

  .casino-stage {
    min-height: 640px;
  }

  .table-rail {
    width: min(94vw, 560px);
    top: 32px;
    padding: 15px;
    aspect-ratio: 1.2 / 1;
  }

  .table-message {
    width: 76%;
    top: 18%;
  }

  .table-message p {
    white-space: normal;
  }

  .table-pit {
    width: 210px;
    height: 178px;
  }

  .seat-card {
    --seat-w: 112px;
    min-height: 52px;
  }

  .seat-west { left: 15%; }
  .seat-east { left: 85%; }

  .seat-stats {
    gap: 5px;
    font-size: 10px;
  }

  .chip-panel {
    display: none;
  }

  .bid-row {
    bottom: 112px;
    width: calc(100% - 24px);
    justify-content: center;
  }

  .hand-dock {
    padding-inline: 12px;
  }

  .hand-area {
    justify-content: flex-start;
    width: 100%;
    overflow-x: clip;
  }
}

@media (max-height: 740px) and (min-width: 761px) {
  :root {
    --card-w: clamp(58px, 4.8vw, 68px);
    --hand-zone: 116px;
  }

  .table-hud {
    padding-block: 5px;
  }

  .table-rail {
    top: 18px;
  }

  .score-box strong,
  .stake-chip strong {
    font-size: 1.22rem;
  }

  .table-message {
    top: 18%;
    padding-block: 6px;
  }

  .seat-card {
    --seat-w: clamp(122px, 12vw, 150px);
    min-height: 56px;
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .seat-medallion {
    width: 36px;
    height: 36px;
  }

  .bid-row {
    padding-block: 6px;
  }

  .bid-row select,
  .bid-row button {
    min-height: 34px;
  }
}

#roomSelect.panel {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 48px 24px;
  border: 4px solid var(--rail);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255, 224, 150, 0.16), transparent 46%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.06), transparent 62%),
    repeating-linear-gradient(98deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 40%, var(--felt-light) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(17, 102, 68, 0.6),
    inset 0 0 60px rgba(0, 0, 0, 0.55),
    0 30px 70px rgba(0, 0, 0, 0.55);
}

#roomSelect.panel::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  border: 1px solid rgba(233, 198, 109, 0.35);
  box-shadow: inset 0 0 30px rgba(255, 208, 123, 0.1);
  pointer-events: none;
}

.marquee-sweep {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-strong), transparent);
  animation: marqueeSweep 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes marqueeSweep {
  0% { left: -40%; }
  100% { left: 100%; }
}

.lobby-main {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: auto 0;
}

.lobby-activity-line {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--teal);
  animation: fadeInUp 0.6s ease 0.08s both;
}

.room-card-tagline {
  font-size: 12px;
  color: var(--muted);
  margin-top: -2px;
}

#roomSelect h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  background: linear-gradient(100deg, var(--gold-strong) 30%, #fff8e0 45%, var(--gold-strong) 60%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  animation: fadeInUp 0.6s ease both, titleShine 4.5s ease-in-out 1.2s infinite;
}

@keyframes titleShine {
  0%, 60%, 100% { background-position: 200% 0; }
  30% { background-position: 0% 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

#roomSelect .auth-row {
  justify-content: center;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-cards {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  height: 185px;
  border-radius: 10px;
  background: var(--card-face);
  color: var(--ink);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  opacity: 0.14;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card.hc-red { color: #c41e3a; }

.hc-corner {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
}

.hc-corner-bottom {
  top: auto;
  bottom: 8px;
  left: auto;
  right: 8px;
  transform: rotate(180deg);
}

.hc-center {
  font-size: 64px;
}

.hc-1 { animation: floatHc1 7s ease-in-out infinite; }
.hc-2 { animation: floatHc2 8.5s ease-in-out infinite; }
.hc-3 { animation: floatHc3 6.5s ease-in-out 0.5s infinite; }
.hc-4 { animation: floatHc4 9s ease-in-out 1s infinite; }

@keyframes floatHc1 {
  0%, 100% { transform: translate(-320px, -170px) rotate(-18deg); }
  50% { transform: translate(-320px, -186px) rotate(-15deg); }
}

@keyframes floatHc2 {
  0%, 100% { transform: translate(-90px, -230px) rotate(-4deg); }
  50% { transform: translate(-90px, -212px) rotate(-7deg); }
}

@keyframes floatHc3 {
  0%, 100% { transform: translate(150px, -200px) rotate(10deg); }
  50% { transform: translate(150px, -218px) rotate(13deg); }
}

@keyframes floatHc4 {
  0%, 100% { transform: translate(340px, -140px) rotate(22deg); }
  50% { transform: translate(340px, -158px) rotate(19deg); }
}

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

.room-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  margin-top: 34px;
  max-width: 900px;
  width: 100%;
  margin-inline: auto;
}

.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 18px 24px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 215, 137, 0.18), transparent 60%),
    linear-gradient(165deg, var(--rail-light) 0%, var(--rail) 55%, var(--rail-dark) 100%);
  border: 1px solid rgba(233, 198, 109, 0.4);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 235, 188, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  color: var(--text);
  animation: fadeInUp 0.6s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.room-card-grid .room-card:nth-child(1) { animation-delay: 0.2s; }
.room-card-grid .room-card:nth-child(2) { animation-delay: 0.32s; }
.room-card-grid .room-card:nth-child(3) { animation-delay: 0.44s; }

.room-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: rgba(255, 224, 150, 0.75);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 208, 123, 0.28), inset 0 1px 0 rgba(255, 235, 188, 0.25);
}

.room-card:hover .room-card-suit {
  transform: scale(1.25) rotate(-6deg);
}

.room-card-suit {
  font-size: 1.4rem;
  color: var(--gold-strong);
  opacity: 0.85;
  transition: transform 0.25s ease;
  display: inline-block;
}

.room-card-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  color: var(--gold-strong);
}

.room-card-divider {
  width: 34px;
  height: 1px;
  margin: 6px 0;
  background: linear-gradient(90deg, transparent, rgba(233, 198, 109, 0.55), transparent);
}

.room-card-rating {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.room-card-occupancy {
  margin-top: 10px;
  font-size: 11px;
  color: var(--teal);
}

.room-card-beginner { border-color: rgba(125, 204, 166, 0.4); }
.room-card-beginner .room-card-suit { color: var(--green); }
.room-card-beginner:hover { border-color: rgba(125, 204, 166, 0.8); box-shadow: 0 24px 46px rgba(0, 0, 0, 0.5), 0 0 30px rgba(125, 204, 166, 0.28), inset 0 1px 0 rgba(255, 235, 188, 0.25); }

.room-card-advance { border-color: rgba(233, 198, 109, 0.4); }
.room-card-advance .room-card-suit { color: var(--gold-strong); }

.room-card-expert { border-color: rgba(196, 69, 58, 0.45); }
.room-card-expert .room-card-suit { color: var(--ruby); }
.room-card-expert:hover { border-color: rgba(196, 69, 58, 0.85); box-shadow: 0 24px 46px rgba(0, 0, 0, 0.5), 0 0 30px rgba(196, 69, 58, 0.28), inset 0 1px 0 rgba(255, 235, 188, 0.25); }

.lobby-identity-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease both;
}

.lobby-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: text;
}

.lobby-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 25%, #fff4c0, #e6b84e 48%, #91651e 100%);
  color: #201300;
  font-size: 1.1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.lobby-identity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lobby-identity-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lobby-identity-copy input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(233, 198, 109, 0.35);
  color: var(--gold-strong);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  padding: 2px 0;
  min-height: 0;
  width: 160px;
}

.lobby-identity-copy input:focus {
  outline: none;
  border-bottom-color: var(--gold-strong);
}

.quick-join-btn {
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  color: #241a06;
  box-shadow: 0 10px 26px rgba(230, 195, 106, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-size: 14px;
  padding: 12px 22px;
}

.quick-join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(230, 195, 106, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.lobby-footer-row {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.56s both;
}

.lobby-footer-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.room-view-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.room-view-heading h2 {
  margin: 0;
}

.roomview-summary {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.roomview-sidebar {
  width: 200px;
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid var(--line);
}

.roomview-floor {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 26px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(23, 133, 90, 0.14), transparent 55%);
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.table-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px 0 4px;
}

.table-pager button {
  min-height: 32px;
  padding: 5px 16px;
  border-radius: 999px;
  border: 1px solid rgba(233, 198, 109, 0.4);
  background: rgba(233, 198, 109, 0.1);
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
}

.table-pager button:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.table-pager span {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.premium-table-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 44px 30px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12, 18, 27, 0.6), rgba(4, 7, 12, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.premium-table-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.premium-table-plaque {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--gold-strong);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(233, 198, 109, 0.35);
}

.premium-table-status {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.premium-table-status.status-open { color: var(--green); background: rgba(125, 204, 166, 0.14); }
.premium-table-status.status-in-progress { color: var(--gold-strong); background: rgba(233, 198, 109, 0.16); }
.premium-table-status.status-full { color: var(--ruby); background: rgba(196, 69, 58, 0.16); }
.premium-table-status.status-locked { color: var(--muted); background: rgba(255, 255, 255, 0.05); }

.premium-rail {
  position: relative;
  aspect-ratio: 1.7 / 1;
  margin: 34px 24px 40px;
  border-radius: 50%;
  padding: 16px 32px;
  background:
    radial-gradient(ellipse at 31% 10%, rgba(180, 210, 255, 0.22), transparent 25%),
    linear-gradient(155deg, var(--rail-light) 0%, #2d4360 23%, var(--rail) 52%, var(--rail-dark) 100%);
  box-shadow:
    0 16px 26px rgba(0, 0, 0, 0.5),
    0 3px 0 rgba(2, 4, 8, 0.7),
    inset 0 2px 1px rgba(200, 222, 255, 0.25),
    inset 0 -8px 16px rgba(0, 0, 0, 0.4);
}

.premium-felt {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.1), transparent 55%),
    radial-gradient(ellipse at 50% 46%, var(--felt-light) 0%, var(--felt) 58%, var(--felt-dark) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(17, 102, 68, 0.55),
    inset 0 0 18px rgba(0, 0, 0, 0.5);
}

.premium-felt-plaque {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-strong);
  background: rgba(0, 0, 0, 0.42);
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(233, 198, 109, 0.3);
  white-space: nowrap;
}

.premium-seat {
  position: absolute;
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.premium-seat.seat-n { top: -34px; left: 50%; transform: translateX(-50%); }
.premium-seat.seat-s { bottom: -34px; left: 50%; transform: translateX(-50%); }
.premium-seat.seat-w { left: -26px; top: 50%; transform: translateY(-50%); }
.premium-seat.seat-e { right: -26px; top: 50%; transform: translateY(-50%); }

.seat-chair {
  position: relative;
  width: 42px;
  height: 36px;
}

.seat-chair::before {
  content: "";
  position: absolute;
  top: 0;
  left: 5px;
  right: 5px;
  height: 21px;
  border-radius: 11px 11px 3px 3px;
  background: linear-gradient(180deg, var(--rail-light), var(--rail) 72%);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.16), 0 2px 4px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(233, 198, 109, 0.28);
}

.seat-chair::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 19px;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--rail), var(--rail-dark));
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.1), 0 3px 6px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(233, 198, 109, 0.22);
}

.premium-seat-open .seat-chair::before,
.premium-seat-open .seat-chair::after {
  opacity: 0.7;
}

.premium-seat-open:hover .seat-chair::before,
.premium-seat-open:hover .seat-chair::after {
  opacity: 1;
}

.premium-seat-locked .seat-chair::before,
.premium-seat-locked .seat-chair::after {
  opacity: 0.3;
}

.seat-avatar {
  position: absolute;
  top: -9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #201300;
  background: radial-gradient(circle at 33% 25%, #fff4c0, #e6b84e 48%, #91651e 100%);
  border: 1px solid rgba(255, 239, 186, 0.75);
}

.seat-name {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 600;
  color: var(--text);
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-plus {
  position: absolute;
  top: 8px;
  color: var(--gold-strong);
  font-size: 15px;
  font-weight: 800;
}

.seat-lock {
  position: absolute;
  top: 8px;
  font-size: 13px;
}

.table-locked .premium-felt {
  filter: saturate(0.5) brightness(0.7);
}

.premium-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.premium-table-meta {
  font-size: 11px;
  color: var(--muted);
}

.premium-table-action {
  min-height: 32px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(233, 198, 109, 0.5);
  background: rgba(233, 198, 109, 0.12);
  color: var(--gold-strong);
  font-size: 11px;
  font-weight: 800;
}

.premium-table-action:hover {
  background: rgba(233, 198, 109, 0.28);
}

.table-locked .premium-table-action {
  opacity: 0.5;
  pointer-events: none;
}

.roster-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  overflow-y: auto;
  max-height: 180px;
}

.roster-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.rating-star {
  font-size: 11px;
}

.rating-star-beginner { color: #6bcf6b; }
.rating-star-advance { color: #ffa94b; }
.rating-star-expert { color: #e5534b; }

.chat-log {
  flex: 1;
  min-height: 120px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 8px;
  font-size: 13px;
}

.chat-line {
  padding: 3px 0;
}

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

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chat-input-row input {
  flex: 1;
}

@media (max-width: 900px) {
  .roomview-sidebar {
    width: 220px;
    flex: 0 0 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.turn-countdown {
  display: inline-block;
  min-width: 92px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(99, 208, 196, 0.12);
  border: 1px solid rgba(99, 208, 196, 0.28);
}

.turn-countdown.urgent {
  color: var(--gold-strong);
  background: rgba(233, 198, 109, 0.16);
  border-color: rgba(233, 198, 109, 0.45);
}

.turn-countdown.danger {
  color: #ffd1d1;
  background: rgba(196, 69, 58, 0.22);
  border-color: rgba(196, 69, 58, 0.62);
  animation: timerPulse 0.65s ease-in-out infinite alternate;
}

@keyframes timerPulse {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(196, 69, 58, 0); }
  to { transform: scale(1.06); box-shadow: 0 0 18px rgba(196, 69, 58, 0.4); }
}

.contract-label {
  display: block;
  margin-top: 4px;
  color: var(--gold-strong);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seat-special-badge {
  grid-column: 2;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(99, 208, 196, 0.13);
  border: 1px solid rgba(99, 208, 196, 0.35);
  color: var(--teal);
  font-size: 9px;
  line-height: 1.25;
  font-weight: 900;
  text-transform: uppercase;
}

.seat-special-badge.nil-badge {
  background: rgba(233, 198, 109, 0.12);
  border-color: rgba(233, 198, 109, 0.35);
  color: var(--gold);
}

.away-seat {
  filter: saturate(0.62) brightness(0.82);
  border-color: rgba(233, 198, 109, 0.5);
}

.away-seat .seat-badge {
  color: var(--gold-strong);
  border-color: rgba(233, 198, 109, 0.5);
  background: rgba(233, 198, 109, 0.16);
}

.blind-nil-seat {
  border-color: rgba(99, 208, 196, 0.58);
  box-shadow: 0 0 26px rgba(99, 208, 196, 0.16), 0 13px 22px rgba(0, 0, 0, 0.42);
}

.blind-bid-row {
  position: absolute;
  left: 50%;
  bottom: calc(var(--hand-zone) - 9px);
  transform: translateX(-50%);
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 7, 0.9);
  border: 1px solid rgba(99, 208, 196, 0.38);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.blind-bid-row.hidden {
  display: none;
}

.blind-bid-row button {
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 14px;
}

.nil-exchange-row {
  position: absolute;
  left: 50%;
  bottom: calc(var(--hand-zone) - 9px);
  transform: translateX(-50%);
  z-index: 13;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  text-align: center;
  background: rgba(8, 8, 7, 0.92);
  border: 1px solid rgba(233, 198, 109, 0.4);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nil-exchange-row.hidden {
  display: none;
}

.nil-exchange-row p {
  margin: 0;
  color: var(--gold-strong);
  font-weight: 700;
  font-size: 13px;
}

.nil-exchange-row button {
  min-height: 36px;
  border-radius: 999px;
  padding: 7px 18px;
}

.card-btn.card-selected {
  transform: translateY(-14px);
  outline: 2px solid var(--gold-strong);
  box-shadow: 0 0 0 3px rgba(233, 198, 109, 0.35);
}

.card-btn.card-received {
  outline: 2px solid rgba(99, 208, 196, 0.9);
  animation: nil-card-arrived 1.4s ease-in-out 2;
}

@keyframes nil-card-arrived {
  0%, 100% { box-shadow: 0 0 0 2px rgba(99, 208, 196, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(99, 208, 196, 0.4); }
}

.away-host-panel {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 16;
  width: min(390px, 86%);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  background: rgba(8, 13, 11, 0.92);
  border: 1px solid rgba(233, 198, 109, 0.36);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.away-host-panel strong,
.away-host-panel span {
  display: block;
}

.away-host-panel strong {
  color: var(--gold-strong);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.away-host-panel span {
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
}

.away-host-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.away-host-actions button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 11px;
}

.card-back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 28%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 45%, rgba(233, 198, 109, 0.26), transparent 34%),
    linear-gradient(160deg, #7a1f1f, #23121c 58%, #101726);
  border-color: rgba(255, 235, 188, 0.42);
}

.preview-back {
  pointer-events: none;
}

.card-back::before {
  content: "♠";
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 235, 188, 0.34);
  border-radius: 6px;
  color: rgba(255, 235, 188, 0.72);
  font-size: 28px;
}

body[data-deck-style="midnight"] .card-back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 28%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 45%, rgba(145, 168, 200, 0.32), transparent 34%),
    linear-gradient(160deg, #16305c, #0c1a33 58%, #060d1c);
  border-color: rgba(200, 220, 255, 0.42);
}

body[data-deck-style="ruby"] .card-back {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 28%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 50% 45%, rgba(214, 162, 160, 0.32), transparent 34%),
    linear-gradient(160deg, #7a1f3a, #3a1220 58%, #1c0c14);
  border-color: rgba(255, 210, 210, 0.42);
}

body[data-deck-style="shiny"] .card-back {
  background:
    linear-gradient(115deg, transparent 0 32%, rgba(99, 208, 196, 0.28) 38%, rgba(255, 255, 255, 0.6) 45%, rgba(233, 198, 109, 0.3) 52%, transparent 60%),
    radial-gradient(circle at 50% 45%, rgba(233, 198, 109, 0.3), transparent 34%),
    linear-gradient(160deg, #2a2410, #14110a 58%, #0a0806);
  background-size: 230% 100%, auto, auto;
  border-color: rgba(255, 232, 170, 0.5);
  animation: foilSweep 5s ease-in-out infinite;
}

body[data-deck-style="midnight"] {
  --card-face: #eef5ff;
}

body[data-deck-style="midnight"] .trick-card,
body[data-deck-style="midnight"] .mini-card,
body[data-deck-style="midnight"] .card-btn:not(.card-back) {
  border-color: #91a8c8;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.78), transparent 30%), linear-gradient(180deg, #f9fcff, #dce8f7);
}

body[data-deck-style="ruby"] {
  --card-face: #fff5f3;
}

body[data-deck-style="ruby"] .trick-card,
body[data-deck-style="ruby"] .mini-card,
body[data-deck-style="ruby"] .card-btn:not(.card-back) {
  border-color: #d6a2a0;
  background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.82), transparent 30%), linear-gradient(180deg, #fffaf6, #f4dfdc);
}

body[data-deck-style="shiny"] .trick-card,
body[data-deck-style="shiny"] .mini-card,
body[data-deck-style="shiny"] .card-btn:not(.card-back) {
  border-color: #d5c37a;
  background:
    linear-gradient(115deg, transparent 0 32%, rgba(99, 208, 196, 0.22) 38%, rgba(255, 255, 255, 0.55) 45%, rgba(233, 198, 109, 0.24) 52%, transparent 60%),
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.72), transparent 30%),
    var(--card-face);
  background-size: 230% 100%, auto, auto;
  animation: foilSweep 5s ease-in-out infinite;
}

@keyframes foilSweep {
  0%, 68%, 100% { background-position: 180% 0, 0 0, 0 0; }
  34% { background-position: -60% 0, 0 0, 0 0; }
}

.qr-card-box {
  width: min(310px, 92vw);
  text-align: center;
}

.qr-image {
  width: 220px;
  height: 220px;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.qr-invite-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .turn-countdown {
    min-width: 76px;
    margin-top: 4px;
  }

  .blind-bid-row {
    bottom: 112px;
    width: calc(100% - 24px);
    justify-content: center;
  }

  .away-host-panel {
    bottom: 188px;
  }
}



/* Poker Table Styles */
.poker-table-panel {
  padding: 0;
}

.poker-client {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg-deep);
}

.poker-balance-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(233, 198, 109, 0.1);
  border: 1px solid rgba(233, 198, 109, 0.25);
}

.balance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.poker-balance-display strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-strong);
}

.poker-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  min-height: 0;
}

.poker-table-rail {
  position: relative;
  width: min(95vw, 1100px);
  aspect-ratio: 16 / 10;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rail-dark), var(--rail));
  padding: 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 2px 0 var(--rail-light),
    inset 0 -2px 0 rgba(0, 0, 0, 0.8);
}

.poker-table-felt {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt) 40%, var(--felt-dark) 100%);
  box-shadow: inset 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.poker-table-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, rgba(233, 198, 109, 0.08), transparent 60%);
  pointer-events: none;
}

.poker-message-box {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
}

.poker-message-box p {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-strong);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  margin: 0;
}

.poker-community-cards {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.poker-community-cards .mini-card {
  width: 52px;
  height: 74px;
}

.poker-pot-display {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(28, 43, 64, 0.9), rgba(10, 18, 30, 0.95));
  border: 2px solid rgba(233, 198, 109, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.pot-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.poker-pot-display strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-strong);
}

.side-pots-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.poker-seats {
  position: absolute;
  inset: 0;
}

.poker-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
}

.poker-seat-0 { left: 50%; top: 88%; }
.poker-seat-1 { left: 20%; top: 75%; }
.poker-seat-2 { left: 8%; top: 50%; }
.poker-seat-3 { left: 20%; top: 25%; }
.poker-seat-4 { left: 50%; top: 12%; }
.poker-seat-5 { left: 80%; top: 25%; }
.poker-seat-6 { left: 92%; top: 50%; }
.poker-seat-7 { left: 80%; top: 75%; }
.poker-seat-8 { left: 65%; top: 88%; }

.poker-seat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(28, 43, 64, 0.92), rgba(10, 18, 30, 0.95));
  border: 2px solid rgba(233, 198, 109, 0.2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  min-width: 100px;
}

.poker-seat-card.empty {
  opacity: 0.5;
  border-style: dashed;
}

.poker-seat-card.current-turn {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(233, 198, 109, 0.5);
}

.poker-seat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.poker-seat-stack {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}

.poker-seat-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.poker-seat-bet {
  position: absolute;
  top: -30px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(196, 69, 58, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.poker-hole-cards {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  min-height: 120px;
}

.poker-hole-cards .card-btn {
  width: 70px;
  height: 100px;
}

.poker-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(16, 22, 32, 0.95), rgba(4, 6, 10, 0.98));
  border-top: 1px solid var(--line);
}

.poker-action-btn {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fold-btn {
  background: rgba(196, 69, 58, 0.15);
  border-color: rgba(196, 69, 58, 0.4);
  color: var(--ruby);
}

.fold-btn:hover:not(:disabled) {
  background: rgba(196, 69, 58, 0.25);
  border-color: var(--ruby);
}

.check-btn,
.call-btn {
  background: rgba(125, 204, 166, 0.15);
  border-color: rgba(125, 204, 166, 0.4);
  color: var(--green);
}

.check-btn:hover:not(:disabled),
.call-btn:hover:not(:disabled) {
  background: rgba(125, 204, 166, 0.25);
  border-color: var(--green);
}

.bet-btn,
.raise-btn {
  background: rgba(233, 198, 109, 0.15);
  border-color: rgba(233, 198, 109, 0.4);
  color: var(--gold-strong);
}

.bet-btn:hover:not(:disabled),
.raise-btn:hover:not(:disabled) {
  background: rgba(233, 198, 109, 0.25);
  border-color: var(--gold);
}

.allin-btn {
  background: rgba(75, 147, 240, 0.15);
  border-color: rgba(75, 147, 240, 0.4);
  color: var(--blue);
}

.allin-btn:hover:not(:disabled) {
  background: rgba(75, 147, 240, 0.25);
  border-color: var(--blue);
}

.poker-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.poker-bet-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.poker-bet-controls input {
  width: 120px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
}

.poker-bet-controls input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}
