:root {
  color-scheme: dark;
  --bg: #090a0a;
  --bg-soft: #101111;
  --surface: #151716;
  --surface-raised: #1c1e1d;
  --surface-strong: #252725;
  --felt: #102e28;
  --felt-deep: #081d19;
  --felt-edge: #7b252a;
  --text: #f1eee7;
  --text-soft: #cac7bf;
  --muted: #8d8d87;
  --divider: #2b2e2c;
  --divider-strong: #414441;
  --accent: #c9363d;
  --accent-ink: #fff4ed;
  --success: #75a493;
  --warning: #c8a65e;
  --danger: #dc4b50;
  --card: #f2eee5;
  --card-ink: #151616;
  --red-suit: #c7373e;
  --shadow: rgba(0, 0, 0, 0.48);
  --radius: 14px;
  --radius-small: 10px;
  --font-ui: "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", "Roboto Mono", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 48% -18%, rgba(122, 35, 40, 0.12), transparent 36rem),
    linear-gradient(145deg, #090a0a, #121313 54%, #090a0a);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  min-height: 68px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(195, 56, 63, 0.2);
  background: rgba(9, 10, 10, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-lockup {
  display: grid;
  gap: 2px;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block .brand-wordmark {
  display: flex;
  overflow: hidden;
  align-items: center;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.075em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-wordmark em {
  margin-left: 1px;
  color: var(--accent);
  font-size: 13px;
  font-style: normal;
  letter-spacing: -0.035em;
}

.brand-chip {
  position: relative;
  display: inline-block;
  width: 19px;
  height: 19px;
  margin: 0 2px 0 3px;
  flex: 0 0 auto;
  border: 1px solid rgba(232, 244, 238, 0.78);
  border-radius: 50%;
  background:
    radial-gradient(circle, #12231f 0 28%, transparent 30%),
    repeating-conic-gradient(from 7deg, #c9363d 0 15deg, #303231 15deg 30deg);
  box-shadow: 0 0 0 2px rgba(201, 54, 61, 0.13), inset 0 0 0 3px #202322;
}

.brand-chip::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 54, 61, 0.82);
  border-radius: 50%;
}

.brand-lockup > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.session-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  min-width: 420px;
  border-right: 1px solid var(--divider);
  border-left: 1px solid var(--divider);
}

.session-metrics > div {
  padding: 0 16px;
}

.session-metrics span,
.session-metrics strong {
  display: block;
}

.session-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.session-metrics strong {
  margin-top: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  padding: 3px;
  border: 1px solid rgba(132, 154, 146, 0.22);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 7px 20px rgba(1, 10, 8, 0.16);
}

.ghost-button,
.icon-button,
.modal-close,
.primary-button {
  min-height: 42px;
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.ghost-button,
.icon-button,
.modal-close {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
}

.ghost-button:hover,
.icon-button:hover,
.modal-close:hover {
  border-color: rgba(150, 171, 163, 0.32);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 4px 12px rgba(0, 10, 8, 0.15);
  transform: translateY(-1px);
}

.ghost-button {
  padding: 0 14px;
  border-color: rgba(150, 171, 163, 0.24);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 650;
}

.icon-button,
.modal-close {
  padding: 0 12px;
}

.topbar-actions .ghost-button,
.topbar-actions .icon-button {
  min-height: 38px;
  font-size: 12px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-actions .icon-button[aria-pressed="true"] {
  border-color: rgba(201, 54, 61, 0.34);
  background: rgba(201, 54, 61, 0.1);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 224, 219, 0.08);
}

.topbar-actions .ghost-button:active,
.topbar-actions .icon-button:active {
  box-shadow: inset 0 1px 4px rgba(0, 9, 7, 0.2);
  transform: translateY(0) scale(0.975);
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 760;
}

.primary-button:hover {
  background: #db4a51;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 340px;
  gap: 0;
  width: 100%;
  min-height: calc(100dvh - 68px);
}

.play-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--divider);
}

.context-strip {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--divider);
  background: rgba(11, 21, 20, 0.76);
}

.context-strip > div:first-child {
  min-width: 180px;
}

.context-strip > div:first-child span,
.context-strip > div:first-child strong {
  display: block;
}

.context-strip > div:first-child span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.context-strip > div:first-child strong {
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-strip dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, auto));
  gap: 20px;
  margin: 0;
}

.context-strip dl > div {
  min-width: 0;
}

.context-strip dt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.context-strip dd {
  margin: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.table-stage {
  position: relative;
  display: grid;
  min-height: clamp(600px, calc(100dvh - 104px), 720px);
  flex: 1;
  place-items: center;
  overflow: visible;
  padding: 94px 45px 96px;
  isolation: isolate;
}

.table-ambient {
  position: absolute;
  inset: 16% 9% 10%;
  z-index: -1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(30, 92, 77, 0.2), rgba(5, 19, 16, 0.04) 62%, transparent 73%);
  filter: blur(38px);
}

.poker-table {
  position: relative;
  container-type: inline-size;
  width: min(100%, 990px);
  min-width: min(520px, 100%);
  aspect-ratio: 2 / 1;
  border: 8px solid #151716;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 41%, rgba(83, 105, 96, 0.1), transparent 43%),
    radial-gradient(ellipse at 52% 58%, rgba(0, 0, 0, 0.27), transparent 68%),
    linear-gradient(148deg, #18231f 0%, #111a17 48%, #0b1210 100%);
  box-shadow:
    0 0 0 1px rgba(224, 221, 211, 0.24),
    0 0 0 10px #282b29,
    0 0 0 12px #792329,
    0 0 0 16px rgba(7, 8, 8, 0.98),
    0 29px 74px rgba(0, 0, 0, 0.42),
    inset 0 0 72px rgba(0, 0, 0, 0.34),
    inset 0 2px 0 rgba(226, 225, 217, 0.12);
}

.poker-table::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 2;
  width: 124px;
  height: calc(22.5% + 12px);
  border: 0;
  border-radius: 0 0 62px 62px;
  background:
    linear-gradient(#121b18, #121b18) center bottom / 100% 4px no-repeat,
    radial-gradient(ellipse at 50% 18%, rgba(111, 116, 108, 0.14), transparent 48%) center top / 100% 58px no-repeat,
    linear-gradient(180deg, #080909 0%, #121413 72%, #1b1e1c 100%) center top / 100% 58px no-repeat;
  transform: translateX(-50%);
  pointer-events: none;
}

.poker-table::after {
  content: "";
  position: absolute;
  inset: 22.5% 15.5%;
  z-index: 2;
  border: 1px solid rgba(237, 232, 220, 0.3);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 0 24px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.is-depth-mode .table-stage {
  perspective: 1180px;
  perspective-origin: 50% 43%;
}

.is-depth-mode .poker-table {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 170ms cubic-bezier(0.22, 0.72, 0.28, 1), box-shadow 220ms ease;
  will-change: transform;
}

.is-depth-mode .poker-table::after { transform: translateZ(3px); }
.is-depth-mode .felt-grain { transform: translateZ(1px); }
.is-depth-mode .card-layer { transform: translateZ(24px); }
.is-depth-mode .stack-layer { transform: translateZ(30px); }
.is-depth-mode .wager-layer { transform: translateZ(34px); }
.is-depth-mode .marker-layer { transform: translateZ(39px); }
.is-depth-mode .seat-layer { transform: translateZ(43px); }
.is-depth-mode .dealer-station { transform: translateZ(48px); }
.is-depth-mode .table-center { transform: translate(-50%, -50%) translateZ(29px); }

.is-depth-mode .seat-layer,
.is-depth-mode .card-layer,
.is-depth-mode .stack-layer,
.is-depth-mode .wager-layer,
.is-depth-mode .marker-layer,
.is-depth-mode .dealer-station,
.is-depth-mode .table-center {
  transform-style: preserve-3d;
}

.felt-grain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  opacity: 0.12;
  background-image:
    repeating-linear-gradient(24deg, transparent 0, transparent 3px, rgba(255, 255, 255, 0.028) 4px),
    repeating-linear-gradient(114deg, transparent 0, transparent 6px, rgba(0, 0, 0, 0.045) 7px);
  pointer-events: none;
}

.seat-layer,
.card-layer {
  position: absolute;
  inset: 0;
}

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

.card-layer {
  z-index: 3;
  pointer-events: none;
}

.marker-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.stack-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.player-chip-rack {
  position: absolute;
  display: flex;
  min-width: 42px;
  max-width: none;
  min-height: 22px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
  transform: translate(-50%, -50%) rotate(var(--rack-rotation, 0deg));
  transform-origin: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.player-chip-rack .chip-pile {
  flex: 0 0 14px;
  width: 14px;
  height: calc(7px + (var(--chip-count) - 1) * 3.7px);
  transform: translateY(clamp(0px, var(--scatter-y, 0), 2px)) rotate(calc(var(--pile-tilt, 0deg) - var(--rack-rotation, 0deg)));
}

.player-chip-rack .chip-token {
  bottom: calc(var(--chip-index) * 3.7px);
  width: 14px;
  height: 7px;
  border-width: 1px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.34), inset 0 -1px 0 rgba(0, 0, 0, 0.28);
}

.player-chip-rack .chip-token:last-child::after {
  font-size: 4.5px;
}

.player-chip-rack[data-seat="0"] { top: 95.7%; left: 50%; }
.player-chip-rack[data-seat="1"] { top: 95.7%; left: 24.3%; }
.player-chip-rack[data-seat="2"] { top: 80%; left: 4.3%; }
.player-chip-rack[data-seat="3"] { top: 20%; left: 4.3%; }
.player-chip-rack[data-seat="4"] { top: 4.3%; left: 24.3%; }
.player-chip-rack[data-seat="5"] { top: 8%; left: 50%; }
.player-chip-rack[data-seat="6"] { top: 4.3%; left: 75.7%; }
.player-chip-rack[data-seat="7"] { top: 20%; left: 95.7%; }
.player-chip-rack[data-seat="8"] { top: 80%; left: 95.7%; }
.player-chip-rack[data-seat="9"] { top: 95.7%; left: 75.7%; }

.table-marker {
  position: absolute;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: #e7e3d9;
  box-shadow: 0 6px 14px rgba(0, 10, 8, 0.38), inset 0 0 0 2px rgba(18, 29, 26, 0.12);
  color: #17201e;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.table-marker small {
  display: none;
}

.table-marker:not(.is-button) {
  display: none;
}

.table-marker.is-button {
  width: 26px;
  height: 26px;
  border-color: rgba(255, 255, 255, 0.88);
  background: #eeeade;
  box-shadow: 0 6px 14px rgba(0, 10, 8, 0.34), inset 0 0 0 2px #c9c4b7;
  color: #171b19;
  font-size: 11px;
}

/* The button shares each seat's wager radius, with only a small tangential offset. */
.table-marker[data-seat="0"] { top: 66%; left: calc(50% + 3.4cqw); }
.table-marker[data-seat="1"] { top: 66%; left: calc(24.3% + 3.4cqw); }
.table-marker[data-seat="2"] { top: 60%; left: 25%; }
.table-marker[data-seat="3"] { top: 40%; left: 25%; }
.table-marker[data-seat="4"] { top: 34%; left: calc(24.3% + 3.4cqw); }
.table-marker[data-seat="5"] { top: 34%; left: calc(50% + 3.4cqw); }
.table-marker[data-seat="6"] { top: 34%; right: auto; left: calc(75.7% - 3.4cqw); }
.table-marker[data-seat="7"] { top: 40%; right: auto; left: 75%; }
.table-marker[data-seat="8"] { top: 60%; right: auto; bottom: auto; left: 75%; }
.table-marker[data-seat="9"] { top: 66%; right: auto; bottom: auto; left: calc(75.7% - 3.4cqw); }

.seat {
  position: absolute;
  z-index: 5;
  display: grid;
  width: 54px;
  height: 54px;
  min-height: 0;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), filter 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.seat:hover {
  background: transparent;
}

.seat:hover .avatar {
  transform: translateY(-2px) scale(1.045);
}

.seat.is-acting {
  box-shadow: none;
}

.seat.is-acting .avatar {
  border-color: rgba(229, 95, 101, 0.98);
  box-shadow:
    0 0 0 3px rgba(201, 54, 61, 0.17),
    0 0 23px rgba(201, 54, 61, 0.34),
    0 10px 25px rgba(0, 12, 9, 0.48);
}

.seat.is-acting::after {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border: 2px solid rgba(221, 71, 78, 0.88);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(201, 54, 61, 0.28);
  pointer-events: none;
  animation: thinking-ring 1.35s ease-in-out infinite;
}

.seat.is-winner::before {
  content: "";
  position: absolute;
  inset: -8px;
  z-index: 7;
  border: 3px solid rgba(255, 222, 93, 0.96);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 222, 93, 0.72), 0 0 34px rgba(255, 222, 93, 0.58);
  pointer-events: none;
  animation: winner-ring 620ms ease-out 2;
}

.seat.is-folded {
  opacity: 0.7;
  filter: grayscale(0.5) saturate(0.64);
}

.seat.is-allin {
  box-shadow: none;
}

.seat.is-allin .avatar {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(240, 177, 91, 0.17), 0 10px 25px rgba(0, 12, 9, 0.48);
}

.seat.is-hero {
  width: 54px;
  height: 54px;
  min-height: 0;
  margin: 0;
  background: transparent;
}

.seat-number {
  position: absolute;
  right: -3px;
  bottom: -3px;
  z-index: 9;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid rgba(233, 241, 237, 0.78);
  border-radius: 50%;
  background: #152421;
  box-shadow: 0 3px 9px rgba(0, 8, 6, 0.44);
  color: #f1eee7;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
}

/* Read labels stay on the room side of the portrait orbit, never over the felt. */
.player-read-tag {
  position: absolute;
  z-index: 8;
  max-width: 82px;
  min-height: 17px;
  overflow: hidden;
  padding: 3px 7px 2px;
  border: 1px solid rgba(198, 215, 207, 0.22);
  border-radius: 999px;
  background: rgba(10, 24, 21, 0.92);
  box-shadow: 0 5px 13px rgba(0, 13, 10, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #d8e2dd;
  font-size: 8px;
  font-weight: 680;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.seat[data-seat="0"] .player-read-tag {
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
}

.seat[data-seat="1"] .player-read-tag,
.seat[data-seat="4"] .player-read-tag {
  top: 50%;
  right: calc(100% + 6px);
  transform: translateY(-50%);
}

.seat[data-seat="2"] .player-read-tag,
.seat[data-seat="8"] .player-read-tag {
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
}

.seat[data-seat="3"] .player-read-tag,
.seat[data-seat="7"] .player-read-tag {
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
}

.seat[data-seat="6"] .player-read-tag,
.seat[data-seat="9"] .player-read-tag {
  top: 50%;
  left: calc(100% + 6px);
  transform: translateY(-50%);
}

.seat[data-seat="0"] .seat-number { right: -4px; bottom: 1px; }
.seat[data-seat="1"] .seat-number { right: 0; bottom: -2px; left: auto; }
.seat[data-seat="2"] .seat-number { right: 0; bottom: -4px; }
.seat[data-seat="3"] .seat-number { top: -4px; right: 0; bottom: auto; }
.seat[data-seat="4"] .seat-number { top: auto; right: -2px; bottom: 0; }
.seat[data-seat="6"] .seat-number { right: auto; bottom: 0; left: -2px; }
.seat[data-seat="7"] .seat-number { top: -4px; right: auto; bottom: auto; left: 0; }
.seat[data-seat="8"] .seat-number { right: auto; bottom: -4px; left: 0; }
.seat[data-seat="9"] .seat-number { right: auto; bottom: -2px; left: 0; }

.seat[data-seat="0"] {
  top: calc(100% + 65px);
  left: 50%;
}

.seat[data-seat="1"] {
  top: calc(100% + 65px);
  left: 24.3%;
}

.seat[data-seat="2"] {
  top: 80%;
  left: -24px;
}

.seat[data-seat="3"] {
  top: 20%;
  left: -24px;
}

.seat[data-seat="4"] {
  top: -65px;
  left: 24.3%;
}

.seat[data-seat="5"] {
  top: -33px;
  left: 50%;
}

.seat[data-seat="6"] {
  top: -65px;
  right: auto;
  left: 75.7%;
}

.seat[data-seat="7"] {
  top: 20%;
  right: auto;
  left: calc(100% + 24px);
}

.seat[data-seat="8"] {
  right: auto;
  top: 80%;
  bottom: auto;
  left: calc(100% + 24px);
}

.seat[data-seat="9"] {
  right: auto;
  top: calc(100% + 65px);
  bottom: auto;
  left: 75.7%;
}

.avatar {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid rgba(219, 231, 225, 0.68);
  border-radius: 50%;
  background: var(--avatar-bg, #2c4440);
  color: #eef4ef;
  font-family: var(--font-mono);
  box-shadow: 0 11px 24px rgba(0, 18, 14, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.11);
  font-size: 11px;
  font-weight: 750;
  overflow: hidden;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-photo {
  border-color: rgba(214, 224, 219, 0.72);
  background-image: url("./assets/opponent-avatar-atlas.png");
  background-repeat: no-repeat;
  background-size: 300% 300%;
  filter: saturate(0.88) contrast(1.05);
}

.avatar-atlas { background-position: 0 0; }
.avatar-viper { background-position: 50% 0; }
.avatar-stone { background-position: 100% 0; }
.avatar-forge { background-position: 0 50%; }
.avatar-glacier { background-position: 50% 50%; }
.avatar-comet { background-position: 100% 50%; }
.avatar-mirage { background-position: 0 100%; }
.avatar-rookie-mask { background-position: 50% 100%; }
.avatar-ghost { background-position: 100% 100%; }

.is-hero .avatar {
  width: 54px;
  height: 54px;
  border-color: rgba(210, 69, 76, 0.78);
  background:
    radial-gradient(circle at 50% 34%, rgba(201, 54, 61, 0.16), transparent 42%),
    #202322;
  box-shadow: 0 0 0 3px rgba(201, 54, 61, 0.09), 0 11px 29px rgba(0, 0, 0, 0.48);
  color: var(--accent);
}

.seat-main,
.seat-name-row,
.seat-stack-row,
.seat-name,
.seat-position,
.seat-stack,
.seat-action,
.seat-cards,
.dealer-button {
  display: none !important;
}

.seat-chip-rack {
  display: flex;
  min-height: 23px;
  align-items: flex-end;
  gap: 2px;
}

.seat-chip-rack .chip-pile {
  width: 13px;
  height: calc(5px + (var(--chip-count) - 1) * 2px);
}

.seat-chip-rack .chip-token {
  bottom: calc(var(--chip-index) * 2px);
  width: 13px;
  height: 5px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.26);
}

.seat-chip-rack .chip-token:last-child::after {
  inset: 0;
  min-width: 0;
  height: auto;
  border: 0;
  box-shadow: none;
  font-size: 3.8px;
}

.seat-chip-rack .pot-chip-empty {
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 7px;
}

.seat-action {
  overflow: hidden;
  max-width: 68px;
  color: var(--accent);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wager-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.wager-chip-rack {
  position: absolute;
  display: flex;
  min-width: 25px;
  min-height: 27px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  transform: translate(-50%, -50%) rotate(var(--rack-rotation, 0deg));
  transform-origin: center bottom;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.wager-chip-rack .chip-pile {
  width: 16px;
  height: calc(7px + (var(--chip-count) - 1) * 3px);
  transform: rotate(calc(0deg - var(--rack-rotation, 0deg)));
}

.wager-chip-rack .chip-token {
  bottom: calc(var(--chip-index) * 3px);
  width: 16px;
  height: 7px;
  border-width: 1px;
}

.wager-chip-rack .chip-token:last-child::after {
  inset: 0;
  min-width: 0;
  height: auto;
  border: 0;
  box-shadow: none;
  font-size: 4.8px;
}

.wager-chip-rack[data-seat="0"] { top: 66%; left: 50%; --sweep-x: 0cqw; --sweep-y: -12.5cqw; }
.wager-chip-rack[data-seat="1"] { top: 66%; left: 24.3%; --sweep-x: 25.7cqw; --sweep-y: -12.5cqw; }
.wager-chip-rack[data-seat="2"] { top: 65%; left: 25%; --sweep-x: 25cqw; --sweep-y: -12cqw; }
.wager-chip-rack[data-seat="3"] { top: 35%; left: 25%; --sweep-x: 25cqw; --sweep-y: 3cqw; }
.wager-chip-rack[data-seat="4"] { top: 34%; left: 24.3%; --sweep-x: 25.7cqw; --sweep-y: 3.5cqw; }
.wager-chip-rack[data-seat="5"] { top: 25%; left: 50%; --sweep-x: 0cqw; --sweep-y: 25cqw; }
.wager-chip-rack[data-seat="6"] { top: 34%; right: auto; left: 75.7%; --sweep-x: -25.7cqw; --sweep-y: 3.5cqw; }
.wager-chip-rack[data-seat="7"] { top: 35%; right: auto; left: 75%; --sweep-x: -25cqw; --sweep-y: 3cqw; }
.wager-chip-rack[data-seat="8"] { top: 65%; right: auto; bottom: auto; left: 75%; --sweep-x: -25cqw; --sweep-y: -12cqw; }
.wager-chip-rack[data-seat="9"] { top: 66%; right: auto; bottom: auto; left: 75.7%; --sweep-x: -25.7cqw; --sweep-y: -12.5cqw; }

.poker-table.is-sweeping .wager-chip-rack,
.poker-table.is-dealer-sweeping .wager-chip-rack {
  animation: sweep-to-pot 460ms cubic-bezier(0.58, 0.02, 0.35, 1) both;
}

.poker-table.is-sweeping .pot-display,
.poker-table.is-dealer-sweeping .pot-display {
  animation: pot-receive 460ms ease-out both;
}

.card-layer .hole-card-pair,
.card-layer .player-hole-cards,
.card-layer .table-hole-cards {
  position: absolute;
  display: flex;
  align-items: flex-start;
  transform: translate(-50%, -50%) rotate(var(--card-rotation, 0deg));
  transform-origin: center;
}

.mini-card {
  position: relative;
  display: block;
  width: 42px;
  height: 60px;
  overflow: hidden;
  border: 1px solid rgba(218, 232, 226, 0.68);
  border-radius: 6px;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0 23%, rgba(203, 226, 218, 0.16) 24% 27%, transparent 28%),
    repeating-linear-gradient(45deg, rgba(221, 235, 230, 0.095) 0 1px, transparent 1px 4px),
    #16382f;
  box-shadow: 0 4px 10px rgba(0, 15, 11, 0.3), inset 0 0 0 1px rgba(3, 20, 16, 0.28);
  color: var(--card-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 850;
  line-height: 0.9;
}

.mini-card + .mini-card {
  margin-left: 6px;
  transform: none;
}

.mini-card.is-face {
  background: #f2efe7;
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 10px rgba(0, 15, 11, 0.28), inset 0 0 0 1px rgba(81, 76, 65, 0.08);
}

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

.hole-card-pair[data-seat="0"],
.player-hole-cards[data-seat="0"],
.table-hole-cards[data-seat="0"] { top: 85.7%; left: 50%; }
.hole-card-pair[data-seat="1"],
.player-hole-cards[data-seat="1"],
.table-hole-cards[data-seat="1"] { top: 85.6%; left: 24.3%; }
.hole-card-pair[data-seat="2"],
.player-hole-cards[data-seat="2"],
.table-hole-cards[data-seat="2"] { top: 80%; left: 11.5%; }
.hole-card-pair[data-seat="3"],
.player-hole-cards[data-seat="3"],
.table-hole-cards[data-seat="3"] { top: 20%; left: 11.5%; }
.hole-card-pair[data-seat="4"],
.player-hole-cards[data-seat="4"],
.table-hole-cards[data-seat="4"] { top: 14.4%; left: 24.3%; }
.hole-card-pair[data-seat="5"],
.player-hole-cards[data-seat="5"],
.table-hole-cards[data-seat="5"] { top: 13%; left: 50%; }
.hole-card-pair[data-seat="6"],
.player-hole-cards[data-seat="6"],
.table-hole-cards[data-seat="6"] { top: 14.4%; left: 75.7%; }
.hole-card-pair[data-seat="7"],
.player-hole-cards[data-seat="7"],
.table-hole-cards[data-seat="7"] { top: 20%; left: 88.5%; }
.hole-card-pair[data-seat="8"],
.player-hole-cards[data-seat="8"],
.table-hole-cards[data-seat="8"] { top: 80%; left: 88.5%; }
.hole-card-pair[data-seat="9"],
.player-hole-cards[data-seat="9"],
.table-hole-cards[data-seat="9"] { top: 85.6%; left: 75.7%; }

.hole-card-pair[data-seat="0"] { --card-rotation: 0deg; }
.hole-card-pair[data-seat="1"] { --card-rotation: 0deg; }
.hole-card-pair[data-seat="2"] { --card-rotation: -90deg; }
.hole-card-pair[data-seat="3"] { --card-rotation: -90deg; }
.hole-card-pair[data-seat="4"] { --card-rotation: 180deg; }
.hole-card-pair[data-seat="6"] { --card-rotation: 180deg; }
.hole-card-pair[data-seat="7"] { --card-rotation: 90deg; }
.hole-card-pair[data-seat="8"] { --card-rotation: 90deg; }
.hole-card-pair[data-seat="9"] { --card-rotation: 0deg; }

.player-chip-rack[data-seat="0"], .wager-chip-rack[data-seat="0"] { --rack-rotation: 0deg; }
.player-chip-rack[data-seat="1"], .wager-chip-rack[data-seat="1"] { --rack-rotation: 0deg; }
.player-chip-rack[data-seat="2"], .wager-chip-rack[data-seat="2"] { --rack-rotation: -90deg; }
.player-chip-rack[data-seat="3"], .wager-chip-rack[data-seat="3"] { --rack-rotation: -90deg; }
.player-chip-rack[data-seat="4"], .wager-chip-rack[data-seat="4"] { --rack-rotation: 180deg; }
.player-chip-rack[data-seat="6"], .wager-chip-rack[data-seat="6"] { --rack-rotation: 180deg; }
.player-chip-rack[data-seat="7"], .wager-chip-rack[data-seat="7"] { --rack-rotation: 90deg; }
.player-chip-rack[data-seat="8"], .wager-chip-rack[data-seat="8"] { --rack-rotation: 90deg; }
.player-chip-rack[data-seat="9"], .wager-chip-rack[data-seat="9"] { --rack-rotation: 0deg; }

.dealer-station {
  position: absolute;
  top: -45px;
  left: 50%;
  z-index: 6;
  width: 82px;
  height: 82px;
  margin-left: -41px;
  pointer-events: none;
}

.dealer-station::before {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -24px;
  z-index: 4;
  width: 23px;
  height: 33px;
  border: 2px solid #ece8dd;
  border-radius: 4px;
  background:
    repeating-linear-gradient(45deg, rgba(230, 241, 235, 0.22) 0 2px, transparent 2px 5px),
    #173f37;
  box-shadow: 0 5px 12px rgba(0, 8, 6, 0.4);
  transform: rotate(17deg);
}

.dealer-avatar {
  position: relative;
  z-index: 2;
  display: block;
  width: 80px;
  height: 80px;
  border: 3px solid rgba(224, 219, 209, 0.78);
  border-radius: 50%;
  background-color: #171918;
  background-image: url("./assets/dealer-zhang-jiawen-original.jpg");
  background-position: 47.5% 32.2%;
  background-repeat: no-repeat;
  background-size: 280%;
  box-shadow:
    0 0 0 6px rgba(8, 9, 9, 0.82),
    0 13px 28px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.dealer-chip-tray {
  position: absolute;
  top: 86px;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 132px;
  height: 29px;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 4px 5px 5px;
  border: 1px solid rgba(225, 220, 209, 0.24);
  border-radius: 7px 7px 12px 12px;
  background: linear-gradient(180deg, #080909, #202321);
  box-shadow:
    0 6px 13px rgba(0, 0, 0, 0.36),
    inset 0 5px 8px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055);
  transform: translateX(-50%);
}

.dealer-chip-tray i {
  --tray-chip: #b63239;
  display: block;
  min-width: 0;
  border-radius: 2px 2px 6px 6px;
  background:
    repeating-linear-gradient(0deg, var(--tray-chip) 0 2px, rgba(239, 232, 218, 0.78) 2px 3px, var(--tray-chip) 3px 5px) center bottom / 72% 14px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025), transparent 45%),
    #090a0a;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.92), inset 0 -1px 0 rgba(234, 229, 218, 0.06);
}

.dealer-chip-tray i:nth-child(1),
.dealer-chip-tray i:nth-child(2) { --tray-chip: #45464b; }
.dealer-chip-tray i:nth-child(3) { --tray-chip: #df6f9c; }
.dealer-chip-tray i:nth-child(4) { --tray-chip: #e5b72f; }
.dealer-chip-tray i:nth-child(5),
.dealer-chip-tray i:nth-child(6) { --tray-chip: #c82e73; }

.dealer-hand {
  position: absolute;
  top: 57px;
  left: 50%;
  z-index: 1;
  width: 17px;
  height: 72px;
  border: 1px solid rgba(91, 48, 28, 0.34);
  border-radius: 48% 48% 58% 58%;
  background: linear-gradient(90deg, #824f34 0%, #bb7a55 42%, #8e5638 100%);
  box-shadow: 0 7px 13px rgba(0, 8, 6, 0.3);
  opacity: 0;
  transform: translate(-50%, -10px) rotate(5deg) scaleY(0.72);
  transform-origin: 50% 0;
}

.dealer-hand::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -3px;
  width: 28px;
  height: 18px;
  border-radius: 60% 42% 58% 45%;
  background: linear-gradient(145deg, #bd805a, #8c5234);
  box-shadow: inset 0 -2px 0 rgba(80, 40, 24, 0.22);
  transform: rotate(-12deg);
}

.poker-table.is-sweeping .dealer-hand,
.poker-table.is-dealer-sweeping .dealer-hand,
.dealer-station.is-sweeping .dealer-hand {
  animation: dealer-sweep 560ms cubic-bezier(0.45, 0, 0.25, 1) both;
}

.poker-table[data-pot-push-seat="0"] { --dealer-push-x: 0cqw; --dealer-push-y: 15cqw; }
.poker-table[data-pot-push-seat="1"] { --dealer-push-x: -8cqw; --dealer-push-y: 13cqw; }
.poker-table[data-pot-push-seat="2"] { --dealer-push-x: -13cqw; --dealer-push-y: 10cqw; }
.poker-table[data-pot-push-seat="3"] { --dealer-push-x: -14cqw; --dealer-push-y: 7cqw; }
.poker-table[data-pot-push-seat="4"] { --dealer-push-x: -10cqw; --dealer-push-y: 4cqw; }
.poker-table[data-pot-push-seat="5"] { --dealer-push-x: 0cqw; --dealer-push-y: 3cqw; }
.poker-table[data-pot-push-seat="6"] { --dealer-push-x: 10cqw; --dealer-push-y: 4cqw; }
.poker-table[data-pot-push-seat="7"] { --dealer-push-x: 14cqw; --dealer-push-y: 7cqw; }
.poker-table[data-pot-push-seat="8"] { --dealer-push-x: 13cqw; --dealer-push-y: 10cqw; }
.poker-table[data-pot-push-seat="9"] { --dealer-push-x: 8cqw; --dealer-push-y: 13cqw; }

.poker-table.is-pot-pushing .dealer-hand,
.dealer-station.is-pushing .dealer-hand {
  animation: dealer-push 580ms cubic-bezier(0.38, 0.02, 0.2, 1) both;
}

.poker-table.is-dealing .dealer-hand,
.dealer-station.is-dealing .dealer-hand {
  animation: dealer-deal-hand 430ms cubic-bezier(0.32, 0.02, 0.22, 1) both;
}

.poker-table.is-dealing .dealer-station::before,
.dealer-station.is-dealing::before {
  animation: dealer-card-flight 430ms cubic-bezier(0.2, 0.72, 0.3, 1) both;
}

.table-center {
  position: absolute;
  top: 47%;
  left: 50%;
  z-index: 2;
  display: flex;
  min-width: 330px;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
}

.street-label {
  display: none !important;
}

.board {
  display: flex;
  min-height: 71px;
  gap: 6px;
  align-items: center;
}

.playing-card {
  position: relative;
  display: block;
  width: 50px;
  height: 70px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 7px 15px rgba(0, 14, 11, 0.34);
  color: var(--card-ink);
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  transform-origin: center;
}

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

.playing-card .suit-large {
  position: absolute;
  top: 50%;
  left: 50%;
  font-family: Georgia, serif;
  font-size: 24px;
  transform: translate(-50%, -50%);
}

.card-corner {
  position: absolute;
  z-index: 1;
  display: block;
  min-width: 12px;
  text-align: center;
}

.card-corner b,
.card-corner i {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 850;
  line-height: 0.9;
}

.card-corner i {
  margin-top: 1px;
  font-family: Georgia, serif;
  font-size: 0.86em;
}

.card-corner-top,
.playing-card .card-corner.is-top {
  top: 5px;
  left: 5px;
}

.card-corner-bottom,
.playing-card .card-corner.is-bottom {
  right: 5px;
  bottom: 5px;
  transform: rotate(180deg);
}

.card-center-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1;
  opacity: 0.88;
  transform: translate(-50%, -50%);
}

.mini-card .card-corner {
  min-width: 9px;
  font-size: 8px;
}

.mini-card .card-corner-top {
  top: 2px;
  left: 2px;
}

.mini-card .card-corner-bottom {
  right: 2px;
  bottom: 2px;
}

.mini-card .card-center-suit {
  font-size: 18px;
}

.mini-card-corner {
  position: absolute;
  z-index: 1;
  display: block;
  min-width: 9px;
  font-size: 8px;
  text-align: center;
}

.mini-card-corner b,
.mini-card-corner i {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 850;
  line-height: 0.88;
}

.mini-card-corner i {
  margin-top: 1px;
  font-family: Georgia, serif;
  font-size: 0.82em;
}

.mini-card-corner.is-top {
  top: 2px;
  left: 2px;
}

.mini-card-corner.is-bottom {
  right: 2px;
  bottom: 2px;
  transform: rotate(180deg);
}

.mini-card-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1;
  opacity: 0.88;
  transform: translate(-50%, -50%);
}

.card-slot {
  width: 50px;
  height: 70px;
  border: 1px dashed rgba(225, 239, 232, 0.15);
  border-radius: 8px;
  background: rgba(0, 15, 12, 0.08);
}

.pot-display {
  position: relative;
  display: flex;
  min-width: 190px;
  min-height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  order: -1;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transform: translate3d(0, 0, 0);
  transform-origin: center;
}

.pot-display > span:not(.pot-chip-rack),
.pot-display > strong,
.pot-display > small {
  display: none !important;
}

.pot-chip-rack {
  display: flex;
  min-height: 36px;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.chip-pile {
  position: relative;
  display: block;
  width: 27px;
  height: calc(10px + (var(--chip-count) - 1) * 4px);
}

.chip-token {
  position: absolute;
  bottom: calc(var(--chip-index) * 4px);
  left: 0;
  display: grid;
  width: 27px;
  height: 10px;
  place-items: center;
  border: 2px dashed rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: var(--chip-color);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transform: translateX(var(--chip-shift, 0)) rotate(var(--chip-tilt, 0));
}

.chip-token::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--chip-ink, #fff);
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 850;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.pot-chip-rack .chip-pile.is-scattered {
  margin: 0 1px;
  z-index: calc(10 + var(--pile-order));
  transform:
    translate(
      clamp(-4px, var(--scatter-x, 0px), 4px),
      clamp(-3px, var(--scatter-y, 0px), 3px)
    )
    rotate(var(--pile-tilt, 0));
}

.chip-pile.is-100 { --chip-color: #45464b; --chip-ink: #ffffff; }
.chip-pile.is-500 { --chip-color: #df6f9c; --chip-ink: #35101f; }
.chip-pile.is-1000 { --chip-color: #e5b72f; --chip-ink: #211a08; }
.chip-pile.is-10000 { --chip-color: #c82e73; --chip-ink: #ffffff; }

.pot-chip-empty {
  display: none;
}

.table-status {
  display: none !important;
}

.pot-display.is-pushing {
  z-index: 7;
  animation: pot-to-winner 580ms cubic-bezier(0.36, 0.02, 0.24, 1) both;
  will-change: transform, filter, opacity;
}

.pot-display.is-pushing.push-seat-0 { --push-x: 0cqw; --push-y: 19cqw; }
.pot-display.is-pushing.push-seat-1 { --push-x: -27cqw; --push-y: 16cqw; }
.pot-display.is-pushing.push-seat-2 { --push-x: -40cqw; --push-y: 8cqw; }
.pot-display.is-pushing.push-seat-3 { --push-x: -40cqw; --push-y: -6cqw; }
.pot-display.is-pushing.push-seat-4 { --push-x: -27cqw; --push-y: -16cqw; }
.pot-display.is-pushing.push-seat-5 { --push-x: 0cqw; --push-y: -19cqw; }
.pot-display.is-pushing.push-seat-6 { --push-x: 27cqw; --push-y: -16cqw; }
.pot-display.is-pushing.push-seat-7 { --push-x: 40cqw; --push-y: -6cqw; }
.pot-display.is-pushing.push-seat-8 { --push-x: 40cqw; --push-y: 8cqw; }
.pot-display.is-pushing.push-seat-9 { --push-x: 27cqw; --push-y: 16cqw; }

.pot-display.is-pushing .pot-chip-rack {
  animation: chip-jostle 220ms ease-in-out 2;
}

.action-dock {
  position: relative;
  z-index: 12;
  display: grid;
  grid-template-columns: minmax(118px, 0.62fr) minmax(420px, 2.1fr) minmax(170px, 0.86fr);
  min-height: 68px;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 18px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--divider);
  background: rgba(9, 17, 16, 0.97);
  box-shadow: 0 -13px 34px rgba(2, 9, 8, 0.16);
}

.decision-copy {
  align-self: center;
}

.decision-copy > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
}

.decision-copy h1 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: clamp(14px, 1.15vw, 17px);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.decision-copy p {
  display: none;
}

.action-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(54px, 1fr));
  gap: 5px;
}

.action-button {
  min-height: 43px;
  padding: 4px 7px;
  border: 1px solid rgba(139, 160, 152, 0.34);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 5px 14px rgba(0, 9, 7, 0.13);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.action-button:hover:not(:disabled) {
  border-color: rgba(185, 205, 197, 0.56);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 19px rgba(0, 9, 7, 0.2);
  transform: translateY(-2px);
}

.action-button:active:not(:disabled) {
  box-shadow: inset 0 2px 5px rgba(0, 8, 6, 0.2), 0 2px 8px rgba(0, 9, 7, 0.12);
  transform: translateY(0) scale(0.975);
}

.action-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.action-button span,
.action-button strong {
  display: block;
}

.action-button span {
  margin-bottom: 1px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.action-button strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 690;
  white-space: nowrap;
}

.action-button.action-fold:not(:disabled) {
  border-color: rgba(240, 111, 105, 0.3);
}

.action-button.action-passive:not(:disabled) {
  border-color: rgba(190, 205, 198, 0.35);
}

.action-button.action-bet:not(:disabled) {
  border-color: rgba(201, 54, 61, 0.34);
}

.action-button.action-bet:not(:disabled):hover,
.action-button.action-allin:not(:disabled):hover {
  border-color: var(--accent);
}

.action-button.action-allin:not(:disabled) {
  background: var(--accent);
  border-color: rgba(244, 192, 185, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 16px rgba(112, 16, 22, 0.24);
}

.action-button.action-allin:not(:disabled) span,
.action-button.action-allin:not(:disabled) strong {
  color: var(--accent-ink);
}

.action-button:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.3;
}

.custom-sizing {
  min-width: 0;
}

.sizing-head,
.sizing-row {
  display: flex;
  align-items: center;
}

.sizing-head {
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 4px;
}

.sizing-head label {
  color: var(--muted);
  font-size: 9px;
}

.sizing-head output {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.sizing-row {
  gap: 7px;
}

.bet-number {
  width: 92px;
  min-height: 36px;
  border: 1px solid rgba(213, 208, 198, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.bet-number:disabled {
  color: var(--muted);
  opacity: 0.42;
}

.sizing-row input[type="range"] {
  width: 100%;
  height: 4px;
  appearance: none;
  border: 1px solid rgba(150, 170, 162, 0.18);
  border-radius: 999px;
  background: var(--divider-strong);
  cursor: pointer;
}

.sizing-row input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(201, 54, 61, 0.56), 0 3px 9px rgba(0, 0, 0, 0.3);
}

.sizing-row input:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.sizing-row button {
  min-width: 58px;
  min-height: 35px;
  border: 1px solid rgba(201, 54, 61, 0.5);
  border-radius: 10px;
  background: rgba(201, 54, 61, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 680;
  transition: transform 120ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.sizing-row button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(201, 54, 61, 0.15);
  box-shadow: 0 5px 14px rgba(0, 9, 7, 0.16);
  transform: translateY(-1px);
}

.sizing-row button:active:not(:disabled) {
  transform: translateY(0) scale(0.975);
}

.sizing-row button:disabled {
  border-color: var(--divider);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.coach-panel {
  position: sticky;
  top: 68px;
  display: flex;
  height: calc(100dvh - 68px);
  flex-direction: column;
  overflow: hidden auto;
  background: rgba(11, 20, 19, 0.92);
}

.coach-console-head {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--divider);
}

.console-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.console-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(97, 213, 161, 0.1);
}

.coach-console-head h2 {
  margin: 5px 0 0;
  font-size: 19px;
  letter-spacing: -0.035em;
}

.console-node {
  padding-left: 14px;
  border-left: 1px solid var(--divider);
  text-align: right;
}

.console-node span,
.console-node strong {
  display: block;
}

.console-node span {
  color: var(--muted);
  font-size: 9px;
}

.console-node strong {
  margin-top: 4px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
}

.coach-situation {
  display: grid;
  grid-template-columns: 0.72fr 1.45fr 0.8fr;
  border-bottom: 1px solid var(--divider);
}

.coach-situation > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--divider);
}

.coach-situation > div:last-child {
  border-right: 0;
}

.coach-situation span,
.coach-situation strong {
  display: block;
}

.coach-situation span {
  color: var(--muted);
  font-size: 8px;
}

.coach-situation strong {
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-situation .manual-pot-status {
  color: var(--warning);
}

.panel-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--divider);
  background: rgba(11, 20, 19, 0.96);
}

.panel-tab {
  position: relative;
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.panel-tab span {
  color: #60706a;
  font-family: var(--font-mono);
  font-size: 7px;
}

.panel-tab.is-active {
  color: var(--text);
}

.panel-tab.is-active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: var(--accent);
}

.panel-tab.is-active span {
  color: var(--accent);
}

.panel-view {
  padding: 14px 16px;
}

.coach-empty {
  display: grid;
  min-height: 204px;
  align-content: start;
  padding: 4px 0 0;
}

.empty-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 11px;
  border-bottom: 1px solid var(--divider);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.empty-status {
  color: var(--warning);
  letter-spacing: 0.08em;
}

.coach-empty h2 {
  margin: 17px 0 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.coach-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.decision-protocol {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 16px;
  border-top: 1px solid var(--divider);
  border-left: 1px solid var(--divider);
}

.decision-protocol > div {
  position: relative;
  min-width: 0;
  padding: 9px 9px 9px 29px;
  border-right: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.decision-protocol span {
  position: absolute;
  top: 10px;
  left: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
}

.decision-protocol strong,
.decision-protocol small {
  display: block;
}

.decision-protocol strong {
  color: var(--text-soft);
  font-size: 10px;
}

.decision-protocol small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.analysis-card {
  border: 1px solid var(--divider);
  border-left-width: 3px;
  border-radius: 2px;
  background: transparent;
  overflow: hidden;
}

.analysis-card.verdict-best,
.analysis-card.verdict-mix {
  border-color: rgba(97, 213, 161, 0.5);
}

.analysis-card.verdict-minor {
  border-color: rgba(240, 177, 91, 0.52);
}

.analysis-card.verdict-major,
.analysis-card.verdict-fatal {
  border-color: rgba(240, 111, 105, 0.56);
}

.verdict-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--divider);
}

.verdict-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.verdict-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.verdict-score {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}

.verdict-score small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.review-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--divider);
}

.review-stat {
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.012);
}

.review-stat span,
.review-stat strong,
.review-stat small {
  display: block;
}

.review-stat span {
  color: var(--muted);
  font-size: 10px;
}

.review-stat strong {
  margin: 4px 0;
  color: var(--text);
  font-size: 14px;
}

.review-stat small {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
}

.analysis-section {
  padding: 13px 15px;
  border-top: 1px solid var(--divider);
}

.analysis-section h3 {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 12px;
}

.frequency-list {
  display: grid;
  gap: 7px;
}

.frequency-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.frequency-item span:last-child {
  text-align: right;
  color: var(--text-soft);
  font-family: var(--font-mono);
}

.frequency-line {
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(107, 132, 124, 0.22);
}

.frequency-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.factor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.factor-list span {
  padding: 4px 0;
  border-bottom: 1px solid var(--divider);
  border-radius: 0;
  color: var(--text-soft);
  font-size: 10px;
}

.analysis-copy {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.62;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 10px;
}

.action-timeline {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 43px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.timeline-item.is-hero {
  border-color: rgba(201, 54, 61, 0.25);
  background: rgba(201, 54, 61, 0.04);
}

.timeline-pos {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.timeline-main strong,
.timeline-main span {
  display: block;
}

.timeline-main strong {
  color: var(--text-soft);
  font-size: 11px;
}

.timeline-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-amount {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
}

.range-matrix {
  display: grid;
  grid-template-columns: repeat(13, minmax(16px, 1fr));
  gap: 2px;
}

.range-cell {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(97, 121, 113, 0.14);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
  color: #61706c;
  font-family: var(--font-mono);
  font-size: clamp(5px, 0.55vw, 7px);
}

.range-cell.is-in-range {
  border-color: rgba(201, 54, 61, 0.3);
  background: rgba(201, 54, 61, 0.12);
  color: var(--text-soft);
}

.range-cell.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}

.range-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.seat-advice {
  margin: 2px 16px 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--divider);
}

.seat-advice-detail {
  position: relative;
  padding: 11px 12px 11px 15px;
  border-left: 2px solid var(--warning);
  background: rgba(240, 177, 91, 0.035);
}

.seat-advice-detail strong,
.seat-advice-detail p {
  display: block;
}

.seat-advice-detail strong {
  color: var(--text-soft);
  font-size: 11px;
}

.seat-advice-detail p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.opponent-focus {
  margin: 14px 16px 18px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}

.opponent-detail {
  min-height: 94px;
  padding: 11px 12px;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.018);
}

.opponent-detail h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.opponent-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.opponent-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.opponent-meta div {
  padding: 7px;
  border-radius: 2px;
  background: var(--surface-raised);
}

.opponent-meta span,
.opponent-meta strong {
  display: block;
}

.opponent-meta span {
  color: var(--muted);
  font-size: 9px;
}

.opponent-meta strong {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 10px;
}

.mobile-coach-toggle {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(2, 8, 7, 0.7);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.modal-sheet {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  width: min(920px, calc(100vw - 32px));
  max-height: min(780px, calc(100dvh - 32px));
  overflow: hidden auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius);
  background: #101b19;
  box-shadow: 0 35px 110px rgba(0, 5, 4, 0.72);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--divider);
  background: rgba(16, 27, 25, 0.97);
}

.modal-head span,
.modal-head h2 {
  display: block;
}

.modal-head span {
  color: var(--accent);
  font-size: 11px;
}

.modal-head h2 {
  margin: 4px 0 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 22px;
}

.settings-grid fieldset {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-grid legend {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.settings-grid label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 61px;
  padding: 9px 11px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.settings-grid label:has(input:checked) {
  border-color: rgba(201, 54, 61, 0.5);
  background: rgba(201, 54, 61, 0.05);
}

.settings-grid input {
  accent-color: var(--accent);
}

.settings-grid label strong,
.settings-grid label small {
  display: block;
}

.settings-grid label strong {
  color: var(--text-soft);
  font-size: 12px;
}

.settings-grid label small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.settings-submit {
  min-height: 50px;
  grid-column: 1 / -1;
  padding: 0 18px;
}

.report-content {
  padding: 22px;
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(200px, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--divider);
}

.report-grade {
  display: grid;
  min-height: 178px;
  align-content: center;
  padding: 24px;
  border: 1px solid rgba(201, 54, 61, 0.36);
  border-radius: var(--radius);
  background: rgba(201, 54, 61, 0.06);
}

.report-grade span,
.report-grade strong,
.report-grade small {
  display: block;
}

.report-grade span {
  color: var(--muted);
  font-size: 11px;
}

.report-grade strong {
  margin: 7px 0 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 42px;
}

.report-grade small {
  color: var(--text-soft);
  font-size: 11px;
}

.report-summary h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.report-summary p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.report-metrics div {
  padding: 11px;
  border-radius: var(--radius-small);
  background: var(--surface-raised);
}

.report-metrics span,
.report-metrics strong {
  display: block;
}

.report-metrics span {
  color: var(--muted);
  font-size: 9px;
}

.report-metrics strong {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.report-section {
  margin-top: 24px;
}

.report-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.dimension-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.015);
}

.dimension-card strong,
.dimension-card span,
.dimension-card small {
  display: block;
}

.dimension-card strong {
  font-size: 12px;
}

.dimension-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dimension-card small {
  align-self: center;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

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

.recommendation {
  padding: 13px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  background: var(--surface-raised);
}

.recommendation strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.recommendation p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.hand-summary {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: block;
  width: min(380px, 100vw);
  border-left: 1px solid var(--divider-strong);
  background: var(--bg-soft);
  box-shadow: -18px 0 50px rgba(0, 7, 5, 0.28);
}

.summary-card {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden auto;
  padding: 22px;
  border: 0;
  border-radius: 0;
  background: #101b19;
  box-shadow: none;
}

.summary-topline,
.summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-topline > span {
  color: var(--accent);
  font-size: 11px;
}

.summary-card > h2 {
  margin: 18px 0 14px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.summary-autoplay {
  margin: -8px 0 15px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.summary-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.summary-score-grid div {
  padding: 13px;
  border-radius: var(--radius-small);
  background: var(--surface-raised);
}

.summary-score-grid span,
.summary-score-grid strong {
  display: block;
}

.summary-score-grid span {
  color: var(--muted);
  font-size: 9px;
}

.summary-score-grid strong {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 16px;
}

.summary-lines {
  display: grid;
  gap: 7px;
  margin: 15px 0 0;
}

.summary-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--divider);
  border-radius: 9px;
}

.summary-line span,
.summary-line strong,
.summary-line small {
  font-size: 10px;
}

.summary-line span,
.summary-line small {
  color: var(--muted);
}

.summary-actions {
  margin-top: 18px;
}

.summary-actions button {
  min-width: 150px;
  padding: 0 16px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--divider-strong);
  border-radius: var(--radius-small);
  background: #1b2926;
  box-shadow: 0 18px 46px rgba(0, 5, 4, 0.56);
  color: var(--text-soft);
  font-size: 12px;
}

@keyframes deal-in {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.84) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes thinking-ring {
  0%, 100% {
    opacity: 0.38;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes winner-ring {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }
  32% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes sweep-to-pot {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate3d(0, 0, 0) rotate(var(--rack-rotation, 0deg)) scale(1);
  }
  72% {
    opacity: 0.92;
  }
  100% {
    opacity: 0.08;
    transform: translate(-50%, -50%) translate3d(var(--sweep-x), var(--sweep-y), 0) rotate(var(--rack-rotation, 0deg)) scale(0.66);
  }
}

@keyframes dealer-sweep {
  0% {
    opacity: 0;
    transform: translate(-50%, -12px) rotate(7deg) scaleY(0.68);
  }
  18% {
    opacity: 0.96;
    transform: translate(calc(-50% - 4cqw), 1cqw) rotate(24deg) scaleY(0.92);
  }
  50% {
    opacity: 1;
    transform: translate(calc(-50% - 11cqw), 6cqw) rotate(53deg) scaleY(1);
  }
  76% {
    opacity: 0.92;
    transform: translate(calc(-50% + 10cqw), 8cqw) rotate(-49deg) scaleY(0.96);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 7cqw) rotate(3deg) scaleY(0.72);
  }
}

@keyframes dealer-push {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px) rotate(4deg) scaleY(0.72);
  }
  22% {
    opacity: 0.96;
    transform: translate(-50%, 2cqw) rotate(2deg) scaleY(0.94);
  }
  72% {
    opacity: 1;
    transform: translate(calc(-50% + var(--dealer-push-x)), var(--dealer-push-y)) rotate(1deg) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dealer-push-x)), var(--dealer-push-y)) rotate(1deg) scaleY(0.8);
  }
}

@keyframes dealer-deal-hand {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px) rotate(4deg) scaleY(0.7);
  }
  35% {
    opacity: 0.95;
  }
  76% {
    opacity: 0.9;
    transform: translate(calc(-50% + 3cqw), 7cqw) rotate(-24deg) scaleY(0.96);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + 7cqw), 9cqw) rotate(-31deg) scaleY(0.74);
  }
}

@keyframes dealer-card-flight {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(17deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(8cqw, 13cqw) rotate(29deg) scale(0.82);
  }
}

@keyframes pot-receive {
  0%, 64% {
    filter: brightness(1);
    transform: translate3d(0, 0, 0) scale(1);
  }
  82% {
    filter: brightness(1.16);
    transform: translate3d(0, 1px, 0) scale(1.055);
  }
  100% {
    filter: brightness(1);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes pot-to-winner {
  0% {
    opacity: 1;
    filter: brightness(1);
    transform: translate3d(0, 0, 0) scale(1);
  }
  72% {
    opacity: 1;
    filter: brightness(1.08);
  }
  100% {
    opacity: 0.18;
    filter: brightness(0.96);
    transform: translate3d(var(--push-x), var(--push-y), 0) scale(0.82);
  }
}

@keyframes chip-jostle {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(1.2deg) translateY(-2px); }
}

@keyframes verdict-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.playing-card.is-new {
  animation: deal-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.analysis-card:not([hidden]) {
  animation: verdict-in 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 1499px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .play-column {
    border-right: 0;
  }

  .coach-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    z-index: 55;
    width: min(430px, 100vw);
    height: min(78dvh, 720px);
    border-top: 1px solid var(--divider-strong);
    border-left: 1px solid var(--divider-strong);
    border-radius: var(--radius) 0 0 0;
    box-shadow: -22px -12px 70px rgba(0, 5, 4, 0.58);
    transform: translateY(calc(100% + 4px));
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .coach-panel.is-open {
    transform: translateY(0);
  }

  .mobile-coach-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    display: flex;
    min-width: 160px;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 13px;
    border: 1px solid rgba(201, 54, 61, 0.46);
    border-radius: var(--radius-small);
    background: #1b2a26;
    box-shadow: 0 14px 42px rgba(0, 6, 5, 0.5);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 11px;
  }

  .mobile-coach-toggle strong {
    color: var(--accent);
    font-size: 10px;
  }
}

@media (min-width: 960px) and (max-width: 1499px) {
  .app-shell:has(.hand-summary:not([hidden])) .play-column {
    width: calc(100% - 380px);
  }

  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    padding-right: 52px;
    padding-left: 52px;
  }

  .app-shell:has(.hand-summary:not([hidden])) .action-dock {
    grid-template-columns: 1fr;
  }

  .app-shell:has(.hand-summary:not([hidden])) .decision-copy {
    grid-row: auto;
  }
}

@media (max-width: 959px) {
  .hand-summary {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    min-height: 0;
    border-top: 1px solid var(--divider-strong);
    border-left: 0;
    box-shadow: 0 -18px 50px rgba(0, 7, 5, 0.18);
  }

  .summary-card {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: minmax(150px, 1fr) auto;
  }

  .session-metrics {
    display: none;
  }

  .context-strip {
    align-items: flex-start;
  }

  .context-strip dl {
    grid-template-columns: repeat(2, minmax(72px, auto));
    gap: 7px 18px;
  }

  .table-stage {
    min-height: clamp(390px, calc(100dvh - 330px), 520px);
    padding-right: 94px;
    padding-left: 94px;
  }

  .action-dock {
    grid-template-columns: 1fr;
  }

  .decision-copy {
    grid-row: auto;
  }

  .decision-copy p {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 56px;
    padding: 8px 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-block > div {
    display: none;
  }

  .topbar-actions {
    min-width: 0;
    gap: 2px;
    justify-content: flex-end;
    padding: 2px;
  }

  .topbar-actions .ghost-button {
    min-height: 40px;
    padding: 0 8px;
    font-size: 10px;
  }

  .topbar-actions .icon-button {
    min-height: 40px;
    padding: 0 7px;
    font-size: 10px;
  }

  .workspace {
    min-height: calc(100dvh - 56px);
  }

  .context-strip {
    min-height: 54px;
    gap: 10px;
    padding: 8px 12px;
  }

  .context-strip > div:first-child {
    min-width: 0;
    flex: 1;
  }

  .context-strip > div:first-child span {
    font-size: 9px;
  }

  .context-strip > div:first-child strong {
    font-size: 11px;
  }

  .context-strip dl {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(2, 64px);
    gap: 3px 8px;
  }

  .context-strip dl > div:nth-child(3),
  .context-strip dl > div:nth-child(4) {
    display: none;
  }

  .context-strip dt,
  .context-strip dd {
    font-size: 9px;
  }

  .table-stage {
    min-height: 405px;
    flex: none;
    padding: 58px 34px 74px;
  }

  .table-ambient {
    inset: 20% 4%;
  }

  .poker-table {
    width: 100%;
    min-width: 274px;
    border-width: 7px;
    box-shadow:
      0 0 0 1px rgba(105, 155, 141, 0.3),
      0 0 0 11px rgba(8, 20, 18, 0.74),
      0 18px 46px var(--shadow),
      inset 0 0 36px rgba(0, 12, 10, 0.34);
  }

  .is-depth-mode .poker-table {
    transform: none;
    transition: none;
  }

  .is-depth-mode .card-layer,
  .is-depth-mode .stack-layer,
  .is-depth-mode .wager-layer,
  .is-depth-mode .marker-layer,
  .is-depth-mode .seat-layer,
  .is-depth-mode .dealer-station,
  .is-depth-mode .table-center {
    transform-style: flat;
  }

  .is-depth-mode .table-center {
    transform: translate(-50%, -50%);
  }

  .seat {
    width: 42px;
    height: 42px;
    min-height: 0;
    margin-left: -21px;
    padding: 0;
    border-radius: 50%;
  }

  .seat .avatar {
    display: grid;
    width: 40px;
    height: 40px;
    font-size: 8px;
  }

  .seat.is-hero {
    width: 42px;
    height: 42px;
    min-height: 0;
    margin-left: -21px;
  }

  .seat.is-hero .avatar {
    display: grid;
    width: 40px;
    height: 40px;
    font-size: 8px;
  }

  .seat[data-seat="0"] {
    bottom: -27px;
  }

  .seat[data-seat="1"] {
    bottom: -13px;
    left: 19%;
  }

  .seat[data-seat="2"] {
    bottom: 17%;
    left: -1px;
  }

  .seat[data-seat="3"] {
    top: 26%;
    left: -1px;
  }

  .seat[data-seat="4"] {
    top: -19px;
    left: 21%;
  }

  .seat[data-seat="5"] {
    top: -23px;
  }

  .seat[data-seat="6"] {
    top: -19px;
    right: auto;
    left: 79%;
  }

  .seat[data-seat="7"] {
    top: 26%;
    right: auto;
    left: calc(100% + 1px);
  }

  .seat[data-seat="8"] {
    right: auto;
    bottom: 17%;
    left: calc(100% + 1px);
  }

  .seat[data-seat="9"] {
    right: auto;
    bottom: -13px;
    left: 81%;
  }

  .mini-card {
    width: 42px;
    height: 60px;
    border-radius: 6px;
    font-size: 11px;
  }

  .mini-card + .mini-card {
    margin-left: 4px;
  }

  .mini-card-corner {
    min-width: 9px;
    font-size: 8px;
  }

  .mini-card-suit {
    font-size: 18px;
  }

  .dealer-station {
    top: -33px;
    width: 56px;
    height: 56px;
    margin-left: -28px;
  }

  .dealer-avatar {
    width: 54px;
    height: 54px;
    border-width: 2px;
    box-shadow: 0 0 0 4px rgba(6, 21, 17, 0.72), 0 9px 20px rgba(0, 10, 7, 0.45);
  }

  .dealer-station::before {
    right: -2px;
    bottom: -12px;
    width: 17px;
    height: 24px;
    border-width: 1px;
  }

  .dealer-hand {
    top: 42px;
    width: 12px;
    height: 48px;
  }

  .table-center {
    top: 53%;
    min-width: 198px;
  }

  .board {
    min-height: 43px;
    gap: 3px;
  }

  .playing-card,
  .card-slot {
    width: 33px;
    height: 47px;
    border-radius: 6px;
  }

  .playing-card {
    padding: 0;
    font-size: 9px;
  }

  .playing-card .suit-large {
    font-size: 17px;
  }

  .pot-display {
    min-width: 120px;
    min-height: 34px;
    margin: 0 0 4px;
    padding: 0;
  }

  .pot-chip-rack {
    min-height: 28px;
    gap: 2px;
    transform: scale(0.76);
    transform-origin: center bottom;
  }

  .table-marker.is-button {
    width: 27px;
    height: 27px;
    min-width: 27px;
    min-height: 27px;
    border-width: 1px;
    font-size: 9px;
  }

  .player-chip-rack {
    min-width: 31px;
    min-height: 24px;
    gap: 2px;
  }

  .player-chip-rack .chip-pile {
    width: 13px;
    height: calc(6px + (var(--chip-count) - 1) * 2.8px);
  }

  .player-chip-rack .chip-token {
    bottom: calc(var(--chip-index) * 2.8px);
    width: 13px;
    height: 6px;
  }

  .player-chip-rack .chip-token:last-child::after {
    font-size: 3.4px;
  }

  .wager-chip-rack {
    min-width: 22px;
    min-height: 21px;
    gap: 1px;
  }

  .wager-chip-rack .chip-pile {
    width: 13px;
    height: calc(5px + (var(--chip-count) - 1) * 2px);
  }

  .wager-chip-rack .chip-token {
    bottom: calc(var(--chip-index) * 2px);
    width: 13px;
    height: 5px;
  }

  .wager-chip-rack .chip-token:last-child::after {
    font-size: 3.4px;
  }

  .action-dock {
    gap: 10px;
    padding: 12px 12px max(74px, calc(12px + env(safe-area-inset-bottom)));
  }

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

  .decision-copy > span {
    grid-column: 1;
    font-size: 9px;
  }

  .decision-copy h1 {
    grid-column: 1;
    margin: 0;
    font-size: 17px;
  }

  .decision-copy p {
    grid-column: 2;
    grid-row: 1 / 3;
    max-width: 18ch;
    text-align: right;
    font-size: 9px;
  }

  .action-controls {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .action-button {
    min-height: 49px;
    padding: 5px;
  }

  .action-button span {
    font-size: 8px;
  }

  .action-button strong {
    font-size: 11px;
  }

  .sizing-head label,
  .sizing-head output {
    font-size: 9px;
  }

  .mobile-coach-toggle {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 150px;
    min-height: 44px;
  }

  .coach-panel {
    width: 100vw;
    height: 76dvh;
    border-left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .settings-grid,
  .report-grid,
  .report-hero {
    grid-template-columns: 1fr;
  }

  .modal-sheet {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-height: 88dvh;
    transform: none;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .modal-head,
  .settings-grid,
  .report-content {
    padding-right: 16px;
    padding-left: 16px;
  }

  .report-metrics,
  .summary-score-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-card {
    padding: 17px;
  }

  .summary-actions button {
    min-width: 0;
    flex: 1;
  }
}

/* Decision discipline: one compact checklist plus a public-action thread. */
.decision-audit {
  flex: 0 0 auto;
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--divider);
  background: rgba(10, 16, 15, 0.7);
}

.audit-head,
.action-thread-head,
.mobile-float-kicker,
.mobile-feedback-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.audit-head span,
.action-thread-head span,
.mobile-float-kicker span,
.mobile-feedback-float > span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.audit-head h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 15px;
  letter-spacing: -0.02em;
}

.audit-head > strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.audit-checks {
  display: grid;
  gap: 5px;
  margin-top: 11px;
}

.audit-check {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: 25px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid rgba(219, 213, 203, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
}

.audit-check:disabled {
  cursor: default;
  opacity: 0.76;
}

.audit-check > span:first-child {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgba(205, 214, 209, 0.24);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

.audit-check strong,
.audit-check small {
  display: block;
}

.audit-check strong {
  color: var(--text-soft);
  font-size: 11px;
}

.audit-check small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.audit-check.is-checked {
  border-color: rgba(97, 213, 161, 0.34);
  background: rgba(97, 213, 161, 0.055);
}

.audit-check.is-checked > span:first-child {
  border-color: rgba(97, 213, 161, 0.48);
  color: var(--success);
}

.action-thread {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.action-thread-head strong {
  color: var(--text-soft);
  font-size: 10px;
}

.action-thread-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.action-thread-player {
  padding-left: 9px;
  border-left: 2px solid rgba(201, 54, 61, 0.38);
}

.action-thread-player > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.action-thread-player strong {
  color: var(--text);
  font-size: 10px;
}

.action-thread-player em {
  color: var(--warning);
  font-size: 8px;
  font-style: normal;
}

.action-thread-player p,
.action-thread-empty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.action-thread-player p span {
  display: block;
}

.action-thread-player p b {
  display: inline-block;
  min-width: 34px;
  margin-right: 5px;
  color: var(--text-soft);
  font-weight: 650;
}

.mobile-training-float {
  display: none;
}

/* Seat numbers are always directly above the portrait, never on a cheek. */
.seat[data-seat] .seat-number {
  top: auto !important;
  right: auto !important;
  bottom: calc(100% + 6px) !important;
  left: 50% !important;
  transform: translateX(-50%);
}

/* Larger in both axes: the cards remain readable while the felt gains space. */
@media (min-width: 960px) {
  .workspace {
    height: auto;
    min-height: calc(100dvh - 68px);
  }

  .play-column {
    height: auto;
    min-height: calc(100dvh - 68px);
  }

  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    min-height: 710px;
    flex: 0 0 710px;
    padding: 88px 14px 72px;
  }

  .poker-table {
    width: min(calc(100% - 28px), 1210px);
    aspect-ratio: 2.18 / 1;
  }

  .seat[data-seat="0"] { top: calc(100% + 38px); left: 50%; }
  .seat[data-seat="1"] { top: calc(100% + 38px); left: 24.3%; }
  .seat[data-seat="2"] { top: 84.5%; left: 1.1%; }
  .seat[data-seat="3"] { top: 15.5%; left: 1.1%; }
  .seat[data-seat="4"] { top: -38px; left: 24.3%; }
  .seat[data-seat="6"] { top: -38px; left: 75.7%; }
  .seat[data-seat="7"] { top: 15.5%; left: 98.9%; }
  .seat[data-seat="8"] { top: 84.5%; left: 98.9%; }
  .seat[data-seat="9"] { top: calc(100% + 38px); left: 75.7%; }

  /* Button orbit: 18px inside the fixed white ellipse on every side. */
  .table-marker[data-seat="0"] { top: calc(50% + 112px); left: 50%; }
  .table-marker[data-seat="1"] { top: calc(50% + 97px); left: 37.3%; }
  .table-marker[data-seat="2"] { top: calc(50% + 56px); left: 28.05%; }
  .table-marker[data-seat="3"] { top: calc(50% - 56px); left: 28.05%; }
  .table-marker[data-seat="4"] { top: calc(50% - 97px); left: 37.3%; }
  .table-marker[data-seat="6"] { top: calc(50% - 97px); left: 62.7%; }
  .table-marker[data-seat="7"] { top: calc(50% - 56px); left: 71.95%; }
  .table-marker[data-seat="8"] { top: calc(50% + 56px); left: 71.95%; }
  .table-marker[data-seat="9"] { top: calc(50% + 97px); left: 62.7%; }
}

/* Purpose-built portrait table. This is not the desktop table scaled down. */
@media (max-width: 680px) and (orientation: portrait) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
  }

  #depth-toggle {
    display: none;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .icon-button {
    min-height: 34px;
    padding-inline: 6px;
    font-size: 9px;
  }

  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    min-height: 625px;
    flex: 0 0 625px;
    padding: 74px 48px 76px;
    overflow: visible;
  }

  .poker-table {
    width: min(318px, calc(100vw - 96px));
    min-width: 0;
    max-width: none;
    aspect-ratio: .62 / 1;
    border-width: 7px;
    border-radius: 999px;
  }

  .poker-table::before {
    top: -8px;
    width: 88px;
    height: 70px;
    border-radius: 0 0 44px 44px;
  }

  .poker-table::after {
    inset: 15% 25%;
    width: auto;
    height: auto;
    transform: none;
    border-radius: 999px;
  }

  .is-depth-mode .poker-table::after {
    transform: none;
  }

  .table-center,
  .is-depth-mode .table-center {
    top: 50%;
    width: 100%;
    min-width: 0;
    transform: translate(-50%, -50%);
  }

  .seat,
  .seat.is-hero,
  .seat .avatar,
  .seat.is-hero .avatar {
    width: 42px;
    height: 42px;
    margin: 0;
  }

  .seat[data-seat] {
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
  }

  .seat[data-seat="0"] { top: calc(100% + 26px); left: 50%; }
  .seat[data-seat="1"] { top: 95.2%; left: 8.5%; }
  .seat[data-seat="2"] { top: 64%; left: -26px; }
  .seat[data-seat="3"] { top: 36%; left: -26px; }
  .seat[data-seat="4"] { top: 4.8%; left: 8.5%; }
  .seat[data-seat="6"] { top: 4.8%; left: 91.5%; }
  .seat[data-seat="7"] { top: 36%; left: calc(100% + 26px); }
  .seat[data-seat="8"] { top: 64%; left: calc(100% + 26px); }
  .seat[data-seat="9"] { top: 95.2%; left: 91.5%; }

  .seat[data-seat] .seat-number {
    top: -23px !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%);
  }

  .seat.is-folded {
    opacity: 1;
    filter: none;
  }

  .seat.is-folded .avatar {
    opacity: .48;
    filter: grayscale(.55) saturate(.7);
  }

  .player-read-tag {
    display: none;
  }

  .seat:active {
    transform: translate(-50%, -50%);
  }

  .mini-card {
    width: 36px;
    height: 52px;
    border-radius: 6px;
  }

  .mini-card + .mini-card {
    margin-left: 5px;
  }

  .mini-card-corner {
    min-width: 9px;
    font-size: 8px;
  }

  .mini-card-suit {
    font-size: 18px;
  }

  .hole-card-pair[data-seat="0"] { top: 87%; left: 50%; --card-rotation: 0deg; }
  .hole-card-pair[data-seat="1"] { top: 79%; left: 18%; --card-rotation: 35deg; }
  .hole-card-pair[data-seat="2"] { top: 60%; left: 15%; --card-rotation: 90deg; }
  .hole-card-pair[data-seat="3"] { top: 40%; left: 15%; --card-rotation: 90deg; }
  .hole-card-pair[data-seat="4"] { top: 21%; left: 18%; --card-rotation: 145deg; }
  .hole-card-pair[data-seat="6"] { top: 21%; left: 82%; --card-rotation: -145deg; }
  .hole-card-pair[data-seat="7"] { top: 40%; left: 85%; --card-rotation: -90deg; }
  .hole-card-pair[data-seat="8"] { top: 60%; left: 85%; --card-rotation: -90deg; }
  .hole-card-pair[data-seat="9"] { top: 79%; left: 82%; --card-rotation: -35deg; }

  .player-chip-rack[data-seat] {
    gap: 3px;
  }

  .player-chip-rack[data-seat] .chip-pile {
    transform: none;
  }

  .player-chip-rack[data-seat="0"] { top: 96%; left: 50%; --rack-rotation: 0deg; }
  .player-chip-rack[data-seat="1"] { top: 89%; left: 11%; --rack-rotation: 35deg; }
  .player-chip-rack[data-seat="2"] { top: 65%; left: 4%; --rack-rotation: 90deg; }
  .player-chip-rack[data-seat="3"] { top: 35%; left: 4%; --rack-rotation: 90deg; }
  .player-chip-rack[data-seat="4"] { top: 12%; left: 11%; --rack-rotation: 145deg; }
  .player-chip-rack[data-seat="6"] { top: 12%; left: 89%; --rack-rotation: -145deg; }
  .player-chip-rack[data-seat="7"] { top: 35%; left: 96%; --rack-rotation: -90deg; }
  .player-chip-rack[data-seat="8"] { top: 65%; left: 96%; --rack-rotation: -90deg; }
  .player-chip-rack[data-seat="9"] { top: 89%; left: 89%; --rack-rotation: -35deg; }

  .table-marker.is-button {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
  }

  .table-marker[data-seat="0"] { top: 79%; left: 50%; }
  .table-marker[data-seat="1"] { top: 75.1%; left: 41.25%; }
  .table-marker[data-seat="2"] { top: 64.5%; left: 34.85%; }
  .table-marker[data-seat="3"] { top: 35.5%; left: 34.85%; }
  .table-marker[data-seat="4"] { top: 24.9%; left: 41.25%; }
  .table-marker[data-seat="6"] { top: 24.9%; left: 58.75%; }
  .table-marker[data-seat="7"] { top: 35.5%; left: 65.15%; }
  .table-marker[data-seat="8"] { top: 64.5%; left: 65.15%; }
  .table-marker[data-seat="9"] { top: 75.1%; left: 58.75%; }

  .wager-chip-rack[data-seat] {
    min-width: 20px;
    min-height: 20px;
    gap: 2px;
  }

  .wager-chip-rack[data-seat] .chip-pile {
    width: 12px;
    height: calc(5px + (var(--chip-count) - 1) * 2px);
    transform: none;
  }

  .wager-chip-rack[data-seat] .chip-token {
    bottom: calc(var(--chip-index) * 2px);
    width: 12px;
    height: 5px;
  }

  .wager-chip-rack[data-seat] .chip-pile.is-10000,
  .wager-chip-rack[data-seat] .chip-pile.is-10000 .chip-token {
    width: 14px;
  }

  .wager-chip-rack[data-seat="0"] { top: 73%; left: 50%; --rack-rotation: 0deg; --sweep-x: 0cqw; --sweep-y: -23cqw; }
  .wager-chip-rack[data-seat="1"] { top: 69.9%; left: 43.5%; --rack-rotation: 35deg; --sweep-x: 6.5cqw; --sweep-y: -19.9cqw; }
  .wager-chip-rack[data-seat="2"] { top: 61.5%; left: 38.7%; --rack-rotation: 90deg; --sweep-x: 11.3cqw; --sweep-y: -11.5cqw; }
  .wager-chip-rack[data-seat="3"] { top: 38.5%; left: 38.7%; --rack-rotation: 90deg; --sweep-x: 11.3cqw; --sweep-y: 11.5cqw; }
  .wager-chip-rack[data-seat="4"] { top: 30.1%; left: 43.5%; --rack-rotation: 145deg; --sweep-x: 6.5cqw; --sweep-y: 19.9cqw; }
  .wager-chip-rack[data-seat="6"] { top: 30.1%; left: 56.5%; --rack-rotation: -145deg; --sweep-x: -6.5cqw; --sweep-y: 19.9cqw; }
  .wager-chip-rack[data-seat="7"] { top: 38.5%; left: 61.3%; --rack-rotation: -90deg; --sweep-x: -11.3cqw; --sweep-y: 11.5cqw; }
  .wager-chip-rack[data-seat="8"] { top: 61.5%; left: 61.3%; --rack-rotation: -90deg; --sweep-x: -11.3cqw; --sweep-y: -11.5cqw; }
  .wager-chip-rack[data-seat="9"] { top: 69.9%; left: 56.5%; --rack-rotation: -35deg; --sweep-x: -6.5cqw; --sweep-y: -19.9cqw; }

  .dealer-station {
    top: -36px;
  }

  .board {
    max-width: 138px;
    flex-wrap: nowrap;
    gap: 2px;
  }

  .playing-card,
  .card-slot {
    width: 25px;
    height: 38px;
    border-radius: 4px;
  }

  .playing-card .card-corner {
    font-size: 7px;
  }

  .playing-card .suit-large {
    font-size: 13px;
  }

  .pot-display {
    transform: scale(.82);
    transform-origin: center bottom;
  }

  .action-dock,
  .app-shell:has(.hand-summary:not([hidden])) .action-dock {
    position: sticky;
    bottom: 0;
    z-index: 44;
    width: 100%;
    padding: 9px 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(8, 9, 9, .985);
  }

  .mobile-coach-toggle {
    display: none;
  }

  .mobile-training-float:not([hidden]) {
    position: fixed;
    right: 12px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 49;
    display: block;
    max-height: min(228px, 32dvh);
    overflow: auto;
    padding: 14px;
    border: 1px solid rgba(218, 213, 203, .2);
    border-radius: 14px;
    background: rgba(17, 20, 19, .96);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .58), inset 0 1px 0 rgba(255, 255, 255, .055);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: verdict-in 220ms cubic-bezier(.16, 1, .3, 1) both;
  }

  .mobile-training-float h2 {
    margin: 9px 0 0;
    color: var(--text);
    font-size: 17px;
    letter-spacing: -.025em;
  }

  .mobile-training-float p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.5;
  }

  .mobile-float-kicker strong {
    color: var(--accent);
    font-size: 9px;
  }

  .mobile-step-progress {
    height: 3px;
    margin: 12px 0 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(218, 213, 203, .12);
  }

  .mobile-step-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 180ms ease;
  }

  .mobile-step-float > button,
  .mobile-analysis-link {
    width: 100%;
    min-height: 38px;
    border: 1px solid rgba(201, 54, 61, .54);
    border-radius: 9px;
    background: rgba(201, 54, 61, .15);
    color: #f6efea;
    font-size: 11px;
    font-weight: 750;
  }

  .mobile-feedback-float {
    border-left: 4px solid var(--success) !important;
  }

  .mobile-feedback-float.is-error {
    border-left-color: var(--danger) !important;
    box-shadow: 0 18px 52px rgba(0, 0, 0, .62), 0 0 0 1px rgba(240, 111, 105, .16);
  }

  .mobile-feedback-float.is-error #mobile-feedback-kicker,
  .mobile-feedback-float.is-error #mobile-feedback-title {
    color: var(--danger);
  }

  .mobile-float-close {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .055);
    color: var(--muted);
    font-size: 18px;
  }

  .mobile-feedback-meta {
    margin: 10px 0;
    padding: 8px 0;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
  }

  .mobile-feedback-meta strong {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 16px;
  }

  .mobile-feedback-meta span {
    color: var(--text-soft);
    font-size: 10px;
  }

  .coach-panel.is-open ~ .mobile-training-float {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 359px) and (orientation: portrait) {
  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    padding-right: 40px;
    padding-left: 40px;
  }

  .poker-table {
    width: calc(100vw - 80px);
  }

  .seat,
  .seat.is-hero,
  .seat .avatar,
  .seat.is-hero .avatar {
    width: 36px;
    height: 36px;
  }

  .seat[data-seat="2"],
  .seat[data-seat="3"] { left: -22px; }
  .seat[data-seat="7"],
  .seat[data-seat="8"] { left: calc(100% + 22px); }

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

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: dark;
  }

  body {
    background:
      radial-gradient(circle at 48% -18%, rgba(122, 35, 40, 0.12), transparent 36rem),
      linear-gradient(145deg, #090a0a, #121313 54%, #090a0a);
  }

  .topbar {
    background: rgba(9, 10, 10, 0.92);
  }

  .context-strip,
  .action-dock,
  .coach-panel,
  .panel-tabs {
    background: rgba(15, 16, 16, 0.96);
  }

  .seat,
  .seat.is-hero {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .topbar-actions {
    border-color: rgba(222, 217, 207, 0.14);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 6px 18px rgba(0, 0, 0, 0.18);
  }

  .action-button {
    border-color: rgba(218, 213, 203, 0.2);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 4px 12px rgba(0, 0, 0, 0.16);
  }

  .seat-position {
    background: #242725;
  }

  .modal-sheet,
  .summary-card,
  .modal-head {
    background: #141615;
  }

  .mobile-coach-toggle,
  .toast {
    background: #181a19;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .modal-backdrop,
  .hand-summary {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Professional tournament-table composition */
.brand-wordmark-image {
  display: block;
  width: clamp(176px, 15vw, 190px);
  height: auto;
  max-height: none;
}

.coach-panel .hand-summary {
  position: static;
  inset: auto;
  width: auto;
  min-height: 0;
  flex: 0 0 auto;
  margin: 10px 12px 2px;
  border: 1px solid rgba(219, 213, 203, 0.14);
  border-radius: 12px;
  background: #121413;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: visible;
}

.coach-panel .summary-card {
  height: auto;
  max-height: none;
  padding: 13px;
  border-radius: inherit;
  background: transparent;
  overflow: visible;
}

.coach-panel .summary-card > h2 {
  margin: 9px 0 8px;
  font-size: 19px;
}

.coach-panel .summary-autoplay {
  margin: -3px 0 9px;
  font-size: 9px;
}

.coach-panel .summary-score-grid div,
.coach-panel .summary-line {
  padding: 8px;
}

.coach-panel .summary-actions {
  margin-top: 10px;
}

.coach-panel .summary-actions button {
  min-width: 0;
  min-height: 36px;
  flex: 1;
}

@media (min-width: 1500px) {
  .play-column {
    position: relative;
  }

  .action-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 42;
    width: 340px;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(201, 54, 61, 0.34);
    border-left: 1px solid var(--divider);
    background: rgba(12, 13, 13, 0.975);
    box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.3);
  }

  .action-dock .decision-copy {
    display: none;
  }

  .action-dock .action-controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }

  .action-dock .action-button {
    min-height: 42px;
    padding: 4px;
  }

  .coach-panel {
    padding-bottom: 116px;
    scroll-padding-bottom: 124px;
  }
}

@media (min-width: 960px) and (max-width: 1499px) {
  .action-dock {
    position: fixed;
    top: 140px;
    right: 10px;
    bottom: auto;
    z-index: 48;
    width: 156px;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px;
    border: 1px solid rgba(213, 208, 198, 0.16);
    border-top-color: rgba(201, 54, 61, 0.44);
    border-radius: 12px;
    background: rgba(12, 13, 13, 0.96);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .action-dock .decision-copy {
    display: none;
  }

  .action-dock .action-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .action-dock .action-button {
    min-height: 41px;
    padding: 4px 2px;
  }

  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    padding-right: 190px;
    padding-left: 72px;
  }

  .app-shell:has(.hand-summary:not([hidden])) .play-column {
    width: auto;
  }

  .app-shell:has(.hand-summary:not([hidden])) .action-dock {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 959px) {
  .action-dock {
    position: relative;
    inset: auto;
    width: auto;
    grid-template-columns: minmax(112px, 0.58fr) minmax(0, 2fr);
    gap: 7px 12px;
    padding: 8px 12px max(9px, env(safe-area-inset-bottom));
  }

  .action-dock .decision-copy {
    display: block;
  }

  .action-dock .custom-sizing {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .brand-block > .brand-lockup {
    display: grid;
  }

  .brand-wordmark-image {
    width: 116px;
    max-height: 28px;
  }

  .table-stage {
    min-height: 420px;
    padding: 52px 42px 58px;
  }

  .seat,
  .seat.is-hero {
    width: 42px;
    height: 42px;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .seat .avatar,
  .seat.is-hero .avatar {
    width: 40px;
    height: 40px;
  }

  .seat[data-seat="0"] { top: calc(100% + 38px); left: 50%; }
  .seat[data-seat="1"] { top: calc(100% + 38px); left: 24.3%; }
  .seat[data-seat="2"] { top: 80%; left: -10px; }
  .seat[data-seat="3"] { top: 20%; left: -10px; }
  .seat[data-seat="4"] { top: -38px; left: 24.3%; }
  .seat[data-seat="6"] { top: -38px; right: auto; left: 75.7%; }
  .seat[data-seat="7"] { top: 20%; right: auto; left: calc(100% + 10px); }
  .seat[data-seat="8"] { top: 80%; right: auto; bottom: auto; left: calc(100% + 10px); }
  .seat[data-seat="9"] { top: calc(100% + 38px); right: auto; bottom: auto; left: 75.7%; }

  .mini-card {
    width: 32px;
    height: 46px;
    border-radius: 5px;
    font-size: 9px;
  }

  .mini-card + .mini-card {
    margin-left: 4px;
  }

  .mini-card-corner {
    min-width: 7px;
    font-size: 6px;
  }

  .mini-card-suit {
    font-size: 14px;
  }

  .dealer-chip-tray {
    top: 60px;
    width: 94px;
    height: 22px;
    gap: 2px;
    padding: 3px 4px 4px;
  }

  .action-dock {
    grid-template-columns: 1fr;
  }

  .action-dock .decision-copy {
    display: none;
  }

  .action-dock .action-controls {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  .action-dock .action-button {
    min-height: 41px;
    padding: 3px 2px;
  }

  .action-dock .custom-sizing {
    grid-column: auto;
  }
}

/* Casino chip set: 100 charcoal, 500 rose, 1K yellow, 10K oversized magenta. */
.pot-chip-rack .chip-pile.is-10000 {
  width: 33px;
  height: calc(12px + (var(--chip-count) - 1) * 4px);
}

.pot-chip-rack .chip-pile.is-10000 .chip-token {
  width: 33px;
  height: 12px;
}

.player-chip-rack .chip-pile.is-10000 {
  width: 18px;
  height: calc(9px + (var(--chip-count) - 1) * 3.7px);
  flex-basis: 18px;
}

.player-chip-rack .chip-pile.is-10000 .chip-token {
  width: 18px;
  height: 9px;
}

.wager-chip-rack .chip-pile.is-10000 {
  width: 20px;
  height: calc(9px + (var(--chip-count) - 1) * 3px);
}

.wager-chip-rack .chip-pile.is-10000 .chip-token {
  width: 20px;
  height: 9px;
}

.seat-chip-rack .chip-pile.is-10000 {
  width: 16px;
  height: calc(7px + (var(--chip-count) - 1) * 2px);
}

.seat-chip-rack .chip-pile.is-10000 .chip-token {
  width: 16px;
  height: 7px;
}

/* Curved-side stacks remain parallel to their local rail and never braid together. */
.player-chip-rack[data-seat="2"],
.player-chip-rack[data-seat="3"],
.player-chip-rack[data-seat="7"],
.player-chip-rack[data-seat="8"] {
  display: flex;
  width: auto;
  min-width: 42px;
  max-width: none;
  min-height: 22px;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.player-chip-rack[data-seat="2"] .chip-pile,
.player-chip-rack[data-seat="3"] .chip-pile,
.player-chip-rack[data-seat="7"] .chip-pile,
.player-chip-rack[data-seat="8"] .chip-pile {
  transform: translateY(clamp(0px, var(--scatter-y, 0), 2px));
}

.player-chip-rack[data-seat="2"] .chip-token,
.player-chip-rack[data-seat="3"] .chip-token,
.player-chip-rack[data-seat="7"] .chip-token,
.player-chip-rack[data-seat="8"] .chip-token {
  transform: translateX(0) rotate(0);
}

.wager-chip-rack[data-seat="2"],
.wager-chip-rack[data-seat="3"],
.wager-chip-rack[data-seat="7"],
.wager-chip-rack[data-seat="8"] {
  display: flex;
  width: auto;
  min-width: 28px;
  min-height: 30px;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

.wager-chip-rack[data-seat="2"] .chip-pile,
.wager-chip-rack[data-seat="3"] .chip-pile,
.wager-chip-rack[data-seat="7"] .chip-pile,
.wager-chip-rack[data-seat="8"] .chip-pile {
  transform: none;
}

/* Session context belongs to the coach rail, leaving the live table uninterrupted. */
.coach-panel > .context-strip {
  display: grid;
  width: 100%;
  min-height: 0;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  align-items: start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(13, 14, 14, 0.92);
  overflow: hidden;
}

.coach-panel > .context-strip > div:first-child {
  min-width: 0;
}

.coach-panel > .context-strip dl {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.coach-panel > .context-strip > div:first-child strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-console-head,
.coach-situation,
.panel-tabs {
  flex: 0 0 auto;
}

.coach-panel > * {
  flex-shrink: 0;
}

/* Primary actions sit directly below the felt as compact, tactile round controls. */
@media (min-width: 960px) {
  .workspace {
    height: calc(100dvh - 68px);
    min-height: calc(100dvh - 68px);
  }

  .play-column {
    height: 100%;
  }

  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    min-height: 0;
    flex: 1 1 auto;
    padding: 54px 10px;
  }

  .poker-table {
    width: min(100%, 1180px, calc((100dvh - 260px) * 2.51));
    aspect-ratio: 2.51 / 1;
  }

  /* The table grows around the original white betting line, so the inner loop stays fixed. */
  .poker-table::after {
    inset: auto;
    top: 50%;
    left: 50%;
    width: min(59%, 637px);
    height: min(55%, 254px);
    transform: translate(-50%, -50%);
  }

  .is-depth-mode .poker-table::after {
    transform: translate(-50%, -50%) translateZ(3px);
  }

  /* Five consistent tracks: portrait → bankroll → cards → button → live wager. */
  .seat[data-seat],
  .player-chip-rack[data-seat],
  .hole-card-pair[data-seat],
  .player-hole-cards[data-seat],
  .table-hole-cards[data-seat],
  .table-marker[data-seat],
  .wager-chip-rack[data-seat] {
    right: auto;
    bottom: auto;
  }

  .seat,
  .seat.is-hero,
  .seat .avatar,
  .seat.is-hero .avatar {
    width: 50px;
    height: 50px;
  }

  .seat[data-seat="0"] { top: calc(100% + 25px); left: 50%; }
  .seat[data-seat="1"] { top: calc(100% + 25px); left: 24.3%; }
  .seat[data-seat="2"] { top: 84.5%; left: 1.5%; }
  .seat[data-seat="3"] { top: 15.5%; left: 1.5%; }
  .seat[data-seat="4"] { top: -25px; left: 24.3%; }
  .seat[data-seat="6"] { top: -25px; left: 75.7%; }
  .seat[data-seat="7"] { top: 15.5%; left: 98.5%; }
  .seat[data-seat="8"] { top: 84.5%; left: 98.5%; }
  .seat[data-seat="9"] { top: calc(100% + 25px); left: 75.7%; }

  .player-chip-rack[data-seat="0"] { top: 97.6%; left: 50%; --rack-rotation: 0deg; }
  .player-chip-rack[data-seat="1"] { top: 97.6%; left: 24.3%; --rack-rotation: 0deg; }
  .player-chip-rack[data-seat="2"] { top: 79%; left: 6.1%; --rack-rotation: 53deg; }
  .player-chip-rack[data-seat="3"] { top: 21%; left: 6.1%; --rack-rotation: 127deg; }
  .player-chip-rack[data-seat="4"] { top: 2.4%; left: 24.3%; --rack-rotation: 180deg; }
  .player-chip-rack[data-seat="6"] { top: 2.4%; left: 75.7%; --rack-rotation: 180deg; }
  .player-chip-rack[data-seat="7"] { top: 21%; left: 93.9%; --rack-rotation: -127deg; }
  .player-chip-rack[data-seat="8"] { top: 79%; left: 93.9%; --rack-rotation: -53deg; }
  .player-chip-rack[data-seat="9"] { top: 97.6%; left: 75.7%; --rack-rotation: 0deg; }

  .hole-card-pair[data-seat="0"], .player-hole-cards[data-seat="0"], .table-hole-cards[data-seat="0"] { top: 86.3%; left: 50%; --card-rotation: 0deg; }
  .hole-card-pair[data-seat="1"], .player-hole-cards[data-seat="1"], .table-hole-cards[data-seat="1"] { top: 86.3%; left: 24.3%; --card-rotation: 0deg; }
  .hole-card-pair[data-seat="2"], .player-hole-cards[data-seat="2"], .table-hole-cards[data-seat="2"] { top: 66.5%; left: 12.7%; --card-rotation: 53deg; }
  .hole-card-pair[data-seat="3"], .player-hole-cards[data-seat="3"], .table-hole-cards[data-seat="3"] { top: 33.5%; left: 12.7%; --card-rotation: 127deg; }
  .hole-card-pair[data-seat="4"], .player-hole-cards[data-seat="4"], .table-hole-cards[data-seat="4"] { top: 13.7%; left: 24.3%; --card-rotation: 180deg; }
  .hole-card-pair[data-seat="6"], .player-hole-cards[data-seat="6"], .table-hole-cards[data-seat="6"] { top: 13.7%; left: 75.7%; --card-rotation: 180deg; }
  .hole-card-pair[data-seat="7"], .player-hole-cards[data-seat="7"], .table-hole-cards[data-seat="7"] { top: 33.5%; left: 87.3%; --card-rotation: -127deg; }
  .hole-card-pair[data-seat="8"], .player-hole-cards[data-seat="8"], .table-hole-cards[data-seat="8"] { top: 66.5%; left: 87.3%; --card-rotation: -53deg; }
  .hole-card-pair[data-seat="9"], .player-hole-cards[data-seat="9"], .table-hole-cards[data-seat="9"] { top: 86.3%; left: 75.7%; --card-rotation: 0deg; }

  /* D has its own inset orbit. Every possible button seat stays just inside
     the white betting line instead of sharing the wager/chip track. */
  .table-marker[data-seat="0"] { top: 74.5%; left: 50%; }
  .table-marker[data-seat="1"] { top: 71.2%; left: 37.25%; }
  .table-marker[data-seat="2"] { top: 62.25%; left: 27.9%; }
  .table-marker[data-seat="3"] { top: 37.75%; left: 27.9%; }
  .table-marker[data-seat="4"] { top: 28.8%; left: 37.25%; }
  .table-marker[data-seat="6"] { top: 28.8%; left: 62.75%; }
  .table-marker[data-seat="7"] { top: 37.75%; left: 72.1%; }
  .table-marker[data-seat="8"] { top: 62.25%; left: 72.1%; }
  .table-marker[data-seat="9"] { top: 71.2%; left: 62.75%; }

  .wager-chip-rack[data-seat="0"] { top: 64%; left: 50%; --rack-rotation: 0deg; --sweep-x: 0cqw; --sweep-y: -9.8cqw; }
  .wager-chip-rack[data-seat="1"] { top: 64%; left: 35%; --rack-rotation: 0deg; --sweep-x: 15cqw; --sweep-y: -9.8cqw; }
  .wager-chip-rack[data-seat="2"] { top: 60%; left: 25.8%; --rack-rotation: 53deg; --sweep-x: 24.2cqw; --sweep-y: -8.1cqw; }
  .wager-chip-rack[data-seat="3"] { top: 40%; left: 25.8%; --rack-rotation: 127deg; --sweep-x: 24.2cqw; --sweep-y: .4cqw; }
  .wager-chip-rack[data-seat="4"] { top: 36%; left: 35%; --rack-rotation: 180deg; --sweep-x: 15cqw; --sweep-y: 2.1cqw; }
  .wager-chip-rack[data-seat="6"] { top: 36%; left: 65%; --rack-rotation: 180deg; --sweep-x: -15cqw; --sweep-y: 2.1cqw; }
  .wager-chip-rack[data-seat="7"] { top: 40%; left: 74.2%; --rack-rotation: -127deg; --sweep-x: -24.2cqw; --sweep-y: .4cqw; }
  .wager-chip-rack[data-seat="8"] { top: 60%; left: 74.2%; --rack-rotation: -53deg; --sweep-x: -24.2cqw; --sweep-y: -8.1cqw; }
  .wager-chip-rack[data-seat="9"] { top: 64%; left: 65%; --rack-rotation: 0deg; --sweep-x: -15cqw; --sweep-y: -9.8cqw; }

  .action-dock,
  .app-shell:has(.hand-summary:not([hidden])) .action-dock {
    position: relative;
    inset: auto;
    right: auto;
    bottom: auto;
    z-index: 12;
    width: 100%;
    min-height: 82px;
    flex: 0 0 82px;
    grid-template-columns: minmax(410px, 1fr) minmax(190px, 230px);
    gap: 12px 18px;
    padding: 9px 20px;
    border: 0;
    border-top: 1px solid rgba(201, 54, 61, 0.34);
    border-radius: 0;
    background: rgba(10, 11, 11, 0.985);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24);
  }

  .action-dock .decision-copy {
    display: none;
  }

  .action-dock .action-controls {
    display: grid;
    grid-template-columns: repeat(6, 58px);
    justify-content: center;
    gap: 10px;
  }

  .action-dock .action-button {
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 5px 3px;
    border-radius: 50%;
  }

  .action-dock .action-button span {
    font-size: 8px;
  }

  .action-dock .action-button strong {
    font-size: 10px;
  }

  .action-dock .custom-sizing {
    width: 100%;
    max-width: 230px;
  }

  .coach-panel {
    padding-bottom: 0;
    scroll-padding-bottom: 0;
  }
}

@media (min-width: 681px) {
  .mini-card {
    width: 54px;
    height: 76px;
    border-radius: 7px;
  }

  .mini-card + .mini-card {
    margin-left: 8px;
  }

  .mini-card .card-corner,
  .mini-card-corner {
    min-width: 13px;
    font-size: 11px;
  }

  .mini-card .card-center-suit,
  .mini-card-suit {
    font-size: 24px;
  }
}

@media (min-width: 960px) and (max-height: 700px) {
  .mini-card {
    width: 52px;
    height: 70px;
  }
}

@media (max-width: 959px) {
  .action-dock {
    position: relative;
    inset: auto;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  }

  .action-dock .decision-copy {
    display: none;
  }

  .action-dock .action-controls {
    grid-template-columns: repeat(6, minmax(46px, 54px));
    justify-content: center;
    gap: clamp(4px, 1.4vw, 9px);
  }

  .action-dock .action-button {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1;
    padding: 4px 2px;
    border-radius: 50%;
  }

  .action-dock .custom-sizing {
    width: min(100%, 560px);
    margin-inline: auto;
  }
}

/* A single professional decision rail: fold, call/check, exact amount, all in. */
.action-dock {
  grid-template-columns: minmax(0, 1fr);
}

.action-dock .action-controls {
  display: grid;
  width: min(100%, 780px);
  grid-template-columns: 64px 64px 72px minmax(310px, 1fr) 72px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-inline: auto;
}

.action-dock .action-button {
  width: 64px;
  height: 64px;
  min-height: 64px;
  justify-self: center;
  padding: 5px 3px;
  border-radius: 50%;
}

.action-dock .action-passive {
  width: 72px;
  height: 72px;
}

.action-dock .custom-sizing {
  width: 100%;
  max-width: none;
}

.action-dock .sizing-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 92px 62px;
  gap: 9px;
}

.action-dock .sizing-row button {
  min-width: 0;
  min-height: 38px;
}

@media (max-width: 680px) {
  .action-dock .action-controls {
    width: 100%;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
    gap: 7px;
  }

  .action-dock .action-button {
    width: 58px;
    height: 58px;
    min-height: 58px;
  }

  .action-dock .action-passive {
    width: 62px;
    height: 62px;
  }

  .action-dock .action-allin {
    grid-column: 4;
    grid-row: 1;
  }

  .action-dock .custom-sizing {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .action-dock .sizing-row {
    grid-template-columns: minmax(120px, 1fr) 82px 58px;
  }
}

/* Final geometry contract. Keep this last: desktop and phone use different tables. */
@media (min-width: 960px) {
  .workspace {
    height: auto;
    min-height: calc(100dvh - 68px);
  }

  .play-column {
    height: auto;
    min-height: calc(100dvh - 68px);
  }

  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    min-height: 710px;
    flex: 0 0 710px;
    padding: 88px 14px 72px;
  }

  .poker-table {
    width: min(calc(100% - 28px), 1210px);
    aspect-ratio: 2.18 / 1;
  }

  .poker-table::after {
    inset: auto;
    top: 50%;
    left: 50%;
    width: min(59%, 637px);
    height: min(55%, 254px);
    transform: translate(-50%, -50%);
  }

  .is-depth-mode .poker-table::after {
    transform: translate(-50%, -50%) translateZ(3px);
  }

  .seat[data-seat="0"] { top: calc(100% + 38px); left: 50%; }
  .seat[data-seat="1"] { top: calc(100% + 38px); left: 24.3%; }
  .seat[data-seat="2"] { top: 84.5%; left: 1.1%; }
  .seat[data-seat="3"] { top: 15.5%; left: 1.1%; }
  .seat[data-seat="4"] { top: -38px; left: 24.3%; }
  .seat[data-seat="6"] { top: -38px; left: 75.7%; }
  .seat[data-seat="7"] { top: 15.5%; left: 98.9%; }
  .seat[data-seat="8"] { top: 84.5%; left: 98.9%; }
  .seat[data-seat="9"] { top: calc(100% + 38px); left: 75.7%; }

  .table-marker[data-seat="0"] { top: calc(50% + 112px); left: 50%; }
  .table-marker[data-seat="1"] { top: calc(50% + 97px); left: 37.3%; }
  .table-marker[data-seat="2"] { top: calc(50% + 56px); left: 28.05%; }
  .table-marker[data-seat="3"] { top: calc(50% - 56px); left: 28.05%; }
  .table-marker[data-seat="4"] { top: calc(50% - 97px); left: 37.3%; }
  .table-marker[data-seat="6"] { top: calc(50% - 97px); left: 62.7%; }
  .table-marker[data-seat="7"] { top: calc(50% - 56px); left: 71.95%; }
  .table-marker[data-seat="8"] { top: calc(50% + 56px); left: 71.95%; }
  .table-marker[data-seat="9"] { top: calc(50% + 97px); left: 62.7%; }
}

@media (max-width: 680px) and (orientation: portrait) {
  #depth-toggle { display: none; }

  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    min-height: 625px;
    flex: 0 0 625px;
    padding: 74px 48px 76px;
    overflow: visible;
  }

  .poker-table {
    width: min(318px, calc(100vw - 96px));
    min-width: 0;
    max-width: none;
    aspect-ratio: .62 / 1;
    border-width: 7px;
    border-radius: 999px;
  }

  .poker-table::before {
    top: -8px;
    width: 88px;
    height: 70px;
    border-radius: 0 0 44px 44px;
  }

  .poker-table::after {
    inset: 15% 28%;
    width: auto;
    height: auto;
    transform: none;
    border-radius: 999px;
  }

  .is-depth-mode .poker-table::after { transform: none; }

  .table-center,
  .is-depth-mode .table-center {
    top: 50%;
    width: 100%;
    min-width: 0;
    transform: translate(-50%, -50%);
  }

  .seat,
  .seat.is-hero,
  .seat .avatar,
  .seat.is-hero .avatar {
    width: 42px;
    height: 42px;
    margin: 0;
  }

  .seat[data-seat] {
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
  }

  .seat[data-seat="0"] { top: calc(100% + 30px); left: 50%; }
  .seat[data-seat="1"] { top: calc(100% + 26px); left: 22%; }
  .seat[data-seat="2"] { top: 64%; left: -26px; }
  .seat[data-seat="3"] { top: 33%; left: -26px; }
  .seat[data-seat="4"] { top: -26px; left: 28%; }
  .seat[data-seat="6"] { top: -26px; left: 72%; }
  .seat[data-seat="7"] { top: 33%; left: calc(100% + 26px); }
  .seat[data-seat="8"] { top: 64%; left: calc(100% + 26px); }
  .seat[data-seat="9"] { top: calc(100% + 26px); left: 78%; }

  .seat:active { transform: translate(-50%, -50%); }

  .mini-card {
    width: 36px;
    height: 52px;
    border-radius: 6px;
  }

  .mini-card + .mini-card { margin-left: 5px; }
  .mini-card-corner { min-width: 9px; font-size: 8px; }
  .mini-card-suit { font-size: 18px; }

  .hole-card-pair[data-seat="0"] { top: 84.5%; left: 50%; --card-rotation: 0deg; }
  .hole-card-pair[data-seat="1"] { top: 84.5%; left: 22%; --card-rotation: 0deg; }
  .hole-card-pair[data-seat="2"] { top: 64%; left: 19%; --card-rotation: 90deg; }
  .hole-card-pair[data-seat="3"] { top: 33%; left: 19%; --card-rotation: 90deg; }
  .hole-card-pair[data-seat="4"] { top: 16%; left: 28%; --card-rotation: 180deg; }
  .hole-card-pair[data-seat="6"] { top: 16%; left: 72%; --card-rotation: 180deg; }
  .hole-card-pair[data-seat="7"] { top: 33%; left: 81%; --card-rotation: -90deg; }
  .hole-card-pair[data-seat="8"] { top: 64%; left: 81%; --card-rotation: -90deg; }
  .hole-card-pair[data-seat="9"] { top: 84.5%; left: 78%; --card-rotation: 0deg; }

  .player-chip-rack[data-seat] {
    min-width: 32px;
    gap: 3px;
  }

  .player-chip-rack[data-seat] .chip-pile { transform: none; }

  .player-chip-rack[data-seat] .chip-pile {
    height: calc(6px + (var(--chip-count) - 1) * 2.5px);
  }

  .player-chip-rack[data-seat] .chip-token {
    bottom: calc(var(--chip-index) * 2.5px);
  }

  .player-chip-rack[data-seat="0"] { top: 94%; left: 50%; --rack-rotation: 0deg; }
  .player-chip-rack[data-seat="1"] { top: 94%; left: 22%; --rack-rotation: 0deg; }
  .player-chip-rack[data-seat="2"] { top: 64%; left: 4.5%; --rack-rotation: 90deg; }
  .player-chip-rack[data-seat="3"] { top: 33%; left: 4.5%; --rack-rotation: 90deg; }
  .player-chip-rack[data-seat="4"] { top: 5%; left: 28%; --rack-rotation: 180deg; }
  .player-chip-rack[data-seat="6"] { top: 5%; left: 72%; --rack-rotation: 180deg; }
  .player-chip-rack[data-seat="7"] { top: 33%; left: 95.5%; --rack-rotation: -90deg; }
  .player-chip-rack[data-seat="8"] { top: 64%; left: 95.5%; --rack-rotation: -90deg; }
  .player-chip-rack[data-seat="9"] { top: 94%; left: 78%; --rack-rotation: 0deg; }

  .table-marker[data-seat="0"] { top: 79%; left: 50%; }
  .table-marker[data-seat="1"] { top: 75.1%; left: 41.25%; }
  .table-marker[data-seat="2"] { top: 64.5%; left: 34.85%; }
  .table-marker[data-seat="3"] { top: 35.5%; left: 34.85%; }
  .table-marker[data-seat="4"] { top: 24.9%; left: 41.25%; }
  .table-marker[data-seat="6"] { top: 24.9%; left: 58.75%; }
  .table-marker[data-seat="7"] { top: 35.5%; left: 65.15%; }
  .table-marker[data-seat="8"] { top: 64.5%; left: 65.15%; }
  .table-marker[data-seat="9"] { top: 75.1%; left: 58.75%; }

  .wager-chip-rack[data-seat] {
    min-width: 20px;
    min-height: 20px;
    gap: 2px;
  }

  .wager-chip-rack[data-seat] .chip-pile {
    width: 12px;
    height: calc(5px + (var(--chip-count) - 1) * 2px);
    transform: none;
  }

  .wager-chip-rack[data-seat] .chip-token {
    bottom: calc(var(--chip-index) * 2px);
    width: 12px;
    height: 5px;
  }

  .wager-chip-rack[data-seat] .chip-pile.is-10000,
  .wager-chip-rack[data-seat] .chip-pile.is-10000 .chip-token { width: 14px; }

  .wager-chip-rack[data-seat="0"] { top: 73%; left: 50%; --rack-rotation: 0deg; --sweep-x: 0cqw; --sweep-y: -23cqw; }
  .wager-chip-rack[data-seat="1"] { top: 69.9%; left: 43.5%; --rack-rotation: 35deg; --sweep-x: 6.5cqw; --sweep-y: -19.9cqw; }
  .wager-chip-rack[data-seat="2"] { top: 61.5%; left: 38.7%; --rack-rotation: 90deg; --sweep-x: 11.3cqw; --sweep-y: -11.5cqw; }
  .wager-chip-rack[data-seat="3"] { top: 38.5%; left: 38.7%; --rack-rotation: 90deg; --sweep-x: 11.3cqw; --sweep-y: 11.5cqw; }
  .wager-chip-rack[data-seat="4"] { top: 30.1%; left: 43.5%; --rack-rotation: 145deg; --sweep-x: 6.5cqw; --sweep-y: 19.9cqw; }
  .wager-chip-rack[data-seat="6"] { top: 30.1%; left: 56.5%; --rack-rotation: -145deg; --sweep-x: -6.5cqw; --sweep-y: 19.9cqw; }
  .wager-chip-rack[data-seat="7"] { top: 38.5%; left: 61.3%; --rack-rotation: -90deg; --sweep-x: -11.3cqw; --sweep-y: 11.5cqw; }
  .wager-chip-rack[data-seat="8"] { top: 61.5%; left: 61.3%; --rack-rotation: -90deg; --sweep-x: -11.3cqw; --sweep-y: -11.5cqw; }
  .wager-chip-rack[data-seat="9"] { top: 69.9%; left: 56.5%; --rack-rotation: -35deg; --sweep-x: -6.5cqw; --sweep-y: -19.9cqw; }

  .board { max-width: 138px; flex-wrap: nowrap; gap: 2px; }
  .playing-card, .card-slot { width: 25px; height: 38px; border-radius: 4px; }
  .playing-card .card-corner { font-size: 7px; }
  .playing-card .suit-large { font-size: 13px; }

  .action-dock,
  .app-shell:has(.hand-summary:not([hidden])) .action-dock {
    position: sticky;
    inset: auto 0 0;
    z-index: 44;
    width: 100%;
    padding: 9px 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(8, 9, 9, .985);
  }

  .action-dock .action-controls {
    width: 100%;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
    gap: 7px;
  }

  .action-dock .custom-sizing {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .action-dock .action-allin { grid-column: 4; grid-row: 1; }
  .mobile-coach-toggle { display: none; }

  .mobile-training-float:not([hidden]) {
    bottom: calc(166px + env(safe-area-inset-bottom));
  }

  .mobile-training-float[data-anchor="top"]:not([hidden]) {
    top: 65px;
    bottom: auto;
  }

  body:has(.coach-panel.is-open) .mobile-training-float {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 359px) and (orientation: portrait) {
  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    padding-right: 40px;
    padding-left: 40px;
  }

  .poker-table { width: calc(100vw - 80px); }

  .seat,
  .seat.is-hero,
  .seat .avatar,
  .seat.is-hero .avatar { width: 36px; height: 36px; }

  .seat[data-seat="2"], .seat[data-seat="3"] { left: -22px; }
  .seat[data-seat="7"], .seat[data-seat="8"] { left: calc(100% + 22px); }
  .mini-card { width: 30px; height: 44px; }
}

/* Final table spacing: the action rail sits below a complete outer player orbit. */
.seat-rail-number {
  position: absolute;
  z-index: 9;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid rgba(235, 239, 234, .78);
  border-radius: 50%;
  background: #13201e;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .035);
  color: #f2eee7;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.seat-rail-number.is-hero {
  border-color: rgba(221, 69, 77, .95);
  color: #ff777c;
  box-shadow: 0 0 0 2px rgba(201, 54, 61, .14), 0 4px 12px rgba(0, 0, 0, .52);
}

/* Live bets are face-up chips laid individually on the felt. */
.wager-chip-rack {
  width: max-content;
  min-width: 0;
  min-height: 18px;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.wager-chip-rack .chip-pile,
.wager-chip-rack .chip-pile.is-10000 {
  display: flex;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  transform: none;
}

.wager-chip-rack .chip-token,
.wager-chip-rack .chip-pile.is-10000 .chip-token {
  position: relative;
  inset: auto;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border-width: 1.5px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .46), inset 0 0 0 2px rgba(255, 255, 255, .075);
  transform: none;
}

.wager-chip-rack .chip-pile.is-10000 .chip-token {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.wager-chip-rack .chip-token:last-child::after { font-size: 3.8px; }

@media (min-width: 960px) {
  .table-stage,
  .app-shell:has(.hand-summary:not([hidden])) .table-stage {
    min-height: 740px;
    flex: 0 0 740px;
    padding: 100px 14px 85px;
  }

  /* Move the separator and the whole dock, without changing table geometry. */
  .action-dock {
    margin-top: 64px;
  }

  .play-column,
  .action-dock,
  .app-shell:has(.hand-summary:not([hidden])) .action-dock {
    background: var(--bg);
  }
}

@media (min-width: 681px), (orientation: landscape) {
  .mobile-feedback-float.is-error:not([hidden]) {
    position: fixed;
    display: block;
    z-index: 90;
    inset: auto 20px 24px auto;
    width: min(400px, calc(100vw - 40px));
    max-height: min(65dvh, 480px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--divider-strong);
    border-left: 4px solid var(--danger);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 16px 48px var(--shadow);
  }

  .mobile-feedback-float.is-error h2 { margin: 8px 26px 12px 0; font-size: 19px; }
  .mobile-feedback-float.is-error p { font-size: 14px; line-height: 1.65; white-space: pre-line; }
  .mobile-feedback-float .mobile-float-close { position: absolute; top: 8px; right: 8px; }
  .mobile-feedback-float .mobile-feedback-meta { margin-block: 12px; color: var(--muted); }
  .mobile-feedback-float #open-mobile-analysis { width: 100%; }
  .mobile-feedback-float #mobile-feedback-kicker { color: var(--danger); }
}

@media (min-width: 960px) {
  .seat[data-seat="0"],
  .seat[data-seat="1"],
  .seat[data-seat="9"] { top: calc(100% + 48px); }

  .seat[data-seat="4"],
  .seat[data-seat="6"] { top: -48px; }

  .seat[data-seat="2"],
  .seat[data-seat="3"] { left: .3%; }

  .seat[data-seat="7"],
  .seat[data-seat="8"] { left: 99.7%; }

  .seat-rail-number[data-seat="0"] { top: calc(100% - 3px); left: calc(50% + 34px); }
  .seat-rail-number[data-seat="1"] { top: calc(100% - 3px); left: calc(24.3% - 34px); }
  .seat-rail-number[data-seat="2"] { top: calc(84.5% + 30px); left: 6.3%; }
  .seat-rail-number[data-seat="3"] { top: calc(15.5% - 30px); left: 6.3%; }
  .seat-rail-number[data-seat="4"] { top: 3px; left: calc(24.3% - 34px); }
  .seat-rail-number[data-seat="6"] { top: 3px; left: calc(75.7% + 34px); }
  .seat-rail-number[data-seat="7"] { top: calc(15.5% - 30px); left: 93.7%; }
  .seat-rail-number[data-seat="8"] { top: calc(84.5% + 30px); left: 93.7%; }
  .seat-rail-number[data-seat="9"] { top: calc(100% - 3px); left: calc(75.7% + 34px); }

  /* One concentric betting orbit: blinds and later wagers use the same rail. */
  .wager-chip-rack[data-seat="0"] { top: 65.3%; left: 50%; --rack-rotation: 0deg; }
  .wager-chip-rack[data-seat="1"] { top: 63.25%; left: 38.85%; --rack-rotation: 0deg; }
  .wager-chip-rack[data-seat="2"] { top: 56.5%; left: 29.8%; --rack-rotation: 53deg; }
  .wager-chip-rack[data-seat="3"] { top: 43.5%; left: 29.8%; --rack-rotation: 127deg; }
  .wager-chip-rack[data-seat="4"] { top: 36.75%; left: 38.85%; --rack-rotation: 180deg; }
  .wager-chip-rack[data-seat="6"] { top: 36.75%; left: 61.15%; --rack-rotation: 180deg; }
  .wager-chip-rack[data-seat="7"] { top: 43.5%; left: 70.2%; --rack-rotation: -127deg; }
  .wager-chip-rack[data-seat="8"] { top: 56.5%; left: 70.2%; --rack-rotation: -53deg; }
  .wager-chip-rack[data-seat="9"] { top: 63.25%; left: 61.15%; --rack-rotation: 0deg; }

  /* D follows a separate outer orbit, uniformly just inside the white line. */
  .table-marker[data-seat="0"] { top: 70.18%; left: 50%; }
  .table-marker[data-seat="1"] { top: 67.48%; left: 37.52%; }
  .table-marker[data-seat="2"] { top: 58.52%; left: 27.38%; }
  .table-marker[data-seat="3"] { top: 41.48%; left: 27.38%; }
  .table-marker[data-seat="4"] { top: 32.52%; left: 37.52%; }
  .table-marker[data-seat="6"] { top: 32.52%; left: 62.48%; }
  .table-marker[data-seat="7"] { top: 41.48%; left: 72.62%; }
  .table-marker[data-seat="8"] { top: 58.52%; left: 72.62%; }
  .table-marker[data-seat="9"] { top: 67.48%; left: 62.48%; }
}

@media (max-width: 680px) and (orientation: portrait) {
  .seat-rail-number {
    width: 18px;
    height: 18px;
    font-size: 8px;
  }

  .seat-rail-number[data-seat="0"] { top: calc(100% - 4px); left: calc(50% + 27px); }
  .seat-rail-number[data-seat="1"] { top: calc(100% - 4px); left: calc(22% - 24px); }
  .seat-rail-number[data-seat="2"] { top: calc(64% + 24px); left: 3%; }
  .seat-rail-number[data-seat="3"] { top: calc(33% - 24px); left: 3%; }
  .seat-rail-number[data-seat="4"] { top: 4px; left: calc(28% - 24px); }
  .seat-rail-number[data-seat="6"] { top: 4px; left: calc(72% + 24px); }
  .seat-rail-number[data-seat="7"] { top: calc(33% - 24px); left: 97%; }
  .seat-rail-number[data-seat="8"] { top: calc(64% + 24px); left: 97%; }
  .seat-rail-number[data-seat="9"] { top: calc(100% - 4px); left: calc(78% + 24px); }

  .wager-chip-rack[data-seat] {
    width: max-content;
    min-width: 0;
    min-height: 13px;
    gap: 3px;
    flex-wrap: nowrap;
  }

  .wager-chip-rack[data-seat] .chip-pile,
  .wager-chip-rack[data-seat] .chip-pile.is-10000 {
    display: flex;
    width: auto;
    height: auto;
    gap: 1px;
    transform: none;
  }

  .wager-chip-rack[data-seat] .chip-token,
  .wager-chip-rack[data-seat] .chip-pile.is-10000 .chip-token {
    position: relative;
    inset: auto;
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-width: 1px;
    border-radius: 50%;
    transform: none;
  }

  .wager-chip-rack[data-seat] .chip-pile.is-10000 .chip-token {
    width: 12px;
    height: 12px;
    flex-basis: 12px;
  }

  .wager-chip-rack[data-seat] .chip-token:last-child::after { font-size: 2.6px; }
}

/* Wide screens use the right side as a full-height control and analysis tower. */
@media (min-width: 1500px) {
  .app-shell { --right-rail-width: clamp(420px, 22vw, 470px); }

  .topbar {
    position: fixed;
    inset: 0 var(--right-rail-width) auto 0;
    width: auto;
    min-height: 58px;
    grid-template-columns: 1fr;
    padding: 7px 20px;
    /* A backdrop filter traps fixed descendants in the logo column. Keep the
       metrics and toolbar anchored to the viewport's right analysis column. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .topbar .session-metrics {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 61;
    width: var(--right-rail-width);
    min-width: 0;
    min-height: 58px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    border-right: 0;
    border-left: 1px solid var(--divider);
    background: rgba(9, 10, 10, .98);
  }

  .topbar .session-metrics > div {
    min-width: 0;
    padding: 0 10px;
  }

  .topbar .topbar-actions {
    position: fixed;
    top: 58px;
    right: 0;
    z-index: 61;
    display: grid;
    width: var(--right-rail-width);
    min-height: 51px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 8px;
    border-right: 0;
    border-left: 1px solid var(--divider);
    border-radius: 0;
    background: rgba(12, 14, 13, .98);
  }

  .topbar .topbar-actions .ghost-button,
  .topbar .topbar-actions .icon-button {
    min-width: 0;
    padding-inline: 4px;
  }

  .workspace {
    min-height: 100dvh;
    grid-template-columns: minmax(720px, 1fr) var(--right-rail-width);
    padding-top: 58px;
  }

  .play-column { min-height: calc(100dvh - 58px); }

  .coach-panel {
    position: fixed;
    inset: 109px 0 0 auto;
    z-index: 55;
    width: var(--right-rail-width);
    height: auto;
    border-left: 1px solid var(--divider);
    transform: none;
  }

  .mobile-coach-toggle { display: none; }
}
