/* ===== Cartes Animé : thème sombre, cartes stylisées par rareté ===== */
:root {
  --fond: #0d0f1a;
  --fond-2: #151829;
  --fond-3: #1e2238;
  --bord: #2c3150;
  --texte: #eef0fb;
  --texte-2: #a3a8c3;
  --accent: #ff4f81;
  --accent-2: #7c5cff;
  --or: #f59e0b;
  --vert: #22c55e;
  --orange: #f97316;
  --rouge: #ef4444;
  --rayon: 14px;
  --ombre: 0 8px 24px rgba(0, 0, 0, .35);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(255, 79, 129, .12), transparent 60%),
    var(--fond);
}
a { color: inherit; }
h1 { font-size: 1.8rem; margin: .4em 0 .5em; display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .6em; }
.petit { font-size: .85rem; color: var(--texte-2); margin: .3em 0; }
.vide { color: var(--texte-2); text-align: center; padding: 2em; }
.grand-chiffre { font-size: 1.6rem; font-weight: 800; margin: .2em 0; }

/* ----- En-tête ----- */
#entete {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.2rem;
  background: rgba(13, 15, 26, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bord);
}
.logo { font-weight: 800; font-size: 1.15rem; text-decoration: none; display: flex; align-items: center; gap: .4em; white-space: nowrap; }
.logo-icone { color: var(--accent); font-size: 1.4rem; }
.nav { display: flex; gap: .2rem; flex: 1; justify-content: center; }
.nav-lien {
  position: relative; text-decoration: none; padding: .5em .8em; border-radius: 10px;
  color: var(--texte-2); display: flex; align-items: center; gap: .4em; font-weight: 600;
}
.nav-lien:hover { background: var(--fond-3); color: var(--texte); }
.nav-lien.actif { background: var(--fond-3); color: var(--texte); box-shadow: inset 0 -2px 0 var(--accent); }
.pastille {
  background: var(--accent); color: white; font-size: .7rem; font-weight: 800;
  border-radius: 99px; padding: .1em .45em; min-width: 1.4em; text-align: center;
}
.monnaies { display: flex; align-items: center; gap: .5rem; }
.monnaie { text-decoration: none; background: var(--fond-3); padding: .35em .7em; border-radius: 99px; font-size: .9rem; white-space: nowrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: inline-flex;
  align-items: center; justify-content: center; background: var(--accent-2); font-weight: 800;
  border: 2px solid var(--bord); flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.grand { width: 96px; height: 96px; font-size: 2.4rem; }
.entete-avatar { text-decoration: none; display: flex; }

#page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1rem 1.2rem 3rem; outline: none; }
.pied { text-align: center; font-size: .8rem; color: var(--texte-2); padding: 1rem; }

/* ----- Boutons et formulaires ----- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .6em 1.1em; border-radius: 10px; border: 1px solid var(--bord);
  background: var(--fond-3); color: var(--texte); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: transform .08s, filter .15s;
}
.bouton:hover:not(:disabled) { filter: brightness(1.2); }
.bouton:active:not(:disabled) { transform: scale(.97); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.bouton.principal { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: white; }
.bouton.gros { font-size: 1.1rem; padding: .8em 1.6em; }
.bouton.danger { border-color: var(--rouge); color: #fca5a5; }
.bouton.discord { background: #5865f2; border: none; }
.bouton.google { background: white; color: #222; border: none; }
.rangee-boutons { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; justify-content: center; }
.rangee-boutons.gauche { justify-content: flex-start; }
select, .recherche {
  font: inherit; color: var(--texte); background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: 10px; padding: .6em .9em;
}
.recherche { width: 100%; max-width: 420px; }
label { display: flex; flex-direction: column; gap: .3em; font-weight: 600; }
label.option { flex-direction: row; align-items: center; justify-content: center; gap: .5em; margin: .6rem 0; }

.etiquette { font-size: .75rem; font-weight: 700; padding: .2em .6em; border-radius: 99px; background: var(--fond-3); margin-left: .5em; vertical-align: middle; }
.etiquette.or { background: var(--or); color: #1a1200; }

.barre { height: 8px; background: var(--fond-3); border-radius: 99px; overflow: hidden; margin: .4em 0; }
.barre-remplie { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 99px; transition: width .4s; }

/* ----- Accueil ----- */
.bienvenue h1 { font-size: 2rem; margin-bottom: .1em; }
.bienvenue p { color: var(--texte-2); margin-top: 0; }
.grille-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.tuile, .carte-section {
  background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start;
}
.carte-section { margin: 1rem 0; }
.tuile .bouton { margin-top: auto; }
.tuile-pack { background: linear-gradient(160deg, rgba(255, 79, 129, .18), var(--fond-2) 60%); border-color: rgba(255, 79, 129, .4); }
.tuile-jeu { background: linear-gradient(160deg, rgba(245, 158, 11, .15), var(--fond-2) 60%); }
.historique { list-style: none; padding: 0; margin: 0; display: grid; gap: .4em; }
.historique time { color: var(--texte-2); font-size: .8rem; margin-right: .4em; }
.aide-bulle { cursor: help; }

/* ----- Cartes ----- */
.carte {
  --l: 180px;
  position: relative; width: var(--l); aspect-ratio: 63 / 88; flex-shrink: 0;
  border-radius: calc(var(--l) * .07); perspective: 800px; cursor: default;
  color: white; user-select: none;
}
.carte[tabindex] { cursor: pointer; }
.carte.petite { --l: 132px; }
.carte.grande { --l: 210px; }
.carte-face, .carte-dos {
  position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden;
  transition: transform .45s cubic-bezier(.3, .7, .4, 1);
}
.carte-face {
  display: flex; flex-direction: column; padding: calc(var(--l) * .055);
  border: calc(var(--l) * .03) solid var(--rarete);
  background:
    radial-gradient(circle at 50% 38%, hsl(var(--teinte) 70% 45% / .9), transparent 62%),
    linear-gradient(160deg, hsl(var(--teinte) 55% 22%), hsl(calc(var(--teinte) + 40) 45% 10%));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.carte-haut { display: flex; justify-content: space-between; gap: .3em; font-size: calc(var(--l) * .058); opacity: .9; }
.carte-anime { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.carte-illu {
  flex: 1; display: flex; align-items: center; justify-content: center; margin: calc(var(--l) * .04) 0;
  border-radius: calc(var(--l) * .04); background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .12);
}
.carte-mono { font-size: calc(var(--l) * .26); font-weight: 900; letter-spacing: -.03em; text-shadow: 0 3px 10px rgba(0, 0, 0, .5); opacity: .92; }
.carte-nom { font-weight: 800; font-size: calc(var(--l) * .085); line-height: 1.1; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.carte-forme { font-size: calc(var(--l) * .06); text-align: center; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.carte-rarete {
  margin-top: calc(var(--l) * .03); text-align: center; font-size: calc(var(--l) * .062); font-weight: 700;
  background: var(--rarete); color: #0b0b12; border-radius: 99px; padding: .15em .4em;
}
.carte-rarete .etoiles { letter-spacing: -.05em; }
.carte-dos {
  transform: rotateY(180deg);
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #24204a 0 10px, #1b1838 10px 20px);
  border: calc(var(--l) * .03) solid #3b3577; font-size: calc(var(--l) * .3); color: var(--accent);
}
.carte.cachee .carte-face { transform: rotateY(180deg); }
.carte.cachee .carte-dos { transform: rotateY(0); }
.carte.cachee:hover .carte-dos { filter: brightness(1.2); }

/* Effets par rareté */
.carte.r-rare .carte-face { box-shadow: 0 0 14px rgba(59, 130, 246, .45), 0 6px 18px rgba(0, 0, 0, .45); }
.carte.r-epique .carte-face { box-shadow: 0 0 20px rgba(168, 85, 247, .6), 0 6px 18px rgba(0, 0, 0, .45); animation: pulse-violet 2.4s infinite; }
.carte.r-legendaire .carte-face { box-shadow: 0 0 26px rgba(245, 158, 11, .7), 0 6px 18px rgba(0, 0, 0, .45); }
.carte.r-legendaire .carte-illu { background: conic-gradient(from 0deg, rgba(245, 158, 11, .25), transparent 15%, rgba(245, 158, 11, .25) 30%, transparent 45%, rgba(245, 158, 11, .25) 60%, transparent 75%, rgba(245, 158, 11, .25) 90%, transparent); }
.carte.r-mythique .carte-face {
  border-image: linear-gradient(135deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7) 1;
  border-radius: 0; box-shadow: 0 0 30px rgba(255, 255, 255, .35);
}
.carte.r-mythique .carte-rarete { background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7); }
.carte.r-mythique .carte-face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .25) 45%, transparent 60%);
  background-size: 250% 100%; animation: reflet 3.5s infinite linear;
}
@keyframes pulse-violet { 50% { box-shadow: 0 0 30px rgba(168, 85, 247, .9), 0 6px 18px rgba(0, 0, 0, .45); } }
@keyframes reflet { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.carte.inconnue .carte-face { filter: grayscale(1) brightness(.45); }
.carte.inconnue:hover .carte-face { filter: grayscale(.6) brightness(.7); }
.carte.cible .carte-face { outline: 4px solid var(--vert); outline-offset: 3px; }
.carte.erreur .carte-face { outline: 4px solid var(--rouge); outline-offset: 3px; }
.badge-nouveau, .badge-nombre, .badge-doublon {
  position: absolute; z-index: 2; font-size: .7rem; font-weight: 800; padding: .2em .55em; border-radius: 99px;
}
.badge-nouveau { top: -8px; right: -8px; background: var(--accent); color: white; box-shadow: var(--ombre); }
.badge-nombre { bottom: -8px; right: -6px; background: var(--fond-3); border: 1px solid var(--bord); }
.badge-doublon { bottom: -10px; left: 50%; transform: translateX(-50%); background: #0ea5e9; color: white; white-space: nowrap; }
.carte.cachee .badge-nouveau, .carte.cachee .badge-doublon { display: none; }

/* ----- Packs ----- */
.barre-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.compteur-packs { margin-right: auto; }
.zone-ouverture { margin: 1.5rem 0; text-align: center; }
.placeholder-anim { color: var(--texte-2); font-style: italic; }
.rangee-cartes { display: flex; flex-wrap: wrap; gap: 1.1rem; justify-content: center; margin: 1rem 0 1.4rem; }
.pack-ouvert .carte.retournee { animation: pop .35s ease-out; }
@keyframes pop { 50% { transform: scale(1.06); } }
details.taux { margin-top: 1rem; background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; }
details.taux summary { cursor: pointer; font-weight: 700; }
table { border-collapse: collapse; margin-top: .8rem; width: 100%; max-width: 560px; }
th, td { text-align: left; padding: .4em .6em; border-bottom: 1px solid var(--bord); }
.puce { display: inline-block; width: .8em; height: .8em; border-radius: 50%; margin-right: .5em; }

/* ----- Album ----- */
.grille-animes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; margin-top: 1rem; }
.tuile-anime {
  text-decoration: none; padding: .9rem 1rem; border-radius: var(--rayon); position: relative;
  background: linear-gradient(150deg, hsl(var(--teinte) 50% 24%), var(--fond-2) 75%);
  border: 1px solid hsl(var(--teinte) 40% 35%); display: flex; flex-direction: column; gap: .2em;
  transition: transform .12s;
}
.tuile-anime:hover { transform: translateY(-3px); }
.complet { position: absolute; top: .6rem; right: .7rem; font-size: .75rem; color: var(--vert); font-weight: 800; }
.filtres { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .5rem 0; }
.filtres .recherche { max-width: 260px; }
.puces { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 1rem; }
.puce-filtre {
  font: inherit; font-size: .85rem; padding: .35em .8em; border-radius: 99px; cursor: pointer;
  background: var(--fond-2); color: var(--texte); border: 1px solid var(--rarete, var(--bord));
}
.puce-filtre.actif { background: var(--rarete, var(--accent-2)); color: #0b0b12; font-weight: 700; }
.progression-anime { margin: .5rem 0 1rem; max-width: 420px; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; justify-items: center; }
.detail-carte { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; justify-content: center; }
.detail-infos { display: flex; flex-direction: column; gap: .5rem; max-width: 280px; }
.detail-infos p { margin: 0; }

/* ----- Mini-jeux ----- */
.grille-jeux { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .9rem; margin-top: 1rem; }
.carte-jeu {
  display: flex; gap: .9rem; align-items: flex-start; text-decoration: none; padding: 1rem;
  background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); transition: transform .12s, border-color .12s;
}
a.carte-jeu:hover { transform: translateY(-3px); border-color: var(--accent); }
.carte-jeu.verrouille { opacity: .55; }
.jeu-icone { font-size: 2rem; line-height: 1; }
.carte-jeu p { margin: .25em 0 0; }
.jeu-meta { font-size: .78rem; color: var(--texte-2); }
.jeu-meta.bientot { color: var(--or); }
.retour { color: var(--texte-2); text-decoration: none; }
.regles { color: var(--texte-2); max-width: 760px; }
.zone-jeu { background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.2rem; min-height: 240px; text-align: center; }
.options-jeu { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1rem 0; }
.options-jeu > .bouton { min-width: 260px; }
.jeu-entete { display: flex; justify-content: space-between; font-weight: 700; color: var(--texte-2); margin-bottom: .6rem; }
.chrono { height: 6px; background: var(--fond-3); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.chrono-barre { height: 100%; width: 100%; background: var(--vert); }
.chrono-barre.urgent { background: var(--rouge); }
.question { font-size: 1.25rem; font-weight: 700; margin: .6rem 0 1rem; }
.choix-grille { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; max-width: 720px; margin: 0 auto; }
.choix {
  font: inherit; font-weight: 600; padding: 1em; border-radius: 12px; cursor: pointer;
  background: var(--fond-3); color: var(--texte); border: 2px solid var(--bord); transition: border-color .1s;
}
.choix:hover:not(:disabled) { border-color: var(--accent-2); }
.choix.bon { background: rgba(34, 197, 94, .25); border-color: var(--vert); }
.choix.faux { background: rgba(239, 68, 68, .25); border-color: var(--rouge); }
.explication { color: var(--texte-2); min-height: 1.4em; }
.duel-cartes { display: flex; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap; margin: 1rem 0; }
.vs { font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.grille-memoire { display: grid; grid-template-columns: repeat(4, auto); gap: .7rem; justify-content: center; }
.grille-memoire.grande { grid-template-columns: repeat(5, auto); }
.grille-memoire .carte { --l: 110px; }
.tuiles { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.tuiles .tuile {
  display: inline-flex; width: 2.4rem; height: 2.8rem; align-items: center; justify-content: center; padding: 0;
  font-size: 1.4rem; font-weight: 900; background: var(--fond-3); border: 2px solid var(--accent-2); border-radius: 8px;
}
.aide { color: var(--texte-2); min-height: 1.4em; }
.rangee-packs { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.pack-mystere {
  width: 150px; height: 200px; border-radius: 16px; cursor: pointer; font: inherit; color: var(--texte);
  background: linear-gradient(160deg, var(--accent-2), var(--accent)); border: 3px solid rgba(255, 255, 255, .2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; transition: transform .15s;
}
.pack-mystere:hover:not(:disabled) { transform: translateY(-6px) rotate(-2deg); }
.pack-mystere:disabled { cursor: default; }
.pack-mystere.ouvert { background: var(--fond-3); }
.pack-mystere.choisi { border-color: var(--or); box-shadow: 0 0 24px rgba(245, 158, 11, .5); }
.pack-icone { font-size: 3rem; }
.pack-contenu { font-weight: 800; font-size: 1.1rem; }

/* Animedle */
.legende { font-size: .8rem; color: var(--texte-2); }
.champ-recherche { position: relative; max-width: 420px; margin: .8rem auto; }
.champ-recherche .recherche { max-width: none; }
.suggestions { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; list-style: none; margin: .3rem 0 0; padding: 0; background: var(--fond-3); border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; box-shadow: var(--ombre); }
.suggestions:empty { display: none; }
.suggestions li { padding: .55em .9em; cursor: pointer; display: flex; justify-content: space-between; gap: 1em; text-align: left; }
.suggestions li span { color: var(--texte-2); font-size: .85rem; }
.suggestions li:hover, .suggestions li:focus, .suggestions li.actif { background: var(--accent-2); outline: none; }
.dle-indices { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin: .5rem 0 1rem; }
.indice { font-size: .85rem; padding: .35em .8em; border-radius: 99px; background: var(--fond-3); color: var(--texte-2); }
.indice.ouvert { background: rgba(245, 158, 11, .2); color: var(--or); font-weight: 700; }
.dle-defile { overflow-x: auto; }
.dle-tableau { display: grid; gap: .35rem; min-width: 640px; }
.dle-ligne { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); gap: .35rem; }
.dle-ligne.entete div { font-size: .78rem; color: var(--texte-2); font-weight: 700; }
.dle-perso, .dle-case { border-radius: 8px; padding: .55em .4em; font-size: .85rem; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.2em; }
.dle-perso { background: var(--fond-3); }
.dle-perso small { font-weight: 400; color: var(--texte-2); }
.dle-case.vert { background: #15803d; }
.dle-case.orange { background: #c2410c; }
.dle-case.rouge { background: #991b1b; }
.dle-ligne.apparait .dle-case { animation: retourne .5s backwards; }
.dle-ligne.apparait .dle-case:nth-child(3) { animation-delay: .1s; }
.dle-ligne.apparait .dle-case:nth-child(4) { animation-delay: .2s; }
.dle-ligne.apparait .dle-case:nth-child(5) { animation-delay: .3s; }
.dle-ligne.apparait .dle-case:nth-child(6) { animation-delay: .4s; }
@keyframes retourne { from { transform: rotateX(90deg); } }
.dle-fin { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 1rem 0; }

/* Résultat de partie */
.resultat { margin-top: 1.2rem; padding: 1.2rem; border-top: 1px solid var(--bord); }
.resultat h2 { font-size: 1.6rem; margin: .2em 0; }
.medaille { font-size: 3.5rem; }
.record { color: var(--or); font-weight: 800; }
.gain { font-size: 1.2rem; font-weight: 800; color: var(--vert); }

/* ----- Objectifs ----- */
.liste-objectifs { display: grid; gap: .7rem; }
.objectif { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem 1.1rem; }
.objectif > div:first-child { flex: 1; }
.objectif.pret { border-color: var(--or); }
.objectif.fait { opacity: .6; }
.objectif-gain { display: flex; align-items: center; gap: .8rem; font-weight: 800; }

/* ----- Profil ----- */
.profil-entete { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.avatar-bouton { background: none; border: none; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .3rem; font: inherit; }
.avatar-bouton:hover .avatar { border-color: var(--accent); }
.grille-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
.stat { background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat strong { font-size: 1.3rem; }
.choix-avatar { display: flex; flex-direction: column; gap: .8rem; }
.choix-avatar .recherche { max-width: none; }
.avatars-liste { max-height: 60vh; overflow-y: auto; padding-right: .4rem; }
.avatars-liste h3 { font-size: .9rem; color: var(--texte-2); margin: 1rem 0 .4rem; }
.avatars-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .5rem; }
.avatar-choix { padding: 0; border: 2px solid transparent; border-radius: 50%; overflow: hidden; cursor: pointer; background: var(--fond-3); aspect-ratio: 1; }
.avatar-choix img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-choix:hover, .avatar-choix.actif { border-color: var(--accent); }

/* ----- Modale et notifications ----- */
.modale-fond { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 12, .75); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modale { position: relative; background: var(--fond-2); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.4rem; width: min(720px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--ombre); }
.modale-fermer { position: absolute; top: .6rem; right: .7rem; background: none; border: none; color: var(--texte-2); font-size: 1.2rem; cursor: pointer; }
#toasts { position: fixed; z-index: 60; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: var(--fond-3); border: 1px solid var(--bord); padding: .7em 1.2em; border-radius: 99px; box-shadow: var(--ombre); font-weight: 600; animation: monte .25s; transition: opacity .4s; }
.toast.succes { border-color: var(--vert); }
.toast.rare { border-color: var(--accent-2); background: #2a1f4d; }
.toast.erreur { border-color: var(--rouge); }
.toast.sortie { opacity: 0; }
@keyframes monte { from { transform: translateY(12px); opacity: 0; } }

/* ----- Mobile : navigation en bas de l'écran ----- */
@media (max-width: 860px) {
  /* backdrop-filter ferait de l'en-tête le repère de la barre fixe du bas : on le retire. */
  #entete { padding: .5rem .8rem; backdrop-filter: none; background: var(--fond); }
  .logo { font-size: 1rem; }
  .nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; justify-content: space-around; gap: 0;
    background: rgba(13, 15, 26, .96); border-top: 1px solid var(--bord); padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
  }
  .nav-lien { flex-direction: column; gap: .1em; padding: .35em .3em; font-size: .68rem; }
  .nav-icone { font-size: 1.25rem; }
  .nav-lien .pastille { position: absolute; top: 0; right: 2px; }
  .nav-lien.actif { box-shadow: none; color: var(--accent); background: none; }
  .monnaies { margin-left: auto; gap: .3rem; }
  .monnaie { padding: .3em .5em; font-size: .8rem; }
  #page { padding: .8rem .8rem 6rem; }
  .pied { padding-bottom: 5.5rem; }
  .carte { --l: 150px; }
  .carte.grande { --l: 160px; }
  .carte.petite, .grille-memoire .carte { --l: 96px; }
  .grille-memoire { grid-template-columns: repeat(3, auto); }
  .grille-memoire.grande { grid-template-columns: repeat(4, auto); }
  .grille-cartes { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .choix-grille { grid-template-columns: 1fr; }
  .rangee-cartes .carte { --l: 130px; }
}
@media (max-width: 420px) {
  .logo-texte { display: none; }
  .carte.grande, .rangee-cartes .carte { --l: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
