/* ============ DANS LA FILE — thème clair & féerique ============ */
:root {
  --bg: #fff8f3;
  --bg2: #fdeef6;
  --surface: #ffffff;
  --surface2: #faf5ff;
  --ink: #2e2346;
  --ink2: #6b5f85;
  --ink3: #a59bb8;
  --line: #eadff3;
  --primary: #2367a6;
  --primary2: #5d93c9;
  --navy: #1b4f7e;
  --pink: #ff7eb6;
  --mint: #4fd1b5;
  --sky: #6ec3ff;
  --gold: #f0b11e;
  --danger: #ff5d73;
  --ok: #3cc58a;
  --r-common: #9aa7b8;
  --r-uncommon: #45c48b;
  --r-rare: #4a9dff;
  --r-epic: #a865ff;
  --r-legendary: #ffb21e;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(91, 61, 160, .10), 0 1px 3px rgba(91, 61, 160, .08);
  --shadow-lg: 0 18px 50px rgba(91, 61, 160, .22);
  --font-title: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffe1f0 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #e3e0ff 0%, transparent 60%),
    radial-gradient(800px 600px at 50% 120%, #dff7f1 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h3 { font-size: 1.1rem; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--ink2); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(12px, 3vw, 28px); background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; color: var(--ink); white-space: nowrap; }
.logo-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--pink), var(--primary)); color: #fff; box-shadow: 0 4px 12px rgba(123, 92, 255, .35); }
.logo span.alt { color: #d99a0b; }
.logo-img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(27,79,126,.25)); }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--ink2); font-weight: 700; }
.topnav a.active, .topnav a:hover { background: var(--surface2); color: var(--primary); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); font-weight: 800; font-size: .9rem; white-space: nowrap; }
.chip.dust { color: #b0761a; }
.chip.packs { color: var(--primary); }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--sky), var(--primary2));
  display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.avatar.lg { width: 96px; height: 96px; font-size: 2.4rem; border: 4px solid #fff; box-shadow: var(--shadow); }

main { max-width: 1200px; margin: 0 auto; padding: clamp(14px, 3vw, 32px); padding-bottom: calc(var(--nav-h) + 40px); }

.bottomnav { display: none; }
@media (max-width: 820px) {
  .topnav { display: none; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink3); font-size: .7rem; font-weight: 800; position: relative; }
  .bottomnav a .ico { font-size: 1.35rem; line-height: 1; filter: grayscale(.6); }
  .bottomnav a.active { color: var(--primary); }
  .bottomnav a.active .ico { filter: none; transform: translateY(-2px); }
  .logo .full { display: none; }
}
.badge-dot { position: absolute; top: 6px; right: calc(50% - 20px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: .7rem; display: grid; place-items: center; padding: 0 4px; }

/* ---------- Boutons / champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; padding: 11px 20px; border-radius: 14px;
  font-weight: 800; background: var(--surface); color: var(--ink); border: 1px solid var(--line); transition: transform .12s, box-shadow .2s, background .2s; text-align: center; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, var(--navy), #4a8ccc); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(35, 103, 166, .35); }
.btn.pink { background: linear-gradient(135deg, var(--pink), #ff9fc7); color: #fff; border: 0; }
.btn.gold { background: linear-gradient(135deg, #ffb21e, #ffd56b); color: #5a3a00; border: 0; }
.btn.danger { background: #fff0f2; color: var(--danger); border-color: #ffd0d7; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 7px 12px; border-radius: 10px; font-size: .85rem; }
.btn.lg { padding: 16px 30px; font-size: 1.1rem; border-radius: 18px; }
.btn.block { width: 100%; }
.btn.google { background: #fff; }
.btn.discord { background: #5865f2; color: #fff; border: 0; }

.field { display: block; }
.field > span { display: block; font-weight: 800; font-size: .85rem; color: var(--ink2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; outline: none; transition: border .2s, box-shadow .2s;
}
.input:focus { border-color: var(--primary2); box-shadow: 0 0 0 4px rgba(123, 92, 255, .12); }
textarea.input { min-height: 90px; resize: vertical; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid-form .span2 { grid-column: 1 / -1; }

/* ---------- Panneaux ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 3vw, 24px); border: 1px solid rgba(234, 223, 243, .7); }
.panel + .panel, .section + .section { margin-top: 20px; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 0; background: var(--surface); padding: 8px 14px; border-radius: 999px; font-weight: 800; color: var(--ink2); cursor: pointer; border: 1px solid var(--line); }
.tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Barre de progression ---------- */
.progress { height: 10px; border-radius: 99px; background: #f0e8f7; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5d93c9, var(--navy)); transition: width .6s; }
.progress.done > i { background: linear-gradient(90deg, var(--gold), #ffd96b); }
.progress-label { display: flex; justify-content: space-between; font-weight: 800; font-size: .85rem; margin-bottom: 6px; color: var(--ink2); }

/* ---------- Accueil / packs ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding: clamp(10px, 4vw, 40px) 0; }
.hero p { font-size: 1.1rem; color: var(--ink2); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero .row { justify-content: center; } }
.hero-cards { position: relative; height: 320px; }
.hero-cards .tcg { position: absolute; width: 170px; top: 20px; left: 50%; }
.hero-cards .tcg:nth-child(1) { transform: translateX(-120%) rotate(-12deg); }
.hero-cards .tcg:nth-child(2) { transform: translateX(-50%) translateY(-10px); z-index: 2; }
.hero-cards .tcg:nth-child(3) { transform: translateX(20%) rotate(12deg); }

.pack-zone { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
@media (max-width: 700px) { .pack-zone { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.pack-art { width: 180px; aspect-ratio: 3/4.2; border-radius: 22px; position: relative; cursor: pointer; user-select: none;
  background: linear-gradient(160deg, #ff9ccc 0%, #b48cff 50%, #6ec3ff 100%); box-shadow: var(--shadow-lg), inset 0 0 0 4px rgba(255, 255, 255, .5);
  display: grid; place-items: center; color: #fff; text-align: center; overflow: hidden; transition: transform .2s; }
.pack-art:hover { transform: translateY(-4px) rotate(-1deg); }
.pack-art.empty { filter: grayscale(.7) opacity(.7); cursor: default; }
.pack-art::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 12px, transparent 12px 24px); }
.pack-art::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg); animation: sheen 3.5s infinite; }
.pack-art .pk-logo { font-family: var(--font-title); font-weight: 700; font-size: 1.4rem; text-shadow: 0 2px 8px rgba(0,0,0,.2); position: relative; z-index: 1; line-height: 1.1; padding: 10px; }
.pack-art .pk-logo .em { font-size: 3rem; display: block; margin-bottom: 6px; }
.pack-art .pk-count { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; color: var(--primary); font-weight: 900; border-radius: 99px; padding: 4px 10px; font-size: .9rem; box-shadow: var(--shadow); }
.pack-art.mini { width: 110px; border-radius: 16px; }
.pack-art.mini .pk-logo { font-size: .85rem; }
.pack-art.mini .pk-logo .em { font-size: 1.8rem; }
@keyframes sheen { 0% { left: -60%; } 60%, 100% { left: 130%; } }
.timer { font-family: var(--font-title); font-size: 1.6rem; font-weight: 600; color: var(--primary); }
.pack-pips { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0 16px; }
.pack-pips i { width: 16px; height: 22px; border-radius: 5px; background: #eee6f6; display: block; }
.pack-pips i.on { background: linear-gradient(160deg, var(--pink), var(--primary)); }
.pack-pips i.bonus { background: linear-gradient(160deg, var(--gold), #ffd96b); }
@media (max-width: 700px) { .pack-pips { justify-content: center; } }

.event-banner { border-radius: var(--radius); padding: 16px 20px; color: #fff; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--ev, #ffb347), #ff7eb6); box-shadow: var(--shadow); margin-bottom: 16px; }
.event-banner h3 { margin: 0 0 4px; }
.event-banner .btn { background: #fff; color: var(--ink); border: 0; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.shop-item { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- Grilles de cartes ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: clamp(10px, 2vw, 18px); }
@media (max-width: 480px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.card-grid a { display: block; color: inherit; }
.card-cell { position: relative; }
.card-cell .count-badge { position: absolute; top: -6px; right: -6px; z-index: 5; background: var(--ink); color: #fff; font-weight: 900; font-size: .75rem; border-radius: 99px; padding: 3px 8px; box-shadow: var(--shadow); }
.card-cell .shiny-badge { position: absolute; top: -6px; left: -6px; z-index: 5; font-size: .9rem; background: #fff; border-radius: 99px; padding: 2px 6px; box-shadow: var(--shadow); }

/* ---------- La carte TCG ---------- */
.tcg { --rc: var(--r-common); position: relative; width: 100%; aspect-ratio: 5 / 7; border-radius: 7% / 5%; container-type: inline-size;
  background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 75%, #fff), var(--rc) 55%, color-mix(in srgb, var(--rc) 70%, #000) 100%);
  padding: 3.5%; box-shadow: 0 8px 20px rgba(46, 35, 70, .18); transition: transform .25s, box-shadow .25s; transform-style: preserve-3d; isolation: isolate; }
a:hover > .tcg, a:hover .tcg, .tcg.hoverable:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(46, 35, 70, .25); }
.tcg.r-uncommon { --rc: var(--r-uncommon); }
.tcg.r-rare { --rc: var(--r-rare); }
.tcg.r-epic { --rc: var(--r-epic); }
.tcg.r-legendary { --rc: var(--r-legendary); box-shadow: 0 8px 26px rgba(255, 178, 30, .45); }
.tcg-inner { position: relative; height: 100%; border-radius: 4.5cqw; background: #fffdf9; overflow: hidden; display: flex; flex-direction: column; }
.tcg-top { display: flex; align-items: center; justify-content: space-between; gap: 2cqw; padding: 3.5cqw 4.5cqw 2.5cqw; }
.tcg-name { font-family: var(--font-title); font-weight: 700; font-size: 7.6cqw; line-height: 1.05; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcg-gem { flex-shrink: 0; width: 9cqw; height: 9cqw; transform: rotate(45deg); border-radius: 2cqw; background: var(--rc);
  box-shadow: inset 0 0 0 1.4cqw rgba(255, 255, 255, .55), 0 1cqw 2cqw rgba(0, 0, 0, .15); }
.tcg-art { position: relative; margin: 0 3.5cqw; height: 50%; border-radius: 3.5cqw; overflow: hidden; background-size: cover; background-position: center;
  display: grid; place-items: center; font-size: 26cqw; box-shadow: inset 0 0 0 .8cqw rgba(0, 0, 0, .06); }
.tcg-art.gen::after { content: ''; position: absolute; inset: 0; background:
  radial-gradient(circle at 20% 20%, rgba(255,255,255,.55) 0 8%, transparent 9%),
  radial-gradient(circle at 80% 30%, rgba(255,255,255,.35) 0 5%, transparent 6%),
  radial-gradient(circle at 60% 85%, rgba(255,255,255,.3) 0 6%, transparent 7%); }
.tcg-art .emoji { filter: drop-shadow(0 2cqw 2cqw rgba(0, 0, 0, .18)); position: relative; z-index: 1; }
.tcg-status { position: absolute; left: 2.5cqw; bottom: 2.5cqw; z-index: 2; font-size: 5cqw; font-weight: 900; padding: 1cqw 3cqw; border-radius: 99px; background: rgba(46,35,70,.75); color: #fff; }
.tcg-type { display: flex; justify-content: space-between; gap: 2cqw; padding: 2.5cqw 4.5cqw 0; font-size: 5.2cqw; font-weight: 800; color: var(--ink2); white-space: nowrap; overflow: hidden; }
.tcg-type span:first-child { overflow: hidden; text-overflow: ellipsis; }
.tcg-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5cqw 4cqw; padding: 2.5cqw 4.5cqw; margin-top: auto; }
.tcg-stat { display: grid; grid-template-columns: auto 1fr; gap: 1.5cqw; align-items: center; font-size: 5cqw; }
.tcg-stat b { display: block; height: 2.6cqw; border-radius: 9cqw; background: #efe7f5; overflow: hidden; position: relative; }
.tcg-stat b i { position: absolute; inset: 0 auto 0 0; background: var(--rc); border-radius: 9cqw; }
.tcg-foot { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; padding: 2.2cqw 4.5cqw 3.2cqw; font-size: 4.8cqw; font-weight: 800;
  color: #fff; background: var(--rc); }
.tcg-foot span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcg .holo { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; opacity: 0; }
.tcg.shiny .holo { opacity: 1; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 0, 170, .45) 32%, rgba(255, 238, 0, .45) 42%, rgba(0, 255, 200, .45) 52%, rgba(0, 140, 255, .45) 62%, transparent 75%);
  background-size: 300% 300%; background-position: var(--hx, 0%) var(--hy, 0%); animation: holo 5s ease-in-out infinite; }
.tcg.shiny::after { content: '✦'; position: absolute; top: 1cqw; right: 3cqw; z-index: 4; color: #fff; font-size: 9cqw; text-shadow: 0 0 3cqw #fff, 0 0 6cqw #ff7eb6; }
.tcg.shiny { box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 10px 30px rgba(168, 101, 255, .45); }
@keyframes holo { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
.tcg.tilt .holo { animation: none; }
.tcg.missing { background: #e8e0f0; box-shadow: none; }
.tcg.missing .tcg-inner { background: repeating-linear-gradient(45deg, #f6f1fa 0 10px, #f1eaf7 10px 20px); align-items: center; justify-content: center; text-align: center; }
.tcg.missing .q { font-family: var(--font-title); font-size: 30cqw; color: #d7cbe4; line-height: 1; }
.tcg.missing .nm { font-size: 6.5cqw; font-weight: 800; color: var(--ink3); padding: 0 6cqw; margin-top: 3cqw; }
.tcg.missing .rr { width: 7cqw; height: 7cqw; border-radius: 2cqw; transform: rotate(45deg); background: var(--rc); opacity: .5; margin: 4cqw auto 0; }
.tcg-back { width: 100%; aspect-ratio: 5/7; border-radius: 7% / 5%; background: linear-gradient(160deg, #ff9ccc, #b48cff 55%, #6ec3ff);
  display: grid; place-items: center; color: #fff; font-family: var(--font-title); font-size: 1.2rem; box-shadow: 0 8px 20px rgba(46, 35, 70, .18);
  border: 4px solid rgba(255,255,255,.6); position: relative; overflow: hidden; container-type: inline-size; }
.tcg-back .bk { font-size: 30cqw; }
.tcg-back::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.1) 0 10px, transparent 10px 20px); }

/* ---------- Ouverture de pack ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; background: radial-gradient(circle at 50% 40%, #fff4fb, #efe7ff 60%, #e2f1ff); display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px; overflow-y: auto; animation: fadein .3s; }
.overlay.god { background: radial-gradient(circle at 50% 40%, #fff7d6, #ffd6f0 50%, #d6e9ff); }
.overlay .close-x { position: absolute; top: 14px; right: 14px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.open-stage { width: 100%; max-width: 1000px; text-align: center; }
.open-pack { width: 200px; margin: 30px auto; animation: wobble 1.8s ease-in-out infinite; }
.open-pack.tearing { animation: tear .7s forwards; }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) scale(1.03); } }
@keyframes tear { 0% { transform: scale(1); } 40% { transform: scale(1.15) rotate(-4deg); } 100% { transform: scale(.2) rotate(20deg); opacity: 0; } }
.reveal-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 2vw, 20px); margin: 20px 0; perspective: 1200px; }
@media (max-width: 700px) { .reveal-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .reveal-row > :nth-child(4) { grid-column: 1 / 2; margin-left: 50%; } .reveal-row > :nth-child(5) { margin-left: 50%; } }
.flip { position: relative; aspect-ratio: 5/7; cursor: pointer; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); animation: dealin .5s backwards; }
.flip:nth-child(2) { animation-delay: .08s; } .flip:nth-child(3) { animation-delay: .16s; } .flip:nth-child(4) { animation-delay: .24s; } .flip:nth-child(5) { animation-delay: .32s; }
@keyframes dealin { from { transform: translateY(60px) scale(.6); opacity: 0; } }
.flip.flipped { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face.front { transform: rotateY(180deg); }
.flip .glow { position: absolute; inset: -10%; border-radius: 30px; z-index: -1; filter: blur(18px); opacity: 0; transition: opacity .5s; }
.flip.flipped .glow { opacity: .8; }
.flip.r-epic .glow { background: var(--r-epic); }
.flip.r-legendary .glow { background: var(--r-legendary); }
.flip.is-shiny .glow { background: conic-gradient(#ff7eb6, #ffd56b, #4fd1b5, #6ec3ff, #a865ff, #ff7eb6); }
.flip .tcg-back.hint-epic { box-shadow: 0 0 0 3px var(--r-epic), 0 0 24px var(--r-epic); }
.flip .tcg-back.hint-legendary { box-shadow: 0 0 0 3px var(--r-legendary), 0 0 30px var(--r-legendary); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px var(--r-legendary), 0 0 50px var(--r-legendary); } }
.new-tag { position: absolute; z-index: 6; top: -10px; left: 50%; transform: translateX(-50%) rotateY(180deg); background: var(--danger); color: #fff; font-weight: 900; font-size: .7rem;
  padding: 3px 10px; border-radius: 99px; box-shadow: var(--shadow); backface-visibility: hidden; white-space: nowrap; }
.god-title { font-family: var(--font-title); font-size: clamp(2.4rem, 8vw, 4.5rem); font-weight: 700; margin: 0;
  background: linear-gradient(90deg, #ff7eb6, #ffbe3d, #4fd1b5, #6ec3ff, #a865ff, #ff7eb6); background-size: 200%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbow 2s linear infinite; }
@keyframes rainbow { to { background-position: 200% 0; } }
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 210; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Collections ---------- */
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.col-card { display: block; color: inherit; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s;
  border: 1px solid rgba(234, 223, 243, .7); }
.col-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.col-banner { height: 92px; background: linear-gradient(135deg, var(--cc, #f7a8c8), color-mix(in srgb, var(--cc, #f7a8c8) 50%, #7b5cff)); background-size: cover; background-position: center;
  position: relative; display: flex; align-items: flex-end; padding: 10px 14px; }
.col-banner .kind { background: rgba(255,255,255,.9); color: var(--ink); font-weight: 900; font-size: .72rem; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.col-banner .flag { position: absolute; top: 10px; right: 12px; font-size: 1.6rem; }
.col-body { padding: 14px 16px 16px; }
.col-body h3 { margin: 0 0 10px; }
.col-head { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 20px; }
.col-head .col-banner { height: 140px; }
.col-head .col-body { padding: 18px 22px 22px; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-weight: 800; font-size: .9rem; color: var(--ink3); margin-bottom: 12px; }
.crumbs a { color: var(--ink2); }
.crumbs a:hover { color: var(--primary); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; padding: 8px 12px; }
.sub-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sub-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: inherit; }
.sub-item:hover { border-color: var(--primary2); }
.sub-item .nm { font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Fiche carte (wiki) ---------- */
.wiki { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
@media (max-width: 760px) { .wiki { grid-template-columns: 1fr; } .wiki .big-card { max-width: 300px; margin: 0 auto; } }
.big-card { perspective: 1000px; position: sticky; top: 90px; }
.big-card .tcg { transition: transform .1s; }
.infobox { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.infobox th { color: var(--ink2); font-size: .85rem; width: 38%; font-weight: 800; }
.stat-bars { display: grid; gap: 10px; }
.stat-bar { display: grid; grid-template-columns: 100px 1fr 40px; gap: 10px; align-items: center; font-weight: 800; font-size: .9rem; }
.stat-bar .progress > i { background: var(--rc, var(--primary)); }
.rarity-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-weight: 900; font-size: .85rem; color: #fff; background: var(--rc); }
.rarity-pill.common { --rc: var(--r-common); } .rarity-pill.uncommon { --rc: var(--r-uncommon); } .rarity-pill.rare { --rc: var(--r-rare); }
.rarity-pill.epic { --rc: var(--r-epic); } .rarity-pill.legendary { --rc: var(--r-legendary); }
.owned-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.owned-box > div { background: var(--surface2); border-radius: 14px; padding: 12px; text-align: center; }
.owned-box b { font-family: var(--font-title); font-size: 1.6rem; display: block; }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); color: inherit; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.rank { width: 34px; text-align: center; font-family: var(--font-title); font-size: 1.2rem; color: var(--ink3); }
.rank.r1 { color: #e0a100; } .rank.r2 { color: #8f9bb0; } .rank.r3 { color: #c47a3d; }
.score { font-family: var(--font-title); font-size: 1.2rem; color: var(--primary); }

/* ---------- Profil ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.stat-tile { background: var(--surface2); border-radius: 14px; padding: 14px; }
.stat-tile b { display: block; font-family: var(--font-title); font-size: 1.6rem; color: var(--ink); }
.stat-tile span { font-size: .8rem; font-weight: 800; color: var(--ink2); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface2); }
.ach .ic { font-size: 1.8rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #fff; }
.ach.locked { opacity: .45; filter: grayscale(1); }
.showcase { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Auth ---------- */
.auth-box { max-width: 420px; margin: 30px auto; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink3); font-weight: 800; font-size: .85rem; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 76px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
@media (max-width: 820px) { .toasts { top: auto; bottom: calc(var(--nav-h) + 16px); left: 16px; right: 16px; } }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow-lg); animation: toastin .3s; }
.toast.ok { background: linear-gradient(135deg, var(--navy), #4a8ccc); }
.toast.err { background: var(--danger); }
.toast.ach { background: linear-gradient(135deg, #ffb21e, #ff7eb6); }
@keyframes toastin { from { transform: translateY(-10px); opacity: 0; } }

/* ---------- Modale ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 250; background: rgba(46, 35, 70, .35); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
.modal { background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; padding: clamp(18px, 3vw, 28px); }

/* ---------- Admin ---------- */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-menu { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; }
@media (max-width: 820px) { .admin-menu { flex-direction: row; overflow-x: auto; position: static; } }
.admin-menu a { padding: 10px 14px; border-radius: 12px; font-weight: 800; color: var(--ink2); white-space: nowrap; }
.admin-menu a.active, .admin-menu a:hover { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.tbl th { color: var(--ink2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.tbl tr:hover td { background: var(--surface2); }
.tree { list-style: none; padding-left: 0; margin: 0; }
.tree ul { list-style: none; padding-left: 22px; margin: 0; border-left: 2px dashed var(--line); margin-left: 10px; }
.tree li > .node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; }
.tree li > .node:hover { background: var(--surface2); }
.tree .dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.rate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rate-grid .field .input { text-align: right; }
.preview-card { max-width: 220px; }
.kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars div { flex: 1; background: linear-gradient(180deg, var(--primary2), var(--primary)); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bars div span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .7rem; font-weight: 800; color: var(--ink2); }
pre.code { background: #2e2346; color: #f3eaff; padding: 14px; border-radius: 12px; overflow-x: auto; font-size: .8rem; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink2); }
.empty .big { font-size: 3rem; display: block; margin-bottom: 8px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.tree li > .node { flex-wrap: wrap; }
.tree .node > .row { flex-wrap: nowrap; gap: 4px; }
.credit { font-size: .75rem; color: var(--ink3); margin: 8px 0 0; text-align: center; overflow-wrap: anywhere; }
.credit a { color: var(--ink2); }
.col-head .credit { text-align: left; }

/* ---------- Marché ---------- */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
@media (max-width: 480px) { .mk-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.mk-item { display: flex; flex-direction: column; gap: 8px; color: inherit; background: var(--surface); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
  border: 1px solid rgba(234, 223, 243, .7); transition: transform .2s, box-shadow .2s; height: 100%; }
.mk-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mk-info { display: flex; flex-direction: column; gap: 3px; }
.mk-price { font-family: var(--font-title); font-size: 1.25rem; font-weight: 700; color: #b0761a; }
.mk-meta, .mk-seller { font-size: .8rem; color: var(--ink2); font-weight: 700; }
.mk-seller { color: var(--ink3); }
.mk-buyout { font-size: .78rem; font-weight: 800; color: var(--primary); }
.soon { color: var(--danger); font-weight: 900; }
.mk-status { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 900; background: var(--surface2); color: var(--ink2); }
.mk-status.active { background: #e3fbef; color: #1d9a62; }
.mk-status.sold { background: #fff3d6; color: #a46a00; }
.mk-status.cancelled, .mk-status.expired { background: #f1edf6; color: var(--ink3); }
.mk-wrap { position: relative; }
.mk-tag { display: inline-block; font-size: .72rem; font-weight: 900; padding: 3px 10px; border-radius: 99px; background: var(--surface2); color: var(--ink2); margin-bottom: 6px; }
.mk-tag.ok { background: #e3fbef; color: #1d9a62; }
.mk-tag.bad { background: #ffe8ec; color: var(--danger); }
.mk-box { background: linear-gradient(135deg, #fffaf0, #fff); }
.mk-big-price { font-family: var(--font-title); font-size: 2.2rem; font-weight: 700; color: #b0761a; display: flex; flex-direction: column; line-height: 1.1; }
.mk-big-price .small { font-family: var(--font); font-weight: 800; }
.mk-timer { font-weight: 900; font-size: 1.1rem; margin-top: 8px; }
.mk-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; max-height: 55vh; overflow-y: auto; padding: 6px; }
.mk-pick-item { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 12px; }
.mk-pick-item:hover .tcg { transform: translateY(-3px); }
.mk-pick-item .count-badge { position: absolute; top: -6px; right: -6px; z-index: 5; background: var(--ink); color: #fff; font-weight: 900; font-size: .72rem; border-radius: 99px; padding: 2px 7px; }
@media (max-width: 820px) { .bottomnav { grid-template-columns: repeat(6, 1fr); } .bottomnav a { font-size: .62rem; } }
