/**
 * Shared “Explorer Academy” course theme — matches FLL Explorer Academy (fll-course.html).
 * Used by: fll-course.html, ftc-course.html, ftc-week1–6.html, ftc-launchpad-labs.html, learning/index.html
 */
* {
  box-sizing: border-box;
}

:root {
  --bg: #1a1a2e;
  --card: #16213e;
  --accent: #ffc93c;
  --green: #6bcb77;
  --blue: #4d96ff;
  --red: #e94560;
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  margin: 0;
  background: var(--bg);
  color: #eee;
  line-height: 1.6;
}

/* ── FTC Launchpad: dual track (Guides vs Launchpad Labs) ── */
.ftc-track-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 2rem;
}

@media (min-width: 560px) {
  .ftc-track-split {
    grid-template-columns: 1fr 1fr;
  }
}

.ftc-track-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 2px solid rgba(255, 201, 60, 0.25);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.ftc-track-card:hover {
  border-color: rgba(77, 150, 255, 0.45);
  transform: translateY(-2px);
}

.ftc-track-card:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.ftc-track-card--labs {
  border-color: rgba(107, 203, 119, 0.35);
}

.ftc-track-card--labs:hover {
  border-color: rgba(107, 203, 119, 0.55);
}

.ftc-track-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.ftc-track-card--labs .ftc-track-kicker {
  color: var(--green);
}

.ftc-track-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  color: #fff;
  margin: 0 0 0.4rem;
}

.ftc-track-desc {
  margin: 0;
  font-size: 0.92rem;
  color: #aaa;
  line-height: 1.45;
}

/* ── Launchpad Labs (interactive module player) ── */
.labs-earn-loop-line {
  font-size: 0.88rem;
  color: #9ab;
  max-width: 36rem;
  margin: 0 auto 0.75rem;
  line-height: 1.45;
}

/* Full-width ribbon banner (shop unlock) — CHAMPION in display type, not a “hint bubble” */
.labs-flair-banner {
  max-width: 36rem;
  margin: 0 auto 1rem;
}

.labs-flair-banner-ribbon {
  display: flex;
  align-items: stretch;
  justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.labs-flair-banner-notch {
  width: 0.65rem;
  flex-shrink: 0;
  background: linear-gradient(180deg, #8b6914 0%, #5c450e 100%);
  clip-path: polygon(0 0, 100% 0.35rem, 100% calc(100% - 0.35rem), 0 100%);
}

.labs-flair-banner-notch--right {
  transform: scaleX(-1);
}

.labs-flair-banner-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 1rem 0.45rem;
  background: linear-gradient(
    180deg,
    #ffeaa7 0%,
    #f4d03f 22%,
    #d4a017 78%,
    #9a7209 100%
  );
  border-top: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid rgba(60, 40, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.labs-flair-banner-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.labs-flair-banner-trophy-img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  flex-shrink: 0;
}

.labs-flair-banner-champion {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: clamp(2.1rem, 6vw, 2.75rem);
  line-height: 0.95;
  letter-spacing: 0.12em;
  color: #1a1204;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 -1px 0 rgba(0, 0, 0, 0.15);
}

.labs-flair-banner-sub {
  font-family: "Outfit", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #3d2a08;
  margin: 0;
  opacity: 0.92;
  text-align: center;
}

@media (min-width: 480px) {
  .labs-flair-banner-main {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem 0.85rem;
    padding: 0.45rem 1.35rem 0.4rem;
  }

  .labs-flair-banner-sub {
    border-left: 2px solid rgba(26, 18, 4, 0.28);
    padding-left: 0.85rem;
    margin-left: -0.15rem;
  }
}

.labs-inventory {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(22, 33, 62, 0.55);
  border: 1px dashed rgba(77, 150, 255, 0.28);
}

.labs-inventory-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin-bottom: 0.45rem;
}

.labs-inventory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 1.75rem;
  align-items: center;
}

.labs-inventory-chips:empty::after {
  content: "Nothing yet — earn credits in modules and open the shop.";
  font-size: 0.85rem;
  color: #666;
}

.labs-inv-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(77, 150, 255, 0.12);
  border: 1px solid rgba(77, 150, 255, 0.35);
  color: #dde6ff;
}

.labs-inv-chip strong {
  color: #fff;
  font-weight: 600;
}

.labs-inv-art {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: -0.2em;
  object-fit: contain;
}

button.labs-inv-chip {
  font: inherit;
  cursor: pointer;
  border: 1px solid rgba(77, 150, 255, 0.45);
  color: inherit;
}

button.labs-inv-chip:hover {
  filter: brightness(1.12);
}

.labs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  margin: 0 0 1.25rem;
  background: rgba(22, 33, 62, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.labs-bar.labs-bar--pulse {
  animation: labs-bar-pulse 0.45s ease;
}

@keyframes labs-bar-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.5);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(255, 201, 60, 0);
  }
}

.labs-credit-pop {
  position: absolute;
  right: 1rem;
  top: -0.35rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green);
  pointer-events: none;
  animation: labs-credit-pop-anim 0.9s ease forwards;
}

@keyframes labs-credit-pop-anim {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-28px) scale(1.05);
  }
}

.labs-confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.labs-confetti-piece {
  position: absolute;
  width: 8px;
  height: 12px;
  top: -20px;
  border-radius: 2px;
  animation: labs-confetti-fall 2.2s ease-out forwards;
}

@keyframes labs-confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0.85;
  }
}

.labs-quiz-streak-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 201, 60, 0.08);
  border: 1px solid rgba(255, 201, 60, 0.2);
}

.labs-quiz-streak-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.labs-quiz-streak-val {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  color: #fff;
  min-width: 1.5rem;
}

.labs-quiz-streak-hint {
  font-size: 0.82rem;
  color: #9ab;
}

.labs-credits {
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  color: var(--accent);
}

.labs-energy {
  font-family: "Fredoka", sans-serif;
  font-size: 1rem;
  color: #81c784;
  margin-left: 0.65rem;
}

.labs-energy-select {
  width: 100%;
  max-width: 28rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #e8e8e8;
  font-size: 0.95rem;
}

.labs-module-label {
  font-size: 0.8rem;
  color: #888;
}

.labs-panel {
  background: var(--card);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.labs-hub-bonus {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.labs-hub-bonus-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.labs-hub-bonus .labs-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.labs-climb-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
}

.labs-climb-title {
  margin: 0;
  flex: 1;
  min-width: 8rem;
}

#labs-climb-root {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.labs-climb-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.labs-climb-energy-bar {
  width: 100%;
}

.labs-climb-get-energy {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, #43a047 0%, #2e7d32 100%);
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 0 #1b5e20, 0 8px 20px rgba(46, 125, 50, 0.35);
  cursor: pointer;
}

.labs-climb-get-energy:hover {
  filter: brightness(1.06);
}

.labs-climb-get-energy:focus-visible {
  outline: 3px solid rgba(129, 199, 132, 0.9);
  outline-offset: 2px;
}

.labs-climb-get-energy:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1b5e20;
}

.labs-climb-energy-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.labs-climb-energy-overlay.hidden {
  display: none !important;
}

.labs-climb-energy-panel {
  width: 100%;
  max-height: min(82vh, 540px);
  overflow-y: auto;
  padding: 1rem 1rem 1.25rem;
  border-radius: 14px 14px 0 0;
  background: #f8fafc;
  color: #1e293b;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.25);
}

.labs-climb-energy-title {
  margin: 0 0 0.35rem;
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  color: #0f172a;
}

.labs-climb-energy-topic {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #475569;
}

.labs-climb-energy-q {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: #0f172a;
}

.labs-climb-energy-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.labs-climb-energy-opt {
  text-align: left;
  justify-content: flex-start;
}

.labs-climb-energy-opt--correct {
  background: rgba(46, 125, 50, 0.18) !important;
  border-color: #2e7d32 !important;
  color: #1b5e20 !important;
}

.labs-climb-energy-opt--wrong {
  background: rgba(198, 40, 40, 0.15) !important;
  border-color: #c62828 !important;
  color: #b71c1c !important;
}

.labs-climb-energy-feedback {
  min-height: 1.35rem;
  margin: 0.65rem 0 0;
}

.labs-climb-energy-feedback--ok {
  color: #2e7d32 !important;
}

.labs-climb-energy-feedback--bad {
  color: #c62828 !important;
}

.labs-climb-energy-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  justify-content: flex-end;
}

.labs-climb-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: #5a6b82;
}

.labs-climb-hud kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(179, 229, 252, 0.5);
  border: 1px solid rgba(2, 136, 209, 0.25);
  color: #1565c0;
}

.labs-climb-canvas {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 10px;
  border: 2px solid rgba(129, 199, 132, 0.55);
  outline: none;
  background: #e1f5fe;
  box-shadow: 0 6px 24px rgba(2, 119, 189, 0.12);
}

.labs-climb-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.labs-slide-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.labs-slide-body {
  color: #ddd;
  font-size: 0.98rem;
  line-height: 1.55;
}

.labs-slide-body p {
  margin: 0 0 0.75rem;
}

.labs-slide-body p:last-child {
  margin-bottom: 0;
}

.labs-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.labs-btn {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #4d96ff 0%, #3a7dd6 100%);
  color: #fff;
}

.labs-btn:hover {
  filter: brightness(1.08);
}

.labs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.labs-btn--secondary {
  background: #2a3550;
  color: #ddd;
}

.labs-btn--accent {
  background: linear-gradient(180deg, #6bcb77 0%, #4fa85d 100%);
}

.labs-quiz-q {
  font-weight: 600;
  margin: 0 0 0.85rem;
  color: #eee;
}

.labs-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.labs-quiz-opt {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: #eee;
  font-size: 0.95rem;
  cursor: pointer;
}

.labs-quiz-opt:hover:not(:disabled) {
  border-color: var(--blue);
}

.labs-quiz-opt.selected {
  border-color: var(--accent);
  background: rgba(255, 201, 60, 0.12);
}

.labs-quiz-opt.correct {
  border-color: var(--green);
  background: rgba(107, 203, 119, 0.15);
}

.labs-quiz-opt.wrong {
  border-color: var(--red);
  opacity: 0.85;
}

.labs-feedback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #aaa;
}

.labs-shop-section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #e0e0e0;
  letter-spacing: 0.02em;
}

.labs-shop-section-title:first-of-type {
  margin-top: 0;
}

.labs-shop-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .labs-shop-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.labs-shop-item {
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.labs-shop-item-inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.85rem;
  padding: 0.85rem;
}

.labs-shop-art-wrap {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 0.25rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.labs-shop-art {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.labs-shop-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.labs-shop-item-copy .labs-btn {
  align-self: flex-start;
  margin-top: 0.15rem;
}

.labs-shop-item.labs-shop-item--owned {
  border-color: rgba(107, 203, 119, 0.4);
  background: rgba(107, 203, 119, 0.06);
}

.labs-shop-item.labs-shop-item--queued {
  border-color: rgba(255, 201, 60, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 201, 60, 0.15);
}

.labs-shop-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.labs-shop-badge--owned {
  background: rgba(107, 203, 119, 0.25);
  color: var(--green);
}

.labs-shop-badge--queued {
  background: rgba(255, 201, 60, 0.2);
  color: var(--accent);
}

.labs-shop-item h4,
.labs-shop-item-copy h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #fff;
}

.labs-shop-item p,
.labs-shop-item-copy p {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: #999;
}

@media (max-width: 400px) {
  .labs-shop-item-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .labs-shop-item-copy .labs-btn {
    align-self: center;
  }
}

.labs-match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (max-width: 520px) {
  .labs-match-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.labs-match-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.25;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, #1e2a4a 0%, #16213e 100%);
  color: #ddd;
  user-select: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.labs-match-card:hover:not(.matched):not(.face-down) {
  border-color: var(--blue);
}

.labs-match-card.face-down {
  background: linear-gradient(145deg, #4d96ff 0%, #2d5a9e 100%);
  color: transparent;
  font-size: 0;
}

.labs-match-card.face-down::after {
  content: "?";
  font-size: 1.25rem;
  font-family: "Fredoka", sans-serif;
  color: rgba(255, 255, 255, 0.85);
}

.labs-match-card.matched {
  border-color: var(--green);
  background: rgba(107, 203, 119, 0.12);
  cursor: default;
  color: #fff;
}

.labs-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: 90vw;
  padding: 0.65rem 1.1rem;
  background: #16213e;
  border: 1px solid var(--green);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #eee;
  z-index: 100;
  transition: transform 0.25s ease;
  pointer-events: none;
}

.labs-toast.visible {
  transform: translateX(-50%) translateY(0);
}

.labs-deep-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  color: #aaa;
}

.labs-deep-links a {
  color: var(--blue);
}

/* Module hub grid */
.labs-module-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (min-width: 520px) {
  .labs-module-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.labs-module-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: #eee;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.labs-module-card:hover:not(:disabled) {
  border-color: rgba(77, 150, 255, 0.45);
  background: rgba(22, 33, 62, 0.6);
}

.labs-module-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.labs-module-card.done {
  border-color: rgba(107, 203, 119, 0.45);
}

.labs-module-card-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.25rem;
}

.labs-module-card-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: #fff;
  margin: 0 0 0.35rem;
}

.labs-module-card-desc {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.4;
  margin: 0;
}

.labs-module-card-meta {
  font-size: 0.75rem;
  color: var(--green);
  margin: 0.5rem 0 0;
}

.labs-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.labs-bar-actions .labs-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.labs-order-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (min-width: 480px) {
  .labs-order-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.labs-order-card {
  min-height: 4.5rem;
  padding: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.3;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #1e2a4a;
  color: #ddd;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.labs-order-card:hover:not(:disabled):not(.labs-order-card--done) {
  border-color: var(--blue);
}

.labs-order-card--wrong {
  animation: labs-shake 0.35s ease;
  border-color: var(--red) !important;
}

.labs-order-card--done {
  border-color: var(--green);
  background: rgba(107, 203, 119, 0.12);
  cursor: default;
  color: #fff;
}

.labs-order-card--done::before {
  content: attr(data-step);
  display: block;
  font-size: 0.65rem;
  color: var(--green);
  margin-bottom: 0.25rem;
}

@keyframes labs-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.hidden {
  display: none !important;
}

/* ── Course landing (fll-course, ftc-course, learning hub) ── */
.main {
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

.main h1 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.9rem;
  color: var(--accent);
  margin: 0 0 0.3rem;
  text-align: center;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-icon {
  display: block;
  margin: 0 auto 0.75rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 20px;
  padding: 0.15em 0.75em;
}

.badge-green {
  background: rgba(107, 203, 119, 0.18);
  color: var(--green);
  border: 1px solid rgba(107, 203, 119, 0.4);
}

.badge-yellow {
  background: rgba(255, 201, 60, 0.15);
  color: var(--accent);
  border: 1px solid rgba(255, 201, 60, 0.35);
}

.badge-blue {
  background: rgba(77, 150, 255, 0.15);
  color: var(--blue);
  border: 1px solid rgba(77, 150, 255, 0.35);
}

.hero p {
  color: #aaa;
  font-size: 1.05rem;
  margin: 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  color: var(--accent);
  margin: 2rem 0 0.75rem;
}

/* FTC Launchpad landing: topic groups (no week numbers) */
.ftc-topic-group {
  margin-top: 1.35rem;
}

.ftc-topic-group:first-of-type {
  margin-top: 0.5rem;
}

.ftc-topic-label {
  font-family: "Fredoka", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a7a8c;
  margin: 0 0 0.5rem;
}

.ftc-landing-lead {
  color: #999;
  font-size: 0.93rem;
  margin: 0 0 1rem;
  max-width: 36rem;
}

.weeks-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.week-row {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: var(--card);
  border: 2px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: #eee;
  transition: border-color 0.2s, background 0.2s;
}

.week-row:hover {
  border-color: var(--accent);
  background: rgba(255, 201, 60, 0.06);
}

.week-num {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: var(--accent);
  min-width: 2.5rem;
}

.week-body .week-title {
  font-weight: 700;
  font-size: 1rem;
}

.week-body .week-sub {
  color: #888;
  font-size: 0.88rem;
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.how-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.07);
}

.how-card .how-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.how-card .how-desc {
  color: #999;
  font-size: 0.88rem;
}

.materials-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.materials-list li {
  background: var(--card);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.materials-list li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.trust-note {
  margin-top: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  font-size: 0.95rem;
  color: #aaa;
}

.trust-note strong {
  color: #ddd;
}

.page-footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

.page-footer a {
  color: var(--accent);
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

.course-breadcrumb {
  font-size: 0.88rem;
  color: #888;
  margin: 0 0 1rem;
  text-align: center;
}

.course-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.course-breadcrumb a:hover {
  text-decoration: underline;
}

/* ── Inner lesson pages (FTC study guide, practice, etc.) — FLL week–style ── */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
}

.session-header {
  background: var(--card);
  border-radius: 14px;
  border: 2px solid rgba(255, 201, 60, 0.3);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.session-week {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.session-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.7rem;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-chip {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 0.2em 0.75em;
  color: #bbb;
}

.content-block {
  margin-bottom: 1.75rem;
}

.content-block h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.content-block p,
.content-block ul {
  color: #bbb;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.content-block ul {
  padding-left: 1.25rem;
}

.lesson-card {
  background: var(--card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.lesson-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: #eee;
}

.lesson-card p,
.lesson-card ul {
  margin: 0;
  color: #bbb;
  font-size: 0.93rem;
}

.lesson-card ul {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
}

.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.week-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.week-nav a:hover {
  text-decoration: underline;
}

.week-nav .center {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

/* Practice: details / answers */
details.practice-item {
  background: var(--card);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 0.65rem 0;
}

details.practice-item summary {
  cursor: pointer;
  font-weight: 700;
  color: #eee;
  list-style: none;
}

details.practice-item summary::-webkit-details-marker {
  display: none;
}

details.practice-item[open] summary {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

details.practice-item .answer {
  color: #aaa;
  font-size: 0.93rem;
}

details.practice-item .answer ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

details.practice-item .answer ul li {
  margin-bottom: 0.25rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  margin-bottom: 0.5rem;
}

.checklist label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  color: #bbb;
  font-size: 0.95rem;
  cursor: pointer;
}

.checklist input {
  margin-top: 0.35rem;
  flex-shrink: 0;
}

/* FTC Launchpad: tap missions & explore links */
details.ftc-mission {
  background: var(--card);
  border: 2px solid rgba(107, 203, 119, 0.28);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 0.65rem 0;
}

details.ftc-mission summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green);
  list-style: none;
}

details.ftc-mission summary::-webkit-details-marker {
  display: none;
}

details.ftc-mission[open] summary {
  margin-bottom: 0.5rem;
}

details.ftc-mission .ftc-mission-body {
  color: #bbb;
  font-size: 0.93rem;
}

details.ftc-mission .ftc-mission-body p:first-child {
  margin-top: 0;
}

.ftc-lead {
  color: #888;
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.fun-callout {
  background: rgba(255, 201, 60, 0.07);
  border: 1px dashed rgba(255, 201, 60, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  font-size: 0.93rem;
  color: #ccc;
}

.fun-callout ul {
  list-style: disc;
}

.fun-callout ul li {
  margin-bottom: 0.3rem;
}

/* FTC Launchpad: on-page crash course (summarizes linked resources) */
.ftc-crash-course {
  background: rgba(77, 150, 255, 0.07);
  border-left: 4px solid var(--blue);
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0 1.5rem;
}

.ftc-crash-course h3 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.ftc-crash-course > p {
  margin: 0 0 0.65rem;
  color: #aaa;
  font-size: 0.93rem;
}

.ftc-crash-course ul {
  margin: 0;
  padding-left: 1.15rem;
  color: #ccc;
  font-size: 0.91rem;
  line-height: 1.5;
}

.ftc-crash-course li {
  margin-bottom: 0.4rem;
}

.ftc-crash-course strong {
  color: #eee;
  font-weight: 600;
}

.ftc-crash-course ul ul,
.ftc-mission-body ul ul {
  margin: 0.35rem 0 0.35rem;
  padding-left: 1.2rem;
}

.ftc-crash-course ul ul > li,
.ftc-mission-body ul ul > li {
  margin-bottom: 0.25rem;
}

.ftc-mission-body ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
  color: #bbb;
  font-size: 0.9rem;
  line-height: 1.45;
}

.ftc-mission-body ul:first-child {
  margin-top: 0;
}

.ftc-mission-body > p + ul {
  margin-top: 0.35rem;
}

ul.ftc-tight-list {
  color: #888;
  font-size: 0.95rem;
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.45;
}

ul.ftc-tight-list li {
  margin-bottom: 0.4rem;
}

.explore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.explore-grid a {
  display: block;
  background: rgba(77, 150, 255, 0.08);
  border: 1px solid rgba(77, 150, 255, 0.28);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: var(--blue);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.explore-grid a:hover {
  background: rgba(77, 150, 255, 0.14);
}

.explore-grid a .explore-hint {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.2rem;
}

@media (max-width: 520px) {
  .explore-grid {
    grid-template-columns: 1fr;
  }

  .main,
  .page {
    padding: 4rem 1rem 2rem;
  }

  .main h1,
  .session-title {
    font-size: 1.6rem;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }
}

/* Code blocks — prevent page-level horizontal scroll on mobile */
pre {
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  font-size: 0.82rem;
  line-height: 1.45;
}

code {
  font-size: 0.88em;
  word-break: break-word;
}

/* ── Print styles ────────────────────────────────────────────────────────── */
@media print {
  /* Reset backgrounds and colours to plain black-on-white */
  *, *::before, *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: #ccc !important;
  }

  /* Hide non-content chrome */
  .site-sticky-header,
  .nav-hamburger,
  .week-nav,
  .page-footer,
  .explore-grid,
  .fun-callout,
  #vlq-auth-gate,
  .skip-link {
    display: none !important;
  }

  /* Remove main content visibility hiding (auth gate hides main for print too) */
  main {
    visibility: visible !important;
  }

  /* Page layout */
  body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .main, .page {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Headings */
  h1 { font-size: 18pt; margin-bottom: 6pt; }
  h2 { font-size: 14pt; margin-top: 16pt; margin-bottom: 4pt; page-break-after: avoid; }
  h3 { font-size: 12pt; page-break-after: avoid; }

  /* Keep cards readable */
  .lesson-card {
    border: 1px solid #ccc;
    border-radius: 4pt;
    padding: 8pt;
    margin-bottom: 8pt;
    page-break-inside: avoid;
  }

  /* Keep details open on print */
  details { display: block; }
  details summary { list-style: none; font-weight: 700; }
  details summary::marker { display: none; }
  .ftc-details-body { display: block !important; }

  /* Code blocks */
  pre {
    border: 1px solid #ccc;
    padding: 6pt;
    font-size: 8pt;
    white-space: pre-wrap;
    word-break: break-all;
    overflow: visible;
  }

  /* Don't print URLs after every link — too noisy for course content */
  a[href]::after { content: none !important; }

  /* Page break hints */
  .section-heading { page-break-before: auto; }
  .lesson-card { page-break-inside: avoid; }
}
