:root {
  --bg: #070b09;
  --felt: #0b3d2e;
  --felt-deep: #06261d;
  --rail: #3b2414;
  --gold: #e2c078;
  --gold-dim: #a8843c;
  --ink: #f4efe4;
  --mute: #b7b09f;
  --red: #c73b3b;
  --danger: #8d2a2a;
  --glass: rgba(10, 16, 13, 0.72);
  --line: rgba(226, 192, 120, 0.22);
  --ease: cubic-bezier(0.22, 0.7, 0.28, 1);
}

@property --turn-pct {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 100%;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: radial-gradient(circle at 50% -10%, #163226 0%, var(--bg) 52%);
  color: var(--ink);
  font-family: Manrope, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

html.admin-page,
body.admin-page {
  height: auto;
  max-height: none;
  min-height: 100dvh;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body {
  display: flex;
  flex-direction: column;
}

body.admin-page {
  display: block;
}

body.admin-page .top {
  display: flex;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #070b09 70%, rgba(7, 11, 9, 0.88));
}

body.admin-page .panel {
  width: calc(100% - 24px);
  max-width: none;
  min-height: 0;
  margin: 0 12px 28px;
  padding-bottom: 28px;
  border-radius: 20px;
}

body.admin-page .table-card {
  flex-direction: column;
  align-items: stretch;
}

body.admin-page .account-actions {
  justify-content: flex-start;
}

body.admin-page .pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.admin-page .pay-row .btn {
  min-height: 40px;
  padding: 8px 12px;
}

body.admin-page .amt-in {
  width: 120px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.8' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex: 0 0 auto;
  padding: 10px 14px 8px;
  padding-top: max(10px, env(safe-area-inset-top));
}


.table-pot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gold);
  font-size: 18px;
  flex: 0 1 auto;
}

.table-pot b {
  color: var(--gold);
  font-size: 20px;
}

.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.link .ico {
  margin-right: 4px;
  vertical-align: -3px;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  flex: 1 1 auto;
}

.mode-label {
  font-style: normal;
  color: var(--mute);
  font-size: 13px;
  white-space: nowrap;
}

.brand strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  letter-spacing: 0.04em;
}

.pulse {
  animation: pulse 2.4s ease-in-out infinite;
}

.diamond {
  color: var(--gold);
  font-size: 30px;
}

.top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
  flex: 0 0 auto;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 16px;
  color: var(--mute);
}

.check input {
  width: 18px;
  height: 18px;
}

.wallet {
  text-align: right;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 12px;
}

.wallet span {
  display: block;
  color: var(--mute);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wallet b {
  color: var(--gold);
  font-size: 18px;
}

.panel {
  width: min(560px, calc(100% - 32px));
  margin: 18px auto 40px;
  padding: 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(20, 28, 23, 0.92), rgba(8, 12, 10, 0.9));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

h1,
h2 {
  font-family: "Cormorant Garamond", serif;
  margin: 0 0 8px;
}

#login h1 {
  font-size: 34px;
  margin: 0 0 6px;
}

h1 {
  font-size: 42px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--mute);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.auth-tab.on {
  border-color: var(--gold-dim);
  background: rgba(226, 192, 120, 0.12);
  color: var(--gold);
}

.lead,
.rules-body,
.share {
  color: var(--mute);
  line-height: 1.5;
}

.rules-body h3 {
  margin: 16px 0 6px;
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  color: var(--ink);
}

.rules-body h3:first-child {
  margin-top: 0;
}

.rules-body p,
.rules-body li {
  margin: 0 0 8px;
}

.rules-body ul,
.rules-body ol {
  margin: 0 0 10px;
  padding-left: 2.2em;
}

.rules-body b {
  color: var(--ink);
  font-weight: 600;
}

.rules-body .example {
  background: rgba(226, 192, 120, 0.08);
  border-left: 2px solid var(--gold-dim);
  border-radius: 0 10px 10px 0;
  padding: 8px 10px;
  color: #d8d1c2;
}

.combos {
  list-style: decimal;
  padding-left: 2.4em;
}

.combos li::marker {
  font-variant-numeric: tabular-nums;
}

.combos li {
  margin: 0 0 12px;
}

.combo-cards {
  display: flex;
  gap: 4px;
  margin: 6px 0 2px;
  flex-wrap: wrap;
}

.combo-cards .card {
  width: 34px;
  height: 48px;
  padding: 3px 4px;
  font-size: 11px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
}

.combo-cards .card b,
.combo-cards .card i {
  color: inherit;
  font-size: 11px;
  font-weight: 800;
}

.combo-cards .card i {
  font-size: 12px;
}

.music-credit {
  margin-top: 16px;
  font-size: 11px;
  opacity: 0.55;
}

.music-btn {
  position: relative;
}

.music-btn.muted {
  opacity: 0.42;
}

.music-btn.muted::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-28deg);
}

.share {
  background: #0c1210;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  word-break: break-all;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  color: var(--mute);
  font-size: 13px;
}

input {
  border: 1px solid var(--line);
  background: #0c1210;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  user-select: text;
  -webkit-user-select: text;
}

.pass-wrap {
  position: relative;
  display: block;
}

.pass-wrap input {
  width: 100%;
  padding-right: 46px;
}

.eye-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.eye-btn svg {
  width: 22px;
  height: 22px;
}

.eye-btn.on {
  color: var(--ink);
}

.eye-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pass-view {
  font-family: ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
}

textarea {
  user-select: text;
  -webkit-user-select: text;
}

input[type="number"] {
  color-scheme: dark;
  accent-color: var(--gold);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  height: 2.1em;
  cursor: pointer;
  filter: invert(0.82) sepia(1) saturate(3.2) hue-rotate(8deg) brightness(0.95);
}

.row {
  display: flex;
  gap: 12px;
}

.grow {
  flex: 1;
}

.actions,
.join-row,
.hud-meta,
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.join-row {
  margin-top: 12px;
}

.join-row input {
  flex: 1;
}

.btn,
.link {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.btn {
  border-radius: 14px;
  padding: 12px 16px;
  background: #1b2420;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.gold {
  background: linear-gradient(180deg, #f0d392, #c49a45);
  color: #2a1c08;
  border-color: transparent;
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  background: var(--danger);
  border-color: transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn,
.menu-btn {
  transition: transform 0.28s var(--ease), box-shadow 0.28s ease, background 0.28s ease;
}

.btn:hover,
.menu-btn:hover {
  transform: translateY(-2px);
}

.menu {
  display: grid;
  gap: 12px;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  background: #121a16;
  color: var(--ink);
  border-radius: 18px;
  padding: 18px 20px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.menu-btn span {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
}

.menu-btn small {
  color: var(--mute);
}

.menu-btn.gold {
  background: linear-gradient(180deg, #f0d392, #c49a45);
  color: #2a1c08;
  border-color: transparent;
}

.menu-btn.gold small {
  color: #5a3d12;
}

.menu-btn.ghost {
  background: transparent;
}

@media (max-width: 720px) {
  .panel {
    width: calc(100% - 20px);
    margin: 12px auto 24px;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .menu {
    gap: 8px;
  }
  .menu-btn {
    padding: 12px 14px;
    border-radius: 14px;
  }
  .menu-btn span {
    font-size: 22px;
  }
}

.code-box {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.code-box input {
  flex: 1;
}

.fade-up {
  animation: fadeUp 0.62s var(--ease);
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.08);
  }
}

@keyframes dealIn {
  0% {
    opacity: 0;
    transform: translateY(-130px) scale(0.28) rotate(-22deg);
  }
  62% {
    opacity: 1;
    transform: translateY(10px) scale(1.06) rotate(4deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes boardDeal {
  0% {
    opacity: 0;
    transform: translateY(-80px) scale(0.45) rotateY(80deg);
  }
  68% {
    opacity: 1;
    transform: translateY(8px) scale(1.05) rotateY(0deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes muckOut {
  0% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translate(48px, -120px) rotate(56deg) scale(0.7);
  }
}

@keyframes muckOutLeft {
  0% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translate(-48px, -120px) rotate(-50deg) scale(0.7);
  }
}

.card.hot {
  outline: 2px solid rgba(226, 192, 120, 0.55);
  animation: cardHot 1.15s ease-in-out infinite;
}

@keyframes cardHot {
  0%,
  100% {
    outline-color: rgba(226, 192, 120, 0.35);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28), 0 0 10px rgba(226, 192, 120, 0.2);
  }
  50% {
    outline-color: #f0d78a;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28), 0 0 22px rgba(226, 192, 120, 0.9);
  }
}

@keyframes holeReveal {
  from {
    opacity: 0;
    transform: rotateY(88deg) scale(0.84);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card.reveal {
  animation: holeReveal 0.55s ease-out both;
}

.card.reveal-2 {
  animation-delay: 0.22s;
}

.card.hot.reveal {
  animation: holeReveal 0.55s ease-out both, cardHot 1.15s ease-in-out 0.6s infinite;
}

.card.hot.reveal-2 {
  animation-delay: 0s, 0.82s;
}

.card.deal {
  animation: dealIn 0.95s cubic-bezier(0.22, 0.72, 0.28, 1) both;
}

.card.deal-1 {
  animation-delay: 0.06s;
}

.card.deal-2 {
  animation-delay: 0.4s;
}

.card.board-deal {
  animation: boardDeal 0.75s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}

.card.muck {
  animation: muckOut 0.62s var(--ease) forwards;
}

.card.muck:nth-child(1),
.hero-hole .card.muck:first-child {
  animation-name: muckOutLeft;
}

.card.gone {
  opacity: 0;
  visibility: hidden;
}

.link {
  background: none;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.open-tables {
  margin-top: 26px;
}

.table-list {
  display: grid;
  gap: 8px;
}

.table-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d1411;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.felt {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 10px 8px;
  overflow: hidden;
}

.rail {
  position: relative;
  width: min(980px, 100%);
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  background: radial-gradient(circle at 30% 20%, #6a4324, var(--rail) 55%);
  border-radius: 999px;
  box-shadow: inset 0 0 0 6px #2a180d, 0 20px 50px rgba(0, 0, 0, 0.4);
}

.table {
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 40%, #146048, var(--felt) 46%, var(--felt-deep) 80%);
  box-shadow: inset 0 0 0 3px rgba(226, 192, 120, 0.18), inset 0 0 80px rgba(0, 0, 0, 0.35);
}

.felt-glow {
  position: absolute;
  inset: 18%;
  border: 1px dashed rgba(226, 192, 120, 0.18);
  border-radius: 999px;
}

.dealer {
  position: absolute;
  left: 50%;
  top: 2%;
  transform: translateX(-50%);
  z-index: 8;
  width: 88px;
  text-align: center;
  pointer-events: none;
}

.dealer svg {
  width: 54px;
  height: 60px;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
}

.dealer em {
  display: block;
  margin-top: -6px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d8c48a;
}

.dealer.throwing svg {
  animation: throw 0.7s ease;
}

@keyframes throw {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-12px) rotate(-10deg);
  }
  70% {
    transform: translateY(-4px) rotate(6deg);
  }
  100% {
    transform: none;
  }
}

.center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, 68%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
}

.fx-chip,
.fx-flycard {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
}

.fx-chip {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f3d89a, #c4963d 52%, #7a5418);
  border: 2px solid #f6e4b0;
  box-shadow: inset 0 0 0 3px #8d5c1c, 0 4px 10px rgba(0, 0, 0, 0.45);
  animation: chipFly 0.72s var(--ease) forwards;
}

.fx-flycard {
  width: 30px;
  height: 42px;
  margin: -21px 0 0 -15px;
  border-radius: 5px;
  background: repeating-linear-gradient(45deg, #6e1d2a, #6e1d2a 5px, #4d121c 5px, #4d121c 10px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  animation: cardThrow 0.68s var(--ease) forwards;
}

.fx-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(12, 16, 14, 0.92);
  border: 1px solid rgba(226, 192, 120, 0.45);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: tagPop 0.95s var(--ease) forwards;
}

.fx-tag.check {
  color: #d9c89a;
  border-color: rgba(217, 200, 154, 0.4);
}

.fx-tag.fold {
  color: #e07a7a;
  border-color: rgba(224, 122, 122, 0.5);
}

.fx-tag.bet {
  color: #f0d392;
}

@keyframes chipFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.7);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.85);
  }
}

@keyframes cardThrow {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot, 40deg)) scale(0.55);
  }
}

@keyframes tagPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.7);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -80%) scale(1.06);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1);
  }
}

#seats {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.pot strong {
  display: block;
  color: var(--gold);
  font-size: 22px;
}

.board {
  display: flex;
  gap: 6px;
  min-height: 62px;
}

.street,
.log {
  margin: 0;
  max-width: 100%;
  color: #d9c89a;
  font-size: 14px;
  white-space: pre-line;
}

.hud .log {
  display: none;
}

.seat {
  position: absolute;
  width: 96px;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}

.seat.empty {
  width: 56px;
  opacity: 0.38;
  z-index: 1;
}

.seat.empty.invite {
  opacity: 1;
  pointer-events: auto;
  width: 52px;
  z-index: 10;
}

.seat-plus {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border: 2px dashed rgba(226, 192, 120, 0.55);
  border-radius: 50%;
  background: rgba(7, 11, 9, 0.55);
  color: var(--gold);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.seat-plus:hover {
  border-color: var(--gold);
  background: rgba(226, 192, 120, 0.12);
}

.kick-btn {
  pointer-events: auto;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(199, 59, 59, 0.55);
  border-radius: 999px;
  background: rgba(80, 18, 18, 0.75);
  color: #f0c8c8;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.seat.empty .chair {
  width: 34px;
  height: 34px;
  margin: 0 auto 4px;
  border: 2px dashed rgba(226, 192, 120, 0.28);
  border-radius: 50%;
}

.seat.empty .who {
  color: #9a8b6a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 9px;
}

.seat-say {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  box-sizing: border-box;
  width: max-content;
  min-width: 132px;
  max-width: min(240px, 72vw);
  padding: 7px 10px;
  border-radius: 12px 12px 12px 4px;
  background: rgba(14, 20, 17, 0.96);
  border: 1px solid rgba(226, 192, 120, 0.42);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  display: block;
  overflow: visible;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
}

.seat-say::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: rgba(14, 20, 17, 0.95);
  border-right: 1px solid rgba(226, 192, 120, 0.42);
  border-bottom: 1px solid rgba(226, 192, 120, 0.42);
  transform: rotate(45deg);
}

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

.seat-say.pop {
  animation: sayPop 0.28s var(--ease);
}

.seat.north .seat-say {
  bottom: auto;
  top: calc(100% + 6px);
  border-radius: 4px 12px 12px 12px;
}

.seat.north .seat-say::after {
  top: -5px;
  bottom: auto;
  transform: rotate(225deg);
}

@keyframes sayPop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.seat .who {
  font-size: 11px;
  margin-bottom: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat:not(.empty) {
  background: rgba(7, 11, 9, 0.82);
  border: 1px solid rgba(226, 192, 120, 0.18);
  border-radius: 10px;
  padding: 4px 6px 5px;
  width: auto;
  min-width: 72px;
  max-width: 104px;
}

.seat .stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.seat .stack small {
  display: none;
}

.seat.actor {
  outline: none;
  animation: none;
}

.seat-ring {
  display: none;
}

.seat.actor .seat-ring {
  display: block;
  position: absolute;
  inset: -5px;
  border-radius: 13px;
  padding: 2.5px;
  pointer-events: none;
  background: conic-gradient(from -90deg, #46d278 var(--turn-pct, 100%), rgba(70, 210, 120, 0.14) 0);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.seat.actor.warn .seat-ring {
  background: conic-gradient(from -90deg, #e35a5a var(--turn-pct, 100%), rgba(227, 90, 90, 0.16) 0);
}

.seat .inpot {
  color: #8a8270;
  font-size: 10px;
}

.entry-status {
  font-size: 9px;
  line-height: 1.2;
  margin: 1px 0 2px;
}

.entry-status.in {
  color: rgba(90, 180, 120, 0.55);
}

.entry-status.wait {
  color: #8a8270;
}

.seat.folded {
  opacity: 0.42;
  transition: opacity 0.55s ease 0.12s;
}

.seat.seat-in {
  animation: seatIn 0.72s var(--ease);
}

.seat.seat-out {
  animation: seatOut 0.68s var(--ease) forwards;
}

@keyframes seatIn {
  from {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.74);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes seatOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.78);
  }
}

.badge {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 3px;
  overflow: visible;
}

.seat .card {
  width: 24px;
  height: 34px;
  font-size: 9px;
  padding: 2px 3px;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.card {
  width: 52px;
  height: 74px;
  border-radius: 8px;
  background: #f7f1e6;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 6px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.28);
}

.card.red {
  color: var(--red);
}

.card.back {
  background: repeating-linear-gradient(45deg, #6e1d2a, #6e1d2a 6px, #4d121c 6px, #4d121c 12px);
  color: transparent;
}

.card.ghost {
  opacity: 0.28;
  background: rgba(255, 255, 255, 0.08);
}

.card b,
.card i {
  font-style: normal;
  line-height: 1;
}

.card i {
  align-self: flex-end;
}

.hud {
  width: min(980px, 100%);
  flex: 0 0 auto;
  margin: 6px auto 0;
  display: grid;
  gap: 6px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  z-index: 7;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.hero-hole {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 76px;
  overflow: visible;
}

.hero-hole .card {
  width: 54px;
  height: 76px;
}

.hero-cash {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--gold);
  min-width: 72px;
}

.hero-cash span {
  color: var(--mute);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-cash b {
  color: var(--gold);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.turn-clock {
  width: 42px;
  height: 42px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 700;
}

.turn-clock.warn {
  border-color: #e35a5a;
  color: #e35a5a;
}

.stake-box {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mute);
  font-size: 12px;
}

.stake-box input {
  width: 84px;
  padding: 8px 10px;
}

.entry-wait {
  width: 100%;
  margin: 0 0 4px;
  text-align: center;
  color: #d9c89a;
  font-size: 14px;
}

.ante-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  color: var(--mute);
  font-size: 13px;
}

.ante-edit input {
  width: 84px;
  margin-left: 6px;
}

.hud-meta {
  display: flex;
  justify-content: space-between;
  color: var(--mute);
}

.controls {
  justify-content: center;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

.felt.sweeping .card,
.felt.sweeping .inpot,
.felt.sweeping .badge,
.felt.sweeping .log {
  animation: sweepOut 0.45s ease forwards;
}

@keyframes sweepOut {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.9);
  }
}

#chatToggle {
  position: relative;
}

.chat-dot {
  position: absolute;
  top: 2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #46d278;
  box-shadow: 0 0 0 2px #070b09;
}

.chat-panel {
  position: fixed;
  right: 12px;
  top: 58px;
  bottom: 18px;
  width: min(320px, calc(100vw - 24px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(16, 22, 19, 0.96), rgba(8, 12, 10, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}

.chat-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  color: var(--gold);
}

.chat-close {
  border: 0;
  background: none;
  color: var(--mute);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-line {
  font-size: 13px;
  line-height: 1.35;
}

.chat-line b {
  color: var(--gold);
  font-weight: 600;
  margin-right: 6px;
}

.chat-line.sys {
  color: #d9c89a;
}

.chat-line.sys b {
  color: #d9c89a;
}

.chat-line.mine b {
  color: #86d4a4;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
}

.chat-form .btn {
  flex: 0 0 auto;
}

.table-banner {
  position: fixed;
  left: 50%;
  top: max(52px, calc(env(safe-area-inset-top) + 46px));
  transform: translateX(-50%) translateY(-6px);
  z-index: 40;
  max-width: min(420px, calc(100vw - 24px));
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(226, 192, 120, 0.38);
  background: linear-gradient(180deg, rgba(24, 20, 14, 0.94), rgba(12, 10, 8, 0.92));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(226, 192, 120, 0.08);
  color: var(--gold);
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s var(--ease);
}

.table-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.table-banner.win {
  font-size: 15px;
  padding: 6px 14px;
  border-color: rgba(226, 192, 120, 0.55);
}

.table-banner.fade {
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
}

.toast {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top));
  bottom: auto;
  transform: translateX(-50%) translateY(-8px);
  z-index: 90;
  max-width: min(420px, calc(100vw - 28px));
  background: linear-gradient(180deg, rgba(32, 24, 14, 0.96), rgba(16, 12, 8, 0.94));
  border: 1px solid rgba(226, 192, 120, 0.5);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(226, 192, 120, 0.08);
  color: var(--gold);
  padding: 10px 22px;
  border-radius: 999px;
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.48s var(--ease), transform 0.48s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #101612;
  color: var(--ink);
  width: min(520px, 92vw);
  padding: 22px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

dialog[open].on {
  opacity: 1;
  transform: none;
}

dialog[open].on.closing,
dialog.closing {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  transition: opacity 0.4s ease;
}

dialog[open].on::backdrop {
  opacity: 1;
}

dialog[open].on.closing::backdrop,
dialog.closing::backdrop {
  opacity: 0;
}

#rules {
  width: min(560px, 92vw);
  max-height: min(84dvh, 740px);
  padding: 20px 8px 16px 22px;
  background: #101612;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
  user-select: none;
  -webkit-user-select: none;
}

#rules,
#rules * {
  user-select: none;
  -webkit-user-select: none;
}

#rules[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  margin: auto;
  height: min(84dvh, 740px);
}

#rules h2 {
  flex: 0 0 auto;
  padding-right: 14px;
}

.rules-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 14px;
  margin: 8px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: #c9a55a rgba(226, 192, 120, 0.12);
}

.rules-body::-webkit-scrollbar {
  width: 8px;
}

.rules-body::-webkit-scrollbar-track {
  margin: 6px 0;
  background: #0c1210;
  border: 1px solid rgba(226, 192, 120, 0.16);
  border-radius: 99px;
}

.rules-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #edcf8a, #9a732e);
  border-radius: 99px;
  border: 1px solid rgba(16, 22, 18, 0.35);
}

.rules-body::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

#rules .btn {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .brand {
    gap: 6px;
  }
  .brand strong {
    font-size: 20px;
    letter-spacing: 0.02em;
  }
  .diamond {
    font-size: 22px;
  }
  .mode-label {
    display: none;
  }
  .table-pot:not(.hidden) {
    flex: 1 1 100%;
    order: 5;
    font-size: 15px;
    padding: 4px 0 2px;
  }
  .table-pot b {
    font-size: 16px;
  }
  .top-right {
    gap: 8px;
  }
  .wallet {
    padding: 4px 10px;
  }
  .wallet b {
    font-size: 16px;
  }
  .rail {
    border-radius: 48px;
    padding: 8px;
  }
  .table {
    border-radius: 48px;
  }
  .seat {
    width: 72px;
  }
  .seat:not(.empty) {
    min-width: 64px;
    max-width: 86px;
    padding: 3px 5px;
  }
  .seat .card {
    width: 22px;
    height: 31px;
    font-size: 9px;
  }
  .seat-say {
    min-width: 120px;
    max-width: min(220px, 70vw);
    font-size: 12px;
    padding: 6px 8px;
  }
  .dealer {
    width: 70px;
  }
  .dealer svg {
    width: 44px;
    height: 48px;
  }
  .card {
    width: 36px;
    height: 52px;
    font-size: 12px;
  }
  .hero-hole .card {
    width: 48px;
    height: 68px;
  }
  .hero-cash b {
    font-size: 18px;
  }
  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .combo-cards .card {
    width: 30px;
    height: 42px;
    padding: 2px 3px;
  }
  .combo-cards .card b,
  .combo-cards .card i {
    font-size: 10px;
  }
}

@media (min-height: 640px) {
  .rail {
    min-height: 240px;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .table-pot:not(.hidden) {
    flex: 0 1 auto;
    order: 0;
    padding: 0;
    font-size: 14px;
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .top {
    flex-wrap: nowrap;
    gap: 6px 8px;
    padding: 4px 10px 4px;
    padding-top: max(4px, env(safe-area-inset-top));
  }
  .brand strong {
    font-size: 18px;
  }
  .diamond {
    font-size: 18px;
  }
  .mode-label,
  .link-text,
  .wallet span,
  .hero-cash span,
  .dealer {
    display: none;
  }
  .table-pot:not(.hidden) {
    flex: 0 1 auto;
    order: 0;
    font-size: 13px;
    padding: 0;
  }
  .table-pot b {
    font-size: 14px;
  }
  .top-right {
    gap: 6px;
  }
  .wallet {
    padding: 2px 8px;
  }
  .wallet b {
    font-size: 14px;
  }
  .felt {
    padding: 2px 8px 4px;
  }
  .rail {
    min-height: 0;
    border-radius: 36px;
    box-shadow: inset 0 0 0 4px #2a180d, 0 8px 20px rgba(0, 0, 0, 0.4);
  }
  .table {
    inset: 6px;
    border-radius: 36px;
  }
  .felt-glow {
    inset: 16%;
  }
  .board {
    min-height: 40px;
    gap: 4px;
  }
  .card {
    width: 28px;
    height: 40px;
    font-size: 11px;
  }
  .seat {
    width: 64px;
  }
  .seat:not(.empty) {
    min-width: 58px;
    max-width: 78px;
    padding: 2px 4px;
  }
  .seat.empty {
    width: 44px;
  }
  .seat .card {
    width: 18px;
    height: 26px;
    font-size: 8px;
  }
  .seat-say {
    min-width: 110px;
    max-width: min(200px, 68vw);
    font-size: 12px;
    padding: 5px 8px;
  }
  .table-banner {
    top: max(36px, calc(env(safe-area-inset-top) + 32px));
    font-size: 13px;
    padding: 4px 12px;
  }
  .hud {
    gap: 4px;
    margin: 2px auto 0;
    max-height: 46dvh;
    overflow: hidden;
  }
  .hud .log,
  .entry-wait {
    font-size: 12px;
    min-height: 0;
  }
  .hero-row {
    gap: 8px;
  }
  .hero-hole {
    min-height: 0;
    gap: 4px;
  }
  .hero-hole .card {
    width: 34px;
    height: 48px;
  }
  .hero-cash b {
    font-size: 16px;
  }
  .turn-clock {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .controls {
    gap: 6px;
  }
  .btn {
    padding: 7px 10px;
    min-height: 36px;
    font-size: 13px;
  }
  .stake-box input,
  .ante-edit input {
    width: 64px;
    padding: 6px 8px;
  }
}

.pay-hint {
  margin: 0 0 12px;
  color: var(--mute);
  line-height: 1.45;
}

.pay-hint b {
  color: var(--gold);
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.copy-row code {
  flex: 1 1 160px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d1411;
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.04em;
  user-select: text;
  -webkit-user-select: text;
}

.pay-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.pay-amounts .btn {
  min-height: 40px;
}

#splash.out {
  opacity: 0;
  pointer-events: none;
}

.net-warn {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(7, 11, 9, 0.42);
  color: var(--gold);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  animation: netBlink 1.8s ease-in-out infinite;
}

.net-warn.hidden {
  display: none;
}

@keyframes netBlink {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 1;
  }
}

.invite-bar {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invite-bar.hidden {
  display: none;
}

.invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 16, 13, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.invite-card p {
  margin: 0;
  font-size: 13px;
}

.invite-card small {
  display: block;
  color: var(--mute);
  font-size: 11px;
}

.invite-card .invite-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.friend-add {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.friend-add input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(48dvh, 360px);
  overflow-y: auto;
  margin-bottom: 12px;
}

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.friend-row b {
  display: block;
}

.friend-row .seen {
  color: var(--mute);
  font-size: 12px;
}

.friend-row .seen.online {
  color: #7dcea0;
}

.friend-row .friend-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

#friends,
#invite {
  width: min(440px, 92vw);
  max-height: min(90dvh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
