/* ==========================================================================
   66 BOOKS OF THE BIBLE - PRINTABLE ACTIVITY & MEMORIZATION SYSTEM
   Engineered for Screen Interactivity & Pixel-Perfect 8.5" x 11" Printing
   ========================================================================== */

:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #172554;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --bg-page: #f8fafc;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --paper-bg: #ffffff;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --shelf-wood: #8b5a2b;
  --shelf-shadow: #5c3a1e;

  /* Category Colors */
  --cat-law: #ea580c;
  --cat-history-ot: #0d9488;
  --cat-poetry: #7c3aed;
  --cat-major: #db2777;
  --cat-minor: #16a34a;
  --cat-gospels: #2563eb;
  --cat-history-nt: #0284c7;
  --cat-paul: #c2410c;
  --cat-general: #6d28d9;
  --cat-prophecy: #9f1239;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP HEADER & CONTROLS TOOLBAR (Hidden in Print)
   ========================================================================== */
.no-print-toolbar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid #334155;
}

.toolbar-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.control-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-item label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-weight: 700;
}

.select-custom, .input-custom {
  background-color: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  outline: none;
  transition: all 0.2s ease;
  min-width: 150px;
}

.select-custom:focus, .input-custom:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
}

.btn-print {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  font-size: 0.95rem;
  padding: 9px 20px;
}

.btn-print:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
  background-color: #334155;
  color: #e2e8f0;
}

.btn-secondary:hover {
  background-color: #475569;
  color: #ffffff;
}

.toggle-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #475569;
  cursor: pointer;
  font-weight: 600;
}

.toggle-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}

/* ==========================================================================
   PAGE CANVAS & PRINT WRAPPER
   ========================================================================== */
.preview-container {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.status-banner {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  border-radius: 8px;
  padding: 10px 18px;
  max-width: 900px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interactive-stats {
  display: flex;
  gap: 14px;
  font-weight: 700;
}

.interactive-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* The physical paper preview */
.printable-sheet {
  background: #ffffff;
  width: 8.5in;
  min-height: 11in;
  padding: 0.35in 0.4in;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  color: #111827;
  box-sizing: border-box;
}

.printable-sheet.landscape {
  width: 11in;
  min-height: 8.5in;
  padding: 0.35in 0.45in;
}

/* Eco Ink-Saver Mode (Greyscale / High Contrast) */
.eco-mode {
  --primary: #111827 !important;
  --primary-light: #374151 !important;
  --accent: #111827 !important;
  --cat-law: #111827 !important;
  --cat-history-ot: #111827 !important;
  --cat-poetry: #111827 !important;
  --cat-major: #111827 !important;
  --cat-minor: #111827 !important;
  --cat-gospels: #111827 !important;
  --cat-history-nt: #111827 !important;
  --cat-paul: #111827 !important;
  --cat-general: #111827 !important;
  --cat-prophecy: #111827 !important;
}

.eco-mode .cat-badge,
.eco-mode .testament-header,
.eco-mode .custom-church-badge {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border: 1px solid #6b7280 !important;
}

.eco-mode .book-spine {
  background: #ffffff !important;
  border: 1.5px solid #111827 !important;
  color: #111827 !important;
}

.eco-mode .book-spine.colored {
  background: #e5e7eb !important;
}

/* ==========================================================================
   WORKSHEET HEADER SECTION
   ========================================================================== */
.worksheet-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.organization-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d97706;
}

.eco-mode .organization-label {
  color: #111827;
}

.sheet-main-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-subtitle {
  font-size: 0.78rem;
  color: #475569;
  font-weight: 600;
  margin-top: 2px;
}

.header-badge-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.score-box {
  border: 2px solid #0f172a;
  border-radius: 6px;
  padding: 4px 10px;
  background: #fffbeb;
  text-align: center;
  min-width: 130px;
}

.eco-mode .score-box {
  background: #ffffff;
}

.score-box-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #475569;
}

.score-box-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
}

.star-rating {
  font-size: 0.95rem;
  color: #d1d5db;
  letter-spacing: 2px;
}

/* Student Info Fill-in Line */
.student-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px dashed #94a3b8;
  font-size: 0.82rem;
  font-weight: 700;
}

.meta-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
}

.meta-line {
  flex: 1;
  border-bottom: 1.5px solid #475569;
  height: 16px;
}

/* ==========================================================================
   TEMPLATE 1: 2-COLUMN FILL-IN CHALLENGE (PORTRAIT 1-PAGE FIT)
   ========================================================================== */
.challenge-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 16px;
  flex: 1;
}

.testament-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.testament-header {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.testament-header.nt-header {
  background: linear-gradient(135deg, #047857, #064e3b);
}

.eco-mode .testament-header.nt-header {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.testament-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
}

.category-block {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  background: #ffffff;
  page-break-inside: avoid;
  break-inside: avoid;
}

.category-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 3px;
}

.cat-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cat-badge.cat-law { background-color: var(--cat-law); }
.cat-badge.cat-history-ot { background-color: var(--cat-history-ot); }
.cat-badge.cat-poetry { background-color: var(--cat-poetry); }
.cat-badge.cat-major-prophets { background-color: var(--cat-major); }
.cat-badge.cat-minor-prophets { background-color: var(--cat-minor); }
.cat-badge.cat-gospels { background-color: var(--cat-gospels); }
.cat-badge.cat-history-nt { background-color: var(--cat-history-nt); }
.cat-badge.cat-paul { background-color: var(--cat-paul); }
.cat-badge.cat-general { background-color: var(--cat-general); }
.cat-badge.cat-prophecy { background-color: var(--cat-prophecy); }

.cat-count-pill {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
}

/* Books List Rows in Challenge */
.book-rows-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5px;
}

.book-rows-list.cols-2 {
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.book-fill-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.25;
}

.book-num {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  min-width: 20px;
  text-align: right;
  user-select: none;
}

.book-input-wrapper {
  flex: 1;
  display: flex;
  align-items: baseline;
  position: relative;
}

.book-line-underline {
  flex: 1;
  border-bottom: 1.2px solid #64748b;
  height: 18px;
  display: flex;
  align-items: flex-end;
  padding: 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.book-line-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
  padding: 0;
  height: 17px;
  font-family: inherit;
}

.book-line-input:focus {
  background: #f0f9ff;
  border-radius: 2px;
}

.book-line-input.correct {
  color: #15803d;
  font-weight: 800;
}

.book-line-input.incorrect {
  color: #b91c1c;
  background-color: #fee2e2;
}

.hint-text {
  color: #64748b;
  font-weight: 800;
}

.hint-remaining {
  border-bottom: 1px dotted #94a3b8;
  display: inline-block;
  min-width: 45px;
  height: 14px;
}

.chapter-count-tag {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 4px;
  user-select: none;
}

/* Memory Math Banner */
.memory-math-card {
  margin-top: 8px;
  background: #fffbeb;
  border: 1.5px dashed #f59e0b;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: #92400e;
  line-height: 1.3;
}

.eco-mode .memory-math-card {
  background: #f9fafb;
  border-color: #4b5563;
  color: #111827;
}

.memory-math-card strong {
  color: #78350f;
  font-size: 0.8rem;
}

.eco-mode .memory-math-card strong {
  color: #000000;
}

/* Word Bank at bottom (Optional toggle) */
.word-bank-section {
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
}

.word-bank-header {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.word-bank-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 5px;
  max-height: 80px;
  overflow: hidden;
}

.word-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  user-select: none;
}

.word-chip:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
}

.word-chip.used {
  text-decoration: line-through;
  opacity: 0.35;
  background: #e2e8f0;
}

/* ==========================================================================
   TEMPLATE 2: THE GREAT BIBLE BOOKSHELF (COLORING & TRACKING)
   ========================================================================== */
.bookshelf-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.shelf-unit {
  position: relative;
  background: #ffffff;
  border-radius: 6px;
  padding-bottom: 12px;
}

.shelf-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}

.shelf-title {
  font-size: 1rem;
  font-weight: 900;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.shelf-books-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3px;
  height: 185px;
  padding: 0 6px;
  position: relative;
  z-index: 2;
}

.shelf-plank {
  height: 14px;
  background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
  border-radius: 2px 2px 4px 4px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  margin-top: -1px;
  position: relative;
  z-index: 1;
}

.eco-mode .shelf-plank {
  background: #111827 !important;
}

.shelf-plank-shadow {
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
}

/* Book Spine Element */
.book-spine {
  flex: 1;
  min-width: 14px;
  max-width: 26px;
  border: 1.5px solid #1e293b;
  border-radius: 4px 4px 0 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 1px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.1);
}

.book-spine:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.spine-ribbon-top, .spine-ribbon-bottom {
  width: 100%;
  height: 3px;
  background: #cbd5e1;
}

.spine-text-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.02em;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 130px;
}

.spine-num {
  font-size: 0.58rem;
  font-weight: 800;
  opacity: 0.8;
}

/* Shelf Legend */
.shelf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}

.legend-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   TEMPLATE 3: COMPLETE REFERENCE & STUDY GUIDE TABLE
   ========================================================================== */
.study-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.study-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.study-table th {
  background: #0f172a;
  color: #ffffff;
  padding: 4px 6px;
  text-align: left;
  font-weight: 800;
  font-size: 0.7rem;
}

.study-table td {
  padding: 3px 6px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.study-table tr:nth-child(even) {
  background: #f8fafc;
}

/* ==========================================================================
   TEMPLATE 4: BOOKMARKS & POCKET CARDS (4-PER-PAGE CUTOUT)
   ========================================================================== */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  height: 100%;
  flex: 1;
}

.bookmark-card {
  border: 2px dashed #64748b;
  border-radius: 8px;
  padding: 10px 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.bookmark-header {
  text-align: center;
  border-bottom: 1.5px solid #0f172a;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.bookmark-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: #0f172a;
}

.bookmark-subtitle {
  font-size: 0.65rem;
  font-weight: 700;
  color: #d97706;
}

.bookmark-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  font-size: 0.68rem;
  overflow: hidden;
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bookmark-checkbox {
  width: 11px;
  height: 11px;
  border: 1.2px solid #475569;
  border-radius: 2px;
}

.bookmark-footer {
  text-align: center;
  border-top: 1px solid #cbd5e1;
  padding-top: 4px;
  margin-top: 6px;
  font-size: 0.6rem;
  color: #64748b;
  font-weight: 700;
}

/* ==========================================================================
   INTERACTIVE ON-SCREEN MODAL / CELEBRATION
   ========================================================================== */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 10000;
  display: none;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   PRINT MEDIA RULES - PERFECT 1-PAGE OUTPUT
   ========================================================================== */
@media print {
  @page {
    margin: 0.28in 0.32in;
    size: portrait;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 11pt;
  }

  .no-print-toolbar,
  .status-banner,
  .toast,
  .confetti-canvas,
  #instructionsDrawer {
    display: none !important;
  }

  .preview-container {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .printable-sheet {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
  }

  .printable-sheet.landscape {
    width: 100% !important;
  }

  /* Force exact colors and borders for printing */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .book-line-input {
    border: none !important;
    background: transparent !important;
    color: #000000 !important;
  }

  .book-line-underline {
    border-bottom: 1.2px solid #334155 !important;
  }

  /* Prevent page breaks inside critical elements */
  .category-block, .shelf-unit, .bookmark-card, .testament-col, .worksheet-header {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .challenge-grid {
    gap: 12px !important;
  }

  .book-fill-item {
    font-size: 0.74rem !important;
    line-height: 1.2 !important;
  }

  .book-line-underline {
    height: 15px !important;
  }

  .category-block {
    padding: 4px 6px !important;
    margin-bottom: 3px !important;
  }

  .word-bank-section {
    margin-top: 4px !important;
    padding: 4px 6px !important;
  }

  .word-bank-tags {
    gap: 2px 4px !important;
    max-height: none !important;
  }

  .word-chip {
    font-size: 0.62rem !important;
    padding: 0 4px !important;
  }
}

/* ==========================================================================
   ROYAL & CAPTAIN T-REX: PATTERN LEARNING SYSTEM STYLES
   ========================================================================== */

/* Top Navigation Bar Tabs */
.app-nav-tabs {
  background: #0f172a;
  border-bottom: 2px solid #334155;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px 0;
}

.nav-tab-btn {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-bottom: none;
  padding: 10px 22px;
  border-radius: 10px 10px 0 0;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  background: #334155;
  color: #ffffff;
}

.nav-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

/* Royal Hub Main Layout */
.royal-hub-wrapper {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 50px;
}

/* Captain T-Rex Hero Section */
.trex-hero-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
  border-radius: 18px;
  padding: 24px 28px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 10px 25px rgba(2, 132, 199, 0.25);
  position: relative;
  overflow: hidden;
}

.trex-avatar-box {
  width: 100px;
  height: 100px;
  min-width: 100px;
  background: #ffffff;
  border: 4px solid #facc15;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: gentleBob 3s ease-in-out infinite;
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.trex-speech-bubble {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  padding: 16px 20px;
  position: relative;
}

.trex-speech-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.trex-speech-text {
  font-size: 0.96rem;
  line-height: 1.5;
  color: #f8fafc;
}

.trex-action-bar {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-speak {
  background: #facc15;
  color: #854d0e;
  font-weight: 800;
  border: none;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.btn-speak:hover {
  background: #fef08a;
  transform: translateY(-2px);
}

/* Royal's Quick Milestones Strip */
.royal-milestone-strip {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  gap: 14px;
}

.milestone-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.badge-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
}

.badge-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

/* Learning Modules Grid */
.modules-container {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.module-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease;
}

.module-card:hover {
  border-color: #cbd5e1;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.module-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.module-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-desc {
  font-size: 0.88rem;
  color: #475569;
  margin-top: 4px;
}

/* Module 1: Day & Night Simulator */
.day-night-interactive {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 768px) {
  .day-night-interactive {
    grid-template-columns: 1fr;
  }
}

.sky-viewport {
  height: 240px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.6s ease;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sky-viewport.day {
  background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 100%);
}

.sky-viewport.night {
  background: linear-gradient(180deg, #090d16 0%, #1e1b4b 100%);
}

.celestial-body {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 30px rgba(253, 224, 71, 0.8);
}

.sky-viewport.day .celestial-body {
  background: #facc15;
  transform: scale(1.1);
}

.sky-viewport.night .celestial-body {
  background: #f1f5f9;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  transform: scale(0.95);
}

.sky-label {
  margin-top: 14px;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.sky-viewport.day .sky-label { color: #0369a1; }
.sky-viewport.night .sky-label { color: #f8fafc; }

.sky-subtext {
  font-size: 0.8rem;
  font-weight: 700;
}
.sky-viewport.day .sky-subtext { color: #0284c7; }
.sky-viewport.night .sky-subtext { color: #94a3b8; }

.day-controls-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.time-toggle-bar {
  display: flex;
  gap: 10px;
}

.time-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.time-btn.active {
  border-color: #0284c7;
  background: #e0f2fe;
  color: #0369a1;
}

/* Royal's Playground Tiles */
.playground-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.play-tile {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.play-tile:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  background: #f0f9ff;
}

.play-tile-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.play-tile-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1e293b;
}

/* Module 2: "What's Blue?" Discovery Cards */
.blue-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .blue-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.blue-card {
  background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blue-card:hover {
  transform: translateY(-3px);
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.blue-card-icon {
  font-size: 36px;
  margin-bottom: 6px;
}

.blue-card-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: #0369a1;
}

.blue-card-desc {
  font-size: 0.72rem;
  color: #475569;
  margin-top: 2px;
}

/* Color Pattern Sequencer Box */
.pattern-box-container {
  background: #f8fafc;
  border: 2px dashed #94a3b8;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pattern-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pattern-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.pattern-node {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.pattern-node.yellow { background: #facc15; border: 3px solid #eab308; }
.pattern-node.green { background: #22c55e; border: 3px solid #16a34a; }
.pattern-node.blue { background: #38bdf8; border: 3px solid #0284c7; }
.pattern-node.red { background: #ef4444; border: 3px solid #dc2626; }

.pattern-node.target-slot {
  background: #ffffff;
  border: 3px dashed #64748b;
  font-size: 1.4rem;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
}

.pattern-choices {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.choice-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.choice-btn:hover {
  transform: translateY(-2px);
  border-color: #0284c7;
}

/* Module 3: Noah's Rainbow & Covenant */
.rainbow-interactive-box {
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
  border-radius: 14px;
  padding: 20px;
  border: 2px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rainbow-display {
  width: 100%;
  max-width: 550px;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  padding-bottom: 8px;
}

.rainbow-arch-svg {
  width: 100%;
  height: 180px;
}

.rainbow-band-btn {
  cursor: pointer;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

.rainbow-band-btn:hover {
  opacity: 0.85;
}

.rainbow-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.rainbow-color-chip {
  padding: 6px 12px;
  border-radius: 20px;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.rainbow-color-chip:hover {
  transform: scale(1.05);
}

.covenant-verse-card {
  background: #fffbeb;
  border: 2px dashed #f59e0b;
  border-radius: 12px;
  padding: 12px 18px;
  max-width: 750px;
  text-align: center;
  font-size: 0.88rem;
  color: #92400e;
  line-height: 1.4;
}

/* Seasons Predictable Pattern Wheel */
.seasons-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .seasons-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.season-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.season-icon { font-size: 26px; }
.season-name { font-weight: 900; font-size: 0.85rem; color: #1e293b; margin-top: 2px; }
.season-sub { font-size: 0.68rem; color: #64748b; font-weight: 700; }

/* Module 5: Royal's 13 Books Mastered Board */
.royal-books-board {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mastered-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fefce8;
  border: 2px solid #facc15;
  border-radius: 12px;
  padding: 12px 18px;
}

.mastered-title {
  font-weight: 900;
  font-size: 1.05rem;
  color: #854d0e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.books-stars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.royal-book-badge {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.royal-book-badge.mastered {
  border-color: #facc15;
  background: linear-gradient(180deg, #fffbeb 0%, #fef9c3 100%);
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.2);
}

.royal-book-badge.next-goal {
  border-color: #38bdf8;
  border-style: dashed;
  background: #f0f9ff;
}

.badge-star {
  color: #eab308;
  font-size: 1.1rem;
}

.badge-book-name {
  font-weight: 900;
  font-size: 0.82rem;
  color: #0f172a;
  margin-top: 2px;
}

.badge-book-cat {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 700;
}

/* ==========================================================================
   MODAL DIALOG & GEMINI LIVE STYLES
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: slideInModal 0.25s ease;
}

@keyframes slideInModal {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Book Selector Grid */
.selector-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.selector-search-input {
  flex: 1;
  min-width: 220px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  outline: none;
}

.selector-search-input:focus {
  border-color: #0284c7;
}

.quick-action-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.book-checkboxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.book-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.book-select-item:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.book-select-item.selected {
  border-color: #eab308;
  background: #fefce8;
  font-weight: 800;
}

.book-select-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #eab308;
  cursor: pointer;
}

.book-select-num {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 20px;
}

.book-select-name {
  font-size: 0.85rem;
  color: #0f172a;
}

/* Gemini Live Voice Bar */
.gemini-live-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border: 2px solid #38bdf8;
  border-radius: 16px;
  padding: 18px 24px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2);
}

.gemini-live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.gemini-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.gemini-status-badge.connected {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

.mic-action-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-mic {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
  position: relative;
}

.btn-mic:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-mic.listening {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: pulseMic 1.2s infinite;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
}

@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mic-text-status {
  display: flex;
  flex-direction: column;
}

.mic-main-status {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.mic-sub-hint {
  font-size: 0.8rem;
  color: #94a3b8;
}

.live-transcript-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e2e8f0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-transcript-royal {
  color: #38bdf8;
  font-weight: 700;
}

.live-transcript-trex {
  color: #fde047;
  font-weight: 700;
}

/* ==========================================================================
   ROYAL BLUE SPOTLIGHT & PHONICS STUDIO STYLES
   ========================================================================== */
.royal-blue-spotlight {
  background: linear-gradient(135deg, #002366 0%, #4169E1 100%);
  border-radius: 14px;
  padding: 20px 24px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(65, 105, 225, 0.35);
  border: 2px solid #60a5fa;
  margin-top: 16px;
}

.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.spotlight-title {
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fef08a;
}

.swatches-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.swatch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.82rem;
}

.swatch-color-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

/* Phonics & Pronunciation Studio */
.phonics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.phonics-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.phonics-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.phonics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phonics-book-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
}

.syllables-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.syllable-pill {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 900;
  font-size: 0.88rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #bae6fd;
}

.syllable-pill.emphasis {
  background: #fef08a;
  color: #854d0e;
  border-color: #fde047;
}

.phonics-action-bar {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-phonics-play {
  flex: 1;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-phonics-play.normal {
  background: #0284c7;
  color: #ffffff;
}

.btn-phonics-play.normal:hover {
  background: #0369a1;
}

.btn-phonics-play.slow {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-phonics-play.slow:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   🤖 TEACH ROYAL HOW TO USE AI & THE AI TRUTH SHIELD
   ========================================================================== */
.ai-truth-card {
  background: linear-gradient(135deg, #090d16 0%, #1e1b4b 50%, #0c1a30 100%);
  border: 2px solid #818cf8;
  border-radius: 16px;
  padding: 22px 26px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
  margin-top: 14px;
}

.ai-truth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 14px;
}

.ai-truth-badge {
  background: rgba(129, 140, 248, 0.2);
  border: 1px solid #818cf8;
  color: #c7d2fe;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.ai-rule-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.ai-rule-box:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #818cf8;
  transform: translateY(-2px);
}

.ai-rule-num {
  width: 28px;
  height: 28px;
  background: #6366f1;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ai-rule-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 3px;
}

.ai-rule-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
}

/* Hallucination Spotter Mini-Game */
.hallucination-game-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.truth-score-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.82rem;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.hallucination-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.ai-statement-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.ai-statement-card.verified-truth {
  border-color: #22c55e;
  background: rgba(22, 101, 52, 0.3);
}

.ai-statement-card.caught-bug {
  border-color: #ef4444;
  background: rgba(153, 27, 27, 0.3);
}

.statement-bubble {
  font-size: 0.88rem;
  line-height: 1.4;
  color: #e2e8f0;
}

.statement-bubble strong {
  color: #38bdf8;
}

.statement-actions {
  display: flex;
  gap: 8px;
}

.btn-spot {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-spot.truth {
  background: #15803d;
  color: #ffffff;
}

.btn-spot.truth:hover {
  background: #16a34a;
}

.btn-spot.bug {
  background: #b91c1c;
  color: #ffffff;
}

.btn-spot.bug:hover {
  background: #dc2626;
}

.spot-result-msg {
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 4px;
}

.spot-result-msg.success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.spot-result-msg.error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Microphone Ear Live Decoder */
.mic-decoder-panel {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.mic-decoder-label {
  color: #94a3b8;
  font-weight: 700;
}

.mic-decoder-val {
  color: #38bdf8;
  font-weight: 800;
}

/* Extended Royal Blue Specifications Panel */
.royal-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.royal-spec-tile {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.royal-spec-label {
  font-size: 0.7rem;
  color: #93c5fd;
  text-transform: uppercase;
  font-weight: 800;
}

.royal-spec-val {
  font-size: 0.85rem;
  color: #ffffff;
  font-weight: 700;
}





/* ==========================================================================
   BIBLE CHAMPIONS ARENA (ROYAL GILLISPIE & DA'LANI LEE)
   Co-Op Ark Builder, Head-to-Head Buzzer Arena & Official Certificate Suite
   ========================================================================== */

.arena-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #31102b 100%);
  border-radius: 18px;
  border: 2px solid #ca8a04;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 24px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.arena-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 16px;
}

.arena-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.arena-emblem-badge {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.25);
}

.arena-title {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.arena-subtitle {
  font-size: 0.92rem;
  color: #cbd5e1;
}

.subdomain-badge-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.subdomain-chip {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subdomain-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Dual Student Cards */
.arena-students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.student-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  transition: all 0.25s ease;
}

.student-card.royal-card {
  border: 1.5px solid #3b82f6;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

.student-card.royal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
}

.student-card.dalani-card {
  border: 1.5px solid #ec4899;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.2);
}

.student-card.dalani-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.35);
}

.student-avatar-box {
  font-size: 2.2rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.royal-card .student-avatar-box {
  border-color: #60a5fa;
  background: radial-gradient(circle, #2563eb, #1e3a8a);
}

.dalani-card .student-avatar-box {
  border-color: #f472b6;
  background: radial-gradient(circle, #db2777, #831843);
}

.student-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.student-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.royal-tag {
  background: #1e40af;
  color: #bfdbfe;
  border: 1px solid #3b82f6;
}

.dalani-tag {
  background: #9d174d;
  color: #fbcfe8;
  border: 1px solid #ec4899;
}

.student-motto {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-style: italic;
}

.student-stats-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.stat-pill {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  color: #f1f5f9;
}

.stat-pill strong {
  color: #facc15;
}

.buzzer-key-badge {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Arena Sub-Nav Bar */
.arena-nav-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
}

.arena-subtab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.arena-subtab-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.arena-subtab-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Ark of the Covenant Co-Op Mode */
.coop-turn-badge {
  background: #fef08a;
  color: #854d0e;
  border: 1.5px solid #ca8a04;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: pulseTurn 2s infinite ease-in-out;
}

@keyframes pulseTurn {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(202, 138, 4, 0); }
  50% { transform: scale(1.03); box-shadow: 0 0 12px rgba(202, 138, 4, 0.5); }
}

.ark-visual-card {
  background: radial-gradient(circle at center, #fef9c3 0%, #fef08a 60%, #fde047 100%);
  border: 2px solid #ca8a04;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(202, 138, 4, 0.2);
  margin-bottom: 20px;
}

.ark-chest-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.ark-progress-labels {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.92rem;
  color: #713f12;
  margin-bottom: 8px;
}

.ark-bar-track {
  background: rgba(0, 0, 0, 0.1);
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid #ca8a04;
}

.ark-bar-fill {
  background: linear-gradient(90deg, #ca8a04, #eab308, #fef08a, #ca8a04);
  background-size: 200% 100%;
  animation: shimmerGold 3s linear infinite;
  height: 100%;
  border-radius: 9px;
  transition: width 0.4s ease;
}

@keyframes shimmerGold {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.coop-question-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.coop-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.coop-prompt-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.phonics-callout {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.phonics-syllables {
  font-size: 1.05rem;
  font-weight: 800;
  color: #166534;
  letter-spacing: 0.5px;
}

.phonics-guide {
  font-size: 0.85rem;
  color: #15803d;
  font-weight: 700;
}

.btn-speak-audio {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

.btn-speak-audio:hover {
  transform: scale(1.05);
  background: #15803d;
}

.coop-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.coop-option-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coop-option-btn:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
}

/* Head-to-Head Bible Buzzer Battle */
.battle-buzzers-grid {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 20px;
  align-items: stretch;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .battle-buzzers-grid {
    grid-template-columns: 1fr;
  }
}

.buzzer-podium {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.royal-podium {
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  border: 2px solid #60a5fa;
  color: #ffffff;
}

.dalani-podium {
  background: linear-gradient(180deg, #831843 0%, #9d174d 100%);
  border: 2px solid #f472b6;
  color: #ffffff;
}

.podium-avatar {
  font-size: 2.8rem;
}

.podium-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: #ffffff;
}

.podium-score {
  font-size: 2.6rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.buzzer-btn {
  width: 100%;
  padding: 16px 12px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.3), 0 10px 20px rgba(0,0,0,0.25);
  transition: all 0.1s ease;
}

.royal-buzzer-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: 2px solid #93c5fd;
}

.royal-buzzer-btn:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.royal-buzzer-btn:active, .royal-buzzer-btn.buzzed-active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
  background: #1d4ed8;
}

.dalani-buzzer-btn {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: #ffffff;
  border: 2px solid #fbcfe8;
}

.dalani-buzzer-btn:hover {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.dalani-buzzer-btn:active, .dalani-buzzer-btn.buzzed-active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
  background: #be185d;
}

.buzzer-circle {
  font-size: 1.8rem;
}

.buzzer-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.buzzer-sub {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.9;
  text-transform: uppercase;
}

.battle-center-arena {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.battle-status-msg {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 800;
  color: #334155;
}

.battle-timer-bar-wrapper {
  background: #e2e8f0;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.battle-timer-bar {
  background: #ef4444;
  height: 100%;
  width: 100%;
  transition: width 0.1s linear;
}

.battle-question-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.battle-q-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.battle-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.battle-choice-btn {
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.battle-choice-btn:hover:not(:disabled) {
  border-color: #f59e0b;
  background: #fef3c7;
}

.battle-choice-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Scholar Exam & Official Certificate */
.exam-setup-bar {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.setup-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-group label {
  font-weight: 800;
  font-size: 0.88rem;
  color: #334155;
}

.student-radio-toggle {
  display: flex;
  gap: 8px;
}

.student-select-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.student-select-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* Official 501(c)(3) Certificate of Achievement */
.official-certificate-wrapper {
  background: #ffffff;
  padding: 30px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  max-width: 900px;
  margin: 0 auto;
}

.cert-border-outer {
  border: 6px double #ca8a04;
  padding: 24px;
  background: #fffdfa;
  border-radius: 8px;
  position: relative;
}

.cert-border-inner {
  border: 2px solid #eab308;
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cert-church-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: #854d0e;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.cert-ministry-tag {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ca8a04;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.cert-award-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0f172a;
  font-family: Georgia, serif;
  margin: 10px 0 4px;
  letter-spacing: 1px;
}

.cert-certifies-text {
  font-size: 0.95rem;
  color: #475569;
  font-style: italic;
}

.cert-student-name {
  font-size: 2.5rem;
  font-weight: 900;
  color: #1e3a8a;
  border-bottom: 2px solid #ca8a04;
  padding: 4px 30px 8px;
  display: inline-block;
  font-family: Georgia, serif;
  margin: 6px 0;
}

.cert-body-text {
  max-width: 650px;
  font-size: 0.98rem;
  color: #334155;
  line-height: 1.6;
}

.cert-badge-level {
  background: linear-gradient(135deg, #ca8a04, #eab308);
  color: #ffffff;
  padding: 6px 20px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

.cert-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  max-width: 700px;
  margin-top: 24px;
  padding-top: 16px;
}

.cert-seal-box {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px double #ca8a04;
  background: radial-gradient(circle, #fef08a, #ca8a04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(202, 138, 4, 0.4);
  font-weight: 900;
  color: #713f12;
  font-size: 0.65rem;
  text-align: center;
  padding: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cert-sign-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cert-sign-line {
  width: 180px;
  height: 1.5px;
  background: #334155;
  margin-bottom: 4px;
}

.cert-sign-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
}

.cert-sign-title {
  font-size: 0.72rem;
  color: #64748b;
}

/* Phonics Studio Grid */
.phonics-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.phonics-book-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.phonics-book-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #3b82f6;
}

.phonics-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phonics-book-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

.phonics-syllable-display {
  font-size: 0.95rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.5px;
}

.phonics-pronounce-guide {
  font-size: 0.8rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
}

.phonics-hook-text {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.4;
}

/* Print Rules specifically for Certificate */
@media print {
  body.printing-cert * {
    visibility: hidden;
  }
  body.printing-cert #certificateBox,
  body.printing-cert #certificateBox * {
    visibility: visible;
  }
  body.printing-cert #certificateBox {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  body.printing-cert .no-print,
  body.printing-cert .cert-action-bar {
    display: none !important;
  }
}


/* Student Custom Photos - Personalized for Royal & Da'lani */
.student-avatar-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ca8a04;
  box-shadow: 0 0 14px rgba(202, 138, 4, 0.5);
  display: block;
}

.royal-card .student-avatar-img {
  border-color: #60a5fa;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.6);
}

.dalani-card .student-avatar-img {
  border-color: #f472b6;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.6);
}

.podium-avatar-img {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fef08a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 6px;
  background: #1e293b;
  display: block;
}

.cert-student-photo-frame {
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-student-photo-seal {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px double #ca8a04;
  box-shadow: 0 4px 14px rgba(202, 138, 4, 0.35);
}


/* ==========================================================================
   100/100 VISUAL MAKEOVER - GAMIFIED PIXAR & 3D ARCADE STYLING
   ========================================================================== */

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, .arena-title, .student-name, .btn, .nav-tab-btn, .coop-option-btn, .battle-choice-btn {
  font-family: 'Fredoka', 'Outfit', sans-serif;
}

/* 3D Immersive Ark Visual Card */
.ark-visual-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.85) 100%), url('ark_adventure_3d.jpg') center/cover no-repeat !important;
  border: 3px solid #eab308 !important;
  color: #ffffff !important;
  padding: 30px 24px !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 30px rgba(234, 179, 8, 0.3) !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
}

.ark-progress-labels {
  color: #fef08a !important;
  font-size: 1.05rem !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.ark-bar-track {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 2px solid #facc15 !important;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
  height: 22px !important;
}

/* 3D Immersive Buzzer Battle Arena */
.battle-center-arena {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%), url('buzzer_arena_3d.jpg') center/cover no-repeat !important;
  border: 3px solid #f59e0b !important;
  border-radius: 18px !important;
  color: #ffffff !important;
  box-shadow: 0 12px 35px rgba(0,0,0,0.4), 0 0 25px rgba(245, 158, 11, 0.25) !important;
}

.battle-q-title {
  color: #f8fafc !important;
  font-size: 1.3rem !important;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.battle-choice-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  padding: 16px !important;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3) !important;
  transition: all 0.15s ease !important;
}

.battle-choice-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #fef08a !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4) !important;
}

.battle-choice-btn:active:not(:disabled) {
  transform: translateY(2px) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,0.3) !important;
}

/* Avatar Switcher Bar */
.avatar-view-toggle-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 6px 16px;
  margin: 0 auto;
  max-width: 440px;
}

.avatar-toggle-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.avatar-toggle-btn.active {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* 3D Hero Avatar Badges */
.hero-avatar-3d-box {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.5);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.25s ease;
  background: #0f172a;
}

.hero-avatar-3d-box:hover {
  transform: scale(1.1) rotate(2deg);
}

.hero-avatar-3d-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Duolingo Style 3D tactile buttons */
.coop-option-btn {
  box-shadow: 0 4px 0 #cbd5e1;
  transition: all 0.15s ease;
}

.coop-option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #93c5fd;
  border-color: #3b82f6;
}

.coop-option-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #93c5fd;
}

/* Trophies & Streaks Floating Badges */
.streak-flame-badge {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: pulseFlame 1.8s infinite ease-in-out;
}

@keyframes pulseFlame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}


/* ==========================================================================
   DUAL PHOTO & 3D PIXAR AVATAR DISPLAY + CELEBRATION ANIMATIONS
   ========================================================================== */

.student-dual-avatars-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.avatar-photo-wrapper, .avatar-hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}

.avatar-real-photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ca8a04;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}

.avatar-real-photo:hover {
  transform: scale(1.1);
  border-color: #facc15;
}

.avatar-hero-3d {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.5);
  transition: all 0.25s ease;
  background: #0f172a;
  cursor: pointer;
}

.avatar-hero-3d:hover {
  transform: scale(1.15) rotate(3deg);
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.8);
}

.avatar-label-sub {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

/* Podium Dual Display */
.podium-dual-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.podium-real-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fef08a;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.podium-hero-3d {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 3.5px solid #facc15;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.6);
  background: #0f172a;
}

/* Celebration Keyframes */
@keyframes avatarCelebrationJump {
  0% { transform: scale(1) translateY(0) rotate(0deg); }
  25% { transform: scale(1.22) translateY(-20px) rotate(-8deg); }
  50% { transform: scale(1.3) translateY(-28px) rotate(8deg); }
  75% { transform: scale(1.18) translateY(-12px) rotate(-4deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}

@keyframes avatarGlowSparkle {
  0%, 100% { filter: drop-shadow(0 0 8px #facc15); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px #ec4899) drop-shadow(0 0 50px #f59e0b); transform: scale(1.22) rotate(6deg); }
}

.celebrate-jump {
  animation: avatarCelebrationJump 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
  z-index: 100 !important;
}

.celebrate-sparkle {
  animation: avatarGlowSparkle 0.9s ease-in-out infinite;
  z-index: 100 !important;
}

/* High Five Celebration Banner */
.highfive-banner-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 50%, #3b82f6 100%);
  color: #ffffff;
  border: 2px solid #fef08a;
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
  transition: all 0.2s ease;
}

.highfive-banner-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.6);
}

/* ==========================================================================
   UNIVERSAL SCHOLAR PROFILE BAR & MULTI-CHILD CUSTOMIZER STYLES
   ========================================================================== */

.scholar-selector-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-left: 6px solid #2563eb;
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.25s ease;
}

@media (min-width: 860px) {
  .scholar-selector-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.scholar-active-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.scholar-avatar-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}

.scholar-badge-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 4px;
}

.scholar-active-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.scholar-active-sub {
  font-size: 0.85rem;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.scholar-quick-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-switch-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scholar-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scholar-chip {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.scholar-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

.scholar-chip.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.scholar-chip.custom-btn {
  background: #fef08a;
  border-color: #ca8a04;
  color: #854d0e;
}

.scholar-chip.custom-btn:hover {
  background: #fde047;
}

/* Scholar Creator Modal */
.scholar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.scholar-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.scholar-modal-dialog {
  background: #ffffff;
  border-radius: 22px;
  max-width: 540px;
  width: 100%;
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scholar-modal-backdrop.active .scholar-modal-dialog {
  transform: scale(1);
}

.scholar-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.scholar-modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.scholar-modal-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 20px;
  line-height: 1.45;
}

.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 20px 0;
}

.avatar-pick-option {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-pick-option:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.avatar-pick-option.selected {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.avatar-pick-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 4px;
}

.avatar-pick-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  display: block;
}

.avatar-pick-sub {
  font-size: 0.68rem;
  color: #64748b;
}

.btn-scholar-save {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-scholar-save:hover {
  background: #1e40af;
  transform: translateY(-2px);
}


/* PAO Scene Memory Theater Modal */
.pao-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999999;
  overflow-y: auto;
  padding: 20px;
}
.phonics-pao-preview:hover .phonics-scene-img {
  transform: scale(1.05);
}
.pao-style-btn {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pao-style-btn:hover {
  background: #334155;
  color: #fff;
}
.pao-style-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}


/* PAO Gallery Chips & Styles */
.pao-chip-btn {
  background: rgba(30, 41, 59, 0.7);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pao-chip-btn:hover {
  background: #334155;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.pao-chip-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}


/* Syllable Teaching Pulse Animation */
@keyframes syllablePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
  50% { transform: scale(1.06); box-shadow: 0 0 20px rgba(56, 189, 248, 0.6); border-color: #38bdf8; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
}

.syllable-teaching-pulse button {
  animation: syllablePulse 1s ease-in-out infinite;
}

.audio-speed-btn.active {
  background: #0284c7 !important;
  color: #fff !important;
  border-color: #38bdf8 !important;
  font-weight: 700;
}
