/* ==========================================================================
   Math Textbook Interactive Simulation - Pages 7, 8, 9
   Grade 5 / Grade 6 Mathematics: Ordering, Rounding, Powers & Roots
   100% Visual Matching to Printed Textbook + Smartboard Interactive Controls
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900;1,700&family=Caveat:wght@600;700&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
  /* Textbook Authentic Palette */
  --tb-header-purple: #322f67;
  --tb-header-purple-dark: #24214d;
  --tb-header-orange: #ea580c;
  --tb-header-orange-light: #fb923c;
  --tb-exercises-teal: #106f69;
  --tb-exercises-teal-dark: #0a524e;
  --tb-exercise-bullet: #84cc16;
  --tb-note-blue: #3b77ba;
  --tb-page-number-red: #de472c;
  --tb-yellow-strip: #fdf2a7;
  --tb-yellow-strip-border: #f8e577;
  --tb-mint-box: #e5f1ea;
  --tb-mint-border: #b8ded0;
  
  /* Ink & Typography */
  --tb-text-dark: #1e293b;
  --tb-text-muted: #475569;
  --tb-text-blue: #1b5387;
  --tb-line-grey: #64748b;
  --tb-ink-blue: #0b57d0;
  --tb-ink-glow: rgba(11, 87, 208, 0.25);
  
  /* App Interface Colors */
  --ui-bg: #e2e8f0;
  --ui-surface: #ffffff;
  --ui-primary: #2563eb;
  --ui-primary-hover: #1d4ed8;
  --ui-accent: #f59e0b;
  --ui-success: #10b981;
  --ui-border: #cbd5e1;
  --ui-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  
  /* Dimensions & Fonts */
  --font-book: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-math: 'Nunito', 'JetBrains Mono', monospace;
  --font-ink: 'Caveat', 'Segoe Print', cursive, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--ui-bg);
  font-family: var(--font-book);
  color: var(--tb-text-dark);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   APP HEADER & CLASSROOM TOP BAR
   ========================================================================== */
.smartboard-topbar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lesson-badge {
  background: #ea580c;
  color: #ffffff;
  font-weight: 900;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.4);
}

.lesson-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lesson-title .subtitle {
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
}

/* Page Tabs in Top Bar */
.page-tabs-group {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 30px;
  gap: 4px;
}

.page-tab-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.page-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.tool-btn:active, .tool-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

/* ==========================================================================
   MAIN WORKSPACE & TEXTBOOK STAGE
   ========================================================================== */
.book-stage-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px 110px 16px; /* Bottom padding so floating control bar doesn't cover content */
  min-height: calc(100vh - 120px);
}

.book-viewport {
  max-width: 920px;
  width: 100%;
  perspective: 1200px;
}

/* Realistic Printed Textbook Page */
.textbook-page {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  display: none;
  min-height: 1140px;
  flex-direction: column;
  animation: pageFade 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.textbook-page.active {
  display: flex;
}

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

/* Paper Background Gradient & Texture */
.page-top-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(180deg, #fcd8c0 0%, #feeade 50%, #ffffff 100%);
  z-index: 1;
  pointer-events: none;
}

.page-inner-content {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 24px 34px 50px 34px;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TEXTBOOK TOP HEADERS (100% Matching Images)
   ========================================================================== */
.textbook-header {
  position: relative;
  margin-bottom: 22px;
}

/* Orange horizontal accent stripe */
.header-accent-stripe {
  height: 4px;
  background: linear-gradient(90deg, #ea580c 0%, #f97316 70%, transparent 100%);
  border-radius: 2px;
  margin-bottom: 8px;
  width: 90%;
}

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

/* Section Header Pill (Dark Purple Navy) */
.section-pill {
  background: var(--tb-header-purple);
  color: #ffffff;
  padding: 10px 32px 10px 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 14px rgba(50, 47, 103, 0.35);
  position: relative;
}

.section-pill .section-num {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.section-pill .section-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

/* Student Icon on Page 9 */
.student-avatar-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #f97316;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.student-avatar-badge svg {
  width: 100%;
  height: 100%;
}

/* Teal Exercises Section Bar */
.exercises-bar {
  background: var(--tb-exercises-teal);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(16, 111, 105, 0.2);
}

.exercises-bullet-square {
  width: 13px;
  height: 13px;
  background: var(--tb-exercise-bullet);
  border-radius: 2px;
  flex-shrink: 0;
}

.exercises-bar-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   PAGE 7 SPECIFIC STYLES: 1.3 ORDERING NUMBERS
   ========================================================================== */
.p7-intro-stairs-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #f0fdf4 0%, #e6f6ee 100%);
  border: 2px dashed #86efac;
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 24px;
}

.stairs-illustration {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
}

.stairs-text h4 {
  font-size: 17px;
  color: #166534;
  font-weight: 800;
  margin-bottom: 4px;
}

.stairs-text p {
  font-size: 14.5px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.35;
}

.exercise-prompt-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--tb-text-dark);
  margin-bottom: 20px;
}

.exercise-question-block {
  margin-bottom: 30px;
}

.question-numbers-row {
  font-size: 20px;
  font-weight: 700;
  color: var(--tb-text-dark);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.answer-writein-line {
  position: relative;
  min-height: 52px;
  border-bottom: 2px solid var(--tb-line-grey);
  display: flex;
  align-items: flex-end;
  padding: 4px 12px 6px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.answer-writein-line:hover {
  background-color: rgba(241, 245, 249, 0.6);
}

.p7-mint-notes-panel {
  margin-top: 36px;
  background: var(--tb-mint-box);
  border: 1.5px solid var(--tb-mint-border);
  border-radius: 18px;
  padding: 24px 26px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.mint-panel-title {
  font-size: 19px;
  font-weight: 800;
  color: #1e3a5f;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mint-tip-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mint-tip-item {
  font-size: 16px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.tip-dot {
  color: #059669;
  font-size: 20px;
  line-height: 1;
}

/* ==========================================================================
   PAGE 8 SPECIFIC STYLES: 1.4 ROUNDING
   ========================================================================== */
.p8-lead-question {
  color: var(--tb-text-blue);
  font-size: 20.5px;
  font-weight: 700;
  margin-bottom: 22px;
}

/* 4 Cartoon Real-Life Examples Grid */
.p8-examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.example-comic-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  position: relative;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.comic-illustration-box {
  width: 120px;
  height: 110px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comic-illustration-box svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Speech Bubble */
.speech-bubble {
  flex: 1;
  background: #ffffff;
  border: 1.8px solid #64748b;
  border-radius: 14px;
  padding: 10px 14px;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.speech-bubble::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -10px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid #64748b;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid #ffffff;
}

.speech-text {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--tb-text-dark);
  line-height: 1.35;
}

/* Rounded Status Interactive Chip */
.example-interactive-chip {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-rounded {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.chip-exact {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* Page 8 Exercises Section */
.p8-exercise-1 {
  margin-bottom: 24px;
}

.p8-q1-title {
  font-size: 19px;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 10px;
}

.p8-q1-title span.highlight-num {
  font-weight: 900;
  color: #042f2e;
}

.p8-exercise-columns {
  margin-bottom: 24px;
}

.p8-col-title {
  font-size: 18.5px;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 14px;
}

.p8-tri-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.p8-tri-item {
  display: flex;
  flex-direction: column;
}

.tri-prompt {
  font-size: 19px;
  font-weight: 700;
  color: var(--tb-text-dark);
  margin-bottom: 8px;
}

.tri-answer-line {
  min-height: 44px;
  border-bottom: 2px solid var(--tb-line-grey);
  display: flex;
  align-items: flex-end;
  padding: 2px 8px 4px 8px;
  cursor: pointer;
}

/* ==========================================================================
   PAGE 9 SPECIFIC STYLES: 1.5 POWERS AND ROOTS
   ========================================================================== */
.p9-explanation-block {
  margin-bottom: 20px;
}

.p9-lead-para {
  font-size: 18px;
  font-weight: 600;
  color: #334155;
  line-height: 1.45;
  margin-bottom: 6px;
}

/* Powers Diagram & Blue Note Box Row */
.p9-diagram-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.p9-math-breakdown {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 4^2 with Annotated Base and Power */
.power-annotated-figure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  align-self: flex-start;
}

.base-number {
  font-size: 38px;
  font-weight: 900;
  color: #0f172a;
  position: relative;
  line-height: 1;
}

.exponent-number {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  position: relative;
  line-height: 1;
  vertical-align: top;
  margin-top: -12px;
}

.annotation-label {
  font-size: 13px;
  font-weight: 800;
  color: #64748b;
  position: absolute;
}

.annotation-base {
  left: -38px;
  bottom: 8px;
}

.annotation-power {
  right: -52px;
  top: 6px;
}

.power-calc-formula {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.power-words-explanation {
  font-size: 17px;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.power-words-indent {
  padding-left: 28px;
  font-weight: 700;
  color: #1e293b;
}

.squared-rule-note {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
}

/* Blue Note Box on the Right */
.p9-note-blue-box {
  background: var(--tb-note-blue);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: 12px;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(59, 119, 186, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-box-title {
  font-size: 16px;
  font-weight: 800;
}

.note-box-body {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
}

/* Page 9 Complete the Following Table */
.p9-complete-example {
  background: #fef9c3;
  border-left: 5px solid #eab308;
  padding: 10px 16px;
  font-size: 18.5px;
  font-weight: 700;
  color: #1e293b;
  border-radius: 4px;
  margin-bottom: 12px;
}

.p9-exercises-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p9-table-row {
  display: flex;
  align-items: center;
  background: var(--tb-yellow-strip);
  border-top: 1px solid var(--tb-yellow-strip-border);
  border-bottom: 1px solid var(--tb-yellow-strip-border);
  padding: 8px 18px;
  border-radius: 3px;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.p9-table-row:hover {
  background: #fef08a;
}

.row-label {
  width: 40px;
  flex-shrink: 0;
  font-weight: 800;
}

.row-equation {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.eq-left {
  font-size: 21px;
  font-weight: 800;
  min-width: 50px;
}

.eq-blank {
  min-width: 44px;
  height: 32px;
  border-bottom: 2px solid #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--font-ink);
  font-size: 26px;
  color: var(--tb-ink-blue);
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.eq-blank.answer-hidden {
  color: transparent !important;
  text-shadow: none !important;
}

/* ==========================================================================
   HANDWRITING INK STYLING & STEP-BY-STEP REVEAL ANIMATIONS
   ========================================================================== */
.answer-ink {
  font-family: var(--font-ink);
  font-size: 28px;
  font-weight: 700;
  color: var(--tb-ink-blue);
  letter-spacing: 0.5px;
  display: inline-block;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.answer-ink.answer-hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
}

.answer-ink.just-revealed {
  animation: inkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes inkPop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.85);
    color: #e11d48;
  }
  60% {
    transform: translateY(-2px) scale(1.08);
    color: #2563eb;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    color: var(--tb-ink-blue);
  }
}

.answer-writein-line.has-answer {
  background-color: rgba(239, 246, 255, 0.4);
}

/* ==========================================================================
   TEXTBOOK FOOTER & AUTHENTIC PAGE NUMBER CIRCLES
   ========================================================================== */
.textbook-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: var(--tb-header-purple);
  z-index: 5;
}

/* Folio Circle Badge (Reddish-orange) */
.page-folio-circle {
  position: absolute;
  bottom: 8px;
  width: 42px;
  height: 42px;
  background: var(--tb-page-number-red);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(222, 71, 44, 0.4);
}

.page-folio-circle::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

/* Page 7 & Page 9: Right Corner */
.textbook-page.page-right .page-folio-circle {
  right: 26px;
}

/* Page 8: Left Corner (Facing Page) */
.textbook-page.page-left .page-folio-circle {
  left: 26px;
}

/* ==========================================================================
   INTERACTIVE SMARTBOARD FLOATING DOCK (ENGLISH BUTTONS AS REQUESTED)
   ========================================================================== */
.smartboard-floating-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 40px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 200;
  touch-action: manipulation;
}

/* Primary English Action Buttons (Previous & Next) */
.dock-btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  touch-action: manipulation;
  height: 50px;
  padding: 0 22px;
}

.dock-btn:active {
  transform: scale(0.94);
}

/* Previous Button (Orange / Slate Warning) */
.btn-previous {
  background: #ea580c;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.btn-previous:hover {
  background: #c2410c;
}

.btn-previous:disabled {
  background: #475569;
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Next Button (Bright Vibrant Blue) */
.btn-next {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.btn-next:hover {
  background: #1d4ed8;
}

.btn-next:disabled {
  background: #475569;
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Answer Progress Counter Badge */
.answer-counter-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.counter-num {
  color: #38bdf8;
  font-weight: 900;
}

/* Secondary Dock Actions */
.dock-actions-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 8px;
}

.dock-icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s ease;
}

.dock-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.dock-icon-btn:active {
  transform: scale(0.92);
}

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

.drawing-canvas-overlay.pen-active {
  pointer-events: auto;
}

.pen-floating-toolbar {
  position: fixed;
  top: 65px;
  right: 20px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 160;
  display: none;
  flex-direction: column;
  gap: 8px;
}

.pen-floating-toolbar.active {
  display: flex;
}

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

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.color-swatch.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px #0f172a;
}

.pen-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.pen-tool-action {
  background: #f1f5f9;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pen-tool-action:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   INTERACTIVE EDUCATIONAL ACTIVITIES STYLES (Smartboard Labs)
   ========================================================================== */

/* Activity Panes Container */
.activity-pane {
  display: none;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
  padding: 30px 36px 60px 36px;
  min-height: 980px;
  flex-direction: column;
  animation: pageFade 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
}

.activity-pane.active {
  display: flex;
}

/* Activity Hero Header */
.activity-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 22px 28px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  border-left: 8px solid #3b82f6;
}

.activity-hero.hero-rounding {
  border-left-color: #10b981;
}

.activity-hero.hero-powers {
  border-left-color: #f59e0b;
}

.activity-hero.hero-quiz {
  border-left-color: #8b5cf6;
}

.hero-tag {
  background: rgba(255, 255, 255, 0.15);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #93c5fd;
}

.hero-title-box h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.hero-title-box p {
  color: #cbd5e1;
  font-size: 15.5px;
  font-weight: 600;
}

.hero-controls {
  display: flex;
  gap: 10px;
}

.hero-action-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.hero-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hero-action-btn:active {
  transform: scale(0.95);
}

/* Sub-card Containers */
.act-card-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.act-card-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.act-card-subtitle {
  font-size: 14.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 18px;
}

/* Preset Selectors */
.preset-pills-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.preset-pill {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-pill:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
}

.preset-pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   ACTIVITY 1: ASCENDING STAIRCASE LAB
   ========================================================================== */
.stairs-stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Available Number Chips Pool */
.number-chips-pool {
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 80px;
  flex-wrap: wrap;
}

.num-chip {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.num-chip:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45);
}

.num-chip.negative {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.num-chip.selected {
  outline: 3px solid #facc15;
  transform: scale(1.08);
}

.num-chip.placed {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.8);
}

/* Stepped Staircase Visual */
.stairs-visual-canvas {
  position: relative;
  height: 380px;
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #a7f3d0;
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  overflow: hidden;
}

.stair-step-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.stair-drop-slot {
  width: 85%;
  height: 60px;
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed #10b981;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-weight: 800;
  color: #047857;
  transition: all 0.2s ease;
  padding: 4px;
}

.stair-drop-slot.filled {
  border-style: solid;
  border-color: #059669;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.stair-block-body {
  width: 90%;
  background: linear-gradient(180deg, #10b981 0%, #047857 100%);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
  border-top: 4px solid #34d399;
}

.stair-step-1 .stair-block-body { height: 70px; }
.stair-step-2 .stair-block-body { height: 130px; }
.stair-step-3 .stair-block-body { height: 190px; }
.stair-step-4 .stair-block-body { height: 250px; }

/* Runner Character */
.stairs-runner-character {
  position: absolute;
  bottom: 80px;
  left: 20px;
  width: 50px;
  height: 50px;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

/* Feedback Banner */
.stairs-feedback-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 6px solid #94a3b8;
  font-weight: 700;
  font-size: 16px;
}

.stairs-feedback-box.correct {
  border-left-color: #10b981;
  background: #f0fdf4;
  color: #166534;
}

.stairs-feedback-box.incorrect {
  border-left-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

/* ==========================================================================
   ACTIVITY 2: ROUNDING ROLLERCOASTER & ESTIMATION LAB
   ========================================================================== */
.rollercoaster-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.roller-track-box {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: 18px;
  padding: 24px;
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.roller-top-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.station-badge {
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 10px 18px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.station-badge .station-tag {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
}

.station-badge .station-val {
  font-size: 26px;
  font-weight: 900;
  color: #1e3a8a;
}

.roller-hill-center {
  text-align: center;
}

.hill-peak-badge {
  background: #fef08a;
  border: 2px solid #eab308;
  color: #854d0e;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  display: inline-block;
}

/* Rollercoaster Hill SVG Track */
.roller-svg-wrapper {
  width: 100%;
  height: 200px;
  position: relative;
}

.roller-cart-elem {
  position: absolute;
  width: 64px;
  height: 52px;
  transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* Rounding Rule Legend */
.rounding-rule-pills {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 10px;
}

.rule-pill-down {
  background: #fee2e2;
  color: #991b1b;
  border: 1.5px solid #fca5a5;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 800;
}

.rule-pill-up {
  background: #dcfce7;
  color: #166534;
  border: 1.5px solid #86efac;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 800;
}

/* Sorting Game Container (Rounded vs Exact) */
.sorting-game-box {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 24px;
  margin-top: 10px;
}

.sorting-bins-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.sorting-bin-card {
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 140px;
  justify-content: center;
}

.sorting-bin-card:hover {
  transform: translateY(-4px);
}

.sorting-bin-card:active {
  transform: scale(0.96);
}

.bin-rounded-target {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px dashed #f59e0b;
  color: #92400e;
}

.bin-exact-target {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border: 3px dashed #0284c7;
  color: #075985;
}

.bin-title {
  font-size: 20px;
  font-weight: 900;
}

.bin-hint {
  font-size: 13.5px;
  font-weight: 700;
  opacity: 0.85;
}

.active-sorting-card {
  background: #ffffff;
  border: 2px solid #334155;
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

/* ==========================================================================
   ACTIVITY 3: POWERS & GEOMETRIC SQUARES LAB
   ========================================================================== */
.powers-lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.square-visualizer-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Visual Grid of NxN squares */
.geometric-grid-container {
  width: 320px;
  height: 320px;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
  margin-top: 16px;
  margin-bottom: 16px;
}

.grid-cell-tile {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 800;
}

.grid-cell-tile:hover {
  transform: scale(1.1);
  background: #f59e0b;
  z-index: 2;
}

/* Slider Controls */
.powers-slider-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.power-range-input {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  accent-color: #2563eb;
}

.powers-formula-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 16px 20px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 14px rgba(49, 46, 129, 0.35);
}

.formula-big-math {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #facc15;
}

.formula-words-tag {
  font-size: 15px;
  font-weight: 700;
  color: #c7d2fe;
  margin-top: 4px;
}

/* Speed Match Cards Board */
.match-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.match-game-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.match-game-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
}

.match-game-card.card-selected {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
  transform: scale(1.06);
}

.match-game-card.card-matched {
  border-color: #10b981;
  background: #dcfce7;
  color: #166534;
  pointer-events: none;
  opacity: 0.85;
}

/* ==========================================================================
   ACTIVITY 4: SMARTBOARD CLASSROOM QUIZ
   ========================================================================== */
.quiz-main-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.quiz-badge-category {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
}

.quiz-score-pill {
  background: #ecfdf5;
  color: #047857;
  font-size: 15px;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 20px;
}

.quiz-question-text {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.quiz-opt-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 16px 20px;
  text-align: left;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-opt-btn:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.quiz-opt-btn:active {
  transform: scale(0.98);
}

.quiz-opt-letter {
  background: #e2e8f0;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  flex-shrink: 0;
}

.quiz-opt-btn.correct {
  background: #dcfce7;
  border-color: #10b981;
  color: #166534;
}

.quiz-opt-btn.correct .quiz-opt-letter {
  background: #10b981;
  color: #ffffff;
}

.quiz-opt-btn.wrong {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.quiz-opt-btn.wrong .quiz-opt-letter {
  background: #ef4444;
  color: #ffffff;
}

.quiz-feedback-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  display: none;
}

.quiz-feedback-box.active {
  display: block;
}

/* ==========================================================================
   RESPONSIVE & SMARTBOARD MEDIA QUERIES
   ========================================================================== */
@media (max-width: 820px) {
  .p8-examples-grid {
    grid-template-columns: 1fr;
  }
  .p8-tri-grid {
    grid-template-columns: 1fr;
  }
  .p9-diagram-row {
    flex-direction: column;
  }
  .p9-note-blue-box {
    max-width: 100%;
  }
  .smartboard-floating-dock {
    width: 95%;
    padding: 6px 10px;
    gap: 6px;
    border-radius: 24px;
  }
  .dock-btn {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }
  .powers-lab-grid {
    grid-template-columns: 1fr;
  }
  .sorting-bins-row {
    grid-template-columns: 1fr;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
}

