/* frappe — FR.world (js/game/world.js): the home screen (trainer HUD, « Aventure du jour » track, next step,
   illustrated world map, quests, weak spots, shortcuts), the region pages (zones, dojo of techniques, bosses,
   mock exam), the onboarding (view "placement") and the world's dialogs (lesson, celebration, new region).
   Classes are prefixed wd-. Built on game-base.css (.g-*) and the theme tokens; fixed colours only appear in
   the map illustration (land, sea, rivers, roads), which is a picture and reads the same in every theme.
   Motion: the view root (and each dialog) gets .wd-still when FR.reducedMotion() is true. */

/* ================================================================ shared */

.wd-en {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}
.wd-h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
}
.wd-sec-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.6rem;
}
.wd-sec-head .g-h {
  font-size: 1.2rem;
}
.wd-sec-head > .g-spacer,
.wd-adv-head > .g-spacer,
.wd-adv-done > .g-spacer,
.wd-onb-btns > .g-spacer,
.wd-examcard > .g-spacer {
  flex: 1;
}
.wd-why {
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}
.wd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.5rem;
  border-radius: 1rem;
  background: var(--bg);
  color: var(--g-gloss);
  font-size: 0.7rem;
  white-space: nowrap;
  flex: none;
}
.wd-badge.ok {
  color: var(--g-ok-ink);
}
.wd-badge.hl {
  background: var(--main);
  color: var(--bg);
}
.wd-badge .g-en {
  color: inherit;
}
.wd-stars {
  display: inline-flex;
  gap: 0.05rem;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}
.wd-stars span {
  color: var(--sub);
  opacity: 0.6;
}
.wd-stars span.on {
  color: var(--g-coin);
  opacity: 1;
}
.wd-av {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--sub-alt);
  box-shadow: inset 0 0 0 0.16rem var(--main);
  font-size: 1.2rem;
  flex: none;
}
.wd-av-md {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.6rem;
}
.wd-sc:focus-visible,
.wd-tech:focus-visible,
.wd-choice:focus-visible,
.wd-avpick:focus-visible,
.wd-selfpick:focus-visible,
.wd-step button:focus-visible,
.wd-say:focus-visible,
.wd-node:focus-visible,
.wd-region .g-btn:focus-visible,
.wd-home .g-btn:focus-visible,
.wd-onb .g-btn:focus-visible,
.wd-modal .g-btn:focus-visible {
  outline: 2px solid var(--main);
  outline-offset: 2px;
}

/* ================================================================ home: HUD */

.wd-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}
.wd-hud-me {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}
.wd-hud-hi {
  min-width: 0;
}
.wd-hello {
  font-size: 1.5rem;
  line-height: 1.25;
}
.wd-hud-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wd-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sub-alt);
  border-radius: 2rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.2;
}
.wd-stat .g-label {
  display: block;
}
.wd-flame {
  font-size: 1.35rem;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.45;
}
.wd-streak.on .wd-flame {
  filter: none;
  opacity: 1;
  animation: wd-flicker 1.6s ease-in-out infinite;
}
.wd-ring {
  width: 2.3rem;
  height: 2.3rem;
  flex: none;
  fill: none;
  stroke-linecap: round;
}
.wd-ring-bg {
  stroke: var(--bg);
  stroke-width: 4;
}
.wd-ring-fg {
  stroke: var(--main);
  stroke-width: 4;
  transition: stroke-dasharray 0.6s ease;
}
.wd-goal.met .wd-ring-fg {
  stroke: var(--g-ok);
}
.wd-coins > span:first-child {
  font-size: 1.25rem;
  line-height: 1;
}
.wd-coins b {
  color: var(--g-coin-ink);
}

/* ================================================================ home: the daily adventure */

.wd-adv {
  background: var(--sub-alt);
  /* a light wash of the accent: at 14 % the gloss text in the card fell to 4.2:1 on macaron; 8 % keeps it ≥ 4.5 */
  background: linear-gradient(135deg, color-mix(in srgb, var(--main) 8%, var(--sub-alt)), var(--sub-alt) 65%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.wd-adv-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}
.wd-adv-head .g-h {
  font-size: 1.3rem;
}
.wd-adv-bar {
  height: 0.4rem;
}
.wd-track {
  /* width 0 + min-width 100%: the scrolling track never widens the page (no intrinsic width) */
  width: 0;
  min-width: 100%;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0.1rem 0.5rem;
  display: flex;
  gap: 0.2rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.wd-step {
  flex: 0 0 5.8rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  scroll-snap-align: start;
}
.wd-step > button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  border-radius: 0.6rem;
}
/* connector to the previous step */
.wd-step::before {
  content: "";
  position: absolute;
  top: 1.3rem;
  right: 50%;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--bg);
  z-index: 0;
}
.wd-step:first-child::before {
  display: none;
}
.wd-step.done::before,
.wd-step.cur::before {
  background: var(--main);
}
.wd-step-dot {
  position: relative;
  z-index: 1;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 3px solid var(--sub);
  font-size: 1.15rem;
  line-height: 1;
  flex: none;
}
.wd-step.done .wd-step-dot {
  background: var(--main);
  border-color: var(--main);
  color: var(--bg);
  font-weight: 500;
}
.wd-step.cur .wd-step-dot {
  border-color: var(--main);
  animation: wd-pulse 1.8s ease-out infinite;
}
.wd-step.todo .wd-step-dot {
  opacity: 0.75;
}
.wd-step-t,
.wd-step-s {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
  max-width: 100%;
  padding: 0 0.15rem;
}
/* the names of the day's steps tell the learner what comes next: readable gloss colour, not the decorative --sub */
.wd-step-t {
  font-size: 0.72rem;
  color: var(--g-gloss);
}
.wd-step-s {
  font-size: 0.7rem;
  color: var(--g-gloss);
}
.wd-step.cur .wd-step-t {
  color: var(--text);
}
.wd-adv-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
}
.wd-adv-cur {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 12rem;
}
.wd-adv-cur b {
  font-weight: 500;
}
.wd-adv-done {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
}
.wd-adv-trophy {
  font-size: 2.2rem;
  line-height: 1;
}

/* ================================================================ home: next step, quests, weak spots, shortcuts */

.wd-next {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
}
.wd-next:empty {
  display: none;
}
.wd-next-ic {
  font-size: 1.7rem;
  line-height: 1;
}
.wd-next-b {
  flex: 1 1 13rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.wd-next-t {
  font-weight: 500;
}

.wd-cols {
  display: grid;
  gap: var(--g-gap);
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .wd-cols {
    grid-template-columns: 1fr 1fr;
  }
}
.wd-qlist,
.wd-weak {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.wd-q,
.wd-weak-i {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
/* a weak spot: icon | text | button on one line while the text keeps ~12rem, else the button wraps below */
.wd-weak-i {
  flex-wrap: wrap;
}
.wd-weak-i > .g-btn {
  margin-left: auto;
}
.wd-q-ic,
.wd-weak-ic {
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
}
.wd-q-b,
.wd-weak-b {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.wd-q-t {
  font-size: 0.88rem;
}
.wd-q .g-bar {
  height: 0.35rem;
  margin-top: 0.15rem;
}
.wd-q-n {
  font-size: 0.8rem;
  color: var(--g-gloss);
  white-space: nowrap;
}
.wd-q.done .wd-q-t {
  color: var(--sub);
  text-decoration: line-through;
}
.wd-q.done .g-bar > i {
  background: var(--g-ok);
}
.wd-weak-b {
  flex: 1 1 12rem;
}
.wd-weak-b b {
  font-weight: 500;
  overflow-wrap: break-word;
  hyphens: auto;
}
.wd-weak-b .g-label {
  text-transform: none; /* the kinds are already lower case: keeps « TCF » in capitals */
}
.wd-weak-bar {
  height: 0.3rem;
  max-width: 9rem;
  margin-top: 0.15rem;
}

.wd-short {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
/* wrapping tiles that grow to fill their row: all 7 in one row on a wide screen, and never a lone tile next
   to empty cells on a narrow one (the tiles of the last row share its width) */
.wd-short-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wd-short-grid > .wd-sc {
  flex: 1 1 7.5rem;
  min-width: 0;
}
.wd-sc {
  appearance: none;
  border: 0;
  font: inherit;
  background: var(--sub-alt);
  color: var(--text);
  border-radius: var(--g-radius);
  padding: 0.85rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.wd-sc:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: var(--g-shadow);
}
.wd-sc[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.wd-sc-ic {
  font-size: 1.7rem;
  line-height: 1.1;
}
.wd-sc-t {
  font-size: 0.9rem;
}

/* ================================================================ the world map */

.wd-mapwrap {
  display: flex;
  flex-direction: column;
}
.wd-map {
  position: relative;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  aspect-ratio: 8 / 5;
  border-radius: var(--g-radius);
  overflow: hidden;
  background: #86c46f;
  box-shadow: var(--g-shadow), inset 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.wd-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: none;
}
.wd-road {
  fill: none;
  stroke: rgba(70, 55, 35, 0.3);
  stroke-width: 7;
  stroke-linecap: round;
}
.wd-road.on {
  stroke: #d9b97a;
}
.wd-road-dash {
  fill: none;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1 8;
}
.wd-road-dash.on {
  stroke: #fff7d6;
  stroke-dasharray: 6 6;
  animation: wd-march 1.6s linear infinite;
}
.wd-fog circle {
  fill: #eef1f4;
  opacity: 0.78;
}
.wd-cloud {
  animation: wd-drift 26s ease-in-out infinite alternate;
}
.wd-cloud2 {
  animation-duration: 34s;
  animation-direction: alternate-reverse;
}
.wd-boat {
  animation: wd-sail 4s ease-in-out infinite alternate;
}

.wd-node {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 50%;
  color: #1d1b26;
}
.wd-node-dot {
  position: relative;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rc, var(--main));
  border: 3px solid #ffffff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22), 0 6px 14px rgba(0, 0, 0, 0.25);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.15s;
}
.wd-node:hover .wd-node-dot {
  transform: scale(1.08);
}
.wd-node-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  font-size: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.wd-node-lbl {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  padding: 0.12rem 0.45rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1d1b26;
  font-size: 0.72rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.wd-node-lbl .g-lv {
  font-size: 0.62rem;
  padding: 0 0.3rem;
}
.wd-node.locked .wd-node-dot {
  background: #9aa1ab;
  border-color: #e3e6ea;
}
.wd-node.locked .wd-node-ic {
  opacity: 0.5;
  filter: grayscale(1);
}
.wd-node.locked .wd-node-lbl {
  color: #5b616b;
}
.wd-node.cur .wd-node-dot::after,
.wd-node.guide .wd-node-dot::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 50%;
  border: 3px solid #ffffff;
  opacity: 0;
  animation: wd-ring 2s ease-out infinite;
}
.wd-node.guide .wd-node-dot::after {
  border-color: #fff36b;
  animation-duration: 1.2s;
}
.wd-node:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #1d1b26;
}
.wd-me {
  position: absolute;
  z-index: 3;
  transform: translate(-125%, -85%);
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}
.wd-me > * {
  animation: wd-bob 1.4s ease-in-out infinite alternate;
}

/* guided first step */
.wd-guide-tip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  margin-bottom: 0.7rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--g-radius);
  border: 2px dashed var(--main);
  background: var(--sub-alt);
  background: color-mix(in srgb, var(--main) 16%, var(--sub-alt));
  font-size: 0.9rem;
  line-height: 1.4;
}
.wd-guide-tip > div {
  flex: 1 1 12rem;
}
.wd-guide-tip.in-card {
  margin: 0 0 0.2rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
}
.wd-guide-hand {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
  animation: wd-point 0.9s ease-in-out infinite alternate;
}

/* ================================================================ region page */

.wd-rhead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--g-radius);
  background: var(--sub-alt);
  background: linear-gradient(135deg, color-mix(in srgb, var(--rc, var(--main)) 35%, var(--sub-alt)), var(--sub-alt) 70%);
}
.wd-rhead-ic {
  font-size: 2.7rem;
  line-height: 1;
}
.wd-rhead-t {
  flex: 1 1 10rem;
  min-width: 0;
}
.wd-rhead-t .g-h {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.wd-rstats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wd-rstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  border-radius: 0.6rem;
  padding: 0.35rem 0.75rem;
  min-width: 5rem;
  text-align: center;
}
.wd-rstat b {
  font-size: 1.05rem;
  font-weight: 500;
}
.wd-lockban {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: var(--g-radius);
  background: var(--sub-alt);
  border-left: 4px solid var(--sub);
}
.wd-lockban-ic {
  font-size: 1.8rem;
  line-height: 1;
}
.wd-lockban p {
  margin: 0.3rem 0;
  font-size: 0.92rem;
}
.wd-gatechips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.7rem;
}
.wd-gatechip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
  background: var(--bg);
  color: var(--g-gloss);
  font-size: 0.78rem;
}
.wd-gatechip.ok {
  color: var(--g-ok-ink);
}

.wd-zones {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.wd-zone {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 4px solid var(--rc, var(--main));
  padding: 0.85rem 0.9rem;
}
.wd-zone.done {
  border-top-color: var(--g-st4);
}
.wd-zone.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}
.wd-zone.wd-guided {
  outline: 3px solid var(--main);
  outline-offset: 2px;
  animation: wd-glow 1.8s ease-in-out infinite;
}
.wd-zone-top {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
}
.wd-zone-ic {
  font-size: 1.6rem;
  line-height: 1.1;
  flex: none;
}
.wd-zone-t {
  flex: 1 1 7rem;
  min-width: 0;
}
.wd-zone-t h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.wd-zone-mons {
  display: flex;
  align-items: flex-end;
  gap: 0.1rem;
  min-height: 40px;
}
.wd-zone-num {
  font-size: 0.8rem;
  color: var(--g-gloss);
}
.wd-zone-num b {
  color: var(--text);
  font-weight: 500;
}
.wd-mast {
  color: var(--g-coin-ink);
}
.wd-zone .g-bar {
  height: 0.4rem;
}
.wd-zone.done .g-bar > i {
  background: var(--g-st4);
}
.wd-zone-btns {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  flex-wrap: wrap;
}

.wd-techs {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0 0.2rem 0 0;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  max-height: 22rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.wd-tech {
  appearance: none;
  border: 0;
  font: inherit;
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  border-radius: 0.55rem;
  padding: 0.5rem 0.7rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.12s;
}
.wd-tech:hover:not([disabled]) {
  background: color-mix(in srgb, var(--main) 14%, var(--bg));
}
.wd-tech[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}
.wd-tech.next {
  box-shadow: inset 0 0 0 2px var(--main);
}
.wd-tech-t {
  flex: 1 1 8rem;
  min-width: 0;
}

.wd-bosses {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
}
.wd-boss {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 0.9rem 0.7rem;
}
.wd-boss.won {
  box-shadow: inset 0 0 0 2px var(--g-ok);
}
.wd-boss.locked {
  opacity: 0.55;
  filter: grayscale(0.7);
}
.wd-boss h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}
.wd-boss-sp {
  height: 76px;
  display: grid;
  place-items: center;
}
.wd-boss-ic {
  font-size: 2.6rem;
}
.wd-boss-sec {
  font-size: 0.75rem;
  color: var(--g-gloss);
}
.wd-boss-st {
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}
.wd-boss-gate {
  font-size: 0.72rem;
}
.wd-boss .g-btn {
  margin-top: auto;
  max-width: 100%;
}
/* buttons with an English gloss in narrow places: the French label stays whole and the gloss goes under it,
   instead of the label breaking word by word beside the gloss */
.wd-boss .g-btn,
.wd-sec-head .g-btn,
.wd-weak-i > .g-btn {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0;
  text-align: center;
}

/* near-black emoji (🗣️ speaking, 🐾, 🕵️) stay visible on dark themes: a thin halo in the text colour */
.wd-emo-dk {
  display: inline-block;
  filter: drop-shadow(0 0 1px color-mix(in srgb, var(--text) 75%, transparent));
}

.wd-examcard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
}
.wd-examcard > div {
  flex: 1 1 14rem;
}
.wd-examcard p {
  margin: 0.2rem 0 0;
}
.wd-exam-ic {
  font-size: 2rem;
  line-height: 1;
}

/* ================================================================ dialogs (lesson, celebration, new region) */

.wd-dialog {
  max-width: 40rem;
}
.wd-dialog .g-h {
  font-size: 1.35rem;
}
.wd-dlg-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.1rem;
}
.wd-les-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}
.wd-les-head .g-h {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.wd-les-sp {
  flex: none;
}
.wd-les-explain {
  font-size: 0.92rem;
  line-height: 1.6;
}
.wd-les-explain p {
  margin: 0.5rem 0;
}
.wd-les-explain ul {
  margin: 0.4rem 0;
  padding-left: 1.2rem;
}
.wd-les-explain b {
  color: var(--main);
  font-weight: 500;
}
/* the form table scrolls sideways inside the dialog instead of widening it (width 0 + min-width 100%) */
.wd-les-twrap {
  width: 0;
  min-width: 100%;
  overflow-x: auto;
  margin: 0.7rem 0 0.4rem;
  border-radius: 0.4rem;
}
.wd-les-twrap:focus-visible {
  outline: 2px solid var(--main);
  outline-offset: 2px;
}
.wd-les-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.wd-les-table th,
.wd-les-table td {
  line-height: 1.45;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--sub-alt);
  text-align: left;
  vertical-align: top;
}
.wd-les-table tbody th {
  color: var(--main);
  font-weight: 500;
}
/* column header: small labels in the gloss colour, set apart from the rows by a heavier rule */
.wd-les-table thead th {
  color: var(--g-gloss);
  font-size: 0.78rem;
  font-weight: 400;
  vertical-align: bottom;
  border-bottom: 2px solid var(--sub-alt);
}
.wd-les-table thead th.g-fr {
  color: var(--text);
  font-weight: 500;
}
/* English cells (labels, glosses, sound-alikes) read as glosses, French cells keep the text colour */
.wd-les-table .wd-t-en,
.wd-les-table tbody th.wd-t-en {
  color: var(--g-gloss);
  font-weight: 400;
}
.wd-les-table .wd-nw {
  white-space: nowrap;
}
/* 🔊 column (no % width: it would stretch the table) */
.wd-les-table .wd-tsay {
  width: 2rem;
  padding: 0.2rem 0 0.2rem 0.1rem;
}
.wd-tsay .wd-say {
  width: 1.8rem;
  height: 1.8rem;
  font-size: 0.82rem;
}
.wd-sayall {
  margin: 0.1rem 0 0.3rem;
}
@media (max-width: 480px) {
  .wd-les-table th,
  .wd-les-table td {
    padding: 0.3rem 0.35rem;
  }
}
.wd-dialog .wd-h3 {
  margin-top: 0.9rem;
}
.wd-les-ex {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}
.wd-les-ex li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.4rem 0;
}
.wd-say {
  appearance: none;
  border: 0;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--sub-alt);
  cursor: pointer;
  font-size: 0.95rem;
}
.wd-say:hover {
  background: var(--main);
}
.wd-les-err {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.5;
}
.wd-les-tip {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  background: var(--sub-alt);
  font-size: 0.88rem;
  line-height: 1.5;
}

.wd-cel,
.wd-newreg {
  text-align: center;
}
.wd-cel .wd-dlg-btns,
.wd-newreg .wd-dlg-btns {
  justify-content: center;
}
.wd-cel-ic,
.wd-newreg-ic {
  font-size: 3.6rem;
  line-height: 1;
  margin: 0.3rem 0 0.6rem;
  display: inline-block;
  animation: wd-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.wd-newreg-ic {
  font-size: 4rem;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0.3rem auto 0.6rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc, var(--main)) 55%, transparent) 0%, transparent 70%);
}
.wd-newreg .g-h {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.wd-cel-stats {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  margin: 1rem 0;
}
.wd-cel-stat {
  background: var(--sub-alt);
  border-radius: 0.6rem;
  padding: 0.6rem 0.4rem;
}
.wd-cel-stat b {
  display: block;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--main);
}

/* ================================================================ onboarding (view "placement") */

.wd-onb {
  max-width: 44rem;
  margin: 0 auto;
  padding-bottom: 2rem;
}
.wd-onb-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.wd-onb-h {
  font-size: 1.6rem;
  line-height: 1.25;
}
.wd-onb-lead {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0.5rem 0 0.2rem;
}
.wd-dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.75rem;
  color: var(--g-gloss);
}
.wd-dots li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.wd-dots span {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  font-size: 0.72rem;
}
.wd-dots li.cur {
  color: var(--text);
}
.wd-dots li.cur span {
  background: var(--main);
  color: var(--bg);
}
.wd-dots li.done span {
  background: color-mix(in srgb, var(--main) 40%, var(--bg));
  color: var(--text);
}
.wd-onb-hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.2rem;
}
.wd-onb-hero > div {
  flex: 1 1 16rem;
}
.wd-onb-owl {
  flex: none;
}
.wd-onb-owl > svg {
  animation: wd-bob 1.8s ease-in-out infinite alternate;
}
.wd-big {
  font-size: 4.5rem;
  line-height: 1;
}
.wd-feat {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.wd-feat li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg);
  border-radius: 0.65rem;
  padding: 0.6rem 0.85rem;
}
.wd-feat-ic {
  font-size: 1.45rem;
  line-height: 1.1;
  flex: none;
}
.wd-feat b {
  font-weight: 500;
}
.wd-onb-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.wd-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.wd-avpicks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wd-avpick {
  --av: var(--sub);
  appearance: none;
  font: inherit;
  border: 2px solid transparent;
  background: var(--bg);
  color: var(--text);
  border-radius: 0.8rem;
  padding: 0.5rem 0.55rem 0.4rem;
  min-width: 4.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
}
.wd-avpick:hover {
  transform: translateY(-2px);
}
.wd-avpick small {
  font-size: 0.7rem;
  color: var(--g-gloss);
}
.wd-avpick-e {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  background: var(--sub-alt);
  background: color-mix(in srgb, var(--av) 25%, var(--sub-alt));
  box-shadow: inset 0 0 0 0.18rem var(--av);
}
.wd-avpick[aria-checked="true"],
.wd-choice[aria-checked="true"],
.wd-selfpick[aria-checked="true"] {
  border-color: var(--main);
  background: color-mix(in srgb, var(--main) 14%, var(--bg));
}
.wd-avpick[aria-checked="true"] small {
  color: var(--text);
}
.wd-choices {
  display: grid;
  gap: 0.7rem;
}
.wd-choice,
.wd-selfpick {
  appearance: none;
  font: inherit;
  border: 2px solid transparent;
  background: var(--bg);
  color: var(--text);
  border-radius: 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.wd-choice {
  padding: 0.9rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.wd-choice-ic {
  font-size: 1.9rem;
  line-height: 1.1;
}
.wd-choice-b {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.wd-choice-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wd-choice-top > b {
  font-size: 1.1rem;
  font-weight: 500;
}
.wd-choice-d {
  font-size: 0.8rem;
  color: var(--g-gloss);
  line-height: 1.45;
}
.wd-selfpicks {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.wd-selfpick {
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.wd-selfpick b {
  font-weight: 500;
}
.wd-warn {
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: 0.6rem;
  background: var(--bg);
  font-size: 0.88rem;
  line-height: 1.5;
}
.wd-res-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.wd-res-sk {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  background: var(--bg);
  border-radius: 0.7rem;
  padding: 0.8rem 0.6rem;
}
.wd-res-ic {
  font-size: 1.5rem;
  line-height: 1;
}
.wd-res-n {
  font-size: 0.85rem;
}
.wd-res-cefr {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--main);
}
.wd-res-reg {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--rc, var(--main)) 30%, var(--bg)), var(--bg) 70%);
}
.wd-res-reg .g-h {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wd-res-regic {
  font-size: 2.6rem;
  line-height: 1;
}

/* ================================================================ small screens */

@media (max-width: 640px) {
  .wd-hello {
    font-size: 1.25rem;
  }
  .wd-hud-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .wd-stat {
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.45rem 0.3rem;
    border-radius: 0.8rem;
    font-size: 0.82rem;
    text-align: center;
  }
  .wd-stat .g-en {
    display: none;
  }
  .wd-rstats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }
  .wd-rstat {
    min-width: 0;
    padding: 0.35rem 0.3rem;
  }
  .wd-rstat .g-en {
    display: none;
  }
  .wd-zones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .wd-zone {
    padding: 0.7rem 0.65rem;
  }
  .wd-bosses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .wd-techs {
    grid-template-columns: 1fr;
  }
  .wd-node-dot {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.1rem;
    border-width: 2px;
  }
  .wd-node-lbl {
    font-size: 0.62rem;
    padding: 0.08rem 0.35rem;
  }
  .wd-node-lbl .g-lv {
    display: none;
  }
  .wd-onb-card {
    padding: 1.1rem;
  }
  .wd-onb-h {
    font-size: 1.35rem;
  }
  .wd-rhead-t .g-h {
    font-size: 1.35rem;
  }
}
@media (max-width: 400px) {
  .wd-zones {
    grid-template-columns: 1fr;
  }
  .wd-step {
    flex-basis: 5rem;
  }
}

/* ================================================================ motion */

@keyframes wd-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--main) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0.7rem transparent;
  }
}
@keyframes wd-ring {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
@keyframes wd-glow {
  50% {
    outline-color: color-mix(in srgb, var(--main) 35%, transparent);
  }
}
@keyframes wd-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-4px);
  }
}
@keyframes wd-point {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}
@keyframes wd-flicker {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.08) rotate(-4deg);
  }
}
@keyframes wd-march {
  to {
    stroke-dashoffset: -24;
  }
}
@keyframes wd-drift {
  from {
    transform: translateX(-6px);
  }
  to {
    transform: translateX(22px);
  }
}
@keyframes wd-sail {
  from {
    transform: translate(356px, 206px) rotate(-3deg);
  }
  to {
    transform: translate(348px, 208px) rotate(3deg);
  }
}
@keyframes wd-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* reduced motion: FR.reducedMotion() puts .wd-still on the view root and on each dialog */
.wd-still *,
.wd-still *::before,
.wd-still *::after {
  animation: none !important;
  transition: none !important;
}
.wd-still .wd-node.cur .wd-node-dot::after,
.wd-still .wd-node.guide .wd-node-dot::after {
  opacity: 0.9;
  transform: scale(1.15);
}
