:root {
  --bg-1: #071220;
  --bg-2: #03070d;
  --panel: rgba(8, 16, 30, 0.84);
  --panel-border: rgba(125, 178, 255, 0.22);
  --text: #ecf5ff;
  --muted: #94abca;
  --accent: #42c2ff;
  --accent-2: #4cff9b;
  --danger: #ff5d6c;
  --warning: #ffc857;
  --gold: #f6d986;
  --table-felt-1: #2f9e44;
  --table-felt-2: #1f7a34;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Chakra Petch', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #102947 0, transparent 34%),
    radial-gradient(circle at 92% 5%, #1a3e2f 0, transparent 38%),
    linear-gradient(165deg, var(--bg-1), var(--bg-2));
}

.page-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 12px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 0;
}

.screen.active {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(4, 9, 18, 0.9);
  border: 1px solid rgba(143, 192, 255, 0.22);
}

body.table-mode .topbar {
  display: none;
}

.brand h1 {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.brand p {
  margin: 0;
  color: var(--muted);
}

.status-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.connection-status {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.connection-status.status-online {
  color: #6dffb8;
}

.connection-status.status-offline,
.connection-status.status-error {
  color: #ff9fa9;
}

.connection-status.status-pending {
  color: #ffd97d;
}

.connection-status.status-info {
  color: #9cc7ff;
}

.status-line .btn {
  padding: 7px 10px;
  position: relative;
}

.status-line .btn.has-alert::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b48;
  box-shadow: 0 0 0 2px rgba(8, 16, 30, 0.95), 0 0 8px rgba(255, 59, 72, 0.6);
}

.pill {
  border: 1px solid var(--panel-border);
  background: rgba(8, 16, 30, 0.9);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
}

.pill.muted {
  color: var(--muted);
}

.panel {
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(3px);
  padding: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  font-size: 1.6rem;
}

label {
  display: grid;
  gap: 5px;
  font-size: 0.9rem;
}

input,
select,
button {
  font-family: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(126, 173, 241, 0.36);
  background: rgba(6, 14, 26, 0.95);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 9px;
}

.btn {
  border: 1px solid rgba(160, 202, 255, 0.4);
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(11, 27, 49, 0.92);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(160, 202, 255, 0.7);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  border-color: rgba(82, 213, 255, 0.6);
  background: linear-gradient(135deg, #124482, #0b5e70);
}

.btn.warning {
  border-color: rgba(255, 210, 121, 0.8);
  background: linear-gradient(135deg, #6a4a12, #8b5f15);
}

.btn.danger {
  border-color: rgba(255, 112, 126, 0.7);
  background: linear-gradient(135deg, #7e2138, #521021);
}

.hint {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 8px 0 0;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.btn-row.single {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.auth-card {
  max-width: 480px;
  margin: 40px auto;
  display: grid;
  gap: 10px;
}

.auth-password-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-password-len-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 93, 108, 0.8);
  box-shadow: 0 0 8px rgba(255, 93, 108, 0.4);
  flex: 0 0 12px;
}

.auth-password-len-dot.ok {
  background: rgba(76, 255, 155, 0.95);
  box-shadow: 0 0 10px rgba(76, 255, 155, 0.65);
}

.profile-page-wrap {
  width: min(860px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.faq-page-wrap {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

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

.profile-page-head h2 {
  margin: 0;
}

.profile-ingame-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-ingame-row input {
  flex: 1 1 280px;
  min-width: 0;
}

.profile-ingame-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.profile-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-url-row input {
  flex: 1;
}

.profile-avatar-preview-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar-preview {
  width: 72px;
  height: 72px;
}

.profile-avatar-preview .player-icon {
  width: 72px;
  height: 72px;
  margin-left: 0;
}

.profile-url-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(126, 173, 241, 0.4);
  background: rgba(6, 14, 26, 0.95);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ad0ff;
}

.profile-url-icon:hover {
  border-color: rgba(153, 201, 255, 0.8);
  background: rgba(11, 25, 45, 0.95);
}

.profile-url-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.lobby-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.chips-block {
  flex: 1 1 auto;
  min-width: 0;
}

.chips-title {
  color: var(--muted);
}

.chips-value {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.04em;
  line-height: 1;
}

.profile-block {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.lobby-online-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.lobby-online-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lobby-online-head h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.lobby-online-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 30px);
  grid-auto-columns: 30px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  min-height: 68px;
}

.lobby-online-grid .hint {
  grid-column: 1 / -1;
  align-self: center;
}

.online-user-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.online-user-btn .inline-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}

.online-user-btn:hover .inline-avatar,
.online-user-btn:focus-visible .inline-avatar {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 0 0 2px rgba(159, 212, 255, 0.55);
}

.lobby-table-wrap {
  overflow-x: auto;
}

.lobby-table {
  width: max-content;
  border-collapse: collapse;
  min-width: clamp(700px, 92vw, 920px);
}

.lobby-table th,
.lobby-table td {
  border-bottom: 1px solid rgba(115, 160, 230, 0.28);
  padding: clamp(6px, 0.9vw, 10px) clamp(4px, 0.8vw, 8px);
  text-align: left;
  font-size: clamp(0.84rem, 0.76rem + 0.3vw, 1rem);
}

.lobby-table thead th {
  color: #b8d2f8;
  font-weight: 700;
}

.lobby-table td:first-child {
  color: var(--gold);
  font-weight: 700;
}

.lobby-friends {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.lobby-friends .inline-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.table-name-btn {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.table-name-btn:hover {
  color: #ffe7a8;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  border-bottom: 1px solid rgba(115, 160, 230, 0.28);
  padding: 8px 6px;
  text-align: left;
}

.name-with-avatar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(150, 204, 255, 0.75);
  background: radial-gradient(circle at 30% 30%, #79d8ff, #2f78b8);
  display: inline-flex;
  flex: 0 0 24px;
}

.inline-avatar-female {
  background: radial-gradient(circle at 30% 30%, #ffb2da, #d65e9e);
}

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

.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.table-title {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  font-size: 2rem;
  line-height: 1;
}

.table-subtitle {
  color: var(--muted);
}

.table-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-meta-hidden {
  display: none;
}

.table-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'main'
    'controls';
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.table-layout.chat-hidden,
#tableScreen.chat-hidden .table-layout {
  grid-template-rows: minmax(0, 1fr) auto;
}

#tableScreen.chat-hidden .table-wrap {
  min-height: 0;
}

#tableScreen.chat-hidden .poker-table {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.table-wrap {
  grid-area: main;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  align-content: stretch;
}

.table-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 0 4px;
}

.table-header-center {
  justify-self: center;
  min-width: 0;
}

.table-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  justify-self: end;
}

.table-header-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.table-header-btns .btn {
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
}

.table-icon-btn {
  width: 42px;
  height: 40px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-bankroll-btn {
  min-width: 142px;
  justify-content: center;
}

#tableProfileChips {
  color: #eaf6ff;
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.phase {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-room-name {
  color: #b7cbe3;
  font-size: 0.8em;
}

.table-header.omit-room-name .phase-room-name {
  display: none;
}

.table-header.omit-win-chance .street-odds {
  display: none;
}

.street-odds {
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(90, 239, 178, 0.42);
  color: #cbffe5;
  background: rgba(5, 32, 19, 0.7);
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  position: relative;
  z-index: 11;
}

.street-odds::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(340px, 70vw);
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(126, 173, 241, 0.34);
  background: rgba(6, 14, 26, 0.96);
  color: #d7eaff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.32);
  z-index: 30;
}

.street-odds:hover::after,
.street-odds:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.poker-table {
  position: relative;
  height: 100%;
  min-height: 390px;
  max-height: none;
  border-radius: 18px;
  border: 2px solid rgba(179, 235, 157, 0.4);
  background:
    radial-gradient(circle at 30% 22%, rgba(200, 255, 134, 0.24), transparent 38%),
    radial-gradient(circle at 65% 75%, rgba(16, 81, 40, 0.45), transparent 48%),
    linear-gradient(135deg, var(--table-felt-1), var(--table-felt-2));
  box-shadow: inset 0 0 120px rgba(1, 20, 8, 0.58);
  overflow: visible;
}

.poker-table::before {
  content: '';
  position: absolute;
  inset: 18% 5.5% 16%;
  border-radius: 50%;
  border: 2px solid rgba(240, 247, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 0;
}

.felt-glow {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 0.7px, transparent 0.7px);
  background-size: 4px 4px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.community-area {
  position: absolute;
  left: 50%;
  top: calc(50% + 8px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 6px;
  justify-items: center;
  z-index: 4;
}

.pot-amount {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 236, 172, 0.7);
  background: rgba(16, 19, 8, 0.78);
  color: #fff6cf;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.55rem;
  letter-spacing: 0.05em;
}

#potLabel {
  display: none;
}

.pot-chip-stack {
  min-height: 24px;
}

.cards,
.seat-cards {
  display: flex;
  gap: 8px;
}

.seat-cards {
  /* Keep space for 2 hole cards so chip position stays consistent even when cards are hidden. */
  min-width: 76px;
}

.seat-cards.folded {
  opacity: 0.55;
  filter: saturate(0.6);
}

.seat-cards-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-areas:
    'cards info';
  align-items: center;
  justify-items: start;
  column-gap: 10px;
  row-gap: 0;
  min-height: 38px;
  position: absolute;
  left: 14px;
  top: -46px;
  width: calc(100% - 24px);
  max-width: calc(100% - 24px);
  margin-top: 0;
  margin-bottom: 0;
  z-index: 6;
  pointer-events: none;
}

.seat-cards {
  grid-area: cards;
  align-self: start;
  justify-content: flex-start;
}

.seat-hand-info {
  grid-area: info;
  align-self: center;
  color: #d6ffe9;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  min-height: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  text-align: left;
}

.seat-inline-bet {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-left: 0;
  margin-top: 0;
  min-height: 15px;
  position: static;
  left: auto;
  top: auto;
  bottom: auto;
  transform: none;
  z-index: 7;
  pointer-events: none;
}

.seat-inline-bet.seat-inline-bet-empty {
  min-height: 0;
}

.seat-leave-after-btn {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 159, 159, 0.9);
  background: rgba(141, 20, 20, 0.96);
  color: #ffeaea;
  font-size: 1.02rem;
  line-height: 1;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 4;
}

.seat-leave-after-btn.active {
  background: rgba(89, 15, 15, 0.95);
  border-color: rgba(255, 193, 193, 0.95);
}

.seat-leave-after-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.seat-inline-bet .chip-stack {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.seat-inline-bet .chip-amount {
  display: block;
  width: auto;
  white-space: nowrap;
  text-align: center;
  line-height: 1.1;
}

.card,
.mini-card {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #f6f7f3;
  color: #141414;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.card {
  width: 54px;
  height: 74px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-card {
  width: 34px;
  height: 44px;
  border-radius: 6px;
  font-size: 0.88rem;
}

.card.red,
.mini-card.red {
  color: #d43232;
}

.card.back,
.mini-card.back {
  background: linear-gradient(135deg, #af3030, #6d1313);
  color: #fff;
}

.community-card-slot {
  width: 54px;
  height: 74px;
}

.card.card-flip-shell {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  perspective: 760px;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: board-card-flip 480ms cubic-bezier(0.22, 0.74, 0.2, 1) both;
}

.card-flip-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  backface-visibility: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-flip-back {
  background: linear-gradient(135deg, #af3030, #6d1313);
  color: #fff;
}

.card-flip-front {
  background: #f6f7f3;
  color: #141414;
  transform: rotateY(180deg);
}

.card-flip-front.red {
  color: #d43232;
}

@keyframes board-card-flip {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(180deg);
  }
}

.seat-layer,
.bet-chip-layer,
.chip-anim-layer {
  position: absolute;
  inset: 0;
}

.seat-layer {
  z-index: 5;
}

.bet-chip-layer {
  z-index: 2;
  pointer-events: none;
  display: none;
}

.chip-anim-layer {
  z-index: 120;
  pointer-events: none;
}

.seat {
  position: absolute;
  --seat-pad-left: 12px;
  --seat-pad-right: 10px;
  --seat-avatar-offset: 0px;
  --seat-avatar-size: 52px;
  --seat-bubble-height: 64px;
  --seat-bet-shift: 30%;
  width: 239px;
  min-height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(159, 222, 255, 0.35);
  background: linear-gradient(90deg, rgba(2, 16, 10, 0.82), rgba(2, 12, 8, 0.68));
  padding: 6px var(--seat-pad-right) 6px var(--seat-pad-left);
  transform: translate(-50%, -50%);
  overflow: visible;
}

.seat.turn {
  border-color: rgba(255, 233, 138, 0.95);
  box-shadow: 0 0 16px rgba(255, 239, 171, 0.35);
}

.seat.self {
  border-color: rgba(76, 255, 155, 0.86);
}

.seat.folded {
  opacity: 0.55;
}

.seat.waiting-next-hand {
  opacity: 0.5;
  filter: saturate(0.7);
}

.seat.winner {
  border-color: rgba(255, 225, 132, 0.95);
  box-shadow: 0 0 20px rgba(255, 218, 122, 0.38);
}

.seat-combo {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  color: #d6ffe9;
  font-size: 0.76rem;
  font-weight: 700;
  z-index: 3;
  white-space: nowrap;
}

.seat.seat-0 .seat-combo {
  bottom: auto;
  top: calc(100% + 4px);
}

.seat-top {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 52px;
  margin-top: 0;
}

.seat-remove-bot-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 132, 132, 0.7);
  background: rgba(71, 12, 12, 0.82);
  color: #ffd9d9;
  font-size: 0.9rem;
  line-height: 1;
  font-weight: 700;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.seat-remove-bot-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.seat-plus {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px dashed rgba(194, 238, 166, 0.95);
  background: rgba(4, 26, 13, 0.45);
  color: #ebffd5;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  z-index: 9;
}

.player-icon {
  position: relative;
  width: var(--seat-avatar-size, 52px);
  height: var(--seat-avatar-size, 52px);
  margin-left: 0;
  border-radius: 50%;
  border: 3px solid rgba(160, 216, 255, 0.9);
  background: radial-gradient(circle at 30% 30%, #4b99d6, #1b3d66);
  overflow: hidden;
  cursor: pointer;
}

.player-icon.lucky-glow {
  border-color: rgba(255, 224, 94, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 214, 92, 0.4),
    0 0 14px rgba(255, 208, 74, 0.9);
}

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

.player-icon.player-icon-blank {
  background: linear-gradient(145deg, rgba(10, 18, 30, 0.98), rgba(4, 8, 15, 0.98));
}

.player-icon.sil-male {
  background: radial-gradient(circle at 30% 30%, #79d8ff, #2f78b8);
}

.player-icon.sil-female {
  background: radial-gradient(circle at 30% 30%, #ffb2da, #d65e9e);
}

.seat-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dealer-chip {
  position: absolute;
  right: -3px;
  top: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 244, 185, 0.85);
  background: rgba(135, 34, 34, 0.95);
  color: #fff4c2;
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.seat-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.seat-outside-meta {
  position: absolute;
  left: 0;
  top: calc(100% + 3px);
  width: 100%;
  padding: 0 var(--seat-pad-right) 0 calc(var(--seat-pad-left) + var(--seat-avatar-offset));
  display: grid;
  grid-template-rows: auto auto auto;
  align-items: start;
  justify-items: stretch;
  gap: 2px;
  z-index: 7;
  pointer-events: none;
  overflow: visible;
}

.seat-outside-track {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: visible;
}

.seat-outside-track-bet {
  position: relative;
  z-index: 1;
  width: var(--seat-avatar-size);
  margin-left: var(--seat-bet-shift);
  margin-top: calc(12px + (var(--seat-bubble-height) * 0.3));
}

.seat-outside-track-action {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  justify-content: flex-end;
  z-index: 2;
}

.seat-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.seat-name-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.seat-rank {
  color: #9fc6ee;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.seat-bot-role {
  color: #9fe8c4;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.seat-name-link {
  display: inline-block;
  cursor: pointer;
}

.seat-name-link:hover {
  text-decoration: underline;
}

.seat-name-text {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-name-friend {
  color: #8cc9ff;
  text-shadow: 0 0 4px rgba(140, 201, 255, 0.4);
}

.seat-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.seat-stack {
  color: #80ffb2;
  font-weight: 700;
  white-space: nowrap;
}

.seat-status-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  min-height: 40px;
  overflow: visible;
}

.seat-action-inline {
  position: static;
  align-self: flex-start;
  width: 100%;
  max-width: none;
  margin-top: 0;
  text-align: right;
  color: #eaf5ff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
}

.seat-action-inline.action-default {
  color: #eaf5ff;
}

.seat-action-inline.action-fold {
  color: #ff8092;
}

.seat-action-inline.action-check {
  color: #dbeafe;
}

.seat-action-inline.action-call {
  color: #7dd3fc;
}

.seat-action-inline.action-bet {
  color: #ffd166;
}

.seat-action-inline.action-raise {
  color: #ffb86b;
}

.seat-action-inline.action-allin {
  color: #f9a8ff;
}

.seat-action-inline.action-win {
  color: #fff085;
}

.seat-action-inline.action-topup {
  color: #9ee7ff;
}

.seat-action-inline.action-leave {
  color: #ff9fb2;
}

.seat-action-inline.action-wait {
  color: #d1d9e6;
}

.seat-action-inline.action-muck {
  color: #cab6ff;
}

.seat-bet {
  color: #ffd88f;
  font-size: 0.86rem;
}

.seat-timer-bar {
  width: 100%;
  height: 6px;
  margin: 0 0 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.seat-timer-bar.idle {
  visibility: hidden;
}

.seat-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #35ff7b, #9cff6a);
  transition: width 220ms linear, background 220ms linear;
}

.seat-timer-fill.urgent {
  background: linear-gradient(90deg, #ffe17a, #ff8a65);
}

.seat-0 {
  left: 50%;
  top: 18%;
}

.seat-1 {
  left: 86%;
  top: 30%;
}

.seat-2 {
  left: 86%;
  top: 69%;
}

.seat-3 {
  left: 50%;
  top: 84%;
}

.seat-4 {
  left: 14%;
  top: 69%;
}

.seat-5 {
  left: 14%;
  top: 30%;
}

.seat-bet-chip {
  position: absolute;
  z-index: 1;
  display: none !important;
}

.seat-bet-chip.seat-0 {
  left: 45%;
  top: 16%;
  transform: translate(-50%, -50%);
}

.seat-bet-chip.seat-1 {
  left: 86%;
  top: 44%;
  transform: translate(-50%, -50%);
}

.seat-bet-chip.seat-2 {
  left: 86%;
  top: 83%;
  transform: translate(-50%, -50%);
}

.seat-bet-chip.seat-3 {
  left: 45%;
  top: 84%;
  transform: translate(-50%, -50%);
}

.seat-bet-chip.seat-4 {
  left: 14%;
  top: 83%;
  transform: translate(-50%, -50%);
}

.seat-bet-chip.seat-5 {
  left: 14%;
  top: 44%;
  transform: translate(-50%, -50%);
}

.seat-bet-chip .chip-stack {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.chip-fly {
  position: absolute;
  z-index: 120;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-top: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff1a6, #d4b54a 72%);
  border: 1px solid rgba(255, 240, 189, 0.8);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  opacity: 0.95;
  transform: translate(0, 0) scale(1);
}

.controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  min-height: 0;
  height: auto;
}

.controls.chat-hidden,
#tableScreen.chat-hidden .controls {
  height: auto;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions-row {
  order: 1;
  justify-content: flex-start;
}

.bet-row {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 2fr);
  align-items: end;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.action-row {
  order: 3;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.action-row .btn {
  width: 100%;
}

.bet-row label {
  min-width: 0;
  max-width: 100%;
}

.lucky-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lucky-toggle input {
  width: auto;
  accent-color: #4cff9b;
}

.bet-toggle-stack {
  display: grid;
  grid-auto-rows: min-content;
  gap: 6px;
  align-self: stretch;
}

.bet-slider-field,
.bet-amount-field {
  display: grid;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  align-self: end;
}

.bet-amount-field {
  width: 100%;
  justify-self: stretch;
}

.bet-amount-field input,
.bet-slider-field input {
  min-width: 0;
  max-width: 100%;
}

#betInput {
  height: 40px;
}

#betSlider {
  width: 100%;
  height: 40px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #1f86ff;
}

.bet-toggle-stack.single-option {
  align-self: end;
}

.bet-toggle-stack.single-option .lucky-toggle {
  min-height: 34px;
  align-items: center;
}

.bet-slider-field #betHint {
  margin: 0;
}

#tableScreen .top-actions-row .btn {
  padding: 7px 10px;
}

#seatMenuAutoTopUpWrap .lucky-toggle {
  justify-content: flex-start;
}

#seatAutoTopUpTargetInput:disabled {
  opacity: 0.6;
}

.table-topup-target-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: center;
  gap: 10px;
}

#tableScreen.screen.active {
  display: grid;
  grid-template-rows: 1fr;
  gap: 6px;
  overflow: hidden;
  position: relative;
}

#authScreen.screen.active,
#lobbyScreen.screen.active,
#profileScreen.screen.active,
#faqScreen.screen.active {
  overflow: auto;
}

#tableScreen .table-layout,
#tableScreen .table-wrap {
  overflow: visible;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 18, 0.66);
  display: grid;
  place-items: center;
  z-index: 40;
}

.modal-card {
  width: min(460px, calc(100vw - 24px));
  border: 1px solid rgba(125, 178, 255, 0.3);
  border-radius: 14px;
  background: rgba(8, 16, 30, 0.97);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.seat-modal-card {
  position: relative;
}

.icon-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 148, 148, 0.75);
  background: rgba(88, 20, 20, 0.85);
  color: #ffe7e7;
  font-weight: 700;
  cursor: pointer;
}

.chat-panel {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.faq-section {
  border: 1px solid rgba(126, 173, 241, 0.22);
  border-radius: 10px;
  background: rgba(6, 15, 28, 0.72);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.faq-q {
  font-weight: 700;
  color: #d8ebff;
}

.faq-a {
  color: #b9d2ef;
  line-height: 1.45;
}

.faq-a a {
  color: #8fe7d4;
  text-decoration-color: rgba(143, 231, 212, 0.72);
}

.faq-a a:hover {
  color: #b5fff0;
  text-decoration-color: rgba(181, 255, 240, 0.9);
}

.faq-gold {
  color: #f6d986;
}

.ai-level-basic,
.ai-level-beginner {
  color: #b2c7de;
}

.ai-level-intermediate {
  color: #84e3b4;
}

.ai-level-expert {
  color: #82ccff;
}

.ai-level-pro {
  color: #d5acff;
  text-shadow: 0 0 7px rgba(195, 143, 255, 0.32);
}

.ai-level-superstar {
  color: #ffeaa4;
  background: linear-gradient(90deg, #fff4be 0%, #ffd974 28%, #ffb5de 55%, #95dcff 78%, #fff4be 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 8px rgba(255, 227, 144, 0.45),
    0 0 14px rgba(153, 219, 255, 0.28);
  animation: ai-superstar-shimmer 2.4s linear infinite;
}

@keyframes ai-superstar-shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

.profile-view-avatar {
  width: 72px;
  height: 72px;
}

.profile-view-avatar .player-icon {
  width: 72px;
  height: 72px;
  margin-left: 0;
}

.profile-view-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-view-name.gender-male {
  color: #90d2ff;
  text-shadow: 0 0 8px rgba(89, 185, 255, 0.32);
}

.profile-view-name.gender-female {
  color: #ffb4de;
  text-shadow: 0 0 8px rgba(255, 123, 204, 0.3);
}

.profile-view-gender-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(159, 209, 255, 0.4);
  background: rgba(10, 24, 44, 0.82);
  color: #d7e9ff;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-view-gender-badge.gender-male {
  border-color: rgba(117, 195, 255, 0.6);
  background: rgba(10, 43, 74, 0.88);
  color: #bde7ff;
}

.profile-view-gender-badge.gender-female {
  border-color: rgba(255, 163, 216, 0.65);
  background: rgba(68, 24, 62, 0.9);
  color: #ffd0ef;
}

.profile-view-desc {
  border: 1px solid rgba(126, 173, 241, 0.25);
  border-radius: 10px;
  background: rgba(5, 13, 23, 0.85);
  padding: 10px;
  line-height: 1.45;
  color: #d4e6ff;
}

.profile-view-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-social-box {
  border: 1px solid rgba(126, 173, 241, 0.2);
  border-radius: 10px;
  background: rgba(6, 15, 28, 0.72);
  padding: 8px;
}

.profile-requests {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.profile-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(126, 173, 241, 0.16);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.72);
  padding: 6px 8px;
}

.profile-request-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-request-actions {
  display: flex;
  gap: 6px;
}

.profile-request-actions .btn {
  padding: 6px 8px;
  font-size: 0.78rem;
}

.friend-profile-link {
  color: #9fd1ff;
  text-decoration: underline;
  font-size: 0.82rem;
}

.profile-request-main .friend-profile-link {
  font-size: inherit;
}

.friend-profile-link:hover {
  color: #c5e4ff;
}

.chat-box {
  --chat-visible-lines: 5;
  flex: 0 0 auto;
  height: calc((var(--chat-visible-lines) * 1.45em) + 20px);
  min-height: calc((var(--chat-visible-lines) * 1.45em) + 20px);
  max-height: calc((var(--chat-visible-lines) * 1.45em) + 20px);
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(126, 173, 241, 0.25);
  background: rgba(5, 13, 23, 0.92);
  padding: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.chat-panel-inline {
  order: 4;
  border: 1px solid rgba(126, 173, 241, 0.2);
  border-radius: 10px;
  background: rgba(6, 15, 28, 0.72);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
}

.chat-panel-inline.chat-omitted {
  display: none !important;
}

body.phone-device #tableScreen .chat-panel-inline {
  display: none !important;
}

.phone-rotate-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 9, 18, 0.95);
}

#tableScreen.phone-landscape-required .phone-rotate-overlay {
  display: flex;
}

#tableScreen.phone-landscape-required .table-layout {
  display: none;
}

.phone-rotate-card {
  width: min(460px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(126, 173, 241, 0.42);
  background: rgba(8, 18, 34, 0.97);
  padding: 16px 14px;
  text-align: center;
}

.phone-rotate-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: #cde6ff;
}

.phone-rotate-card p {
  margin: 0;
  color: #9fc2e8;
  line-height: 1.4;
}

.chat-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-panel-head h2 {
  margin: 0;
  font-size: 0.96rem;
}

.chat-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b6cce6;
  font-size: 0.76rem;
  line-height: 1;
  user-select: none;
}

.chat-filter-toggle input {
  width: auto;
  accent-color: #4cff9b;
}

.chat-panel-head .btn {
  display: none !important;
}

.chat-line {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 5px 0;
  word-break: break-word;
}

.chat-line:last-child {
  border-bottom: 0;
}

.chat-prefix {
  font-weight: 700;
}

.chat-line.dealer .chat-prefix {
  color: #ffd77f;
}

.chat-line.broadcast .chat-prefix {
  color: #86ffe1;
}

.chat-line.chat .chat-prefix {
  color: #8cc9ff;
}

.inbox-modal-card {
  width: min(980px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.inbox-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inbox-top-row h2 {
  margin: 0;
  margin-right: auto;
}

.inbox-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  height: min(68vh, 560px);
}

.inbox-thread-list {
  min-height: 0;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(126, 173, 241, 0.25);
  background: rgba(5, 13, 23, 0.92);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inbox-thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(126, 173, 241, 0.2);
  border-radius: 10px;
  background: rgba(9, 19, 34, 0.92);
  color: var(--text);
  padding: 9px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}

.inbox-thread-item.active {
  border-color: rgba(104, 205, 255, 0.65);
  background: rgba(16, 41, 68, 0.95);
}

.inbox-thread-name {
  font-weight: 700;
  color: #d4e9ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.inbox-thread-preview {
  grid-column: 1 / span 2;
  color: #9db8da;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-thread-time {
  color: #7fa7d6;
  font-size: 0.74rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.inbox-thread-empty {
  color: var(--muted);
  padding: 8px;
}

.inbox-conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
}

.inbox-active-name {
  font-weight: 700;
  color: #cce2ff;
  padding: 0 4px;
}

.inbox-messages {
  min-height: 0;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(126, 173, 241, 0.25);
  background: rgba(5, 13, 23, 0.92);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.inbox-empty {
  color: var(--muted);
  margin: auto 0;
  text-align: center;
}

.inbox-msg-row {
  display: flex;
}

.inbox-msg-row.mine {
  justify-content: flex-end;
}

.inbox-msg-row.theirs {
  justify-content: flex-start;
}

.inbox-bubble {
  max-width: min(74%, 520px);
  border-radius: 14px;
  padding: 7px 10px;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(126, 173, 241, 0.2);
}

.inbox-bubble.mine {
  background: linear-gradient(145deg, rgba(14, 73, 122, 0.9), rgba(16, 53, 89, 0.92));
  border-color: rgba(104, 205, 255, 0.45);
}

.inbox-bubble.theirs {
  background: rgba(18, 29, 47, 0.94);
}

.inbox-bubble-text {
  color: #e9f4ff;
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

.inbox-bubble-meta {
  color: #9db9dc;
  font-size: 0.72rem;
  text-align: right;
}

.inbox-compose {
  margin-top: 0;
}

.chat-compose {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.chip-stack {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
}

.chip-stack.seat {
  background: transparent;
  box-shadow: none;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.chip-piles {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
}

.chip-pile {
  position: relative;
  width: 28px;
  height: 52px;
}

.chip-disc {
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translateY(calc(var(--i) * -4px));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.chip-chiptext {
  position: absolute;
  left: 50%;
  bottom: calc((var(--layers) - 1) * 4px + 8px);
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
}

.chip-red {
  background: radial-gradient(circle at 30% 30%, #ff8e8e, #d74242 70%);
}

.chip-blue {
  background: radial-gradient(circle at 30% 30%, #96e2ff, #3e8ecc 70%);
}

.chip-green {
  background: radial-gradient(circle at 30% 30%, #8de7b7, #2f9f66 70%);
}

.chip-gold {
  background: radial-gradient(circle at 30% 30%, #fff1a6, #d4b54a 70%);
}

.chip-black {
  background: radial-gradient(circle at 30% 30%, #7e7e7e, #222 70%);
}

.chip-purple {
  background: radial-gradient(circle at 30% 30%, #c0a4ff, #6e4dc2 70%);
}

.chip-amount {
  color: #fff8da;
  font-size: 0.85rem;
  font-weight: 700;
}

@media (max-width: 1280px) {
  #tableScreen .table-layout {
    overflow: hidden;
  }

  .poker-table {
    height: 100%;
    min-height: 416px;
  }
}

@media (max-height: 900px) {
  .poker-table {
    height: 100%;
    min-height: 364px;
  }

  .table-title {
    font-size: 1.7rem;
  }

  .phase {
    font-size: 1.45rem;
  }

  .btn {
    padding: 7px 10px;
  }

  .controls {
    gap: 6px;
    padding: 8px;
  }
}

@media (max-height: 760px) {
  .poker-table {
    height: 100%;
    min-height: 312px;
  }

  .community-card-slot {
    width: 46px;
    height: 64px;
  }

  .card {
    width: 46px;
    height: 64px;
  }

  .mini-card {
    width: 30px;
    height: 40px;
  }

  .seat {
    width: 227px;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .lobby-head {
    flex-direction: row;
    align-items: flex-start;
  }

  .profile-block {
    text-align: right;
    margin-left: auto;
    align-items: flex-end;
    width: auto;
  }

  .table-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 0;
  }

  .table-header-center {
    justify-self: center;
  }

  .table-header-right {
    justify-self: end;
    width: auto;
  }

  .table-header-btns {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .poker-table {
    height: 100%;
    min-height: 338px;
  }

  .seat {
    width: 199px;
    --seat-avatar-offset: -10px;
    --seat-avatar-size: 40px;
  }

  .player-icon {
    margin-left: -10px;
    font-size: 0.78rem;
  }

  #tableScreen.screen.active {
    gap: 8px;
  }

  .inbox-modal-card {
    width: min(98vw, 760px);
  }

  .inbox-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 150px minmax(0, 1fr);
    height: min(72vh, 620px);
  }

  .inbox-thread-list {
    grid-auto-rows: min-content;
  }
}

@media (max-width: 700px) {
  .lobby-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-block {
    text-align: left;
    margin-left: 0;
    align-items: flex-start;
    width: 100%;
  }
}

/* Phone-only table compact mode:
   - reclaim vertical space for felt area
   - reduce seat/card/control footprint to improve readability on small landscape screens
*/
@media (orientation: landscape) {
  body.phone-device #tableScreen.screen.active {
    gap: 4px;
  }

  body.phone-device #tableScreen .table-layout {
    gap: 4px;
  }

  body.phone-device #tableScreen .table-wrap {
    gap: 4px;
  }

  body.phone-device #tableScreen .table-header {
    column-gap: 6px;
    padding: 0 2px;
  }

  body.phone-device #tableScreen .phase {
    font-size: 1.2rem;
  }

  body.phone-device #tableScreen .phase-room-name {
    font-size: 0.72em;
  }

  body.phone-device #tableScreen .street-odds {
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.92rem;
  }

  body.phone-device #tableScreen .table-header-btns {
    gap: 6px;
  }

  body.phone-device #tableScreen .table-header-btns .btn {
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
  }

  body.phone-device #tableScreen .table-bankroll-btn {
    min-width: 120px;
  }

  body.phone-device #tableScreen .table-icon-btn {
    width: 36px;
    height: 34px;
  }

  body.phone-device #tableScreen .table-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  body.phone-device #tableScreen .poker-table {
    min-height: 360px;
  }

  body.phone-device #tableScreen .community-area {
    top: 49%;
  }

  body.phone-device #tableScreen .community-card-slot,
  body.phone-device #tableScreen .card {
    width: 44px;
    height: 60px;
  }

  body.phone-device #tableScreen .mini-card {
    width: 28px;
    height: 36px;
    font-size: 0.8rem;
  }

  body.phone-device #tableScreen .seat {
    width: 172px;
    min-height: 56px;
    --seat-pad-left: 9px;
    --seat-pad-right: 8px;
    --seat-avatar-offset: -8px;
    --seat-avatar-size: 34px;
    --seat-bubble-height: 56px;
    --seat-bet-shift: 22%;
  }

  body.phone-device #tableScreen .seat-top {
    min-height: 42px;
    gap: 5px;
  }

  body.phone-device #tableScreen .seat-name {
    gap: 5px;
    font-size: 0.9rem;
  }

  body.phone-device #tableScreen .seat-rank,
  body.phone-device #tableScreen .seat-bot-role,
  body.phone-device #tableScreen .seat-meta {
    font-size: 0.72rem;
  }

  body.phone-device #tableScreen .seat-action-inline {
    font-size: 0.74rem;
    line-height: 1.15;
  }

  body.phone-device #tableScreen .seat-stack {
    font-size: 0.74rem;
  }

  body.phone-device #tableScreen .controls {
    gap: 4px;
    padding: 6px;
  }

  body.phone-device #tableScreen .controls-row {
    gap: 6px;
  }

  body.phone-device #tableScreen .bet-row {
    gap: 8px;
  }

  body.phone-device #tableScreen #betInput,
  body.phone-device #tableScreen #betSlider {
    height: 34px;
  }

  body.phone-device #tableScreen .lucky-toggle {
    gap: 6px;
    font-size: 0.82rem;
  }

  body.phone-device #tableScreen .action-row {
    gap: 6px;
  }

  body.phone-device #tableScreen .action-row .btn {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 0.95rem;
  }
}
