:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(circle at 10% 20%, #1e1b4b 0%, #0f172a 70%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Top Bar */
header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-icon {
  font-size: 28px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-status-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-status-pill:hover {
  background: rgba(51, 65, 85, 0.95);
  transform: translateY(-1px);
}

.avatar-badge {
  font-size: 22px;
}

.player-details {
  display: flex;
  flex-direction: column;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-name {
  font-weight: 700;
  font-size: 14px;
}

.player-level {
  font-size: 11px;
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 800;
}

.xp-progress-bar {
  width: 90px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 3px;
}

.xp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  width: 50%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-chip.gold {
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.3);
}

.stat-chip.streak {
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.3);
}

.icon-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: scale(1.05);
}

/* Container */
.main-container {
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
}

/* Views Management */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero / Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.welcome-text h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
}

.welcome-text p {
  color: var(--text-muted);
  font-size: 15px;
}

.reward-goal-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  text-align: right;
  max-width: 320px;
}

.reward-title {
  font-size: 13px;
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.reward-desc {
  font-size: 13px;
  color: #e2e8f0;
}

/* Category Cards Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--primary));
}

.game-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-emoji {
  font-size: 40px;
  background: rgba(255, 255, 255, 0.05);
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

.card-btn {
  background: var(--card-accent, var(--primary));
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s ease;
}

.card-btn:hover {
  opacity: 0.9;
}

/* Specific Card Themes */
.card-math { --card-accent: #3b82f6; }
.card-language { --card-accent: #ec4899; }
.card-geo { --card-accent: #10b981; }
.card-typing { --card-accent: #f59e0b; }
.card-daily { --card-accent: #8b5cf6; }
.card-shop { --card-accent: #06b6d4; }

/* In-Game Quiz View */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-width: 760px;
  margin: 0 auto;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.quiz-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.quiz-counter {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.quiz-score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: var(--accent-gold);
  font-size: 15px;
}

.question-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  margin-bottom: 28px;
}

.question-text {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.4;
  color: #ffffff;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.option-btn {
  background: rgba(51, 65, 85, 0.8);
  border: 2px solid transparent;
  color: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 70px;
}

.option-btn:hover {
  background: rgba(71, 85, 105, 1);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.option-btn.correct {
  background: #059669 !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.option-btn.wrong {
  background: #dc2626 !important;
  border-color: #f87171 !important;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.feedback-box {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 600;
  display: none;
}

.feedback-box.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.feedback-box.correct {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.feedback-box.wrong {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Typing Game Arena */
.typing-box {
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  text-align: center;
}

.typing-target-sentence {
  font-size: 26px;
  line-height: 1.6;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.typing-char.correct {
  color: #34d399;
}

.typing-char.wrong {
  color: #f87171;
  background: rgba(239, 68, 68, 0.3);
  border-radius: 4px;
}

.typing-char.current {
  background: rgba(99, 102, 241, 0.5);
  border-bottom: 3px solid #a5b4fc;
  border-radius: 2px;
}

.typing-input {
  width: 100%;
  background: rgba(30, 41, 59, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 20px;
  font-family: 'Courier New', Courier, monospace;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s ease;
}

.typing-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.typing-metrics {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 24px;
}

.metric-card {
  background: rgba(30, 41, 59, 0.8);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-gold);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  position: relative;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-modal-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.close-modal-btn:hover {
  color: #fff;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-size: 15px;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}

/* Avatar Selection & Shop Grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.avatar-item {
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-item:hover {
  background: rgba(51, 65, 85, 0.8);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.avatar-item.active {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
}

.avatar-emoji {
  font-size: 36px;
}

.avatar-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Hall of Fame Leaderboard */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.leaderboard-table th {
  text-align: left;
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 15px;
}

/* Responsiveness */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .reward-goal-box {
    text-align: left;
    max-width: 100%;
    width: 100%;
  }
}

/* ==========================================
   WERKBLAD SCANNER & HUISWERK QUESTS
   ========================================== */
.scanner-hero-card {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(139, 92, 246, 0.25));
  border: 2px dashed rgba(236, 72, 153, 0.5);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-lg);
}

.scanner-hero-card:hover {
  transform: translateY(-4px);
  border-color: #f472b6;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(139, 92, 246, 0.35));
  box-shadow: 0 12px 28px rgba(236, 72, 153, 0.25);
}

.scanner-hero-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.scanner-camera-icon {
  font-size: 42px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 8px 24px rgba(236, 72, 153, 0.6); }
}

.scanner-hero-text h3 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
}

.scanner-hero-text p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.5;
}

.homework-section {
  margin-bottom: 32px;
}

.homework-section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.homework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.homework-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 5px solid var(--accent-pink);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.homework-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

.homework-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
}

.homework-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex: 1;
}

.homework-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-preview-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.photo-preview-item {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
  background: #0f172a;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanning-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.scanning-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(236, 72, 153, 0.2);
  border-top-color: #ec4899;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin-bottom: 18px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================================
   BLOCK BLAST (LEERBLAST) STYLING & ANIMATIES
   =================================================== */

.bb-container {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.bb-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bb-score-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bb-score-val {
  font-size: 18px;
  font-weight: 900;
  color: #38bdf8;
}

.bb-combo-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
  animation: pulse 1s infinite alternate;
}

.bb-question-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 12px 16px;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.bb-question-source {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #38bdf8;
  font-weight: 800;
  margin-bottom: 4px;
}

.bb-question-text {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.bb-board-wrapper {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
}

.bb-board-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 5px;
  background: rgba(15, 23, 42, 0.85);
  padding: 8px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6), 0 12px 32px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.bb-cell {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.12s, border-color 0.12s;
  cursor: pointer;
  box-sizing: border-box;
}

.bb-cell.filled {
  border-width: 2px;
  border-style: solid;
}

.bb-cell.preview-valid {
  background-color: var(--preview-color, #3b82f6) !important;
  opacity: 0.7;
  border: 2px dashed #ffffff !important;
  box-shadow: 0 0 10px var(--preview-color, #3b82f6);
}

.bb-cell.preview-invalid {
  background-color: rgba(239, 68, 68, 0.45) !important;
  border: 2px dashed #f87171 !important;
}

.bb-cell.blast-explode {
  animation: blast-pop 0.32s forwards;
}

.bb-cell.invalid-shake {
  animation: invalid-shake 0.35s ease-in-out;
}

.bb-dock {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  min-height: 120px;
  padding: 6px 0;
}

.bb-piece-slot {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 110px;
}

.bb-piece {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  touch-action: none;
  padding: 8px;
  border-radius: 14px;
  transition: transform 0.15s, background-color 0.15s;
  position: relative;
}

.bb-piece:active {
  cursor: grabbing;
  transform: scale(1.08);
}

.bb-piece-slot.selected .bb-piece {
  outline: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.06);
}

.bb-piece-slot.disabled .bb-piece {
  opacity: 0.35;
  filter: grayscale(0.85);
  pointer-events: none;
}

.bb-piece-answer-badge {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.bb-mini-grid {
  display: grid;
  gap: 3px;
}

.bb-mini-block {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-sizing: border-box;
}

.bb-mini-block.active {
  border-width: 1.5px;
  border-style: solid;
}

.bb-mini-block.transparent {
  background: transparent;
  border: none;
}

.bb-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.7));
}

.bb-floating-container {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
}

.bb-floating-text {
  font-size: 30px;
  font-weight: 900;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 255, 255, 0.5);
  animation: float-up-blast 1.2s forwards;
  white-space: nowrap;
  text-align: center;
}

.shake {
  animation: shake 0.3s ease-in-out;
}

@keyframes blast-pop {
  0% {
    transform: scale(1);
    filter: brightness(2.5);
    background-color: #ffffff !important;
  }
  40% {
    transform: scale(1.18);
    opacity: 0.9;
  }
  100% {
    transform: scale(0.1);
    opacity: 0;
  }
}

@keyframes float-up-blast {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1.2);
  }
  80% {
    opacity: 1;
    transform: translateY(-25px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-45px) scale(0.85);
  }
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 4px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, 3px); }
  80% { transform: translate(4px, -3px); }
}

@keyframes invalid-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
