:root {
  --felt: #0b3d2e;
  --felt-dark: #072820;
  --gold: #c9a227;
  --gold-soft: #e8d48b;
  --ink: #f4efe3;
  --danger: #c44536;
  --ok: #2f9e6e;
  --panel: rgba(8, 20, 16, 0.92);
  --line: rgba(201, 162, 39, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #123528 0%, #050f0c 70%, #000 100%);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#table {
  display: block;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  border-radius: 16px;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hud > * {
  pointer-events: auto;
}

#top-bar {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 8px;
}

#action-bar {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.raise-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

#raise-slider {
  width: 140px;
  accent-color: var(--gold);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  background: #1d2f28;
  transition: transform 0.08s ease, filter 0.12s ease, opacity 0.12s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.12);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-primary {
  background: linear-gradient(180deg, #d4b13a, #a8841d);
  color: #1a1405;
  border-color: #e8d48b;
}

.btn-fold {
  background: #5a2a24;
  border-color: #8a4036;
}

.btn-check {
  background: #1f3d5c;
  border-color: #3d6a99;
}

.btn-call {
  background: #1d4d38;
  border-color: #2f9e6e;
}

.btn-raise {
  background: #5a4a18;
  border-color: var(--gold);
  color: var(--gold-soft);
}

.btn-allin {
  background: #4a1f3d;
  border-color: #a04880;
}

.hidden {
  display: none !important;
}

#settings-panel,
#result-panel {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.panel-card {
  width: min(420px, calc(100% - 32px));
  background: linear-gradient(180deg, #10241d, #0a1712);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.panel-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gold-soft);
  margin-bottom: 16px;
}

.panel-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: rgba(244, 239, 227, 0.8);
  margin-bottom: 12px;
}

.panel-card label.row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.panel-card input[type="number"],
.panel-card select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.panel-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-soft);
  margin: 4px 0 10px;
}

.panel-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 14px 0 12px;
}

.target-row {
  display: flex;
  gap: 6px;
}

.target-row input {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.hint {
  font-size: 12px;
  color: rgba(244, 239, 227, 0.55);
  margin: 4px 0 8px;
  line-height: 1.5;
}

#control-badge {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: rgba(244, 239, 227, 0.75);
  background: rgba(8, 20, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 12px;
  pointer-events: none;
}

#control-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e6e;
}

#control-badge.override .dot {
  background: #c9a227;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.8);
}

#control-badge.disabled .dot {
  background: #666;
}

#result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

#result-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  font-size: 14px;
}

#result-list .win {
  color: #7ddea8;
}

#result-list .lose {
  color: #e08a80;
}

#toast {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 20, 16, 0.92);
  border: 1px solid var(--line);
  color: var(--gold-soft);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 10;
}
