:root {
  color-scheme: dark;
  --bg: #0f1012;
  --panel: #181a1d;
  --soft: #22252a;
  --text: #f5f1e8;
  --muted: #9ea3a8;
  --line: #34383f;
  --line-strong: #4b515a;
  --accent: #d9a441;
  --accent-soft: #332a17;
  --accent-strong: #f0c15b;
  --gold: #d9a441;
  --check: #d9a441;
  --fold: #3d7fb8;
  --call: #58b766;
  --raise: #f2383d;
  --allin: #8f1d1d;
  --black-card: #2d3137;
  --heart-card: #b81818;
  --diamond-card: #1e5fbf;
  --club-card: #13843a;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.36);
  --radius: 8px;
  --shell-padding: 12px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@supports (padding-top: constant(safe-area-inset-top)) {
  :root {
    --safe-area-top: constant(safe-area-inset-top);
    --safe-area-right: constant(safe-area-inset-right);
    --safe-area-bottom: constant(safe-area-inset-bottom);
    --safe-area-left: constant(safe-area-inset-left);
  }
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

button,
input,
select,
textarea {
  font: inherit;
  touch-action: manipulation;
}

button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

button:hover:not(:disabled) {
  border-color: #68717d;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  width: min(430px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding:
    calc(var(--shell-padding) + var(--safe-area-top))
    calc(var(--shell-padding) + var(--safe-area-right))
    calc(var(--shell-padding) + var(--safe-area-bottom))
    calc(var(--shell-padding) + var(--safe-area-left));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

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

.topbar {
  margin-bottom: 20px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-logo:hover:not(:disabled) {
  border-color: transparent;
}

.brand-wordmark {
  width: min(318px, calc(100vw - 32px));
  height: auto;
  display: block;
}

.top-actions,
.dialog-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 820;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 780;
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  min-height: 0;
  overflow: hidden;
}

.capture-stack,
.side-stack {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.capture-stack {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
}

.side-stack {
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.compact-panel,
.step-card,
.flow-panel,
.hand-card,
.queue-panel {
  padding: 14px;
}

.hand-card,
.queue-panel {
  min-height: 0;
  overflow: auto;
}

.flow-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.flow-top,
.flow-nav,
.flow-step-heading,
.size-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.flow-progress {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 4px 0;
}

.phase-label {
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
}

.flow-card {
  min-height: 0;
  display: grid;
  align-content: stretch;
  gap: 14px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 10px;
}

.flow-card.flow-forward {
  animation: slideForward 180ms ease-out;
}

.flow-card.flow-back {
  animation: slideBack 180ms ease-out;
}

.flow-card.flow-vertical {
  animation: slideVertical 200ms ease-out;
}

.step-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.capture-screen {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: visible;
}

.board-screen {
  grid-template-rows: auto auto;
  align-content: start;
  gap: 12px;
}

.preflop-screen,
.street-screen {
  grid-template-rows: minmax(0, 1fr) auto;
}

.hero-screen {
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 12px;
}

.setup-screen {
  grid-template-rows: auto;
  align-content: start;
  justify-items: stretch;
}

.setup-flat {
  align-content: start;
  padding-top: 12px;
}

.note-screen {
  grid-template-rows: minmax(0, 1fr) auto;
}

.screen-kicker {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pot-stack {
  justify-self: center;
  width: min(180px, 72%);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(240, 193, 91, 0.38);
  border-radius: 0;
  background: transparent;
}

.pot-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.pot-total {
  color: var(--accent-strong);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}

.board-screen .pot-stack {
  margin-top: -2px;
  margin-bottom: 2px;
}

.board-screen .board-stage {
  align-self: start;
}

.center-stage {
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101214;
  text-align: center;
}

.setup-stage {
  align-content: center;
  gap: 18px;
}

.screen-title {
  font-size: clamp(40px, 18vw, 76px);
  line-height: 0.95;
  font-weight: 920;
}

.screen-subtitle,
.screen-foot {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.screen-foot {
  min-height: 22px;
  text-align: center;
}

.stakes-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-content: start;
  justify-self: stretch;
}

.stack-field {
  display: grid;
  gap: 7px;
}

.stack-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.stack-field input,
.stack-field textarea {
  text-align: center;
  font-size: 20px;
  font-weight: 860;
}

.stake-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(132px, 1.08fr);
  gap: 14px;
  align-items: center;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid rgba(75, 81, 90, 0.72);
  background: transparent;
  text-align: left;
}

.stake-field span {
  align-self: auto;
  color: var(--accent-strong);
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  text-transform: none;
}

.stake-field input {
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border-color: var(--line-strong);
  font-size: 27px;
  text-align: right;
}

.player-count-stepper {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 0;
  border: 0;
  border-bottom: 1px solid rgba(75, 81, 90, 0.72);
  background: transparent;
}

.player-count-stepper > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.player-count-stepper span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  font-weight: 820;
  text-transform: none;
}

.player-count-stepper strong {
  display: block;
  margin-top: 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  font-weight: 920;
}

.stepper-controls {
  display: flex;
  gap: 8px;
}

.stepper-controls button {
  width: 46px;
  height: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border-radius: 50%;
  background: var(--accent);
  color: #171614;
  font-size: 26px;
  line-height: 1;
  font-weight: 920;
}

.hero-stack-field,
.inline-stack {
  width: min(360px, 100%);
  justify-self: center;
}

.seat-stage {
  align-content: center;
}

.seat-stage .pot-stack {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.street-pot-header {
  width: min(260px, 82%);
  display: grid;
  justify-items: center;
  gap: 10px;
  justify-self: center;
}

.street-pot-header .pot-stack {
  width: 100%;
}

.street-board-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
}

.street-board-row .card-mini {
  width: 38px;
  height: 52px;
  font-size: 19px;
}

.hero-seat-stage {
  border-color: rgba(217, 164, 65, 0.72);
  background:
    linear-gradient(180deg, rgba(217, 164, 65, 0.14), rgba(16, 18, 20, 0) 46%),
    #101214;
  box-shadow: inset 0 0 0 1px rgba(240, 193, 91, 0.12);
}

.hero-turn-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #171614;
  font-size: 13px;
  font-weight: 920;
}

.locked-stack {
  width: min(260px, 100%);
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(240, 193, 91, 0.38);
  border-radius: var(--radius);
  background: rgba(217, 164, 65, 0.12);
}

.locked-stack span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.locked-stack strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 920;
}

.size-entry-stage {
  align-content: center;
}

.size-action-name {
  font-size: clamp(52px, 16vw, 92px);
  line-height: 0.95;
  font-weight: 920;
}

.size-field {
  width: min(320px, 100%);
}

.size-field input {
  height: 64px;
  font-size: clamp(28px, 9vw, 38px);
  text-align: center;
}

.position-grid.compact-position-grid {
  grid-template-columns: repeat(3, 1fr);
}

.hero-pick,
.board-pick {
  min-height: 124px;
  justify-content: center;
}

.big-player-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141619;
}

.big-player-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
  text-transform: uppercase;
}

.big-player-line strong {
  font-size: 30px;
}

.big-player-line em {
  font-style: normal;
  font-size: 20px;
  font-weight: 780;
}

.micro-builder {
  display: grid;
  gap: 10px;
}

.action-console {
  display: grid;
  gap: 14px;
}

.turn-card {
  min-height: 136px;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101214;
  text-align: center;
}

.street-screen .turn-card {
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 16px;
  padding: 18px;
}

.street-actor-summary {
  min-height: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 12px 0 4px;
}

.turn-kicker {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 820;
  text-transform: uppercase;
}

.turn-player {
  font-size: clamp(48px, 11vw, 88px);
  line-height: 0.95;
  font-weight: 900;
}

.turn-meta {
  color: var(--muted);
  font-size: 17px;
  font-weight: 760;
  text-transform: none;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.action-button {
  min-height: 74px;
  padding: 0 12px;
  border: 0;
  color: #ffffff;
  font-size: clamp(18px, 3.5vw, 28px);
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.28);
}

.action-fold {
  background: var(--fold);
}

.action-check {
  background: var(--check);
  color: #171614;
  text-shadow: none;
}

.action-call {
  background: var(--call);
}

.action-raise {
  background: var(--raise);
}

.action-allin {
  grid-column: 2 / 3;
  background: var(--allin);
}

.action-count-3 .action-button:last-child {
  grid-column: 1 / -1;
}

.action-count-5 .action-button:last-child {
  grid-column: 1 / -1;
}

.two-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.size-line input {
  flex: 1;
}

.size-line button {
  width: 110px;
}

.mini-summary {
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111316;
}

.flow-nav button {
  flex: 1;
}

@keyframes slideForward {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideBack {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideVertical {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chipDrop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.step-card {
  display: grid;
  gap: 14px;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.step-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #27231f;
  color: #ffffff;
  font-size: 14px;
  font-weight: 820;
}

.players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.player-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.player-title {
  font-size: 15px;
  font-weight: 860;
}

.player-bottom {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
}

label span,
.builder-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #111316;
  color: var(--text);
}

input,
select {
  height: 44px;
  padding: 0 10px;
}

textarea {
  padding: 10px;
  line-height: 1.42;
  resize: vertical;
}

.note-screen textarea {
  min-height: 92px;
  max-height: 132px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 760;
  text-align: left;
  resize: none;
}

textarea:focus,
input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(11, 111, 99, 0.22);
  outline-offset: 1px;
}

.position-grid,
.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 8px;
}

.position-chip,
.action-chip {
  min-height: 46px;
  padding: 0 8px;
  font-weight: 800;
}

.position-chip.active,
.action-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.card-slot,
.board-slots {
  width: 100%;
  min-height: 88px;
  padding: 10px;
  border-style: dashed;
  background: #141619;
}

.double-slot,
.board-slots,
.preview-board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.empty-card {
  width: 50px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: #111316;
  font-size: 22px;
  font-weight: 800;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr 110px;
  gap: 10px;
  align-items: end;
}

.action-grid {
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
}

.full-button {
  width: 100%;
}

.timeline {
  display: grid;
  gap: 10px;
}

.street-lane {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.street-lane-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.street-lane-title em {
  color: var(--accent-strong);
  font-style: normal;
}

.visual-note {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141619;
}

.visual-note.is-empty {
  display: none;
}

.visual-note div {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.visual-note p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.42;
  font-weight: 720;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 34px;
}

.visual-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 999px;
  background: #111316;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 760;
}

.visual-action strong {
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #171614;
  text-align: center;
  font-size: 12px;
}

.visual-action.decision {
  border-color: var(--gold);
  background: var(--accent-soft);
}

.empty-line {
  color: var(--muted);
  font-size: 13px;
}

.hand-hero {
  display: grid;
  gap: 8px;
}

.final-review {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101214;
  overflow: auto;
}

.final-review .pot-stack {
  margin-bottom: 2px;
}

.final-review .hand-hero {
  min-height: 0;
}

.final-review .players-preview {
  grid-template-columns: 1fr;
}

.final-review .street-lane {
  padding: 8px;
}

.visual-stakes {
  display: inline-flex;
  justify-self: start;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 820;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #171614;
  font-size: 12px;
  font-weight: 760;
}

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

.player-preview {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141619;
}

.player-preview-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.player-preview-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 18px;
}

.player-preview-main strong {
  font-size: 24px;
}

.seat-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seat-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111316;
  font-size: 13px;
  font-weight: 820;
}

.seat-preview.folded {
  color: var(--muted);
  opacity: 0.65;
  text-decoration: line-through;
}

.seat-preview em {
  color: var(--muted);
  font-style: normal;
  font-weight: 760;
}

.count-pill {
  justify-content: center;
  min-width: 32px;
}

.card-row,
.preview-board {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.card-tile {
  width: 50px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  color: #ffffff;
  font-weight: 900;
  font-size: 25px;
  box-shadow: inset 0 -10px 16px rgba(0, 0, 0, 0.13);
}

.card-mini {
  width: 34px;
  height: 46px;
  font-size: 18px;
}

.suit-s {
  background: var(--black-card);
}

.suit-h {
  background: var(--heart-card);
}

.suit-d {
  background: var(--diamond-card);
}

.suit-c {
  background: var(--club-card);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #171614;
  font-weight: 820;
}

.primary-button:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.secondary-button {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.ghost-button {
  background: transparent;
  font-weight: 760;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 30px;
  line-height: 1;
}

.queue-list {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.queue-item {
  width: 100%;
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #141619;
  text-align: left;
}

.queue-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 111, 99, 0.13);
}

.queue-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.queue-title {
  font-size: 17px;
  font-weight: 860;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.status-dot.reviewed {
  background: var(--accent);
}

.empty-state {
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.card-dialog,
.hand-dialog,
.size-dialog {
  width: min(820px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.size-dialog {
  width: min(360px, calc(100vw - 32px));
}

.card-dialog::backdrop,
.hand-dialog::backdrop,
.size-dialog::backdrop {
  background: rgba(18, 15, 12, 0.64);
}

.card-dialog-body,
.hand-dialog-body,
.size-dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #252321;
  color: #ffffff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}

.hand-dialog-body {
  background: var(--panel);
  color: var(--text);
}

.size-dialog-body {
  gap: 16px;
  background: #191b1f;
  color: var(--text);
}

.size-dialog-kicker {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 860;
  text-transform: uppercase;
}

.size-dialog-body h2 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1;
  font-weight: 920;
}

.size-dialog-field input {
  height: 68px;
  font-size: 34px;
  font-weight: 900;
  text-align: center;
}

.size-dialog-footer {
  justify-content: flex-end;
}

.size-allin-button {
  width: auto;
  min-width: 92px;
  min-height: 44px;
  padding: 0 12px;
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--allin);
  color: #ffffff;
  font-size: 13px;
  font-weight: 920;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.26);
}

.card-dialog-body .muted {
  color: #c4bbb1;
}

.selected-cards {
  min-height: 70px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.inline-card-picker {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.inline-selected-cards {
  min-height: 58px;
  padding: 8px;
}

.inline-selected-cards .card-tile,
.inline-selected-cards .empty-card {
  width: 42px;
  height: 56px;
  font-size: 21px;
}

.empty-selected-card {
  width: 42px;
  height: 56px;
  display: inline-block;
  border: 1px dashed rgba(158, 163, 168, 0.45);
  border-radius: 6px;
  background: rgba(17, 19, 22, 0.72);
}

.card-grid-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.inline-card-grid-scroll {
  margin: 0 -2px;
}

.card-grid {
  min-width: 670px;
  display: grid;
  gap: 6px;
}

.inline-card-grid {
  min-width: 610px;
}

.inline-card-grid .card-choice {
  height: 48px;
  min-height: 48px;
  font-size: 22px;
}

.card-grid-row {
  display: grid;
  grid-template-columns: 26px repeat(13, minmax(42px, 1fr));
  gap: 5px;
  align-items: stretch;
}

.suit-label {
  display: grid;
  place-items: center;
  color: #ddd6cc;
  font-size: 20px;
  font-weight: 900;
}

.card-choice {
  height: 58px;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.card-choice.selected {
  outline: 3px solid #ffffff;
  outline-offset: -5px;
}

.card-choice:disabled {
  opacity: 0.34;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-area-bottom));
  transform: translateX(-50%) translateY(80px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #171614;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  font-weight: 760;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

  .side-stack {
    order: 0;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  h1 {
    font-size: 24px;
  }

  .players-grid,
  .player-bottom,
  .players-preview,
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .flow-card {
    min-height: 0;
  }

  .capture-screen {
    gap: 10px;
  }

  .center-stage {
    padding: 14px;
  }

  .screen-title {
    font-size: clamp(40px, 18vw, 76px);
  }

  .compact-position-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .action-raise,
  .action-allin {
    grid-column: auto;
  }

  .action-button {
    min-height: 74px;
  }

  .flow-top {
    align-items: flex-start;
  }

  .position-grid,
  .chip-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-heading {
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .position-grid,
  .chip-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow-progress {
    gap: 5px;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }
}
