/* =====================================================================
   TCG ISEKAZ — thème japonais : noir, rouge laque et or
   Polices (chargées dans index.html) : Oswald (titres), Rajdhani (interface)
   ===================================================================== */

:root {
  --ink: #060608;
  --panel: #120c0f;
  --panel-2: #1a1013;
  --card: #1a1214;
  --crimson: #b4161b;
  --crimson-deep: #6e0d12;
  --ember: #f2542d;
  --gold: #d9b45a;
  --gold-hi: #f3dc9a;
  --gold-line: rgba(217, 180, 90, 0.55);
  --text-main: #f4efe4;
  --text-muted: #a89f92;
  --border-subtle: rgba(217, 180, 90, 0.22);
  --accent-cyan: #38bdf8;

  --sg-fill: #101016;
  --sg-line: #1f1f29;

  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --font-ui: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-ui); }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  background-color: var(--sg-fill);
  /* Motif de vagues japonaises (seigaiha) */
  background-image:
    radial-gradient(circle at 100% 150%, var(--sg-fill) 24%, var(--sg-line) 24%, var(--sg-line) 28%, var(--sg-fill) 28%, var(--sg-fill) 36%, var(--sg-line) 36%, var(--sg-line) 40%, transparent 40%, transparent),
    radial-gradient(circle at 0 150%, var(--sg-fill) 24%, var(--sg-line) 24%, var(--sg-line) 28%, var(--sg-fill) 28%, var(--sg-fill) 36%, var(--sg-line) 36%, var(--sg-line) 40%, transparent 40%, transparent),
    radial-gradient(circle at 50% 100%, var(--sg-line) 10%, var(--sg-fill) 10%, var(--sg-fill) 23%, var(--sg-line) 23%, var(--sg-line) 30%, var(--sg-fill) 30%, var(--sg-fill) 43%, var(--sg-line) 43%, var(--sg-line) 50%, var(--sg-fill) 50%, var(--sg-fill) 63%, var(--sg-line) 63%, var(--sg-line) 71%, transparent 71%, transparent),
    radial-gradient(circle at 100% 50%, var(--sg-line) 5%, var(--sg-fill) 5%, var(--sg-fill) 15%, var(--sg-line) 15%, var(--sg-line) 20%, var(--sg-fill) 20%, var(--sg-fill) 29%, var(--sg-line) 29%, var(--sg-line) 34%, var(--sg-fill) 34%, var(--sg-fill) 44%, var(--sg-line) 44%, var(--sg-line) 49%, transparent 49%, transparent),
    radial-gradient(circle at 0 50%, var(--sg-line) 5%, var(--sg-fill) 5%, var(--sg-fill) 15%, var(--sg-line) 15%, var(--sg-line) 20%, var(--sg-fill) 20%, var(--sg-fill) 29%, var(--sg-line) 29%, var(--sg-line) 34%, var(--sg-fill) 34%, var(--sg-fill) 44%, var(--sg-line) 44%, var(--sg-line) 49%, transparent 49%, transparent);
  background-size: 96px 48px;
}

/* Voile sombre : bords noirs, lueur rouge discrète au centre */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(150, 18, 24, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.82) 100%);
}

:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* =====================================================================
   PÉTALES DE CERISIER (décor)
   ===================================================================== */
.sakura { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute;
  top: -30px;
  width: var(--s, 12px);
  height: calc(var(--s, 12px) * 0.72);
  background: radial-gradient(circle at 30% 30%, #ffd9e3, #f58aa8 70%);
  border-radius: 150% 0 150% 0;
  opacity: 0.8;
  animation: petalFall var(--d, 20s) linear var(--delay, 0s) infinite;
}
@keyframes petalFall {
  0%   { transform: translate3d(0, -5vh, 0) rotate(0deg); }
  50%  { transform: translate3d(var(--sway, 60px), 52vh, 0) rotate(210deg); }
  100% { transform: translate3d(calc(var(--sway, 60px) * -0.4), 108vh, 0) rotate(420deg); }
}

/* =====================================================================
   BARRE DE NAVIGATION
   ===================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 92px;
  padding: 0.8rem 1.2rem 0.8rem 9.3rem;
  background: linear-gradient(180deg, rgba(22, 11, 14, 0.97), rgba(8, 6, 8, 0.95));
  backdrop-filter: blur(8px);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold) 14%, var(--gold-hi) 50%, var(--gold) 86%, transparent) 1;
}

.logo-link {
  position: absolute;
  left: 1.4rem;
  top: 6px;
  width: 118px;
  height: 118px;
  z-index: 60;
  display: block;
  border-radius: 50%;
}
.logo-link img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7), 0 0 26px rgba(200, 20, 30, 0.55), 0 8px 18px rgba(0, 0, 0, 0.75);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.logo-link:hover img { transform: scale(1.04); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7), 0 0 36px rgba(230, 30, 40, 0.75), 0 8px 18px rgba(0, 0, 0, 0.75); }

.nav-pills {
  margin: 0 auto;
  display: flex;
  gap: 0.15rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(8, 6, 8, 0.88);
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #d9d0c0;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.nav-btn:hover { color: #fff; }
.nav-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #d12a2a, #7e1013);
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.badge { margin-left: 0.3rem; color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.nav-btn.active .badge { color: #f1d8d0; }

.currencies { display: flex; align-items: center; gap: 0.55rem; }
.currency-pill {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  background: rgba(10, 7, 9, 0.92);
  border: 1px solid var(--gold-line);
}

.btn-discord {
  white-space: nowrap;
  background: rgba(10, 7, 9, 0.92);
  color: var(--text-main);
  border: 1px solid var(--gold-line);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-discord:hover { border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(217, 180, 90, 0.4); background: rgba(40, 12, 16, 0.95); }

.icon-btn {
  background: rgba(10, 7, 9, 0.92);
  border: 1px solid var(--gold-line);
  color: #fff;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  cursor: pointer;
}

/* =====================================================================
   MISE EN PAGE & TITRES
   ===================================================================== */
.container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 3.2rem 1.5rem 4rem; }
.site-footer { position: relative; z-index: 1; padding: 0 1.5rem 2rem; text-align: center; font-size: 0.9rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--border-subtle); transition: color 0.15s, border-color 0.15s; }
.site-footer a:hover { color: var(--gold-hi); border-color: var(--gold-line); }
.tab-section { display: none; animation: fadeIn 0.25s ease; }
.tab-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.section-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.2vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
  background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 38%, #9a9a9a 62%, #ececec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(28, 28, 28, 0.9);
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.9)) drop-shadow(0 0 14px rgba(0, 0, 0, 0.9));
}
.section-subtitle {
  text-align: center;
  color: #cfc6b6;
  max-width: 760px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}
.section-subtitle strong { color: var(--gold-hi); }

.sub-title {
  margin: 1.5rem 0 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  color: var(--gold-hi);
}
.placeholder-text { color: var(--text-muted); text-align: center; }

/* =====================================================================
   SÉLECTEUR D'ÉDITION
   ===================================================================== */
.edition-picker { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.edition-btn {
  position: relative;
  isolation: isolate;
  background: none;
  border: none;
  color: #e9e0cf;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.7rem;
  cursor: pointer;
  transition: color 0.2s;
}
.edition-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: skewX(-14deg);
  background: linear-gradient(180deg, rgba(30, 20, 22, 0.95), rgba(10, 7, 9, 0.95));
  border: 1px solid var(--gold-line);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.edition-btn:hover::before { border-color: var(--gold-hi); }
.edition-btn.active { color: #fff; }
.edition-btn.active::before {
  background: linear-gradient(180deg, #8e1519, #4a0a0e);
  border-color: var(--gold-hi);
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.6);
}

/* =====================================================================
   BOOSTER
   ===================================================================== */
.booster-stage { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; margin: 1.4rem 0 1.8rem; }

.booster-pack {
  position: relative;
  width: 240px;
  height: 360px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.7),
    0 0 0 4px var(--gold),
    0 0 70px 10px rgba(220, 38, 38, 0.5),
    0 28px 50px rgba(0, 0, 0, 0.7);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.booster-pack:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.7),
    0 0 0 4px var(--gold-hi),
    0 0 90px 16px rgba(240, 60, 40, 0.6),
    0 34px 60px rgba(0, 0, 0, 0.75);
}
.booster-pack::before, .booster-pack::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 14px;
  z-index: 2;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 3px, transparent 3px 7px);
}
.booster-pack::before { top: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.35); }
.booster-pack::after { bottom: 0; border-top: 1px solid rgba(0, 0, 0, 0.35); }

/* Cadre doré intérieur du paquet */
.booster-foil {
  position: absolute;
  inset: 20px 14px;
  z-index: 1;
  border: 2px solid rgba(243, 220, 154, 0.9);
  border-radius: 6px;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}

/* Paquet illustré : une image par édition (PNG/WebP avec transparence) */
.booster-pack.has-art {
  width: 250px;
  height: 372px;
  border-radius: 0;
  overflow: visible;
  background-color: transparent;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 0 26px rgba(220, 38, 38, 0.6)) drop-shadow(0 22px 24px rgba(0, 0, 0, 0.75));
}
.booster-pack.has-art:hover {
  box-shadow: none;
  filter: drop-shadow(0 0 40px rgba(240, 70, 50, 0.85)) drop-shadow(0 30px 30px rgba(0, 0, 0, 0.8));
}
.booster-pack.has-art::before,
.booster-pack.has-art::after,
.booster-pack.has-art .booster-art,
.booster-pack.has-art .booster-foil { display: none; }
.booster-pack.has-art .booster-counter { bottom: -14px; }

.pack-info {
  margin-top: -0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.booster-art { position: relative; z-index: 2; text-align: center; padding: 1rem; }
.booster-tag {
  display: inline-block;
  background: #0a0709;
  color: var(--gold-hi);
  border: 1px solid var(--gold);
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.booster-art h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.3rem;
  letter-spacing: 0.02em;
  margin: 0.6rem 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}
.booster-art p { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; opacity: 0.92; }
.booster-counter {
  position: absolute;
  bottom: 30px;
  z-index: 3;
  background: #0a0709;
  border: 1.5px solid var(--gold);
  padding: 0.2rem 1rem;
  border-radius: 99px;
  font-weight: 800;
  font-size: 1.1rem;
}

.booster-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 0.4rem; }

/* =====================================================================
   BOUTONS
   ===================================================================== */
.btn-primary {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff4e0;
  padding: 0.95rem 2.1rem;
  border-radius: 14px;
  border: 2px solid var(--gold);
  cursor: pointer;
  background:
    radial-gradient(120% 90% at 50% 135%, #ff9a3c 0%, rgba(255, 106, 40, 0) 55%),
    linear-gradient(180deg, #d62d2d 0%, #9d1517 55%, #5e0a0d 100%);
  box-shadow:
    0 0 0 3px #1a0505,
    0 0 0 4px rgba(217, 180, 90, 0.55),
    inset 0 0 14px rgba(255, 150, 60, 0.45),
    0 0 26px rgba(220, 38, 38, 0.55);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  transition: transform 0.15s, filter 0.2s;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.14); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: linear-gradient(180deg, rgba(28, 18, 20, 0.95), rgba(10, 7, 9, 0.95));
  color: var(--text-main);
  border: 1.5px solid var(--gold-line);
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.btn-secondary:hover { border-color: var(--gold-hi); box-shadow: 0 0 16px rgba(217, 180, 90, 0.35); }

.btn-gem {
  background: rgba(10, 7, 9, 0.92);
  border: 1.5px solid var(--gold-line);
  color: var(--text-main);
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.btn-gem:hover { border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(217, 180, 90, 0.35); }

/* =====================================================================
   TIMER BOOSTER GRATUIT
   ===================================================================== */
.timer-card {
  max-width: 520px;
  margin: 2.2rem auto 0;
  padding: 1.3rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(26, 15, 18, 0.93), rgba(12, 8, 10, 0.93));
  border: 1.5px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.6);
}
.timer-hint { color: #ddd3c2; margin-bottom: 0.8rem; }
.timer-row { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 0.5rem; }
.timer-clock { color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.progress-bar {
  height: 10px;
  background: #0a0608;
  border: 1px solid rgba(217, 180, 90, 0.35);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.progress-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #e11d48, #f97316);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.7);
  transition: width 0.4s;
}

/* =====================================================================
   CARTES & EFFETS HOLOGRAPHIQUES
   ===================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.tcg-card {
  position: relative;
  overflow: hidden;
  padding: 0.75rem;
  border-radius: 12px;
  border: 2px solid #4b4540;
  background: linear-gradient(180deg, #1f1519, #130c0f);
  transition: transform 0.15s ease-out, box-shadow 0.2s;
  transform-style: preserve-3d;
}
.tcg-card.locked { filter: grayscale(1) brightness(0.45); opacity: 0.75; }

/* Bordures par rareté */
.rarity-C   { border-color: #6b6560; }
.rarity-UC  { border-color: #3fa66a; }
.rarity-R   { border-color: #38bdf8; box-shadow: 0 0 15px rgba(56, 189, 248, 0.25); }
.rarity-UR  { border-color: #c084fc; box-shadow: 0 0 22px rgba(192, 132, 252, 0.45); }
.rarity-SEC { border-color: #f5c542; box-shadow: 0 0 28px rgba(245, 197, 66, 0.65); }

.holo-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  mix-blend-mode: color-dodge;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.75), rgba(236,72,153,0.35) 35%, rgba(56,189,248,0.35) 65%, transparent 80%);
}
.rarity-R:hover .holo-overlay,
.rarity-UR:hover .holo-overlay,
.rarity-SEC:hover .holo-overlay { opacity: 0.85; }

.card-header { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 0.5rem; }
.card-art {
  height: 170px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin-bottom: 0.65rem;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 -30px 40px rgba(0, 0, 0, 0.25);
}
.card-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.02em; margin-bottom: 0.25rem; }
.card-meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--text-muted); }

/* Cadre doré : carte 100 % collectée (normale + 11 notes) */
.tcg-card.complete {
  border: 3px solid transparent;
  background:
    linear-gradient(#1f1519, #130c0f) padding-box,
    linear-gradient(135deg, #facc15, #f472b6, #38bdf8, #facc15) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: completeShine 4s linear infinite;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.6);
}
@keyframes completeShine {
  from { background-position: 0 0, 0% 50%; }
  to   { background-position: 0 0, 300% 50%; }
}

/* Progression par carte */
.card-progress { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.card-progress-bar { flex: 1; height: 6px; background: #0a0608; border-radius: 99px; overflow: hidden; }
.card-progress-bar div { height: 100%; background: linear-gradient(90deg, #e11d48, var(--gold)); }
.card-progress-bar.big { height: 10px; margin: 0.6rem 0; border: 1px solid rgba(217, 180, 90, 0.3); }

/* =====================================================================
   BOÎTIER DE GRADATION (SLAB)
   ===================================================================== */
.slab-wrapper {
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-radius: 16px;
  padding: 0.65rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.12);
}
.slab-label {
  background: #0d0809;
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.slab-label.black-label { background: #050505; border: 1.5px solid var(--gold); box-shadow: 0 0 12px rgba(217, 180, 90, 0.5); }
.slab-info { font-size: 0.75rem; line-height: 1.3; }
.slab-info strong { display: block; color: #fff; font-size: 0.85rem; }
.slab-grade {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-hi);
  background: rgba(217, 180, 90, 0.15);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
}
.slab-subgrades { font-size: 0.7rem; color: var(--text-muted); text-align: center; margin-top: 0.45rem; }

/* =====================================================================
   FILTRES, GRADATION, RECYCLAGE
   ===================================================================== */
.section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.section-header .section-title { margin-bottom: 0; }
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; }

select {
  background: #0d080a;
  color: #fff;
  border: 1px solid var(--gold-line);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.grading-workbench {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  background: linear-gradient(180deg, rgba(26, 15, 18, 0.93), rgba(12, 8, 10, 0.93));
  border: 1.5px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5);
}
.grading-selector { display: flex; flex-direction: column; gap: 1rem; justify-content: center; }
.grading-result-zone { display: flex; justify-content: center; align-items: center; min-height: 320px; }

.recycle-header { text-align: center; margin-bottom: 1.5rem; }
.recycle-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, #a31a1d, #6e0d12);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.recycle-btn:hover { filter: brightness(1.15); }

/* =====================================================================
   CLASSEMENT & PROGRESSION
   ===================================================================== */
.progress-box {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(26, 15, 18, 0.93), rgba(12, 8, 10, 0.93));
  border: 1.5px solid var(--gold);
  border-radius: 16px;
}
.progress-box h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; color: var(--gold-hi); margin-bottom: 0.5rem; }
.progress-level { font-size: 1.15rem; }
.progress-next { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

.score-info {
  max-width: 760px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(18, 12, 15, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}
.score-info summary { cursor: pointer; font-weight: 700; color: var(--gold-hi); }
.score-info ul { margin-top: 0.75rem; padding-left: 1.2rem; display: grid; gap: 0.5rem; color: #cfc6b6; font-size: 0.95rem; line-height: 1.45; }

.leaderboard-actions { text-align: center; margin-bottom: 1.5rem; }
.leaderboard-wrap { overflow-x: auto; }
.leaderboard-table { width: 100%; border-collapse: collapse; background: rgba(18, 12, 15, 0.94); border-radius: 14px; overflow: hidden; border: 1px solid var(--border-subtle); }
.leaderboard-table th, .leaderboard-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-subtle); }
.leaderboard-table th { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.leaderboard-table tr.me { background: rgba(217, 180, 90, 0.12); }
.rank-cell { font-weight: 800; width: 3.5rem; }

/* =====================================================================
   MODAL D'OUVERTURE DE BOOSTER
   ===================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background: rgba(4, 2, 5, 0.94);
}
.modal.hidden, .hidden { display: none !important; }
.modal-content { text-align: center; max-width: 1100px; width: 100%; }
.modal-content h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.modal-content .btn-primary, .modal-content .btn-secondary { margin: 0 0.4rem; }
.modal-hint { color: var(--text-muted); margin-bottom: 1.5rem; }
.opened-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.2rem; max-width: 1000px; margin: 0 auto 2rem; }
.modal-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }

/* --- Déchirure du booster --- */
@keyframes packTear {
  0%   { transform: scale(1) rotate(0deg); filter: brightness(1); }
  25%  { transform: scale(1.08) rotate(-3deg); filter: brightness(1.4); }
  50%  { transform: scale(1.12) rotate(3deg); filter: brightness(1.8); }
  80%  { transform: scale(1.25); opacity: 0.7; filter: brightness(2.5); }
  100% { transform: scale(1.4); opacity: 0; }
}
.booster-pack.opening { animation: packTear 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards; pointer-events: none; }

/* --- Carte retournable (révélation une par une) --- */
.flip-slot {
  position: relative;
  perspective: 1000px;
  cursor: pointer;
  height: 295px;
  animation: cardDeal 0.35s ease backwards;
}
.flip-slot:nth-child(1) { animation-delay: 0.05s; }
.flip-slot:nth-child(2) { animation-delay: 0.12s; }
.flip-slot:nth-child(3) { animation-delay: 0.19s; }
.flip-slot:nth-child(4) { animation-delay: 0.26s; }
.flip-slot:nth-child(5) { animation-delay: 0.33s; }

@keyframes cardDeal {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}
.flip-slot.flipped .flip-inner { transform: rotateY(180deg); }

.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; }

.flip-back {
  background: radial-gradient(circle at center, #4a0f14 0%, #12070a 85%);
  border: 2px solid rgba(217, 180, 90, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.flip-slot:not(.flipped):hover .flip-back {
  transform: translateY(-6px);
  border-color: var(--gold-hi);
  box-shadow: 0 14px 30px rgba(217, 180, 90, 0.3);
}
.flip-back-emblem { font-size: 2.5rem; color: var(--gold-hi); filter: drop-shadow(0 0 10px rgba(217, 180, 90, 0.6)); }
.flip-back-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px; color: var(--gold-hi); text-transform: uppercase; }

/* Indice subtil de rareté sur le dos avant retournement */
.flip-slot[data-rarity="R"]   { --glow: #38bdf8; }
.flip-slot[data-rarity="UR"]  { --glow: #c084fc; }
.flip-slot[data-rarity="SEC"] { --glow: #facc15; }
.flip-slot[data-rarity="R"] .flip-back  { box-shadow: 0 0 18px rgba(56, 189, 248, 0.45); }
.flip-slot[data-rarity="UR"] .flip-back { box-shadow: 0 0 24px rgba(192, 132, 252, 0.65); }
.flip-slot[data-rarity="SEC"] .flip-back { border-color: #facc15; box-shadow: 0 0 30px rgba(250, 204, 21, 0.85); }

.flip-front { transform: rotateY(180deg); }
.flip-front .tcg-card { height: 100%; display: flex; flex-direction: column; justify-content: space-between; }

@keyframes revealFlash { 0% { filter: brightness(2.4); } 100% { filter: brightness(1); } }
.flip-slot.flipped .flip-front { animation: revealFlash 0.5s ease-out; }

/* --- Suspense & explosion pour les cartes rares --- */
.flip-slot.charging, .flip-slot.bursting { z-index: 20; }
.flip-slot.charging .flip-back {
  border-color: var(--glow);
  animation: chargeShake 0.1s linear infinite, chargeGlow 0.9s ease-in forwards;
}
@keyframes chargeShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25%      { transform: translate(-3px, 2px) rotate(-1.2deg); }
  50%      { transform: translate(3px, -2px) rotate(1.2deg); }
  75%      { transform: translate(-2px, -3px) rotate(-0.8deg); }
}
@keyframes chargeGlow {
  from { box-shadow: 0 0 15px var(--glow); filter: brightness(1); }
  to   { box-shadow: 0 0 70px 14px var(--glow); filter: brightness(1.8); }
}

.reveal-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 30; }
.reveal-burst::before {
  content: "";
  position: absolute;
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 4px solid var(--c);
  box-shadow: 0 0 30px var(--c);
  animation: ringExpand 0.8s ease-out forwards;
}
@keyframes ringExpand { from { transform: scale(0.2); opacity: 1; } to { transform: scale(9); opacity: 0; } }
.reveal-particle {
  position: absolute;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  animation: particleFly 0.9s ease-out forwards;
}
@keyframes particleFly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

.screen-flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: radial-gradient(circle, var(--c), transparent 70%);
  animation: screenFlash 0.6s ease-out forwards;
}
@keyframes screenFlash { 0% { opacity: 0; } 20% { opacity: 0.7; } 100% { opacity: 0; } }

.modal-content.shake { animation: modalShake 0.5s ease-out; }
@keyframes modalShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 4px); }
  40% { transform: translate(7px, -5px); }
  60% { transform: translate(-5px, 3px); }
  80% { transform: translate(3px, -2px); }
}

.flip-slot.flipped[data-rarity="UR"] .tcg-card,
.flip-slot.flipped[data-rarity="SEC"] .tcg-card { animation: rareGlowPulse 2s ease-in-out infinite; }
@keyframes rareGlowPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.2); } }

/* =====================================================================
   NOTIFICATION (PARCHEMIN)
   ===================================================================== */
.toast {
  position: fixed;
  right: 28px;
  bottom: 24px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 56px));
  padding: 0.9rem 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(90deg, #2b140f 0, #43211a 6%, #2a1410 94%, #1b0c09 100%);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}
.toast::before, .toast::after {
  content: "";
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #1a0a07, #5a2a1a 45%, #1a0a07);
  border: 1px solid var(--gold);
}
.toast::before { left: -8px; }
.toast::after { right: -8px; }

/* =====================================================================
   ÉCRANS ÉTROITS
   ===================================================================== */
@media (min-width: 1250px) {
  /* Grand écran : menu parfaitement centré */
  .navbar { display: grid; grid-template-columns: 1fr auto 1fr; padding-left: 1.5rem; }
  .nav-pills { margin: 0; grid-column: 2; }
  .currencies { grid-column: 3; justify-self: end; }
}
@media (max-width: 1180px) {
  .navbar { flex-wrap: wrap; justify-content: center; padding-left: 8.2rem; }
  .logo-link { width: 96px; height: 96px; left: 1rem; }
  .nav-pills { margin: 0; }
}
@media (max-width: 768px) {
  .grading-workbench { grid-template-columns: 1fr; }
  .navbar { padding: 0.7rem 0.8rem 0.7rem 5.6rem; min-height: 78px; }
  .logo-link { width: 64px; height: 64px; left: 0.7rem; top: 8px; }
  .nav-pills { max-width: 100%; overflow-x: auto; }
  .currencies { flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .edition-btn { padding: 0.5rem 1.1rem; font-size: 0.9rem; }
  .nav-btn { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
  .container { padding-top: 2.2rem; }
  .flip-slot { height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .sakura { display: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   FICHE CARTE (agrandissement) & RECYCLAGE DES DOUBLONS GRADÉS
   ===================================================================== */
.tcg-card.clickable, .slab-wrapper.clickable { cursor: pointer; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.recycle-header { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; }
.slab-recycle { font-size: 0.8rem; }

.card-detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
  max-width: 940px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 2rem;
  text-align: left;
  background: linear-gradient(180deg, rgba(26, 15, 18, 0.98), rgba(12, 8, 10, 0.98));
  border: 1.5px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5), 0 30px 80px rgba(0, 0, 0, 0.8);
}
.card-detail-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(10, 7, 9, 0.9);
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
}
.card-detail-close:hover { border-color: var(--gold-hi); box-shadow: 0 0 12px rgba(217, 180, 90, 0.4); }
.card-detail-preview .tcg-card .card-art { height: 300px; font-size: 6rem; }
.card-detail-preview .slab-wrapper .card-art { height: 260px; font-size: 5rem; }

.card-detail-info h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; letter-spacing: 0.02em; margin-right: 2.5rem; }
.card-detail-info h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em; color: var(--gold-hi); margin-top: 1.1rem; }
.card-detail-meta { color: var(--text-muted); margin: 0.2rem 0 0.8rem; }
.complete-note { color: var(--gold-hi); font-weight: 700; margin-bottom: 0.6rem; }
.detail-help { color: var(--text-muted); font-size: 0.85rem; line-height: 1.4; margin: 0.6rem 0 1rem; }

.version-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-top: 0.6rem; }
.version-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-height: 66px;
  padding: 0.55rem 0.3rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(10, 7, 9, 0.85);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.version-tile.owned { cursor: pointer; border-color: var(--gold-line); }
.version-tile.owned:hover { border-color: var(--gold-hi); }
.version-tile.missing { opacity: 0.4; }
.version-tile.selected { border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(217, 180, 90, 0.45); background: rgba(60, 20, 24, 0.7); }
.vt-grade { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.vt-count { font-size: 0.85rem; color: var(--gold-hi); }
.vt-recycle {
  margin-top: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, #a31a1d, #6e0d12);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.vt-recycle:hover { filter: brightness(1.2); }

@media (max-width: 768px) {
  .card-detail { grid-template-columns: 1fr; padding: 1.2rem; gap: 1.2rem; }
  .card-detail-preview { max-width: 300px; margin: 0 auto; }
  .version-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Bonus quotidien */
.btn-daily { margin: 10px 8px 0 0; }
.btn-daily:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

/* ===== Salle de jeux ===== */
.game-tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.game-tab { background: var(--panel); color: #cfc6b4; border: 1px solid rgba(217,180,90,.35); padding: 10px 22px; font-family: 'Oswald', sans-serif; letter-spacing: 2px; cursor: pointer; transition: .2s; }
.game-tab:hover { border-color: var(--gold-hi); color: #fff; }
.game-tab.active { background: linear-gradient(180deg, var(--crimson), #7d0e12); color: #fff; border-color: var(--gold-hi); }
.game-panel { max-width: 560px; margin: 0 auto; background: var(--panel-2); border: 1px solid rgba(217,180,90,.3); padding: 26px 22px; text-align: center; }
.game-title { font-family: 'Oswald', sans-serif; letter-spacing: 3px; color: var(--gold-hi); margin-bottom: 8px; }
.game-desc { color: #b9ae98; line-height: 1.5; margin: 8px 0 16px; }
.game-desc strong { color: var(--gold-hi); }
.game-canvas-wrap { width: min(384px, 100%); aspect-ratio: 1; margin: 0 auto 12px; border: 2px solid var(--gold); box-shadow: 0 0 22px rgba(217,180,90,.25); }
.game-canvas-wrap.revealed { border-color: #4fd18b; }
.game-canvas-wrap canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.game-canvas-wrap.revealed canvas { image-rendering: auto; }
.game-reward { color: var(--gold-hi); font-family: 'Oswald', sans-serif; letter-spacing: 1px; margin: 6px 0 14px; }
.game-reward.good { color: #4fd18b; } .game-reward.bad { color: #ff6b6b; }
.game-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.game-option { background: var(--panel); color: #eee; border: 1px solid rgba(217,180,90,.35); padding: 12px 8px; font-family: 'Rajdhani', sans-serif; font-size: 16px; font-weight: 600; cursor: pointer; transition: .2s; }
.game-option:hover:not(:disabled) { border-color: var(--gold-hi); background: #241418; }
.game-option:disabled { cursor: default; opacity: .75; }
.game-option.correct { border-color: #4fd18b; background: rgba(79,209,139,.18); opacity: 1; }
.game-option.wrong { border-color: #ff6b6b; background: rgba(255,107,107,.18); opacity: 1; }
.bet-options { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.bet-chip { background: var(--panel); color: #ddd; border: 1px solid rgba(217,180,90,.35); padding: 8px 14px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.bet-chip.active { background: var(--crimson); color: #fff; border-color: var(--gold-hi); }
.bet-cards { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.bet-card { width: 28%; max-width: 130px; aspect-ratio: 5/7; border: 2px solid var(--gold); background: repeating-linear-gradient(45deg, #2a0f14, #2a0f14 8px, #3a1319 8px, #3a1319 16px); color: var(--gold-hi); font-family: 'Oswald', sans-serif; font-size: 40px; cursor: pointer; transition: transform .3s, box-shadow .3s; }
.bet-card:hover:not(:disabled) { transform: translateY(-6px); box-shadow: 0 8px 22px rgba(217,180,90,.35); }
.bet-card:disabled { cursor: default; }
.bet-card.flipped { background: var(--panel); animation: betflip .5s ease; }
.bet-card.win { border-color: #4fd18b; color: #4fd18b; font-size: 30px; }
.bet-card.lose { border-color: #5a3a3a; color: #7a5a5a; opacity: .7; }
.bet-card.picked { box-shadow: 0 0 0 3px var(--gold-hi); opacity: 1; }
@keyframes betflip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
@media (max-width: 600px) { .game-options { grid-template-columns: 1fr; } }

/* Vitrine gradée : une vignette par carte */
.slab-wrapper.showcase { transition: transform .2s, box-shadow .2s, border-color .2s; border-color: rgba(217, 180, 90, 0.55); }
.slab-wrapper.showcase:hover { transform: translateY(-4px); border-color: var(--gold-hi); box-shadow: 0 14px 34px rgba(0,0,0,.6), 0 0 18px rgba(217,180,90,.35); }
.slab-wrapper.showcase.complete { border-color: #facc15; box-shadow: 0 12px 30px rgba(0,0,0,.55), 0 0 26px rgba(250,204,21,.5); }

/* Missions bonus */
.bonus-card { max-width: 640px; margin: 22px auto 0; background: var(--panel-2); border: 1px solid rgba(217,180,90,.3); padding: 18px 20px; }
.bonus-title { font-family: 'Oswald', sans-serif; letter-spacing: 3px; color: var(--gold-hi); margin-bottom: 10px; font-size: 1.05rem; }
.bonus-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid rgba(217,180,90,.15); }
.bonus-row strong { display: block; color: #fff; }
.bonus-row span { color: #b9ae98; font-size: .9rem; }
.bonus-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bonus-actions a.btn-secondary { text-decoration: none; display: inline-flex; align-items: center; }
.bonus-done { color: #4fd18b; font-style: normal; font-weight: 700; }
.bonus-todo { color: #b9ae98; font-style: normal; font-size: .85rem; }

/* Série exclusive Isekaz */
.tcg-card.series-isekaz { border-color: #facc15; box-shadow: 0 0 14px rgba(250, 204, 21, 0.35); }
.tcg-card.series-isekaz .card-header { color: #fde68a; }
.tcg-card.handmade { box-shadow: 0 0 22px rgba(180, 22, 27, 0.7), 0 0 10px rgba(250, 204, 21, 0.6); }
.booster-pack .booster-art h2 { text-shadow: 0 2px 10px rgba(0,0,0,.45); }

/* =====================================================================
   OUVERTURE INTERACTIVE : déchirure du booster + révélation une par une
   ===================================================================== */
.tear-stage { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; margin: 0.5rem 0 1.5rem; }
.tear-pack {
  position: relative; width: 250px; height: 372px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none;
  transform: scale(1.12); margin: 1rem 0;
}
.tear-pack:active { cursor: grabbing; }
.tear-clone, .tear-clone:hover { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; transform: none !important; animation: none !important; pointer-events: none; }
.tear-bottom { clip-path: inset(var(--top) 0 0 0); }
.tear-attached { clip-path: inset(0 0 calc(100% - var(--top)) 0); }
.tear-torn { clip-path: inset(0 100% calc(100% - var(--top)) 0); transform: rotate(10deg) translateY(-3px) !important; }
.tear-topwrap { position: absolute; inset: 0; }
.tear-line {
  position: absolute; left: 4%; right: 4%; top: var(--top); height: 0; pointer-events: none;
  border-top: 3px dashed rgba(255, 255, 255, 0.85); filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
  animation: tearPulse 1.2s ease-in-out infinite;
}
@keyframes tearPulse { 50% { opacity: 0.35; } }
.tear-pack.started .tear-line { animation: none; opacity: 0.55; }
.tear-glow {
  position: absolute; left: 0; top: calc(var(--top) - 3px); height: 6px; width: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(250, 204, 21, 0), #fde68a 70%, #fff);
  box-shadow: 0 0 18px 6px rgba(250, 204, 21, 0.85); z-index: 3;
}
.tear-dot {
  position: absolute; left: 0; top: var(--top); width: 38px; height: 38px; margin: -19px 0 0 -19px; z-index: 4; pointer-events: none;
  display: grid; place-items: center; font-size: 1.3rem; border-radius: 50%;
  background: rgba(10, 6, 8, 0.85); border: 2px solid var(--gold-hi); box-shadow: 0 0 16px rgba(250, 204, 21, 0.8);
  animation: dotHint 1.1s ease-in-out infinite;
}
.tear-pack.started .tear-dot { animation: none; }
@keyframes dotHint { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(26px); } }
.tear-pack.done .tear-topwrap { animation: tearFly 0.8s cubic-bezier(0.3, 0, 0.7, 0.4) forwards; z-index: 5; }
@keyframes tearFly { to { transform: translate(60px, -420px) rotate(32deg); opacity: 0; } }
.tear-pack.done .tear-line, .tear-pack.done .tear-dot { opacity: 0; transition: opacity 0.1s; }
.tear-pack.done .tear-glow { animation: tearFlash 0.8s ease-out forwards; }
@keyframes tearFlash { 0% { height: 6px; opacity: 1; } 100% { height: 300px; top: -200px; opacity: 0; } }
.tear-pack.done .tear-bottom { animation: packBurst 0.85s ease-in forwards; }
@keyframes packBurst { 0% { filter: brightness(1); } 70% { filter: brightness(2.2); transform: scale(1.04); } 100% { filter: brightness(3); opacity: 0; } }

.seq-stage { display: flex; justify-content: center; align-items: center; gap: 1.2rem; margin: 0.4rem 0 1.2rem; }
.seq-col { display: flex; justify-content: center; align-items: center; }
.flip-slot.seq-slot { height: auto; aspect-ratio: 200 / 295; width: min(42vw, 210px); animation: cardDeal 0.35s ease backwards; }
.seq-left .flip-slot { cursor: pointer; }
.seq-left .flip-slot:not(.charging):not(.seq-done) .flip-back { animation: deckNudge 2s ease-in-out infinite; }
@keyframes deckNudge { 50% { transform: translateY(-5px); } }
.seq-left .flip-slot.seq-done { visibility: hidden; }
.seq-arrow { font-size: 1.6rem; color: var(--gold-hi); opacity: 0.7; }
.seq-placeholder {
  width: min(42vw, 210px); aspect-ratio: 200 / 295; display: grid; place-items: center; font-size: 3rem; color: rgba(243, 220, 154, 0.35);
  border: 2px dashed rgba(217, 180, 90, 0.35); border-radius: 14px;
}
.seq-history { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; min-height: 64px; margin-bottom: 1.2rem; }
.seq-thumb {
  width: 44px; height: 62px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.35);
  background-size: cover; background-position: center; display: grid; place-items: center; font-size: 1.3rem;
  animation: cardDeal 0.3s ease backwards;
}
.seq-thumb[data-rarity="R"] { border-color: #38bdf8; }
.seq-thumb[data-rarity="UR"] { border-color: #c084fc; }
.seq-thumb[data-rarity="SEC"] { border-color: #facc15; box-shadow: 0 0 10px #facc15; }
@media (max-width: 520px) { .seq-stage { gap: 0.4rem; } .seq-arrow { font-size: 1.1rem; } .tear-pack { transform: scale(1); } }

/* Dos de carte illustré (toutes éditions) */
.flip-back {
  background: url("assets/cards/back.webp?v=48") center / 100% 100% no-repeat, #12070a;
  border: none;
  position: absolute;
}
.flip-back .flip-back-emblem { display: none; }
.flip-back .flip-back-label {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); white-space: nowrap;
  padding: 0.25rem 0.7rem; border-radius: 999px; background: rgba(8, 4, 6, 0.72); border: 1px solid rgba(217, 180, 90, 0.6);
  font-size: 0.7rem;
}

/* Ouverture groupée + « ouvrir un autre booster » */
.multi-open { margin-top: 10px; gap: 10px; flex-wrap: wrap; justify-content: center; }
.multi-open .btn-secondary { font-size: .82rem; padding: 8px 14px; }
.multi-open .btn-secondary:disabled { opacity: .4; cursor: not-allowed; }
#btn-open-again { margin-right: 10px; }

/* ===== Fonctions sociales (quêtes, profil, boutique, échanges, marché) ===== */
.hidden { display: none !important; }
.nav-btn .badge.hidden { display: none !important; }
.soc-muted { color: var(--text-muted); font-size: .85rem; }
.soc-h { font-family: var(--font-display); letter-spacing: .06em; color: var(--gold-hi); margin: 1.4rem 0 .6rem; font-size: 1.1rem; }
.soc-login { max-width: 560px; margin: 2rem auto; text-align: center; padding: 1.5rem; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--panel); }
.soc-btn { padding: .45rem 1rem !important; font-size: .85rem !important; }
.soc-subnav { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; align-items: center; margin: 0 0 1rem; }
.soc-pill { background: var(--panel-2); color: var(--text-main); border: 1px solid var(--border-subtle); border-radius: 999px; padding: .45rem 1.1rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.soc-pill.active { border-color: var(--gold-hi); color: var(--gold-hi); box-shadow: 0 0 12px rgba(217,180,90,.3); }
.soc-bar { height: 8px; border-radius: 99px; background: #261a1d; overflow: hidden; margin: .35rem 0 .2rem; }
.soc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--crimson), var(--gold)); }
.soc-row { display: flex; gap: 1rem; align-items: center; background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .6rem; }
.soc-row.is-done { opacity: .55; }
.soc-grow { flex: 1; min-width: 0; }
.soc-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.soc-ach { display: flex; flex-direction: column; gap: .2rem; background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 12px; padding: .8rem; }
.soc-ach.is-ready { border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(217,180,90,.35); }
.soc-ach.is-done { opacity: .6; }
.soc-ach-top { display: flex; justify-content: space-between; gap: .5rem; }
.soc-ach .soc-btn { margin-top: .4rem; }
button:disabled.soc-btn { opacity: .45; cursor: not-allowed; }

/* Profil */
.pf-card { max-width: 820px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 16px; overflow: hidden; padding-bottom: 1rem; }
.pf-banner { height: 150px; background: linear-gradient(135deg, #2a1218, #12070a); }
.banner-dusk { background: linear-gradient(135deg, #1e1b4b, #7c2d5b 55%, #f2542d); }
.banner-sakura { background: linear-gradient(135deg, #3b0d2b, #be4a86 55%, #fbcfe8); }
.banner-abyss { background: linear-gradient(135deg, #020617, #0e4a6b 55%, #10b981); }
.pf-head { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; padding: 0 1.2rem; margin-top: -44px; }
.pf-id { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: .15rem; }
.pf-id h2 { margin: 0; font-family: var(--font-display); font-size: 1.6rem; }
.pf-title { color: var(--gold-hi); font-weight: 700; font-size: .9rem; }
.pf-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pf-bio { padding: 0 1.2rem; color: var(--text-main); white-space: pre-wrap; word-break: break-word; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .6rem; padding: 0 1.2rem; margin-top: .8rem; }
.pf-stats div { background: var(--panel-2); border-radius: 10px; padding: .6rem; text-align: center; }
.pf-stats b { display: block; font-size: 1.2rem; color: var(--gold-hi); }
.pf-stats span { font-size: .75rem; color: var(--text-muted); }
.pf-card > .soc-h, .pf-card > .pf-showcase, .pf-card > p { margin-left: 1.2rem; margin-right: 1.2rem; }
.pf-avatar { border-radius: 50%; object-fit: cover; border: 3px solid var(--gold-line); background: #1a1013; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gold-hi); flex: none; }
.pf-avatar.lg { width: 88px; height: 88px; font-size: 2rem; border-color: var(--panel); }
.pf-avatar.sm { width: 44px; height: 44px; }
.pf-edit { max-width: 820px; margin: 1.2rem auto; display: flex; flex-direction: column; gap: .7rem; }
.pf-edit label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; }
.pf-edit input[type=text], .pf-edit input:not([type]), .pf-edit textarea, .tp-who input, .sell-price { background: #0e080a; color: var(--text-main); border: 1px solid var(--border-subtle); border-radius: 8px; padding: .55rem .7rem; font: inherit; }
.pf-edit .pf-check { flex-direction: row; align-items: center; font-weight: 600; }
.pf-edit .btn-primary { align-self: flex-start; }
.pf-showcase, .mini-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.mini { position: relative; width: 74px; border-radius: 8px; border: 2px solid #3f3f46; background: #0e080a; overflow: hidden; text-align: center; }
.mini.rarity-R { border-color: #38bdf8; } .mini.rarity-UR { border-color: #c084fc; } .mini.rarity-SEC { border-color: #facc15; } .mini.rarity-UC { border-color: #34d399; }
.mini-art { height: 74px; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.mini b { position: absolute; top: 2px; left: 2px; font-size: .7rem; background: rgba(0,0,0,.75); color: var(--gold-hi); padding: 0 5px; border-radius: 6px; }
.mini span { display: block; font-size: .6rem; padding: 2px; line-height: 1.1; height: 1.5rem; overflow: hidden; }
.mini.is-bl { box-shadow: 0 0 10px #000, 0 0 0 1px #facc15; }

/* Boutique */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
.shop-item { background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 12px; padding: .7rem; display: flex; flex-direction: column; gap: .4rem; align-items: center; text-align: center; font-size: .85rem; }
.shop-item.is-eq { border-color: var(--gold-hi); box-shadow: 0 0 12px rgba(217,180,90,.35); }
.shop-prev { height: 62px; width: 100%; display: flex; align-items: center; justify-content: center; }
.banner-prev { width: 100%; height: 100%; border-radius: 8px; background-size: cover; }
.back-prev { width: 44px; height: 62px; border-radius: 6px; background: url("assets/cards/back.webp?v=48") center / 100% 100%; }
.back-prev[data-back=azure] { filter: hue-rotate(190deg) saturate(1.3); } .back-prev[data-back=emerald] { filter: hue-rotate(110deg) saturate(1.2); }
.back-prev[data-back=crimson] { filter: saturate(1.6) brightness(1.1); } .back-prev[data-back=gold] { filter: sepia(1) saturate(2.4) brightness(1.15); }

/* Cadres (avatar, classement, cartes) */
.frame-gold { border-color: #f3dc9a !important; box-shadow: 0 0 10px #d9b45a; }
.frame-neon { border-color: #22d3ee !important; box-shadow: 0 0 12px #22d3ee, 0 0 4px #e879f9; }
.frame-sakura { border-color: #f9a8d4 !important; box-shadow: 0 0 10px #f472b6; }
.frame-flame { border-color: #f97316 !important; box-shadow: 0 0 12px #ef4444, 0 0 4px #facc15; }
.frame-frost { border-color: #bae6fd !important; box-shadow: 0 0 12px #38bdf8; }
body[data-frame=gold] .tcg-card { box-shadow: 0 0 0 2px #f3dc9a, 0 0 14px rgba(217,180,90,.6); }
body[data-frame=neon] .tcg-card { box-shadow: 0 0 0 2px #22d3ee, 0 0 14px #e879f9; }
body[data-frame=sakura] .tcg-card { box-shadow: 0 0 0 2px #f9a8d4, 0 0 14px #f472b6; }
body[data-frame=flame] .tcg-card { box-shadow: 0 0 0 2px #f97316, 0 0 16px #ef4444; }
body[data-frame=frost] .tcg-card { box-shadow: 0 0 0 2px #bae6fd, 0 0 16px #38bdf8; }
/* Dos de carte équipé (ouverture de boosters) */
body[data-back=azure] .flip-back { filter: hue-rotate(190deg) saturate(1.3); }
body[data-back=emerald] .flip-back { filter: hue-rotate(110deg) saturate(1.2); }
body[data-back=crimson] .flip-back { filter: saturate(1.6) brightness(1.1); }
body[data-back=gold] .flip-back { filter: sepia(1) saturate(2.4) brightness(1.15); }
.flip-back-label { filter: none; }

/* Classement */
.lb-name { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; }
.lb-name:hover { color: var(--gold-hi); }
.lb-av { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--gold-line); object-fit: cover; }
.lb-title { display: block; color: var(--gold-hi); font-size: .7rem; }
.monthly { max-width: 820px; margin: 0 auto 1.2rem; background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 14px; padding: .4rem 1.2rem 1rem; }
.monthly-claim { background: rgba(217,180,90,.12); border: 1px solid var(--gold-line); border-radius: 10px; padding: .7rem; margin: .6rem 0; }
.monthly-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.monthly-list li { display: flex; gap: .7rem; align-items: center; padding: .35rem .2rem; border-bottom: 1px solid rgba(255,255,255,.05); }
.monthly-list li span { width: 2.2rem; } .monthly-list li a { flex: 1; } .monthly-list b { color: var(--gold-hi); }

/* Échanges & marché */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; }
.listing { display: flex; gap: .6rem; background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 12px; padding: .6rem; align-items: center; }
.listing-info { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.trade-top { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; margin-bottom: .6rem; }
.trade-row { background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 12px; padding: .8rem; margin-bottom: .7rem; }
.trade-sides { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.trade-sides > div:not(.trade-arrow) { flex: 1; min-width: 160px; }
.trade-arrow { font-size: 1.4rem; color: var(--gold-hi); }
.trade-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.soc-modal-box { position: relative; background: var(--panel); border: 1px solid var(--gold-line); border-radius: 16px; padding: 1.2rem; width: min(900px, 94vw); max-height: 88vh; overflow-y: auto; }
#soc-modal { display: flex; align-items: center; justify-content: center; z-index: 1200; }
#soc-modal.hidden { display: none !important; }
.tp-who { display: flex; gap: .5rem; margin-bottom: .8rem; }
.tp-who input { flex: 1; }
.tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) { .tp-cols { grid-template-columns: 1fr; } .pf-head { margin-top: -36px; } }
.pick-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: 10px; }
.pick-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .6rem; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .85rem; }
.pick-row.on { background: rgba(217,180,90,.12); }
.pick-name.rarity-R { color: #7dd3fc; } .pick-name.rarity-UR { color: #d8b4fe; } .pick-name.rarity-SEC { color: #fde047; } .pick-name.rarity-UC { color: #6ee7b7; }
.pick-step { display: flex; align-items: center; gap: .4rem; }
.pick-step button { background: var(--panel-2); color: var(--text-main); border: 1px solid var(--gold-line); border-radius: 6px; min-width: 28px; cursor: pointer; }

/* Ouverture groupée : la fenêtre défile quand il y a beaucoup de cartes, et se ferme toujours */
#pack-modal { overflow-y: auto; align-items: flex-start; -webkit-overflow-scrolling: touch; }
#pack-modal .modal-content { margin: auto; padding: 1rem 0 2rem; }
#pack-modal .modal-x { position: fixed; top: 14px; right: 18px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--gold-line); background: rgba(10,6,8,.9); color: var(--gold-hi); font-size: 1.2rem; cursor: pointer; }
#pack-modal .modal-x:hover { border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(217,180,90,.4); }

/* Zoom sur une carte (marché, échanges, profils) */
.zoomable { cursor: zoom-in; }
.mini.zoomable:hover { transform: translateY(-2px); border-color: var(--gold-hi); }
#zoom-modal { z-index: 1500; display: flex; align-items: center; justify-content: center; overflow-y: auto; }
#zoom-modal.hidden { display: none !important; }
#zoom-modal .modal-x { position: fixed; top: 14px; right: 18px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--gold-line); background: rgba(10,6,8,.9); color: var(--gold-hi); font-size: 1.2rem; cursor: pointer; }
.zoom-body { zoom: 1.9; margin: auto; }
.zoom-body .slab-wrapper { width: 250px; cursor: default; } .zoom-body .tcg-card { width: 230px; cursor: default; } .zoom-body .slab-wrapper .tcg-card { width: 100%; }
@media (max-width: 700px) { .zoom-body { zoom: 1.35; } }
