/* One reserved game viewport and one stable betting dock. The four legacy
   stylesheets remain in place while their table rules are migrated here. */
body[data-screen="table"],
body[data-screen="table"] #app {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body[data-screen="table"] #table {
  --dock-height: 188px;
  position: absolute;
  inset: 0;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body #table .table-oval {
  left: 50%;
  top: calc((100dvh - var(--dock-height)) * .48);
  width: min(1060px, calc(100vw - 220px));
  height: min(420px, calc((100dvh - var(--dock-height)) * .62));
}

body #table .table-oval.is-hybrid .table-art,
body #table .table-oval.is-hybrid.is-three .table-art { z-index: 0; opacity: 1; visibility: visible; }
body #table .table-oval.is-hybrid .table-three { z-index: 1; }
body #table .table-oval { opacity: 0; transition: opacity .18s ease-out; }
body #table .table-oval.art-ready { opacity: 1; }
body #lobby .club-intro h1,
body #lobby .play-heading h2,
body .guide-dialog h2,
body .hand-result-card .hand-result-header h3,
body #gameOver .session-finale h2,
body #gameOver .hand-result-card > h3 { font-family: var(--font-title); }
body #gameOver .session-finale strong { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
body #table .table-oval .seats { z-index: 2; }
body #table .table-oval .board { z-index: 3; }

body #table .board { top: 44%; gap: 7px; }
body #table .street-progress {
  order: 0;
  display: flex;
  gap: 5px;
  margin: 0 0 2px;
  font-size: 11px;
  line-height: 1;
}
body #table .street-progress span {
  min-width: 0;
  padding: 2px 5px 3px;
  border-top: 0;
  border-bottom: 2px solid #a0b79e50;
}
body #table .street-progress .current { border-bottom-color: var(--gold-300); }
body #table .seat.self { transform: translate(-50%, -17%); }
body #table .seat.seat-north { transform: translate(-50%, -50%); }
body #table .seat.self .seat-avatar,
body #table .seat.self .countdown-ring { display: block; }
body #table .seat.folded { opacity: .72; filter: grayscale(.65); }
body #table .seat.active::after { display: none; }
body #table .seat.active .seat-avatar { animation: none; }
body #table .seat.active:not(:has(.countdown-ring)) .seat-avatar { outline: 2px solid var(--gold-300); outline-offset: 3px; }
body #table .seat .countdown-ring { top: 29px; width: 56px; height: 56px; transform: translate(-50%, -50%); }
body #table .seat.seat-north .countdown-ring { top: 20px; width: 44px; height: 44px; }
body #table .seat-style { font-size: 11px; }
body #table .table-oval.is-hybrid.is-three .seat-bet::before { display: none; }
body #table .bet-history-toggle { display: none; }
body #table .settings-popup {
  width: min(260px, calc(100vw - 20px));
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 1001px) and (min-height: 501px) {
  body #table .settings-popup { position: fixed; top: 72px; right: clamp(275px, 24vw, 360px); }
}
body #table .settings-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-top: 1px solid #c9b47455;
  color: var(--text-muted);
  font-size: 11px;
}
body #table .settings-preview-cards { display: flex; gap: 5px; }
body #table .settings-preview-cards .card { width: 36px; height: 50px; }
body #table .session-hud[data-format="sprint"] .session-track {
  width: 100%;
  height: 6px;
  border-radius: 0;
  mask-image: repeating-linear-gradient(90deg, #000 0 calc(8.333% - 2px), transparent calc(8.333% - 2px) 8.333%);
}
body #table .top-bar .icon-btn.active,
body #table .top-bar .icon-btn[aria-expanded="true"] {
  color: #fff4d0;
  background: #5b4c2d;
  border-color: #f2d18b;
  box-shadow: inset 0 0 0 1px #f8dda166, 0 0 15px #e9c46a66;
}
@media (min-width: 1001px) and (min-height: 501px) {
  body #table .top-bar #squintToggle,
  body #table .top-bar #leaveBtn { position: relative; margin-left: 7px; }
  body #table .top-bar #squintToggle::before,
  body #table .top-bar #leaveBtn::before {
    content: "";
    position: absolute;
    left: -7px;
    width: 1px;
    height: 22px;
    background: #d8bd7b55;
  }
}
body #table .settings-radio:focus-within { outline: 2px solid var(--gold-300); outline-offset: 1px; }
body #app .card.face:not(.face-a) .card-main {
  inset: 14% 14% 13%;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(155deg, #e8dcc0, #f9f3df);
}
body #app .card.face:not(.face-a) .royal-rank { display: none; }
body #app .card.face:not(.face-a) .royal-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  pointer-events: none;
}
body #app .card.face:not(.face-a) .main-suit {
  position: absolute;
  right: 3%;
  bottom: 2%;
  z-index: 1;
  font-size: clamp(8px, 16cqw, 17px);
  filter: drop-shadow(0 1px 1px #fff);
}
body #table .session-info #sessionProfit.gain { color: var(--gain); }
body #table .session-info #sessionProfit.loss { color: var(--loss); }
body #table .session-info #sessionProfit.flat { color: var(--even); }

/* Settlement: compact overview, responsive roster and always-visible actions. */
body #handResult { padding: 12px; }
body #handResult .hand-result-card {
  display: flex; flex-direction: column; gap: 0; width: min(1050px, calc(100vw - 24px));
  min-width: 0; max-width: none; max-height: calc(100dvh - 24px); padding: 18px;
  overflow: hidden; box-sizing: border-box;
}
body #handResult .result-moment-art { display: none; }
body #handResult .hand-result-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; padding: 0 0 12px; }
body #handResult .hand-result-header h3 { margin: 0; font: 500 24px/1.3 var(--font-title); text-align: left; }
body #handResult #resultViewToggle { min-height: 40px; flex: 0 0 auto; border: 1px solid #bdad7455; border-radius: 8px; padding: 7px 12px; background: #132e23; color: #dfce9f; font: 12px system-ui; cursor: pointer; }
body #handResult .result-main { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); align-items: start; gap: 18px; min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
body #handResult .result-summary { display: grid; gap: 10px; min-width: 0; }
body #handResult .session-result { padding: 8px 0; margin: 0; gap: 4px 10px; }
body #handResult .session-result[hidden] { display: none; }
body #handResult .session-result strong { font-size: 26px; }
body #handResult .session-result span { font-size: 11px; }
body #handResult .session-result small { display: none; }
body #handResult .result-milestones { margin: 0; min-width: 0; }
body #handResult .result-milestone { min-height: 26px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
body #handResult .self-result-summary:not([hidden]) { padding: 0; border: 0; }
body #handResult #handResultBody { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; min-width: 0; min-height: 0; padding: 0; overflow: visible; gap: 6px; }
body #handResult #handResultBody:empty { display: none; }
body #handResult .result-list-heading { grid-column: 1 / -1; padding: 0 2px 3px; font-size: 11px; }
body #handResult .result-scroll-cue { display: none; }
body #handResult .result-row { display: grid; grid-template-columns: minmax(0, 1fr) 58px; align-items: center; gap: 10px; flex: 0 0 auto; height: auto; min-height: 0; margin: 0; padding: 8px 10px; border-radius: 10px; }
body #handResult .result-info { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; min-width: 0; width: auto; gap: 2px 7px; }
body #handResult .result-avatar { grid-column: 1; grid-row: 1 / span 3; width: 28px; height: 28px; object-fit: cover; border: 1px solid #d7b876; border-radius: 50%; background: #204638; }
body #handResult .result-name { grid-column: 2; grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.3; }
body #handResult .result-rank { grid-column: 2; grid-row: 2; font-size: 11px; line-height: 1.3; }
body #handResult .result-delta { grid-column: 3; grid-row: 1 / span 2; margin: 0; font-size: 15px; white-space: nowrap; }
body #handResult .result-info .result-pot-badge { grid-column: 2 / -1; grid-row: 3; font-size: 9px; }
body #handResult .result-cards-wrap { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; width: 100%; min-width: 0; max-width: none; padding: 2px; overflow: visible; }
body #handResult .result-card-group { display: grid; min-width: 0; gap: 4px; }
body #handResult .result-card-label { color: #d8c595; font: 500 10px/1.3 system-ui; }
body #handResult .result-holes, body #handResult .result-best { display: grid; gap: 3px; min-width: 0; }
body #handResult .result-holes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body #handResult .result-best { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body #handResult .result-cards-wrap .card { width: 100%; min-width: 0; height: auto; aspect-ratio: 5 / 7; transform: none; margin: 0; }
body #handResult .result-cards-wrap .card.highlight { transform: none; box-shadow: 0 0 0 1px #e9ca7e, 0 2px 3px #0004; }
body #handResult:not([data-detail="true"]) #handResultBody .result-card-group:has(.result-best),
body #handResult:not([data-detail="true"]) #handResultBody .result-card-label { display: none; }
body #handResult .self-result-summary .result-row { grid-template-columns: minmax(0, 1fr); gap: 9px; opacity: 1; background: linear-gradient(120deg, #345b48a8, #0a302eb5); border-color: #dcc18b99; padding: 12px; }
body #handResult .self-result-summary .result-name::before { content: none; }
body #handResult .self-result-summary .result-name::after { content: " · 你"; color: #dfc28b; }
body #handResult .self-result-summary .result-cards-wrap { grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); max-width: 310px; }
body #handResult .result-summary:has(.session-result:not([hidden])) .self-result-summary .result-delta { display: none; }
body #handResult .result-board { margin: 0; padding: 10px; gap: 8px; flex-wrap: nowrap; border-radius: 10px; }
body #handResult .result-board-label { font-size: 11px; }
body #handResult .result-board-cards { min-width: 0; max-width: 100%; gap: 5px; }
body #handResult .result-board-cards .card { width: clamp(30px, 4vw, 44px); height: auto; aspect-ratio: 5 / 7; }
body #handResult .result-actions { display: grid; grid-template-columns: 1fr 1fr 1.8fr; gap: 8px; flex: 0 0 auto; margin-top: 14px; padding-top: 12px; border-top: 1px solid #c7b78040; }
body #handResult .result-actions > button { position: static; min-width: 0; min-height: 46px; height: auto; margin: 0; padding: 9px 12px; font-size: 14px; line-height: 1.35; border-radius: 10px; white-space: normal; }
body #handResult #nextHandBtn { margin: 0; font-size: 15px; min-height: 46px; }
body #handResult .result-pot-details { grid-column: 1 / -1; min-width: 0; }
body #handResult .result-pot-details > summary { padding: 6px 8px; color: #dfce9f; font-size: 11px; cursor: pointer; border-radius: 7px; background: #d5b9760b; }
body #handResult[data-detail="true"] #handResultBody .result-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
body #handResult[data-detail="true"] #handResultBody .result-cards-wrap { grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); max-width: 320px; }
body .history-entry-board .card { width: 32px; height: 45px; }
body .history-player-net { font-weight: 700; }
body .history-player-net.gain::before { content: "▲ "; }
body .history-player-net.loss::before { content: "▼ "; }
@media (min-width: 950px) {
  body #handResult[data-players="many"] #handResultBody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body #handResult[data-players="many"] #handResultBody .result-row { grid-template-columns: minmax(0, 1fr) 48px; padding: 9px 7px; gap: 5px; }
  body #handResult[data-players="many"] #handResultBody .result-info { grid-template-columns: minmax(0, 1fr); }
  body #handResult[data-players="many"] #handResultBody .result-avatar { display: none; }
  body #handResult[data-players="many"] #handResultBody .result-name { grid-column: 1; grid-row: 1; }
  body #handResult[data-players="many"] #handResultBody .result-rank { grid-column: 1; grid-row: 2; }
  body #handResult[data-players="many"] #handResultBody .result-delta { grid-column: 1; grid-row: 3; }
  body #handResult[data-players="many"] #handResultBody .result-pot-badge { grid-column: 1; grid-row: 4; }
  body #handResult[data-detail="true"] #handResultBody { grid-template-columns: minmax(0, 1fr); }
  body #handResult[data-detail="true"] #handResultBody .result-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  body #handResult { padding: 8px; }
  body #handResult .hand-result-card { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 12px; }
  body #handResult .hand-result-header { padding-bottom: 7px; }
  body #handResult .hand-result-header h3 { font-size: 20px; }
  body #handResult .result-main { display: block; }
  body #handResult .result-summary { gap: 6px; margin-bottom: 9px; }
  body #handResult .session-result { padding: 5px 0; }
  body #handResult .session-result strong { font-size: 22px; }
  body #handResult .session-result span { font-size: 10px; }
  body #handResult .self-result-summary .result-row { padding: 8px; gap: 5px; }
  body #handResult .self-result-summary .result-cards-wrap { max-width: 280px; gap: 10px; }
  body #handResult .result-board { padding: 6px 8px; }
  body #handResult .result-board-cards .card { width: clamp(26px, 8vw, 34px); }
  body #handResult .result-row { padding: 6px 8px; grid-template-columns: minmax(0, 1fr) 48px; gap: 7px; }
  body #handResult .result-avatar { width: 24px; height: 24px; }
  body #handResult .result-info { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 6px; }
  body #handResult .result-name { font-size: 12px; }
  body #handResult .result-delta { font-size: 13px; }
  body #handResult .result-actions { margin-top: 9px; padding-top: 9px; gap: 6px; }
  body #handResult .result-actions > button { padding: 8px; font-size: 13px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-row { grid-template-columns: minmax(0, 1fr) 38px; padding: 5px 6px; gap: 4px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-info { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-avatar { display: none; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-name { grid-column: 1; grid-row: 1; font-size: 11px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-rank { grid-column: 1; grid-row: 2; font-size: 10px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-delta { grid-column: 1; grid-row: 3; font-size: 12px; }
  body #handResult[data-players="many"]:not([data-detail="true"]) #handResultBody .result-pot-badge { grid-column: 1; grid-row: 4; }
}
@media (max-height: 700px) {
  body #handResult .hand-result-card { padding: 10px; }
  body #handResult .hand-result-header { padding-bottom: 5px; }
  body #handResult .result-actions { margin-top: 6px; padding-top: 6px; }
  body #handResult .result-summary { gap: 5px; }
  body #handResult .result-board { padding: 5px 7px; }
  body #handResult .result-board-cards .card { width: 28px; }
  body #handResult .self-result-summary .result-cards-wrap { max-width: 244px; }
  body #handResult .self-result-summary .result-row { padding: 6px 8px; }
  body #handResult .session-result strong { font-size: 20px; }
}
@media (min-width: 651px) and (max-height: 500px) {
  body #handResult .hand-result-card { width: calc(100vw - 24px); }
  body #handResult .result-main { grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); gap: 12px; }
  body #handResult .hand-result-header h3 { font-size: 20px; }
  body #handResult #resultViewToggle { min-height: 32px; }
  body #handResult[data-players="many"] #handResultBody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body #handResult[data-players="many"] #handResultBody .result-row { grid-template-columns: minmax(0, 1fr) 36px; padding: 5px; gap: 3px; }
  body #handResult[data-players="many"] #handResultBody .result-avatar { display: none; }
  body #handResult[data-players="many"] #handResultBody .result-info { grid-template-columns: minmax(0, 1fr); }
  body #handResult[data-players="many"] #handResultBody .result-name { grid-column: 1; grid-row: 1; font-size: 11px; }
  body #handResult[data-players="many"] #handResultBody .result-rank { grid-column: 1; grid-row: 2; font-size: 10px; }
  body #handResult[data-players="many"] #handResultBody .result-delta { grid-column: 1; grid-row: 3; font-size: 12px; }
  body #handResult[data-detail="true"] #handResultBody { grid-template-columns: minmax(0, 1fr); }
  body #handResult[data-detail="true"] #handResultBody .result-row { grid-template-columns: minmax(0, 1fr); }
}
body #gameOver .hand-result-card { max-height: min(90dvh, 760px); overflow: hidden; padding: 18px 22px 0; }
body #gameOver #gameOverBody { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body #gameOver .session-finale { padding: 4px 0 16px; }
body #gameOver .session-finale strong.gain { color: var(--gain); }
body #gameOver .session-finale strong.loss { color: var(--loss); }
body #gameOver .session-finale strong.flat { color: var(--even); }
body #gameOver .final-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 15px; }
body #gameOver .final-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 7px;
  text-align: center;
  background: #102f2a;
  border: 1px solid #b99a5a70;
  border-radius: 8px;
}
body #gameOver .final-stat strong { color: var(--gold-300); font: 700 20px/1.2 var(--font-num); font-variant-numeric: tabular-nums; }
body #gameOver .final-stat span { color: var(--text-muted); font-size: 11px; }
body #gameOver .final-ranking-title { margin: 2px 0 7px; color: var(--gold-300); font-size: 14px; }
body #gameOver .rank-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 10px; }
body #gameOver .rank-row.self { background: #315b483d; border: 1px solid #d2b97880; }
body #gameOver .rank-place { color: var(--gold-300); font: 700 13px/1 var(--font-num); }
body #gameOver .rank-row strong { color: var(--text-strong); font: 700 13px/1 var(--font-num); font-variant-numeric: tabular-nums; }
body #gameOver .lobby-actions { flex: 0 0 auto; margin: 10px 0 0; padding-bottom: 18px; }
body .guide-card-example { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
body .guide-card-example #guideExampleCards { display: flex; gap: 5px; flex: 0 0 auto; }
body #app .guide-card-example .card { width: 34px; height: 48px; }
body .guide-card-example small { color: var(--text-muted); font-size: 11px; }
@media (max-width: 540px) {
  body .guide-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 16px; }
  body .guide-card-example { flex-wrap: wrap; }
}
@media (min-width: 1001px) and (min-height: 800px) and (max-height: 960px) {
  body #lobby .lobby-layout { padding-top: 23px; padding-bottom: 14px; }
  body #lobby .club-play { padding: 23px 26px; }
  body #lobby .format-card { min-height: 72px; }
  body #lobby .hero-scene { height: 275px; }
  body #lobby .career-stats { margin-top: 18px; padding-top: 13px; }
}
body #lobby .format-check { opacity: 0; color: var(--gold-300); font-size: 20px; }
body #lobby .format-card.selected .format-check { opacity: 1; }

body #actionBar {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  right: auto;
  bottom: max(8px, env(safe-area-inset-bottom));
  width: min(940px, calc(100vw - 32px));
  height: var(--dock-height);
  min-height: 0;
  padding: 11px 18px 12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: stretch;
  gap: 5px;
  background: linear-gradient(160deg, #12382ff7, #061e1bf9);
  border: 1px solid #c5a9689c;
  border-radius: 15px;
  box-shadow: 0 16px 40px #000b, inset 0 1px #fff3cb22;
  backdrop-filter: blur(12px);
}
body #actionBar::before,
body #actionBar .bet-console::before { content: none; }

body #actionBar .decision-context {
  position: static;
  inset: auto;
  display: block;
  max-width: none;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  text-align: left;
  color: var(--gold-300);
  font: 600 12px/18px system-ui, sans-serif;
}
body #actionBar .hud-top {
  position: static;
  inset: auto;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 22px;
  max-width: none;
  padding: 0;
  gap: 8px;
  transform: none;
  border: 0;
  background: none;
  box-shadow: none;
}
body #actionBar .hand-panel-title,
body #actionBar .hole-cards-mini { display: none; }
body #actionBar .hud-side {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: none;
  gap: 12px;
}
body #actionBar .hand-hint {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  font-size: 12px;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
body #actionBar .equity-meter { min-width: 0; flex: 0 0 auto; }
body #actionBar .equity-label { display: flex; justify-content: flex-start; gap: 5px; font-size: 12px; }
body #actionBar .equity-value { font: 700 15px/1 var(--font-num); font-variant-numeric: tabular-nums; }
body #actionBar .equity-bar { display: none; }

/* Readable operational copy; tiny lettering remains only inside card artwork. */
body[data-screen="table"] #table :is(
  .session-brand, .session-info, .session-info *, .session-goal,
  .pot-label, .street-progress, .seat-name, .seat-stack, .seat-style,
  .seat-capsule, .seat-bet, .badge-dealer, .badge-sb, .badge-bb,
  .bet-history-title, .bet-history-subtitle, .bet-history-player,
  .bet-history-action, .bet-history-stage
),
body[data-screen="table"] #actionBar :is(.chip-preset, .chip-preset small, .circle-btn-amount) {
  font-size: 12px;
}

body #actionBar .bet-console {
  position: static;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  grid-template-rows: 32px 27px 48px;
  gap: 5px 10px;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  transform: none;
  background: none;
}
body #actionBar .bet-console > * { position: static; inset: auto; width: auto; height: auto; transform: none; }
body #actionBar .bet-console .raise-presets-circle {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  max-width: none;
  padding: 0;
}
body #actionBar .bet-console .chip-preset {
  height: 32px;
  min-width: 0;
  padding: 2px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 11px;
}
body #actionBar .bet-console .chip-preset::before { display: none; }
body #actionBar .bet-console .chip-preset small {
  display: block;
  margin-top: 2px;
  color: #d9d4b5;
  font: 600 10px/1 var(--font-num);
  font-variant-numeric: tabular-nums;
}
body #actionBar .bet-console .chip-preset:disabled { opacity: .45; cursor: not-allowed; }
body #actionBar .bet-console .raise-slider { grid-column: 1; grid-row: 2; display: flex; align-items: center; }
body #actionBar .bet-console .raise-value-badge {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  place-items: center;
  padding: 0 5px;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
}
body #actionBar .bet-console .action-buttons-circle {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}
body #actionBar .bet-console .circle-btn,
body #actionBar .bet-console .circle-btn:hover:not(:disabled),
body #actionBar .bet-console .circle-btn:active:not(:disabled) {
  width: 100%;
  height: 48px;
  min-width: 0;
  padding: 4px;
  border-radius: 7px;
  box-shadow: inset 0 1px #fff5d641, 0 3px 7px #0008 !important;
}
body #actionBar .bet-console .circle-btn::before { content: none; }
body #actionBar .circle-btn kbd { display: none; }
body #actionBar .circle-btn .circle-btn-label { font-size: 15px; }
body #actionBar .circle-btn .circle-btn-amount { font-size: 11px; }
body #actionBar .circle-fold { color: var(--loss); border-color: #e0806c8a; background: #281e20 !important; }

body #actionBar .pre-action-bar {
  position: static;
  inset: auto;
  width: 100%;
  min-height: 27px;
  margin: 0;
  padding: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  z-index: 1;
}
body #actionBar .pre-pill { min-height: 27px; padding: 2px 10px; font-size: 11px; }
body #actionBar[data-state="waiting"] .bet-console { opacity: .55; }
body #actionBar[data-state="waiting"]:not([data-has-summary="true"]) .hud-top { display: none; }
body #actionBar[data-state="waiting"]:has(> #preActionBar[style*="display: flex"]) .decision-context { display: none; }
body #actionBar[data-state="waiting"] .decision-context { color: var(--text-muted); }

@media (max-height: 780px) and (min-width: 761px) {
  body[data-screen="table"] #table { --dock-height: 153px; }
  body #actionBar { padding: 7px 14px 8px; gap: 2px; }
  body #actionBar .hud-top { min-height: 18px; }
  body #actionBar .bet-console { grid-template-rows: 27px 22px 44px; gap: 3px 8px; }
  body #actionBar .bet-console .chip-preset { height: 27px; }
  body #actionBar .bet-console .circle-btn,
  body #actionBar .bet-console .circle-btn:hover:not(:disabled),
  body #actionBar .bet-console .circle-btn:active:not(:disabled) { height: 44px; }
  body #table .table-oval { top: calc((100dvh - var(--dock-height)) * .44); height: min(375px, calc((100dvh - var(--dock-height)) * .60)); }
  body #table .seat.self { margin-top: -8px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  body[data-screen="table"] #table :is(
    .session-brand, .session-info, .session-info *, .session-goal,
    .pot-label, .street-progress, .seat-name, .seat-stack, .seat-style,
    .seat-capsule, .seat-bet, .badge-dealer, .badge-sb, .badge-bb,
    .bet-history-title, .bet-history-subtitle, .bet-history-player,
    .bet-history-action, .bet-history-stage
  ),
  body[data-screen="table"] #actionBar :is(.chip-preset, .chip-preset small, .circle-btn-amount) { font-size: 11px; }
  body #lobby .lobby-layout { gap: 12px; padding: 16px 0; }
  body #lobby .club-intro { min-height: 205px; }
  body #lobby .club-intro h1 { position: relative; z-index: 2; margin: 10px 0 8px; font-size: 30px; line-height: 1.3; text-shadow: 0 2px 14px #001614; }
  body #lobby .intro-copy { position: relative; z-index: 2; }
  body #lobby .hero-scene { width: 185px; height: 185px; right: -24px; bottom: -12px; }
  body #lobby .hero-scene img { width: 195px; height: 195px; }
  body #lobby .club-play { padding: 16px; }
  body #lobby .play-heading h2 { font-size: 23px; }
  body #lobby .format-list { gap: 6px; }
  body #lobby .format-card { min-height: 72px; padding: 8px 9px; }
  body[data-screen="table"] #table { --dock-height: 186px; }
  body #table .table-oval {
    left: 50%;
    top: calc((100dvh - var(--dock-height)) * .52);
    width: min(82vw, 420px);
    height: min(390px, calc((100dvh - var(--dock-height)) * .57));
  }
  body #table .seat:not(.self) { width: 64px; padding: 2px; }
  body #table .seat:not(.self) .seat-avatar { width: 35px; height: 35px; margin-bottom: 2px; }
  body #table .seat:not(.self) .seat-name { max-width: 62px; font-size: 11px; }
  body #table .seat:not(.self) .seat-style { display: none; }
  body #table .seat:not(.self) .seat-stack { padding: 2px 3px; font-size: 11px; }
  body #table .seat:not(.self) .seat-cards {
    position: absolute;
    left: calc(50% + 10px);
    top: 2px;
    display: flex;
    gap: 0;
    margin: 0;
    min-height: 0;
    transform: rotate(8deg);
  }
  body #table .seat:not(.self) .seat-cards .card,
  body #table:is([data-seat-count="7"],[data-seat-count="8"]) .seat:not(.self) .seat-cards .card {
    width: 14px;
    height: 20px;
    min-width: 14px;
  }
  body #table .seat:not(.self) .seat-cards .card + .card { margin-left: -7px; transform: rotate(12deg); }
  body #table .seat:not(.self) .seat-bet { left: 50%; top: calc(100% - 6px); transform: translateX(-50%); }
  body #table .seat.self { width: 94px; transform: translate(-50%, -14%); }
  body #table .seat.seat-north { transform: translate(-50%, -70%); }
  body #table .seat.self .seat-avatar { display: block; width: 36px; height: 36px; margin-bottom: 2px; }
  body #table .seat.self .countdown-ring { display: block; top: 22px; width: 44px; height: 44px; }
  body #table .seat.self .seat-style { display: none; }
  body #table .seat.self .seat-cards { margin-top: 2px; }
  body #table .street-progress { gap: 3px; font-size: 10px; }
  body #table .street-progress span { padding: 1px 3px 2px; }
  body #table .board { top: 43%; gap: 5px; }
  body #table .pot-info { min-width: 110px; margin: 0; padding: 3px 12px; }
  body #table .pot-label { font-size: 9px; }
  body #table .pot-amount { font-size: 26px; }
  #app .community-cards .card { width: clamp(32px, 9.7vw, 40px); }
  body #actionBar { width: calc(100vw - 14px); height: calc(var(--dock-height) - 10px); padding: 8px 10px 10px; gap: 4px; }
  body #actionBar .decision-context { font-size: 11px; line-height: 16px; }
  body #actionBar .hud-top { min-height: 19px; }
  body #actionBar .bet-console { grid-template-columns: minmax(0,1fr) 106px; grid-template-rows: 31px 26px 50px; gap: 5px; }
  body #actionBar .bet-console .chip-preset { height: 31px; padding: 1px; font-size: 10px; }
  body #actionBar .bet-console .chip-preset small { font-size: 9px; }
  body #actionBar .bet-console .circle-btn,
  body #actionBar .bet-console .circle-btn:hover:not(:disabled),
  body #actionBar .bet-console .circle-btn:active:not(:disabled) { height: 50px; }
  body #actionBar .circle-btn .circle-btn-label { font-size: 13px; }
  body #actionBar .circle-btn .circle-btn-amount { font-size: 10px; }
  body #table .mobile-menu-toggle { top: calc(max(10px, env(safe-area-inset-top)) + 84px); }
}

@media (max-width: 760px) and (max-height: 640px) and (orientation: portrait) {
  body[data-screen="table"] #table { --dock-height: 171px; }
  body #table .session-goal, body #table .session-track { display: none; }
  body #table .session-hud { padding: 7px 9px; }
  body #table .session-info { margin-top: 3px; }
  body #table .mobile-menu-toggle { top: calc(max(10px, env(safe-area-inset-top)) + 56px); }
  body #table .table-oval { top: calc((100dvh - var(--dock-height)) * .53); height: calc((100dvh - var(--dock-height)) * .54); }
  body #table .seat.self { width: 78px; transform: translate(-50%, -31%); }
  body #table .seat.self .seat-avatar { width: 28px; height: 28px; }
  body #table .seat.self .seat-cards .card { width: 33px; height: 46px; }
  #app .community-cards .card { width: 28px; }
  body #actionBar .hud-top { display: none; }
  body #actionBar .bet-console { grid-template-rows: 28px 24px 46px; }
  body #actionBar .bet-console .chip-preset { height: 28px; }
  body #actionBar .bet-console .circle-btn,
  body #actionBar .bet-console .circle-btn:hover:not(:disabled),
  body #actionBar .bet-console .circle-btn:active:not(:disabled) { height: 46px; }
}

@media (max-width: 360px) and (orientation: portrait) {
  body #table .session-hud { width: 114px; }
  body #table #sessionMode,
  body #table #sessionBlinds { display: none; }
  body #table .session-info { flex-wrap: wrap; gap: 2px 6px; }
  body #table .seat.seat-north { margin-top: -25px; }
  body #table .pot-info { width: 100px; min-width: 100px; box-sizing: border-box; padding: 3px 6px; }
  body #table .pot-label { font-size: 9px; letter-spacing: -.4px; white-space: nowrap; }
  body #table .seat[style*="left: 6%"] { margin-left: -2px; }
  body #table .seat[style*="left: 94%"] { margin-left: 2px; }
}

@media (max-width: 375px) and (orientation: portrait) {
  body #table[data-seat-count="8"] .seat:is(.seat-lower-left, .seat-lower-right) { margin-top: 32px; }
}

@media (max-width: 760px) and (orientation: portrait) {
  body #table[data-seat-count="6"] .seat.seat-lower-left { margin-left: -20px; }
  body #table[data-seat-count="6"] .seat.seat-lower-right { margin-left: 20px; }
}

@media (min-width: 761px) and (max-width: 900px) and (orientation: portrait) {
  body #table .seat:not(.self) { width: 72px; padding: 2px; }
  body #table .seat:not(.self) .seat-avatar { width: 35px; height: 35px; margin-bottom: 2px; }
  body #table .seat:not(.self) .seat-name { max-width: 70px; font-size: 11px; }
  body #table .seat:not(.self) .seat-style { display: none; }
  body #table .seat:not(.self) .seat-stack { padding: 2px 3px; font-size: 11px; }
  body #table .seat:not(.self) .seat-cards {
    position: absolute;
    left: calc(50% + 10px);
    top: 2px;
    display: flex;
    gap: 0;
    margin: 0;
    min-height: 0;
    transform: rotate(8deg);
  }
  body #table .seat:not(.self) .seat-cards .card,
  body #table:is([data-seat-count="7"],[data-seat-count="8"]) .seat:not(.self) .seat-cards .card {
    width: 14px;
    height: 20px;
    min-width: 14px;
  }
  body #table .seat:not(.self) .seat-cards .card + .card { margin-left: -7px; transform: rotate(12deg); }
  body #table .seat.seat-north { margin-top: -40px; }
  body #table[data-seat-count="6"] .seat.seat-lower-left { margin-left: -34px; }
  body #table[data-seat-count="6"] .seat.seat-lower-right { margin-left: 34px; }
  body #table .seat.seat-left-side .seat-bet { margin-left: -42px; }
}

@media (min-width: 361px) and (max-width: 375px) and (max-height: 700px) and (orientation: portrait) {
  body #table .session-goal, body #table .session-track { display: none; }
  body #table .session-hud { padding: 7px 9px; }
  body #table .session-info { margin-top: 3px; }
  body #table .mobile-menu-toggle { top: calc(max(10px, env(safe-area-inset-top)) + 56px); }
  body #table .seat.self { margin-top: -20px; }
  body #table .seat.seat-north { margin-top: -20px; }
}

@media (min-width: 901px) {
  body #table .seat.seat-north { width: 72px; padding: 2px; margin-top: -50px; }
  body #table .seat.seat-north .seat-avatar { width: 35px; height: 35px; margin-bottom: 2px; }
  body #table .seat.seat-north .seat-name { font-size: 11px; }
  body #table .seat.seat-north .seat-style { display: none; }
  body #table .seat.seat-north .seat-stack { padding: 2px 3px; font-size: 11px; }
  body #table .seat.seat-north .seat-cards {
    position: absolute;
    left: calc(50% + 10px);
    top: 2px;
    display: flex;
    gap: 0;
    margin: 0;
    min-height: 0;
  }
  body #table .seat.seat-north .seat-cards .card { width: 14px; height: 20px; min-width: 14px; }
}

@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  body[data-screen="table"] #table :is(
    .session-brand, .session-info, .session-info *, .session-goal,
    .pot-label, .street-progress, .seat-name, .seat-stack, .seat-style,
    .seat-capsule, .seat-bet, .badge-dealer, .badge-sb, .badge-bb,
    .bet-history-title, .bet-history-subtitle, .bet-history-player,
    .bet-history-action, .bet-history-stage
  ),
  body[data-screen="table"] #actionBar :is(.chip-preset, .chip-preset small, .circle-btn-amount) { font-size: 11px; }
  body[data-screen="table"] #app,
  body[data-screen="table"] #table { height: 100dvh; min-height: 0; overflow: hidden; }
  body[data-screen="table"] #table { --land-dock-width: clamp(196px, 27vw, 240px); --dock-height: 100dvh; }
  body #table .table-oval {
    left: calc((100vw - var(--land-dock-width)) / 2);
    top: 53%;
    width: calc(100vw - var(--land-dock-width) - 20px);
    height: min(245px, 58dvh);
  }
  body #table .board { top: 43%; gap: 3px; }
  body #table .pot-info { padding: 2px 12px; min-width: 100px; margin: 0; }
  body #table .pot-label { font-size: 8px; }
  body #table .pot-amount { font-size: 21px; }
  body #table .street-progress { gap: 2px; font-size: 9px; }
  body #table .street-progress span { padding: 1px 2px 2px; }
  #app .community-cards .card { width: clamp(32px, 5.1vw, 43px); height: auto; aspect-ratio: 5 / 7; }
  body #table .seat { width: 66px; padding: 2px; }
  body #table .seat-avatar, body #table .seat.self .seat-avatar { width: 30px; height: 30px; margin-bottom: 1px; display: block; }
  body #table .seat-name { font-size: 10px; line-height: 1.1; }
  body #table .seat-style { display: none; }
  body #table .seat-stack { font-size: 10px; padding: 1px 3px; }
  body #table .seat-cards { position: absolute; left: calc(50% + 11px); top: 0; margin: 0; gap: 0; }
  body #table .seat:not(.self) .seat-cards .card { width: 16px; height: 23px; }
  body #table .seat.self .seat-cards { left: calc(50% - 125px); top: -8px; gap: 5px; }
  #app .seat.self .seat-cards .card { width: 44px; height: 62px; min-width: 44px; margin-left: 0; }
  body #table .seat-cards .card + .card { margin-left: -7px; }
  body #table .seat-bet { left: 50%; top: calc(100% - 5px); transform: translateX(-50%); font-size: 9px; }
  body #table .seat.self { transform: translate(-50%, -10%); }
  body #table .seat.seat-north { transform: translate(-50%, -50%); }
  body #table .seat.seat-north { margin-top: -47px; }
  body #table .seat .countdown-ring, body #table .seat.self .countdown-ring { display: block; top: 17px; width: 38px; height: 38px; }
  body #table .session-hud { top: 5px; left: 7px; width: 205px; padding: 5px 8px; }
  body #table .session-brand { font-size: 10px; }
  body #table .session-info { margin-top: 2px; gap: 7px; font-size: 9px; }
  body #table .session-goal, body #table .session-track, body #table .bet-history-panel { display: none; }
  body #table .mobile-menu-toggle {
    display: inline-flex;
    position: absolute;
    top: 5px;
    right: calc(var(--land-dock-width) + 11px);
    z-index: 42;
    min-width: 54px;
    min-height: 36px;
    padding: 0 7px;
    font-size: 11px;
    color: var(--gold-300);
    background: linear-gradient(145deg, #174838f2, #052b2bf2);
    border: 1px solid #d8bd7b99;
    border-radius: 8px;
    box-shadow: 0 4px 12px #0009;
  }
  body #table .top-bar { display: none; top: 44px; bottom: auto; right: calc(var(--land-dock-width) + 10px); z-index: 42; }
  body #table .top-bar.is-open { display: grid; grid-template-columns: repeat(4, 36px); }
  body #table .top-bar .icon-btn, body #table .top-bar .settings-wrap { width: 36px; height: 36px; }
  body #table .settings-popup { top: calc(100% + 8px); max-height: calc(100dvh - 100px); right: 0; }
  body #actionBar {
    left: auto;
    right: max(7px, env(safe-area-inset-right));
    top: max(5px, env(safe-area-inset-top));
    bottom: max(5px, env(safe-area-inset-bottom));
    width: calc(var(--land-dock-width) - 12px);
    height: auto;
    padding: 8px;
    transform: none;
    gap: 5px;
  }
  body #actionBar .decision-context { font-size: 11px; line-height: 15px; }
  body #actionBar .hud-top { min-height: 22px; }
  body #actionBar .hud-side { gap: 3px; }
  body #actionBar .hand-hint { font-size: 0; }
  body #actionBar .hand-hint::after { content: attr(data-short) " ·"; font-size: 11px; }
  body #actionBar .equity-text { display: none; }
  body #actionBar .equity-label { font-size: 11px; }
  body #actionBar .equity-value { font-size: 12px; }
  body #actionBar .bet-console {
    grid-template-columns: minmax(0,1fr) 82px;
    grid-template-rows: minmax(88px, 1fr) 26px 110px;
    gap: 5px;
  }
  body #actionBar .bet-console .raise-presets-circle { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(3, minmax(0,1fr)); }
  body #actionBar .bet-console .raise-presets-circle,
  body #actionBar .bet-console .action-buttons-circle { height: 100%; min-height: 0; }
  body #actionBar .bet-console .chip-preset { height: 100%; min-height: 27px; font-size: 10px; }
  body #actionBar .bet-console .chip-preset small { font-size: 9px; }
  body #actionBar .bet-console .action-buttons-circle { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); }
  body #actionBar .bet-console .circle-btn,
  body #actionBar .bet-console .circle-btn:hover:not(:disabled),
  body #actionBar .bet-console .circle-btn:active:not(:disabled) { height: 100%; min-height: 46px; }
  body #actionBar .circle-btn .circle-btn-label { font-size: 12px; }
  body #actionBar .circle-btn .circle-btn-amount { font-size: 10px; }
  body #actionBar .pre-action-bar { min-height: 27px; }
  body #actionBar .pre-action-label { display: none; }
  body #actionBar .pre-pill { padding: 2px 6px; }
  body #table .chat-panel.open { right: calc(var(--land-dock-width) + 8px); top: 43px; bottom: auto; width: min(250px, calc(100vw - var(--land-dock-width) - 16px)); height: min(275px, calc(100dvh - 52px)); }
}

@media (min-width: 1280px) {
  body #table:has(#chatPanel.open) .table-oval { left: calc(50% - 150px); width: min(820px, calc(100vw - 370px)); }
  body #table:has(#chatPanel.open) #actionBar { left: calc(50% - 150px); width: min(760px, calc(100vw - 370px)); }
}
@media (min-width: 761px) and (max-width: 1400px) and (min-height: 501px) {
  body #table .bet-history-panel:not(.is-expanded) {
    top: 150px;
    left: 12px;
    width: 46px;
    height: 46px;
    min-height: 0;
    max-height: 46px;
    border-radius: 12px;
  }
  body #table .bet-history-panel:not(.is-expanded) .bet-history-head { padding: 0; border: 0; }
  body #table .bet-history-panel:not(.is-expanded) .bet-history-head > div,
  body #table .bet-history-panel:not(.is-expanded) .bet-history-list { display: none; }
  body #table .bet-history-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 5px;
    padding: 0;
    color: var(--gold-300);
    background: #123b31;
    border: 1px solid #d8bd7b88;
    border-radius: 8px;
    font: 700 21px/1 system-ui, sans-serif;
    cursor: pointer;
  }
  body #table .bet-history-toggle:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; }
  body #table .bet-history-panel.is-expanded { width: min(250px, 25vw); }
}
@media (max-width: 1279px) and (min-height: 501px) {
  body #table .chat-panel.open { top: auto; bottom: calc(var(--dock-height) + 12px); right: 10px; width: min(310px, calc(100vw - 20px)); height: min(260px, 35dvh); }
}

@media (prefers-reduced-motion: reduce) {
  body #table .table-art, body #table .table-three { transition: none; }
  body #table .table-oval::before,
  body #table .seat.winner .seat-avatar,
  body #table .seat.winner .seat-cards,
  body #table .seat-capsule,
  body #table .card.flip,
  body #table .card.deal-in,
  body #table .card.hole-deal,
  body #table .card.reveal-in,
  body #handResult .result-moment-art { animation: none !important; }
}

body[data-screen="table"] #table .seat .seat-name,
body[data-screen="table"] #table .seat .seat-stack,
body[data-screen="table"] #table .session-brand span,
body[data-screen="table"] #table .settings-preview,
body[data-screen="table"] #actionBar .bet-console .chip-preset,
body[data-screen="table"] #actionBar .circle-btn .circle-btn-amount,
body[data-screen="table"] #actionBar .bet-console .chip-preset small { font-size: 12px; }
@media (max-width: 1000px) {
  body[data-screen="table"] #table .seat .seat-name,
  body[data-screen="table"] #table .seat .seat-stack,
  body[data-screen="table"] #table .session-brand span,
  body[data-screen="table"] #table .settings-preview,
  body[data-screen="table"] #actionBar .bet-console .chip-preset,
  body[data-screen="table"] #actionBar .circle-btn .circle-btn-amount,
  body[data-screen="table"] #actionBar .bet-console .chip-preset small { font-size: 11px; }
}

/* Multiway settlement keeps the award trail visible without enlarging the modal header. */
body #handResult .result-pot-ledger {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d8bd7b70;
  border-radius: 10px;
  background: #153b31;
}
body #handResult .result-pot-ledger > strong { color: #ffe5a8; font-size: 12px; letter-spacing: .1em; }
body #handResult .result-pot-line { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 8px; color: #e5e8d8; font-size: 12px; }
body #handResult .result-pot-name { color: #ffe1a0; font-weight: 700; white-space: nowrap; }
body #handResult .result-pot-line b { color: #ffe1a0; font: 700 14px var(--font-num); }
body #handResult .result-pot-recipients { min-width: 0; overflow-wrap: anywhere; }
body #handResult .result-list-heading { padding: 0 2px 3px; color: #d2d9c6; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
body #handResult .result-pot-badge { align-self: start; padding: 2px 5px; border: 1px solid #d8bd7b70; border-radius: 4px; color: #ffe2a7; font-size: 11px; line-height: 1.2; }
body #gameOver .rank-row { grid-template-columns: 30px 28px minmax(0, 1fr) auto; }

@media (max-width: 600px) {
  body #handResult .result-pot-line { grid-template-columns: auto 1fr; gap: 2px 8px; }
  body #handResult .result-pot-recipients { grid-column: 1 / -1; padding-bottom: 4px; }
}

/* Emerald Room refinement: quieter materials, clear decisions, details on demand. */
@media (min-width: 761px) {
  body #lobby .hero-scene { margin: 0; }
  body #lobby .hero-scene img { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; max-width: 340px; object-fit: contain; animation: none; }
}
body #lobby .format-card { transition: background .18s, border-color .18s, transform .18s; }
body #lobby .format-card:active { transform: scale(.98); }
body #lobby .format-card small { color: #c1cec0; line-height: 1.5; }
body #table .table-bg { filter: brightness(.7) saturate(.75); }
body #table .seat-avatar { padding: 0; font: inherit; cursor: pointer; transition: transform .16s, box-shadow .16s; }
body #table .seat-avatar:focus-visible { outline: 2px solid #fff0bc; outline-offset: 4px; }
body #table .seat-avatar:active { transform: scale(.96); }
body #table .seat-avatar::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; }
body #table .seat-stack { font-variant-numeric: tabular-nums; }
body #table .seat.active .seat-avatar { box-shadow: 0 0 0 2px #b89853, 0 4px 14px #0008; }
body #table .session-hud,
body #table .bet-history-panel { background: #0b2923ed; border-color: #a9966455; box-shadow: var(--shadow-panel); }
body #actionBar { background: #0b2520f5; border-color: #b6a16d66; box-shadow: var(--shadow-panel); }
body #actionBar .bet-console .chip-preset { background: #1b372d !important; border: 1px solid #a3b09a40; border-radius: 6px; box-shadow: inset 0 1px #ffffff08; text-shadow: none; transition: background .16s, border-color .16s, transform .16s; }
body #actionBar .bet-console .chip-preset[aria-pressed="true"] { background: #51462c !important; border-color: #dcc18b; box-shadow: inset 0 1px #ffffff14; }
body #actionBar .bet-console .chip-preset:active:not(:disabled) { transform: scale(.96); }
body #actionBar .bet-console .circle-btn,
body #actionBar .bet-console .circle-btn:hover:not(:disabled),
body #actionBar .bet-console .circle-btn:active:not(:disabled) { border-bottom-width: 1px; box-shadow: inset 0 1px #ffffff14, 0 3px 8px #0004 !important; text-shadow: none; }
body #actionBar .bet-console .circle-btn::after { content: none; }
body #actionBar .bet-console .action-buttons-circle { height: auto; }
body #actionBar .bet-console .circle-btn.circle-fold:is(button, :hover, :active) { background: #24332e !important; border-color: #73857388; color: #e0e4d8; }
body #actionBar .bet-console .circle-btn.circle-call:is(button, :hover, :active) { background: linear-gradient(160deg, #337759, #24583f) !important; border-color: #81ac8888; }
body #actionBar .bet-console .circle-btn.circle-raise:is(button, :hover, :active) { background: linear-gradient(160deg, #ead5a3, #c8a665) !important; border-color: #f4dfae; color: #302814; }
body #actionBar .bet-console .circle-btn.circle-allin:is(button, :hover, :active) { background: #583333 !important; border-color: #bd8e7866; }
body #actionBar .bet-console .circle-btn:hover:not(:disabled) { transform: none; filter: brightness(1.08); }
body #actionBar .bet-console .circle-btn:active:not(:disabled) { transform: scale(.96); }
body #actionBar .bet-console .raise-value-badge { display: flex; gap: 7px; padding: 0 9px; border-color: #d6bc7866; border-radius: 6px; background: var(--surface-deep); box-shadow: inset 0 1px 4px #0005; }
body #actionBar .raise-value-badge label { flex: 0 0 auto; color: #c6cdbb; font: 500 11px/1.2 system-ui, sans-serif; }
body #actionBar #raiseAmountInput { width: 100%; min-width: 0; height: 100%; min-height: 0; padding: 0; appearance: textfield; border: 0; border-radius: 0; background: transparent; color: #f1dca9; box-shadow: none; font: 700 16px/1 var(--font-num); font-variant-numeric: tabular-nums; text-align: right; }
body #actionBar #raiseAmountInput::-webkit-inner-spin-button,
body #actionBar #raiseAmountInput::-webkit-outer-spin-button { appearance: none; margin: 0; }
body #actionBar #raiseAmountInput:focus-visible { outline: none; }
body #actionBar .raise-value-badge:focus-within { outline: 2px solid var(--gold-300); outline-offset: 2px; }
body #actionBar .raise-value-badge:has(input:disabled) { opacity: .45; }
@media (min-height: 501px) {
  body[data-screen="table"] #table { --dock-height: 212px; }
  body #actionBar .bet-console { grid-template-rows: 40px 40px 48px; }
  body #actionBar .bet-console .chip-preset { height: 40px; }
}
@media (min-width: 761px) and (min-height: 501px) {
  body #table .seat.self { margin-top: -36px; }
}
@media (min-width: 761px) and (min-height: 501px) and (max-height: 780px) {
  body[data-screen="table"] #table { --dock-height: 198px; }
  body #actionBar .bet-console { grid-template-rows: 40px 40px 44px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  body[data-screen="table"] #table { --dock-height: 214px; }
  body #actionBar .bet-console { grid-template-columns: minmax(0, 1fr) 126px; grid-template-rows: 40px 40px 50px; }
  body #actionBar .bet-console .chip-preset { height: 40px; }
  body #table[data-seat-count] .seat:not(.self) .seat-bet { top: 20px; left: calc(50% + 24px); transform: none; margin: 0; }
  body #table[data-seat-count] .seat[data-side="right"] .seat-bet { left: auto; right: calc(50% + 24px); }
  body #table[data-seat-count] .seat.self .seat-bet { top: -18px; left: 50%; right: auto; transform: translateX(-50%); }
}
@media (max-width: 760px) and (max-height: 640px) and (orientation: portrait) {
  body[data-screen="table"] #table { --dock-height: 193px; }
  body #actionBar .bet-console { grid-template-rows: 36px 40px 46px; }
  body #actionBar .bet-console .chip-preset { height: 36px; }
}
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
  body #actionBar .bet-console { grid-template-columns: minmax(0, 1fr) 106px; grid-template-rows: minmax(88px, 1fr) 40px 110px; }
  body #actionBar .bet-console .raise-value-badge { padding: 0 5px; gap: 4px; }
  body #actionBar #raiseAmountInput { font-size: 14px; }
  body #table[data-seat-count] .seat:not(.self) .seat-bet { top: 2px; left: calc(50% + 22px); transform: none; margin: 0; }
  body #table[data-seat-count] .seat[data-side="right"] .seat-bet { left: auto; right: calc(50% + 22px); }
  body #table[data-seat-count] .seat.self .seat-bet { top: 14px; left: calc(100% + 12px); right: auto; transform: none; }
}

body .player-profile { box-sizing: border-box; width: min(420px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 24px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #bea56b80; border-radius: 20px; background: radial-gradient(ellipse at 10% 0, #204439, transparent 60%), var(--surface-deep); color: #f5efdd; box-shadow: 0 24px 90px #000b, inset 0 1px #ffffff12; }
body .player-profile::backdrop { background: #020d0bd9; backdrop-filter: blur(5px); }
body .profile-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -8px -8px 20px 0; }
body .profile-heading .eyebrow { color: #c7b789; font: 600 10px/1.4 system-ui, sans-serif; letter-spacing: .15em; }
body .profile-close { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-soft); border-radius: 50%; color: #d6d9c9; background: #ffffff06; font: 24px/1 system-ui, sans-serif; cursor: pointer; }
body .profile-identity { display: flex; align-items: center; gap: 18px; }
body #profileAvatar { flex: 0 0 80px; object-fit: cover; border: 1px solid #b9a06a; border-radius: 50%; box-shadow: 0 0 0 5px #bea56b12; }
body .profile-style { color: #e2c790; font-size: 12px; letter-spacing: .12em; }
body #profileName { margin: 5px 0; font: 600 30px/1.2 var(--font-title); overflow-wrap: anywhere; }
body #profilePosition { margin: 0; color: #adbcab; font-size: 12px; }
body .profile-tell { margin: 22px 0; padding-left: 12px; border-left: 2px solid #b7a171; color: #e0e3d4; font-size: 15px; line-height: 1.6; }
body .profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 10px; background: #ffffff03; }
body .profile-stats > div { display: flex; flex-direction: column; gap: 7px; padding: 16px 8px; text-align: center; }
body .profile-stats > div + div { border-left: 1px solid var(--line-soft); }
body .profile-stats span { color: #b1c0ad; font-size: 11px; }
body .profile-stats strong { color: #f2dfaf; font: 600 19px/1.2 var(--font-num); font-variant-numeric: tabular-nums; }
body .profile-note { margin: 16px 0 22px; color: #aebcab; font-size: 12px; line-height: 1.7; }
body .profile-done { width: 100%; min-height: 44px; margin: 0; border: 1px solid #ac996266; border-radius: 8px; background: #244434; color: #eee5c8; cursor: pointer; }
body .profile-close, body .profile-done { transition: background .16s, transform .16s; }
body .profile-close:hover, body .profile-done:hover { background: #37553e; }
body .profile-close:active, body .profile-done:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  body #table .seat-avatar, body #lobby .format-card,
  body #actionBar .bet-console .chip-preset, body #actionBar .bet-console .circle-btn,
  body .profile-close, body .profile-done { transition: none; }
}

/* Achievement collection — etched medals on the club's emerald felt. */
body .achievement-entry {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 20px 0 0; padding: 14px 18px;
  color: var(--text-strong); text-align: left; border: 1px solid #dfc28b55; border-radius: 14px;
  background: linear-gradient(110deg, #dfc28b12, #09271e88); cursor: pointer;
}
.achievement-entry > span:nth-child(2) { flex: 1; min-width: 0; }
.achievement-entry b { display: block; font-size: 15px; }
.achievement-entry small { display: block; margin-top: 5px; color: #b4c4b8; font-size: 12px; }
.achievement-entry-mark { color: var(--gold-300); font-size: 34px; line-height: 1; }
body .achievement-entry:hover { border-color: var(--gold-500); background-color: #dfc28b12; }
body .achievement-result-link, body .achievement-stats-link {
  padding: 12px; min-height: 44px; border: 1px solid #dfc28b40; border-radius: 10px;
  background: #0b211c; color: var(--gold-300); font: 500 13px/1.5 system-ui, sans-serif; cursor: pointer;
}
body .achievement-stats-link { width: 100%; margin-top: 20px; }
body .achievement-dialog {
  --achievement-edge: #b4c5b32e;
  box-sizing: border-box; width: min(820px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 32px); margin: auto; padding: 28px; overflow: auto; overscroll-behavior: contain;
  color: var(--text-strong); border: 1px solid #d0ad635e; border-radius: 22px;
  background: radial-gradient(ellipse at top right, #234c37 0, transparent 55%), #10281f;
  box-shadow: 0 32px 100px #0009; font: 14px/1.5 system-ui, sans-serif;
}
.achievement-dialog::backdrop { background: #020d0bbd; backdrop-filter: blur(6px); }
.achievement-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.achievement-heading h2 { margin: 10px 0 24px; font: 500 clamp(25px, 4vw, 36px)/1.35 var(--font-title); color: #f4dfb4; }
.achievement-heading .eyebrow { color: #c6b583; font-size: 10px; letter-spacing: .2em; }
body .achievement-close { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--achievement-edge); border-radius: 50%; background: #061e1980; color: #e9e2cb; font: 26px/1 system-ui; cursor: pointer; }
.achievement-overview { display: flex; align-items: center; gap: 48px; padding: 0 0 18px; }
.achievement-overview > div > span { display: block; color: #b1c5b6; font-size: 12px; }
.achievement-overview strong { display: block; margin-top: 4px; color: #f0cf86; font: 500 32px/1.2 var(--font-num); }
.achievement-crest { margin-left: auto; padding-right: 12px; color: #d9b969; font-size: 64px; line-height: 1; text-shadow: 0 4px 24px #d5af5620; }
.achievement-dialog progress { display: block; appearance: none; width: 100%; height: 4px; overflow: hidden; border: 0; border-radius: 4px; background: #ccddc61a; accent-color: var(--gold-500); }
.achievement-dialog progress::-webkit-progress-bar { background: #ccddc61a; border-radius: 4px; }
.achievement-dialog progress::-webkit-progress-value { background: #d8bb7f; border-radius: 4px; }
.achievement-dialog progress::-moz-progress-bar { background: #d8bb7f; border-radius: 4px; }
.achievement-next { margin: 12px 0 24px; color: #c1cdbd; font-size: 12px; line-height: 1.7; }
.achievement-filters { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 18px; border-top: 1px solid var(--achievement-edge); }
.achievement-categories { display: flex; flex-wrap: wrap; gap: 4px; }
body .achievement-categories button { min-height: 44px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #b6c8b9; font: 500 13px/1.2 system-ui; cursor: pointer; }
body .achievement-categories button[aria-pressed="true"] { color: #f5dc9e; background: #d7b96e14; border-color: #d7b96e70; }
.achievement-status { display: flex; align-items: center; gap: 8px; color: #b6c8b9; font-size: 12px; }
body .achievement-status select { width: auto; min-height: 44px; padding: 8px 26px 8px 10px; background-color: #0a211a; color: #dfdfce; border: 1px solid var(--achievement-edge); border-radius: 8px; font: 12px system-ui; }
.achievement-filter-count { margin: 12px 0; font-size: 11px; color: #a3b7a8; }
.achievement-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.achievement-item { display: flex; align-items: flex-start; min-width: 0; gap: 16px; padding: 18px 16px; border: 1px solid var(--achievement-edge); border-radius: 14px; background: #081d1873; }
.achievement-item.is-unlocked { border-color: #d6b57060; background: linear-gradient(120deg, #b4994d16, #122d2180); }
.achievement-medal { flex: 0 0 96px; width: 96px; height: 112px; display: grid; place-items: center; }
.achievement-medal img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; filter: grayscale(.85) brightness(.76); opacity: .78; }
.is-unlocked .achievement-medal img { filter: drop-shadow(0 5px 10px #0005); opacity: 1; }
body #handResult .result-milestone { display: inline-flex; align-items: center; gap: 5px; }
body #handResult .result-milestone img { flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain; }
.milestone-toast .milestone-icon { flex: 0 0 60px; width: 60px; height: 60px; object-fit: contain; }
.achievement-copy { flex: 1; min-width: 0; }
.achievement-item-top, .achievement-item-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; font-size: 10px; color: #a4bba9; }
.achievement-item-top b { font-weight: 500; color: #c7b98e; }
.achievement-copy h3 { margin: 7px 0 6px; color: #ede9d7; font-size: 16px; line-height: 1.3; }
.achievement-copy p { min-height: 36px; margin: 0 0 13px; color: #b1c3b6; font-size: 12px; line-height: 1.5; }
.achievement-item-bottom { margin-top: 9px; font-variant-numeric: tabular-nums; }
.is-unlocked .achievement-item-bottom > span:first-child { color: #ddc890; }
.achievement-empty { grid-column: 1 / -1; padding: 34px 16px; text-align: center; border: 1px dashed var(--achievement-edge); border-radius: 12px; color: #b6c8b9; }
.achievement-storage-note { margin: 22px 0 0; color: #a4b8aa; font-size: 11px; line-height: 1.8; }
@media (max-width: 600px) {
  body .achievement-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 20px 16px; border-radius: 16px; }
  .achievement-heading h2 { margin-bottom: 20px; font-size: 25px; }
  .achievement-overview { gap: 32px; }
  .achievement-overview strong { font-size: 29px; }
  .achievement-crest { font-size: 52px; padding: 0; }
  .achievement-list { grid-template-columns: minmax(0, 1fr); }
  .achievement-filters { gap: 10px; }
  body .achievement-categories button { padding: 9px 12px; }
  .achievement-item { padding: 16px; }
  .achievement-medal { flex-basis: 80px; width: 80px; height: 100px; }
  .achievement-copy p { min-height: 0; }
}
@media (max-width: 360px) {
  .achievement-item { gap: 10px; padding: 12px 10px; }
  .achievement-medal { flex-basis: 64px; width: 64px; height: 90px; }
}

/* A brief portrait entrance marks a raise without taking over the controls. */
.raise-spotlight {
  position: absolute; left: 50%; width: min(350px, calc(100vw - 32px)); min-height: 150px;
  box-sizing: border-box; display: flex; align-items: center; gap: 22px; padding: 12px 24px 12px 14px;
  transform: translateX(-50%); isolation: isolate; pointer-events: none;
  border: 1px solid #ddc07b96; border-radius: 80px 18px 18px 80px;
  background: linear-gradient(105deg, #234b38fa, #0a241cf5 75%);
  box-shadow: 0 16px 42px #0009, inset 0 1px #ffedb82b;
  animation: raise-entrance 1450ms both cubic-bezier(.2,.75,.25,1);
}
.raise-spotlight::after {
  content: ""; position: absolute; right: 22px; bottom: 12px; width: 100px; height: 2px;
  transform-origin: left; background: linear-gradient(90deg, #efd798, transparent);
  animation: raise-streak 1450ms ease-out both;
}
.raise-portrait { position: relative; flex: 0 0 122px; height: 122px; border: 2px solid var(--gold-300); border-radius: 50%; padding: 5px; background: #0b221a; box-shadow: 0 0 24px #d9b65b30; }
.raise-portrait::before { content: ""; position: absolute; inset: -9px; border: 1px solid #f0cf8699; border-radius: 50%; animation: raise-ring 1100ms ease-out both; }
.raise-portrait img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.raise-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }
.raise-player-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #d3dfce; font: 600 13px/1.5 system-ui, sans-serif; }
.raise-copy strong { color: #f7e6b9; font: 600 25px/1.25 var(--font-title); letter-spacing: .12em; }
.raise-amount { color: var(--gold-300); font: 600 clamp(22px, 4vw, 30px)/1.3 var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@keyframes raise-entrance {
  0% { opacity: 0; transform: translateX(calc(-50% - 28px)) scale(.78); }
  18% { opacity: 1; transform: translateX(-50%) scale(1.035); }
  30%, 77% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(calc(-50% + 14px)) scale(.96); }
}
@keyframes raise-ring { 0% { opacity: 0; transform: scale(.8); } 25% { opacity: .9; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes raise-streak { 0%, 15% { transform: scaleX(0); opacity: 0; } 30%, 75% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(.3); opacity: 0; } }
@media (max-width: 600px), (max-height: 500px) {
  .raise-spotlight { width: min(290px, calc(100vw - 32px)); min-height: 120px; gap: 16px; padding: 10px 18px 10px 10px; }
  .raise-portrait { flex-basis: 96px; height: 96px; padding: 4px; }
  .raise-copy strong { font-size: 22px; }
  .raise-amount { font-size: 25px; }
  .raise-player-name { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .raise-spotlight { animation: none; }
  .raise-portrait::before, .raise-spotlight::after { display: none; animation: none; }
}

/* Hand history is accessible from the lobby as well as the table. */
body dialog.history-modal { inset: 0; width: min(780px, calc(100vw - 24px)); height: auto; max-width: none; max-height: calc(100dvh - 24px); padding: 0; margin: auto; border: 0; border-radius: 18px; background: #10281f; overflow: auto; }
body dialog.history-modal:not([open]) { display: none; }
body dialog.history-modal[open] { display: block; }
.history-modal::backdrop, .replay-dialog::backdrop { background: #020d0bbd; backdrop-filter: blur(6px); }
body .history-modal .history-card { width: 100%; max-height: none; box-sizing: border-box; border: 1px solid #d0ad635e; }
body .history-list { max-height: 58dvh; min-height: 0; }
body .history-entry { flex: 0 0 auto; cursor: default; }
.history-retention { font-size: 12px; color: #b3c2b6; margin: 0; }
.history-entry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body .history-entry-actions button, body .replay-latest-link { min-height: 44px; padding: 9px 14px; border-radius: 9px; border: 1px solid #d7b96e65; color: #eed7a1; background: #173d2d; font: 500 13px/1.4 system-ui; cursor: pointer; }
body .replay-latest-link { margin: 6px 0 10px; }
body .history-close { width: 44px; height: 44px; flex-shrink: 0; }
body .replay-dialog { width: min(850px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 24px; margin: auto; box-sizing: border-box; overflow: auto; overscroll-behavior: contain; border: 1px solid #d0ad635e; border-radius: 20px; background: radial-gradient(ellipse at top right, #244933, transparent 65%), #10281f; color: var(--text-strong); font: 14px/1.5 system-ui; }
.replay-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.replay-heading .eyebrow { font-size: 10px; color: #c6b583; letter-spacing: .15em; }
.replay-heading h2 { margin: 9px 0 0; color: #f0dcae; font: 500 30px/1.3 var(--font-title); }
body .replay-close { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #b4c5b32e; border-radius: 50%; background: #09271d; color: #ece5ce; font-size: 26px; cursor: pointer; }
.replay-note { color: #b7c7b9; font-size: 12px; margin: 14px 0; line-height: 1.7; }
.replay-streets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
body .replay-streets button { min-height: 44px; padding: 9px 16px; border: 1px solid #b4c5b32e; border-radius: 9px; color: #b6c8b9; background: #0d211a; font: 13px system-ui; cursor: pointer; }
body .replay-streets button[aria-pressed="true"] { color: #f5dc9e; border-color: #d7b96e70; background: #d7b96e14; }
.replay-felt { padding: 18px 12px 12px; border: 1px solid #b9aa6f52; border-radius: 18px; background: radial-gradient(ellipse, #245c44, #0d2e23); text-align: center; }
.replay-pot { color: #f0d89d; font: 500 18px/1.5 var(--font-num); }
.replay-board { display: flex; gap: 8px; justify-content: center; margin: 15px auto; }
body .replay-board .card { width: clamp(36px, 8vw, 60px); height: auto; aspect-ratio: 5 / 7; flex: 0 0 auto; transform: none; }
.replay-action { margin: 12px 0 0; min-height: 22px; color: #f0e9cf; font-size: 13px; overflow-wrap: anywhere; }
.replay-controls { margin: 14px 0 18px; }
.replay-transport { display: flex; gap: 8px; justify-content: center; }
body .replay-transport button { min-height: 44px; min-width: 44px; padding: 10px 14px; border-radius: 9px; border: 1px solid #b4c5b33c; background: #173b2b; color: #f0dcab; cursor: pointer; font: 14px system-ui; }
body .replay-transport button[data-step="play"] { min-width: 112px; color: #1c2d21; background: #dfc28b; }
body .replay-dialog button:disabled { opacity: .4; cursor: default; }
.replay-scrubber { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
body .replay-scrubber input { flex: 1; min-width: 0; height: 30px; accent-color: #dfc28b; }
.replay-count { min-width: 54px; text-align: right; color: #b7c7b9; font: 12px var(--font-num); }
.replay-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.replay-player { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 15px; border: 1px solid #b4c5b32e; border-radius: 12px; background: #091f18aa; min-width: 0; }
.replay-player.is-actor { border-color: #e4c476; background: #d2b56814; }
.replay-player.is-folded { border-style: dashed; }
.replay-player h3 { font-size: 14px; margin: 0; overflow-wrap: anywhere; color: #e9e8d7; }
.replay-player p { margin: 0; font-size: 12px; color: #c6d0bf; overflow-wrap: anywhere; }
.replay-player small { font-size: 11px; color: #b0c2b5; }
.replay-player b { font: 600 14px var(--font-num); }
.replay-player > :not(.replay-hole) { grid-column: 1; }
.replay-hole { grid-column: 2; grid-row: 1 / span 4; display: flex; gap: 5px; align-items: center; }
body .replay-hole .card { width: 30px; height: 42px; flex: 0 0 auto; transform: none; }
.replay-awards:not(:empty) { margin-top: 16px; }
body .replay-done { width: 100%; min-height: 44px; margin-top: 18px; border: 1px solid #b4c5b33c; border-radius: 9px; color: #e3d6b5; background: #133325; cursor: pointer; font: 13px system-ui; }
@media (max-width: 600px) {
  body .replay-dialog { padding: 18px 14px; border-radius: 16px; }
  .replay-players { grid-template-columns: minmax(0, 1fr); }
  body .replay-streets button { padding: 9px 12px; }
  .replay-transport { gap: 5px; }
  body .replay-transport button { padding: 10px 8px; }
  body .replay-transport button[data-step="play"] { min-width: 94px; }
  .replay-board { gap: 6px; }
  body .history-entry-winner { white-space: normal; }
}
.replay-awards .result-pot-ledger { display: grid; gap: 8px; padding: 14px; border: 1px solid #d4b57555; border-radius: 12px; background: #0c241b; }
.replay-awards .result-pot-line { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12px; }
.replay-awards .result-pot-name, .replay-awards .result-pot-line b { color: #ecd298; }
.replay-awards .result-pot-recipients { overflow-wrap: anywhere; min-width: 0; }
body #app .replay-hole .card { width: 36px; height: 50px; }
@media (max-width: 600px) {
  .replay-awards .result-pot-line { grid-template-columns: auto 1fr; }
  .replay-awards .result-pot-recipients { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .replay-transport { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 6px; }
  body .replay-transport button[data-step="play"] { grid-column: 1 / -1; grid-row: 1; }
  .replay-transport button:not([data-step="play"]) { grid-row: 2; }
}

/* Short viewports trade spare spacing for readable cards and persistent actions. */
body #handResult .hand-result-header h3 { color: #f0dfb7; }
body #handResult[data-detail="true"] .result-name { white-space: normal; overflow-wrap: anywhere; }
@media (max-height: 700px) {
  body #handResult #resultViewToggle { min-height: 32px; }
  body #handResult .session-result { padding: 3px 0; }
  body #handResult .session-result strong { font-size: 18px; line-height: 1.2; }
  body #handResult .self-result-summary .result-info { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px; }
  body #handResult .self-result-summary .result-avatar { grid-row: 1; width: 24px; height: 24px; }
  body #handResult .self-result-summary .result-rank { grid-column: 3; grid-row: 1; }
  body #handResult .self-result-summary .result-delta { grid-column: 2 / -1; grid-row: 2; }
  body #handResult .self-result-summary .result-cards-wrap { max-width: 224px; }
  body #handResult .self-result-summary .result-row { padding: 5px 7px; gap: 4px; }
}
@media (min-width: 651px) and (max-height: 500px) {
  body #handResult[data-players="many"] #handResultBody { gap: 4px; }
  body #handResult[data-players="many"] #handResultBody .result-row { padding: 2px 5px; }
}
body #handResult .result-row.folded { opacity: .8; }
@media (min-width: 651px) and (max-height: 500px) {
  body #handResult .hand-result-header { padding-bottom: 2px; }
}
