/* Miradunia — style « jeu vif » : couleurs franches, une couleur par continent, police ronde (Nunito, licence OFL, polices/). */
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap;
  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;
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap;
  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;
}

:root {
  /* Océan : tout en bleus, du ciel au grand large ; les boutons en corail. */
  --fond: #f0f6fc; --carte: #ffffff; --encre: #0f2340; --doux: #4f6480; --trait: #dbe7f3; --ombre-trait: #c3d4e6;
  /* Le corail ne sert qu'aux actions (boutons, liens) ; la sélection est bleue, l'attention ambre, la réussite verte. */
  --accent: #c43a2f; --accent-fonce: #9f2d24; --accent-clair: #fff0ee; --sur-accent: #ffffff;
  --selection: #0369a1; --selection-clair: #e0f2fe; --sur-sel: #ffffff;
  --ambre: #b45309; --or: #f59e0b; --or-clair: #fff3d6; --mauvais-fond: #fff7ed; --mauvais: #92400e;
  --bon: #15803d; --bon-fond: #dcfce7; --faux: #c0262d; --faux-fond: #fde4e4;
  --heros: linear-gradient(140deg, #0369a1 0%, #2563eb 60%, #1e3a8a 100%);
  --ombre: 0 1px 2px rgba(15, 35, 64, .06), 0 8px 24px rgba(15, 35, 64, .07);
  --afrique: #1e40af; --ameriques: #075985; --asie: #1d4ed8; --europe: #0369a1; --oceanie: #0e7490; --monde: #312e81;
  --rayon: 18px; --sur-bon: #ffffff; --sur-faux: #ffffff;
}
/* Thème sombre : celui du système, sauf si la page en impose un (l'application mobile pose data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #233f66; --carte: #315682; --encre: #f4f8fd; --doux: #c3d4e8; --trait: #4a72a3; --ombre-trait: #182c47;
    --accent: #f47b70; --accent-fonce: #c2453b; --accent-clair: #3a1d1b; --sur-accent: #1a0b0a;
    --ambre: #fbbf24; --or: #fbbf24; --or-clair: #5a4a1d; --mauvais-fond: #33200c; --mauvais: #fdba74; --selection: #38bdf8; --selection-clair: #2f6aa3; --sur-sel: #06223a; --sur-faux: #1a0b0a;
    --bon: #4ade80; --bon-fond: #10331f; --faux: #f87171; --faux-fond: #3b1717;
    --heros: linear-gradient(140deg, #0369a1 0%, #1d4ed8 60%, #1e3a8a 100%);
    --ombre: 0 1px 2px rgba(0, 0, 0, .5);
    --afrique: #1e3a8a; --ameriques: #075985; --asie: #1e40af; --europe: #0369a1; --oceanie: #0e7490; --monde: #312e81; --sur-bon: #06200f;
  }
}
:root[data-theme="dark"] {
  --fond: #233f66; --carte: #315682; --encre: #f4f8fd; --doux: #c3d4e8; --trait: #4a72a3; --ombre-trait: #182c47;
  --accent: #f47b70; --accent-fonce: #c2453b; --accent-clair: #3a1d1b; --sur-accent: #1a0b0a;
  --ambre: #fbbf24; --or: #fbbf24; --or-clair: #5a4a1d; --mauvais-fond: #33200c; --mauvais: #fdba74; --selection: #38bdf8; --selection-clair: #2f6aa3; --sur-sel: #06223a; --sur-faux: #1a0b0a;
  --bon: #4ade80; --bon-fond: #10331f; --faux: #f87171; --faux-fond: #3b1717;
  --heros: linear-gradient(140deg, #0369a1 0%, #1d4ed8 60%, #1e3a8a 100%);
  --ombre: 0 1px 2px rgba(0, 0, 0, .5);
  --afrique: #1e3a8a; --ameriques: #075985; --asie: #1e40af; --europe: #0369a1; --oceanie: #0e7490; --monde: #312e81; --sur-bon: #06200f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 500 17px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: inherit; font-weight: 900; line-height: 1.15; margin: 0 0 .4em; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); font-weight: 700; }
img { max-width: 100%; display: block; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
main:focus-visible, .carte:focus-visible { outline: none; } /* cibles de focus après un changement d'écran */

/* ---------- Entête ---------- */
.entete {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 560px; margin: 0 auto; padding: 14px 16px 6px;
}
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); min-height: 48px;
  font-weight: 900; font-size: 1.4rem; letter-spacing: -.02em; }
.marque .logo { flex: none; }
.serie-entete { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: var(--ambre);
  background: var(--or-clair); border-radius: 999px; padding: 4px 12px 4px 10px; font-variant-numeric: tabular-nums; }
.serie-entete:empty { display: none; }

main { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; outline: none; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px;
  margin: 0 0 16px; box-shadow: var(--ombre); outline: none; }
.doux { color: var(--doux); } .petit { font-size: .88rem; } .centre { text-align: center; }

/* ---------- Boutons : en relief, ils s'enfoncent au toucher ---------- */
.bouton { display: block; width: 100%; padding: 14px 16px; border-radius: 16px; border: 0;
  background: var(--accent); color: var(--sur-accent); font-weight: 900; font-size: 1.02rem; letter-spacing: .01em;
  text-align: center; min-height: 54px; margin-top: 12px; box-shadow: 0 4px 0 var(--accent-fonce); }
.bouton.secondaire { background: var(--carte); color: var(--accent); border: 2px solid var(--trait); box-shadow: 0 4px 0 var(--trait); }
.bouton:disabled { opacity: .45; box-shadow: none; }

/* ---------- Carte du défi du jour ---------- */
.carte.heros { background: var(--heros); color: #fff; border: 0; position: relative; overflow: hidden; padding: 20px; }
.carte.heros::after { content: ""; position: absolute; inset-inline-end: -60px; bottom: -70px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.heros h1 { color: #fff; font-size: 1.55rem; }
.heros .doux { color: #ffffff; }
.heros .etiquette { color: #fef3c7; }
.heros .bouton { background: #fff; color: #1e3a8a; box-shadow: 0 4px 0 rgba(0, 0, 0, .22); position: relative; z-index: 1; font-size: 1.08rem; }
.heros .bouton.secondaire { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .75); box-shadow: none; }
.heros .loupe { border-color: #fde68a; }
.heros h1 { margin-bottom: .35em; }
/* Niveau du jour : une pastille, couleur du feu (facile vert, moyen ambre, difficile rouge). */
.niveau-jour { display: inline-block; font-size: .8rem; font-weight: 900; padding: 3px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); color: #fff; margin: 0 0 12px; }
.niveau-jour::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 7px;
  vertical-align: 1px; background: #fbbf24; }
.niveau-jour.n1::before { background: #4ade80; } .niveau-jour.n3::before { background: #f87171; }
.heros p.doux { margin-bottom: 4px; }
@media (max-width: 400px) { .heros h1 { font-size: 1.38rem; } .loupe { width: 84px; height: 84px; } }

/* ---------- Chiffres ---------- */
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 16px; }
.chiffres div { background: var(--carte); border: 1px solid var(--trait); border-radius: 16px; padding: 12px 6px;
  text-align: center; box-shadow: var(--ombre); }
.chiffres b { display: block; font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.chiffres div:nth-child(1) b { color: var(--ambre); } .chiffres div:nth-child(2) b { color: var(--encre); }
.chiffres div:nth-child(3) b { color: var(--selection); }
.chiffres span { font-size: .8rem; color: var(--doux); font-weight: 700; }

.compte { font-variant-numeric: tabular-nums; font-weight: 900; }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Résultat du défi : une carte qui récompense ---------- */
.carte.resultat { text-align: center; }
.resultat .score-grand { font-size: 4.4rem; font-weight: 1000; line-height: 1; margin: 8px 0 4px; font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate; color: #fff; }
.resultat .score-grand small { font-size: 1.4rem; font-weight: 800; opacity: .9; }
.resultat h1, .resultat h2.titre-resultat { font-size: 1.4rem; margin: 0 0 12px; }
.epreuves-resultat { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; position: relative; z-index: 1; }
.epreuves-resultat li { display: flex; align-items: center; gap: 10px; background: rgba(8, 20, 60, .3); border-radius: 14px;
  padding: 8px 12px; text-align: start; font-weight: 800; min-height: 48px; }
.epreuves-resultat .ico { width: 28px; height: 28px; flex: none; color: #fde68a; }
.epreuves-resultat .ico svg { width: 100%; height: 100%; display: block; }
.epreuves-resultat .nom-ep { flex: 1; line-height: 1.2; }
.epreuves-resultat .pts { font-weight: 900; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.epreuves-resultat .pts small { font-weight: 700; opacity: .9; }
.epreuves-resultat li.plein .pts::before { content: "✓ "; color: #bbf7d0; }
.serie-record { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; font-weight: 900;
  background: var(--carte); border: 1px solid var(--trait); box-shadow: var(--ombre); font-variant-numeric: tabular-nums; }
.chip.serie { color: var(--ambre); background: var(--or-clair); border-color: var(--or); }
.nouveautes .miniatures { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.nouveautes .miniatures img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; border: 2px solid var(--trait); }
.nouveautes .miniatures .plus { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 12px;
  background: var(--selection-clair); color: var(--selection); font-weight: 900; }

/* ---------- Continents (entraînement) et raccourcis ---------- */
.titre-bloc { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 2px 10px; }
.titre-bloc h2 { margin: 0; }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.zone { --c: var(--monde); position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px;
  text-align: start; padding: 14px 14px 12px; min-height: 116px; border: 0; border-radius: var(--rayon);
  background: var(--c); background-image: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .08));
  color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .22); overflow: hidden; }
/* Silhouette du continent en grand et en transparence, qui déborde de la tuile. */
.zone .zone-icone { position: absolute; top: -12px; inset-inline-end: -20px; width: 124px; height: 124px; color: #fff; opacity: .16; }
.zone .zone-icone svg, .raccourci .zone-icone svg { width: 100%; height: 100%; display: block; }
.zone b, .zone .petit, .zone .jauge { position: relative; }
/* Le texte blanc passe sur la silhouette claire : une ombre douce garde le contraste partout. */
.zone b, .zone .petit { text-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 0 1px rgba(0, 0, 0, .35); }
.zone b { font-size: 1.08rem; font-weight: 900; line-height: 1.15; }
/* Choix du niveau de l'entraînement */
.zone .petit { opacity: 1; font-weight: 700; font-size: .8rem; }
.zone .jauge { width: 100%; height: 7px; margin: 8px 0 0; background: rgba(255, 255, 255, .3); }
.zone .jauge i { background: #fff; }
.zone.choisie { outline: 3px solid var(--encre); outline-offset: 2px; }
[data-zone="Afrique"] { --c: var(--afrique); } [data-zone="Amériques"] { --c: var(--ameriques); }
[data-zone="Asie"] { --c: var(--asie); } [data-zone="Europe"] { --c: var(--europe); }
[data-zone="Océanie"] { --c: var(--oceanie); } [data-zone="monde"] { --c: var(--monde); }
.carte.continent { border-top: 6px solid var(--c); }
.carte.continent h2::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-inline-end: 8px; vertical-align: middle; }

.raccourci { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; margin: 0 0 6px; text-align: start;
  border: 2px solid var(--trait); border-radius: var(--rayon); background: var(--carte); box-shadow: 0 4px 0 var(--trait); color: var(--encre); }
.raccourci .zone-icone { width: 30px; height: 30px; color: var(--selection); }
.raccourci.alerte .zone-icone { color: var(--ambre); }
.raccourci b { display: block; font-weight: 900; font-size: 1rem; }
.raccourci span.petit { color: var(--doux); font-weight: 700; font-size: .85rem; line-height: 1.2; }
.raccourci.alerte { border-color: var(--or); background: var(--or-clair); box-shadow: 0 4px 0 var(--or); }
.raccourci.alerte span.petit { color: var(--ambre); }

/* ---------- Défi ---------- */
.etapes { display: flex; gap: 6px; margin: 4px 0 14px; }
.etapes i { flex: 1; height: 10px; border-radius: 5px; background: var(--trait); }
.etapes i.passee { background: var(--bon); } .etapes i.ici { background: var(--or); }
.progression { flex: none; font-weight: 900; font-size: .95rem; font-variant-numeric: tabular-nums; }
.consigne { font-weight: 800; margin: 12px 0 6px; }
.etiquette { display: inline-block; font-size: .86rem; letter-spacing: .01em;
  color: var(--ambre); font-weight: 900; margin-bottom: 8px; }

.photo { margin: 0 0 12px; border-radius: 16px; overflow: hidden; background: #0f172a; }
.photo img { width: 100%; height: 240px; object-fit: contain; }
.photo.zoom img { object-fit: cover; transform: scale(2.6); }
.nom { font-weight: 900; font-size: 1.3rem; margin: 0; }
.categorie { font-weight: 700; font-size: .9rem; color: var(--doux); }

select { width: 100%; min-height: 54px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--trait);
  background: var(--carte); }
.essais { list-style: none; padding: 0; margin: 8px 0; font-size: .92rem; font-weight: 700; }
.essais li { padding: 8px 12px; border-radius: 12px; background: var(--mauvais-fond); color: var(--mauvais); margin-bottom: 6px; }

.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choix button, .puce {
  min-height: 56px; padding: 10px 8px; border-radius: 16px; border: 2px solid var(--trait);
  background: var(--carte); font-weight: 800; line-height: 1.2; color: var(--encre); text-decoration: none;
  box-shadow: 0 4px 0 var(--trait);
}
.choix button:not(:disabled):hover, .puce:not(:disabled):hover { border-color: var(--accent); }
.juste { border-color: var(--bon) !important; background: var(--bon-fond) !important; color: var(--bon) !important; box-shadow: 0 4px 0 var(--bon) !important; }
.fausse { border-color: var(--faux) !important; background: var(--faux-fond) !important; color: var(--faux) !important; box-shadow: 0 4px 0 var(--faux) !important; }
.choix .juste::before { content: "✓ "; } .choix .fausse::before { content: "✗ "; }

.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vignette { padding: 0; border: 2px solid var(--trait); border-radius: 16px; overflow: hidden; background: var(--carte);
  text-align: start; display: flex; flex-direction: column; box-shadow: 0 4px 0 var(--trait); }
.vignette img { width: 100%; height: 118px; object-fit: cover; }
.vignette span { padding: 8px 10px; font-weight: 800; line-height: 1.2; font-size: .95rem; }
.vignette small { padding: 0 10px 8px; color: var(--doux); font-weight: 800; }
.vignette.juste span::before { content: "✓ "; } .vignette.fausse span::before { content: "✗ "; }

.lien { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; width: 100%; text-align: start;
  padding: 8px; margin: 0 0 10px; border: 2px solid var(--trait); border-radius: 16px; background: var(--carte); box-shadow: 0 3px 0 var(--trait); }
.lien img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.lien.active { border-color: var(--selection); background: var(--selection-clair); box-shadow: 0 3px 0 var(--selection); }
.lien-texte { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; font-weight: 700; }
.attribue { font-weight: 900; color: var(--selection); }
.attribue.vide { font-weight: 600; color: var(--doux); }
.lien.juste .attribue { color: var(--bon); } .lien.fausse .attribue { color: var(--faux); }
.puces, .anciens { display: flex; flex-wrap: wrap; gap: 10px; }
.puce { min-height: 46px; padding: 8px 16px; font-size: .95rem; display: inline-flex; align-items: center; border-radius: 999px; box-shadow: 0 3px 0 var(--trait); }
/* Pays déjà attribué à une curiosité : lisible, mais en retrait (fond neutre, trait pointillé, pas de relief). */
.puce.prise { background: var(--fond); color: var(--doux); border-style: dashed; box-shadow: none; }
.puce.choisie { border-color: var(--selection); background: var(--selection-clair); color: var(--selection); }

/* Verdict : une ligne forte, une ligne douce. Vert pour réussi, ambre pour partiel, ambre doux pour manqué : jamais de rouge. */
.verdict { border-radius: 16px; padding: 12px 14px; margin: 14px 0 10px; font-weight: 900; border-inline-start: 6px solid transparent; }
.verdict.bon { background: var(--bon-fond); color: var(--bon); border-inline-start-color: var(--bon); }
.verdict.mauvais { background: var(--mauvais-fond); color: var(--mauvais); border-inline-start-color: #fb923c; }
.verdict.moyen { background: var(--or-clair); color: var(--ambre); border-inline-start-color: var(--or); }
.verdict-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.verdict-fort { margin: 0; font-size: 1.15rem; font-weight: 900; line-height: 1.2; }
.verdict-doux { margin: 6px 0 0; font-size: .95rem; font-weight: 700; line-height: 1.35; }
.verdict-monte { margin: 8px 0 0; font-size: .9rem; font-weight: 800; }
.gain { flex: none; background: var(--or); color: #3b2a00; border-radius: 999px; padding: 2px 14px; font-weight: 1000; font-size: 1.1rem;
  font-variant-numeric: tabular-nums; }
/* Barème de « D'où ça vient ? » : les quatre prix, celui d'en ce moment en avant, les passés barrés. */
.ligne-bareme { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ligne-bareme .etiquette { margin: 0; }
.bareme { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.bareme li { min-width: 44px; text-align: center; padding: 3px 8px; border-radius: 999px; border: 2px solid var(--trait);
  font-size: .85rem; font-weight: 800; color: var(--doux); font-variant-numeric: tabular-nums; }
.bareme li.passee { text-decoration: line-through; background: var(--fond); }
.bareme li.ici { background: var(--or); border-color: var(--or); color: #3b2a00; font-size: 1.02rem; font-weight: 1000; }
.fait { margin: 0 0 6px; }
.credit { font-size: .82rem; color: var(--doux); margin: 4px 0 12px; overflow-wrap: anywhere; }
.credit a { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 2px; }

/* ---------- Atlas ---------- */
.pays { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--trait); }
.pays b { font-weight: 800; }
.niveau { font-size: .78rem; font-weight: 900; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 2px solid var(--trait); color: var(--doux); }
.niveau.n1 { color: var(--ambre); border-color: var(--or); background: var(--or-clair); }
.niveau.n2 { color: var(--selection); border-color: var(--selection); background: var(--selection-clair); }
.niveau.n3 { color: var(--sur-bon); background: var(--bon); border-color: var(--bon); }
.jauge { height: 12px; border-radius: 6px; background: var(--trait); overflow: hidden; margin: 8px 0; }
.jauge i { display: block; height: 100%; background: var(--selection); border-radius: 6px; }

.barres { display: grid; gap: 8px; }
.barre-ligne { display: grid; grid-template-columns: 96px 1fr 24px; gap: 8px; align-items: center; font-size: .86rem; font-weight: 700; }
.barre-ligne i { display: block; height: 14px; border-radius: 7px; background: var(--selection); }
.barre-ligne b { text-align: end; font-variant-numeric: tabular-nums; }

/* ---------- Album ---------- */
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.case { padding: 0; border: 2px solid var(--trait); border-radius: 14px; overflow: hidden; background: var(--carte);
  display: flex; flex-direction: column; text-align: start; min-height: 96px; }
.case img { width: 100%; height: 72px; object-fit: cover; }
.case span { padding: 5px 6px 7px; font-size: .78rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.case.vide { align-items: center; justify-content: center; text-align: center; border-style: dashed; color: var(--doux); }
.case.vide b { font-size: 1.6rem; font-weight: 900; }

textarea, input[type=text] { width: 100%; min-height: 48px; font: .85rem ui-monospace, Consolas, monospace; padding: 12px 10px; border-radius: 12px;
  border: 2px solid var(--trait); background: var(--fond); color: var(--encre); }
details { margin-top: 10px; } summary { cursor: pointer; font-weight: 800; padding: 12px 0; min-height: 48px; }
.credits-liste { font-size: .82rem; color: var(--doux); padding-inline-start: 18px; overflow-wrap: anywhere; }
ul.regles { padding-inline-start: 20px; margin: 0 0 .8em; } ul.regles li { margin-bottom: 8px; }

/* ---------- Barre du bas, avec icônes ---------- */
.barre { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px;
  background: var(--carte); border-top: 1px solid var(--trait); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(20, 33, 61, .06); }
.barre button { flex: 1; max-width: 120px; min-height: 58px; border: 0; background: none; border-radius: 14px;
  font-size: .76rem; font-weight: 800; color: var(--doux); position: relative; padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.barre button svg { width: 24px; height: 24px; }
.barre button[aria-current=page] { color: var(--selection); background: var(--selection-clair); }
.pastille { position: absolute; top: 3px; inset-inline-end: 10px; min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--faux); color: var(--sur-faux); font-size: .72rem; line-height: 20px; padding: 0 5px; font-weight: 900; }
.essai { background: #7c3aed; color: #fff; text-align: center; font-size: .86rem; font-weight: 800; padding: 6px 10px; }
.essai a { color: #fff; }

/* Page d'accueil commune : choix de la langue (le plus souvent, elle redirige aussitôt). */
.choix-langue { max-width: 420px; margin: 12vh auto 0; padding: 0 16px; text-align: center; }
.choix-langue h1 { justify-content: center; font-size: 1.8rem; }
.choix-langue ul { list-style: none; padding: 0; display: grid; gap: 10px; margin: 24px 0 0; }
.choix-langue a { display: block; padding: 14px; border-radius: 16px; border: 2px solid var(--trait); background: var(--carte);
  color: var(--encre); font-weight: 800; text-decoration: none; box-shadow: 0 4px 0 var(--trait); }
.choix-langue a:hover { border-color: var(--accent); }

/* Pendant le défi : pas de barre du bas, un bouton pour sortir. */
body.en-jeu { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
body.en-jeu .barre { display: none; }
.haut-jeu { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.haut-jeu .etapes { flex: 1; margin: 0; }
.quitter { width: 48px; height: 48px; border-radius: 24px; border: 2px solid var(--trait); background: var(--carte);
  font-size: 1.4rem; line-height: 1; color: var(--doux); flex: none; }

/* Recherche d'un pays */
input.champ-pays { width: 100%; font: 600 1rem "Nunito", system-ui, sans-serif; min-height: 54px; padding: 10px 14px; border: 2px solid var(--trait);
  border-radius: 14px; background: var(--carte); color: var(--encre); }
input.champ-pays:focus { border-color: var(--accent); outline: none; }
.resultats { margin: 10px 0 0; }
.resultats p { grid-column: 1 / -1; margin: 4px 0; }

/* Essais : ambre quand le continent est bon (on se rapproche), neutre pour un indice demandé. */
.essais li.proche { background: var(--or-clair); color: var(--ambre); border-inline-start: 5px solid var(--or); }
.essais li.neutre { background: var(--fond); color: var(--doux); border: 1px dashed var(--ombre-trait); }

/* Aperçu du jour sur l'accueil : une loupe sur le détail de la photo. */
.loupe { float: inline-end; width: 100px; height: 100px; margin: 0 0 8px; margin-inline-start: 12px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--or); background: var(--trait); position: relative; z-index: 1; }
.loupe img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.6); }
.loupe ~ .etiquette { display: block; }
.a-decouvrir summary { color: var(--doux); font-weight: 700; }
.regle-atlas { margin-top: 4px; } .regle-atlas summary { color: var(--accent); font-size: .92rem; }
.album-vides .pays:first-child { border-top: 0; padding-top: 0; }
details.credit summary { font-weight: 700; padding: 12px 0; }

/* L'arabe se lie : ni espacement entre les lettres, ni capitales. */
:lang(ar) .etiquette { letter-spacing: 0; text-transform: none; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) .marque { letter-spacing: 0; }

@media (min-width: 480px) { .photo img { height: 300px; } .vignette img { height: 150px; } .album { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: no-preference) {
  .carte, .zones, .raccourci { animation: entree .28s ease-out; }
  @keyframes entree { from { opacity: 0; transform: translateY(8px); } }
  .bouton, .choix button, .puce, .vignette, .lien, .quitter, .zone, .raccourci { transition: transform 80ms ease-out, box-shadow 80ms ease-out; }
  .bouton:active, .choix button:active, .puce:active, .vignette:active, .lien:active, .zone:active, .raccourci:active {
    transform: translateY(3px); box-shadow: 0 1px 0 var(--trait); }
  .bouton:not(.secondaire):active { box-shadow: 0 1px 0 var(--accent-fonce); }
  .zone:active { box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
  .quitter:active { transform: scale(.94); }
  /* La photo entière se dévoile en reculant depuis le détail. */
  .photo.dezoom img { animation: dezoom .9s cubic-bezier(.16, 1, .3, 1); }
  @keyframes dezoom { from { transform: scale(2.6); } to { transform: scale(1); } }
  .secoue { animation: secoue .32s ease-out; }
  @keyframes secoue { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
  .rebond { animation: rebond .3s ease-out; }
  .gain { animation: gain .5s cubic-bezier(.2, 1.5, .4, 1); }
  @keyframes gain { from { transform: scale(.4); opacity: 0; } }
  @keyframes rebond { 50% { transform: scale(1.07); } }
  .loupe { animation: pouls 2.4s ease-in-out infinite; }
  @keyframes pouls { 50% { box-shadow: 0 0 0 7px rgba(253, 230, 138, .35); } }
}

/* ---------- Teintes douces des tuiles (modes, thèmes) : toutes dans la palette Océan, ambre en touche chaude ---------- */
:root {
  --ton-plat: #b45309; --ton-boisson: #0e7490; --ton-monument: #4338ca; --ton-lieu: #0f766e;
  --ton-fete: #1d4ed8; --ton-tradition: #475569; --ton-instrument: #0369a1; --ton-objet: #6d28d9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ton-plat: #fbbf24; --ton-boisson: #22d3ee; --ton-monument: #a5b4fc; --ton-lieu: #5eead4;
    --ton-fete: #93c5fd; --ton-tradition: #cbd5e1; --ton-instrument: #38bdf8; --ton-objet: #c4b5fd;
  }
}
:root[data-theme="dark"] {
  --ton-plat: #fbbf24; --ton-boisson: #22d3ee; --ton-monument: #a5b4fc; --ton-lieu: #5eead4;
  --ton-fete: #93c5fd; --ton-tradition: #cbd5e1; --ton-instrument: #38bdf8; --ton-objet: #c4b5fd;
}
.theme[data-theme="plat"] { --t: var(--ton-plat); } .theme[data-theme="boisson"] { --t: var(--ton-boisson); }
.theme[data-theme="monument"] { --t: var(--ton-monument); } .theme[data-theme="lieu"] { --t: var(--ton-lieu); }
.theme[data-theme="fête"] { --t: var(--ton-fete); } .theme[data-theme="tradition"] { --t: var(--ton-tradition); }
.theme[data-theme="instrument"] { --t: var(--ton-instrument); } .theme[data-theme="objet"] { --t: var(--ton-objet); }
.mode[data-mode="continent"] { --t: var(--ton-instrument); } .mode[data-mode="theme"] { --t: var(--ton-monument); }
.mode[data-mode="niveau"] { --t: var(--ton-lieu); } .mode[data-mode="hasard"] { --t: var(--ton-plat); }

/* ---------- Objectif du jour : un anneau qui se ferme et se coche, la série de jours à côté ---------- */
.objectif-jour { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.objectif-jour .coche { flex: none; width: 56px; height: 56px; display: block; }
.objectif-jour .coche svg { width: 100%; height: 100%; display: block; overflow: visible; }
.coche circle { fill: none; stroke-width: 6; transform: rotate(-90deg); transform-origin: 28px 28px; }
.coche .piste { stroke: var(--trait); }
.coche .plein { stroke: var(--bon); stroke-linecap: round; }
.coche .trait { fill: none; stroke: var(--bon); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.coche text { font: 900 13px "Nunito", system-ui, sans-serif; fill: var(--doux); direction: ltr; }
.objectif-jour.atteint { border-color: var(--bon); background: var(--bon-fond); }
.objectif-jour.atteint .coche .piste { stroke: var(--carte); }
.objectif-texte { flex: 1 1 8em; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.objectif-texte b { font-weight: 900; font-size: 1.05rem; }
.objectif-jour.atteint .objectif-texte b { color: var(--bon); }
.objectif-jour.atteint .objectif-texte .doux { color: var(--encre); }
.chip.flamme { flex-direction: column; gap: 0; padding: 6px 12px 7px; border-radius: 18px; text-align: center; box-shadow: none; line-height: 1.15; }
.chip.flamme .chiffre-flamme { display: inline-flex; align-items: center; gap: 4px; font-size: 1.35rem; }
.chip.flamme .legende { font-size: .75rem; font-weight: 800; }
.chip.objectif-chip { color: var(--bon); background: var(--bon-fond); border-color: var(--bon); }

/* ---------- Défi du jour commun : trois atouts d'un coup d'œil, puis un état « fait » compact ---------- */
.defi-commun h2 { margin: 0 0 .35em; }
.defi-commun .loupe { width: 76px; height: 76px; border-width: 3px; }
.defi-commun .niveau-jour { background: var(--selection-clair); color: var(--selection); margin-bottom: 10px; }
.defi-commun { border-inline-start: 5px solid var(--selection); }
.defi-points { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 6px; clear: both; }
.defi-points li { display: flex; align-items: center; gap: 10px; font-weight: 800; line-height: 1.2; min-height: 36px; }
.defi-points .ico { flex: none; width: 36px; height: 36px; padding: 7px; border-radius: 12px; background: var(--selection-clair); color: var(--selection); }
.defi-points .ico svg, .defi-rang .ico svg { width: 100%; height: 100%; display: block; }
.defi-points .podium .ico { background: var(--or-clair); color: var(--ambre); }
.defi-fait { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.3rem; line-height: 1.2; margin: 4px 0 6px; color: var(--bon); }
.rond-bon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--bon); color: var(--sur-bon); font-size: 1.05rem; }
.defi-rang { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 800; }
.defi-rang .ico { flex: none; width: 32px; height: 32px; padding: 6px; border-radius: 10px; background: var(--or-clair); color: var(--ambre); }
.defi-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5em, 1fr)); gap: 10px; margin-top: 10px; }
.defi-actions .bouton { margin-top: 0; }

/* ---------- Jouer comme vous voulez : 4 tuiles « mode », puis le panneau des choix, relié à la tuile touchée ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.mode { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 112px; padding: 12px 14px; text-align: start;
  border-radius: var(--rayon); border: 2px solid var(--trait); background: var(--carte); color: var(--encre); box-shadow: 0 4px 0 var(--trait); }
.mode .icone-mode { width: 44px; height: 44px; padding: 9px; border-radius: 14px; color: var(--t, var(--selection)); background: var(--selection-clair);
  background: color-mix(in srgb, var(--t, var(--selection)) 14%, var(--carte)); }
.mode .icone-mode svg { width: 100%; height: 100%; display: block; }
.mode-textes { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mode b { font-weight: 900; font-size: 1.05rem; line-height: 1.15; }
.mode .petit { color: var(--doux); font-weight: 700; font-size: .8rem; line-height: 1.2; }
.mode-coche { display: none; position: absolute; top: 10px; inset-inline-end: 10px; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--selection); color: var(--sur-sel); font-weight: 1000; font-size: .85rem; line-height: 1; }
.mode[aria-pressed="true"] { border-color: var(--selection); background: var(--selection-clair); box-shadow: 0 4px 0 var(--selection); }
.mode[aria-pressed="true"] .icone-mode { background: var(--carte); }
.mode[aria-pressed="true"] .mode-coche { display: inline-flex; }
.mode[aria-pressed="true"] .petit { color: var(--encre); }
.choix-mode { position: relative; margin: 14px 0 12px; padding: 14px 12px 12px; border: 2px solid var(--selection); border-radius: var(--rayon); background: var(--selection-clair); }
.choix-mode::before { content: ""; position: absolute; top: -10px; width: 16px; height: 16px; background: var(--selection-clair); border: solid var(--selection); border-width: 2px 0 0 2px;
  transform: rotate(45deg); inset-inline-start: calc(25% - 10.5px); }
.choix-mode[data-col="1"]::before { inset-inline-start: calc(75% - 5.5px); }
.choix-mode > :last-child { margin-bottom: 0; }
.choix-mode .niveaux { margin-top: 0; }
.choix-mode .zones { gap: 10px; }
.choix-mode .zone { min-height: 104px; }
.choix-mode .bouton { margin-top: 0; }
.note-serie { margin: 4px 2px 12px; }
/* Thèmes et niveaux : une petite illustration à sa teinte, un nom, le nombre de curiosités en discret. */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.theme { display: flex; align-items: center; gap: 8px; min-height: 68px; padding: 8px; text-align: start;
  border-radius: 16px; border: 2px solid var(--trait); background: var(--carte); color: var(--encre); box-shadow: 0 3px 0 var(--trait); }
.theme .icone-theme { flex: none; width: 40px; height: 40px; padding: 7px; border-radius: 14px; color: var(--t, var(--selection)); background: var(--selection-clair);
  background: color-mix(in srgb, var(--t, var(--selection)) 14%, var(--carte)); }
.theme .icone-theme svg { width: 100%; height: 100%; display: block; }
.theme .noms { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.theme b { font-weight: 900; font-size: .9rem; overflow-wrap: break-word; hyphens: auto; }
.theme .petit { color: var(--doux); font-weight: 700; font-size: .78rem; }
.themes.niveaux-tuiles { grid-template-columns: 1fr; }
.niveau-tuile.n1 { --t: var(--bon); } .niveau-tuile.n2 { --t: var(--ambre); } .niveau-tuile.n3 { --t: var(--faux); }
/* Le jeu tient dans une colonne de 560 px : sur grand écran, les tuiles gardent la même forme (pas de grille qui s'étire). */
@media (min-width: 720px) { .themes.niveaux-tuiles { grid-template-columns: repeat(3, 1fr); } .themes.niveaux-tuiles .theme { min-height: 76px; } }
/* Niveau : un choix de réglage, en bleu (le corail reste aux boutons d'action) */
.niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.4em, 1fr)); gap: 8px; margin: 0 0 14px; font-size: .9rem; }
.niveaux .puce { min-height: 48px; padding: 6px 4px; font-size: 1em; justify-content: center; text-align: center; }
.niveaux .puce[aria-pressed="true"] { border-color: var(--selection); background: var(--selection); color: var(--sur-sel); box-shadow: 0 3px 0 var(--selection); }

/* ---------- Fin d'une série : une récompense, comme la fin du défi ---------- */
.fin-serie { padding: 22px 20px 20px; }
.fin-serie h1 { font-size: 1.6rem; margin: 6px 0 10px; }
.fin-serie .fin-score { font-size: 4.4rem; font-weight: 1000; line-height: 1; margin: 6px 0 12px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; color: #fff; }
.fin-serie .fin-score small { font-size: 1.6rem; font-weight: 800; opacity: .92; }
.pastilles { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 0 auto 12px; max-width: 18em; position: relative; z-index: 1; }
.pastilles i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.pastilles i.plein { background: #fde68a; }
.fin-serie .score-serie { font-size: 1.15rem; font-weight: 800; line-height: 1.3; margin: 0 0 4px; color: #fff; }
.fin-serie .etiquette { color: #fef3c7; }
.fin-serie.palier3 .fin-score { color: #fde68a; }
@media (prefers-reduced-motion: no-preference) {
  .mode, .theme { transition: transform 80ms ease-out, box-shadow 80ms ease-out; }
  .mode:active, .theme:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--trait); }
  .carte.rappel-serie { animation: entree .5s ease-out .3s backwards; }
  .pastilles i.plein { animation: gain .4s cubic-bezier(.2, 1.5, .4, 1) calc(var(--i) * 70ms + 250ms) backwards; }
  .coche.neuf .plein { stroke-dasharray: 145; animation: anneau .7s ease-out backwards; }
  .coche.neuf .trait { stroke-dasharray: 40; animation: trace .45s ease-out .55s backwards; }
  @keyframes anneau { from { stroke-dashoffset: 145; } }
  @keyframes trace { from { stroke-dashoffset: 40; } }
}
.rappel-serie h2 .cloche { margin-inline-end: 8px; }


/* Rappel quotidien */
a.bouton { text-decoration: none; }
.ligne-heure { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; font-weight: 700; }
.heure-rappel { font: 700 1rem "Nunito", system-ui, sans-serif; min-height: 48px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--trait); background: var(--carte); color: var(--encre); }

/* Podium du défi du jour : trois lignes (rang, pseudo, points, durée), puis le rang du joueur. */
.podium { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; }
.podium-ligne { display: grid; grid-template-columns: 36px 1fr auto; grid-template-areas: "rang qui pts" "rang temps pts"; align-items: center;
  column-gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--fond); border: 1px solid var(--trait); }
.podium-ligne .rang { grid-area: rang; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 1000; background: var(--selection-clair); color: var(--selection); }
.podium-ligne.r1 .rang { background: var(--or); color: #3b2a00; }
.podium-ligne .qui { grid-area: qui; font-weight: 900; overflow-wrap: anywhere; line-height: 1.2; }
.podium-ligne .ex-aequo { margin-inline-start: 6px; font-weight: 700; color: var(--doux); }
.podium-ligne .pts { grid-area: pts; font-weight: 1000; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.podium-ligne .temps { grid-area: temps; font-size: .82rem; color: var(--doux); font-weight: 700; }
.mon-rang { font-weight: 900; color: var(--selection); margin: 4px 0 6px; }
input.champ-pseudo { width: 100%; font: 700 1rem "Nunito", system-ui, sans-serif; min-height: 52px; padding: 10px 14px; border: 2px solid var(--trait);
  border-radius: 14px; background: var(--carte); color: var(--encre); margin-top: 6px; }
input.champ-pseudo:focus { border-color: var(--accent); outline: none; }
.erreur-pseudo { color: var(--faux); font-weight: 800; margin: 6px 0 0; min-height: 1.2em; }
.erreur-pseudo:empty { min-height: 0; margin: 0; }
