:root {
  --fond: #f4efe6;
  --papier: #fffdf8;
  --encre: #1f1a17;
  --discret: #6f655c;
  --accent: #8c2f1b;
  --accent-clair: #f3dcd3;
  --vrai: #1f6f4a;
  --ligne: #ddd3c4;
  --mer: #c9d6dc;
  --terre: #efe7d8;
  --rayon: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--fond); color: var(--encre); }
body {
  font: 16px/1.45 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 .4rem; }
main { max-width: 760px; margin: 0 auto; padding: 0 12px 32px; }

.barre {
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; justify-content: space-between;
  padding: .6rem 14px; background: var(--encre); color: var(--fond);
}
.barre a { color: var(--fond); text-decoration: none; }
.marque { font-variant: small-caps; letter-spacing: .06em; font-size: 1.15rem; }
.barre nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .92rem; }

.carte-papier { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; margin: 14px 0; }
.centre { text-align: center; }
.discret { color: var(--discret); font-size: .9rem; }
.alerte { color: var(--accent); }
.gros { font-size: 2rem; margin: .4rem 0 1rem; }

.bouton {
  display: inline-block; border: 0; border-radius: 999px; background: var(--accent); color: #fff;
  font: inherit; font-size: 1rem; padding: .7rem 1.3rem; text-decoration: none; cursor: pointer;
}
.bouton:disabled { background: #b9aea2; cursor: default; }
.bouton.secondaire { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.bouton.large { display: block; width: 100%; margin: 10px 0; }
.pile { display: flex; flex-direction: column; gap: .8rem; }
.ligne { display: flex; gap: .6rem; flex-wrap: wrap; }
input, textarea, select { font: inherit; padding: .55rem .6rem; border: 1px solid var(--ligne); border-radius: 8px; width: 100%; background: #fff; }
label { display: flex; flex-direction: column; gap: .25rem; }
fieldset { border: 1px solid var(--ligne); border-radius: 8px; }
label.case { flex-direction: row; align-items: flex-start; gap: .5rem; padding: .15rem 0; font-size: .95rem; }
label.case input { width: auto; margin-top: .3rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: .4rem; }
.pastille { border: 1px solid var(--ligne); background: var(--accent-clair); border-radius: 999px; padding: .3rem .7rem; font: inherit; font-size: .88rem; cursor: pointer; }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--ligne); }
.a-offrir li { flex-wrap: wrap; align-items: center; }
/* Classement : rang, pseudo (prénom en dessous), points alignés à droite ; rien ne se chevauche. */
.podium { list-style: none; padding: 0; margin: 0; counter-reset: rang; }
.podium li { counter-increment: rang; display: grid; grid-template-columns: 1.8rem 1fr auto; gap: .2rem .6rem;
  align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--ligne); }
.podium li::before { content: counter(rang) "."; text-align: right; color: var(--discret); }
.podium .nom { min-width: 0; overflow-wrap: anywhere; }
.podium .nom .discret { display: block; font-size: .85rem; }
.podium .points { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.podium .points .discret { font-size: .85rem; }
.podium .moi .nom > span:first-child, .podium .moi .points { font-weight: bold; }

/* Jeu */
.entete-jeu { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; color: var(--discret); padding: 10px 2px 4px; }
.oeuvre { margin: 0; background: #2a2420; border-radius: var(--rayon); overflow: hidden; }
.oeuvre img { display: block; width: 100%; height: 38vh; min-height: 220px; object-fit: contain; background: #2a2420; cursor: zoom-in; }
.oeuvre img.charge { opacity: 0; }
.oeuvre figcaption { color: #eee4d6; font-size: .92rem; padding: 8px 12px; }
.oeuvre figcaption:empty { display: none; }
.carte { height: 42vh; min-height: 260px; margin-top: 10px; border-radius: var(--rayon); border: 1px solid var(--ligne); background: var(--mer); }
#carte.leaflet-container { background: var(--mer); font: inherit; }

.frise { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 12px 4px; margin-top: 10px; }
.annee { display: flex; align-items: center; justify-content: center; gap: .35rem; }
.annee button { font: inherit; border: 1px solid var(--ligne); background: #fff; border-radius: 8px; padding: .3rem .55rem; min-width: 2.6rem; }
.annee output { min-width: 9.5rem; text-align: center; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
/* Frise : une piste neutre, sans remplissage, et seulement le point rouge du curseur. */
.piste { position: relative; margin: 10px 11px 0; }
#curseur { -webkit-appearance: none; appearance: none; display: block; width: 100%; padding: 0; border: 0;
  margin: 0; height: 34px; background: transparent; cursor: pointer; }
#curseur::-webkit-slider-runnable-track { height: 4px; background: var(--ligne); border-radius: 2px; }
#curseur::-moz-range-track { height: 4px; background: var(--ligne); border-radius: 2px; }
#curseur::-moz-range-progress { background: transparent; }
#curseur::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px;
  border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
#curseur::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--accent); }
#curseur:disabled { cursor: default; }
.date-vraie { position: absolute; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--vrai); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--vrai);
  pointer-events: none; }
.annee button:disabled { opacity: .45; }
.score-oeuvre { text-align: center; margin: 0 0 10px; }
.score-oeuvre strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
.graduations { position: relative; margin: 0 11px; height: 1.3rem; font-size: .72rem; color: var(--discret); }
.graduations span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.scores div { background: var(--fond); border-radius: 8px; padding: 8px; }
.scores strong { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.scores span { font-size: .88rem; color: var(--discret); }
.cartel { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .8rem; margin: 14px 0 6px; font-size: .95rem; }
.cartel dt { color: var(--discret); }
.cartel dd { margin: 0; }
.cartel .titre { grid-column: 1 / -1; font-size: 1.1rem; font-style: italic; }

.loupe { position: fixed; inset: 0; background: rgba(15, 12, 10, .95); z-index: 2000; display: flex; align-items: center; justify-content: center; overflow: auto; }
.loupe img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; touch-action: pinch-zoom; }
.loupe .vue-nav { z-index: 2; }
.loupe .vue-compte { bottom: calc(14px + env(safe-area-inset-bottom)); right: 50%; transform: translateX(50%); }
.loupe-fermer { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 42px; height: 42px;
  border: 0; border-radius: 50%; background: rgba(255, 253, 248, .85); font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* Relecture */

.demande { border-bottom: 1px solid var(--ligne); padding: .4rem 0 .8rem; }
.demande.refusee, .demande.acceptee { opacity: .6; }
blockquote { margin: .3rem 0 .6rem; padding-left: .8rem; border-left: 3px solid var(--ligne); white-space: pre-wrap; }

.epingle-joueur { background: var(--accent); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--accent); }
.epingle-vraie { background: var(--vrai); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--vrai); }
#carte .leaflet-control-attribution { font-size: 10px; line-height: 1.3; }
#carte .leaflet-control-layers { font-size: .9rem; }
#carte .leaflet-control-layers label { display: block; padding: 2px 4px; }
#carte .leaflet-control-layers input { width: auto; margin-right: 4px; }
.defilement { overflow-x: auto; }
table.stats { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
table.stats th, table.stats td { padding: .3rem .5rem; border-bottom: 1px solid var(--ligne); text-align: right; }
table.stats tbody th, table.stats thead th:first-child { text-align: left; font-weight: normal; }
table.stats thead th { color: var(--discret); font-weight: normal; }
.pastille.autres { background: transparent; border-style: dashed; color: var(--accent); }
/* Avant le premier geste, la frise n'a pas de curseur. */
#curseur.vide::-webkit-slider-thumb { opacity: 0; }
#curseur.vide::-moz-range-thumb { opacity: 0; }
.signaler { margin: 10px 0 4px; font-size: .92rem; }
.signaler summary { color: var(--discret); cursor: pointer; }
.signaler form { margin-top: 8px; }
.vue { position: relative; }
.vue-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0;
  border-radius: 50%; background: rgba(255, 253, 248, .85); color: var(--encre); font-size: 1.6rem; line-height: 1;
  cursor: pointer; }
.vue-nav.precedente { left: 8px; }
.vue-nav.suivante { right: 8px; }
.vue-compte { position: absolute; bottom: 8px; right: 10px; background: rgba(31, 26, 23, .7); color: #fff;
  font-size: .8rem; padding: 2px 8px; border-radius: 999px; }
.aide { background: var(--fond); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: .95rem; }
.aide p { margin: .4rem 0; }
/* Bilan de fin de série : numéro, titre (sur plusieurs lignes si besoin), points alignés à droite. */
.recap { list-style: none; padding: 0; margin: 10px 0 16px; counter-reset: recap; }
.recap li { counter-increment: recap; display: grid; grid-template-columns: 2rem 1fr auto; gap: .6rem;
  align-items: baseline; padding: .4rem 0; border-bottom: 1px solid var(--ligne); }
.recap li::before { content: counter(recap) "."; text-align: right; color: var(--discret); }
.recap li span:first-child { font-style: italic; }
.recap .lien-recap { font: inherit; font-style: italic; color: inherit; text-align: left; background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.recap .lien-recap:hover { text-decoration-style: solid; }
.recap .points { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.leaflet-container .maplibregl-canvas { outline: none; }
#carte .logo-maptiler img { display: block; opacity: .9; }
.jauge { height: 8px; background: var(--fond); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.jauge span { display: block; height: 100%; background: var(--accent); }
.apercu h2 { margin-top: 0; }
.apercu .carte { height: 300px; }
table.stats a { font-weight: bold; }
.liste-oeuvres { list-style: none; padding: 0; margin: 0; }
.liste-oeuvres li { display: grid; grid-template-columns: 64px 1fr; gap: .8rem; align-items: center;
  padding: .45rem 0; border-bottom: 1px solid var(--ligne); }
.liste-oeuvres img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #2a2420; display: block; }
/* En phase de résultat, la réponse du joueur reste bien rouge à côté du point vert. */
#curseur:disabled { opacity: 1; }
#curseur:disabled::-webkit-slider-thumb { background: var(--accent); filter: none; opacity: 1; }
#curseur:disabled::-moz-range-thumb { background: var(--accent); opacity: 1; }
.aide-page h2 { margin-top: 1.4rem; } .aide-page li { margin: .3rem 0; }

/* Récompense de fin de série et cabinet de curiosités */
.badge { display: inline-block; min-width: 1.2rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: .75rem; text-align: center; line-height: 1.2rem; }
.meme { position: relative; margin: 10px 0 4px; background: #2a2420; border-radius: var(--rayon); overflow: hidden; }
.meme img { display: block; width: 100%; max-height: 50vh; object-fit: contain; }
.meme figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px 12px; text-align: center;
  color: #fff; font: 800 1.35rem/1.15 Impact, "Arial Black", "Helvetica Neue", sans-serif; text-transform: uppercase;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000; overflow-wrap: anywhere; }
.recompense { background: var(--fond); border-radius: 8px; padding: 10px 14px; margin: 10px 0; text-align: center; }
.petit-titre { margin: .4rem 0 .2rem; color: var(--discret); font-size: .9rem; }
.curiosite { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: .2rem 0 .6rem; font-size: 1.1rem; }
.curiosite .emoji { font-size: 2.4rem; line-height: 1; }
.recompense form { justify-content: center; }
.recompense select { width: auto; max-width: 100%; flex: 1 1 12rem; }
.etageres { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 10px; }
.etageres li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem;
  background: var(--fond); border: 1px solid var(--ligne); border-radius: 8px; padding: 10px 8px; }
.etageres li.nouveau { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-clair); }
.etageres li.relique { border: 2px solid #b8913a; background: #fbf5e4; }
.offrir-relique { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.offrir-relique input[type=text] { flex: 1 1 16rem; }
.etageres .emoji { font-size: 2.2rem; line-height: 1.1; }
.vignette { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.curiosite .vignette { width: 7rem; flex: none; }
.etageres .nom { font-size: .92rem; }
.etageres .discret { font-size: .8rem; }
.meme-credit { margin: 0 0 12px; font-size: .75rem; text-align: center; }
.meme-credit a { color: var(--discret); }

/* Participation quotidienne (admin) : une case par joueur et par jour, une seule teinte du clair au foncé. */
.defile { overflow-x: auto; }
.participation { border-collapse: separate; border-spacing: 2px; font-size: .78rem; }
.participation th[scope="row"] { text-align: right; font-weight: normal; padding-right: 8px; white-space: nowrap; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; }
.participation thead th { height: 1.2rem; position: relative; font-weight: normal; color: var(--discret); }
.participation thead th span { position: absolute; left: 0; bottom: 2px; white-space: nowrap; }
.participation thead th.dernier span { left: auto; right: 0; }
.participation td { padding: 0; }
.participation tr.actifs th, .participation tr.actifs td { padding-bottom: 6px; }
.case { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; }
.case.n0 { background: #ebe4d8; }
.case.n1 { background: #ecc8bb; }
.case.n2 { background: #d28d77; }
.case.n3 { background: #ad5539; }
.case.n4 { background: #7a2614; }
.legende-participation .case { margin: 0 1px; }

/* Corrigé d'un jour (admin) : vignettes plus grandes pour juger l'image. */
.liste-oeuvres.corrige li { grid-template-columns: 160px 1fr; align-items: start; }
.liste-oeuvres.corrige img { width: 160px; height: 160px; object-fit: contain; }
.corrige-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 480px) { .liste-oeuvres.corrige li { grid-template-columns: 96px 1fr; } .liste-oeuvres.corrige img { width: 96px; height: 96px; } }

/* Recherche d'une ville au-dessus de la carte du jeu. */
.cherche-ville { position: relative; margin-top: 10px; }
.cherche-ville input { width: 100%; box-sizing: border-box; padding: .5rem .7rem; font: inherit; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--papier); }
.villes { position: absolute; z-index: 1000; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.villes li { padding: 0; }
.villes li.discret { padding: .4rem .7rem; }
.villes button { display: block; width: 100%; text-align: left; padding: .4rem .7rem; font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
.villes button:hover, .villes button:focus { background: var(--fond); }

/* Bascule de la carte entre l'Europe et les Amériques. */
.bascule-continent { font: inherit; font-size: .85rem; padding: 4px 8px; background: var(--papier); color: inherit;
  border: 2px solid rgba(0,0,0,.2); border-radius: 4px; cursor: pointer; background-clip: padding-box; }
.bascule-continent:hover { background: var(--fond); }
.bandeau-semaine { margin: 0; padding: .55rem 14px; background: #e9dcc0; color: var(--encre); border-bottom: 1px solid var(--ligne); font-size: .95rem; text-align: center; }
