:root {
  --fond: #f4efe4; --fond2: #ebe3d2; --encre: #2b2418; --doux: #6e6250; --or: #c9a14a; --or-f: #8a6a22;
  --rouge: #b83b2a; --vert: #3f8a3a; --panneau: #fffaf0; --ligne: #d8ccb4;
  --ombre: 0 2px 10px rgba(60, 40, 10, .15);
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #1c1916; --fond2: #26221d; --encre: #f1e9d8; --doux: #b5a88f; --panneau: #2a251f; --ligne: #4a4134; --ombre: 0 2px 10px rgba(0,0,0,.5); --or-f: #e0b85a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: "Nunito", system-ui, sans-serif; font-size: 16px; line-height: 1.45; overflow-x: hidden; }
h1, h2, h3 { font-family: "Cinzel", Georgia, serif; margin: .4em 0 .5em; }
h2 { font-size: 1.5rem; } h3 { font-size: 1.1rem; }
a { color: var(--or-f); }
.aide { color: var(--doux); font-size: .9rem; }
.erreur { color: var(--rouge); } .ok { color: var(--vert); font-weight: 700; } .danger { color: var(--rouge); font-weight: 800; }
.centre { text-align: center; } .centre-flex { justify-content: center; }
.badge { display: inline-block; font-size: .72rem; background: var(--or); color: #2a1a05; border-radius: 99px; padding: .05em .6em; margin-left: .3em; vertical-align: middle; font-weight: 800; }
.badge-premium { display: inline-block; background: linear-gradient(90deg, #9b4fd6, #e0a81c); color: #fff; font-weight: 800; border-radius: 99px; padding: .1em .7em; margin: .2em 0; }
.etiquette-rar { display: inline-block; color: #fff; font-weight: 800; font-size: .78rem; border-radius: 99px; padding: .1em .7em; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.pastille-rar { display: inline-block; width: .8em; height: .8em; border-radius: 50%; vertical-align: middle; }

/* ---------- barre du haut (mobile d'abord) */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; padding: .45rem .8rem;
  background: linear-gradient(#3a2c1a, #2a1f12); color: #f6ecd6; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.logo { display: flex; align-items: baseline; gap: .35rem; color: #f6d77a; text-decoration: none; font-family: "Cinzel", serif; font-weight: 800; font-size: 1.1rem; }
.logo small { font-family: "Nunito"; font-size: .68rem; background: #b83b2a; color: #fff; border-radius: 99px; padding: 0 .5em; }
#profil { display: flex; align-items: center; gap: .4rem; font-size: .85rem; margin-left: auto; flex-wrap: wrap; }
#nav { order: 3; width: 100%; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a { color: #e8d6ab; text-decoration: none; padding: .35rem .65rem; border-radius: 6px; font-weight: 700; white-space: nowrap; font-size: .92rem; }
#nav a.actif, #nav a:hover { background: rgba(246, 215, 122, .15); color: #fff; }
.jeton { background: rgba(0,0,0,.25); border-radius: 99px; padding: .1rem .55rem; font-weight: 800; white-space: nowrap; }
main .jeton { background: var(--fond2); }
.pseudo { display: none; }
.lien { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; opacity: .8; }
#page { max-width: 1280px; margin: 0 auto; padding: .8rem 16px; min-height: 70vh; }
.pied-page { text-align: center; color: var(--doux); font-size: .8rem; padding: 2rem 1rem; }

/* ---------- boutons, formulaires */
.btn { display: inline-flex; align-items: center; gap: .3em; background: linear-gradient(#d6ae55, #a87e2c); color: #2a1a05; border: 1px solid #7a5a1a;
  border-radius: 8px; padding: .55rem 1rem; font: 800 .95rem "Nunito", sans-serif; cursor: pointer; text-decoration: none; box-shadow: 0 2px 0 #6b4e15; margin: .15rem 0; min-height: 40px; }
.btn:hover { filter: brightness(1.07); } .btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn.sec { background: var(--panneau); color: var(--encre); border-color: var(--ligne); box-shadow: 0 2px 0 var(--ligne); }
.btn.petit { padding: .25rem .6rem; font-size: .82rem; min-height: 32px; }
.btn.large { width: 100%; justify-content: center; padding: .75rem; font-size: 1.05rem; }
.boutons { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
label { display: block; font-weight: 700; margin: .6rem 0; }
input, select { display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; border: 1px solid var(--ligne); border-radius: 8px; background: var(--panneau); color: var(--encre); font: inherit; font-size: 16px; }
select { display: inline-block; width: auto; max-width: 100%; }

/* ---------- page publique */
.accueil-public { display: grid; gap: 1.5rem; align-items: center; }
.vitrine { display: flex; justify-content: center; padding-top: 1rem; }
.vitrine .carte { --w: 130px; margin: 0 -22px; }
.vitrine .carte:nth-child(1) { transform: rotate(-10deg) translateY(16px); }
.vitrine .carte:nth-child(2) { transform: translateY(-6px); z-index: 2; }
.vitrine .carte:nth-child(3) { transform: rotate(10deg) translateY(16px); }
.formulaire { background: var(--panneau); border-radius: 14px; padding: 1.2rem; box-shadow: var(--ombre); }
.formulaire h1 { font-size: 1.8rem; margin: 0; } .sous { color: var(--doux); }
.onglets { display: flex; gap: .3rem; margin: 1rem 0 .3rem; }
.onglets button { flex: 1; padding: .55rem; border: 1px solid var(--ligne); background: var(--fond2); color: var(--encre); border-radius: 8px; font: 700 1rem "Nunito"; cursor: pointer; }
.onglets button.actif { background: var(--or); color: #2a1a05; }

/* ---------- quotidien */
.quotidien { display: grid; gap: 1rem; }
.col { display: flex; flex-direction: column; gap: 1rem; }
.panneau { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: .9rem 1rem; box-shadow: var(--ombre); }
.heros { display: flex; gap: 1rem; align-items: center; } .heros .carte { --w: 104px; flex: none; cursor: zoom-in; }
.heros h2 { font-size: 1.2rem; } .heros p { margin: .2rem 0; font-size: .92rem; }
.jauge { display: flex; gap: .3rem; align-items: center; margin: .4rem 0; }
.jauge i { width: 30px; height: 42px; border-radius: 5px; border: 2px solid var(--ligne); background: var(--fond2); }
.jauge i.on { background: linear-gradient(135deg, #f6d77a, #c9a14a); border-color: var(--or-f); }
.jauge span { margin-left: .4rem; font-weight: 800; }
.minuteur { color: var(--doux); font-size: .9rem; margin: .2rem 0 .6rem; min-height: 1.2em; }
.missions { list-style: none; padding: 0; margin: .5rem 0; } .missions li { padding: .25rem 0; } .missions li.faite { color: var(--vert); font-weight: 700; }
.paliers { display: grid; gap: .5rem; }
.palier { border: 1px dashed var(--ligne); border-radius: 8px; padding: .5rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; font-size: .88rem; }
.palier.pret { border: 2px solid var(--or); background: rgba(201, 161, 74, .12); } .palier.recu { opacity: .6; }
.carte-royaume { font-size: 1.3rem; display: flex; align-items: center; gap: .3rem; justify-content: center; margin: .8rem 0; flex-wrap: wrap; }
.carte-royaume.vide { letter-spacing: .2em; color: var(--doux); }
.pas { width: 2rem; height: 2rem; border-radius: 50%; display: inline-grid; place-items: center; background: var(--fond2); font-size: .9rem; font-weight: 800; border: 2px solid var(--ligne); }
.pas.fait { background: var(--vert); color: #fff; border-color: var(--vert); } .pas.ici { border-color: var(--or); background: #f6d77a; color: #2a1a05; animation: pulse 1.4s infinite; }
.trait { width: 1.6rem; height: 3px; background: var(--ligne); }
@keyframes pulse { 50% { transform: scale(1.12); } }
.journal-patr { font-size: .88rem; color: var(--doux); padding-left: 1.1rem; }
.btn.chemin { flex: 1 1 140px; justify-content: center; }
.gain .carte { --w: 120px; cursor: zoom-in; }

/* ---------- carte à jouer */
.carte { --w: 230px; --aff: #888; --aff-f: #444; --rar: #9a9a9a; position: relative; width: var(--w); aspect-ratio: 63 / 88; font-size: calc(var(--w) / 23);
  border-radius: calc(var(--w) * .05); background: #2a2014; padding: calc(var(--w) * .028); box-shadow: 0 3px 12px rgba(0,0,0,.35), 0 0 0 calc(var(--w) * .012) var(--rar); user-select: none; flex: none; color: #2b2418; line-height: 1.2; }
.carte.petite { --w: 150px; } .carte.grande { --w: min(340px, 86vw); }
.carte .cadre { position: relative; height: 100%; border-radius: calc(var(--w) * .03); overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(170deg, color-mix(in srgb, var(--aff) 30%, #fbf5e6), #f3ead6 60%); border: .15em solid color-mix(in srgb, var(--aff) 70%, #000); }
.carte .entete { display: flex; align-items: center; gap: .3em; padding: .35em .45em .1em; }
.carte .grade { font-size: .62em; text-transform: uppercase; font-weight: 800; background: var(--aff-f); color: #fff; border-radius: .4em; padding: .1em .4em; letter-spacing: .03em; }
.carte .nom { flex: 1; font-family: "Cinzel", serif; font-weight: 800; font-size: .92em; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte .pv { font-weight: 800; font-size: 1.05em; color: #8a1f12; } .carte .pv small { font-size: .55em; }
.carte .evol { font-size: .6em; font-style: italic; padding: 0 .75em; color: #5d4e3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte .fenetre { margin: .2em .45em; border: .15em solid #b59a62; border-radius: .25em; overflow: hidden; aspect-ratio: 200 / 140; background: #ccc; box-shadow: inset 0 0 6px rgba(0,0,0,.3); flex: none; }
.carte .illu { width: 100%; height: 100%; display: block; }
.carte .corps { flex: 1; padding: .1em .55em; display: flex; flex-direction: column; gap: .2em; font-size: .78em; overflow: hidden; }
.carte .talent { background: rgba(184, 59, 42, .1); border-left: .2em solid #b83b2a; padding: .2em .35em; font-size: .9em; }
.carte .talent b { color: #9a2a1a; }
.carte .attaque { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .3em; border-bottom: 1px solid rgba(0,0,0,.12); padding: .15em 0; }
.carte .anom { font-weight: 800; } .carte .adeg { font-weight: 800; font-size: 1.25em; }
.carte .atexte { grid-column: 1 / -1; font-size: .85em; color: #4a3e2e; }
.carte .cout { display: flex; gap: .1em; }
.eclat { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: var(--c); color: #fff; font-size: .9em; line-height: 1; box-shadow: inset 0 -1px 2px rgba(0,0,0,.35); text-shadow: 0 1px 1px rgba(0,0,0,.4); flex: none; }
.eclat.vide { background: #999; }
.carte .pied-combat { display: flex; justify-content: space-between; font-size: .85em; margin-top: auto; padding-top: .15em; }
.carte .regle { font-size: .85em; background: rgba(0,0,0,.07); border-radius: .3em; padding: .15em .35em; font-style: italic; }
.carte .effet { font-size: 1.05em; padding: .4em 0; }
.carte .saveur { font-size: .58em; font-style: italic; color: #6a5a44; padding: 0 .8em; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.carte .pied { display: flex; justify-content: space-between; gap: .4em; font-size: .55em; padding: .25em .8em .35em; color: #5d4e3a; white-space: nowrap; }
.carte .rar { color: var(--rar); font-weight: 800; letter-spacing: -.05em; text-shadow: 0 0 1px rgba(0,0,0,.5); }
.carte .qte { position: absolute; top: -.5em; right: -.5em; z-index: 3; background: var(--or); color: #2a1a05; font-weight: 800; border-radius: 99px; padding: .05em .5em; font-size: .85em; box-shadow: var(--ombre); }
.carte .qte:empty { display: none; }
.carte.t-mentor .cadre { background: linear-gradient(170deg, #f1dfb8, #f6efdf 60%); border-color: #8a6a22; }
.carte.t-equipement .cadre { background: linear-gradient(170deg, #d9e4ee, #f2f5f8 60%); border-color: #4d6a86; }
.carte.t-mentor .grade { background: #8a6a22; } .carte.t-equipement .grade { background: #4d6a86; }
.carte.r-champion .cadre { box-shadow: inset 0 0 0 .12em #b07ce6; }
.carte.r-legende { background: linear-gradient(135deg, #8a6a22, #f2d98a, #8a6a22); }
.carte.r-mythe { background: linear-gradient(135deg, #7a2a00, #ff9a4a, #ffe0a0, #7a2a00); box-shadow: 0 0 18px 2px rgba(255, 106, 26, .55); }
.carte.pleine .fenetre { position: absolute; inset: 0; margin: 0; border: 0; border-radius: 0; aspect-ratio: auto; }
.carte.pleine .entete, .carte.pleine .evol, .carte.pleine .corps, .carte.pleine .pied { position: relative; z-index: 1; }
.carte.pleine .entete { background: linear-gradient(rgba(255,250,235,.85), rgba(255,250,235,.55)); }
.carte.pleine .evol { background: rgba(255,250,235,.55); }
.carte.pleine .corps { flex: none; background: rgba(255,250,235,.84); margin: auto .35em .2em; border-radius: .4em; padding: .3em .45em; }
.carte.pleine .pied { background: rgba(255,250,235,.7); }
.carte.pleine .illu { transform: scale(1.08); }
.carte.f-scene .illu { filter: saturate(1.3) contrast(1.05); }
.carte.f-immersive { background: linear-gradient(135deg, #1b2f66, #8fd0ff, #f2d98a, #1b2f66); }
.carte.f-immersive .illu { filter: saturate(1.45); }
.carte.f-doree { background: linear-gradient(135deg, #7a5a12, #fff0b0, #c9a14a, #7a5a12); box-shadow: 0 0 18px 2px rgba(255, 106, 26, .5); }
.carte.f-doree .cadre { border-color: #a8811c; }
.carte.f-doree .illu { filter: sepia(.65) saturate(2.2) hue-rotate(-8deg) brightness(1.05); }
.carte.f-doree .entete, .carte.f-doree .corps, .carte.f-doree .pied { background: rgba(255, 240, 190, .86); }
.reflet { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.75) 38%, rgba(255,120,220,.4) 46%, rgba(120,220,255,.45) 54%, transparent 70%);
  background-size: 250% 250%; animation: brille 5s ease-in-out infinite; }
@keyframes brille { 0%, 100% { background-position: 100% 100%; } 50% { background-position: 0 0; } }
.carte.dos { background: linear-gradient(135deg, #3a2c1a, #6b4e1f); box-shadow: 0 3px 12px rgba(0,0,0,.35); }
.dos-motif { height: 100%; border-radius: calc(var(--w) * .03); border: .2em solid #c9a14a; display: grid; place-items: center; align-content: center; gap: .5em; color: #f6d77a; text-align: center;
  background: repeating-linear-gradient(45deg, rgba(246,215,122,.08) 0 .6em, transparent .6em 1.2em), radial-gradient(circle, #5a3e18, #2a1d0c); }
.dos-motif span { font-size: 3em; } .dos-motif b { font-family: "Cinzel"; font-size: 1.1em; }
.carte.dos.lueur { box-shadow: 0 0 20px 6px var(--rar, #f6d77a); animation: pulse 1.2s infinite; }

/* ---------- grilles */
.grille { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1rem; }
.grille .carte { --w: 150px; cursor: zoom-in; }
.grille.petite .carte { --w: 110px; }
.manquante { position: relative; cursor: zoom-in; }
.manquante .carte { filter: grayscale(1) brightness(.55) blur(.6px); opacity: .55; }
.manquante .num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: #fff; text-shadow: 0 1px 4px #000; font-size: 1.1rem; }
.filtres { display: flex; gap: .4rem; flex-wrap: wrap; }
.titre-ligne { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; }
.titre-ligne input { width: auto; flex: 1; font-size: 1.1rem; font-weight: 800; min-width: 0; }
.progres { flex: 1; min-width: 100px; max-width: 320px; height: 10px; border-radius: 99px; background: var(--fond2); overflow: hidden; }
.progres i { display: block; height: 100%; background: linear-gradient(90deg, #c9a14a, #f6d77a); }

/* ---------- boosters */
.boosters { text-align: center; } .boosters > p { max-width: 640px; margin-left: auto; margin-right: auto; }
.choix-series { display: flex; gap: .4rem; overflow-x: auto; padding: .3rem 0 .6rem; scrollbar-width: thin; }
.serie-btn { flex: none; display: flex; flex-direction: column; align-items: center; gap: .1rem; width: 112px; padding: .5rem .3rem; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
  background: linear-gradient(160deg, var(--c1), var(--c2)); color: #fff; font: 800 .8rem "Nunito"; text-shadow: 0 1px 2px rgba(0,0,0,.5); opacity: .7; }
.serie-btn span { font-size: 1.5rem; } .serie-btn.actif { opacity: 1; border-color: #f6d77a; transform: translateY(-2px); }
.paquet { width: 180px; height: 270px; margin: 1rem auto .5rem; cursor: pointer; }
.paquet-face { height: 100%; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .5rem; color: #f6ecd6; padding: .6rem;
  border: 4px solid #c9a14a; box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 40px rgba(246,215,122,.2); transition: transform .3s, box-shadow .3s; }
.paquet:hover .paquet-face { transform: translateY(-6px) rotate(-2deg); }
.paquet.charme .paquet-face { box-shadow: 0 0 30px 8px rgba(63, 174, 74, .7), inset 0 0 40px rgba(246,215,122,.3); }
.paquet.vide { opacity: .4; pointer-events: none; }
.pq-marque { font-family: "Cinzel"; font-size: .8rem; letter-spacing: .15em; color: #f6d77a; }
.pq-titre { font-family: "Cinzel"; font-weight: 800; font-size: 1.2rem; color: #fff; text-align: center; } .pq-icone { font-size: 3.6rem; }
.paquet.ouverture .paquet-face { animation: dechirer .65s ease-in forwards; }
@keyframes dechirer { 30% { transform: scale(1.05) rotate(3deg); } 100% { transform: scale(.2) rotate(-20deg); opacity: 0; } }
.charme-chk { display: inline-flex; margin: 0; } .charme-chk.grise { opacity: .5; }
.rangee { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; }
.rangee.petite .carte { --w: 88px; cursor: zoom-in; }
.retournable { position: relative; width: 150px; aspect-ratio: 63 / 88; perspective: 1000px; cursor: pointer; }
.retournable .recto, .retournable .verso { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s; }
.retournable .recto { transform: rotateY(180deg); } .retournable .carte { --w: 150px; }
.retournable.retourne .recto { transform: rotateY(0); } .retournable.retourne .verso { transform: rotateY(-180deg); }
.retournable .etiquette-rar { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); z-index: 4; white-space: nowrap; }
.retournable.choisie { outline: 3px solid var(--or); outline-offset: 4px; border-radius: 10px; }
.retournable.melange { animation: melange .8s ease-out; }
@keyframes melange { 30% { transform: translateX(-24px) rotate(-6deg); } 60% { transform: translateX(24px) rotate(6deg); } 100% { transform: none; } }
.nouveau { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: #b83b2a; color: #fff; font-weight: 800; font-size: .72rem; border-radius: 99px; padding: .1em .6em; z-index: 4; }
.booster-rare { font-family: "Cinzel"; font-weight: 800; font-size: 1.3rem; color: var(--or-f); }
.liste-pioche { display: flex; flex-direction: column; gap: 1rem; }
.ouverture-pioche { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: .6rem .8rem; }
.op-tete { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }

/* ---------- boutique */
.simulation { background: repeating-linear-gradient(45deg, #fff3c4 0 12px, #ffe9a0 12px 24px); color: #5a4208; border: 1px solid #e0b85a; border-radius: 10px; padding: .6rem .8rem; margin-bottom: .8rem; }
.soldes { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.rayon { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.offre { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: .7rem; display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; box-shadow: var(--ombre); }
.offre .btn { margin-top: auto; width: 100%; justify-content: center; }
.offre-icone { font-size: 1.8rem; }
.offre.jour { border: 2px solid var(--or); background: linear-gradient(160deg, rgba(246,215,122,.25), var(--panneau)); }
.offre.pass { border: 2px solid #9b4fd6; background: linear-gradient(160deg, rgba(155,79,214,.18), var(--panneau)); }
.offre.epuisee { opacity: .6; }

/* ---------- decks */
.deck-ligne { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; background: var(--panneau); border: 1px solid var(--ligne); border-radius: 10px; margin: .4rem 0; flex-wrap: wrap; }
.deck-ligne .boutons { margin-left: auto; }
.deck-aff { display: flex; gap: .15rem; font-size: 1.2rem; }
.choix-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.deck-carte { display: flex; flex-direction: column; gap: .3rem; padding: .9rem; background: var(--panneau); border: 2px solid var(--ligne); border-radius: 12px; text-decoration: none; color: var(--encre); }
.deck-carte:hover { border-color: var(--or); }
.affs { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }
.chk { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 700; } .chk input { width: auto; margin: 0; }
.deux-col { display: grid; gap: 1.2rem; }
.ajout { cursor: pointer; } .ajout.grise { opacity: .35; cursor: not-allowed; }
.liste-deck { display: flex; flex-direction: column; gap: .3rem; }
.ld { display: flex; align-items: center; gap: .5rem; background: var(--panneau); border: 1px solid var(--ligne); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; }
.ld span { margin-left: auto; font-weight: 800; }

/* ---------- combat (vertical d'abord) */
.zone-combat { display: grid; gap: .8rem; }
.plateau { background: radial-gradient(ellipse at center, #5d7a3e, #34481f); border-radius: 14px; padding: .5rem; color: #fff; display: flex; flex-direction: column; gap: .4rem; box-shadow: inset 0 0 40px rgba(0,0,0,.4); }
.camp { display: flex; flex-direction: column; gap: .35rem; align-items: center; }
.bandeau { display: flex; gap: .7rem; align-items: center; background: rgba(0,0,0,.35); border-radius: 99px; padding: .15rem .8rem; font-size: .82rem; flex-wrap: wrap; justify-content: center; }
.points { display: inline-flex; gap: .25rem; } .points i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid #f6d77a; } .points i.on { background: #f6d77a; }
.reserve, .front { display: flex; gap: .4rem; justify-content: center; }
.emplacement { width: 92px; min-height: 112px; border-radius: 10px; border: 2px dashed rgba(255,255,255,.3); }
.emplacement.mini { border: 3px solid var(--aff); background: rgba(20, 15, 8, .7); cursor: pointer; padding: 3px; position: relative; font-size: .68rem; }
.front .emplacement { width: 124px; }
.emplacement.selectionne, .carte-main.selectionne { outline: 3px solid #f6d77a; outline-offset: 2px; transform: translateY(-3px); }
.mini-illu { border-radius: 6px; overflow: hidden; aspect-ratio: 200 / 140; } .mini-illu .illu { width: 100%; height: 100%; display: block; }
.mini-nom { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.barre { height: 6px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; margin: 2px 0; }
.barre i { display: block; height: 100%; background: #5fd36a; } .barre i.moyen { background: #f2c94c; } .barre i.bas { background: #e05a4a; }
.mini-eclats { display: flex; gap: 2px; flex-wrap: wrap; min-height: 1.1em; }
.mini-etats { display: flex; gap: 2px; flex-wrap: wrap; }
.etat { font-size: .6rem; border-radius: 4px; padding: 0 .3em; font-weight: 800; background: #555; }
.e-poison { background: #7a3fa0; } .e-brule { background: #d9572b; } .e-paralyse { background: #c9a14a; color: #222; } .e-endormi { background: #3d6fd1; } .e-garde { background: #6b7f94; }
.degats-flash { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); font-size: 1.6rem; font-weight: 800; color: #ff5a3d; text-shadow: 0 2px 4px #000; animation: flash 1s forwards; z-index: 3; }
@keyframes flash { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -30px); } }
.milieu { display: flex; justify-content: space-between; align-items: center; padding: .15rem .4rem; border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.15); gap: .5rem; flex-wrap: wrap; }
.info-tour { font-family: "Cinzel"; font-weight: 800; font-size: .9rem; }
.zone-eclats { display: flex; align-items: center; gap: .35rem; font-size: .8rem; } .zone-eclats .eclat { font-size: 1.2rem; }
.main-joueur { display: flex; gap: .35rem; overflow-x: auto; padding: .5rem .2rem; background: rgba(0,0,0,.25); border-radius: 10px; }
.carte-main { cursor: pointer; flex: none; transition: transform .15s; } .carte-main .carte { --w: 96px; }
.panneau-combat { display: flex; flex-direction: column; gap: .6rem; }
.actions { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: .7rem; }
.choix { display: flex; flex-direction: column; gap: .35rem; } .choix .btn { justify-content: center; } .choix p { margin: .2rem 0; }
.btn.fin-tour { margin-top: .4rem; background: linear-gradient(#5d7a3e, #3f5a28); color: #fff; border-color: #2a3e18; box-shadow: 0 2px 0 #23330f; }
.btn.atq { justify-content: flex-start; }
.fin { text-align: center; } .fin h3 { font-size: 1.5rem; } .fin.gagne h3 { color: var(--vert); } .fin.perdu h3 { color: var(--rouge); }
.journal { background: var(--panneau); border: 1px solid var(--ligne); border-radius: 12px; padding: .5rem .7rem; font-size: .82rem; max-height: 220px; overflow-y: auto; }
.journal div { padding: .15rem 0; border-bottom: 1px dotted var(--ligne); }
.journal .tour { font-weight: 800; color: var(--or-f); } .journal .ko { color: var(--rouge); font-weight: 800; } .journal .attaque { font-weight: 700; }
.journal .special { color: #9b4fd6; font-weight: 700; } .journal .fin { font-weight: 800; font-size: 1rem; }

/* ---------- règles, tableaux, admin */
.table-defile { overflow-x: auto; }
.tableau { border-collapse: collapse; width: 100%; font-size: .85rem; background: var(--panneau); }
.tableau th, .tableau td { border: 1px solid var(--ligne); padding: .3rem .45rem; text-align: left; }
.tableau.petit { font-size: .74rem; } tr.bloque { opacity: .5; }
.regles ol, .regles ul { padding-left: 1.2rem; }
.regles .deux-col > div { min-width: 0; overflow-x: auto; }
section > .tableau { display: block; overflow-x: auto; }

/* ---------- modale et toasts */
#modale { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
#modale[hidden] { display: none; }
#modale .fond { position: absolute; inset: 0; background: rgba(10, 6, 2, .75); }
#modale .boite { position: relative; display: flex; gap: 1rem; align-items: center; flex-direction: column; padding: 1rem; max-height: 100vh; overflow: auto; }
.zoom-actions { display: flex; flex-direction: column; gap: .4rem; color: #f6ecd6; width: min(340px, 86vw); } .zoom-actions .aide { color: #d8ccb4; } .zoom-actions .btn { justify-content: center; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 200%); background: #2a1f12; color: #f6ecd6; padding: .7rem 1.2rem; border-radius: 10px; z-index: 60; transition: transform .3s; font-weight: 700; box-shadow: var(--ombre); max-width: 90vw; }
.toast.on { transform: translate(-50%, 0); } .toast.ok { border-left: 5px solid #5fd36a; } .toast.err { border-left: 5px solid #e05a4a; }
.chargement { text-align: center; color: var(--doux); padding: 4rem; }

/* ---------- écrans larges (PC) */
@media (min-width: 900px) {
  #nav { order: 0; width: auto; flex: 1; }
  .pseudo { display: inline; }
  #page { padding: 1rem; }
  .accueil-public { grid-template-columns: 1.2fr 1fr; min-height: 70vh; }
  .vitrine .carte { --w: 200px; margin: 0 -30px; }
  .quotidien { grid-template-columns: 1fr 1fr; }
  .paliers { grid-template-columns: repeat(3, 1fr); } .palier { flex-direction: column; align-items: flex-start; }
  .heros .carte { --w: 120px; }
  .grille .carte { --w: 180px; } .grille.petite .carte { --w: 125px; }
  .deux-col { grid-template-columns: 2fr 1fr; }
  .retournable, .retournable .carte { width: 190px; --w: 190px; }
  .rangee.petite .carte { --w: 105px; }
  .zone-combat { grid-template-columns: 1fr 300px; }
  .plateau { padding: .8rem; gap: .6rem; }
  .emplacement { width: 125px; min-height: 145px; font-size: .78rem; } .front .emplacement { width: 155px; }
  .carte-main .carte { --w: 120px; }
  .journal { max-height: 440px; }
  #modale .boite { flex-direction: row; }
  .zoom-actions { width: 240px; }
}

.pied-page .editeur { font-size: .72rem; opacity: .7; }


/* ---------- en-tête façon appli (v2) */
.barre { background:
    radial-gradient(120% 140% at 0% 0%, rgba(246,215,122,.22), transparent 55%),
    radial-gradient(120% 160% at 100% 0%, rgba(155,79,214,.28), transparent 60%),
    linear-gradient(180deg, #43301a 0%, #2a1d0f 100%);
  border-bottom: 2px solid #c9a14a; box-shadow: 0 4px 14px rgba(0,0,0,.45), inset 0 -1px 0 rgba(255,240,190,.25);
  padding: calc(.45rem + env(safe-area-inset-top)) .8rem .45rem; }
.logo { align-items: center; gap: .45rem; }
.logo-icone svg { width: 36px; height: 36px; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.logo-txt { display: flex; flex-direction: column; line-height: .95; }
.logo-txt b { font-family: "Cinzel", serif; font-weight: 800; letter-spacing: .04em;
  background: linear-gradient(180deg, #fff3c4, #f2c94c 55%, #b8862a); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.15); font-size: 1rem; }
.logo-txt b + b { font-size: .82rem; letter-spacing: .18em; }
#profil .jeton { background: rgba(0,0,0,.35); border: 1px solid rgba(246,215,122,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
#nav .nav-i { display: none; }

@media (max-width: 899px) {
  .barre { flex-wrap: nowrap; }
  #profil { gap: .3rem; font-size: .8rem; }
  #profil .lien { display: none; }
  .logo small { position: absolute; top: calc(.2rem + env(safe-area-inset-top)); left: 3.1rem; font-size: .55rem; }
  .barre { position: sticky; }
  /* navigation en onglets, en bas de l'écran */
  body.connecte #page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.connecte .pied-page { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  #nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; width: auto; order: 0; gap: 0; justify-content: space-around;
    background: linear-gradient(180deg, #34250f, #1e150a); border-top: 2px solid #c9a14a; box-shadow: 0 -4px 14px rgba(0,0,0,.4);
    padding: .25rem .2rem calc(.3rem + env(safe-area-inset-bottom)); overflow-x: auto; }
  #nav a { flex: 1 0 auto; min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .25rem .2rem; border-radius: 10px; font-size: .64rem; color: #cdb98d; }
  #nav .nav-i { display: block; font-size: 1.3rem; line-height: 1.1; filter: grayscale(.4); }
  #nav a.actif { background: linear-gradient(180deg, rgba(246,215,122,.25), rgba(246,215,122,.05)); color: #fff3c4; }
  #nav a.actif .nav-i { filter: none; transform: translateY(-2px) scale(1.12); }
  #nav a[href="#regles"], #nav a[href="#admin"] { display: none; }
  .toast { bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
}

.liens-compte { font-size: .85rem; } .liens-compte .lien { padding: 0; }

/* ---------- adaptation fluide à tous les mobiles (v3) */
@media (max-width: 899px) {
  html { font-size: clamp(14px, 3.9vw, 17px); }
  body { font-size: 1rem; }
  #page { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .barre { padding-left: max(.6rem, env(safe-area-inset-left)); padding-right: max(.6rem, env(safe-area-inset-right)); }
  /* cartes : 2 colonnes sur téléphone, 3 dès que la place le permet */
  .grille { gap: 10px; }
  .grille .carte { --w: min(180px, calc((100vw - 40px) / 2)); }
  .grille.petite .carte { --w: min(125px, calc((100vw - 50px) / 3)); }
  /* booster : les 5 cartes tiennent sans défilement horizontal */
  .rangee { gap: 8px; }
  .retournable, .retournable .carte { width: min(190px, calc((100vw - 44px) / 2)); --w: min(190px, calc((100vw - 44px) / 2)); }
  .rangee.petite .carte { --w: min(105px, calc((100vw - 64px) / 5)); }
  .paquet { width: min(180px, 46vw); height: calc(min(180px, 46vw) * 1.5); }
  .serie-btn { width: min(112px, 27vw); }
  .vitrine .carte { --w: min(150px, 32vw); margin: 0 calc(-1 * min(22px, 4vw)); }
  .heros .carte { --w: min(104px, 26vw); }
  .carte.grande { --w: min(340px, 84vw, calc((100dvh - 200px) * .72)); }
  /* combat : 3 places de Réserve et le Front toujours visibles */
  .plateau { padding: 6px; gap: 4px; }
  .reserve, .front { gap: 5px; }
  .emplacement { width: calc((100vw - 52px) / 3.3); max-width: 125px; min-height: 0; aspect-ratio: 92 / 118; }
  .front .emplacement { width: calc((100vw - 52px) / 2.5); max-width: 160px; }
  .emplacement.mini { font-size: clamp(.58rem, 2.6vw, .78rem); }
  .carte-main .carte { --w: min(110px, calc((100vw - 40px) / 3.6)); }
  .bandeau { gap: .5rem; padding: .1rem .6rem; font-size: .75rem; }
  .degats-flash { font-size: 1.3rem; }
  .offre { padding: .6rem; }
  .rayon { grid-template-columns: repeat(auto-fill, minmax(min(150px, 42vw), 1fr)); }
  .zoom-actions { width: min(340px, 84vw); }
  .choix-deck { grid-template-columns: 1fr; }
}
/* très petits écrans (iPhone SE 1re génération, petits Android) */
@media (max-width: 359px) {
  #profil .jeton:first-child { display: none; }
  .logo-txt b { font-size: .88rem; } .logo-txt b + b { font-size: .72rem; }
  .logo-icone svg { width: 30px; height: 30px; }
  #nav a { min-width: 44px; font-size: .58rem; }
}
/* téléphone à l'horizontale : barre basse plus compacte */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
  #nav .nav-t { display: none; }
  #nav a { padding: .15rem; }
  body.connecte #page { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .grille .carte { --w: min(170px, calc((100vw - 60px) / 4)); }
  .retournable, .retournable .carte { width: min(150px, calc((100vw - 60px) / 5)); --w: min(150px, calc((100vw - 60px) / 5)); }
  .emplacement { width: min(110px, 12vw); } .front .emplacement { width: min(130px, 15vw); }
  .zone-combat { grid-template-columns: 1fr 260px; }
  .carte.grande { --w: min(260px, calc((100dvh - 40px) * .72)); }
  #modale .boite { flex-direction: row; }
}
/* tablettes en portrait */
@media (min-width: 600px) and (max-width: 899px) {
  .grille .carte { --w: min(180px, calc((100vw - 60px) / 3)); }
  .retournable, .retournable .carte { width: min(170px, calc((100vw - 70px) / 3)); --w: min(170px, calc((100vw - 70px) / 3)); }
  .quotidien { grid-template-columns: 1fr 1fr; }
  .choix-deck { grid-template-columns: 1fr 1fr; }
}
/* écrans tactiles : zones de toucher confortables */
@media (pointer: coarse) {
  .btn { min-height: 44px; } .btn.petit { min-height: 36px; }
  select { min-height: 42px; }
}
/* la grille de combat ne doit jamais élargir la page */
.zone-combat { grid-template-columns: minmax(0, 1fr); }
.zone-combat > * , .plateau > *, .camp, .deux-col > *, .quotidien > *, .col > * { min-width: 0; }
@media (min-width: 900px) { .zone-combat { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) { .zone-combat { grid-template-columns: minmax(0, 1fr) 260px; } }
