:root {
  --gold: #c9a227;
  --gold-bright: #f0d060;
  --gold-dim: #8a6a10;
  --felt-dark: #0d2818;
  --felt-mid: #1a4a2e;
  --felt-light: #245f3a;
  --table-rim-dark: #07170d;
  --table-rim-light: #163520;
  --cream: #f8efd0;
  --text-body: #d8cda7;
  --text-muted: #8ea27a;
  --action-red: #b03030;
  --action-green: #2d8a4a;
  --action-blue: #2860a0;
  --action-purple: #7b42a0;
  --card-w: clamp(72px, 4.8vw, 116px);
  --card-h: calc(var(--card-w) * 1.405);
  --tray-chip-size: clamp(54px, 3.8vw, 72px);
  --bet-chip-size: clamp(62px, 4.35vw, 84px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body.dealer-table-page {
  margin: 0;
  color: var(--text-body);
  font-family: Georgia, "Times New Roman", serif;
  background-color: var(--felt-dark);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(20, 80, 40, 0.42) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(7, 42, 20, 0.62) 0%, transparent 62%),
    linear-gradient(135deg, #020805 0%, #082415 48%, #020302 100%);
  user-select: none;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

.dealer-table-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.72);
}

.top-bar {
  min-height: 68px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1a3a20 0%, #102916 100%);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.58);
}

.return-link,
.topbar-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  background: #0f2615;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.return-link {
  min-width: 92px;
  padding: 8px 14px;
  font-size: clamp(17px, 1.1vw, 22px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.return-link::before {
  content: "\2630";
  margin-right: 8px;
  font-family: Arial, sans-serif;
}

.topbar-button {
  padding: 8px 14px;
  color: var(--text-secondary, #d6c58a);
  border-color: var(--gold-dim);
  font-size: clamp(15px, 0.95vw, 20px);
}

.return-link:hover,
.topbar-button:hover:not(:disabled) {
  background: var(--felt-mid);
  color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.36);
  transform: translateY(-1px);
}

.stat-group {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.metric-card {
  min-width: clamp(104px, 8.8vw, 146px);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.32);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card.changed {
  border-color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.5);
}

.metric-label,
.panel-kicker,
.chip-info-label {
  color: var(--text-muted);
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.7vw, 14px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--gold-bright);
  font-size: clamp(22px, 1.55vw, 31px);
  line-height: 1.08;
  text-shadow: 0 0 8px rgba(201, 162, 39, 0.28);
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 10;
}

.service-menu {
  position: relative;
}

.service-toggle {
  min-width: 118px;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}

.service-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--gold-bright);
  transition: transform 0.18s ease;
}

.service-menu.is-open .service-toggle::after {
  transform: rotate(180deg);
}

.service-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 228px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(201, 162, 39, 0.78);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(18, 50, 30, 0.98) 0%, rgba(8, 24, 15, 0.98) 100%);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 236, 174, 0.12) inset;
}

.service-dropdown[hidden] {
  display: none !important;
}

.service-dropdown-item {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgba(201, 162, 39, 0.34);
  border-radius: 10px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.28);
  font-size: clamp(17px, 1vw, 22px);
  font-weight: 900;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.service-dropdown-item:hover {
  background: rgba(24, 77, 45, 0.72);
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.26);
  transform: translateY(-1px);
}

.mute-toggle {
  width: 46px;
  min-width: 46px;
  padding: 0;
  position: relative;
}

.speaker-icon {
  position: relative;
  width: 22px;
  height: 18px;
  display: inline-block;
}

.speaker-box {
  position: absolute;
  left: 0;
  top: 5px;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(240, 208, 96, 0.88);
  border-right: 0;
  background: linear-gradient(180deg, rgba(240, 208, 96, 0.95), rgba(171, 125, 22, 0.9));
}

.speaker-box::after {
  content: "";
  position: absolute;
  right: -9px;
  top: -4px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid rgba(240, 208, 96, 0.92);
  filter: drop-shadow(0 0 4px rgba(240, 208, 96, 0.24));
}

.speaker-wave {
  position: absolute;
  right: 0;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 2px solid rgba(240, 208, 96, 0.92);
  border-right: 2px solid rgba(240, 208, 96, 0.92);
  border-radius: 0 100% 0 0;
  opacity: 1;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
  transition: opacity 0.2s ease;
}

.speaker-wave.wave-1 {
  right: 2px;
}

.speaker-wave.wave-2 {
  right: -4px;
  width: 13px;
  height: 13px;
}

.mute-toggle.is-muted .speaker-wave {
  opacity: 0.16;
}

.mute-toggle.is-muted::after,
.mute-toggle.is-muted::before {
  content: "";
  position: absolute;
  width: 2px;
  height: 22px;
  background: linear-gradient(180deg, #ffd67d, #a24a28);
  box-shadow: 0 0 8px rgba(255, 214, 125, 0.22);
  border-radius: 999px;
  top: 50%;
  left: 50%;
}

.mute-toggle.is-muted::after {
  transform: translate(-50%, -50%) rotate(42deg);
}

.mute-toggle.is-muted::before {
  transform: translate(-50%, -50%) rotate(-42deg);
}

.options-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.options-modal-shell[hidden] {
  display: none !important;
}

.options-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 15, 10, 0.7);
  backdrop-filter: blur(4px);
}

.options-modal {
  position: relative;
  width: min(780px, 94vw);
  border: 1px solid rgba(201, 162, 39, 0.72);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(17, 48, 28, 0.96) 0%, rgba(9, 26, 15, 0.96) 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.54),
    0 0 0 1px rgba(240, 208, 96, 0.18) inset;
  overflow: hidden;
}

.service-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.service-modal-shell[hidden] {
  display: none !important;
}

.service-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 15, 10, 0.72);
  backdrop-filter: blur(4px);
}

.service-modal {
  position: relative;
  width: min(960px, 94vw);
  max-height: min(86vh, 920px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(201, 162, 39, 0.78);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(17, 48, 28, 0.97) 0%, rgba(8, 24, 15, 0.98) 100%);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.54),
    0 0 0 1px rgba(240, 208, 96, 0.18) inset;
  overflow: hidden;
}

.service-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 232, 169, 0.08), transparent 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 52%);
}

.service-modal-header,
.service-modal-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}

.service-modal h2 {
  margin: 6px 0 0;
  color: var(--gold-bright);
  font-size: clamp(30px, 2vw, 40px);
  line-height: 1;
}

.service-modal-header {
  border-bottom: 1px solid rgba(201, 162, 39, 0.34);
}

.service-modal-footer {
  border-top: 1px solid rgba(201, 162, 39, 0.24);
  justify-content: flex-end;
}

.service-modal-body {
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
}

.prose-scroll {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.service-section {
  padding: 18px 20px;
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
}

.service-section h3 {
  margin: 0 0 10px;
  color: var(--gold-bright);
  font-size: clamp(24px, 1.5vw, 34px);
}

.service-section h4 {
  margin: 14px 0 8px;
  color: #fff1bf;
  font-size: clamp(18px, 1.16vw, 25px);
}

.service-section p,
.service-section li {
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 0.98vw, 19px);
  line-height: 1.58;
}

.service-section ul,
.service-section ol {
  margin: 10px 0 0 20px;
  padding: 0;
}

.service-callout {
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: rgba(201, 162, 39, 0.08);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.service-card {
  padding: 14px 16px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 14px;
  background: rgba(8, 21, 12, 0.46);
}

.service-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-bright);
  font-size: clamp(18px, 1.1vw, 22px);
}

.service-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.service-table th,
.service-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  text-align: left;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 0.92vw, 18px);
}

.service-table th {
  color: var(--gold-bright);
  font-weight: 900;
}

.option-row-range {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 280px);
  align-items: center;
}

.option-range-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.option-range-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--gold-bright);
}

.option-range-value {
  min-width: 52px;
  color: var(--gold-bright);
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 0.92vw, 18px);
  font-weight: 900;
  text-align: right;
}

.chip-change-modal {
  width: min(820px, 94vw);
}

.table-rules-modal {
  width: min(900px, 94vw);
}

.stats-modal {
  width: min(980px, 95vw);
}

.observer-modal {
  width: min(860px, 94vw);
}

.dev-unlock-modal {
  width: min(720px, 92vw);
}

.dev-qa-modal {
  width: min(1120px, 96vw);
}

.service-modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#dev-qa-modal-shell.dev-qa-docked {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 18px 18px 0;
  pointer-events: none;
}

#dev-qa-modal-shell.dev-qa-docked .service-modal-backdrop {
  opacity: 0;
  pointer-events: none;
}

#dev-qa-modal-shell.dev-qa-docked .dev-qa-modal {
  width: min(420px, 34vw);
  max-height: min(240px, 30vh);
  margin: 0;
  border-radius: 18px;
  pointer-events: auto;
  overflow: hidden;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55);
}

#dev-qa-modal-shell.dev-qa-docked .dev-qa-body {
  gap: 10px;
}

#dev-qa-modal-shell.dev-qa-docked .dev-qa-grid,
#dev-qa-modal-shell.dev-qa-docked .dev-qa-list-panel,
#dev-qa-modal-shell.dev-qa-docked .dev-qa-results,
#dev-qa-modal-shell.dev-qa-docked .dev-qa-scenario-list,
#dev-qa-modal-shell.dev-qa-docked #dev-qa-clear-button,
#dev-qa-modal-shell.dev-qa-docked #dev-qa-run-all-button,
#dev-qa-modal-shell.dev-qa-docked #dev-qa-run-selected-button,
#dev-qa-modal-shell.dev-qa-docked .dev-qa-audit-control,
#dev-qa-modal-shell.dev-qa-docked .dev-qa-results-panel h3 {
  display: none !important;
}

#dev-qa-modal-shell.dev-qa-docked .dev-qa-toolbar {
  justify-content: flex-end;
}

#dev-qa-modal-shell.dev-qa-docked #dev-qa-run-audit-button {
  display: none !important;
}

#dev-qa-modal-shell.dev-qa-docked .dev-qa-summary {
  margin-bottom: 0;
  min-height: 96px;
  font-size: clamp(13px, 0.85vw, 16px);
}

.dev-unlock-body,
.dev-qa-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dev-code-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}

.dev-code-input {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgba(201, 162, 39, 0.42);
  border-radius: 10px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.42);
  font-size: clamp(18px, 1.1vw, 22px);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-align: center;
}

.dev-unlock-message {
  min-height: 24px;
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 0.9vw, 18px);
}

.dev-unlock-message.is-error {
  color: #ffb3ad;
}

.dev-unlock-message.is-success {
  color: #b9ffca;
}

.dev-qa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dev-qa-audit-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(13px, 0.86vw, 16px);
  font-weight: 700;
}

.dev-qa-audit-control input {
  width: 88px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid rgba(201, 162, 39, 0.42);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--gold-bright);
  font: 800 clamp(15px, 0.96vw, 18px) / 1 Arial, sans-serif;
  text-align: center;
}

.dev-qa-audit-control input:focus {
  outline: 2px solid rgba(255, 214, 94, 0.7);
  outline-offset: 2px;
}

.observer-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.observer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.observer-summary {
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 0.9vw, 17px);
  line-height: 1.5;
}

.observer-last-round {
  display: grid;
  gap: 10px;
}

.observer-last-round .round-history-row {
  margin: 0;
}

.observer-inline-resume {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 24;
  min-width: min(18rem, 42vw);
  min-height: 74px;
  padding: 18px 38px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 223, 119, 0.7);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(84, 195, 108, 0.96), rgba(28, 103, 54, 0.96));
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.44),
    0 0 0 1px rgba(255, 221, 132, 0.35) inset,
    0 0 24px rgba(109, 215, 122, 0.28);
  color: #fff3bf;
  font-size: clamp(28px, 2.2vw, 40px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.observer-inline-resume:hover {
  transform: translate(-50%, -50%) scale(1.03);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 221, 132, 0.4) inset,
    0 0 28px rgba(109, 215, 122, 0.34);
  filter: brightness(1.04);
}

.observer-inline-resume:active {
  transform: translate(-50%, -50%) scale(0.98);
}

.observer-inline-resume[hidden] {
  display: none !important;
}

#observer-modal-shell.observer-docked {
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 18px 18px 0;
  pointer-events: none;
}

#observer-modal-shell.observer-docked .service-modal-backdrop {
  opacity: 0;
  pointer-events: none;
}

#observer-modal-shell.observer-docked .observer-modal {
  width: min(320px, 26vw);
  max-height: min(260px, 34vh);
  margin: 0;
  pointer-events: auto;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55);
}

#observer-modal-shell.observer-docked .observer-intro,
#observer-modal-shell.observer-docked .observer-last-round {
  display: none !important;
}

#observer-modal-shell.observer-docked .observer-summary {
  min-height: 96px;
  margin: 0;
}

#observer-modal-shell.observer-docked .observer-body {
  gap: 10px;
}

.dev-qa-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.dev-qa-list-panel,
.dev-qa-results-panel {
  min-height: 460px;
}

.dev-qa-scenario-list,
.dev-qa-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dev-qa-scenario-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.dev-qa-scenario-item input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--gold);
}

.dev-qa-scenario-item strong {
  display: block;
  color: var(--gold-bright);
  font-size: clamp(16px, 1vw, 21px);
}

.dev-qa-scenario-item span,
.dev-qa-result-card p,
.dev-qa-summary,
.dev-qa-empty {
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 0.9vw, 17px);
  line-height: 1.5;
}

.dev-qa-summary {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.dev-qa-result-card {
  padding: 14px 16px;
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.dev-qa-result-card.is-pass {
  border-color: rgba(128, 235, 156, 0.3);
  box-shadow: inset 0 0 0 1px rgba(128, 235, 156, 0.08);
}

.dev-qa-result-card.is-fail {
  border-color: rgba(255, 122, 122, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 122, 0.08);
}

.dev-qa-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.dev-qa-result-title strong {
  color: var(--gold-bright);
  font-size: clamp(17px, 1.02vw, 22px);
}

.dev-qa-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.76vw, 14px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dev-qa-badge.is-pass {
  color: #0b2315;
  background: #9ce8b1;
}

.dev-qa-badge.is-fail {
  color: #2d0909;
  background: #ff9e97;
}

.dev-qa-assertions {
  margin: 8px 0 0 18px;
  padding: 0;
}

.dev-qa-assertions li {
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(13px, 0.86vw, 16px);
  line-height: 1.45;
}

.dev-qa-empty {
  padding: 12px 0;
}

.chip-change-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chip-change-summary {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.chip-change-bankroll-card {
  padding: 16px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.chip-change-bankroll-card strong {
  display: block;
  margin-top: 6px;
  color: var(--gold-bright);
  font-size: clamp(26px, 1.8vw, 38px);
}

.chip-change-summary p {
  margin: 0;
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 0.98vw, 18px);
  line-height: 1.55;
}

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

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.chip-change-grid input[type="number"] {
  min-width: 140px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(201, 162, 39, 0.42);
  border-radius: 10px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.38);
  font-size: clamp(16px, 1vw, 20px);
  font-weight: 800;
}

.chip-exchange-preview,
.chip-exchange-inventory {
  padding: 18px 20px;
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
}

.chip-exchange-preview h3,
.chip-exchange-inventory h3 {
  margin: 0 0 10px;
  color: var(--gold-bright);
  font-size: clamp(22px, 1.35vw, 30px);
}

.chip-exchange-preview p,
.chip-exchange-inventory p,
.chip-exchange-preview li,
.chip-exchange-inventory li {
  color: #dfe6c5;
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 0.94vw, 18px);
  line-height: 1.5;
}

.chip-exchange-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats-card {
  padding: 14px 16px;
  border: 1px solid rgba(201, 162, 39, 0.24);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.stats-card strong {
  display: block;
  margin-top: 6px;
  color: var(--gold-bright);
  font-size: clamp(22px, 1.4vw, 30px);
}

.stats-card span {
  color: #dce6c2;
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 0.82vw, 15px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feedback-summary,
.round-history-list,
.decision-log-list {
  display: grid;
  gap: 10px;
}

.feedback-row,
.round-history-row,
.decision-log-row {
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 12px;
  background: rgba(8, 21, 12, 0.4);
}

.feedback-row strong,
.round-history-row strong,
.decision-log-row strong {
  color: var(--gold-bright);
}

.feedback-row p,
.round-history-row p,
.decision-log-row p {
  margin: 6px 0 0;
}

.decision-log-row.is-correct {
  border-color: rgba(121, 233, 155, 0.34);
}

.decision-log-row.is-incorrect {
  border-color: rgba(255, 119, 109, 0.34);
}

.chip-exchange-chip-card {
  padding: 12px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 14px;
  background: rgba(8, 21, 12, 0.46);
  text-align: center;
}

.chip-exchange-chip-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-bright);
  font-size: clamp(18px, 1.04vw, 22px);
}

.chip-exchange-chip-card span {
  color: #dce6c2;
  font-family: Arial, sans-serif;
  font-size: clamp(14px, 0.86vw, 16px);
}

.service-accept-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.player-name-modal {
  max-width: min(40rem, 92vw);
}

.player-name-modal input[type="text"] {
  width: min(18rem, 100%);
  padding: 0.8rem 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(201, 162, 39, 0.55);
  background: rgba(255, 250, 234, 0.96);
  color: #14381f;
  font: 600 1rem/1.1 "Georgia", "Times New Roman", serif;
  box-shadow: inset 0 0 0.5rem rgba(0, 0, 0, 0.12);
}

.player-name-modal input[type="text"]:focus {
  outline: 2px solid rgba(255, 214, 94, 0.7);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .chip-change-summary,
  .chip-change-grid,
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

.options-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 232, 169, 0.09), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 50%);
}

.options-modal-header,
.options-modal-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}

.options-modal-header {
  border-bottom: 1px solid rgba(201, 162, 39, 0.34);
}

.options-modal-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px 26px;
}

.options-kicker {
  color: var(--text-muted);
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.7vw, 14px);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.options-modal h2 {
  margin: 6px 0 0;
  color: var(--gold-bright);
  font-size: clamp(30px, 2vw, 40px);
  line-height: 1;
}

.options-close-button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.28);
  font-size: clamp(15px, 0.96vw, 19px);
  font-weight: 900;
  cursor: pointer;
}

.options-close-button:hover {
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.34);
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(201, 162, 39, 0.26);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
}

.option-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-name {
  color: var(--gold-bright);
  font-size: clamp(20px, 1.24vw, 26px);
  font-weight: 900;
}

.option-note {
  color: #d7ddb9;
  font-family: Arial, sans-serif;
  font-size: clamp(13px, 0.86vw, 16px);
  line-height: 1.35;
}

.option-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--gold);
}

.option-row select {
  min-width: 168px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(201, 162, 39, 0.42);
  border-radius: 10px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.38);
  font-size: clamp(16px, 1vw, 20px);
  font-weight: 800;
}

.status-bar {
  min-height: 32px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #142e1c 0%, #0d2014 100%);
  border-bottom: 1px solid #2d5a3a;
}

.status-tag,
.phase-pill {
  min-width: 82px;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--gold);
  color: #0d2014;
  font-family: Arial, sans-serif;
  font-size: clamp(13px, 0.82vw, 17px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.status-text {
  flex: 1;
  text-align: center;
  color: var(--cream);
  font-size: clamp(17px, 1.05vw, 23px);
  font-style: italic;
}

.round-tag {
  min-width: 88px;
  background: #1a4a2e;
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
}

.game-area {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(252px, 15vw, 346px);
  gap: 6px;
  padding: 12px;
}

.table-wrap {
  min-width: 0;
  min-height: 0;
  display: flex;
  position: relative;
}

.table {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 14px solid var(--table-rim-dark);
  border-radius: 50% / 22%;
  background-color: #0a2414;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.18 0 0 0 0 0.10 0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>"),
    radial-gradient(ellipse 90% 70% at 50% 0%, #2a6a40 0%, #1a4a2a 35%, #0e3018 70%, #061a0d 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: overlay, normal;
  box-shadow:
    0 0 0 2px var(--gold) inset,
    0 0 30px rgba(0, 0, 0, 0.65),
    0 0 70px rgba(0, 0, 0, 0.45);
}

.table::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 38% 55% at 50% -8%, rgba(255, 240, 180, 0.54) 0%, rgba(255, 220, 130, 0.28) 18%, rgba(255, 200, 100, 0.12) 38%, rgba(255, 200, 100, 0.04) 55%, transparent 75%),
    radial-gradient(ellipse 70% 80% at 50% -20%, rgba(255, 230, 160, 0.18) 0%, rgba(255, 220, 140, 0.06) 40%, transparent 70%);
  mix-blend-mode: screen;
}

.table::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 60% 25% at 50% 30%, rgba(255, 230, 160, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 90% 80% at 50% 35%, transparent 55%, rgba(0, 0, 0, 0.56) 100%),
    radial-gradient(ellipse 100% 60% at 50% 110%, rgba(0, 0, 0, 0.38) 0%, transparent 60%);
}

.lamp,
.table-gloss,
.shoe-visual,
.dealer-layer,
.player-seat-layer,
.table-center,
.table-diamond {
  z-index: 4;
}

.lamp {
  position: absolute;
  top: -2px;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translateX(-50%);
}

.lamp-cord {
  width: 2px;
  height: 18px;
  background: linear-gradient(180deg, #2a2a2a 0%, #111 100%);
}

.lamp-shade {
  position: relative;
  width: clamp(86px, 6vw, 120px);
  height: clamp(22px, 1.6vw, 30px);
  border: 1px solid #1a0e04;
  border-top-color: #4a3018;
  border-radius: 50% 50% 18% 18% / 80% 80% 100% 100%;
  background:
    radial-gradient(ellipse 60% 90% at 50% 100%, rgba(255, 235, 160, 0.9) 0%, rgba(180, 120, 40, 0.6) 40%, #3a2410 70%, #1a0e04 100%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.72),
    inset 0 -6px 12px rgba(255, 200, 100, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.lamp-glow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 60px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 235, 160, 0.8) 0%, rgba(255, 200, 100, 0.4) 50%, transparent 80%);
  filter: blur(2px);
  transform: translateX(-50%);
}

.table-gloss {
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 30%;
  border-radius: 50% / 100% 100% 0 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 50%, transparent 100%);
}

.table-center {
  position: absolute;
  top: 38%;
  left: 50%;
  width: 100%;
  text-align: center;
  pointer-events: none;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  opacity: 0.54;
  mix-blend-mode: screen;
}

.center-line-1 {
  margin-bottom: 5px;
  color: rgba(244, 219, 139, 0.58);
  font-size: clamp(12px, 1.12vw, 23px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
}

.center-line-2 {
  margin-bottom: 7px;
  color: rgba(248, 239, 208, 0.46);
  font-size: clamp(7px, 0.5vw, 11px);
  font-weight: 800;
  letter-spacing: 0.3em;
}

.center-line-3 {
  color: rgba(220, 179, 87, 0.48);
  font-size: clamp(9px, 0.74vw, 15px);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: none;
}

.table-diamond {
  position: absolute;
  bottom: 2.1%;
  left: 50%;
  width: 18px;
  height: 18px;
  pointer-events: none;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.62);
  transform: translateX(-50%) rotate(45deg);
}

.shoe-visual {
  position: absolute;
  top: 3.7%;
  left: 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  color: var(--gold-bright);
  font-family: Arial, sans-serif;
  font-size: clamp(9px, 0.7vw, 12px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
  transform: translateX(-50%);
}

.shoe-visual::after {
  content: "6 deck shoe";
  padding-bottom: 2px;
}

.shoe-slot {
  width: clamp(66px, 5.8vw, 108px);
  height: clamp(22px, 1.8vw, 34px);
  border-radius: 6px;
  border: 1px solid rgba(217, 180, 90, 0.36);
  background:
    repeating-linear-gradient(90deg, rgba(20, 20, 20, 0.96) 0 8px, rgba(55, 55, 55, 0.96) 8px 11px),
    linear-gradient(180deg, #0d0d0d, #222);
  box-shadow: inset 0 0 10px #000;
}

.dealer-layer,
.player-seat-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dealer-area,
.player-seat {
  position: absolute;
  color: var(--cream);
  text-align: center;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.dealer-area {
  left: 50%;
  top: 10.6%;
  width: clamp(170px, 14vw, 255px);
}

.bet-window-beacon {
  position: absolute;
  top: 48%;
  min-width: clamp(130px, 11vw, 210px);
  display: grid;
  gap: 10px;
  justify-items: center;
  color: rgba(244, 219, 139, 0.74);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  transform: translateY(-50%);
}

.bet-window-beacon.is-right {
  left: calc(100% + 34px);
}

.bet-window-beacon.is-left {
  right: calc(100% + 34px);
}

.bet-window-title,
.bet-window-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(92px, 8vw, 180px);
  text-shadow:
    0 0 12px rgba(240, 208, 96, 0.24),
    0 2px 5px rgba(0, 0, 0, 0.36);
  transform-origin: center;
}

.bet-window-title {
  font-size: clamp(12px, 1.12vw, 23px);
  letter-spacing: 0.08em;
  animation: beaconGrowPulse 3.2s ease-in-out infinite;
}

.bet-window-count {
  font-size: clamp(11px, 1vw, 21px);
  letter-spacing: 0.12em;
  animation: beaconGrowPulse 3.2s ease-in-out infinite 1.1s;
}

.bet-window-count .countdown-value {
  min-width: 1.35em;
}

.player-seat {
  width: clamp(150px, 11.5vw, 220px);
  --bet-circle-x: 0%;
  --bet-circle-y: 0%;
  --card-side-x: 110%;
  --card-side-y: -180%;
  --dealer-bank-x: 0vw;
  --dealer-bank-y: -54vh;
  --player-rack-x: 0%;
  --player-rack-y: 132%;
}

.player-seat[data-seat-id="player1"] {
  left: 13%;
  top: 79.6%;
  --dealer-bank-x: 39vw;
  --dealer-bank-y: -58vh;
  --player-rack-x: -28%;
  --player-rack-y: 140%;
}

.player-seat[data-seat-id="player2"] {
  left: 30.5%;
  top: 82.4%;
  --dealer-bank-x: 21vw;
  --dealer-bank-y: -58vh;
  --player-rack-x: -12%;
  --player-rack-y: 138%;
}

.player-seat[data-seat-id="user"] {
  left: 50%;
  top: 79.4%;
  width: clamp(180px, 14vw, 270px);
  --dealer-bank-x: 2vw;
  --dealer-bank-y: -54vh;
  --player-rack-x: 0%;
  --player-rack-y: 144%;
}

.player-seat[data-seat-id="player4"] {
  left: 69.5%;
  top: 82.4%;
  --dealer-bank-x: -16vw;
  --dealer-bank-y: -58vh;
  --player-rack-x: 12%;
  --player-rack-y: 138%;
}

.player-seat[data-seat-id="player5"] {
  left: 87%;
  top: 79.6%;
  --dealer-bank-x: -34vw;
  --dealer-bank-y: -58vh;
  --player-rack-x: 28%;
  --player-rack-y: 140%;
}

.seat-panel,
.dealer-panel {
  position: relative;
  padding: 6px;
  border-radius: 10px;
}

.dealer-panel {
  min-height: clamp(52px, 4.4vw, 82px);
  border: 1px dashed rgba(201, 162, 39, 0.34);
  background: rgba(0, 0, 0, 0.06);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.dealer-area.is-requesting {
  --dealer-lean-x: 0px;
  --dealer-lean-r: 0deg;
}

.dealer-area.is-requesting[data-target-seat-id="player1"] {
  --dealer-lean-x: -16px;
  --dealer-lean-r: -6deg;
}

.dealer-area.is-requesting[data-target-seat-id="player2"] {
  --dealer-lean-x: -9px;
  --dealer-lean-r: -3deg;
}

.dealer-area.is-requesting[data-target-seat-id="player4"] {
  --dealer-lean-x: 9px;
  --dealer-lean-r: 3deg;
}

.dealer-area.is-requesting[data-target-seat-id="player5"] {
  --dealer-lean-x: 16px;
  --dealer-lean-r: 6deg;
}

.dealer-area.is-requesting .dealer-panel {
  border-color: rgba(255, 225, 154, 0.72);
  box-shadow: 0 0 18px rgba(255, 225, 154, 0.22), inset 0 0 18px rgba(255, 225, 154, 0.08);
  animation: dealerLean 0.72s ease both;
}

.dealer-area.is-requesting .dealer-panel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: clamp(32px, 2.6vw, 48px);
  height: clamp(13px, 1vw, 19px);
  border: 1px solid rgba(126, 72, 35, 0.7);
  border-radius: 999px 999px 60% 60%;
  background:
    radial-gradient(circle at 70% 38%, rgba(255, 235, 205, 0.95), transparent 32%),
    linear-gradient(180deg, #e2b37b, #a56437);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%) rotate(var(--dealer-lean-r));
  animation: dealerTap 0.72s ease both;
}

.dealer-action-prompt {
  position: absolute;
  left: 50%;
  bottom: -39px;
  z-index: 8;
  min-width: clamp(92px, 7.5vw, 142px);
  padding: 5px 9px;
  border: 1px solid rgba(240, 208, 96, 0.7);
  border-radius: 999px;
  color: #fff4bc;
  background: rgba(0, 0, 0, 0.72);
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 0.86vw, 17px);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  transform: translateX(-50%);
  animation: promptPop 0.24s ease both;
}

.seat-panel {
  background: transparent;
}

.player-seat.user-seat .seat-panel {
  border: 1px solid rgba(201, 162, 39, 0.52);
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.24), inset 0 0 14px rgba(201, 162, 39, 0.08);
}

.observer-analysis-card {
  padding: 6px 8px;
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 10px;
  background: rgba(8, 21, 12, 0.9);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.observer-seat-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 16;
  width: clamp(86px, 6.4vw, 118px);
  transform: translateX(-50%);
  pointer-events: none;
}

.observer-seat-card.seat-user {
  top: 52%;
}

.observer-seat-card.seat-player1,
.observer-seat-card.seat-player5 {
  top: 48%;
}

.observer-seat-card.seat-player2,
.observer-seat-card.seat-player4 {
  top: 49%;
}

.observer-analysis-title {
  color: var(--gold-bright);
  font-size: clamp(10px, 0.72vw, 13px);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.05;
}

.observer-analysis-score {
  margin-top: 2px;
  color: #fff4bc;
  font-family: Arial, sans-serif;
  font-size: clamp(10px, 0.74vw, 12px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
}

.player-seat.is-active .seat-panel,
.dealer-area.is-active .dealer-panel {
  animation: activeSeatGlow 1.4s ease-in-out infinite;
}

.seat-heading,
.dealer-heading {
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.seat-name,
.dealer-name {
  color: var(--gold-bright);
  font-size: clamp(15px, 1.14vw, 24px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.75);
}

.status-chip {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.42);
  color: #dbe8c4;
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.82vw, 17px);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.status-chip.win,
.status-chip.blackjack {
  color: #a9ffbd;
  border-color: rgba(121, 233, 155, 0.5);
}

.status-chip.lose,
.status-chip.bust {
  color: #ffaaa4;
  border-color: rgba(255, 119, 109, 0.52);
}

.hand-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
}

.hand-block {
  position: relative;
  min-width: 0;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.hand-block.is-active-hand {
  border-color: rgba(255, 225, 154, 0.58);
  background: rgba(255, 225, 154, 0.08);
  box-shadow: 0 0 22px rgba(255, 225, 154, 0.22);
}

.player-gesture {
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 9;
  width: clamp(94px, 7.6vw, 146px);
  height: clamp(76px, 5.9vw, 116px);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.gesture-hand {
  position: absolute;
  left: 50%;
  top: 44%;
  width: clamp(48px, 3.8vw, 70px);
  height: clamp(40px, 3vw, 56px);
  transform: translate(-50%, -50%) rotate(-14deg);
}

.gesture-palm,
.gesture-finger,
.gesture-thumb {
  position: absolute;
  border: 1px solid rgba(129, 76, 40, 0.62);
  background:
    linear-gradient(180deg, rgba(253, 220, 178, 0.98) 0%, rgba(220, 167, 116, 0.98) 56%, rgba(176, 113, 72, 0.98) 100%);
  box-shadow:
    0 7px 13px rgba(0, 0, 0, 0.38),
    inset 0 1px 2px rgba(255, 255, 255, 0.34),
    inset 0 -2px 3px rgba(112, 55, 28, 0.22);
}

.gesture-palm {
  left: 50%;
  bottom: 0;
  width: 62%;
  height: 56%;
  border-radius: 42% 38% 46% 44%;
  transform: translateX(-50%);
}

.gesture-finger {
  top: 0;
  width: 14%;
  border-radius: 999px;
}

.finger-1 { left: 22%; height: 58%; transform: rotate(-5deg); }
.finger-2 { left: 37%; height: 66%; transform: rotate(-1deg); }
.finger-3 { left: 52%; height: 64%; transform: rotate(2deg); }
.finger-4 { left: 67%; height: 54%; transform: rotate(7deg); }

.gesture-thumb {
  left: 4%;
  bottom: 13%;
  width: 24%;
  height: 28%;
  border-radius: 999px;
  transform: rotate(-42deg);
}

.gesture-hit .gesture-hand {
  animation: hitTap 0.72s ease both;
}

.gesture-stand {
  animation: standWave 0.86s ease both;
}

.gesture-double .gesture-hand {
  animation: doublePoint 0.92s ease both;
}

.gesture-split .gesture-hand {
  animation: splitSignal 0.94s ease both;
}

.gesture-split .finger-1 {
  box-shadow: clamp(8px, 0.7vw, 12px) 0 0 rgba(239, 187, 125, 0.96);
}

.gesture-surrender .gesture-hand {
  animation: surrenderDraw 0.88s ease both;
}

.gesture-tap-ring {
  position: absolute;
  left: 50%;
  top: 76%;
  width: clamp(26px, 2.2vw, 42px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 238, 178, 0.78);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: tapRipple 0.72s ease-out both;
}

.gesture-chip {
  position: absolute;
  left: 27%;
  top: 73%;
  width: clamp(25px, 2vw, 38px);
  aspect-ratio: 1;
  border: 3px dashed rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle, #f0d060 0 31%, #b48509 32% 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.34);
  animation: gestureChipSlide 0.88s ease both;
}

.gesture-chip.split-chip {
  box-shadow: 26px 0 0 rgba(180, 133, 9, 0.95), 0 4px 10px rgba(0, 0, 0, 0.34);
}

.gesture-surrender-line {
  position: absolute;
  left: 50%;
  top: 72%;
  width: clamp(48px, 4vw, 78px);
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 238, 178, 0.88);
  transform: translate(-50%, -50%) scaleX(0);
  animation: surrenderLine 0.86s ease both;
}

.action-toast {
  position: absolute;
  left: 50%;
  top: 67%;
  z-index: 12;
  padding: 4px 10px;
  border: 1px solid rgba(240, 208, 96, 0.72);
  border-radius: 999px;
  color: #0b2114;
  background: linear-gradient(180deg, #fff0a8, #d9a90f);
  font-family: Arial, sans-serif;
  font-size: clamp(13px, 0.9vw, 18px);
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.36);
  transform: translate(-50%, -50%);
  animation: actionToastPop 0.72s ease both;
}

.hand-label {
  margin-bottom: 2px;
  color: #fff1bf;
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.82vw, 16px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cards-row {
  min-height: calc(var(--card-h) + 4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: calc(var(--card-w) * 0.17);
}

.cards-row:empty::after {
  content: "";
  width: calc(var(--card-w) * 0.76);
  height: calc(var(--card-h) * 0.78);
  border: 1px dashed rgba(201, 162, 39, 0.48);
  border-radius: 8px;
}

.dealer-area .cards-row {
  min-height: clamp(48px, 4vw, 78px);
}

.dealer-area .cards-row:empty::after {
  width: clamp(44px, 3.4vw, 66px);
  height: clamp(58px, 4.5vw, 86px);
}

.playing-card {
  --deal-from-x: 0px;
  --deal-from-y: -24vh;
  width: var(--card-w);
  height: var(--card-h);
  margin-left: calc(var(--card-w) * -0.17);
  border-radius: 8px;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.46));
  transform-origin: 50% 80%;
  will-change: transform, opacity;
}

.playing-card.is-new-card {
  animation: dealCard 0.62s cubic-bezier(0.18, 0.78, 0.28, 1.04) backwards;
}

.playing-card.is-hole-reveal {
  animation: flipHoleCard 0.42s ease both;
}

.playing-card:nth-child(2n) {
  transform: rotate(2deg);
}

.playing-card:nth-child(3n) {
  transform: rotate(-3deg);
}

.playing-card img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}

.hand-value {
  min-height: 20px;
  margin-top: 3px;
  color: #f8d988;
  font-family: Arial, sans-serif;
  font-size: clamp(13px, 0.95vw, 19px);
  font-weight: 800;
}

.hand-value:empty {
  display: none;
}

.bet-zone {
  position: relative;
  min-height: clamp(82px, 7.3vw, 132px);
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.bet-zone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(78px, 6.4vw, 116px);
  aspect-ratio: 1;
  border: 1px dashed rgba(201, 162, 39, 0.58);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
  transform: translate(-50%, -50%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.bet-zone.is-drop-target::after {
  content: "Drop Chips";
  position: absolute;
  left: 50%;
  top: 50%;
  color: rgba(201, 162, 39, 0.34);
  font-family: Arial, sans-serif;
  font-size: clamp(10px, 0.7vw, 13px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.bet-zone.has-chips::after {
  content: none;
}

.bet-zone.drag-over::before {
  border-color: var(--gold-bright);
  background: rgba(201, 162, 39, 0.18);
  box-shadow: 0 0 20px rgba(201, 162, 39, 0.52), inset 0 0 18px rgba(201, 162, 39, 0.15);
  transform: translate(-50%, -50%) scale(1.05);
}

.bet-zone.is-active-bet::before {
  border-color: rgba(255, 236, 174, 0.9);
  background: rgba(255, 225, 154, 0.1);
  box-shadow: 0 0 20px rgba(255, 225, 154, 0.36), inset 0 0 14px rgba(255, 225, 154, 0.12);
}

.bet-pile {
  position: relative;
  z-index: 2;
  width: clamp(86px, 7vw, 126px);
  height: clamp(78px, 6.4vw, 116px);
}

.settlement-payout-pile {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: clamp(72px, 5.8vw, 112px);
  height: clamp(72px, 5.8vw, 112px);
  pointer-events: none;
}

.settlement-payout-pile.settle-payout .payout-chip {
  animation: payoutFromDealer 1.28s ease-in-out both;
}

.settlement-payout-pile.settle-celebrate .payout-chip {
  transform: translate(var(--card-side-x), var(--card-side-y)) rotate(calc(var(--r, 0deg) - 22deg)) scale(0.9);
}

.settlement-payout-pile.settle-rack .payout-chip {
  animation: winnerToPlayerRack 1.34s ease-in both;
}

.bet-total {
  position: absolute;
  left: 50%;
  bottom: -17px;
  z-index: 3;
  padding: 2px 9px;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.68);
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 0.82vw, 16px);
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
}

.mini-balance {
  display: block;
  width: 100%;
  color: #cfe1b8;
  font-family: Arial, sans-serif;
  font-size: clamp(9px, 0.68vw, 12px);
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.casino-chip {
  --chip-a: #f6f2e6;
  --chip-b: #cfc8b8;
  --chip-ink: #111;
  position: relative;
  width: var(--tray-chip-size);
  height: var(--tray-chip-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: var(--chip-ink);
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.74vw, 15px);
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.68);
  background:
    radial-gradient(circle at center, #f7f2df 0 26%, transparent 27%),
    radial-gradient(circle at center, var(--chip-a) 0 46%, transparent 47%),
    repeating-conic-gradient(from 0deg, var(--chip-a) 0deg 18deg, #f7f7f7 18deg 28deg, var(--chip-b) 28deg 45deg),
    radial-gradient(circle at center, var(--chip-a) 0 67%, var(--chip-b) 68% 100%);
  box-shadow:
    0 5px 9px rgba(0, 0, 0, 0.34),
    inset 0 2px 3px rgba(255, 255, 255, 0.34),
    inset 0 -4px 6px rgba(0, 0, 0, 0.3);
}

.casino-chip::before {
  content: "";
  position: absolute;
  inset: 21%;
  border: 2px solid rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.casino-chip span {
  position: relative;
  z-index: 1;
}

.chip-1 { --chip-a: #f7f7f1; --chip-b: #c9c9bd; --chip-ink: #111; text-shadow: none; }
.chip-5 { --chip-a: #d7312f; --chip-b: #8f1215; --chip-ink: #fff; }
.chip-10 { --chip-a: #2673d9; --chip-b: #103f8b; --chip-ink: #fff; }
.chip-25 { --chip-a: #15914d; --chip-b: #07582b; --chip-ink: #fff; }
.chip-50 { --chip-a: #8b42c9; --chip-b: #4e1f80; --chip-ink: #fff; }
.chip-100 { --chip-a: #202020; --chip-b: #050505; --chip-ink: #fff; }
.chip-200 { --chip-a: #f1c83d; --chip-b: #b48509; --chip-ink: #111; text-shadow: none; }
.chip-250 { --chip-a: #25b7b8; --chip-b: #0a6970; --chip-ink: #fff; }
.chip-500 { --chip-a: #e97820; --chip-b: #a64009; --chip-ink: #fff; }
.chip-1000 { --chip-a: #dadde3; --chip-b: #9097a2; --chip-ink: #111; text-shadow: none; }

.bet-chip {
  --tray-chip-size: var(--bet-chip-size);
  position: absolute;
  left: calc(50% + var(--x, 0px));
  top: calc(50% + var(--y, 0px));
  cursor: default;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}

.bet-chip.is-new-chip {
  animation: chipDrop 0.22s ease-out both;
  animation-delay: var(--chip-delay, 0ms);
}

.bet-chip.is-removable {
  cursor: pointer;
}

.bet-chip.is-removable:hover {
  filter: brightness(1.1);
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.45),
    0 0 12px rgba(255, 210, 100, 0.38),
    inset 0 2px 3px rgba(255, 255, 255, 0.34),
    inset 0 -4px 6px rgba(0, 0, 0, 0.3);
}

.bet-pile.is-lose.settle-results .bet-chip {
  animation: lossSweep 1.02s ease-in-out both;
}

.bet-pile.is-lose.settle-collect .bet-chip {
  animation: lossToDealer 1.28s ease-in-out both;
}

.bet-pile.is-lose.settle-payout .bet-chip,
.bet-pile.is-lose.settle-celebrate .bet-chip,
.bet-pile.is-lose.settle-rack .bet-chip,
.bet-pile.is-lose.settle-complete .bet-chip {
  opacity: 0.12;
  transform: translate(var(--dealer-bank-x), var(--dealer-bank-y)) rotate(calc(var(--r, 0deg) + 70deg)) scale(0.72);
}

.bet-pile.is-win.settle-complete .bet-chip {
  opacity: 0;
  transform: translate(var(--player-rack-x), var(--player-rack-y)) rotate(calc(var(--r, 0deg) - 58deg)) scale(0.58);
}

.bet-pile.is-win.settle-celebrate .bet-chip {
  transform: translate(var(--bet-circle-x), var(--bet-circle-y)) rotate(calc(var(--r, 0deg) - 10deg)) scale(0.98);
}

.bet-pile.is-win.settle-rack .bet-chip {
  animation: winnerToPlayerRack 1.34s ease-in both;
}

.bet-pile.is-push.settle-results .bet-chip {
  animation: pushPulse 0.65s ease-in-out both;
}

.win-amount-bubble {
  position: absolute;
  left: 50%;
  top: 34%;
  z-index: 14;
  min-width: clamp(88px, 6.8vw, 142px);
  padding: 8px 14px;
  border: 2px solid rgba(255, 230, 150, 0.92);
  border-radius: 999px;
  color: #fff8d8;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 248, 196, 0.36), transparent 56%),
    linear-gradient(180deg, rgba(38, 120, 60, 0.92), rgba(9, 52, 26, 0.96));
  box-shadow:
    0 0 24px rgba(240, 208, 96, 0.38),
    0 8px 16px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-family: Arial, sans-serif;
  font-size: clamp(18px, 1.35vw, 28px);
  font-weight: 950;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transform: translate(calc(-50% + var(--card-side-x)), calc(-50% + var(--card-side-y) - 104px));
}

.win-amount-bubble.settle-celebrate {
  animation: winBubblePop 1.28s cubic-bezier(0.17, 0.86, 0.27, 1.08) both;
}

.win-amount-bubble.settle-rack {
  animation: winBubbleRetract 0.86s ease-in both;
}

.insurance-bet {
  position: absolute;
  right: -22px;
  top: 4px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(99, 73, 169, 0.72);
  border-radius: 999px;
  color: #efe5ff;
  background: rgba(23, 13, 45, 0.76);
  font-family: Arial, sans-serif;
  font-size: clamp(10px, 0.7vw, 13px);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.32);
}

.insurance-bet.is-paid {
  border-color: rgba(170, 255, 190, 0.72);
  color: #d2ffdc;
}

.insurance-chip-pile {
  position: relative;
  width: clamp(26px, 2vw, 36px);
  height: clamp(26px, 2vw, 36px);
}

.insurance-chip {
  --tray-chip-size: clamp(24px, 1.75vw, 32px);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}

.insurance-chip span {
  font-size: 7px;
}

.chip-tray-dock {
  min-height: 84px;
  padding: 10px 12px 10px 10px;
  display: grid;
  grid-template-columns: minmax(84px, 106px) minmax(168px, 230px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #122b1c 0%, #0a1c10 100%);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
}

.chip-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chip-info-value {
  color: var(--gold-bright);
  font-size: clamp(24px, 1.6vw, 34px);
  font-weight: 900;
}

.chip-tray-dock strong {
  display: block;
  color: var(--gold-bright);
  font-size: clamp(14px, 0.9vw, 18px);
  line-height: 1.18;
}

.panel-summary {
  display: block;
  margin-top: 2px;
  color: #cbd8b2;
  font-family: Arial, sans-serif;
  font-size: clamp(12px, 0.78vw, 15px);
}

.chip-tray {
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: clamp(8px, 0.65vw, 14px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 0 6px;
}

.chip-tray-group {
  min-width: max-content;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid rgba(201, 162, 39, 0.18);
}

.chip-tray-group:last-child {
  padding-right: 0;
  border-right: 0;
}

.chip-tray-group-title {
  color: rgba(240, 208, 96, 0.82);
  font-family: Arial, sans-serif;
  font-size: clamp(11px, 0.74vw, 14px);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chip-tray-group-row {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 0.45vw, 10px);
}

.chip-stack-button {
  min-width: clamp(58px, 4.4vw, 78px);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 3px;
  border-radius: 8px;
  color: var(--gold-bright);
  background: transparent;
  cursor: grab;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.chip-stack-button:hover:not(:disabled) {
  transform: translateY(-6px);
  filter: brightness(1.08);
}

.chip-stack-button:active:not(:disabled),
.chip-stack-button.is-dragging {
  cursor: grabbing;
  opacity: 0.62;
  transform: scale(1.08);
}

.chip-denomination-label {
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(14px, 0.86vw, 17px);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.72);
}

.chip-stack-visual {
  position: relative;
  width: var(--tray-chip-size);
  height: calc(var(--tray-chip-size) + 12px);
}

.chip-stack-visual .casino-chip {
  position: absolute;
  left: 50%;
  bottom: var(--lift, 0px);
  transform: translateX(-50%);
}

.chip-stack-visual .casino-chip > span {
  font-size: clamp(9px, 0.58vw, 12px);
}

.chip-count {
  color: #dce6c2;
  font-family: Arial, sans-serif;
  font-size: clamp(10px, 0.66vw, 12px);
  white-space: nowrap;
}

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

.chip-action-btn {
  min-height: 42px;
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--gold-dim);
  border-radius: 5px;
  color: var(--gold-bright);
  background: #0f2615;
  font-size: clamp(12px, 0.8vw, 16px);
  font-weight: 900;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.chip-action-btn:hover:not(:disabled) {
  border-color: var(--gold);
  box-shadow: 0 0 9px rgba(201, 162, 39, 0.28);
}

.chip-action-btn.danger:hover:not(:disabled) {
  color: #ffaaa4;
  border-color: var(--action-red);
  box-shadow: 0 0 9px rgba(176, 48, 48, 0.36);
}

.controls-panel {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  background: linear-gradient(180deg, #0f2615 0%, #0a1c10 100%);
  overflow-x: hidden;
  overflow-y: hidden;
  margin-left: -8px;
}

.panel-title {
  padding: 2px 0 6px;
  border-bottom: 1px solid var(--gold-dim);
  color: var(--gold-bright);
  font-size: clamp(13px, 0.78vw, 16px);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.table-actions-title {
  margin-top: 6px;
}

.action-grid,
.control-column {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.round-controls {
  display: none;
}

body[data-phase="roundOver"] .round-controls {
  display: grid;
}

body[data-phase="roundOver"] .betting-controls,
body[data-phase="roundOver"] .action-controls {
  display: none;
}

.action-btn,
.util-btn {
  min-width: 0;
  min-height: 40px;
  padding: 6px 6px;
  border: 1px solid;
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.action-btn {
  font-size: clamp(13px, 0.86vw, 18px);
}

.util-btn {
  width: 100%;
  min-height: 34px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.32);
  border-color: var(--gold-dim);
  font-size: clamp(12px, 0.8vw, 15px);
  text-transform: none;
}

.action-btn:hover:not(:disabled),
.util-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.52);
}

.action-btn:active:not(:disabled),
.util-btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-deal,
.primary-action {
  grid-column: span 2;
  min-height: 46px;
  background: linear-gradient(180deg, #3aa860 0%, #1e6a3a 100%);
  border-color: #4ac870;
  font-size: clamp(16px, 1.06vw, 22px);
}

.btn-hit {
  background: linear-gradient(180deg, #2d8a4a 0%, #1a5a30 100%);
  border-color: #3da860;
}

@keyframes beaconGrowPulse {
  0% {
    opacity: 0.06;
    transform: scale(0.52);
  }

  14% {
    opacity: 0.92;
    transform: scale(1);
  }

  46% {
    opacity: 1;
    transform: scale(1);
  }

  72% {
    opacity: 0.22;
    transform: scale(0.72);
  }

  100% {
    opacity: 0.06;
    transform: scale(0.42);
  }
}

.btn-stand {
  background: linear-gradient(180deg, #b03030 0%, #701a1a 100%);
  border-color: #d04040;
}

.btn-double,
.btn-repeat,
.btn-undo {
  background: linear-gradient(180deg, #c98027 0%, #8a5010 100%);
  border-color: #e09030;
}

.btn-split {
  background: linear-gradient(180deg, #2860a0 0%, #163a60 100%);
  border-color: #3070b0;
}

.btn-surrender {
  background: linear-gradient(180deg, #6b6f68 0%, #343a34 100%);
  border-color: #8c9388;
}

.btn-insurance {
  background: linear-gradient(180deg, #7b42a0 0%, #3f225a 100%);
  border-color: #9d62c5;
}

.btn-no-insurance {
  background: linear-gradient(180deg, #47534a 0%, #1f2b22 100%);
  border-color: #697766;
}

.btn-clear {
  background: linear-gradient(180deg, #5a4a5a 0%, #3a2a3a 100%);
  border-color: #6a5a6a;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

button:disabled,
.chip-stack-button:disabled,
.chip-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  filter: grayscale(0.45);
  transform: none;
}

@keyframes activeSeatGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255, 225, 154, 0.16), 0 10px 24px rgba(0, 0, 0, 0.24);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(255, 225, 154, 0.32), 0 0 26px rgba(255, 225, 154, 0.32);
  }
}

@keyframes dealerLean {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(var(--dealer-lean-x), 8px) rotate(var(--dealer-lean-r));
  }
  100% {
    transform: translate(calc(var(--dealer-lean-x) * 0.45), 3px) rotate(calc(var(--dealer-lean-r) * 0.55));
  }
}

@keyframes dealerTap {
  0%, 100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) rotate(var(--dealer-lean-r)) scale(0.78);
  }
  36%, 72% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(var(--dealer-lean-r)) scale(1);
  }
}

@keyframes promptPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.84);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes hitTap {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -72%) rotate(-12deg) scale(0.88);
  }
  28%, 70% {
    opacity: 1;
    transform: translate(-50%, -28%) rotate(-12deg) scale(1);
  }
  48% {
    transform: translate(-50%, -5%) rotate(-12deg) scale(0.96);
  }
}

@keyframes tapRipple {
  0%, 34% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25);
  }
  58% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}

@keyframes standWave {
  0% {
    opacity: 0;
    transform: translate(-74%, -50%);
  }
  24%, 78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(16%, -50%);
  }
}

@keyframes doublePoint {
  0% {
    opacity: 0;
    transform: translate(-50%, -58%) rotate(-20deg) scale(0.86);
  }
  44%, 84% {
    opacity: 1;
    transform: translate(-50%, -24%) rotate(-20deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -18%) rotate(-20deg) scale(0.92);
  }
}

@keyframes splitSignal {
  0% {
    opacity: 0;
    transform: translate(-50%, -62%) rotate(-6deg) scale(0.84);
  }
  42%, 82% {
    opacity: 1;
    transform: translate(-50%, -28%) rotate(-6deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -28%) rotate(-6deg) scale(0.92);
  }
}

@keyframes surrenderDraw {
  0% {
    opacity: 0;
    transform: translate(-86%, -35%) rotate(-4deg) scale(0.84);
  }
  35%, 78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-18%, -35%) rotate(-4deg) scale(0.92);
  }
}

@keyframes surrenderLine {
  0%, 22% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0);
  }
  64% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(1);
  }
}

@keyframes gestureChipSlide {
  0% {
    opacity: 0;
    transform: translate(22px, -28px) scale(0.7);
  }
  60%, 100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes actionToastPop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.72);
  }
  34%, 84% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.92);
  }
}

@keyframes dealCard {
  0% {
    opacity: 0;
    transform: translate(var(--deal-from-x), var(--deal-from-y)) rotate(-12deg) scale(0.68);
  }
  72% {
    opacity: 1;
    transform: translate(0, 0) rotate(2deg) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

@keyframes flipHoleCard {
  0% {
    transform: rotateY(90deg) scale(0.96);
  }
  100% {
    transform: rotateY(0deg) scale(1);
  }
}

@keyframes chipDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -140%) scale(1.25) rotate(var(--r, 0deg));
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(var(--r, 0deg));
  }
}

@keyframes payoutReturn {
  0%, 35% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  }
  100% {
    opacity: 0.18;
    transform: translate(-210%, 130%) rotate(calc(var(--r, 0deg) - 34deg)) scale(0.8);
  }
}

@keyframes lossSweep {
  0%, 35% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  }
  100% {
    opacity: 0.84;
    transform: translate(var(--card-side-x), var(--card-side-y)) rotate(calc(var(--r, 0deg) + 48deg)) scale(0.84);
  }
}

@keyframes lossToDealer {
  0% {
    opacity: 0.84;
    transform: translate(var(--card-side-x), var(--card-side-y)) rotate(calc(var(--r, 0deg) + 48deg)) scale(0.84);
  }
  100% {
    opacity: 0.14;
    transform: translate(var(--dealer-bank-x), var(--dealer-bank-y)) rotate(calc(var(--r, 0deg) + 70deg)) scale(0.72);
  }
}

@keyframes payoutFromDealer {
  0% {
    opacity: 0.18;
    transform: translate(var(--dealer-bank-x), var(--dealer-bank-y)) rotate(calc(var(--r, 0deg) + 70deg)) scale(0.72);
  }
  72% {
    opacity: 1;
    transform: translate(var(--bet-circle-x), var(--bet-circle-y)) rotate(calc(var(--r, 0deg) - 6deg)) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: translate(var(--bet-circle-x), var(--bet-circle-y)) rotate(calc(var(--r, 0deg) - 10deg)) scale(0.98);
  }
}

@keyframes winBubblePop {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--bet-circle-x)), calc(-50% + var(--bet-circle-y) - 18px)) scale(0.18);
  }
  58% {
    opacity: 1;
    transform: translate(calc(-50% + var(--bet-circle-x)), calc(-50% + var(--bet-circle-y) - 64px)) scale(1.18);
  }
  100% {
    opacity: 1;
    transform: translate(calc(-50% + var(--bet-circle-x)), calc(-50% + var(--bet-circle-y) - 58px)) scale(1);
  }
}

@keyframes winBubbleRetract {
  0% {
    opacity: 1;
    transform: translate(calc(-50% + var(--bet-circle-x)), calc(-50% + var(--bet-circle-y) - 58px)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--bet-circle-x)), calc(-50% + var(--bet-circle-y) - 4px)) scale(0.08);
  }
}

@keyframes winnerToPlayerRack {
  0% {
    opacity: 1;
    transform: translate(var(--bet-circle-x), var(--bet-circle-y)) rotate(calc(var(--r, 0deg) - 10deg)) scale(0.98);
  }
  45% {
    opacity: 1;
    transform: translate(var(--player-rack-x), 20%) rotate(calc(var(--r, 0deg) - 38deg)) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(var(--player-rack-x), var(--player-rack-y)) rotate(calc(var(--r, 0deg) - 58deg)) scale(0.58);
  }
}

@keyframes pushPulse {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1);
  }
  50% {
    transform: translate(-50%, -58%) rotate(var(--r, 0deg)) scale(1.08);
  }
}

@media (max-width: 1180px) {
  :root {
    --card-w: clamp(62px, 5.3vw, 92px);
    --tray-chip-size: 56px;
    --bet-chip-size: 66px;
  }

  .game-area {
    grid-template-columns: minmax(0, 1fr) 198px;
  }

  .chip-tray-dock {
    grid-template-columns: 92px minmax(138px, 198px) minmax(0, 1fr);
  }

  .chip-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-height: 980px) and (min-width: 901px) {
  :root {
    --card-w: clamp(64px, 4.35vw, 98px);
    --tray-chip-size: clamp(48px, 3.15vw, 64px);
    --bet-chip-size: clamp(56px, 3.85vw, 76px);
  }

  .top-bar {
    min-height: 58px;
    padding: 6px 12px;
    gap: 12px;
  }

  .return-link,
  .topbar-button {
    min-height: 30px;
    padding: 6px 12px;
  }

  .return-link {
    min-width: 84px;
    font-size: clamp(15px, 0.95vw, 19px);
  }

  .topbar-button {
    font-size: clamp(14px, 0.86vw, 17px);
  }

  .metric-card {
    min-width: clamp(94px, 8vw, 134px);
    padding: 6px 12px;
  }

  .metric-card strong {
    font-size: clamp(20px, 1.36vw, 27px);
  }

  .status-bar {
    min-height: 28px;
    padding: 3px 12px;
    gap: 10px;
  }

  .status-tag,
  .phase-pill {
    min-width: 76px;
    padding: 3px 10px;
    font-size: clamp(12px, 0.75vw, 15px);
  }

  .status-text {
    font-size: clamp(15px, 0.94vw, 19px);
  }

  .game-area {
    grid-template-columns: minmax(0, 1fr) clamp(212px, 13vw, 286px);
    gap: 4px;
    padding: 8px;
  }

  .table {
    border-width: 11px;
  }

  .dealer-area {
    top: 9.9%;
    width: clamp(156px, 12.6vw, 228px);
  }

  .bet-window-beacon {
    top: 45.5%;
    min-width: clamp(112px, 9.4vw, 172px);
    gap: 8px;
  }

  .bet-window-beacon.is-right {
    left: calc(100% + 24px);
  }

  .bet-window-beacon.is-left {
    right: calc(100% + 24px);
  }

  .table-center {
    top: 37%;
  }

  .player-seat {
    width: clamp(140px, 10.4vw, 188px);
  }

  .player-seat[data-seat-id="player1"] {
    left: 13.4%;
    top: 77.9%;
  }

  .player-seat[data-seat-id="player2"] {
    left: 30.8%;
    top: 80.7%;
  }

  .player-seat[data-seat-id="user"] {
    top: 77.9%;
    width: clamp(168px, 12.4vw, 228px);
  }

  .player-seat[data-seat-id="player4"] {
    left: 69.2%;
    top: 80.7%;
  }

  .player-seat[data-seat-id="player5"] {
    left: 86.6%;
    top: 77.9%;
  }

  .seat-name,
  .dealer-name {
    font-size: clamp(14px, 1vw, 20px);
  }

  .status-chip {
    padding: 2px 7px;
    font-size: clamp(10px, 0.7vw, 14px);
  }

  .mini-balance {
    font-size: clamp(8px, 0.58vw, 11px);
  }

  .hand-value {
    min-height: 18px;
    font-size: clamp(12px, 0.84vw, 16px);
  }

  .bet-zone {
    min-height: clamp(72px, 6.2vw, 110px);
  }

  .bet-zone::before {
    width: clamp(68px, 5.5vw, 98px);
  }

  .bet-pile {
    width: clamp(76px, 6vw, 108px);
    height: clamp(70px, 5.5vw, 100px);
  }

  .bet-total {
    bottom: -14px;
    font-size: clamp(11px, 0.74vw, 14px);
  }

  .controls-panel {
    gap: 5px;
    padding: 8px;
    margin-left: -4px;
  }

  .panel-title {
    padding-bottom: 5px;
    font-size: clamp(12px, 0.72vw, 14px);
  }

  .action-grid,
  .control-column {
    gap: 4px;
  }

  .action-btn,
  .util-btn {
    min-height: 34px;
    padding: 5px;
  }

  .action-btn {
    font-size: clamp(12px, 0.76vw, 15px);
  }

  .util-btn {
    min-height: 30px;
    font-size: clamp(11px, 0.72vw, 13px);
  }

  .btn-deal,
  .primary-action {
    min-height: 40px;
    font-size: clamp(14px, 0.92vw, 18px);
  }

  .chip-tray-dock {
    min-height: 74px;
    padding: 8px 10px 8px 8px;
    grid-template-columns: minmax(76px, 90px) minmax(148px, 196px) minmax(0, 1fr) auto;
    gap: 8px;
  }

  .chip-info-value {
    font-size: clamp(22px, 1.38vw, 28px);
  }

  .chip-tray-dock strong {
    font-size: clamp(13px, 0.8vw, 15px);
  }

  .panel-summary {
    font-size: clamp(11px, 0.68vw, 13px);
  }

  .chip-tray {
    gap: clamp(6px, 0.52vw, 10px);
    padding: 2px 0 4px;
  }

  .chip-tray-group {
    gap: 4px;
    padding-right: 8px;
  }

  .chip-tray-group-title {
    font-size: clamp(10px, 0.66vw, 12px);
  }

  .chip-stack-button {
    min-width: clamp(52px, 3.9vw, 66px);
    min-height: 62px;
  }

  .chip-denomination-label {
    font-size: clamp(12px, 0.76vw, 15px);
  }

  .chip-stack-visual {
    height: calc(var(--tray-chip-size) + 8px);
  }

  .chip-count {
    font-size: clamp(9px, 0.58vw, 11px);
  }

  .chip-actions {
    gap: 4px;
  }

  .chip-action-btn {
    min-width: 88px;
    min-height: 36px;
    padding: 6px 8px;
    font-size: clamp(11px, 0.72vw, 13px);
  }
}

@media (max-height: 860px) and (min-width: 901px) {
  :root {
    --card-w: clamp(58px, 4.1vw, 88px);
    --tray-chip-size: clamp(42px, 2.95vw, 56px);
    --bet-chip-size: clamp(50px, 3.6vw, 68px);
  }

  .top-bar {
    min-height: 54px;
    padding: 5px 10px;
    gap: 10px;
  }

  .stat-group {
    gap: 8px;
  }

  .metric-card {
    min-width: clamp(88px, 7.2vw, 124px);
    padding: 5px 10px;
  }

  .metric-card strong {
    font-size: clamp(18px, 1.22vw, 24px);
  }

  .game-area {
    grid-template-columns: minmax(0, 1fr) 204px;
    padding: 6px;
  }

  .table-center {
    top: 36%;
  }

  .center-line-1 {
    font-size: clamp(10px, 0.94vw, 18px);
  }

  .center-line-2 {
    font-size: clamp(6px, 0.44vw, 9px);
  }

  .center-line-3 {
    font-size: clamp(8px, 0.62vw, 12px);
  }

  .dealer-area {
    top: 9.4%;
  }

  .player-seat[data-seat-id="player1"] {
    top: 76.6%;
  }

  .player-seat[data-seat-id="player2"] {
    top: 79.2%;
  }

  .player-seat[data-seat-id="user"] {
    top: 76.4%;
  }

  .player-seat[data-seat-id="player4"] {
    top: 79.2%;
  }

  .player-seat[data-seat-id="player5"] {
    top: 76.6%;
  }

  .seat-name,
  .dealer-name {
    font-size: clamp(13px, 0.9vw, 18px);
  }

  .hand-layout {
    gap: 6px;
  }

  .cards-row {
    min-height: calc(var(--card-h) + 1px);
  }

  .bet-zone {
    min-height: 64px;
  }

  .bet-zone::before {
    width: clamp(62px, 5vw, 88px);
  }

  .controls-panel {
    padding: 7px;
  }

  .action-btn,
  .util-btn {
    min-height: 31px;
  }

  .btn-deal,
  .primary-action {
    min-height: 36px;
  }

  .chip-tray-dock {
    min-height: 68px;
    padding: 7px 8px 7px 7px;
    grid-template-columns: 68px minmax(138px, 176px) minmax(0, 1fr) auto;
    gap: 6px;
  }

  .chip-tray {
    gap: 6px;
  }

  .chip-stack-button {
    min-width: 48px;
    min-height: 56px;
  }

  .chip-action-btn {
    min-width: 78px;
    min-height: 32px;
    padding: 5px 7px;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .dealer-table-app {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .game-area {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    min-height: 620px;
  }

  .controls-panel {
    max-height: none;
  }

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

  .chip-actions {
    justify-content: stretch;
  }

  .chip-action-btn {
    flex: 1;
  }
}

@media (max-width: 640px) {
  :root {
    --card-w: 58px;
    --tray-chip-size: 48px;
    --bet-chip-size: 54px;
  }

  .top-bar,
  .status-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-group,
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .metric-card {
    flex: 1;
  }

  .table-wrap {
    min-height: 560px;
  }

  .center-line-1 {
    font-size: 16px;
  }

  .center-line-2 {
    letter-spacing: 0.14em;
  }
}
