:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --primary: #58a6ff;
  --secondary: #7c3aed;
  --accent: #f78166;
  --green: #3fb950;
  --yellow: #d29922;
  --cyan: #39d0d8;
  --pink: #f472b6;
  --txt: #e6edf3;
  --txt2: #8b949e;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 12px;
  --glass: rgba(255, 255, 255, 0.04);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Light mode overrides */
body.light {
  --bg: #f0f4f8;
  --bg2: #ffffff;
  --bg3: #e8edf3;
  --primary: #0969da;
  --secondary: #6e40c9;
  --accent: #d1242f;
  --green: #1f883d;
  --yellow: #9a6700;
  --cyan: #0550ae;
  --pink: #bf3989;
  --txt: #1a202c;
  --txt2: #4a5568;
  --border: rgba(0, 0, 0, 0.1);
  --glass: rgba(0, 0, 0, 0.03);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════
       2. RESET
    ═══════════════════════════════════════════ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s, color 0.35s;
}

/* ═══════════════════════════════════════════
       3. SCROLL PROGRESS BAR
    ═══════════════════════════════════════════ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--pink));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 3px 3px 0;
}

/* ═══════════════════════════════════════════
       4. STICKY NAVBAR
    ═══════════════════════════════════════════ */
nav {
  position: sticky;
  top: 0;
  z-index: 800;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}

body.light nav {
  background: rgba(240, 244, 248, 0.92);
}

.nav-brand {
  font-weight: 800;
  font-size: 0.95rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  display: block;
  color: var(--txt2);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: var(--glass);
  color: var(--txt);
}

.nav-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

#mode-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--txt);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#mode-toggle:hover {
  border-color: var(--primary);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--txt2);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-back:hover {
  background: var(--glass);
  color: var(--txt);
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════
       5. STUDY TIMER (fixed pill)
    ═══════════════════════════════════════════ */
#timer-pill {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  z-index: 600;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 120px;
}

#timer-display {
  font-family: 'Fira Code', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--txt);
  letter-spacing: 0.05em;
}

#timer-display.urgent {
  color: var(--accent);
}

.timer-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--txt2);
}

.timer-btns {
  display: flex;
  gap: 0.3rem;
}

.timer-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  transition: opacity 0.15s;
}

.timer-btn:hover {
  opacity: 0.8;
}

.timer-btn.start {
  background: var(--green);
  color: #fff;
}

.timer-btn.pause {
  background: var(--yellow);
  color: #000;
}

.timer-btn.reset {
  background: var(--bg3);
  color: var(--txt2);
  border: 1px solid var(--border);
}

.timer-set {
  font-size: 0.68rem;
  color: var(--txt2);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.timer-set select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--txt);
  font-size: 0.68rem;
  padding: 0.1rem 0.3rem;
  cursor: pointer;
}

/* ═══════════════════════════════════════════
       6. HERO
    ═══════════════════════════════════════════ */
.hero {
  padding: 4rem 2rem 3rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(88, 166, 255, 0.12), transparent 60%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 100px;
  padding: 0.35rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(120deg, var(--txt) 40%, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--txt2);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto 1.75rem;
  line-height: 1.75;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 1.25rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 166, 255, 0.35);
}

.stat-pill .num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.stat-pill .lbl {
  font-size: 0.68rem;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════
       7. LAYOUT
    ═══════════════════════════════════════════ */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 8rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3.5rem 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.section-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(88, 166, 255, 0.12);
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
       8. SHARED CARD STYLES
    ═══════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(88, 166, 255, 0.3);
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.82rem;
  color: var(--txt2);
  line-height: 1.6;
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.6rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* ═══════════════════════════════════════════
       9. BUTTONS
    ═══════════════════════════════════════════ */
.btn {
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
}

.btn:hover:not(:disabled) {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.btn-green {
  background: var(--green);
  color: #fff;
}

.btn-ghost {
  background: var(--bg3);
  color: var(--txt2);
  border: 1px solid var(--border);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.flex-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ═══════════════════════════════════════════
       10. QUIZ ENGINE (shared)
    ═══════════════════════════════════════════ */
.quiz-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.qz-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.qz-counter {
  font-size: 0.75rem;
  color: var(--txt2);
  font-weight: 600;
  white-space: nowrap;
}

.qz-bar-bg {
  flex: 1;
  height: 5px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
}

.qz-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 100px;
  transition: width 0.4s ease;
}

.qz-score-badge {
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.qz-question {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.qz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.qz-opt {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--txt);
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.qz-opt:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(88, 166, 255, 0.06);
}

.qz-opt.correct {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
}

.qz-opt.wrong {
  border-color: var(--accent);
  background: rgba(247, 129, 102, 0.1);
  color: var(--accent);
}

.opt-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.qz-feedback {
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  min-height: 2rem;
  margin-bottom: 1rem;
}

.qz-feedback.ok {
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
}

.qz-feedback.err {
  background: rgba(247, 129, 102, 0.1);
  color: var(--accent);
}

.qz-result {
  text-align: center;
  padding: 2rem;
}

.qz-result .big-score {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.qz-result .msg {
  font-size: 1rem;
  color: var(--txt2);
  margin: 0.5rem 0 1.5rem;
}

/* ═══════════════════════════════════════════
       11. FLASHCARDS
    ═══════════════════════════════════════════ */
.flashcard-scene {
  perspective: 1000px;
  width: 100%;
  max-width: 480px;
  height: 200px;
  margin: 0 auto 1.25rem;
  cursor: pointer;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard-scene.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.flashcard-front {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 2px solid var(--primary);
}

.flashcard-back {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.12), rgba(124, 58, 237, 0.12));
  border: 2px solid var(--secondary);
  transform: rotateY(180deg);
}

.flashcard-front .fc-hint {
  font-size: 0.68rem;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.flashcard-front .fc-term {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--txt);
}

.flashcard-front .fc-category {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.flashcard-back .fc-answer {
  font-size: 0.9rem;
  color: var(--txt);
  line-height: 1.6;
  font-weight: 500;
}

.fc-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.fc-counter {
  font-size: 0.8rem;
  color: var(--txt2);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
       12. WRITTEN ANSWER (Model Answer)
    ═══════════════════════════════════════════ */
.written-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.written-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.written-card h4 .q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(88, 166, 255, 0.15);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.written-card textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 150px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 0.75rem;
}

.written-card textarea:focus {
  border-color: var(--primary);
}

.model-answer {
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.25);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-size: 0.83rem;
  color: var(--txt2);
  line-height: 1.7;
  display: none;
}

.model-answer.visible {
  display: block;
}

.model-answer strong {
  color: var(--green);
}

/* ═══════════════════════════════════════════
       13. CODING CHALLENGE CHECKLIST
    ═══════════════════════════════════════════ */
.challenge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .challenge-grid {
    grid-template-columns: 1fr;
  }
}

.challenge-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.challenge-check:hover {
  border-color: rgba(63, 185, 80, 0.4);
}

.challenge-check.done {
  background: rgba(63, 185, 80, 0.07);
  border-color: rgba(63, 185, 80, 0.4);
}

.cc-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  margin-top: 2px;
  transition: all 0.2s;
}

.challenge-check.done .cc-box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.cc-text {
  font-size: 0.84rem;
  color: var(--txt2);
  line-height: 1.5;
}

.challenge-check.done .cc-text {
  text-decoration: line-through;
  opacity: 0.55;
}

.challenge-score-bar {
  margin-top: 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.csb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.csb-label {
  font-size: 0.82rem;
  color: var(--txt2);
}

.csb-pct {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.csb-bar-bg {
  height: 8px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
}

.csb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--primary));
  border-radius: 100px;
  transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════
       13B. CHALLENGE PLAYGROUND
    ═══════════════════════════════════════════ */
.playground-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 1024px) {
  .playground-wrap {
    flex-direction: row;
    height: 600px;
  }
}

.pg-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  overflow: hidden;
}

.pg-header {
  background: var(--bg3);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--txt);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pg-editor {
  flex: 1;
  width: 100%;
  padding: 1rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--txt);
  background: var(--bg2);
  border: none;
  resize: none;
  outline: none;
  line-height: 1.6;
}

.pg-preview {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

/* ═══════════════════════════════════════════
       14. ACCORDION (existing style)
    ═══════════════════════════════════════════ */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.accordion-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.accordion-item:hover {
  border-color: rgba(88, 166, 255, 0.3);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--txt);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}

.accordion-trigger:hover {
  background: var(--glass);
}

.accordion-trigger .mod-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(88, 166, 255, 0.12);
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  flex-shrink: 0;
}

.accordion-trigger .acc-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.accordion-trigger .chevron {
  margin-left: auto;
  color: var(--txt2);
  font-size: 0.9rem;
  transition: transform 0.3s;
}

.accordion-item.open .chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
}

.accordion-content {
  padding: 0 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .accordion-content {
    grid-template-columns: 1fr;
  }
}

.acc-block {
  background: var(--bg3);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.acc-block h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.acc-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.acc-block ul li {
  font-size: 0.85rem;
  color: var(--txt2);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.5;
}

.acc-block ul li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--green);
}

.acc-block ul li strong {
  color: var(--txt);
}

.acc-code {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  background: black;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  color: #79c0ff;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
  margin-top: 0.5rem;
}

.acc-code .kw {
  color: #ff7b72;
}

.acc-code .fn {
  color: #d2a8ff;
}

.acc-code .st {
  color: #a5d6ff;
}

.acc-code .cm {
  color: #8b949e;
  font-style: italic;
}

.acc-code .vl {
  color: #79c0ff;
}

/* ═══════════════════════════════════════════
       15. CHEAT SHEET (existing style)
    ═══════════════════════════════════════════ */
.cheat-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cheat-tab {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--txt2);
  font-family: inherit;
  transition: all 0.2s;
}

.cheat-tab.active,
.cheat-tab:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.cheat-panel {
  display: none;
}

.cheat-panel.active {
  display: block;
}

.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.cheat-table th {
  background: var(--bg3);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cheat-table td {
  padding: 0.62rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--txt2);
  vertical-align: top;
  line-height: 1.5;
}

.cheat-table tr:last-child td {
  border-bottom: none;
}

.cheat-table tr:hover td {
  background: var(--glass);
}

.cheat-table code {
  font-family: 'Fira Code', monospace;
  font-size: 0.79rem;
  color: var(--primary);
  background: rgba(88, 166, 255, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
       16. CHECKLIST (existing style)
    ═══════════════════════════════════════════ */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.6rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.check-item:hover {
  border-color: rgba(63, 185, 80, 0.35);
}

.check-item.checked {
  background: rgba(63, 185, 80, 0.07);
  border-color: rgba(63, 185, 80, 0.4);
}

.check-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.check-item.checked .check-box {
  background: var(--green);
  border-color: var(--green);
}

.check-label {
  font-size: 0.875rem;
  color: var(--txt2);
  flex: 1;
  transition: color 0.2s;
}

.check-item.checked .check-label {
  text-decoration: line-through;
  opacity: 0.6;
}

.checklist-summary {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--txt2);
}

.progress-text strong {
  color: var(--txt);
}

.checklist-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
}

.checklist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--primary));
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════
       17. FIX-THE-HTML EXERCISE
    ═══════════════════════════════════════════ */
.fth-exercise {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.fth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.fth-header h4 {
  font-size: 0.875rem;
  font-weight: 700;
}

.fth-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  text-transform: uppercase;
}

.fth-badge.broken {
  background: rgba(247, 129, 102, 0.15);
  color: var(--accent);
}

.fth-badge.fixed {
  background: rgba(63, 185, 80, 0.15);
  color: var(--green);
}

.fth-body {
  padding: 1.25rem;
}

.fth-code-area {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  color: var(--txt);
  line-height: 1.65;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

.fth-code-area .error {
  color: var(--accent);
  text-decoration: underline wavy var(--accent);
}

.fth-code-area .fix {
  color: var(--green);
}

.fth-code-area[contenteditable="true"] {
  outline: none;
  transition: all 0.2s;
}

.fth-code-area[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px var(--primary);
  background: var(--bg2);
}

.fth-answer {
  display: none;
}

.fth-answer.visible {
  display: block;
}

/* ═══════════════════════════════════════════
       18. BACK TO TOP
    ═══════════════════════════════════════════ */
#back-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.2s;
  z-index: 500;
  box-shadow: 0 4px 20px rgba(88, 166, 255, 0.35);
}

#back-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-top:hover {
  transform: translateY(-3px);
}

/* ═══════════════════════════════════════════
       19. DNS SIMULATION
    ═══════════════════════════════════════════ */
.dns-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  opacity: 0.3;
  transition: opacity 0.4s, border-color 0.4s;
}

.dns-step.active {
  opacity: 1;
  border-color: var(--primary);
}

.dns-step.done {
  opacity: 1;
  border-color: var(--green);
}

.dns-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dns-step.active .dns-step-num {
  background: var(--primary);
  color: #fff;
}

.dns-step.done .dns-step-num {
  background: var(--green);
  color: #fff;
}

.dns-step-text {
  font-size: 0.83rem;
  color: var(--txt2);
}

.dns-step.active .dns-step-text,
.dns-step.done .dns-step-text {
  color: var(--txt);
}

/* ═══════════════════════════════════════════
       20. FRONTEND vs BACKEND COMPARISON
    ═══════════════════════════════════════════ */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

@media (max-width: 540px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.cg-col {
  padding: 1.5rem;
}

.cg-col.front {
  background: rgba(88, 166, 255, 0.06);
  border-right: 1px solid var(--border);
}

.cg-col.back {
  background: rgba(124, 58, 237, 0.06);
}

.cg-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 800;
}

.cg-col.front .cg-header {
  color: var(--primary);
}

.cg-col.back .cg-header {
  color: var(--secondary);
}

.cg-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.83rem;
  color: var(--txt2);
}

.cg-item::before {
  content: "▹";
  color: var(--green);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
       21. FOOTER & MOBILE
    ═══════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 3rem 1rem 4rem;
  color: var(--txt2);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
  }

  nav {
    padding: 0 1rem;
  }

  .hero {
    padding: 3rem 1rem 2rem;
  }

  .container {
    padding: 0 1rem 4rem;
  }

  #timer-pill {
    right: 1rem;
  }
}

/* ═══════════════════════════════════════════
       22. UTIL
    ═══════════════════════════════════════════ */
.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

.info-box {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  font-size: 0.83rem;
  color: var(--txt2);
  line-height: 1.6;
}

.info-box strong {
  color: var(--txt);
}

.warn-box {
  background: rgba(247, 129, 102, 0.08);
  border: 1px solid rgba(247, 129, 102, 0.25);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  font-size: 0.83rem;
  color: var(--txt2);
  line-height: 1.6;
}

/* Random shuffler badge */
.random-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  background: rgba(57, 208, 216, 0.15);
  color: var(--cyan);
  margin-left: 0.5rem;
}

/* ═══════════════════════════════════════════
       16. HTML CORRECTION FEEDBACK
    ═══════════════════════════════════════════ */
.fth-feedback {
  font-size: 0.82rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-top: 0.75rem;
  line-height: 1.5;
  display: none;
}

.fth-feedback.visible {
  display: block;
}

.fth-feedback.ok {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.25);
  color: var(--green);
}

.fth-feedback.err {
  background: rgba(247, 129, 102, 0.08);
  border: 1px solid rgba(247, 129, 102, 0.25);
  color: var(--accent);
}

/* Custom styles for Módulo 2 Trainer */
.sim-console {
  background: #090e1a;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Fira Code', monospace;
  padding: 1.25rem;
  color: #34d399;
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 100px;
  max-height: 250px;
  overflow-y: auto;
  line-height: 1.6;
  white-space: pre-wrap;
}
.sandbox-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}
.sandbox-tab-btn {
  padding: 0.4rem 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--txt2);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}
.sandbox-tab-btn.active, .sandbox-tab-btn:hover {
  background: var(--glass);
  color: var(--txt);
  border-color: var(--border);
}
.sandbox-tab-panel {
  display: none;
}
.sandbox-tab-panel.active {
  display: block;
}
.demo-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--txt);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--primary);
}
.db-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.db-item:hover {
  background: rgba(247, 129, 102, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.quiz-opt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.quiz-opt:hover {
  border-color: var(--primary);
}
.quiz-opt.correct {
  border-color: var(--green);
  background: rgba(63, 185, 80, 0.1);
}
.quiz-opt.wrong {
  border-color: var(--accent);
  background: rgba(247, 129, 102, 0.1);
}
.quiz-feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
}
.quiz-feedback.correct {
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
}
.quiz-feedback.wrong {
  background: rgba(247, 129, 102, 0.1);
  color: var(--accent);
}
.role-card {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  transition: all 0.25s;
}
.role-card.allowed {
  border-left: 4px solid var(--green);
}
.role-card.denied {
  border-left: 4px solid var(--accent);
  opacity: 0.6;
}
