/* ===================== Academy: map, paths, lesson player, infographic cards ===================== */
.academy-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; border-radius: 20px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #22d3ee44, transparent 50%), linear-gradient(135deg, #1e1b4b, #4c1d95 55%, #831843); box-shadow: var(--shadow); margin-bottom: 20px; }
.lv { display: flex; align-items: center; gap: 14px; min-width: 240px; flex: 1; }
.lv-badge { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; background: linear-gradient(135deg, #fbbf24, #f97316); color: #1f1300; box-shadow: 0 6px 18px rgb(249 115 22 / 35%); }
.lv-text { flex: 1; }
.lv-text b { font-size: 1.15rem; }
.lv-text small { color: #e0e7ff; }
.xpbar { height: 9px; border-radius: 99px; background: rgb(255 255 255 / 18%); overflow: hidden; margin: 6px 0 4px; }
.xpbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fbbf24, #22d3ee); transition: width .6s; }
.xpbar.light { background: rgb(255 255 255 / 25%); max-width: 320px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hs { min-width: 92px; padding: 10px 14px; border-radius: 14px; background: rgb(255 255 255 / 10%); color: #fff; display: grid; text-align: center; }
.hs b { font-size: 1.3rem; }
.hs span { font-size: .75rem; color: #e0e7ff; }
a.hs:hover { background: rgb(255 255 255 / 18%); text-decoration: none; }
.hs.due { outline: 2px solid #fbbf24; }

.continue { --track: var(--brand); display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 18px; margin-bottom: 22px; color: var(--text); background: linear-gradient(135deg, color-mix(in srgb, var(--track) 16%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--track) 35%, var(--line)); box-shadow: var(--shadow); transition: transform .12s; }
.continue:hover { transform: translateY(-2px); text-decoration: none; }
.big-icon { font-size: 2.6rem; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 20px; background: color-mix(in srgb, var(--track, var(--brand)) 18%, var(--surface)); flex: none; }
.continue-body { flex: 1; min-width: 0; }
.continue-body small { color: var(--muted); font-weight: 600; }
.continue-body h2 { margin: 4px 0; font-size: 1.3rem; }
.continue-body p { margin: 0 0 6px; color: var(--muted); }
.continue .meta { font-size: .82rem; font-weight: 600; color: var(--track); }
.continue .go { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--track); font-size: 1.2rem; flex: none; box-shadow: 0 6px 18px color-mix(in srgb, var(--track) 40%, transparent); }


.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.track-tile { --track: var(--brand); display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--track); color: var(--text); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.track-tile:hover { transform: translateY(-2px); border-color: var(--track); text-decoration: none; }
.track-tile h3 { margin: 0 0 2px; font-size: 1rem; }
.track-tile p { margin: 0 0 4px; font-size: .82rem; color: var(--muted); }
.track-tile small { font-weight: 700; color: var(--track); }
.ring { width: 64px; height: 64px; flex: none; color: var(--text); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badges.center { justify-content: center; margin: 10px 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: .4em .9em; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .85rem; }
.badge.new { animation: pop .5s ease-out; border-color: #fbbf24; background: color-mix(in srgb, #fbbf24 15%, var(--surface)); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: none; } }
.skill-check .skill-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.skill-check .seg label { display: inline-flex; position: relative; }
.skill-check .seg input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.skill-check .seg span { padding: .35em .8em; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.skill-check .seg input:checked + span { background: var(--brand-soft); color: var(--brand); }
.skill-check .seg input:focus-visible + span { outline: 2px solid var(--brand); }
.skill-check > button { margin-top: 14px; }
.maker .capture { margin: 0; }
.center-text { text-align: center; }
.back-link { display: inline-block; margin-bottom: 12px; font-weight: 600; }

.track-banner { --track: var(--brand); display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, var(--track), color-mix(in srgb, var(--track) 55%, #0b0f19)); box-shadow: var(--shadow); margin-bottom: 22px; }
.track-banner .big-icon { background: rgb(255 255 255 / 16%); }
.track-banner h1 { margin: 0 0 4px; }
.track-banner p { margin: 0 0 8px; opacity: .9; }
.lesson-path { --track: var(--brand); list-style: none; padding: 0; margin: 0; position: relative; }
.lesson-path::before { content: ""; position: absolute; inset-block: 24px; inset-inline-start: 25px; width: 3px; background: var(--line); border-radius: 3px; }
.lesson-path li { position: relative; margin-bottom: 12px; }
.lesson-path a { display: flex; gap: 16px; align-items: flex-start; padding-block: 12px; padding-inline-end: 16px; color: var(--text); border-radius: 14px; }
.lesson-path a:hover { background: var(--surface); text-decoration: none; }
.lesson-path .node { position: relative; z-index: 1; width: 52px; height: 52px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; background: var(--surface); border: 3px solid var(--line); color: var(--muted); }
.lesson-path li.done .node { background: var(--track); border-color: var(--track); color: #fff; }
.lesson-path li.current .node { border-color: var(--track); color: var(--track); box-shadow: 0 0 0 6px color-mix(in srgb, var(--track) 18%, transparent); animation: pulse-ring 1.8s infinite; }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--track) 8%, transparent); } }
.lesson-path b { display: block; font-size: 1.02rem; }
.lesson-path small { color: var(--muted); font-weight: 600; }
.lesson-path p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.lesson-path div { flex: 1; }
.start-pill { align-self: center; padding: .45em 1em; border-radius: 99px; background: var(--track); color: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap; }

/* lesson player */
.lesson-player, .review { --track: var(--brand); max-width: 760px; margin: 0 auto; }
.player-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.player-top .x { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); font-size: 1.1rem; }
.player-top .x:hover { background: var(--surface); text-decoration: none; }
.pbar { flex: 1; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--track), color-mix(in srgb, var(--track) 50%, #22d3ee)); transition: width .35s; }
.pcount { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .85rem; }
.lesson-meta { margin-bottom: 14px; text-align: center; }
.slide { animation: slide-in .32s ease-out; }
.slide.bwd { animation-name: slide-back; }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-28px); } }
:dir(rtl) .slide { animation-name: slide-back; }
:dir(rtl) .slide.bwd { animation-name: slide-in; }
.player-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; position: sticky; bottom: 12px; }
.player-nav .primary { padding: .75em 1.6em; font-size: 1rem; }

/* infographic cards */
.ic { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.ic-title { font-size: 1.25rem; margin: 0 0 18px; text-align: center; }
.ic-hero { text-align: center; align-items: center; background: radial-gradient(90% 80% at 50% 0%, color-mix(in srgb, var(--track) 20%, transparent), transparent 70%), var(--surface); }
.hero-icon { font-size: 3.6rem; width: 112px; height: 112px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 32px; background: color-mix(in srgb, var(--track) 16%, var(--surface)); box-shadow: 0 10px 30px color-mix(in srgb, var(--track) 25%, transparent); animation: pop .5s ease-out; }
.ic-hero h2 { font-size: 1.7rem; margin-bottom: 10px; }
.ic-hero p { font-size: 1.1rem; color: var(--muted); max-width: 520px; margin: 0 auto; }
.ic-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ic-steps li { display: flex; gap: 14px; align-items: flex-start; }
.ic-steps .num { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--track), color-mix(in srgb, var(--track) 55%, #22d3ee)); }
.ic-steps b { display: block; }
.ic-steps p { margin: 2px 0 0; color: var(--muted); font-size: .93rem; }
.ic-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.ic-compare .side { border-radius: 16px; padding: 16px; }
.ic-compare .bad { background: color-mix(in srgb, #ef4444 9%, var(--surface)); border: 1px solid color-mix(in srgb, #ef4444 25%, var(--line)); }
.ic-compare .good { background: color-mix(in srgb, #16a34a 10%, var(--surface)); border: 1px solid color-mix(in srgb, #16a34a 30%, var(--line)); }
.ic-compare h4 { margin: 0 0 10px; }
.ic-compare .bad h4 { color: #dc2626; }
.ic-compare .good h4 { color: var(--ok); }
.ic-compare ul { margin: 0; padding-inline-start: 1.1em; display: grid; gap: 6px; font-size: .93rem; }
.ic-compare .vs { align-self: center; font-weight: 900; color: var(--muted); font-size: .8rem; }
.ic-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-tile { text-align: center; padding: 18px 12px; border-radius: 16px; background: color-mix(in srgb, var(--track) 9%, var(--surface)); }
.stat-tile b { display: block; font-size: 2.1rem; line-height: 1.1; background: linear-gradient(135deg, var(--track), #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-tile span { color: var(--muted); font-size: .88rem; }
.ic-flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.fnode { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--track) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--track) 30%, var(--line)); font-weight: 700; text-align: center; max-width: 180px; }
.fnode small { font-size: .7rem; color: var(--track); font-weight: 800; }
.ic-flow .arrow { color: var(--track); font-size: 1.4rem; font-weight: 900; }
:dir(rtl) .ic-flow .arrow:not(.loop) { transform: scaleX(-1); }
.ic-flow .loop { font-size: 1.8rem; }
.ic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.gtile { padding: 16px; border-radius: 16px; background: var(--surface-2); }
.gicon { font-size: 1.7rem; display: block; margin-bottom: 6px; }
.gtile b { display: block; margin-bottom: 4px; }
.gtile p { margin: 0; color: var(--muted); font-size: .88rem; }
.ic .code pre { font-size: .86rem; }
.ic .caption { color: var(--muted); text-align: center; margin: 10px 0 0; }
.ic-quote { text-align: center; background: linear-gradient(135deg, color-mix(in srgb, var(--track) 12%, var(--surface)), var(--surface)); }
.ic-quote .qmark { font-size: 5rem; line-height: .6; color: var(--track); opacity: .35; font-family: Georgia, serif; }
.ic-quote p { font-size: 1.35rem; font-weight: 700; margin: 10px auto; max-width: 560px; }
.ic-quote cite { color: var(--muted); font-style: normal; }
.ic-tip { flex-direction: row; align-items: center; gap: 18px; justify-content: flex-start; background: color-mix(in srgb, #f59e0b 10%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 35%, var(--line)); }
.tip-icon { font-size: 2.8rem; }
.ic-tip b { font-size: 1.15rem; display: block; margin-bottom: 6px; }
.ic-tip p { margin: 0; }
.ic-takeaways { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ic-takeaways li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-weight: 600; }
.ic-takeaways span { color: #fff; background: var(--ok); width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; }

/* lab + quiz */
.lab { justify-content: flex-start; }
.lab-head { font-weight: 800; color: var(--track); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.checklist { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.checklist input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--track); }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.lab .check { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.quiz { justify-content: flex-start; }
.quiz h2 { font-size: 1.3rem; margin: 6px 0 16px; }
.options { display: grid; gap: 10px; }
.opt { justify-content: flex-start; text-align: start; white-space: normal; padding: 14px 16px; font-weight: 600; border-width: 2px; border-radius: 14px; }
.opt:hover:not(:disabled) { border-color: var(--track); }
.opt.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--text); opacity: 1; }
.opt.wrong { border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, var(--surface)); opacity: 1; animation: shake .35s; }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.why { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); animation: slide-in .25s; }
.why.ok b { color: var(--ok); }
.why.err b { color: #dc2626; }
.done-card { text-align: center; align-items: center; }
.done-card h2 { font-size: 1.7rem; }
.xp { color: #f59e0b; }
.related-mini { margin: 14px auto; text-align: start; max-width: 460px; display: grid; gap: 6px; }
.related-mini h4 { margin: 0; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }

/* flashcards */
.flash { --track: var(--brand); display: block; width: 100%; min-height: 280px; padding: 0; margin: 10px 0 16px; border: 0; background: none; perspective: 1200px; position: relative; cursor: pointer; }
.flash .face { position: absolute; inset: 0; display: grid; place-items: center; padding: 28px; border-radius: 22px; font-size: 1.3rem; font-weight: 700; backface-visibility: hidden; transition: transform .5s; box-shadow: var(--shadow); white-space: normal; }
.flash .front { background: var(--surface); border: 2px solid color-mix(in srgb, var(--track) 35%, var(--line)); color: var(--text); }
.flash .back { background: linear-gradient(135deg, var(--track), color-mix(in srgb, var(--track) 55%, #0b0f19)); color: #fff; transform: rotateY(180deg); font-weight: 600; font-size: 1.1rem; }
.flash.flipped .front { transform: rotateY(-180deg); }
.flash.flipped .back { transform: rotateY(0); }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }
@media (prefers-reduced-motion: reduce) {
  .slide, .hero-icon, .badge.new, .opt.wrong { animation: none !important; }
  .confetti { display: none; }
}

@media (max-width: 860px) {
  .ic { padding: 20px; min-height: 0; border-radius: 18px; }
  .ic-compare { grid-template-columns: 1fr; }
  .ic-compare .vs { justify-self: center; }
  .ic-hero h2 { font-size: 1.4rem; }
  .academy-hero { padding: 18px; }
  .continue { flex-wrap: wrap; }
  .continue .go { display: none; }
  .player-nav { bottom: 76px; }
  .track-banner { flex-direction: column; align-items: flex-start; }
}

/* the path from the skill check */
.path { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.path-step { --track: var(--brand); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--track); color: var(--text); font-weight: 600; }
.path-step:hover { text-decoration: none; border-color: var(--track); }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: #fff; font-size: .8rem; flex: none; }
.step-icon { font-size: 1.3rem; }

/* steadier player: cards keep a common height so the buttons don't jump */
.slide > .ic { min-height: 380px; }
.ic .code pre { white-space: pre; word-break: normal; overflow-x: auto; }
.lab .code pre { white-space: pre-wrap; word-break: normal; overflow-wrap: anywhere; }
.flash .back { flex-direction: column; gap: 12px; display: flex; align-items: center; justify-content: center; text-align: center; }
.flash .back small { font-size: .8rem; font-weight: 600; opacity: .75; }
@media (max-width: 860px) { .slide > .ic { min-height: 0; } }

/* missed questions on the done screen */
.missed { margin: 12px auto; max-width: 520px; text-align: start; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.missed summary { cursor: pointer; font-weight: 700; }
.missed-q { margin-top: 10px; }
.missed-q p { margin: 4px 0 0; }
.lab [data-lab-done]:disabled { opacity: .5; }
