.bb-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.bb-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) {
  .bb-layout { grid-template-columns: 1fr; }
}

.bb-board-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bb-hud {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.bb-hud-block { text-align: center; }
.bb-hud-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.65; }
.bb-hud-value { font-family: "Orbitron", sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--gold-bright); }

#bb-canvas-wrap {
  width: 100%;
  max-width: 520px;
  position: relative;
  touch-action: none;
}

#bb-canvas {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--card-bg2);
  touch-action: none;
}

.bb-combo-flash {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(255,90,31,0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.bb-flash-anim {
  animation: bbFlashPop 0.9s ease-out;
}
@keyframes bbFlashPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  70%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(0.9); }
}

#bb-tray {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  min-height: 90px;
  width: 100%;
}
.bb-tray-slot {
  min-width: 90px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bb-tray-piece {
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: transform 0.1s ease;
}
.bb-tray-piece:hover { transform: scale(1.06); }
.bb-piece-dragging { opacity: 0.35; }

.bb-sidebar-card + .bb-sidebar-card { margin-top: 1.25rem; }

.bb-lb-row {
  display: grid;
  grid-template-columns: 32px 28px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}
.bb-lb-rank { opacity: 0.6; font-family: "Share Tech Mono", monospace; }
.bb-lb-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255,255,255,0.08) center/cover no-repeat;
}
.bb-lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-lb-score { font-weight: 700; color: var(--gold-bright); }

.bb-reward-info {
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.6;
}
.bb-reward-info b { color: var(--gold-bright); }

/* ── Game-over modal ─────────────────────────────────────── */
#bb-gameover-modal {
  position: fixed;
  inset: 0;
  background: rgba(10,8,7,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.bb-modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.bb-modal-box h2 { margin-top: 0; color: var(--gold-bright); }
#bb-newhigh-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--purple));
  font-size: 0.8rem;
  font-weight: 700;
}
.bb-modal-stat-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0;
}
.bb-modal-stat { text-align: center; }
.bb-modal-stat-val { font-family: "Orbitron", sans-serif; font-size: 1.4rem; font-weight: 700; }
.bb-modal-stat-label { font-size: 0.75rem; opacity: 0.65; text-transform: uppercase; }
#bb-reward-status { margin: 1rem 0; min-height: 1.4em; }
#bb-levelup-text { color: var(--green); font-weight: 700; margin-bottom: 0.75rem; }

.bb-rules-list { font-size: 0.85rem; opacity: 0.85; line-height: 1.7; padding-left: 1.1rem; }
