
#dbbp-calc * { box-sizing: border-box; }
#dbbp-calc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  color: #1a1a2e;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #dde1e7;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
#dbbp-calc h2 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  color: #1a1a2e;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#dbbp-calc h3 {
  margin: 16px 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a8394;
}

/* ── Slot rows ─────────────────────────────────────────── */
.dbbp-slots-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dbbp-section {
  background: #f4f6f9;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #e2e6ed;
}

/* ── Slot (a placed card) ──────────────────────────────── */
.dbbp-slot {
  width: 42px;
  height: 58px;
  border-radius: 6px;
  border: 2px dashed #bcc3ce;
  background: #e8ecf2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #8a94a6;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
}
.dbbp-slot.filled {
  border-style: solid;
  border-color: #2471a3;
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 0.75rem;
  flex-direction: column;
  line-height: 1.1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.dbbp-slot.filled.suit-h { color: #c0392b; }
.dbbp-slot.filled.suit-d { color: #1a7de0; }
.dbbp-slot.filled.suit-c { color: #1aaa4a; }
.dbbp-slot.active-target { border-color: #e67e22; border-style: solid; background: #fff8ee; }
.dbbp-slot.locked {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.dbbp-slot .dbbp-remove {
  position: absolute;
  top: -6px; right: -6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
}
.dbbp-slot.filled:hover .dbbp-remove { display: flex; }

/* ── Turn/River slot divider ───────────────────────────── */
.dbbp-slot-divider {
  width: 1px;
  height: 58px;
  background: #ccd0d8;
  flex-shrink: 0;
  align-self: center;
}

/* ── Player controls ───────────────────────────────────── */
.dbbp-players-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.dbbp-btn-sm {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #bcc3ce;
  background: #fff;
  color: #4a5568;
  cursor: pointer;
  font-size: 0.8rem;
}
.dbbp-btn-sm:hover { border-color: #7a8394; color: #1a1a2e; }

/* ── Run button ────────────────────────────────────────── */
#dbbp-run {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #1a1a2e;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
  letter-spacing: 0.04em;
}
#dbbp-run:hover:not(:disabled) { background: #2c2c4a; }
#dbbp-run:disabled { background: #c8cdd6; color: #fff; cursor: not-allowed; }

/* ── Results ───────────────────────────────────────────── */
#dbbp-results {
  margin-top: 20px;
  display: none;
}
.dbbp-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.dbbp-result-hand {
  width: 80px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a2e;
  flex-shrink: 0;
}
.dbbp-bar-wrap {
  flex: 1;
  background: #e8ecf2;
  border-radius: 4px;
  height: 22px;
  overflow: hidden;
  position: relative;
}
.dbbp-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.dbbp-result-pcts {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
  color: #7a8394;
  flex-shrink: 0;
  min-width: 160px;
}
.dbbp-result-pcts span { white-space: nowrap; }
.dbbp-error {
  color: #c0392b;
  font-size: 0.9rem;
  text-align: center;
  padding: 10px;
}

/* ── Progress / spinner ────────────────────────────────── */
.dbbp-progress-wrap {
  padding: 16px 0 8px;
}
.dbbp-progress-track {
  width: 100%;
  height: 5px;
  background: #e8ecf2;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.dbbp-progress-fill {
  width: 40%;
  height: 100%;
  background: #2471a3;
  border-radius: 3px;
  animation: dbbp-slide 1.5s ease-in-out infinite;
}
@keyframes dbbp-slide {
  0%   { transform: translateX(-150%); }
  100% { transform: translateX(400%); }
}
.dbbp-spinner-label {
  text-align: center;
  color: #7a8394;
  font-size: 0.85rem;
}

/* Bar colours per player */
.dbbp-bar-0 { background: #2980b9; }
.dbbp-bar-1 { background: #27ae60; }
.dbbp-bar-2 { background: #8e44ad; }
.dbbp-bar-3 { background: #e67e22; }
.dbbp-bar-4 { background: #c0392b; }
.dbbp-bar-5 { background: #16a085; }

/* ── Player mode toggle (Hand / Range) ────────────────── */
.dbbp-mode-toggle {
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #bcc3ce;
  flex-shrink: 0;
}
.dbbp-mode-btn {
  padding: 3px 9px;
  font-size: 0.75rem;
  border: none;
  background: #fff;
  color: #7a8394;
  cursor: pointer;
  line-height: 1.4;
}
.dbbp-mode-btn.active { background: #1a1a2e; color: #fff; }
.dbbp-range-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #bcc3ce;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: monospace;
  min-width: 0;
}
.dbbp-range-input::placeholder { color: #bcc3ce; }

/* ── Full card picker grid ─────────────────────────────── */
.dbbp-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dbbp-picker-row {
  display: flex;
  gap: 3px;
  align-items: center;
}
.dbbp-picker-suit-label {
  width: 22px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
  color: #aaa;
}
.dbbp-picker-card {
  flex: 1;
  height: 46px;
  border-radius: 6px;
  border: none;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.1s, transform 0.1s;
  user-select: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  letter-spacing: -0.02em;
}
.dbbp-picker-card.suit-s { background: #555e6e; }
.dbbp-picker-card.suit-h { background: #e02020; }
.dbbp-picker-card.suit-d { background: #1a7de0; }
.dbbp-picker-card.suit-c { background: #1aaa4a; }

.dbbp-picker-card:hover:not(.dbbp-dead):not(.dbbp-no-target) {
  filter: brightness(1.35);
  transform: translateY(-2px);
}
.dbbp-picker-card.dbbp-dead {
  opacity: 0.18;
  cursor: not-allowed;
  transform: none !important;
}
.dbbp-picker-card.dbbp-no-target {
  cursor: default;
}
/* Prompt shown when no slot is selected */
.dbbp-picker-hint {
  font-size: 0.78rem;
  color: #e67e22;
  margin-bottom: 8px;
  min-height: 1.2em;
  font-style: italic;
}
