/* =============================================================================
   ILS Geometry CSS — Shared styles for geometry ILS activities (Chapter 4+)
   Companion to ils-geo.js | v1.0
   Covers: JSXGraph board wrapper, angle chips, measurement box, discovery
           panel, shape badges, geometric notation, drag hint, property cards,
           legend strip, geometry tool strip, dark mode, responsive
   Prefix: geo-  (activity-unique styles use mb- / local prefixes per activity)
   ============================================================================= */

/* =============================================================================
   1. JSXGraph BOARD WRAPPER
   ============================================================================= */

.geo-board-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 16px;
  border: 2.5px solid #c7d2fe;
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.10);
  /* Prevent JSXGraph from expanding the page on touch */
  touch-action: none;
}
.dark .geo-board-wrap {
  border-color: #4338ca;
  background: #0f172a;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.20);
}

/* The actual JSXGraph canvas div — height is set inline by ILS.Geo.renderBoardWrap */
.geo-board-wrap .geo-jxg-board {
  width: 100%;
  display: block;
}

/* Thin accent bar at the top of the board (colour varies per activity level) */
.geo-board-wrap::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
}

/* Caption / label shown above or below a board */
.geo-board-label {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  padding: 6px 10px 2px;
  letter-spacing: 0.2px;
}
.dark .geo-board-label {
  color: #a5b4fc;
}

/* Sub-caption in lighter weight */
.geo-board-sublabel {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  padding: 0 10px 8px;
}
.dark .geo-board-sublabel {
  color: #64748b;
}

/* =============================================================================
   2. ANGLE TYPE CHIPS
   Pill badges that appear beneath the board or inside feedback showing what
   type of angle is currently displayed.
   ============================================================================= */

.geo-angle-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid transparent;
  letter-spacing: 0.2px;
  transition: all 0.25s ease;
  animation: geoChipPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes geoChipPop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* Acute — 0° < θ < 90° */
.geo-chip-acute {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.dark .geo-chip-acute {
  background: #052e16;
  color: #4ade80;
  border-color: #166534;
}

/* Right — θ = 90° */
.geo-chip-right {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}
.dark .geo-chip-right {
  background: #1e3a5f;
  color: #60a5fa;
  border-color: #1d4ed8;
}

/* Obtuse — 90° < θ < 180° */
.geo-chip-obtuse {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
}
.dark .geo-chip-obtuse {
  background: #431407;
  color: #fb923c;
  border-color: #9a3412;
}

/* Straight — θ = 180° */
.geo-chip-straight {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.dark .geo-chip-straight {
  background: #450a0a;
  color: #f87171;
  border-color: #7f1d1d;
}

/* Reflex — 180° < θ < 360° */
.geo-chip-reflex {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #d8b4fe;
}
.dark .geo-chip-reflex {
  background: #3b0764;
  color: #c084fc;
  border-color: #6b21a8;
}

/* Zero angle — θ = 0° */
.geo-chip-zero {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.dark .geo-chip-zero {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

/* Optional dot before chip label — coloured bullet */
.geo-angle-chip::before {
  content: "●";
  font-size: 9px;
  opacity: 0.75;
}

/* =============================================================================
   3. MEASUREMENT READOUT BOX
   Live display of angle degrees or length while dragging on the board.
   ============================================================================= */

.geo-measure-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #eef2ff, #f0fdf4);
  border: 2px solid #c7d2fe;
  border-radius: 14px;
  margin: 10px auto;
  max-width: 320px;
  animation: geoMeasurePulse 0.3s ease;
}
@keyframes geoMeasurePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.dark .geo-measure-box {
  background: linear-gradient(135deg, #1e1b4b, #052e16);
  border-color: #4338ca;
}

.geo-measure-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}
.dark .geo-measure-label {
  color: #94a3b8;
}

.geo-measure-value {
  font-size: 28px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  color: #4f46e5;
  min-width: 72px;
  text-align: center;
  transition: color 0.2s ease;
}
.dark .geo-measure-value {
  color: #a5b4fc;
}

.geo-measure-unit {
  font-size: 14px;
  font-weight: 700;
  color: #6366f1;
}
.dark .geo-measure-unit {
  color: #818cf8;
}

/* Colour shifts when angle chip changes type */
.geo-measure-box.geo-mbox-acute  { border-color: #86efac; }
.geo-measure-box.geo-mbox-right  { border-color: #93c5fd; }
.geo-measure-box.geo-mbox-obtuse { border-color: #fdba74; }
.geo-measure-box.geo-mbox-straight { border-color: #fca5a5; }
.geo-measure-box.geo-mbox-reflex { border-color: #d8b4fe; }

.geo-measure-box.geo-mbox-acute  .geo-measure-value { color: #15803d; }
.geo-measure-box.geo-mbox-right  .geo-measure-value { color: #1d4ed8; }
.geo-measure-box.geo-mbox-obtuse .geo-measure-value { color: #c2410c; }
.geo-measure-box.geo-mbox-straight .geo-measure-value { color: #b91c1c; }
.geo-measure-box.geo-mbox-reflex .geo-measure-value { color: #7e22ce; }

/* =============================================================================
   4. DISCOVERY PANEL
   Animated reveal panel that appears when a student first encounters a new
   geometric concept (e.g. first time they drag into reflex territory).
   ============================================================================= */

.geo-discovery {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 2.5px solid #fcd34d;
  border-radius: 16px;
  padding: 18px 20px;
  margin: 14px 0;
  animation: geoDiscoveryIn 0.5s cubic-bezier(0.21, 1.02, 0.73, 1);
  position: relative;
  overflow: hidden;
}
.geo-discovery::after {
  content: "✦";
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 22px;
  opacity: 0.25;
  animation: geoDiscoveryStar 3s ease-in-out infinite;
}
@keyframes geoDiscoveryStar {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50%       { transform: rotate(180deg) scale(1.3); }
}
@keyframes geoDiscoveryIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dark .geo-discovery {
  background: linear-gradient(135deg, #451a03, #1c1200);
  border-color: #78350f;
}

.geo-discovery-icon {
  font-size: 32px;
  margin-bottom: 6px;
  display: block;
  animation: geoIconSpin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes geoIconSpin {
  from { transform: rotate(-20deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(0deg) scale(1);    opacity: 1; }
}

.geo-discovery-title {
  font-size: 17px;
  font-weight: 900;
  color: #92400e;
  margin-bottom: 6px;
}
.dark .geo-discovery-title {
  color: #fcd34d;
}

.geo-discovery-body {
  font-size: 14px;
  line-height: 1.7;
  color: #78350f;
}
.dark .geo-discovery-body {
  color: #fde68a;
}

.geo-discovery-body strong {
  color: #b45309;
  font-weight: 800;
}
.dark .geo-discovery-body strong {
  color: #fbbf24;
}

/* Compact variant for inline use (no top/bottom margin) */
.geo-discovery.geo-discovery-compact {
  padding: 12px 16px;
  margin: 8px 0;
}
.geo-discovery.geo-discovery-compact .geo-discovery-icon {
  font-size: 22px;
  display: inline;
  margin-right: 6px;
  margin-bottom: 0;
}

/* =============================================================================
   5. SHAPE CLASSIFICATION BADGES
   Pill labels for triangle/quadrilateral classification shown beneath boards
   or inside quiz answer cards.
   ============================================================================= */

.geo-shape-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid transparent;
  letter-spacing: 0.2px;
  animation: geoChipPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Triangle — by sides */
.geo-badge-equilateral  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.geo-badge-isosceles    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.geo-badge-scalene      { background: #f3e8ff; color: #7e22ce; border-color: #d8b4fe; }

/* Triangle — by angles */
.geo-badge-acute-tri    { background: #dcfce7; color: #15803d; border-color: #86efac; }
.geo-badge-right-tri    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.geo-badge-obtuse-tri   { background: #ffedd5; color: #c2410c; border-color: #fdba74; }

/* Quadrilaterals */
.geo-badge-square       { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.geo-badge-rectangle    { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.geo-badge-rhombus      { background: #fdf2f8; color: #9d174d; border-color: #f9a8d4; }
.geo-badge-parallelogram{ background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.geo-badge-trapezium    { background: #fef3c7; color: #b45309; border-color: #fde68a; }

/* Circle parts */
.geo-badge-radius       { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.geo-badge-diameter     { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.geo-badge-chord        { background: #f3e8ff; color: #7e22ce; border-color: #d8b4fe; }
.geo-badge-arc          { background: #ffedd5; color: #c2410c; border-color: #fdba74; }
.geo-badge-sector       { background: #dcfce7; color: #15803d; border-color: #86efac; }

/* Dark mode overrides — keep hues, darken backgrounds */
.dark .geo-badge-equilateral,
.dark .geo-badge-acute-tri,
.dark .geo-badge-rectangle   { background: #052e16; color: #4ade80; border-color: #166534; }

.dark .geo-badge-isosceles,
.dark .geo-badge-right-tri,
.dark .geo-badge-radius       { background: #1e3a5f; color: #60a5fa; border-color: #1d4ed8; }

.dark .geo-badge-scalene,
.dark .geo-badge-rhombus,
.dark .geo-badge-chord         { background: #3b0764; color: #c084fc; border-color: #6b21a8; }

.dark .geo-badge-obtuse-tri,
.dark .geo-badge-arc           { background: #431407; color: #fb923c; border-color: #9a3412; }

.dark .geo-badge-straight,
.dark .geo-badge-diameter      { background: #450a0a; color: #f87171; border-color: #7f1d1d; }

.dark .geo-badge-square        { background: #1e1b4b; color: #a5b4fc; border-color: #4338ca; }

.dark .geo-badge-parallelogram,
.dark .geo-badge-trapezium,
.dark .geo-badge-sector        { background: #451a03; color: #fbbf24; border-color: #92400e; }

/* =============================================================================
   6. GEOMETRIC NOTATION DISPLAY
   Styled inline spans for segment / ray / line / angle notation rendered by
   KaTeX (or as plain text fallback).
   ============================================================================= */

/* Container for a KaTeX-rendered geometric expression */
.geo-notation {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  border: 1.5px solid #c7d2fe;
  border-radius: 8px;
  padding: 2px 10px;
  margin: 0 3px;
  vertical-align: middle;
  font-family: "KaTeX_Math", "STIX Two Math", "Times New Roman", serif;
}
.dark .geo-notation {
  background: #1e1b4b;
  border-color: #4338ca;
  color: #a5b4fc;
}

/* Block-level notation (e.g. a formula line like d = 2r) */
.geo-notation-block {
  display: block;
  text-align: center;
  margin: 10px auto;
  padding: 10px 18px;
  font-size: 20px;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  border: 2px solid #c7d2fe;
  border-radius: 12px;
  max-width: 320px;
  font-family: "KaTeX_Math", "STIX Two Math", "Times New Roman", serif;
}
.dark .geo-notation-block {
  background: #1e1b4b;
  border-color: #4338ca;
  color: #a5b4fc;
}

/* Highlighted variable inside a formula (e.g. "r" in d = 2r) */
.geo-notation em,
.geo-notation-block em {
  color: #6366f1;
  font-style: italic;
  font-weight: 900;
}

/* =============================================================================
   7. DRAG HINT
   Animated cue prompting students to interact with the JSXGraph board.
   ============================================================================= */

.geo-drag-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #6366f1;
  padding: 6px 0 10px;
  animation: geoDragPulse 2s ease-in-out infinite;
}
.dark .geo-drag-hint {
  color: #a5b4fc;
}
@keyframes geoDragPulse {
  0%, 100% { opacity: 1;   transform: translateX(0); }
  40%       { opacity: 0.6; transform: translateX(4px); }
  60%       { opacity: 0.6; transform: translateX(-2px); }
}

.geo-drag-hint::before {
  content: "☛";
  font-size: 18px;
  animation: geoDragBounce 1.5s ease-in-out infinite;
}
@keyframes geoDragBounce {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(6px); }
}

/* =============================================================================
   8. PROPERTY CARDS
   Cards used in Level 2 matching games — show a shape's name and key
   properties.
   ============================================================================= */

.geo-property-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.geo-property-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: #c7d2fe;
  border-radius: 2px 0 0 2px;
  transition: background 0.2s ease;
}
.geo-property-card:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}
.geo-property-card:hover::before {
  background: #6366f1;
}
.dark .geo-property-card {
  background: #1e293b;
  border-color: #334155;
}
.dark .geo-property-card:hover {
  border-color: #6366f1;
}

.geo-property-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dark .geo-property-card-title {
  color: #e2e8f0;
}

.geo-property-card-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.geo-property-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.geo-property-card-list li {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.geo-property-card-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #6366f1;
  font-size: 11px;
  top: 2px;
}
.dark .geo-property-card-list li {
  color: #94a3b8;
}

/* Selected / matched state */
.geo-property-card.geo-card-selected {
  border-color: #6366f1;
  background: #eef2ff;
}
.dark .geo-property-card.geo-card-selected {
  background: #1e1b4b;
  border-color: #6366f1;
}

.geo-property-card.geo-card-matched {
  border-color: #22c55e;
  background: #f0fdf4;
  cursor: default;
}
.geo-property-card.geo-card-matched::before {
  background: #22c55e;
}
.dark .geo-property-card.geo-card-matched {
  background: #052e16;
  border-color: #22c55e;
}

.geo-property-card.geo-card-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  animation: geoCardShake 0.35s ease;
}
.dark .geo-property-card.geo-card-wrong {
  background: #450a0a;
  border-color: #ef4444;
}
@keyframes geoCardShake {
  0%  { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
  100%{ transform: translateX(0); }
}

/* =============================================================================
   9. LEGEND STRIP
   Horizontal row of colour-dot + label pairs used to explain board colours.
   ============================================================================= */

.geo-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  margin: 8px 0 12px;
}
.dark .geo-legend {
  background: #1e293b;
  border-color: #334155;
}

.geo-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}
.dark .geo-legend-item {
  color: #94a3b8;
}

.geo-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
}

/* =============================================================================
   10. GEOMETRY TOOL STRIP
   Optional horizontal toolbar above/below the board (draw, erase, label, etc.)
   ============================================================================= */

.geo-tool-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.geo-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.geo-tool-btn:hover {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.geo-tool-btn:active {
  transform: scale(0.96);
}
.geo-tool-btn.geo-tool-active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}
.dark .geo-tool-btn {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
.dark .geo-tool-btn:hover {
  background: #1e1b4b;
  color: #a5b4fc;
  border-color: #4338ca;
}
.dark .geo-tool-btn.geo-tool-active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: #6366f1;
}

/* =============================================================================
   11. CIRCLE PARTS DIAGRAM LABELS
   Overlay labels positioned around a circle figure for labelling activities.
   ============================================================================= */

.geo-circle-labels-wrap {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

.geo-circle-label-tag {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  border: 2px solid #e2e8f0;
  color: #1e293b;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}
.geo-circle-label-tag.geo-tag-active {
  border-color: #6366f1;
  color: #4338ca;
  background: #eef2ff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.20);
}
.dark .geo-circle-label-tag {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .geo-circle-label-tag.geo-tag-active {
  background: #1e1b4b;
  border-color: #6366f1;
  color: #a5b4fc;
}

/* =============================================================================
   12. FIGURE TYPE ICONS
   Small inline SVG-based icons showing the "shape" of a geometric figure
   (used in line/ray/segment identification drills).
   ============================================================================= */

.geo-figure-icon {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 8px auto;
}

/* Container for a geometric figure + label below it */
.geo-figure-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px 10px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.geo-figure-card:hover {
  border-color: #6366f1;
  background: #eef2ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.geo-figure-card.geo-fig-selected {
  border-color: #6366f1;
  background: #eef2ff;
}
.geo-figure-card.geo-fig-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}
.geo-figure-card.geo-fig-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  animation: geoCardShake 0.35s ease;
}
.dark .geo-figure-card {
  background: #1e293b;
  border-color: #334155;
}
.dark .geo-figure-card:hover,
.dark .geo-figure-card.geo-fig-selected {
  background: #1e1b4b;
  border-color: #6366f1;
}
.dark .geo-figure-card.geo-fig-correct {
  background: #052e16;
  border-color: #22c55e;
}
.dark .geo-figure-card.geo-fig-wrong {
  background: #450a0a;
  border-color: #ef4444;
}

.geo-figure-name {
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  text-align: center;
}
.dark .geo-figure-name {
  color: #cbd5e1;
}

/* =============================================================================
   13. GEOMETRY CHARACTER COMIC PANEL THEMES
   Extends the existing comic panel system with geometry-specific themes.
   Classes applied to .comic-panel alongside .cp-geo-N variants.
   ============================================================================= */

.comic-panel.cp-geo {
  background: linear-gradient(180deg, #eef2ff 0%, #fff 40%);
}
.dark .comic-panel.cp-geo {
  background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 40%);
}

.comic-panel.cp-student {
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 40%);
}
.dark .comic-panel.cp-student {
  background: linear-gradient(180deg, #052e16 0%, #0f172a 40%);
}

.comic-panel.cp-teacher {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 40%);
}
.dark .comic-panel.cp-teacher {
  background: linear-gradient(180deg, #451a03 0%, #0f172a 40%);
}

/* Context badge variants for geometry */
.comic-context-badge.ccb-geo {
  background: #eef2ff;
  color: #4338ca;
}
.dark .comic-context-badge.ccb-geo {
  background: #1e1b4b;
  color: #a5b4fc;
}

.comic-context-badge.ccb-student {
  background: #dcfce7;
  color: #166534;
}
.dark .comic-context-badge.ccb-student {
  background: #052e16;
  color: #4ade80;
}

.comic-context-badge.ccb-teacher {
  background: #fef3c7;
  color: #92400e;
}
.dark .comic-context-badge.ccb-teacher {
  background: #451a03;
  color: #fcd34d;
}

/* =============================================================================
   14. SCORE STREAK CHIP (geometry flavour)
   A small chip showing current answer streak — reused across all 3 activities.
   ============================================================================= */

.geo-streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
  border: 2px solid #fcd34d;
  transition: all 0.25s ease;
}
.geo-streak-chip.geo-streak-hot {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-color: #dc2626;
  animation: geoStreakFlame 1s ease-in-out infinite alternate;
}
@keyframes geoStreakFlame {
  from { box-shadow: 0 0 6px rgba(239,68,68,0.4); }
  to   { box-shadow: 0 0 14px rgba(239,68,68,0.7); }
}
.dark .geo-streak-chip {
  background: #451a03;
  color: #fcd34d;
  border-color: #78350f;
}

/* =============================================================================
   15. QUIZ QUESTION PROMPT (geometry flavour)
   Replaces / extends .lnp-prompt for geometry activities.
   ============================================================================= */

.geo-question-prompt {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-left: 5px solid #6366f1;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  line-height: 1.65;
}
.geo-question-prompt em {
  color: #6366f1;
  font-style: normal;
  font-weight: 900;
  background: #eef2ff;
  padding: 1px 6px;
  border-radius: 4px;
}
.dark .geo-question-prompt {
  background: #1e293b;
  border-color: #334155;
  border-left-color: #6366f1;
  color: #e2e8f0;
}
.dark .geo-question-prompt em {
  background: #1e1b4b;
  color: #a5b4fc;
}

/* =============================================================================
   16. MINI GEOMETRY FIGURE GRID
   A 2×2 or 3×2 grid of small figure cards for classification drills.
   ============================================================================= */

.geo-figure-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.geo-figure-grid.geo-grid-2col {
  grid-template-columns: repeat(2, 1fr);
}

/* =============================================================================
   17. STEP GUIDE
   A numbered step list used to walk students through a construction sequence.
   ============================================================================= */

.geo-step-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.geo-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.2s ease;
}
.geo-step-item.geo-step-active {
  background: #eef2ff;
  border-color: #6366f1;
}
.geo-step-item.geo-step-done {
  background: #f0fdf4;
  border-color: #86efac;
}
.dark .geo-step-item {
  background: #1e293b;
  border-color: #334155;
}
.dark .geo-step-item.geo-step-active {
  background: #1e1b4b;
  border-color: #6366f1;
}
.dark .geo-step-item.geo-step-done {
  background: #052e16;
  border-color: #166534;
}
.geo-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.geo-step-active .geo-step-num {
  background: #6366f1;
  color: #fff;
}
.geo-step-done .geo-step-num {
  background: #22c55e;
  color: #fff;
}
.geo-step-done .geo-step-num::before {
  content: "✓";
}
.geo-step-text {
  font-size: 14px;
  color: #475569;
  line-height: 1.55;
}
.geo-step-active .geo-step-text {
  color: #1e293b;
  font-weight: 600;
}
.dark .geo-step-text {
  color: #94a3b8;
}
.dark .geo-step-active .geo-step-text {
  color: #e2e8f0;
}

/* =============================================================================
   18. ANIMATIONS — shared keyframes reused across the geometry system
   ============================================================================= */

@keyframes geoFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes geoSlideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes geoSlideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes geoScaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes geoBounceIn {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { transform: scale(1.08); }
  80%  { transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

/* Apply animation helpers as utility classes */
.geo-anim-fade-in    { animation: geoFadeIn 0.4s ease both; }
.geo-anim-slide-left { animation: geoSlideInLeft 0.35s ease both; }
.geo-anim-slide-right{ animation: geoSlideInRight 0.35s ease both; }
.geo-anim-scale-in   { animation: geoScaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both; }
.geo-anim-bounce-in  { animation: geoBounceIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }

/* Staggered children entrance (add .geo-stagger to parent) */
.geo-stagger > *:nth-child(1) { animation-delay: 0.00s; }
.geo-stagger > *:nth-child(2) { animation-delay: 0.07s; }
.geo-stagger > *:nth-child(3) { animation-delay: 0.14s; }
.geo-stagger > *:nth-child(4) { animation-delay: 0.21s; }
.geo-stagger > *:nth-child(5) { animation-delay: 0.28s; }
.geo-stagger > *:nth-child(6) { animation-delay: 0.35s; }

/* =============================================================================
   19. RESPONSIVE — 480px breakpoint
   ============================================================================= */

@media (max-width: 480px) {
  .geo-board-wrap {
    border-radius: 12px;
  }
  .geo-measure-value {
    font-size: 22px;
    min-width: 56px;
  }
  .geo-measure-box {
    padding: 8px 12px;
    gap: 7px;
  }
  .geo-discovery {
    padding: 14px 14px;
  }
  .geo-discovery-title {
    font-size: 15px;
  }
  .geo-discovery-body {
    font-size: 13px;
  }
  .geo-angle-chip {
    font-size: 12px;
    padding: 3px 10px 3px 8px;
  }
  .geo-property-card {
    padding: 10px 12px;
  }
  .geo-property-card-title {
    font-size: 14px;
  }
  .geo-property-card-list li {
    font-size: 12px;
  }
  .geo-question-prompt {
    font-size: 14px;
    padding: 10px 12px;
  }
  .geo-tool-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
  .geo-notation-block {
    font-size: 16px;
    padding: 8px 12px;
  }
  .geo-figure-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .geo-figure-grid.geo-grid-2col {
    grid-template-columns: repeat(2, 1fr);
  }
  .geo-legend {
    gap: 6px 10px;
    padding: 6px 8px;
  }
  .geo-legend-item {
    font-size: 11px;
  }
  .geo-step-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .geo-step-text {
    font-size: 13px;
  }
  .geo-step-num {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  .geo-notation {
    font-size: 14px;
    padding: 2px 7px;
  }
}

/* =============================================================================
   20. RESPONSIVE — 360px (very small screens)
   ============================================================================= */

@media (max-width: 360px) {
  .geo-measure-value {
    font-size: 19px;
  }
  .geo-figure-grid,
  .geo-figure-grid.geo-grid-2col {
    grid-template-columns: repeat(2, 1fr);
  }
  .geo-tool-strip {
    gap: 4px;
  }
  .geo-tool-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
}
