@font-face { font-family: "SN Pro"; src: url("/fonts/SNPro/SNPro-Regular.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "SN Pro"; src: url("/fonts/SNPro/SNPro-Medium.woff2") format("woff2"); font-weight: 500; }
@font-face { font-family: "SN Pro"; src: url("/fonts/SNPro/SNPro-Bold.woff2") format("woff2"); font-weight: 700; }

:root {
  color-scheme: dark;
  --ink: #f6f2e8;
  --accent-color: #f6f2e8;
  --muted: #8f8b82;
  --dim: #252421;
  --line: #302f2a;
  --ivory: #f6f2e8;
  --ivory-ink: #121210;
  --bg: #0d0d0c;
  --surface: #151513;
  --red: #d9574f;
}

.winner-toast { display: none !important; }

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); }
body { color: var(--ink); font-family: "SN Pro", sans-serif; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.shell { min-height: 100dvh; width: min(100%, 520px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.wordmark { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: .19em; text-decoration: none; }
.text-button, .quiet-link { min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 14px; text-decoration: none; padding: 10px 0; }
.text-button:focus-visible, .quiet-link:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; }
.view { animation: enter 320ms var(--ease-out-quart) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.eyebrow { color: var(--ivory); font-size: 11px; font-weight: 700; letter-spacing: .18em; margin: 0 0 13px; }
h1 { max-width: 430px; margin: 0; font-size: clamp(38px, 11vw, 58px); line-height: .96; letter-spacing: -.052em; font-weight: 500; text-wrap: balance; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.45; max-width: 400px; margin: 22px 0 0; }
.gold-button, .outline-button { min-height: 58px; width: 100%; border-radius: 18px; border: 0; font-weight: 700; cursor: pointer; transition: transform 120ms var(--ease-out-quart), opacity 120ms ease; }
.gold-button { background: var(--ivory); color: var(--ivory-ink); }
.outline-button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.gold-button:active, .outline-button:active { transform: scale(.985); }
.gold-button:disabled, .outline-button:disabled { opacity: .35; cursor: not-allowed; }

.entry-view { min-height: calc(100dvh - 100px); display: flex; flex-direction: column; justify-content: space-between; padding: clamp(72px, 14vh, 130px) 0 12px; }
.entry-actions { display: grid; gap: 12px; text-align: center; }
.profile-view { padding-top: clamp(70px, 13vh, 120px); }
.profile-view h1 { font-size: clamp(34px, 9vw, 50px); }
.profile-form { margin-top: 42px; display: grid; }
.photo-picker { width: max-content; display: flex; align-items: center; gap: 14px; cursor: pointer; margin-bottom: 34px; }
.profile-preview, .avatar { display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #23221f; color: var(--ink); font-weight: 600; }
.profile-preview { width: 72px; height: 72px; font-size: 25px; border: 1px solid var(--line); }
.profile-preview img, .avatar img { width: 100%; height: 100%; object-fit: cover; }
.photo-action { color: var(--ivory); font-size: 14px; font-weight: 600; }
.field-label { color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 9px; }
.name-input { width: 100%; height: 60px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-size: 26px; padding: 0; margin-bottom: 32px; }
.name-input::placeholder { color: #484640; }

.lobby-view { padding-top: clamp(52px, 9vh, 90px); }
.lobby-view h1 { font-size: clamp(34px, 9vw, 48px); }
.seat-list { margin: 42px 0 34px; border-top: 1px solid var(--line); }
.seat-row { min-height: 68px; display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.seat-row .avatar { width: 42px; height: 42px; font-size: 18px; }
.seat-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.seat-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-meta { color: var(--muted); font-size: 12px; }
.host-mark { color: var(--ivory); font-size: 9px; letter-spacing: .12em; }
.empty-seat .avatar { border: 1px dashed #45433d; background: transparent; color: #4d4a44; }
.empty-seat .seat-name { color: #55524c; }
.host-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.add-players-button {
  width: auto;
  min-width: max-content;
  padding-inline: 17px;
  color: var(--muted);
}
.ai-fill-row { position: relative; display: grid; grid-template-columns: 1fr 46px; align-items: center; min-height: 76px; cursor: pointer; }
.ai-fill-row strong { display: block; font-size: 15px; }
.ai-fill-row small { display: block; color: var(--muted); margin-top: 4px; font-size: 13px; }
.ai-fill-row input { position: absolute; opacity: 0; }
.switch { width: 46px; height: 28px; border-radius: 18px; background: #33312d; position: relative; transition: background .2s ease; }
.switch::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #b9b5aa; position: absolute; left: 3px; top: 3px; transition: transform .2s ease, background .2s ease; }
.ai-fill-row input:checked + .switch { background: var(--ivory); }
.ai-fill-row input:checked + .switch::after { transform: translateX(18px); background: var(--ivory-ink); }
.ai-fill-row:has(input:focus-visible) .switch { outline: 2px solid var(--ivory); outline-offset: 3px; }
.waiting-note { display: flex; justify-content: center; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; padding: 18px; }
.waiting-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ivory); animation: pulse 1.5s ease infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.game-view { height: calc(100dvh - 70px); display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 10px; overflow: hidden; }
.game-status { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; letter-spacing: .15em; padding-top: 6px; }
.opponents { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.opponent { min-width: 0; text-align: center; opacity: .68; padding: 7px 1px; border-radius: 18px; }
.opponent.active, .player-seat.active { background: #201e16; opacity: 1; box-shadow: inset 0 0 0 1px #514719; }
.opponent.folded { opacity: .28; }
.opponent .avatar { width: 38px; height: 38px; margin: 0 auto 5px; font-size: 17px; }
.opponent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.opponent-chips { color: var(--muted); font-size: 10px; margin-top: 2px; }
.dealer { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 8px; font-weight: 700; margin-left: 2px; }
.felt { display: grid; place-content: center; justify-items: center; min-height: 0; }
.community { display: flex; justify-content: center; gap: 5px; min-height: 76px; }
.pot { color: var(--ivory); font-size: 22px; font-weight: 700; margin-top: 16px; }
.game-message { color: var(--muted); min-height: 20px; font-size: 13px; margin-top: 8px; text-align: center; }
.player-seat { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; border-radius: 20px; padding: 9px; }
.player-seat .avatar { width: 48px; height: 48px; }
.player-cards { display: flex; gap: 6px; }
.action-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: env(safe-area-inset-bottom); }
.action-controls button { min-height: 54px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); font-weight: 600; }
.action-controls button.primary { background: var(--ivory); color: var(--ivory-ink); border-color: var(--ivory); }
.action-controls .turn-wait { grid-column: 1 / -1; min-height: 54px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.raise-sheet { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.raise-sheet input { accent-color: var(--ivory); width: 100%; }
.raise-sheet output { min-width: 45px; text-align: right; color: var(--ivory); }
.error-view { padding-top: 24vh; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 18px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 99px; padding: 11px 18px; font-size: 13px; transition: opacity 160ms ease, transform 220ms var(--ease-out-quint); white-space: nowrap; max-width: calc(100vw - 30px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 700px) {
  .game-view { gap: 4px; }
  .opponent { padding: 3px 1px; }
  .opponent .avatar { width: 32px; height: 32px; }
  .community { min-height: 66px; }
  .card { width: 43px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.shell.game-active {
  width: 100%;
  max-width: none;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
}
.shell.game-active > .topbar { display: none; }
.multiplayer-game {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  grid-template-areas: "header" "opponents" "table" "player";
  padding: max(10px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
  gap: 8px;
  overflow: hidden;
}
.multiplayer-game > * { min-width: 0; max-width: 100%; }
.multiplayer-game .header-actions { grid-area: header; display: flex; align-items: center; justify-content: space-between; }
.multiplayer-game .opponents-bar { grid-area: opponents; width: auto; min-width: 0; padding-left: 0; padding-right: 0; flex-wrap: nowrap; gap: 6px; }
.multiplayer-game .opponent { width: 0; min-width: 0; flex: 1 1 0; }
.multiplayer-game .table-area { grid-area: table; }
.multiplayer-game .player-area { grid-area: player; }
.multiplayer-game .btn-icon { min-width: 44px; width: 44px; height: 44px; display: grid; place-items: center; color: inherit; text-decoration: none; }
.multiplayer-hand-status { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 10px; letter-spacing: .14em; }
.multiplayer-message { min-height: 19px; max-width: min(100%, 390px); margin: 9px auto 0; color: var(--text-secondary); font-size: 13px; line-height: 1.25; text-align: center; text-wrap: balance; }
.multiplayer-game .opponent { opacity: 1; }
.multiplayer-game .opponent.folded { opacity: .28; }
.multiplayer-game .opponent.eliminated { opacity: .18; }
.multiplayer-game .opponent.all-in:not(.folded) .opponent-card {
  box-shadow: inset 0 0 0 1px rgba(246, 242, 232, .42), 0 5px 18px rgba(0, 0, 0, .22);
}
.multiplayer-game .opponent.folded .opponent-avatar,
.multiplayer-game .opponent.folded .opponent-card,
.multiplayer-game .opponent.folded .opponent-name,
.multiplayer-game .opponent.folded .opponent-chips { opacity: 1 !important; }
.multiplayer-game .opponent.eliminated .opponent-card { opacity: 1 !important; }
.multiplayer-game .opponent.disconnected:not(.folded) .opponent-card { opacity: .48; }
.multiplayer-game .avatar-photo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.multiplayer-game .opponent-hand-container {
  position: absolute !important;
  top: calc(100% - 18px) !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  display: flex;
  width: max-content;
  max-width: none;
  margin: 0;
  overflow: visible;
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) !important;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .34));
  pointer-events: none;
  z-index: 500;
}
.multiplayer-game .mini-hand-stack {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  visibility: visible;
  opacity: 1;
  transform: none;
}
.multiplayer-game .mini-hand-stack .card {
  width: 10em;
  height: 14em;
  flex: 0 0 10em;
  margin: 0;
  font-size: clamp(5px, 1.55vw, 7px);
  transform: none;
  box-shadow: -3px 2px 8px rgba(0, 0, 0, .28);
}
.multiplayer-game .mini-hand-stack .card + .card { margin-left: -4em !important; }
.multiplayer-game .mini-hand-stack .card:first-child { margin-left: 0 !important; transform: rotate(-4deg) translateY(1px); }
.multiplayer-game .mini-hand-stack .card:last-child { transform: rotate(4deg) translateY(1px); }
.multiplayer-game .mini-hand-stack .card:hover { margin-right: 0 !important; transform: none; }
.multiplayer-game .player-area { display: block; }
.multiplayer-game .player-hand-container { width: 100%; min-width: 0; gap: 14px; }
.multiplayer-game .player-cards-wrapper { min-width: 0; flex: 0 0 16em; width: 16em; font-size: 13px; }
.multiplayer-game .player-cards { max-width: 100%; gap: 0; }
.multiplayer-game .player-cards .card { font-size: inherit !important; }
.multiplayer-game .player-info-wrapper { min-width: 0; }
.multiplayer-game .action-button-segment { position: relative; }
.multiplayer-game .user-bet-container {
  top: -42px;
  z-index: 120;
}
.multiplayer-game .user-bet-bubble {
  margin: 0;
}
.multiplayer-game .action-button-segment.dragging .action-raise-amount { opacity: 1; }
.multiplayer-game .action-button-segment.dragging .action-btn {
  background: rgba(34, 197, 94, .72);
  border-color: rgba(134, 239, 172, .62);
  box-shadow: 0 12px 30px rgba(22, 163, 74, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.multiplayer-game .action-button-segment.dragging .action-btn.drag-all-in {
  background: rgba(239, 68, 68, .25);
  border-color: rgba(239, 68, 68, .5);
  color: #ff9999;
  box-shadow: 0 12px 30px rgba(185, 28, 28, .24), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.multiplayer-game .action-stretch-rect {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
}
.multiplayer-game .action-button-segment.dragging .action-stretch-rect {
  background: rgba(34, 197, 94, .72);
  border-color: rgba(134, 239, 172, .36);
}
.multiplayer-game .action-button-segment:not(.dragging) .action-raise-amount {
  opacity: 0 !important;
  transition: none;
}
.multiplayer-game .action-button-segment.dragging .action-stretch-rect.all-in {
  background: rgba(239, 68, 68, .4);
  border-color: rgba(248, 113, 113, .42);
}
.multiplayer-game .action-btn:disabled { opacity: .35; }
.multiplayer-game .player-cards {
  touch-action: none;
  transition: transform .24s cubic-bezier(.2,.9,.3,1), opacity .2s ease;
  will-change: transform, opacity;
}
.multiplayer-game .player-cards.dragging,
.multiplayer-game .player-cards.fold-phase-flip,
.multiplayer-game .player-cards.fold-phase-exit {
  position: fixed !important;
  z-index: 2147483647 !important;
  isolation: isolate;
}
.multiplayer-game .player-cards:focus-visible { outline: 2px solid var(--ivory); outline-offset: 4px; border-radius: 14px; }
.multiplayer-game .action-btn { touch-action: none; }
@media screen and (max-width: 400px) {
  .multiplayer-game .player-hand-container { gap: 12px; }
  .multiplayer-game .player-cards-wrapper { font-size: 11px; }
}
@media screen and (max-height: 650px) {
  .multiplayer-game { gap: 4px; padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: max(4px, env(safe-area-inset-bottom)); }
  .multiplayer-game .opponents-bar { padding-top: 2px; padding-bottom: 30px; }
  .multiplayer-game .opponent-card { padding: 5px 2px 8px !important; border-radius: 12px !important; }
  .multiplayer-game .opponent-avatar { width: 30px; height: 30px; font-size: 18px; }
  .multiplayer-game .opponent-name { font-size: 9px; }
  .multiplayer-game .opponent-chips { font-size: 10px; }
  .multiplayer-game .player-cards .card { font-size: 8.5px !important; }
  .multiplayer-game .player-cards-wrapper { font-size: 8.5px; }
  .multiplayer-game .player-profile-card { padding: 10px 0; }
  .multiplayer-game .player-hand-container { min-height: 119px; }
  .multiplayer-game .player-area::before { height: 122px; }
}
.mp-hand-deal { animation: mpHandDeal 560ms var(--ease-out-quint) both; }
.mp-hand-deal.mp-card-1 { animation-delay: 80ms; }
.mp-community-deal { animation: mpCommunityDeal 360ms var(--ease-out-quint) both; }
.mp-community-deal.mp-delay-1 { animation-delay: 80ms; }
.mp-community-deal.mp-delay-2 { animation-delay: 160ms; }
.mp-bet-pop { animation: popIn 180ms var(--ease-out-quint) both; }
@keyframes mpHandDeal {
  0% { opacity: 0; transform: translate3d(115%, 24px, 0) rotate(14deg) scale(.86); }
  100% { opacity: 1; }
}
@keyframes mpCommunityDeal {
  0% { opacity: 0; transform: translate3d(70px, -18px, 0) rotate(8deg) scale(.86); }
  100% { opacity: 1; }
}

.gold-button,
.outline-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.table-settings {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
}

.table-settings-panel {
  width: min(100%, 480px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #151513;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}

.table-settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.table-settings-header h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -.04em;
}

.table-settings-header .eyebrow { margin-bottom: 8px; }
.table-settings-header .text-button { color: var(--ink); }

.table-setting-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.table-setting-row strong,
.table-setting-row small { display: block; }
.table-setting-row strong { font-size: 15px; font-weight: 500; }
.table-setting-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.table-setting-row input { width: 20px; height: 20px; accent-color: #f4f0e6; }
.table-settings-panel .outline-button { margin-top: 20px; }
.settings-leave { width: 100%; display: grid; place-items: center; margin-top: 8px; }

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}

@media screen and (min-width: 760px) {
  .table-settings { place-items: center; }

  .multiplayer-game {
    position: relative;
    width: 100%;
    max-width: 1240px;
    animation: none;
    height: 100dvh;
    padding: 14px clamp(24px, 3vw, 40px) max(16px, env(safe-area-inset-bottom));
    gap: clamp(4px, .8vh, 10px);
    grid-template-rows: 0 auto minmax(0, 1fr) auto;
    grid-template-areas: "header" "opponents" "table" "player";
  }

  .multiplayer-game .header-actions {
    position: fixed;
    top: max(20px, env(safe-area-inset-top, 0px));
    left: clamp(20px, 3vw, 44px);
    right: clamp(20px, 3vw, 44px);
    width: auto;
    max-width: none;
    min-height: 0;
    padding: 0;
    z-index: 220;
    pointer-events: none;
  }

  .multiplayer-game .header-actions .btn-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    font-size: 20px;
    pointer-events: auto;
  }

  .multiplayer-game .multiplayer-hand-status {
    position: fixed;
    top: 176px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 80;
  }

  .multiplayer-game .opponents-bar {
    width: auto;
    margin: 0 auto;
    padding: 2px 0 42px;
    gap: clamp(10px, 1.25vw, 16px);
    justify-content: center;
    flex-wrap: nowrap;
  }

  .multiplayer-game .opponent {
    width: clamp(68px, 6.25vw, 82px);
    min-width: clamp(68px, 6.25vw, 82px);
    max-width: 82px;
    flex: 0 0 clamp(68px, 6.25vw, 82px);
  }

  .multiplayer-game .opponent-avatar {
    width: clamp(40px, 3.5vw, 46px);
    height: clamp(40px, 3.5vw, 46px);
  }

  .multiplayer-game .opponent-name { font-size: 10px; }
  .multiplayer-game .opponent-chips { font-size: 12px; }

  .multiplayer-game .table-area {
    width: 100%;
    min-height: 0;
    padding-bottom: clamp(8px, 1.5vh, 18px);
  }

  .multiplayer-game .table-center { width: 100%; }

  .multiplayer-game .community-cards {
    width: min(100%, 720px);
    max-width: 720px;
    margin-inline: auto;
  }

  .multiplayer-game .community-cards .card {
    font-size: clamp(10.5px, 1vw, 13px);
    margin-right: -1.7em;
  }

  .multiplayer-game .player-area {
    width: min(calc(100% - 48px), 580px);
    max-width: 580px;
    padding: 0 16px;
    justify-self: center;
  }

  .multiplayer-game .player-hand-container {
    width: 100%;
    gap: 16px;
    justify-content: center;
    align-items: stretch;
  }

  .multiplayer-game .player-cards-wrapper {
    flex: 0 0 16em;
    width: 16em;
    font-size: 13px;
  }

  .multiplayer-game .player-cards .card { font-size: inherit !important; }

  .multiplayer-game .player-info-wrapper {
    flex: 0 0 300px;
    width: 300px;
    max-width: 300px;
  }

  .multiplayer-game .action-btn {
    min-height: 54px;
    font-size: 16px;
  }

  .multiplayer-game .player-profile-card { min-height: 124px; }
  .multiplayer-game .raise-hint { font-size: 10px; }
}

@media screen and (min-width: 900px) {
  .shell.lobby-active {
    width: min(100%, 980px);
    padding-inline: 34px;
  }

  .shell.lobby-active .lobby-view {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    grid-template-rows: auto auto;
    column-gap: clamp(58px, 8vw, 110px);
    align-items: start;
  }

  .shell.lobby-active .lobby-heading { grid-column: 1; grid-row: 1; }
  .shell.lobby-active .seat-list { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .shell.lobby-active .host-panel,
  .shell.lobby-active .waiting-note { grid-column: 1; grid-row: 2; align-self: end; margin-top: 48px; }
}

@media screen and (min-width: 1180px) {
  .multiplayer-game .community-cards {
    width: min(100%, 760px);
    max-width: 760px;
  }

  .multiplayer-game .community-cards .card { font-size: 13px; }
}

@media screen and (min-width: 760px) and (max-height: 700px) {
  .multiplayer-game { padding-top: 8px; }
  .multiplayer-game .opponents-bar { padding-bottom: 30px; }
  .multiplayer-game .opponent { height: 92px; max-height: 92px; }
  .multiplayer-game .opponent-card { padding-block: 6px !important; }
  .multiplayer-game .opponent-avatar { width: 38px; height: 38px; }
  .multiplayer-game .community-cards .card { font-size: 10px; }
  .multiplayer-game .player-cards-wrapper { font-size: 11px; }
  .multiplayer-game .player-info-wrapper { flex-basis: 270px; width: 270px; max-width: 270px; }
  .multiplayer-game .player-profile-card { min-height: 92px; padding-block: 14px; }
  .multiplayer-game .multiplayer-hand-status { top: 144px; }
}

@media screen and (max-width: 759px) {
  .multiplayer-game {
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: 0;
    padding-left: 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .multiplayer-game .header-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .multiplayer-game .btn-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }

  .multiplayer-game .opponents-bar {
    padding-right: 10px;
    padding-left: 10px;
  }
}

/* Final proportion and interaction pass: fewer visual accents, one scale system. */
:root {
  --gameplay-speed: 1;
  --motion-scale: 1;
}

.multiplayer-game .opponents-bar {
  justify-content: center;
  gap: clamp(5px, 1.5vw, 9px);
  padding-bottom: 44px;
  overflow: visible !important;
}

.multiplayer-game .opponent { overflow: visible !important; }
.multiplayer-game .opponent.revealed-hand { opacity: 1 !important; }
.multiplayer-game .payout-total strong { color: var(--ink); }

.multiplayer-game .opponent {
  width: clamp(56px, 15vw, 60px);
  min-width: clamp(56px, 15vw, 60px);
  max-width: 60px;
  height: 90px;
  max-height: 90px;
  flex: 0 0 clamp(56px, 15vw, 60px);
}

.multiplayer-game .opponent-card {
  width: 100%;
  height: 82px;
  min-height: 82px !important;
  padding: 6px 3px 8px !important;
  border-radius: 14px !important;
  gap: 2px;
}

.multiplayer-game .opponent-avatar {
  width: 34px;
  height: 34px;
  font-size: 21px;
}

.multiplayer-game .opponent-name { font-size: 9px; }
.multiplayer-game .opponent-chips { font-size: 10px; }

.multiplayer-game .mini-hand-stack {
  --showdown-card-unit: clamp(4.4px, .95vw, 5.25px);
  gap: 0;
}

.multiplayer-game .mini-hand-stack .card {
  width: 10em;
  height: 14em;
  min-height: 14em;
  max-height: 14em;
  flex: 0 0 10em;
  box-sizing: border-box;
  font-size: var(--showdown-card-unit);
  margin: 0;
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.multiplayer-game .mini-hand-stack .card + .card { margin-left: -4em !important; }
.multiplayer-game .mini-hand-stack .card:first-child,
.multiplayer-game .mini-hand-stack .card:last-child { transform: none !important; }

.player-area.user-turn-active .action-button-segment::after {
  display: none !important;
  content: none !important;
}

.player-area.user-turn-active .action-btn:not(:disabled) {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: #121210 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .46) !important;
}

.player-area.user-turn-active .raise-hint { color: rgba(246, 242, 232, .72); }

.player-area.user-turn-active .action-button-segment.dragging .action-btn {
  background: rgba(34, 197, 94, .78) !important;
  border-color: rgba(134, 239, 172, .62) !important;
  color: #fff !important;
}

.table-speed-row { grid-template-columns: minmax(0, 1fr) minmax(136px, 42%); }
.table-speed-control { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 10px; }
.table-setting-row .table-speed-control input {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--ink);
}
.table-speed-control output {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.table-speed-row:has(input:disabled) { opacity: .58; }

.mp-hand-deal { animation-duration: calc(560ms * var(--motion-scale)); }
.mp-hand-deal.mp-card-1 { animation-delay: calc(80ms * var(--motion-scale)); }
.mp-community-deal { animation-duration: calc(360ms * var(--motion-scale)); }
.mp-community-deal.mp-delay-1 { animation-delay: calc(80ms * var(--motion-scale)); }
.mp-community-deal.mp-delay-2 { animation-delay: calc(160ms * var(--motion-scale)); }
.mp-bet-pop { animation-duration: calc(180ms * var(--motion-scale)); }

@media screen and (min-width: 760px) {
  .multiplayer-game .opponents-bar { gap: clamp(9px, 1vw, 12px); padding-bottom: 46px; }
  .multiplayer-game .opponent {
    width: 66px;
    min-width: 66px;
    max-width: 66px;
    height: 94px;
    max-height: 94px;
    flex-basis: 66px;
  }
  .multiplayer-game .opponent-card { height: 86px; min-height: 86px !important; }
  .multiplayer-game .opponent-avatar { width: 36px; height: 36px; font-size: 22px; }
}

@media screen and (min-width: 760px) and (max-height: 700px) {
  .multiplayer-game .opponents-bar { padding-bottom: 40px; }
}

@media screen and (max-width: 420px) {
  .table-speed-row { grid-template-columns: 1fr; gap: 10px; padding-block: 14px; }
}

/* Showdown geometry mirrors solo: the rail owns the width and each hand owns its seat. */
.multiplayer-game .opponents-bar {
  --opponent-count: 5;
  display: grid !important;
  grid-template-columns: repeat(var(--opponent-count), minmax(0, 1fr));
  align-items: start;
  width: calc(100% - 20px) !important;
  max-width: 480px;
  margin-inline: auto;
  padding: 4px 0 58px !important;
  gap: clamp(4px, 1.5vw, 8px) !important;
  overflow: visible !important;
}

.multiplayer-game .opponents-bar .opponent {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 96px;
  max-height: 96px;
  flex: none !important;
  container-type: inline-size;
}

.multiplayer-game .opponents-bar .opponent-card {
  width: 100%;
  height: 90px;
  min-height: 90px !important;
  padding: 10px 3px 9px !important;
  gap: 2px;
  border-radius: 14px !important;
}

.multiplayer-game .opponents-bar .opponent-name,
.multiplayer-game .opponents-bar .opponent-chips {
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiplayer-game .opponents-bar .opponent-hand-container {
  top: calc(100% - 10px) !important;
  right: 0 !important;
  bottom: auto !important;
  left: 0 !important;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  transform: none !important;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .32));
  z-index: 60 !important;
}

.multiplayer-game .opponents-bar .mini-hand-stack {
  --showdown-card-unit: calc((100cqw - 4px) / 16.8);
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  gap: 0;
  padding-inline: 2px;
  transform: none !important;
}

.multiplayer-game .opponents-bar .mini-hand-stack .card {
  width: 10em !important;
  min-width: 10em !important;
  max-width: 10em !important;
  height: 14em !important;
  min-height: 14em !important;
  max-height: 14em !important;
  aspect-ratio: auto;
  margin: 0 !important;
  flex: 0 0 10em !important;
  font-size: var(--showdown-card-unit) !important;
  border-radius: var(--border-radius) !important;
  transform: none !important;
  transform-origin: center !important;
  box-shadow: 0 0.2em 2em rgba(0, 0, 0, .3) !important;
}

.multiplayer-game .opponents-bar .mini-hand-stack .card + .card {
  margin-left: -3.2em !important;
  z-index: 2;
}

.multiplayer-game .payout-row {
  padding: 2px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.multiplayer-game .payout-total {
  padding-left: 0;
  border-left: 0;
}

@media screen and (max-width: 360px) {
  .multiplayer-game .opponents-bar {
    width: calc(100% - 16px) !important;
    gap: 3px !important;
  }

  .multiplayer-game .opponents-bar .opponent-avatar {
    width: 32px;
    height: 32px;
  }
}
