/* Aurora: onboarding, profile (Learn / Practice / Play / Me), learning path, review, drill, level up
   Owned by the "profile" screen group, and only by it. Loaded after /style.css and
   /aurora/base.css, so a rule here overrides both. Never edit style.css or
   base.css from here: use the tokens (--au-*, --ink, --muted...) and the base
   pieces (.card, .btn.brand, .au-hero, .au-tile, .au-chip, .au-stat, .au-ring,
   .au-progress, .seg/.tabs, .au-row, .au-dock...) described in base.css.
   Scope every rule to this group's own classes.

   The phone app is the source of truth (linguino-mobile/mobile/src/screens/
   Home, Path, Profile, Review, Drill). On a phone (up to 480px) this page is
   its four tabs, Learn, Practise, Play and Me, one at a time (main[data-tab]),
   with the dock to switch; up to a small laptop the parts stand one under
   the other and the dock jumps between them; from 1024px it is a dashboard:
   the path, the missions and the games on the left, the deck and the
   shelves on the right. */

/* =====================================================================
   the page
   ===================================================================== */

.profile.au-page { width: 100%; max-width: 1180px; padding-top: 22px; padding-bottom: 48px; gap: 22px; }
.profile.pf-new { max-width: 600px; }
/* The in-page jumps land under the sticky header, not behind it. */
.profile :is(#me, #path, #practice, #play, .pf-shelf, .pf-missions) { scroll-margin-top: 78px; }

/* The header: nearly opaque frosted glass, so nothing scrolling under it
   ghosts through the logo and the buttons. */
.site-nav.pf-nav {
  background: var(--au-dock); border-bottom: 0;
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line), 0 12px 30px -24px rgba(0, 0, 0, 0.6);
}
/* Polar day: translucent white over the sky, a hairline rather than a hard edge. */
:root[data-theme="light"] .site-nav.pf-nav {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 1px 0 rgba(13, 33, 64, 0.06), 0 10px 26px -22px rgba(30, 70, 130, 0.35);
}

/* The one primary of each screen: a white label, a faint shadow under it
   so it holds on the orange. */
:is(.profile, .dr-screen, .rv-modal) .btn.brand:not(:disabled) { color: #fff; text-shadow: 0 1px 2px rgba(150, 50, 0, 0.45); }

/* The credit: plain ink, as on the home page (no orange gradient). */
.profile ~ .credit b { background: none; color: var(--ink); -webkit-text-fill-color: currentColor; }

/* A tab's own title, only on a phone's Practise tab. */
.profile .pf-tab-h { display: none; margin: 0; font: 700 var(--au-fs-hero, 30px)/1.05 var(--display); letter-spacing: -0.025em; }

/* Section titles: Outfit 19/600, no icon, a quiet note on the right. */
.profile .pf-h,
.profile h2.pf-h { display: block; margin: 0; font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.profile .au-section-head > :last-child:not(:first-child) { font-variant-numeric: tabular-nums; }

/* The dashboard. Below 1024 its two columns melt into one (display:
   contents) and the parts take the phone's order: Learn (the path, the
   missions), Practise (the deck, the rows, the shelves), Play. */
/* --side: the dashboard's right column, set on the page so the header
   above it (.pf-head) splits on the very same line. */
.profile { --side: 384px; }
@media (max-width: 1023px) {
  .pf-dash { gap: 26px; }
  .pf-dash > .pf-col { display: contents; }
  .pf-dash .pf-path { order: 1; }
  .pf-dash .pf-missions { order: 2; }
  .pf-dash .pf-solo { order: 3; }
  .pf-dash .pf-shelf { order: 4; }
  .pf-dash .pf-stories { order: 5; }
  .pf-dash .pf-play { order: 6; }
}
@media (min-width: 1024px) {
  .pf-dash > .pf-col { gap: 26px; }
}

/* The dock: the phone app's tab bar up to a small laptop. A desktop gets
   the same four as tabs in the header (.pf-dock-top, rendered there from
   1024px), not base.css's rail: the dashboard keeps its full width, so no
   room is kept for a rail either. */
@media (min-width: 1024px) {
  #app:has(.pf-dock) { padding-left: 0; }
  /* The bar's ends line up with the page's content (1180px with its
     gutter), not style.css's 1200px; and it keeps the dock's height while
     the edit form hides the dock, so nothing under it jumps. */
  .site-nav.pf-nav {
    gap: 12px; min-height: 72px;
    padding-inline: max(var(--au-gutter), calc((100% - 1180px) / 2 + var(--au-gutter)));
  }
  .site-nav.pf-nav .brand { margin-right: 18px; }
  .pf-nav .pf-dock.pf-dock-top {
    position: static; inset: auto; z-index: auto; width: auto; height: auto; max-width: none; margin: 0;
    flex-direction: row; align-items: center; gap: 4px; padding: 4px;
    border-radius: 999px; background: var(--au-glass-flat);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .pf-dock-top .au-dock-tab {
    flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px;
    color: var(--ink-2); font: 600 14.5px/1 var(--font); transition: background var(--dur-2), color var(--dur-2);
  }
  .pf-dock-top .au-dock-ic { width: 24px; height: 24px; border-radius: 50%; background: none; box-shadow: none; }
  .pf-dock-top .au-dock-ic svg, .pf-dock-top .au-dock-ic .i { width: 19px; height: 19px; }
  .pf-dock-top .au-dock-l { max-width: 132px; }
  .pf-dock-top .pf-dock-me { width: 24px; height: 24px; font-size: 12px; }
  /* The tab I am on: a raised glass pill, its icon in teal. The orange stays
     the page's one action (the path's next step). */
  .pf-dock-top .au-dock-tab.on {
    color: var(--ink);
    background: linear-gradient(var(--au-glass-hi) 0 0), var(--au-glass-flat);
    box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi), 0 6px 16px -10px rgba(0, 0, 0, 0.55);
  }
  .pf-dock-top .au-dock-tab.on .au-dock-ic { color: var(--au-teal); background: none; box-shadow: none; }
  .pf-dock-top .au-dock-tab.on::before { display: none; }
  @media (hover: hover) and (pointer: fine) { .pf-dock-top .au-dock-tab:not(.on):hover { background: var(--au-glass-flat); color: var(--ink); } }
  :root[data-theme="light"] .pf-nav .pf-dock.pf-dock-top { background: rgba(255, 255, 255, 0.5); box-shadow: inset 0 0 0 1px rgba(13, 33, 64, 0.08); }
  :root[data-theme="light"] .pf-dock-top .au-dock-tab.on { background: #fff; box-shadow: inset 0 0 0 1px rgba(13, 33, 64, 0.08), 0 6px 16px -10px rgba(30, 70, 130, 0.45); }
  :root[data-theme="light"] .pf-dock-top .au-dock-tab.on .au-dock-ic { color: #0b8a78; }
}
/* A tab jumped to on a wide screen: its part glows once, since side by side
   the page may hardly move. */
@media (prefers-reduced-motion: no-preference) {
  .profile .pf-jumped { border-radius: var(--au-r-card); outline: 2px solid transparent; outline-offset: 10px; animation: pf-jumped 1.2s var(--ease-out) 0.2s; }
}
@keyframes pf-jumped {
  0%, 100% { outline-color: transparent; }
  25%, 45% { outline-color: color-mix(in srgb, var(--au-teal) 60%, transparent); }
}
/* The Me tab: my initial in a small disc with the avatar's ring. */
.pf-dock-me {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent;
  background: linear-gradient(160deg, #1c4b8c, #0e2248) padding-box, linear-gradient(135deg, var(--au-teal), var(--au-violet)) border-box;
  color: #f3f7ff; font: 700 13px/1 var(--display);
}

/* A phone: one tab at a time, as in the app. Learn is the strip (language,
   streak, XP, level), the path and the missions; Practise the deck, the rows
   and the shelves; Play the room and the games; Me the person, the level,
   the counts and the credit. The edit form shows whatever the tab. */
@media (max-width: 480px) {
  .profile[data-tab="path"] :is(.pf-solo, .pf-shelf, .pf-stories, .pf-play),
  .profile[data-tab="path"] .pf-head :is(.pf-id, .pf-counts),
  .profile[data-tab="practice"] :is(.pf-head, .pf-path, .pf-missions, .pf-play, .pf-open),
  .profile[data-tab="play"] :is(.pf-head, .pf-path, .pf-missions, .pf-solo, .pf-shelf, .pf-stories),
  .profile[data-tab="me"] :is(.pf-path, .pf-missions, .pf-solo, .pf-shelf, .pf-stories, .pf-play, .pf-open),
  .profile[data-tab="me"] .pf-head .pf-stats { display: none; }
  .profile[data-tab]:not([data-tab="me"]) ~ .credit { display: none; }
  .profile[data-tab="practice"] .pf-tab-h { display: block; margin: 4px 0 2px; }

  /* Learn: the app's strip, then its thin level line, then the unit card. */
  .profile[data-tab="path"] .pf-head { gap: 10px; grid-template-areas: "stats" "level"; }
  .profile[data-tab="me"] .pf-head { grid-template-areas: "id" "level" "counts"; }
  .profile[data-tab="path"] .pf-stats { flex-wrap: nowrap; gap: 6px; }
  .profile[data-tab="path"] .pf-stats .pf-lang { display: inline-flex; margin-right: auto; }
  .profile[data-tab="path"] .pf-level { display: flex; align-items: center; gap: 12px; padding: 0 4px; background: none; box-shadow: none; }
  .profile[data-tab="path"] .pf-level-say { display: contents; }
  .profile[data-tab="path"] .pf-level-say b { order: 0; flex: none; font: 600 13.5px/1 var(--font); color: var(--ink-2); }
  .profile[data-tab="path"] .pf-level-bar { order: 1; flex: 1; min-width: 0; }
  .profile[data-tab="path"] .pf-level-say .muted { order: 2; flex: none; font-size: 12.5px; }

  /* Me: the person in the middle, the app's Me tab. */
  .profile[data-tab="me"] .pf-id { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 10px; padding-top: 6px; }
  .profile[data-tab="me"] .pf-id .acc-avatar.big { width: 84px; height: 84px; font-size: 36px; }
  .profile[data-tab="me"] .pf-who { justify-items: center; }
  .profile[data-tab="me"] .pf-pair { justify-content: center; }
  .profile[data-tab="me"] .pf-tags { justify-content: center; }
}

/* =====================================================================
   the first minute of an account (onboarding)
   ===================================================================== */

.ob.card { width: min(560px, 100%); margin: min(5vh, 40px) auto; gap: 18px; padding: 24px 22px 22px; border-radius: var(--au-r-hero); }
.ob-top { grid-template-columns: 38px 1fr auto; }
.ob-back.btn.icon { width: 38px; height: 38px; }
.ob-back.btn.icon .i { width: 18px; height: 18px; }
.ob-dots { gap: 6px; }
.ob-dots span { width: 22px; height: 4px; background: var(--line-hi); }
.ob-dots span.on { background: var(--au-teal); box-shadow: 0 0 8px color-mix(in srgb, var(--au-teal) 55%, transparent); }
.ob-count { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ob-step { gap: 14px; }
.ob-step h1 { font: 700 clamp(26px, 6.6vw, 30px)/1.1 var(--display); letter-spacing: -0.02em; }
.ob-step > p { margin: -6px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.ob-first { justify-items: stretch; }
.ob-first .ob-art { justify-self: center; margin-bottom: -4px; }
.ob-first h1 { text-align: center; }
.ob-first > p { text-align: center; }
.ob .field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ob-name.input { font-size: 17px; min-height: 52px; }
.ob .btn.brand.big { width: 100%; justify-content: center; gap: 8px; }
.ob .btn.brand.big .i { width: 18px; height: 18px; }

/* The choices: glass tiles; the chosen one rings teal and glows. */
.ob-goal {
  gap: 3px; padding: 16px 8px 14px; border: 0; border-radius: var(--au-r-mission);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
  transition: box-shadow var(--dur-2), background var(--dur-2), transform var(--dur-1) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .ob-goal:hover { background: linear-gradient(var(--au-glass-hi) 0 0), linear-gradient(var(--au-glass-base) 0 0); } }
.ob-goal:active { transform: scale(0.98); }
.ob-goal:has(input:checked) {
  background: linear-gradient(color-mix(in srgb, var(--au-teal) 14%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 2px var(--au-teal), 0 0 18px -4px color-mix(in srgb, var(--au-teal) 60%, transparent);
}
.ob-goal:has(input:focus-visible) { outline: 2px solid var(--au-teal); }
.ob-goal-n { font: 700 28px/1 var(--display); letter-spacing: -0.02em; }
.ob-goal:has(input:checked) .ob-goal-n { color: var(--au-teal); }
.ob-goal-l { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.ob-goal-h { font-size: 11.5px; line-height: 1.3; color: var(--muted); }

.ob-ready { gap: 10px; }
.ob-ready-row {
  grid-template-columns: 44px 1fr; align-items: center; padding: 12px 14px 12px 12px; border-radius: var(--au-r-mission);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.ob-ready-row b { font: 600 16px/1.2 var(--display); }
.ob-ready-row .muted { font-size: 12.5px; line-height: 1.4; }
/* Glass discs with the hue as a glow, never as a fill. */
.ob-ready .pf-do-i, .pf-do-i {
  width: 44px; height: 44px; border-radius: 50%; color: var(--ink);
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--hue, var(--au-teal)) 45%, transparent), transparent 72%), var(--au-glass-flat);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.pf-do-i.lesson { --hue: #ff9a4d; color: var(--ink); }
.pf-do-i.friends { --hue: var(--au-violet); color: var(--ink); }
.pf-do-i.deck { --hue: var(--au-teal); color: var(--ink); }
.pf-do-i .i { width: 20px; height: 20px; }

/* =====================================================================
   who I am (.pf-head): the phone's header pills and its Me tab
   ===================================================================== */

.pf-head {
  display: grid; gap: 14px; padding: 0; border: 0; border-radius: 0; background: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "id" "stats" "level" "counts";
}
.pf-id { grid-area: id; grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
.pf-stats { grid-area: stats; }
.pf-level { grid-area: level; }
.pf-counts { grid-area: counts; }

/* The initial in a navy disc with a teal-to-violet ring (the phone's avatar). */
.pf-id .acc-avatar.big {
  width: 60px; height: 60px; border-radius: 50%; border: 3px solid transparent;
  background: linear-gradient(160deg, #1c4b8c, #0e2248) padding-box, linear-gradient(135deg, var(--au-teal), var(--au-violet)) border-box;
  color: #f3f7ff; font: 700 26px/1 var(--display);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}
.pf-head h1 { font: 700 clamp(28px, 7vw, 34px)/1.05 var(--display); letter-spacing: -0.025em; }
.pf-who { display: grid; gap: 6px; justify-items: start; }
.pf-pair { margin: 0; gap: 8px; flex-wrap: nowrap; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.pf-pair > span:last-child { min-width: 0; }
.pf-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.pf-head .pf-change { display: inline-flex; align-items: center; gap: 5px; padding: 4px 2px; font-size: 13.5px; white-space: nowrap; }
.pf-head .pf-change .i { width: 14px; height: 14px; }
.pf-pair svg { width: 22px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(var(--fg) / 0.14); }
.pf-head .link-btn { color: var(--au-teal); text-decoration: none; font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .pf-head .link-btn:hover { text-decoration: underline; } }
:root[data-theme="light"] .pf-head .link-btn { color: #0b8a78; }
.pf-cefr {
  margin: 0; min-height: 32px; padding: 4px 13px; border: 0; border-radius: 999px;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
  color: var(--ink); font-size: 13.5px; font-weight: 700;
}
.pf-cefr b { font: 700 14px/1 var(--display); color: var(--au-teal); }
.pf-cefr.ask { color: var(--brand-3); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--au-brand) 70%, transparent); }
.pf-cefr .i { width: 15px; height: 15px; }
@media (hover: hover) and (pointer: fine) { .pf-cefr:hover { background: linear-gradient(var(--au-glass-hi) 0 0), linear-gradient(var(--au-glass-base) 0 0); } }
:root[data-theme="light"] .pf-cefr b { color: #0b8a78; }

/* Streak, XP, the level ring (and, on a phone's Learn tab, the language). */
.pf-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-stats .pf-lang { display: none; align-items: center; gap: 7px; min-width: 0; padding-right: 10px; border: 0; cursor: pointer; font: 600 15px/1 var(--display); color: var(--ink); }
.pf-stats .pf-lang svg { width: 22px; height: 16px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgb(var(--fg) / 0.14); }
.pf-stats .pf-lang .pf-lang-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-stats .pf-lang > span:last-child .i { width: 15px; height: 15px; color: var(--muted); }
.pf-stats .au-stat .pic { width: 22px; height: 22px; }
.pf-ring.au-ring { --s: 42px; }

/* The level, as a bar on glass. */
.pf-level {
  display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.pf-level-say { font-size: 12.5px; }
.pf-level-say b { font: 600 15px/1.2 var(--display); }
.pf-level-say .muted { font-weight: 600; font-variant-numeric: tabular-nums; }

/* The counts: glass tiles, a big Outfit numeral over its picture and name. */
.pf-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; background: none; border-radius: 0; overflow: visible; }
.pf-counts > .pf-count {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 12px 14px 13px; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.pf-counts dd { margin: 0; font: 700 26px/1 var(--display); letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pf-counts dt { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--muted); }
.pf-counts .pf-count.warm dt { color: var(--muted); }
.pf-counts .pf-count.warm dd { color: var(--ink); }
.pf-count-pic { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.pf-count-pic .pic { width: 20px; height: 20px; }
.pf-count-pic .i { width: 16px; height: 16px; color: var(--au-teal); }

/* Above a phone the streak is already in the pills: three counts, not four. */
@media (min-width: 481px) {
  .pf-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-counts > .pf-count.streak { display: none; }
  /* One glass strip with hairlines between the counts, not three tiles. */
  .pf-counts {
    gap: 0; padding: 4px 0; border-radius: var(--au-r-mission);
    background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
  }
  .pf-counts > .pf-count { justify-content: center; padding: 10px 16px; border-radius: 0; background: none; box-shadow: none; }
  .pf-counts > .pf-count:not(.streak) ~ .pf-count:not(.streak) { box-shadow: inset 1px 0 0 var(--line); }
  .pf-counts dt { align-items: flex-start; min-height: 2.5em; }
  .pf-count-pic { margin-top: -2px; }
}
@media (min-width: 640px) {
  .pf-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id stats" "level level" "counts counts"; align-items: center; column-gap: 24px; }
  .pf-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-ring.au-ring { --s: 48px; }
  .pf-stats { justify-content: flex-end; }
}
@media (min-width: 1024px) {
  /* The same two tracks and gap as the dashboard under it (.au-split):
     the level over the path, the counts over the deck. */
  .pf-head { grid-template-areas: "id stats" "level counts"; grid-template-columns: minmax(0, 1fr) var(--side); column-gap: 24px; row-gap: 18px; }
  .pf-id .acc-avatar.big { width: 72px; height: 72px; font-size: 30px; }
  .pf-level { align-self: stretch; align-content: center; padding: 16px 20px; }
}

/* An open room, the edit form: glass cards. */
.pf-edit.card { gap: 16px; border-radius: var(--au-r-card); }
/* Above a phone "I speak" and "I want to learn" are one component: the
   same equal tracks (four to a row in a narrow card, seven from 900px, so
   fourteen take two rows), the same 60px option with a flag over its label, so each
   option sits exactly over the one below it, as the level grid's columns
   do. The speak buttons carry only a code, so their flag is drawn here
   (the same artwork as FLAG_SVG in client/ui.ts). */
@media (min-width: 481px) {
  .pf-edit .field .seg {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto;
    gap: 4px; width: 100%; min-width: 0;
  }
  .pf-edit .field .seg > :is(button, .seg-opt) {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    min-width: 0; min-height: 60px; padding: 9px 6px 12px;
    font: 700 15px/1.25 var(--font); letter-spacing: 0; text-align: center;
  }
  .pf-edit .field .seg > :is(button, .seg-opt) > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pf-edit .field .seg .flag { flex: none; width: 22px; height: 15px; border-radius: 3px; }
  .pf-edit .ui-seg > button { letter-spacing: 0.04em; }
  .pf-edit .ui-seg > button::before {
    content: ''; flex: none; width: 22px; height: 15px; border-radius: 3px;
    background: center / 100% 100% no-repeat; box-shadow: 0 0 0 1px rgb(var(--fg) / 0.14);
  }
  .pf-edit .ui-seg [data-lang="es"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23c60b1e'/><rect y='5' width='30' height='10' fill='%23ffc400'/></svg>"); }
  .pf-edit .ui-seg [data-lang="en"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40' preserveAspectRatio='none'><rect width='60' height='40' fill='%23012169'/><path d='M0 0L60 40M60 0L0 40' stroke='%23fff' stroke-width='8'/><path d='M0 0L60 40M60 0L0 40' stroke='%23c8102e' stroke-width='3'/><path d='M30 0V40M0 20H60' stroke='%23fff' stroke-width='12'/><path d='M30 0V40M0 20H60' stroke='%23c8102e' stroke-width='7'/></svg>"); }
  .pf-edit .ui-seg [data-lang="ru"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23fff'/><rect y='6.67' width='30' height='6.67' fill='%230039a6'/><rect y='13.33' width='30' height='6.67' fill='%23d52b1e'/></svg>"); }
  .pf-edit .ui-seg [data-lang="zh"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23de2910'/><path fill='%23ffde00' d='M5 2.2l.9 2.8h2.9l-2.4 1.7.9 2.8L5 7.8 2.6 9.5l.9-2.8L1.1 5h2.9z'/><circle cx='10' cy='2.4' r='.8' fill='%23ffde00'/><circle cx='12' cy='4.4' r='.8' fill='%23ffde00'/><circle cx='12' cy='7.2' r='.8' fill='%23ffde00'/><circle cx='10' cy='9.2' r='.8' fill='%23ffde00'/></svg>"); }
  .pf-edit .ui-seg [data-lang="it"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='10' height='20' fill='%23009246'/><rect x='10' width='10' height='20' fill='%23fff'/><rect x='20' width='10' height='20' fill='%23ce2b37'/></svg>"); }
  .pf-edit .ui-seg [data-lang="de"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='6.67' fill='%23000'/><rect y='6.67' width='30' height='6.67' fill='%23dd0000'/><rect y='13.33' width='30' height='6.67' fill='%23ffce00'/></svg>"); }
  .pf-edit .ui-seg [data-lang="ja"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23fff'/><circle cx='15' cy='10' r='6' fill='%23bc002d'/></svg>"); }
  .pf-edit .ui-seg [data-lang="sv"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23006aa7'/><rect x='9.4' width='3.8' height='20' fill='%23fecc02'/><rect y='8' width='30' height='4' fill='%23fecc02'/></svg>"); }
  .pf-edit .ui-seg [data-lang="no"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23ba0c2f'/><rect x='8.18' width='5.45' height='20' fill='%23fff'/><rect y='7.5' width='30' height='5' fill='%23fff'/><rect x='9.55' width='2.73' height='20' fill='%2300205b'/><rect y='8.75' width='30' height='2.5' fill='%2300205b'/></svg>"); }
  .pf-edit .ui-seg [data-lang="lv"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%239e3039'/><rect y='8' width='30' height='4' fill='%23fff'/></svg>"); }
  .pf-edit .ui-seg [data-lang="kk"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%2300afca'/><circle cx='16' cy='8.6' r='3.4' fill='%23fec50c'/><path d='M10.5 14.2q5.5-2.6 11 0l-1 1.1q-4.5-1.9-9 0z' fill='%23fec50c'/><rect x='2.2' y='2' width='1.2' height='16' fill='%23fec50c'/></svg>"); }
  .pf-edit .ui-seg [data-lang="be"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23c8313e'/><rect y='13.3' width='30' height='6.7' fill='%234aa657'/><rect width='3.3' height='20' fill='%23fff'/><path d='M1.65 1l1 1.5-1 1.5-1-1.5zM1.65 6l1 1.5-1 1.5-1-1.5zM1.65 11l1 1.5-1 1.5-1-1.5zM1.65 16l1 1.5-1 1.5-1-1.5z' fill='%23c8313e'/></svg>"); }
  .pf-edit .ui-seg [data-lang="ka"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='30' height='20' fill='%23fff'/><rect x='12.6' width='4.8' height='20' fill='%23e8112d'/><rect y='7.6' width='30' height='4.8' fill='%23e8112d'/><path fill='%23e8112d' d='M5.2 2.2h1.1v1.4h1.4v1.1H6.3v1.4H5.2V4.7H3.8V3.6h1.4zM23.7 2.2h1.1v1.4h1.4v1.1h-1.4v1.4h-1.1V4.7h-1.4V3.6h1.4zM5.2 13.9h1.1v1.4h1.4v1.1H6.3v1.4H5.2v-1.4H3.8v-1.1h1.4zM23.7 13.9h1.1v1.4h1.4v1.1h-1.4v1.4h-1.1v-1.4h-1.4v-1.1h1.4z'/></svg>"); }
  .pf-edit .ui-seg [data-lang="fr"]::before { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'><rect width='10' height='20' fill='%23002654'/><rect x='10' width='10' height='20' fill='%23fff'/><rect x='20' width='10' height='20' fill='%23ce1126'/></svg>"); }
}
@media (min-width: 900px) {
  .pf-edit .field .seg { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.pf-open.card {
  border: 0;
  background-image: radial-gradient(160px 140px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-brand) 30%, transparent), transparent 72%), var(--au-glass);
}
.pf-open-say h2 { display: flex; align-items: center; gap: 8px; font: 600 17px/1.2 var(--display); }
.pf-open-say h2 .i { width: 18px; height: 18px; color: var(--brand-3); }
.pf-open-code { font: 700 20px/1 var(--display); letter-spacing: 0.22em; border: 0; background: var(--au-field); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-hi); }
.pf-open .link-btn { color: var(--muted); text-decoration: none; }

/* =====================================================================
   the learning path (web/profile/path.tsx): the Learn tab
   ===================================================================== */

.pf-path { --pth-lip: var(--au-bg0); display: grid; gap: 16px; }
.pf-path.card { border-radius: var(--au-r-hero); }
.pth-skel.card {
  min-height: 380px; border: 0;
  background: linear-gradient(100deg, var(--au-glass-flat) 30%, var(--au-glass-hi) 50%, var(--au-glass-flat) 70%) 0 0 / 300% 100%, linear-gradient(var(--au-glass-base) 0 0);
}

/* The head: the language's flag, the path's name, what it has given, and
   the way to practise what has been seen. */
.pth-head { gap: 12px; align-items: center; }
.pth-head .pf-h { margin: 0 0 4px; }
.pth-flag { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 2px var(--line-hi), 0 8px 16px -8px rgba(0, 0, 0, 0.55); }
.pth-head-n { gap: 12px; }
.pth-chip { gap: 5px; padding: 0; border-radius: 0; background: none; font-size: 12px; font-weight: 700; color: var(--muted); }
.pth-chip .i { width: 13px; height: 13px; color: var(--au-teal); }
.pth-chip.xp { background: none; color: var(--muted); }
.pth-chip.xp .i { color: var(--au-gold); }
.pth-review.btn .i { width: 15px; height: 15px; }
.pth-head .pth-review.btn { align-self: center; min-height: 36px; }
/* A phone: the button is its icon alone, in a round 3D button. */
@media (max-width: 560px) {
  .pth-head { flex-wrap: nowrap; }
  .pth-head .pth-review-l { display: none; }
  .pth-head .pth-review.btn.small { order: 0; flex: none; width: 42px; height: 42px; min-height: 0; padding: 0; display: grid; place-items: center; border-radius: 50%; --lip: 3px; }
  .pth-head .pth-review.btn .i { width: 19px; height: 19px; }
}
:root[data-theme="light"] .pf-path .pth-chip.xp .i { color: #c98a00; }

/* ---------- the NowCard: the one hero of the path ---------- */

.pth-now.au-hero {
  --pth-lip: #040a19;
  display: grid; gap: 14px; padding: 22px 20px 20px; overflow: visible; color: var(--ink);
  border-radius: var(--au-r-hero);
}
.pth-now.au-hero.all-done { display: flex; align-items: center; gap: 14px; font: 700 20px/1.25 var(--display); }
.pth-now.all-done .pth-now-icon { width: 34px; height: 34px; background: none; border-radius: 0; }
.pth-now.all-done .pth-now-icon .pic { width: 34px; height: 34px; }

/* The unit's picture, tilted, wholly inside the card's top-right corner,
   over a soft moon and a glow of the unit's colour. */
.pth-now-art { position: absolute; top: 10px; right: 10px; z-index: 0; width: 120px; height: 120px; display: grid; place-items: center; pointer-events: none; }
.pth-now-art::before {
  content: ''; position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--hue, var(--au-teal)) 40%, transparent), transparent);
}
.pth-now-art::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: radial-gradient(closest-side, rgba(243, 247, 255, 0.18), transparent); }
.pth-now-art .pth-art { position: relative; z-index: 1; width: 100px; height: 100px; transform: rotate(-8deg); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
.pth-now-art > .i { position: relative; z-index: 1; width: 72px; height: 72px; color: var(--ink-2); transform: rotate(-8deg); }
.pth-now-top { position: relative; z-index: 1; display: block; min-height: 92px; padding-right: 118px; }
.pth-now-t { display: grid; gap: 5px; }
.pth-now-t small.au-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; opacity: 1; color: var(--au-teal); }
.pth-now-t b { font: 700 var(--au-fs-hero)/1.1 var(--display); letter-spacing: -0.02em; overflow-wrap: break-word; }
.pth-now-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pth-now .pth-stars.au-stars > i { width: 16px; height: 16px; }
.pf-path .pth-stars.au-stars > i:not(.on) { background: rgb(var(--fg) / 0.35); }
.pf-path .pth-go.btn.brand.big {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 15px 22px; font: 700 17px/1.2 var(--font); letter-spacing: 0; text-transform: none;
}
.pf-path .pth-go .i { width: 20px; height: 20px; }

/* Polar day: a soft blue shadow, not a dark smear under the card. */
:root[data-theme="light"] .pth-now.au-hero { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 28px -18px rgba(30, 70, 130, 0.3); }
/* Polar day: the hero is not a night-navy slab on a white page but a vivid
   blue-to-violet island, the deck card's sibling (white ink still reads). */
:root[data-theme="light"] :is(.pth-now, .dr-ask-card, .dr-intro-card, .rv-q:not(.retry)).au-hero {
  --pth-lip: #1d2f86;
  background:
    radial-gradient(320px 260px at calc(100% + 40px) -30px, rgba(90, 240, 212, 0.38), transparent 70%),
    radial-gradient(260px 220px at -40px calc(100% + 30px), rgba(169, 150, 255, 0.45), transparent 70%),
    linear-gradient(150deg, #2f6fdc, #3d55d8 55%, #5b47e8);
}
:root[data-theme="light"] .pth-now .pth-now-t small.au-eyebrow { color: #b9fff1; }

/* ---------- a trail: the steps of a unit ---------- */

/* Six 3D beads on a thin track that turns teal as they are done; a label
   under each. --top leaves room above for the perched penguin. */
.pf-path .pth-trail {
  --bead: 42px; --top: 4px;
  position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 0;
  padding: var(--top) 0 0; background: none; border-radius: 0;
}
.pf-path .pth-trail.perch { --top: 44px; }
.pf-path .pth-trail::before { content: none; }
.pf-path .pth-trail > .pth-track,
.pf-path .pth-trail > .pth-fill {
  position: absolute; left: calc(50% / var(--n, 6)); right: auto; width: calc(100% - 100% / var(--n, 6));
  top: calc(var(--top) + var(--bead) / 2 - 1.5px); height: 3px; border-radius: 2px; pointer-events: none;
}
.pf-path .pth-trail > .pth-track { background: color-mix(in srgb, var(--muted) 38%, transparent); }
.pf-path .pth-trail > .pth-fill { background: var(--au-teal); transform-origin: left center; transform: scaleX(var(--p, 0)); box-shadow: 0 0 8px color-mix(in srgb, var(--au-teal) 50%, transparent); }

.pf-path .pth-node { position: static; z-index: auto; flex: 1 1 0; min-width: 0; display: grid; justify-items: center; align-content: start; gap: 7px; }
.pth-bead { position: relative; z-index: 1; display: block; width: var(--bead); height: calc(var(--bead) + 3px); }

/* A bead: a gradient face on a 3px lip. Ahead: dim glass; done: teal;
   next: orange with a glowing halo. */
.pf-path .pth-step {
  --lip: 3px; --lip-c: var(--pth-lip);
  position: relative; width: var(--bead); height: var(--bead); padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  background-color: var(--panel-solid);
  background-image: linear-gradient(180deg, rgb(var(--fg) / 0.12), rgb(var(--fg) / 0.05));
  box-shadow: 0 var(--lip) 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), filter var(--dur-2);
}
.au-hero .pth-step { background-color: #1a2f5c; }
.pf-path .pth-step:not(.done):not(.now) { color: var(--ink-2); background-color: var(--panel-solid); box-shadow: 0 var(--lip) 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); }
.pf-path .au-hero .pth-step:not(.done):not(.now) { background-color: #1a2f5c; }
.pf-path .pth-step .i { width: calc(var(--bead) * 0.44); height: calc(var(--bead) * 0.44); stroke-width: 2.2; }
.pf-path .pth-step.done {
  --lip-c: #11806d; color: #053a33;
  background-color: #22c3a6; background-image: linear-gradient(180deg, #5af0d4, #22c3a6);
  box-shadow: 0 var(--lip) 0 var(--lip-c), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.pf-path .pth-step.now {
  --lip-c: #c24f05; color: #fff;
  background-color: #ff7a1a; background-image: linear-gradient(180deg, #ffa04d, #ff7a1a);
  box-shadow: 0 var(--lip) 0 var(--lip-c), var(--au-node-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.pf-path .pth-step.now::after {
  content: ''; position: absolute; inset: -6px; border: 2px solid rgba(255, 122, 26, 0.45); border-radius: 50%;
  animation: pth-halo 1.8s ease-in-out infinite; pointer-events: none;
}
.pf-path .pth-step.final:not(.done) { border-radius: 50%; }
.pf-path .pth-step.asking { outline: 2px solid var(--au-teal); outline-offset: 4px; }
.pf-path .pth-step:disabled { cursor: not-allowed; opacity: 0.6; }
@media (hover: hover) and (pointer: fine) { .pf-path .pth-step:hover:not(:disabled) { transform: none; filter: brightness(1.1); } }
.pf-path .pth-step:active:not(:disabled) { --lip: 1px; transform: translateY(2px); }

.pf-path .pth-step-l {
  max-width: 100%; padding: 0 3px; font-size: 10.5px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em;
  color: var(--ink-2); text-align: center; overflow-wrap: break-word; hyphens: auto;
}
.pf-path .pth-node.done .pth-step-l { color: var(--au-teal); }
.pf-path .pth-node.now .pth-step-l { color: #ffb066; font-weight: 800; }
@media (min-width: 1024px) {
  .pf-path .pth-trail { --bead: 46px; }
  .pf-path .pth-step-l { font-size: 12.5px; }
}
/* A phone: the trail takes the card's padding too, so six labels never touch. */
@media (max-width: 480px) {
  .pth-now .pth-trail { margin: 0 -12px; }
  .pf-path .pth-step-l { padding: 0 1px; font-size: 10px; letter-spacing: -0.02em; }
}
:root[data-theme="light"] .pf-path .pth-row-body .pth-node.done .pth-step-l { color: #0b8a78; }

/* "You are here": the little penguin stands on the next bead. */
.pth-bead > .pth-perch { position: absolute; left: 50%; bottom: calc(100% - 2px); z-index: 2; transform: translateX(-50%); pointer-events: none; }

/* The unit's chest (+30 XP): a small gold badge on the last bead. */
.pf-path .pth-chest {
  position: absolute; top: -5px; right: -6px; z-index: 2; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; color: var(--au-gold);
  background: var(--panel-solid); box-shadow: inset 0 0 0 1px rgba(255, 201, 77, 0.55);
}
.au-hero .pth-chest { background: #1d3566; }
.pf-path .pth-chest.open { box-shadow: inset 0 0 0 1px var(--au-gold), 0 0 12px 2px rgba(255, 201, 77, 0.55); }
.pf-path .pth-chest-i { display: grid; place-items: center; width: auto; height: auto; }
.pf-path .pth-chest .i { width: 10px; height: 10px; }
:root[data-theme="light"] .pf-path .pth-row-body .pth-chest { color: #c98a00; }

/* Alone or with somebody: a sheet under the trail, over what follows it
   (the hero isolates its own layers, so it is lifted while the sheet is open). */
.pth-now.au-hero:has(.pth-ask), .pf-path .pth-trail:has(.pth-ask) { z-index: 30; }
.pf-path .pth-ask {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 20; width: auto; max-width: 440px; margin: 0 auto;
  display: grid; gap: 8px; padding: 14px; border: 0; border-radius: 22px; text-align: left; color: var(--ink);
  background: var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 24px 50px -18px rgba(0, 0, 0, 0.65);
}
.au-hero .pth-ask { background: linear-gradient(180deg, #17336a, #0b1c42); }
.pf-path .pth-ask > b { font: 600 16px/1.25 var(--display); padding: 2px 4px 4px; }
.pf-path .pth-ask-o {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border: 0; border-radius: var(--au-r-mission);
  background: var(--au-glass-flat); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
  color: var(--ink); text-align: left; cursor: pointer; transition: background var(--dur-2);
}
@media (hover: hover) and (pointer: fine) { .pf-path .pth-ask-o:hover { border: 0; background: var(--au-glass-hi); } }
.pf-path .pth-ask-o > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pf-path .pth-ask-o b { font: 600 14.5px/1.2 var(--display); }
.pf-path .pth-ask-o small { font-size: 12px; line-height: 1.35; }
.pth-ask-i {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--ink);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--hue, var(--au-teal)) 55%, transparent), transparent), var(--au-glass-flat);
}
.pth-ask-i.duo { --hue: var(--au-violet); }
.pth-ask-i .i { width: 19px; height: 19px; }
.pf-path .pth-ask-o > .pth-ask-go { flex: none; width: 18px; height: 18px; color: var(--muted); }

/* ---------- the levels: a segmented control ---------- */

.pf-path .pth-tabs.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 4px; width: 100%; }
.pf-path .pth-tab {
  display: grid; justify-items: stretch; align-content: center; gap: 6px; min-height: 48px; padding: 8px 10px 9px;
  border: 0; border-radius: var(--au-r-seg-in); background: transparent; color: var(--muted); text-align: center; cursor: pointer;
}
.pf-path .pth-tab b { font: 600 15px/1 var(--display); letter-spacing: -0.01em; }
.pf-path .pth-tab.on { color: var(--ink); }
.pf-path .pth-tab.on::after { content: none; }
@media (hover: hover) and (pointer: fine) { .pf-path .pth-tab:not(.on):hover { background: var(--au-glass-flat); border-color: transparent; } }
.pf-path .pth-tab-bar.au-progress { grid-column: auto; height: 3px; margin: 0 4px; background: color-mix(in srgb, var(--muted) 20%, transparent); }
.pf-path .pth-tab.on .pth-tab-bar { background: color-mix(in srgb, var(--muted) 30%, transparent); }
.pf-path .pth-tab-bar > span { min-width: 6px; }

/* ---------- the units: bare rows on one rail ---------- */

.pf-path .pth-units { gap: 4px; }
.pf-path .pth-row { position: relative; border: 0; border-radius: var(--au-r-mission); background: none; box-shadow: none; }
.pf-path .pth-row.current, .pf-path .pth-row.open { border: 0; background: none; box-shadow: none; }
/* The rail: from this disc's centre to the next one's, behind both. */
.pf-path .pth-row:not(:last-child):not(.open)::before {
  content: ''; position: absolute; left: 26px; top: 29px; bottom: -33px; width: 2px; border-radius: 1px;
  background: color-mix(in srgb, var(--muted) 32%, transparent);
}
.pf-path .pth-row.full:not(:last-child):not(.open)::before { background: color-mix(in srgb, var(--au-teal) 80%, transparent); }
.pf-path .pth-row-head { gap: 12px; min-height: 58px; padding: 6px 8px 6px 4px; border-radius: var(--au-r-mission); transition: background var(--dur-2); }
@media (hover: hover) and (pointer: fine) {
  .pf-path .pth-row-head:hover { background: var(--au-glass-flat); }
  .pf-path .pth-row-head:hover .pth-row-t b { color: var(--ink); }
}
.pf-path .pth-row .pth-row-icon {
  position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; color: var(--ink);
  background: var(--panel-solid);
  box-shadow: inset 0 1px 0 var(--au-highlight), 0 0 0 1px var(--au-edge), 0 0 22px 3px color-mix(in srgb, var(--hue, var(--au-teal)) 38%, transparent);
}
.pf-path .pth-row.current .pth-row-icon {
  box-shadow: inset 0 0 0 2.5px rgba(255, 122, 26, 0.7), 0 0 24px 4px rgba(255, 122, 26, 0.45);
}
.pf-path .pth-row.full .pth-row-icon { background: var(--panel-solid); color: var(--ink); }
.pf-path .pth-row.locked .pth-row-icon { background: var(--panel-solid); color: var(--muted); box-shadow: inset 0 1px 0 var(--au-highlight), 0 0 0 1px var(--au-edge), 0 0 18px 1px color-mix(in srgb, var(--hue, var(--au-teal)) 14%, transparent); }
.pf-path .pth-row.locked .pth-row-icon > :not(.pth-row-ok) { opacity: 0.6; }
.pf-path .pth-row-icon .pth-art { width: 28px; height: 28px; }
.pf-path .pth-row-icon > .i { width: 22px; height: 22px; }
.pth-row-ok { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--au-teal); color: var(--au-on-teal); box-shadow: 0 0 0 2px var(--au-bg1); }
.pth-row-ok .i { width: 11px; height: 11px; stroke-width: 3; }
.pf-path .pth-row-t { gap: 3px; }
.pf-path .pth-row-t b { font: 600 16px/1.2 var(--display); letter-spacing: -0.01em; }
.pf-path .pth-row.locked .pth-row-t b { color: var(--ink-2); }
:root[data-theme="light"] .pf-path .pth-row.locked .pth-row-t b { color: var(--ink); }
:root[data-theme="light"] .pf-path .pth-row.locked .pth-row-icon > :not(.pth-row-ok) { opacity: 0.8; }
.pf-path .pth-row-t small { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-path .pth-here { color: var(--brand-3); font-weight: 700; }
.pf-path .pth-row .pth-stars.au-stars { gap: 2px; }
.pf-path .pth-row .pth-stars.au-stars > i { width: 13px; height: 13px; }
.pf-path .pth-row-lock { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pf-path .pth-row-chev { width: 18px; height: 18px; color: var(--muted); }

/* An open unit: its trail in a glass panel with the unit's glow. */
.pf-path .pth-row-body {
  display: grid; gap: 14px; margin: 6px 0 8px; padding: 14px 12px 14px; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base);
  background-image: radial-gradient(100px 100px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) 32%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.pf-path .pth-row-body .pth-trail { --top: 6px; padding-top: var(--top); }
.pf-path .pth-locked { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pf-path .pth-again { justify-self: center; }

/* ---------- chapters (the syllabus's): a header that folds its units ---------- */

.pf-path .pth-chapters { display: grid; gap: 10px; }
.pf-path .pth-chap { display: grid; gap: 6px; }
.pf-path .pth-chap-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 10px; row-gap: 9px;
  width: 100%; padding: 12px 12px 11px 14px; border: 0; border-radius: var(--au-r-mission); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.pf-path .pth-chap-t { display: grid; gap: 3px; min-width: 0; }
.pf-path .pth-chap-t b { font: 600 16px/1.2 var(--display); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-path .pth-chap-n { font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-path .pth-chap.won .pth-chap-n { color: var(--au-teal); }
.pf-path .pth-chap-bar.au-progress { grid-column: 1 / -1; height: 3px; background: color-mix(in srgb, var(--muted) 20%, transparent); }
.pf-path .pth-chap-bar > span { min-width: 6px; }
@media (hover: hover) and (pointer: fine) { .pf-path .pth-chap-head:hover { background-color: var(--au-glass-flat); } }

/* A unit still to be written: drawn, never walked. */
.pf-path .pth-row.soon .pth-row-head { cursor: default; }
.pf-path .pth-row.soon .pth-row-icon { box-shadow: inset 0 1px 0 var(--au-highlight), 0 0 0 1px var(--au-edge); }
.pf-path .pth-row.soon .pth-row-icon > * { opacity: 0.45; filter: grayscale(0.7); }
.pf-path .pth-row.soon .pth-row-t b { color: var(--muted); }
.pf-path .pth-row.soon .pth-row-t small { color: var(--muted); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .pf-path .pth-row.soon .pth-row-head:hover { background: none; } }

/* ---------- the level's trophy ---------- */

.pf-path .pth-trophy {
  justify-content: flex-start; gap: 14px; padding: 14px; border: 0; border-radius: var(--au-r-mission); font-size: 13.5px;
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.pf-path .pth-trophy.won {
  border: 0;
  background-image: radial-gradient(120px 110px at calc(100% - 6px) 0, rgba(255, 201, 77, 0.32), transparent 72%), var(--au-glass);
}
.pth-trophy-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 201, 77, 0.15); box-shadow: inset 0 0 0 1.5px rgba(255, 201, 77, 0.55); }
.pf-path .pth-trophy-icon .i, .pf-path .pth-trophy.won .pth-trophy-icon .i { width: 22px; height: 22px; color: var(--au-gold); }
.pf-path .pth-trophy.won .pth-trophy-icon { box-shadow: inset 0 0 0 1.5px var(--au-gold), 0 0 22px 4px rgba(255, 201, 77, 0.45); }
.pf-path .pth-trophy-t { flex: 1; min-width: 0; display: grid; gap: 9px; justify-items: start; }
.pf-path .pth-trophy-t > b { font: 600 16px/1.2 var(--display); }
.pth-trophy-say { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.pth-trophy-say .muted { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pth-trophy-bar.au-progress { width: 100%; background: rgb(var(--fg) / 0.08); }
.pth-trophy-bar > span { background: var(--au-gold); }
:root[data-theme="light"] .pf-path .pth-trophy-icon .i { color: #d99a00; }

/* ---------- alone or with friends, said once, quietly ---------- */

.pf-path .pth-how { gap: 10px; }
.pf-path .pth-how-i {
  align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border: 0; border-radius: var(--au-r-mission);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.pf-path .pth-how-i b { font: 600 14.5px/1.2 var(--display); }
.pf-path .pth-how-i small { font-size: 12px; line-height: 1.4; }
.pf-path .pth-how-icon { width: 38px; height: 38px; border-radius: 50%; color: var(--ink); background: radial-gradient(closest-side, color-mix(in srgb, var(--hue) 50%, transparent), transparent), var(--au-glass-flat); }
.pf-path .pth-how-icon.solo { --hue: #ff9a4d; }
.pf-path .pth-how-icon.duo { --hue: var(--au-violet); }

@media (max-width: 380px) {
  .pf-path .pth-trail { --bead: 36px; }
  .pf-path .pth-step-l { font-size: 9.5px; }
  .pth-now-art { width: 96px; height: 96px; }
  .pth-now-art .pth-art { width: 80px; height: 80px; }
  .pth-now-top { padding-right: 96px; }
}

/* =====================================================================
   Play: the room hero and the games
   ===================================================================== */

.pf-play { display: grid; gap: 22px; }
.pf-play .pf-room.au-hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 20px 20px; border: 0;
}
.pf-room-say { display: flow-root; }
.pf-room-say > b { display: block; font: 700 var(--au-fs-hero-sm)/1.08 var(--display); letter-spacing: -0.02em; }
.pf-room-say > .muted { display: block; margin-top: 8px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }

/* Three penguins on an ice floe, top right; the words wrap round them. */
.pf-floe { float: right; position: relative; width: 132px; height: 94px; margin: -8px -6px 6px 10px; pointer-events: none; }
.pf-floe-ice {
  position: absolute; left: 2px; right: 2px; bottom: 2px; height: 26px; border-radius: 50%;
  background: var(--au-ice); box-shadow: 0 0 28px rgba(140, 200, 255, 0.45), inset 0 -4px 6px rgba(40, 90, 150, 0.35);
}
.pf-floe > .penguin { position: absolute; bottom: 13px; }
.pf-floe > .pf-floe-a { left: 12px; }
.pf-floe > .pf-floe-b { left: 41px; z-index: 1; bottom: 11px; }
.pf-floe > .pf-floe-c { right: 12px; }

.pf-play .pf-room-do { display: grid; gap: 14px; align-items: center; }
.pf-play .pf-room-go { width: 100%; justify-content: center; gap: 10px; }
.pf-play .pf-room-go .i { width: 20px; height: 20px; }
.pf-play .pf-room-or {
  display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-2);
}
.pf-play .pf-room-or::before, .pf-play .pf-room-or::after { content: ''; flex: 1; height: 1px; background: var(--line-hi); }
.pf-play .pf-room .join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: auto; flex: none; }
/* The room code: four recessed boxes under one real input, as on the home
   page (a monospaced code spaced to land one letter in each box). */
.pf-room .code-boxes {
  position: relative; min-width: 0; height: 52px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  container-type: inline-size; overflow: hidden; border-radius: var(--au-r-small);
}
.pf-room .code-box {
  border-radius: var(--au-r-small); background: rgb(0 0 0 / 0.28);
  box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.3), inset 0 0 0 1px rgb(255 255 255 / 0.08);
  transition: box-shadow var(--dur-2);
}
.pf-room .code-boxes:focus-within .code-box {
  box-shadow: inset 0 2px 5px rgb(0 0 0 / 0.3), inset 0 0 0 1.5px color-mix(in srgb, var(--au-teal) 70%, transparent), 0 0 12px -3px color-mix(in srgb, var(--au-teal) 60%, transparent);
}
.pf-play .pf-room .code-boxes .code-input,
.pf-play .pf-room .code-boxes .code-input:focus,
.pf-play .pf-room .code-boxes .code-input:focus-visible {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: calc(100% + 30cqw); max-width: none; height: 100%; min-height: 0;
  margin: 0; padding: 0 0 0 calc(12.5cqw - 3px - 0.5ch); text-indent: 0;
  border: 0; border-radius: 0; outline: none; background: transparent; box-shadow: none;
  color: #f3f7ff; caret-color: var(--au-teal);
  font: 700 24px/1 ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', monospace;
  letter-spacing: calc(25cqw + 2px - 1ch); text-align: left; text-transform: uppercase;
}
/* Empty boxes until something is typed: a faint letter read as a code already there. */
.pf-play .pf-room .code-boxes .code-input::placeholder { color: transparent; }
.pf-play .pf-room .join-row .btn.violet { min-height: 52px; padding: 0 24px; border-radius: var(--au-r-small); font-size: 16px; }
@media (min-width: 720px) {
  .pf-play .pf-room-do { grid-template-columns: auto auto minmax(0, 340px); justify-content: start; gap: 16px; }
  .pf-play .pf-room-go { width: auto; justify-self: start; padding-left: 26px; padding-right: 28px; }
  .pf-play .pf-room-or::before, .pf-play .pf-room-or::after { content: none; }
  .pf-floe { width: 150px; margin-top: -10px; }
}

/* The games: glass tiles, the game's hue as a glow and a glowing dot. */
.pf-board { display: grid; gap: 12px; }
/* Three to a row left a phone 100px per game: names broke mid-word and the
   picture sat on them. Two until there is room for three or more. */
.pf-play .pf-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .pf-play .pf-games { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.pf-games .pf-game.au-tile {
  justify-items: start; min-height: 118px; padding: 12px 12px 11px; overflow: hidden; color: var(--ink); text-align: left;
}
.pf-games .pf-game::after { content: none; }
@media (hover: hover) and (pointer: fine) {
  .pf-games .pf-game.au-tile:hover { box-shadow: var(--au-shadow); }
  .pf-games .pf-game:hover .pf-game-i { transform: none; }
}
.pf-games .pf-game:focus-visible { outline: 2px solid var(--au-teal); }
.pf-games .pf-game.solo { border: 0; }
.pf-games .pf-game .au-tile-pic { width: 46px; height: 46px; }
.pf-games .pf-game-i.au-tile-pic { display: grid; place-items: center; margin: 0; border-radius: 0; background: none; box-shadow: none; color: var(--hue); }
.pf-games .pf-game-i .i { width: 32px; height: 32px; }
.pf-games .au-tile-t { position: relative; padding-right: 2px; overflow-wrap: break-word; hyphens: auto; }
.pf-games .au-tile-n { position: relative; margin: 0; }
.pf-games .au-tile-n .i { width: 13px; height: 13px; }

/* =====================================================================
   Practise: the deck hero and the rows
   ===================================================================== */

.pf-solo { display: grid; gap: 14px; }
.pf-solo-head { margin-top: 8px; }
.pf-deck { display: grid; gap: 10px; margin: 0; }

.pf-deck .pf-deck-main.au-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 18px;
  width: 100%; min-height: 214px; padding: 22px 20px 20px; border: 0; border-radius: var(--au-r-hero);
  color: #fff; text-align: left; cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
@media (hover: hover) and (pointer: fine) {
  .pf-deck .pf-deck-main.au-hero:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 26px 50px -20px rgba(91, 71, 232, 0.7); }
}
.pf-deck .pf-deck-main:active { transform: scale(0.99); }
/* A desktop at night: the deck sits beside the path's card, so it is a
   deeper indigo with a blue glow, and the orange start button stays what
   the eye lands on. (On a phone it is its tab's hero and keeps the app's
   bright day-sky gradient.) */
@media (min-width: 1024px) {
  :root:not([data-theme="light"]) .pf-deck .pf-deck-main.au-hero {
    background:
      radial-gradient(300px 240px at calc(100% + 30px) -30px, rgba(90, 184, 255, 0.34), transparent 70%),
      radial-gradient(240px 200px at -30px calc(100% + 30px), rgba(154, 131, 255, 0.28), transparent 70%),
      linear-gradient(160deg, #2c2a8a, #23367e 55%, #163a66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 22px 44px -22px rgba(60, 110, 230, 0.55);
  }
}
.pf-deck .pf-deck-main:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.pf-deck .pf-deck-t { position: relative; z-index: 1; display: grid; justify-items: start; gap: 2px; max-width: 58%; min-width: 0; }
.pf-deck .au-eyebrow { color: rgb(255 255 255 / 0.78); }
.pf-deck .pf-deck-n { display: block; margin: 8px 0 0; font: 700 var(--au-fs-numeral)/0.95 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pf-deck .pf-deck-h { display: block; margin-top: 10px; font: 700 var(--au-fs-hero-sm)/1.08 var(--display); letter-spacing: -0.02em; }
.pf-deck-say { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 14px; font-weight: 600; color: #fff; }
.pf-deck-say .i { width: 15px; height: 15px; color: #6ff2a6; }
.pf-deck-saved { font-size: 12px; font-weight: 600; color: rgb(255 255 255 / 0.75); }
.pf-deck .pf-deck-go.btn.au-light { position: relative; z-index: 1; justify-self: start; grid-column: auto; gap: 8px; padding: 12px 18px; font-size: 15px; }
.pf-deck .pf-deck-go .i { width: 17px; height: 17px; }

/* A small stack of word cards, the penguin pointing at it. */
.pf-deck-art { position: absolute; inset: 0 0 0 auto; width: 46%; pointer-events: none; }
.pf-flash {
  position: absolute; width: 96px; height: 122px; border-radius: 14px; background: #f5f7fa;
  box-shadow: 0 12px 26px -12px rgba(16, 10, 70, 0.6), inset 0 -2px 0 rgba(20, 30, 80, 0.08);
}
.pf-flash.f3 { right: 22px; top: 30px; opacity: 0.55; transform: rotate(12deg); }
.pf-flash.f2 { right: 36px; top: 26px; opacity: 0.8; transform: rotate(4deg); }
.pf-flash.f1 { right: 52px; top: 22px; display: grid; justify-items: center; align-content: center; gap: 7px; transform: rotate(-6deg); }
.pf-flash.f1 .pic { width: 30px; height: 30px; }
.pf-flash.f1 i { display: block; width: 50px; height: 6px; border-radius: 3px; background: rgba(20, 30, 70, 0.14); }
.pf-flash.f1 i + i { width: 32px; background: rgba(20, 30, 70, 0.1); }
.pf-deck-art > .pf-deck-pg { position: absolute; right: 16px; top: 100px; }

.pf-deck .pf-deck-tip {
  display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 0 6px;
  border: 0; border-radius: 0; background: none; font-size: 12.5px; line-height: 1.45; color: var(--muted);
}
.pf-deck .pf-deck-tip .i { width: 16px; height: 16px; margin-top: 1px; color: var(--au-teal); }
.pf-deck .pf-deck-tip b { color: var(--ink-2); }

/* The rest: rows in one glass card, hairlines between them. */
.pf-solo .pf-rows.au-rows { display: block; gap: 0; }
.pf-rows .pf-row.au-row { padding: 10px 4px; border-radius: 0; text-align: left; transition: none; }
@media (hover: hover) and (pointer: fine) {
  .pf-rows .pf-row.au-row:hover { border-color: var(--line-hi); background: transparent; }
  .pf-rows .pf-row:hover .au-row-t { color: var(--ink); }
}
.pf-rows .pf-row:focus-visible { outline-offset: -2px; border-radius: 12px; }
.pf-rows .pf-row-i.au-row-disc {
  color: var(--ink);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 0 20px 0 color-mix(in srgb, var(--hue, var(--au-teal)) 42%, transparent);
}
.pf-rows .au-row-t { font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; }
.pf-rows .au-row-m { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.pf-rows .pf-row-go { width: 18px; height: 18px; flex: none; color: var(--muted); }
.pf-tag {
  flex: none; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--ink-2);
  background: var(--au-glass-flat); box-shadow: inset 0 0 0 1px var(--au-edge);
}

/* =====================================================================
   today's missions
   ===================================================================== */

.pf-missions { display: grid; gap: 12px; padding: 0; border: 0; background: none; box-shadow: none; }
.pf-missions .au-section-head > .pf-mis-all { color: var(--au-teal); }
.pf-missions .mis-list { display: grid; gap: 8px; }
.pf-missions .mis {
  --hue: var(--au-violet);
  position: relative; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base);
  background-image: radial-gradient(70px 70px at calc(100% - 4px) 0, color-mix(in srgb, var(--hue) 30%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.pf-missions .mis.done { --hue: var(--au-green); }
.pf-missions .mis-icon {
  position: relative; width: 40px; height: 40px; border-radius: 50%; color: var(--ink);
  background: var(--au-glass-flat); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.pf-missions .mis.done .mis-icon { background: var(--au-glass-flat); color: var(--ink); }
.pf-missions .mis-icon .pic { width: 24px; height: 24px; }
.pf-missions .mis-icon > .i { width: 18px; height: 18px; }
.mis-ok { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: var(--au-on-teal); box-shadow: 0 0 0 2px var(--au-bg1); }
.mis-ok .i { width: 10px; height: 10px; stroke-width: 3; }
.pf-missions .mis-body { gap: 7px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.pf-missions .mis.done .mis-body span { text-decoration: none; color: var(--ink-2); }
.pf-missions .mis-bar.au-progress { height: 4px; background: color-mix(in srgb, var(--hue) 28%, transparent); }
.pf-missions .mis-bar > span { background: var(--hue); }
.pf-missions .mis-xp { display: grid; justify-items: end; gap: 4px; min-width: 38px; font-size: 12.5px; font-weight: 700; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-missions .mis-xp .i { width: 15px; height: 15px; color: var(--ok); }
.pf-missions .mis-xp small { font-size: 11.5px; line-height: 1; color: var(--au-gold); font-weight: 700; }
/* Polar day: no hue blob in the corner (it bled out as a purple smear). */
:root[data-theme="light"] .pf-missions .mis { background-image: var(--au-glass); }
:root[data-theme="light"] .pf-missions .mis-xp small { color: #c98a00; }

/* =====================================================================
   the shelves
   ===================================================================== */

:is(.pf-shelf, .pf-stories) .pf-shelf-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
:is(.pf-shelf, .pf-stories) .pf-shelf-count { margin-right: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
:is(.pf-shelf, .pf-stories) .pf-shelf-all.btn {
  padding: 4px 2px; min-height: 0; background: none; box-shadow: none; color: var(--au-teal); font-size: 13px; font-weight: 700; gap: 2px;
}
:is(.pf-shelf, .pf-stories) .pf-shelf-all .i { width: 15px; height: 15px; }
:root[data-theme="light"] :is(.pf-shelf, .pf-stories) .pf-shelf-all.btn { color: #0b8a78; }
:is(.pf-shelf, .pf-stories) .pf-shelf-sub { margin: 4px 0 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
/* Phone: a shelf scrolls sideways past the screen's edge. */
@media (max-width: 1023px) {
  .pf-shelf .rd-shelf, .pf-stories .st-shelf-row {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--au-gutter)); padding: 4px var(--au-gutter) 10px; scroll-padding: 0 var(--au-gutter);
  }
  .pf-shelf .rd-shelf::-webkit-scrollbar, .pf-stories .st-shelf-row::-webkit-scrollbar { display: none; }
  /* The next cover peeks in and fades out at the edge: there is more. */
  .pf-shelf .rd-shelf, .pf-stories .st-shelf-row {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
  }
  .pf-shelf .rd-shelf .rd-cover, .pf-stories .st-shelf-row .st-cover { flex: 0 0 min(44%, 240px); scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .pf-shelf .rd-shelf .rd-cover, .pf-stories .st-shelf-row .st-cover { flex-basis: 66%; }
}
/* Desktop, in the side column: the four covers two by two, the stories a row that scrolls. */
@media (min-width: 1024px) {
  .pf-col-side .pf-shelf .rd-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; overflow: visible; }
  .pf-col-side .pf-stories .st-shelf-row {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 4px 2px 10px;
  }
  .pf-col-side .pf-stories .st-shelf-row .st-cover { flex: 0 0 74%; scroll-snap-align: start; }
  .pf-col-side .pf-stories .st-shelf-row {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent);
  }
}

/* =====================================================================
   the room's game feel that lives on the profile: confetti, level up
   ===================================================================== */

.fun-float { font-family: var(--display); font-weight: 700; color: var(--brand-3); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.fun-float.fun-good { color: var(--au-teal); }
.fun-float.fun-bad { color: var(--bad); }

/* Level up: a sheet in the middle with a teal-to-violet ring round the number. */
.fun-lvup-card {
  gap: 14px; width: min(340px, 100%); padding: 30px 26px 24px; border: 0; border-radius: var(--au-r-hero);
  background: var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 40px 80px -24px rgba(0, 0, 0, 0.7);
}
.fun-lvup-card strong { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; }
.fun-lvup-badge {
  width: 96px; height: 96px; border-radius: 50%; color: #f3f7ff;
  background: radial-gradient(circle at 50% 35%, #1c4b8c, #0e2248 70%) padding-box, conic-gradient(var(--au-teal), var(--au-violet), var(--au-teal)) border-box;
  border: 5px solid transparent;
  box-shadow: 0 0 30px -4px color-mix(in srgb, var(--au-teal) 60%, transparent), 0 14px 30px -12px rgba(0, 0, 0, 0.6);
}
.fun-lvup-badge b { font: 700 44px/1 var(--display); letter-spacing: -0.03em; }
.fun-lvup-ring { top: 30px; width: 96px; height: 96px; margin-left: -48px; background: radial-gradient(circle, color-mix(in srgb, var(--au-teal) 55%, transparent), transparent 70%); }

/* =====================================================================
   review (web/review): the deck's practice, in a sheet
   ===================================================================== */

.rv-modal.modal { width: min(600px, calc(100vw - 32px)); }
/* A desktop: a roomier sheet, the word bigger, the answers taller. */
@media (min-width: 1024px) {
  .rv-modal.modal { width: min(780px, calc(100vw - 64px)); }
  .rv-q.au-hero { padding: 34px 28px 30px; }
  .rv-q .rv-cue { font-size: 44px; }
  .rv-opts { gap: 12px; }
  .rv-opt { min-height: 66px; font-size: 17px; }
}
.rv-modal .modal-head h2 { display: flex; align-items: center; gap: 10px; }
.rv-modal .modal-head h2 .i { width: 22px; height: 22px; color: var(--au-teal); }
.rv-modal .rv-x.btn.icon { width: 38px; height: 38px; }
.rv-modal .rv-x .i { width: 18px; height: 18px; }
.rv-body { gap: 16px; }

.rv-langs { gap: 8px; }
.rv-lang {
  min-height: 34px; padding: 6px 13px; border: 1px solid var(--au-edge); border-radius: 999px; color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight); font: 700 13px/1 var(--font);
}
.rv-lang.on { border-color: color-mix(in srgb, var(--au-teal) 70%, transparent); background: linear-gradient(color-mix(in srgb, var(--au-teal) 16%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); }
.rv-lang svg { width: 18px; height: 13px; border-radius: 2px; }
.rv-badge { min-width: 20px; height: 20px; background: var(--au-brand); color: #fff; font: 700 11px/1 var(--font); box-shadow: 0 2px 8px -2px rgba(255, 122, 26, 0.7); }

.rv-top { gap: 10px; }
.rv-top .rv-meter.au-progress { flex: 1; min-width: 80px; height: 6px; background: var(--line-hi); }
.rv-streak.pill { color: var(--brand-3); background: linear-gradient(rgba(255, 122, 26, 0.14) 0 0), linear-gradient(var(--au-glass-base) 0 0); border-color: rgba(255, 122, 26, 0.35); }
.rv-practice.pill { color: var(--violet-ink); }
.rv-top .btn.tiny { min-height: 30px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; gap: 5px; }
.rv-top .btn.tiny .i { width: 14px; height: 14px; }

/* The question: a dark island lit by the language's colour (.au-hero). */
.rv-q.au-hero {
  display: grid; gap: 14px; justify-items: center; padding: 26px 20px 24px; text-align: center; color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 22px 44px -20px rgba(0, 0, 0, 0.65);
}
.rv-q.au-hero.retry {
  background:
    radial-gradient(320px 260px at calc(100% + 40px) -30px, rgba(255, 122, 26, 0.42), transparent 70%),
    radial-gradient(260px 220px at -40px calc(100% + 30px), rgba(255, 201, 77, 0.26), transparent 70%),
    var(--au-hero-navy);
}
.rv-q .rv-ask { gap: 8px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.rv-q .rv-ask svg { width: 20px; height: 14px; border-radius: 2px; }
.rv-q .rv-retry { color: var(--brand-3); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.rv-q .rv-cue { font: 700 clamp(26px, 6vw, 34px)/1.15 var(--display); letter-spacing: -0.02em; }
.rv-q .btn.ghost { color: var(--ink); background: var(--au-glass-flat); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); }
.rv-q .rv-speakers { gap: 14px; }
.rv-q .rv-speak.btn { width: 76px; height: 76px; border-radius: 50%; padding: 0; display: grid; place-items: center; }
.rv-q .rv-speak.slow.btn { width: 54px; height: 54px; border-radius: 50%; color: var(--au-teal); }
.rv-q .rv-prompt-word .btn.icon { color: var(--au-teal); }

/* The answers: glass options with a lip; teal when right, coral when not. */
.rv-opts { gap: 10px; }
.rv-opt {
  --lip-c: var(--line-hi);
  min-height: 58px; gap: 10px; padding: 14px 16px; border: 0; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base); background-image: var(--au-glass); color: var(--ink);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
  font: 600 16px/1.3 var(--font);
}
@media (hover: hover) and (pointer: fine) { .rv-opt:hover:not(:disabled) { border-color: transparent; background-image: linear-gradient(var(--au-glass-hi) 0 0); } }
.rv-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); }
.rv-opt kbd { border: 0; border-radius: 7px; padding: 4px 7px; background: var(--au-glass-flat); color: var(--muted); font: 700 11px/1 var(--font); }
.rv-opt.right {
  --lip-c: #11806d; color: var(--ink);
  background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 18%, transparent) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--au-teal), 0 0 22px -6px color-mix(in srgb, var(--au-teal) 70%, transparent);
}
.rv-opt.wrong {
  --lip-c: #c22c4c;
  background-image: linear-gradient(rgba(255, 93, 122, 0.16) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--bad);
}

.rv-line { min-height: 60px; border-bottom: 1.5px solid var(--line-hi); }
.rv-line.right { border-color: var(--au-teal); } .rv-line.close { border-color: var(--warn); } .rv-line.wrong { border-color: var(--bad); }
.rv-tile {
  --lip-c: var(--line-hi);
  padding: 9px 14px; border: 0; border-radius: 13px; color: var(--ink);
  background-color: var(--au-glass-base); background-image: linear-gradient(var(--au-glass-hi) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
  font: 600 16px/1.2 var(--font);
}
.rv-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip-c), inset 0 0 0 1px var(--line-hi); }
.rv-tile.used { color: transparent; background: var(--au-glass-flat); box-shadow: inset 0 0 0 1.5px var(--line); }
.rv-check.btn, .rv-continue.btn { width: 100%; justify-content: center; }
.rv-form .input { min-height: 52px; font-size: 17px; }

/* How it went: a glass panel tinted by the verdict, no outline. */
.rv-fb {
  gap: 12px; padding: 16px; border: 0; border-radius: 22px;
  background-color: var(--au-glass-base); background-image: linear-gradient(color-mix(in srgb, var(--fb) 14%, transparent) 0 0), var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1.5px color-mix(in srgb, var(--fb) 45%, transparent);
}
.rv-fb.right { --fb: var(--au-teal); background-color: var(--au-glass-base); border-color: transparent; }
.rv-fb.close { --fb: var(--au-gold); background-color: var(--au-glass-base); border-color: transparent; }
.rv-fb.wrong { --fb: var(--bad); background-color: var(--au-glass-base); border-color: transparent; }
.rv-fb-head { gap: 8px; font: 700 19px/1.2 var(--display); }
.rv-fb-head .i { width: 22px; height: 22px; }
.rv-fb.right .rv-fb-head { color: var(--au-teal); }
.rv-fb.close .rv-fb-head { color: var(--warn); }
.rv-fb-answer { font: 700 21px/1.25 var(--display); letter-spacing: -0.01em; }
.rv-continue kbd { border: 0; background: none; }
:root[data-theme="light"] .rv-fb.right .rv-fb-head { color: #0b8a78; }

/* Real sentences under the answer. */
.rv-ex { gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-hi); }
.rv-ex-row { font-size: 13.5px; }
.rv-ex-row .muted { font-size: 12px; }

/* The end of a round. */
.rv-done { gap: 16px; padding: 6px 0; }
.rv-stats { gap: 10px; }
.rv-stats div {
  display: grid; gap: 2px; padding: 12px; border: 0; border-radius: var(--au-r-mission);
  background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow);
}
.rv-stats b { font: 700 26px/1.05 var(--display); color: var(--ink); letter-spacing: -0.02em; }
.rv-stats span { font-size: 12px; font-weight: 600; color: var(--muted); }
.rv-after { gap: 10px; max-width: 380px; }
.rv-after .btn { justify-content: center; }
.rv-next .i { width: 13px; height: 13px; }

/* The alphabet keys (web/shared/keys.tsx). */
.rv-keys { gap: 5px; }
.rv-key {
  border: 0; border-radius: 10px; color: var(--ink); font: 600 16px/1 var(--font);
  background-color: var(--au-glass-base); background-image: linear-gradient(var(--au-glass-flat) 0 0);
  box-shadow: 0 2px 0 var(--line-hi), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
@media (hover: hover) and (pointer: fine) { .rv-key:hover { border-color: transparent; background-image: linear-gradient(var(--au-glass-hi) 0 0); } }
.rv-key:active { transform: translateY(1px); background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 22%, transparent) 0 0); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 50%, transparent); }

/* =====================================================================
   a lesson of the path (web/drill): the whole screen, under the sky
   ===================================================================== */

.dr-screen {
  color: var(--ink);
  background-color: var(--au-bg0);
  background-image:
    radial-gradient(70% 42% at 16% 3%, rgb(var(--au-blob-teal) / calc(0.28 * var(--au-blob-o))), transparent 72%),
    radial-gradient(62% 44% at 92% 12%, rgb(var(--au-blob-violet) / calc(0.28 * var(--au-blob-o))), transparent 72%),
    var(--au-sky);
  background-repeat: no-repeat;
}
.dr-top { gap: 12px; padding: 16px var(--au-gutter) 8px; }
.dr-x {
  width: 42px; height: 42px; border-radius: 50%; color: var(--ink);
  background: var(--au-glass-flat); background-color: var(--au-glass-base); background-image: linear-gradient(rgb(var(--fg) / 0.1) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
}
@media (hover: hover) and (pointer: fine) { .dr-x:hover { color: var(--ink); background-image: linear-gradient(rgb(var(--fg) / 0.16) 0 0); } }
.dr-x .i { width: 20px; height: 20px; }
.dr-x.dr-sound { width: 38px; height: 38px; }
.dr-x.dr-sound .i { width: 18px; height: 18px; }
.dr-bar { height: 8px; background: var(--line-hi); }
.dr-bar > div { min-width: 10px; background: var(--au-progress); }
.dr-bar > div::after { left: 6px; right: 6px; top: 2px; height: 2px; background: rgb(255 255 255 / 0.35); }
.dr-bar.glow > div { box-shadow: 0 0 14px color-mix(in srgb, var(--au-teal) 80%, transparent); }
.dr-combo { font: 700 16px/1 var(--display); }
.dr-combo.on { color: var(--brand-3); }

.dr-main { gap: 20px; padding: 14px var(--au-gutter) 24px; }
/* Choices sit in the middle of the room above the button, not under the bar
   with the bottom half of the screen empty. Typing stays at the top. */
.dr-main:is(.k-pick, .k-meaning, .k-hear, .k-gap, .k-match) { justify-content: safe center; }
.dr-ask { font: 700 clamp(26px, 6.4vw, 34px)/1.1 var(--display); letter-spacing: -0.025em; }
.dr-retry { color: var(--brand-3); font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; }

/* A new word: the teal chip, then the word's card as the screen's hero. */
.dr-intro { justify-items: stretch; gap: 16px; }
.dr-new {
  justify-self: start; gap: 7px; min-height: 30px; padding: 5px 13px; border-radius: 999px;
  background: linear-gradient(color-mix(in srgb, var(--au-teal) 12%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-teal) 45%, transparent);
  color: var(--au-teal); font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em;
}
.dr-new .i { width: 15px; height: 15px; }
:root[data-theme="light"] .dr-new { color: #0b8a78; }
.dr-intro .dr-intro-card.au-hero {
  --hue: #5ab8ff; --hue2: #9a83ff;
  justify-self: center; display: grid; justify-items: center; gap: 10px; width: min(440px, 100%); padding: 28px 22px 22px;
  border: 0; border-radius: var(--au-r-hero); text-align: center;
}
.dr-intro .dr-emoji { font-size: 96px; line-height: 1; }
.dr-intro .dr-emoji .pic { width: 120px; height: 120px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3)); }
.dr-intro .dr-emoji.none { width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--au-teal) 40%, transparent), transparent), var(--au-glass-flat); color: var(--ink); }
.dr-intro .dr-intro-word { margin-top: 8px; color: var(--ink); font: 700 clamp(30px, 8vw, 38px)/1.1 var(--display); letter-spacing: -0.03em; }
.dr-intro .dr-reading { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.dr-intro .dr-intro-mean { font: 600 22px/1.2 var(--display); color: var(--ink); }
.dr-intro .dr-speakers { gap: 14px; margin: 4px 0 2px; }
.dr-intro .dr-speak, .dr-intro .dr-speak.slow {
  width: 46px; height: 46px; border-radius: 50%; color: var(--au-teal);
  background: var(--au-glass-flat); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
}
.dr-intro .dr-speak .i, .dr-intro .dr-speak.slow .i { width: 21px; height: 21px; }
.dr-intro .dr-speak:active { transform: translateY(1px); box-shadow: inset 0 0 0 1px var(--line-hi); }
.dr-intro .dr-intro-ex {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: none; margin-top: 4px; padding: 12px 14px;
  border-radius: var(--au-r-mission); background: var(--au-glass-flat); text-align: left;
  font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink);
}
.dr-intro-ex-i { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: var(--au-teal); background: radial-gradient(closest-side, color-mix(in srgb, var(--au-teal) 30%, transparent), transparent); }
.dr-intro-ex-i .i { width: 18px; height: 18px; }

/* The listening buttons: teal 3D (listen), the slow one glass. */
.dr-speak {
  color: #053a33; border-radius: 22px;
  background: linear-gradient(180deg, #5af0d4, #22c3a6); box-shadow: 0 4px 0 #11806d, 0 14px 28px -12px rgba(34, 195, 166, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dr-speak:active { transform: translateY(3px); box-shadow: 0 1px 0 #11806d, inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.dr-speak.slow { color: var(--au-teal); background: var(--au-glass-flat); background-color: var(--au-glass-base); box-shadow: 0 3px 0 var(--line-hi), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi); }
.dr-speakers.big .dr-speak:not(.slow) { border-radius: 32px; }

/* The penguin asks, in a glass bubble. */
.dr-bubble {
  border: 0; border-radius: 22px; padding: 14px 18px; color: var(--ink); font: 700 19px/1.35 var(--font);
  background-color: var(--panel-solid); background-image: var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi), var(--au-drop);
}
.dr-bubble::before { border-left: 1px solid var(--line-hi); border-bottom: 1px solid var(--line-hi); background: var(--panel-solid); }
button.dr-bubble .i { color: var(--au-teal); }
.dr-bubble small { color: var(--muted); font-weight: 600; }

/* Choices: glass cards with a lip; chosen rings teal, then right / wrong. */
.dr-card, .dr-opt {
  --lip-c: var(--line-hi);
  border: 0; border-radius: var(--au-r-mission); color: var(--ink); font: 600 17px/1.3 var(--font);
  background-color: var(--au-glass-base); background-image: var(--au-glass);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
}
.dr-grid.words .dr-card { font: 600 19px/1.25 var(--display); }
.dr-card-emoji .pic { width: 64px; height: 64px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
.dr-card kbd, .dr-opt kbd { border: 0; border-radius: 7px; padding: 4px 7px; background: var(--au-glass-flat); color: var(--muted); }
/* The key's number: a 22px chip inset from the corner, with room kept under
   it so a word on two lines never runs into it. */
.dr-card kbd { top: 12px; left: 12px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; font: 700 11px/1 var(--font); }
.dr-card { padding: 38px 14px 22px; }
/* A finger has no number keys: no chips, as in the app. */
@media (hover: none), (max-width: 480px) {
  .dr-card kbd { display: none; }
  .dr-card { padding: 18px 12px; }
}

/* A grid of words has nobody asking: the question is the screen's card,
   the penguin on its left as in the app's word card. */
.dr-ask-card.au-hero {
  --hue: #5ab8ff; --hue2: #9a83ff;
  display: flex; align-items: center; gap: 14px; padding: 20px 22px; border: 0; border-radius: var(--au-r-hero);
}
.dr-ask-card .dr-ask { flex: 1; min-width: 0; color: var(--ink); font-size: clamp(24px, 6vw, 30px); }
.dr-ask-card .dr-ask-pg { flex: none; margin: -4px 0 -8px; }
@media (hover: hover) and (pointer: fine) { .dr-card:hover:not(:disabled), .dr-opt:hover:not(:disabled) { background-color: var(--au-glass-base); background-image: linear-gradient(var(--au-glass-hi) 0 0); } }
.dr-card:active:not(:disabled), .dr-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip-c), inset 0 0 0 1px var(--line-hi); }
.dr-card.on, .dr-opt.on {
  --lip-c: color-mix(in srgb, var(--au-teal) 55%, #000); color: var(--ink);
  background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 14%, transparent) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--au-teal), 0 0 20px -6px color-mix(in srgb, var(--au-teal) 70%, transparent);
}
.dr-card.on kbd, .dr-opt.on kbd { color: var(--au-teal); }
.dr-card.right, .dr-opt.right {
  --lip-c: #11806d; color: var(--ink);
  background-image: linear-gradient(color-mix(in srgb, var(--au-teal) 20%, transparent) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--au-teal), 0 0 22px -6px color-mix(in srgb, var(--au-teal) 75%, transparent);
}
.dr-card.wrong, .dr-opt.wrong {
  --lip-c: #c22c4c; color: var(--ink);
  background-image: linear-gradient(rgba(255, 93, 122, 0.16) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--bad);
}
.dr-match-o.done { opacity: 0.4; --lip-c: #11806d; box-shadow: 0 2px 0 var(--lip-c), inset 0 0 0 2px var(--au-teal); }
.dr-match-o.bad { --lip-c: #c22c4c; background-image: linear-gradient(rgba(255, 93, 122, 0.16) 0 0); box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--bad); }

/* Tiles: a line to build on, and the bank. */
.dr-line { border-bottom: 1.5px solid var(--line-hi); background: repeating-linear-gradient(transparent 0 62px, var(--line) 62px 63px); }
.dr-line.right { border-color: var(--au-teal); }
.dr-slot { border: 1.5px dashed var(--line-hi); border-radius: 13px; }
.dr-tile {
  --lip-c: var(--line-hi);
  border: 0; border-radius: 13px; color: var(--ink); font: 600 17px/1.2 var(--font);
  background-color: var(--au-glass-base); background-image: linear-gradient(var(--au-glass-hi) 0 0);
  box-shadow: 0 3px 0 var(--lip-c), inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
}
.dr-bank.spell .dr-tile, .dr-line.spell .dr-tile { font: 700 22px/1 var(--display); }
.dr-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip-c), inset 0 0 0 1px var(--line-hi); }
.dr-tile.used { color: transparent; background: var(--au-glass-flat); box-shadow: none; }
.dr-line.spell.right .dr-tile { --lip-c: #11806d; color: var(--au-teal); box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--au-teal); }
.dr-line.spell.wrong .dr-tile { --lip-c: #c22c4c; color: var(--bad); box-shadow: 0 3px 0 var(--lip-c), inset 0 0 0 2px var(--bad); }
.dr-input.input { min-height: 56px; font-size: 20px; border-radius: var(--au-r-mission); }

/* The grammar of a lesson. */
.dr-tip {
  gap: 14px; padding: 20px; border: 0; border-radius: var(--au-r-card);
  background-color: var(--au-glass-base); background-image: radial-gradient(130px 130px at calc(100% - 8px) 0, color-mix(in srgb, var(--au-violet) 35%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.dr-tip-head b { font: 700 21px/1.25 var(--display); letter-spacing: -0.015em; }
.dr-tip ul { font-size: 15.5px; }
.dr-tip li::marker { color: var(--au-teal); }

/* The strip at the bottom: the orange check, then a sheet that says how it went. */
.dr-foot { border-top: 0; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--au-fade) 85%, transparent) 40%); }
.dr-foot-in { width: min(760px, 100%); padding: 14px var(--au-gutter) calc(18px + env(safe-area-inset-bottom)); min-height: 0; }
.dr-go.btn { min-width: 200px; justify-content: center; font: 700 17px/1.2 var(--font); letter-spacing: 0; text-transform: none; padding: 15px 24px; border-radius: var(--au-r-btn); }
/* Not ready yet: still the orange primary, dimmed, so it keeps its identity. */
.dr-foot .btn.brand.dr-go:disabled {
  color: #fff; text-shadow: none; opacity: 0.4; cursor: not-allowed;
  background-color: var(--k-bottom); background-image: linear-gradient(180deg, var(--k-top), var(--k-bottom));
  box-shadow: 0 var(--lip) 0 var(--k-deep), inset 0 1px 0 var(--au-btn-highlight);
}
.dr-skip.btn { text-transform: none; letter-spacing: 0; font-weight: 700; }
.dr-foot.right, .dr-foot.close, .dr-foot.wrong {
  border-top: 0; border-radius: var(--au-r-sheet) var(--au-r-sheet) 0 0;
  background-color: var(--panel-solid);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--fb) 20%, transparent), color-mix(in srgb, var(--fb) 6%, transparent));
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px color-mix(in srgb, var(--fb) 35%, transparent), 0 -20px 40px -24px rgba(0, 0, 0, 0.6);
}
.dr-foot.right { --fb: var(--au-teal); }
.dr-foot.close { --fb: var(--au-gold); }
.dr-foot.wrong { --fb: var(--bad); }
.dr-foot-icon { width: 52px; height: 52px; background: var(--au-glass-flat); box-shadow: inset 0 1px 0 var(--au-highlight), 0 0 18px -2px color-mix(in srgb, var(--fb, var(--au-teal)) 55%, transparent); }
.dr-foot.right .dr-foot-icon { color: var(--au-teal); }
.dr-foot-t > b { font: 700 22px/1.2 var(--display); letter-spacing: -0.015em; }
.dr-foot.right .dr-foot-t > b { color: var(--au-teal); }
.dr-foot.close .dr-foot-t > b, .dr-foot.close .dr-foot-icon { color: var(--warn); }
/* The verdict buttons are the base's 3D ones: drop the old flat colours. */
.dr-foot .btn.ok, .dr-foot .btn.bad { background-color: var(--k-bottom); background-image: linear-gradient(180deg, var(--k-top), var(--k-bottom)); color: var(--k-ink); box-shadow: 0 var(--lip) 0 var(--k-deep), 0 14px 30px -12px var(--k-glow), inset 0 1px 0 var(--au-btn-highlight); }
:root[data-theme="light"] .dr-foot.right .dr-foot-t > b, :root[data-theme="light"] .dr-foot.right .dr-foot-icon { color: #0b8a78; }

/* The end of a lesson. */
.dr-end-t { font: 700 clamp(30px, 7vw, 38px)/1.1 var(--display); letter-spacing: -0.025em; color: var(--ink); }
.dr-stats { gap: 10px; }
.dr-stats > div {
  gap: 4px; padding: 14px 8px 12px; border: 0; border-radius: var(--au-r-mission); overflow: visible;
  background-color: var(--au-glass-base);
  background-image: radial-gradient(80px 80px at calc(100% - 4px) 0, color-mix(in srgb, var(--c) 34%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
}
.dr-stats > div > span { padding: 0; order: 2; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.dr-stats b { order: 1; padding: 0; background: none; border-radius: 0; color: var(--ink); font: 700 26px/1 var(--display); }
.dr-stats b .i { color: var(--c); }
.dr-stats .xp { --c: #ffc94d; } .dr-stats .good { --c: #3ee6c8; } .dr-stats .meh { --c: #ffa04d; } .dr-stats .time { --c: #5ab8ff; }
.dr-end-btns .btn { text-transform: none; letter-spacing: 0; font-weight: 700; }
.dr-end .path-note.ok { color: var(--au-teal); }
.dr-quit { background: var(--au-backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dr-quit-in {
  border-radius: var(--au-r-sheet); background: var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 40px 80px -24px rgba(0, 0, 0, 0.7);
}
.dr-quit-in b { font: 700 22px/1.2 var(--display); }
.dr-milestone { font: 700 18px/1 var(--display); background: linear-gradient(180deg, #ffa04d, #ff7a1a); box-shadow: 0 4px 0 #c24f05, 0 14px 30px -10px rgba(255, 122, 26, 0.65); }

@media (max-width: 560px) {
  .dr-foot-in { padding-top: 14px; }
  .dr-foot-icon { width: 42px; height: 42px; }
  .dr-stats b { font-size: 22px; }
}
/* A desktop: the lesson as one centred stage, in aurora/drill.css. */

/* =====================================================================
   the path's moments (fresh units), and reduced motion
   ===================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .pf-path .pth-row.fresh .pth-row-icon { animation: gf-pop var(--dur-4, 400ms) var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) 200ms backwards; }
  .pf-path .pth-row.fresh .pth-row-icon::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; opacity: 0;
    box-shadow: 0 0 0 3px var(--hue), 0 0 18px 4px var(--hue); animation: gf-ring 900ms ease-out 300ms;
  }
  .pth-now.fresh .pth-now-art .pth-art { animation: gf-pop var(--dur-4, 400ms) var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) 200ms backwards; }
  .pf-path .pth-chest.just .pth-chest-i { animation: gf-chest 700ms var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) 250ms backwards; }
  .pf-path .pth-step.just::before { box-shadow: 0 0 0 3px var(--au-teal); border-radius: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-path .pth-step.now::after { animation: none; }
  .pf-deck .pf-deck-main, .pf-games .pf-game { transition: none; }
}

/* A step tried and short of its pass mark: a rose ring and the "again" arrow,
   until it passes (path.PassMarks). */
.pf-path .pth-step.retry:not(.now) { color: #ff6b8b; box-shadow: 0 var(--lip) 0 var(--lip-c), inset 0 0 0 2px rgba(255, 107, 139, 0.75); }
.pf-path .pth-step.retry.now::after { border-color: rgba(255, 107, 139, 0.6); }
.pf-path .pth-retry-note { position: relative; z-index: 1; display: block; margin-top: 8px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
