.bd-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.bd-overlay.open { display: flex; animation: bd-fade 0.18s ease; }
@keyframes bd-fade { from { opacity: 0; } to { opacity: 1; } }
body.bd-modal-open { overflow: hidden; }

.bd-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #0b0d18;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 28px 26px;
  position: relative;
  box-shadow: 0 32px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(124,58,237,0.12) inset;
  animation: bd-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #e2e8f0;
}
@keyframes bd-pop { from { opacity: 0; transform: scale(0.94) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.bd-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: #cbd5e1; font-size: 22px; line-height: 1;
  cursor: pointer; transition: 0.15s; display: flex; align-items: center; justify-content: center;
}
.bd-close:hover { background: rgba(255,255,255,0.08); color: #fff; transform: scale(1.05); }

.bd-head { display: flex; align-items: center; gap: 14px; padding-right: 56px; }
.bd-game-icon { width: 36px; height: 36px; color: #cbd5e1; }
.bd-game-icon svg { width: 100%; height: 100%; }
.bd-title-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bd-title { font: 800 22px/1.2 'Inter', sans-serif; color: #fff; margin: 0; min-width: 0; }
.bd-public-id { font: 700 18px/1.2 'JetBrains Mono', monospace; color: #fff; opacity: 0.85; }
.bd-share {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 6px 8px; color: #94a3b8; cursor: pointer; transition: 0.15s;
}
.bd-share:hover { background: rgba(124,58,237,0.18); color: #c4b5fd; border-color: rgba(124,58,237,0.4); }

.bd-meta { margin: 16px 0 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; color: #64748b; }
.bd-meta-label { font-weight: 600; }
.bd-user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.28);
  padding: 4px 12px 4px 8px; border-radius: 24px;
  font-weight: 700; font-size: 13px; color: #c4b5fd;
}
.bd-user-pill::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: inline-block;
}
.bd-meta-when { color: #94a3b8; font-weight: 600; }

.bd-stats {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 16px 20px;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
  margin-bottom: 18px;
}
.bd-stat-k { font-size: 12px; color: #64748b; font-weight: 600; margin-bottom: 6px; letter-spacing: 0.02em; }
.bd-stat-v { font: 800 17px/1.2 'Inter', sans-serif; color: #fff; display: flex; align-items: center; gap: 6px; }
.bd-coin-cur { font: 700 11px/1 'JetBrains Mono', monospace; padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,0.06); color: #94a3b8; }
.bd-win { color: #1ad96d; }
.bd-loss { color: #e63b4f; }

.bd-viz {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 24px 20px;
  margin-bottom: 18px;
  min-height: 200px;
}

.bd-dice-box { position: relative; padding-top: 8px; }
.bd-roll-marker {
  position: absolute; top: 0;
  transform: translate(-50%, 0);
  background: #0b0d18;
  border: 2px solid #e63b4f;
  border-radius: 10px; padding: 10px 16px;
  font: 800 18px/1 'JetBrains Mono', monospace;
  white-space: nowrap;
  color: #fff;
  z-index: 5;
  box-shadow: 0 6px 18px rgba(230, 59, 79, 0.25);
}
.bd-roll-marker.win { border-color: #1ad96d; box-shadow: 0 6px 18px rgba(26, 217, 109, 0.25); }
.bd-roll-marker::after {
  content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 7px solid currentColor;
}
.bd-slider {
  position: relative; height: 14px;
  margin: 72px 6px 14px;
}
.bd-slider-track {
  position: absolute; inset: 0;
  background: #1e293b; border-radius: 999px; overflow: hidden;
}
.bd-slider-fill { position: absolute; top: 0; bottom: 0; }
.bd-slider-thumb {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  background: #a855f7; border: 3px solid #0b0d18; border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35);
}
.bd-slider-axis {
  display: flex; justify-content: space-between; padding: 0 4px;
  font: 700 11px/1 'JetBrains Mono', monospace; color: #94a3b8; margin-top: 8px;
}
.bd-dice-stats { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bd-dice-stat {
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px; padding: 10px 12px;
}
.bd-dice-stat-k { font-size: 11px; color: #64748b; font-weight: 600; }
.bd-dice-stat-v { font: 700 14px/1 'JetBrains Mono', monospace; color: #fff; margin-top: 4px; }

.bd-cf-wrap { display: flex; align-items: center; gap: 24px; justify-content: center; padding: 20px; }
.bd-cf-coin {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(145deg, #fbbf24, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font: 900 14px/1 'JetBrains Mono', monospace;
  color: #422006; box-shadow: 0 10px 40px rgba(245, 158, 11, 0.4);
  border: 4px solid rgba(255,255,255,0.2);
}
.bd-cf-coin.loss { background: linear-gradient(145deg, #94a3b8, #64748b); color: #1e293b; box-shadow: 0 10px 40px rgba(100, 116, 139, 0.4); }
.bd-cf-info { display: flex; flex-direction: column; gap: 10px; min-width: 140px; }
.bd-cf-row { display: flex; justify-content: space-between; font: 600 13px/1 'Inter'; color: #94a3b8; padding: 8px 14px; background: rgba(0,0,0,0.25); border-radius: 8px; }
.bd-cf-row b { color: #fff; font-weight: 800; }

.bd-mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 280px; margin: 0 auto; }
.bd-mt {
  aspect-ratio: 1; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #475569;
}
.bd-mt.bomb { background: rgba(230, 59, 79, 0.12); border-color: rgba(230, 59, 79, 0.4); }
.bd-mt.gem  { background: rgba(26, 217, 109, 0.12); border-color: rgba(26, 217, 109, 0.4); }
.bd-mines-stats { margin-top: 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }

.bd-pk-wrap { padding: 8px; }
.bd-pk-row { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; justify-content: center; }
.bd-pk-bucket {
  min-width: 38px; height: 44px; flex-shrink: 0;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font: 700 11px/1 'JetBrains Mono', monospace; color: #475569;
}
.bd-pk-bucket.hit {
  background: linear-gradient(180deg, #1ad96d, #0f9c4e); color: #042713; border-color: transparent;
  box-shadow: 0 8px 24px rgba(26, 217, 109, 0.35);
}

.bd-empty { padding: 24px; text-align: center; color: #64748b; font-style: italic; }
.bd-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(124,58,237,0.2);
  border-top-color: #a855f7;
  margin: 32px auto; animation: bd-spin 0.8s linear infinite;
}
@keyframes bd-spin { to { transform: rotate(360deg); } }

.bd-pf {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  margin-top: 4px;
}
.bd-pf-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: transparent; border: 0; cursor: pointer;
  font: 800 15px/1 'Inter', system-ui, sans-serif; color: #c4b5fd;
  letter-spacing: 0;
  transition: 0.15s;
}
.bd-pf-toggle:hover { color: #fff; }
.bd-pf-toggle svg { transition: 0.2s; color: #94a3b8; }
.bd-pf-toggle.open svg { transform: rotate(180deg); }
.bd-pf-body { padding: 4px 20px 18px; }
.bd-pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.bd-pf-field-full { grid-column: 1 / -1; }
.bd-pf-field label {
  display: block;
  font: 700 11px/1 'Inter', system-ui, sans-serif;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.bd-pf-input-wrap { display: flex; align-items: stretch; }
.bd-pf-input-wrap input {
  flex: 1; min-width: 0; padding: 10px 12px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px 0 0 8px;
  font: 600 12px/1.4 'JetBrains Mono', monospace;
  color: #f1f5f9; outline: none;
  text-overflow: ellipsis;
}
.bd-pf-input-wrap input:focus { border-color: rgba(168, 85, 247, 0.35); }
.bd-copy {
  padding: 0 12px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05); border-left: 0;
  border-radius: 0 8px 8px 0; color: #94a3b8;
  cursor: pointer; transition: 0.15s;
  font-size: 13px; min-width: 38px;
  display: flex; align-items: center; justify-content: center;
}
.bd-copy:hover { background: rgba(168,85,247,0.16); color: #c4b5fd; }

.bd-pf-locked {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 20px 18px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  text-align: center;
  margin-bottom: 12px;
}
.bd-pf-locked-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(168, 85, 247, 0.12);
  color: #c4b5fd; display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.bd-pf-locked-title { font: 700 13px/1.2 'Inter'; color: #e2e8f0; }
.bd-pf-locked-sub { font: 500 12px/1.4 'Inter'; color: #94a3b8; max-width: 360px; }
.bd-pf-locked-hash {
  margin-top: 4px; padding: 6px 10px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.03);
  border-radius: 6px;
  font: 600 10px/1.3 'JetBrains Mono', monospace;
  color: #64748b; word-break: break-all; max-width: 100%;
}

.bd-pf-hint { font: 500 12px/1.4 'Inter'; color: #94a3b8; padding: 8px 0 4px; text-align: center; }
.bd-pf-hint.ok { color: var(--cyan); }
.bd-verify {
  width: 100%; padding: 12px; border-radius: 10px;
  background: linear-gradient(180deg, #a855f7, #7c3aed); color: #fff;
  border: 0; font: 700 14px/1 'Inter'; cursor: pointer;
  margin-top: 4px; transition: 0.18s;
}
.bd-verify:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(124,58,237,0.35); }
.bd-verify:disabled { background: rgba(255,255,255,0.04); color: #475569; cursor: not-allowed; transform: none; box-shadow: none; border: 1px solid rgba(255,255,255,0.04); }
.bd-verify-result {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  font: 600 12px/1.4 'Inter';
}
.bd-verify-result.ok  { background: rgba(26, 217, 109, 0.10); border: 1px solid rgba(26, 217, 109, 0.28); color: #6ee7b7; }
.bd-verify-result.err { background: rgba(230, 59, 79, 0.10); border: 1px solid rgba(230, 59, 79, 0.28); color: #fca5a5; }
.bd-pf-link {
  display: block; text-align: center; margin-top: 10px;
  font: 500 12px/1 'Inter'; color: #94a3b8; text-decoration: underline;
  text-underline-offset: 3px;
}
.bd-pf-link:hover { color: #c4b5fd; }

@media (max-width: 540px) {
  .bd-card { padding: 22px 18px; border-radius: 16px; }
  .bd-stats { grid-template-columns: 1fr; gap: 10px; }
  .bd-pf-grid { grid-template-columns: 1fr; }
  .bd-dice-stats, .bd-mines-stats { grid-template-columns: 1fr 1fr; }
  .bd-meta { gap: 6px; font-size: 12px; }
  .bd-title { font-size: 18px; }
  .bd-public-id { font-size: 15px; }
}

.rb-row.bd-clickable { cursor: pointer; transition: background 0.12s ease; }
.rb-row.bd-clickable:hover { background: rgba(124,58,237,0.08); }

.bd-hilo-wrap { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.bd-hilo-strip {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 14px 12px; background: rgba(255,255,255,0.02); border-radius: 10px;
  width: 100%; min-height: 92px;
}
.bd-hilo-card {
  width: 50px; height: 72px; background: #fff; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35); color: #111827;
  font-family: 'Geist', sans-serif;
}
.bd-hilo-card.red { color: #d93340; }
.bd-hilo-rank { font-size: 18px; font-weight: 800; line-height: 1; }
.bd-hilo-suit { font-size: 20px; line-height: 1; margin-top: 2px; }

.bd-limbo-wrap { display: flex; flex-direction: column; gap: 16px; align-items: center; padding: 18px 8px; }
.bd-limbo-value {
  font-size: clamp(48px, 7vw, 96px); font-weight: 800; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bd-limbo-value.win  { color: var(--green); text-shadow: 0 6px 24px rgba(var(--green-rgb),0.4); }
.bd-limbo-value.loss { color: #FF6B6B; text-shadow: 0 6px 24px rgba(255,107,107,0.3); }

.bd-keno-wrap { display: flex; flex-direction: column; gap: 14px; }
.bd-keno-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px;
}
.bd-kn-cell {
  aspect-ratio: 1 / 1.1; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: rgba(255,255,255,0.04); color: var(--text-dim, #94A3B8);
  border: 1px solid rgba(255,255,255,0.04);
}
.bd-kn-cell.picked { background: rgba(var(--cyan-rgb),0.12); border-color: rgba(var(--cyan-rgb),0.5); color: #fff; }
.bd-kn-cell.drawn  { background: rgba(255,255,255,0.08); color: #fff; }
.bd-kn-cell.hit    {
  background: radial-gradient(circle, rgba(255,215,80,0.95), rgba(var(--gold-rgb),0.85));
  color: #1a1300; border-color: rgba(255,215,80,0.9); box-shadow: 0 0 12px rgba(var(--gold-rgb),0.45);
}