/* ═══════════════════════════════════════════════════════════════
   BallDex — système visuel
   ═══════════════════════════════════════════════════════════════ */
:root {
  --font: 'Manrope', system-ui, sans-serif;
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --nav-w: 248px;
  --top-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --coral: #ff5a4e; --coral-2: #ff8a6b;
  --citrine: #ffc531; --mint: #2fd8a2; --sky: #3d8bff; --violet: #a35cff;

  --r-common: #9aa3b5; --r-uncommon: #2fd8a2; --r-rare: #3d8bff;
  --r-epic: #a35cff; --r-legendary: #ffc531; --r-mythic: #ff5ad1;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0e1a; --bg-2: #10142450;
  --surface: #141a2c; --surface-2: #1b2238; --surface-3: #242c46;
  --line: #ffffff14; --line-2: #ffffff24;
  --ink: #f3f5ff; --ink-2: #b7bdd6; --ink-3: #7d849f;
  --glass: #141a2ccc;
  --shadow: 0 20px 60px -20px #000a, 0 2px 8px #0005;
  --glow: 0 0 0 1px #ffffff10, 0 30px 80px -30px var(--coral);
}
[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f2ec; --bg-2: #ffffff80;
  --surface: #ffffff; --surface-2: #f6f3ee; --surface-3: #ece7df;
  --line: #1b1f3014; --line-2: #1b1f3024;
  --ink: #161a2c; --ink-2: #4a5070; --ink-3: #8a8fa8;
  --glass: #ffffffd9;
  --shadow: 0 20px 50px -24px #1b1f3040, 0 2px 6px #1b1f3010;
  --glow: 0 0 0 1px #1b1f3010, 0 30px 70px -30px #ff5a4e80;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 500 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* halo d'ambiance */
  content: ''; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 15% 0%, #ff5a4e22, transparent 60%),
    radial-gradient(40vmax 30vmax at 100% 20%, #3d8bff1f, transparent 60%),
    radial-gradient(50vmax 40vmax at 50% 110%, #a35cff1a, transparent 60%);
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 800; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }
.muted { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }
.center { text-align: center; }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  --b: var(--surface-2); --c: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--b); color: var(--c); font-weight: 700; white-space: nowrap;
  transition: transform .2s var(--spring), background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); background: var(--surface-3); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary {
  --c: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--coral), #ff3d7f); box-shadow: 0 10px 30px -10px #ff5a4eaa, inset 0 1px 0 #fff4;
}
.btn-primary:hover { background: linear-gradient(135deg, #ff6b5f, #ff4f8c); box-shadow: 0 14px 34px -10px #ff5a4ecc, inset 0 1px 0 #fff4; }
.btn-gold { --c: #2a1d00; border-color: transparent; background: linear-gradient(135deg, #ffe17a, #ffb21f); box-shadow: 0 10px 30px -12px #ffb21fbb; }
.btn-gold:not(:disabled):hover { background: linear-gradient(135deg, #ffdc62, #ffa40f); box-shadow: 0 14px 34px -10px #ffad20d9, inset 0 1px 0 #fff7; }
.btn-gold:not(:disabled):active { background: linear-gradient(135deg, #ffca3d, #ef9200); box-shadow: 0 5px 16px -8px #ffad20cc, inset 0 2px 5px #8a4a0033; }
.btn-gold:focus-visible { outline-color: var(--citrine); outline-offset: 3px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { --c: #ff6b6b; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.badge-dot {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ── Champs ──────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, .select {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface-2); transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px #ff5a4e26; }
textarea.input { padding: 12px 14px; min-height: 90px; resize: vertical; }
.select { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-3); }
.search .input { padding-left: 42px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 700; font-size: 13px; cursor: pointer; user-select: none; }
.toggle[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ── Surfaces ────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-pad { padding: clamp(16px, 3vw, 28px); }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.empty { display: grid; place-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty .icon { width: 40px; height: 40px; opacity: .5; }
.divider { height: 1px; background: var(--line); }

/* ── Démarrage ───────────────────────────────────────────────── */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-orb { width: 46px; height: 58px; border-radius: 30px; background: linear-gradient(135deg, #ffb199, var(--coral));
  animation: bob 1s var(--ease) infinite alternate; box-shadow: 0 20px 40px -10px #ff5a4e88; }
@keyframes bob { to { transform: translateY(-14px) rotate(8deg); } }

/* ═══ Coque de l'application ═════════════════════════════════════ */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100dvh; }
.nav {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg-2); backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; text-decoration: none; }
.brand-mark { width: 30px; height: 38px; }
.brand b { font: 800 21px/1 var(--display); letter-spacing: -.03em; }
.brand b i { font-style: normal; color: var(--coral); }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  color: var(--ink-2); text-decoration: none; font-weight: 700; transition: background .2s, color .2s;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link[aria-current='page'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav-link[aria-current='page'] .icon { color: var(--coral); }
.nav-link .badge-dot { position: static; margin-left: auto; box-shadow: none; }
.nav-foot { margin-top: auto; display: grid; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.me-chip small { display: block; color: var(--ink-3); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 10px;
  padding: 0 clamp(16px, 3vw, 32px); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font: 800 20px/1 var(--display); }
.topbar .brand { display: none; padding: 0; }
.wallet { display: flex; gap: 8px; margin-left: auto; }
.meter {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-variant-numeric: tabular-nums;
}
.meter-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.meter-draws .meter-ico { background: #ff5a4e22; color: var(--coral); }
.meter-money .meter-ico { background: #ffc53122; color: var(--citrine); }
.meter small { font-weight: 600; color: var(--ink-3); font-size: 11px; display: block; line-height: 1; margin-top: 2px; }
.meter > span { line-height: 1.05; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: transform .2s var(--spring); }
.icon-btn:hover { transform: scale(1.06); }

.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(16px, 3vw, 36px) clamp(16px, 3vw, 36px) 120px; display: grid; gap: 28px; animation: page-in .45s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; font-weight: 700; color: var(--ink-2); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Barre du bas (mobile) */
.tabbar { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .nav { display: none; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar .brand { display: flex; }
  .topbar-title { display: none; }
  .meter { padding-right: 11px; height: 38px; }
  .meter small { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; z-index: 30; left: 10px; right: 10px;
    bottom: calc(10px + var(--safe-b)); padding: 6px; border-radius: 26px; background: var(--glass);
    backdrop-filter: blur(20px) saturate(1.5); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; border-radius: 20px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 700; }
  .tabbar a[aria-current='page'] { color: var(--ink); background: var(--surface-2); }
  .tabbar a[aria-current='page'] .icon { color: var(--coral); }
  .tabbar .badge-dot { top: 2px; right: calc(50% - 22px); }
  .tabbar .tab-open { margin-top: -26px; }
  .tabbar .tab-open span.orb { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, var(--coral), #ff3d7f); box-shadow: 0 12px 30px -8px #ff5a4ecc, 0 0 0 5px var(--bg); }
  .tabbar .tab-open[aria-current='page'] { background: none; }
  .tabbar .tab-open[aria-current='page'] .icon { color: #fff; }
}
@media (max-width: 420px) { .meter-money small, .hide-xs { display: none; } }

/* ═══ Cartes ═════════════════════════════════════════════════════ */
.card {
  --rc: var(--r-common);
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 18px; text-align: left;
  background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 30%, transparent), var(--shadow);
  transform: perspective(700px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  transition: transform .35s var(--ease), box-shadow .3s; overflow: hidden; isolation: isolate;
}
button.card { cursor: pointer; font: inherit; color: inherit; }
button.card:hover { box-shadow: 0 0 0 1.5px var(--rc), 0 24px 50px -20px color-mix(in srgb, var(--rc) 70%, transparent); }
.r-uncommon { --rc: var(--r-uncommon); } .r-rare { --rc: var(--r-rare); } .r-epic { --rc: var(--r-epic); }
.r-legendary { --rc: var(--r-legendary); } .r-mythic { --rc: var(--r-mythic); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.card-cp { position: absolute; z-index: 3; right: 8px; bottom: 8px; display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--rc) 75%, #fff); border-radius: 10px; color: #fff; background: #101827e8; box-shadow: 0 3px 12px #0008, 0 0 12px color-mix(in srgb, var(--rc) 30%, transparent); line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.card-cp-label { color: var(--citrine); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.card-cp b { font-size: 12px; font-weight: 900; }
.card-name { font: 700 14px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-shiny { color: var(--citrine); font-size: 15px; text-shadow: 0 0 10px #ffc531; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card-types { display: flex; gap: 4px; }
.card-types i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--t); color: #fff; }
.card-types .glyph { fill: currentColor; }
.card > .art { flex: none; width: 100%; aspect-ratio: 1; }
.rarity-gem { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rc); white-space: nowrap; }
.card-flag, .card-lock { position: absolute; top: 40px; left: -2px; padding: 3px 9px 3px 10px; border-radius: 0 999px 999px 0; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; z-index: 3; }
.flag-new { background: var(--mint); color: #003524; box-shadow: 0 6px 16px -6px var(--mint); }
.card-lock { background: var(--surface-3); color: var(--ink-2); top: auto; bottom: 40px; }
.card-count { position: absolute; top: 40px; right: 8px; z-index: 3; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--ink); color: var(--bg); }
.card-fav { position: absolute; top: 72px; right: 10px; z-index: 3; color: var(--coral); font-size: 14px; }

.art { position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c1) 85%, #fff), var(--c1) 45%, color-mix(in srgb, var(--c2) 80%, #000) 110%); }
.art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 120%, #0006, transparent 60%); }
.pokemon-sprite { position: absolute; z-index: 1; inset: 4%; width: 92%; height: 92%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 10px 12px #0005); }
.pokemon-sprite[hidden] { display: none; }
.art-glyph { fill: #fff; filter: drop-shadow(0 4px 8px #0004); }
.art-glyph2 { fill: #fff; opacity: .85; }
.ring { transform-origin: 50px 50px; animation: spin var(--spin) linear infinite; animation-play-state: paused; }
.card:hover .ring, .reveal .ring, .art-lg .ring { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.art-num { position: absolute; left: 8px; bottom: 6px; z-index: 1; font: 800 11px/1 var(--display); opacity: .8; letter-spacing: .04em; }
.art.is-shiny { background: radial-gradient(circle at 30% 25%, #fff6c9, var(--c1) 40%, #2a1660 115%); }

/* Holographique pour les shiny */
.card.shiny { --rc: var(--citrine); }
.foil { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: color-dodge; opacity: .55;
  background:
    radial-gradient(circle at var(--mx, 30%) var(--my, 20%), #fff8 0, transparent 35%),
    linear-gradient(115deg, transparent 20%, #ff5ad155 35%, #3d8bff55 45%, #2fd8a255 55%, #ffc53155 65%, transparent 80%);
  background-size: 100% 100%, 250% 250%; animation: foil 5s linear infinite; }
@keyframes foil { to { background-position: 0 0, -250% 0; } }

/* Tailles */
.card-xs { padding: 6px; gap: 4px; border-radius: 12px; }
.card-xs .card-name { font-size: 11px; }
.card-xs .card-bottom, .card-xs .card-flag { display: none; }
.card-xs .art { border-radius: 9px; }
.card-lg { padding: 14px; gap: 12px; border-radius: 26px; }
.card-lg .card-name { font-size: 22px; }
.card-lg .art { border-radius: 20px; }
.card-lg .art-num { font-size: 15px; left: 14px; bottom: 12px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.grid-cards { align-content: start; }
@media (max-width: 560px) { .grid-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .grid-cards .card { padding: 6px; gap: 5px; border-radius: 13px; } .grid-cards .card-name { font-size: 11.5px; }
  .grid-cards .rarity-gem { display: none; } .grid-cards .card-types i { width: 16px; height: 16px; }
  .grid-cards .card-flag, .grid-cards .card-count { top: 30px; font-size: 9px; } }

.type-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; background: var(--t); }
.type-chip .glyph { fill: currentColor; }

/* ═══ Accueil (déconnecté) ═══════════════════════════════════════ */
.landing { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.landing-top { display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(16px, 4vw, 48px); }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 72px); align-items: center; padding: 20px clamp(16px, 4vw, 48px) 60px; max-width: 1280px; margin: 0 auto; width: 100%; }
.hero h1 span { background: linear-gradient(100deg, var(--coral), #ff3d7f 40%, var(--violet) 80%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 46ch; margin: 18px 0 26px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-stats .pill { padding: 8px 14px; font-size: 13px; }
.hero-stats b { color: var(--ink); }
.fan { position: relative; height: 270px; margin-top: 36px; }
.fan .card { position: absolute; width: 170px; left: 50%; top: 0; transform-origin: 50% 120%; transition: transform .6s var(--spring); }
.fan .card:nth-child(1) { transform: translateX(-150%) rotate(-14deg) translateY(30px); }
.fan .card:nth-child(2) { transform: translateX(-85%) rotate(-5deg) translateY(4px); z-index: 1; }
.fan .card:nth-child(3) { transform: translateX(-15%) rotate(5deg) translateY(4px); z-index: 2; }
.fan .card:nth-child(4) { transform: translateX(50%) rotate(14deg) translateY(30px); }
.fan:hover .card:nth-child(1) { transform: translateX(-170%) rotate(-18deg) translateY(20px); }
.fan:hover .card:nth-child(4) { transform: translateX(70%) rotate(18deg) translateY(20px); }
.auth-card { padding: clamp(20px, 3vw, 32px); display: grid; gap: 18px; position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--coral), var(--citrine), var(--mint), var(--sky), var(--violet)); }
.auth-card form { display: grid; gap: 14px; }
.form-error { padding: 10px 14px; border-radius: 12px; background: #ff5a4e1f; color: #ff7b72; font-weight: 700; font-size: 14px; }
.signup-import-toggle { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); cursor: pointer; }
.signup-import-toggle input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--mint); }
.signup-import-toggle span { display: grid; gap: 3px; }
.signup-import-toggle strong { font-size: 13px; }
.signup-import-toggle small { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.signup-import-guide { display: grid; gap: 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--mint) 30%, var(--line)); border-radius: 15px; background: color-mix(in srgb, var(--mint) 6%, var(--surface)); }
.signup-import-guide h3 { margin: 0; font: 800 15px/1.25 var(--display); }
.signup-import-guide ol { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.signup-import-guide details { border-top: 1px solid var(--line); padding-top: 9px; }
.signup-import-guide summary { color: var(--sky); font-size: 12px; font-weight: 800; cursor: pointer; }
.signup-import-guide pre { overflow-x: auto; margin: 8px 0 0; padding: 10px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); font: 11px/1.5 ui-monospace, Consolas, monospace; }
.signup-import-note { margin: 0; color: var(--ink-3); font-size: 11px; line-height: 1.5; }
.signup-import-link { display: inline-flex; align-items: center; gap: 5px; color: var(--mint); font-size: 12px; font-weight: 800; text-decoration: none; }
.signup-import-link + .signup-import-link { margin-top: 2px; }
.signup-import-link:hover { text-decoration: underline; }
.landing-foot { padding: 24px; text-align: center; color: var(--ink-3); font-size: 13px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1280px; margin: 0 auto 40px; padding: 0 clamp(16px, 4vw, 48px); width: 100%; }
.feature { padding: 20px; display: grid; gap: 8px; }
.feature .ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--coral); }
.feature p { color: var(--ink-2); font-size: 14px; }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding-top: 0; }
  .fan { height: 210px; } .fan .card { width: 128px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } .fan .card { width: 108px; } .fan { height: 180px; } }

/* ═══ Ouvrir ═════════════════════════════════════════════════════ */
.open-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(20px, 3vw, 32px); position: relative; overflow: hidden; }
.open-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, #ff5a4e33, transparent 70%); pointer-events: none; }
.regen { display: flex; align-items: center; gap: 14px; }
.regen-ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 800 18px/1 var(--display);
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--coral) calc(var(--p) * 1%), var(--surface-3) 0); }
.balls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ball {
  position: relative; display: grid; justify-items: center; gap: 10px; padding: 22px 14px 16px; border-radius: var(--r-lg); text-align: center;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transition: transform .3s var(--spring), box-shadow .3s, border-color .3s;
}
.ball:hover { transform: translateY(-4px); }
.ball[aria-pressed='true'] { border-color: var(--bc); box-shadow: 0 0 0 2px var(--bc), 0 30px 60px -30px var(--bc); }
.ball .capsule { transition: transform .4s var(--spring); filter: drop-shadow(0 12px 18px #0005); }
.ball[aria-pressed='true'] .capsule { transform: translateY(-4px) rotate(-8deg) scale(1.06); }
.ball h3 { font-size: 16px; }
.ball .price { font-weight: 800; font-size: 13px; color: var(--ink-2); }
.odds { display: flex; width: 100%; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-3); }
.odds i { display: block; height: 100%; }
.odds-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 11px; color: var(--ink-3); }
.odds-legend span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); margin-right: 4px; }
.open-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; padding: 16px; position: sticky; bottom: 16px; z-index: 5; }
.qty { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.qty button { border: 0; background: transparent; padding: 0 16px; min-height: 40px; border-radius: 999px; font-weight: 800; color: var(--ink-2); }
.qty button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
@media (max-width: 960px) {
  .balls { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .open-hero { grid-template-columns: 1fr; }
  .open-bar { bottom: calc(96px + var(--safe-b)); }
}

/* Séquence d'ouverture */
.stage { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #05070fe8; backdrop-filter: blur(12px); color: #fff; animation: fade .3s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.stage-capsule { display: grid; place-items: center; gap: 24px; }
.stage-capsule .capsule { width: 140px; height: 175px; filter: drop-shadow(0 30px 40px #0008); }
.stage-capsule.shake .capsule { animation: shake .55s var(--ease) var(--shakes, 2); }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg) translateX(-6px); } 75% { transform: rotate(14deg) translateX(6px); } }
.stage-hint { font-weight: 700; color: #fff9; }
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 101; background: radial-gradient(circle at 50% 50%, var(--bc, #fff) 0, transparent 60%); animation: burst .8s var(--ease) forwards; }
@keyframes burst { from { opacity: 1; transform: scale(.2); } to { opacity: 0; transform: scale(2.4); } }
.reveal { width: min(1100px, 100%); padding: 32px 16px calc(32px + var(--safe-b)); display: grid; gap: 22px; justify-items: center; }
.reveal-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%; }
.flip { width: clamp(118px, 17vw, 180px); aspect-ratio: 160 / 236; perspective: 900px; cursor: pointer; border: 0; padding: 0; background: none; animation: deal .5s var(--spring) backwards; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--spring); }
.flip.on .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; backface-visibility: hidden; }
.flip-front { transform: rotateY(180deg); }
.flip-front .card { height: 100%; }
.flip-back { border-radius: 18px; display: grid; place-items: center; border: 1px solid #ffffff22;
  background: repeating-linear-gradient(45deg, #ffffff08 0 10px, transparent 10px 20px), linear-gradient(160deg, #1b2238, #0d1120); box-shadow: 0 20px 40px -20px #000; }
.flip-back .capsule { width: 46px; height: 58px; opacity: .9; }
.flip.hint-rare .flip-back { box-shadow: 0 0 0 2px var(--bc), 0 0 40px -6px var(--bc); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px var(--bc), 0 0 60px 0 var(--bc); } }
@keyframes deal { from { opacity: 0; transform: translateY(60px) rotate(-8deg) scale(.8); } }
.reveal-summary { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.reveal-summary .pill { background: #ffffff12; border-color: #ffffff1c; color: #fff; }

/* ═══ Barre d'outils / listes ════════════════════════════════════ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; }
.toolbar .search { flex: 1 1 220px; }
.toolbar .select { width: auto; min-width: 140px; flex: 0 1 auto; }
@media (max-width: 560px) { .toolbar .select { flex: 1 1 40%; min-width: 0; } }
.selection-bar { position: sticky; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); animation: page-in .3s var(--ease); }
@media (max-width: 960px) { .selection-bar { bottom: calc(96px + var(--safe-b)); } }
.card.selected { box-shadow: 0 0 0 3px var(--coral), var(--shadow); transform: scale(.96); }
.card.selected::before { content: '✓'; position: absolute; z-index: 4; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--coral); color: #fff; font-weight: 800; font-size: 13px; }

.progress { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), var(--citrine)); transition: width .8s var(--ease); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font: 800 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: 13px; font-weight: 700; }

/* Pokédex */
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.dex-tile { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; transition: transform .2s var(--spring), border-color .2s; content-visibility: auto; contain-intrinsic-size: 116px 150px; }
.dex-tile:hover { transform: translateY(-3px); border-color: var(--line-2); }
.dex-tile .art { border-radius: 11px; }
.dex-tile b { font: 700 13px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dex-tile small { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.dex-tile.unknown .art { background: var(--surface-3); }
.dex-tile.unknown .art * { opacity: .25; }
.dex-tile.unknown .pokemon-sprite { visibility: hidden; }
.dex-tile.unknown .art-glyph, .dex-tile.unknown .art-glyph2 { fill: var(--ink-3); }
.dex-tile .shiny-mark { position: absolute; top: 12px; right: 12px; color: var(--citrine); text-shadow: 0 0 8px #ffc531; z-index: 2; }
@media (max-width: 560px) { .dex-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.statbar { display: grid; grid-template-columns: 70px 34px 1fr; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; }
.statbar .progress { height: 8px; }
.statbar .progress > i { background: var(--bar, var(--sky)); }
.card-moves { display: grid; gap: 8px; }
.card-moves h3 { margin: 0; font-size: 14px; }
.move-chip { display: inline-grid; gap: 1px; padding: 7px 10px; border: 1px solid color-mix(in srgb,var(--move-color) 45%,var(--line)); border-radius: 11px; background: color-mix(in srgb,var(--move-color) 12%,var(--surface)); }
.move-chip b { font-size: 12px; }
.move-chip small { color: var(--ink-3); font-size: 10px; }

/* ═══ Fenêtres ═══════════════════════════════════════════════════ */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(720px, calc(100vw - 24px)); width: 100%; max-height: calc(100dvh - 24px); }
dialog.modal::backdrop { background: #05070fb3; backdrop-filter: blur(6px); animation: fade .25s; }
.modal-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); display: grid; gap: 18px; animation: pop .35s var(--spring); max-height: calc(100dvh - 24px); overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96); } }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
@media (max-width: 560px) {
  dialog.modal { margin: auto 0 0; max-width: 100vw; max-height: 92dvh; }
  .modal-box { border-radius: 28px 28px 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: sheet .4s var(--ease); max-height: 92dvh; }
  @keyframes sheet { from { transform: translateY(100%); } }
}
.detail { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
@media (max-width: 640px) { .detail { grid-template-columns: 1fr; } .detail > .card { width: 200px; margin: 0 auto; } }

/* Toasts */
#toasts { position: fixed; z-index: 200; top: 16px; left: 50%; translate: -50% 0; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 700; box-shadow: var(--shadow); animation: toast .4s var(--spring); }
.toast.err { background: #ff4d4d; color: #fff; }
.toast.ok .icon { color: var(--mint); }
.toast.out { animation: toast-out .3s forwards; }
@keyframes toast { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* Notifications */
.notif-panel { position: fixed; z-index: 60; top: calc(var(--top-h) + 6px); right: 16px; width: min(380px, calc(100vw - 24px)); max-height: 70dvh; overflow-y: auto; padding: 8px; animation: pop .3s var(--spring); }
.notif { display: grid; gap: 2px; padding: 12px; border-radius: 14px; text-decoration: none; }
.notif:hover { background: var(--surface-2); }
.notif.unseen { background: #ff5a4e12; }
.notif small { color: var(--ink-3); }

/* Listes génériques */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.item b { display: block; }
.item small { color: var(--ink-3); }
.avatar { --c1: var(--coral); --c2: var(--violet); width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; position: relative;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c1) 70%, #fff), var(--c1) 50%, var(--c2)); }
.avatar .glyph { fill: currentColor; width: 55%; height: 55%; }
.avatar.lg { width: 96px; height: 96px; box-shadow: 0 0 0 5px var(--surface), 0 0 0 7px var(--line-2); }
.avatar .online { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--surface); }
.avatar.lg .online { width: 20px; height: 20px; box-shadow: 0 0 0 4px var(--surface); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }

/* Classement */
.rank { width: 32px; text-align: center; font: 800 16px/1 var(--display); color: var(--ink-3); }
.rank-1 { color: var(--r-legendary); } .rank-2 { color: #c8d0e0; } .rank-3 { color: #e39b5b; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; }
.podium .step { display: grid; justify-items: center; gap: 8px; padding: 18px 10px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-align: center; text-decoration: none; }
.podium .step:nth-child(2) { padding-top: 30px; box-shadow: var(--glow); }
.podium b { font: 800 20px/1 var(--display); }

/* Chat */
.chat { display: grid; grid-template-rows: auto 1fr auto; height: min(70dvh, 680px); overflow: hidden; }
.chat-log { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { display: flex; gap: 10px; align-items: start; max-width: 90%; }
.msg .avatar { width: 32px; height: 32px; }
.msg-body { background: var(--surface-2); padding: 8px 12px; border-radius: 4px 16px 16px 16px; }
.msg-body header { display: flex; gap: 8px; align-items: baseline; font-size: 12px; }
.msg-body header b { font-size: 13px; }
.msg-body p { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .msg-body { background: linear-gradient(135deg, #ff5a4e, #ff3d7f); color: #fff; border-radius: 16px 4px 16px 16px; }
.msg.mine .msg-body small { color: #fffa; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* Combat */
.arena { display: grid; gap: 18px; padding: clamp(16px, 3vw, 28px); color: #fff; border-radius: var(--r-xl);
  background: radial-gradient(120% 80% at 50% 120%, #2fd8a233, transparent), linear-gradient(180deg, #121a33, #0b0f1d); }
.arena-side { display: flex; align-items: center; gap: 14px; }
.arena-side.b { flex-direction: row-reverse; text-align: right; }
.arena-side .art { width: clamp(90px, 18vw, 140px); flex: none; transition: transform .25s, opacity .4s, filter .4s; }
.arena-side .art.hit { animation: hit .35s; }
.arena-side .art.ko { opacity: .25; filter: grayscale(1); transform: translateY(14px) scale(.9); }
@keyframes hit { 30% { transform: translateX(-10px); filter: brightness(2.5); } 60% { transform: translateX(8px); } }
.arena-info { flex: 1; display: grid; gap: 6px; }
.arena-info b { font: 800 20px/1 var(--display); }
.hp { height: 12px; border-radius: 6px; background: #ffffff1a; overflow: hidden; }
.hp > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2fd8a2, #a8f0c0); transition: width .45s var(--ease), background .3s; }
.hp.low > i { background: linear-gradient(90deg, #ff5a4e, #ffb199); }
.team-dots { display: flex; gap: 5px; }
.arena-side.b .team-dots { justify-content: flex-end; }
.team-dots i { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.team-dots i.out { background: #ffffff30; }
.arena-log { min-height: 48px; padding: 12px 16px; border-radius: 14px; background: #ffffff10; font-weight: 700; text-align: center; }
.arena-vs { text-align: center; font: 800 14px var(--display); letter-spacing: .3em; color: #fff6; }
.result-banner { text-align: center; font: 800 clamp(32px, 6vw, 56px)/1 var(--display); animation: pop .5s var(--spring); }
.result-banner.win { background: linear-gradient(90deg, #ffe17a, #ffb21f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.picker-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.slot { aspect-ratio: 3 / 4; border-radius: 18px; border: 2px dashed var(--line-2); display: grid; place-items: center; color: var(--ink-3); background: var(--surface-2); padding: 0; }
.slot .card { width: 100%; height: 100%; }
.gym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gym { position: relative; display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); text-align: left; overflow: hidden;
  border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--t) 22%, var(--surface)), var(--surface)); transition: transform .3s var(--spring); }
.gym:hover { transform: translateY(-4px); }
.gym .badge-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--t); color: #fff; box-shadow: 0 10px 24px -10px var(--t); }
.gym .badge-ico .glyph { fill: currentColor; }
.gym.done::after { content: 'Badge obtenu'; position: absolute; top: 16px; right: -34px; rotate: 35deg; padding: 4px 40px; background: var(--citrine); color: #2a1d00; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.gym-team { display: flex; gap: 6px; }
.gym-team .art { width: 44px; border-radius: 10px; }
.gym-team .art-num { display: none; }

/* Boss */
.boss { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; gap: clamp(16px, 4vw, 40px); align-items: center; padding: clamp(20px, 4vw, 40px); border-radius: var(--r-xl); color: #fff;
  background: radial-gradient(80% 120% at 0% 50%, color-mix(in srgb, var(--t) 50%, transparent), transparent), linear-gradient(135deg, #1a0f2e, #0b0f1d); }
.boss .art { width: clamp(140px, 26vw, 260px); box-shadow: 0 0 80px -10px var(--t); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
.boss .hp { height: 18px; border-radius: 9px; }
.boss .hp > i { background: linear-gradient(90deg, #ff3d7f, #ffb21f); }
@media (max-width: 640px) { .boss { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* Roue */
.wheel-wrap { position: relative; width: min(420px, 86vw); aspect-ratio: 1; margin: 0 auto; }
.wheel { width: 100%; height: 100%; border-radius: 50%; transition: transform 5s cubic-bezier(.12, .8, .1, 1); box-shadow: 0 0 0 8px var(--surface), 0 0 0 10px var(--line-2), var(--shadow); }
.wheel-pin { position: absolute; top: -14px; left: 50%; translate: -50% 0; width: 0; height: 0; border: 16px solid transparent; border-top: 28px solid var(--ink); filter: drop-shadow(0 4px 6px #0006); z-index: 2; }
.wheel-hub { position: absolute; inset: 40%; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }

/* Succès */
.ach { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.ach .medal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); }
.ach.done .medal { background: linear-gradient(135deg, #ffe17a, #ffb21f); color: #2a1d00; }
.ach.ready { border-color: var(--citrine); box-shadow: 0 0 0 1px var(--citrine), 0 20px 40px -24px var(--citrine); }
@media (max-width: 560px) { .ach { grid-template-columns: auto 1fr; } .ach > :last-child { grid-column: 1 / -1; } }

/* Profil */
.profile-hero { position: relative; overflow: hidden; padding: clamp(20px, 4vw, 36px); display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-hero::before { content: ''; position: absolute; inset: 0 0 50%; background: linear-gradient(120deg, color-mix(in srgb, var(--c1) 40%, transparent), transparent 70%); pointer-events: none; }
.profile-hero > * { position: relative; }
.showcase { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 760px) { .showcase { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.badges-row { display: flex; flex-wrap: wrap; gap: 10px; }
.badge-medal { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--t); box-shadow: inset 0 -4px 0 #0003, 0 6px 14px -6px var(--t); }
.badge-medal .glyph { fill: currentColor; }
.badge-medal.off { background: var(--surface-3); color: var(--ink-3); box-shadow: none; opacity: .6; }

/* Enchères */
.auction { display: grid; gap: 10px; padding: 10px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.auction .card { box-shadow: none; }
.auction-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.auction-meta b { font: 800 18px/1 var(--display); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink-2); }
.timer.soon { color: var(--coral); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.table-wrap { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Pokédex : progression par génération */
.gen-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; }
.gen-bar { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; border: 0; background: none; padding: 4px; border-radius: 10px; font-weight: 800; font-size: 13px; text-align: left; }
.gen-bar:hover { background: var(--surface-2); }
.gen-bar .progress { height: 8px; }
.gen-bar small { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Illustrations : animations douces */
.rays { transform-origin: 50px 50px; animation: spin 40s linear infinite; }
.spark { animation: twinkle 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 50% { opacity: .15; } }
.medal { transition: transform .4s var(--spring); transform-origin: 50px 50px; }
.card:hover .medal, .dex-tile:hover .medal { transform: scale(1.08) translateY(-1px); }
.art-glyph { filter: none; }
.dex-tile.unknown .medal circle, .dex-tile.unknown .crest { fill: var(--surface-2); stroke: var(--ink-3); }
.dex-tile.unknown .rays { display: none; }

/* Ouvrir : Ball unique */
.open-stage { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(20px, 4vw, 40px); overflow: hidden; }
.open-stage-cap { position: relative; display: grid; place-items: center; min-height: 260px; }
.cap-halo { position: absolute; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, #ff5a4e55, transparent 65%); animation: halo 3s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.15); opacity: .6; } }
.capsule-big { position: relative; border: 0; background: none; padding: 0; animation: float 3.5s ease-in-out infinite; transition: transform .3s var(--spring); }
.capsule-big:hover { transform: scale(1.06) rotate(-6deg); }
.capsule-big:active { transform: scale(.94); }
.capsule-big .capsule { width: 160px; height: 200px; filter: drop-shadow(0 30px 30px #0006); }
.odds-lg { height: 12px; border-radius: 6px; }
.odds-table { display: grid; gap: 4px; }
.odds-row { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.odds-row span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); margin-right: 8px; }
.odds-row b { font-variant-numeric: tabular-nums; }
.shiny-row { background: linear-gradient(90deg, #ffc53122, transparent); color: var(--citrine); }
.shiny-row span::before { display: none; }
@media (max-width: 760px) { .open-stage { grid-template-columns: 1fr; } .open-stage-cap { min-height: 220px; } }

/* ═══ Gacha : progression, missions, fil en direct ═══════════════ */
.open-meta { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.meta-card { display: grid; gap: 8px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.meta-card small { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; color: var(--ink-3); }
.meta-card span { font-size: 13px; color: var(--ink-2); }
.meta-card b { font: 800 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.shiny-meta { background: linear-gradient(135deg, #ffc5311c, var(--surface) 70%); }
.shiny-meta small, .shiny-meta b { color: var(--citrine); }
.open-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .open-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .open-meta { grid-template-columns: 1fr; } }

.featured { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; padding: 16px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, color-mix(in srgb, var(--r-epic) 18%, var(--surface)), var(--surface) 65%); }
.featured-art .art { border-radius: 18px; box-shadow: 0 16px 40px -16px #000a; }

.missions { display: grid; gap: 12px; }
.mission { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .3s, box-shadow .3s; }
.mission b { font-size: 14px; display: block; margin-bottom: 6px; }
.mission .progress { height: 7px; }
.mission small { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 700; }
.mission-ico { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); }
.mission.ready { border-color: var(--citrine); box-shadow: 0 0 0 1px var(--citrine), 0 12px 30px -16px var(--citrine); animation: ready-pulse 1.8s ease-in-out infinite; }
.mission.ready .mission-ico { background: var(--citrine); color: #2a1d00; }
.mission.claimed { opacity: .6; }
.mission.claimed .mission-ico { background: var(--mint); color: #003524; }
.mission.chest { background: linear-gradient(135deg, #ffc53114, var(--surface-2)); }
.mission .btn { flex: none; }
@keyframes ready-pulse { 50% { box-shadow: 0 0 0 1px var(--citrine), 0 12px 40px -10px var(--citrine); } }

.feed { display: grid; max-height: 420px; overflow-y: auto; padding: 4px 8px 8px; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-decoration: none; font-size: 13px; animation: page-in .4s var(--ease); }
.feed-item:hover { background: var(--surface-2); }
.feed-item .art { width: 40px; flex: none; border-radius: 10px; }
.feed-item .art-num { display: none; }
.feed-item small { display: block; color: var(--ink-3); }
.feed-item .feed-poke { color: var(--rc); }
.feed-item.shiny .feed-poke { color: var(--citrine); }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--coral); }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); animation: twinkle 1.2s infinite; }

/* Ouverture : montée en tension */
.stage-capsule { position: relative; }
.stage-glow { position: absolute; top: 40%; left: 50%; width: 260px; height: 260px; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, var(--bc), transparent 65%); opacity: 0; transition: opacity .6s; pointer-events: none; }
.stage-capsule.shake .stage-glow { opacity: .25; }
.stage-capsule.charged .stage-glow { opacity: .7; animation: halo .6s ease-in-out infinite; }
.stage-capsule.charged .capsule { filter: drop-shadow(0 0 30px var(--bc)) drop-shadow(0 30px 40px #0008); }
.flip.wow .flip-front .card { animation: wow .7s var(--spring); box-shadow: 0 0 0 2px var(--bc), 0 0 60px -6px var(--bc); }
@keyframes wow { 40% { transform: scale(1.12); } }
.flag-featured { top: 70px; background: var(--violet); color: #fff; z-index: 5; }
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 300; pointer-events: none; }

/* Série de connexion */
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.streak-day { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.streak-day small { font-size: 11px; color: var(--ink-3); font-weight: 800; }
.streak-day b { font-size: 11px; line-height: 1.2; }
.streak-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.streak-day.done { opacity: .55; }
.streak-day.done .streak-ico { background: var(--mint); color: #003524; }
.streak-day.today { border-color: var(--citrine); box-shadow: 0 0 0 1px var(--citrine), 0 16px 34px -16px var(--citrine); transform: translateY(-3px); }
.streak-day.today .streak-ico { background: var(--citrine); color: #2a1d00; }
.streak-day.big { background: linear-gradient(160deg, #ffc5312a, var(--surface-2)); }
@media (max-width: 560px) { .streak { grid-template-columns: repeat(4, 1fr); } .streak-day.big { grid-column: span 2; } }

/* Niveau */
.level-chip { --p: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; flex: none;
  background: radial-gradient(closest-side, var(--surface) 80%, transparent 82% 100%), conic-gradient(var(--citrine) calc(var(--p) * 1%), var(--surface-3) 0); }
.level-chip b { font: 800 14px/1 var(--display); }
.level-burst { width: 130px; height: 130px; margin: 0 auto; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 30% 25%, #fff3b0, #ffc531 50%, #ff8a3d); color: #2a1d00; box-shadow: 0 20px 60px -10px #ffc531; animation: pop .6s var(--spring); }
.level-burst span { font-weight: 800; font-size: 14px; }
.level-burst b { font: 800 52px/1 var(--display); }
@media (max-width: 960px) { #w-level { display: none; } }

/* Barre mobile : 6 onglets + menu « Plus » ; barre du haut compacte */
@media (max-width: 960px) {
  .tabbar { grid-template-columns: repeat(6, 1fr); }
  .tabbar .tab-more { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; border: 0; background: none; border-radius: 20px; color: var(--ink-3); font-size: 11px; font-weight: 700; }
  .tabbar .tab-more .badge-dot { top: 2px; right: calc(50% - 22px); }
  .tabbar .orb { position: relative; }
  .tabbar .orb .badge-dot { top: -2px; right: -2px; }
  .topbar { min-width: 0; }
  .wallet { min-width: 0; gap: 6px; }
}
@media (max-width: 560px) {
  .topbar .brand b { display: none; }
  .topbar .brand { flex: none; }
  .topbar #w-avatar { display: none; }
  .meter { padding: 0 10px 0 4px; gap: 6px; height: 36px; }
  .meter-ico { width: 28px; height: 28px; }
  .icon-btn { width: 38px; height: 38px; }
  .tabbar { left: 6px; right: 6px; padding: 4px; }
  .tabbar a, .tabbar .tab-more { font-size: 10px; }
}
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-item { position: relative; display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 13px; text-align: center; color: var(--ink); }
.more-item:hover { background: var(--surface-3); }
.more-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--surface); color: var(--coral); box-shadow: var(--shadow); }
.more-item .badge-dot { top: 8px; right: 8px; }
/* Les enfants de grille ne doivent jamais forcer la largeur de la page. */
.page > *, .stack > *, .open-layout > *, .two-col > * { min-width: 0; }
@media (max-width: 560px) { .gen-bars { grid-template-columns: 1fr 1fr; gap: 6px 12px; } .gen-bar { grid-template-columns: 26px 1fr auto; gap: 6px; font-size: 12px; } }
@media (max-width: 560px) {
  .dex-grid, .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.dex-tile, .card { min-width: 0; }
/* Ouvrir sur mobile : infos compactes, bouton d'ouverture toujours visible au-dessus des onglets */
@media (max-width: 560px) {
  .open-meta { grid-template-columns: 1.4fr 1fr; gap: 10px; }
  .meta-card { padding: 12px 14px; gap: 6px; }
  .meta-card b { font-size: 22px; }
  .meta-card span { font-size: 11.5px; line-height: 1.35; }
  .open-hero { gap: 16px; }
  .open-bar { bottom: calc(108px + var(--safe-b)); padding: 10px; gap: 8px; }
  .open-bar .btn-lg { min-height: 50px; padding: 0 18px; font-size: 15px; }
  .featured { grid-template-columns: 96px 1fr; }
}

/* ═══ Ouverture à taper (Ball qui monte en rareté) ═════════════════ */
.tap-stage { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; gap: 18px; }
.tap-stage .stage-glow { opacity: .45; transition: background .4s, opacity .4s; }
.tap-ball { position: relative; animation: float 3s ease-in-out infinite; }
.tap-ball .ball-svg { width: min(52vw, 200px); height: auto; filter: drop-shadow(0 26px 34px #000a) drop-shadow(0 0 30px var(--bc)); transition: filter .4s; }
.tap-ball.bump .ball-svg { animation: bump .28s var(--spring); }
.tap-ball.upgrade .ball-svg { animation: upgrade .65s var(--spring); }
@keyframes bump { 40% { transform: scale(.9) rotate(-6deg); } 70% { transform: scale(1.05) rotate(4deg); } }
@keyframes upgrade { 0% { transform: scale(.7); filter: brightness(3); } 50% { transform: scale(1.18) rotate(8deg); } }
.tap-label { font: 800 clamp(26px, 6vw, 40px)/1 var(--display); color: var(--bc); text-shadow: 0 0 24px var(--bc); letter-spacing: -.02em; }
.tap-label.pop { animation: label-pop .55s var(--spring); }
@keyframes label-pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.25); } }
.tap-pips { display: flex; gap: 8px; }
.tap-pips i { width: 12px; height: 12px; border-radius: 50%; background: #ffffff26; transition: background .3s, transform .3s var(--spring); }
.tap-pips i.on { background: var(--bc); transform: scale(1.2); box-shadow: 0 0 10px var(--bc); }
.stage-capsule.charged .tap-ball .ball-svg { animation: charged 1.2s ease-in-out infinite; }
@keyframes charged { 50% { filter: drop-shadow(0 26px 34px #000a) drop-shadow(0 0 60px var(--bc)) brightness(1.15); } }
.ball-gem { filter: drop-shadow(0 0 4px #fff); }
.capsule-big .ball-svg { width: 190px; height: 190px; filter: drop-shadow(0 30px 30px #0006); }
.flip-back .ball-svg { width: 56px; height: 56px; opacity: .9; }

/* ═══ Bannière d'événement ═══════════════════════════════════════ */
.event-bar { display: block; padding: 9px 16px; text-align: center; font-weight: 800; font-size: 13px; text-decoration: none;
  background: linear-gradient(90deg, #ffc53126, #ff5ad126, #ffc53126); color: var(--citrine); border-bottom: 1px solid var(--line); }
.event-bar.live { color: #2a1d00; background: linear-gradient(90deg, #ffe17a, #ffb21f, #ff8ad6, #ffe17a); background-size: 300% 100%; animation: event-shine 4s linear infinite; }
@keyframes event-shine { to { background-position: 300% 0; } }

/* ═══ Albums ══════════════════════════════════════════════════════ */
.albums { display: grid; gap: 14px; }
.album { overflow: hidden; }
.album.complete { box-shadow: 0 0 0 1.5px var(--citrine), var(--shadow); }
.album-head { width: 100%; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 0; background: none; text-align: left; }
.album-head h3 { margin-bottom: 2px; }
.album-cover { display: flex; flex: none; }
.album-cover .art { width: 46px; border-radius: 12px; box-shadow: 0 6px 16px -8px #000a; border: 2px solid var(--surface); }
.album-cover .art + .art { margin-left: -18px; }
.album-cover .art-num { display: none; }
.album-count { font-variant-numeric: tabular-nums; font-size: 14px; }
.milestones { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 14px; }
.milestone { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.milestone .ms-at { font-weight: 800; }
.milestone .ms-reward { color: var(--ink-2); }
.milestone.ready { border-color: var(--citrine); box-shadow: 0 0 0 1px var(--citrine); animation: ready-pulse 1.8s ease-in-out infinite; }
.milestone.claimed { opacity: .6; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; padding: 0 18px 18px; }
.album-slot { display: grid; gap: 4px; text-align: center; }
.album-slot .art { border-radius: 12px; }
.album-slot .art-num { display: none; }
.album-slot small { font-size: 10.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-slot.missing .art { filter: grayscale(1) brightness(.35); }
.album-slot.missing small { color: var(--ink-3); }
@media (max-width: 560px) { .album-cover { display: none; } .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 12px 14px; } }

/* ═══ Fusion ══════════════════════════════════════════════════════ */
.fuse-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid transparent; min-width: 0; }
.fuse-row.ready { border-color: var(--line-2); }
.fuse-row b { display: block; }
.fuse-from { position: relative; width: 54px; flex: none; }
.fuse-from .art, .fuse-to .art { width: 100%; max-width: 54px; aspect-ratio: 1; border-radius: 12px; flex: none; overflow: hidden; }
.fuse-from .art-num, .fuse-to .art-num { display: none; }
.fuse-from .pokemon-sprite, .fuse-to .pokemon-sprite { inset: 9%; width: 82%; height: 82%; max-width: 82%; max-height: 82%; object-fit: contain; object-position: center; }
.fuse-result .pokemon-sprite { inset: 9%; width: 82%; height: 82%; object-fit: contain; object-position: center; }
.fuse-count { position: absolute; right: -6px; bottom: -6px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--ink); color: var(--bg); }
.fuse-row.ready .fuse-count { background: var(--mint); color: #003524; }
.fuse-copy { min-width: 0; }
.fuse-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fuse-row-meta { display: block; margin-top: 4px; color: var(--ink-3); font-size: 11px; font-weight: 700; }
.fuse-to { display: flex; gap: 5px; max-width: 184px; overflow: hidden; }
.fuse-to .art { width: 36px; opacity: .88; border-radius: 10px; }
.fuse-button { display: grid; grid-template-columns: 16px auto; align-items: center; justify-items: start; gap: 2px 7px; white-space: nowrap; }
.fuse-button b { grid-column: 2; color: inherit; font-size: 11px; }
.fuse-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.fuse-highlight { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 16px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.fuse-highlight-shiny { border-color: color-mix(in srgb, var(--citrine) 42%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--citrine) 10%, var(--surface-2)), var(--surface)); }
.fuse-highlight-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 11px; background: color-mix(in srgb, var(--citrine) 16%, transparent); color: var(--citrine); font-size: 19px; }
.fuse-highlight b { display: block; font-size: 14px; }
.fuse-highlight small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11px; }
.fuse-result { width: 220px; margin: 0 auto; }
.fuse-result-meta { max-width: 34ch; margin: 0 auto; line-height: 1.6; }
@media (max-width: 720px) { .fuse-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 10px; } .fuse-from { width: 48px; } .fuse-to { display: none; } .fuse-button { grid-template-columns: 16px auto; gap: 2px 5px; padding: 8px 9px; font-size: 11px; } }
@media (max-width: 440px) { .fuse-highlights { gap: 7px; } .fuse-highlight { align-items: flex-start; gap: 8px; padding: 10px; } .fuse-highlight-icon { width: 28px; height: 28px; } .fuse-highlight b { font-size: 12px; } .fuse-highlight small { font-size: 10px; } .fuse-row-meta { font-size: 10px; } }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ═══ Ouverture « de malade » ═══════════════════════════════════════ */
.ob-stage { background: radial-gradient(circle at 50% 42%, #10162a, #04060d 70%); cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; overflow: hidden; }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 0; }
.fx-flash { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0; mix-blend-mode: screen; }
.ob-scene, .ob-stage .reveal { position: relative; z-index: 2; }
.ob-scene { display: grid; justify-items: center; gap: 14px; translate: 0 -4vh; }
.ob-wrap { position: relative; width: min(58vw, 220px); aspect-ratio: 1; }
.ob-wrap.enter { animation: ob-drop .62s cubic-bezier(.5, 0, .75, 0) both, ob-land .5s .62s var(--spring); }
@keyframes ob-drop { from { transform: translateY(-80vh) scale(.6) rotate(-40deg); } to { transform: none; } }
@keyframes ob-land { 30% { transform: scale(1.18, .78) translateY(14px); } 60% { transform: scale(.94, 1.06) translateY(-8px); } }
.ob-aura { position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--bc) 55%, transparent), transparent 62%); animation: halo 2.4s ease-in-out infinite; transition: background .4s; }
.ob-ball { position: absolute; inset: 0; animation: float 3s ease-in-out infinite; }
.ob-ball .ball-svg { width: 100%; height: 100%; filter: drop-shadow(0 30px 40px #000c) drop-shadow(0 0 28px var(--bc)); }
.ball-top, .ball-bottom { transform-box: view-box; transform-origin: 50px 50px; }
.ball-sparkle { filter: drop-shadow(0 0 5px #fff); animation: ball-twinkle 1s ease-in-out infinite alternate; }
@keyframes ball-twinkle { to { opacity: .35; transform: scale(.72); } }
.ob-ball.squash .ball-svg { animation: ob-squash .26s var(--spring); }
@keyframes ob-squash { 35% { transform: scale(1.14, .84) rotate(-5deg); } 70% { transform: scale(.95, 1.06) rotate(3deg); } }
.ob-ball.upgrade .ball-svg { animation: ob-up .7s var(--spring); }
@keyframes ob-up { 0% { transform: scale(.6); filter: brightness(4) drop-shadow(0 0 60px var(--bc)); } 45% { transform: scale(1.25) rotate(12deg); } }
.ob-cracks { position: absolute; inset: 6%; width: 88%; height: 88%; pointer-events: none; overflow: visible; }
.ob-cracks path { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  filter: drop-shadow(0 0 2px var(--crack, #fff)) drop-shadow(0 0 6px var(--crack, #fff)); }
.ob-cracks path.on { opacity: 1; animation: ob-crack .22s ease-out forwards; }
@keyframes ob-crack { to { stroke-dashoffset: 0; } }
/* Charge : vibration de plus en plus violente, lumière qui fuit par les fissures */
.ob-wrap.charging { animation: ob-charge var(--charge, 1.4s) cubic-bezier(.6, 0, 1, 1) forwards; }
.ob-wrap.charging .ob-ball { animation: ob-vibrate .06s linear infinite; }
.ob-wrap.charging .ob-cracks path { stroke-width: 2.6; filter: drop-shadow(0 0 4px var(--crack)) drop-shadow(0 0 14px var(--crack)) drop-shadow(0 0 30px #fff); }
.ob-wrap.charging .ob-aura { animation: none; transform: scale(1.6); opacity: 1; transition: transform var(--charge, 1.4s); }
.ob-wrap.opening .ball-top { animation: ball-open-top .46s cubic-bezier(.2,.8,.3,1) forwards; }
.ob-wrap.opening .ball-bottom { animation: ball-open-bottom .46s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes ball-open-top { to { transform: translateY(-20px) rotate(-13deg); } }
@keyframes ball-open-bottom { to { transform: translateY(13px) rotate(8deg); } }
@keyframes ob-charge { 0% { transform: scale(1); } 85% { transform: scale(1.22); filter: brightness(1.6); } 100% { transform: scale(.85); filter: brightness(3); } }
@keyframes ob-vibrate { 0% { translate: 2px -1px; } 25% { translate: -3px 2px; } 50% { translate: 3px 1px; } 75% { translate: -2px -3px; } }
.ob-label { min-height: 1.1em; font: 800 clamp(34px, 9vw, 64px)/1 var(--display); color: var(--bc); letter-spacing: -.03em; text-transform: uppercase;
  text-shadow: 0 0 18px var(--bc), 0 0 50px var(--bc), 0 4px 0 #0008; -webkit-text-stroke: 1px #ffffff55; }
.ob-label.slam { animation: ob-slam .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes ob-slam { 0% { transform: scale(3.2); opacity: 0; filter: blur(10px); } 55% { transform: scale(.92); opacity: 1; filter: blur(0); } }
.ob-label.small { position: fixed; top: max(18px, env(safe-area-inset-top)); left: 50%; translate: -50% 0; font-size: 22px; z-index: 3; animation: none; }
.ob-hint { font-weight: 800; letter-spacing: .3em; text-transform: uppercase; font-size: 13px; color: #fffa; animation: ob-hint 1.2s ease-in-out infinite; }
@keyframes ob-hint { 50% { opacity: .35; transform: scale(.96); } }
.ob-skip { position: fixed; z-index: 4; top: max(14px, env(safe-area-inset-top)); right: 14px; border: 1px solid #ffffff22; background: #ffffff10; color: #fffc;
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.ob-stage.ob-legend .ob-aura { inset: -70%; }
.ob-stage .reveal { animation: none; }
.ob-stage .flip.wow .flip-front .card { box-shadow: 0 0 0 2px var(--bc), 0 0 80px -4px var(--bc); }

/* Ouverture épurée : surcharges */
.ob-ball .ball-svg { position: absolute; inset: 0; }
.ob-ball .ball-svg { overflow: visible; }
.ob-ball .ball-svg.ob-fadein { animation: ob-fade .45s ease-out; }
@keyframes ob-fade { from { opacity: 0; transform: scale(.92); } }
.ob-ball.upgrade .ball-svg:last-child { animation: ob-up-soft .6s var(--spring); }
@keyframes ob-up-soft { 0% { transform: scale(.85); filter: brightness(1.8) drop-shadow(0 0 40px var(--bc)); } 50% { transform: scale(1.1); } }
.ob-ball.squash .ball-svg:last-child { animation: ob-squash-soft .32s var(--spring); }
@keyframes ob-squash-soft { 40% { transform: scale(1.08, .9); } 75% { transform: scale(.97, 1.04); } }
.ob-wrap.charging { animation: ob-charge-soft var(--charge, 1.2s) cubic-bezier(.5, 0, .9, .4) forwards; }
.ob-wrap.charging .ob-ball { animation: ob-spin var(--charge, 1.2s) cubic-bezier(.6, 0, 1, 1) forwards; }
.ob-wrap.charging .ob-aura { transform: scale(1.4); opacity: 1; }
@keyframes ob-spin { to { rotate: 720deg; } }
@keyframes ob-charge-soft { 80% { transform: scale(1.12); filter: brightness(1.4); } 100% { transform: scale(1); filter: brightness(2); opacity: 1; } }
.ob-label { -webkit-text-stroke: 0; text-shadow: 0 0 22px color-mix(in srgb, var(--bc) 70%, transparent); text-transform: none; }
.ob-label.slam { animation: ob-label-in .5s var(--spring); }
@keyframes ob-label-in { 0% { transform: translateY(12px) scale(.85); opacity: 0; } }

/* Cartes : types sur l’illustration, rareté sur toute la largeur (plus jamais coupée) */
.card .art .card-types { position: absolute; z-index: 2; top: 6px; right: 6px; display: flex; gap: 3px; }
.card .art .card-types i { width: 20px; height: 20px; box-shadow: 0 2px 6px #0006, 0 0 0 1.5px #ffffffaa; }
.card-bottom { justify-content: center; min-width: 0; }
.rarity-gem { display: block; max-width: 100%; text-align: center; font-size: 10px; letter-spacing: .04em; line-height: 1.3; white-space: normal; }
.card-sm .card-types i, .grid-cards .card-types i { width: 17px; height: 17px; }
.card-lg .card-types i { width: 28px; height: 28px; }
.card-lg .card-types .glyph { width: 15px; height: 15px; }
.card-lg .rarity-gem { font-size: 13px; }
.card-lg .card-cp { right: 12px; bottom: 12px; gap: 7px; padding: 8px 12px; border-radius: 13px; }
.card-lg .card-cp-label { font-size: 11px; }
.card-lg .card-cp b { font-size: 19px; }
@media (max-width: 560px) {
  .grid-cards .rarity-gem { display: block; font-size: 8.5px; letter-spacing: .02em; }
  .grid-cards .card .art .card-types { top: 4px; right: 4px; }
  .grid-cards .card-types i { width: 15px; height: 15px; }
}

/* ═══ Marché ══════════════════════════════════════════════════════ */
.mk-stats .stat b { font-size: 22px; }
.mk-ticker { display: flex; align-items: center; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.mk-ticker-label { flex: none; }
.mk-tick { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; white-space: nowrap; }
.mk-tick .art { width: 30px; border-radius: 50%; }
.mk-tick .art-num, .mk-row .art-num, .mk-sugg .art-num, .mk-course .art-num { display: none; }
.mk-tick .card-types, .mk-row .card-types { display: none; }
.mk-tabs { width: 100%; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.mk-item { --rc: var(--r-common); position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .25s var(--spring), box-shadow .25s; }
.mk-item:hover, .mk-item:focus-visible { transform: translateY(-3px); box-shadow: 0 0 0 1.5px var(--rc), var(--shadow); }
.mk-item.r-uncommon { --rc: var(--r-uncommon); } .mk-item.r-rare { --rc: var(--r-rare); } .mk-item.r-epic { --rc: var(--r-epic); }
.mk-item.r-legendary { --rc: var(--r-legendary); } .mk-item.r-mythic { --rc: var(--r-mythic); } .mk-item.shiny { --rc: var(--citrine); }
.mk-item-art { position: relative; align-self: start; }
.mk-item-art .art { border-radius: 14px; }
.mk-item-body { display: grid; gap: 4px; min-width: 0; align-content: start; }
.mk-item-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.mk-item-name b { font: 700 15px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-shiny { color: var(--citrine); }
.mk-rarity { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--rc); }
.mk-item-price small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 700; }
.mk-item-price b { font: 800 20px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.mk-item-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-size: 12px; }
.mk-bidder { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.mk-bidder .avatar { width: 22px; height: 22px; }
.mk-buynow { display: inline-flex; align-items: center; gap: 4px; width: max-content; max-width: 100%; padding: 3px 8px; border-radius: 999px; background: #ffc5311f; color: var(--citrine); font-size: 11.5px; font-weight: 800; }
.mk-item-foot { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--ink-3); }
.mk-timer { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.mk-timer.soon { color: var(--citrine); }
.mk-timer.urgent { color: var(--coral); }
.mk-timer.critical { animation: mk-blink .5s steps(2) infinite; }
.mk-timer.over { color: var(--ink-3); }
@keyframes mk-blink { 50% { opacity: .35; } }
.mk-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.mk-item-art .mk-badge { position: absolute; left: 50%; bottom: -8px; translate: -50% 0; z-index: 3; box-shadow: 0 0 0 2px var(--surface); }
.mk-badge.lead { background: var(--mint); color: #003524; }
.mk-badge.out { background: var(--coral); color: #fff; }
.mk-badge.mine { background: var(--sky); color: #fff; }
.mk-watch { position: absolute; top: -6px; left: -6px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); }
.mk-watch.on { color: #fff; background: var(--coral); border-color: transparent; }
.mk-rows { display: grid; gap: 8px; }
.mk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.mk-row:hover { background: var(--surface-2); }
.mk-row .art { width: 44px; flex: none; border-radius: 11px; }
.mk-row-main { min-width: 0; }
.mk-row-main b, .mk-row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row-side { display: grid; justify-items: end; gap: 2px; flex: none; }
.mk-row-side b { font-variant-numeric: tabular-nums; }
.mk-search { position: relative; flex: 1 1 260px; }
.mk-sugg { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: grid; gap: 2px; }
.mk-sugg button { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; background: none; border-radius: 10px; text-align: left; font-weight: 700; }
.mk-sugg button:hover { background: var(--surface-2); }
.mk-sugg .art { width: 30px; border-radius: 8px; }
.mk-sugg .card-types { display: none; }
.mk-course .row .art { width: 44px; border-radius: 11px; }
.mk-prices { display: grid; gap: 10px; }
.mk-price-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mk-price-tiles > div { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.mk-price-tiles small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-price-tiles b { font-variant-numeric: tabular-nums; font-size: 14px; }
.mk-spark { width: 100%; height: 70px; }
.mk-spark-line { fill: none; stroke: var(--coral); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mk-spark-area { fill: #ff5a4e22; }
.mk-spark-dot { fill: var(--coral); }
.mk-spark-empty { font-size: 13px; padding: 10px 0; }
/* Fiche d’enchère */
.mk-detail { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.mk-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: start; }
.mk-big-price { font: 800 clamp(32px, 5vw, 44px)/1 var(--display); font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.mk-big-price.bump { animation: mk-bump .6s var(--spring); color: var(--mint); }
@keyframes mk-bump { 30% { transform: scale(1.15); } }
.mk-big-timer-box { display: grid; justify-items: end; gap: 2px; text-align: right; }
.mk-big-timer { font: 800 30px/1 var(--display); }
.mk-big-timer.ext { animation: mk-ext .8s var(--spring); }
@keyframes mk-ext { 0% { transform: scale(1.4); color: var(--mint); } }
.mk-anti { max-width: 200px; font-size: 11px; }
.mk-bid .mk-amount { flex: 1; min-width: 0; font-size: 18px; font-weight: 800; }
.mk-leading, .mk-ended { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; font-weight: 700; }
.mk-leading { background: #2fd8a21f; color: var(--mint); }
.mk-ended { background: var(--surface-2); }
.mk-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.mk-bids { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.mk-bids li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.mk-bids li.top { background: #2fd8a21a; box-shadow: inset 0 0 0 1px #2fd8a255; }
.mk-bids li span { font-weight: 800; font-variant-numeric: tabular-nums; }
.mk-bids .avatar { width: 26px; height: 26px; }
.mk-sell { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: start; }
.mk-sell-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mk-durations { width: max-content; max-width: 100%; flex-wrap: wrap; }
@media (max-width: 760px) {
  .mk-detail { grid-template-columns: 1fr; }
  .mk-detail-card { width: 190px; margin: 0 auto; }
  .mk-big-timer-box { justify-items: start; text-align: left; }
  .mk-sell { grid-template-columns: 1fr; } .mk-sell > .card { width: 150px; margin: 0 auto; }
  .mk-sell-fields { grid-template-columns: 1fr; }
  .mk-price-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .mk-grid { grid-template-columns: 1fr; gap: 10px; }
  .mk-item { grid-template-columns: 84px minmax(0, 1fr); }
  .mk-tabs { overflow-x: auto; }
}

/* Récapitulatif de la défausse des doublons */
.dupes-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); }
.dupes-money { font: 800 22px/1 var(--display); color: var(--citrine); font-variant-numeric: tabular-nums; }
.dupes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 46dvh; overflow-y: auto; }
.dupes-list li { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--surface-2); }
.dupes-list .art { width: 40px; flex: none; border-radius: 10px; }
.dupes-list .art-num, .dupes-list .card-types { display: none; }
.dupes-name { min-width: 0; }
.dupes-name b, .dupes-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dupes-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.dupes-value { min-width: 64px; text-align: right; font-weight: 700; color: var(--citrine); font-variant-numeric: tabular-nums; }

/* Onglets du marché sur mobile : deux lignes au lieu de défiler hors écran */
@media (max-width: 560px) {
  .mk-tabs { flex-wrap: wrap; border-radius: 20px; overflow: visible; }
  .mk-tabs .tab { flex: 1 1 auto; justify-content: center; padding: 8px 10px; font-size: 13px; }
  .mk-ticker { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
}

/* Fenêtres : aucun contenu ne doit élargir la fenêtre au-delà de l’écran */
.modal-box > *, .detail > *, .mk-detail > *, .mk-sell > *, .stack > * { min-width: 0; }
.modal-box { overflow-x: hidden; }
.modal-box .tabs { flex-wrap: wrap; border-radius: 20px; overflow: visible; width: auto; }
.modal-box .tabs .tab { flex: 1 1 auto; justify-content: center; white-space: normal; text-align: center; }
@media (max-width: 760px) { .mk-detail, .detail { grid-template-columns: minmax(0, 1fr); } }
.mk-bid .row { min-width: 0; } .mk-bid .btn-gold { white-space: normal; text-align: center; }
.mk-facts .btn { margin-left: auto; }
@media (max-width: 560px) { dialog.modal { max-width: 100vw !important; width: 100vw; } }
/* La colonne de page ne s’élargit jamais selon son contenu (bandeaux défilants, grilles…) */
.page { grid-template-columns: minmax(0, 1fr); }
/* Marché : cartes un peu plus larges, lignes qui passent à la ligne au lieu de déborder */
.mk-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.mk-item-body > * { min-width: 0; max-width: 100%; }
.mk-buynow { width: auto; white-space: normal; }
.mk-item-meta > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-item { overflow: hidden; }
.mk-item-art .mk-watch { top: 4px; left: 4px; }
.mk-item-art .mk-badge { bottom: 4px; }
/* Menu latéral : défile si l’écran est bas, au lieu de chevaucher le pied */
.nav { overflow-y: auto; scrollbar-width: none; }
.nav-foot { padding-top: 12px; }
@media (max-height: 760px) { .nav-link { padding: 8px 14px; } .brand { padding-bottom: 12px; } }

/* ═══ Finitions : pastilles, pied du menu, onglet « + », bannière de profil ═══ */
/* Pastille de notification : posée sur le bord du bouton, sans cacher l’icône */
.icon-btn .badge-dot { top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; line-height: 18px; box-shadow: 0 0 0 2.5px var(--bg); }

/* Pied du menu latéral : carte de profil + trois boutons icônes, jamais plus large que le menu */
.nav { width: var(--nav-w); }
.nav-foot { gap: 10px; }
.me-chip { min-width: 0; width: 100%; }
.me-chip .avatar { width: 38px; height: 38px; }
.me-name { flex: 1; min-width: 0; }
.me-name b, .me-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.nav-tool { height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; transition: background .2s, color .2s; }
.nav-tool:hover { background: var(--surface-2); color: var(--ink); }

/* Onglet « + » de la barre mobile */
.tabbar .tab-more { align-content: center; }
.tabbar .more-plus { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); }
.tabbar .tab-more:active .more-plus { transform: scale(.92); }
.tabbar .tab-more .badge-dot { top: 4px; right: calc(50% - 26px); min-width: 12px; height: 12px; padding: 0; font-size: 0; }

/* Bannière de profil : lueurs douces de la couleur du partenaire, plus de bande coupée net */
.profile-hero::before { inset: 0; background:
  radial-gradient(55% 140% at 0% 0%, color-mix(in srgb, var(--c1) 20%, transparent), transparent 70%),
  radial-gradient(40% 90% at 100% 100%, color-mix(in srgb, var(--c1) 10%, transparent), transparent 70%); }
.pf-hero::after { opacity: .6; }

/* Icônes : trait un peu plus fin pour un rendu plus net */
.icon { stroke-width: 1.7; }
.nav-link .icon { width: 20px; height: 20px; }
.icon-btn .badge-dot { top: -6px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
