/* Hallo! — matériaux Liquid Glass de Révision Term, palette allemande. Clair par défaut, sombre via [data-theme="dark"]. */

:root {
  --font:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --blue: #c93242;
  --pink: #df574f;
  --green: #3b9b61;
  --orange: #dba52d;
  --indigo: #303238;
  --teal: #c79c3e;
  --red: #cb3342;
  --yellow: #edbd3d;
  --brown: #9b7950;

  --bg: #f3f1ed;
  --text: #0b0c10;
  --text-2: rgba(20, 22, 35, 0.64);
  --text-3: rgba(20, 22, 35, 0.42);
  --sep: rgba(20, 22, 40, 0.1);
  --fill: rgba(120, 125, 150, 0.12);
  --fill-2: rgba(120, 125, 150, 0.2);
  --link: #9f1f2d;
  --danger: #d70015;
  /* états juste / faux (stateBadge, verdict, .is-right / .is-wrong) : texte à 4,5:1 au moins sur les cartes et le
     fond, --on-ok / --on-ko sur un fond --ok / --ko ; bleu-vert contre rouge orangé, distincts en deutéranopie */
  --ok: #007585;
  --ko: #c43a12;
  --on-ok: #ffffff;
  --on-ko: #ffffff;

  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --card-rim: rgba(255, 255, 255, 0.9);
  --card-shadow:
    0 1px 1px rgba(42, 28, 25, 0.04), 0 14px 34px -14px rgba(64, 35, 29, 0.24);
  --glass: rgba(255, 255, 255, 0.24);
  --glass-strong: rgba(255, 255, 255, 0.55);
  --glass-rim-top: rgba(255, 255, 255, 0.95);
  --glass-rim-bottom: rgba(255, 255, 255, 0.25);
  --glass-shadow:
    0 10px 30px -8px rgba(58, 30, 25, 0.28), 0 2px 6px rgba(58, 30, 25, 0.08);
  --glass-sheen: 0.7;
  --wallpaper: 1;
  --field: rgba(255, 255, 255, 0.7);
  color-scheme: light;

  /* Barres fixes du bas, mesurées par app.js (watchChrome) :
     --tabbar-h : hauteur de la barre d'onglets du téléphone (0 quand elle est cachée) ;
     --chrome-bottom : hauteur d'écran couverte en bas par les barres fixes ou collées, marge de sécurité de l'iPhone comprise */
  --tabbar-h: 0px;
  --chrome-bottom: 0px;
}

:root[data-theme="dark"] {
  --bg: #0b090a;
  --text: #f5f6fa;
  --text-2: rgba(235, 238, 255, 0.66);
  --text-3: rgba(235, 238, 255, 0.42);
  --sep: rgba(255, 255, 255, 0.1);
  --fill: rgba(140, 145, 175, 0.16);
  --fill-2: rgba(140, 145, 175, 0.26);
  --link: #ffb2ba;
  --danger: #ff6961;
  --ok: #45cbe0;
  --ko: #ffa07a;
  --on-ok: #0b0c10;
  --on-ko: #0b0c10;

  --card: rgba(43, 36, 38, 0.7);
  --card-solid: #211c1d;
  --card-rim: rgba(255, 255, 255, 0.14);
  --card-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7);
  --glass: rgba(69, 54, 57, 0.3);
  --glass-strong: rgba(95, 99, 122, 0.46);
  --glass-rim-top: rgba(255, 255, 255, 0.35);
  --glass-rim-bottom: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 12px 34px -8px rgba(0, 0, 0, 0.7);
  --glass-sheen: 0.22;
  --wallpaper: 0.72;
  --field: rgba(20, 21, 30, 0.6);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  transition: background-color 300ms ease;
  /* défilement (focus clavier, reveal()) : jamais sous les barres du bas */
  scroll-padding-bottom: calc(var(--chrome-bottom) + 8px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Fond d'écran : taches de couleur douces, fixes derrière tout le contenu.
   Pas de filter: blur (recalculé au défilement sur téléphone) : les dégradés s'estompent seuls. */
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--wallpaper);
  background:
    radial-gradient(
      44% 48% at 12% 18%,
      rgba(36, 38, 42, 0.5),
      transparent 100%
    ),
    radial-gradient(
      40% 46% at 88% 12%,
      rgba(201, 50, 66, 0.4),
      transparent 100%
    ),
    radial-gradient(
      46% 50% at 78% 78%,
      rgba(229, 178, 44, 0.42),
      transparent 100%
    ),
    radial-gradient(
      42% 46% at 20% 88%,
      rgba(181, 30, 46, 0.32),
      transparent 100%
    ),
    radial-gradient(
      36% 40% at 50% 50%,
      rgba(238, 190, 51, 0.2),
      transparent 100%
    );
  transform: translateZ(0);
}

::selection {
  background: color-mix(in srgb, var(--blue) 30%, transparent);
}

a {
  color: var(--link);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent);
  outline-offset: 2px;
}

/* Titre ou zone qui reçoit le focus après un changement d'écran (settleScreen dans app.js) : pas de contour,
   ni au toucher ni au clavier, ce ne sont pas des commandes. */
h1[tabindex="-1"]:focus,
main[tabindex="-1"]:focus,
.focus-title[tabindex="-1"]:focus,
.card.result[tabindex="-1"]:focus {
  outline: none;
}

/* Liens d'évitement « Aller au contenu » (première touche Tab) et « Aller au menu » (Maj+Tab depuis le titre de
   l'écran) : invisibles tant qu'ils n'ont pas le focus clavier */
.skip-link,
.skip-menu {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 8px;
  z-index: 1000;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--card-solid);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--glass-shadow);
}

.skip-link:not(:focus),
.skip-menu:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

svg {
  display: block;
}

/* ---------- matériaux ---------- */

.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(190%) brightness(1.05);
  backdrop-filter: blur(16px) saturate(190%) brightness(1.05);
  box-shadow:
    var(--glass-shadow),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.18);
  isolation: isolate;
}

/* Liseré spéculaire : la lumière accroche le bord haut et s'éteint en bas */
/* dans la page, le verre repose sur une carte ou sur le fond : pas besoin de flou */
main .glass:not(.quiz-bar) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.glass::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    170deg,
    var(--glass-rim-top),
    var(--glass-rim-bottom) 40%,
    transparent 60%,
    var(--glass-rim-bottom)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.glass::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    120% 80% at 30% -20%,
    rgba(255, 255, 255, 0.45),
    transparent 55%
  );
  opacity: var(--glass-sheen);
}

/* Pas de backdrop-filter sur les cartes : derrière elles il n'y a que le fond déjà doux,
   et des dizaines de flous recalculés à chaque défilement faisaient ramer les téléphones */
.card {
  position: relative;
  background: var(--card);
  border-radius: 26px;
  box-shadow: var(--card-shadow);
}

.card::before {
  background: linear-gradient(180deg, var(--card-rim), transparent 35%);
}

/* ---------- boutons ---------- */

.btn {
  --c: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  /* un libellé trop long passe à la ligne (équilibrée) au lieu d'élargir la page */
  white-space: normal;
  text-wrap: balance;
  text-align: center;
  padding-block: 6px;
  color: #fff;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--c) 85%, white),
    var(--c)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 20px -6px color-mix(in srgb, var(--c) 70%, transparent);
  transition:
    transform 120ms var(--ease),
    filter 150ms ease;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: scale(0.97);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn.glass {
  color: var(--text);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
}

.btn.danger {
  --c: var(--red);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.block {
  width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.mini {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--fill);
  transition:
    background-color 150ms ease,
    transform 120ms var(--ease);
}

.mini:hover:not([disabled]) {
  background: var(--fill-2);
}

.mini:active:not([disabled]) {
  transform: scale(0.96);
}

.mini.danger {
  color: var(--danger);
}

.mini[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* ---------- duel façon Kahoot ---------- */

:root {
  --duel-red: #ff3b5c;
  --duel-blue: #1f7aff;
  --duel-amber: #ffad0a;
  --duel-green: #22c55e;
  --duel-gold: #ffc533;
  /* chiffres du jeu : police arrondie d'Apple quand elle existe */
  --duel-round: ui-rounded, "SF Pro Rounded", "Nunito", var(--font);
}

.seg-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 22px;
}

.seg-row .seg {
  flex: 1 1 300px;
  margin: 0;
}

.duel-link {
  min-height: 44px;
}

/* Éclairage de plateau : 4 projecteurs aux couleurs des réponses, qui suivent le moment du jeu */
#duel-arena {
  position: fixed;
  inset: -15%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  transition: opacity 600ms ease;
}

:root[data-theme="dark"] #duel-arena {
  opacity: 0.24;
}

/* les moments forts : salle d'attente, correction, podium */
#duel-arena[data-state="lobby"],
#duel-arena[data-state="right"],
#duel-arena[data-state="wrong"],
#duel-arena[data-state="end"] {
  opacity: 0.5;
}

:root[data-theme="dark"] #duel-arena[data-state="lobby"],
:root[data-theme="dark"] #duel-arena[data-state="right"],
:root[data-theme="dark"] #duel-arena[data-state="wrong"],
:root[data-theme="dark"] #duel-arena[data-state="end"] {
  opacity: 0.38;
}

/* chaque projecteur est un dégradé (pas de flou) ; seule sa position s'anime, sur sa propre couche */
#duel-arena i {
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--c), transparent);
  will-change: transform;
  animation: duel-drift 14s ease-in-out infinite alternate;
}

#duel-arena i:nth-child(1) {
  --c: var(--duel-red);
  left: -12%;
  top: -10%;
}
#duel-arena i:nth-child(2) {
  --c: var(--duel-blue);
  right: -12%;
  top: -12%;
  animation-delay: -4s;
}
#duel-arena i:nth-child(3) {
  --c: var(--duel-amber);
  left: -8%;
  bottom: -14%;
  animation-delay: -8s;
}
#duel-arena i:nth-child(4) {
  --c: var(--duel-green);
  right: -10%;
  bottom: -10%;
  animation-delay: -11s;
}

#duel-arena[data-state="question"] {
  opacity: 0.2;
}

#duel-arena[data-state="right"] i {
  --c: var(--duel-green);
}
#duel-arena[data-state="wrong"] i {
  --c: var(--duel-red);
}
#duel-arena[data-state="wrong"] i:nth-child(2n) {
  --c: #a3133a;
}
#duel-arena[data-state="end"] i {
  --c: var(--duel-gold);
}
#duel-arena[data-state="end"] i:nth-child(2) {
  --c: var(--duel-amber);
}
#duel-arena[data-state="end"] i:nth-child(3) {
  --c: #ff7a1a;
}

@keyframes duel-drift {
  to {
    transform: translate(8%, 10%) scale(1.15);
  }
}

/* ---------- accueil ---------- */

.duel-hero {
  margin: 40px 0 26px;
}

.duel-hero h1 {
  margin: 14px 0 6px;
  font-family: var(--duel-round);
  font-size: clamp(54px, 10vw, 84px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.duel-hero p {
  max-width: 34em;
  margin: 0;
  font-size: 18px;
  color: var(--text-2);
}

.duel-hero-shapes {
  display: flex;
  gap: 8px;
}

.duel-hero-shapes span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: var(--c);
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.2),
    0 8px 18px -8px var(--c);
  animation: duel-bob 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}

.duel-hero-shapes .duel-shape {
  width: 20px;
  height: 20px;
}

@keyframes duel-bob {
  50% {
    transform: translateY(-5px) rotate(-4deg);
  }
}

.duel-home {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 18px;
}

.duel-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 24px;
}

.duel-panel h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.duel-panel p {
  margin: 0;
}

.duel-code-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--sep);
  border-radius: 20px;
  text-align: center;
  font-family: var(--duel-round);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  font-variant-numeric: tabular-nums;
  background: var(--field);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.duel-code-input:focus {
  outline: none;
  border-color: var(--duel-blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--duel-blue) 22%, transparent);
}

.duel-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.duel-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--sep);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: var(--field);
}

.duel-seg {
  max-width: none;
  margin: 0;
}

/* Bouton d'action du jeu : épais, il s'enfonce quand on appuie */
.btn.duel-go {
  --c: var(--duel-blue);
  font-family: var(--duel-round);
  font-weight: 800;
  box-shadow:
    inset 0 -4px 0 rgba(0, 0, 0, 0.22),
    0 10px 22px -10px var(--c);
}

.btn.duel-go:active:not([disabled]) {
  transform: translateY(3px);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 4px 10px -6px var(--c);
}

.btn.duel-go.big {
  min-height: 58px;
  padding: 0 30px;
  font-size: 19px;
}

/* ---------- partie ---------- */

.duel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}

.duel-pill {
  overflow: hidden;
  max-width: 60%;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.duel-head-end {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  max-width: 70%;
}

.duel-head-end .duel-pill {
  max-width: none;
  min-width: 0;
}

/* code de la partie pendant le jeu : ouvre la fenêtre « Rejoindre la partie » */
.duel-code-pill,
.focus-code {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.duel-code-pill {
  border: 0;
  color: var(--text);
}

.duel-code-pill svg,
.focus-code svg {
  width: 16px;
  height: 16px;
}

.focus-code {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
  background: var(--fill);
}

.duel-code-pill:active,
.focus-code:active {
  transform: scale(0.96);
}

.duel-join-dialog .dialog-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.duel-join-dialog h2 {
  margin: 0;
}

.duel-join-dialog p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.duel-join-dialog .duel-digits span {
  width: 54px;
  height: 68px;
  border-radius: 16px;
  font-size: 42px;
}

.duel-qr.still {
  width: min(64vw, 260px);
  cursor: default;
}

.duel-qr.still:active {
  transform: none;
}

.duel-join-dialog .dialog-actions {
  justify-self: stretch;
  justify-content: center;
}

.duel-notice {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  background: color-mix(in srgb, var(--orange) 18%, var(--card));
}

.duel-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.duel-h2 {
  margin: 28px 0 12px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.duel-launch {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 26px;
  text-align: center;
}

.duel-launch .btn {
  min-width: min(320px, 100%);
}

.duel-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  font-weight: 600;
  color: var(--text-2);
}

.duel-dots {
  display: inline-flex;
  gap: 4px;
}

.duel-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: duel-dot 1.2s ease-in-out infinite;
}

.duel-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.duel-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes duel-dot {
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
  0%,
  80%,
  100% {
    opacity: 0.35;
  }
}

/* salle d'attente : le code comme un billet d'entrée */
.duel-ticket {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 26px 18px;
  text-align: center;
}

.duel-digits {
  display: flex;
  gap: clamp(8px, 2.4vw, 14px);
}

.duel-digits span {
  display: grid;
  place-items: center;
  width: clamp(62px, 18vw, 96px);
  height: clamp(80px, 23vw, 120px);
  border-radius: 22px;
  font-family: var(--duel-round);
  font-size: clamp(48px, 14vw, 78px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  animation: duel-flip 520ms var(--ease) both;
  animation-delay: calc(var(--i) * 90ms);
}

@keyframes duel-flip {
  from {
    opacity: 0;
    transform: translateY(14px) rotateX(70deg);
  }
}

.duel-lobby-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
}

.duel-lobby-bar h2 {
  margin: 0;
  font-size: 19px;
}

.duel-count-badge {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--duel-round);
  font-weight: 900;
  color: #fff;
  background: var(--duel-blue);
}

.duel-players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.duel-player {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  font-weight: 650;
  background: var(--card);
  box-shadow: var(--card-shadow);
  animation: duel-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.duel-player.me {
  box-shadow:
    0 0 0 2px var(--duel-blue),
    var(--card-shadow);
}

.duel-player.off {
  opacity: 0.45;
}

.duel-guest-tag {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--fill);
}

/* QR code de la salle d'attente : noir sur blanc dans les deux thèmes ; touché, il s'agrandit (écran projeté) */
.duel-qr {
  display: block;
  width: 168px;
  margin-top: 6px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--card-shadow);
  cursor: zoom-in;
  aspect-ratio: 1;
  transition: width 260ms var(--ease);
}

.duel-qr.big {
  width: min(72vmin, 520px);
  cursor: zoom-out;
}

.duel-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.duel-qr:active {
  transform: scale(0.98);
}

/* entrée d'un visiteur sans compte : invité ou connexion */
.duel-gate .duel-hero-shapes {
  justify-content: center;
  margin-bottom: 16px;
}

.duel-gate .lede b {
  color: var(--text);
}

.duel-gate .form .btn {
  margin-top: 14px;
}

.duel-gate .duel-gate-or + .btn {
  margin-top: 0;
}

.duel-gate-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-3);
  font-size: 14px;
}

.duel-gate-or::before,
.duel-gate-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sep);
}

/* fin de partie d'un invité : créer son compte */
.duel-signup {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 22px;
  text-align: left;
}

.duel-signup h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.duel-signup p {
  margin: 0;
  color: var(--text-2);
}

.duel-signup .actions {
  margin-top: 6px;
}

@keyframes duel-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

/* écran du duel mis à jour sans changer (un autre joueur répond) : les entrées ne rejouent pas,
   sauf ce qui vient vraiment d'apparaître (.new : joueur qui arrive ; la réponse verrouillée est gardée telle quelle) */
.duel-still
  :is(
    .duel-digits span,
    .duel-player,
    button.duel-choice,
    .duel-choice.right,
    .duel-count i,
    .duel-verdict,
    .duel-rank li,
    .duel-end h1,
    .duel-podium .block,
    .duel-podium .step > :not(.block)
  ):not(.new) {
  animation: none;
}

@media (max-width: 520px) {
}

@media (max-width: 760px) {
}

@supports not (height: 100dvh) {
}

.duel-crown {
  font-size: 15px;
}

/* question */
.duel-q {
  margin-top: 16px;
}

.duel-qtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.duel-step {
  margin: 0;
  font-weight: 700;
  color: var(--text-2);
}

.duel-qcard {
  padding: 22px;
}

.duel-qcard .duel-step {
  margin-bottom: 6px;
  font-size: 14px;
}

.duel-qtext {
  margin: 0;
  font-size: clamp(21px, 3.4vw, 28px);
  line-height: 1.28;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.duel-321 {
  display: grid;
  place-items: center;
  height: clamp(160px, 34vh, 260px);
}

.duel-321 b {
  font-family: var(--duel-round);
  font-size: clamp(120px, 30vw, 200px);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(160deg, var(--duel-amber), var(--duel-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.duel-321 b.pop {
  animation: duel-321 900ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes duel-321 {
  from {
    opacity: 0;
    transform: scale(2.2);
  }
  60% {
    opacity: 1;
    transform: scale(1);
  }
}

/* chrono circulaire */
.duel-ring {
  position: relative;
  width: 58px;
  height: 58px;
}

.duel-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.duel-ring circle {
  fill: none;
  stroke-width: 5;
}

.duel-ring .track {
  stroke: var(--fill-2);
}

.duel-ring .arc {
  stroke: var(--duel-blue);
  stroke-linecap: round;
  transition:
    stroke-dashoffset 100ms linear,
    stroke 300ms ease;
}

.duel-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--duel-round);
  font-size: 21px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.duel-ring.low .arc {
  stroke: var(--duel-red);
}

.duel-ring.low b {
  color: var(--duel-red);
  animation: duel-beat 1s ease-in-out infinite;
}

@keyframes duel-beat {
  50% {
    transform: scale(1.18);
  }
}

/* les 4 boutons de réponse */
/* toujours 2 × 2, comme Kahoot : rouge ▲ et bleu ◆ en haut, jaune ● et vert ■ en bas */
.duel-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.duel-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 18px;
  border: 0;
  border-radius: 20px;
  text-align: left;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  background: var(--c);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.2),
    0 12px 24px -14px var(--c);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition:
    transform 110ms var(--ease),
    box-shadow 110ms var(--ease),
    opacity 250ms ease,
    filter 250ms ease;
}

button.duel-choice {
  animation: duel-in 360ms var(--ease) both;
  animation-delay: calc(var(--i) * 60ms);
}

@keyframes duel-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}

button.duel-choice:hover {
  filter: brightness(1.06);
}

button.duel-choice:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 -2px 0 rgba(0, 0, 0, 0.2),
    0 4px 10px -8px var(--c);
}

.duel-choice .duel-shape {
  flex: none;
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.duel-choice.faded {
  opacity: 0.32;
  filter: saturate(0.5);
}

.duel-choice.right {
  animation: duel-pop 480ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.duel-choice.picked {
  outline: 4px solid var(--text);
  outline-offset: 3px;
}

.duel-count {
  position: relative;
  display: grid;
  place-items: center end;
  min-width: 64px;
  height: 30px;
  margin-left: auto;
  padding: 0 10px;
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--duel-round);
  font-weight: 900;
  background: rgba(0, 0, 0, 0.2);
}

.duel-count i {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(255, 255, 255, 0.3);
  animation: duel-grow 700ms var(--ease) both;
  transform-origin: left;
}

.duel-count em {
  position: relative;
  font-style: normal;
}

@keyframes duel-grow {
  from {
    transform: scaleX(0);
  }
}

/* réponse donnée : grande carte de la couleur choisie */
.duel-locked {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 30px 20px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  background: var(--c);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.2),
    0 16px 34px -16px var(--c);
  animation: duel-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.duel-locked .duel-shape {
  width: 44px;
  height: 44px;
}

.duel-locked strong {
  font-family: var(--duel-round);
  font-size: 26px;
  font-weight: 900;
}

.duel-status {
  margin: 16px 0 0;
  text-align: center;
  font-weight: 600;
  color: var(--text-2);
}

/* correction */
.duel-verdict {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 6px 0 14px;
  padding: 18px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  background: var(--duel-green);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.18),
    0 16px 34px -16px var(--duel-green);
  animation: duel-pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.duel-verdict.ko {
  background: var(--duel-red);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.18),
    0 16px 34px -16px var(--duel-red);
}

.duel-verdict strong {
  font-family: var(--duel-round);
  font-size: 34px;
  font-weight: 900;
  line-height: 1.1;
}

.duel-gain {
  font-family: var(--duel-round);
  font-size: 20px;
  font-weight: 800;
}

.duel-gain b {
  font-variant-numeric: tabular-nums;
}

.duel-streak {
  margin-top: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.18);
}

.duel-explain {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.45;
  background: var(--card);
}

/* classement */
.duel-rank {
  margin: 0;
  padding: 8px;
  list-style: none;
}

.duel-rank li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  font-weight: 650;
  animation: duel-in 360ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

.duel-rank li.me {
  background: color-mix(in srgb, var(--duel-blue) 16%, transparent);
}

.duel-rank li.gap {
  justify-content: center;
  padding: 0;
  color: var(--text-3);
}

.duel-rank .pos {
  width: 22px;
  font-family: var(--duel-round);
  font-weight: 900;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.duel-rank .name {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-rank .move {
  font-size: 12px;
  font-weight: 800;
}

.duel-rank .move.up {
  color: var(--duel-green);
}

.duel-rank .move.down {
  color: var(--duel-red);
}

.duel-rank .streak {
  font-size: 13px;
}

.duel-rank .pts {
  margin-left: auto;
  font-family: var(--duel-round);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* podium */
.duel-end {
  margin-top: 20px;
  text-align: center;
}

.duel-end h1 {
  margin: 6px 0 0;
  font-family: var(--duel-round);
  font-size: clamp(36px, 8vw, 58px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  animation: duel-pop 600ms 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.duel-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  max-width: 540px;
  margin: 26px auto 22px;
}

.duel-podium .step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.duel-podium .step strong {
  overflow: hidden;
  max-width: 100%;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-podium .step > span:not(.duel-crown) {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}

.duel-podium .block {
  display: grid;
  place-items: start center;
  width: 100%;
  padding-top: 12px;
  margin-top: 6px;
  border-radius: 20px 20px 8px 8px;
  font-family: var(--duel-round);
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18);
  transform-origin: bottom;
  animation: duel-rise 700ms var(--ease) both;
}

.duel-podium .s1 .block {
  height: 168px;
  background: linear-gradient(180deg, var(--duel-gold), #dba52d);
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.15),
    0 18px 40px -16px #dba52d;
}

.duel-podium .s2 .block {
  height: 122px;
  background: linear-gradient(180deg, #c9d1e0, #8e99ad);
}

.duel-podium .s3 .block {
  height: 90px;
  background: linear-gradient(180deg, #e8a77a, #b86b3c);
}

/* montée dans l'ordre : 3e, 2e, puis 1er */
.duel-podium .s3 .block {
  animation-delay: 0.2s;
}
.duel-podium .s2 .block {
  animation-delay: 0.7s;
}
.duel-podium .s1 .block {
  animation-delay: 1.2s;
}

.duel-podium .step > :not(.block) {
  animation: duel-pop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.duel-podium .s3 > :not(.block) {
  animation-delay: 0.6s;
}
.duel-podium .s2 > :not(.block) {
  animation-delay: 1.1s;
}
.duel-podium .s1 > :not(.block) {
  animation-delay: 1.6s;
}

.duel-crown.big {
  font-size: 34px;
  line-height: 1;
}

@keyframes duel-rise {
  from {
    transform: scaleY(0);
  }
}

.duel-mine {
  display: grid;
  gap: 2px;
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
}

.duel-mine strong {
  font-family: var(--duel-round);
  font-size: 26px;
  font-weight: 900;
}

.duel-mine span {
  color: var(--text-2);
}

.duel-end .duel-h2,
.duel-end .duel-rank {
  text-align: left;
}

.duel-confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}

.duel-confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: var(--w);
  height: calc(var(--w) * 1.6);
  border-radius: 2px;
  background: var(--c);
  animation: duel-fall var(--t) var(--d) cubic-bezier(0.3, 0.6, 0.5, 1) forwards;
  opacity: 0;
}

@keyframes duel-fall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translate(var(--drift), 105vh) rotate(var(--r));
  }
}

/* sur téléphone : la forme au-dessus du texte, pour garder 2 cases par ligne */
@media (max-width: 560px) {
  .duel-choices {
    gap: 8px;
  }
  .duel-choice {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    min-height: 118px;
    padding: 12px;
    border-radius: 16px;
    font-size: 16px;
    overflow-wrap: anywhere;
  }
  .duel-choice .duel-shape {
    width: 24px;
    height: 24px;
  }
  .duel-choice.result {
    min-height: 104px;
  }
  .duel-count {
    position: absolute;
    right: 8px;
    top: 8px;
    min-width: 44px;
    height: 26px;
  }
  .duel-podium .block {
    font-size: 32px;
  }
  .duel-podium .s1 .block {
    height: 140px;
  }
  .duel-podium .s2 .block {
    height: 104px;
  }
  .duel-podium .s3 .block {
    height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #duel-arena i,
  .duel-hero-shapes span,
  .duel-dots i,
  .duel-ring.low b {
    animation: none;
  }
  .duel-digits span,
  .duel-player,
  button.duel-choice,
  .duel-choice.right,
  .duel-locked,
  .duel-verdict,
  .duel-rank li,
  .duel-321 b.pop,
  .duel-end h1,
  .duel-podium .block,
  .duel-podium .step > :not(.block),
  .duel-count i {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  #duel-arena {
    display: none;
  }
}

/* Hallo! — mêmes matières et couleurs que Révision Term, parcours d’allemand. */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
button {
  font: inherit;
}
button svg,
a svg {
  flex: none;
}
a {
  color: var(--link);
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  letter-spacing: -0.025em;
}
h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  margin: 0 0 12px;
  font-weight: 750;
}
h2 {
  font-size: 25px;
  line-height: 1.2;
  margin: 0 0 12px;
}
h3 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 8px;
}
p {
  margin: 0 0 14px;
}
.ha-icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
}
.ha-brand-icon {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  box-shadow: 0 3px 8px #4457af25;
}
.ha-muted {
  color: var(--text-2);
}
.ha-small {
  font-size: 14px;
}
.ha-eyebrow {
  font-size: 14px;
  font-weight: 650;
  color: var(--link);
  margin: 0 0 12px;
}
.ha-main {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 44px 28px 90px;
  animation: ha-enter 0.25s var(--ease);
}
.ha-header {
  position: sticky;
  top: 12px;
  z-index: 35;
  max-width: 1420px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  pointer-events: none;
}
.ha-header > * {
  pointer-events: auto;
}
.ha-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 17px 8px 9px;
  border-radius: 28px;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
.ha-brand small {
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 600;
  margin-left: 5px;
  color: var(--text-2);
}
.ha-nav {
  display: flex;
  gap: 2px;
  border-radius: 29px;
  padding: 5px;
  margin: auto;
}
.ha-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  padding: 11px 15px;
  border-radius: 23px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.ha-nav a .ha-icon {
  width: 18px;
  height: 18px;
}
.ha-nav a[aria-current="page"] {
  color: var(--link);
  background: var(--glass-strong);
  box-shadow:
    inset 0 0.5px 0 #ffffffe6,
    0 2px 8px #141e501f;
}
.ha-user-menu {
  display: flex;
  gap: 8px;
}
.ha-round {
  border: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
}
.ha-pagehead {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.ha-pagehead > div:first-child {
  max-width: 760px;
}
.ha-pagehead .ha-sub {
  max-width: 680px;
}
.ha-sub {
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-2);
  margin-bottom: 0;
}
.ha-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  background: var(--fill);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.ha-pill.blue {
  color: var(--link);
  background: color-mix(in srgb, var(--blue) 10%, var(--card));
}
.ha-stack {
  display: grid;
  gap: 16px;
}
.ha-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.ha-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ha-card {
  padding: 26px;
  min-width: 0;
}
.ha-section {
  margin: 34px 0 16px;
}
.ha-section-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 16px;
}
.ha-section-row h2 {
  margin: 0;
}
.ha-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.ha-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 21px;
  border: 0;
  border-radius: 25px;
  background: var(--blue);
  color: white;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  box-shadow:
    inset 0 1px 0 #ffffff55,
    0 7px 16px -7px #c9324299;
  transition:
    transform 0.15s var(--ease),
    filter 0.15s;
}
.ha-btn:hover {
  filter: brightness(1.05);
}
.ha-btn:active {
  transform: scale(0.97);
}
.ha-btn.secondary {
  background: var(--glass-strong);
  color: var(--link);
  box-shadow:
    inset 0 0.5px 0 #ffffff88,
    0 3px 9px #24325414;
}
.ha-btn.ghost {
  background: transparent;
  box-shadow: none;
  color: var(--link);
  padding-inline: 13px;
}
.ha-btn.danger {
  background: var(--danger);
  color: white;
}
.ha-btn.small {
  font-size: 14px;
  min-height: 40px;
  padding: 9px 16px;
}
.ha-btn.full {
  width: 100%;
}
.ha-field {
  display: grid;
  gap: 7px;
  text-align: left;
  min-width: 0;
}
.ha-field > span {
  font-size: 14px;
  font-weight: 650;
}
.ha-input,
.ha-select,
.ha-textarea {
  width: 100%;
  min-height: 49px;
  background: var(--field);
  border: 1px solid var(--sep);
  border-radius: 15px;
  padding: 12px 14px;
  font-size: 17px;
  color: var(--text);
  font: inherit;
  line-height: 1.3;
}
.ha-input::placeholder {
  color: var(--text-3);
}
.ha-input:focus,
.ha-select:focus {
  border-color: var(--blue);
}
.ha-form {
  display: grid;
  gap: 18px;
}
.ha-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.ha-password {
  position: relative;
  display: flex;
}
.ha-password input {
  padding-right: 50px;
}
.ha-password button {
  position: absolute;
  right: 5px;
  top: 4px;
  width: 41px;
  height: 41px;
  border: 0;
  background: none;
  color: var(--text-2);
  display: grid;
  place-items: center;
}
.ha-error {
  padding: 13px 16px;
  border-radius: 14px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, var(--card));
  font-weight: 550;
  line-height: 1.4;
  margin: 0;
}
.ha-error:empty {
  display: none;
}
.ha-notice {
  border-radius: 19px;
  padding: 17px 20px;
  background: color-mix(in srgb, var(--blue) 8%, var(--card));
  color: var(--text-2);
  font-size: 15px;
}
.ha-notice strong {
  color: var(--text);
}
.ha-loading {
  display: grid;
  place-items: center;
  min-height: 250px;
  color: var(--text-2);
}
.ha-loading:before {
  content: "";
  width: 25px;
  height: 25px;
  margin-bottom: 15px;
  border: 3px solid var(--fill-2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: ha-spin 1s linear infinite;
}
.ha-back {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 20px;
}
.ha-empty {
  padding: 36px 26px;
  text-align: center;
}
.ha-empty .ha-icon {
  width: 42px;
  height: 42px;
  color: var(--blue);
  margin: 0 auto 16px;
  display: block;
}
.ha-empty p {
  color: var(--text-2);
  max-width: 500px;
  margin-inline: auto;
}
.ha-statbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.ha-stat {
  padding: 20px;
  border-radius: 23px;
}
.ha-stat strong {
  display: block;
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.ha-stat span {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 550;
}
.ha-hero {
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  overflow: hidden;
}
.ha-hero h2 {
  font-size: clamp(25px, 3.5vw, 35px);
  max-width: 650px;
  margin: 9px 0 12px;
}
.ha-hero p {
  max-width: 630px;
  color: var(--text-2);
  font-size: 17px;
}
.ha-greeting {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-2);
  margin: 0 0 8px;
}
.ha-start-steps {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 23px 0 0;
  font-size: 14px;
  color: var(--text-2);
}
.ha-start-steps span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.ha-start-steps b {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  background: var(--fill);
  color: var(--text);
  font-size: 12px;
}
.ha-progress {
  height: 8px;
  overflow: hidden;
  background: var(--fill);
  border-radius: 8px;
}
.ha-progress > span {
  display: block;
  height: 100%;
  background: var(--c, var(--blue));
  border-radius: inherit;
  transition: width 0.35s;
}
.ha-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 7px;
}
.ha-unit {
  overflow: hidden;
  margin-bottom: 23px;
}
.ha-unit-head {
  padding: 25px 27px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 17px;
  align-items: center;
  border-bottom: 1px solid var(--sep);
}
.ha-unit-number {
  width: 54px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: var(--c, var(--blue));
  background: color-mix(in srgb, var(--c, var(--blue)) 12%, var(--card-solid));
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ha-unit-head h2 {
  font-size: 23px;
  margin-bottom: 5px;
}
.ha-unit-head p {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
}
.ha-lessons {
  padding: 4px 16px;
}
.ha-lesson-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 17px 11px;
  color: var(--text);
  border-bottom: 1px solid var(--sep);
  transition: background 0.15s;
}
.ha-lesson-row:last-child {
  border-bottom: 0;
}
.ha-lesson-row:hover {
  background: var(--fill);
  border-radius: 15px;
}
.ha-lesson-row > div > strong {
  font-size: 17px;
}
.ha-lesson-row p {
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 0 0;
}
.ha-lesson-node {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
}
.ha-lesson-node.done {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, var(--card-solid));
}
.ha-lesson-node.next {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 5px 16px -5px #c9324288;
}
.ha-lesson-side {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-2);
}
.ha-lesson-side small {
  font-size: 13px;
}
.ha-skill-list {
  display: grid;
  gap: 19px;
}
.ha-skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.ha-skill-row > div:first-child strong {
  font-weight: 600;
  font-size: 16px;
}
.ha-skill-row > div:first-child p {
  font-size: 13px;
  color: var(--text-2);
  margin: 3px 0 9px;
}
.ha-skill-row > span {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  padding-top: 2px;
}
.ha-review-card .ha-icon {
  color: var(--indigo);
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
}
.ha-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.ha-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--sep);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.ha-list li:last-child {
  border: 0;
}
.ha-list li > div {
  min-width: 0;
}
.ha-list p {
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 0 0;
}
.ha-reading {
  max-width: 780px;
}
.ha-reading .ha-card {
  margin-bottom: 18px;
}
.ha-reading p {
  line-height: 1.7;
}
.ha-reading h2 {
  font-size: 23px;
  margin-bottom: 15px;
}
.ha-example {
  border-left: 3px solid var(--blue);
  padding: 11px 17px;
  background: color-mix(in srgb, var(--blue) 5%, var(--card));
  border-radius: 0 13px 13px 0;
  margin: 15px 0;
}
.ha-example strong {
  display: block;
  font-size: 19px;
  margin-bottom: 3px;
}
.ha-example span {
  font-size: 15px;
  color: var(--text-2);
}
.ha-lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
.ha-lesson-aside {
  position: sticky;
  top: 95px;
}
.ha-lesson-aside .ha-actions {
  display: grid;
}
.ha-vocab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 0;
}
.ha-vocab > div {
  padding: 11px 0;
  border-bottom: 1px solid var(--sep);
}
.ha-vocab dt {
  font-weight: 650;
}
.ha-vocab dd {
  margin: 3px 0 0;
  color: var(--text-2);
  font-size: 15px;
}
.ha-source {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 23px;
}
.ha-source a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ha-focus-header {
  max-width: 1000px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px auto 0;
  padding: 0 25px;
}
.ha-focus-header > a {
  color: var(--text-2);
  font-weight: 650;
  display: flex;
  gap: 5px;
  align-items: center;
}
.ha-focus-header .ha-progress {
  flex: 1;
  height: 10px;
}
.ha-focus-header > span {
  font-size: 14px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ha-exercise-main {
  max-width: 830px;
  margin: 0 auto;
  padding: 44px 25px 130px;
  animation: ha-enter 0.25s var(--ease);
}
.ha-exercise-type {
  font-size: 14px;
  font-weight: 650;
  color: var(--link);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}
.ha-exercise-main h1 {
  font-size: clamp(25px, 4vw, 35px);
  line-height: 1.3;
  letter-spacing: -0.025em;
  max-width: 730px;
  margin-bottom: 26px;
}
.ha-exercise-sentence {
  padding: 20px 24px;
  border-radius: 21px;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 22px;
}
.ha-choice-list {
  display: grid;
  gap: 12px;
}
.ha-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-height: 66px;
  padding: 15px 20px;
  text-align: left;
  border-radius: 19px;
  border: 2px solid transparent;
  background: var(--card);
  box-shadow: var(--card-shadow);
  color: var(--text);
  font-size: 18px;
  line-height: 1.4;
  transition:
    border-color 0.12s,
    background 0.12s,
    transform 0.12s;
}
.ha-choice:hover:not(:disabled) {
  border-color: var(--fill-2);
}
.ha-choice.selected {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--card-solid));
  box-shadow: 0 3px 16px #c9324216;
}
.ha-choice > span:first-child {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--sep);
  background: var(--field);
}
.ha-choice.selected > span:first-child {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.ha-answer-input {
  min-height: 115px;
  font-size: 22px;
  resize: vertical;
  background: var(--card);
  padding: 20px 23px;
}
.ha-special-chars {
  display: flex;
  gap: 7px;
  margin-top: 11px;
  flex-wrap: wrap;
}
.ha-special-chars button {
  border: 1px solid var(--sep);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  min-width: 43px;
  height: 43px;
  font-weight: 650;
}
.ha-token-area {
  min-height: 105px;
  padding: 18px;
  border-radius: 20px;
  border: 2px dashed var(--sep);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 9px;
}
.ha-token-area.filled {
  border-style: solid;
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 4%, var(--card));
}
.ha-token-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 65px;
  margin-top: 18px;
}
.ha-token {
  min-height: 45px;
  border: 1px solid var(--sep);
  border-bottom-width: 3px;
  border-radius: 12px;
  padding: 10px 17px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 18px;
}
.ha-token:disabled {
  visibility: hidden;
}
.ha-token-placeholder {
  margin: 12px;
  color: var(--text-3);
  font-size: 15px;
}
.ha-exercise-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 23px;
}
.ha-hint {
  margin-top: 18px;
  padding: 17px 20px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--yellow) 15%, var(--card));
  font-size: 16px;
}
.ha-answer-dock {
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  padding: 17px 25px max(17px, env(safe-area-inset-bottom));
  background: var(--card-solid);
  border-top: 1px solid var(--sep);
}
.ha-dock-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.ha-answer-dock.correct {
  background: color-mix(in srgb, var(--ok) 10%, var(--card-solid));
}
.ha-answer-dock.incorrect {
  background: color-mix(in srgb, var(--ko) 9%, var(--card-solid));
}
.ha-verdict {
  flex: 1;
  min-width: 0;
}
.ha-verdict strong {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}
.ha-verdict p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.45;
  max-width: 630px;
}
.ha-verdict.correct strong {
  color: var(--ok);
}
.ha-verdict.incorrect strong {
  color: var(--ko);
}
.ha-result {
  max-width: 700px;
  margin: 30px auto;
  text-align: center;
}
.ha-result-icon {
  width: 100px;
  height: 100px;
  border-radius: 29px;
  display: grid;
  place-items: center;
  margin: 0 auto 25px;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, var(--card-solid));
  transform: rotate(-6deg);
}
.ha-result-icon svg {
  width: 55px;
  height: 55px;
}
.ha-result h1 {
  font-size: 38px;
}
.ha-result .ha-statbar {
  margin-top: 27px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ha-result .ha-actions {
  justify-content: center;
}
.ha-auth {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 65px 30px;
  min-height: calc(100dvh - 70px);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 70px;
  align-items: center;
}
.ha-auth-story {
  padding: 0 10px;
}
.ha-auth-story h1 {
  font-size: clamp(58px, 7vw, 86px);
  line-height: 0.99;
  letter-spacing: -0.065em;
  font-weight: 800;
  margin: 21px 0;
}
.ha-auth-story h1 span {
  color: var(--blue);
}
.ha-auth-story > p {
  color: var(--text-2);
  font-size: 20px;
  line-height: 1.5;
  max-width: 440px;
}
.ha-auth-story .ha-eyebrow {
  font-size: 15px;
  color: var(--link);
}
.ha-auth-card {
  padding: 31px;
  border-radius: 30px;
}
.ha-auth-card h2 {
  font-size: 26px;
  margin-bottom: 7px;
}
.ha-auth-card > p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 24px;
}
.ha-auth-note {
  margin: 23px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}
.ha-auth-features {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 30px 0;
}
.ha-auth-features > span {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 16px;
}
.ha-auth-features svg {
  color: var(--blue);
}
.ha-auth-foot {
  font-size: 13px !important;
  color: var(--text-3) !important;
}
.ha-brand-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 28px 0;
}
.ha-toolbar {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  align-items: center;
  flex-wrap: wrap;
}
.ha-toolbar .ha-input {
  max-width: 350px;
}
.ha-toolbar .ha-select {
  max-width: 210px;
}
.ha-table-wrap {
  overflow-x: auto;
  border-radius: 24px;
}
.ha-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.ha-table th {
  text-align: left;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  padding: 18px 20px;
  white-space: nowrap;
  background: var(--fill);
}
.ha-table td {
  padding: 17px 20px;
  border-bottom: 1px solid var(--sep);
  vertical-align: middle;
}
.ha-table tr:last-child td {
  border-bottom: 0;
}
.ha-table tbody tr:hover {
  background: var(--fill);
}
.ha-table a {
  font-weight: 650;
}
.ha-table .ha-small {
  display: block;
  margin-top: 3px;
  color: var(--text-2);
}
.ha-table .ha-progress {
  min-width: 90px;
}
.ha-table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ha-table code {
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.ha-dialog {
  border: 0;
  padding: 0;
  border-radius: 29px;
  background: var(--card-solid);
  color: var(--text);
  box-shadow: 0 25px 100px #0004;
  max-width: min(620px, calc(100vw - 32px));
  width: 100%;
  max-height: calc(100dvh - 40px);
  overflow: auto;
}
.ha-dialog::backdrop {
  background: #0b123748;
  backdrop-filter: blur(7px);
}
.ha-dialog-body {
  padding: 29px;
}
.ha-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}
.ha-dialog-head h2 {
  font-size: 25px;
  margin: 0;
}
.ha-close {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 50%;
  border: 0;
  background: var(--fill);
  color: var(--text-2);
  flex: none;
}
.ha-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.ha-code-card {
  text-align: center;
  padding: 26px 20px;
  border-radius: 21px;
  background: var(--fill);
  margin: 15px 0 20px;
}
.ha-code-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  user-select: all;
  overflow-wrap: anywhere;
}
.ha-code-card p {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 7px;
}
.ha-code-card code {
  display: block;
  font-size: 23px;
  margin-top: 7px;
  user-select: all;
}
.ha-toasts {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 35px);
}
.ha-toast {
  background: var(--card-solid);
  color: var(--text);
  padding: 13px 20px;
  border-radius: 22px;
  box-shadow: var(--glass-shadow);
  font-size: 14px;
  font-weight: 550;
}
.ha-student-heading {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ha-account-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--sep);
  font-size: 15px;
}
.ha-account-info:last-child {
  border: 0;
}
.ha-account-info > span {
  color: var(--text-2);
}
.ha-account-info strong {
  font-weight: 600;
  text-align: right;
}
.ha-mobile-more {
  display: none;
}
.ha-footer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
  margin-top: 35px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.ha-footer a {
  color: var(--text-2);
}
.ha-quiz-intro {
  font-size: 16px;
  color: var(--text-2);
}
.ha-main.duel-main {
  max-width: 1050px;
}
.ha-main .duel-head {
  margin-top: 0;
}
.ha-main .duel-head .ha-back {
  margin: 0;
}
.ha-main .duel-lobby {
  margin-top: 25px;
}
.ha-main .duel-ticket {
  padding-top: 10px;
}
.ha-main .duel-digits {
  justify-content: center;
}
.ha-main .duel-qr {
  margin-top: 18px;
}
.ha-main .duel-lobby-bar {
  margin-top: 25px;
}
.ha-main .duel-lobby-bar h2 {
  margin: 0;
}
.ha-main .duel-player {
  font-size: 17px;
}
.ha-main .duel-qcard {
  padding: 27px;
}
.ha-main .duel-h2 {
  margin-top: 26px;
}
.ha-main .duel-go {
  padding-block: 12px;
  line-height: 1.25;
}
.ha-main .duel-qtext {
  line-height: 1.4;
}
.ha-host-banner {
  padding: 12px 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue) 9%, var(--card));
  color: var(--link);
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 20px;
  display: flex;
  gap: 9px;
  align-items: center;
}
.ha-projection .ha-header {
  display: none;
}
.ha-projection .ha-main {
  padding-top: 20px;
  max-width: 1250px;
}
.ha-projection .duel-qtext {
  font-size: clamp(28px, 4vw, 48px);
}
.ha-projection .duel-choice {
  font-size: clamp(20px, 2.5vw, 30px);
  min-height: 100px;
}
.ha-project-btn {
  white-space: nowrap;
}
.ha-answer-dock .ha-btn {
  flex: none;
  min-width: 150px;
}
.ha-diagnostic-note {
  max-width: 580px;
  margin: 20px auto 0;
}
.ha-lesson-summary {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 13px;
}
.ha-lesson-summary li {
  display: flex;
  gap: 10px;
  color: var(--text-2);
  font-size: 15px;
}
.ha-lesson-summary .ha-icon {
  color: var(--blue);
  width: 19px;
  height: 19px;
  margin-top: 2px;
}
.ha-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}
.ha-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}
.ha-check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}
.ha-empty-search {
  padding: 30px;
  text-align: center;
  color: var(--text-2);
}
.ha-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--sep);
}
.ha-toggle-row label {
  font-weight: 600;
}
.ha-toggle-row p {
  color: var(--text-2);
  font-size: 14px;
  margin: 5px 0 0;
}
.ha-toggle-row select {
  max-width: 150px;
}
.ha-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.ha-due {
  color: var(--ko);
}
.ha-divider {
  border: 0;
  border-top: 1px solid var(--sep);
  margin: 22px 0;
}
.ha-text-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font: inherit;
  font-size: inherit;
}
.ha-privacy-list {
  padding-left: 20px;
  color: var(--text-2);
  line-height: 1.7;
}
.ha-offline {
  background: var(--card-solid);
  padding: 12px 25px;
  color: var(--ko);
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid var(--sep);
}
@keyframes ha-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes ha-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1250px) {
  .ha-main {
    padding-top: 52px;
  }
  .ha-nav a {
    padding-inline: 16px;
  }
}
@media (max-width: 1100px) {
  .ha-header {
    gap: 10px;
    padding: 0 18px;
  }
  .ha-brand small {
    display: none;
  }
  .ha-nav a {
    font-size: 13px;
    padding: 11px 12px;
    gap: 6px;
  }
  .ha-nav a .ha-icon {
    display: none;
  }
  .ha-auth {
    gap: 40px;
    grid-template-columns: 1fr 390px;
  }
  .ha-main {
    padding-inline: 25px;
  }
  .ha-lesson-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
}
@media (max-width: 820px) {
  .ha-header {
    top: 10px;
    padding: 0 16px;
  }
  .ha-brand {
    font-size: 21px;
    padding-right: 15px;
  }
  .ha-nav {
    position: fixed;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 620px;
    justify-content: space-around;
    box-shadow: 0 5px 30px #1a255733;
    backdrop-filter: blur(22px) saturate(180%);
    background: var(--glass-strong);
  }
  .ha-nav a {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    min-width: 57px;
    min-height: 51px;
    justify-content: center;
    flex: 1;
  }
  .ha-nav a .ha-icon {
    display: block;
    width: 20px;
    height: 20px;
  }
  .ha-user-menu {
    margin-left: auto;
  }
  .ha-main {
    padding-bottom: 125px;
    padding-top: 35px;
  }
  .ha-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ha-auth {
    grid-template-columns: 1fr 365px;
    gap: 25px;
    padding: 50px 25px;
  }
  .ha-auth-story h1 {
    font-size: 62px;
  }
  .ha-auth-story > p {
    font-size: 18px;
  }
  .ha-auth-features {
    margin: 24px 0;
  }
  .ha-auth-features > span {
    font-size: 14px;
  }
  .ha-lesson-layout {
    grid-template-columns: 1fr;
  }
  .ha-lesson-aside {
    position: static;
    grid-row: 1;
  }
  .ha-lesson-aside .ha-lesson-summary {
    display: none;
  }
  .ha-lesson-aside .ha-actions {
    display: flex;
    margin-top: 0;
  }
  .ha-lesson-aside .ha-card {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
  }
  .ha-lesson-aside h3 {
    margin: 0;
    font-size: 17px;
  }
  .ha-statbar {
    gap: 10px;
  }
  .ha-stat {
    padding: 17px;
  }
  .ha-pagehead {
    gap: 16px;
  }
  .ha-pagehead .ha-actions {
    margin-top: 0;
  }
  .ha-main.duel-main {
    padding-bottom: 110px;
  }
  .ha-main.duel-main .duel-choices {
    gap: 12px;
  }
  .ha-main.duel-main .duel-choice {
    min-height: 87px;
  }
}
@media (max-width: 620px) {
  .ha-auth {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 35px 22px 45px;
    min-height: 0;
    max-width: 470px;
  }
  .ha-auth-story {
    padding: 0 5px;
  }
  .ha-auth-story h1 {
    font-size: 59px;
    margin: 14px 0;
  }
  .ha-auth-story > p {
    font-size: 17px;
    margin-bottom: 0;
  }
  .ha-auth-features {
    display: none;
  }
  .ha-auth-story .ha-auth-foot {
    display: none;
  }
  .ha-auth-card {
    padding: 26px;
  }
  .ha-brand-banner {
    margin-inline: 22px;
  }
  .ha-header {
    top: 8px;
  }
  .ha-main {
    padding: 30px 18px 120px;
  }
  .ha-pagehead {
    display: block;
    margin-bottom: 24px;
  }
  .ha-pagehead .ha-actions {
    margin-top: 17px;
  }
  .ha-sub {
    font-size: 16px;
  }
  .ha-grid,
  .ha-grid.three {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .ha-statbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
  }
  .ha-stat strong {
    font-size: 27px;
  }
  .ha-stat {
    padding: 17px;
    border-radius: 20px;
  }
  .ha-card {
    padding: 22px;
  }
  .ha-hero {
    padding: 24px;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .ha-hero h2 {
    font-size: 27px;
  }
  .ha-hero p {
    font-size: 16px;
  }
  .ha-hero .ha-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ha-hero .ha-actions .ha-btn {
    width: 100%;
  }
  .ha-start-steps {
    gap: 12px;
    font-size: 13px;
  }
  .ha-unit-head {
    padding: 20px;
    grid-template-columns: auto 1fr;
    gap: 14px;
  }
  .ha-unit-head > .ha-pill {
    grid-column: 2;
    width: max-content;
    margin-top: -2px;
  }
  .ha-unit-number {
    width: 44px;
    height: 49px;
    font-size: 20px;
    border-radius: 14px;
    grid-row: 1 / 3;
  }
  .ha-unit-head h2 {
    font-size: 21px;
  }
  .ha-lessons {
    padding: 2px 10px;
  }
  .ha-lesson-row {
    gap: 12px;
    padding: 16px 7px;
  }
  .ha-lesson-row > div > strong {
    font-size: 16px;
  }
  .ha-lesson-node {
    width: 35px;
    height: 35px;
    font-size: 13px;
  }
  .ha-lesson-side small {
    display: none;
  }
  .ha-section-row h2,
  .ha-section {
    font-size: 23px;
  }
  .ha-vocab {
    grid-template-columns: 1fr;
  }
  .ha-lesson-aside .ha-card {
    display: block;
  }
  .ha-lesson-aside .ha-actions {
    margin-top: 12px;
  }
  .ha-lesson-aside .ha-actions .ha-btn {
    width: 100%;
  }
  .ha-exercise-main {
    padding: 32px 20px 165px;
  }
  .ha-focus-header {
    padding-inline: 18px;
    gap: 12px;
  }
  .ha-focus-header > a span {
    display: none;
  }
  .ha-exercise-main h1 {
    font-size: 26px;
  }
  .ha-choice {
    font-size: 17px;
    padding: 14px 16px;
    min-height: 63px;
  }
  .ha-answer-dock {
    padding: 15px 20px max(15px, env(safe-area-inset-bottom));
  }
  .ha-dock-inner {
    gap: 14px;
    flex-wrap: wrap;
  }
  .ha-answer-dock .ha-btn {
    min-width: 120px;
  }
  .ha-answer-dock.correct .ha-dock-inner,
  .ha-answer-dock.incorrect .ha-dock-inner {
    display: block;
  }
  .ha-answer-dock.correct .ha-btn,
  .ha-answer-dock.incorrect .ha-btn {
    margin-top: 12px;
    width: 100%;
  }
  .ha-verdict strong {
    font-size: 18px;
  }
  .ha-verdict p {
    font-size: 14px;
    max-height: 115px;
    overflow: auto;
  }
  .ha-exercise-tools {
    gap: 10px;
  }
  .ha-exercise-tools .ha-btn {
    font-size: 14px;
    padding-inline: 8px;
  }
  .ha-dialog-body {
    padding: 23px;
  }
  .ha-form-row {
    grid-template-columns: 1fr;
  }
  .ha-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
  .ha-toolbar .ha-input,
  .ha-toolbar .ha-select {
    max-width: none;
  }
  .ha-info-grid {
    grid-template-columns: 1fr;
  }
  .ha-result .ha-statbar {
    gap: 8px;
  }
  .ha-result .ha-stat {
    padding: 15px 10px;
  }
  .ha-result .ha-stat strong {
    font-size: 25px;
  }
  .ha-result h1 {
    font-size: 32px;
  }
  .ha-quiz-intro {
    font-size: 15px;
  }
  .ha-main .duel-digits {
    gap: 8px;
  }
  .ha-main .duel-digits span {
    width: 60px;
    height: 78px;
    font-size: 50px;
    border-radius: 20px;
  }
  .ha-main .duel-qcard {
    padding: 21px;
  }
  .ha-main.duel-main .duel-choice {
    padding: 12px;
    gap: 10px;
    font-size: 16px;
    min-height: 88px;
    border-radius: 17px;
  }
  .ha-main .duel-choice .duel-shape {
    width: 22px;
    height: 22px;
  }
  .ha-main .duel-count {
    min-width: 35px;
    padding: 0 6px;
    height: 25px;
    font-size: 13px;
  }
  .ha-main .duel-choice.result {
    flex-wrap: wrap;
  }
  .ha-main .duel-choice.result .duel-count {
    width: 100%;
    margin-left: 0;
  }
  .ha-main .duel-rank li {
    gap: 8px;
    padding: 12px;
  }
  .ha-main .duel-podium {
    gap: 8px;
  }
  .ha-main .duel-podium .step {
    min-width: 0;
  }
  .ha-main .duel-podium strong {
    font-size: 14px;
  }
  .ha-main .duel-lobby-bar {
    gap: 10px;
  }
  .ha-main .duel-lobby-bar h2 {
    font-size: 21px;
  }
  .ha-main .duel-look-btn {
    font-size: 13px;
    padding-inline: 12px;
  }
  .ha-main .duel-head {
    gap: 10px;
    flex-wrap: wrap;
  }
  .ha-host-banner {
    font-size: 13px;
    align-items: flex-start;
  }
  .ha-project-btn {
    font-size: 13px;
  }
  .ha-toasts {
    bottom: 95px;
  }
  .ha-reading .ha-card {
    padding: 22px;
  }
  .ha-reading p {
    font-size: 16px;
  }
  .ha-nav a {
    padding-inline: 5px;
    min-width: 45px;
  }
  .ha-nav:has(a:nth-child(7)) a {
    font-size: 10px;
    min-width: 39px;
  }
  .ha-nav:has(a:nth-child(7)) a .ha-icon {
    width: 18px;
    height: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .ha-loading:before {
    border-style: dotted;
  }
}
@media print {
  body::before,
  .ha-header,
  .ha-nav,
  .ha-answer-dock,
  .ha-user-menu,
  .ha-toasts,
  .ha-lesson-aside {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  .ha-main {
    padding: 0;
    max-width: none;
  }
  .card,
  .glass {
    box-shadow: none;
    background: white;
    border: 1px solid #ddd;
  }
  .ha-lesson-layout {
    display: block;
  }
  .ha-reading {
    max-width: none;
  }
  .ha-reading .ha-card {
    break-inside: avoid;
  }
  .ha-auth {
    display: none;
  }
}

/* L’attribut natif reste prioritaire sur les composants en grille. */
[hidden] {
  display: none !important;
}
.ha-placement {
  margin-bottom: 22px;
}
/* Le jaune garde sa couleur de jeu avec un texte lisible sur vidéoprojecteur. */
.duel-choice[style*="--duel-amber"] {
  color: #362400;
  text-shadow: none;
}

/* Exercices de manipulation : une réponse se prépare avant la correction. */
.ha-exercise-type {
  flex-wrap: wrap;
  row-gap: 5px;
}
.ha-format-title {
  font-weight: 500;
  color: var(--text-2);
}
.ha-format-separator {
  color: var(--text-3);
}
.ha-gap-text {
  font-size: clamp(23px, 4vw, 29px);
  line-height: 1.7;
}
.ha-gap-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 95px;
  min-height: 48px;
  margin: 0 5px;
  padding: 0 15px;
  border-radius: 12px;
  border-bottom: 3px solid var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--card-solid));
  color: var(--link);
  vertical-align: baseline;
}
.ha-gap-slot.filled {
  font-weight: 750;
}
.ha-gap-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 19px;
}
.ha-gap-choice {
  min-width: 100px;
  min-height: 53px;
}
.ha-gap-choice.selected {
  color: var(--link);
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, var(--card-solid));
}
.ha-word-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  padding: 24px;
  margin-bottom: 18px;
}
.ha-word-token {
  min-height: 53px;
  padding: 8px 11px;
  border: 2px solid transparent;
  border-bottom-color: var(--sep);
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 600;
  line-height: 1.35;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}
.ha-word-token:hover {
  background: var(--fill);
}
.ha-word-token.selected {
  border-color: var(--blue);
  color: var(--link);
  background: color-mix(in srgb, var(--blue) 10%, var(--card-solid));
}
.ha-match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.ha-match-column {
  display: grid;
  gap: 11px;
  align-content: start;
}
.ha-match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 14px 17px;
  border: 2px solid transparent;
  border-radius: 17px;
  box-shadow: var(--card-shadow);
  background: var(--card);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}
.ha-match-item:hover {
  border-color: var(--fill-2);
}
.ha-match-item.paired {
  border-color: color-mix(in srgb, var(--blue) 24%, transparent);
  background: color-mix(in srgb, var(--blue) 6%, var(--card));
}
.ha-match-item.selected {
  border-color: var(--blue);
  color: var(--link);
  background: color-mix(in srgb, var(--blue) 12%, var(--card-solid));
}
.ha-pair-number {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 12%, var(--card-solid));
  color: var(--link);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ha-match-status {
  min-height: 23px;
  margin: 17px 0 9px;
}
.ha-match-pairs {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 17px;
  overflow: hidden;
}
.ha-match-pairs:empty {
  display: none;
}
.ha-match-pairs li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--sep);
}
.ha-match-pairs li:last-child {
  border-bottom: 0;
}
.ha-pair-description {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}
.ha-pair-description strong {
  font-weight: 600;
}
.ha-match-remove {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text-2);
}
.ha-match-remove .ha-icon {
  width: 18px;
  height: 18px;
}
@media (max-width: 620px) {
  .ha-exercise-type {
    font-size: 12px;
    gap: 6px;
  }
  .ha-gap-slot {
    min-width: 75px;
    min-height: 43px;
    padding: 0 9px;
    margin: 0 3px;
  }
  .ha-gap-choices {
    gap: 9px;
  }
  .ha-gap-choice {
    min-width: 86px;
  }
  .ha-word-sentence {
    padding: 17px;
    gap: 5px;
  }
  .ha-word-token {
    min-height: 48px;
    font-size: 22px;
    padding: 7px 8px;
  }
  .ha-match-grid {
    gap: 11px;
  }
  .ha-match-column {
    gap: 9px;
  }
  .ha-match-item {
    min-height: 68px;
    padding: 12px 11px;
    border-radius: 15px;
    font-size: 15px;
    gap: 7px;
  }
  .ha-match-item .ha-pair-number {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }
}
.ha-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 22px;
}
.ha-resume .ha-btn {
  flex: none;
}
@media (max-width: 620px) {
  .ha-resume {
    flex-wrap: wrap;
  }
}


/* Mises en page des activités : fonctionnalités conservées. */
.ha-exercise-main h1,.ha-exercise-prompt { max-width: 27ch; margin: 0 0 38px; color: var(--text); font-size: clamp(25px,3vw,33px); font-weight: 740; line-height: 1.3; letter-spacing: -.03em; }
.ha-exercise-context { margin-bottom: 32px; }
.ha-token:disabled,.ha-token.is-used { visibility: visible; opacity: 1; color: transparent; background: var(--fill-2); border-color: var(--fill-2); box-shadow: 0 3px 0 var(--fill-2); pointer-events: none; }
.ha-input-mode { display: flex; justify-content: center; margin: 30px 0 0; }
.ha-input-mode .ha-btn,.ha-input-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 0; background: transparent; color: var(--text-2); box-shadow: none; padding: 8px 14px; font-size: 13px; font-weight: 650; }
.ha-verdict,.ha-feedback { min-width: 0; flex: 1; }
.ha-match-item.selected,.ha-match-item.is-active { border-color: var(--red); color: var(--link); background: var(--accent-wash); box-shadow: 0 3px 0 var(--red); }
.ha-match-item.is-correct { border-color: color-mix(in srgb,var(--ok) 35%,var(--line-strong)); background: color-mix(in srgb,var(--ok) 8%,var(--card-solid)); color: var(--ok); box-shadow: 0 3px 0 color-mix(in srgb,var(--ok) 35%,var(--line-strong)); opacity: .5; }
.ha-match-item.is-wrong { border-color: var(--ko); background: var(--accent-wash); color: var(--ko); animation: ha-pair-wrong 240ms ease; }
@keyframes ha-pair-wrong { 25% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
.ha-learn-welcome { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin: 0 0 48px; }
.ha-learn-welcome h1 { font-size: clamp(34px,3.5vw,46px); margin: 0 0 15px; }
.ha-learn-welcome p { max-width: 65ch; margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.7; }
.ha-learn-welcome > .ha-pill { margin-top: 5px; }
.ha-learn-layout { display: grid; grid-template-columns: minmax(0,1fr) 285px; align-items: start; gap: 56px; }
.ha-learn-primary { min-width: 0; }
.ha-learn-next { padding: 35px 37px 37px; border: 1px solid var(--sep); border-radius: 26px; background: var(--card); box-shadow: var(--card-shadow); }
.ha-learn-next-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 26px; border-radius: 18px; background: var(--gold-wash); color: var(--red); }
.ha-learn-next-icon .ha-icon { width: 29px; height: 29px; }
.ha-learn-next h2 { max-width: 25ch; margin-bottom: 18px; font-size: clamp(27px,2.8vw,34px); line-height: 1.25; }
.ha-learn-next p { max-width: 59ch; color: var(--text-2); font-size: 16px; line-height: 1.75; }
.ha-learn-next .ha-actions { margin-top: 28px; }
.ha-learn-quicklinks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px; margin: 32px 0; }
.ha-learn-quicklinks > a { display: flex; align-items: center; gap: 14px; min-height: 90px; padding: 12px 0; color: var(--text); }
.ha-learn-quicklinks > a > .ha-icon:first-child { width: 25px; height: 25px; color: var(--red); }
.ha-learn-quicklinks > a > .ha-icon:last-child { width: 18px; height: 18px; color: var(--text-3); }
.ha-learn-quicklinks > a > span { flex: 1; min-width: 0; }
.ha-learn-quicklinks strong { display: block; font-size: 15px; font-weight: 700; }
.ha-learn-quicklinks small { display: block; margin-top: 5px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.ha-learn-quicklinks > a:hover strong { color: var(--red); }
.ha-learn-sidebar { display: grid; gap: 29px; padding-top: 4px; }
.ha-learn-today { padding: 24px; border: 1px solid var(--sep); border-radius: 21px; background: var(--card); }
.ha-learn-today .ha-section-row { margin: 0 0 16px; gap: 12px; }
.ha-learn-today .ha-section-row > .ha-icon { width: 20px; height: 20px; color: var(--gold); }
.ha-learn-today h2 { font-size: 18px; margin: 0 0 12px; }
.ha-learn-today p { color: var(--text-2); font-size: 12px; line-height: 1.65; }
.ha-learn-today p:last-child { margin: 13px 0 0; }
.ha-learn-today .ha-progress { height: 10px; margin-top: 21px; }
.ha-learn-goal { margin-top: 12px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ha-learn-goal strong { color: var(--text); font-weight: 750; }
.ha-learn-stats { display: grid; gap: 17px; padding: 0 8px; }
.ha-learn-stats > div { display: grid; grid-template-columns: 23px auto minmax(0,1fr); align-items: center; gap: 10px; }
.ha-learn-stats .ha-icon { width: 18px; height: 18px; color: var(--gold); }
.ha-learn-stats strong { font-size: 15px; font-weight: 740; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ha-learn-stats span { color: var(--text-2); font-size: 12px; }
.ha-learn-progress-link { display: inline-flex; align-items: center; gap: 12px; justify-self: start; padding: 5px 8px; min-height: 44px; color: var(--link); font-size: 13px; font-weight: 650; }
.ha-learn-progress-link .ha-icon { width: 17px; height: 17px; }
.ha-path-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; align-items: start; gap: 76px; }
.ha-path-course { min-width: 0; max-width: 700px; }
.ha-path-toolbar { margin: 0 0 34px; }
.ha-path-toolbar .ha-field { max-width: 340px; }
.ha-path-toolbar .ha-field > span { font-size: 12px; color: var(--text-2); font-weight: 550; }
.ha-path-toolbar select { min-height: 46px; font-size: 14px; }
.ha-path-unit { --unit-tone: var(--path-tone-1); --unit-ink: #fff; margin: 0 0 42px; scroll-margin-top: 112px; }
.ha-path-unit[style*="--path-tone-2"] { --unit-ink: #342809; }
.ha-path-unit-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 26px; border: 1px solid color-mix(in srgb,var(--unit-tone) 19%,var(--sep)); border-radius: 21px; background: color-mix(in srgb,var(--unit-tone) 7%,var(--card-solid)); }
.ha-path-unit-head h2 { max-width: 27ch; margin: 0 0 8px; color: var(--text); font-size: 22px; line-height: 1.3; }
.ha-path-unit-head p { max-width: 55ch; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.ha-path-unit-number { display: block; margin-bottom: 8px; color: var(--text-2); font-size: 12px; font-weight: 550; }
.ha-path-guide { flex: none; }
.ha-path-guide .ha-icon { width: 17px; height: 17px; }
.ha-path-track { display: grid; justify-items: center; gap: 36px; margin: 0 auto; padding: 48px 16px 12px; }
.ha-path-stop { position: relative; width: 270px; max-width: 100%; margin: 0; transform: translateX(calc(var(--path-shift,0)*56px)); }
.ha-path-trigger { position: relative; display: flex; flex-direction: column; align-items: center; gap: 15px; padding: 0; list-style: none; cursor: pointer; text-align: center; }
.ha-path-trigger::-webkit-details-marker { display: none; }
.ha-path-trigger::marker { display: none; content: ""; }
.ha-path-trigger:focus-visible { outline-offset: 9px; border-radius: 16px; }
.ha-path-node { position: relative; display: grid; place-items: center; width: 77px; height: 74px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--card); box-shadow: 0 7px 0 var(--line-strong),0 13px 20px -17px rgb(66 42 21 / 32%); color: var(--text-2); transition: transform 160ms var(--ease),box-shadow 160ms var(--ease),background 160ms ease; }
.ha-path-node .ha-icon { width: 29px; height: 29px; stroke-width: 2; }
.ha-path-trigger:hover .ha-path-node { background: var(--gold-wash); transform: translateY(-2px); }
.ha-path-trigger:active .ha-path-node { transform: translateY(5px); box-shadow: 0 2px 0 var(--line-strong); }
.ha-path-stop.is-complete .ha-path-node,.ha-path-stop.is-current .ha-path-node { border-color: var(--unit-tone); color: var(--unit-ink); background: var(--unit-tone); box-shadow: 0 7px 0 color-mix(in srgb,var(--unit-tone) 76%,#242120),0 13px 20px -17px rgb(66 42 21 / 32%); }
.ha-path-stop.is-current .ha-path-node::before { content: ""; position: absolute; inset: -9px; border: 3px solid color-mix(in srgb,var(--unit-tone) 28%,transparent); border-radius: 50%; }
.ha-path-stop.is-current .ha-path-trigger:active .ha-path-node,.ha-path-stop.is-complete .ha-path-trigger:active .ha-path-node { box-shadow: 0 2px 0 color-mix(in srgb,var(--unit-tone) 76%,#242120); }
.ha-path-label { max-width: 230px; color: var(--text-2); font-size: 13px; line-height: 1.5; font-weight: 570; }
.ha-path-stop.is-current .ha-path-label { color: var(--text); font-weight: 720; }
.ha-path-start { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 32px; margin: -8px 0 1px; padding: 6px 12px; border: 1px solid color-mix(in srgb,var(--unit-tone) 30%,var(--sep)); border-radius: 10px; color: var(--link); background: var(--card); font-size: 11px; line-height: 1.4; font-weight: 700; }
.ha-path-note { position: relative; width: 280px; max-width: 100%; margin: 22px auto 0; padding: 22px; border: 1px solid color-mix(in srgb,var(--unit-tone) 22%,var(--sep)); border-radius: 18px; background: var(--card); box-shadow: 0 16px 34px -26px rgb(65 35 11 / 28%); text-align: left; }
.ha-path-note p { margin-bottom: 12px; font-size: 13px; line-height: 1.65; }
.ha-path-note .ha-actions { display: grid; gap: 13px; margin-top: 18px; }
.ha-path-note .ha-btn { width: 100%; min-height: 45px; font-size: 12px; padding-inline: 12px; }
.ha-path-sidebar { position: sticky; top: 120px; display: grid; gap: 30px; }
.ha-path-legend { padding: 0 8px; }
.ha-path-legend h2 { margin-bottom: 17px; font-size: 18px; }
.ha-path-legend p { color: var(--text-2); font-size: 13px; line-height: 1.8; }
.ha-path-legend .ha-btn { margin-top: 5px; min-height: 44px; font-size: 13px; }
.ha-feedback { display: flex; align-items: flex-start; gap: 19px; }
.ha-feedback-icon { display: grid; place-items: center; flex: none; width: 47px; height: 47px; margin-top: 2px; border: 1px solid color-mix(in srgb,var(--ok) 20%,transparent); border-radius: 50%; color: var(--ok); background: var(--card); }
.ha-feedback-icon .ha-icon { width: 25px; height: 25px; }
.ha-feedback.incorrect .ha-feedback-icon { color: var(--ko); border-color: color-mix(in srgb,var(--ko) 20%,transparent); }
.ha-feedback > div:last-child { min-width: 0; }
.ha-match-headings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; margin: 28px 0 -14px; color: var(--text-2); font-size: 12px; font-weight: 550; text-align: center; }
.ha-bank-note { margin: 24px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.6; text-align: center; }
button.ha-input-mode { width: fit-content; min-height: 44px; margin: 27px auto 0; font-size: 12px; }
.ha-practice-detail { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; margin: 29px 0; }
.ha-practice-detail > div { display: flex; flex-direction: column-reverse; gap: 9px; }
.ha-practice-detail dt { color: var(--text-2); font-size: 12px; line-height: 1.6; }
.ha-practice-detail dd { margin: 0; color: var(--text); font-size: 25px; font-weight: 730; line-height: 1.2; font-variant-numeric: tabular-nums; }
@media (max-width:1150px) {
.ha-learn-layout { gap: 35px; grid-template-columns: minmax(0,1fr) 265px; }
.ha-path-layout { grid-template-columns: minmax(0,1fr) 250px; gap: 42px; }
}
@media (max-width:1000px) {
.ha-learn-layout { gap: 28px; grid-template-columns: minmax(0,1fr) 240px; }
.ha-learn-next { padding: 30px; }
.ha-learn-quicklinks { grid-template-columns: 1fr; gap: 0; }
.ha-learn-quicklinks > a { min-height: 75px; }
.ha-path-layout { grid-template-columns: minmax(0,1fr); }
.ha-path-course { max-width: 680px; width: 100%; margin-inline: auto; }
.ha-path-sidebar { position: static; max-width: 680px; width: 100%; margin: 15px auto 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px; align-items: start; }
}
@media (max-width:820px) {
.ha-learn-welcome { margin-bottom: 32px; }
.ha-learn-welcome h1 { font-size: 37px; }
.ha-learn-welcome p { max-width: 40ch; font-size: 15px; }
.ha-learn-layout { gap: 27px; grid-template-columns: minmax(0,1fr) 225px; }
.ha-learn-next { padding: 28px; border-radius: 22px; }
.ha-learn-next h2 { font-size: 28px; }
.ha-learn-next p { font-size: 15px; }
.ha-learn-next .ha-actions { display: grid; gap: 15px; }
.ha-learn-today { padding: 21px; }
.ha-learn-stats { padding: 0 3px; gap: 21px; }
.ha-learn-stats > div { grid-template-columns: 20px auto; gap: 7px; }
.ha-learn-stats span { grid-column: 2; }
.ha-learn-stats .ha-icon { grid-row: span 2; }
}
@media (max-width:620px) {
.ha-pagehead,.ha-learn-welcome { display: block; margin-bottom: 31px; }
.ha-learn-welcome h1 { font-size: 33px; }
.ha-learn-welcome > .ha-pill { margin-top: 18px; }
.ha-learn-layout { grid-template-columns: minmax(0,1fr); gap: 25px; }
.ha-learn-next { padding: 27px; border-radius: 22px; }
.ha-learn-next-icon { width: 52px; height: 52px; margin-bottom: 23px; border-radius: 16px; }
.ha-learn-next h2 { font-size: 28px; }
.ha-learn-next .ha-actions { display: grid; }
.ha-learn-quicklinks { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin: 20px 0; }
.ha-learn-quicklinks > a { align-items: flex-start; gap: 10px; }
.ha-learn-quicklinks > a > .ha-icon:last-child { display: none; }
.ha-learn-quicklinks small { font-size: 11px; }
.ha-learn-sidebar { gap: 22px; }
.ha-learn-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-inline: 4px; }
.ha-learn-stats > div { grid-template-columns: 18px auto; }
.ha-learn-stats strong { font-size: 14px; }
.ha-learn-stats span { max-width: 13ch; font-size: 11px; }
.ha-learn-progress-link { padding-left: 4px; }
.ha-path-layout { gap: 24px; }
.ha-path-toolbar { margin-bottom: 28px; }
.ha-path-toolbar .ha-field { max-width: none; }
.ha-path-unit { margin-bottom: 35px; scroll-margin-top: 95px; }
.ha-path-unit-head { padding: 21px 20px; gap: 14px; border-radius: 17px; }
.ha-path-unit-head h2 { font-size: 18px; }
.ha-path-unit-head p { font-size: 12px; }
.ha-path-guide { padding: 10px 12px; font-size: 11px; }
.ha-path-guide .ha-icon { display: none; }
.ha-path-unit-number { font-size: 11px; margin-bottom: 7px; }
.ha-path-track { padding: 40px 5px 10px; gap: 34px; }
.ha-path-stop { width: 242px; transform: translateX(calc(var(--path-shift,0)*32px)); }
.ha-path-node { width: 72px; height: 69px; }
.ha-path-note { padding: 20px; }
.ha-path-label { font-size: 12px; max-width: 210px; }
.ha-path-sidebar { grid-template-columns: minmax(0,1fr); margin-top: 10px; }
.ha-path-legend { padding-inline: 4px; }
.ha-exercise-main h1,.ha-exercise-prompt { margin-bottom: 31px; font-size: 26px; line-height: 1.35; }
.ha-input-mode { margin-top: 25px; }
.ha-input-mode button { font-size: 12px; }
.ha-feedback { gap: 13px; }
.ha-feedback-icon { width: 36px; height: 36px; }
.ha-feedback-icon .ha-icon { width: 21px; height: 21px; }
.ha-match-headings { gap: 16px; font-size: 11px; }
.ha-practice-detail { gap: 16px; }
.ha-practice-detail dd { font-size: 23px; }
}
@media (max-width:360px) {
.ha-path-stop { width: 225px; transform: translateX(calc(var(--path-shift,0)*26px)); }
.ha-learn-next { padding: 24px; }
}

/* Variables complémentaires des activités, dans la même palette. */
:root { --gold: #c79a26; --charcoal: #242426; --line-strong: rgba(60,36,30,.2); --accent-wash: color-mix(in srgb,var(--blue) 10%,var(--card)); --gold-wash: color-mix(in srgb,var(--gold) 12%,var(--card)); --path-tone-1: #c93242; --path-tone-2: #d8ad3b; --path-tone-3: #343438; --radius: 26px; }
:root[data-theme="dark"] { --gold: #edc76c; --line-strong: rgba(255,235,226,.22); }
.ha-learn-next,.ha-learn-today,.ha-path-unit-head,.ha-path-note { position:relative; border:0; border-radius:26px; background:var(--card); box-shadow:var(--card-shadow); }
.ha-learn-next::before,.ha-learn-today::before,.ha-path-unit-head::before,.ha-path-note::before { content:""; position:absolute; inset:0; border-radius:inherit; padding:1px; pointer-events:none; background:linear-gradient(180deg,var(--card-rim),transparent 35%); -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; }
.ha-learn-welcome h1 { font-size:clamp(34px,5vw,52px); line-height:1.08; font-weight:750; letter-spacing:-.025em; }
.ha-learn-next h2 { font-weight:700; letter-spacing:-.025em; }
.ha-learn-next-icon { border-radius:20px; background:var(--glass-strong); box-shadow:inset 0 1px 0 #ffffff88,0 5px 14px -10px #32141455; }
.ha-learn-next .ha-btn,.ha-path-note .ha-btn { border-radius:25px; }
.ha-path-node { background:var(--glass-strong); border:1px solid var(--glass-rim-bottom); box-shadow:inset 0 1px 0 var(--glass-rim-top),var(--glass-shadow); }
.ha-path-stop.is-complete .ha-path-node,.ha-path-stop.is-current .ha-path-node { box-shadow:inset 0 1px 0 #ffffff88,0 8px 20px -9px var(--unit-tone); }
.ha-path-start { border:0; border-radius:20px; background:var(--glass-strong); box-shadow:inset 0 1px 0 #ffffff88,0 4px 12px -9px #32141466; }
.ha-path-node::after { content:""; position:absolute; inset:2px; border-radius:inherit; pointer-events:none; background:radial-gradient(120% 80% at 30% -20%,rgba(255,255,255,.35),transparent 60%); }
.ha-word-source { margin:0 0 26px; padding:22px 24px; border-radius:23px; background:var(--card); box-shadow:var(--card-shadow); font-size:24px; font-weight:600; }
.ha-token:disabled,.ha-token.is-used { visibility:visible; opacity:.34; color:transparent; background:var(--fill-2); pointer-events:none; }
.ha-match-item.is-correct { background:color-mix(in srgb,var(--ok) 13%,var(--card)); color:var(--ok); opacity:.55; box-shadow:inset 0 1px 0 #ffffff88; }
.ha-match-item.is-active { background:color-mix(in srgb,var(--blue) 14%,var(--card)); border-color:var(--blue); }
.ha-match-item.is-wrong { background:color-mix(in srgb,var(--ko) 12%,var(--card)); color:var(--ko); }
.ha-focus-header { position:sticky; top:12px; z-index:35; border-radius:26px; background:var(--glass-strong); -webkit-backdrop-filter:blur(16px) saturate(190%); backdrop-filter:blur(16px) saturate(190%); padding:14px 22px; box-shadow:var(--glass-shadow),inset 0 1px 0 var(--glass-rim-top); }
.ha-focus-header > a { min-height:40px; }
.ha-match-headings { margin-bottom:0; }
.ha-match-item { min-height:60px; }
.ha-answer-dock { background:var(--glass-strong); -webkit-backdrop-filter:blur(18px) saturate(180%); backdrop-filter:blur(18px) saturate(180%); box-shadow:0 -1px 0 var(--glass-rim-top); }
.ha-answer-dock .ha-btn { border-radius:25px; }
.ha-table .ha-small { display:block; }
@media(max-width:820px) { .ha-focus-header { margin:12px 16px 0; top:8px; } }

/* Mots bien délimités et correction à l’endroit où l’on apprend. */
.ha-word-token { border:2px solid color-mix(in srgb,var(--text) 50%,var(--card-solid)); border-radius:15px; padding:10px 16px; background:var(--field); box-shadow:inset 0 1px 0 var(--glass-rim-top),0 4px 11px -8px rgba(35,20,20,.38); }
.ha-word-token:hover:not(:disabled),.ha-word-token.selected { border-color:var(--blue); background:color-mix(in srgb,var(--blue) 12%,var(--card)); }
.ha-word-token .ha-icon { width:22px; height:22px; margin-left:8px; }
.ha-inline-correction { margin:26px 0 12px; padding:24px 26px; border:2px solid var(--ok); scroll-margin:130px 0 160px; background:color-mix(in srgb,var(--ok) 7%,var(--card-solid)); }
.ha-inline-correction-title { display:flex; gap:12px; align-items:center; color:var(--ok); margin-bottom:14px; }
.ha-inline-correction-title h2 { margin:0; font-size:23px; line-height:1.3; }
.ha-inline-correction-title > .ha-icon { flex:none; width:28px; height:28px; }
.ha-inline-answer { margin:0 0 14px; font-size:28px; line-height:1.5; font-weight:750; color:var(--text); overflow-wrap:anywhere; }
.ha-inline-correction > p:last-child { margin-bottom:0; font-size:17px; line-height:1.6; color:var(--text); }
.ha-inline-correction:focus { outline:none; }
.ha-word-token.is-answer-correct,.ha-choice.is-answer-correct,.ha-gap-slot.is-answer-correct,.ha-token.is-answer-correct,.ha-answer-input.is-answer-correct { border:2px solid var(--ok); background:color-mix(in srgb,var(--ok) 13%,var(--card-solid)); color:var(--text); box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 14%,transparent),inset 0 1px 0 var(--glass-rim-top); opacity:1; visibility:visible; -webkit-text-fill-color:var(--text); }
.ha-word-token.is-answer-wrong,.ha-choice.is-answer-wrong { border-color:var(--ko); color:var(--ko); }
.ha-corrected-pool { opacity:.4; }
.ha-correct-pairs { display:grid; gap:12px; }
.ha-correct-pair { display:grid; grid-template-columns:minmax(0,1fr) 22px minmax(0,1fr); align-items:center; gap:16px; padding:17px 20px; border:2px solid var(--ok); border-radius:18px; background:var(--card); }
.ha-correct-pair > .ha-icon { color:var(--ok); }
@media(max-width:620px) { .ha-inline-correction { padding:19px; } .ha-inline-answer { font-size:24px; } .ha-word-token { padding:9px 12px; } .ha-correct-pair { gap:10px; padding:14px; font-size:15px; } }

/* Navigation centrée sur la fenêtre, sans dépendre de la largeur du logo. */
.ha-header { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
.ha-brand { justify-self:start; grid-column:1; }
.ha-nav { justify-self:center; grid-column:2; margin:0; }
.ha-user-menu { justify-self:end; grid-column:3; }

/* Listes natives accessibles : flèche espacée et menu en verre si disponible. */
:root { --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%230b0c10' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23f5f6fa' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E"); }
.ha-select,.duel-select { -webkit-appearance:none; appearance:none; min-height:48px; padding:12px 54px 12px 17px; border:1px solid var(--sep); border-radius:18px; background-color:var(--field); background-image:var(--select-chevron); background-repeat:no-repeat; background-position:right 18px center; background-size:19px 19px; color:var(--text); box-shadow:inset 0 1px 0 var(--glass-rim-top),0 3px 12px -10px rgba(40,20,20,.35); cursor:pointer; text-overflow:ellipsis; }
.ha-select:focus-visible,.duel-select:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
@supports (appearance:base-select) {
 .ha-select,.duel-select,.ha-select::picker(select),.duel-select::picker(select) { appearance:base-select; }
 .ha-select::picker-icon,.duel-select::picker-icon { display:none; }
 .ha-select::picker(select),.duel-select::picker(select) { min-width:anchor-size(width); max-width:calc(100vw - 32px); max-height:min(55vh,440px); overflow:auto; margin-block:8px; padding:7px; border:1px solid var(--glass-rim-top); border-radius:22px; background:var(--glass-strong); -webkit-backdrop-filter:blur(24px) saturate(180%); backdrop-filter:blur(24px) saturate(180%); color:var(--text); box-shadow:var(--glass-shadow),inset 0 1px 0 var(--glass-rim-top); }
 .ha-select option,.duel-select option { display:flex; align-items:center; gap:14px; min-height:43px; padding:10px 15px; border-radius:13px; font:inherit; font-size:15px; line-height:1.4; color:var(--text); white-space:normal; cursor:pointer; }
 .ha-select option:hover,.duel-select option:hover { background:var(--fill); }
 .ha-select option:checked,.duel-select option:checked { background:color-mix(in srgb,var(--blue) 14%,var(--card)); color:var(--link); font-weight:650; }
 .ha-select option::checkmark,.duel-select option::checkmark { order:1; margin-left:auto; color:var(--blue); }
}
.ha-learn-home > .ha-field,.ha-main > .ha-field { max-width:340px; margin:0 0 26px; }

/* Prononciation : commandes compactes dans le matériau existant. */
.ha-audio-controls { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:10px; }
.ha-audio-controls .ha-audio-button { min-height:44px; white-space:nowrap; font-size:.88rem; }
.ha-audio-button[aria-pressed="true"] { color:var(--primary, #c93242); border-color:currentColor; }
.ha-audio-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:0 0 24px; }
.ha-audio-bar > span { display:flex; align-items:center; gap:10px; }
.ha-verdict .ha-audio-controls { flex-basis:100%; }
.ha-exercise-tools { flex-wrap:wrap; gap:12px; }
@media (max-width:600px) { .ha-audio-bar { align-items:flex-start; } .ha-audio-controls { gap:6px; } }
.ha-feedback { flex-wrap:wrap; }
.ha-feedback > div:nth-child(2) { flex:1; min-width:0; }
@media print { .ha-audio-controls, .ha-audio-bar { display:none !important; } }

.ha-listening-prompt { display:flex; align-items:center; flex-direction:column; gap:14px; padding:28px 20px; margin:24px 0; text-align:center; }
.ha-listening-icon { width:48px; height:48px; color:var(--blue); }
.ha-listening-prompt .ha-audio-controls { margin:0; justify-content:center; }
.ha-listening-prompt p { margin:0; max-width:48ch; }
.ha-listening-prompt .ha-audio-button { min-height:48px; font-size:1rem; }
.ha-listening-setting { margin:20px 0; }
.ha-heard-text { font-weight:650; }
@media (min-width:650px) {
  .ha-listening-prompt { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px 18px; padding:18px 22px; text-align:left; }
  .ha-listening-prompt .ha-listening-icon { grid-column:1; grid-row:1 / 3; width:42px; height:42px; }
  .ha-listening-prompt .ha-audio-controls { grid-column:2; grid-row:1; justify-content:flex-start; }
  .ha-listening-prompt > p { grid-column:2; grid-row:2; }
  .ha-listening-prompt > button { grid-column:3; grid-row:1 / 3; }
}
