/* ============================================================
   WaifuCatch Dex — feuille de style
   Esthétique gacha sombre, tropicale / néon
   ============================================================ */

:root {
  /* Fond / surfaces */
  --bg: #0b0f1a;
  --bg-2: #0f1424;
  --surface: #161c30;
  --surface-2: #1c2440;
  --border: #2a3354;
  --text: #eaf0ff;
  --text-dim: #9aa6c9;
  --text-faint: #8b97bd;

  /* Accents néon tropicaux */
  --neon-1: #00e5ff;   /* cyan lagon */
  --neon-2: #ff4d8d;   /* rose corail */
  --neon-pink: #ff4d8d;
  --neon-purple: #b14dff;

  /* Couleurs de rareté */
  --r-common: #9e9e9e;
  --r-rare: #2196f3;
  --r-epic: #9c27b0;
  --r-legendary: #ff9800;
  --r-mythic: #f44336;
  --r-divine: #e040fb;
  --r-celestial: #00e5ff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --maxw: 1240px;

  /* Mise en page application */
  --sidebar-w: 300px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Rajdhani', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(177, 77, 255, .14), transparent 60%),
    radial-gradient(1000px 500px at 0% 0%, rgba(0, 229, 255, .12), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(255, 77, 141, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }

h1, h2, h3 { font-family: 'Orbitron', sans-serif; letter-spacing: .5px; margin: 0; }

a { color: inherit; text-decoration: none; }

img { display: block; }

/* ===================== APP : 2 COLONNES ===================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px 28px;
  background: linear-gradient(180deg, rgba(22, 28, 48, .92), rgba(13, 17, 30, .96));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 30;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 999px; }

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  font-size: 1.55rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, .6));
  flex: 0 0 auto;
}
.brand-logo {
  height: 42px; width: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, .5));
}
.brand-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  white-space: nowrap;
}
/* "WaifuCatch" mis en avant en cyan néon */
.brand-title-accent {
  color: var(--neon-1);
  text-shadow: 0 0 12px rgba(0, 229, 255, .55);
}

/* Zone connexion / profil dans la sidebar */
.header-right { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.header-right .btn { justify-content: center; }

/* Pied de sidebar : « Se déconnecter » épinglé tout en bas */
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; }
.sidebar-foot:empty { display: none; }
.sidebar-foot .btn { justify-content: center; }

/* Sections de la sidebar */
.sidebar-dex { display: flex; flex-direction: column; gap: 18px; }
.side-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.side-title {
  font-family: 'Orbitron', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}

/* ---- Repli de la sidebar (bureau) ---- */
.sidebar-collapse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.sidebar-collapse:hover { color: var(--text); border-color: var(--neon-1); }
.sidebar-collapse-chevron { font-size: 1.1rem; line-height: 1; }

/* Bouton de réouverture, affiché dans le contenu quand la sidebar est repliée */
.sidebar-expand {
  display: none;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: 18px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .2s ease;
}
.sidebar-expand:hover { border-color: var(--neon-1); box-shadow: 0 0 16px rgba(0, 229, 255, .25); }

/* État replié : la grille occupe toute la largeur */
body.sidebar-collapsed .app { grid-template-columns: minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { display: none; }
body.sidebar-collapsed .sidebar-expand { display: inline-flex; }

/* Bouton fermeture + voile (mobile uniquement) */
.sidebar-close { display: none; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 7, 14, .6);
  backdrop-filter: blur(2px);
}

/* Barre mobile (cachée en bureau) */
.mobile-topbar { display: none; }
.menu-toggle {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: '';
  display: block;
  width: 18px; height: 2px;
  background: var(--neon-1);
  border-radius: 2px;
  position: relative;
}
.menu-toggle-bars::before { position: absolute; top: -6px; }
.menu-toggle-bars::after { position: absolute; top: 6px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
}
.user-chip-name { font-weight: 600; font-size: 1rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar {
  height: 34px; width: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-purple);
}

/* ===================== BOUTONS ===================== */
.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
  color: #fff;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-twitch {
  background: #9146ff;
  box-shadow: 0 6px 22px rgba(145, 70, 255, .45);
}
.btn-twitch:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(145, 70, 255, .6); }
.btn-twitch svg { width: 18px; height: 18px; fill: currentColor; }
.btn-twitch.is-disabled { background: #4a4566; box-shadow: none; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--neon-1); color: var(--text); }

/* Bouton "Se déconnecter" : fond rouge. */
.btn-logout {
  background: linear-gradient(135deg, #e23b4e, #b1182c);
  color: #fff;
  box-shadow: 0 5px 18px rgba(226, 59, 78, .38);
}
.btn-logout:hover { filter: brightness(1.08); box-shadow: 0 7px 24px rgba(226, 59, 78, .55); }

/* ===================== MAIN / ÉTATS ===================== */
.main {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px 28px 50px;
}
.main > .footer { margin-top: auto; }

.state { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.state-loading, .state-error {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}
.state-icon { font-size: 3rem; margin-bottom: 8px; }
.state-error h2 { margin-bottom: 10px; color: var(--text); }
.state-error p { margin: 0 auto 18px; max-width: 460px; }

.spinner {
  width: 46px; height: 46px;
  margin: 0 auto 18px;
  border: 4px solid var(--surface-2);
  border-top-color: var(--neon-1);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Badge mode aperçu */
.preview-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 152, 0, .14);
  border: 1px solid rgba(255, 152, 0, .5);
  color: #ffce80;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.preview-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff9800; box-shadow: 0 0 8px #ff9800; }

/* ===================== LANDING ===================== */
.state-landing { position: relative; padding-top: 30px; }
.landing-card {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 40px auto;
  text-align: center;
  background: linear-gradient(180deg, rgba(22, 28, 48, .92), rgba(15, 20, 36, .92));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 44px 32px;
  box-shadow: var(--shadow);
}
.landing-title { font-size: clamp(1.6rem, 5vw, 2.4rem); margin-bottom: 14px; }
.grad-text {
  background: linear-gradient(90deg, var(--neon-1), var(--neon-pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.landing-sub { color: var(--text-dim); font-size: 1.15rem; line-height: 1.5; margin: 0 auto 26px; max-width: 480px; }
.landing-actions { display: flex; justify-content: center; }
.landing-note { color: var(--text-faint); margin-top: 16px; font-size: .98rem; }

/* Aperçu des cartes verrouillées derrière */
.landing-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  opacity: .35;
  filter: blur(1px);
  pointer-events: none;
  overflow: hidden;
  max-height: 640px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}

/* ===================== STATS (sidebar) ===================== */
.stats-bar { border-top: none; padding-top: 4px; }
.stats-head { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 6px; }
.stats-summary { font-size: 1.1rem; width: 100%; text-align: center; }
.stats-summary strong { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--neon-1); }
.stats-pct {
  margin-left: 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--neon-pink);
}
.progress {
  margin: 14px 0 0;
  height: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--neon-1), var(--neon-purple), var(--neon-pink));
  box-shadow: 0 0 14px rgba(0, 229, 255, .55);
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.rarity-stats { display: flex; flex-direction: column; gap: 8px; }
.rarity-stat { font-size: .98rem; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.rarity-stat .dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex: 0 0 auto; }
.rarity-stat b { color: var(--text); font-weight: 700; margin-left: auto; }

/* ===================== FILTRES ===================== */
.filters { margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { color: var(--text); border-color: var(--text-faint); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip.is-active {
  color: #fff;
  border-color: var(--chip-color, var(--neon-1));
  background: color-mix(in srgb, var(--chip-color, var(--neon-1)) 22%, var(--surface));
  box-shadow: 0 0 0 1px var(--chip-color, var(--neon-1)), 0 0 14px -2px var(--chip-color, var(--neon-1));
}

.search {
  width: 100%;
  min-width: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search::placeholder { color: var(--text-faint); }
.search:focus { border-color: var(--neon-1); box-shadow: 0 0 0 3px rgba(0, 229, 255, .18); }

/* Toggle obtenues seulement */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 46px; height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  transition: background .2s ease, border-color .2s ease;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-faint);
  transition: transform .2s ease, background .2s ease;
}
.toggle input:checked + .toggle-track { background: color-mix(in srgb, var(--neon-1) 35%, var(--surface)); border-color: var(--neon-1); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); background: var(--neon-1); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(0, 229, 255, .25); }
.toggle-label { font-weight: 600; color: var(--text-dim); }

/* ===================== GRILLE ===================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .25s ease;
  /* Perf : les cartes hors écran ne sont ni peintes ni animées (énorme gain sur
     les longues grilles mobiles — les auras box-shadow ne tournent que si visibles). */
  content-visibility: auto;
  contain-intrinsic-size: auto 340px;
}
.card:hover { transform: translateY(-6px); }

/* Carte obtenue : aura de rareté de base (raffinée par .dex-r-* plus bas) */
.card-owned {
  border-color: var(--rc, var(--border));
  box-shadow: 0 0 0 1px var(--rc), 0 8px 26px -8px var(--rc);
}
.card-owned:hover {
  box-shadow: 0 0 0 2px var(--rc), 0 18px 42px -8px var(--rc), 0 0 30px -4px var(--rc);
}
.card-locked:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent), 0 14px 34px -10px var(--rc);
}

/* ============================================================
   AURAS DE RARETÉ (grille) — langage visuel repris de l'overlay
   de spawn, adapté au thème sombre cyan/violet du Dex. Chaque
   rareté est plus intense que la précédente (céleste = max).
   Halo multi-couches sobre par défaut, intensifié au survol.
   ============================================================ */
.card-owned {
  --aura: 0 0 0 1px var(--rc), 0 0 14px -4px var(--rc), 0 10px 26px -10px #000;
  --aura-hover: 0 0 0 2px var(--rc), 0 0 22px -2px var(--rc), 0 0 44px -8px var(--rc), 0 18px 40px -10px #000;
}
.card-owned { box-shadow: var(--aura); }
.card-owned:hover { box-shadow: var(--aura-hover); }

.dex-r-rare {
  --aura: 0 0 0 1px var(--rc), 0 0 16px -4px var(--rc), 0 0 30px -8px color-mix(in srgb, var(--rc) 60%, transparent);
  --aura-hover: 0 0 0 2px var(--rc), 0 0 24px -2px var(--rc), 0 0 50px -6px color-mix(in srgb, var(--rc) 55%, transparent), 0 18px 42px -10px #000;
}
.dex-r-epic {
  --aura: 0 0 0 1px var(--rc), 0 0 18px -3px var(--rc), 0 0 36px -8px color-mix(in srgb, var(--rc) 60%, transparent);
  --aura-hover: 0 0 0 2px var(--rc), 0 0 28px -2px var(--rc), 0 0 60px -6px color-mix(in srgb, var(--rc) 55%, transparent), 0 18px 44px -10px #000;
}
.dex-r-legendary {
  --aura: 0 0 0 1px var(--rc), 0 0 20px -3px var(--rc), 0 0 44px -8px color-mix(in srgb, var(--rc) 55%, transparent);
  --aura-hover: 0 0 0 2px var(--rc), 0 0 30px -2px var(--rc), 0 0 70px -6px color-mix(in srgb, var(--rc) 55%, transparent), 0 0 96px -14px color-mix(in srgb, var(--rc) 40%, transparent);
  animation: dexAuraPulse 2.4s ease-in-out infinite;
}
.dex-r-mythic {
  --aura: 0 0 0 1px var(--rc), 0 0 22px -3px var(--rc), 0 0 50px -8px color-mix(in srgb, var(--rc) 55%, transparent);
  --aura-hover: 0 0 0 2px var(--rc), 0 0 34px -2px var(--rc), 0 0 80px -6px color-mix(in srgb, var(--rc) 50%, transparent), 0 0 110px -12px color-mix(in srgb, var(--rc) 38%, transparent);
  animation: dexAuraPulse 1.9s ease-in-out infinite;
}
.dex-r-divine {
  --aura: 0 0 0 1px var(--rc), 0 0 24px -2px var(--rc), 0 0 56px -8px color-mix(in srgb, var(--rc) 55%, transparent), 0 0 80px -14px color-mix(in srgb, var(--neon-purple) 50%, transparent);
  --aura-hover: 0 0 0 2px var(--rc), 0 0 38px -2px var(--rc), 0 0 90px -6px color-mix(in srgb, var(--rc) 50%, transparent), 0 0 130px -12px color-mix(in srgb, var(--neon-purple) 45%, transparent);
  animation: dexAuraPulse 1.6s ease-in-out infinite;
}
.dex-r-celestial {
  --aura: 0 0 0 1px var(--rc), 0 0 26px -2px var(--rc), 0 0 64px -8px color-mix(in srgb, var(--rc) 60%, transparent), 0 0 96px -12px color-mix(in srgb, #ffffff 35%, transparent);
  --aura-hover: 0 0 0 2px var(--rc), 0 0 44px -2px var(--rc), 0 0 100px -6px color-mix(in srgb, var(--rc) 55%, transparent), 0 0 150px -10px color-mix(in srgb, #ffffff 40%, transparent);
  animation: dexAuraPulse 1.2s ease-in-out infinite;
}
/* Le survol garde le halo intensifié même si une pulsation tourne */
.dex-r-legendary:hover, .dex-r-mythic:hover,
.dex-r-divine:hover, .dex-r-celestial:hover { animation: none; box-shadow: var(--aura-hover); }

@keyframes dexAuraPulse {
  0%, 100% { box-shadow: var(--aura); }
  50%      { box-shadow: var(--aura-hover); }
}

/* ── Balayage de lumière (shine) façon overlay, au survol ── */
.card .card-shine {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; overflow: hidden; opacity: 0;
}
.card .card-shine::before {
  content: ''; position: absolute; top: -60%; left: -75%;
  width: 62%; height: 220%;
  /* Reflet adouci (cohérent avec la modale) : plus discret + bords floutés. */
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.18) 50%, transparent 62%);
  filter: blur(4px);
  transform: rotate(8deg) translateX(0);
}
.card-owned:hover .card-shine { opacity: 1; }
.card-owned:hover .card-shine::before { animation: dexShine .85s ease-out; }
@keyframes dexShine {
  0%   { transform: rotate(8deg) translateX(0); }
  100% { transform: rotate(8deg) translateX(420%); }
}

/* ── Légère mise à l'échelle + remontée au survol (en plus du translate) ── */
.card-owned:hover { transform: translateY(-6px) scale(1.015); }

/* ============================================================
   OVERLAY STATISTIQUES (HP/ATK/DEF/VIT) — révélé au survol
   ============================================================ */
.card-stats-overlay {
  position: absolute;
  top: 40px; left: 10px; right: 10px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.card-owned:hover .card-stats-overlay { opacity: 1; transform: translateY(0); }
.cstat {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--rc) 16%, rgba(7,10,18,.78));
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  backdrop-filter: blur(6px);
}
.cstat-l {
  font-family: 'Orbitron', sans-serif;
  font-size: .56rem; letter-spacing: 1px;
  text-transform: uppercase; opacity: .7;
}
.cstat-v {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700; font-size: .82rem;
}
.cstat-hp .cstat-v { color: #4caf50; }
.cstat-atk .cstat-v { color: #ff5252; }
.cstat-def .cstat-v { color: #42a5f5; }
.cstat-spd .cstat-v { color: #e0e0e0; }

/* Indice de compteur (tooltip discret) sous le méta, révélé au survol */
.card-count-hint {
  font-family: 'Rajdhani', 'Orbitron', sans-serif;
  font-size: .68rem; font-weight: 600;
  color: var(--neon-1);
  opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity .2s ease, max-height .2s ease;
}
.card-owned:hover .card-count-hint { opacity: .85; max-height: 2.4em; }

/* ============================================================
   BANDEAU SOUS L'ART — élément + attaques + passif (compact)
   ============================================================ */
.card-footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 5px;
  background: linear-gradient(0deg, rgba(7,10,18,.96), rgba(7,10,18,.72) 70%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--rc) 35%, transparent);
  transform: translateY(100%);
  opacity: 0;
  transition: transform .24s ease, opacity .24s ease;
}
.card-owned:hover .card-footer { transform: translateY(0); opacity: 1; }
.cf-el {
  align-self: flex-start;
  font-size: .64rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  color: var(--el, var(--text));
  background: color-mix(in srgb, var(--el, var(--rc)) 18%, rgba(0,0,0,.5));
  border: 1px solid color-mix(in srgb, var(--el, var(--rc)) 55%, transparent);
}
.cf-atks { display: flex; flex-wrap: wrap; gap: 4px; }
.cf-atk {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .64rem; font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 2px 6px;
  max-width: 100%;
}
.cf-atk-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--el, var(--rc));
  box-shadow: 0 0 6px var(--el, var(--rc));
  flex: 0 0 auto;
}
.cf-passive {
  font-size: .62rem;
  color: #ffd76a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   AURA SPÉCIALE — cartes SECRÈTES / manipulation (ex. Nao-Chan)
   En plus de l'aura de rareté : un balayage holographique arc-en-ciel
   + un anneau pulsant, pour les distinguer des cartes normales.
   ============================================================ */
.card-secret::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255,0,128,.16), rgba(0,229,255,.16),
    rgba(177,77,255,.16), rgba(255,215,64,.16),
    transparent 70%);
  background-size: 300% 300%;
  mix-blend-mode: screen;
  animation: dexHolo 5s linear infinite;
}
.card-secret { position: relative; }
.card-owned.card-secret {
  box-shadow: var(--aura), 0 0 0 2px color-mix(in srgb, var(--neon-purple) 55%, transparent);
  animation: dexSecretRing 2.8s ease-in-out infinite;
}
.card-owned.card-secret:hover { animation: none; box-shadow: var(--aura-hover), 0 0 0 2px var(--neon-purple); }
@keyframes dexHolo {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes dexSecretRing {
  0%, 100% { box-shadow: var(--aura), 0 0 0 2px color-mix(in srgb, var(--neon-purple) 45%, transparent), 0 0 22px -6px var(--neon-purple); }
  50%      { box-shadow: var(--aura-hover), 0 0 0 2px var(--neon-1), 0 0 40px -6px var(--neon-1); }
}
.badge-secret {
  position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  z-index: 4;
  font-size: 1rem;
  color: #d9b8ff;
  text-shadow: 0 0 8px var(--neon-purple), 0 0 14px var(--neon-1);
  animation: dexSecretSpark 2.6s ease-in-out infinite;
  pointer-events: none;
}
/* Décale le ◈ si la carte est aussi évoluée (le ✦ occupe déjà le haut-centre) */
.card-evolved .badge-secret { top: auto; bottom: 8px; }
@keyframes dexSecretSpark {
  0%, 100% { opacity: .8; transform: translateX(-50%) scale(1); filter: hue-rotate(0deg); }
  50%      { opacity: 1;  transform: translateX(-50%) scale(1.2); filter: hue-rotate(60deg); }
}

/* Mobile / tactile : on fige les animations coûteuses et on révèle les
   infos en permanence (pas de survol fiable sur écran tactile). */
@media (hover: none), (max-width: 820px) {
  .dex-r-legendary, .dex-r-mythic, .dex-r-divine, .dex-r-celestial,
  .card-owned.card-secret, .card-secret::after, .badge-secret { animation: none; }
  /* Auras allégées : on garde le halo coloré (par --rc) mais SANS les énormes
     flous multi-couches (jusqu'à 150px) qui font ramer le scroll sur mobile.
     On réduit le rayon de flou → rasterisation bien moins coûteuse. */
  .dex-r-legendary { --aura: 0 0 0 1px var(--rc), 0 0 13px -4px var(--rc); }
  .dex-r-mythic    { --aura: 0 0 0 1px var(--rc), 0 0 15px -4px var(--rc); }
  .dex-r-divine    { --aura: 0 0 0 1px var(--rc), 0 0 17px -4px var(--rc); }
  .dex-r-celestial { --aura: 0 0 0 1px var(--rc), 0 0 19px -4px var(--rc); }
  .card-owned:hover { transform: translateY(-4px); }
  .card .card-shine { display: none; }
  /* Sur tactile, pas de survol fiable : on NE montre PAS les stats/élément en
     permanence (ça donnait un faux air de "carte survolée" et ça surchargeait).
     Un appui sur la carte ouvre la fiche détaillée avec toutes les infos. */
  .card-stats-overlay, .card-footer { display: none !important; }
  .card-count-hint { opacity: .85; max-height: none; }
  /* PERF MOBILE CRITIQUE : backdrop-filter est ruineux pendant le scroll, et ici il
     est multiplié par carte (le #numéro + les 4 lignes de stats toujours affichées).
     On le supprime sur tactile et on opacifie les fonds pour garder la lisibilité. */
  .card .cstat, .card .badge-event, .card .card-number, .card .card-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .card .cstat { background: color-mix(in srgb, var(--rc) 16%, rgba(7,10,18,.92)); }
  .card .badge-event, .card .card-number { background: rgba(11, 15, 26, .9); }
}
.card-art {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--bg-2);
  opacity: 0;
  transition: opacity .35s ease;
}
.card-art.is-loaded { opacity: 1; }
.card-art-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 2.4rem;
  color: var(--rc, var(--text-faint));
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
}
.card-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(180deg, transparent 45%, rgba(7, 10, 18, .92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  gap: 6px;
  transition: padding-bottom .24s ease;
}
/* Au survol d'une carte obtenue, le bandeau (élément/attaques/passif) remonte :
   on réserve de l'espace pour que le nom reste lisible au-dessus. */
.card-owned:hover .card-overlay { padding-bottom: 86px; }
.card-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}
.card-title { font-size: .9rem; color: var(--text-dim); line-height: 1.1; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.rarity-badge {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rc) 26%, #0b0f1a);
  color: #fff;
  border: 1px solid var(--rc);
}
/* Badge des cartes verrouillées : neutre, ne révèle aucune rareté. */
.rarity-badge-mystery {
  min-width: 22px; text-align: center;
  background: rgba(108, 115, 147, .22);
  color: #c7cbe0;
  border-color: rgba(108, 115, 147, .6);
}
.card-level {
  font-family: 'Orbitron', sans-serif;
  font-size: .74rem;
  font-weight: 700;
  color: var(--r-legendary);
  background: rgba(0, 0, 0, .45);
  padding: 3px 8px;
  border-radius: 999px;
}
.card-count {
  margin-left: auto;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  color: var(--neon-1);
  background: rgba(0, 0, 0, .5);
  padding: 3px 9px;
  border-radius: 999px;
}

/* Badge évènement / exclusif */
.badge-event {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 3;
  font-size: .8rem;
  background: rgba(11, 15, 26, .7);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  padding: 2px 8px;
  backdrop-filter: blur(4px);
}

/* Numéro de Dex (#001) — coin haut-gauche, sur cartes obtenues, verrouillées et vides */
.card-number {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 3;
  font-family: 'Orbitron', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-faint, #cfe);
  background: rgba(11, 15, 26, .6);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 2px 8px;
  backdrop-filter: blur(4px);
}

/* Carte verrouillée */
.card-locked {
  border-color: var(--rc, var(--border));
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--rc) 14%, transparent), transparent 60%),
    linear-gradient(170deg, var(--surface), var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent);
}
.card-locked .lock-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 4rem;
  color: color-mix(in srgb, var(--rc) 60%, var(--text-faint));
  text-shadow: 0 0 22px color-mix(in srgb, var(--rc) 50%, transparent);
}
.card-locked .card-overlay {
  background: linear-gradient(180deg, transparent 55%, rgba(7, 10, 18, .85) 100%);
}
.card-locked .card-name { color: var(--text-faint); letter-spacing: 3px; }

/* Shimmer des cartes mystère : UNIQUEMENT au survol (CSS pur, ne révèle aucune
   rareté). Pas d'animation au repos → fluide même avec ~900 cartes affichées. */
.card-locked::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; overflow: hidden;
  background: linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--rc) 22%, transparent) 50%, transparent 58%);
  filter: blur(6px);
  transform: translateX(-120%);
  opacity: 0;
}
.card-locked:hover::after { opacity: 1; animation: dexLockShimmer 1.1s ease-out; }
@keyframes dexLockShimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}
/* Pulse neutre du « ? » au survol (réutilise MYSTERY_COLOR via --rc). */
.card-locked:hover .lock-mark {
  transform: scale(1.08);
  text-shadow: 0 0 30px color-mix(in srgb, var(--rc) 70%, transparent);
  transition: transform .25s ease, text-shadow .25s ease;
}

/* Bandeau d'information « aperçu » au-dessus de la grille (pseudo inexistant). */
.dex-preview-note {
  grid-column: 1 / -1;
  background: color-mix(in srgb, var(--neon-purple) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--neon-purple) 40%, var(--border));
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: .95rem;
  line-height: 1.4;
}

/* ===================== DIVERS ===================== */
.stats-subnote { margin-top: 8px; font-size: .82rem; color: var(--text-dim); }

/* Slots de cartes (capacité de copies par carte) — encart stylé dans la sidebar. */
.card-slots {
  margin-top: 10px; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,193,7,0.10), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,193,7,0.28);
}
.card-slots .slots-ico { font-size: 1.1rem; line-height: 1; }
.card-slots .slots-num { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1.05rem; color: #ffd54f; }
.card-slots .slots-lbl { font-size: .8rem; color: var(--text-dim); }
.card-slots .slots-bonus { margin-left: auto; font-size: .72rem; font-weight: 600; color: #66bb6a; }

.no-results { text-align: center; color: var(--text-dim); padding: 50px 0; font-size: 1.1rem; }

.footer {
  text-align: center;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding: 18px;
  font-size: .95rem;
}
.footer-brand { color: var(--text-dim); font-weight: 600; }
.footer-link {
  color: var(--neon-purple); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--neon-purple) 45%, transparent);
  transition: color .2s ease, border-color .2s ease;
}
.footer-link:hover { color: var(--neon-1); border-color: var(--neon-1); }
.footer-link:focus-visible { outline: 2px solid var(--neon-1); outline-offset: 3px; border-radius: 2px; }

/* Tooltip simple (Twitch non configuré) */
.tip-wrap { position: relative; display: inline-block; }
.tip-wrap[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 40;
}

/* ===================== RESPONSIVE ===================== */

/* Tablette / mobile : la sidebar devient un tiroir coulissant */
@media (max-width: 820px) {
  .app {
    display: block;
    min-height: auto;
  }

  /* PERF mobile : le fond fixe (parallaxe) provoque un gros lag au scroll
     sur mobile → on le repasse en défilement normal. */
  body { background-attachment: scroll; }

  /* Barre supérieure mobile avec le bouton ☰
     (fond quasi-opaque, sans flou : le backdrop-filter sur un élément
     "sticky" force un repaint à chaque frame de scroll = lag). */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 25;
    margin: -28px -28px 18px;
    padding: 12px 16px;
    background: rgba(11, 15, 26, .96);
    border-bottom: 1px solid var(--border);
  }
  .brand-mobile .brand-logo { height: 32px; width: 32px; }
  .brand-mobile .brand-title { font-size: 1.05rem; }

  /* Sidebar = tiroir hors écran par défaut */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(320px, 86vw);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close {
    display: block;
    position: absolute;
    top: 12px; right: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
  }
  .sidebar-close:hover { color: var(--text); border-color: var(--neon-1); }

  /* Les bascules « bureau » n'ont pas de sens en mode tiroir mobile */
  .sidebar-collapse { display: none; }
  body.sidebar-collapsed .sidebar-expand { display: none; }
  /* Sur mobile, un repli accidentel ne doit jamais masquer le tiroir */
  body.sidebar-collapsed .sidebar { display: flex; }
  body.sidebar-collapsed .app { grid-template-columns: none; }

  .main { padding: 28px 18px 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .user-chip-name { max-width: 140px; }
  .card-name { font-size: .95rem; }
  .card-locked .lock-mark { font-size: 3rem; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Barre de commandes (combats / échanges / boutique)
   Top menu sleek — pilules icône + libellé, thème cyan/violet
   ============================================================ */
/* Menu d'actions VERTICAL dans la sidebar : pilules pleine largeur empilées. */
.dex-cmdbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(28, 36, 64, .85), rgba(15, 20, 36, .9));
  border: 1px solid var(--border);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(8px);
}
.actions-note {
  color: var(--text-faint);
  font-size: .95rem;
  font-weight: 600;
  padding: 4px 8px;
  text-align: center;
}

/* Groupes (Combat · Échanges · Boutique & codes) + fins séparateurs horizontaux */
.cmd-group { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.cmd-sep {
  height: 1px;
  width: 100%;
  margin: 2px 0;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* Pilule de commande — pleine largeur */
.btn-cmd {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(13, 17, 30, .55);
  color: var(--text-dim);
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .2s ease,
    transform .12s ease;
}
.btn-cmd .cmd-ico {
  font-size: 1.15rem;
  line-height: 1;
  flex: 0 0 auto;
  width: 1.4em;
  text-align: center;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, .4));
}
.btn-cmd .cmd-label { flex: 1 1 auto; }
.btn-cmd:hover {
  color: var(--text);
  transform: translateX(2px);
}
.btn-cmd:active { transform: translateX(0); }
.btn-cmd:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .55);
}

/* Accent CYAN — actions de combat */
.btn-cmd.cmd-battle:hover {
  border-color: rgba(0, 229, 255, .7);
  background: linear-gradient(180deg, rgba(0, 229, 255, .16), rgba(0, 229, 255, .06));
  box-shadow: 0 6px 20px rgba(0, 229, 255, .35), inset 0 0 14px rgba(0, 229, 255, .12);
}
/* Accent VIOLET — échanges */
.btn-cmd.cmd-trade:hover {
  border-color: rgba(177, 77, 255, .7);
  background: linear-gradient(180deg, rgba(177, 77, 255, .18), rgba(177, 77, 255, .06));
  box-shadow: 0 6px 20px rgba(177, 77, 255, .4), inset 0 0 14px rgba(177, 77, 255, .12);
}
/* Accent OR — boutique */
.btn-cmd.cmd-shop {
  color: #ffd76a;
  border-color: rgba(255, 152, 0, .35);
  background: linear-gradient(180deg, rgba(255, 152, 0, .12), rgba(255, 152, 0, .04));
}
.btn-cmd.cmd-shop:hover {
  color: #fff;
  border-color: rgba(255, 180, 60, .8);
  background: linear-gradient(180deg, rgba(255, 180, 60, .28), rgba(255, 152, 0, .08));
  box-shadow: 0 6px 20px rgba(255, 180, 60, .45), inset 0 0 14px rgba(255, 180, 60, .15);
}
/* Accent VERT — code promo */
.btn-cmd.cmd-promo {
  color: #8af7c8;
  border-color: rgba(0, 230, 150, .3);
  background: linear-gradient(180deg, rgba(0, 230, 150, .12), rgba(0, 230, 150, .04));
}
.btn-cmd.cmd-promo:hover {
  color: #fff;
  border-color: rgba(0, 230, 150, .8);
  background: linear-gradient(180deg, rgba(0, 230, 150, .26), rgba(0, 230, 150, .08));
  box-shadow: 0 6px 20px rgba(0, 230, 150, .4), inset 0 0 14px rgba(0, 230, 150, .14);
}

/* ----- Modale Code promo ----- */
.promo-intro { color: var(--text-dim); margin: 0 0 14px; text-align: center; }
.promo-form { display: flex; gap: 10px; flex-wrap: wrap; }
.promo-input {
  flex: 1 1 180px;
  min-width: 0;
  font-family: 'Orbitron', 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.promo-input:focus {
  outline: none;
  border-color: var(--neon-1);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, .35);
}
.promo-input::placeholder { letter-spacing: .5px; text-transform: none; font-weight: 600; color: var(--text-faint); }
.promo-submit { flex: 0 0 auto; }
.promo-result { margin-top: 14px; text-align: center; }

/* Petit badge flottant (Défis / Offres) */
.cmd-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px;
  border-radius: 999px; font-size: .72rem; font-weight: 800; line-height: 1;
  background: var(--neon-1); color: #04111a;
  box-shadow: 0 0 10px rgba(0, 229, 255, .6);
}

/* « Défis » qui pulse quand il y a des invitations */
.btn-cmd.has-invites {
  color: var(--text);
  border-color: var(--neon-purple);
  animation: cmdInvitePulse 1.6s ease-in-out infinite;
}
@keyframes cmdInvitePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(177, 77, 255, .5), 0 0 10px rgba(177, 77, 255, .30); }
  50%      { box-shadow: 0 0 0 1px rgba(177, 77, 255, .8), 0 0 20px rgba(177, 77, 255, .60); }
}
.btn-action {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  box-shadow: 0 6px 22px rgba(177, 77, 255, .35);
  white-space: nowrap;
  justify-content: center;
}
.btn-action:hover { filter: brightness(1.1); box-shadow: 0 8px 28px rgba(177, 77, 255, .55); }
/* Variante cyan pour différencier l'échange normal de l'échange mystère */
.btn-action.btn-action-alt {
  background: linear-gradient(135deg, var(--neon-1), #2196f3);
  box-shadow: 0 6px 22px rgba(0, 229, 255, .3);
}
.btn-action.btn-action-alt:hover { box-shadow: 0 8px 28px rgba(0, 229, 255, .5); }

/* Mobile : le menu reste vertical dans le tiroir latéral. */
@media (max-width: 520px) {
  .btn-cmd { padding: 11px 13px; font-size: .96rem; }
}
.btn-primary {
  background: linear-gradient(135deg, var(--neon-1), #2196f3);
  box-shadow: 0 6px 22px rgba(0, 229, 255, .3);
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   Modale générique
   ============================================================ */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(4, 7, 16, .72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: popIn .2s ease;
}
@keyframes popIn { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.25rem; margin: 0; }
.modal-close {
  background: var(--surface-2); border: none; color: var(--text-dim);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--neon-pink); color: #fff; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-intro { color: var(--text-dim); line-height: 1.5; margin: 0 0 16px; }
.field-label { display: block; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; font-size: .95rem; }
.modal-row { display: flex; gap: 10px; align-items: stretch; }
.modal-row .search { flex: 1; }
.err-text { color: var(--neon-pink); font-weight: 600; margin-top: 14px; }

/* Mini spinner (in-modal) */
.mini-spinner {
  width: 28px; height: 28px; margin: 8px auto;
  border: 3px solid var(--surface-2); border-top-color: var(--neon-1);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Résultat de combat
   ============================================================ */
.battle-result { margin-top: 18px; }
.battle-verdict {
  font-family: 'Orbitron', sans-serif; font-size: 1.5rem; text-align: center;
  padding: 14px; border-radius: var(--radius-sm); margin-bottom: 16px;
}
.battle-verdict.win { background: rgba(0, 229, 255, .12); color: var(--neon-1); }
.battle-verdict.lose { background: rgba(244, 67, 54, .12); color: #ff6b6b; }
.battle-verdict.draw { background: var(--surface-2); color: var(--text-dim); }
.battle-teams { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.battle-team { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.team-head { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.battle-vs { font-family: 'Orbitron', sans-serif; color: var(--text-faint); font-size: 1.1rem; }
.team-chip {
  background: var(--surface-2); border-left: 3px solid var(--rc, #888);
  border-radius: 6px; padding: 5px 9px; font-size: .92rem; font-weight: 600;
}
.team-chip small { color: var(--text-faint); font-weight: 500; }
.battle-log-wrap { margin-top: 6px; }
.battle-log-wrap summary { cursor: pointer; color: var(--text-dim); font-weight: 600; padding: 6px 0; }
.battle-log {
  margin-top: 10px; max-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  font-size: .9rem;
}
.log-line { padding: 5px 9px; border-radius: 5px; background: var(--bg-2); }
.log-line.log-A { border-left: 3px solid var(--neon-1); }
.log-line.log-B { border-left: 3px solid var(--neon-pink); }
.log-faint { background: rgba(244, 67, 54, .12); color: #ff8a8a; font-weight: 600; border: none; }
.crit { color: #ffd740; font-weight: 700; }
.adv-up { color: var(--neon-1); }
.adv-down { color: var(--text-faint); }

/* ============================================================
   Échange mystère
   ============================================================ */
.trade-picks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 8px;
}
.trade-pick {
  text-align: left; background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--rc, #888); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform .12s, border-color .15s, background .15s;
}
.trade-pick:hover { transform: translateY(-2px); background: var(--surface); }
.trade-pick:disabled { opacity: .5; cursor: not-allowed; }
.trade-pick.is-selected {
  border-color: var(--neon-1);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--neon-1), 0 0 16px rgba(0, 229, 255, .25);
}
/* Échange direct : champ pseudo + bouton d'envoi */
.trade-target-label {
  display: block; font-weight: 700; font-size: .9rem;
  color: var(--text-dim); margin: 12px 0 6px;
}
.trade-target { width: 100%; margin-bottom: 12px; }
.trade-send { width: 100%; justify-content: center; }
.trade-pick-name { font-weight: 700; }
.trade-pick-meta { color: var(--text-faint); font-size: .85rem; }
.trade-result { margin-top: 14px; }
.trade-success {
  background: rgba(0, 229, 255, .12); color: var(--neon-1);
  padding: 16px; border-radius: var(--radius-sm); text-align: center;
  line-height: 1.5; margin-bottom: 14px;
}
.trade-queued {
  background: var(--surface-2); color: var(--text-dim);
  padding: 16px; border-radius: var(--radius-sm); text-align: center; line-height: 1.5;
}
/* Échange direct : select « waifu demandée » */
.trade-want { width: 100%; margin-bottom: 4px; }

/* ============================================================
   Révélation d'un échange réussi (carte reçue brillante)
   ============================================================ */
.trade-reveal {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center;
}
.trade-reveal-title {
  margin: 4px 0 2px; font-size: 1.05rem; font-weight: 800; line-height: 1.4;
  background: linear-gradient(90deg, var(--neon-1), var(--neon-purple));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--neon-1);
  animation: tradeRevealTitle .5s ease-out both;
}
@keyframes tradeRevealTitle {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
/* Entrée « fait briller » : pop + halo qui pulse autour de la carte reçue */
.trade-reveal-card.cd-head-card {
  width: 100%;
  animation: tradeRevealPop .55s cubic-bezier(.2, .9, .25, 1.2) both,
             tradeRevealGlow 2.4s ease-in-out .55s infinite;
  border-radius: var(--radius-sm);
}
@keyframes tradeRevealPop {
  0%   { opacity: 0; transform: scale(.82) translateY(14px); }
  60%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tradeRevealGlow {
  0%, 100% { box-shadow: 0 0 22px -8px var(--rc), 0 0 40px -16px var(--neon-1); }
  50%      { box-shadow: 0 0 40px -4px var(--rc), 0 0 72px -10px var(--neon-purple); }
}
/* Rejoue le shine de l'art à l'apparition de la révélation */
.trade-reveal-card .card-shine::before { animation: dexShine 1s ease-out .35s; }
.trade-reveal-go { margin-top: 2px; min-width: 200px; }
@media (max-width: 540px) {
  .trade-reveal-card.cd-head-card { animation: tradeRevealPop .55s ease-out both; }
  .trade-reveal-title { font-size: .98rem; }
  .trade-reveal-go { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .trade-reveal-title,
  .trade-reveal-card.cd-head-card { animation: none; }
  .trade-reveal-card .card-shine::before { animation: none; }
  /* Fige les auras / holos / glows de la grille sur leur état statique. */
  .dex-r-legendary, .dex-r-mythic, .dex-r-divine, .dex-r-celestial {
    animation: none; box-shadow: var(--aura);
  }
  .card-owned.card-secret { animation: none; }
  .card-secret::after { animation: none; }
  .badge-secret, .badge-evolved { animation: none; }
  .card-evolved { animation: none; }
  .card-locked::after { animation: none; }
}

/* ============================================================
   Offres d'échange entrantes (📨)
   ============================================================ */
/* Badge de comptage sur le bouton « Offres » */
.offer-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; font-size: .78rem; font-weight: 800; line-height: 1;
  background: var(--neon-1); color: #04111a;
  box-shadow: 0 0 10px rgba(0, 229, 255, .55);
}
.offer-list { display: flex; flex-direction: column; gap: 12px; }
.offer-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--neon-1); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.offer-card.is-removed { opacity: .55; }
.offer-body { line-height: 1.55; }
.offer-line { margin: 2px 0; }
.offer-gift { color: var(--text-dim); }
.offer-actions { display: flex; gap: 10px; margin-top: 10px; }
.offer-actions .btn { flex: 1; justify-content: center; }
.offer-result:not(:empty) { margin-top: 10px; }
@media (max-width: 520px) {
  .offer-actions { flex-direction: column; }
}
@media (max-width: 520px) {
  .battle-teams { flex-direction: column; }
  .modal-row { flex-direction: column; }
}

/* ============================================================
   Waifu ÉVOLUÉE — garde sa couleur de rareté, gagne une aura
   dorée animée + un badge ✦ (haut-centre) + un tag dans le méta.
   ============================================================ */
.card-evolved {
  box-shadow: 0 0 0 1px rgba(255, 215, 106, .55), 0 0 16px rgba(255, 200, 80, .42);
  animation: evolvedGlow 2.6s ease-in-out infinite;
}
@keyframes evolvedGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 215, 106, .40), 0 0 12px rgba(255, 200, 80, .32); }
  50%      { box-shadow: 0 0 0 1px rgba(255, 215, 106, .85), 0 0 26px rgba(255, 200, 80, .60); }
}
.badge-evolved {
  position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  z-index: 3;
  font-size: 1rem;
  color: #ffd76a;
  text-shadow: 0 0 8px rgba(255, 215, 106, .95), 0 0 14px rgba(255, 180, 60, .6);
  animation: evolvedSpark 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes evolvedSpark {
  0%, 100% { opacity: .85; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.18); }
}
.evolved-tag {
  font-size: .72rem;
  font-weight: 700;
  color: #ffd76a;
  text-shadow: 0 0 6px rgba(255, 200, 80, .7);
  white-space: nowrap;
}
/* Mobile : on fige les animations (glow + ✦ restent visibles, sans coût/frame) */
@media (max-width: 820px) {
  .card-evolved, .badge-evolved { animation: none; }
}

/* ============================================================
   COMBAT STRATÉGIQUE — constructeur d'équipe
   ============================================================ */

/* Badge élément réutilisable */
.el-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  color: #fff;
  background: color-mix(in srgb, var(--el, #b0bec5) 26%, #0b0f1a);
  border: 1px solid var(--el, #b0bec5);
}

/* Compteur chef / sbires */
.tb-counter { display: flex; gap: 10px; margin-bottom: 12px; }
.tb-cnt {
  font-family: 'Orbitron', sans-serif;
  font-size: .82rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.tb-cnt.ok { color: var(--neon-1); border-color: var(--neon-1); box-shadow: 0 0 12px -4px var(--neon-1); }

/* Liste des copies */
.tb-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 42vh; overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}
.tb-list::-webkit-scrollbar { width: 8px; }
.tb-list::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 999px; }

.tb-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rc, #888);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: transform .12s ease, box-shadow .2s ease, border-color .15s ease;
}
.tb-card.is-chef { box-shadow: 0 0 0 1px var(--rc), 0 0 16px -4px var(--rc); border-color: var(--rc); }
.tb-card.is-sbire { background: color-mix(in srgb, var(--neon-1) 8%, var(--surface-2)); }
.tb-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tb-card-name { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: .98rem; }
.tb-evolved { color: #ffd76a; text-shadow: 0 0 8px rgba(255, 215, 106, .9); }
.tb-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tb-class { font-size: .78rem; font-weight: 600; color: var(--text-dim); }
.tb-card-atk { font-size: .82rem; color: var(--text-faint); }

.tb-card-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.tb-btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: .82rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.tb-btn:hover { color: var(--text); border-color: var(--text-faint); }
.tb-btn-chef.on {
  color: #fff; border-color: var(--r-legendary);
  background: color-mix(in srgb, var(--r-legendary) 30%, var(--surface));
  box-shadow: 0 0 12px -3px var(--r-legendary);
}
.tb-btn-sbire.on {
  color: #fff; border-color: var(--neon-1);
  background: color-mix(in srgb, var(--neon-1) 30%, var(--surface));
  box-shadow: 0 0 12px -3px var(--neon-1);
}
.tb-noChef { font-size: .76rem; color: var(--text-faint); text-align: center; padding: 6px 0; }

/* Bloc passif du chef */
.tb-passive {
  margin-top: 14px;
  background: rgba(255, 215, 106, .08);
  border: 1px solid rgba(255, 215, 106, .35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.tb-passive-head { font-weight: 700; color: #ffd76a; }
.tb-passive-head b { color: #ffe9a8; }
.tb-passive-sub { color: var(--text-dim); font-size: .9rem; margin: 6px 0 8px; }
.tb-buffs { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-buff {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tb-buff.on { border-color: #ffd76a; color: #ffe9a8; }
.tb-buff input { accent-color: #ffd76a; }

.combat-loading { text-align: center; padding: 30px 10px; color: var(--text-dim); }

/* ============================================================
   ÉCRAN DE COMBAT ANIMÉ
   ============================================================ */
.combat-screen { display: flex; flex-direction: column; gap: 10px; }
.cb-side-head {
  font-family: 'Orbitron', sans-serif;
  font-size: .85rem; font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.cb-enemy .cb-side-head { color: var(--neon-pink); }
.cb-you .cb-side-head { color: var(--neon-1); }
.cb-vs {
  text-align: center;
  font-family: 'Orbitron', sans-serif; font-weight: 900;
  color: var(--text-faint); font-size: 1.1rem;
  letter-spacing: 2px;
}
.cb-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.cb-card {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rc, var(--border));
  background: linear-gradient(170deg, var(--surface-2), var(--bg-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc, #888) 30%, transparent);
  padding: 6px;
  min-height: 132px;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease, opacity .4s ease, filter .4s ease;
}
.cb-card.is-active {
  box-shadow: 0 0 0 2px var(--neon-1), 0 0 18px -2px var(--neon-1);
  transform: translateY(-3px);
  z-index: 2;
}
.cb-card.is-hit { animation: cbHit .34s ease; }
@keyframes cbHit {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); filter: brightness(1.6); }
  60% { transform: translateX(4px); }
}
.cb-card.cb-ko {
  opacity: .32;
  filter: grayscale(1) brightness(.7);
}
.cb-card.cb-ko .cb-name::after { content: ' 💀'; }

.cb-art, .cb-art-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.cb-art-fallback {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif; font-size: 2rem;
  color: var(--rc, var(--text-faint));
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
}
.cb-chef {
  position: absolute; top: 4px; left: 4px; z-index: 4;
  color: #ffd76a; font-size: 1rem;
  text-shadow: 0 0 8px rgba(255, 215, 106, .95);
}
.cb-fx {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.cb-name {
  position: relative; z-index: 3; margin-top: auto;
  font-weight: 700; font-size: .8rem; line-height: 1.05;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
  background: linear-gradient(180deg, transparent, rgba(7, 10, 18, .85));
  padding: 6px 2px 2px;
}
.cb-hpbar {
  position: relative; z-index: 3;
  height: 7px; border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  overflow: hidden;
  margin-top: 3px;
}
.cb-hpfill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #66bb6a, #aed581);
  transition: width .45s cubic-bezier(.3, .8, .3, 1);
}
.cb-hpfill.low { background: linear-gradient(90deg, #f44336, #ff8a65); }
.cb-el {
  position: relative; z-index: 3;
  font-size: .64rem; color: var(--text-dim);
  text-align: center; margin-top: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
}

/* Carte ennemie face cachée */
.cb-back {
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(177, 77, 255, .18), transparent 60%),
    linear-gradient(170deg, var(--surface), var(--bg-2));
  align-items: center; justify-content: center;
}
.cb-back-mark {
  font-size: 2.4rem; color: var(--neon-purple);
  text-shadow: 0 0 16px rgba(177, 77, 255, .6);
  margin: auto;
}

/* Textes flottants */
.cb-float {
  position: absolute;
  font-family: 'Orbitron', sans-serif; font-weight: 900;
  font-size: 1rem; white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .9);
  animation: cbFloat 1.1s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes cbFloat {
  0% { transform: translateY(8px) scale(.8); opacity: 0; }
  20% { transform: translateY(-2px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-34px) scale(1); opacity: 0; }
}
.cb-float-dmg { color: #ff6b6b; }
.cb-float-crit { color: #ffd740; font-size: 1.1rem; }
.cb-float-heal { color: #66ffa6; }
.cb-float-burn { color: #ff9b42; }
.cb-float-stun { color: #ffe066; font-size: 1.3rem; }
.cb-float-ko { color: #ff5252; font-size: 1.2rem; }

.cb-controls { display: flex; justify-content: center; margin-top: 6px; }
.cb-end-actions {
  display: flex; gap: 10px; justify-content: center; margin-top: 4px;
}

@media (max-width: 520px) {
  .cb-card { min-height: 108px; }
  .cb-name { font-size: .72rem; }
  .tb-card { flex-direction: column; align-items: stretch; }
  .tb-card-actions { flex-direction: row; }
}

/* Mobile : on calme l'aura clignotante */
@media (max-width: 820px) {
  .cb-card.is-active { animation: none; }
}

/* ============================================================
   DÉTAIL D'UNE CARTE — exemplaires + attaques par copie
   ============================================================ */
.cd-head {
  border-left: 4px solid var(--rc, var(--neon-1));
  background: linear-gradient(120deg, color-mix(in srgb, var(--rc, var(--neon-1)) 12%, transparent), transparent 70%);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.cd-head-name {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.cd-head-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── En-tête « grande carte sous ses effets de rareté » ── */
.cd-head-card {
  border-left: none;
  display: flex;
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--rc) 20%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--rc) 10%, var(--surface-2)), var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent),
    0 0 36px -10px var(--rc),
    inset 0 0 60px -30px var(--rc);
}
/* Détail d'une carte : modale plus large pour profiter de la grande image. */
.modal:has(.cd-head-card) { max-width: 720px; }
.cd-card-art {
  position: relative;
  flex: 0 0 280px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--rc);
  box-shadow: 0 0 24px -6px var(--rc), 0 0 48px -12px color-mix(in srgb, var(--rc) 55%, transparent);
  background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
}
.cd-card-art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.cd-art-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif; font-size: 3rem;
  color: var(--rc); opacity: .5;
}
.cd-card-art .card-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.cd-card-art .card-shine::before {
  content: ''; position: absolute; top: -60%; left: -75%;
  width: 65%; height: 220%;
  /* Reflet adouci : cœur lumineux discret + dégradé progressif + bords floutés
     (avant : bande blanche nette à .4 d'opacité, trop marquée). */
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.15) 50%, transparent 62%);
  filter: blur(7px);
  transform: rotate(8deg);
  animation: dexShine 3.2s ease-in-out infinite;
}
.cd-card-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cd-head-title { font-size: .92rem; font-style: italic; color: var(--text-dim); margin-top: -4px; }
.cd-secret-tag {
  font-size: .72rem; font-weight: 700;
  color: #d9b8ff;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--neon-purple);
  border-radius: 999px; padding: 3px 10px;
  text-shadow: 0 0 8px var(--neon-purple);
}

/* Halo de rareté du grand visuel : réutilise les classes .dex-r-* */
.cd-head-card.dex-r-legendary .cd-card-art,
.cd-head-card.dex-r-mythic .cd-card-art,
.cd-head-card.dex-r-divine .cd-card-art,
.cd-head-card.dex-r-celestial .cd-card-art {
  animation: dexArtGlow 2.2s ease-in-out infinite;
}
@keyframes dexArtGlow {
  0%, 100% { box-shadow: 0 0 24px -6px var(--rc), 0 0 48px -12px color-mix(in srgb, var(--rc) 55%, transparent); }
  50%      { box-shadow: 0 0 40px -4px var(--rc), 0 0 80px -10px color-mix(in srgb, var(--rc) 60%, transparent); }
}
/* Shimmer holographique secret dans la modale */
.cd-head-card.card-secret .cd-card-art::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%,
    rgba(255,0,128,.18), rgba(0,229,255,.18), rgba(177,77,255,.18), rgba(255,215,64,.18),
    transparent 70%);
  background-size: 300% 300%;
  mix-blend-mode: screen;
  animation: dexHolo 5s linear infinite;
}

/* Barres de statistiques (style overlay) */
.cd-statbars { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cds-row { display: flex; align-items: center; gap: 8px; }
.cds-l {
  flex: 0 0 34px;
  font-family: 'Orbitron', sans-serif;
  font-size: .62rem; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim);
}
.cds-track {
  flex: 1 1 auto; height: 8px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.cds-fill {
  display: block; height: 100%; border-radius: 999px;
  transition: width .4s ease;
}
.cds-hp .cds-fill  { background: linear-gradient(90deg, #2e7d32, #4caf50); }
.cds-atk .cds-fill { background: linear-gradient(90deg, #c62828, #ff5252); }
.cds-def .cds-fill { background: linear-gradient(90deg, #1565c0, #42a5f5); }
.cds-spd .cds-fill { background: linear-gradient(90deg, #9e9e9e, #e0e0e0); }
.cds-v {
  flex: 0 0 auto; min-width: 30px; text-align: right;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700; font-size: .82rem;
}
.cds-hp .cds-v  { color: #4caf50; }
.cds-atk .cds-v { color: #ff5252; }
.cds-def .cds-v { color: #42a5f5; }
.cds-spd .cds-v { color: #e0e0e0; }

@media (max-width: 560px) {
  .cd-head-card { flex-direction: column; align-items: center; text-align: center; }
  .cd-card-art { flex-basis: auto; width: 60%; max-width: 200px; }
  .cd-head-tags { justify-content: center; }
}
@media (hover: none), (max-width: 820px) {
  .cd-head-card.dex-r-legendary .cd-card-art,
  .cd-head-card.dex-r-mythic .cd-card-art,
  .cd-head-card.dex-r-divine .cd-card-art,
  .cd-head-card.dex-r-celestial .cd-card-art,
  .cd-card-art .card-shine::before,
  .cd-head-card.card-secret .cd-card-art::after { animation: none; }
}

.cd-count {
  font-family: 'Orbitron', sans-serif;
  font-size: .76rem;
  font-weight: 700;
  color: var(--neon-1);
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--neon-1);
  border-radius: 999px;
  padding: 3px 10px;
}

.cd-copies { display: flex; flex-direction: column; gap: 12px; }
.cd-copy {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.cd-copy.is-evolved {
  border-color: rgba(255, 215, 106, .55);
  box-shadow: 0 0 14px -6px rgba(255, 200, 80, .6);
}
.cd-copy-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.cd-copy-no {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
}
.cd-evolved {
  font-size: .76rem; font-weight: 700;
  color: #ffd76a;
  text-shadow: 0 0 6px rgba(255, 200, 80, .7);
}
.cd-copy-lvl {
  margin-left: auto;
  font-family: 'Orbitron', sans-serif;
  font-size: .76rem; font-weight: 700;
  color: var(--r-legendary);
}

.cd-atks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.cd-atk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
}
.cd-atk-name { font-weight: 700; color: var(--text); }
.cd-atk-fx {
  font-size: .85rem;
  color: var(--text-dim);
  font-style: italic;
}
.cd-atk-fx::before { content: '· '; color: var(--text-faint); font-style: normal; }
.cd-empty { color: var(--text-faint); font-size: .9rem; font-style: italic; }
.cd-passive {
  margin-top: 10px;
  font-size: .9rem;
  color: #ffd76a;
}
.cd-passive b { color: #ffe9a8; }
.cd-note {
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   ÉCONOMIE — badge de points, notifications, boutique, relâcher
   ============================================================ */

/* --- Badge de points (header / sidebar) --- */
.points-badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 229, 255, .14), rgba(177, 77, 255, .16));
  border: 1px solid rgba(0, 229, 255, .45);
  box-shadow: 0 0 18px rgba(0, 229, 255, .22), inset 0 0 12px rgba(177, 77, 255, .12);
  font-weight: 700;
  color: var(--text);
}
.points-badge-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, .8));
}
.points-badge-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--neon-1), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .5px;
}
.points-badge-label {
  font-size: .8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* --- Notification de gain/perte flottante --- */
.points-gain {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, 0);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 60;
  animation: pointsGainRise 1.7s ease-out forwards;
}
.points-gain.points-gain-floating {
  position: fixed;
  left: auto;
  right: 18px;
  top: 18px;
  transform: none;
}
.points-gain.is-gain {
  color: #062e15;
  background: linear-gradient(135deg, #5cffb0, #00e5ff);
  box-shadow: 0 4px 18px rgba(0, 229, 170, .5);
}
.points-gain.is-loss {
  color: var(--text);
  background: rgba(28, 36, 64, .92);
  border: 1px solid rgba(177, 77, 255, .55);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.points-gain-reason {
  font-size: .72rem;
  font-weight: 700;
  opacity: .85;
  text-transform: uppercase;
  letter-spacing: .4px;
}
@keyframes pointsGainRise {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(.9); }
  15%  { opacity: 1; transform: translate(-50%, -10px) scale(1); }
  70%  { opacity: 1; transform: translate(-50%, -34px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54px) scale(.96); }
}

/* --- Bouton Boutique dans la barre d'actions --- */
.btn-action.btn-action-shop {
  background: linear-gradient(135deg, #ffd76a, #ff9800);
  box-shadow: 0 6px 22px rgba(255, 152, 0, .35);
  color: #2a1c00;
}
.btn-action.btn-action-shop:hover { box-shadow: 0 8px 28px rgba(255, 180, 60, .55); }

/* --- Boutique (modale) --- */
.shop-head { margin-bottom: 14px; }
.shop-balance {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.shop-balance b {
  background: linear-gradient(90deg, var(--neon-1), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.shop-note {
  margin: 6px 0 0;
  font-size: .88rem;
  color: var(--text-dim);
}
.shop-note b { color: var(--neon-1); }
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.shop-item:hover {
  border-color: rgba(0, 229, 255, .5);
  box-shadow: 0 0 16px rgba(0, 229, 255, .18);
}
.shop-item-main { flex: 1 1 auto; min-width: 0; }
.shop-item-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}
.shop-item-desc {
  margin-top: 4px;
  font-size: .9rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.shop-item-effect {
  margin-top: 4px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--neon-1);
}
.shop-buy { flex: 0 0 auto; white-space: nowrap; }
.shop-buy:disabled {
  opacity: .45;
  filter: grayscale(.6);
  cursor: not-allowed;
  box-shadow: none;
}
.shop-toast {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  background: linear-gradient(135deg, rgba(0, 229, 170, .22), rgba(0, 229, 255, .18));
  border: 1px solid rgba(0, 229, 170, .5);
  color: var(--text);
  animation: fadeIn .2s ease;
}
.shop-toast.is-error {
  background: rgba(255, 77, 141, .15);
  border-color: rgba(255, 77, 141, .55);
}

/* --- Bouton « Relâcher » (détail d'une carte) --- */
.cd-release-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.cd-release-btn {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-1));
  box-shadow: 0 6px 20px rgba(177, 77, 255, .35);
  color: #fff;
  font-weight: 700;
}
.cd-release-btn:hover { filter: brightness(1.1); box-shadow: 0 8px 26px rgba(0, 229, 255, .5); }
.cd-release-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.cd-release-result { margin-top: 10px; }

/* Mobile : la notif flottante reste lisible, sans animation coûteuse */
@media (max-width: 820px) {
  .points-gain { animation-duration: 1.4s; }
}

/* ============================================================
   COMBAT TEMPS RÉEL (Phase 3) — recherche / invitations / lobby
   Thème : cyan #00e5ff · violet #b14dff
   ============================================================ */

/* Badge "Défis" qui pulse quand il y a des invitations */
.btn-action.has-invites {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 1px var(--neon-purple), 0 0 14px rgba(177, 77, 255, .35);
  animation: rtInvitePulse 1.6s ease-in-out infinite;
}
@keyframes rtInvitePulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--neon-purple), 0 0 10px rgba(177, 77, 255, .30); }
  50%      { box-shadow: 0 0 0 1px var(--neon-purple), 0 0 20px rgba(177, 77, 255, .55); }
}

/* --- Écran d'attente / recherche --- */
.rt-wait {
  text-align: center;
  padding: 18px 8px 6px;
}
.rt-wait-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 14px 0 4px;
  color: var(--text);
}
.rt-wait-sub {
  color: var(--text-dim);
  font-size: .92rem;
  margin: 2px 0;
}

/* Spinner néon */
.rt-spinner {
  width: 54px;
  height: 54px;
  margin: 6px auto 0;
  border-radius: 50%;
  border: 4px solid rgba(0, 229, 255, .15);
  border-top-color: var(--neon-1);
  border-right-color: var(--neon-purple);
  animation: rtSpin .9s linear infinite;
}
@keyframes rtSpin { to { transform: rotate(360deg); } }

/* --- Invitations entrantes (modale "Défis") --- */
.rt-invites { display: flex; flex-direction: column; gap: 10px; }
.rt-invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--neon-purple);
  border-radius: var(--radius-sm);
}
.rt-invite-txt { font-size: .98rem; }
.rt-invite-actions { display: flex; gap: 8px; flex-shrink: 0; }
.rt-invite-actions .btn { padding: 7px 12px; }

/* --- Salon de combat (lobby) --- */
.rt-lobby-head {
  background: linear-gradient(135deg, rgba(0, 229, 255, .08), rgba(177, 77, 255, .08));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.rt-opp {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 1.05rem;
}
.rt-opp-vs {
  font-weight: 900;
  color: var(--neon-1);
  letter-spacing: 1px;
}
.rt-dot { font-size: .85rem; font-weight: 600; }
.rt-dot.rt-on  { color: #5cf08a; }
.rt-dot.rt-off { color: #ff6b6b; }

.rt-ready-line {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.rt-badge {
  font-size: .85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.rt-badge.on  { color: #5cf08a; border-color: rgba(92, 240, 138, .5); background: rgba(92, 240, 138, .10); }
.rt-badge.off { color: var(--text-dim); }

/* Équipe verrouillée après "Je suis prêt" */
.rt-locked {
  text-align: center;
  padding: 18px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rt-locked-title { font-weight: 700; color: #5cf08a; font-size: 1.05rem; margin: 0 0 4px; }
.rt-hidden-note { margin-top: 10px; font-size: .85rem; color: var(--text-faint); }

/* Placeholder "combat actif" (le plateau arrive plus tard) */
.rt-active {
  text-align: center;
  padding: 26px 12px 10px;
  background: radial-gradient(ellipse at top, rgba(177, 77, 255, .12), transparent 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rt-active-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, .55));
  animation: rtClash 1.2s ease-in-out infinite;
}
@keyframes rtClash {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}
.rt-active-title { font-weight: 800; font-size: 1.1rem; margin: 12px 0 4px; color: var(--text); }

/* Combat annulé / terminé */
.rt-ended { text-align: center; padding: 22px 12px 8px; }
.rt-ended-msg { font-size: 1.02rem; color: var(--text); margin-bottom: 6px; }

/* Mobile */
@media (max-width: 560px) {
  .rt-invite { flex-direction: column; align-items: stretch; }
  .rt-invite-actions { justify-content: stretch; }
  .rt-invite-actions .btn { flex: 1; }
  .rt-active-icon { font-size: 2.4rem; }
}

/* ============================================================
   PLATEAU DE COMBAT TEMPS RÉEL (Phase 3 — étape 2)
   Thème cyan #00e5ff / violet #b14dff, sombre, fluide.
   ============================================================ */

/* Modale élargie pour le plateau */
.modal.modal-board { max-width: 920px; }
.modal.modal-board .modal-body { padding: 14px; }

.bb {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(177, 77, 255, .14), transparent 60%),
    radial-gradient(120% 70% at 50% 110%, rgba(0, 229, 255, .14), transparent 60%),
    linear-gradient(180deg, #0a0e1c, #0c1326 55%, #0a0e1c);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow: hidden;
}

.bb-side { display: flex; flex-direction: column; gap: 6px; }
.bb-enemy { padding-bottom: 2px; }
.bb-me { padding-top: 2px; }

.bb-side-head { display: flex; }
.bb-enemy .bb-side-head { justify-content: flex-start; }
.bb-me .bb-side-head { justify-content: flex-end; }
.bb-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: .82rem;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .04em;
}
.bb-tag-enemy { background: rgba(255, 77, 141, .16); color: #ff8bb3; border: 1px solid rgba(255, 77, 141, .4); }
.bb-tag-me { background: rgba(0, 229, 255, .14); color: var(--neon-1); border: 1px solid rgba(0, 229, 255, .42); }

/* Rangée : banc d'un côté, actif au centre */
.bb-rowwrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.bb-enemy .bb-rowwrap { grid-template-columns: 1fr auto; }   /* banc à gauche, actif centre-droit */
.bb-me .bb-rowwrap { grid-template-columns: auto 1fr; }       /* actif, puis banc à droite */
.bb-active-slot { display: flex; justify-content: center; }
.bb-bench { display: flex; gap: 8px; flex-wrap: wrap; }
.bb-bench-enemy { justify-content: flex-start; }
.bb-bench-me { justify-content: flex-end; }

/* ---- Carte ---- */
.bb-card {
  position: relative;
  border-radius: 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--rc, #888) 16%, transparent), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--rc, #888) 10%, #11182c), #0c1224);
  border: 1px solid color-mix(in srgb, var(--rc, #888) 45%, transparent);
  box-shadow: var(--aura, 0 0 0 1px color-mix(in srgb, var(--rc, #888) 35%, transparent)), 0 8px 22px -10px #000;
  display: flex; flex-direction: column; align-items: center;
  padding: 7px 7px 8px;
  transition: transform .18s ease, box-shadow .18s ease, opacity .35s ease;
}
.bb-big { width: 188px; }
.bb-small { width: 86px; padding: 5px; }

.bb-art-wrap {
  position: relative; width: 100%; aspect-ratio: 1/1;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, #182038, #0e1424);
}
.bb-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bb-art-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 2rem;
  color: color-mix(in srgb, var(--rc, #888) 70%, var(--text-faint));
}
.bb-small .bb-art-fallback { font-size: 1.3rem; }

.bb-name {
  margin-top: 5px; font-weight: 700; font-size: .9rem; color: var(--text);
  text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bb-small .bb-name { font-size: .72rem; }
.bb-meta { font-size: .72rem; color: var(--text-dim); margin-top: 1px; text-align: center; }

.bb-crown {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 1.15rem; filter: drop-shadow(0 0 6px rgba(255, 200, 60, .8)); z-index: 3;
}
.bb-small .bb-crown { font-size: .9rem; top: -8px; }
.bb-evo {
  position: absolute; top: 4px; right: 5px; font-size: .95rem; color: var(--neon-1);
  text-shadow: 0 0 8px var(--neon-1); z-index: 3;
}

/* HP bar */
.bb-hpbar {
  position: relative; width: 100%; height: 11px; margin-top: 6px;
  background: rgba(0, 0, 0, .55); border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
}
.bb-small .bb-hpbar { height: 7px; margin-top: 4px; }
.bb-hpfill {
  height: 100%; border-radius: 999px;
  transition: width .55s cubic-bezier(.4, 0, .2, 1), background .3s;
}
.bb-hpfill.high { background: linear-gradient(90deg, #00e5ff, #5cf08a); }
.bb-hpfill.mid  { background: linear-gradient(90deg, #ffb347, #ffd966); }
.bb-hpfill.low  { background: linear-gradient(90deg, #f44336, #ff8a65); }
.bb-hptxt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; letter-spacing: .03em;
}

.bb-status { display: flex; gap: 3px; min-height: 16px; margin-top: 3px; }
.bb-st { font-size: .85rem; line-height: 1; filter: drop-shadow(0 0 3px rgba(0,0,0,.6)); }
.bb-small .bb-st { font-size: .72rem; }

/* Carte face cachée (dos) */
.bb-back {
  background:
    repeating-linear-gradient(45deg, rgba(177,77,255,.12) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, #1a2140, #0c1226);
  border: 1px solid rgba(177, 77, 255, .4);
  box-shadow: inset 0 0 22px -8px var(--neon-purple), 0 8px 22px -10px #000;
}
.bb-back-inner {
  width: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.bb-back-mark { font-size: 2rem; color: var(--neon-purple); opacity: .65; text-shadow: 0 0 14px var(--neon-purple); }
.bb-small .bb-back-mark { font-size: 1.3rem; }
.bb-back-chef { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 1rem; filter: drop-shadow(0 0 6px rgba(255,200,60,.8)); }

/* Carte K.O. */
.bb-faint { opacity: .42; filter: grayscale(.85); }
.bb-faint .bb-name::after { content: ' 💀'; }

/* ---- Bannière de tour ---- */
.bb-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 14px; border-radius: 999px; margin: 2px auto; min-width: 60%;
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: .92rem;
  text-align: center; transition: background .3s, color .3s, box-shadow .3s;
  border: 1px solid var(--border);
}
.bb-banner-mine {
  background: linear-gradient(90deg, rgba(0,229,255,.18), rgba(0,229,255,.06));
  color: var(--neon-1); border-color: rgba(0,229,255,.5);
  box-shadow: 0 0 22px -6px rgba(0,229,255,.55);
  animation: bbBannerPulse 1.8s ease-in-out infinite;
}
.bb-banner-their {
  background: rgba(177,77,255,.1); color: #cba6ff; border-color: rgba(177,77,255,.4);
}
.bb-banner-neutral { background: var(--surface-2); color: var(--text-dim); }
.bb-turnnum {
  font-size: .72rem; color: var(--text-faint); letter-spacing: .08em;
  padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.3);
}
@keyframes bbBannerPulse {
  0%, 100% { box-shadow: 0 0 22px -8px rgba(0,229,255,.5); }
  50%      { box-shadow: 0 0 34px -4px rgba(0,229,255,.75); }
}

/* ---- Contrôles d'action ---- */
.bb-actions {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  margin-top: 4px; min-height: 8px;
}
.bb-actions-empty { min-height: 0; }
.bb-target-chef {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: .85rem; color: #ffcc80; margin-bottom: 8px;
  padding: 5px 12px; border-radius: 18px;
  background: rgba(255,152,0,.10); border: 1px solid rgba(255,152,0,.32);
}
.bb-target-chef input { accent-color: #ff9800; cursor: pointer; }
.bb-atk-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }
.bb-atk {
  flex: 1 1 200px; max-width: 320px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; padding: 10px 14px; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--el, var(--neon-1)) 22%, #121a30), #0e1426);
  border: 1px solid color-mix(in srgb, var(--el, var(--neon-1)) 55%, transparent);
  border-radius: var(--radius-sm); color: var(--text);
  transition: transform .14s, box-shadow .18s, filter .15s;
}
.bb-atk:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--el, var(--neon-1)) 70%, transparent);
  filter: brightness(1.08);
}
.bb-atk:disabled { opacity: .5; cursor: default; }
.bb-atk-name { font-weight: 800; font-size: .98rem; font-family: 'Orbitron', sans-serif; }
.bb-atk-line { font-size: .8rem; color: var(--text-dim); }
.bb-atk-eff { font-size: .74rem; color: color-mix(in srgb, var(--el, var(--neon-1)) 80%, #fff); }
.bb-forfeit { font-size: .85rem; padding: 6px 16px; }
.bb-forfeit-confirm { background: rgba(244, 67, 54, .18); color: #ff8a80; border-color: rgba(244,67,54,.5); }

/* ---- Effets flottants ---- */
.bb-fx { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 6; }
.bb-float {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: 'Orbitron', sans-serif; font-weight: 800; white-space: nowrap;
  text-shadow: 0 2px 6px #000; animation: bbFloatUp 1.15s ease-out forwards;
}
@keyframes bbFloatUp {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(.85); }
  18%  { opacity: 1; transform: translate(-50%, -6px) scale(1.08); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}
.bb-dmg { color: #ff6b6b; font-size: 1.4rem; }
.bb-dmg.big { font-size: 1.9rem; }
.bb-float-crit .bb-crit { color: #ffd54f; font-size: .8rem; letter-spacing: .06em; }
.bb-float-crit .bb-dmg { color: #ff5252; }
.bb-adv { font-size: .68rem; padding: 1px 6px; border-radius: 999px; }
.bb-adv.up { color: #5cf08a; background: rgba(92,240,138,.16); }
.bb-adv.down { color: #9aa6c9; background: rgba(154,166,201,.14); }
.bb-eff { font-size: 1.6rem; }
.bb-float-heal .bb-eff, .bb-float-heal .bb-tag-txt { color: #5cf08a; }
.bb-float-burn .bb-dmg { color: #ff8a65; }
.bb-float-stun .bb-tag-txt, .bb-float-heal .bb-tag-txt { font-size: .72rem; color: var(--text); }
.bb-ko { color: #ff5252; font-size: 1.5rem; letter-spacing: .08em; }

/* ---- Animations de carte ---- */
.bb-lunge-down { animation: bbLungeDown .42s ease; z-index: 5; }
.bb-lunge-up   { animation: bbLungeUp .42s ease; z-index: 5; }
@keyframes bbLungeDown {
  0% { transform: translateY(0); } 45% { transform: translateY(26px) scale(1.05); } 100% { transform: translateY(0); }
}
@keyframes bbLungeUp {
  0% { transform: translateY(0); } 45% { transform: translateY(-26px) scale(1.05); } 100% { transform: translateY(0); }
}
.bb-hit { animation: bbHit .38s ease; }
@keyframes bbHit {
  0%, 100% { transform: translateX(0); filter: none; }
  20% { transform: translateX(-7px); filter: brightness(1.7) drop-shadow(0 0 10px #fff); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.bb-fainting { animation: bbFaint .75s ease forwards; }
@keyframes bbFaint {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: .42; transform: translateY(16px) rotate(5deg); }
}
.bb-flip { animation: bbFlip .6s ease; }
@keyframes bbFlip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg) scale(1.04); }
  100% { transform: rotateY(0); }
}
.bb-revive { animation: bbRevive .9s ease; }
@keyframes bbRevive {
  0% { box-shadow: 0 0 0 0 rgba(92,240,138,0); }
  40% { box-shadow: 0 0 30px -4px rgba(92,240,138,.9); }
  100% { box-shadow: var(--aura, none); }
}

/* ============================================================
   POLISH COMBAT (additif) — game-feel « jeu de cartes »
   ============================================================ */

/* Carte ACTIVE (grand format) : aura colorée par l'élément + légère respiration. */
.bb-big:not(.bb-faint) {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--el, var(--rc, #888)) 70%, transparent),
    0 0 26px -6px color-mix(in srgb, var(--el, var(--rc, #888)) 80%, transparent),
    0 10px 26px -10px #000;
  animation: bbActiveBreath 2.6s ease-in-out infinite;
}
@keyframes bbActiveBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.bb-big:not(.bb-faint) .bb-art-wrap::after {
  /* Reflet « holographique » discret qui glisse sur l'art de la carte active. */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.16) 50%, transparent 62%);
  background-size: 240% 240%; animation: bbHolo 3.4s linear infinite;
}
@keyframes bbHolo { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* CHEF : cadre doré (anneau or) pour bien le distinguer des sbires. */
.bb-card:has(> .bb-crown) {
  border-color: rgba(255, 205, 90, .7);
  box-shadow:
    0 0 0 2px rgba(255, 205, 90, .55),
    0 0 22px -6px rgba(255, 205, 90, .65),
    0 8px 22px -10px #000;
}
.bb-big:has(> .bb-crown):not(.bb-faint) {
  box-shadow:
    0 0 0 2px rgba(255, 205, 90, .85),
    0 0 30px -5px rgba(255, 205, 90, .8),
    0 10px 26px -10px #000;
}

/* Barre de PV : brillance qui glisse + pulsation rouge quand bas. */
.bb-hpfill { position: relative; overflow: hidden; }
.bb-hpfill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  background-size: 200% 100%; animation: bbHpShine 2.8s linear infinite;
}
@keyframes bbHpShine { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.bb-hpfill.low { animation: bbLowPulse 1s ease-in-out infinite; }
@keyframes bbLowPulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.35); } }

/* Impact plus punchy : léger tremblement du plateau quand une carte encaisse. */
.bb-card.bb-hit::before {
  content: ''; position: absolute; inset: 0; z-index: 6; border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.55), transparent 60%);
  animation: bbImpactFlash .38s ease-out forwards; pointer-events: none;
}
@keyframes bbImpactFlash { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.25); } }

@media (prefers-reduced-motion: reduce) {
  .bb-big:not(.bb-faint), .bb-big:not(.bb-faint) .bb-art-wrap::after,
  .bb-hpfill::after, .bb-hpfill.low, .bb-card.bb-hit::before { animation: none; }
}

/* ---- Overlay de fin ---- */
.bb-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 16, .82); backdrop-filter: blur(4px);
  animation: fadeIn .25s ease; border-radius: var(--radius);
}
.bb-end-card {
  position: relative; text-align: center; padding: 30px 34px;
  border-radius: var(--radius); min-width: 260px;
  background: linear-gradient(160deg, #131a30, #0c1224);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: popIn .3s ease;
}
.bb-overlay-win .bb-end-card { border-color: rgba(255,200,60,.55); box-shadow: 0 0 60px -10px rgba(255,200,60,.6); }
.bb-overlay-lose .bb-end-card { border-color: rgba(244,67,54,.5); }
.bb-end-title { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: 2rem; margin-bottom: 8px; }
.bb-overlay-win .bb-end-title {
  color: #ffd54f; text-shadow: 0 0 24px rgba(255,200,60,.7);
  animation: bbWinPulse 1.4s ease-in-out infinite;
}
.bb-overlay-lose .bb-end-title { color: #ff6b6b; }
.bb-overlay-draw .bb-end-title { color: var(--text-dim); }
.bb-overlay-cancel .bb-end-title { color: #ffb347; font-size: 1.5rem; }
@keyframes bbWinPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 24px rgba(255,200,60,.6); }
  50% { transform: scale(1.06); text-shadow: 0 0 40px rgba(255,200,60,.9); }
}
.bb-end-sub { color: var(--text-dim); margin-bottom: 18px; }
.bb-confetti {
  position: absolute; inset: -40px; pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, #ffd54f 0 3px, transparent 4px),
    radial-gradient(circle at 80% 20%, var(--neon-1) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 5%, var(--neon-purple) 0 3px, transparent 4px),
    radial-gradient(circle at 35% 30%, #5cf08a 0 3px, transparent 4px),
    radial-gradient(circle at 70% 40%, #ff8bb3 0 3px, transparent 4px);
  animation: bbConfetti 1.6s ease-out infinite;
  opacity: .8;
}
@keyframes bbConfetti {
  0% { transform: translateY(-20px); opacity: 0; }
  30% { opacity: .9; }
  100% { transform: translateY(60px); opacity: 0; }
}

/* ---- Toast ---- */
.bb-toast {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%) translateY(10px);
  z-index: 18; padding: 9px 18px; border-radius: 999px;
  background: rgba(244, 67, 54, .92); color: #fff; font-weight: 700; font-size: .85rem;
  box-shadow: 0 8px 24px -8px #000; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.bb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Mobile ---- */
@media (max-width: 760px) {
  .modal.modal-board { max-width: 100%; }
  .bb-big { width: 150px; }
  .bb-small { width: 70px; }
  .bb-atk { flex: 1 1 100%; }
}
@media (max-width: 560px) {
  .bb { padding: 8px; gap: 6px; }
  .bb-rowwrap, .bb-enemy .bb-rowwrap, .bb-me .bb-rowwrap {
    grid-template-columns: 1fr; justify-items: center; gap: 6px;
  }
  /* Ordre : actif d'abord, banc ensuite, en colonne */
  .bb-enemy .bb-active-slot { order: 1; }
  .bb-enemy .bb-bench { order: 2; }
  .bb-me .bb-active-slot { order: 1; }
  .bb-me .bb-bench { order: 2; }
  .bb-bench-enemy, .bb-bench-me { justify-content: center; }
  .bb-big { width: 130px; }
  .bb-small { width: 62px; }
  .bb-small .bb-name { font-size: .64rem; }
  .bb-banner { font-size: .8rem; min-width: 100%; padding: 7px 10px; }
  .bb-end-title { font-size: 1.6rem; }
}

/* Réduit les animations si demandé */
@media (prefers-reduced-motion: reduce) {
  .bb-banner-mine, .bb-overlay-win .bb-end-title, .bb-confetti,
  .bb-lunge-up, .bb-lunge-down, .bb-hit, .bb-flip, .bb-revive, .bb-fainting { animation: none; }
}

/* ── Musique d'ambiance ── */
.music-ctl {
  position: fixed; bottom: 16px; right: 16px; z-index: 200;
  display: flex; align-items: center; gap: 8px;
  background: rgba(18, 18, 32, .92); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 6px 12px 6px 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  backdrop-filter: blur(6px);
}
.music-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #00e5ff, #b14dff); color: #0a0a12;
  transition: transform .15s ease, box-shadow .2s ease;
}
.music-btn:hover { transform: scale(1.06); box-shadow: 0 0 16px rgba(0, 229, 255, .5); }
.music-btn.is-on { box-shadow: 0 0 14px rgba(0, 229, 255, .6); }
.music-btn-sm { width: 32px; height: 32px; font-size: 15px; background: linear-gradient(135deg, #2b2b44, #3a3a5c); color: #e8e8ff; }
.music-btn-sm.is-on { background: linear-gradient(135deg, #00e5ff, #b14dff); color: #0a0a12; }
.music-vol { width: 84px; accent-color: #00e5ff; cursor: pointer; }
@media (max-width: 560px) { .music-vol { width: 54px; } .music-ctl { bottom: 12px; right: 12px; } }

/* ── Carte « déjà vue » (relâchée/échangée) : silhouette grisée, non cliquable ── */
.card-seen { cursor: default; }
.card-seen .card-art { filter: grayscale(1) brightness(.5) contrast(.95); transition: filter .25s ease, opacity .35s ease; }
.card-seen:hover .card-art { filter: grayscale(.8) brightness(.62); }
.card-seen .card-seen-veil { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(8,10,20,.35), rgba(8,10,20,.6)); }
.card-seen .card-overlay { z-index: 2; }
.card-seen .card-name { color: var(--text-dim); letter-spacing: 1px; }
.card-seen .rarity-badge { opacity: .68; }
.card-seen .card-seen-tag {
  font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-faint); background: rgba(255,255,255,.06);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px;
}
@media (prefers-reduced-motion: reduce) { .card-seen .card-art { transition: none; } }

/* ============================================================
   WAIFU TIMER DEX — overlay cadeau gacha (boîte qui tremble puis s'ouvre)
   ============================================================ */
.gift-overlay {
  position: fixed; inset: 0; z-index: 9000; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 40%, rgba(40,18,60,.82), rgba(6,8,18,.94));
  backdrop-filter: none;
}
.gift-overlay.show { display: flex; animation: gift-fade .35s ease both; }
@keyframes gift-fade { from { opacity: 0; } to { opacity: 1; } }
.gift-stage { position: relative; width: 100%; max-width: 420px; text-align: center; }
.gift-glow {
  position: absolute; left: 50%; top: 38%; width: 380px; height: 380px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc, #ffd278) 55%, transparent), rgba(255,140,200,.18) 46%, transparent 70%);
  animation: gift-glow-pulse 2.4s ease-in-out infinite;
}
@keyframes gift-glow-pulse { 0%,100% { opacity: .5; transform: translate(-50%,-50%) scale(.9); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.14); } }

/* Rayons de lumière tournants derrière la boîte (anticipation). */
.gift-rays {
  position: absolute; left: 50%; top: 38%; width: 460px; height: 460px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; opacity: .55;
  background: conic-gradient(from 0deg,
    transparent 0 16deg, color-mix(in srgb, var(--rc, #ffd278) 40%, transparent) 16deg 20deg,
    transparent 20deg 40deg, color-mix(in srgb, var(--rc, #ffd278) 28%, transparent) 40deg 43deg, transparent 43deg 60deg);
  -webkit-mask: radial-gradient(circle, transparent 28%, #000 42%, transparent 72%);
          mask: radial-gradient(circle, transparent 28%, #000 42%, transparent 72%);
  animation: gift-rays-spin 9s linear infinite;
}
@keyframes gift-rays-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* Étincelles d'anticipation autour de la boîte (disparaissent à l'ouverture). */
.gift-sparkles { position: absolute; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; z-index: 4; transition: opacity .3s ease; }
.gift-stage.opened .gift-sparkles, .gift-stage.opened .gift-rays { opacity: 0; }
.gsk {
  position: absolute; left: 0; top: 0; font-size: .95rem; opacity: 0;
  transform: translate(var(--x), var(--y)) scale(.4);
  animation: gsk-twinkle 1.5s ease-in-out var(--d, 0s) infinite;
  filter: drop-shadow(0 0 5px rgba(255,225,150,.7));
}
@keyframes gsk-twinkle {
  0%, 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3) rotate(0deg); }
  50% { opacity: 1; transform: translate(var(--x), var(--y)) scale(1) rotate(18deg); }
}

/* Flash blanc à l'ouverture. */
.gift-flash {
  position: absolute; left: 50%; top: 38%; width: 60px; height: 60px; transform: translate(-50%,-50%) scale(0);
  border-radius: 50%; pointer-events: none; z-index: 6; opacity: 0;
  background: radial-gradient(circle, #fff 0 30%, color-mix(in srgb, var(--rc, #ffe6a0) 70%, #fff) 45%, transparent 70%);
}
.gift-flash.go { animation: gift-flash-go .6s ease-out both; }
@keyframes gift-flash-go {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0); }
  18% { opacity: 1; transform: translate(-50%,-50%) scale(7); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(11); }
}

/* Confettis & emojis kawaii. */
.gift-confetti { position: absolute; left: 0; right: 0; top: 8%; height: 1px; pointer-events: none; z-index: 7; }
.gcf {
  position: absolute; top: 0; border-radius: 2px; opacity: 0;
  animation-name: gcf-fall; animation-timing-function: cubic-bezier(.3,.6,.4,1); animation-fill-mode: forwards;
}
.gcf-emo { background: none !important; width: auto !important; height: auto !important; font-size: 1.05rem; filter: drop-shadow(0 0 4px rgba(255,210,140,.6)); }
@keyframes gcf-fall {
  0% { opacity: 0; transform: translate(0, -20px) rotate(0deg) scale(.6); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), 340px) rotate(var(--rot, 360deg)) scale(1); }
}

/* La boîte */
.gift-box {
  position: relative; width: 150px; height: 130px; margin: 30px auto 0; z-index: 5;
  transform-origin: 50% 100%; animation: gift-shake 1.45s ease-in-out both;
}
/* Reflet qui balaie la boîte pendant l'attente. */
.gift-glint {
  position: absolute; left: -8px; top: 18px; width: 166px; height: 78px; border-radius: 9px; overflow: hidden;
  pointer-events: none; z-index: 5;
}
.gift-glint::before {
  content: ''; position: absolute; top: -20%; left: -60%; width: 40%; height: 140%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-18deg); animation: gift-glint-sweep 1.6s ease-in-out infinite;
}
@keyframes gift-glint-sweep { 0% { left: -60%; } 55%, 100% { left: 130%; } }
.gift-body {
  position: absolute; left: 0; bottom: 0; width: 150px; height: 96px; border-radius: 10px;
  background: linear-gradient(160deg, #ff7ac0, #d4408f); box-shadow: 0 12px 30px rgba(0,0,0,.45), inset 0 -8px 16px rgba(0,0,0,.25);
}
.gift-lid {
  position: absolute; left: -8px; top: 18px; width: 166px; height: 40px; border-radius: 9px;
  background: linear-gradient(160deg, #ff9ad2, #e25aa3); box-shadow: 0 6px 14px rgba(0,0,0,.4);
  transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.5,-0.4,.3,1.4), opacity .5s ease;
  z-index: 3;
}
.gift-ribbon-v { position: absolute; left: 50%; bottom: 0; width: 22px; height: 96px; transform: translateX(-50%); background: linear-gradient(180deg, #ffe082, #ffb300); z-index: 2; }
.gift-ribbon-h { position: absolute; left: -8px; top: 22px; width: 166px; height: 30px; background: linear-gradient(180deg, #ffe082, #ffb300); z-index: 2; }
.gift-bow { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); font-size: 2rem; z-index: 4; transition: transform .5s ease, opacity .5s ease; }
.gift-box.open .gift-lid { transform: translateY(-44px) rotate(-26deg); opacity: 0; }
.gift-box.open .gift-bow { transform: translate(-50%, -60px) scale(.4) rotate(40deg); opacity: 0; }
.gift-box.open .gift-glint { display: none; }
.gift-box.open { animation: gift-pop .5s ease both; }
/* Tremblement qui s'intensifie (anticipation) avant l'ouverture. */
@keyframes gift-shake {
  0% { transform: rotate(0) scale(1); }
  10% { transform: rotate(-3deg) scale(1.01); }
  20% { transform: rotate(3deg); }
  35% { transform: rotate(-5deg) scale(1.02); }
  50% { transform: rotate(5deg); }
  65% { transform: rotate(-7deg) scale(1.04); }
  80% { transform: rotate(7deg); }
  90% { transform: rotate(-9deg) scale(1.06); }
  100% { transform: rotate(0) scale(1.08); }
}
@keyframes gift-pop { 0% { transform: scale(1.08); } 35% { transform: scale(1.2); } 100% { transform: scale(0); opacity: 0; } }

/* Révélation de la carte */
.gift-reveal { position: relative; display: none; margin-top: -40px; }
.gift-reveal.show { display: block; animation: gift-reveal-in .55s cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes gift-reveal-in { from { opacity: 0; transform: translateY(24px) scale(.85); } to { opacity: 1; transform: none; } }
.gift-burst {
  position: absolute; left: 50%; top: 30%; width: 280px; height: 280px; transform: translate(-50%,-50%);
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle, rgba(255,225,140,.5), transparent 60%),
    conic-gradient(from 0deg, transparent 0 14deg, rgba(255,220,150,.5) 14deg 16deg, transparent 16deg 30deg);
  animation: gift-burst-spin 6s linear infinite;
}
@keyframes gift-burst-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
.gift-title { position: relative; z-index: 1; margin: 0 0 12px; font-size: 1.25rem; color: #ffe08a; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.gift-reveal .trade-reveal-card, .gift-reveal .reveal-card {
  position: relative; z-index: 1; margin: 0 auto;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc, #ffd76a) 60%, transparent), 0 0 28px color-mix(in srgb, var(--rc, #ffd76a) 45%, transparent);
  animation: gift-card-glow 2.2s ease-in-out infinite;
}
@keyframes gift-card-glow {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc, #ffd76a) 55%, transparent), 0 0 22px color-mix(in srgb, var(--rc, #ffd76a) 38%, transparent); }
  50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc, #ffd76a) 75%, transparent), 0 0 38px color-mix(in srgb, var(--rc, #ffd76a) 60%, transparent); }
}
.gift-sub { position: relative; z-index: 1; margin: 12px 0 16px; color: var(--text); font-size: .95rem; }
.gift-sub b { color: #ffd76a; }
.gift-close { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .gift-overlay.show, .gift-box, .gift-box.open, .gift-reveal.show, .gift-glow, .gift-burst,
  .gift-rays, .gsk, .gift-flash.go, .gcf, .gift-glint::before, .gift-reveal .trade-reveal-card { animation: none !important; }
  .gift-box { transform: none; }
  .gift-box.open .gift-lid, .gift-box.open .gift-bow { transition: none; opacity: 0; }
  .gift-rays, .gift-sparkles, .gift-confetti, .gift-flash { display: none; }
}

/* ============================================================
   BANNIÈRE WAIFUDORADO / EVENTS GLOBAUX sur le Dex
   ============================================================ */
.dex-event-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 800;
  display: flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: 999px;
  font-weight: 700; font-size: .9rem; color: #2a1c00; white-space: nowrap;
  background: linear-gradient(100deg, #ffe082, #ffc107 50%, #ffb300);
  border: 1px solid rgba(255,255,255,.55); box-shadow: 0 8px 26px rgba(255,170,0,.4), inset 0 1px 0 rgba(255,255,255,.6);
  animation: deb-in .5s ease both, deb-float 3.2s ease-in-out infinite 0.5s;
}
.dex-event-banner .deb-ico, .dex-event-banner .deb-spark { font-size: 1.05rem; }
.dex-event-banner .deb-spark { animation: deb-spark 1.6s ease-in-out infinite; }
@keyframes deb-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes deb-float { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }
@keyframes deb-spark { 0%,100% { opacity: .5; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
@media (max-width: 560px) { .dex-event-banner { font-size: .8rem; padding: 7px 13px; white-space: normal; max-width: 92vw; } }
@media (prefers-reduced-motion: reduce) { .dex-event-banner { animation: deb-in .4s ease both; } .dex-event-banner .deb-spark { animation: none; } }

/* ── Favoris (wishlist) : badge ❤️ + coût d'évolution sur la fiche ── */
.badge-fav {
  position: absolute; top: 8px; right: 8px; z-index: 5;
  font-size: .95rem; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
}
/* Si la carte a déjà un badge évènement (✨) en haut-droite, on décale le cœur. */
.card .badge-event ~ .badge-fav { top: 34px; }
.cd-evolve-cost {
  margin-top: 8px; font-size: .82rem; color: var(--text-dim, #9fb6c6);
  background: rgba(255,255,255,.05); border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 8px; padding: 5px 10px; display: inline-block;
}
.cd-evolve-cost b { color: #ffd76a; }
