:root {
  color-scheme: dark;
  --bg: #090d14;
  --panel: rgba(18, 27, 42, 0.86);
  --panel-strong: #121b2a;
  --line: #26364d;
  --text: #eef5ff;
  --muted: #94a3b8;
  --green: #34e0a1;
  --blue: #4d8dff;
  --red: #ff5570;
  --yellow: #f2c94c;
}

.stack-to-issue {
  color: #74f5bb;
  font-weight: 900;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 50% 0%, rgba(52, 224, 161, 0.11), transparent 30%), var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(9, 13, 20, 0.96), rgba(9, 13, 20, 0.72));
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.logout-button {
  border-color: rgba(255, 85, 112, 0.46);
  color: #ff9aaa;
}

.icon-button,
.primary-button,
.secondary-button,
.chip-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-strong);
  min-height: 42px;
}

.icon-button {
  width: 44px;
  font-weight: 800;
}

.title-block {
  min-width: 0;
}

.eyebrow,
.subline,
.stat-label,
.player-meta,
.action-meta {
  color: var(--muted);
  font-size: 12px;
}

h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  letter-spacing: 0;
}

.section-title {
  margin: 14px 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-title {
  margin: 4px 0 6px;
}

.notice,
.auth-card,
.empty,
.picker,
.dashboard,
.card,
.stat,
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.notice {
  padding: 12px;
  color: var(--yellow);
}

.action-confirmation {
  position: fixed;
  z-index: 1000;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  display: grid;
  gap: 3px;
  width: min(92vw, 460px);
  padding: 14px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(93, 255, 181, 0.7);
  border-radius: 16px;
  color: #eafff5;
  background: rgba(5, 52, 37, 0.96);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.54), 0 0 24px rgba(52, 224, 161, 0.22);
  text-align: center;
  animation: action-confirmation-in 180ms ease-out;
}

.action-confirmation strong {
  color: #78ffc2;
  font-size: 16px;
}

.action-confirmation span {
  font-size: 13px;
}

.action-confirmation.dealer-notification {
  z-index: 2147483000;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  width: min(94vw, 560px);
  border-width: 2px;
  border-color: rgba(242, 201, 76, 0.92);
  color: #fff8dc;
  background: linear-gradient(135deg, rgba(63, 43, 8, 0.98), rgba(18, 27, 38, 0.98));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.68), 0 0 32px rgba(242, 201, 76, 0.3);
}

.action-confirmation.dealer-notification strong {
  color: #ffe486;
  font-size: 17px;
}

.action-confirmation.dealer-notification span {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

@keyframes action-confirmation-in {
  from { opacity: 0; transform: translate(-50%, -12px) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.empty,
.auth-card,
.picker,
.dashboard {
  padding: 12px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #080d14;
  color: var(--text);
}

.candidate-list,
.list,
.table-list,
.actions-list {
  display: grid;
  gap: 8px;
}

.candidate,
.card,
.action-row {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  text-align: left;
}

.candidate {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1420;
  color: var(--text);
}

.candidate-title,
.player-name {
  font-weight: 800;
}

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

.stat {
  padding: 10px;
}

.stat-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 900;
}

.stack-sheet-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 4px;
}

.stack-sheet-head p,
.stack-sheet-hint {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.stack-sheet-head > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bcd0e8;
  font-size: 10px;
  font-weight: 800;
}

.stack-sheet-hint {
  margin-bottom: 10px;
}

.stack-sheet-tables {
  display: grid;
  gap: 10px;
}

.stack-table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 13, 21, 0.72);
}

.stack-table-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(52, 224, 161, 0.08);
}

.stack-table-card > header strong {
  color: #7dffc7;
  font-size: 14px;
}

.stack-table-card > header span {
  color: var(--muted);
  font-size: 10px;
}

.stack-table-list {
  display: grid;
}

.stack-player-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(112px, 35%);
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 7px 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
}

.stack-player-row:last-child {
  border-bottom: 0;
}

.stack-player-seat {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(77, 141, 255, 0.55);
  border-radius: 50%;
  color: #dcebff;
  background: rgba(77, 141, 255, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.stack-player-name {
  display: grid;
  min-width: 0;
}

.stack-player-name strong {
  overflow: hidden;
  color: #f5f9ff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-player-name small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-player-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(77, 141, 255, 0.5);
  border-radius: 8px;
  padding: 0 10px;
  color: #fff;
  background: #070d15;
  font-size: 17px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stack-player-input:focus {
  outline: 2px solid rgba(52, 224, 161, 0.5);
  border-color: var(--green);
}

.stack-player-input:disabled {
  opacity: 0.72;
}

.stack-save-state {
  position: absolute;
  right: 10px;
  bottom: 1px;
  min-height: 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.stack-player-row[data-save-state="dirty"] .stack-save-state { color: var(--yellow); }
.stack-player-row[data-save-state="saving"] .stack-save-state { color: #70b7ff; }
.stack-player-row[data-save-state="saved"] .stack-save-state { color: var(--green); }
.stack-player-row[data-save-state="error"] .stack-save-state { color: #ff8095; }

.stack-sheet-empty {
  padding: 20px 12px;
  text-align: center;
}

@media (min-width: 720px) {
  .stack-sheet-tables {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.director-actions {
  display: grid;
  margin-top: 10px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1420;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-color: rgba(52, 224, 161, 0.75);
  color: var(--text);
  background: rgba(52, 224, 161, 0.14);
}

.dealer-pwa-mode .tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.move-bar {
  position: sticky;
  top: 70px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(52, 224, 161, 0.7);
  border-radius: 8px;
  background: rgba(10, 32, 26, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.move-bar strong,
.move-bar span {
  display: block;
}

.move-bar span {
  color: var(--muted);
  font-size: 12px;
}

.search-box {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.search-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #080d14;
  color: var(--text);
}

.waiting-mobile-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  border: 1px solid rgba(52, 224, 161, .28);
  border-radius: 10px;
  background: rgba(52, 224, 161, .06);
  padding: 9px 10px;
}

.waiting-mobile-actions strong,
.waiting-mobile-actions span {
  display: block;
}

.waiting-mobile-actions strong {
  font-size: 14px;
}

.waiting-mobile-actions span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.waiting-mobile-actions .primary-button {
  min-height: 40px;
  white-space: nowrap;
}

.mobile-search-results {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.seat-picker-results {
  max-height: 360px;
}

.table-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 20%, rgba(52, 224, 161, 0.12), transparent 36%),
    var(--panel);
}

.table-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

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

.seat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-content: center;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  text-align: left;
  touch-action: manipulation;
}

.seat span {
  grid-row: span 2;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.seat strong,
.seat em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat strong {
  font-size: 13px;
}

.seat em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.occupied {
  background: rgba(77, 141, 255, 0.08);
}

.occupied::after {
  content: "удерж.";
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  opacity: 0.72;
}

.empty-seat {
  background: rgba(255, 255, 255, 0.025);
}

.drop-ready {
  border-color: rgba(52, 224, 161, 0.85);
  background: rgba(52, 224, 161, 0.16);
}

.selected {
  outline: 2px solid rgba(52, 224, 161, 0.8);
  outline-offset: 2px;
}

.player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.player-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 62px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 27, 42, 0.78);
}

.player-stats-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}

.player-stat-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: #dce8f7;
  background: rgba(255, 255, 255, 0.06);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.player-stat-badge.bounty,
.player-stat-item.bounty { border-color: rgba(255, 111, 111, 0.52); color: #ffb2b2; }
.player-stat-badge.reentry,
.player-stat-item.reentry { border-color: rgba(83, 169, 255, 0.58); color: #a9d4ff; }
.player-stat-badge.addon,
.player-stat-item.addon { border-color: rgba(52, 224, 161, 0.5); color: #8dffd0; }
.player-stat-badge.addon-plus,
.player-stat-item.addon-plus { border-color: rgba(226, 151, 255, 0.62); color: #edb8ff; }
.player-stat-badge.bonus,
.player-stat-item.bonus { border-color: rgba(242, 201, 76, 0.58); color: #ffe79a; }

.player-stats-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 9px 0 4px;
}

.player-stat-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

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

.player-stat-item strong {
  font-size: 17px;
  line-height: 1;
}

.player-stat-item em {
  grid-column: 1 / -1;
  color: currentColor;
  font-size: 9px;
  font-style: normal;
  opacity: 0.8;
}

.drag-handle,
.player-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.drag-handle {
  width: 42px;
  min-height: 42px;
  font-weight: 900;
  touch-action: none;
}

.player-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  text-align: left;
}

.search-player {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
}

.search-player .player-main {
  min-width: 0;
  min-height: 38px;
  width: 100%;
  padding: 5px 8px;
}

.search-player .player-main:disabled {
  opacity: 0.55;
}

.search-player .player-name,
.search-player .player-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-player .player-name {
  font-size: 15px;
  line-height: 1.15;
}

.search-player .player-meta {
  font-size: 11px;
  line-height: 1.1;
}

.search-player .status {
  grid-column: auto;
  align-self: center;
  justify-self: end;
  max-width: 72px;
  min-height: 22px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.search-player-add {
  align-self: center;
  min-height: 34px;
  padding: 0 10px;
  border-color: rgba(52, 224, 161, .45);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.search-player-registered {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.ghost {
  grid-column: 2 / -1;
  color: #cfe7ff;
  background: rgba(77, 141, 255, 0.12);
}

.bonus-action {
  border-color: rgba(242, 201, 76, 0.68);
  color: #ffe9a6;
  background: rgba(242, 201, 76, 0.12);
}

.selected-action {
  border-color: rgba(52, 224, 161, 0.9) !important;
  background: rgba(52, 224, 161, 0.18) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 2px rgba(52, 224, 161, 0.22);
}

.empty-line {
  padding: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(77, 141, 255, 0.18);
  color: #bcd3ff;
  font-size: 12px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.danger {
  border-color: rgba(255, 85, 112, 0.7);
  color: #ffd6de;
}

.primary-button {
  padding: 0 14px;
  background: var(--green);
  color: #04120d;
  font-weight: 900;
}

.secondary-button {
  padding: 0 14px;
}

dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  color: var(--text);
  padding: 0;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  max-height: calc(100dvh - 24px);
}

.dialog-body h2 {
  margin: 0;
  font-size: 18px;
}

.dialog-text,
.entry-sheet {
  margin: 0;
  color: var(--muted);
}

.entry-sheet {
  display: grid;
  gap: 8px;
}

#dialogFields {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #080d14;
  color: var(--text);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(18, 27, 42, 0), rgba(18, 27, 42, 0.96) 22%);
}

.dealer-pwa-mode .app-shell {
  width: min(760px, 100%);
}

.dealer-pwa-mode .dashboard {
  padding: 8px;
}

.dealer-pwa-mode .tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dealer-table-list {
  display: grid;
  gap: 12px;
}

.dealer-table-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(52, 224, 161, 0.34);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(17, 29, 42, 0.96), rgba(8, 14, 22, 0.98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.dealer-table-visual {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border: 3px solid rgba(226, 190, 86, 0.72);
  border-radius: 48% / 36%;
  background:
    radial-gradient(ellipse at center, rgba(37, 171, 116, 0.35), transparent 58%),
    linear-gradient(145deg, #0c6047, #073628 70%);
  box-shadow: inset 0 0 0 7px rgba(4, 13, 17, 0.44), inset 0 0 42px rgba(0, 0, 0, 0.4);
}

.dealer-table-center {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 4px;
  width: 42%;
  padding: 10px 8px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(3, 17, 14, 0.48);
  text-align: center;
  pointer-events: none;
}

.dealer-table-center strong {
  color: #ffe79a;
  font-size: 15px;
}

.dealer-table-center span {
  font-size: 10px;
}

.dealer-level-panel {
  gap: 3px;
  width: min(46%, 210px);
  padding: 9px 12px;
  border-color: rgba(242, 201, 76, 0.5);
  border-radius: 18px;
  background: rgba(3, 17, 14, 0.82);
  box-shadow: 0 9px 28px rgba(0, 0, 0, 0.34);
}

.dealer-level-panel.is-break {
  border-color: rgba(82, 196, 255, 0.76);
  background: rgba(7, 37, 56, 0.9);
}

.dealer-level-panel .dealer-level-label {
  color: #ffe79a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.dealer-level-panel .dealer-level-clock {
  color: #fff;
  font-size: clamp(25px, 7vw, 38px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dealer-level-panel .dealer-level-blinds {
  color: #8dffd0;
  font-size: 11px;
  font-weight: 800;
}

.dealer-level-panel .dealer-table-free {
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
}

.dealer-position-marker {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 91%;
  display: grid;
  grid-template-columns: 25px auto;
  gap: 5px;
  align-items: center;
  min-height: 38px;
  padding: 5px 9px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(242, 201, 76, 0.72);
  border-radius: 999px;
  color: #ffe89a;
  background: rgba(8, 15, 22, 0.96);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.38);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.dealer-position-marker span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  color: #151006;
  background: #f2c94c;
  font-size: 12px;
  font-weight: 900;
}

.dealer-table-seat {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 5px;
  align-items: center;
  width: clamp(90px, 29%, 118px);
  min-height: 62px;
  padding: 6px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  color: var(--text);
  background: rgba(7, 15, 24, 0.94);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.35);
  text-align: left;
  touch-action: manipulation;
}

.dealer-table-seat:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.dealer-table-seat.occupied::after {
  content: none;
}

.dealer-seat-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
}

.player-stat-badge.knockout {
  border-color: rgba(255, 92, 92, .66);
  color: #ffd2d2;
  background: rgba(160, 31, 40, .3);
}

.reentry-action small,
.bonus-action[data-reentry-hold] small {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  font-weight: 700;
  opacity: .72;
}

.knockout-winner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 196, 70, .72);
  border-radius: 10px;
  color: #fff1bc;
  background: rgba(82, 49, 7, .94);
  font-size: 12px;
  font-weight: 900;
}

.knockout-winner-banner button {
  min-height: 30px;
  padding: 3px 9px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px;
  color: #fff;
  background: rgba(255,255,255,.08);
}

.dealer-table-seat.knockout-winner-choice {
  z-index: 7;
  border: 3px solid #ffd05b !important;
  box-shadow: 0 0 0 4px rgba(255, 208, 91, .24), 0 0 24px rgba(255, 180, 35, .52) !important;
  animation: knockout-winner-pulse .9s ease-in-out infinite;
}

.dealer-table-seat.knockout-loser {
  opacity: .46;
  filter: grayscale(.7);
}

.knockout-winner-label {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 999px;
  color: #271803;
  background: #ffd05b;
  font-size: 7px;
  font-weight: 1000;
  white-space: nowrap;
}

@keyframes knockout-winner-pulse {
  50% { transform: translate(-50%, -50%) scale(1.05); }
}

.dealer-seat-stats .player-stat-badge {
  justify-content: center;
  min-height: 15px;
  min-width: 0;
  padding: 1px 2px;
  overflow: hidden;
  font-size: 7.5px;
}

.dealer-table-seat.empty-seat {
  justify-content: center;
  border-style: dashed;
  color: #b9c6d8;
  background: rgba(9, 23, 26, 0.72);
}

.dealer-table-seat.drop-ready {
  border-style: solid;
  border-color: #55f1b5;
  background: rgba(18, 112, 79, 0.88);
  animation: dealer-seat-pulse 1.1s ease-in-out infinite;
}

.dealer-seat-number {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #07120e;
  background: #f0cb58;
  font-size: 11px;
  font-weight: 900;
}

.dealer-table-seat strong,
.dealer-table-seat em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dealer-table-seat strong {
  font-size: 12px;
}

.dealer-table-seat em {
  color: #7ff0c3;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.dealer-table-seat .enhanced-addon-badge {
  position: absolute;
  right: 4px;
  bottom: -7px;
  padding: 3px 6px;
  font-size: 9px;
}

.dealer-player-club-card {
  position: absolute;
  z-index: 4;
  right: -5px;
  top: -12px;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  width: 54px;
  min-height: 27px;
  padding: 3px 4px;
  overflow: hidden;
  transform: rotate(4deg);
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 6px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .42);
  pointer-events: none;
}

.dealer-player-club-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 15%, rgba(255, 255, 255, .34) 42%, transparent 66%);
  opacity: .5;
}

.dealer-player-club-card-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 1000;
}

.dealer-player-club-card-copy {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  line-height: .9;
}

.dealer-player-club-card-copy b,
.dealer-player-club-card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dealer-player-club-card-copy b {
  font-size: 6.5px;
  letter-spacing: .04em;
}

.dealer-player-club-card-copy small {
  margin-top: 2px;
  font-size: 6px;
  font-weight: 800;
}

.dealer-player-club-card.is-regular {
  color: rgba(235, 242, 248, .86);
  border-color: rgba(255, 255, 255, .28);
  background: linear-gradient(135deg, rgba(142, 153, 165, .56), rgba(36, 44, 53, .58));
  backdrop-filter: blur(3px);
}

.dealer-player-club-card.is-silver {
  color: #202934;
  border-color: #f1f5f8;
  background: linear-gradient(135deg, #f7fafc 0%, #aebbc6 38%, #eef3f6 58%, #7d8d9c 100%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .42), 0 0 10px rgba(218, 231, 240, .3);
}

.dealer-player-club-card.is-gold {
  color: #2b1a02;
  border-color: #fff0a0;
  background: linear-gradient(135deg, #fff1a8 0%, #c78a16 35%, #ffe173 57%, #8d5808 100%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .42), 0 0 12px rgba(255, 196, 55, .42);
}

/* The whole occupied seat inherits the assigned club-card status. */
.dealer-table-seat.has-club-card {
  isolation: isolate;
  overflow: visible;
}

.dealer-table-seat.card-regular {
  border-color: rgba(205, 216, 226, .46);
  background: linear-gradient(145deg, rgba(83, 94, 105, .82), rgba(20, 29, 38, .88)) !important;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(4px);
}

.dealer-table-seat.card-silver {
  border-color: #ecf3f7;
  color: #111b24;
  background: linear-gradient(145deg, #f6f9fb 0%, #aab7c2 34%, #e8eef2 58%, #778794 100%) !important;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .42), 0 0 15px rgba(218, 232, 240, .34), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.dealer-table-seat.card-gold {
  border-color: #fff0a4;
  color: #2c1b02;
  background: linear-gradient(145deg, #fff0a0 0%, #c78913 34%, #ffe176 58%, #855104 100%) !important;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .44), 0 0 18px rgba(255, 190, 35, .46), inset 0 1px 0 rgba(255, 255, 255, .72);
}

.dealer-table-seat.card-silver > strong,
.dealer-table-seat.card-gold > strong {
  color: #121820;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}

.dealer-table-seat.card-silver > em,
.dealer-table-seat.card-gold > em {
  color: #153526;
}

.dealer-table-seat.card-silver .dealer-seat-number,
.dealer-table-seat.card-gold .dealer-seat-number {
  color: #fff;
  background: rgba(11, 19, 27, .82);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.dealer-table-seat.card-silver .player-stat-badge,
.dealer-table-seat.card-gold .player-stat-badge {
  color: #111a21;
  border-color: rgba(15, 24, 31, .2);
  background: rgba(255, 255, 255, .4);
}

.dealer-pwa-mode .entry-sheet {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dealer-pwa-mode .entry-sheet > div {
  grid-column: 1 / -1;
}

.dealer-pwa-mode .entry-sheet > button {
  min-height: 48px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 900;
}

body.director-table-mode {
  height: 100dvh;
  overflow: hidden;
}

.director-table-mode .app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  padding: 0;
}

.director-table-mode .topbar {
  position: relative;
  height: 58px;
  padding: 5px 10px;
}

.director-table-mode .topbar .eyebrow,
.director-table-mode .topbar .subline {
  font-size: 9px;
}

.director-table-mode .topbar h1 {
  font-size: 14px;
}

.director-table-mode main,
.director-table-mode .dashboard,
.director-table-mode #tablesPanel {
  height: calc(100dvh - 58px);
  min-height: 0;
}

.director-table-mode .dashboard {
  padding: 0;
  border: 0;
  background: transparent;
}

.director-table-mode .summary-grid,
.director-table-mode .director-actions,
.director-table-mode .tabs {
  display: none;
}

.director-table-mode #tablesPanel {
  display: block;
}

.director-table-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 5px;
  height: 100%;
  padding: 6px;
  overflow: hidden;
}

.director-level-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(242, 201, 76, 0.3);
  border-radius: 12px;
  background: rgba(7, 14, 23, 0.93);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.director-level-controls button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid rgba(145, 169, 198, 0.28);
  border-radius: 9px;
  color: #f4f8ff;
  background: rgba(21, 34, 51, 0.96);
  font-size: 16px;
  font-weight: 900;
  touch-action: manipulation;
}

.director-level-controls button:active {
  transform: translateY(1px);
  filter: brightness(1.25);
}

.director-level-controls button:disabled {
  opacity: 0.5;
}

.director-level-controls button span {
  color: #ffe28a;
  font-size: 25px;
  line-height: 1;
}

.director-level-controls button small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.05;
}

.director-level-controls .director-level-toggle {
  border-color: rgba(242, 201, 76, 0.72);
  color: #102116;
  background: linear-gradient(135deg, #ffe07a, #d4a72c);
}

.director-level-controls .director-level-toggle small {
  color: #352907;
}

.director-level-controls .director-level-toggle.is-paused {
  border-color: rgba(52, 224, 161, 0.7);
  background: linear-gradient(135deg, #64efbd, #26a779);
}

.dealer-level-clock-button {
  display: grid;
  justify-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  pointer-events: auto;
  touch-action: manipulation;
}

.dealer-level-clock-button > span {
  font-size: inherit;
  font-weight: inherit;
}

.dealer-level-clock-button small {
  margin-top: -3px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.director-table-toolbar {
  display: grid;
  grid-template-columns: 38px minmax(88px, 0.7fr) minmax(120px, 1.3fr) 38px;
  gap: 6px;
  align-items: center;
}

.director-table-arrow {
  min-height: 36px;
  border: 1px solid rgba(242, 201, 76, 0.5);
  border-radius: 9px;
  color: #ffe79a;
  background: rgba(10, 18, 28, 0.94);
  font-size: 27px;
  line-height: 1;
}

.director-table-title,
.director-dealer-pill {
  display: grid;
  min-width: 0;
  min-height: 38px;
  align-content: center;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 20, 31, 0.94);
}

.director-table-title strong,
.director-dealer-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.director-table-title span,
.director-dealer-pill span {
  color: var(--muted);
  font-size: 9px;
}

.director-dealer-pill {
  border-color: rgba(52, 224, 161, 0.42);
}

.director-dealer-pill strong {
  color: #8dffd0;
}

.director-table-stage {
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.director-table-visual {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 49% / 38%;
}

.director-table-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
}

.director-table-footer button {
  min-height: 42px;
  font-size: 12px;
  font-weight: 900;
}

.danger-button {
  border: 1px solid rgba(255, 85, 112, 0.72);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #9d243b, #5f1628);
}

.danger-button:disabled {
  opacity: 0.45;
}

.director-swipe-hint {
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

@media (orientation: landscape) {
  .director-table-mode .topbar {
    height: 46px;
  }

  .director-table-mode main,
  .director-table-mode .dashboard,
  .director-table-mode #tablesPanel {
    height: calc(100dvh - 46px);
  }

  .director-table-screen {
    grid-template-columns: minmax(0, 1fr) 190px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .director-table-toolbar,
  .director-level-controls,
  .director-table-stage,
  .director-swipe-hint {
    grid-column: 1;
  }

  .director-level-controls {
    width: min(620px, 94%);
    justify-self: center;
    padding: 2px;
  }

  .director-level-controls button {
    min-height: 34px;
  }

  .director-table-footer {
    grid-column: 2;
    grid-row: 1 / 5;
    align-content: end;
    grid-template-columns: 1fr;
  }

  .director-table-visual .dealer-table-seat {
    width: clamp(82px, 19%, 118px);
    min-height: 50px;
  }
}

.reentry-action {
  border-color: rgba(62, 194, 255, 0.72);
  color: #d6f3ff;
  background: rgba(31, 122, 173, 0.28);
}

.addon-action {
  border-color: rgba(255, 173, 66, 0.72);
  color: #ffe1ad;
  background: rgba(184, 100, 24, 0.27);
}

.bounty-action {
  border-color: rgba(242, 201, 76, 0.72);
  color: #fff0a6;
  background: rgba(151, 121, 21, 0.28);
}

.dealer-no-table {
  padding: 20px;
  text-align: center;
}

@keyframes dealer-seat-pulse {
  50% { box-shadow: 0 0 0 4px rgba(85, 241, 181, 0.2), 0 8px 22px rgba(0, 0, 0, 0.38); }
}

@media (orientation: landscape) and (max-height: 620px) {
  .dealer-pwa-mode .summary-grid {
    display: none;
  }

  .dealer-table-visual {
    min-height: 380px;
  }

  .dealer-table-seat {
    width: clamp(92px, 22%, 126px);
    min-height: 54px;
  }
}

.hidden {
  display: none !important;
}

.enhanced-addon-action {
  color: #fff;
  border-color: rgba(226, 151, 255, 0.8);
  background: linear-gradient(135deg, #7038c8, #c13c9e);
  box-shadow: 0 8px 20px rgba(151, 52, 194, 0.24);
}

.enhanced-addon-badge {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid rgba(226, 151, 255, 0.75);
  border-radius: 999px;
  color: #f3c8ff;
  background: rgba(123, 43, 176, 0.42);
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 360px) {
  .app-shell {
    padding: 8px;
  }

  h1 {
    font-size: 16px;
  }

  .tabs {
    gap: 4px;
  }

  .tab {
    font-size: 12px;
  }

  .seat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-card {
    grid-template-columns: 40px 1fr;
  }

  .player-card .status {
    grid-column: 2;
    justify-self: start;
  }

  .search-player {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-player .status {
    display: none;
  }
}

@media (max-width: 640px) {
  dialog {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin: auto 8px 8px;
  }

  .dialog-body {
    padding: 10px;
    gap: 8px;
    max-height: calc(100dvh - 16px);
  }

  .dialog-body h2 {
    font-size: 16px;
  }

  .mobile-search-results {
    max-height: 170px;
  }

  .seat-picker-results {
    max-height: 240px;
  }

  .field input,
  .field select,
  .search-input {
    font-size: 16px;
    min-height: 40px;
  }
}
