@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(/polices/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(/polices/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 {
  --bleu: #1F4E5F; --bleu-fonce: #123540; --orange: #F2A65A; --fond: #F4F7F6;
  --texte: #16262C; --gris: #5B6B70; --trait: #DCE5E3; --carte: #fff;
  --violet: #6A51A3; --vert: #2E7D5B; --brique: #B4581F;
  --rayon: 22px; --ombre: 0 2px 10px rgba(18, 53, 64, .06);
  --sures: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font-family: "Nunito", system-ui, sans-serif; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

/* Appui : léger enfoncement sur tous les boutons */
button, .appuyable { transition: transform .12s ease, filter .12s ease; }
button:active, .appuyable:active { transform: scale(.96); filter: brightness(.96); }

/* ---------- Verrou ---------- */
.verrou { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px calc(32px + var(--sures)); background: var(--bleu); color: #fff; text-align: center; }
.verrou img { width: 104px; height: 104px; border-radius: 26px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: apparait .5s cubic-bezier(.2,1.4,.4,1) both; }
.verrou h1 { margin: 22px 0 6px; font-size: 32px; font-weight: 900; }
.verrou p { margin: 0 0 22px; opacity: .85; max-width: 320px; line-height: 1.4; }
.verrou form { width: 100%; max-width: 320px; display: grid; gap: 12px; }
.champ-code { width: 100%; padding: 16px; border-radius: 16px; border: 2px solid transparent; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; text-align: center; letter-spacing: .2em; outline: none; }
.champ-code::placeholder { color: rgba(255,255,255,.55); letter-spacing: normal; }
.champ-code:focus { border-color: var(--orange); }
.btn-orange { padding: 16px; border-radius: 16px; background: var(--orange); color: var(--bleu-fonce); font-weight: 800; font-size: 18px; }
.btn-orange[disabled] { opacity: .6; }
.erreur { min-height: 22px; color: #FFD2B0; font-weight: 700; }
.secoue { animation: secoue .35s; }

/* ---------- Coquille ---------- */
.coquille { min-height: 100dvh; padding-bottom: calc(96px + var(--sures)); }
.entete { background: var(--bleu); color: #fff; padding: calc(28px + env(safe-area-inset-top, 0px)) 22px 26px; border-radius: 0 0 32px 32px; }
.entete .salut { opacity: .85; font-size: 16px; }
.entete h1 { margin: 2px 0 18px; font-size: 32px; font-weight: 900; }
.carte-xp { background: rgba(255,255,255,.12); border-radius: var(--rayon); padding: 16px 18px; }
.carte-xp .ligne { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; gap: 8px; }
.carte-xp .xp { color: var(--orange); white-space: nowrap; }
.barre { height: 10px; border-radius: 6px; background: rgba(255,255,255,.22); overflow: hidden; margin: 12px 0 8px; }
.barre > i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--orange); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.carte-xp small { opacity: .8; font-size: 14px; }

.contenu { padding: 18px 18px 0; }
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chiffre { background: var(--carte); border-radius: var(--rayon); padding: 14px; box-shadow: var(--ombre); }
.chiffre b { display: block; font-size: 30px; font-weight: 900; line-height: 1.1; }
.chiffre span { color: var(--gris); font-size: 14px; }
.chiffre.reponse { display: none; }
.titre { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
.titre h2 { margin: 0; font-size: 20px; font-weight: 800; }
.vide { background: var(--carte); border-radius: var(--rayon); padding: 26px 20px; text-align: center; color: var(--gris); box-shadow: var(--ombre); line-height: 1.45; }
.vide b { color: var(--texte); display: block; font-size: 17px; margin-bottom: 4px; }
.etat-synchro { margin: 16px 2px 0; font-size: 13px; color: var(--gris); display: flex; align-items: center; gap: 6px; }
.etat-synchro i { width: 8px; height: 8px; border-radius: 50%; background: #B9C6C3; }
.etat-synchro.ok i { background: var(--vert); }
.etat-synchro.ko i { background: var(--brique); }
.astuce { margin: 14px 0 0; background: #E3ECEA; border-radius: 16px; padding: 12px 14px; font-size: 14px; color: var(--bleu); line-height: 1.4; }
.page-a-venir { padding: 40px 22px; text-align: center; color: var(--gris); }
.page-a-venir h1 { color: var(--texte); font-size: 28px; font-weight: 900; margin: 30px 0 8px; }

.fab { position: fixed; right: 20px; bottom: calc(96px + var(--sures)); width: 64px; height: 64px; border-radius: 22px; background: var(--orange); box-shadow: 0 8px 20px rgba(242,166,90,.45); display: grid; place-items: center; z-index: 5; }
.fab svg { width: 30px; height: 30px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--trait); display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 4px calc(8px + var(--sures)); z-index: 6; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--gris); text-decoration: none; font-size: 13px; font-weight: 700; padding: 4px 0; }
.nav a svg { width: 26px; height: 26px; }
.nav a.actif { color: var(--bleu); }
.nav .logo-nav, .nav .xp-nav, .nav .btn-nouvelle { display: none; }

#toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -140%); background: var(--bleu-fonce); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 20; transition: transform .3s cubic-bezier(.2,1.4,.4,1), opacity .2s; max-width: 90vw; text-align: center; opacity: 0; pointer-events: none; }
#toast.visible { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Ordinateur ---------- */
@media (min-width: 900px) {
  .coquille { padding: 0 0 0 300px; }
  .nav { top: 0; right: auto; width: 300px; bottom: 0; background: var(--bleu); border: 0; display: flex; flex-direction: column; gap: 6px; padding: 36px 22px; }
  .nav .logo-nav { display: block; color: #fff; font-size: 30px; font-weight: 900; margin: 0 8px 30px; }
  .nav a { flex-direction: row; gap: 14px; font-size: 18px; color: rgba(255,255,255,.85); padding: 14px 16px; border-radius: 16px; }
  .nav a.actif { background: rgba(255,255,255,.14); color: #fff; }
  .nav .xp-nav { display: block; margin-top: 28px; background: rgba(255,255,255,.12); border-radius: var(--rayon); padding: 16px; color: #fff; font-weight: 800; }
  .nav .xp-nav .barre { margin: 10px 0 8px; }
  .nav .xp-nav small { color: var(--orange); }
  .nav .btn-nouvelle { display: block; margin-top: 18px; padding: 16px; border-radius: 18px; background: var(--orange); color: var(--bleu-fonce); font-weight: 800; font-size: 18px; }
  .fab { display: none; }
  .entete { background: none; color: var(--texte); border-radius: 0; padding: 40px 40px 0; }
  .entete .salut { color: var(--gris); opacity: 1; }
  .entete h1 { font-size: 40px; }
  .entete h1 .mobile { display: none; }
  .entete .carte-xp { display: none; }
  .contenu { padding: 24px 40px 40px; max-width: 1300px; }
  .chiffres { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .chiffre { padding: 22px; }
  .chiffre b { font-size: 40px; }
  .chiffre.reponse { display: block; }
}
@media (max-width: 899px) { .entete h1 .ordi { display: none; } }

@keyframes apparait { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes secoue { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Réglage iPhone « Réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
