/* ==========================================================================
   Grade 5 Science: Unit 2 Food and Diet (Pages 18 & 19)
   High-Contrast, Touch-Optimized Smartboard Stylesheet (Pure CSS3)
   Optimized for Low-Spec School Screens • Zero Lag • GPU Accelerated
   ========================================================================== */

:root {
  --primary-blue: #0284c7;
  --primary-dark: #0369a1;
  --header-bg: #0f172a;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-subtle: #e2e8f0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.14);
  --touch-target-min: 52px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  touch-action: manipulation;
  direction: ltr;
}

/* ==========================================================================
   HEADER & SMARTBOARD TOOLBAR
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0284c7 100%);
  color: #ffffff;
  padding: 10px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 20;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.header-badge {
  background: #f59e0b;
  color: #000;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.header-text-group h1 {
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.page-pill {
  background: rgba(255, 255, 255, 0.2);
  font-size: 14px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.action-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.25);
}

.action-btn.active {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
  font-weight: 700;
}

.action-btn.btn-fullscreen {
  background: #0284c7;
  border-color: #38bdf8;
}

.action-btn.btn-ref {
  background: #8b5cf6;
  border-color: #a78bfa;
}

/* ==========================================================================
   NAVIGATION TAB BAR
   ========================================================================== */
.lesson-navbar {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav-tab {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  min-height: 46px;
  transition: all 0.15s ease;
}

.nav-tab .tab-num {
  background: rgba(255, 255, 255, 0.2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.nav-tab.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-tab.active .tab-num {
  background: #0284c7;
  color: #ffffff;
}

/* ==========================================================================
   WHITEBOARD MAGIC PEN OVERLAY
   ========================================================================== */
.drawing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 900;
}

.drawing-overlay.active {
  pointer-events: auto;
  cursor: crosshair;
}

.pen-toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 30px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.pen-toolbar.hidden {
  display: none !important;
}

.pen-tool-title {
  color: #38bdf8;
  font-weight: 700;
  font-size: 14px;
}

.pen-colors {
  display: flex;
  gap: 8px;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.color-dot.active {
  transform: scale(1.2);
  border-color: #ffffff;
}

.pen-sizes {
  display: flex;
  gap: 6px;
}

.size-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #475569;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.size-btn.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
}

.pen-btn {
  padding: 6px 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
}

.btn-clear {
  background: #f59e0b;
  color: #0f172a;
}

.btn-close {
  background: #ef4444;
  color: #ffffff;
}

/* ==========================================================================
   MAIN LESSON CONTAINER & SECTIONS
   ========================================================================== */
.lesson-stage {
  flex: 1;
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeInPane 0.2s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

/* Hero Title Box for Sections */
.section-hero {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hero-tag {
  color: var(--primary-blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
}

.speak-narrator-btn {
  background: #ecfeff;
  border: 2px solid #06b6d4;
  color: #0891b2;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.speak-narrator-btn:active {
  transform: scale(0.97);
  background: #cffafe;
}

/* Common Smart Action Buttons */
.smart-action-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target-min);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.smart-action-btn:active {
  transform: scale(0.98);
}

.smart-action-btn.btn-secondary {
  background: #e2e8f0;
  color: #334155;
  box-shadow: none;
}

.badge-mini {
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 6px;
}

/* ==========================================================================
   TAB 1: WHY LIVING THINGS NEED FOOD (Cards + Simulation)
   ========================================================================= */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pillar-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease;
}

.pillar-card:active {
  transform: translateY(-2px);
}

.pillar-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.pillar-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.pillar-icon {
  font-size: 32px;
}

.pillar-energy { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%); }
.pillar-growth { border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%); }
.pillar-repair { border-color: #fecdd3; background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%); }
.pillar-health { border-color: #bae6fd; background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%); }

.interactive-mini-trigger {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-action-btn {
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  color: #334155;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mini-action-btn:active {
  background: #f1f5f9;
}

.battery-meter-box {
  background: #e2e8f0;
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.battery-fill {
  background: linear-gradient(90deg, #10b981, #f59e0b);
  height: 100%;
  width: 100%;
  transition: width 0.4s ease;
}

.battery-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
}

.cell-cluster-box, .tissue-box, .shield-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

/* Micro-Simulation: Complex Food to Soluble Substances */
.simulation-banner {
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.sim-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: #0284c7;
}

.sim-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.cell-diffusion-stage {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 20px 0;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 200px;
}

.stage-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.zone-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.food-particle-complex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.big-food-icon {
  font-size: 48px;
  animation: floatMini 2s infinite ease-in-out;
}

@keyframes floatMini {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.food-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.stage-membrane {
  width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0f2fe;
  border: 2px dashed #0284c7;
  border-radius: 8px;
}

.membrane-wall {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 800;
  color: #0369a1;
  letter-spacing: 1px;
  text-align: center;
}

.zone-cell {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.cell-interior {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cell-nucleus {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.cell-powerhouse {
  background: #fef08a;
  color: #854d0e;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.soluble-molecules-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 40px;
}

.soluble-dot {
  background: #10b981;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 10px;
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.sim-status-feedback {
  background: #f1f5f9;
  border-left: 4px solid #0284c7;
  padding: 10px 16px;
  font-size: 14px;
  color: #334155;
  border-radius: 4px;
}

/* ==========================================================================
   TAB 2: FOOD OF PLANTS & MINERALS
   ========================================================================= */
.plant-factory-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.factory-recipe-col, .factory-visual-col {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.factory-recipe-col h3 {
  font-size: 18px;
  font-weight: 800;
  color: #166534;
}

.recipe-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.ingredient-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.ing-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ing-card.active {
  border-color: #10b981;
  background: #f0fdf4;
}

.ing-icon {
  font-size: 28px;
}

.ing-info {
  flex: 1;
}

.ing-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-main);
}

.ing-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.ing-check {
  font-size: 12px;
  font-weight: 800;
  color: #10b981;
  background: #dcfce7;
  padding: 4px 8px;
  border-radius: 6px;
}

.btn-leaf-cook {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.leaf-factory-display {
  background: linear-gradient(180deg, #e0f2fe 0%, #f0fdf4 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  height: 220px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sun-beam {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 36px;
  animation: pulseSun 2s infinite ease-in-out;
}

@keyframes pulseSun {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.air-flow {
  position: absolute;
  top: 30px;
  left: 20px;
  font-size: 16px;
  font-weight: 800;
  color: #0284c7;
}

.stem-flow {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 14px;
  font-weight: 800;
  color: #059669;
}

.leaf-shape {
  background: #22c55e;
  color: #ffffff;
  padding: 24px 36px;
  border-radius: 60px 10px 60px 10px;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
  text-align: center;
}

.leaf-label {
  display: block;
  font-weight: 800;
  font-size: 16px;
}

.glucose-output {
  margin-top: 10px;
  background: #fef08a;
  color: #854d0e;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.factory-message-box {
  margin-top: 14px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #166534;
  text-align: center;
}

/* Minerals Experiment */
.minerals-experiment-section {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.section-title-wrap h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.section-title-wrap p {
  font-size: 14px;
  color: var(--text-muted);
}

.mineral-pills-bar {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.mineral-pill {
  flex: 1;
  min-width: 140px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mineral-pill strong {
  display: inline-block;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.mineral-pill:hover {
  background: #f1f5f9;
}

.plant-comparison-stage {
  margin-top: 20px;
}

.plant-switch-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.mode-toggle-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch-target-min);
}

.mode-toggle-btn.active#btnPlantHealthy {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.mode-toggle-btn.active#btnPlantDeficient {
  background: #f59e0b;
  color: #000000;
  border-color: #d97706;
}

.plant-visualizer-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  align-items: center;
}

.plant-graphic-display {
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 65%, #78350f 65%, #451a03 100%);
  border-radius: var(--radius-md);
  height: 260px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.sun-icon-sky {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 32px;
}

.plant-stem {
  width: 14px;
  height: 120px;
  background: #22c55e;
  border-radius: 8px;
  position: relative;
  margin-bottom: 0px;
  transition: all 0.4s ease;
}

.plant-leaf {
  position: absolute;
  width: 44px;
  height: 24px;
  background: #22c55e;
  border-radius: 30px 4px 30px 4px;
  transition: all 0.4s ease;
}

.leaf-left { top: 30px; left: -40px; transform: rotate(-25deg); }
.leaf-right { top: 50px; right: -40px; transform: scaleX(-1) rotate(-25deg); }
.leaf-top { top: -14px; left: -15px; transform: rotate(45deg); }

.soil-ground {
  width: 100%;
  height: 90px;
  background: #78350f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fde68a;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 4px;
}

.plant-diagnosis-chart {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.plant-diagnosis-chart h4 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.diag-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diag-list li {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
}

.diag-list li.status-good {
  background: #f0fdf4;
  color: #166534;
}

.diag-list li.status-bad {
  background: #fef2f2;
  color: #991b1b;
}

.diag-bullet {
  font-weight: 800;
}

.diag-quote {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   TAB 3: FOOD STORED IN PLANTS & SORTING GAME
   ========================================================================= */
.storage-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.storage-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 2px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.storage-card:active {
  transform: scale(0.98);
  border-color: #0284c7;
}

.storage-badge {
  font-size: 11px;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 6px;
  align-self: flex-start;
}

.storage-icon-art {
  font-size: 40px;
  text-align: center;
  margin: 6px 0;
}

.storage-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.storage-examples {
  font-size: 13px;
  color: #059669;
}

.storage-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
  flex: 1;
}

.storage-tag {
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  color: #475569;
}

/* Sorting Game Container */
.sorting-game-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 2px solid #10b981;
}

.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.game-step-badge {
  background: #10b981;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
}

.game-instruction h4 {
  font-size: 16px;
  font-weight: 800;
  margin-top: 4px;
}

.game-score-pill {
  background: #fef08a;
  color: #854d0e;
  font-size: 16px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid #fde047;
}

.items-pool-tray {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  min-height: 80px;
  margin-bottom: 20px;
}

.sort-item-card {
  background: #ffffff;
  border: 2px solid #94a3b8;
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  min-height: 48px;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.sort-item-card.selected {
  border-color: #0284c7;
  background: #e0f2fe;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.sort-item-card .item-emoji {
  font-size: 24px;
}

.sorting-baskets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.basket-box {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 150px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.basket-box:active {
  transform: scale(0.99);
}

.basket-box.highlight {
  border-color: #10b981;
  background: #f0fdf4;
}

.basket-header {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.basket-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.basket-contents {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.basket-chip {
  background: #ffffff;
  border: 1px solid #10b981;
  color: #065f46;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: popIn 0.2s ease;
}

.game-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sort-feedback-text {
  font-size: 14px;
  font-weight: 700;
  color: #0284c7;
}

/* ==========================================================================
   TAB 4: FOOD OF ANIMALS & THE 7 NUTRIENTS
   ========================================================================= */
.nutrients-ribbon {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 0 16px 0;
  margin-bottom: 16px;
}

.nutrient-chip {
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: transform 0.1s ease;
}

.nutrient-chip:active {
  transform: scale(0.96);
}

.chip-carb { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.chip-protein { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.chip-fat { background: #ecfccb; color: #3f6212; border: 1px solid #d9f99d; }
.chip-vitamin { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.chip-mineral { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.chip-fiber { background: #fae8ff; color: #86198f; border: 1px solid #f5d0fe; }
.chip-water { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.two-substances-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.substance-classification-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.primary-card {
  border: 2px solid #f97316;
  background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
}

.protective-card {
  border: 2px solid #0284c7;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
}

.class-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  align-self: flex-start;
  letter-spacing: 0.5px;
}

.primary-card .class-badge { background: #fed7aa; color: #9a3412; }
.protective-card .class-badge { background: #bae6fd; color: #0369a1; }

.class-icon {
  font-size: 36px;
}

.substance-classification-card h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.class-formula {
  font-size: 15px;
  color: #0f172a;
}

.class-explanation {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.key-takeaway-chip {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}

.primary-card .key-takeaway-chip { background: #ffedd5; color: #c2410c; }
.protective-card .key-takeaway-chip { background: #e0f2fe; color: #0284c7; }

/* Balanced Diet Scale Simulator */
.balanced-diet-sim-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.sim-header-center {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 20px auto;
}

.sim-header-center h3 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
}

.diet-scenario-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
}

.diet-btn {
  flex: 1;
  max-width: 260px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 64px;
}

.diet-btn strong {
  font-size: 15px;
  color: var(--text-main);
}

.diet-btn span {
  font-size: 12px;
  color: var(--text-muted);
}

.diet-btn .diet-icon {
  font-size: 24px;
}

.diet-btn.active#btnBalanced {
  background: #10b981;
  border-color: #059669;
}
.diet-btn.active#btnBalanced strong,
.diet-btn.active#btnBalanced span { color: #ffffff; }

.diet-btn.active#btnTooLittle {
  background: #f59e0b;
  border-color: #d97706;
}
.diet-btn.active#btnTooLittle strong,
.diet-btn.active#btnTooLittle span { color: #000; }

.diet-btn.active#btnTooMuch {
  background: #ef4444;
  border-color: #dc2626;
}
.diet-btn.active#btnTooMuch strong,
.diet-btn.active#btnTooMuch span { color: #ffffff; }

.diet-visual-stage {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: center;
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.student-avatar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.avatar-display {
  font-size: 64px;
  transition: transform 0.3s ease;
}

.avatar-state-tag {
  font-size: 13px;
  font-weight: 800;
  color: #10b981;
  background: #dcfce7;
  padding: 4px 12px;
  border-radius: 12px;
}

.scale-mechanism {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.scale-beam {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transition: transform 0.4s ease;
}

.scale-pan {
  background: #ffffff;
  border: 2px solid #94a3b8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scale-fulcrum {
  font-size: 28px;
  color: #0284c7;
}

.diet-consequence-card {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
}

.diet-consequence-card h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
}

.diet-consequence-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   TAB 5: CARBOHYDRATES & ENERGY
   ========================================================================= */
.carbs-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.carb-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 2px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.carb-card:active {
  transform: scale(0.97);
  border-color: #f59e0b;
}

.carb-icon {
  font-size: 48px;
  margin: 4px 0;
}

.carb-card h3 {
  font-size: 17px;
  font-weight: 800;
}

.carb-source {
  font-size: 12px;
  color: var(--text-muted);
}

.energy-mini-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.energy-mini-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.energy-speed {
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
}

/* Speed Tapper Challenge */
.carb-challenge-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 2px solid #f59e0b;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.challenge-title h3 {
  font-size: 20px;
  font-weight: 800;
}

.challenge-title p {
  font-size: 14px;
  color: var(--text-muted);
}

.challenge-stats {
  display: flex;
  gap: 14px;
}

.stat-item {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}

.carb-game-board {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  min-height: 220px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.carb-target-item {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 0.1s ease;
}

.carb-target-item:active {
  transform: scale(0.95);
}

.carb-target-item.hit-correct {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.carb-target-item.hit-wrong {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

/* ==========================================================================
   TAB 6: SMARTBOARD GAMES & QUIZ CHAMPIONSHIP
   ========================================================================= */
.arena-sub-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.sub-tab-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #334155;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.sub-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.arena-sub-pane {
  display: none;
}

.arena-sub-pane.active {
  display: block;
}

/* Quiz Styles */
.quiz-card-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 2px solid #0284c7;
  max-width: 800px;
  margin: 0 auto;
}

.quiz-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.quiz-prog-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
}

.quiz-score-pill {
  background: #fef08a;
  color: #854d0e;
  font-weight: 800;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 12px;
}

.quiz-question-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-q-num {
  background: #0284c7;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
}

.quiz-q-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
  flex: 1;
}

.speak-btn-mini {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-option-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #334155;
  text-align: left;
  cursor: pointer;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
}

.quiz-option-btn:active {
  transform: scale(0.99);
}

.quiz-option-btn.correct {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.quiz-option-btn.wrong {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

.quiz-explanation-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #166534;
  margin-bottom: 20px;
}

.quiz-explanation-box.hidden {
  display: none;
}

.quiz-footer {
  display: flex;
  justify-content: flex-end;
}

/* Matching Styles */
.matching-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

.match-instructions {
  background: #e0f2fe;
  color: #0369a1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

.matching-columns-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 20px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.match-touch-card {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.match-touch-card.selected {
  border-color: #0284c7;
  background: #e0f2fe;
  transform: scale(1.02);
}

.match-touch-card.matched {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
  cursor: default;
}

.matching-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.match-feedback {
  font-size: 14px;
  font-weight: 700;
  color: #0284c7;
}

/* True or False Styles */
.tf-game-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-card);
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
  border: 2px solid #8b5cf6;
}

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

.tf-badge {
  background: #f3e8ff;
  color: #7e22ce;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 12px;
}

.tf-progress {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.tf-statement-box {
  background: #faf5ff;
  border: 2px dashed #d8b4fe;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.tf-statement-box h3 {
  font-size: 22px;
  font-weight: 800;
  color: #4c1d95;
  line-height: 1.4;
}

.tf-buttons-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.tf-btn {
  flex: 1;
  max-width: 200px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-tf-true {
  background: #10b981;
  color: #ffffff;
}

.btn-tf-false {
  background: #ef4444;
  color: #ffffff;
}

.tf-result-box {
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
}

.tf-result-box.correct {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.tf-result-box.wrong {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.tf-result-box.hidden {
  display: none;
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: #0f172a;
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 24px;
}

/* Wheel Modal */
.wheel-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.wheel-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.wheel-stage-wrap {
  position: relative;
  width: 360px;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  color: #ef4444;
  z-index: 10;
}

#studentWheelCanvas {
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 4s cubic-bezier(0.15, 0.9, 0.25, 1);
}

.btn-spin-trigger {
  width: 100%;
  max-width: 320px;
  font-size: 18px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 800;
}

.winner-reveal-card {
  background: #f0fdf4;
  border: 2px solid #10b981;
  border-radius: var(--radius-md);
  padding: 16px;
  width: 100%;
}

.winner-title {
  font-size: 18px;
  font-weight: 800;
  color: #166534;
}

.winner-task {
  font-size: 14px;
  color: #15803d;
  margin-top: 4px;
}

/* Timer Modal */
.timer-window {
  max-width: 440px;
}

.timer-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.timer-display-huge {
  font-size: 64px;
  font-weight: 900;
  color: #0284c7;
  font-family: monospace;
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 12px 30px;
}

.timer-preset-row {
  display: flex;
  gap: 8px;
}

.preset-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.preset-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.timer-controls-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.timer-controls-row .smart-action-btn {
  flex: 1;
}

/* Reference Modal */
.ref-window {
  max-width: 850px;
}

.ref-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ref-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
}

.ref-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #cbd5e1;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.ref-page-header h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.ref-tag {
  font-size: 11px;
  font-weight: 800;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
}

.ref-content-block ul {
  padding-left: 18px;
  margin: 6px 0 12px 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}

.ref-content-block p {
  font-size: 13px;
  color: #0f172a;
}

/* Confetti Overlay */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1200;
}

/* ==========================================================================
   RESPONSIVENESS & TOUCH ADJUSTMENTS
   ========================================================================== */
@media (max-width: 900px) {
  .plant-factory-container,
  .plant-visualizer-box,
  .two-substances-grid,
  .diet-visual-stage,
  .matching-columns-stage,
  .ref-body {
    grid-template-columns: 1fr;
  }

  .header-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   ISOLATED IFRAME & PSEUDO-FULLSCREEN SUPPORT
   ========================================================================== */
body.pseudo-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background-color: var(--bg-main) !important;
  overflow-y: auto !important;
}

