/* Police Nunito servie par le site lui-même (copiée par npm run vendor), variable de 200 à 1000. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/vendor/nunito/nunito-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/vendor/nunito/nunito-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Couleurs vives et franches, pour un public jeune. --accent-ink : vert foncé lisible en texte. */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --text: #3c3c3c;
  --muted: #777777;
  --line: #e5e5e5;
  --accent: #58cc02;
  --accent-dark: #58a700;
  --accent-ink: #46a302;
  --accent-text: #ffffff;
  --accent-soft: #d7ffb8;
  --blue: #1cb0f6;
  --blue-dark: #1899d6;
  --blue-soft: #ddf4ff;
  --warm: #ffc800;
  --warm-dark: #e5a400;
  --warm-soft: #fff5d3;
  --good: #58cc02;
  --good-soft: #d7ffb8;
  --bad: #ff4b4b;
  --bad-dark: #ea2b2b;
  --bad-soft: #ffdfe0;
  --purple: #ce82ff;
  --purple-dark: #a560e8;
  --purple-ink: #8f3fd9;
  --purple-soft: #f4e5ff;
  --radius: 16px;
  --shadow: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131f24; --surface: #131f24; --surface-2: #202f36; --text: #f1f7fb; --muted: #8b9ba5;
    --line: #37464f; --accent: #58cc02; --accent-dark: #58a700; --accent-ink: #79d634; --accent-text: #ffffff;
    --accent-soft: #1f3a14; --blue: #1cb0f6; --blue-dark: #1899d6; --blue-soft: #10314a;
    --warm: #ffc800; --warm-dark: #e5a400; --warm-soft: #3d3418; --good: #79d634; --good-soft: #1f3a14;
    --bad: #ff4b4b; --bad-dark: #ea2b2b; --bad-soft: #3d2023; --purple: #ce82ff; --purple-dark: #a560e8; --purple-ink: #d9a3ff;
    --purple-soft: #2f2342; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 600 16px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 1.9rem; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 12px; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
label { display: block; font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface-2); min-height: 50px; font-weight: 700;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px; border-radius: 16px; border: 2px solid var(--line); border-bottom-width: 4px;
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 800; letter-spacing: .02em;
  text-decoration: none; transition: transform .05s;
}
.btn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent-dark); }
.btn.blue { background: var(--blue); color: #fff; border-color: var(--blue-dark); }
.btn.big { min-height: 58px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .04em; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 800; cursor: pointer; }
.btn.small { min-height: 38px; padding: 4px 12px; font-size: .875rem; border-bottom-width: 3px; }

.brand { display: flex; align-items: center; gap: 10px; margin: 8px 0 18px; }
.logo { width: 40px; height: 40px; flex: none; }
.code-big { font: 700 2.4rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .15em; text-align: center; padding: 14px; background: var(--surface-2); border-radius: 12px; }

/* Barre de jeu */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; margin: -16px 0 8px; border-bottom: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; font-weight: 600; }
.pill.solo { background: var(--accent-soft); color: var(--accent-ink); }
.pill.discussion { background: var(--warm-soft); color: var(--text); }
.timer { font: 700 1.05rem ui-monospace, Menlo, monospace; }
.timer.urgent { color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--good); }
.dot.wait { background: var(--warm); }

.enonce { font-size: 1.05rem; }
.enonce pre { background: var(--surface-2); padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: .9rem; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; }
.katex { font-size: 1.05em; }
.katex-display, .prop-text .katex { overflow-x: auto; overflow-y: hidden; }

/* Propositions */
.props { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prop {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface);
  cursor: pointer; user-select: none; min-height: 52px;
}
.prop .num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); }
.prop .box { width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; font-weight: 800; }
.prop.checked { border-color: var(--accent); background: var(--accent-soft); }
.prop.checked .box { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Discussion : réponse commune en violet, désaccord encadré en jaune ; toi en vert, le partenaire en bleu. */
.prop.locked, .prop.locked.checked { cursor: default; border-color: var(--purple); background: var(--purple-soft); }
.prop.locked .box { border-color: var(--purple); }
.prop.locked.checked .box { background: var(--purple); border-color: var(--purple); }
.prop.disagree { border: 2px solid var(--warm); box-shadow: 0 0 0 3px var(--warm-soft); }
.prop.disagree, .prop.disagree.checked { background: var(--warm-soft); }
.tags { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; border: 2px solid; white-space: nowrap; }
.tag-me { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.tag-partner { color: var(--blue-dark); border-color: var(--blue); background: var(--blue-soft); }
.tag-common { color: var(--purple-ink); border-color: var(--purple); background: var(--purple-soft); }
.tag-disagree { color: var(--text); border-color: var(--warm); background: var(--warm-soft); }
.tags.prop-legend { margin-bottom: 2px; }
.prop.readonly { cursor: default; }
.prop.correct { border-color: var(--good); }
.prop.wrong { border-color: var(--bad); background: var(--bad-soft); }
.verdict { font-size: .82rem; font-weight: 700; }
.verdict.ok { color: var(--good); }
.verdict.ko { color: var(--bad); }
.justif { grid-column: 2 / 4; font-size: .88rem; color: var(--muted); }
.duo-answer { grid-column: 2 / 4; font-size: .85rem; font-weight: 700; }
.duo-answer.ok { color: var(--good); }
.duo-answer.ko { color: var(--bad); }
.prop.checked.correct, .prop.checked.wrong { background: var(--surface); }
.prop.wrong { background: var(--bad-soft); }

/* Barre d'action fixe */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.actionbar .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
.actionbar .grow { flex: 1; }

/* Tchat */
.chat-log { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.msg { max-width: 85%; padding: 7px 11px; border-radius: 14px; background: var(--blue-soft); border: 2px solid var(--blue); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent); }
.msg .who { font-size: .75rem; font-weight: 700; color: var(--muted); }
.msg .ref { font-size: .8rem; font-weight: 700; color: var(--warm); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .875rem; }
.chat-form { display: grid; grid-template-columns: 76px 1fr auto; gap: 6px; }
.chat-form select { padding: 8px; }
.chat-closed { text-align: center; color: var(--muted); font-size: .9rem; }

/* Score */
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.score { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.score b { display: block; font-size: 1.5rem; }
.outcome { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 600; }

#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(92vw, 520px); background: var(--text); color: var(--bg); padding: 10px 16px;
  border-radius: 12px; z-index: 20; font-weight: 600; text-align: center;
}
.report { color: var(--muted); text-decoration: underline; background: none; border: 0; cursor: pointer; font-size: .85rem; padding: 4px; }
.qid { font: 600 .78rem ui-monospace, Menlo, monospace; color: var(--muted); margin: 0; }

/* Invitation */
.invite-link { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.invite-link input { font-size: .9rem; min-height: 40px; padding: 8px 10px; background: var(--surface-2); }
.share-row { display: flex; flex-wrap: wrap; gap: 6px; }
.share-row .btn { flex: 1 1 100px; min-height: 40px; padding: 6px 12px; text-decoration: none; font-size: .9rem; }

/* Points et grades */
.scoreline .my-score { position: relative; font-size: 1rem; }
.gain {
  position: absolute; left: 100%; top: -2px; margin-left: 6px; font-weight: 800; color: var(--good);
  animation: gain-pop 1.8s ease-out forwards; white-space: nowrap;
}
@keyframes gain-pop {
  0% { opacity: 0; transform: translateY(6px) scale(.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.15); }
  70% { opacity: 1; transform: translateY(-4px) scale(1); }
  100% { opacity: 0; transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) { .gain { animation: none; } }
.grade-name { font-size: 1.4rem; font-weight: 800; color: var(--accent-ink); }
.grade-points { text-align: right; }
.grade-points b { display: block; font-size: 1.4rem; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--warm)); border-radius: inherit; transition: width .6s ease; }
.earned { text-align: center; }
.earned-points { font-size: 2.6rem; font-weight: 800; color: var(--good); line-height: 1.1; }
.earned-points span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.pill.record { background: var(--warm-soft); color: var(--text); }
.outcome.promo { background: var(--good-soft); }

.center { text-align: center; }

/* Profil */
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
textarea {
  font: inherit; color: inherit; width: 100%; resize: vertical; min-height: 110px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 12px;
}
textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
input[type=date] {
  font: inherit; color: inherit; width: 100%; min-height: 46px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.avatar { font-size: 1.5rem; line-height: 1; }
.avatar.big { font-size: 2.75rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.avatar-choice {
  font-size: 1.5rem; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); cursor: pointer; padding: 0;
}
.avatar-choice.selected { border: 2px solid var(--accent); background: var(--accent-soft); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
span.chip { cursor: default; }
.pseudo-link { font: inherit; font-weight: inherit; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.bio { white-space: pre-line; overflow-wrap: anywhere; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; margin: 0; }

/* Statistiques détaillées */
.vbar { display: flex; gap: 2px; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.vbar span { flex: 1 1 0; min-width: 4px; }
.v-juste { background: var(--good); }
.v-a_deux { background: var(--accent); }
.v-fausse { background: var(--bad); }
.v-passee { background: var(--muted); opacity: .45; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 16px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.legend li b { margin-left: auto; }
.legend .muted { font-size: .8rem; min-width: 3.2em; text-align: right; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
details summary { cursor: pointer; color: var(--muted); }
.chapter-stats { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.chapter-stats .vbar { height: 8px; margin-top: 4px; }

/* Amis */
.dot.busy { background: var(--bad); }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.people li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.people li:last-child { padding-bottom: 0; border-bottom: 0; }
.people .row.small { gap: 6px; }
.pill.invited { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.invitation { border-color: var(--accent); background: var(--accent-soft); }

/* Connexion avec Google : le bouton est dessiné par Google dans ce conteneur. */
.google-button { display: flex; justify-content: center; min-height: 44px; }

/* Navigation des écrans secondaires */
.topnav { margin-bottom: 4px; }
/* Premières questions du profil : une question par écran, en gros. */
.onboarding-top { display: flex; align-items: center; justify-content: space-between; }
.onboarding { padding-top: 12px; }
.onboarding h1 { font-size: 1.6rem; margin: 0 0 8px; }
.onboarding .big-select, .onboarding input[type=date] { font-size: 1.15rem; padding: 14px; }
.onboarding .tile { align-items: center; font-size: 1.2rem; }
.back-home { background: none; border: 0; padding: 6px 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.back-home:hover { text-decoration: underline; }
.logo-home { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }

/* Rappel : adresse e-mail à confirmer */
.notice { border-color: var(--warm); background: var(--warm-soft); }

/* Fenêtres de dialogue du jeu (signaler, quitter…) */
.dialog-actions { justify-content: flex-end; }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad-dark); }
/* Action irréversible proposée sans insister (supprimer son compte) : contour rouge, fond normal. */
.btn.danger-outline { color: var(--bad); border-color: var(--bad); }
a:not(.btn) { color: var(--blue); font-weight: 800; }
.legal-link { margin-top: 28px; }
.modal textarea { min-height: 90px; }

/* Accueil compact : grade à côté du pseudo, une seule carte « Jouer » */
.grade-chip { font-size: .8rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.grade-progress .progress { height: 6px; margin-bottom: 6px; }
.account-card .stack > * + *, .account-card > * + * { margin-top: 8px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.play-options { display: grid; grid-template-columns: 1fr 5.5rem; gap: 10px; }

/* Accueil très simple : logo, une phrase, deux gros boutons */
.hero { text-align: center; margin: 28px 0 24px; }
.hero .logo { width: 84px; height: 84px; margin: 0 auto 10px; display: block; }
.hero h1 { font-size: 2.4rem; margin-bottom: 6px; }
.hero p { font-size: 1.05rem; }
.hero-actions { display: grid; gap: 14px; margin: 8px 0 22px; }
.center { text-align: center; }
.home-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
.home-bar .me { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--text); font-weight: 800; }

/* Choix du chapitre et du nombre de questions : grosses tuiles */
.tiles { display: grid; gap: 10px; }
.tiles.count { grid-template-columns: repeat(4, 1fr); }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 14px 16px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px;
  background: var(--surface); color: var(--text); font-weight: 800; font-size: 1.05rem; cursor: pointer;
}
.tiles.count .tile { align-items: center; font-size: 1.3rem; padding: 12px 0; }
/* Matières : autant de colonnes égales que de matières, nom centré. */
.tiles.matieres { grid-auto-flow: column; grid-auto-columns: 1fr; }
.tiles.matieres .tile { align-items: center; justify-content: center; text-align: center; }
.tile.selected { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.code-input { text-align: center; font: 900 1.8rem/1 ui-monospace, Menlo, monospace !important; letter-spacing: .3em; text-transform: uppercase; }

/* Les deux joueurs : toi en vert, ton partenaire en bleu (couleurs des deux boutons de l'accueil). */
.p-me { color: var(--accent-ink); font-weight: 800; }
.p-partner { color: var(--blue-dark); font-weight: 800; }
.p-me-box { border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 12px; }
.p-partner-box { border: 2px solid var(--blue); background: var(--blue-soft); border-radius: 12px; }
.msg .who { color: var(--blue-dark); }
.tile:disabled { opacity: .35; cursor: not-allowed; }

/* Profil : recherche du lycée dans la liste officielle */
.lycee-results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.lycee-result { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.lycee-result:hover, .lycee-result:focus { border-color: var(--blue); background: var(--blue-soft); }
.lycee-chosen { padding: 10px 12px; border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 12px; font-weight: 700; }

/* Partenaire au hasard */
.btn.warm { background: var(--warm); color: #3a2c00; border-color: var(--warm-dark); }
.random-card { gap: 8px; }
.searching { font-size: 3rem; animation: searching 1.6s ease-in-out infinite; }
@keyframes searching { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .searching { animation: none; } }
/* « Nouvelle partie » : trois boutons de même largeur sur une ligne */
.actionbar .inner.three > .btn { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; font-size: .85rem; letter-spacing: .02em; line-height: 1.15; white-space: normal; }

/* Messages privés */
.chat-form:not(:has(select)) { grid-template-columns: 1fr auto; }
.chat-log.thread { max-height: min(55vh, 460px); min-height: 160px; }
.msg-meta { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.msg-meta .report { font-size: .7rem; padding: 0; }
.msg.mine .msg-meta { text-align: right; }
.conversation { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); font: inherit; }
.conversation .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.conversation .small { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.home-bar { flex-wrap: wrap; }
.home-bar > .row { gap: 6px; flex-wrap: nowrap; margin-left: auto; }
.home-bar > .row .btn { white-space: nowrap; }

/* Lot terminé : badge et félicitations. */
.congrats { text-align: center; align-items: center; background: var(--warm-soft); border-color: var(--warm); animation: congrats-pop .5s ease-out; }
.congrats h2 { margin: 0; }
.congrats-icon { font-size: 3.5rem; line-height: 1; animation: congrats-bounce 1.2s ease-in-out 2; }
@keyframes congrats-pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes congrats-bounce { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-10px) rotate(-8deg); } 60% { transform: translateY(0) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .congrats, .congrats-icon { animation: none; } }
.badge-chip { background: var(--warm-soft); border-color: var(--warm); }

/* Série de questions justes et sans-faute : bandeau et confettis par-dessus l'écran, sans bloquer les clics. */
.pill.streak { background: var(--warm-soft); border-color: var(--warm); font-weight: 800; }
.fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; place-items: center; transition: opacity .5s; }
.fx.out { opacity: 0; }
.fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-banner {
  position: relative; text-align: center; padding: 18px 28px 16px; border-radius: 22px; max-width: calc(100% - 32px);
  background: var(--surface); border: 3px solid var(--warm); box-shadow: 0 6px 0 var(--warm-dark), 0 18px 40px rgba(0, 0, 0, .18);
  animation: fx-in .55s cubic-bezier(.2, 1.6, .4, 1) both;
}
.fx-title { font-size: 2.2rem; font-weight: 1000; line-height: 1.1; color: var(--warm-dark); }
.fx-2 .fx-title, .fx-3 .fx-title { font-size: 2.8rem; color: var(--accent-ink); }
.fx-2 .fx-banner, .fx-3 .fx-banner { border-color: var(--accent); box-shadow: 0 6px 0 var(--accent-dark), 0 18px 40px rgba(0, 0, 0, .18); }
.fx-sub { margin-top: 4px; font-weight: 700; color: var(--muted); }
@keyframes fx-in { from { transform: scale(.4) rotate(-6deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fx-banner { animation: none; } .fx { transition: none; } }

/* Classements. */
.ranking { list-style: none; margin: 0; padding: 0; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.rank-row.me { background: var(--blue-soft); border-radius: 10px; }
.rank { width: 2em; text-align: right; font-weight: 800; color: var(--muted); }
.rank-row:nth-child(1) .rank { color: var(--warm-dark); }
.rank-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rank-value { display: flex; flex-direction: column; align-items: flex-end; }
.rank-gap { text-align: center; color: var(--muted); }
