/* One-Click Lesson Pack */
.lesson-pack-box {
  margin-top: 1rem;
  border: 1px dashed rgba(167, 139, 250, 0.45);
  background: rgba(124, 108, 255, 0.07);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.lesson-pack-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: var(--primary-light);
  font-size: 1rem;
}

.lesson-pack-badge {
  background: var(--grad-btn);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

/* Live remote bingo */
.live-grid {
  display: grid;
  gap: 4px;
  max-width: 480px;
}

.live-cell {
  border: 1px solid rgba(139, 92, 246, 0.4);
  background: rgba(124, 108, 255, 0.1);
  color: var(--text);
  border-radius: 8px;
  padding: 0.7rem 0.2rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, transform 0.15s;
}

.live-cell:hover {
  background: rgba(124, 108, 255, 0.2);
}

.live-cell.free { background: var(--grad-btn); color: #fff; cursor: default; }
.live-cell.marked { background: var(--accent); color: #fff; border-color: var(--accent); }
.live-cell.called-match {
  animation: liveFlash 0.8s ease 2;
}

@keyframes liveFlash {
  0% { background: var(--secondary); }
  50% { background: var(--secondary-light); }
  100% { background: inherit; }
}

/* ==========================================================================
   Bingo Grid (prints as white paper; matches the white card sheet preview)
   ========================================================================== */
.bingo-grid {
  display: inline-grid;
  gap: 2px;
  background: #1e293b;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: clamp(0.65rem, 2vw, 0.9rem);
  box-shadow: var(--shadow);
}

.bingo-grid[data-size="5"] { grid-template-columns: repeat(5, 1fr); }
.bingo-grid[data-size="4"] { grid-template-columns: repeat(4, 1fr); }
.bingo-grid[data-size="3"] { grid-template-columns: repeat(3, 1fr); }

.bingo-cell {
  background: #fff;
  color: #1e293b;
  padding: clamp(0.35rem, 1.5vw, 0.75rem);
  text-align: center;
  font-weight: 600;
  min-width: clamp(48px, 10vw, 80px);
  min-height: clamp(40px, 8vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-word;
}

.bingo-cell.header {
  background: #4f46e5;
  color: #fff;
  font-size: 1.1em;
  letter-spacing: 0.1em;
}

.bingo-cell.free {
  background: #fbbf24;
  color: #1e293b;
}

.bingo-cell.marked {
  background: #d1fae5;
  color: #047857;
  position: relative;
}

.bingo-cell.marked::after {
  content: '✓';
  position: absolute;
  top: 1px;
  right: 0.3rem;
  font-weight: 800;
  color: #059669;
}

@media print {
  .bingo-cell { background: #fff !important; color: #111 !important; }
  .bingo-cell.header { background: #4338ca !important; color: #fff !important; }
  .bingo-cell.free { background: #fbbf24 !important; color: #1f2937 !important; }
  .bingo-cell.marked { background: #d1fae5 !important; color: #047857 !important; }
  .bingo-grid { background: #1e293b !important; box-shadow: none !important; }

  #bingoResults[data-pp="1"] .bingo-card-wrapper {
    width: calc(100% - 1.5rem);
    max-width: 700px;
  }
  #bingoResults[data-pp="2"] .bingo-card-wrapper {
    width: calc(50% - 1.5rem);
  }
  #bingoResults[data-pp="4"] .bingo-card-wrapper {
    width: calc(25% - 1.5rem);
  }
  #bingoResults .bingo-card-wrapper {
    box-shadow: none !important;
  }
}