:root {
  --bg: #f5efe3;
  --surface: #fffcf6;
  --surface-2: #efe7d7;
  --ink: #2a2420;
  --muted: #776b5e;
  --line: #e2d7c3;
  --accent: #6a4bd0;
  --accent-2: #8e6cf0;
  --accent-ink: #ffffff;
  --gold: #d29b12;
  --gold-soft: #fff1c7;
  --danger: #c4412d;
  --ok: #2c9a58;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 6px 20px rgba(60, 40, 10, .08);
  --shadow-lg: 0 10px 40px rgba(40, 20, 0, .18);
  --radius: 16px;
  --font-title: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15131a;
    --surface: #1f1c26;
    --surface-2: #2a2633;
    --ink: #f0eaf6;
    --muted: #a69db3;
    --line: #383243;
    --accent: #8f72f2;
    --accent-2: #a78bfa;
    --gold: #f0bd3a;
    --gold-soft: #3a2f12;
    --danger: #ec6b55;
    --ok: #4cc27c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15131a;
  --surface: #1f1c26;
  --surface-2: #2a2633;
  --ink: #f0eaf6;
  --muted: #a69db3;
  --line: #383243;
  --accent: #8f72f2;
  --accent-2: #a78bfa;
  --gold: #f0bd3a;
  --gold-soft: #3a2f12;
  --danger: #ec6b55;
  --ok: #4cc27c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-title); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 600; font-size: 1.25rem; white-space: nowrap; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #d6467e); color: #fff; font-size: 18px;
}
.local-pill {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line); cursor: pointer; white-space: nowrap;
}
.spacer { flex: 1; }
.booster-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font-weight: 700; white-space: nowrap;
}
.booster-pill small { font-weight: 600; color: var(--muted); }
.player { font-weight: 700; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

.tabs { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; }
.tab {
  border: 0; background: none; padding: 10px 14px; border-radius: 10px 10px 0 0;
  font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px;
  border-bottom: 3px solid transparent;
}
.tab .ico { font-size: 1.1rem; }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:hover { color: var(--ink); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 800;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  transition: transform .1s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.big { padding: 14px 26px; font-size: 1.1rem; border-radius: 14px; }
.btn.small { padding: 6px 10px; font-size: .85rem; border-radius: 10px; }
.btn.ghost { background: transparent; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}

/* ---------- Cartes ---------- */
.card {
  --cat: #888;
  container-type: inline-size;
  position: relative;
  width: var(--w, 130px);
  aspect-ratio: 5 / 7;
  border-radius: 12px;
  user-select: none;
}
.card-in {
  position: absolute; inset: 0;
  border-radius: 7cqw;
  padding: 0;
  display: block;
  /* Fond neutre pour toutes les cartes : la seule couleur forte est le cadre (--frame) = la rareté. */
  --frame: linear-gradient(#8f96a0, #8f96a0);
  --rar: #8f96a0;
  border: max(3px, 2.4cqw) solid transparent;
  background:
    linear-gradient(170deg, var(--surface-2) 0%, var(--surface) 70%) padding-box,
    var(--frame) border-box;
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

/* ---------- Rareté : cadre + mention en bas à gauche ---------- */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.card.rar-peu_commune .card-in { --rar: #5b9bd5; --frame: linear-gradient(135deg, #d6e9fb, #6fa8dc 30%, #b9d7f3 50%, #4a86c5 75%, #cfe3f7); }
.card.rar-rare .card-in { --rar: #c9971c; --frame: linear-gradient(135deg, #fff1b8, #c9971c 30%, #fbe08a 50%, #a8760c 75%, #f6d77a); }
.card.rar-epique .card-in {
  --rar: #a78bfa; --frame: linear-gradient(135deg, #e9d5ff, #8b5cf6 30%, #c084fc 50%, #6d28d9 75%, #e9d5ff);
  animation: epicGlow 2.6s ease-in-out infinite;
}
@keyframes epicGlow { 0%, 100% { box-shadow: 0 0 8px 1px rgba(139, 92, 246, .55), var(--shadow); } 50% { box-shadow: 0 0 18px 5px rgba(192, 132, 252, .75), var(--shadow); } }
/* Seule la Légendaire est animée : le mouvement est réservé au plus rare. */
.card.rar-legendaire .card-in {
  --rar: #e0559a;
  --frame: conic-gradient(from var(--spin), #ff5f6d, #ffc371, #f7ff00, #4ade80, #22d3ee, #818cf8, #f472b6, #ff5f6d);
  animation: spin 4s linear infinite;
  box-shadow: 0 0 14px rgba(255, 195, 113, .45), var(--shadow);
}
@keyframes spin { to { --spin: 360deg; } }
.rar-label { color: var(--rar); }
.card.rar-legendaire .rar-label {
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #4ade80, #818cf8); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rar-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.rar-pill.rar-peu_commune { color: #4a86c5; border-color: #8dbbe6; background: color-mix(in srgb, #8dbbe6 18%, var(--surface)); }
.rar-pill.rar-rare { color: #b8860b; border-color: #e5b93a; background: color-mix(in srgb, #f6d77a 22%, var(--surface)); }
.rar-pill.rar-epique { color: #7c4ddb; border-color: #a78bfa; background: color-mix(in srgb, #a78bfa 18%, var(--surface)); }
.rar-pill.rar-legendaire { color: #fff; border-color: transparent; background: linear-gradient(90deg, #ff5f6d, #ffc371, #4ade80, #818cf8); }
.rar-pill.shiny-pill { color: #fff; border-color: transparent; background: linear-gradient(90deg, #f472b6, #818cf8, #22d3ee); }
.rar-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .9rem; }
.rar-table th, .rar-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rar-table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Légendaire : reflet holographique sur l'image ---------- */
.card-art { position: relative; }
.card.rar-legendaire .card-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .55; z-index: 2;
  background: linear-gradient(115deg, transparent 20%, #ff9ad5 35%, #9ae6ff 45%, #b9ff9a 55%, #fff59a 65%, transparent 80%);
  background-size: 300% 100%; animation: holo 3.5s linear infinite;
}
@keyframes holo { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* ---------- Anatomie : image plein cadre, nom en surimpression ---------- */
.card-art {
  position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 22cqw;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rar) 22%, transparent), transparent 70%),
    linear-gradient(170deg, var(--surface-2), var(--surface));
  overflow: hidden;
}
.card-art .art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.emoji { font-size: 42cqw; line-height: 1; filter: drop-shadow(0 2cqw 3cqw rgba(0,0,0,.25)); }
.card.duo .emoji { font-size: 28cqw; letter-spacing: -2cqw; }
/* Bas de carte : dégradé sombre pour que le nom reste lisible sur n'importe quelle image. */
.card-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 14cqw 5cqw 4cqw; text-align: center;
  background: linear-gradient(to top, rgba(10, 8, 18, .92) 0%, rgba(10, 8, 18, .7) 55%, transparent 100%);
  color: #fff;
}
.card-name { font-family: var(--font-title); font-weight: 600; font-size: 11.5cqw; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.card-sub { display: flex; justify-content: space-between; gap: 2cqw; margin-top: 1.5cqw; font-size: 7cqw; font-weight: 800; white-space: nowrap; color: rgba(255,255,255,.7); }
.card-sub .rar-label { filter: brightness(1.25); }
/* Pastilles du haut : famille à gauche, 🏆 à droite. */
.fam-badge, .founder-mark {
  position: absolute; top: 3.5cqw; z-index: 3; width: 15cqw; height: 15cqw; border-radius: 50%;
  display: grid; place-items: center; font-size: 8.5cqw; line-height: 1;
  background: rgba(10, 8, 18, .55); backdrop-filter: blur(2px); box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}
.fam-badge { left: 3.5cqw; }
.founder-mark { right: 3.5cqw; background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 65%); box-shadow: 0 0 2cqw rgba(210,155,18,.8); }
.card.unknown .card-art { padding-bottom: 22cqw; }
.card.unknown .emoji { font-family: var(--font-title); color: var(--muted); filter: none; font-size: 30cqw; }
.card .badge-new {
  position: absolute; top: -3cqw; right: -3cqw; background: var(--danger); color: #fff;
  font-size: 7cqw; font-weight: 900; padding: 1.5cqw 4cqw; border-radius: 999px; box-shadow: var(--shadow); z-index: 10;
}
.card .qty {
  position: absolute; top: -4cqw; right: -4cqw; min-width: 16cqw; height: 16cqw;
  border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 900; font-size: 8.5cqw;
  display: grid; place-items: center; padding: 0 3cqw; box-shadow: var(--shadow); z-index: 10;
}
.card .qty.zero { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
/* Étalonnage commun à toutes les images (couleurs un peu plus riches, contraste doux, légère chaleur)
   et vignettage : des photos d'origines très différentes prennent un air de famille. */
.card-art .art-img { filter: saturate(1.12) contrast(1.06) brightness(.96) sepia(.08); }
.card.has-img .card-art::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(10, 8, 18, .45) 100%);
}
.card.has-img .card-art { background: var(--surface-2); }
/* Coffre (atelier uniquement) : voile sur toute la carte, cadenas et temps restant. */
.vault-veil {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw;
  background: rgba(14, 10, 24, .62); backdrop-filter: blur(1.5px) grayscale(.6); color: #fff; text-align: center;
}
.vault-veil span { font-size: 22cqw; line-height: 1; }
.vault-veil b { font-size: 10cqw; }
.vault-veil small { font-size: 7cqw; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.founder-tag { color: var(--gold); }
.card.unknown .card-in {
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 8px, var(--surface) 8px 16px) padding-box, var(--frame) border-box;
  box-shadow: none; opacity: .6; animation: none;
}
/* Trophée de fondateur : plaque « FONDATEUR » sous la carte. */
.card .trophy-ribbon {
  position: absolute; left: 50%; bottom: -5cqw; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(90deg, #b8860b, #f6d77a, #b8860b); color: #3b2a00; font-weight: 900; font-size: 7cqw;
  letter-spacing: .06em; padding: 1.5cqw 5cqw; border-radius: 2cqw; box-shadow: var(--shadow); z-index: 10;
}
.card.trophy { border-radius: 10px; box-shadow: 0 0 22px 4px color-mix(in srgb, var(--gold) 45%, transparent); }
.subtab .count.hot { background: var(--danger); color: #fff; }
.card.unknown .emoji { font-family: var(--font-title); color: var(--muted); filter: none; }
.card.unknown .card-art { background: transparent; }
.card.dim { opacity: .45; }
.card.clickable { cursor: pointer; transition: transform .15s; }
.card.clickable:hover { transform: translateY(-3px) rotate(-.5deg); }

.card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}
.card-grid .card { width: 100%; }
.grid-group { grid-column: 1 / -1; margin: 10px 0 0; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.grid-group:first-child { margin-top: 0; }

/* ---------- Boosters ---------- */
.booster-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 12px 0 24px; }
/* Paquet en 3D : il flotte, suit le pointeur, tremble puis se déchire. */
.pack-scene { position: relative; perspective: 1000px; padding: 10px 0; }
.pack-float { animation: packFloat 4s ease-in-out infinite; }
@keyframes packFloat { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
.pack {
  --rx: 0deg; --ry: 0deg; --mx: 30%; --my: 20%;
  position: relative; display: block; width: 210px; aspect-ratio: 5 / 7.4; border: 0; padding: 0;
  border-radius: 18px; color: #fff; font-family: var(--font-title);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #7a52e0, #d6467e 70%, #f29a3b);
  box-shadow:
    0 30px 50px -18px rgba(60, 20, 90, .6),
    inset 0 0 0 2px rgba(255,255,255,.18),
    inset 0 0 26px rgba(30, 0, 50, .45);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .18s ease-out;
}
.pack::before { /* épaisseur du paquet */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(160deg, #4b2fa0, #8f2a55); transform: translateZ(-14px);
}
.pack:disabled { filter: grayscale(.8); opacity: .6; }
.pack-top {
  position: absolute; left: 0; right: 0; top: 0; height: 15%; border-radius: 18px 18px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 3px, transparent 3px 9px),
    linear-gradient(160deg, #6a45cf, #b93d79);
  border-bottom: 2px dashed rgba(255,255,255,.55);
  transform: translateZ(1px);
}
.pack-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; height: 8%; border-radius: 0 0 18px 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 3px, transparent 3px 9px),
    linear-gradient(160deg, #c64a5a, #d9773a);
  border-top: 2px dashed rgba(255,255,255,.45);
  transform: translateZ(1px);
}
/* Effet bombé : un paquet rempli de cartes se gonfle au centre et s'assombrit sur les bords. */
.pack-bulge {
  position: absolute; inset: 15% 0 8%; pointer-events: none; transform: translateZ(2.5px);
  background:
    radial-gradient(ellipse 58% 42% at 50% 46%, rgba(255,255,255,.30), transparent 70%),
    linear-gradient(100deg, transparent 22%, rgba(255,255,255,.22) 30%, transparent 38%),
    linear-gradient(90deg, rgba(20,0,40,.42), transparent 16%, transparent 84%, rgba(20,0,40,.42)),
    linear-gradient(180deg, rgba(20,0,40,.28), transparent 14%, transparent 82%, rgba(20,0,40,.35));
}
.pack-shadow {
  position: absolute; left: 50%; bottom: -14px; width: 170px; height: 26px; margin-left: -85px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(20, 0, 40, .45), transparent 70%); filter: blur(4px);
  animation: packShadow 4s ease-in-out infinite;
}
@keyframes packShadow { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.82); opacity: .6; } }
.pack-scene.torn .pack-shadow { animation: none; opacity: 0; transition: opacity .3s; }
.pack-face {
  position: absolute; inset: 15% 0 8%; padding: 14px 16px 18px; transform: translateZ(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
}
.pack-title { font-size: 1.3rem; font-weight: 600; letter-spacing: .02em; text-align: center; line-height: 1.1; text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.pack-emoji { font-size: 66px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.3)); transform: translateZ(30px); }
.pack-sub { font-size: .95rem; opacity: .92; }
.pack-shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transform: translateZ(3px);
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.45), transparent 45%);
  mix-blend-mode: overlay;
}
.pack.opening { animation: packShake .55s ease-in-out; }
@keyframes packShake {
  0%,100% { transform: rotate(0); } 20% { transform: rotate(-6deg) scale(1.03); }
  40% { transform: rotate(6deg) scale(1.06); } 60% { transform: rotate(-4deg) scale(1.08); } 80% { transform: rotate(3deg) scale(1.1); }
}
.pack-scene.torn .pack-float { animation: none; }
.pack-scene.torn .pack-top { animation: tearOff .55s ease-in forwards; z-index: 3; }
.pack-scene.torn .pack { animation: packDrop .55s .12s ease-in forwards; }
@keyframes tearOff { to { transform: translate(60px, -160px) rotate(28deg); opacity: 0; } }
@keyframes packDrop { to { transform: translateY(80px) scale(.85) rotateX(25deg); opacity: 0; } }
.pack-flash {
  position: absolute; left: 50%; top: 30%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255, 230, 160, .7) 35%, transparent 70%);
  opacity: 0; pointer-events: none;
}
.pack-scene.torn .pack-flash { animation: flash .7s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(4); } }
.flip.special.flipped .flip-face.front .card { animation: specialGlow 1.6s ease-out; }
@keyframes specialGlow {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 90, .9); }
  40% { box-shadow: 0 0 40px 12px rgba(255, 210, 90, .6); }
  100% { box-shadow: var(--shadow); }
}
.booster-info { text-align: center; max-width: 520px; }

.reveal-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.flip { width: 150px; aspect-ratio: 5/7; perspective: 900px; cursor: pointer; animation: dealIn .45s backwards; }
@keyframes dealIn { from { opacity: 0; transform: translateY(40px) scale(.8); } }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.8,.3,1.2); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-face.front { transform: rotateY(180deg); }
.flip-face .card { width: 100%; }
.card-back {
  width: 100%; height: 100%; border-radius: 12px; box-shadow: var(--shadow);
  background:
    radial-gradient(circle, rgba(255,255,255,.25) 2px, transparent 3px) 0 0 / 18px 18px,
    linear-gradient(160deg, #5b3fc4, #b8366f);
  display: grid; place-items: center; color: #fff; font-family: var(--font-title); font-size: 2.4rem;
  border: 3px solid rgba(255,255,255,.25);
}
.flip:not(.flipped):hover .flip-inner { transform: translateY(-4px); }

/* ---------- Collection ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.input, .select {
  padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  min-width: 0;
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search { flex: 1 1 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px;
  font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #d6467e); border-radius: inherit; transition: width .4s; }
.collection-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.collection-head .progress { width: min(320px, 100%); margin-top: 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---------- Atelier ---------- */
.forge { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.slot-box {
  width: 100%; max-width: 160px; aspect-ratio: 5/7; border-radius: 14px; border: 2px dashed var(--line);
  display: grid; place-items: center; color: var(--muted); text-align: center; padding: 10px; font-weight: 700;
  background: var(--surface); position: relative;
}
.slot-box.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.slot-box .card { width: 100%; position: absolute; inset: 0; height: 100%; }
.slot-box .slot-clear {
  position: absolute; top: -10px; right: -10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-weight: 900; line-height: 1;
}
.slot select { width: 100%; max-width: 160px; font-size: .85rem; padding: 6px 8px; }
.op { font-family: var(--font-title); font-size: 2rem; color: var(--muted); }
.result-box { border-style: solid; border-color: transparent; background: var(--surface-2); font-size: 3rem; font-family: var(--font-title); }
.result-box.thinking { animation: pulse 0.6s ease-in-out infinite alternate; }
@keyframes pulse { from { transform: scale(.96); filter: brightness(.95);} to { transform: scale(1.04); filter: brightness(1.1);} }
.forge.fusing .slot-box .card { animation: suck .9s ease-in forwards; }
.forge.fusing .slot:first-child .slot-box .card { --dx: 60%; }
.forge.fusing .slot:nth-child(3) .slot-box .card { --dx: -60%; }
@keyframes suck { 60% { transform: translateX(var(--dx)) scale(.8) rotate(8deg); } 100% { transform: translateX(var(--dx)) scale(.6) rotate(-8deg); opacity: .5; } }
.forge.failed .slot-box .card { animation: shake .5s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
.forge-status { text-align: center; min-height: 1.6em; margin: 14px 0 8px; font-weight: 700; }
.forge-status.known { color: var(--ok); }
.forge-status.failed { color: var(--danger); }
.forge-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 26px; }
.picker-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }

/* ---------- Historique ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--font-title); font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .9rem; font-weight: 700; }
.cat-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; margin-bottom: 26px; }
.cat-progress .row { display: flex; justify-content: space-between; font-weight: 700; font-size: .9rem; }
.cat-progress .progress > span { background: var(--c); }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li {
  display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; cursor: pointer;
}
.timeline li:hover { border-color: var(--accent); }
.timeline .card { --w: 58px; flex: none; box-shadow: none; }
.timeline .card .card-sub, .timeline .card .fam-badge { display: none; }
.timeline .card .card-name { font-size: 15cqw; }
.timeline .meta { min-width: 0; }
.timeline .meta b { font-family: var(--font-title); font-size: 1.1rem; font-weight: 600; }
.timeline .meta div { color: var(--muted); font-size: .9rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; margin-left: 6px; }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
details.fails { margin-top: 26px; }
details.fails summary { cursor: pointer; font-weight: 800; }
.fail-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- Règles ---------- */
.rules { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.rules ol, .rules ul { padding-left: 1.2em; margin: 0; }
.rules li { margin-bottom: .45em; }
.notice {
  border-radius: var(--radius); padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  background: var(--gold-soft);
}
.notice h3 { margin-bottom: .3em; }
.settings-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ---------- Modale & toasts ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 10, 25, .55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px; animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(560px, 100%);
  max-height: calc(100vh - 32px); overflow: auto; padding: 22px; animation: popIn .25s cubic-bezier(.2,.8,.3,1.3);
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.detail { display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.detail .card { --w: 170px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; font-size: .93rem; }
.detail dt { color: var(--muted); font-weight: 700; }
.detail dd { margin: 0; }
.recipe-list { list-style: none; padding: 0; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 4px; font-size: .93rem; }
.copies { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.copies li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
  background: var(--surface-2); font-size: .9rem;
}
.copies li .serial { font-family: var(--font-title); font-weight: 600; font-size: 1rem; }
.copies li .grow { flex: 1; min-width: 0; color: var(--muted); }
.lock-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.lock-btn.on { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }

.reveal { text-align: center; }
.reveal .card { --w: 220px; margin: 8px auto 18px; animation: revealIn .7s cubic-bezier(.2,.8,.3,1.3); }
@keyframes revealIn { 0% { transform: rotateY(90deg) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.reveal .burst {
  font-family: var(--font-title); font-size: 1.6rem; font-weight: 600; margin-bottom: 4px;
  background: linear-gradient(90deg, var(--accent), #d6467e, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.founder-cert {
  border: 2px solid var(--gold); background: var(--gold-soft); border-radius: 14px; padding: 10px 14px;
  font-weight: 700; display: inline-block; text-align: left;
}
.consume-list { display: flex; justify-content: center; gap: 14px; margin: 14px 0; }
.consume-list .card { --w: 110px; }
.warn { color: var(--danger); font-weight: 800; }

.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast {
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 700;
  box-shadow: var(--shadow-lg); animation: toastIn .25s; max-width: 100%;
}
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } }

/* ---------- Atelier : sceaux de fondateur ---------- */
.atelier-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 20px; }
.seals-box { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .88rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.seals { display: inline-flex; gap: 5px; vertical-align: middle; }
.seal { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--gold) 60%, var(--line)); }
.seal.on { background: radial-gradient(circle at 35% 35%, #fff3b0, var(--gold) 60%, #8a6200); border-color: var(--gold); box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 60%, transparent); }

/* ---------- Vitrine ---------- */
.card-grid.trophies { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 26px 18px; padding: 6px 4px 10px; }
.trophy-slot { display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; }
.trophy-slot .card { width: 100%; }
.trophy-slot small { color: var(--muted); font-weight: 700; margin-top: 4px; }
.reveal-pair { display: flex; justify-content: center; gap: 16px; margin: 8px 0 14px; }
.reveal-pair .card { --w: 170px !important; margin: 0 !important; }
.reveal.is-founded .burst { font-size: 2rem; }
.copies li.is-shiny { background: linear-gradient(90deg, color-mix(in srgb, #f472b6 18%, var(--surface-2)), color-mix(in srgb, #22d3ee 18%, var(--surface-2))); }

/* ---------- En-tête : son ---------- */
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; font-size: 1rem; box-shadow: var(--shadow);
}

/* ---------- Collection : sous-onglets et collections ---------- */
.subtabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.subtab {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 14px;
  font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.subtab .count { font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }
.subtab[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.subtab[aria-pressed="true"] .count { background: color-mix(in srgb, var(--bg) 20%, transparent); color: var(--bg); }
.sets { display: grid; gap: 16px; }
.set-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.set-head h3 { margin: 0; }
.set-meta { display: flex; align-items: center; gap: 10px; }
.set .progress { margin-bottom: 12px; }
.set-note { font-size: .88rem; margin-bottom: 10px; }
.set-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.set.done { border-color: var(--gold); }

/* ---------- Mise en avant des fondations ---------- */
.stat.gold { border-color: var(--gold); background: var(--gold-soft); }
.stat.gold b { color: var(--gold); }
.card-grid.founders { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.timeline li.is-founder { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: linear-gradient(90deg, var(--gold-soft), var(--surface) 60%); }
.copies li.is-founder { background: var(--gold-soft); }
.forge-status.thinking { color: var(--accent); animation: pulse .6s ease-in-out infinite alternate; }
.reveal.is-new .card, .reveal.is-founded .card.trophy { box-shadow: 0 0 50px 8px color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 12px; }

/* ---------- Défis ---------- */
.tab { position: relative; }
.tab[data-badge]:not([data-badge=""])::after {
  content: attr(data-badge); position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 900; display: grid; place-items: center;
}
.defis-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.defis { display: grid; gap: 0; padding: 4px 18px; }
.defi { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.defi:last-child { border-bottom: 0; }
.defi-main { flex: 1; min-width: 0; }
.defi-progress { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.defi-progress .progress { flex: 1; max-width: 320px; }
.defi-progress small { color: var(--muted); font-weight: 800; }
.defi.ready b { color: var(--accent); }
.defi.claimed { opacity: .6; }
.seals-box { cursor: pointer; }

/* ---------- Animation de découverte ---------- */
.dfx {
  position: fixed; inset: 0; z-index: 70; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #2a1650 0%, #0d0819 55%, #05030a 100%);
  animation: fadeIn .4s ease-out;
}
.dfx.fade { animation: dfxOut .3s forwards; }
body:has(.dfx) { overflow: hidden; }
@keyframes dfxOut { to { opacity: 0; } }
.dfx-rays {
  position: absolute; width: 160vmax; height: 160vmax; left: 50%; top: 45%; margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(from 0deg, rgba(167, 139, 250, .16) 0deg 6deg, transparent 6deg 18deg);
  animation: dfxSpin 14s linear infinite, dfxRays 12s ease-in forwards;
  mask-image: radial-gradient(circle, #000 0%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 60%);
}
@keyframes dfxSpin { to { transform: rotate(360deg); } }
@keyframes dfxRays { from { opacity: .3; } to { opacity: 1; } }
.dfx-core {
  position: absolute; left: 50%; top: 45%; width: 18vmin; height: 18vmin; margin: -9vmin 0 0 -9vmin; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe9a8 22%, #f472b6 48%, rgba(124, 58, 237, .5) 68%, transparent 72%);
  box-shadow: 0 0 60px 20px rgba(244, 114, 182, .45), 0 0 140px 50px rgba(124, 58, 237, .35);
  animation: dfxPulse .9s ease-in-out infinite alternate, dfxGrow 12s ease-in forwards;
}
@keyframes dfxPulse { from { filter: brightness(.9); } to { filter: brightness(1.35); } }
@keyframes dfxGrow { from { transform: scale(.35); } to { transform: scale(1.6); } }
.dfx-orbit { position: absolute; left: 50%; top: 45%; width: 0; height: 0; animation: dfxSpin 2.2s linear infinite; }
.dfx-card {
  position: absolute; width: 22vmin; max-width: 130px; left: 0; top: 0;
  transform: translate(-50%, -50%) translateX(var(--r, 30vmin)) rotate(90deg);
  animation: dfxSpiral 9s ease-in forwards;
}
.dfx-card.two { --flip: 180deg; transform: translate(-50%, -50%) rotate(180deg) translateX(var(--r, 30vmin)) rotate(90deg); animation-name: dfxSpiral2; }
.dfx-card .card { width: 100%; box-shadow: 0 0 30px rgba(167, 139, 250, .7); }
@keyframes dfxSpiral { from { transform: translate(-50%, -50%) translateX(32vmin) rotate(90deg) scale(1); opacity: 1; } to { transform: translate(-50%, -50%) translateX(4vmin) rotate(90deg) scale(.25); opacity: .2; } }
@keyframes dfxSpiral2 { from { transform: translate(-50%, -50%) rotate(180deg) translateX(32vmin) rotate(90deg) scale(1); opacity: 1; } to { transform: translate(-50%, -50%) rotate(180deg) translateX(4vmin) rotate(90deg) scale(.25); opacity: .2; } }
.dfx-particles i {
  position: absolute; left: 50%; top: 45%; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px 3px rgba(244, 114, 182, .8);
  animation: dfxIn var(--d) var(--t) ease-in infinite;
}
@keyframes dfxIn { from { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; } 20% { opacity: 1; } to { transform: translate(0, 0) scale(.2); opacity: 0; } }
.dfx-text { position: absolute; left: 16px; right: 16px; bottom: 9vh; text-align: center; color: #f3eaff; }
.dfx-title {
  font-family: var(--font-title); font-size: clamp(1.5rem, 5vw, 2.4rem); font-weight: 600; letter-spacing: .02em;
  background: linear-gradient(90deg, #c4b5fd, #f9a8d4, #fde68a, #c4b5fd); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: holo 4s linear infinite;
}
.dfx-line { margin-top: 8px; font-weight: 700; opacity: .9; min-height: 1.5em; }
.dfx-line.in { animation: dfxLine .5s ease-out; }
@keyframes dfxLine { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
.dfx-bar { width: min(320px, 70vw); height: 4px; margin: 14px auto 0; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.dfx-bar span { display: block; height: 100%; width: 40%; border-radius: inherit; background: linear-gradient(90deg, transparent, #f9a8d4, #fde68a, transparent); animation: dfxBar 1.3s ease-in-out infinite; }
@keyframes dfxBar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.dfx-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.dfx.boom .dfx-core { animation: dfxBoom .5s ease-in forwards; }
.dfx.boom .dfx-flash { animation: dfxFlash .75s ease-out forwards; }
.dfx.boom .dfx-text, .dfx.boom .dfx-orbit, .dfx.boom .dfx-particles { opacity: 0; transition: opacity .2s; }
@keyframes dfxBoom { to { transform: scale(14); opacity: .9; } }
@keyframes dfxFlash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 1; } }
.reveal.epic { animation: epicIn .7s ease-out; }
@keyframes epicIn { from { filter: brightness(3) saturate(0); } }
@media (prefers-reduced-motion: reduce) {
  .dfx-rays, .dfx-orbit, .dfx-particles i, .dfx-core { animation-duration: 0s !important; animation-iteration-count: 1 !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  /* backdrop-filter créerait un bloc conteneur pour la barre d'onglets fixe. */
  .topbar { backdrop-filter: none; background: var(--bg); }
  .topbar-inner { padding: 8px 12px; gap: 8px; }
  .forge .slot-box { max-width: 118px; }
  .forge .slot select { max-width: 118px; }
  .brand span.name { display: none; }
  .player { display: none; }
  .tabs {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; max-width: none; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around;
  }
  .tab { flex-direction: column; gap: 0; font-size: .7rem; padding: 6px 4px; border-radius: 10px; border-bottom: 0; flex: 1; }
  .tab .ico { font-size: 1.3rem; }
  .tab[aria-current="page"] { background: var(--surface-2); }
  main { padding: 16px 16px 100px; }
  .toasts { bottom: 86px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 9px; }
  .forge { grid-template-columns: 1fr auto 1fr; row-gap: 8px; }
  .forge .op.eq { grid-column: 1 / -1; transform: rotate(90deg); justify-self: center; font-size: 1.6rem; line-height: 1; }
  .forge .slot.result { grid-column: 1 / -1; }
  .forge .slot.result .slot-box { max-width: 96px; font-size: 2rem; }
  .flip { width: calc(33% - 10px); max-width: 130px; }
  .detail { grid-template-columns: 1fr; }
  .detail .card { margin: 0 auto; --w: 150px; }
  .reveal .card { --w: 180px; }
  .consume-list .card { --w: 90px; }
}

/* ---------- Crédits des images ---------- */
.credits { margin-top: 16px; }
.credits summary { cursor: pointer; }
.credits ul { margin: 12px 0 0; padding-left: 1.2em; font-size: .85rem; columns: 2 340px; column-gap: 28px; }
.credits li { margin-bottom: .35em; break-inside: avoid; }

/* =====================================================================
   Refonte visuelle (logo, booster 3D, raretés adoucies, atelier)
   ===================================================================== */

/* ---------- Logo et en-tête ---------- */
.brand-logo { width: 46px; height: 28px; overflow: visible; background: none; border-radius: 0; }
.brand .name { letter-spacing: .01em; }
.brand .name b { background: linear-gradient(90deg, #a78bfa, #ec4899, #f6c453); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eclats-pill {
  display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; font-weight: 800; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}

/* ---------- Dos de carte ---------- */
.card-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, .25), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #24124d, #3b1462 55%, #1a0b33);
  border: 3px solid #c9a24a; box-shadow: inset 0 0 0 4px #1a0b33, inset 0 0 0 5px rgba(201,162,74,.6), var(--shadow);
}
.card-back svg { width: 62%; height: auto; overflow: visible; }

/* ---------- Booster : sachet métallisé en 3D ---------- */
.pack {
  width: 220px; border-radius: 14px;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(255,255,255,.18), transparent 60%),
    conic-gradient(from 210deg at 70% 80%, rgba(236,72,153,.35), rgba(139,92,246,.25), rgba(56,189,248,.25), rgba(246,196,83,.3), rgba(236,72,153,.35)),
    repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 7px),
    linear-gradient(165deg, #2a1360, #4c1d95 45%, #1e1145);
  box-shadow:
    0 34px 50px -20px rgba(40, 10, 80, .75),
    inset 0 0 0 1.5px rgba(255,255,255,.22),
    inset 0 0 30px rgba(10, 0, 30, .55);
}
.pack::before { background: linear-gradient(160deg, #1a0b3d, #2e1065); transform: translateZ(-18px); }
.pack-side { position: absolute; top: 4%; bottom: 4%; width: 18px; background: linear-gradient(90deg, #160933, #3b1a75, #160933); }
.pack-side.left { left: 0; transform-origin: left center; transform: rotateY(90deg); }
.pack-side.right { right: 0; transform-origin: right center; transform: rotateY(-90deg); }
/* Sertissages dorés en dents de scie, comme un vrai sachet scellé. */
.pack-top, .pack-bottom {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #f6d77a, #b8860b 55%, #e9c46a);
  border: 0;
}
.pack-top {
  height: 11%; border-radius: 14px 14px 0 0;
  -webkit-mask: linear-gradient(#000 0 0) top/100% 75% no-repeat, conic-gradient(from 135deg at top, #000 90deg, #0000 0) bottom/10px 30% repeat-x;
  mask: linear-gradient(#000 0 0) top/100% 75% no-repeat, conic-gradient(from 135deg at top, #000 90deg, #0000 0) bottom/10px 30% repeat-x;
}
.pack-bottom {
  height: 7%; border-radius: 0 0 14px 14px;
  -webkit-mask: linear-gradient(#000 0 0) bottom/100% 70% no-repeat, conic-gradient(from -45deg at bottom, #000 90deg, #0000 0) top/10px 35% repeat-x;
  mask: linear-gradient(#000 0 0) bottom/100% 70% no-repeat, conic-gradient(from -45deg at bottom, #000 90deg, #0000 0) top/10px 35% repeat-x;
}
.pack-face { inset: 11% 0 7%; justify-content: center; gap: 10px; padding: 16px 14px; }
.pack-bulge { inset: 11% 0 7%; }
.pack-ribbon {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--font-body); font-size: .62rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase;
  color: #3b2a00; background: linear-gradient(90deg, #c9a24a, #f6e2a0, #c9a24a); padding: 3px 10px; border-radius: 3px;
}
.pack-logo { width: 140px; height: auto; overflow: visible; transform: translateZ(28px); filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); }
.pack-title { font-size: 1.05rem; letter-spacing: .22em; line-height: 1.25; text-align: center; font-weight: 600; }
.pack-title b { font-size: 1.25rem; letter-spacing: .12em; background: linear-gradient(90deg, #f9a8d4, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pack-sub { font-size: .7rem; letter-spacing: .06em; opacity: .85; text-transform: uppercase; font-weight: 800; position: absolute; bottom: 14px; }
.shop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }

/* ---------- Raretés adoucies : la gradation se lit, sans agresser ---------- */
.card.rar-rare .card-in { --rar: #c8ac5f; --frame: linear-gradient(135deg, #f7efd4, #d4bd7c 30%, #efe3b8 50%, #b59c58 75%, #ece0b4); }
.card.rar-epique .card-in { --frame: linear-gradient(135deg, #ede4ff, #8b5cf6 30%, #d8b4fe 50%, #6d28d9 75%, #ede4ff); }
.card.rar-legendaire .card-in { animation-duration: 10s; box-shadow: 0 0 10px rgba(255, 195, 113, .3), var(--shadow); }
.card.rar-legendaire .card-art::after { animation-duration: 8s; opacity: .4; }
.rar-pill.rar-rare { color: #a88c3e; border-color: #dcc78c; background: color-mix(in srgb, #efe3b8 22%, var(--surface)); }

/* ---------- Discovery : badge doré, plaque sous la carte ---------- */
.founder-mark {
  background: radial-gradient(circle at 35% 30%, #fff8dc, #e9c46a 55%, #a87b12);
  box-shadow: 0 0 0 1.2cqw rgba(255, 236, 170, .55), 0 0 3cqw rgba(233, 196, 106, .9);
}
.trophy-slot { gap: 8px; }
.plaque {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 6px 8px; border-radius: 8px; text-align: center;
  background: linear-gradient(180deg, #f6e2a0, #c9a24a); color: #3b2a00; box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.6);
}
.plaque b { font-size: .72rem; letter-spacing: .14em; }
.plaque small { font-size: .7rem; font-weight: 700; opacity: .8; }

/* ---------- Vitrine : saison ---------- */
.season { display: grid; gap: 6px; margin-bottom: 18px; border-color: color-mix(in srgb, #8b5cf6 40%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, #8b5cf6 10%, var(--surface)), var(--surface)); }
.season-score { display: flex; align-items: baseline; gap: 8px; }
.season-score b { font-family: var(--font-title); font-size: 2.2rem; line-height: 1; color: #a78bfa; }

/* ---------- Animation de découverte : rayons ronds (plus de carré visible) ---------- */
.dfx-rays { border-radius: 50%; }

/* ---------- Atelier : une vraie table de fusion ---------- */
.forge {
  position: relative; padding: 26px 18px 22px; border-radius: 22px; isolation: isolate;
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(139, 92, 246, .22), transparent 70%),
    radial-gradient(circle at 15% 20%, rgba(236, 72, 153, .12), transparent 40%),
    linear-gradient(160deg, color-mix(in srgb, #1e1145 70%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, #8b5cf6 35%, var(--line));
  box-shadow: inset 0 0 40px rgba(20, 8, 50, .35), var(--shadow);
}
.forge::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%;
  border: 2px dashed rgba(167, 139, 250, .25); animation: dfxSpin 40s linear infinite;
}
.forge .op { color: #c4b5fd; text-shadow: 0 0 12px rgba(167, 139, 250, .8); font-size: 2.2rem; }
.forge .slot-box { border-color: rgba(167, 139, 250, .45); background: rgba(20, 12, 40, .35); color: #d8ccff; }
.forge .slot-box.active { border-color: #c4b5fd; box-shadow: 0 0 0 3px rgba(167, 139, 250, .25), 0 0 24px rgba(167, 139, 250, .35); animation: slotPulse 1.8s ease-in-out infinite; }
@keyframes slotPulse { 50% { box-shadow: 0 0 0 5px rgba(167, 139, 250, .18), 0 0 34px rgba(167, 139, 250, .5); } }
.forge .result-box { background: radial-gradient(circle, rgba(246, 196, 83, .18), rgba(20, 12, 40, .4) 70%); color: #fde68a; box-shadow: 0 0 30px rgba(246, 196, 83, .2); }

/* ---------- Carnet de recettes ---------- */
.carnet { margin-top: 18px; }
.carnet summary { cursor: pointer; font-weight: 800; }
.carnet-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 22px; position: relative; }
.tree { padding-left: 0; }
.tree ul::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 10px; border-left: 2px solid color-mix(in srgb, #8b5cf6 40%, var(--line)); }
.tree li { position: relative; margin: 6px 0; }
.tree ul > li::before { content: ""; position: absolute; left: -14px; top: 16px; width: 12px; border-top: 2px solid color-mix(in srgb, #8b5cf6 40%, var(--line)); }
.noeud { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; font-size: .9rem; cursor: pointer; }
.noeud .vignette { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface); font-size: 1rem; }
.noeud .vignette img { width: 100%; height: 100%; object-fit: cover; }
.noeud.base { opacity: .8; }
.noeud small { color: var(--muted); font-weight: 700; }

/* ---------- Collection : sections par famille ---------- */
.grid-group .fam-ico { font-size: 1.2rem; }

@media (max-width: 720px) {
  .eclats-pill { padding: 5px 8px; font-size: .85rem; }
  .pack { width: 190px; }
  .pack-logo { width: 118px; }
  .forge { padding: 18px 10px; }
  .forge::before { width: 220px; height: 220px; margin: -110px 0 0 -110px; }
}

/* =====================================================================
   Retouches : badge Discovery pétillant, plaque or, arbre généalogique
   ===================================================================== */

/* Pas de halo sous les cartes Discovery : c'est le badge qui porte l'éclat. */
.card.trophy { box-shadow: none; }
.reveal.is-new .card, .reveal.is-founded .card, .reveal.is-founded .card.trophy { box-shadow: none; }

/* Badge 🏆 : le badge le plus précieux du jeu. Or vif, pulsation, et étincelles qui s'en échappent. */
.founder-mark {
  width: 18cqw; height: 18cqw; font-size: 10cqw; top: 3cqw; right: 3cqw; overflow: visible;
  background: radial-gradient(circle at 35% 30%, #fffbe8, #f6d15a 45%, #c48a0e 80%, #8a5d00);
  box-shadow: 0 0 0 0.9cqw #fff1b0, 0 0 0 1.8cqw rgba(196, 138, 14, .9), 0 0 4cqw 1cqw rgba(255, 214, 90, .95);
  animation: badgePulse 2.2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0.9cqw #fff1b0, 0 0 0 1.8cqw rgba(196, 138, 14, .9), 0 0 3cqw .5cqw rgba(255, 214, 90, .8); }
  50% { box-shadow: 0 0 0 0.9cqw #fff1b0, 0 0 0 1.8cqw rgba(196, 138, 14, .9), 0 0 6cqw 2cqw rgba(255, 228, 130, 1); }
}
.founder-mark::before, .founder-mark::after {
  content: "✦"; position: absolute; color: #fff6c2; font-size: 7cqw; line-height: 1; pointer-events: none;
  text-shadow: 0 0 2cqw #ffd75a; animation: etincelle 1.8s ease-out infinite;
}
.founder-mark::before { left: -6cqw; top: 6cqw; --dx: -6cqw; --dy: 4cqw; }
.founder-mark::after { right: 2cqw; top: -7cqw; --dx: 4cqw; --dy: -6cqw; animation-delay: .9s; font-size: 5.5cqw; }
@keyframes etincelle {
  0% { transform: translate(0, 0) scale(.3) rotate(0); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(90deg); opacity: 0; }
}

/* Plaque Discovery : or métallique gravé, reflet qui passe, texte sombre bien lisible. */
.plaque {
  position: relative; overflow: hidden; border-radius: 6px; padding: 7px 10px 6px;
  background: linear-gradient(180deg, #fff3c4 0%, #f3cf63 22%, #c9961f 52%, #f0c75a 78%, #a87412 100%);
  border: 1px solid #8a5d00; box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 3px rgba(90, 55, 0, .35), 0 3px 8px rgba(0,0,0,.35);
  color: #3a2400; text-shadow: 0 1px 0 rgba(255, 245, 200, .7);
}
.plaque::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.65) 50%, transparent 65%);
  background-size: 250% 100%; animation: plaqueReflet 4s ease-in-out infinite;
}
@keyframes plaqueReflet { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.plaque b { font-size: .74rem; letter-spacing: .16em; color: #3a2400; }
.plaque small { font-size: .74rem; font-weight: 800; color: #4a2f00; opacity: 1; }
.copies li.is-collector { background: linear-gradient(90deg, color-mix(in srgb, #f6d15a 30%, var(--surface-2)), var(--surface-2)); }

/* Atelier : pas de cercle décoratif sans signification. */
.forge::before { content: none; }

/* Animation de découverte : les cartes aspirées disparaissent entièrement au centre. */
@keyframes dfxSpiral { from { transform: translate(-50%, -50%) translateX(32vmin) rotate(90deg) scale(1); opacity: 1; } 85% { opacity: .35; } to { transform: translate(-50%, -50%) translateX(0) rotate(90deg) scale(.05); opacity: 0; } }
@keyframes dfxSpiral2 { from { transform: translate(-50%, -50%) rotate(180deg) translateX(32vmin) rotate(90deg) scale(1); opacity: 1; } 85% { opacity: .35; } to { transform: translate(-50%, -50%) rotate(180deg) translateX(0) rotate(90deg) scale(.05); opacity: 0; } }
.dfx-card { animation-fill-mode: forwards; }

/* Booster : moins de brume sur le logo. */
.pack { background:
    radial-gradient(ellipse 60% 40% at 25% 12%, rgba(255,255,255,.10), transparent 60%),
    conic-gradient(from 210deg at 70% 80%, rgba(236,72,153,.28), rgba(139,92,246,.2), rgba(56,189,248,.2), rgba(246,196,83,.24), rgba(236,72,153,.28)),
    repeating-linear-gradient(115deg, rgba(255,255,255,.04) 0 2px, transparent 2px 7px),
    linear-gradient(165deg, #2a1360, #4c1d95 45%, #1e1145); }
.pack-bulge { opacity: .55; }
.pack-shine { opacity: .6; }
.pack-logo { position: relative; z-index: 2; }

/* Dos de carte : sobre, liseré clair (l'or laissait croire à une carte rare). */
.card-back { border-color: #d9d2f0; box-shadow: inset 0 0 0 4px #1a0b33, inset 0 0 0 5px rgba(217, 210, 240, .45), var(--shadow); }

/* Carnet : arbre généalogique horizontal (la carte à gauche, ses parents à droite). */
.pedigree { overflow-x: auto; padding: 10px 2px 6px; }
.ped { display: flex; align-items: center; }
.ped-node { position: relative; flex: none; }
.ped-node.has-parents { padding-right: 22px; }
.ped-node.has-parents::after { content: ""; position: absolute; right: 0; top: 50%; width: 22px; border-top: 2px solid color-mix(in srgb, #8b5cf6 55%, var(--line)); }
.ped-parents { display: flex; flex-direction: column; gap: 10px; position: relative; padding-left: 22px; }
.ped-parents::before { content: ""; position: absolute; left: 0; top: 25%; bottom: 25%; border-left: 2px solid color-mix(in srgb, #8b5cf6 55%, var(--line)); }
.ped-parents > .ped { position: relative; }
.ped-parents > .ped::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; border-top: 2px solid color-mix(in srgb, #8b5cf6 55%, var(--line)); }
.noeud > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.noeud small { font-size: .7rem; }

/* ---------- Album et indices ---------- */
.slot-info { font-size: .82rem; font-weight: 800; color: var(--muted); min-height: 34px; display: flex; align-items: center; justify-content: center; text-align: center; }
.forge .slot-info { color: #d8ccff; }
.indice-recette { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.indice-recette > b { font-size: 1.4rem; color: var(--muted); }
.set .card.unknown.clickable:hover { transform: translateY(-3px); }

/* ---------- Spectacle « Première mondiale » : ~4 secondes, uniquement à la naissance d'une carte ---------- */
.dfx-card { animation-duration: 3.6s; }
.dfx-core { animation: dfxPulse .6s ease-in-out infinite alternate, dfxGrow 3.8s ease-in forwards; }
.dfx-rays { animation: dfxSpin 8s linear infinite, dfxRays 3.8s ease-in forwards; }

/* Attente d'une paire jamais tentée : ambiance discrète dans l'atelier. */
.forge.deep { animation: forgeAttente 1.4s ease-in-out infinite; }
@keyframes forgeAttente {
  0%, 100% { box-shadow: inset 0 0 40px rgba(20, 8, 50, .35), 0 0 0 rgba(167, 139, 250, 0); }
  50% { box-shadow: inset 0 0 60px rgba(139, 92, 246, .35), 0 0 30px rgba(167, 139, 250, .35); }
}

/* ---------- Plaque Discovery : une ligne fine et moderne ---------- */
.plaque {
  display: block; width: auto; align-self: center; padding: 3px 12px; border-radius: 999px;
  font-size: .66rem; font-weight: 900; letter-spacing: .12em; white-space: nowrap; line-height: 1.4;
  background: linear-gradient(90deg, #b8860b, #f6d77a 45%, #fff3c4 55%, #c9961f);
  border: 0; box-shadow: 0 1px 4px rgba(0,0,0,.3);
  color: #3a2400; text-shadow: none;
}
.trophy-slot { gap: 6px; }

/* ---------- Carte sans image : composition sobre (initiale sur dégradé de famille) ---------- */
.art-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2cqw; padding-bottom: 22cqw;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--fam) 55%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--fam) 35%, #1a1426), #120e1c);
  color: rgba(255,255,255,.92);
}
.art-fallback b { font-family: var(--font-title); font-size: 40cqw; line-height: 1; text-shadow: 0 2cqw 6cqw rgba(0,0,0,.4); }
.art-fallback small { font-size: 6cqw; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.card .emoji { display: none; }
.card.unknown .emoji { display: block; }

/* ---------- Atelier : sections par famille dans « Vos cartes » ---------- */
.picker-grid .grid-group { font-size: .92rem; margin-top: 6px; }

/* =====================================================================
   Duel
   ===================================================================== */
.duel-page { display: flex; flex-direction: column; gap: 14px; }
.duel-stats { display: flex; justify-content: center; gap: 6px; margin-top: 6px; font-size: .78rem; font-weight: 800; }
.duel-stats span { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.duel-stats b { font-family: var(--font-title); font-size: .9rem; }

/* Choix du deck */
.duel-deck-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; position: sticky; top: 100px; z-index: 5; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.duel-deck-barre b { margin-right: auto; }
.duel-grille { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.duel-pick { cursor: pointer; border-radius: 12px; padding: 4px; transition: transform .15s; }
.duel-pick .card { width: 100%; }
.duel-pick:hover { transform: translateY(-2px); }
.duel-pick.choisie { background: color-mix(in srgb, #8b5cf6 25%, transparent); box-shadow: 0 0 0 2px #a78bfa; }

/* Table de jeu */
.duel-camp { border-radius: 18px; padding: 12px; border: 1px solid var(--line); }
.duel-camp.bot { background: linear-gradient(180deg, color-mix(in srgb, #ef4444 10%, var(--surface)), var(--surface)); }
.duel-camp.moi { background: linear-gradient(0deg, color-mix(in srgb, #8b5cf6 14%, var(--surface)), var(--surface)); }
.duel-tete { display: flex; align-items: center; gap: 12px; }
.duel-tete small { color: var(--muted); font-weight: 800; }
.pv { position: relative; flex: 1; max-width: 260px; height: 16px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pv span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #22c55e, #84cc16); transition: width .4s; }
.duel-camp.bot .pv span { background: linear-gradient(90deg, #ef4444, #f97316); }
.pv b { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 16px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.duel-table { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; min-height: 120px; align-items: center; }
.duel-slot { width: 118px; border-radius: 12px; padding: 4px; transition: transform .2s; }
.duel-slot .card { width: 100%; }
.duel-camp.moi .duel-slot { cursor: pointer; }
.duel-camp.moi .duel-slot:hover { transform: translateY(-4px); }
.duel-slot.sel { transform: translateY(-10px); box-shadow: 0 0 0 3px #a78bfa, 0 10px 24px rgba(139, 92, 246, .45); background: color-mix(in srgb, #8b5cf6 20%, transparent); }
.duel-slot.touche { animation: touche .5s; }
@keyframes touche { 0%, 100% { transform: none; } 25% { transform: translateX(-6px) rotate(-2deg); } 75% { transform: translateX(6px) rotate(2deg); } }
.duel-centre { text-align: center; }
.duel-tour { font-family: var(--font-title); font-size: 1.15rem; }
.duel-journal { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9rem; }
.duel-journal li:first-child { font-weight: 800; }
.duel-journal li:not(:first-child) { color: var(--muted); font-size: .82rem; }
.duel-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; position: sticky; bottom: 12px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.duel-fin { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; }
.duel-fin b { font-family: var(--font-title); font-size: 1.3rem; }
.duel-fin.gagne b { color: var(--gold); }

@media (max-width: 720px) {
  .duel-slot { width: 84px; }
  .duel-stats { gap: 3px; font-size: .68rem; }
  .duel-stats span { padding: 0 4px; }
  .duel-actions { bottom: 78px; }
  .duel-deck-barre { top: 60px; }
}

/* Plaque Discovery : deux lignes compactes, toujours contenues dans la largeur de la carte. */
.trophy-slot { min-width: 0; }
.plaque {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden;
  padding: 3px 6px; border-radius: 6px; white-space: normal; text-align: center; line-height: 1.25;
}
.plaque b { font-size: .62rem; letter-spacing: .14em; }
.plaque span { font-size: .62rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Épique : un cadre violet, sans halo ni clignotement (cohérent avec les autres raretés). */
.card.rar-epique .card-in { animation: none; box-shadow: var(--shadow); }

/* ---------- Fusion inédite en deux temps : attente neutre, puis naissance (ou fondu doux) ---------- */
/* 1. Attente : les cartes flottent en orbite autour d'un petit noyau violet. Pas de doré, pas de promesse. */
.dfx-title { transition: opacity .6s ease-out, transform .6s ease-out; }
.dfx.attente { background: radial-gradient(circle at 50% 45%, #1f1440 0%, #0d0819 55%, #05030a 100%); }
.dfx.attente .dfx-rays { opacity: 0; animation: none; }
.dfx.attente .dfx-title { opacity: 0; transform: scale(.9); }
.dfx.attente .dfx-core { transform: scale(.45); filter: hue-rotate(-40deg); animation: dfxPulse 1.2s ease-in-out infinite alternate; }
.dfx.attente .dfx-orbit { animation-duration: 5s; }
.dfx.attente .dfx-card { animation: dfxFlotte 2.6s ease-in-out infinite alternate; }
.dfx.attente .dfx-card.two { animation-name: dfxFlotte2; }
.dfx.attente .dfx-particles i { box-shadow: 0 0 10px 3px rgba(167, 139, 250, .7); }
@keyframes dfxFlotte { from { transform: translate(-50%, -50%) translateX(31vmin) rotate(90deg) scale(1); } to { transform: translate(-50%, -50%) translateX(25vmin) rotate(90deg) scale(.9); } }
@keyframes dfxFlotte2 { from { transform: translate(-50%, -50%) rotate(180deg) translateX(31vmin) rotate(90deg) scale(1); } to { transform: translate(-50%, -50%) rotate(180deg) translateX(25vmin) rotate(90deg) scale(.9); } }

/* 2a. Naissance : rayons dorés, titre, cartes aspirées dans le noyau qui grossit. */
.dfx.naissance .dfx-rays { animation: dfxSpin 8s linear infinite, dfxRays 3s ease-in forwards; }
.dfx.naissance .dfx-core { animation: dfxPulse .6s ease-in-out infinite alternate, dfxGrow 3.2s ease-in forwards; }
.dfx.naissance .dfx-card { animation: dfxSpiral 3s ease-in forwards; }
.dfx.naissance .dfx-card.two { animation-name: dfxSpiral2; }
.dfx.naissance .dfx-title { animation: holo 4s linear infinite, dfxTitre .7s ease-out; }
@keyframes dfxTitre { from { opacity: 0; transform: scale(1.3); filter: blur(6px); } }

/* 2b. Carte existante : les cartes se rejoignent en douceur, puis tout s'efface. */
.dfx.fondre .dfx-card { animation: dfxSpiral .65s ease-in forwards; }
.dfx.fondre .dfx-card.two { animation-name: dfxSpiral2; }
.dfx.fondre .dfx-text { opacity: 0; transition: opacity .3s; }

/* ---------- En ligne : onglet Monde (classements, fil) ---------- */
.local-pill.en-ligne { cursor: pointer; }
.card-sub small { opacity: .7; font-size: .85em; }
.classement { list-style: none; margin: 0; padding: 6px 0; }
.classement li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.classement li:last-child { border-bottom: 0; }
.classement li.moi { background: rgba(167, 139, 250, .14); border-radius: 10px; }
.classement .rang { font-weight: 900; text-align: center; font-size: 1.05rem; }
.classement .val { color: var(--muted); font-weight: 700; white-space: nowrap; }
.fil { list-style: none; margin: 0; padding: 6px 0; }
.fil li { display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.fil li:last-child { border-bottom: 0; }
.fil li:hover { background: rgba(255, 255, 255, .04); }
.fil .vignette { flex: none; width: 46px; height: 62px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--surface); font-weight: 800; }
.fil .vignette img { width: 100%; height: 100%; object-fit: cover; }
.fil small .rar-pill { font-size: .72rem; }

/* ---------- Tutoriel guidé ---------- */
.coach-ring {
  position: fixed; z-index: 58; pointer-events: none; border-radius: 16px;
  border: 2px solid #fde68a; box-shadow: 0 0 0 4px rgba(253, 230, 138, .25), 0 0 26px rgba(253, 230, 138, .55);
  animation: coachPulse 1.4s ease-in-out infinite;
}
@keyframes coachPulse { 50% { box-shadow: 0 0 0 8px rgba(253, 230, 138, .12), 0 0 34px rgba(253, 230, 138, .7); } }
.coach {
  position: fixed; z-index: 59; width: min(320px, calc(100vw - 24px)); padding: 14px 16px 12px;
  background: #241a3d; color: #f3eaff; border: 1px solid rgba(253, 230, 138, .5); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5); animation: coachIn .3s ease-out;
}
.coach.centre { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px)); }
.coach::before {
  content: ""; position: absolute; left: var(--fleche, 50%); width: 12px; height: 12px; margin-left: -6px;
  background: inherit; border: inherit; border-width: 1px 0 0 1px; transform: rotate(45deg);
}
.coach.dessous::before { top: -7px; }
.coach.dessus::before { bottom: -7px; transform: rotate(225deg); }
.coach.centre::before { display: none; }
.coach-titre { font-weight: 900; font-size: 1.02rem; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.coach-titre small { font-weight: 700; opacity: .55; font-size: .78rem; }
.coach-texte { margin-top: 6px; line-height: 1.45; font-size: .95rem; }
.coach-actions { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.coach-passer { background: none; border: 0; color: inherit; opacity: .6; font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; padding: 0; }
@keyframes coachIn { from { opacity: 0; transform: translateY(6px); } }
.coach.centre { animation: none; }

/* ---------- La barre de défilement reste toujours là : la page ne bouge plus d'un onglet à l'autre ---------- */
html { overflow-y: scroll; }

/* ---------- Atelier : attente du serveur (fusion jamais tentée, sans promesse de Discovery) ---------- */
.forge.attente-ia .slot:not(.result) .slot-box .card { animation: tourbillon 1.6s ease-in-out infinite; }
.forge.attente-ia .slot:first-child .slot-box .card { --dx: 34%; }
.forge.attente-ia .slot:nth-child(3) .slot-box .card { --dx: -34%; animation-delay: -.8s; }
.forge.attente-ia .result-box { position: relative; overflow: hidden; }
.forge.attente-ia .result-box::after {
  content: ""; position: absolute; inset: 18%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(196, 181, 253, .9), rgba(253, 230, 138, .9), transparent 70%);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%); mask: radial-gradient(circle, transparent 42%, #000 44%);
  animation: dfxSpin 1s linear infinite;
}
@keyframes tourbillon {
  0%, 100% { transform: translateX(0) rotate(0) scale(1); filter: brightness(1); }
  50% { transform: translateX(var(--dx)) rotate(calc(var(--dx) / 6 * 1deg)) scale(.92); filter: brightness(1.35) drop-shadow(0 0 14px rgba(196, 181, 253, .8)); }
}

/* ---------- Profils et avatars ---------- */
.player { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 4px 6px; border-radius: 999px; }
.player:hover { background: rgba(255, 255, 255, .06); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--surface-2, #2a2140); font-weight: 900; flex: none; border: 2px solid rgba(253, 230, 138, .55); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.mini { width: 28px; height: 28px; font-size: .85rem; }
.avatar.grand { width: 84px; height: 84px; font-size: 2rem; border-width: 3px; box-shadow: 0 0 22px rgba(253, 230, 138, .3); }
.profil-tete { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.profil-tete h2 { margin: 0 0 4px; }
.profil-tete p { margin: 0; }
.profil-favs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.profil-stats { margin: 6px 0 4px; }
.avatar-choix { max-height: 55vh; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.classement li[data-action] { cursor: pointer; }
.classement li[data-action]:hover { background: rgba(255, 255, 255, .04); }
.fil a { color: inherit; font-weight: 800; text-decoration: none; border-bottom: 1px dotted currentColor; }
.filtre-amis { display: flex; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
@media (max-width: 700px) {
  .player { display: inline-flex; }
  .player .nom { display: none; }
}

/* ---------- Défi de la semaine ---------- */
.defi-semaine { border: 1px solid rgba(253, 230, 138, .45); background: linear-gradient(135deg, rgba(253, 230, 138, .08), rgba(167, 139, 250, .06)); }
.defi-semaine h3 { margin: 4px 0 0; }
.defi-cartes { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.defi-carte { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; text-align: center; }
.defi-carte .card { width: 100%; }
.defi-carte small, .defi-carte > span { font-size: .78rem; color: var(--muted); }
.defi-carte.trouvee > span { color: var(--ok, #6ee7b7); font-weight: 800; }
.defi-carte .card.unknown .card-name { font-size: .78rem; letter-spacing: .02em; }
.chaine-fleche { font-size: 1.4rem; color: #c4b5fd; }
.defi-teaser { display: block; margin: 16px 0 6px; color: inherit; text-decoration: none; }
.defi-teaser:hover { border-color: rgba(253, 230, 138, .6); }

/* ---------- Versions : la rareté se voit sur le cadre ---------- */
/* Épique : un halo violet qui respire ; Légendaire : reflet holographique plus présent et lueur dorée. */
.card.rar-epique .card-in { box-shadow: 0 0 0 1px rgba(167, 139, 250, .5), 0 0 18px rgba(139, 92, 246, .45), var(--shadow); }
.card.rar-legendaire .card-in { box-shadow: 0 0 0 1px rgba(255, 215, 128, .7), 0 0 26px rgba(255, 195, 113, .55), var(--shadow); }
.card.rar-legendaire .card-art::after { opacity: .55; }
.card.rar-legendaire .card-sub span:last-child { color: #fde68a; font-weight: 900; }
.niveau-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: rgba(255, 255, 255, .08); color: var(--muted); }
.rar-pill.epuisee { opacity: .45; text-decoration: line-through; }
.versions-monde { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.copies li.rar-peu_commune .serial { color: #5b9bd5; }
.copies li.rar-rare .serial { color: #c9971c; }
.copies li.rar-epique .serial { color: #a78bfa; }
.copies li.rar-legendaire .serial { color: #fde68a; }

/* Atelier : chances du résultat et alerte de mise */
.chances { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: -2px auto 12px; max-width: 720px; font-size: .85rem; }
.chances .rar-pill { font-size: .78rem; }
.chances a { text-decoration: none; font-weight: 900; padding: 0 6px; }
.mise-alerte { flex-basis: 100%; text-align: center; padding: 8px 12px; border-radius: 10px; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .45); font-weight: 700; }
.notice.mise-alerte { text-align: left; margin: 10px 0; }

/* Résultat : bandeau de célébration d'une version rare */
.version-obtenue { margin: 12px auto 6px; max-width: 340px; padding: 10px 14px; border-radius: 12px; text-align: center; animation: versionIn .6s ease-out; }
.version-obtenue b { display: block; font-size: 1.15rem; }
.version-obtenue small { opacity: .85; }
.version-obtenue.rar-peu_commune { background: rgba(91, 155, 213, .16); border: 1px solid #8dbbe6; }
.version-obtenue.rar-rare { background: rgba(246, 215, 122, .16); border: 1px solid #e5b93a; }
.version-obtenue.rar-epique { background: rgba(167, 139, 250, .2); border: 1px solid #a78bfa; box-shadow: 0 0 24px rgba(139, 92, 246, .4); }
.version-obtenue.rar-legendaire { color: #fff; background: linear-gradient(90deg, #ff5f6d, #ffc371, #4ade80, #818cf8); background-size: 300% 100%; animation: versionIn .6s ease-out, holo 4s linear infinite; box-shadow: 0 0 34px rgba(255, 195, 113, .6); }
@keyframes versionIn { from { opacity: 0; transform: scale(.8); } }

/* Booster : une Épique ou une Légendaire qui se retourne éclate de lumière */
.flip.eclat-epique .flip-inner, .flip.eclat-legendaire .flip-inner { animation: eclatVersion 1.2s ease-out; }
.flip.eclat-epique { filter: drop-shadow(0 0 18px rgba(139, 92, 246, .8)); }
.flip.eclat-legendaire { filter: drop-shadow(0 0 26px rgba(255, 195, 113, .9)); }
@keyframes eclatVersion { 0% { filter: brightness(2.2); } 100% { filter: brightness(1); } }

/* Fil du monde : les versions rares obtenues ressortent */
.fil li.rar-legendaire { background: linear-gradient(90deg, rgba(255, 195, 113, .12), transparent); }
.fil li.rar-epique { background: linear-gradient(90deg, rgba(139, 92, 246, .12), transparent); }

/* ---------- Badges et récap de la semaine ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.badge-souvenir { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: linear-gradient(135deg, rgba(253, 230, 138, .14), rgba(167, 139, 250, .12)); border: 1px solid rgba(253, 230, 138, .35); }
.badge-souvenir b { font-size: 1rem; }
.recap { text-align: center; }
.recap h2 { margin: 4px 0 12px; }
.recap-rang { display: inline-flex; align-items: baseline; gap: 8px; font-size: 2rem; }
.recap-rang b { font-size: 2.6rem; font-family: var(--font-title); }
.recap-rang span { font-size: .95rem; color: var(--muted); }
.recap-points { font-size: 1.1rem; margin: 6px 0; }
.recap-points b { font-size: 1.6rem; color: #fde68a; }
.recap-detail { list-style: none; padding: 0; margin: 8px auto 14px; max-width: 320px; text-align: left; }
.recap-detail li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.recap .badges { justify-content: center; }

/* ---------- Application installable ---------- */
.install-app { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px auto; max-width: 560px;
  padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(236, 72, 153, .1)); border: 1px solid rgba(167, 139, 250, .4); font-size: .92rem; text-align: left; }
.install-actions { display: flex; gap: 6px; }

/* ---------- Téléphone : rien ne dépasse de l'écran ---------- */
html, body { overflow-x: clip; }
@media (max-width: 720px) {
  .local-pill, #soundBtn, .booster-pill small { display: none; }
  .topbar-inner { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .booster-pill { padding: 5px 10px; }
  .modal-backdrop { padding: 10px; }
  .modal { padding: 18px 16px; border-radius: 18px; max-height: calc(100dvh - 20px); }
  .modal h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1 1 auto; }
  .detail dl { grid-template-columns: 1fr; gap: 0; }
  .detail dt { margin-top: 8px; }
  .chances { font-size: .8rem; }
  .profil-tete { gap: 12px; }
  .avatar.grand { width: 64px; height: 64px; }
}
@media (max-width: 720px) {
  .subtabs { flex-wrap: wrap; overflow-x: visible; }
  .subtab { font-size: .85rem; padding: 6px 10px; }
}

/* ---------- Accueil (joueur sans partie) ---------- */
body.avec-accueil { overflow: hidden; }
.accueil { position: fixed; inset: 0; z-index: 45; display: grid; grid-template-columns: 1.15fr .85fr; background: #0d0a17; color: #f3eaff; overflow-y: auto; }
.accueil-gauche { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 48px 0 48px 7vw; overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, .28), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(236, 72, 153, .16), transparent 60%), #120b20; }
.accueil-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-size: 1.3rem; }
.accueil-logo svg { width: 46px; height: 28px; }
.accueil-cartes { margin: 18px 0 10px -7vw; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.accueil-bande { display: flex; gap: 16px; width: max-content; animation: defilement 60s linear infinite; padding: 10px 0; }
.accueil-bande .card { width: 150px; flex: none; }
@keyframes defilement { to { transform: translateX(-50%); } }
.accueil h1 { font-family: var(--font-title); font-size: clamp(1.9rem, 3.4vw, 3.1rem); line-height: 1.08; margin: 10px 7vw 0 0; letter-spacing: -.01em; }
.accueil h1 span { background: linear-gradient(90deg, #c4b5fd, #f9a8d4, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accueil-gauche p { max-width: 540px; margin: 0 7vw 0 0; color: #cfc3e8; font-size: 1.05rem; line-height: 1.55; }
.accueil-gauche small { color: #8f84a8; }
.accueil-droite { display: grid; place-items: center; padding: 40px 24px; background: #0d0a17; border-left: 1px solid rgba(255, 255, 255, .06); }
.accueil-form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; }
.accueil-form h2 { margin: 0; font-size: 1.6rem; }
.accueil-form p { margin: 0 0 14px; }
.accueil-form label { font-weight: 800; margin-top: 4px; }
.accueil-form .input { width: 100%; padding: 14px 16px; font-size: 1.05rem; }
.accueil-form .btn.big { width: 100%; margin-top: 6px; padding: 14px; }
.accueil-form small { margin-top: 6px; line-height: 1.4; }
@media (max-width: 860px) {
  .accueil { grid-template-columns: 1fr; align-content: start; }
  .accueil-gauche { padding: 28px 20px 8px; gap: 12px; }
  .accueil-cartes { margin: 8px -20px 4px; }
  .accueil-bande .card { width: 118px; }
  .accueil h1 { margin: 4px 0 0; font-size: 1.75rem; }
  .accueil-gauche p { margin: 0; font-size: .95rem; }
  .accueil-droite { padding: 18px 20px 40px; border-left: 0; place-items: start center; }
}

/* ======================================================================
   Refonte de l'affichage : ordinateur plus aéré, téléphone plus net.
   ====================================================================== */

/* ---------- Ordinateur : on profite de la place ---------- */
main { max-width: 1240px; padding-left: 24px; padding-right: 24px; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.flip { width: 170px; }
.reveal-row { gap: 18px; }
@media (min-width: 1100px) {
  .reveal-row .flip { width: 190px; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ---------- Fenêtres : bouton ✕ toujours accessible ---------- */
.modal { position: relative; }
.modal-x { position: sticky; top: 0; float: right; margin: -8px -8px 0 8px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 1rem; cursor: pointer; }

/* ---------- Fiche d'une carte ---------- */
.fiche { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: start; }
.fiche-carte .card { --w: 200px; width: 100%; }
.fiche-infos h2 { margin: 0 0 4px; }
.fiche-infos > p.muted { margin: 0 0 10px; }
.fiche-puces { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fiche-ligne { margin: 6px 0; font-size: .93rem; }
.fiche-bloc { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.fiche-bloc small { text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; font-weight: 800; }
.exemplaires { display: flex; flex-wrap: wrap; gap: 6px; }
.exemplaire { padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line); }
.exemplaire.collector { border-color: rgba(253, 230, 138, .6); }
.exemplaire.rar-peu_commune { border-color: #8dbbe6; color: #8dbbe6; }
.exemplaire.rar-rare { border-color: #e5b93a; color: #e5b93a; }
.exemplaire.rar-epique { border-color: #a78bfa; color: #c4b5fd; }
.exemplaire.rar-legendaire { color: #fff; border-color: transparent; background: linear-gradient(90deg, #ff5f6d, #ffc371, #4ade80, #818cf8); }
.fiche-wiki { font-size: .85rem; }

/* ---------- Profil ---------- */
.profil-page .profil-tete { display: flex; align-items: center; gap: 18px; padding: 18px; }
.avatar-btn { position: relative; background: none; border: 0; padding: 0; cursor: pointer; }
.avatar-btn small { position: absolute; right: -2px; bottom: -2px; background: var(--surface-2); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-size: .75rem; border: 1px solid var(--line); }
.profil-id h2 { margin: 0 0 6px; overflow-wrap: anywhere; }
.profil-chiffres { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .92rem; }
.profil-chiffres b { color: var(--ink); }
.journal summary { cursor: pointer; }
.journal .timeline { margin-top: 10px; }
.timeline li .vignette { flex: none; width: 40px; height: 54px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.timeline li .vignette img { width: 100%; height: 100%; object-fit: cover; }
.reglages .settings-row { flex-wrap: wrap; }

/* ---------- Classement ---------- */
.defi-teaser { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 16px; padding: 14px 16px; text-decoration: none; color: inherit;
  border: 1px solid rgba(253, 230, 138, .4); background: linear-gradient(135deg, rgba(253, 230, 138, .08), rgba(167, 139, 250, .06)); }
.defi-teaser b { font-size: 1.1rem; }

/* ---------- Téléphone ---------- */
@media (max-width: 720px) {
  main { padding: 14px 14px 100px; }
  h2 { font-size: 1.35rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  /* Booster : de grandes cartes, deux par ligne. */
  .reveal-row { gap: 12px; }
  .reveal-row .flip, .flip { width: calc(50% - 8px); max-width: 190px; }
  /* Fenêtres : un panneau qui monte du bas, la barre d'onglets reste visible. */
  .modal-backdrop { bottom: calc(60px + env(safe-area-inset-bottom)); padding: 0; place-items: end stretch; }
  .modal { width: 100%; max-height: calc(100dvh - 120px); border-radius: 20px 20px 0 0; padding: 16px 16px 20px; animation: monteDuBas .25s ease-out; }
  @keyframes monteDuBas { from { transform: translateY(40px); opacity: 0; } }
  .fiche { grid-template-columns: 1fr; gap: 12px; }
  .fiche-carte { display: flex; justify-content: center; }
  .fiche-carte .card { width: 58vw; max-width: 230px; }
  .fiche-infos h2 { text-align: center; }
  .fiche-infos > p.muted { text-align: center; }
  .fiche-puces { justify-content: center; }
  .modal-actions { position: sticky; bottom: -20px; background: var(--surface); padding: 10px 0 4px; margin-top: 10px; }
  .reveal .card { --w: 62vw; max-width: 240px; margin: 0 auto; }
  .profil-page .profil-tete { padding: 14px; gap: 14px; }
  .forge { padding: 14px 8px; }
  .shop { flex-direction: column; }
  .accueil { z-index: 70; }
}
@media (max-width: 720px) {
  .modal-backdrop { inset: 0 0 auto 0; height: calc(100dvh - var(--hauteur-onglets, 70px)); }
}

/* ---------- Ouverture d'un booster : une grande carte à la fois ---------- */
.ouverture { display: flex; flex-direction: column; align-items: center; }
.pile { position: relative; width: min(74vw, 320px); aspect-ratio: 5 / 7; margin: 18px auto 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pile .flip.grande { position: absolute; inset: 0; width: 100%; max-width: none; animation: arriveeCarte .35s cubic-bezier(.2, .8, .3, 1.1); }
.pile .flip.grande .card { --w: 100%; width: 100%; }
.pile-dos { position: absolute; inset: 0; transform: translate(calc(var(--k) * 6px), calc(var(--k) * 6px)) rotate(calc(var(--k) * 1.5deg)); opacity: calc(1 - var(--k) * .22); }
.pile-dos .card-back, .pile .card-back { width: 100%; height: 100%; }
@keyframes arriveeCarte { from { transform: translateX(40px) rotate(4deg); opacity: 0; } }
.compteur { margin: 10px 0 4px; color: var(--muted); font-size: .95rem; }
.compteur b { color: var(--ink); }
/* Récapitulatif : une vraie grille, lisible sur téléphone */
.reveal-row { display: grid; grid-template-columns: repeat(5, minmax(0, 190px)); justify-content: center; gap: 16px; width: 100%; }
.recap-carte .card { width: 100%; }
@media (max-width: 720px) {
  .reveal-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .reveal-row .recap-carte:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
}

/* ---------- Ordinateur : menu latéral et tout l'écran utilisé ---------- */
@media (min-width: 1024px) {
  :root { --menu: 236px; }
  body { padding-left: var(--menu); }
  .topbar { background: var(--bg); }
  .topbar-inner { max-width: none; padding: 12px 32px; }
  /* Le logo s'installe en haut du menu. */
  .brand { position: fixed; top: 0; left: 0; width: var(--menu); height: 74px; padding: 0 22px; z-index: 26; display: flex; align-items: center; }
  .brand span.name { display: inline; font-size: 1.15rem; }
  .tabs {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--menu); max-width: none; margin: 0; z-index: 25;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 86px 14px 24px;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .tab { width: 100%; justify-content: flex-start; gap: 12px; padding: 12px 16px; border-radius: 12px; border-bottom: 0; font-size: 1rem; }
  .tab .ico { font-size: 1.3rem; width: 26px; text-align: center; }
  .tab[aria-current="page"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
  .tab[data-badge]:not([data-badge=""])::after { right: 12px; left: auto; top: 50%; transform: translateY(-50%); }
  main { max-width: none; margin: 0; padding: 28px 40px 56px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}
@media (min-width: 1600px) {
  main { padding: 32px 56px 64px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ---------- Page Classement ---------- */
.classement-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px; border-radius: 20px; color: #fff;
  background: radial-gradient(ellipse at 15% 0%, rgba(253, 230, 138, .35), transparent 55%), linear-gradient(120deg, #4c1d95, #7c3aed 45%, #db2777); box-shadow: 0 12px 34px rgba(124, 58, 237, .3); }
.classement-hero small { letter-spacing: .12em; font-weight: 800; opacity: .8; font-size: .72rem; }
.classement-hero h2 { margin: 2px 0; font-size: 2rem; color: #fff; }
.classement-hero span { opacity: .85; font-size: .9rem; }
.hero-defi { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; border: 1px solid rgba(255, 255, 255, .25); }
.hero-defi:hover { background: rgba(255, 255, 255, .22); }
.classement-grille { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; margin: 14px 0 10px; }
.podium-place { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; text-align: center; min-width: 0; }
.podium-avatar { width: 64px; height: 64px; font-size: 1.5rem; }
.podium-place.p1 .podium-avatar { width: 84px; height: 84px; border-color: #fde68a; box-shadow: 0 0 24px rgba(253, 230, 138, .5); }
.podium-medaille { font-size: 1.4rem; margin-top: -16px; }
.podium-pseudo { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-weight: 900; font-size: 1.1rem; }
.podium-score small { font-weight: 700; color: var(--muted); font-size: .75rem; }
.podium-socle { width: 100%; margin-top: 6px; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font-family: var(--font-title); font-size: 1.6rem; color: rgba(255, 255, 255, .9);
  background: linear-gradient(180deg, #a78bfa, #6d28d9); }
.podium-place.p1 .podium-socle { height: 96px; background: linear-gradient(180deg, #fde68a, #d97706); }
.podium-place.p2 .podium-socle { height: 70px; background: linear-gradient(180deg, #e5e7eb, #9ca3af); }
.podium-place.p3 .podium-socle { height: 52px; background: linear-gradient(180deg, #fdba74, #c2410c); }
.podium-place.moi .podium-pseudo { color: var(--accent); }
.classement li { grid-template-columns: 34px 34px 1fr auto auto; }
.classement .val small { color: var(--muted); font-weight: 700; }
.cl-recompense { font-size: .78rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.bareme { position: sticky; top: 90px; }
.bareme h3 { margin: 0 0 10px; }
.bareme ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bareme li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; font-size: .92rem; }
.bareme li b { font-family: var(--font-title); color: var(--accent); }
.bareme-ico { font-size: 1.15rem; }
.bareme-titre { margin: 14px 0 8px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bareme-versions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bareme-versions .rar-pill { display: flex; justify-content: space-between; gap: 6px; }
.bareme-recompenses li { grid-template-columns: 1fr auto; }
@media (max-width: 1100px) {
  .classement-grille { grid-template-columns: 1fr; }
  .bareme { position: static; }
}
@media (max-width: 720px) {
  .classement-hero { padding: 18px; border-radius: 16px; }
  .classement-hero h2 { font-size: 1.6rem; }
  .podium-avatar { width: 52px; height: 52px; }
  .podium-place.p1 .podium-avatar { width: 66px; height: 66px; }
  .podium-place.p1 .podium-socle { height: 70px; }
  .podium-place.p2 .podium-socle { height: 50px; }
  .podium-place.p3 .podium-socle { height: 38px; }
  .classement li { grid-template-columns: 26px 30px 1fr auto; }
  .classement li .cl-recompense { display: none; }
}
@media (min-width: 1024px) {
  /* Le flou du bandeau crée un repère pour les éléments « fixes » : sans lui, le menu se place bien à gauche. */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.podium-place.p1 { grid-column: 2; grid-row: 1; }
.podium-place.p2 { grid-column: 1; grid-row: 1; }
.podium-place.p3 { grid-column: 3; grid-row: 1; }
.bareme-versions { grid-template-columns: 1fr; }

/* ---------- Noms longs : deux lignes ---------- */
.card-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.card-name.long { font-size: 9.5cqw; }

/* ---------- Bandeau défilant sous le booster ---------- */
.bandeau-infos { width: min(680px, 100%); margin: 6px auto 10px; overflow: hidden; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.bandeau-piste { display: flex; width: max-content; animation: defilement 32s linear infinite; }
.bandeau-piste span { padding: 9px 26px; white-space: nowrap; font-weight: 800; font-size: .9rem; }
.bandeau-piste span:nth-child(odd) { color: var(--accent); }

/* ---------- Défi de la semaine : frise d'étapes ---------- */
.defi-etapes { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.etape { flex: 1 0 92px; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; scroll-snap-align: start; position: relative; }
.defi-etapes.chaine .etape:not(:last-child)::after { content: ""; position: absolute; top: 46px; left: calc(50% + 46px); width: calc(100% - 82px); height: 3px; border-radius: 3px; background: var(--line); }
.defi-etapes.chaine .etape.trouvee:not(:last-child)::after { background: var(--ok, #34d399); }
.etape-visuel { position: relative; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; overflow: hidden;
  background: var(--surface-2); border: 3px dashed var(--line); }
.etape.trouvee .etape-visuel { border: 3px solid var(--ok, #34d399); cursor: pointer; }
.etape-visuel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.etape-num { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: var(--accent); color: #fff; }
.etape-nom { font-weight: 800; font-size: .9rem; line-height: 1.15; }
.etape small { color: var(--muted); font-weight: 700; }
.etape.trouvee small { color: var(--ok, #34d399); }
@media (max-width: 720px) {
  .etape { flex-basis: 78px; }
  .etape-visuel { width: 74px; height: 74px; font-size: 1.8rem; }
  .defi-etapes.chaine .etape:not(:last-child)::after { top: 37px; left: calc(50% + 38px); width: calc(100% - 66px); }
}

/* ---------- Marché ---------- */
.marche-tete { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.marche-tete p { margin: 4px 0 0; max-width: 560px; }
.marche-solde { display: flex; flex-direction: column; align-items: flex-end; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.marche-solde b { font-size: 1.3rem; }
.marche-filtres { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.marche-filtres input { width: 100%; max-width: 420px; }
.marche-filtres .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.marche-filtres .chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.marche-filtres .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.marche-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.marche-grille .empty { grid-column: 1 / -1; }
.annonce { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.annonce-prix { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.annonce-prix b { font-size: 1.1rem; }
.annonce-prix small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.annonce .btn { width: 100%; justify-content: center; }
.vente-prix { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.vente-prix input { font-size: 1.2rem; font-weight: 800; max-width: 200px; }
button.exemplaire { cursor: pointer; font: inherit; }
button.exemplaire[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
  .marche-grille { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ---------- Boutique d'éclats ---------- */
.packs-eclats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0 16px; max-width: 720px; }
.pack-eclats { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.pack-eclats.top { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pack-gemme { font-size: 1.8rem; letter-spacing: -6px; min-height: 2.2rem; }
.pack-eclats b { font-size: 1.05rem; }
.pack-eclats .btn { width: 100%; justify-content: center; }
.pack-bonus { position: absolute; top: -10px; right: 10px; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 800; }
.boutique-regles { margin: 0 0 10px; padding-left: 18px; line-height: 1.6; max-width: 720px; }
label.case { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; line-height: 1.4; cursor: pointer; }
label.case input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
@media (max-width: 720px) { .packs-eclats { gap: 8px; } .pack-eclats { padding: 18px 6px 10px; } .pack-gemme { font-size: 1.4rem; } .pack-eclats b { font-size: .9rem; } }

/* ---------- Ordinateur : les 5 cartes du booster côte à côte ---------- */
.reveal-row.cote-a-cote .flip { width: 100%; max-width: none; }
.reveal-row.cote-a-cote .flip .card { width: 100%; }

/* ---------- Fiche : parcourir ses exemplaires ---------- */
.fiche-carte { position: relative; touch-action: pan-y; user-select: none; }
.fiche-vue { width: 100%; display: flex; justify-content: center; animation: ficheVue .25s ease-out; }
@keyframes ficheVue { from { opacity: .3; transform: scale(.97); } }
.fiche-fleche { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.fiche-fleche.gauche { left: -6px; }
.fiche-fleche.droite { right: -6px; }
.fiche-fleche:hover { border-color: var(--accent); }

/* Défi de la semaine : les numéros d'étape débordent du rond (ils étaient coupés) */
.etape-visuel { overflow: visible; }
.etape-visuel img { border-radius: 50%; }
.etape-num { top: -4px; left: -4px; box-shadow: 0 0 0 3px var(--bg); z-index: 1; }

/* ---------- Profil : sections bien séparées, badges en catalogue ---------- */
.profil-page > h3 { margin: 34px 0 12px; }
.profil-page > .panel + h3, .profil-page > .card-grid + h3 { margin-top: 38px; }
.succes-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.succes { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 16px; text-align: center;
  background: var(--surface); border: 1px dashed var(--line); color: var(--muted); }
.succes-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; background: var(--surface-2); }
.succes b { font-size: .92rem; }
.succes small { font-size: .78rem; line-height: 1.3; }
.succes.obtenu { border-style: solid; color: var(--ink); }
.succes.obtenu .succes-ico { background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold, #e5b93a) 70%); color: #3b2a00; box-shadow: 0 0 14px rgba(229, 185, 58, .35); }
.succes.obtenu small { color: var(--muted); }
@media (max-width: 720px) { .succes-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =====================================================================
   Atelier : l'autel de fusion
   Ordinateur : l'autel à gauche (toujours visible), vos cartes à droite.
   Téléphone : une seule ligne [A] + [B] = [?], collée en haut de l'écran.
   ===================================================================== */
.atelier-grille { display: block; }
.autel .forge-actions { margin-bottom: 18px; }

@media (min-width: 1024px) {
  .atelier-grille { display: grid; grid-template-columns: minmax(420px, 5fr) 6fr; gap: 28px; align-items: start; }
  .autel { position: sticky; top: 92px; }
  .autel .forge {
    max-width: none; margin: 0; padding: 34px 28px 30px; border-radius: 28px;
    grid-template-columns: 1fr auto 1fr; grid-template-areas: "a plus b" "flux flux flux" "res res res"; row-gap: 0;
    min-height: min(640px, calc(100vh - 230px)); align-content: center; overflow: hidden;
  }
  .autel .forge > .slot:nth-child(1) { grid-area: a; }
  .autel .forge > .op:not(.eq) { grid-area: plus; }
  .autel .forge > .slot:nth-child(3) { grid-area: b; }
  .autel .forge > .slot.result { grid-area: res; }
  .autel .forge .slot-box { max-width: 170px; width: 100%; }
  .autel .forge .slot.result .slot-box { max-width: 210px; }
  /* Le « = » devient un flux d'énergie qui descend vers le résultat */
  .autel .forge > .op.eq { grid-area: flux; justify-self: center; position: relative; width: 120px; height: 64px; font-size: 0; transform: none; }
  .autel .forge > .op.eq::before, .autel .forge > .op.eq::after {
    content: ""; position: absolute; top: 0; width: 3px; height: 100%; border-radius: 3px;
    background: linear-gradient(180deg, transparent, #c4b5fd 40%, #fde68a); background-size: 100% 200%; animation: fluxEnergie 1.4s linear infinite;
    box-shadow: 0 0 12px rgba(196, 181, 253, .8);
  }
  .autel .forge > .op.eq::before { left: 22%; transform: skewX(28deg); }
  .autel .forge > .op.eq::after { right: 22%; transform: skewX(-28deg); }
  /* Portail qui tourne derrière le résultat */
  .autel .forge::before {
    left: 50%; top: auto; bottom: 30px; width: 360px; height: 360px; margin: 0 0 -60px -180px; border: 0; opacity: .9;
    background: conic-gradient(from 0deg, transparent, rgba(167, 139, 250, .35), transparent 30%, rgba(246, 196, 83, .3), transparent 60%, rgba(236, 72, 153, .3), transparent 85%);
    -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%, #000 70%, transparent 71%); mask: radial-gradient(circle, transparent 52%, #000 53%, #000 70%, transparent 71%);
    animation: dfxSpin 14s linear infinite;
  }
  .autel .forge::after {
    content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
    background-image: radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.5), transparent), radial-gradient(2px 2px at 70% 20%, rgba(196,181,253,.6), transparent),
      radial-gradient(1.5px 1.5px at 40% 70%, rgba(253,230,138,.6), transparent), radial-gradient(1.5px 1.5px at 85% 60%, rgba(255,255,255,.4), transparent),
      radial-gradient(2px 2px at 12% 80%, rgba(236,72,153,.5), transparent), radial-gradient(1.5px 1.5px at 60% 45%, rgba(255,255,255,.35), transparent);
    animation: poussiere 9s ease-in-out infinite alternate;
  }
  .autel .forge-status { margin-top: 18px; }
  .atelier-cartes .picker-grid { max-height: none; }
}
@keyframes fluxEnergie { from { background-position: 0 100%; } to { background-position: 0 -100%; } }
@keyframes poussiere { to { transform: translateY(-14px); opacity: .7; } }

@media (max-width: 1023px) {
  /* Une ligne : A + B = ?, collée sous la barre du haut */
  .autel { position: sticky; top: 52px; z-index: 6; background: var(--bg); padding: 6px 0 2px; margin: 0 -4px; }
  .autel .forge { grid-template-columns: 1fr auto 1fr auto 1fr; row-gap: 0; column-gap: 6px; padding: 12px 10px 10px; border-radius: 18px; max-width: 560px; }
  .autel .forge .op { font-size: 1.3rem; }
  .autel .forge .op.eq { grid-column: auto; transform: none; font-size: 1.3rem; }
  .autel .forge .slot.result { grid-column: auto; }
  .autel .forge .slot-box, .autel .forge .slot.result .slot-box { max-width: 112px; width: 100%; font-size: .72rem; }
  .autel .forge .slot.result .slot-box { font-size: 1.8rem; }
  .autel .forge .slot select { max-width: 112px; font-size: .7rem; padding: 3px 4px; }
  .autel .forge .slot-info { min-height: 0; font-size: .7rem; }
  .autel .forge::before { width: 170px; height: 170px; margin: -85px 0 0 -85px; }
  .autel .forge-status { margin: 8px 0 6px; font-size: .9rem; }
  .autel .forge-actions { margin-bottom: 10px; }
}

/* Atelier téléphone : l'autel passe au-dessus des compteurs des cartes */
@media (max-width: 1023px) { .autel { z-index: 15; } }

/* ---------- Menu latéral (ordinateur) : l'icône dans une pastille qui s'allume ---------- */
@media (min-width: 1024px) {
  .tab { padding: 8px 12px; gap: 14px; font-weight: 700; transition: background .2s, color .2s; }
  .tab .ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); transition: background .25s, box-shadow .25s, transform .25s; }
  .tab:hover { background: transparent; color: var(--ink); }
  .tab:hover .ico { transform: translateY(-1px); }
  .tab[aria-current="page"] { background: transparent; box-shadow: none; color: var(--ink); font-weight: 900; }
  .tab[aria-current="page"] .ico {
    background: linear-gradient(145deg, #a78bfa, #7c3aed 60%, #ec4899);
    box-shadow: 0 6px 18px rgba(124, 58, 237, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
  }
}

/* ---------- Marché : recherche et filtres aérés ---------- */
.marche-filtres { gap: 12px; }
.marche-filtres .input { width: 100%; max-width: 420px; }
.marche-filtres .chips { gap: 8px; row-gap: 8px; }
.marche-filtres .chip { padding: 7px 14px; font-size: .88rem; white-space: nowrap; }
@media (max-width: 720px) {
  .marche-filtres .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .marche-filtres .chips::-webkit-scrollbar { display: none; }
  .marche-tete { flex-direction: column; gap: 10px; }
  .marche-solde { flex-direction: row; align-items: baseline; gap: 10px; align-self: stretch; justify-content: space-between; }
}
@media (max-width: 720px) {
  .succes-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .succes { padding: 10px 6px; }
  .succes-ico { width: 42px; height: 42px; font-size: 1.3rem; }
  .succes b { font-size: .8rem; }
  .succes small { font-size: .7rem; }
  .succes:not(.obtenu) b { display: none; }
}

/* ---------- Bas de carte : sigle d'édition ---------- */
.card-sub .sigle { display: inline-block; margin-right: 1.6cqw; padding: 0 1.4cqw; border-radius: 1.4cqw; font-size: .85em; line-height: 1.35;
  background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .9); letter-spacing: .02em; }

/* ---------- Résultat d'une fusion : titre bien centré malgré la croix de fermeture ---------- */
.reveal .burst { padding: 0 44px; }
.founder-cert { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.founder-cert small { font-weight: 600; opacity: .8; }
/* Rayons du spectacle : toujours découpés en cercle (aucun carré visible, quel que soit le navigateur) */
.dfx-rays { clip-path: circle(50%); }

/* ---------- Profil : marge avant le journal ---------- */
.profil-page .succes-grille { margin-bottom: 34px; }
.profil-page .journal { margin-top: 0; }

/* ---------- Fiche : la ligne d'origine ne change jamais la hauteur de la fenêtre ---------- */
.fiche-bloc small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Atelier (ordinateur) : vos cartes défilent dans leur colonne, la page reste en place ---------- */
@media (min-width: 1024px) {
  .atelier-cartes { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; }
}

/* Bas de carte trop long (ex. « ■ Peu commune S1 #1/1000 ») : texte un peu plus petit, jamais coupé hors de la carte */
.card-sub.dense { font-size: 5.6cqw; gap: 1.5cqw; }
.card-sub .rar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-sub .card-num { flex: none; }

/* =====================================================================
   Atelier (ordinateur) : tout tient dans l'écran, sans faire défiler la page.
   L'autel s'adapte à la hauteur de la fenêtre ; seules vos cartes défilent, dans leur colonne.
   ===================================================================== */
@media (min-width: 1024px) {
  main:has(.atelier-page) { padding-top: 20px; padding-bottom: 12px; }
  .atelier-page > h2 { display: none; }
  .atelier-grille { height: calc(100vh - 106px); min-height: 520px; align-items: stretch; }
  .autel { position: static; display: flex; flex-direction: column; height: 100%; min-height: 0; }
  .autel .forge { flex: 1; min-height: 0; padding: 18px 20px; }
  .autel .forge .slot-box { max-width: min(150px, 17vh); }
  .autel .forge .slot.result .slot-box { max-width: min(190px, 24vh); }
  .autel .forge .slot select { max-width: min(150px, 17vh); }
  .autel .forge > .op.eq { height: min(52px, 5vh); }
  .autel .forge::before { width: min(340px, 40vh); height: min(340px, 40vh); margin: 0 0 calc(min(340px, 40vh) / -6) calc(min(340px, 40vh) / -2); }
  .autel .forge-status { margin: 10px 0 6px; min-height: 1.4em; }
  .autel .forge-actions { margin-bottom: 0; }
  .atelier-cartes { position: static; top: auto; max-height: none; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .atelier-cartes > .panel { margin: 0; }
}

/* Téléphone : la carte du booster un peu moins grande */
.pile { width: min(64vw, 280px); margin-top: 10px; }
/* Résultat d'une Discovery : de l'air entre la carte et le certificat */
.reveal .founder-cert { margin-top: 14px; }
/* Marché : de l'air entre le solde et les onglets */
.marche-tete { margin-bottom: 16px; }

/* ---------- Icône de booster : un petit paquet scellé ---------- */
.ico-booster { display: inline-block; width: .82em; height: 1.08em; vertical-align: -.17em; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 26'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23c4b5fd'/%3E%3Cstop offset='.5' stop-color='%237c3aed'/%3E%3Cstop offset='1' stop-color='%23ec4899'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M2 2.6 4 1l2 1.6L8 1l2 1.6L12 1l2 1.6L16 1l2 1.6v20.8L16 25l-2-1.6-2 1.6-2-1.6L8 25l-2-1.6L4 25l-2-1.6Z' fill='url(%23g)'/%3E%3Cpath d='M2 6.5h16M2 19.5h16' stroke='%23fff' stroke-opacity='.45' stroke-width='.8'/%3E%3Cpath d='M6.3 13c0-1.3 1-2.1 2.1-2.1 1.7 0 2.5 4.2 4.2 4.2 1.1 0 2.1-.8 2.1-2.1s-1-2.1-2.1-2.1c-1.7 0-2.5 4.2-4.2 4.2-1.1 0-2.1-.8-2.1-2.1Z' fill='none' stroke='%23fff' stroke-width='1.3'/%3E%3C/svg%3E") center / contain no-repeat; }
.tab .ico .ico-booster { width: 1em; height: 1.25em; vertical-align: middle; }

/* ---------- Bas de carte : même taille de texte pour toutes les versions, tout sur une ligne ---------- */
.card-sub, .card-sub.dense { font-size: 6.4cqw; gap: 2cqw; align-items: center; }
.card-sub .card-num { display: inline-flex; align-items: center; gap: 1.4cqw; line-height: 1; }
.card-sub .sigle { display: inline-flex; align-items: center; justify-content: center; margin: 0; padding: .22em .4em; font-size: .9em; line-height: 1; border-radius: .35em; }

/* ---------- Comment gagner des points : des pastilles du même style ---------- */
.bareme-liste li { grid-template-columns: 26px 1fr auto; padding: 8px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }
.bareme-liste li.rar-pill { display: grid; font-size: .92rem; }
.bareme-liste li b { white-space: nowrap; }
.bareme-ico { text-align: center; }
.bareme-note { font-size: .8rem; margin: 12px 0 0; }

/* ---------- Classement : liste complète, récompense à droite ---------- */
.classement li { grid-template-columns: 34px auto 1fr auto auto; }
.classement li .rang { font-size: 1rem; text-align: center; }
.classement li.top1 { background: linear-gradient(90deg, rgba(246, 196, 83, .14), transparent 60%); }
.classement li.top2 { background: linear-gradient(90deg, rgba(203, 213, 225, .12), transparent 60%); }
.classement li.top3 { background: linear-gradient(90deg, rgba(217, 119, 6, .12), transparent 60%); }
.cl-recompense { display: inline-flex; align-items: center; gap: 4px; margin-left: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem;
  background: color-mix(in srgb, var(--accent) 14%, transparent); white-space: nowrap; }

/* ---------- Avatar : il brille selon la version de la carte ---------- */
.avatar.av-v2 { box-shadow: 0 0 0 2px #e5b93a, 0 0 10px rgba(229, 185, 58, .5); }
.avatar.av-v3 { box-shadow: 0 0 0 2px #a78bfa, 0 0 14px rgba(139, 92, 246, .65); }
.avatar.av-v4 { position: relative; box-shadow: 0 0 16px rgba(255, 195, 113, .7); }
.avatar.av-v4::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; z-index: -1;
  background: conic-gradient(#ff5f6d, #ffc371, #4ade80, #38bdf8, #818cf8, #f472b6, #ff5f6d); animation: dfxSpin 3s linear infinite; }
.avatar.av-v4, .avatar.av-v3, .avatar.av-v2 { isolation: isolate; }

/* ---------- Bandeau Légendaire : texte bien lisible ---------- */
.version-obtenue.rar-legendaire { color: #1d1033; }
.version-obtenue.rar-legendaire small { opacity: 1; font-weight: 700; line-height: 1.45; }

/* ---------- Spectacle de naissance : plus de rectangle autour de la boule de lumière ----------
   Le halo est dessiné par un dégradé (pas d'ombre portée) et la pulsation joue sur l'opacité (plus de filtre). */
.dfx-core { box-shadow: none; }
.dfx-core::after { content: ""; position: absolute; inset: -110%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(244, 114, 182, .42) 0%, rgba(124, 58, 237, .26) 35%, transparent 68%); }
@keyframes dfxPulse { from { opacity: .88; } to { opacity: 1; } }

/* ---------- Profil : de l'air entre toutes les sections ---------- */
section.profil-page > h3 { margin-top: 40px !important; margin-bottom: 14px; }
section.profil-page > .card-grid, section.profil-page > .succes-grille { margin-bottom: 8px; }
@media (max-width: 720px) {
  .classement li { grid-template-columns: 26px 30px 1fr auto auto; gap: 8px; }
  .cl-recompense { margin-left: 2px; padding: 3px 7px; font-size: .78rem; }
}
.bareme-liste li { border-radius: 14px; }

/* ---------- Téléphone : les familles sur une seule ligne qui défile (plus de pastilles en vrac) ---------- */
@media (max-width: 720px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: none; padding: 6px 12px; font-size: .85rem; white-space: nowrap; }
  .collection-head { display: flex; align-items: center; gap: 12px; }
  .collection-head > div { flex: 1; }
}

/* Accueil (téléphone) : la bande de cartes garde toute sa hauteur, le titre passe en dessous */
.accueil-cartes { flex: none; }
.accueil-bande .card { aspect-ratio: 5 / 7; }

/* Accueil (téléphone) : rien n'est coupé, tout défile normalement */
@media (max-width: 860px) {
  .accueil { display: block; z-index: 80; -webkit-overflow-scrolling: touch; }
  .accueil-gauche { overflow: visible; justify-content: flex-start; }
  .accueil-gauche > * { flex: none; }
  .accueil-droite { display: block; }
  .accueil-form { margin: 0 auto; }
}
.toasts { z-index: 95; }

/* Accueil (téléphone) : tout tient sur un écran */
@media (max-width: 860px) {
  .accueil-gauche { padding: 16px 20px 10px; gap: 8px; }
  .accueil-logo { font-size: 1.1rem; }
  .accueil-logo svg { width: 38px; height: 23px; }
  .accueil-cartes { margin: 2px -20px 0; }
  .accueil-bande { padding: 6px 0; gap: 12px; }
  .accueil-bande .card { width: 92px; }
  .accueil h1 { font-size: 1.55rem; margin: 2px 0 0; }
  .accueil-gauche p { font-size: .9rem; line-height: 1.45; }
  .accueil-droite { padding: 12px 20px 24px; }
  .accueil-form { gap: 8px; }
  .accueil-form h2 { font-size: 1.3rem; }
  .accueil-form p { margin: 0 0 4px; }
  .accueil-form .input { padding: 12px 14px; }
  .accueil-form .btn.big { padding: 12px; margin-top: 2px; }
  .accueil-form small { font-size: .78rem; margin-top: 2px; }
}

/* =====================================================================
   Comment gagner des points : défi en carte dégradée, puis une liste sobre et unifiée
   ===================================================================== */
.bareme-defi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; margin-bottom: 12px; border-radius: 16px; color: #fff; text-decoration: none;
  background: radial-gradient(ellipse at 15% 0%, rgba(253, 230, 138, .3), transparent 55%), linear-gradient(120deg, #4c1d95, #7c3aed 45%, #db2777); box-shadow: 0 8px 24px rgba(124, 58, 237, .28); }
.bareme-defi small { letter-spacing: .1em; font-weight: 800; opacity: .85; font-size: .68rem; }
.bareme-defi > b { font-size: 1.05rem; }
.bareme-defi-bas { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; margin-top: 4px; font-weight: 800; font-size: .85rem; }
.bareme-defi-bas .progress { background: rgba(255, 255, 255, .22); height: 6px; }
.bareme-defi-bas .progress span { background: #fff; }
.bareme-defi-bas b { font-family: var(--font-title); font-size: 1rem; }
.bareme-defi.fait { box-shadow: 0 0 0 2px #34d399, 0 8px 24px rgba(52, 211, 153, .3); }
.bareme-liste li, .bareme-liste li.rar-pill { display: grid; grid-template-columns: 26px 1fr auto; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-radius: 12px; }
.bareme-liste li small { color: var(--muted); font-weight: 700; margin-left: 4px; }
.bareme-liste li b small { font-family: var(--font-body, inherit); font-size: .72rem; }
.bareme-liste .bareme-ico { color: var(--muted); font-weight: 900; }
.bareme-liste li.fait { border-color: #34d399; background: color-mix(in srgb, #34d399 12%, var(--surface-2)); }
.bareme-liste li.fait .bareme-ico { color: #34d399; }

/* =====================================================================
   Défi de la semaine (onglet Défis) : même carte dégradée que le classement
   ===================================================================== */
.panel.defi-semaine { color: #fff; border: 0;
  background: radial-gradient(ellipse at 15% 0%, rgba(253, 230, 138, .3), transparent 55%), linear-gradient(120deg, #4c1d95, #7c3aed 45%, #db2777); box-shadow: 0 12px 34px rgba(124, 58, 237, .3); }
.panel.defi-semaine .muted, .panel.defi-semaine small { color: rgba(255, 255, 255, .82); }
.panel.defi-semaine .tag { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.panel.defi-semaine .etape-visuel { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); }
.panel.defi-semaine .etape small { color: rgba(255, 255, 255, .8); }
.panel.defi-semaine .etape.trouvee small { color: #6ee7b7; }
.panel.defi-semaine .etape-num { box-shadow: 0 0 0 3px #6d28d9; background: #fff; color: #6d28d9; }
.panel.defi-semaine .progress { background: rgba(255, 255, 255, .22); }
.panel.defi-semaine .progress span { background: #fff; }
.panel.defi-semaine.done { box-shadow: 0 0 0 2px #34d399, 0 12px 34px rgba(52, 211, 153, .3); }
.defi-etapes.chaine .etape:not(:last-child)::after { background: rgba(255, 255, 255, .3); }

/* ---------- Bandeau défilant sous le booster : du texte libre, sans pastille qui le coupe ---------- */
.bandeau-infos { border: 0; background: transparent; border-radius: 0; }
.bandeau-piste span { padding: 8px 22px; font-size: .88rem; }

/* ---------- Ouverture d'un booster : cartes centrées dans l'écran ---------- */
.booster-stage.ouverture, .booster-stage:has(.reveal-row.cote-a-cote) { min-height: calc(100dvh - 190px); justify-content: center; }
@media (max-width: 720px) { .booster-stage.ouverture { min-height: calc(100dvh - var(--hauteur-onglets, 70px) - 120px); } }

/* ---------- Atelier (téléphone) : les trois cartes alignées en haut ---------- */
@media (max-width: 1023px) {
  .autel .forge { align-items: start; }
  .autel .forge > .op { align-self: start; margin-top: calc(min(112px, (100vw - 90px) / 3) * .7 - .65em); }
}

/* =====================================================================
   Avatar : son halo dit la version de la carte choisie (pour briller au classement)
   ===================================================================== */
@property --av-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes avTour { to { --av-angle: 360deg; } }
.avatar { border: 2px solid rgba(148, 163, 184, .55); }
.avatar.av-v0 { border-color: #9ca3af; box-shadow: none; }
.avatar.av-v1 { border-color: #60a5fa; box-shadow: 0 0 8px rgba(96, 165, 250, .45); }
.avatar.av-v2 { border-color: #e5b93a; box-shadow: 0 0 10px rgba(229, 185, 58, .55); }
.avatar.av-v3 { border: 2px solid transparent; box-shadow: 0 0 14px rgba(236, 72, 153, .5), 0 0 22px rgba(139, 92, 246, .35);
  background: linear-gradient(var(--surface-2, #2a2140), var(--surface-2, #2a2140)) padding-box, conic-gradient(from var(--av-angle), #a78bfa, #f472b6, #c4b5fd, #f9a8d4, #a78bfa) border-box;
  animation: avTour 6s linear infinite; }
.avatar.av-v4 { border: 3px solid transparent; box-shadow: 0 0 16px rgba(255, 195, 113, .7), 0 0 30px rgba(129, 140, 248, .45);
  background: linear-gradient(var(--surface-2, #2a2140), var(--surface-2, #2a2140)) padding-box, conic-gradient(from var(--av-angle), #ff5f6d, #ffc371, #4ade80, #38bdf8, #818cf8, #f472b6, #ff5f6d) border-box;
  animation: avTour 2.5s linear infinite; }
.avatar.av-v4::before { content: none; }

/* =====================================================================
   Retours du 21/10 : classement, défi, atelier, tailles, thème, booster
   ===================================================================== */
/* Classement : lignes sobres, sans teinte dorée ni arrondi isolé */
.classement { padding: 0; overflow: hidden; }
.classement li.top1, .classement li.top2, .classement li.top3 { background: none; }
.classement li.moi { border-radius: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.classement li:nth-child(even) { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.classement li.moi:nth-child(even) { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cl-recompense { background: var(--surface-2); border: 1px solid var(--line); }
/* Podium : le halo de l'avatar suit sa version, même pour le 1er */
.podium-place.p1 .podium-avatar:not(.av-v1):not(.av-v2):not(.av-v3):not(.av-v4) { border-color: #9ca3af; box-shadow: none; }
.podium-place.p1 .podium-avatar.av-v4, .podium-place.p1 .podium-avatar.av-v3 { border-color: transparent; }
/* Avatars animés : rotation plus lente */
.avatar.av-v3 { animation-duration: 12s; }
.avatar.av-v4 { animation-duration: 7s; }

/* Défi de la semaine : un voile sombre adoucit le dégradé */
.panel.defi-semaine, .bareme-defi { background-image: linear-gradient(rgba(10, 6, 20, .32), rgba(10, 6, 20, .32)), radial-gradient(ellipse at 15% 0%, rgba(253, 230, 138, .22), transparent 55%), linear-gradient(120deg, #4c1d95, #7c3aed 45%, #db2777); }

/* Atelier : zone d'infos de hauteur fixe (rien ne bouge en posant les cartes) */
.autel-infos { min-height: 104px; display: flex; flex-direction: column; justify-content: flex-start; }
.autel-infos .forge-status { margin: 8px 0 6px; }
.autel-infos .chances { margin: 0 auto; }
.autel-infos .mise-alerte { padding: 5px 10px; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1023px) { .autel-infos { min-height: 112px; } }

/* Ordinateur : cartes plus petites à l'atelier et un peu plus petites dans la collection */
@media (min-width: 1024px) {
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
}

/* Indice : bouton plus discret, de l'air avant l'explication */
.indice-acheter { display: flex; margin: 14px 0 12px; }

/* Paramètres : la bannière d'installation alignée à gauche */
.reglages .install-app { margin: 0 0 12px; max-width: none; justify-content: flex-start; text-align: left; }

/* (paquet qui se remplit : retiré) */

/* Téléphone : les 5 cartes du booster tiennent dans l'écran (3 en haut, 2 en dessous), boutons sur une ligne */
@media (max-width: 720px) {
  .reveal-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; margin: 0 auto; }
  .reveal-row .recap-carte { grid-column: span 2; }
  .reveal-row .recap-carte:nth-child(4) { grid-column: 2 / span 2; }
  .reveal-row .recap-carte:last-child:nth-child(odd) { grid-column: 4 / span 2; width: auto; justify-self: stretch; }
  .booster-stage h2 { margin: 0; }
  #revealActions { flex-wrap: nowrap; gap: 8px; }
  #revealActions .btn { white-space: nowrap; padding: 10px 14px; font-size: .9rem; }
}

/* Ordinateur : « Comment gagner des points » plus large (plus de retours à la ligne), classement plus resserré */
@media (min-width: 1101px) {
  .classement-grille { grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; }
  .bareme-liste li span:nth-child(2) { white-space: nowrap; }
}
.amis-liste { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------- Amis : demandes reçues, envoyées, amis ---------- */
.amis-bloc { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.amis-bloc > small { letter-spacing: .08em; font-weight: 800; font-size: .7rem; }
.amis-panel > .amis-bloc:first-child { margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ami-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ami-ligne span { display: flex; gap: 6px; }
.chip.attente { display: inline-flex; align-items: center; gap: 8px; opacity: .85; }
.chip.attente a { text-decoration: none; color: var(--muted); }
#playerName { position: relative; }
#playerName[data-badge]:not([data-badge=""])::after { content: attr(data-badge); position: absolute; top: -4px; left: 18px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff; font-size: .7rem; font-weight: 900; display: grid; place-items: center; }
.demandes-haut { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; border-color: var(--accent); }

/* Défi de la semaine : toutes les étapes cliquables montrent la main (cartes trouvées et indices) */
.etape[data-action], .etape[data-action] * { cursor: pointer; }
.etape[data-action="indice"] .etape-visuel { transition: transform .15s, border-color .15s; }
.etape[data-action="indice"]:hover .etape-visuel { transform: translateY(-2px); border-color: #fde68a; }
.etape[data-action="indice"]:hover small { color: #fde68a; }

/* ---------- Discovery : de l'air sous le certificat ---------- */
.reveal .founder-cert { margin-bottom: 4px; }
.discovery-note { margin: 12px auto 0; max-width: 420px; line-height: 1.45; }

/* ---------- Collection › Monde : le coffre ---------- */
.coffre { margin-bottom: 18px; border-color: color-mix(in srgb, #fde68a 45%, var(--line)); }
.coffre h3 { margin: 0 0 4px; }
.coffre p { margin: 0 0 12px; font-size: .9rem; }
.coffre-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }

/* ---------- Ouverture du coffre ---------- */
.coffre-icone { font-size: 2.6rem; animation: coffreOuvre .7s cubic-bezier(.2, .8, .3, 1.4); }
@keyframes coffreOuvre { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }
.coffre-sortie { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }
.coffre-sortie > div { width: 150px; animation: coffreCarte .6s cubic-bezier(.2, .8, .3, 1.2) backwards; }
.coffre-sortie .card { width: 100%; margin: 0; }
@keyframes coffreCarte { from { transform: translateY(30px) scale(.7); opacity: 0; } }
@media (max-width: 720px) { .coffre-sortie > div { width: 110px; } }

/* ---------- Pas de curseur de texte sur les éléments cliquables (cartes, étapes) ---------- */
.card, .etape, .podium-place, .classement li, .subtab, .chip, .btn { -webkit-user-select: none; user-select: none; }

/* ---------- Fiche : versions dans le monde plus discrètes, Légendaire lisible ---------- */
.versions-monde { gap: 6px; }
.versions-monde .rar-pill { font-size: .74rem; padding: 3px 9px; background: transparent; box-shadow: none; }
.versions-monde .rar-pill.rar-legendaire { background: linear-gradient(90deg, #ff5f6d, #ffc371, #4ade80, #818cf8); color: #1d1033; font-weight: 800; }
.rar-pill.rar-legendaire { color: #1d1033; text-shadow: none; }
.fiche-coffre { align-self: center; margin-right: auto; font-size: .85rem; font-weight: 700; color: var(--muted); }

/* ---------- Défi de la semaine : titre plus grand, défilement des étapes sans barre visible ---------- */
.defi-titre { font-size: 1.35rem; }
.panel.defi-semaine .progress { margin: 4px 0 14px; }
.defi-etapes { scrollbar-width: none; padding-bottom: 6px; }
.defi-etapes::-webkit-scrollbar { display: none; }
