/* ═══════════════════════════════════════════════════════════
   CT for Educators — Stylesheet
   Color: Google quartet (CT framework standard) + Malaysian accents
   ═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Google CT quartet */
  --g-blue: #4285F4;
  --g-blue-d: #1a5fc4;
  --g-red: #EA4335;
  --g-red-d: #c0271a;
  --g-yellow: #FBBC04;
  --g-yellow-d: #b8860b;
  --g-green: #34A853;
  --g-green-d: #1e7e34;

  /* Light theme */
  --bg: #fafaf7;
  --bg-2: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f5f3ec;
  --surface-3: #e9e6dc;
  --border: #d8d4c5;
  --border-strong: #b8b3a0;
  --text: #1a1f2e;
  --text-dim: #4a5066;
  --text-muted: #7a8092;
  --shadow-sm: 0 1px 3px rgba(20,30,50,.06), 0 1px 2px rgba(20,30,50,.04);
  --shadow-md: 0 8px 24px rgba(20,30,50,.08), 0 2px 8px rgba(20,30,50,.05);
  --shadow-lg: 0 24px 60px rgba(20,30,50,.12), 0 8px 24px rgba(20,30,50,.08);

  --font-sans: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  --font-display: 'Roboto', 'Plus Jakarta Sans', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  --slide-pad: 38px 48px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
}

[data-theme="dark"] {
  --bg: #0e1119;
  --bg-2: #161a26;
  --surface: #1a1f2e;
  --surface-2: #232a3d;
  --surface-3: #2e3650;
  --border: #2e3650;
  --border-strong: #4a5066;
  --text: #f0f2f8;
  --text-dim: #b8bdcc;
  --text-muted: #8088a0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
}

[data-density="cozy"] { --slide-pad: 28px 36px; }
[data-density="spacious"] { --slide-pad: 50px 64px; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ═══ INTRO SCREEN ═══ */
.intro {
  position: fixed; inset: 0; z-index: 1000;
  background: linear-gradient(135deg, #4285F4 0%, #34A853 50%, #FBBC04 100%);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
  transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.intro.gone { opacity: 0; transform: scale(1.1); pointer-events: none; }

.intro-shapes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.intro-shapes div {
  position: absolute; border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}
.intro-shapes div:nth-child(1) { top: 10%; left: 15%; width: 80px; height: 80px; background: rgba(255,255,255,.18); animation-delay: 0s; }
.intro-shapes div:nth-child(2) { top: 70%; left: 80%; width: 120px; height: 120px; background: rgba(234,67,53,.5); animation-delay: 1s; }
.intro-shapes div:nth-child(3) { top: 20%; right: 10%; width: 60px; height: 60px; background: rgba(255,255,255,.22); border-radius: 12px; animation-delay: 2s; }
.intro-shapes div:nth-child(4) { bottom: 15%; left: 20%; width: 100px; height: 100px; background: rgba(251,188,4,.55); border-radius: 12px; animation-delay: 1.5s; }
.intro-shapes div:nth-child(5) { top: 50%; left: 50%; width: 200px; height: 200px; background: rgba(255,255,255,.08); animation-delay: .5s; }

@keyframes float {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  33% { transform: translate(30px,-20px) rotate(120deg); }
  66% { transform: translate(-20px,20px) rotate(240deg); }
}

.intro-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.96); backdrop-filter: blur(20px);
  border-radius: 28px; padding: 36px 56px 44px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
  animation: bounceIn 1.1s cubic-bezier(.34,1.56,.64,1);
  max-width: 540px;
}
.intro-logo {
  display: block; height: 38px; width: auto;
  margin: 0 auto 18px;
  animation: logoFade .8s ease-out .3s backwards;
}
@keyframes logoFade {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
  0% { transform: scale(0.3) translateY(60px); opacity: 0; }
  50% { transform: scale(1.05); opacity: 1; }
  70% { transform: scale(0.95); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.intro-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--g-blue-d); margin-bottom: 14px;
}
.intro-card h1 {
  font-family: var(--font-display); font-size: 42px; line-height: 1.05;
  font-weight: 600; color: var(--text); margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.intro-card h1 em { font-style: italic; color: var(--g-red); }
.intro-card p {
  font-size: 15px; color: var(--text-dim); margin-bottom: 24px;
  line-height: 1.6; max-width: 420px; margin-left: auto; margin-right: auto;
}
.intro-meta {
  display: flex; justify-content: center; gap: 24px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted); margin-bottom: 20px;
  font-family: var(--mono); letter-spacing: .5px;
}
.intro-meta span { display: flex; align-items: center; gap: 6px; }
.intro-meta i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--g-green);
}

.intro-cta {
  background: var(--text); color: var(--surface);
  border: none; padding: 14px 32px; border-radius: 100px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .25s;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  display: inline-flex; align-items: center; gap: 10px;
}
.intro-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.intro-cta:active { transform: translateY(0); }

.intro-logos {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; z-index: 1;
}
.intro-logos img { height: 36px; opacity: .9; }
.intro-logos span { color: rgba(255,255,255,.85); font-family: var(--mono); font-size: 11px; letter-spacing: 2px; font-weight: 600; }

/* ═══ APP SHELL ═══ */
.app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: 12px;
}
.brand-logo {
  height: 24px; width: auto; display: block;
}
.brand-divider {
  width: 1px; height: 22px; background: var(--border);
}
.brand-mark {
  display: flex; align-items: center; gap: 6px;
}
.brand-mark span {
  width: 11px; height: 11px; border-radius: 50%;
}
.brand-mark span:nth-child(1) { background: var(--g-blue); }
.brand-mark span:nth-child(2) { background: var(--g-red); }
.brand-mark span:nth-child(3) { background: var(--g-yellow); }
.brand-mark span:nth-child(4) { background: var(--g-green); }
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.5px;
  color: var(--text-muted); text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 100px;
}

.topic-name {
  flex: 1; display: flex; align-items: center; gap: 12px;
  margin-left: 18px; padding-left: 18px;
  border-left: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim); font-weight: 600;
  overflow: hidden;
}
.topic-name strong { color: var(--g-red); margin-right: 4px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.score-pill {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, #FBBC04, #EA4335); color: white;
  padding: 6px 12px; border-radius: 100px;
  box-shadow: 0 2px 6px rgba(234,67,53,.3);
  transition: transform .25s;
}
.score-pill.bumped { animation: scoreBump .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes scoreBump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.hamburger {
  width: 36px; height: 36px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 0;
  transition: all .2s;
}
.hamburger:hover { background: var(--surface-3); border-color: var(--border-strong); }
.hamburger span {
  display: block; width: 16px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  transform-origin: center;
}
.hamburger.open { background: var(--text); border-color: var(--text); }
.hamburger.open span { background: var(--surface); }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

[data-theme="dark"] .brand-logo {
  background: #fff; padding: 4px 8px; border-radius: 6px;
  box-sizing: content-box;
}

/* ═══ STAGE ═══ */
.main {
  flex: 1; position: relative; overflow: hidden;
  background: var(--bg);
}
.stage {
  position: absolute; inset: 0;
}
.slide {
  position: absolute; inset: 0;
  padding: var(--slide-pad);
  overflow-y: auto;
  opacity: 0; transform: translateY(30px) scale(.98);
  pointer-events: none;
  transition: opacity .55s cubic-bezier(.2,.8,.2,1), transform .55s cubic-bezier(.2,.8,.2,1);
}
.slide.active {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.slide.exit {
  opacity: 0; transform: translateY(-30px) scale(.98); pointer-events: none;
}

.slide-inner {
  max-width: 980px; margin: 0 auto;
}

/* Reveal animation for elements within active slide */
.slide.active .reveal {
  animation: revealUp .6s cubic-bezier(.2,.8,.2,1) backwards;
}
.slide.active .reveal:nth-child(1) { animation-delay: 0s; }
.slide.active .reveal:nth-child(2) { animation-delay: .08s; }
.slide.active .reveal:nth-child(3) { animation-delay: .16s; }
.slide.active .reveal:nth-child(4) { animation-delay: .24s; }
.slide.active .reveal:nth-child(5) { animation-delay: .32s; }
.slide.active .reveal:nth-child(6) { animation-delay: .40s; }
.slide.active .reveal:nth-child(n+7) { animation-delay: .48s; }
@keyframes revealUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ TYPOGRAPHY & PRIMITIVES ═══ */
h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: 56px; line-height: 1.0; letter-spacing: -0.03em;
  margin-bottom: 14px;
}
h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 32px; line-height: 1.1; letter-spacing: -0.02em;
  margin-bottom: 16px;
}
h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; line-height: 1.2; margin-bottom: 10px;
}
h4 {
  font-size: 15px; font-weight: 700;
  margin-bottom: 6px; letter-spacing: -0.01em;
}
p { font-size: 14px; line-height: 1.65; color: var(--text-dim); text-wrap: pretty; }
p strong, h4 strong { color: var(--text); }
a { color: var(--g-blue-d); text-decoration: none; }

code.kbd {
  font-family: var(--mono); font-size: 12px;
  background: var(--surface-2); padding: 2px 7px;
  border-radius: 5px; border: 1px solid var(--border); color: var(--g-red-d);
}

.tag {
  display: inline-block; font-family: var(--mono);
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 100px;
}
.tag.blue { background: rgba(66,133,244,.12); color: var(--g-blue-d); }
.tag.red { background: rgba(234,67,53,.12); color: var(--g-red-d); }
.tag.yellow { background: rgba(251,188,4,.18); color: var(--g-yellow-d); }
.tag.green { background: rgba(52,168,83,.12); color: var(--g-green-d); }

.act-label {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--g-red);
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.act-label::before {
  content: ''; width: 18px; height: 2px; background: var(--g-red);
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 12px;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { box-shadow: var(--shadow-sm); }

.card-accent {
  border-left: 4px solid var(--border-strong);
}
.card-accent.blue { border-left-color: var(--g-blue); }
.card-accent.red { border-left-color: var(--g-red); }
.card-accent.yellow { border-left-color: var(--g-yellow); }
.card-accent.green { border-left-color: var(--g-green); }

.box {
  padding: 12px 16px; border-radius: 10px; margin: 12px 0;
  font-size: 13.5px; line-height: 1.55;
}
.box strong:first-child {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 4px;
}
.box.tip { background: rgba(66,133,244,.08); border: 1px solid rgba(66,133,244,.2); color: var(--text); }
.box.tip strong:first-child { color: var(--g-blue-d); }
.box.note { background: rgba(52,168,83,.08); border: 1px solid rgba(52,168,83,.2); color: var(--text); }
.box.note strong:first-child { color: var(--g-green-d); }
.box.warn { background: rgba(251,188,4,.12); border: 1px solid rgba(251,188,4,.3); color: var(--text); }
.box.warn strong:first-child { color: var(--g-yellow-d); }

.tc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tc-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ═══ TITLE SLIDE ═══ */
.title-slide {
  min-height: 100%; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start; text-align: left;
  padding: 20px 0;
}
.title-slide .title-art { margin-bottom: 22px; }
.title-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--g-red);
  margin-bottom: 12px;
}
.title-slide h1 { max-width: 760px; }
.title-slide p {
  font-size: 17px; max-width: 620px; color: var(--text-dim);
  line-height: 1.5;
}

/* ═══ CT ICONS ═══ */
.ct-icon { width: 48px; height: 48px; }
.ct-icon-lg { width: 110px; height: 110px; }

/* ═══ OBJECTIVES ═══ */
.obj-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 16px;
}
.obj {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; line-height: 1.5;
  transition: transform .2s;
}
.obj:hover { transform: translateX(4px); }
.obj-num {
  flex: 0 0 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  color: white;
}
.obj.blue .obj-num { background: var(--g-blue); }
.obj.red .obj-num { background: var(--g-red); }
.obj.yellow .obj-num { background: var(--g-yellow); color: #222; }
.obj.green .obj-num { background: var(--g-green); }

/* ═══ CONCEPT TILES (flippable) ═══ */
.concept-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 14px 0;
}
.concept-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; transition: all .3s cubic-bezier(.2,.8,.2,1);
  position: relative; overflow: hidden;
}
.concept-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.concept-tile.blue { border-top: 4px solid var(--g-blue); }
.concept-tile.red { border-top: 4px solid var(--g-red); }
.concept-tile.yellow { border-top: 4px solid var(--g-yellow); }
.concept-tile.green { border-top: 4px solid var(--g-green); }
.concept-icon { margin-bottom: 6px; }
.concept-tile h4 { font-size: 14px; }
.concept-tile p { font-size: 12px; }
.concept-detail {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: all .3s; margin-top: 0;
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
}
.concept-tile.open .concept-detail {
  max-height: 200px; opacity: 1; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--border);
}

/* ═══ DRAG-MATCH ═══ */
.drag-zone {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 14px; background: var(--surface-2);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius); margin-bottom: 12px;
  min-height: 60px;
}
.drag-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px;
  font-size: 12.5px; cursor: grab; font-weight: 500;
  transition: all .2s; box-shadow: var(--shadow-sm);
}
.drag-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.drag-card:active { cursor: grabbing; }
.drag-card.placed {
  opacity: .35; pointer-events: none;
  text-decoration: line-through;
}
.drop-slots {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.drop-slot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface);
  border: 2px dashed var(--border); border-radius: var(--radius);
  font-size: 13px; min-height: 52px; transition: all .2s;
}
.drop-slot.over {
  border-color: var(--g-blue); background: rgba(66,133,244,.05);
  border-style: solid;
}
.drop-slot.ok {
  border-color: var(--g-green); background: rgba(52,168,83,.06);
  border-style: solid;
}
.drop-slot.err {
  border-color: var(--g-red); background: rgba(234,67,53,.06);
  border-style: solid; animation: shake .4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.slot-label { font-weight: 700; min-width: 130px; font-size: 12.5px; }
.slot-value { color: var(--text-dim); flex: 1; font-size: 12.5px; }

/* ═══ QUIZ ═══ */
.quiz {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  margin-bottom: 10px;
}
.quiz h4 {
  font-size: 14px; margin-bottom: 10px;
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 600; line-height: 1.4;
}
.quiz-num {
  flex: 0 0 28px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-blue); color: white;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .5px;
}
.quiz-opts {
  display: flex; flex-direction: column; gap: 6px;
}
.quiz-opt {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 13px; transition: all .2s;
  position: relative;
}
.quiz-opt:hover:not(.locked) {
  border-color: var(--g-blue); background: rgba(66,133,244,.05);
  transform: translateX(4px);
}
.quiz-opt.locked { cursor: default; }
.quiz-opt.correct {
  border-color: var(--g-green); background: rgba(52,168,83,.1);
  color: var(--g-green-d); font-weight: 600;
}
.quiz-opt.correct::after {
  content: '✓'; position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); color: var(--g-green); font-weight: 700;
}
.quiz-opt.wrong {
  border-color: var(--g-red); background: rgba(234,67,53,.1);
  color: var(--g-red-d); text-decoration: line-through;
}
.quiz-feedback {
  display: none; margin-top: 8px; padding: 8px 12px;
  font-size: 12.5px; font-weight: 600; border-radius: 8px;
}
.quiz-feedback.show { display: block; animation: revealUp .3s; }
.quiz-feedback.ok { background: rgba(52,168,83,.1); color: var(--g-green-d); }
.quiz-feedback.no { background: rgba(234,67,53,.1); color: var(--g-red-d); }

/* ═══ FLOW STEPS ═══ */
.flow { display: flex; flex-direction: column; gap: 8px; }
.flow-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.flow-num {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
}
.flow-step.blue .flow-num { background: var(--g-blue); }
.flow-step.red .flow-num { background: var(--g-red); }
.flow-step.yellow .flow-num { background: var(--g-yellow); color: #222; }
.flow-step.green .flow-num { background: var(--g-green); }
.flow-content h4 { font-size: 13px; margin-bottom: 2px; }
.flow-content p { font-size: 12px; }

/* ═══ DRAWING CANVAS ═══ */
.draw-bar {
  display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
  padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  flex-wrap: wrap;
}
.color-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: all .2s;
}
.color-btn.active { border-color: var(--text); transform: scale(1.15); box-shadow: var(--shadow-sm); }
.size-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; font-size: 11px;
  cursor: pointer; font-weight: 600; font-family: var(--mono);
}
.size-btn.active { background: var(--text); color: var(--surface); border-color: var(--text); }

.canvas-wrap {
  background: var(--surface);
  border: 2px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  max-width: 720px; margin: 0 auto;
}
#mC {
  display: block; width: 100%; height: 360px;
  background: white; cursor: crosshair;
  touch-action: none;
}

.txt-input {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-family: var(--font-sans);
  font-size: 13px; color: var(--text); resize: vertical;
  margin-top: 8px;
}
.txt-input:focus { outline: 2px solid var(--g-blue); outline-offset: 1px; border-color: var(--g-blue); }

/* ═══ SCRATCH BLOCKS ═══ */
.sb-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sb-col h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 6px; font-family: var(--mono); font-weight: 600; }
.sb-wrap {
  background: #2a3043; border-radius: 10px; padding: 10px;
}
.sb-stack { display: flex; flex-direction: column; }
.sb-block {
  font-family: var(--font-sans); color: white;
  padding: 8px 14px; border-radius: 5px;
  font-size: 12.5px; font-weight: 600;
  margin: 1px 0; box-shadow: 0 2px 4px rgba(0,0,0,.2);
  display: inline-block; position: relative;
}
.sb-block.motion { background: #4C97FF; }
.sb-block.event { background: #FFAB19; color: #222; }
.sb-block.event.hat { border-radius: 16px 16px 5px 5px; }
.sb-block.sound { background: #CF63CF; }
.sb-block.control { background: #FFAB19; color: #222; }

/* ═══ PYTHON ═══ */
.py {
  background: #1a1f2e; color: #f0f2f8;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  padding: 14px 16px; border-radius: 10px;
  white-space: pre; overflow-x: auto;
  border: 1px solid #2e3650;
  margin-top: 8px;
}
.py .kw { color: #ff9b6d; font-weight: 600; }
.py .fn { color: #6db8ff; }
.py .st { color: #b6e88f; }
.py .num { color: #f0c674; }
.py .cm { color: #6e7691; font-style: italic; }

/* ═══ CHECKLIST ═══ */
.checklist { list-style: none; padding: 0; }
.checklist li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 6px;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
}
.checklist li:hover { border-color: var(--g-blue); transform: translateX(4px); }
.checklist .ck {
  flex: 0 0 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: transparent; transition: all .2s; font-weight: 700;
}
.checklist li.done .ck {
  background: var(--g-green); border-color: var(--g-green); color: white;
}
.checklist li.done {
  background: rgba(52,168,83,.06); border-color: rgba(52,168,83,.3);
  text-decoration: line-through; color: var(--text-dim);
}

/* ═══ ETHICS ═══ */
.eth-options { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.eth-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 13px; text-align: left; font-family: var(--font-sans); color: var(--text);
  transition: all .2s;
}
.eth-btn:hover:not(.locked) { background: var(--surface-3); border-color: var(--g-blue); }
.eth-btn.locked { cursor: default; opacity: .55; }
.eth-btn.good { background: rgba(52,168,83,.12); border-color: var(--g-green); color: var(--g-green-d); font-weight: 600; opacity: 1; }
.eth-btn.bad { background: rgba(234,67,53,.12); border-color: var(--g-red); color: var(--g-red-d); opacity: 1; }
.eth-explain {
  display: none; margin-top: 8px; padding: 10px 14px;
  background: rgba(66,133,244,.08); border: 1px solid rgba(66,133,244,.2);
  border-radius: 8px; font-size: 12.5px; color: var(--text); line-height: 1.5;
}
.eth-explain.show { display: block; animation: revealUp .3s; }

/* ═══ RUBRIC ═══ */
.rubric {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12.5px; background: var(--surface);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.rubric th, .rubric td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.rubric th { background: var(--surface-2); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.rubric td { vertical-align: top; cursor: pointer; transition: background .2s; }
.rubric td:not(:first-child):hover { background: var(--surface-2); }
.rubric td.hl {
  background: rgba(251,188,4,.18) !important;
  box-shadow: inset 3px 0 0 var(--g-yellow);
}
.rubric tr:last-child td { border-bottom: none; }

/* ═══ AI ═══ */
.ai-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-family: var(--font-sans);
  font-size: 13px; color: var(--text);
}
.ai-input:focus { outline: 2px solid var(--g-blue); border-color: var(--g-blue); }
.ai-output {
  margin-top: 10px; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(66,133,244,.06), rgba(52,168,83,.06));
  border: 1px solid rgba(66,133,244,.2);
  border-radius: var(--radius); font-size: 13px; line-height: 1.7;
  color: var(--text); white-space: pre-wrap;
}
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid var(--border); border-top-color: var(--g-blue);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ TIMER ═══ */
.timer {
  font-family: var(--mono); font-size: 56px; font-weight: 700;
  text-align: center; color: var(--g-blue-d);
  margin: 14px 0; letter-spacing: 4px;
  text-shadow: 0 4px 20px rgba(66,133,244,.2);
}
.timer.urgent { color: var(--g-red); animation: pulse .8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ═══ CERT ═══ */
.cert {
  background: var(--surface);
  border: 4px double var(--g-yellow-d);
  border-radius: var(--radius-lg); padding: 36px 30px;
  text-align: center; max-width: 620px; margin: 0 auto;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cert::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid var(--g-yellow);
  border-radius: 16px; pointer-events: none;
}
.cert-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--g-yellow-d);
  margin-bottom: 14px;
}
.cert h3 {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 600; color: var(--text);
  margin-bottom: 16px;
}
.cert-line { font-size: 12.5px; color: var(--text-dim); margin-bottom: 8px; }
.cert-name {
  font-family: var(--font-display); font-size: 36px; font-weight: 600;
  color: var(--g-red); margin: 12px 0;
  font-style: italic;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px; letter-spacing: -0.01em;
}
.cert-score {
  font-family: var(--mono); font-size: 18px; font-weight: 700;
  color: var(--g-green-d); margin-top: 14px; letter-spacing: 1px;
}

/* ═══ NAV ═══ */
.navbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: var(--surface);
  border-top: 1px solid var(--border);
}
.btn {
  border: none; border-radius: 100px; padding: 8px 18px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn.primary { background: var(--text); color: var(--surface); }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.nav-spacer { flex: 1; }

.dots {
  flex: 1; display: flex; align-items: center; gap: 4px;
  justify-content: center; flex-wrap: wrap;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); cursor: pointer;
  transition: all .2s;
}
.dot:hover { background: var(--border-strong); transform: scale(1.3); }
.dot.complete { background: var(--g-green); }
.dot.active { background: var(--g-red); transform: scale(1.5); box-shadow: 0 0 0 3px rgba(234,67,53,.2); }
.dot-sep {
  width: 14px; height: 1px; background: var(--border);
  margin: 0 4px;
}

.progress {
  height: 3px; background: var(--border);
  border-radius: 0; overflow: hidden;
}
.pfill {
  height: 100%;
  background: linear-gradient(90deg, var(--g-blue), var(--g-red), var(--g-yellow), var(--g-green));
  background-size: 200% 100%;
  transition: width .55s cubic-bezier(.2,.8,.2,1);
  animation: gradFlow 4s linear infinite;
}
@keyframes gradFlow {
  to { background-position: 200% 0; }
}

.slide-count {
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  font-weight: 600; letter-spacing: 1px; min-width: 60px; text-align: center;
}

/* ═══ TWEAKS PANEL (hamburger menu) ═══ */
.tweaks-panel {
  position: fixed; top: 56px; right: 18px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  width: 260px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px) scale(.96); pointer-events: none;
  transform-origin: top right;
  transition: all .25s cubic-bezier(.34,1.4,.64,1);
}
.tweaks-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.tweaks-panel::before {
  content: ''; position: absolute; top: -6px; right: 14px;
  width: 12px; height: 12px; background: var(--surface);
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.tweaks-panel h4 {
  font-family: var(--font-display); font-size: 15px;
  margin-bottom: 14px; color: var(--text); font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.tweaks-panel h4::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--g-red);
}
.tweak-row { margin-bottom: 14px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-row label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px; font-family: var(--mono);
}
.tweak-options { display: flex; gap: 4px; }
.tweak-options button {
  flex: 1; padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; cursor: pointer; font-family: var(--font-sans);
  color: var(--text); transition: all .2s; font-weight: 500;
}
.tweak-options button:hover { background: var(--surface-3); }
.tweak-options button.on {
  background: var(--text); color: var(--surface);
  border-color: var(--text); font-weight: 600;
}

/* ═══ CONFETTI ═══ */
.confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
}
.confetti i {
  position: absolute; top: -10px; width: 8px; height: 14px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ═══ NARRATION PLAYER ═══ */
.narration-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  max-height: 0; overflow: hidden;
  background: var(--surface);
  border-top: 1px solid transparent;
  transition: max-height .35s cubic-bezier(.2,.8,.2,1), border-color .35s, padding .35s;
}
.narration-bar.visible {
  max-height: 48px;
  padding: 0 20px;
  border-top-color: var(--border);
}
.narr-play-btn {
  flex: 0 0 32px; width: 32px; height: 32px;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--g-blue); color: white;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: 0 2px 8px rgba(66,133,244,.35);
  flex-shrink: 0;
}
.narr-play-btn:hover { background: var(--g-blue-d); transform: scale(1.08); }
.narr-icon { width: 14px; height: 14px; }
.narr-label {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}
.narr-track {
  flex: 1; height: 4px; background: var(--surface-3);
  border-radius: 4px; cursor: pointer; position: relative;
  transition: height .15s;
}
.narr-track:hover { height: 6px; }
.narr-fill {
  height: 100%; width: 0%; background: var(--g-blue);
  border-radius: 4px; transition: width .2s linear;
  pointer-events: none;
}
.narr-time {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--text-muted); min-width: 36px; text-align: right;
  flex-shrink: 0;
}

/* Print */
@media print {
  .topbar, .navbar, .tweaks-panel, .tweaks-btn { display: none !important; }
  .slide { position: static; opacity: 1 !important; transform: none !important; page-break-after: always; }
  .stage { position: static; }
  body, html { overflow: visible; height: auto; }
}

/* Scrollbar */
.slide::-webkit-scrollbar { width: 8px; }
.slide::-webkit-scrollbar-track { background: transparent; }
.slide::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Mobile */
@media (max-width: 720px) {
  :root { --slide-pad: 24px 22px; }
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
  .obj-list, .tc, .tc-3, .concept-grid, .drop-slots, .sb-compare { grid-template-columns: 1fr; }
  .topic-name { display: none; }
  .brand-tag { display: none; }

  /* Keep nav visible on phones — pin progress + navbar to bottom */
  .progress {
    position: fixed; left: 0; right: 0;
    bottom: calc(48px + env(safe-area-inset-bottom));
    z-index: 40;
  }
  .navbar {
    position: fixed; left: 0; right: 0;
    bottom: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
    z-index: 40;
    box-shadow: 0 -4px 16px rgba(0,0,0,.06);
  }
  .navbar .btn { padding: 8px 14px; font-size: 13px; }
  .slide-count { min-width: 44px; font-size: 11px; letter-spacing: .5px; }
  /* Reserve room so slide content isn't hidden behind the fixed nav */
  .main { padding-bottom: calc(51px + env(safe-area-inset-bottom)); }
}
