:root {
  --page: #07100d;
  --ink: #faf7ec;
  --muted: #aaa99e;
  --quiet: #76786f;
  --line: rgba(255, 255, 255, 0.09);
  --panel: rgba(17, 25, 22, 0.94);
  --panel-2: #18231f;
  --felt: #086441;
  --felt-dark: #053f2c;
  --rail: #44271f;
  --brass: #e6bc62;
  --brass-soft: rgba(230, 188, 98, 0.14);
  --red: #d75058;
  --black-card: #181512;
  --good: #66c28d;
  --bad: #e06f61;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

body {
  padding: 28px;
  background:
    radial-gradient(circle at 50% -10%, rgba(22, 111, 74, 0.22), transparent 35%),
    radial-gradient(circle at 0 40%, rgba(230, 188, 98, 0.06), transparent 26%),
    linear-gradient(145deg, #09130f, var(--page) 62%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.app-header {
  max-width: 1440px;
  margin: 0 auto 22px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(230, 188, 98, 0.45);
  border-radius: 17px;
  color: #161008;
  background: linear-gradient(145deg, #f1cf7b, #b8832e);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.4);
  font-family: Georgia, serif;
  font-size: 30px;
  transform: rotate(-4deg);
}

.brand-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.app-header h1,
.section-heading h2,
.table-toolbar h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-heading h2,
.table-toolbar h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brass);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.status {
  min-width: 180px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(170, 169, 158, 0.1);
}

.status.success .status-dot { background: var(--good); box-shadow: 0 0 0 4px rgba(102, 194, 141, 0.12); }
.status.error .status-dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(224, 111, 97, 0.12); }
.status.is-busy .status-dot { animation: statusPulse 1s ease-in-out infinite; background: var(--brass); }

.status.success {
  color: var(--good);
}

.status.error {
  color: var(--bad);
}

.workspace {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "table controls"
    "standings code"
    "batch code";
  gap: 16px;
}

.table-panel,
.control-panel,
.standings-panel,
.batch-panel,
.code-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
}

.table-panel {
  grid-area: table;
  padding: 20px;
  overflow: hidden;
}

.control-panel {
  grid-area: controls;
  padding: 18px;
}

.standings-panel {
  grid-area: standings;
  padding: 16px;
}

.batch-panel {
  grid-area: batch;
  padding: 16px;
}

.code-panel {
  grid-area: code;
  padding: 16px;
  min-width: 0;
}

.table-toolbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.replay-buttons,
.quick-actions {
  display: flex;
  gap: 8px;
}

.replay-buttons button,
.quick-actions button,
.replay-buttons select {
  width: 38px;
  height: 34px;
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.replay-buttons select {
  width: 84px;
  padding: 0 8px;
}

.quick-actions button {
  width: auto;
  min-width: 0;
  padding: 0 10px;
  font-weight: 800;
}

.replay-buttons button:hover,
.quick-actions button:hover,
.run-button.secondary:hover {
  border-color: var(--brass);
}

.poker-table {
  position: relative;
  min-height: 540px;
  margin-top: 18px;
}

.table-felt {
  position: absolute;
  inset: 68px 94px;
  border: 18px solid var(--rail);
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 2px,
      transparent 2px,
      transparent 9px
    ),
    var(--felt);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.08),
    inset 0 0 50px rgba(0, 0, 0, 0.36),
    0 0 0 7px #281813,
    0 20px 60px rgba(0, 0, 0, 0.5);
}

.felt-brand {
  position: absolute;
  inset: auto 0 18%;
  color: rgba(255, 255, 255, 0.13);
  text-align: center;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.table-felt::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 2px solid rgba(210, 173, 90, 0.55);
  border-radius: 999px;
}

.board {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  align-content: center;
  z-index: 1;
}

.pot {
  min-width: 108px;
  padding: 8px 14px;
  color: #17130d;
  background: linear-gradient(180deg, #f3cf79, #d29d3e);
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 180ms ease;
}

.community,
.seat-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.card {
  width: 46px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fbf8ef;
  color: var(--black-card);
  border: 1px solid #d9d1bf;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  animation: dealCard 260ms cubic-bezier(.2,.8,.2,1) both;
}

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

.card.is-empty {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.card.is-back {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 38%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 3px,
      transparent 3px,
      transparent 8px
    ),
    #7b1f2a;
  border-color: #d2ad5a;
  box-shadow:
    inset 0 0 0 3px rgba(20, 18, 16, 0.28),
    0 3px 0 rgba(0, 0, 0, 0.22);
}

.card.is-back::after {
  content: "";
  width: 48%;
  height: 48%;
  border: 1px solid rgba(245, 242, 232, 0.55);
  border-radius: 999px;
}

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

.seat {
  position: absolute;
  width: 152px;
  min-height: 128px;
  transform: translate(-50%, -50%);
  padding: 10px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--good);
  border-radius: 12px;
  background: linear-gradient(180deg, #212d29, #17201d);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.28);
  text-align: center;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  animation: seatIn 300ms cubic-bezier(.2,.8,.2,1) both;
}

.seat:hover {
  z-index: 5;
  transform: translate(-50%, -50%) scale(1.04);
}

.seat-layer.is-dense .seat {
  width: 126px;
  min-height: 108px;
  padding: 8px;
}

.seat-layer.is-full .seat {
  width: 102px;
  min-height: 88px;
  padding: 6px;
}

.seat-layer.is-ultra .seat {
  width: 92px;
  min-height: 84px;
  padding: 6px;
}

.seat.is-folded {
  border-color: #27292c;
  border-top-color: var(--bad);
  background: #17191b;
  opacity: 0.72;
}

.seat.is-all-in {
  border-color: rgba(210, 173, 90, 0.55);
  border-top-color: var(--brass);
  background: #292416;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.36),
    0 0 0 3px rgba(210, 173, 90, 0.30);
}

.seat.is-human {
  border-color: var(--good);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.28),
    0 0 0 2px rgba(102, 194, 141, 0.25);
}

.seat.is-winner {
  border-color: var(--brass);
  border-top-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(230, 188, 98, 0.18), 0 0 35px rgba(230, 188, 98, 0.25);
}

.dealer-chip {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  place-items: center;
  background: #f6f0dc;
  color: #151515;
  border: 2px solid var(--brass);
  font-size: 12px;
  font-weight: 900;
}

.seat.is-dealer .dealer-chip {
  display: grid;
}

.seat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.seat-badges {
  min-height: 28px;
  margin-top: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.seat-state {
  padding: 2px 6px;
  border-radius: 999px;
  color: #06120b;
  background: var(--good);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.seat.is-folded .seat-state {
  color: #fff5ef;
  background: var(--bad);
}

.seat.is-all-in .seat-state {
  color: #161007;
  background: var(--brass);
  box-shadow: 0 0 14px rgba(210, 173, 90, 0.48);
}

.seat.is-folded .seat-cards .card {
  background: rgba(224, 111, 97, 0.10);
  border-color: rgba(224, 111, 97, 0.34);
}

.seat.is-folded .seat-name,
.seat.is-folded .seat-meta,
.seat.is-folded .seat-bet {
  color: #8c8378;
}

.seat-cards {
  margin: 8px 0;
}

.seat-cards .card {
  width: 35px;
  height: 48px;
  font-size: 14px;
}

.seat-layer.is-dense .seat-cards .card {
  width: 28px;
  height: 38px;
  font-size: 11px;
}

.seat-layer.is-full .seat-name {
  font-size: 11px;
}

.seat-layer.is-ultra .seat-name {
  font-size: 11px;
}

.seat-layer.is-full .seat-meta,
.seat-layer.is-full .seat-bet,
.seat-layer.is-full .seat-state {
  font-size: 9px;
}

.seat-layer.is-full .seat-badges {
  min-height: 18px;
  margin-top: 3px;
}

.seat-layer.is-full .seat-cards {
  margin: 4px 0;
}

.seat-layer.is-full .seat-cards .card {
  width: 25px;
  height: 34px;
  font-size: 10px;
}

.seat-layer.is-full .seat-bet {
  min-height: 12px;
}

.seat-layer.is-ultra .seat-meta,
.seat-layer.is-ultra .seat-bet,
.seat-layer.is-ultra .seat-state {
  font-size: 9px;
}

.seat-layer.is-ultra .seat-cards .card {
  width: 23px;
  height: 32px;
  font-size: 10px;
}

.seat-meta,
.seat-bet,
.muted,
.run-meta {
  color: var(--muted);
  font-size: 12px;
}

.seat-bet {
  min-height: 16px;
  color: var(--brass);
  font-weight: 700;
}

.seat.is-all-in .seat-bet {
  color: #f6d987;
  font-weight: 900;
  text-transform: uppercase;
}

.event-strip {
  margin-top: 30px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(250px, 0.4fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.replay-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.replay-progress span {
  min-width: 48px;
  color: var(--quiet);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.event-strip input {
  width: 100%;
  accent-color: var(--brass);
}

.event-strip p {
  margin: 0;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.play-panel {
  margin-top: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(11, 20, 17, 0.96), rgba(24, 35, 31, 0.88));
}

.play-panel.is-active {
  border-color: rgba(102, 194, 141, 0.65);
  box-shadow: 0 0 0 3px rgba(102, 194, 141, 0.08), 0 12px 32px rgba(0, 0, 0, 0.2);
}

.play-panel p {
  margin: 0;
}

.player-hand {
  min-width: 170px;
}

.player-hand-cards {
  display: flex;
  gap: 10px;
}

.player-hand-cards .card {
  width: 62px;
  height: 86px;
  border-radius: 9px;
  font-size: 24px;
}

.play-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.play-actions button {
  height: 38px;
  min-width: 74px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-2);
  font-weight: 800;
}

.play-actions button:hover:not(:disabled) {
  border-color: var(--brass);
}

.play-actions button.danger {
  color: #161007;
  background: var(--brass);
  border-color: rgba(210, 173, 90, 0.85);
}

.play-actions button.danger:hover:not(:disabled) {
  background: #e4c46c;
}

.play-actions label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.play-actions input {
  width: 112px;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #111315;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.control-section + .control-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-heading.compact {
  margin-bottom: 12px;
}

.settings-icon {
  color: var(--brass);
  font-family: Georgia, serif;
  font-size: 22px;
  opacity: 0.7;
}

.bot-search {
  height: 40px;
  margin: 12px 0 10px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--quiet);
  background: rgba(5, 10, 8, 0.5);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.bot-search:focus-within {
  border-color: rgba(230, 188, 98, 0.6);
  box-shadow: 0 0 0 3px rgba(230, 188, 98, 0.08);
}

.bot-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.bot-search input::placeholder { color: var(--quiet); }

.bot-list {
  display: grid;
  gap: 8px;
  max-height: 454px;
  padding-right: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.bot-row {
  display: grid;
  grid-template-columns: 18px 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.bot-row:hover {
  border-color: rgba(210, 173, 90, 0.7);
  transform: translateX(2px);
}

.bot-row.is-selected {
  border-color: rgba(210, 173, 90, 0.72);
  background: linear-gradient(90deg, rgba(230, 188, 98, 0.13), rgba(39, 39, 35, 0.5));
}

.bot-row input {
  margin-top: 9px;
  accent-color: var(--brass);
}

.bot-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #0f1916;
  font-size: 17px;
  filter: grayscale(0.1);
}

.bot-copy { min-width: 0; }

.tier-badge {
  align-self: center;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--quiet);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bot-row strong,
.bot-row small {
  display: block;
}

.bot-row small {
  margin-top: 2px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.settings-grid input,
.settings-grid select,
#code-picker {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #111315;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.run-button {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  border-radius: 11px;
  background: linear-gradient(180deg, #f1cb74, #dba94b);
  color: #15110b;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.45);
}

.run-button:hover:not(:disabled) {
  background: #e1bf68;
}

.run-button.secondary {
  margin-top: 0;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
}

.run-button.play {
  background: linear-gradient(180deg, #81d9a5, #59b783);
  color: #07130d;
}

.table-actions .run-button.play {
  width: auto;
  min-width: 142px;
  height: 34px;
  margin-top: 0;
  padding: 0 14px;
}

.run-button.play:hover:not(:disabled) {
  background: #79d99f;
}

.run-button.secondary:hover:not(:disabled) {
  background: #272a2e;
}

.batch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  align-items: end;
}

.batch-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.batch-controls .run-button {
  height: 44px;
}

.batch-controls input {
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 10px;
  color: var(--ink);
  background: #111315;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.bot-count {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.bot-count.is-invalid {
  color: var(--bad);
}

.event-strip input:disabled {
  opacity: 0.36;
}

.standings-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

.standings-table th,
.standings-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.standings-table th {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

.standings-table td:nth-child(1),
.standings-table td:nth-child(3),
.standings-table th:nth-child(1),
.standings-table th:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.batch-panel .standings-table td:nth-child(4),
.batch-panel .standings-table td:nth-child(5),
.batch-panel .standings-table th:nth-child(4),
.batch-panel .standings-table th:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.standings-table tbody tr:first-child td {
  color: var(--brass);
  font-weight: 800;
}

.standings-table tbody tr {
  transition: background-color 140ms ease;
}

.standings-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.rank-medal {
  width: 24px;
  height: 24px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 900;
}

.rank-medal.is-first {
  color: #241605;
  background: var(--brass);
  box-shadow: 0 0 18px rgba(230, 188, 98, 0.25);
}

.metric-cell { min-width: 112px; }

.metric-value { font-variant-numeric: tabular-nums; }

.metric-bar {
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.metric-bar span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #99702d, var(--brass));
  transform-origin: left;
  animation: growBar 500ms ease both;
}

.winner-name::before {
  content: "♛";
  margin-right: 7px;
  color: var(--brass);
}

#bot-code {
  min-height: 280px;
  max-height: 420px;
  margin: 12px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #f1ead7;
  background: #111315;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -18px;
  width: 9px;
  height: 16px;
  border-radius: 2px;
  animation: confettiFall var(--fall-time, 1800ms) cubic-bezier(.2,.6,.3,1) forwards;
}

@keyframes dealCard {
  from { opacity: 0; transform: translateY(-8px) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes seatIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes statusPulse {
  50% { transform: scale(1.35); box-shadow: 0 0 0 6px rgba(230, 188, 98, 0.08); }
}

@keyframes growBar { from { transform: scaleX(0); } }

@keyframes confettiFall {
  to { transform: translate3d(var(--drift, 0), 105vh, 0) rotate(760deg); opacity: .15; }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "table"
      "standings"
      "batch"
      "code";
  }

  .control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .bot-list { max-height: 520px; }

  .control-section + .control-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 760px) {
  body {
    padding: 10px;
  }

  .app-header,
  .table-toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .brand { align-items: flex-start; }
  .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 24px; }
  .brand-subtitle { display: none; }

  .table-actions {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .table-actions .run-button.play {
    width: 100%;
  }

  .app-header h1 {
    font-size: 24px;
  }

  .status {
    min-width: 0;
    text-align: left;
  }

  .control-panel {
    display: block;
  }

  .bot-list { max-height: 430px; }

  .table-panel {
    overflow-x: auto;
  }

  .control-section + .control-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .poker-table {
    min-height: 600px;
    min-width: 720px;
    margin-top: 72px;
  }

  .table-felt {
    inset: 190px 22px;
    border-width: 12px;
  }

  .seat {
    width: 134px;
  }

  .event-strip {
    grid-template-columns: 1fr;
  }

  .replay-progress { width: 100%; }

  .play-panel {
    grid-template-columns: 1fr;
  }

  .play-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .community .card {
    width: 38px;
    height: 54px;
    font-size: 15px;
  }

  .seat {
    width: 122px;
    padding: 8px;
  }

  .seat-cards .card {
    width: 30px;
    height: 42px;
    font-size: 12px;
  }

  .standings-table th,
  .standings-table td {
    padding: 8px 5px;
    font-size: 12px;
  }
}

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