@import url('https://fonts.googleapis.com/css2?family=Lilita+One&family=Nunito:wght@500;700;800;900&display=swap');

/* ═══════════════ Thème ═══════════════ */
:root {
  --bg: #fff6e9;
  --paper: #ffffff;
  --ink: #1f1a3a;
  --muted: #6b6488;
  --soft: #f4efff;
  --pink: #ff4f8b;
  --pink-d: #e8336f;
  --yellow: #ffd23f;
  --blue: #3ec5ff;
  --purple: #8b5cf6;
  --green: #22c55e;
  --orange: #ff8a3d;
  --red: #ef4444;
  --sh: 3px 3px 0 var(--ink);
  --sh-lg: 5px 5px 0 var(--ink);
  --r: 16px;
  --font-title: 'Lilita One', 'Arial Black', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bottombar-h: 66px;
}

/* ═══════════════ Mode sombre (Paramètres → Mode sombre, attribut data-theme="dark" sur <html>) ═══════════════ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15112a;
  --paper: #231c40;
  --ink: #ece7ff;          /* texte et contours « sticker » */
  --muted: #a49dc6;
  --soft: #2d2554;
  --sh: 3px 3px 0 #000;
  --sh-lg: 5px 5px 0 #000;
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 8% 12%, #ff4f8b26 0, transparent 28%),
    radial-gradient(circle at 92% 18%, #3ec5ff1f 0, transparent 30%),
    radial-gradient(circle at 60% 105%, #8b5cf633 0, transparent 40%),
    radial-gradient(#ffffff12 1.2px, transparent 1.2px);
}
/* Les cartes et les boosters gardent leurs couleurs claires d'origine, comme de vraies cartes. */
:root[data-theme="dark"] .mcard, :root[data-theme="dark"] .pack, :root[data-theme="dark"] .mini-pack, :root[data-theme="dark"] .flip {
  --ink: #1f1a3a; --paper: #ffffff; --muted: #6b6488; color: #1f1a3a;
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] select.input { color: var(--ink); }
:root[data-theme="dark"] .steps b, :root[data-theme="dark"] .confirm-check { background: #3a3060; }
:root[data-theme="dark"] mark { color: #1f1a3a; }
/* Fonds teintés clairs → équivalents sombres */
:root[data-theme="dark"] .topbar { background: #15112ae6; }
:root[data-theme="dark"] .pack-count, :root[data-theme="dark"] .chat-body { background: var(--paper); }
:root[data-theme="dark"] .slot-empty, :root[data-theme="dark"] .result { background: #231c40e6; }
:root[data-theme="dark"] .coins-pill, :root[data-theme="dark"] .bar { background: #3a3060; }
:root[data-theme="dark"] .notif.unread, :root[data-theme="dark"] .s-pending, :root[data-theme="dark"] .ach.on,
:root[data-theme="dark"] .conv.on, :root[data-theme="dark"] .lb-row.me, :root[data-theme="dark"] .mode-card.ranked { background: #4a3d16; }
:root[data-theme="dark"] .toast-error, :root[data-theme="dark"] .s-refused, :root[data-theme="dark"] .s-cancelled,
:root[data-theme="dark"] .hist.loss, :root[data-theme="dark"] .hp, :root[data-theme="dark"] .demo-banner.closed { background: #4a1f30; }
:root[data-theme="dark"] .mode-card, :root[data-theme="dark"] .demo-banner { background: #1d3550; }
:root[data-theme="dark"] .bubble.me { background: #5a2445; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 12%, #ffd6e7 0, transparent 28%),
    radial-gradient(circle at 92% 18%, #d4f1ff 0, transparent 30%),
    radial-gradient(circle at 60% 105%, #fff0b3 0, transparent 40%),
    radial-gradient(#1f1a3a10 1.2px, transparent 1.2px);
  background-size: auto, auto, auto, 22px 22px;
  background-attachment: fixed;
  min-height: 100vh;
  font-weight: 600;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 400; margin: 0 0 .4em; letter-spacing: .3px; line-height: 1.1; }
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
p { margin: 0 0 .6em; }
button { font-family: inherit; color: inherit; }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.row.gap { gap: 10px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.link { color: var(--pink-d); font-weight: 800; text-decoration: none; }
.link:hover { text-decoration: underline; }
.online { color: var(--green); font-weight: 800; }

/* ═══════════════ Composants de base ═══════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 800; font-size: 15px; line-height: 1.1;
  padding: 10px 16px; border-radius: 12px;
  border: 2.5px solid var(--ink); background: var(--paper);
  box-shadow: var(--sh); cursor: pointer; text-decoration: none;
  transition: transform .08s, box-shadow .08s, background .15s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--sh); }
.btn.primary { background: var(--pink); color: #fff; }
.btn.buy { background: var(--green); color: #fff; }
.btn.pro { background: linear-gradient(135deg, var(--purple), #c026d3); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--paper); box-shadow: var(--sh); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 14px 26px; font-size: 18px; font-family: var(--font-title); font-weight: 400; letter-spacing: .5px; }
.btn.block { width: 100%; }

.input {
  font: inherit; font-weight: 700; color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 12px;
  padding: 10px 12px; background: var(--paper); width: 100%; outline: none;
  transition: box-shadow .15s;
}
.input:focus { box-shadow: 0 0 0 4px #ffd23f88; }
/* iPhone : un champ de moins de 16 px fait zoomer la page au toucher (et elle reste zoomée). */
@media (max-width: 900px) { .input, input, select, textarea { font-size: 16px; } }
.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.remember input { width: 18px; height: 18px; accent-color: var(--pink); margin: 0; }
.input.big { font-size: 22px; font-family: var(--font-title); }
select.input { cursor: pointer; }
label { display: grid; gap: 5px; font-weight: 800; font-size: 14px; }

.panel {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px;
  box-shadow: var(--sh-lg); padding: 18px; margin-bottom: 20px;
}
.tag { display: inline-block; background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 900; }
.tag.big { font-size: 15px; padding: 8px 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.chips.small { margin-top: -6px; }
.chip {
  border: 2px solid var(--ink); background: var(--paper); border-radius: 999px;
  padding: 5px 12px; font-weight: 800; font-size: 13px; cursor: pointer;
}
.chip.on { background: var(--ink); color: #fff; }
.chip.on[class*="r-"] { background: var(--rc); color: #fff; }

.tabs { display: flex; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.tabs.small { margin: 10px 0; }
.tab {
  border: 2.5px solid var(--ink); background: var(--paper); border-radius: 12px; padding: 8px 14px;
  font-weight: 800; cursor: pointer; text-decoration: none; font-size: 14px; display: inline-flex; gap: 6px; align-items: center;
}
.tab.on { background: var(--yellow); box-shadow: var(--sh); }
.tab-badge:not(:empty) { background: var(--pink); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }

.bar { height: 10px; background: #ece6ff; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar.big { height: 16px; margin: 8px 0 14px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--yellow)); border-radius: 999px; transition: width .6s; }

.filters { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 4px; }
.toggle { display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--pink); }

.empty { text-align: center; padding: 50px 16px; font-size: 17px; font-weight: 800; color: var(--muted); grid-column: 1 / -1; }
.empty a { color: var(--pink-d); }
.loading { display: grid; place-items: center; padding: 60px; grid-column: 1 / -1; }
.spinner { width: 42px; height: 42px; border: 5px solid #ece6ff; border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-error { padding: 80px 20px; text-align: center; font-size: 20px; font-weight: 900; }

.rarity-pill {
  display: inline-block; background: var(--rc); color: #fff; border: 2px solid var(--ink);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 900; white-space: nowrap;
}

/* Couleurs de rareté */
.r-common     { --rc: #8f98ab; --rc2: #eef0f5; }
.r-uncommon   { --rc: #22c55e; --rc2: #dcfce7; }
.r-rare       { --rc: #3b82f6; --rc2: #dbeafe; }
.r-super_rare { --rc: #a855f7; --rc2: #f3e8ff; }
.r-ultra_rare { --rc: #ff3d7f; --rc2: #ffe4ef; }
.r-legendary  { --rc: #f5a700; --rc2: #fff4cc; }
.r-lr         { --rc: #ff2bd6; --rc2: #1d1036; }

/* ═══════════════ Logo ═══════════════ */
.logo {
  font-family: var(--font-title); font-size: 26px; text-decoration: none; color: var(--ink);
  letter-spacing: .5px; white-space: nowrap;
}
.logo span { color: var(--pink); -webkit-text-stroke: 0; margin-left: 2px; }
.logo.big { font-size: clamp(44px, 8vw, 72px); text-shadow: 4px 4px 0 var(--yellow); }

/* ═══════════════ Auth ═══════════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; padding: 40px clamp(16px, 5vw, 80px); max-width: 1200px; margin: 0 auto; }
.auth-hero { text-align: center; }
.tagline { font-size: 20px; font-weight: 800; color: var(--muted); }
.auth-cards { position: relative; height: 300px; margin-top: 30px; }
.auth-card {
  position: absolute; left: 50%; top: 10px; width: 175px; pointer-events: none;
  transform: translateX(calc(-50% + (var(--i) - 1) * 125px)) rotate(calc((var(--i) - 1) * 12deg));
  animation: float 4s ease-in-out infinite; animation-delay: calc(var(--i) * -1.3s);
}
@keyframes float { 50% { margin-top: -12px; } }
.auth-box {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink);
  padding: 28px; display: grid; gap: 14px; max-width: 420px; width: 100%; justify-self: center;
}
.auth-gift { background: var(--yellow); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-weight: 900; margin: 0; }
.auth-switch { text-align: center; margin: 0; }
.auth-switch a { color: var(--pink-d); font-weight: 900; }

/* ═══════════════ Layout ═══════════════ */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--paper); border-right: 3px solid var(--ink);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 18px;
}
.sidebar .logo { padding: 0 8px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  text-decoration: none; font-weight: 800; border: 2.5px solid transparent; position: relative; background: none; cursor: pointer; font-size: 15px;
}
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: var(--yellow); border-color: var(--ink); box-shadow: var(--sh); }
.nav-ico { font-size: 20px; width: 24px; text-align: center; }
.nav-badge { display: none; margin-left: auto; background: var(--pink); color: #fff; font-size: 11px; font-weight: 900; border-radius: 999px; padding: 1px 7px; border: 2px solid var(--ink); }
.nav-badge.on { display: inline-block; }
.sidebar-foot { margin-top: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: #fff6e9e6; backdrop-filter: blur(8px);
}
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; background: var(--paper); border: 2.5px solid var(--ink);
  border-radius: 999px; padding: 5px 12px; font-weight: 900; text-decoration: none; box-shadow: 2px 2px 0 var(--ink); font-size: 15px;
}
.coins-pill { background: #fff7d1; }
.pro-pill { background: linear-gradient(135deg, var(--purple), #c026d3); color: #fff; font-family: var(--font-title); letter-spacing: 1px; }
.icon-btn { position: relative; border: 2.5px solid var(--ink); background: var(--paper); border-radius: 999px; width: 40px; height: 40px; cursor: pointer; font-size: 18px; box-shadow: 2px 2px 0 var(--ink); }
.icon-btn .dot { display: none; position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; background: var(--pink); color: #fff; font-size: 11px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 900; line-height: 16px; padding: 0 4px; }
.icon-btn .dot.on { display: block; }
.view { padding: 8px clamp(16px, 3vw, 36px) 40px; max-width: 1180px; width: 100%; margin: 0 auto; }
.bottombar { display: none; }
.mobile-only { display: none; }

.page-head { margin: 10px 0 18px; }
.page-head.center { text-align: center; }
.sub { color: var(--muted); font-weight: 700; margin: 0 0 4px; }

/* ═══════════════ Cartes ═══════════════ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }

.mcard {
  container-type: inline-size;
  position: relative; width: 100%; aspect-ratio: 5 / 7;
  border: 3px solid var(--ink); border-radius: 14px;
  background: var(--rc2); box-shadow: var(--sh);
  overflow: hidden; cursor: pointer; user-select: none;
  transition: transform .18s ease, box-shadow .18s;
  --mx: 50%; --my: 50%;
}
.card-grid .mcard:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--sh-lg); }
.mcard.lg { border-width: 4px; border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); transition: transform .1s; }
.mc-frame { position: relative; display: flex; flex-direction: column; height: 100%; padding: 4cqw; gap: 3cqw; }
.mc-top { position: absolute; top: 6cqw; left: 6cqw; right: 6cqw; display: flex; gap: 2cqw; z-index: 2; align-items: center; }
.mc-chip {
  font-family: var(--font-title); font-size: 8.5cqw; line-height: 1; padding: 1.8cqw 3cqw;
  background: var(--rc); color: #fff; border: max(1.5px, .9cqw) solid var(--ink); border-radius: 3cqw;
}
.mc-new { font-family: var(--font-title); font-size: 6.5cqw; background: var(--yellow); border: max(1.5px, .9cqw) solid var(--ink); border-radius: 3cqw; padding: 1.4cqw 2.4cqw; }
.mc-qty { margin-left: auto; font-family: var(--font-title); font-size: 8cqw; background: #fff; border: max(1.5px, .9cqw) solid var(--ink); border-radius: 99px; padding: 1.2cqw 3.4cqw; }
.mc-art {
  position: relative; flex: 0 0 54%; border-radius: 4cqw; overflow: hidden;
  border: max(2px, 1.2cqw) solid var(--ink); background: #fff;
}
/* Le mème est affiché EN ENTIER (contain) ; un fond flouté de la même image comble les bords. */
.mc-art img { display: block; }
.mc-art .mc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(10px) saturate(1.3); transform: scale(1.25); opacity: .55; }
.mc-art .mc-img { position: relative; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.mc-art .mc-img.fill, .mc-art .mc-video.fill { object-fit: cover; }
.mc-lock { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-title); font-size: 30cqw; color: #fff; text-shadow: 0 0 2cqw #0006; z-index: 1; }
.mc-body {
  flex: 1; min-height: 0; overflow: hidden; background: #fff; border-radius: 3.5cqw;
  border: max(1.5px, .9cqw) solid var(--ink); padding: 2.5cqw 4cqw;
}
.mc-name { font-family: var(--font-title); font-size: 8.4cqw; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-desc { font-size: 4.6cqw; line-height: 1.3; color: #4a4466; margin-top: 2cqw; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; }
.mc-stats { display: flex; justify-content: space-between; font-weight: 900; font-size: 7.2cqw; padding: 0 1.5cqw; }
.mc-stats span { display: inline-flex; align-items: center; gap: 1.5cqw; }
.mc-atk { color: #e11d48; }
.mc-def { color: #2563eb; }
.ico { width: 1.1em; height: 1.1em; flex: none; }
.mcard.lg .mc-desc { -webkit-line-clamp: 7; }
.mcard.sm .mc-art { flex: 1 1 auto; }
.mcard.sm .mc-body { flex: 0 0 auto; min-height: 23cqw; display: flex; align-items: center; padding: 2cqw 4cqw; }
.mcard.sm .mc-name { font-size: 9cqw; }
.mcard.sm .mc-stats { font-size: 8cqw; }

/* Holographique pour Super rare et + */
.mc-holo { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.r-super_rare .mc-holo, .r-ultra_rare .mc-holo, .r-legendary .mc-holo {
  background: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.65) 45%, rgba(255,255,255,0) 55%);
  background-size: 260% 100%; mix-blend-mode: soft-light; animation: shimmer 3.2s linear infinite;
}
.r-ultra_rare .mc-holo {
  background-image: linear-gradient(115deg, transparent 25%, rgba(255,255,255,.7) 45%, transparent 55%),
    radial-gradient(circle at var(--mx) var(--my), rgba(255,120,200,.35), transparent 60%);
  background-size: 260% 100%, 100% 100%;
}
.r-legendary.mcard { background: linear-gradient(135deg, #fff4cc, #ffd970 40%, #fff4cc 60%, #ffcf4d); }
.r-legendary .mc-holo {
  background-image: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.8) 42%, transparent 55%),
    conic-gradient(from 0deg at var(--mx) var(--my), #ff4f8b33, #ffd23f33, #3ec5ff33, #8b5cf633, #ff4f8b33);
  background-size: 260% 100%, 100% 100%;
  mix-blend-mode: overlay;
}
.r-legendary.mcard.lg { animation: legend-glow 2.4s ease-in-out infinite; }
/* LR : carte nuit étoilée + reflets arc-en-ciel, la plus rare (uniquement des animés) */
.r-lr.mcard { background: linear-gradient(135deg, #1d1036, #3b0f5c 45%, #12204a 70%, #2a0c3f); color: #fff; }
.r-lr .mc-holo {
  background-image: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.85) 42%, transparent 55%),
    conic-gradient(from 0deg at var(--mx) var(--my), #ff4f8b55, #ffd23f55, #3ec5ff55, #8b5cf655, #ff4f8b55);
  background-size: 260% 100%, 100% 100%;
  mix-blend-mode: screen; animation: shimmer 2.6s linear infinite;
}
.r-lr.mcard.lg { animation: lr-glow 2s ease-in-out infinite; }
@keyframes lr-glow { 0%, 100% { box-shadow: 6px 6px 0 var(--ink), 0 0 36px #ff2bd6; } 50% { box-shadow: 6px 6px 0 var(--ink), 0 0 46px #3ec5ff; } }
@keyframes shimmer { from { background-position: 130% 0, 0 0; } to { background-position: -130% 0, 0 0; } }
@keyframes legend-glow { 50% { box-shadow: 6px 6px 0 var(--ink), 0 0 40px #ffc83d; } }

/* Drapeau des mèmes par pays */
.mc-flag { position: absolute; top: 6cqw; right: 6cqw; z-index: 3; line-height: 0; }
.mc-top:has(.mc-qty) ~ .mc-flag { top: 18cqw; }
.mc-flag .flag { width: 14cqw; height: auto; border: max(1.5px, .8cqw) solid var(--ink); border-radius: 2cqw; box-shadow: 1px 1px 0 var(--ink); background: #fff; }
.flag-inline { width: 20px; height: auto; border: 1.5px solid var(--ink); border-radius: 3px; vertical-align: -3px; }

/* Mèmes animés (« shiny ») */
.mc-video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; background: transparent; }
.mc-anim {
  font-family: var(--font-title); font-size: 6.2cqw; color: #fff; padding: 1.4cqw 2.6cqw; border-radius: 3cqw;
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #f59e0b, #8b5cf6); background-size: 300% 100%; animation: anim-badge 3s linear infinite;
  border: max(1.5px, .9cqw) solid var(--ink); white-space: nowrap;
}
@keyframes anim-badge { to { background-position: 300% 0; } }
.mcard.animated {
  border-color: transparent;
  background:
    linear-gradient(135deg, #f5f3ff, #fdf2f8 50%, #fffbeb) padding-box,
    conic-gradient(from var(--spin, 0deg), #8b5cf6, #ec4899, #f59e0b, #22c55e, #3ec5ff, #8b5cf6) border-box;
  animation: spin-border 4s linear infinite;
  box-shadow: var(--sh), 0 0 18px #a78bfa88;
}
.mcard.animated .mc-holo {
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.75) 42%, transparent 55%),
    conic-gradient(from 0deg at var(--mx) var(--my), #ff4f8b40, #ffd23f40, #3ec5ff40, #8b5cf640, #ff4f8b40);
  background-size: 260% 100%, 100% 100%; mix-blend-mode: overlay; animation: shimmer 2.4s linear infinite;
}
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin-border { to { --spin: 360deg; } }
.mc-sound {
  position: absolute; right: 3cqw; bottom: 3cqw; z-index: 4; width: 16cqw; height: 16cqw; min-width: 26px; min-height: 26px;
  border-radius: 50%; border: max(1.5px, .9cqw) solid var(--ink); background: #fff; cursor: pointer; font-size: max(12px, 7cqw);
  display: grid; place-items: center; box-shadow: 1px 1px 0 var(--ink); padding: 0;
}
.mc-sound:hover { transform: scale(1.1); }
.mcard.sm .mc-sound { opacity: 0; transition: opacity .2s; }
.mcard.sm:hover .mc-sound, .mcard.sm .mc-sound:focus { opacity: 1; }
@media (hover: none) { .mcard.sm .mc-sound { opacity: 1; } }
.anim-tag { background: linear-gradient(90deg, #ede9fe, #fce7f3); }
.flip.anim .card-back { background: repeating-linear-gradient(45deg, #8b5cf6 0 18px, #a78bfa 18px 36px); }

.mcard.locked { background: #e9e6f2; }
.mcard.locked .mc-art .mc-img { filter: grayscale(1) brightness(.55) blur(1.5px); }
.mcard.locked .mc-art .mc-bg { filter: grayscale(1) blur(10px); }
.mcard.locked .mc-name, .mcard.locked .mc-stats { opacity: .55; }
.mcard.locked .mc-holo { display: none; }

/* ═══════════════ Paquets ═══════════════ */
.pack-zone { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0 30px; min-height: 480px; }
.pack { background: none; border: 0; padding: 0; cursor: pointer; width: 200px; transition: transform .2s; }
.pack:hover { transform: translateY(-6px) rotate(-2deg); }
.pack.empty { filter: grayscale(.85); opacity: .55; cursor: default; }
.pack.empty:hover { transform: none; }
/* Booster façon TCG : sachet métallisé, bords dentelés (clip-path posé en JS), fenêtre illustrée. */
.pack-art {
  position: relative; aspect-ratio: 0.62; container-type: inline-size;
  filter: drop-shadow(5px 6px 0 var(--ink)) drop-shadow(0 16px 24px rgba(31, 26, 58, .28));
}
.pk-fire   { --pk-a: #ff5f2e; --pk-b: #ffb03a; --pk-c: #b3201c; --pk-glow: #ffb347; }
.pk-gold   { --pk-a: #ffd84d; --pk-b: #fff3b0; --pk-c: #c27c0e; --pk-glow: #ffe066; }
.pk-violet { --pk-a: #9b4dff; --pk-b: #ff6fae; --pk-c: #3d1a9e; --pk-glow: #c084fc; }
.pk-main, .pk-top {
  position: absolute; inset: 0; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px 5px),
    radial-gradient(circle at 50% 58%, var(--pk-b) 0%, transparent 62%),
    linear-gradient(165deg, var(--pk-a) 0%, var(--pk-c) 100%);
}
.pk-main { z-index: 1; transition: clip-path .05s; }
.pk-top { z-index: 2; pointer-events: none; }
.pk-foil {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.75) 44%, rgba(255,255,255,.1) 52%, transparent 60%);
  background-size: 260% 100%; animation: shimmer 3.2s linear infinite;
}
.pk-crimp {
  position: absolute; left: 0; right: 0; height: 9%; z-index: 2;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.45) 0 1.2cqw, rgba(0,0,0,.22) 1.2cqw 2.4cqw),
    linear-gradient(var(--pk-c), var(--pk-a));
}
.pk-crimp-top { top: 0; box-shadow: inset 0 -0.8cqw 0 rgba(0,0,0,.35); }
.pk-crimp-bottom { bottom: 0; box-shadow: inset 0 0.8cqw 0 rgba(0,0,0,.35); }
.pk-tearline { position: absolute; top: 15.5%; left: 3%; right: 3%; z-index: 2; border-top: 0.8cqw dashed rgba(255,255,255,.85); }
.pk-tearline::before { content: '✂'; position: absolute; left: -1cqw; top: -4.6cqw; font-size: 6cqw; color: #fff; }
.pk-logo {
  position: absolute; top: 18%; left: 0; right: 0; z-index: 2; display: flex; flex-direction: column; align-items: center;
  font-family: var(--font-title); line-height: .9; transform: rotate(-4deg);
}
.pk-logo span { font-size: 17cqw; color: #fff; text-shadow: 0.9cqw 0.9cqw 0 var(--ink), -0.6cqw -0.6cqw 0 var(--ink), 0.6cqw -0.6cqw 0 var(--ink), -0.6cqw 0.6cqw 0 var(--ink); }
.pk-logo span:last-child { color: var(--yellow); }
.pk-window {
  position: absolute; top: 39%; left: 11%; right: 11%; height: 35%; z-index: 2; overflow: hidden;
  border-radius: 6cqw; border: 1.4cqw solid #fff; box-shadow: 0 0 0 0.9cqw var(--ink), 0 0 6cqw var(--pk-glow); background: #fff;
}
.pk-window img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-series {
  position: absolute; top: 76.5%; left: 0; right: 0; z-index: 2; text-align: center; color: #fff;
  font-family: var(--font-title); font-size: 5.2cqw; letter-spacing: .6cqw; text-shadow: 0.5cqw 0.5cqw 0 var(--ink);
}
.pk-tag {
  position: absolute; bottom: 11%; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  background: #fff; border: 0.9cqw solid var(--ink); border-radius: 99px; padding: 1cqw 4.5cqw; font-family: var(--font-title); font-size: 6.5cqw;
}
/* Carte qui sort du sachet après la déchirure */
.pk-card { position: absolute; left: 13%; right: 13%; top: 22%; height: 68%; z-index: 0; transition: transform .65s cubic-bezier(.2, 1.3, .5, 1); }
.pk-card .card-back { border-width: 1.2cqw; border-radius: 6cqw; box-shadow: none; font-size: 13cqw; }

.pack.shaking { animation: pack-shake .1s linear infinite alternate; }
.pack.shaking .pack-art { filter: drop-shadow(5px 6px 0 var(--ink)) drop-shadow(0 0 30px var(--pk-glow)); }
.pack.tearing .pk-top { animation: pack-tear .65s cubic-bezier(.3, .6, .4, 1) forwards; }
.pack.emptying .pk-card { transform: translateY(-58%) rotate(-2deg); }
.pack.emptying { animation: pack-out .7s .25s ease-in forwards; }
@keyframes pack-shake { from { transform: rotate(-3deg) scale(1.03); } to { transform: rotate(3deg) scale(1.05); } }
@keyframes pack-tear { 30% { transform: translate(4%, -6%) rotate(6deg); } to { transform: translate(40%, -70%) rotate(32deg); opacity: 0; } }
@keyframes pack-out { to { transform: translateY(30%) scale(.92); opacity: 0; } }

.pack-count {
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--sh);
  padding: 10px 26px; text-align: center; min-width: 210px;
}
.pc-main { font-family: var(--font-title); font-size: 26px; }
.pc-main b { color: var(--pink); font-weight: 400; }
.pc-sub { font-size: 13px; color: var(--muted); font-weight: 800; }
.pc-sub b { color: var(--pink-d); }
.pc-bought { margin-top: 4px; font-size: 13px; font-weight: 900; color: var(--green); }

.pro-panel {
  max-width: 520px; margin: 10px auto 30px; background: linear-gradient(160deg, #f5edff, #fff);
  border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--sh-lg); padding: 20px;
}
.pro-panel.big { max-width: 640px; }
.pro-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.pro-head p { margin: 0; color: var(--muted); font-size: 14px; }
.pro-head b { font-family: var(--font-title); font-weight: 400; font-size: 22px; }
.pro-badge {
  display: inline-block; font-family: var(--font-title); letter-spacing: 1px; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--purple), #c026d3); border: 2.5px solid var(--ink); border-radius: 10px; padding: 4px 10px; vertical-align: middle;
}
.pro-panel ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 9px; font-size: 15px; }

/* Révélation */
.reveal { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.reveal-count { font-weight: 800; color: var(--muted); }
.reveal-count b { color: var(--pink); font-size: 20px; }
.reveal-stage { min-height: 420px; display: grid; place-items: center; }
.reveal-nav { display: flex; align-items: center; gap: 14px; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: var(--sh); }
.round-btn:disabled { opacity: .35; cursor: default; }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ddd5f0; border: 2px solid var(--ink); }
.dots i.seen { background: #ffb3cd; }
.dots i.on { background: var(--pink); transform: scale(1.25); }

.flip { width: min(300px, 76vw); aspect-ratio: 5 / 7; perspective: 1400px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .75s cubic-bezier(.3, 1.4, .5, 1); transform-style: preserve-3d; }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-front { transform: rotateY(180deg); }
.flip-front .mcard { height: 100%; }
.card-back {
  height: 100%; border: 4px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 var(--ink);
  background: repeating-linear-gradient(45deg, #ff4f8b 0 18px, #ff6b9d 18px 36px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-title); color: #fff; font-size: clamp(28px, 9vw, 44px); line-height: .95;
  text-shadow: 3px 3px 0 var(--ink);
  container-type: inline-size;
}
.card-back span:last-child { color: var(--yellow); }
.flip.entering { animation: pop-in .35s ease-out; }
.flip.charging .card-back { animation: charge 1.1s ease-in-out; }
@keyframes pop-in { from { transform: scale(.6) translateY(40px); opacity: 0; } }
@keyframes charge {
  0% { box-shadow: 6px 6px 0 var(--ink), 0 0 0 var(--glow); transform: scale(1); }
  60% { box-shadow: 6px 6px 0 var(--ink), 0 0 70px 10px var(--glow); transform: scale(1.04) rotate(-1.5deg); }
  80% { transform: scale(1.06) rotate(1.5deg); }
  100% { box-shadow: 6px 6px 0 var(--ink), 0 0 90px 20px var(--glow); transform: scale(1.02); }
}
.flip.flipped.r-lr, .flip.flipped.r-legendary, .flip.flipped.r-ultra_rare { filter: drop-shadow(0 0 30px var(--glow)); }

.reveal-grid-wrap { width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.reveal-grid-wrap .sub { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; align-items: center; }
.reveal-grid { width: 100%; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.reveal-grid .flip { width: 100%; }
.reveal-grid .card-back { font-size: 26px; border-width: 3px; border-radius: 14px; }
.reveal-grid .mcard.lg { border-width: 3px; border-radius: 14px; box-shadow: var(--sh); }
.reveal-grid .mcard.lg .mc-desc { display: none; }
.reveal-grid .mcard.lg .mc-art { flex: 1 1 auto; }
.reveal-grid .mcard.lg .mc-body { flex: 0 0 auto; min-height: 23cqw; display: flex; align-items: center; }
.rg-item { animation: pop-in .4s backwards; animation-delay: var(--d); }

.help .bullets { padding-left: 20px; display: grid; gap: 6px; }
.rates { width: 100%; border-collapse: collapse; font-size: 14px; }
.rates th, .rates td { padding: 7px 6px; border-bottom: 2px dashed #e3dcf5; text-align: left; }
.rates th { font-size: 12px; text-transform: uppercase; color: var(--muted); }

/* Effets */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti-layer i {
  position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; border: 1.5px solid var(--ink);
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }
.screen-flash { position: fixed; inset: 0; background: var(--flash); pointer-events: none; z-index: 199; animation: flash .7s ease-out forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* ═══════════════ Collection ═══════════════ */
.progress-card { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--sh-lg); padding: 16px 18px; margin-bottom: 18px; }
.pg-main { font-family: var(--font-title); font-size: 22px; }
.pg-main .muted { font-family: var(--font); font-size: 15px; font-weight: 800; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; }
.rp { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px; align-items: center; font-size: 12px; font-weight: 900; }
.rp span { background: var(--rc); color: #fff; border: 2px solid var(--ink); border-radius: 6px; text-align: center; font-family: var(--font-title); font-weight: 400; }
.rp .bar { height: 8px; }
.rp .bar i { background: var(--rc); }

/* Fiche carte */
.card-detail { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 24px; align-items: start; }
.cd-card { position: sticky; top: 0; width: 100%; }
.cd-info h2 { font-size: 30px; margin-top: 8px; }
.cd-desc { font-size: 16px; line-height: 1.5; }
.cd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.cd-meta div { background: var(--soft); border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; }
.cd-meta dt { font-size: 11px; text-transform: uppercase; font-weight: 900; color: var(--muted); }
.cd-meta dd { margin: 2px 0 0; font-weight: 900; display: flex; align-items: center; gap: 5px; }
.cd-meta .atk { color: #e11d48; }
.cd-meta .def { color: #2563eb; }
.cd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.market-box { margin-top: 10px; background: var(--soft); border: 2px solid var(--ink); border-radius: 12px; padding: 10px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin-bottom: 8px; }
.spark i { flex: 1; background: var(--purple); border-radius: 3px 3px 0 0; }

/* ═══════════════ Modales ═══════════════ */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; background: #1f1a3a73; backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; animation: fade .2s;
}
.modal-wrap.out { animation: fade .2s reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink);
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px;
  animation: modal-in .25s cubic-bezier(.3, 1.5, .6, 1);
}
.modal.small { max-width: 440px; }
.modal.wide { max-width: 880px; }
@keyframes modal-in { from { transform: scale(.9) translateY(20px); opacity: 0; } }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--paper); cursor: pointer; font-weight: 900; z-index: 5;
}
.confirm p { font-size: 17px; margin: 6px 30px 18px 0; }
.form { display: grid; gap: 14px; }
.picker { display: grid; gap: 12px; }
.picker .card-grid { max-height: 60vh; overflow-y: auto; padding: 4px 8px 8px 4px; }
.notif-list { display: grid; gap: 8px; }
.notif { border: 2px solid #e3dcf5; border-radius: 12px; padding: 10px 12px; }
.notif.unread { border-color: var(--ink); background: #fff7d1; }
.notif p { margin: 0 0 2px; font-weight: 700; }
.notif small { color: var(--muted); }
.more-menu { display: grid; gap: 6px; padding-top: 20px; }

/* Toasts */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--sh); padding: 11px 16px;
  font-weight: 800; animation: toast-in .3s cubic-bezier(.3, 1.5, .6, 1); text-align: center;
}
.toast.out { animation: fade .3s reverse forwards; }
.toast-success { background: #dcfce7; }
.toast-error { background: #ffe1e1; }
@keyframes toast-in { from { transform: translateY(20px) scale(.9); opacity: 0; } }

/* Captcha */
#captcha-box { position: fixed; inset: 0; z-index: 400; background: #1f1a3a73; display: grid; place-items: center; }
#captcha-box[hidden] { display: none; }
.captcha-card { background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--sh-lg); padding: 24px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.captcha-card p { margin: 0; font-weight: 800; }

.dupe-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; max-height: 180px; overflow-y: auto; }
.dupe-actions { display: grid; gap: 8px; }

/* ═══════════════ Marché ═══════════════ */
.auction-list { display: grid; gap: 12px; margin-bottom: 14px; }
.auction {
  display: grid; grid-template-columns: 82px 1fr auto auto; gap: 16px; align-items: center;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--sh); padding: 10px 14px;
}
.auction.done { opacity: .7; }
.auction .mcard { box-shadow: 2px 2px 0 var(--ink); border-width: 2.5px; }
.au-name { font-family: var(--font-title); font-size: 19px; margin-bottom: 4px; }
.au-seller { font-size: 13px; color: var(--muted); margin-top: 4px; }
.au-seller a { font-weight: 900; color: var(--ink); }
.au-price { text-align: right; }
.au-label { font-size: 12px; color: var(--muted); font-weight: 800; }
.au-amount { font-family: var(--font-title); font-size: 24px; }
.au-buyout { font-size: 12px; font-weight: 800; color: var(--green); }
.au-leading { font-size: 12px; font-weight: 900; color: var(--pink-d); }
.au-side { display: grid; gap: 6px; justify-items: end; min-width: 110px; }
.au-time { font-weight: 900; font-variant-numeric: tabular-nums; }
.au-status { font-weight: 900; }
.auction-form .mcard { width: 150px; flex: none; }

/* ═══════════════ Échanges ═══════════════ */
.trade-list { display: grid; gap: 14px; }
.trade { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--sh); padding: 14px 16px; display: grid; gap: 10px; }
.trade-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.trade-head a { color: var(--ink); }
.status { font-weight: 900; font-size: 13px; border: 2px solid var(--ink); border-radius: 99px; padding: 2px 10px; background: var(--soft); }
.s-accepted { background: #dcfce7; }
.s-refused, .s-cancelled { background: #ffe1e1; }
.s-pending { background: #fff7d1; }
.trade-msg { font-style: italic; color: var(--muted); margin: 0; }
.trade-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.trade-arrow { font-size: 26px; font-weight: 900; align-self: center; color: var(--pink); }
.trade-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.trade-builder { display: grid; gap: 12px; }
.tb-summary { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; background: var(--soft); border: 2px solid var(--ink); border-radius: 14px; padding: 10px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.sum-chip { border: 2px solid var(--ink); background: var(--rc2); border-radius: 99px; font-size: 12px; font-weight: 800; padding: 3px 9px; cursor: pointer; }
.tb-grid { max-height: 42vh; overflow-y: auto; padding: 4px 8px 8px 4px; }
.tb-item { position: relative; }
.tb-item.selected .mcard { outline: 4px solid var(--pink); outline-offset: 2px; }
.tb-sel { position: absolute; bottom: 4cqw; right: 4cqw; background: var(--pink); color: #fff; border: 2px solid var(--ink); border-radius: 99px; font-family: var(--font-title); font-size: 10cqw; padding: 0 3cqw; z-index: 3; }
.player-list { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.player-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid #e3dcf5; border-radius: 12px;
  background: var(--paper); text-align: left; cursor: pointer; text-decoration: none; font: inherit; font-weight: 700; width: 100%;
}
.player-row:hover { border-color: var(--ink); }
.player-row > a { text-decoration: none; }
.avatar-sm, .avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--yellow); font-family: var(--font-title); font-size: 18px; overflow: hidden; }
.avatar-sm { width: 34px; height: 34px; font-size: 15px; }
.avatar.sm { width: 38px; height: 38px; }
.avatar.xl { width: 110px; height: 110px; font-size: 48px; border-width: 4px; box-shadow: var(--sh-lg); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════ Bataille ═══════════════ */
.battle-top, .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box { background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--sh); padding: 12px; text-align: center; display: grid; gap: 2px; }
.stat-box span { font-size: 22px; }
.stat-box b { font-family: var(--font-title); font-weight: 400; font-size: 24px; }
.stat-box small { color: var(--muted); font-weight: 800; }
.team-power b { font-family: var(--font-title); font-weight: 400; font-size: 20px; color: var(--pink-d); }
.team-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); gap: 16px; margin: 14px 0; justify-content: center; }
.slot { position: relative; }
.slot-empty {
  aspect-ratio: 5 / 7; border: 3px dashed var(--ink); border-radius: 16px; display: grid; place-content: center; text-align: center;
  font-family: var(--font-title); font-size: 46px; cursor: pointer; background: #ffffffaa; color: var(--muted);
}
.slot-empty small { font-family: var(--font); font-size: 14px; font-weight: 800; }
.slot-x { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); cursor: pointer; font-weight: 900; z-index: 3; }
.fight-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.mode-card {
  display: grid; gap: 4px; justify-items: center; text-align: center; padding: 18px; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 18px; background: #e0f6ff; box-shadow: var(--sh-lg); transition: transform .1s;
}
.mode-card.ranked { background: #fff1c2; }
.mode-card:hover { transform: translate(-2px, -2px); }
.mode-card:disabled { opacity: .5; }
.mode-ico { font-size: 40px; }
.mode-card b { font-family: var(--font-title); font-weight: 400; font-size: 22px; }
.mode-card small { color: var(--muted); font-weight: 800; }
.history { display: grid; gap: 6px; }
.hist { display: grid; grid-template-columns: 90px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 12px; font-size: 14px; }
.hist.win { background: #dcfce7; }
.hist.loss { background: #ffe9e9; }

.arena-modal { max-width: 760px; background: linear-gradient(180deg, #ffe4ef, #e0f6ff); }
.arena { display: grid; gap: 14px; }
.arena-side { display: grid; gap: 8px; }
.arena-name { font-family: var(--font-title); font-size: 20px; text-align: center; }
.fighters { display: grid; grid-template-columns: repeat(3, minmax(0, 150px)); justify-content: center; gap: 14px; }
.fighter { position: relative; transition: transform .25s, filter .3s, opacity .3s; }
.fighter .mcard { cursor: default; }
.fighter.active { transform: scale(1.08); z-index: 2; }
.fighter.active .mcard { box-shadow: 4px 4px 0 var(--ink), 0 0 26px var(--rc); }
.fighter.ko { filter: grayscale(1); opacity: .4; transform: scale(.9); }
.hp { height: 10px; margin-top: 6px; background: #ffd1d1; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #84cc16); transition: width .35s; }
.hp-txt { text-align: center; font-size: 12px; font-weight: 900; }
.lunge-up { transform: translateY(-26px) scale(1.12) !important; }
.lunge-down { transform: translateY(26px) scale(1.12) !important; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { translate: -6px 0; } 50% { translate: 6px 0; } 75% { translate: -4px 0; } }
.dmg {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; pointer-events: none;
  font-family: var(--font-title); font-size: 26px; color: #e11d48; text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;
  animation: dmg-up .9s ease-out forwards;
}
.dmg.crit { font-size: 32px; color: #f97316; }
.dmg.dodge { color: #2563eb; font-size: 22px; }
@keyframes dmg-up { to { transform: translate(-50%, -60px); opacity: 0; } }
.arena-mid { display: flex; align-items: center; gap: 12px; justify-content: center; }
.vs { font-family: var(--font-title); font-size: 30px; color: var(--pink); text-shadow: 2px 2px 0 var(--ink); }
.arena-log { font-weight: 800; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 6px 12px; min-height: 36px; flex: 1; max-width: 460px; text-align: center; }
.result { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; background: #ffffffe0; border-radius: 20px; animation: fade .3s; z-index: 10; }
.result h2 { font-size: 54px; }
.result.win h2 { color: var(--green); text-shadow: 3px 3px 0 var(--ink); }
.result.loss h2 { color: var(--red); text-shadow: 3px 3px 0 var(--ink); }
.result p { font-size: 22px; font-weight: 900; margin: 0; }

/* ═══════════════ Profil / succès / classement ═══════════════ */
.profile-head { display: flex; gap: 22px; align-items: center; margin: 10px 0 22px; flex-wrap: wrap; }
.profile-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bio { font-size: 16px; }
.bio-form { max-width: 520px; }
.avatar-btn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; }
.avatar-btn span { position: absolute; bottom: 2px; right: 2px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2.5px solid #d9d2ec; border-radius: 14px; background: var(--paper); opacity: .65; }
.ach.on { border-color: var(--ink); background: #fff7d1; opacity: 1; box-shadow: var(--sh); }
.ach-ico { font-size: 28px; }
.ach small { color: var(--muted); font-weight: 700; }
.ach-reward { font-weight: 900; white-space: nowrap; font-size: 14px; }
.leaderboard { display: grid; gap: 8px; }
.lb-row { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: var(--sh); text-decoration: none; }
.lb-row.me { background: #fff1c2; }
.lb-rank { font-family: var(--font-title); font-size: 20px; width: 44px; text-align: center; }
.lb-val { font-family: var(--font-title); font-size: 18px; }
.purchases { display: grid; gap: 6px; }
.purchase { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 12px; border: 2px solid #e3dcf5; border-radius: 12px; }

/* ═══════════════ Paramètres ═══════════════ */
.settings { display: grid; gap: 4px; padding: 6px 18px; }
.setting { display: flex; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 2px dashed #e3dcf5; }
.setting:last-child { border-bottom: 0; }
.setting select { width: auto; min-width: 180px; }
.setting-link { color: inherit; text-decoration: none; }
.setting-link .chev { font-size: 28px; font-weight: 900; color: var(--muted, #8a83a3); }
.setting-link:hover b { color: var(--pink, #ff4f8b); }
/* Page Aide */
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.install-grid .panel { margin: 0; }
.steps { padding-left: 22px; display: grid; gap: 10px; margin: 12px 0; }
.steps li { line-height: 1.45; }
.steps b { background: #fff4cc; padding: 0 5px; border-radius: 6px; }
.install-card [data-install] { margin-top: 8px; }
/* Pièce MemeCoin (remplace l'émoji 🪙, voir core.js) : dorée sur tous les appareils */
.coin {
  display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.17em; flex: none; font-style: normal;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%23c98a00'/%3E%3Ccircle cx='16' cy='15' r='13.5' fill='%23ffc928'/%3E%3Ccircle cx='16' cy='15' r='10.5' fill='none' stroke='%23e0a100' stroke-width='1.6'/%3E%3Cpath d='M10.2 20.2V10.4h2.3l3.5 5 3.5-5h2.3v9.8h-2.4v-6l-3.4 4.8-3.4-4.8v6z' fill='%23a86f00'/%3E%3Cellipse cx='11.5' cy='8.5' rx='4' ry='2' fill='%23fff' opacity='.45' transform='rotate(-25 11.5 8.5)'/%3E%3C/svg%3E") center / contain no-repeat;
}
.coin-stack .coin { width: 1em; height: 1em; }

/* Carte du jour */
.daily { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 360px); gap: 24px; justify-content: center; align-items: center; margin-bottom: 24px; }
.daily-card { position: relative; }
.daily-card.sold .mcard { filter: grayscale(.5) brightness(.9); }
.daily-stamp {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); z-index: 5;
  font-family: var(--font-title); font-size: 30px; color: #fff; background: var(--pink); border: 3px solid var(--ink);
  border-radius: 12px; padding: 6px 16px; box-shadow: var(--sh); white-space: nowrap;
}
.daily-side { display: grid; gap: 10px; justify-items: start; }
.daily-side h2 { margin: 0; }
.daily-side .btn { justify-self: stretch; }
.daily-price { font-family: var(--font-title); font-size: 34px; display: flex; align-items: center; gap: 8px; }
.daily-new { color: var(--pink-d); font-weight: 800; }
.daily-timer { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 700px) {
  .daily { grid-template-columns: 1fr; justify-items: center; }
  .daily-card { width: min(260px, 75vw); }
  .daily-side { width: 100%; justify-items: center; text-align: center; }
}

/* Légal */
/* Discret mais accessible (l'accès aux pages légales doit rester « facile ») */
.legal-links { text-align: center; font-size: 11px; color: var(--muted, #8a83a3); opacity: .7; margin: 24px 0 8px; }
.legal-links.left { text-align: left; }
.legal-links a, .auth-legal a { color: inherit; text-decoration: underline; }
.auth-legal { font-size: 12px; color: var(--muted, #8a83a3); margin-top: 10px; text-align: center; }
.confirm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin: 4px 0 14px; padding: 10px; background: #fff4cc; border-radius: 12px; cursor: pointer; }
.confirm-check input { margin-top: 2px; width: 18px; height: 18px; flex: none; accent-color: var(--pink, #ff4f8b); }
.confirm-check a { color: inherit; text-decoration: underline; }
.demo-banner.closed { background: #ffe4ef; border-color: #ff4f8b; }
.suggest-form { display: grid; gap: 10px; margin: 12px 0; max-width: 560px; }
.suggest-form textarea { resize: vertical; font: inherit; }
.suggest-form .btn { justify-self: start; }
[data-my-suggest] .tag { margin: 2px; display: inline-block; }
.switch { position: relative; width: 56px; height: 32px; flex: none; display: block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #ddd5f0; border: 2.5px solid var(--ink); border-radius: 99px; cursor: pointer; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(24px); }
.auth-lang { position: absolute; top: 16px; right: 16px; }
.lang-select { width: auto; padding: 6px 10px; font-size: 14px; }
.more-btn { grid-column: 1 / -1; justify-self: center; margin-top: 6px; }
.coin-stack { font-size: 30px; height: 120px; display: grid; place-items: center; letter-spacing: -8px; filter: drop-shadow(2px 2px 0 var(--ink)); }
.filters { grid-template-columns: 1fr auto auto auto auto; }
.filters.market-filters { grid-template-columns: 1fr auto auto; }
.pc-hint { margin: -8px 0 0; text-align: center; max-width: 320px; }

/* Langues non latines : la police des titres n'a pas ces caractères, on épaissit la police de secours */
:lang(ja) :is(h1, h2, h3, h4, .btn.big, .pc-main, .stat-box b, .offer-qty, .au-name, .mode-card b),
:lang(zh) :is(h1, h2, h3, h4, .btn.big, .pc-main, .stat-box b, .offer-qty, .au-name, .mode-card b),
:lang(ko) :is(h1, h2, h3, h4, .btn.big, .pc-main, .stat-box b, .offer-qty, .au-name, .mode-card b),
:lang(ru) :is(h1, h2, h3, h4, .btn.big, .pc-main, .stat-box b, .offer-qty, .au-name, .mode-card b),
:lang(ar) :is(h1, h2, h3, h4, .btn.big, .pc-main, .stat-box b, .offer-qty, .au-name, .mode-card b),
:lang(hi) :is(h1, h2, h3, h4, .btn.big, .pc-main, .stat-box b, .offer-qty, .au-name, .mode-card b) { font-weight: 900; }

/* Arabe : lecture de droite à gauche */
[dir="rtl"] .sidebar { border-right: 0; border-left: 3px solid var(--ink); }
[dir="rtl"] .topbar-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .nav-badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .auth-lang { right: auto; left: 16px; }

/* ═══════════════ Messages ═══════════════ */
.messages { display: grid; grid-template-columns: 290px 1fr; gap: 16px; height: calc(100vh - 110px); min-height: 420px; }
.conv-list, .chat { background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--sh-lg); overflow: hidden; display: flex; flex-direction: column; }
.conv-list { padding: 14px; gap: 6px; overflow-y: auto; }
.conv { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none; border: 2px solid transparent; }
.conv:hover { background: var(--soft); }
.conv.on { border-color: var(--ink); background: #fff7d1; }
.chat-head { padding: 12px 16px; border-bottom: 3px solid var(--ink); font-family: var(--font-title); font-size: 20px; display: flex; gap: 10px; align-items: center; }
.chat-head a { text-decoration: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fffbf3; }
.bubble { max-width: 75%; align-self: flex-start; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px 16px 16px 4px; padding: 8px 12px; }
.bubble.me { align-self: flex-end; background: #ffd6e7; border-radius: 16px 16px 4px 16px; }
.bubble p { margin: 0; word-break: break-word; }
.bubble small { color: var(--muted); font-size: 11px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 3px solid var(--ink); }
.chat .empty { margin: auto; }

/* ═══════════════ Boutique ═══════════════ */
.demo-banner { background: #e0f6ff; border: 2.5px dashed var(--ink); border-radius: 14px; padding: 10px 14px; font-weight: 800; text-align: center; margin-bottom: 20px; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 10px 0 12px; }
.offer {
  position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--sh-lg);
  padding: 18px 14px 14px; text-align: center; display: grid; gap: 8px; justify-items: center;
}
.offer.featured { background: linear-gradient(180deg, #fff1c2, #fff); }
.offer-tag { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--pink); color: #fff; border: 2.5px solid var(--ink); border-radius: 99px; padding: 3px 12px; font-weight: 900; font-size: 12px; white-space: nowrap; }
.offer-discount { position: absolute; top: 10px; right: 10px; background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 10px; padding: 2px 8px; font-family: var(--font-title); transform: rotate(8deg); z-index: 2; }
.offer-packs { position: relative; height: 120px; width: 120px; }
.mini-pack { position: absolute; width: 70px; left: 50%; top: 4px; transform: translateX(calc(-50% + (var(--i) - 1) * 22px)) rotate(calc((var(--i) - 1) * 10deg)); }
.mini-pack .pack-art { border-width: 2.5px; border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); }
.mini-pack .pack-tag { display: none; }
.offer-qty { font-family: var(--font-title); font-size: 24px; }
.offer-sub { font-size: 13px; color: var(--muted); font-weight: 800; }

/* ═══════════════ Mobile ═══════════════ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: initial; }
  .topbar { padding: 10px 16px; }
  .topbar .logo { font-size: 21px; }
  .pill { padding: 4px 9px; font-size: 14px; }
  .view { padding: 4px 16px calc(var(--bottombar-h) + 30px); }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--paper); border-top: 3px solid var(--ink); height: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottombar .nav-item { flex-direction: column; gap: 2px; justify-content: center; padding: 4px 2px; border-radius: 0; border: 0; font-size: 11px; box-shadow: none; }
  .bottombar .nav-item.active { background: var(--yellow); }
  .bottombar .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
  #toasts { bottom: calc(var(--bottombar-h) + 16px); }
  .modal.sheet { align-self: end; border-radius: 22px 22px 0 0; max-width: none; }
  .modal-wrap:has(.sheet) { padding: 0; place-items: end stretch; }
  .auth { grid-template-columns: 1fr; padding-top: 30px; gap: 10px; }
  /* Sur téléphone, le choix de langue passe au-dessus du logo au lieu de le recouvrir */
  .auth-lang { position: static; justify-self: end; margin-bottom: 4px; }
  .auth-lang .input { padding: 6px 10px; min-width: 0; }
  .auth-cards { height: 200px; margin-top: 10px; }
  .auth-card { width: 118px; transform: translateX(calc(-50% + (var(--i) - 1) * 85px)) rotate(calc((var(--i) - 1) * 12deg)); }
  .card-detail { grid-template-columns: 1fr; }
  .cd-card { position: static; width: 100%; max-width: 260px; justify-self: center; }
  .messages { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .messages.has-peer .conv-list { display: none; }
  .messages:not(.has-peer) .chat { display: none; }
}
@media (max-width: 600px) {
  h1 { font-size: 28px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .card-grid.compact { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .filters, .filters.market-filters { grid-template-columns: 1fr 1fr; }
  .filters .input[type=search] { grid-column: 1 / -1; }
  .setting { flex-wrap: wrap; }
  .setting select { width: 100%; }
  .auction { grid-template-columns: 70px 1fr; gap: 10px; }
  .au-price { text-align: left; }
  .au-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: start; }
  .trade-cols, .tb-summary { grid-template-columns: 1fr; }
  .trade-arrow { transform: rotate(90deg); justify-self: center; }
  .fight-modes { grid-template-columns: 1fr; }
  .team-slots { gap: 10px; }
  .fighters { gap: 8px; }
  .hist { grid-template-columns: 1fr auto; }
  .hist .muted, .hist small { display: none; }
  .modal { padding: 20px 16px; }
  .pill.boosters-pill { display: none; }
  .result h2 { font-size: 40px; }
  .stat-box b { font-size: 20px; }
  .battle-top, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .rates { font-size: 12px; }
}

/* Presentation visible sous l'ecran de connexion (aussi lue par les moteurs de recherche), retiree une fois connecte */
.seo-about{max-width:760px;margin:10px auto 40px;padding:0 16px;color:var(--muted, #6b6280);font-size:.92rem;line-height:1.6}
.seo-about h1{font-size:1.25rem;color:inherit;margin:1.2em 0 .4em}
.seo-about h2{font-size:1.05rem;margin:1.1em 0 .3em}
.seo-about ul{padding-left:20px;margin:.3em 0}
.seo-about table{border-collapse:collapse;width:100%;max-width:520px}
.seo-about td,.seo-about th{text-align:left;padding:4px 8px;border-bottom:1px solid rgba(127,127,127,.25)}
.seo-about .badge{font-weight:700}
.seo-about a{color:#8b5cf6}

/* Parrainage */
.invite{display:flex;flex-direction:column;gap:12px}
.invite-link{display:flex;gap:8px}.invite-link .input{flex:1;min-width:0;font-family:ui-monospace,monospace}
.invite-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;text-align:center;margin-top:4px}
.invite-stats div{background:rgba(139,92,246,.08);border-radius:14px;padding:12px 6px;display:flex;flex-direction:column}
.invite-stats b{font-size:1.6rem;font-weight:900;color:#8b5cf6}.invite-stats span{font-size:.8rem;opacity:.75}
.invite-steps{padding-left:20px;line-height:1.8}
