/* mikiwaster : une seule feuille, aucun JavaScript (README, décision 2). */

:root {
  color-scheme: light dark;
  --fond: #f4f1ea;
  --surface: #fffdf8;
  --texte: #1d1b18;
  --discret: #6b655c;
  --accent: #3b5bdb;
  --bord: #d9d3c7;
  --commune: #8a8478;
  --peu-commune: #2f9e44;
  --rare: #1c7ed6;
  --epique: #9c36b5;
  --legendaire: #e8590c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16151a;
    --surface: #222129;
    --texte: #ece9e2;
    --discret: #a29d93;
    --accent: #748ffc;
    --bord: #3a3842;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, sans-serif;
}

a { color: var(--accent); }

main, .barre, footer { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

.barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  padding-block: .75rem;
}
.barre nav { display: flex; gap: 1rem; }
.logo { font-weight: 800; letter-spacing: .02em; text-decoration: none; color: var(--texte); }
.solde { margin-left: auto; color: var(--discret); }

footer { padding-block: 2rem; color: var(--discret); font-size: .875rem; }

.aide, .reserve { color: var(--discret); }
.reserve strong { color: var(--texte); font-size: 1.5rem; }
.message { padding: .5rem .75rem; border-left: 3px solid var(--legendaire); background: var(--surface); }

/* Formulaires ------------------------------------------------------------- */

.formulaire { display: grid; gap: 1rem; max-width: 24rem; }
.formulaire label { display: grid; gap: .25rem; }
input {
  font: inherit;
  padding: .5rem .625rem;
  border: 1px solid var(--bord);
  border-radius: .375rem;
  background: var(--surface);
  color: var(--texte);
}

button, .bouton {
  font: inherit;
  font-weight: 600;
  display: inline-block;
  padding: .625rem 1.25rem;
  border: 0;
  border-radius: .5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.lien { background: none; color: var(--discret); padding: 0; font-weight: 400; }

/* Cartes ------------------------------------------------------------------ */

.carte {
  --couleur: var(--commune);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  aspect-ratio: 5 / 7;
  padding: .875rem;
  border: 3px solid var(--couleur);
  border-radius: .875rem;
  background: var(--surface);
  overflow: hidden;
}
.carte.peu-commune { --couleur: var(--peu-commune); }
.carte.rare { --couleur: var(--rare); }
.carte.epique { --couleur: var(--epique); }
.carte.legendaire { --couleur: var(--legendaire); }

.carte header { display: flex; justify-content: space-between; font-size: .75rem; }
.carte .rarete { color: var(--couleur); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.carte .nouvelle { background: var(--couleur); color: #fff; padding: 0 .375rem; border-radius: .25rem; }
.carte h2 { margin: 0; font-size: 1.125rem; line-height: 1.25; }
.carte h2 a { color: inherit; text-decoration: none; }
.carte p { margin: 0; font-size: .8125rem; color: var(--discret); overflow: hidden; }
.carte footer { margin-top: auto; padding: 0; font-size: .75rem; }

/* Finition holo (AdQ, BA) : un reflet qui traverse la carte. */
.carte.holo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .35) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: reflet 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes reflet { from { background-position: 150% 0; } to { background-position: -100% 0; } }

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.grille li { position: relative; }
.grille .apercue .carte { filter: grayscale(1); opacity: .6; }
.quantite {
  position: absolute;
  top: -.5rem;
  right: -.5rem;
  padding: .125rem .5rem;
  border-radius: 1rem;
  background: var(--texte);
  color: var(--fond);
  font-weight: 700;
  font-size: .875rem;
}

/* Ouverture d'un booster : les cartes se retournent une à une. */
.booster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  perspective: 60rem;
}
.booster .carte { animation: retourne .6s ease-out both; }
.booster .carte:nth-child(2) { animation-delay: .3s; }
.booster .carte:nth-child(3) { animation-delay: .6s; }
.booster .carte:nth-child(4) { animation-delay: .9s; }
.booster .carte:nth-child(5) { animation-delay: 1.2s; }
@keyframes retourne {
  from { transform: rotateY(90deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .booster .carte, .carte.holo::after { animation: none; }
}

.suite { margin-top: 2rem; }
.fiche { display: grid; gap: 1rem; max-width: 20rem; }
.statut { color: var(--discret); }
