/* Classic poker room. Legacy styles are layered below this directly versioned theme. */
:root {
  color-scheme: dark;
  --bg-deep: #202224;
  --cream: #f1f3f1;
  --smoke: #a5adaa;
  --wood: #414644;
  --gold: #8ad4ac;
  --gold-glow: #8ad4ac12;
  --success: #27835a;
  --danger: #b95151;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Inter', -apple-system, sans-serif;
  --line: #ffffff15;
  --surface: #292c2e;
  --dock-height: 110px;
}

body {
  height: 100dvh;
  font-size: 15px;
}
button,
input,
select {
  font: inherit;
}
button {
  touch-action: manipulation;
}
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #8ad4ac;
  outline-offset: 4px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.brand-suit {
  color: #8ad4ac;
  letter-spacing: 0;
  margin-right: 5px;
}

/* Lobby */
.login-screen {
  padding: clamp(28px, 6vh, 72px) 24px 28px;
  background: radial-gradient(ellipse at 50% 0, #353c38 0, #242729 42%, #1d1f21 100%);
}
.login-container {
  max-width: 920px;
  margin: 0 auto;
  animation: none;
}
.login-logo {
  font-size: 17px;
  font-weight: 800;
  color: var(--cream);
  letter-spacing: 0.18em;
  margin-bottom: 28px;
}
.login-subtitle {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 650;
  color: var(--cream);
  font-style: normal;
  letter-spacing: -0.055em;
  margin-bottom: 12px;
}
.lobby-intro {
  color: var(--smoke);
  line-height: 1.6;
  margin-bottom: 28px;
}
.login-divider {
  display: none;
}
.mode-select-inline {
  width: fit-content;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #1b1e20;
  box-shadow: none;
  border-radius: 8px;
  margin-bottom: 0;
}
.mode-link {
  font-size: 13px;
  min-width: 130px;
  padding: 11px 18px;
  letter-spacing: 0;
  color: #aab1ad;
  font-weight: 600;
}
.mode-link.active {
  background: #3a4440;
  color: #e9fff2;
  box-shadow: 0 1px 4px #0003;
  border-color: #ffffff0a;
}
.mode-link::after {
  display: none;
}
.mode-feedback-bar {
  width: 100%;
  margin: 18px auto 20px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}
.mode-feedback-title,
.mode-feedback-meta {
  display: none;
}
.mode-feedback-text {
  margin: 0;
  font: 13px/1.6 var(--font-body);
  color: var(--smoke);
  text-align: center;
  letter-spacing: 0;
}
.login-card {
  max-width: none;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px 30px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #292c2ee8;
  box-shadow: 0 18px 70px #0002;
}
.login-card > .form-group,
.login-card > .form-row.form-row-3 {
  width: 100%;
  max-width: none;
  margin: 0;
}
.login-card > .form-group:first-child {
  grid-column: 1;
  grid-row: 1;
}
.avatar-settings {
  grid-column: 1;
  grid-row: 2;
}
.avatar-settings summary {
  color: var(--smoke);
  cursor: pointer;
  font-size: 12px;
  padding: 5px 0;
}
.avatar-settings summary span {
  color: #7e8983;
  margin-left: 4px;
}
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(6, 38px);
  gap: 6px;
  width: 100%;
  justify-content: start;
  margin: 12px 0 0;
}
.avatar-option {
  width: 38px;
  height: 38px;
  font-size: 21px;
  border-radius: 8px;
}
.form-row.form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  grid-column: 1;
  grid-row: 3;
}
.form-group {
  margin-bottom: 0;
}
.form-group label {
  color: #bfc6c2;
  font: 500 12px/1.4 var(--font-body);
  letter-spacing: 0;
  margin-bottom: 8px;
}
.form-group input,
.form-group select {
  height: 44px;
  padding: 0 10px;
  background: #1e2123;
  border: 1px solid #464b49;
  border-radius: 6px;
  font-size: 14px;
}
.form-group select:disabled {
  background: #242829;
  color: #aeb5b1;
  border-color: var(--line);
}
.room-selection-group {
  grid-column: 1;
  grid-row: 4;
}
.room-selection-group > label {
  display: none;
}
.room-selection-summary {
  border: 0;
  border-left: 2px solid #708b7b;
  border-radius: 0;
  padding: 0 0 0 12px;
  background: none;
}
.room-selection-summary[data-state='idle'] {
  border-style: solid;
}
.room-selection-name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
.room-selection-meta {
  font-size: 11px;
  line-height: 1.6;
}
#roomListSection {
  grid-column: 2;
  grid-row: 1 / 5;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.lobby-section-compact {
  width: 100%;
}
.lobby-title {
  font-size: 12px;
  color: #c4ccc7;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  letter-spacing: 0;
  margin-bottom: 12px;
}
.lobby-title span {
  font-size: 10px;
  font-weight: 400;
  color: var(--smoke);
}
.lobby-rooms-shell {
  max-height: 296px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: #55615a transparent;
}
.lobby-rooms {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.room-card {
  text-align: left;
  padding: 12px;
  min-height: 66px;
  background: #222628;
  border: 1px solid #424a45;
  border-radius: 6px;
}
.room-card:hover {
  background: #2e3933;
  border-color: #759382;
}
.room-card.selected {
  background: #30463a;
  border-color: #8ad4ac;
  box-shadow: inset 0 0 0 1px #8ad4ac33;
}
.room-card-name {
  font-size: 12px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.room-card-heading {
  align-items: center;
}
.room-status-tag {
  border: 0;
  padding: 0;
  font-size: 9px;
  letter-spacing: 0;
  color: #93bfa6;
  text-transform: none;
}
.room-card-info {
  font-size: 10px;
  margin-top: 6px;
}
.room-card-sub {
  font-size: 10px;
  color: #adb6b0;
}
.room-card-new .room-card-sub {
  display: none;
}
.btn-enter {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  width: 100%;
  border: 1px solid #51a979;
  border-radius: 6px;
  padding: 14px;
  background: #2e8559;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
}
.btn-enter:hover {
  background: #379667;
  border-color: #8ad4ac;
}
.btn-enter:disabled {
  background: #3c4540;
  color: #c2cac4;
  border-color: #526057;
  opacity: 0.65;
}
#practiceDirectStart {
  grid-column: 2;
  grid-row: 1 / 5;
  padding: 35px 24px;
  margin: 0;
  display: grid;
  place-content: center;
  border-left: 1px solid var(--line);
  font: 18px/1.8 var(--font-body);
  color: #b8c9be;
  text-align: left;
}
.login-disclaimer {
  opacity: 1;
  color: #a0aaa3;
  font-size: 11px;
  letter-spacing: 0;
  margin-top: 22px;
}

/* Room */
.game-screen {
  height: 100dvh;
  background: radial-gradient(ellipse at 50% 36%, #29312f 0, #151b1e 53%, #0b1014 100%);
}
.top-bar {
  display: flex;
  height: 64px;
  padding: 0 26px;
  gap: 16px;
  align-items: center;
  background: linear-gradient(#171e23, #11171b);
  border-bottom: 1px solid var(--line);
}
.top-bar-title {
  font-size: 15px;
  font-weight: 800;
  color: #f0f3f1;
  letter-spacing: 0.12em;
}
.top-bar-info {
  flex: 1;
  font-size: 14px;
  padding: 0 12px;
  text-align: center;
}
.top-bar-btns {
  max-width: none;
  gap: 8px;
  flex-wrap: nowrap;
}
.top-btn,
.menu-toggle {
  border: 1px solid #ffffff19;
  border-radius: 5px;
  padding: 9px 12px;
  font-size: 14px;
  min-height: 40px;
  color: #d0d6d2;
  letter-spacing: 0;
  transition:
    color 0.15s,
    background 0.15s;
}
.top-btn:hover,
.menu-toggle:hover {
  color: #fff;
  background: #ffffff08;
  border-color: #ffffff30;
}
.invite-btn {
  background: #252e33;
  border-color: #485650;
  color: #e6eee9;
}
.mode-badge {
  font-size: 9px;
  font-weight: 500;
  border-radius: 4px;
  padding: 4px 6px;
  margin-left: 8px;
  letter-spacing: 0;
}
.mode-badge.cash,
.mode-badge.practice,
.mode-badge.tournament {
  background: #ffffff0c;
  color: #a7d8bb;
}
.menu-dropdown {
  min-width: 180px;
  padding: 6px;
  background: #2b3031;
  border: 1px solid #525a55;
  border-radius: 8px;
  box-shadow: 0 15px 30px #0005;
}
.menu-dropdown .menu-item {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 4px;
  font-size: 12px;
}
.card-art-credit {
  display: block;
  color: var(--smoke);
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.table-meta {
  position: absolute;
  top: 80px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #9ea8a1;
  font-size: 11px;
}
.table-meta span:last-child {
  margin-left: auto;
  color: #8c9790;
}
#roomLabel {
  color: #d0d8d2;
  font-weight: 600;
}
.poker-table-wrapper {
  top: calc(50% - 28px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(76vw, 1320px);
  height: min(54dvh, 520px);
  aspect-ratio: auto;
}
.poker-table-wrapper::before,
.poker-table-wrapper::after {
  display: none;
}
.poker-table {
  border: 24px solid #1b2225;
  border-radius: 50%;
  background:
    repeating-linear-gradient(0deg, #ffffff03 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, #00000004 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 34%, #286951, #164d3b 66%, #103c2f);
  box-shadow:
    0 -2px 0 1px #59615c,
    0 2px 0 2px #090e10,
    0 9px 0 3px #252c2b,
    0 13px 0 4px #080e0e,
    0 28px 48px #0009,
    inset 0 0 0 2px #79b39b48,
    inset 0 10px 30px #001e1bc9;
}
.poker-table::before {
  content: '';
  position: absolute;
  inset: -16px;
  border: 1px dashed #76847d66;
  border-radius: 50%;
  pointer-events: none;
}
.poker-table::after {
  inset: 26px;
  border: 1px solid #9cd8b72b;
}
.table-brand {
  top: 72%;
  color: #c5dec328;
  font-size: clamp(16px, 2vw, 25px);
  font-weight: 650;
  letter-spacing: 0.25em;
  text-align: center;
}
.table-brand span {
  display: block;
  margin-top: 7px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #bceace50;
}
.community-cards {
  top: 48%;
  transform: translate(-50%, -50%);
  gap: 9px;
}
.pot-display {
  top: 22%;
  transform: translate(-50%, -50%);
  min-width: 108px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 17px;
  border: 1px solid #d5eadd1a;
  border-radius: 28px;
  background: #071f1b66;
  box-shadow: inset 0 1px #e1f7ea0a;
}
.pot-display:has(.pot-amount:empty) {
  display: none;
}
.pot-amount {
  font-size: 29px;
  font-weight: 650;
  color: #fff;
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}
.pot-amount:not(:empty)::before {
  content: 'POT';
  display: block;
  margin-bottom: 5px;
  color: #b5d9c4;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

/* Standard English faces; text remains visible until the individual image loads. */
.card,
.card-back {
  width: 112px;
  height: auto;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  box-shadow:
    0 1px 0 #e4e2dc,
    0 2px 3px #0004,
    0 5px 9px #0003;
  flex-shrink: 0;
}
.card {
  background: #fff;
  transform-style: flat;
}
.card:hover {
  transform: none;
}
.card-front {
  width: 100%;
  height: 100%;
  background: #fff;
  border: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #fff;
}
.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  border-radius: inherit;
  object-fit: contain;
  /* The matching ink saturation is baked into the pre-rendered card bitmap. */
  visibility: hidden;
  pointer-events: none;
}
.card-art.is-loaded {
  visibility: visible;
}
.card-front::before {
  display: none;
}
.card-front::after {
  display: block;
  z-index: 2;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, #00000002 0 1px, transparent 1px 3px),
    linear-gradient(115deg, #ffffff00 45%, #51483008);
  box-shadow: inset 0 0 0 1px #ffffff70;
}
.card-rank,
.community-cards .card-rank {
  font:
    400 52px/1 Arial,
    sans-serif;
  top: 12%;
  transform: translateX(-50%);
}
.card-suit,
.community-cards .card-suit {
  font:
    50px/1 Georgia,
    'Times New Roman',
    serif;
  top: auto;
  bottom: 9%;
  transform: translateX(-50%);
}
.card-corner,
.card-corner-br {
  display: none;
}
.card.red .card-rank,
.card.red .card-suit {
  color: #c5353b;
}
.card.black .card-rank,
.card.black .card-suit {
  color: #20262a;
}
.card-back {
  border: 3px solid #faf9f6;
  background:
    repeating-linear-gradient(45deg, #f7e5db55 0 0.65px, transparent 0.65px 4px),
    repeating-linear-gradient(-45deg, #f7e5db55 0 0.65px, transparent 0.65px 4px),
    #963b43;
  background-position: center;
}
.card-back::before {
  content: '';
  display: none;
}
.card-back::after {
  inset: 3px;
  border: 1px solid #faf2eab3;
  border-radius: 2px;
}
.card-back.card-placeholder {
  background: #06271f33;
  border: 1px solid #b0d7bd20;
  box-shadow: none;
  opacity: 1;
}
.card-placeholder::after,
.card-placeholder::before {
  display: none;
}

/* Rectangular seats sit on the rail, with the viewing player always at the bottom. */
.player-seat {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 242px;
  min-height: 92px;
}
.player-seat.folded {
  opacity: 0.6;
}
.player-info {
  min-width: 0;
  max-width: none;
  width: 150px;
  min-height: 72px;
  padding: 10px 14px 12px 18px;
  background: linear-gradient(170deg, #303b43, #171f26 75%);
  border: 1px solid #58686e;
  border-radius: 10px;
  text-align: left;
  backdrop-filter: none;
  box-shadow:
    inset 0 1px #c2dce018,
    0 2px 0 #060b0d,
    0 6px 15px #0005;
}
.player-seat.active-turn .player-info {
  background: linear-gradient(165deg, #424b45, #1d2c28);
  border-color: #e0b66d;
  box-shadow:
    0 0 0 2px #d7a45025,
    inset 0 -3px #d4b174,
    0 4px 25px #0005;
}
.player-name {
  max-width: none;
  font-size: 15px;
  font-weight: 550;
  line-height: 1.3;
  margin: 0 0 5px;
  white-space: nowrap;
  color: #c8d2d7;
}
.player-name span {
  display: none;
}
.player-chips {
  font-size: 23px;
  font-weight: 650;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.player-seat.active-turn .player-name {
  color: #f5e9cc;
}
.player-seat.active-turn .player-chips {
  color: #fff;
}
.player-seat.is-hero .player-info {
  width: 166px;
  min-height: 88px;
  padding-left: 22px;
  border-color: #94aab3;
}
.player-seat.is-hero .player-chips {
  font-size: 29px;
}
.player-seat.is-hero .player-name::after {
  content: 'YOU';
  margin-left: 6px;
  font-size: 8px;
  color: #78bd94;
}
.player-seat.active-turn.is-hero .player-name::after {
  color: #ead5a7;
}
.player-seat.is-winner .player-info {
  border-color: #d3b477;
  box-shadow:
    inset 0 0 0 1px #d3b47744,
    0 0 20px #d3b47722;
}
.npc-avatar,
.npc-badge,
.player-name-en,
.npc-tooltip,
.player-totalbet {
  display: none;
}
.player-hole-cards {
  flex-shrink: 0;
  width: 96px;
  margin: 0 -4px 0 0;
  gap: 0;
  position: relative;
  z-index: 2;
}
.player-hole-cards:empty {
  width: 0;
  margin: 0;
}
.player-hole-cards .card,
.player-hole-cards .card-back {
  width: 56px;
  border-radius: 5px;
}
.player-hole-cards > :first-child {
  transform: none;
  rotate: -5deg;
  transform-origin: 75% 85%;
}
.player-hole-cards > :last-child {
  transform: none;
  rotate: 5deg;
  transform-origin: 25% 85%;
  margin-left: -18px;
}
.player-hole-cards .card-rank {
  font-size: 36px;
  transform: translateX(-50%);
}
.player-hole-cards .card-suit {
  font-size: 34px;
  transform: translateX(-50%);
}
.player-seat.is-hero .player-hole-cards {
  width: 202px;
  margin-right: -7px;
}
.player-seat.is-hero .player-hole-cards:empty {
  width: 0;
  margin: 0;
}
.player-seat.is-hero .player-hole-cards .card {
  width: 110px;
  box-shadow:
    0 1px 0 #e4e2dc,
    0 3px 5px #0004,
    0 8px 13px #0004;
}
.player-seat.is-hero .player-hole-cards > :first-child {
  rotate: -4deg;
}
.player-seat.is-hero .player-hole-cards > :last-child {
  rotate: 4deg;
  margin-left: -20px;
}
.player-seat.is-hero .card-rank {
  font-size: 36px;
}
.player-seat.is-hero .card-suit {
  font-size: 34px;
}
.player-seat.is-hero {
  width: 364px;
  min-height: 164px;
  translate: 0 -12px;
}
.player-hand-label {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: 100%;
  padding: 5px 10px;
  border: 1px solid #98adac30;
  border-radius: 5px;
  background: #121d22e8;
  color: #e0e9ed;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  max-height: calc(2.5em + 6px);
  overflow: hidden;
}
.player-seat.active-turn .player-hand-label {
  color: #f4dfb6;
  border-color: #c7a35b55;
}

/* Decorative piles accompany the exact bet and pot amounts. */
.chip-stack {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 31px;
}
.chip-pile {
  display: inline-block;
  position: relative;
  width: 24px;
  height: calc(15px + var(--chip-count) * 3px);
}
.poker-chip {
  position: absolute;
  width: 24px;
  height: 15px;
  left: 0;
  bottom: calc(var(--chip-level) * 3px);
  border: 2px dashed #f1eee4c9;
  border-radius: 50%;
  background: var(--chip-color);
  box-shadow:
    0 2px 0 #151918,
    0 3px 2px #0006,
    inset 0 0 0 1px #0003;
}
.poker-chip::after {
  content: '';
  position: absolute;
  inset: 2px 4px;
  border: 1px solid #fff8;
  border-radius: 50%;
}
.table-bets {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}
.table-wager {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #f0f5ec;
  text-shadow: 0 1px 2px #0008;
}
.wager-amount {
  padding: 3px 7px;
  background: #092c25c9;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.player-bet-badge {
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  color: #d9f4e4;
  background: #102a1fdd;
  border: 1px solid #6c9a7e70;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
}
.player-seat.seat-bottom .player-bet-badge {
  top: auto;
  bottom: calc(100% + 12px);
}
.player-action-badge {
  top: -22px;
  left: 50%;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  min-width: auto;
  box-shadow: none;
}
.action-check,
.action-call {
  background: #d3eddf;
  color: #21563a;
}
.action-raise {
  background: #c2e6ae;
  color: #23402a;
}
.action-fold {
  background: #414644;
  color: #c2c9c5;
}
.allin-indicator {
  font-size: 9px;
}
.dealer-chip,
.sb-chip,
.bb-chip {
  width: 23px;
  height: 23px;
  bottom: -9px;
  font-size: 9px;
  border: 2px solid #cad5ce;
}
.dealer-chip {
  right: -10px;
  color: #34413a;
  background: #f2f4ef;
}
.sb-chip,
.bb-chip {
  left: -10px;
}
.player-turn-timer {
  top: auto;
  bottom: -9px;
  right: -5px;
  min-width: 37px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: #182824;
  border: 1px solid #baa273;
  box-shadow: none;
}
.player-turn-timer-icon {
  display: none;
}
.player-seat.is-hero .player-turn-timer {
  bottom: 0;
}
.player-turn-timer-text {
  color: #d6efde;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.player-turn-timer::after {
  background: #dfb56e;
}
.player-turn-timer.is-critical {
  border-color: #c97864;
  box-shadow: none;
}

/* Results stay on the felt. Nothing covers the cash table between hands. */
.round-overlay {
  position: fixed;
  top: calc(50% - 24px);
  width: min(380px, 65vw);
  z-index: 30;
}
.table-status {
  font-size: 17px;
  font-weight: 550;
  line-height: 1.5;
  margin-bottom: 16px;
  color: #edf8f1;
  text-shadow: 0 1px 4px #0004;
}
.btn-start-game {
  width: auto;
  min-width: 0;
  flex-shrink: 0;
  background: #e7f0e9;
  color: #214931;
  border: 1px solid #bddec8;
  border-radius: 5px;
  padding: 11px 28px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}
.btn-start-game:hover {
  background: #fff;
  border-color: #fff;
}
.ready-status {
  color: #cfdfd5;
  font-size: 11px;
}
.hand-result-inline {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 480px;
  padding: 8px 12px;
  background: #123724ed;
  border: 1px solid #a7d4b633;
  border-radius: 6px;
  color: #e4f4e8;
  font-size: 12px;
  text-align: center;
  z-index: 12;
  line-height: 1.5;
}
.game-screen[data-phase='showdown'] .round-overlay {
  position: static;
  transform: none;
  width: auto;
}
.game-screen[data-phase='showdown'] .table-status {
  display: none;
}

/* Always-present betting dock, separate from the scrolling activity drawer. */
.betting-dock {
  position: absolute;
  inset: auto 0 0;
  height: var(--dock-height);
  background: linear-gradient(180deg, #171f25f5, #10171cf5);
  border-top: 1px solid #ffffff15;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px 24px max(16px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px #0001;
}
.dock-status {
  color: #a6b2aa;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.actions-panel {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 1060px);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
}
.action-btn {
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
  height: 58px;
  min-width: 115px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
}
.btn-fold {
  background: #352b2c;
  border: 1px solid #845052;
  color: #e3b1b0;
}
.btn-fold:hover {
  background: #4b3032;
  border-color: #be7273;
}
.btn-check,
.btn-call {
  background: linear-gradient(#345b51, #24493e);
  border: 1px solid #72998a;
  color: #eaf7ee;
}
.btn-check:hover,
.btn-call:hover {
  background: #3d624e;
}
.btn-raise {
  background: linear-gradient(#c44a50, #a12b3b);
  border: 1px solid #dc7377;
  color: #fff;
  box-shadow:
    inset 0 1px #ffbcc02b,
    0 3px 0 #601b28,
    0 6px 14px #0003;
}
.btn-raise:hover {
  background: linear-gradient(#d75a60, #b83946);
}
.btn-allin {
  min-width: 82px;
  background: #2c3032;
  border: 1px solid #646c67;
  color: #cbd2ce;
}
.btn-allin:hover {
  background: #444038;
}
.raise-slider-group {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 84px;
  gap: 6px 10px;
  flex: 1;
  max-width: 340px;
  margin: 0 8px;
}
.raise-slider {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 20px;
  accent-color: #8ad4ac;
}
.raise-input {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  height: 42px;
  width: 84px;
  border: 1px solid #69776e;
  background: #191e1b;
  color: #e5f1e9;
  font-size: 16px;
  border-radius: 5px;
}
.raise-need-pay {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #aebdb3;
  text-align: right;
  white-space: nowrap;
}
.bet-shortcuts {
  display: flex;
  gap: 6px;
}
.bet-shortcuts button {
  padding: 4px 10px;
  min-height: 25px;
  font-size: 10px;
  border-radius: 4px;
  background: #313b35;
  color: #c2d3c8;
  border: 1px solid #506156;
  cursor: pointer;
}
.bet-shortcuts button:hover {
  background: #43594b;
}
.game-log {
  position: absolute;
  top: auto;
  right: auto;
  left: 18px;
  bottom: calc(var(--dock-height) + 12px);
  width: 300px;
  border: 1px solid #ffffff15;
  background: #242a27;
  z-index: 80;
  border-radius: 6px;
}
.game-log.collapsed {
  max-height: none;
}
.game-log.expanded {
  max-height: none;
  box-shadow: 0 6px 30px #0004;
}
.log-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  background: #2b312e;
  padding: 11px 12px;
  min-height: 38px;
}
.log-label {
  color: #b9c7be;
  font-size: 11px;
  font-weight: 600;
}
.log-last {
  display: block;
  font-size: 10px;
  color: #97a79c;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.log-toggle-arrow {
  font-size: 7px;
}
.log-body {
  max-height: min(32dvh, 260px);
  background: #252b28;
  padding: 8px 12px;
  overflow-wrap: anywhere;
}
.game-log.collapsed .log-body {
  display: none;
}
.log-entry {
  font-size: 11px;
  line-height: 1.6;
  padding: 6px 0;
  border-color: #ffffff08;
}
.npc-chat-area {
  position: absolute;
  top: auto;
  bottom: calc(var(--dock-height) + 64px);
  left: 18px;
  width: 250px;
  z-index: 35;
  max-height: 220px;
  overflow-y: auto;
}
.game-screen:not([data-mode='practice']) .npc-chat-area {
  display: none;
}
.npc-chat-bubble {
  background: #2b332e;
  border: 1px solid #536d5d;
  font-size: 11px;
}

/* Secondary panels retain their contracts and adapt to narrow screens. */
#resultModal,
#tournamentModal {
  backdrop-filter: none;
}
#resultModal .result-content,
#tournamentModal .result-content {
  animation: none;
}
.replay-card {
  width: 54px;
}
.result-content,
.npc-panel-content,
.lb-content,
.replay-content,
.eq-rules-box {
  background: #282e2b;
  border-color: #526257;
  border-radius: 10px;
  max-width: min(720px, calc(100vw - 28px));
  min-width: 0;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 26px;
}
.result-content.result-content-wide {
  min-width: 0;
}
.result-title,
.npc-panel-title {
  font-size: 21px;
  font-weight: 650;
  color: #deede3;
}
.npc-panel-close {
  border-color: #5f7c69;
  color: #d9ecdf;
}
.app-dialog-input {
  background: #1d241f;
  border-color: #60866e;
}
.eq-side,
body.log-expanded .eq-side {
  top: 125px;
  right: 18px;
}
.speed-pause-group {
  display: flex;
  gap: 3px;
}
.speed-btn,
.pause-btn {
  font-size: 10px;
  padding: 7px;
  min-height: 30px;
  background: #29382f;
  border: 1px solid #536b5c;
  border-radius: 4px;
  color: #d4e4da;
}
.tournament-banner {
  top: 112px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90vw;
  background: #2e3229;
  border-color: #6b7354;
  font-size: 10px;
  z-index: 15;
}

/* Animate position separately so dealt hole cards keep their fan after the animation. */
@keyframes dealCard {
  from {
    opacity: 0;
    translate: 0 -24px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes dealCommunity {
  from {
    opacity: 0;
    translate: 0 -16px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
.card.dealing,
.card-back.dealing,
.card.dealing-community {
  animation-fill-mode: backwards;
}
@media (hover: hover) {
  .is-hero .card:hover {
    translate: 0 -5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card,
  .card-back,
  .card.dealing,
  .card-back.dealing,
  .card.dealing-community {
    animation: none;
    transition: none;
  }
}

@media (max-width: 1050px) {
  .pot-display {
    gap: 8px;
    padding: 6px 12px;
  }
  .pot-amount {
    font-size: 24px;
  }
  .chip-pile {
    width: 18px;
  }
  .poker-chip {
    width: 18px;
    height: 12px;
  }
  .poker-chip::after {
    inset: 1px 3px;
  }
  .table-wager[data-slot='2'] .chip-stack,
  .table-wager[data-slot='6'] .chip-stack {
    display: none;
  }
  .table-wager[data-slot='4'] {
    translate: -8px 0;
  }
  .wager-amount {
    font-size: 11px;
    padding: 3px 5px;
  }
  .top-bar {
    padding: 0 16px;
    gap: 8px;
  }
  .top-bar-info {
    font-size: 10px;
    padding: 0;
  }
  .top-bar-btns {
    gap: 5px;
  }
  .poker-table-wrapper {
    width: 75vw;
    height: 52dvh;
  }
  .player-seat {
    width: 184px;
  }
  .player-info {
    width: 116px;
    padding: 9px 10px 9px 12px;
  }
  .player-hole-cards {
    width: 74px;
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 43px;
  }
  .community-cards .card,
  .community-cards .card-back {
    width: clamp(50px, 8vw, 82px);
  }
  .player-seat.is-hero {
    width: 280px;
    min-height: 134px;
  }
  .player-seat.is-hero .player-hole-cards {
    width: 156px;
  }
  .player-seat.is-hero .player-hole-cards .card {
    width: 86px;
  }
  .player-seat.is-hero .player-info {
    width: 130px;
  }
  .player-seat.seat-bottom:not(.is-hero) {
    translate: -32px 0;
  }
  .player-seat.seat-bottom.seat-right:not(.is-hero) {
    translate: 32px 0;
  }
  .player-name {
    font-size: 11px;
  }
  .player-chips {
    font-size: 15px;
  }
  .action-btn {
    min-width: 85px;
    padding: 10px 12px;
  }
  .raise-slider-group {
    margin: 0;
  }
  .game-log {
    width: 250px;
  }
}

@media (max-width: 700px) {
  :root {
    --dock-height: 144px;
  }
  .login-screen {
    padding: 30px 16px;
  }
  .login-logo {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .login-subtitle {
    font-size: 32px;
  }
  .lobby-intro {
    font-size: 12px;
    margin-bottom: 20px;
  }
  .mode-select-inline {
    display: flex;
    width: 100%;
  }
  .mode-link {
    min-width: 0;
    flex: 1;
    padding: 10px 5px;
    font-size: 12px;
  }
  .mode-feedback-text {
    font-size: 12px;
  }
  .login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }
  .login-card > .form-row.form-row-3 {
    order: 2;
  }
  .avatar-settings {
    order: 1;
  }
  #roomListSection {
    order: 3;
    border: 0;
    padding: 0;
  }
  .room-selection-group {
    order: 4;
  }
  .btn-enter {
    order: 6;
    margin: 0;
  }
  #practiceDirectStart {
    order: 3;
    border: 0;
    padding: 10px 0;
    font-size: 14px;
  }
  .lobby-rooms-shell {
    max-height: 220px;
  }
  .top-bar {
    height: 58px;
    padding: 0 12px;
    flex-wrap: nowrap;
  }
  .top-bar-title {
    font-size: 12px;
    letter-spacing: 0.06em;
  }
  .mode-badge {
    font-size: 8px;
    margin-left: 2px;
    padding: 3px 4px;
  }
  .top-bar-info {
    position: absolute;
    top: 90px;
    left: 12px;
    right: 12px;
    text-align: left;
    font-size: 10px;
  }
  .top-bar-btns {
    margin-left: auto;
    gap: 4px;
  }
  .top-btn,
  .menu-toggle {
    font-size: 10px;
    min-height: 34px;
    padding: 7px;
  }
  .invite-btn {
    font-size: 0;
  }
  .invite-btn::after {
    content: 'Invite';
    font-size: 10px;
  }
  .table-meta {
    top: 69px;
    left: 14px;
    right: 14px;
    gap: 10px;
    font-size: 9px;
  }
  .table-meta span:last-child {
    font-size: 8px;
  }
  .poker-table-wrapper {
    width: calc(100vw - 56px);
    height: calc(100dvh - 355px);
    top: calc(50% - 53px);
    min-height: 260px;
    max-height: 620px;
  }
  .poker-table {
    border-width: 14px;
    border-radius: 46%;
    box-shadow:
      0 -1px 0 1px #626966,
      0 9px 0 1px #171c18,
      0 18px 30px #0005,
      inset 0 0 35px #00391e80;
  }
  .poker-table::before {
    inset: -9px;
    border-radius: 46%;
  }
  .poker-table::after {
    inset: 10px;
    border-width: 1px;
    border-radius: 46%;
  }
  .table-brand {
    font-size: 19px;
    letter-spacing: 0.1em;
    top: 68%;
  }
  .table-brand span {
    font-size: 6px;
    letter-spacing: 0.08em;
  }
  .community-cards {
    gap: 4px;
    top: 48%;
  }
  .community-cards .card,
  .community-cards .card-back {
    width: clamp(41px, 10.9vw, 60px);
    border-radius: 4px;
  }
  .community-cards .card-rank {
    font-size: clamp(23px, 6.8vw, 32px);
    top: 8%;
  }
  .community-cards .card-suit {
    font-size: clamp(22px, 6.4vw, 30px);
    bottom: 5%;
  }
  .pot-display {
    top: 32%;
    gap: 6px;
    padding: 5px 10px;
  }
  .pot-amount {
    font-size: 21px;
  }
  .pot-amount:not(:empty)::before {
    font-size: 7px;
    margin-bottom: 3px;
  }
  .player-seat {
    width: 70px;
    min-height: 65px;
    flex-direction: column;
  }
  .player-info {
    width: 70px;
    min-height: 45px;
    padding: 6px 4px;
    border-radius: 5px;
    text-align: center;
  }
  .player-name {
    font-size: 11px;
    margin-bottom: 3px;
  }
  .player-chips {
    font-size: 14px;
  }
  .player-hole-cards {
    width: auto;
    margin: 0 0 -5px;
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 34px;
    border-width: 2px;
  }
  .player-hole-cards > :last-child {
    margin-left: -4px;
  }
  .player-hole-cards .card-rank {
    font-size: 19px;
  }
  .player-hole-cards .card-suit {
    font-size: 17px;
  }
  .player-seat.is-hero {
    width: 216px;
    min-height: 104px;
    flex-direction: row;
  }
  .player-seat.seat-bottom:not(.is-hero) {
    translate: -40px 0;
  }
  .player-seat.seat-bottom.seat-right:not(.is-hero) {
    translate: 40px 0;
  }
  .player-seat.is-hero .player-hole-cards {
    width: 130px;
    margin: 0 -4px 0 0;
  }
  .player-seat.is-hero .player-hole-cards .card {
    width: 68px;
  }
  .player-seat.is-hero .player-hole-cards > :last-child {
    margin-left: -10px;
  }
  .player-seat.is-hero .player-info {
    width: 92px;
    min-height: 66px;
    padding: 9px 6px 9px 10px;
    text-align: left;
  }
  .player-seat.is-hero .player-chips {
    font-size: 20px;
  }
  .card-back::before {
    font-size: 11px;
  }
  .chip-stack {
    height: 23px;
    gap: 1px;
  }
  .chip-pile {
    width: 16px;
    height: calc(10px + var(--chip-count) * 2px);
  }
  .poker-chip {
    width: 16px;
    height: 10px;
    border-width: 1px;
    bottom: calc(var(--chip-level) * 2px);
  }
  .poker-chip::after {
    inset: 1px 3px;
  }
  .table-wager {
    gap: 3px;
  }
  .table-wager .chip-stack {
    display: none;
  }
  .table-wager[data-slot='2'] {
    translate: 16px 42px;
  }
  .table-wager[data-slot='6'] {
    translate: -16px 42px;
  }
  .wager-amount {
    font-size: 9px;
    padding: 3px 6px;
  }
  .pot-chips .chip-stack {
    max-width: 50px;
    overflow: hidden;
  }
  .player-seat.is-hero .card-rank {
    font-size: 27px;
  }
  .player-seat.is-hero .card-suit {
    font-size: 25px;
  }
  .player-hand-label {
    top: calc(100% + 2px);
    font-size: 11px;
  }
  .player-seat.is-hero .player-name::after {
    font-size: 6px;
    margin-left: 3px;
  }
  .player-action-badge {
    top: auto;
    bottom: -19px;
    font-size: 8px;
    padding: 3px 6px;
  }
  .player-bet-badge {
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    padding: 3px 5px;
  }
  .player-seat.seat-right .player-bet-badge {
    left: 50%;
    right: auto;
  }
  .player-seat.seat-bottom .player-bet-badge {
    top: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .dealer-chip,
  .sb-chip,
  .bb-chip {
    width: 17px;
    height: 17px;
    font-size: 7px;
    border-width: 1px;
  }
  .player-turn-timer {
    right: -7px;
    bottom: -12px;
    height: 18px;
    min-width: 30px;
  }
  .player-turn-timer-text {
    font-size: 9px;
  }
  .table-status {
    font-size: 14px;
  }
  .round-overlay {
    top: calc(50% - 28px);
    width: 60vw;
  }
  .game-screen[data-phase='showdown'] .round-overlay {
    width: auto;
    transform: none;
  }
  .game-screen[data-phase='showdown'] .table-status {
    max-width: 170px;
    font-size: 9px;
  }
  .game-screen[data-phase='showdown'] .btn-start-game {
    padding: 8px 16px;
  }
  .hand-result-inline {
    top: 76%;
    font-size: 10px;
    padding: 6px;
    width: 72%;
  }
  .betting-dock {
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .actions-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .action-btn {
    min-width: 0;
    width: 100%;
    height: 44px;
    padding: 6px 3px;
    font-size: 13px;
    grid-row: 2;
  }
  .raise-slider-group {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: none;
    min-width: 0;
    height: 46px;
  }
  .bet-shortcuts {
    gap: 4px;
    flex-shrink: 0;
  }
  .bet-shortcuts button {
    padding: 7px;
    font-size: 10px;
    min-height: 32px;
  }
  .raise-slider {
    flex: 1;
    width: 60px;
  }
  .raise-input {
    flex-shrink: 0;
    width: 65px;
    height: 36px;
    font-size: 14px;
  }
  .raise-need-pay {
    display: none;
  }
  .game-log {
    left: 10px;
    bottom: calc(var(--dock-height) + 8px);
    width: 78px;
    max-width: calc(100vw - 20px);
  }
  .game-log.collapsed .log-last {
    display: none;
  }
  .game-log.collapsed .log-toggle {
    grid-template-columns: auto auto;
  }
  .game-log.expanded {
    width: calc(100vw - 20px);
  }
  .log-toggle {
    min-height: 32px;
    padding: 8px 10px;
    gap: 8px;
  }
  .log-label {
    font-size: 10px;
  }
  .log-last {
    font-size: 9px;
  }
  .log-body {
    max-height: 26dvh;
  }
  .npc-chat-area {
    bottom: calc(var(--dock-height) + 48px);
    left: 10px;
    width: 170px;
    max-height: 140px;
  }
  .speed-pause-group {
    position: absolute;
    top: 112px;
    left: 10px;
  }
  .game-screen[data-mode='practice'] .poker-table-wrapper,
  .game-screen[data-mode='tournament'] .poker-table-wrapper {
    height: calc(100dvh - 385px);
    top: calc(50% - 10px);
  }
  .eq-side,
  body.log-expanded .eq-side {
    top: 118px;
    right: 10px;
    transform: none;
  }
  .eq-side-btn {
    padding: 6px;
  }
  .tournament-banner {
    top: 109px;
    font-size: 8px;
    padding: 4px 8px;
  }
  .result-content,
  .npc-panel-content,
  .lb-content,
  .replay-content,
  .eq-rules-box {
    padding: 20px;
  }
  .lb-table th,
  .lb-table td {
    font-size: 10px;
    padding: 6px;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  :root {
    --dock-height: 86px;
  }
  .top-bar {
    height: 48px;
  }
  .top-bar-info {
    position: static;
    text-align: center;
  }
  .game-screen[data-mode='practice'] .top-bar-info {
    display: none;
  }
  .speed-pause-group {
    position: static;
  }
  .table-meta {
    top: 59px;
  }
  .poker-table-wrapper {
    min-height: 0;
    height: min(50dvh, calc(100dvh - 230px));
    width: min(68vw, 820px);
    top: calc(50% - 27px);
  }
  .game-screen[data-mode='practice'] .poker-table-wrapper,
  .game-screen[data-mode='tournament'] .poker-table-wrapper {
    min-height: 0;
    height: min(50dvh, calc(100dvh - 230px));
    top: calc(50% - 27px);
  }
  .player-seat {
    width: 160px;
    min-height: 50px;
    flex-direction: row;
  }
  .player-info {
    width: 102px;
    min-height: 48px;
    padding: 6px 8px;
  }
  .player-hole-cards {
    width: 65px;
    margin: 0 -6px 0 0;
  }
  .player-seat:not(.seat-right):not(.is-hero) .player-hole-cards {
    translate: 3px 0;
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 38px;
  }
  .player-seat.is-hero {
    width: 220px;
    min-height: 98px;
    translate: 0 -18px;
  }
  .player-seat.seat-bottom:not(.is-hero) {
    translate: -40px 0;
  }
  .player-seat.seat-bottom.seat-right:not(.is-hero) {
    translate: 40px 0;
  }
  .player-seat.is-hero .card-rank {
    font-size: 27px;
  }
  .player-seat.is-hero .card-suit {
    font-size: 25px;
  }
  .player-name {
    font-size: 11px;
  }
  .player-chips {
    font-size: 15px;
  }
  .player-hand-label {
    top: 100%;
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .player-seat.is-hero .player-hole-cards {
    width: 116px;
  }
  .player-seat.is-hero .player-hole-cards .card {
    width: 63px;
  }
  .player-seat.is-hero .player-info {
    width: 112px;
    min-height: 59px;
    padding: 6px 9px;
  }
  .player-seat.is-hero .player-chips {
    font-size: 20px;
  }
  .player-seat.is-hero .player-hole-cards > :last-child {
    margin-left: -12px;
  }
  .card,
  .card-back {
    width: 49px;
  }
  .card-rank {
    font-size: 28px;
  }
  .card-suit {
    font-size: 26px;
  }
  .pot-amount {
    font-size: 18px;
  }
  .pot-display {
    top: 17%;
    padding: 2px 9px;
    gap: 6px;
  }
  .pot-display .pot-chips {
    display: none;
  }
  .table-wager .chip-stack {
    display: none;
  }
  .table-wager .wager-amount {
    font-size: 9px;
    padding: 2px 5px;
  }
  .community-cards {
    top: 54%;
  }
  .community-cards .card,
  .community-cards .card-back {
    width: clamp(42px, 6vw, 52px);
  }
  .community-cards .card-rank {
    font-size: 28px;
  }
  .community-cards .card-suit {
    font-size: 26px;
  }
  .table-brand {
    font-size: 20px;
  }
  .player-bet-badge {
    font-size: 8px;
    padding: 3px 6px;
  }
  .game-log {
    width: 230px;
  }
  .game-log.collapsed {
    width: 90px;
  }
  .game-log.collapsed .log-last {
    display: none;
  }
  .game-log.collapsed .log-toggle {
    grid-template-columns: auto auto;
  }
  .action-btn {
    height: 44px;
    min-width: 64px;
    width: auto;
    padding: 6px 10px;
  }
  .actions-panel {
    display: flex;
  }
  .raise-slider-group {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) 65px;
    max-width: 260px;
    height: auto;
  }
  .raise-slider {
    width: 100%;
  }
  .raise-input {
    width: 65px;
  }
  .player-turn-timer {
    bottom: 0;
  }
  .table-status {
    font-size: 12px;
  }
  .game-screen[data-phase='showdown'] .table-status {
    display: none;
  }
}

@media (max-width: 700px) and (orientation: landscape) {
  .poker-table-wrapper {
    width: 78vw;
  }
  .player-seat {
    width: 144px;
  }
  .player-info {
    width: 90px;
  }
  .player-hole-cards {
    width: 58px;
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 34px;
  }
}

@media (max-height: 740px) and (max-width: 700px) and (orientation: portrait) {
  .table-wager[data-slot='3'],
  .table-wager[data-slot='5'] {
    translate: 0 -15px;
  }
  .poker-table-wrapper {
    min-height: 215px;
    top: calc(50% - 60px);
    height: calc(100dvh - 335px);
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 30px;
  }
  .player-seat {
    min-height: 55px;
  }
  .player-info {
    min-height: 39px;
    padding: 4px;
  }
  .player-name {
    font-size: 11px;
  }
  .player-chips {
    font-size: 14px;
  }
  .table-brand {
    font-size: 15px;
  }
  .table-brand span {
    display: none;
  }
}

/* Short landscape screens use a side action dock, leaving room for the full hand. */
@media (max-height: 650px) and (orientation: landscape) {
  #playerSeats[data-player-count='6'] .player-seat.seat-right:not(.is-hero) {
    translate: 20px 0;
  }
  .game-screen {
    --controls-width: 182px;
    --dock-height: 0px;
  }
  .poker-table-wrapper,
  .game-screen[data-mode='practice'] .poker-table-wrapper,
  .game-screen[data-mode='tournament'] .poker-table-wrapper {
    left: calc((100vw - var(--controls-width)) / 2);
    top: calc(50dvh + 8px);
    width: calc((100vw - var(--controls-width)) * 0.8);
    height: calc(100dvh - 175px);
    min-height: 0;
  }
  .table-meta {
    right: calc(var(--controls-width) + 14px);
    left: 14px;
    font-size: 9px;
  }
  .table-meta span:last-child {
    display: none;
  }
  .pot-display {
    top: 20%;
    min-width: 0;
  }
  .community-cards {
    top: 48%;
  }
  .table-wager[data-slot='2'],
  .table-wager[data-slot='6'] {
    translate: 0 0;
  }
  .table-brand {
    top: 76%;
    font-size: 14px;
  }
  .table-brand span {
    display: none;
  }
  .player-seat.is-hero {
    translate: 0 0;
  }
  .player-hand-label {
    white-space: normal;
    line-height: 1.15;
    font-size: 10px;
    padding: 3px 5px;
  }
  .betting-dock {
    inset: 48px 0 0 auto;
    width: var(--controls-width);
    height: auto;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border-top: 0;
    border-left: 1px solid #53636655;
    box-shadow: -10px 0 25px #0002;
  }
  .actions-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .action-btn {
    width: 100%;
    min-width: 0;
    height: 42px;
    flex-shrink: 0;
  }
  .raise-slider-group {
    width: 100%;
    flex: none;
    order: -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 57px;
    gap: 6px;
    height: auto;
  }
  .raise-input {
    width: 57px;
    height: 35px;
    font-size: 13px;
  }
  .raise-need-pay {
    display: none;
  }
  .bet-shortcuts {
    grid-column: 1;
  }
  .bet-shortcuts button {
    font-size: 9px;
    padding: 5px;
  }
  .raise-slider {
    min-width: 0;
    width: 100%;
  }
  .round-overlay,
  .game-screen[data-phase='showdown'] .round-overlay {
    position: static;
    transform: none;
    width: 100%;
  }
  .table-status {
    font-size: 12px;
    margin-bottom: 9px;
  }
  .round-overlay #modeSelectBtns {
    flex-direction: column;
    gap: 8px;
  }
  .btn-start-game {
    padding: 10px 16px;
  }
  .dock-status {
    font-size: 11px;
  }
  .game-log {
    left: 8px;
    bottom: 8px;
    max-width: calc(100vw - var(--controls-width) - 16px);
  }
  .game-log.collapsed {
    width: 78px;
  }
  .npc-chat-area {
    bottom: 50px;
    left: 8px;
  }
}
@media (max-height: 650px) and (max-width: 700px) and (orientation: landscape) {
  #playerSeats[data-player-count='6'] .player-seat.seat-right:not(.is-hero) {
    translate: 12px 0;
  }
  .game-screen {
    --controls-width: 156px;
  }
  .player-seat {
    width: 116px;
    min-height: 50px;
  }
  .player-info {
    width: 82px;
    min-height: 43px;
    padding: 5px 6px;
  }
  .player-hole-cards {
    width: 46px;
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 28px;
  }
  .player-hole-cards > :last-child {
    margin-left: -9px;
  }
  .player-name {
    font-size: 10px;
  }
  .player-chips {
    font-size: 15px;
  }
  .player-seat.is-hero {
    width: 190px;
    min-height: 86px;
  }
  .player-seat.is-hero .player-hole-cards {
    width: 102px;
  }
  .player-seat.is-hero .player-hole-cards .card {
    width: 56px;
  }
  .player-seat.is-hero .player-info {
    width: 96px;
  }
  .player-seat.is-hero .player-chips {
    font-size: 19px;
  }
  .betting-dock {
    padding: 10px;
  }
  .action-btn {
    height: 40px;
    font-size: 12px;
  }
}

@media (min-width: 1051px) and (min-height: 651px) and (max-height: 820px) {
  .poker-table-wrapper {
    top: calc(50% - 48px);
    height: 58dvh;
  }
  .player-seat {
    min-height: 82px;
  }
  .player-hole-cards {
    width: 88px;
  }
  .player-hole-cards .card,
  .player-hole-cards .card-back {
    width: 50px;
  }
  .player-seat.is-hero {
    width: 342px;
    min-height: 148px;
    translate: 0 -16px;
  }
  .player-seat.is-hero .player-hole-cards {
    width: 180px;
  }
  .player-seat.is-hero .player-hole-cards .card {
    width: 98px;
  }
  .community-cards .card,
  .community-cards .card-back {
    width: 100px;
  }
  .pot-display {
    padding: 4px 13px;
  }
  .pot-amount {
    font-size: 22px;
  }
  .table-wager .chip-stack {
    display: none;
  }
  .wager-amount {
    font-size: 11px;
    padding: 3px 5px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   2026-09-13: bankroll visibility + card presentation
   ═══════════════════════════════════════════════════════════════════════ */

/* Per-seat session result (stack minus buy-ins); hidden when even. */
.player-net {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #9fb0b7;
  font-variant-numeric: tabular-nums;
}
.player-net.is-up {
  color: #8fdca6;
}
.player-net.is-down {
  color: #ef9a9a;
}
.player-seat.is-hero .player-net {
  font-size: 13px;
}
.player-seat.active-turn .player-net.is-up {
  color: #a9e8ba;
}
.player-seat.folded .player-net {
  opacity: 0.85;
}

/* Stacks panel */
.stacks-panel .lb-content {
  width: 560px;
}
.stacks-panel .npc-panel-subtitle {
  margin-bottom: 4px;
  color: #a7b8b0;
  font-size: 12px;
}
.stacks-table th.num,
.stacks-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stacks-table td {
  opacity: 1;
  color: #d9e4de;
  padding: 8px;
}
.stacks-table td.num {
  color: #eef4f0;
  font-weight: 600;
}
.stacks-table .net-up {
  color: #8fdca6;
}
.stacks-table .net-down {
  color: #ef9a9a;
}
.stacks-table .net-even {
  color: #9fb0b7;
  font-weight: 500;
}
.stacks-table tr.lb-me td {
  color: #f3e3b5;
}
.stacks-table tr.lb-me td.net-up {
  color: #a9e8ba;
}
.stacks-table tr.lb-me td.net-down {
  color: #f4a9a9;
}
.stacks-table tr.stacks-busted td {
  opacity: 0.55;
}
.stacks-name {
  font-weight: 550;
}
.stacks-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b9c8c1;
  background: #ffffff12;
  vertical-align: middle;
}
.stacks-inpot {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #9fb0b7;
}
.stacks-note {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.4;
  color: #9fb0b7;
}

/* ── Cards: rounder stock, deeper table shadow, subtle sheen ── */
.card,
.card-back {
  border-radius: 9px;
  box-shadow:
    0 1px 0 #d9d6cc,
    0 3px 6px #0005,
    0 10px 18px #0004;
  transition:
    translate 0.3s ease,
    opacity 0.3s ease,
    box-shadow 0.3s ease,
    filter 0.3s ease;
}
.player-hole-cards .card,
.player-hole-cards .card-back {
  border-radius: 6px;
}
.card-front {
  background: linear-gradient(165deg, #ffffff 0%, #fdfcf9 55%, #f3f0e8 100%);
}
.card-front::after {
  background:
    linear-gradient(160deg, #ffffff66 0%, #ffffff00 38%),
    linear-gradient(180deg, #ffffff00 70%, #5c4d2e0d 100%);
  box-shadow:
    inset 0 0 0 1px #ffffff90,
    inset 0 0 0 2px #0000000a;
}

/* Card back: cream frame, burgundy lattice, soft vignette and a spade medallion. */
.card-back {
  border: 3px solid #f6f1e8;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120'><path fill='%23f8ebe0' fill-opacity='.34' d='M50 4C50 4 9 46 9 71c0 15 12 24 25 24 6 0 11-3 14-7-2 13-8 21-18 25h40c-10-4-16-12-18-25 3 4 8 7 14 7 13 0 25-9 25-24C91 46 50 4 50 4Z'/></svg>")
      center / 46% auto no-repeat,
    radial-gradient(ellipse at 50% 50%, #ffffff00 0 45%, #00000024 100%),
    repeating-linear-gradient(45deg, #f7e5db4d 0 0.65px, transparent 0.65px 4px),
    repeating-linear-gradient(-45deg, #f7e5db4d 0 0.65px, transparent 0.65px 4px),
    linear-gradient(160deg, #a2434b, #7e2f37);
}
.card-back::after {
  inset: 3px;
  border: 1px solid #faf2ea99;
  border-radius: 3px;
}
.card-back.card-placeholder {
  background: #06271f33;
  border: 1px dashed #b0d7bd2e;
}

/* Board cards turn over instead of sliding in. */
@keyframes dealCommunity {
  from {
    opacity: 0;
    transform: perspective(700px) rotateY(-88deg) translateY(-6px);
  }
  55% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: perspective(700px) rotateY(0deg) translateY(0);
  }
}
.card.dealing-community {
  transform-origin: 50% 50%;
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Showdown: the five cards that made the winning hand lift and glow; the rest dim. */
.card.is-winning {
  translate: 0 -6px;
  box-shadow:
    0 0 0 2px #e9c86c,
    0 0 0 4px #e9c86c40,
    0 6px 14px #0006,
    0 0 22px #e9c86c66;
}
.player-hole-cards .card.is-winning {
  translate: 0 -4px;
}
.card.is-idle {
  opacity: 0.5;
  filter: saturate(0.55) brightness(0.92);
}

/* Hero cards sit beside the info box instead of covering its edge. */
.player-seat.is-hero {
  width: auto;
}
.player-seat.is-hero .player-hole-cards {
  margin-right: 8px;
}
.player-seat.is-hero .player-hole-cards:empty {
  margin: 0;
}

@media (max-width: 1050px) {
  .player-net {
    font-size: 11px;
  }
  .player-seat.is-hero .player-net {
    font-size: 12px;
  }
  .stacks-table td {
    padding: 6px;
  }
}
@media (max-width: 700px) {
  .player-net {
    margin-top: 0;
    font-size: 10px;
  }
  .player-seat.is-hero .player-net {
    font-size: 11px;
  }
  .stacks-table .stacks-tag {
    display: none;
  }
  .stacks-table td,
  .stacks-table th {
    padding: 6px 4px;
  }
  .stacks-note {
    font-size: 10px;
  }
}
@media (max-height: 650px) and (orientation: landscape) {
  .player-net {
    font-size: 10px;
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .card.is-winning {
    translate: 0 0;
  }
}
@media (min-width: 1051px) {
  /* Keep the hand result between the board and the hero's cards on desktop tables. */
  .hand-result-inline {
    top: 71%;
  }
}

/* ═══ Modern vector faces (default) — switchable in Settings; four-color deck optional ═══ */
.card {
  --ink-red: #d2323c;
  --ink-black: #1f262c;
  --ink: var(--ink-black);
}
.card.suit-hearts,
.card.suit-diamonds {
  --ink: var(--ink-red);
}
html.deck-four-color .card.suit-diamonds {
  --ink: #2457d6;
}
html.deck-four-color .card.suit-clubs {
  --ink: #2f8a57;
}
.card.red .card-rank,
.card.red .card-suit,
.card.black .card-rank,
.card.black .card-suit {
  color: var(--ink);
}
.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  color: var(--ink);
  border-radius: inherit;
  pointer-events: none;
  overflow: visible;
}
.card-face-rank {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
  paint-order: stroke fill;
  font-family:
    'Inter',
    -apple-system,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-weight: 700;
}
.card-face-frame {
  stroke: currentColor;
}
/* Vector faces carry their own ink; keep the stock plain so the index stays crisp. */
html[data-card-style='modern'] .card-front::after {
  background: linear-gradient(160deg, #ffffff55 0%, #ffffff00 40%);
}

/* Card back: cream frame, burgundy lattice, inner rule and a spade medallion — one scalable SVG. */
.card-back {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 250 350'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23a8474f'/><stop offset='1' stop-color='%23792a32'/></linearGradient><pattern id='p' width='16' height='16' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'><path d='M0 8h16M8 0v16' stroke='%23f7e5db' stroke-opacity='.30' stroke-width='1.2'/></pattern></defs><rect width='250' height='350' rx='12' fill='url(%23g)'/><rect x='13' y='13' width='224' height='324' rx='8' fill='url(%23p)'/><rect x='13' y='13' width='224' height='324' rx='8' fill='none' stroke='%23f7ebe0' stroke-opacity='.8' stroke-width='2.5'/><rect x='22' y='22' width='206' height='306' rx='5' fill='none' stroke='%23f7ebe0' stroke-opacity='.35' stroke-width='1'/><circle cx='125' cy='175' r='50' fill='%23561c22' fill-opacity='.55' stroke='%23f7ebe0' stroke-opacity='.7' stroke-width='2.5'/><path transform='translate(92 142) scale(.66)' fill='%23f8ebe0' fill-opacity='.92' d='M50 3C50 3 7 44 7 67c0 14 11 23 23 23 6 0 12-3 15-7-2 10-7 16-15 19h40c-8-3-13-9-15-19 3 4 9 7 15 7 12 0 23-9 23-23C93 44 50 3 50 3Z'/></svg>")
      center / 100% 100% no-repeat,
    #8a3039;
}
.card-back::after {
  display: none;
}

/* Hole cards turn over as they arrive; the fan itself is untouched (rotate is a separate property). */
@keyframes dealCard {
  from {
    opacity: 0;
    transform: perspective(600px) rotateY(82deg) translateY(-26px);
  }
  60% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.card.dealing,
.card-back.dealing {
  transform-origin: 50% 50%;
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Court figures: tinted ground while the small bitmap arrives, then a short fade (no pop). */
.card-face-figure-ground {
  fill-opacity: 0.07;
}
.card-face-figure {
  opacity: 0;
  transition: opacity 0.16s ease;
}
.card-face-figure.is-loaded {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .card-face-figure {
    transition: none;
  }
}

/* Printed-deck details */
.card-face-border {
  stroke: #000;
  stroke-opacity: 0.08;
  stroke-width: 1.5;
}

/* Long seat names shrink instead of truncating. */
.player-name.is-long {
  font-size: 13px;
}
.player-name.is-xlong {
  font-size: 11.5px;
  letter-spacing: -0.01em;
}
.player-seat.is-hero .player-name.is-long,
.player-seat.is-hero .player-name.is-xlong {
  font-size: 13px;
}
@media (max-width: 1050px) {
  .player-name.is-long {
    font-size: 11px;
  }
  .player-name.is-xlong {
    font-size: 10px;
  }
}

/* Bot seat names: full name on wide plates, short name on phones. */
.player-name > .name-full {
  display: inline;
}
.player-name > .name-short {
  display: none;
}
@media (max-width: 700px) {
  .player-name.has-short > .name-full {
    display: none;
  }
  .player-name.has-short > .name-short {
    display: inline;
  }
  .player-name.has-short.is-long,
  .player-name.has-short.is-xlong {
    font-size: 11px;
    letter-spacing: 0;
  }
}
