/* ============================================================================
   Qui est l'intrus ? — le style commun (v3 « bleu nuit du dragon », 22/11/2026)
   Les couleurs viennent du kit d'interface d'Hugo et de son dragon : bleu nuit,
   vert citron, rouge et or de Noël, crème. L'esprit Duolingo (boutons épais en
   relief qui s'enfoncent, tuiles, typo ronde et grasse, petits rebonds), en
   version « jeu de Noël » : contour sombre, reflet, neige sur les cartes.
   Polices libres (SIL OFL) : Baloo 2 (titres, boutons, chiffres — la plus
   proche de Feather, réservée à Duolingo) et Nunito (texte).
   ========================================================================== */
@font-face { font-family: 'Baloo 2'; src: url('/polices/Baloo2.woff2') format('woff2'); font-weight: 400 800; font-display: swap;
  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: 'Baloo 2'; src: url('/polices/Baloo2-ext.woff2') format('woff2'); font-weight: 400 800; font-display: swap;
  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; }
@font-face { font-family: 'Nunito'; src: url('/polices/Nunito.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  /* la nuit bleue du dragon */
  --nuit: #0a1440;
  --nuit-2: #0e1b56;
  --surface: #17348e;      /* l'intérieur des panneaux du kit */
  --surface-2: #1d40a8;
  --bord: #2756d8;         /* le liseré clair des panneaux */
  --contour: #050c35;      /* le contour sombre de tout le kit */
  --levre: #040a2c;
  --texte: #ffffff;
  --texte-2: #cdd9ff;
  --texte-3: #8fa4e3;
  /* les couleurs franches, avec leur « lèvre » (le relief) */
  --citron: #8fde02;  --citron-levre: #4f9a03; --citron-clair: #ccf56b; --sur-citron: #0b1a4d;
  --vert: var(--citron); --vert-levre: var(--citron-levre); --vert-clair: var(--citron-clair);
  --rouge: #ee3442;   --rouge-levre: #a3121f;  --rouge-clair: #ffb3b9;
  --or: #ffcc1a;      --or-levre: #cf9400;     --or-clair: #ffe68a;   --or-doux: #ffe9a8;
  --bleu: #2f66f2;    --bleu-levre: #1736a8;   --bleu-clair: #9cc0ff;
  --violet: #a666ff;  --violet-levre: #6c33c4;
  --creme: #fbf3e2;   --creme-levre: #cbbd9c;  --sur-creme: #13205a;
  --blanc: #ffffff;   --blanc-levre: #b9c6ea;
  /* les polices */
  --rond: 'Baloo 2', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --texte-f: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gala: var(--rond);
  /* le mouvement : un ressort qui dépasse un peu, comme un rebond */
  --ressort: cubic-bezier(.34, 1.56, .64, 1);
  --doux: cubic-bezier(.2, .8, .2, 1);
  /* anciens noms, pour les pages pas encore repassées */
  --fond: var(--nuit); --carte: var(--surface); --carte-2: var(--surface-2); --trait: var(--bord);
  --ivoire: var(--texte); --ivoire-2: var(--texte-2); --or-fonce: var(--or-levre); --titre: var(--rond); --etroit: var(--rond);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--nuit);
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, rgba(255, 255, 255, .6), transparent 60%),
    radial-gradient(1.2px 1.2px at 22% 64%, rgba(204, 245, 107, .55), transparent 60%),
    radial-gradient(1.6px 1.6px at 41% 26%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(1.1px 1.1px at 63% 81%, rgba(255, 230, 138, .55), transparent 60%),
    radial-gradient(1.4px 1.4px at 79% 17%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1.2px 1.2px at 92% 58%, rgba(255, 230, 138, .5), transparent 60%),
    radial-gradient(120% 70% at 50% -10%, #1e3c9e 0%, var(--nuit-2) 48%, var(--nuit) 100%);
  background-attachment: fixed;
  color: var(--texte);
  font-family: var(--texte-f);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.38;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { -webkit-user-drag: none; user-select: none; }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- titres */
.titre-fete {
  font-family: var(--rond); font-weight: 800; letter-spacing: .005em; color: var(--or);
  text-shadow: 0 3px 0 var(--or-levre), 0 5px 0 var(--contour), 0 8px 18px rgba(0, 0, 0, .35);
}
.titre-gala { font-family: var(--rond); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--citron-clair); }

/* ------------------------------------------------- les boutons en relief
   Comme le kit : un contour sombre, une face colorée avec son reflet en haut,
   une « lèvre » dessous ; on appuie : la face descend sur la lèvre. */
.btn {
  --c: var(--citron); --l: var(--citron-levre); --t: var(--sur-citron);
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 12px 20px; border: 3px solid var(--contour); border-radius: 18px;
  background: var(--c); color: var(--t); box-shadow: inset 0 -5px 0 var(--l), 0 4px 0 var(--contour);
  font-family: var(--rond); font-weight: 800; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; line-height: 1.1; text-align: center;
  transform: translateY(0); transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  -webkit-user-select: none; user-select: none; overflow: hidden;
}
.btn::after { /* le reflet */
  content: ''; position: absolute; left: 12px; right: 12px; top: 5px; height: 30%; border-radius: 999px;
  background: rgba(255, 255, 255, .32); pointer-events: none;
}
.btn > * { position: relative; z-index: 1; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 -2px 0 var(--l), 0 0 0 var(--contour); }
.btn:disabled { --c: #2a3f86; --l: #1b2c66; --t: #8193cc; cursor: not-allowed; }
.btn:disabled::after { opacity: .3; }
.btn:focus-visible { outline: 3px solid var(--or-clair); outline-offset: 3px; }
.btn.vert, .btn.citron { --c: var(--citron); --l: var(--citron-levre); --t: var(--sur-citron); }
.btn.rouge { --c: var(--rouge); --l: var(--rouge-levre); --t: #fff; }
.btn.or { --c: var(--or); --l: var(--or-levre); --t: #3b2a00; }
.btn.bleu { --c: var(--bleu); --l: var(--bleu-levre); --t: #fff; }
.btn.violet { --c: var(--violet); --l: var(--violet-levre); --t: #fff; }
.btn.blanc, .btn.creme { --c: var(--creme); --l: var(--creme-levre); --t: var(--sur-creme); }
.btn.fantome { --c: var(--nuit-2); --l: var(--contour); --t: var(--texte-2); border-color: var(--bord); box-shadow: 0 4px 0 var(--contour); }
.btn.fantome::after { opacity: .12; }
.btn.fantome:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--contour); }
.btn .emo { width: 34px; height: 34px; margin: -8px 0; }
.lien { background: none; border: 0; color: var(--bleu-clair); font-family: var(--rond); font-weight: 700; font-size: 17px; letter-spacing: .05em; text-transform: uppercase; min-height: 48px; padding: 8px 14px; align-self: center; }
.lien.discret { color: var(--texte-3); }

/* bouton rond (son, retour…) */
.rond {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; padding: 0;
  border-radius: 16px; border: 3px solid var(--contour); background: var(--surface-2); box-shadow: inset 0 -4px 0 var(--surface), 0 3px 0 var(--contour);
  transition: transform .08s ease, box-shadow .08s ease;
}
.rond:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--surface), 0 0 0 var(--contour); }
.rond .emo { width: 34px; height: 34px; }

/* ------------------------------------------------------ cartes et tuiles
   Les panneaux du kit : contour sombre, liseré bleu clair, fond bleu. */
.carte {
  position: relative; background: var(--surface); border: 3px solid var(--contour); border-radius: 22px; padding: 16px;
  box-shadow: inset 0 0 0 3px var(--bord), 0 5px 0 var(--contour);
}
.carte.creme { background: var(--creme); color: var(--sur-creme); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .06), 0 5px 0 var(--contour); }
/* un chapeau de neige sur le haut d'une carte */
.neigeux::before {
  content: ''; position: absolute; z-index: 3; left: -3px; right: -3px; top: -11px; height: 30px; pointer-events: none;
  border-radius: 22px 22px 0 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M0 8 Q0 0 10 0 H110 Q120 0 120 8 V16 C113 16 112 25 104 25 C96 25 96 17 88 17 C80 17 79 28 70 28 C61 28 61 18 52 18 C43 18 43 23 34 23 C25 23 25 15 16 15 C9 15 7 20 0 20 Z' fill='%23f7fbff'/%3E%3Cpath d='M0 20 C7 20 9 15 16 15 C25 15 25 23 34 23 C43 23 43 18 52 18 C61 18 61 28 70 28 C79 28 80 17 88 17 C96 17 96 25 104 25 C112 25 113 16 120 16' fill='none' stroke='%23b9cdf0' stroke-width='2.2'/%3E%3C/svg%3E") repeat-x left top / 120px 30px;
  filter: drop-shadow(0 2px 0 rgba(5, 12, 53, .55));
}
.neigeux { margin-top: 8px; }
/* une branche de houx posée sur un coin */
.houx-coin::after {
  content: ''; position: absolute; z-index: 4; left: -14px; top: -20px; width: 58px; height: 58px; pointer-events: none;
  background: url('/icones/houx.webp') center / contain no-repeat; transform: rotate(-18deg);
}
.tuile {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 8px 12px; text-align: left;
  background: var(--surface); color: var(--texte); border: 3px solid var(--contour); border-radius: 18px; box-shadow: inset 0 0 0 2px var(--bord), 0 4px 0 var(--contour);
  font-family: var(--rond); font-weight: 700; font-size: 19px; line-height: 1.1;
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
.tuile:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--bord), 0 1px 0 var(--contour); }
.tuile.choisie { background: #24508a; box-shadow: inset 0 0 0 3px var(--citron), 0 4px 0 var(--citron-levre); color: #fff; }
.tuile.prise { opacity: .45; }
.tuile small { display: block; font-family: var(--texte-f); font-weight: 800; font-size: 14px; color: var(--texte-3); }

/* puces */
.puce {
  flex: none; min-height: 42px; padding: 6px 15px; border-radius: 999px; border: 3px solid var(--contour); box-shadow: inset 0 0 0 2px var(--bord), 0 3px 0 var(--contour);
  background: var(--surface); font-family: var(--rond); font-weight: 700; font-size: 16px; white-space: nowrap; color: var(--texte-2);
}
.puce[aria-pressed=true] { background: var(--citron); box-shadow: inset 0 -3px 0 var(--citron-levre), 0 3px 0 var(--contour); color: var(--sur-citron); }

/* barre de progression : épaisse, bordée, avec son reflet */
.barre { position: relative; height: 20px; border-radius: 999px; background: #0b1f5c; border: 3px solid var(--contour); overflow: hidden; }
.barre > i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--c, var(--citron));
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); transition: width .6s var(--doux);
}
.barre > i::after { content: ''; position: absolute; left: 7px; right: 7px; top: 3px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .5); }

/* ------------------------------------------------------------ avatars */
.avatar {
  --t: 48px; position: relative; flex: none; width: var(--t); height: var(--t); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--av, var(--bleu)); color: #fff; border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--contour), 0 3px 0 2px var(--contour);
  font-family: var(--rond); font-weight: 800; font-size: calc(var(--t) * .38); letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0, 0, 0, .2);
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.emo { display: inline-block; width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: middle; }

/* ------------------------------------------- la mascotte : le dragon d'Hugo
   En pied (7 humeurs) pour les grands moments ; ses « émotes » (la tête et
   les épaules) pour les petites places. Il arrive en rebondissant, puis
   chaque humeur a son petit mouvement. */
.dragon { --t: 120px; position: relative; display: inline-block; flex: none; width: var(--t); line-height: 0; }
.dragon img { display: block; width: 100%; height: auto; transform-origin: 50% 100%; animation: arrive-dragon .6s var(--ressort) both, flotte 2.8s ease-in-out .6s infinite; -webkit-user-drag: none; user-select: none; }
.dragon.humeur-fete img { animation: arrive-dragon .6s var(--ressort) both, sautille 1.05s ease-in-out .6s infinite; }
.dragon.humeur-amour img { animation: arrive-dragon .6s var(--ressort) both, battement 1.4s ease-in-out .6s infinite; }
.dragon.humeur-colere img { animation: arrive-dragon .5s var(--ressort) both, tremble .5s linear .5s 2, flotte 2.8s ease-in-out 1.5s infinite; }
.dragon.humeur-triste img { animation: arrive-dragon .6s var(--ressort) both, sanglote 2.2s ease-in-out .6s infinite; }
.dragon.humeur-reflexion img { animation: arrive-dragon .6s var(--ressort) both, penche 3.2s ease-in-out .6s infinite; }
.dragon.humeur-fier img { animation: arrive-dragon .6s var(--ressort) both, plastronne 2.4s ease-in-out .6s infinite; }
.dragon.humeur-pouce img { animation: arrive-dragon .6s var(--ressort) both, dandine 2.6s ease-in-out .6s infinite; }
.dragon.saute img { animation: saute .7s var(--ressort) 1 !important; }
.dragon.secoue img { animation: tremble .45s linear 2 !important; }
.emote { --t: 64px; position: relative; display: inline-block; flex: none; width: var(--t); line-height: 0; }
.emote img { display: block; width: 100%; height: auto; transform-origin: 50% 90%; animation: arrive-dragon .5s var(--ressort) both, flotte 3s ease-in-out .5s infinite; }
@keyframes arrive-dragon { 0% { opacity: 0; transform: translateY(30%) scale(.5); } 60% { opacity: 1; transform: translateY(-6%) scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes sautille { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(2%) scale(1.06, .94); } 45% { transform: translateY(-12%) scale(.96, 1.05); } 70% { transform: translateY(0) scale(1.04, .96); } }
@keyframes battement { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.06); } 28% { transform: scale(.99); } 42% { transform: scale(1.04); } }
@keyframes tremble { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-3%) rotate(-2deg); } 75% { transform: translateX(3%) rotate(2deg); } }
@keyframes sanglote { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(1.5%) rotate(-1.5deg); } 60% { transform: translateY(0) rotate(1.5deg); } }
@keyframes penche { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-4deg); } 70% { transform: rotate(2deg); } }
@keyframes plastronne { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.03, 1.03) translateY(-2%); } }
@keyframes dandine { 0%, 100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-3deg) translateY(-2%); } 50% { transform: rotate(0) translateY(0); } 75% { transform: rotate(3deg) translateY(-2%); } }
@keyframes saute { 0% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(4%) scale(1.12, .86); } 55% { transform: translateY(-22%) scale(.92, 1.1); } 80% { transform: translateY(2%) scale(1.06, .94); } 100% { transform: none; } }

/* la bulle où parle la mascotte : crème bordée de nuit, comme dans le kit */
.bulle-blanche { position: relative; background: var(--creme); color: var(--sur-creme); border: 3px solid var(--contour); border-radius: 20px; padding: 14px 16px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .06), 0 4px 0 var(--contour); font-family: var(--rond); font-weight: 700; }
.bulle-blanche::before { content: ''; position: absolute; left: -13px; bottom: 20px; border: 12px solid transparent; border-right-color: var(--contour); border-left: 0; }
.bulle-blanche::after { content: ''; position: absolute; left: -8px; bottom: 23px; border: 9px solid transparent; border-right-color: var(--creme); border-left: 0; }

/* le bouton doré rayé des grands moments (« C'est parti ! ») */
.btn.raye { background-image: repeating-linear-gradient(-55deg, rgba(255, 255, 255, 0) 0 18px, rgba(255, 255, 255, .22) 18px 36px); background-color: var(--c); }

/* les rayons d'or derrière un trophée ou un badge */
.rayons { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.rayons::before { content: ''; position: absolute; width: 220%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(rgba(255, 204, 26, .24) 0 10deg, rgba(255, 204, 26, 0) 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: tourne 18s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ------------------------------------------------- animations communes */
@keyframes pop-in { 0% { opacity: 0; transform: translateY(16px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes rebond { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 80% { transform: scale(.96); } 100% { transform: scale(1); } }
@keyframes secoue { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes pulse-doux { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes balance { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes gigote { 0%, 86%, 100% { transform: rotate(0) scale(1); } 89% { transform: rotate(-9deg) scale(1.05); } 92% { transform: rotate(8deg) scale(1.05); } 95% { transform: rotate(-5deg); } 98% { transform: rotate(3deg); } }
@keyframes monte-fond { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes scintille { 0%, 100% { opacity: .25; transform: scale(.7) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes s-envole { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 70% { opacity: 1; transform: translateY(-34px) scale(1); } 100% { opacity: 0; transform: translateY(-60px) scale(.9); } }
.entre { animation: pop-in .45s var(--ressort) both; animation-delay: calc(var(--i, 0) * 55ms); }
.rebondit { animation: rebond .6s var(--ressort) both; }
.secouee { animation: secoue .45s ease-in-out; }
.respire { animation: pulse-doux 1.8s ease-in-out infinite; }
.balance { animation: balance 2.2s ease-in-out infinite; transform-origin: 50% 90%; }
.gigote { animation: gigote 3.2s ease-in-out infinite; transform-origin: 50% 80%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
