/* =============================================
   blockpuzzle.css — Block Puzzle Game Styles
   Mini Games Hub — Premium Gaming UI
   ============================================= */

/* ---- Accent colors ---- */
.block-accent {
  border-color: rgba(167, 139, 250, 0.4) !important;
  background: rgba(167, 139, 250, 0.07) !important;
}

.block-accent .stat-card-value {
  color: #a78bfa !important;
  text-shadow: 0 0 16px rgba(167, 139, 250, 0.5);
}

/* ---- Game area layout ---- */
.bp-game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  max-width: 460px;
}

/* ---- Grid ---- */
.bp-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  padding: var(--space-4);
  background: rgba(13, 13, 26, 0.9);
  border: 1.5px solid rgba(167, 139, 250, 0.25);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 50px rgba(167, 139, 250, 0.1), var(--shadow-lg);
  width: 100%;
  aspect-ratio: 1;
}

.bp-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  transition: all 150ms ease;
}

.bp-cell.filled {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: inset 0 0 8px rgba(167, 139, 250, 0.2);
}

.bp-cell.highlight {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.35);
}

.bp-cell.clearing {
  animation: cellClear 0.4s ease forwards;
}

@keyframes cellClear {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.2); opacity: 0.8; box-shadow: 0 0 20px rgba(167, 139, 250, 0.6); }
  100% { transform: scale(0); opacity: 0; }
}

/* ---- Pieces section ---- */
.bp-pieces-section {
  width: 100%;
  text-align: center;
}

.bp-pieces-label {
  color: var(--clr-text-muted);
  font-size: var(--text-xs);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.bp-pieces-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-5);
  flex-wrap: wrap;
  min-height: 80px;
}

/* ---- Piece blocks ---- */
.bp-piece {
  display: grid;
  gap: 2px;
  cursor: grab;
  padding: 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: transform var(--transition-fast);
  touch-action: none;
}

.bp-piece:hover {
  transform: scale(1.12);
}

.bp-piece.dragging {
  opacity: 0.6;
  cursor: grabbing;
  transform: scale(0.9);
}

.bp-piece.used {
  opacity: 0.15;
  pointer-events: none;
}

.bp-piece-cell {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

.bp-piece-cell.filled {
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.25), 0 0 8px rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.bp-piece-cell.empty {
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden;
  visibility: hidden;
}

/* ---- Game Over Overlay ---- */
.bp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: opacity var(--transition-base);
}

.bp-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.bp-overlay-card {
  background: var(--clr-bg-card);
  border: 1.5px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 0 60px rgba(167, 139, 250, 0.15), var(--shadow-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

/* ---- Responsive ---- */
@media (max-width: 500px) {
  .bp-grid {
    gap: 2px;
    padding: var(--space-3);
  }

  .bp-piece-cell {
    width: 18px;
    height: 18px;
  }

  .bp-pieces-row {
    gap: var(--space-3);
  }
}
