/* Starter course mastery UI (paired with assets/starter-points.js).
   A floating chip plus an end-of-lesson modal: chrome that sits OVER a lesson
   rather than inside it. It still reads the lesson page's colour vars
   (--green, --green-soft, --line, --muted, --ink) so a lesson with its own
   palette carries through — but every fallback now points at theme.css
   instead of the navy/blue literals that used to be spelled out here.

   Two places deliberately stop asking the page:
     · --gold is #2563eb — a BLUE — on all twelve lesson pages, and it was
       colouring the ⭐ score, the one number this component exists to show.
       The score is an achievement readout, so it takes the gold family
       directly: --t-gold-ink for the digits (5.6:1 on white), --t-gold for
       the completion card's top edge (decoration, never type).
     · .mw-sum-close is a filled button carrying white text, and white on a
       fill is exactly where an *-ink token is mandatory. It takes the action
       fill: white is 5.0:1 on --t-green and 7.9:1 on --t-green-deep. */

/* ── mastery chip (⭐ n/100 · Level) ── */
.mw-points-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 13px; border-radius: var(--t-r-pill);
  background: var(--t-white); border: 1px solid var(--line, var(--t-line));
  box-shadow: 0 4px 14px rgba(var(--t-green-deep-rgb), 0.1);
  font: 800 13px/1 var(--t-sans); color: var(--ink, var(--t-ink));
  white-space: nowrap;
}
.mw-points-chip.floating { position: fixed; top: 110px; right: 16px; z-index: 900; }
@media (max-width: 760px) { .mw-points-chip.floating { top: 92px; right: 10px; padding: 5px 11px; font-size: 12px; } }
.mw-points-chip .mw-score b { color: var(--t-gold-ink); }   /* 13px type: ink, never --t-gold */
.mw-points-chip .mw-level {
  padding: 3px 9px; border-radius: var(--t-r-pill);
  background: var(--green-soft, var(--t-green-tint)); color: var(--green, var(--t-green-deep));
  font-size: 11px; font-weight: 800;
}
.mw-points-chip.bump { animation: mw-chip-bump .45s cubic-bezier(.2,.8,.25,1); }
@keyframes mw-chip-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ── end-of-lesson summary card ── */
.mw-sum-back {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--t-scrim); opacity: 0; transition: opacity .25s ease;
}
.mw-sum-back.show { opacity: 1; }
.mw-sum-card {
  width: min(360px, 100%); text-align: center;
  padding: 30px 26px 24px; border-radius: var(--t-r-md);
  background: linear-gradient(180deg, var(--t-white) 0%, var(--t-white) 100%);
  border: 1px solid var(--line, var(--t-line));
  box-shadow: 0 30px 70px rgba(var(--t-green-deep-rgb), 0.3);
  transform: translateY(14px) scale(.96); transition: transform .3s cubic-bezier(.2,.8,.25,1);
}
.mw-sum-back.show .mw-sum-card { transform: translateY(0) scale(1); }
.mw-sum-title { font: 800 20px/1.2 var(--t-sans); color: var(--green, var(--t-green-deep)); }
.mw-sum-lesson {
  margin-top: 8px; display: inline-block; padding: 5px 14px; border-radius: var(--t-r-pill);
  background: var(--green-soft, var(--t-green-tint)); color: var(--green, var(--t-green-deep));
  font: 800 13px/1.2 var(--t-sans);
}
.mw-sum-score {
  margin: 14px 0 10px; font: 600 15px/1 var(--t-sans); color: var(--muted, var(--t-muted));
}
.mw-sum-score b {
  font-size: 46px; font-weight: 800; color: var(--t-gold-ink);
  display: inline-block; animation: mw-score-pop .5s cubic-bezier(.2,.8,.25,1) both;
}
@keyframes mw-score-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.mw-sum-level {
  display: inline-block; margin-top: 2px; padding: 6px 16px; border-radius: var(--t-r-pill);
  background: var(--green-soft, var(--t-green-tint)); color: var(--green, var(--t-green-deep));
  font: 800 14px/1.2 var(--t-sans);
}
.mw-sum-tip { margin-top: 12px; font: 700 16px/1.4 var(--t-sans); color: var(--ink, var(--t-ink)); }

/* whole-course completion card */
.mw-course-card { border-top: 4px solid var(--t-gold); }   /* a 4px edge: mark, not ink */
.mw-course-card .mw-sum-title { font-size: 23px; }
.mw-course-sub { margin-top: 6px; font: 600 14px/1.5 var(--t-sans); color: var(--muted, var(--t-muted)); }
.mw-course-card .mw-sum-tip { font-size: 14.5px; font-weight: 600; line-height: 1.55; }
.mw-sum-close {
  margin-top: 22px; padding: 11px 30px; border: 0; border-radius: var(--t-r-pill); cursor: pointer;
  /* was #a65f20 → #1e3a8a: a green that turned navy halfway down, i.e. both
     accent systems inside one 44px button. One family now, and white clears
     4.5:1 at both ends. */
  background: linear-gradient(180deg, var(--t-green) 0%, var(--t-action-fill) 100%); color: var(--t-white);
  font: 800 15px/1 var(--t-sans); box-shadow: 0 10px 24px rgba(var(--t-green-deep-rgb), 0.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.mw-sum-close:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(var(--t-green-deep-rgb), 0.32); }

@media (prefers-reduced-motion: reduce) {
  .mw-points-chip.bump, .mw-sum-score b, .mw-sum-card, .mw-sum-back { animation: none; transition: none; }
  .mw-sum-score b { transform: none; opacity: 1; }
}
