:root {
  --bg: #000;
  --bg2: #0d0d10;
  --fill: rgba(120, 120, 128, 0.16);
  --fill2: rgba(120, 120, 128, 0.24);
  --sep: rgba(84, 84, 88, 0.45);
  --label: #f5f5f7;
  --label2: rgba(235, 235, 245, 0.62);
  --label3: rgba(235, 235, 245, 0.32);
  --blue: #0a84ff;
  --commune: #98989d;
  --rare: #0a84ff;
  --epique: #bf5af2;
  --legendaire: #ff9f0a;
  --mythique: #ff375f;
  --glass: rgba(22, 22, 26, 0.72);
  --radius: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 50% -200px, #1b1b2a, transparent), var(--bg);
  color: var(--label);
  font: 100%/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
img { display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; user-select: none; }
button:disabled { opacity: 0.4; cursor: default; }

.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 0.5px solid var(--sep);
}
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; }
.brand { color: inherit; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 14px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; color: var(--label2); transition: background 0.2s, color 0.2s; }
.tab:hover { color: var(--label); }
.tab[aria-current="true"] { background: var(--fill2); color: var(--label); }
.nav .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip small { color: var(--label2); font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--fill2); object-fit: cover; }

.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; background: var(--fill2); transition: transform 0.12s ease-out, background 0.2s; }
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn.primary { background: var(--label); color: #000; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.discord { background: #5865f2; color: #fff; }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }

main { max-width: 1180px; margin: 0 auto; padding: 32px 16px 120px; }
.eyebrow { font-size: 0.8rem; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: 0.06em; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.04; letter-spacing: -0.035em; margin: 6px 0 10px; font-weight: 700; }
h2 { font-size: 1.6rem; letter-spacing: -0.025em; margin: 48px 0 16px; line-height: 1.1; }
.sub { color: var(--label2); font-size: 1.05rem; max-width: 560px; margin: 0; }

.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 24px;
  padding: 40px; border-radius: 28px;
  background: linear-gradient(135deg, #1c1c24, #101014);
  border: 0.5px solid var(--sep);
}
.hero .actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-fan { position: relative; height: 240px; }
.hero-fan .card { position: absolute; left: 50%; top: 50%; width: 150px; transform-origin: 50% 120%; }

.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.stats .chip { padding: 9px 14px; background: var(--bg2); border: 0.5px solid var(--sep); }
.bar { width: 46px; height: 5px; border-radius: 3px; background: var(--fill2); overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--label); border-radius: 3px; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--fill); gap: 2px; flex-wrap: wrap; }
.seg button { padding: 6px 14px; border-radius: 9px; font-size: 0.85rem; font-weight: 500; color: var(--label2); }
.seg button[aria-pressed="true"] { background: #636366; color: var(--label); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); }

.boosters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.booster { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0; text-align: center; }
.booster .meta b { display: block; font-size: 1rem; }
.booster .meta span { font-size: 0.8rem; color: var(--label2); }

.pack {
  --c1: #3a3a44; --c2: #15151a;
  position: relative; width: 180px; aspect-ratio: 5 / 8; border-radius: 18px;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7), inset 0 0 0 0.5px rgba(255, 255, 255, 0.25);
  overflow: hidden; transform-style: preserve-3d; will-change: transform; text-align: center;
}
.pack::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 45%, transparent 60%) calc(var(--mx, 50%) * 1) 0 / 250% 100%,
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 8px);
  mix-blend-mode: screen;
}
.pack .faces { position: absolute; inset: 22% 14% 30%; display: grid; place-items: center; }
.pack .faces img { position: absolute; width: 58%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5); border: 2px solid rgba(255, 255, 255, 0.85); }
.pack .faces img:nth-child(1) { transform: translateX(-34%) rotate(-12deg) scale(0.9); }
.pack .faces img:nth-child(3) { transform: translateX(34%) rotate(12deg) scale(0.9); }
.pack .faces img:nth-child(2) { z-index: 1; }
.pack .label { position: absolute; left: 0; right: 0; bottom: 18px; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.pack .crimp { position: absolute; left: 0; right: 0; height: 14px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 8px); }
.pack .crimp.top { top: 0; } .pack .crimp.bottom { bottom: 0; }
.pack .brandmark { position: absolute; top: 22px; left: 0; right: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.3em; opacity: 0.8; }
.pack[data-type="anime"] { --c1: #ff6482; --c2: #5e1a3a; }
.pack[data-type="marvel"] { --c1: #ff453a; --c2: #5a0d0a; }
.pack[data-type="dc"] { --c1: #0a84ff; --c2: #0b2350; }
.pack[data-type="series"] { --c1: #30d158; --c2: #0b3b1e; }
.pack[data-type="autres"] { --c1: #ff9f0a; --c2: #4a2a05; }
.pack[data-type="multivers"] { --c1: #bf5af2; --c2: #1d1450; }
.pack[data-type="pokemon"] { --c1: #ffd60a; --c2: #b3261e; }
.pack[data-type="digimon"] { --c1: #ff9f0a; --c2: #1d3557; }
.pack[data-type="disney"] { --c1: #64d2ff; --c2: #1a237e; }
.pack[data-type="jeux"] { --c1: #5e5ce6; --c2: #0d0d2b; }
.pack[data-type="simpsons"] { --c1: #ffd60a; --c2: #2c7be5; }
.pack[data-type="rickmorty"] { --c1: #a4de02; --c2: #0e3b43; }
.pack[data-type="netflix"] { --c1: #e50914; --c2: #141414; }
.pack[data-type="prime"] { --c1: #1a98ff; --c2: #0f1b2b; }
.pack[data-type="disneyplus"] { --c1: #3b82f6; --c2: #0b1033; }
.pack[data-type="hbo"] { --c1: #8b5cf6; --c2: #120a2a; }
.pack[data-type="appletv"] { --c1: #8e8e93; --c2: #1c1c1e; }
.pack[data-type="streaming"] { --c1: #1ce783; --c2: #0b2a2a; }
.pack[data-type="nintendo"] { --c1: #e60012; --c2: #5a0008; }
.pack[data-type="fortnite"] { --c1: #9d4dff; --c2: #1f8bff; }
.pack[data-type="avatar"] { --c1: #ffb347; --c2: #1d4e89; }
.pack[data-type="daily"] { --c1: #ffd60a; --c2: #5a3a00; color: #fff; }

.card {
  --rc: var(--commune);
  position: relative; aspect-ratio: 5 / 7; border-radius: 14px; overflow: hidden;
  background: #1c1c1e; box-shadow: 0 0 0 1.5px var(--rc), 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d;
}
.card img { width: 100%; height: 100%; object-fit: cover; }
.card.contain { background: radial-gradient(circle at 50% 38%, #3a3a46, #121216 75%); }
.card.contain img { object-fit: contain; padding: 14% 8% 26%; }
.card .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 9px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.88)); }
.card .info b { display: block; font-size: 0.86rem; line-height: 1.15; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .info span { display: block; font-size: 0.68rem; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .rarity { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: var(--rc); color: #000; }
.card .count { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px); }
.card .badge-new { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 999px; font-size: 0.65rem; font-weight: 800; background: #30d158; color: #000; }
.card[data-r="rare"] { --rc: var(--rare); }
.card[data-r="epique"] { --rc: var(--epique); }
.card[data-r="legendaire"] { --rc: var(--legendaire); }
.card[data-r="mythique"] { --rc: var(--mythique); box-shadow: 0 0 0 2px #ffd60a, 0 0 30px -4px #ff375f, 0 10px 24px -8px rgba(0, 0, 0, 0.6); }
.card[data-r="mythique"] .rarity { background: linear-gradient(90deg, #ff375f, #ffd60a, #30d158, #0a84ff, #bf5af2); }
.card[data-r="epique"]::after, .card[data-r="legendaire"]::after, .card[data-r="mythique"]::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.55;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 0, 140, 0.35) 38%, rgba(0, 255, 230, 0.35) 50%, rgba(255, 230, 0, 0.35) 62%, transparent 75%) var(--mx, 50%) var(--my, 50%) / 300% 300%;
}
.card.locked img { filter: grayscale(1) brightness(0.28) blur(1px); }
.card.locked .rarity { opacity: 0.5; }
.card .heart { position: absolute; bottom: 44px; right: 8px; font-size: 0.9rem; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { flex: 1 1 220px; padding: 9px 14px; border-radius: 11px; border: 0; background: var(--fill); color: var(--label); font: inherit; font-size: 0.95rem; outline: none; }
.search:focus { box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.5); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.grid > .card { content-visibility: auto; contain-intrinsic-size: 140px 196px; cursor: pointer; transition: transform 0.15s ease-out; }
.grid > .card:active { transform: scale(0.97); }
.progress { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 18px 0 24px; }
.progress div { padding: 14px; border-radius: 16px; background: var(--bg2); border: 0.5px solid var(--sep); }
.progress b { font-size: 1.3rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.progress span { display: block; font-size: 0.78rem; color: var(--label2); }
.progress .bar { width: 100%; margin-top: 8px; }

.list { border-radius: 18px; background: var(--bg2); border: 0.5px solid var(--sep); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 0.5px solid var(--sep); }
.row:last-child { border-bottom: 0; }
.row .pos { width: 28px; font-weight: 700; color: var(--label2); font-variant-numeric: tabular-nums; }
.row .grow { flex: 1; font-weight: 600; }
.row small { color: var(--label2); font-variant-numeric: tabular-nums; }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(30px) saturate(140%); -webkit-backdrop-filter: blur(30px) saturate(140%); touch-action: none; overflow: hidden; }
.overlay .close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--fill2); font-size: 1rem; z-index: 3; }
.overlay .hint { position: absolute; bottom: max(32px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: var(--label2); font-size: 0.9rem; font-weight: 500; }
.stage { position: relative; width: 260px; aspect-ratio: 5 / 7; perspective: 1200px; }
.stage .pack { position: absolute; inset: -6% -8%; width: auto; cursor: grab; touch-action: none; }
.stage .pack .tear { position: absolute; left: 0; top: 0; height: 15%; width: 100%; background: linear-gradient(90deg, rgba(255, 255, 255, 0.9) var(--tear, 0%), transparent var(--tear, 0%)); mask: linear-gradient(transparent 46%, #000 46% 54%, transparent 54%); }
.stage .flip { position: absolute; inset: 0; transform-style: preserve-3d; cursor: pointer; touch-action: none; }
.stage .flip > * { position: absolute; inset: 0; backface-visibility: hidden; }
.stage .flip .front { transform: rotateY(180deg); width: 100%; }
.stage .back { border-radius: 14px; background: linear-gradient(160deg, #2c2c34, #0f0f12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 20px 40px -10px rgba(0, 0, 0, 0.8); display: grid; place-items: center; }
.stage .back::before { content: ""; width: 64px; height: 64px; border-radius: 18px; background: url(/logo.svg) center / cover; }
.aura { position: absolute; inset: -40%; border-radius: 50%; pointer-events: none; opacity: 0; filter: blur(40px); }
.burst { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tag-new { position: absolute; top: -34px; left: 50%; translate: -50% 0; padding: 4px 12px; border-radius: 999px; background: #30d158; color: #000; font-weight: 800; font-size: 0.8rem; white-space: nowrap; }
.counter { position: absolute; top: 22px; left: 0; right: 0; text-align: center; font-weight: 600; color: var(--label2); font-variant-numeric: tabular-nums; }
.summary { width: min(980px, 92vw); text-align: center; }
.summary .grid { grid-template-columns: repeat(5, 1fr); margin: 24px 0 28px; }
.summary .actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.sheet { position: fixed; inset: 0; z-index: 70; display: grid; place-items: end center; background: rgba(0, 0, 0, 0.5); }
.sheet .panel { width: min(520px, 100%); padding: 22px 22px max(26px, env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: rgba(28, 28, 32, 0.92); backdrop-filter: blur(30px) saturate(180%); border: 0.5px solid var(--sep); display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: start; }
.sheet .grabber { grid-column: 1 / -1; justify-self: center; width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: -10px 0 0; }
.sheet h3 { margin: 0 0 4px; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1.15; }
.sheet p { margin: 0 0 14px; color: var(--label2); font-size: 0.9rem; }
.sheet dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 18px; font-size: 0.88rem; }
.sheet dt { color: var(--label2); }
.sheet dd { margin: 0; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 96px; translate: -50% 0; z-index: 80; padding: 12px 18px; border-radius: 16px; background: rgba(44, 44, 50, 0.9); backdrop-filter: blur(20px); font-weight: 600; font-size: 0.9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.empty { padding: 60px 20px; text-align: center; color: var(--label2); }

.tabbar { display: none; }
@media (max-width: 760px) {
  .nav .tabs { display: none; }
  .nav { gap: 10px; }
  .nav .chip.hide-sm { display: none; }
  .tabbar { display: flex; position: fixed; z-index: 20; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 6px; border-radius: 26px; background: var(--glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); border: 0.5px solid var(--sep); }
  .tabbar .tab { flex: 1; text-align: center; padding: 10px 0; border-radius: 20px; font-size: 0.8rem; }
  .hero { grid-template-columns: 1fr; padding: 26px 20px; }
  .hero-fan { height: 200px; }
  .boosters { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .pack { width: 100%; max-width: 170px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card .info b { font-size: 0.72rem; }
  .card .info span { display: none; }
  .summary .grid { grid-template-columns: repeat(3, 1fr); }
  .sheet .panel { grid-template-columns: 120px 1fr; }
  .stage { width: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav, .tabbar, .sheet .panel, .overlay { backdrop-filter: none; background: #111; }
}
.list:empty { display: none; }
.mini .rarity, .mini .heart, .mini .count, .mini .badge-new { display: none; }
