
:root {
  --text: #16202a;
  --muted: #566471;
  --primary: #f57c00;
  --secondary: #00897b;
  --accent: #ffd54f;
  --success: #2e7d5b;
  --danger: #c84b5a;
  --border: rgba(22, 32, 42, 0.12);
  --shadow: 0 24px 56px rgba(52, 60, 90, 0.16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 79, 0.34), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(92, 107, 192, 0.18), transparent 24%),
    linear-gradient(180deg, #fcfdff 0%, #f6f3ff 45%, #eef5ff 100%);
  overflow-x: hidden;
}
.page-glow { position: fixed; width: 280px; height: 280px; border-radius: 50%; filter: blur(30px); opacity: 0.55; pointer-events: none; }
.glow-one { top: 60px; left: -90px; background: rgba(245,124,0,0.18); }
.glow-two { right: -80px; top: 300px; background: rgba(0,137,123,0.16); }
button, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
textarea {
  width: 100%; min-height: 360px; border: 1px solid rgba(22,32,42,0.08); outline: none; resize: vertical;
  border-radius: 18px; padding: 16px; background: #fffefb; color: var(--text); line-height: 1.65;
}
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.app-shell { width: min(1320px, calc(100% - 24px)); margin: 0 auto; padding: 24px 0 40px; position: relative; z-index: 1; }
.hero, .dashboard, .lesson-grid, .studio-grid { display: grid; gap: 22px; }
.hero { grid-template-columns: 1.1fr 0.7fr; }
.dashboard { grid-template-columns: 350px 1fr; margin-top: 24px; }
.hero__main, .hero__side, .panel, .studio-panel {
  background: rgba(255,255,255,0.84); border: 1px solid rgba(255,255,255,0.74); backdrop-filter: blur(14px);
  box-shadow: var(--shadow); border-radius: var(--radius-xl); padding: 24px;
}
.hero__side { display: grid; gap: 18px; align-content: start; }
.brand-row, .hero__actions, .hero__badges, .panel__header, .challenge-header, .lesson-meta, .stage-legend, .quiz-options, .studio-actions, .studio-top-actions {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.panel__header, .challenge-header { justify-content: space-between; }
.brand-pill, .primary-btn, .secondary-btn, .ghost-btn, .quiz-option, .lesson-item, .stage-chip, .support-bot__trigger, .notes-fab { border-radius: 999px; }
.brand-pill, .brand-mini, .hero__badges span, .chip, .difficulty-pill, .stage-pill, .stage-chip, .panel__label, .stat-card span, .mini-card span, .console-card__header span {
  letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.76rem; font-weight: 800;
}
.brand-pill { background: linear-gradient(135deg, var(--primary), #ffb13c); color: white; padding: 10px 16px; }
.brand-mini, .hero__badges span, .chip, .difficulty-pill, .stage-pill, .stage-chip {
  background: rgba(255,255,255,0.9); color: var(--muted); padding: 10px 14px; border: 1px solid rgba(22,32,42,0.08);
}
h1, h2, h3 { margin: 0; line-height: 1.05; font-family: 'Baloo 2', cursive; }
h1 { font-size: clamp(2.7rem, 5vw, 5rem); max-width: 12ch; }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
h3 { font-size: 1.5rem; }
.hero__copy, #lessonDescription, #lessonExplanation, #exercisePrompt, #quizQuestion, .auto-guide, .feedback-box, #celebrationMessage, #heroSupportText, blockquote, .lesson-item span, #conceptHelp, .support-bot p { color: var(--muted); line-height: 1.65; }
.primary-btn, .secondary-btn, .ghost-btn, .quiz-option, .support-bot__trigger, .notes-fab { padding: 12px 18px; font-weight: 800; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.primary-btn { background: linear-gradient(135deg, var(--primary), #ff9f2d); color: white; box-shadow: 0 16px 32px rgba(245,124,0,0.28); }
.secondary-btn, .support-bot__trigger { background: linear-gradient(135deg, var(--secondary), #12bba9); color: white; }
.notes-fab {
  background: linear-gradient(135deg, #ffd54f, #ff9f2d);
  color: #3b2500;
  box-shadow: 0 18px 36px rgba(245,124,0,0.32), 0 0 0 4px rgba(255,213,79,0.18);
  border: 1px solid rgba(245,124,0,0.18);
}
.ghost-btn, .quiz-option, .lesson-item { background: white; color: var(--text); border: 1px solid var(--border); }
.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .quiz-option:hover, .lesson-item:hover, .stage-chip:hover, .support-bot__trigger:hover, .notes-fab:hover { transform: translateY(-2px); }
.stat-card, .mini-card, .mission-card, .editor-card, .console-card { background: rgba(255,255,255,0.96); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 2.7rem; font-family: 'Baloo 2', cursive; }
.progress-track { margin-top: 12px; height: 14px; background: #f2ebdf; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: inherit; transition: width .3s ease; }
.stage-legend { margin-top: 16px; }
.lesson-list { display: grid; gap: 12px; margin-top: 18px; max-height: 70vh; overflow: auto; padding-right: 6px; }
.lesson-item { text-align: left; padding: 16px 18px; }
.lesson-item strong, .lesson-item span { display: block; }
.lesson-item span { margin-top: 4px; font-size: .92rem; }
.lesson-item.active { background: linear-gradient(135deg, rgba(245,124,0,0.12), rgba(255,213,79,0.28)); border-color: rgba(245,124,0,0.34); }
.lesson-item.completed { box-shadow: inset 0 0 0 2px rgba(46,125,91,0.2); }
.lesson-grid { margin-top: 18px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.practice-card { border: 1px solid rgba(245,124,0,0.22); box-shadow: inset 0 0 0 1px rgba(255,213,79,0.32); }
.auto-guide, .feedback-box, .checklist, blockquote { margin-top: 14px; padding: 16px; border-radius: var(--radius-md); background: #fffaf0; border: 1px dashed rgba(22,32,42,0.14); }
blockquote { background: #edf7ff; font-weight: 600; }
.feedback-box:empty, .checklist:empty, blockquote:empty { display: none; }
.step-list { margin: 14px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }
.checklist { display: grid; gap: 10px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; }
.check-item::before { content: '+'; color: var(--success); font-weight: 800; }
.quiz-options { margin-top: 12px; }
.quiz-option.correct { background: rgba(46,125,91,0.12); border-color: rgba(46,125,91,0.35); }
.quiz-option.wrong { background: rgba(200,75,90,0.12); border-color: rgba(200,75,90,0.35); }
.celebration-card { background: linear-gradient(135deg, rgba(255,213,79,0.2), rgba(237,247,255,0.78)); }
.hidden { display: none !important; }
.studio { margin-top: 24px; }
.studio-grid { margin-top: 18px; grid-template-columns: minmax(0,1.1fr) minmax(320px,.9fr); }
.editor-card--wide { min-height: 100%; }
.console-column { display: grid; gap: 16px; }
.console-card { min-height: 180px; }
#consoleOutput { min-height: 220px; background: #0f172a; color: #d2f7ff; padding: 16px; border-radius: 16px; overflow: auto; }
.info-card { min-height: 150px; }
.notes-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 34;
}
.notes-panel {
  position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(760px, calc(100vw - 24px)); z-index: 35;
  background: rgba(255,255,255,0.98); border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow);
  padding: 22px; display: grid; grid-template-rows: auto 1fr;
}
.notes-panel__header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px;
}
.notes-panel__close {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.notes-panel__body { overflow: auto; display: grid; gap: 16px; padding-right: 4px; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.notes-card {
  background: linear-gradient(180deg, rgba(255,250,240,0.96), rgba(237,247,255,0.98));
  border: 1px solid rgba(22, 32, 42, 0.1); border-radius: 22px; padding: 18px;
}
.notes-card h3 { margin-bottom: 10px; }
.notes-card p, .notes-card li, .notes-card code { color: var(--muted); line-height: 1.65; }
.notes-card ol, .notes-card ul { margin: 10px 0 0; padding-left: 20px; }
.notes-card p { margin: 0 0 10px; }
.notes-label {
  display: inline-block; margin-bottom: 10px; padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.9); border: 1px solid rgba(22,32,42,0.08); font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.notes-section-title {
  display: inline-block;
  margin: 10px 0 6px;
  font-weight: 800;
  color: var(--text);
}
.notes-code {
  margin-top: 12px; background: #0f172a; color: #d2f7ff; padding: 14px; border-radius: 16px; overflow: auto;
}
.floating-action-group {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  gap: 12px;
  align-items: center;
}
.support-bot { position: fixed; right: 18px; bottom: 82px; z-index: 30; width: min(320px, calc(100vw - 28px)); background: rgba(255,255,255,0.96); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; }
.support-bot__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.support-bot__header strong { font-family: 'Baloo 2', cursive; font-size: 1.15rem; }
.support-bot__close { width: 32px; height: 32px; border-radius: 50%; background: #fff3ef; color: var(--primary); font-weight: 800; }
@media (max-width: 1100px) { .hero, .dashboard, .lesson-grid, .studio-grid, .notes-grid { grid-template-columns: 1fr; } .lesson-list { max-height: none; } }
@media (max-width: 640px) {
  .app-shell { width: min(100% - 16px, 1320px); padding-top: 16px; }
  .hero__main, .hero__side, .panel, .studio-panel, .stat-card, .mini-card, .mission-card, .editor-card, .console-card { padding: 16px; }
  h1 { font-size: 2.35rem; }
  textarea { min-height: 280px; }
  .notes-panel { top: 8px; right: 8px; left: 8px; bottom: 8px; width: auto; padding: 16px; }
  .floating-action-group { right: 12px; left: 12px; bottom: 12px; gap: 8px; }
  .floating-action-group > button { flex: 1 1 0; min-width: 0; }
  .support-bot { right: 12px; bottom: 72px; }
}
