:root {
  --bg: #0b0d17;
  --bg2: #12162a;
  --panel: #171c33;
  --line: #262d4d;
  --text: #eef0ff;
  --muted: #8f96bd;
  --gold: #ffd36b;
  --good: #5ee6a8;
  --c: #ffd36b;
  --a: #3b2470;
  --radius: 16px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --soft0: #ffffff08; --soft: #ffffff12; --soft2: #ffffff14; --soft3: #ffffff1a; --soft4: #ffffff22;
  --line2: #3a4374;
  --topbar: #0b0d17cc;
  --glow1: #2a1d5c55; --glow2: #12406b44; --glow3: #5c1d4a33;
  --hero: linear-gradient(90deg, #ffd36b, #ff8bd4, #8bb8ff, #ffd36b);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--glow1), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, var(--glow2), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; }
h2 { font-size: 22px; margin-top: 1.6em; }
code { background: var(--soft2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.accent { color: var(--gold); }
.good { color: var(--good); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px 60px; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  background: var(--topbar); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { display: block; height: 40px; width: auto; filter: drop-shadow(0 2px 6px #0006); }
.brand:hover img { transform: scale(1.03); transition: transform .2s; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.topbar nav a:hover { color: var(--text); }
.topbar nav a.on { background: var(--soft); color: var(--text); }
@media (max-width: 1180px) { .topbar { flex-wrap: wrap; row-gap: 8px; } .topbar nav { order: 3; width: 100%; overflow-x: auto; } }
.value-pill {
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, #ffd36b22, #ff8bd422); border: 1px solid #ffd36b55;
}
.value-pill span { color: var(--muted); font-size: 13px; }
.value-pill b { color: var(--gold); }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 32px; border-top: 1px solid var(--line); }

.boot { padding: 60px 0; text-align: center; }
.boot-help { max-width: 680px; }
.boot-help p { font-size: 16px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 600 15px Inter, sans-serif; cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--line2); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #ff5ea8));
  color: #15111f; border: 0; box-shadow: 0 10px 30px -10px var(--c);
}
.btn.ghost { background: transparent; }
.back { color: var(--muted); font-weight: 500; display: inline-block; margin: 20px 0 8px; }
.back:hover { color: var(--text); }

/* ---------- Accueil ---------- */
.hero { padding: 56px 0 24px; }
.hero h1 { font-size: clamp(30px, 3.9vw, 50px); }
@media (min-width: 900px) { .hero h1 { white-space: nowrap; } }
.hero em { font-style: normal; background: var(--hero); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-width: 180px; }
.hero-stats b { display: block; font: 800 24px var(--display); }
.hero-stats span { color: var(--muted); font-size: 13px; }

.game { margin-top: 40px; }
.game-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.game-head h2 { margin: 0; color: var(--c); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--soft3); }
.dots i.on { background: var(--c); box-shadow: 0 0 8px var(--c); }

.set-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px; }
.set-tile { display: flex; flex-direction: column; gap: 10px; transition: transform .45s cubic-bezier(.2, .8, .2, 1), border-color .2s; }
.set-tile.disabled { opacity: .5; pointer-events: none; }
.set-tile[hidden], .set-group[hidden] { display: none; }
.more-tile {
  aspect-ratio: 5 / 8.2; justify-content: center; align-items: center; text-align: center; padding: 16px;
  border: 2px dashed color-mix(in srgb, var(--c) 50%, transparent); border-radius: 10px; color: var(--c);
}
.more-tile span { font: 800 40px var(--display); }
.more-tile small { color: var(--muted); }
.game-head h2 a:hover { text-decoration: underline; }
.see-all { margin-left: auto; color: var(--c); font-weight: 600; font-size: 14px; }
.set-group h2 { color: var(--c); }
.set-group h2 .muted { font: 500 14px Inter, sans-serif; margin-left: 8px; }
.search {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 16px; font: 500 15px Inter, sans-serif; min-width: min(320px, 100%);
}
.search:focus { outline: none; border-color: var(--c); }
.set-tile-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 8px; }
.set-tile-info b { color: var(--text); }
.progress { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--c), #fff); border-radius: inherit; }

/* ---------- Booster ---------- */
.pack {
  position: relative; aspect-ratio: 5 / 8.2; width: 100%;
  filter: drop-shadow(0 18px 30px #0009);
  transform-origin: 50% 80%;
}
.pack-body {
  position: absolute; inset: 7% 0 4%;
  display: flex; flex-direction: column; align-items: center; padding: 10% 9% 8%;
  background:
    linear-gradient(115deg, transparent 30%, #ffffff40 45%, transparent 55%),
    linear-gradient(160deg, var(--c), var(--a) 75%);
  background-size: 250% 100%, 100% 100%;
  animation: foil 6s linear infinite;
  border-radius: 4px; overflow: hidden;
}
@keyframes foil { from { background-position: 150% 0, 0 0; } to { background-position: -150% 0, 0 0; } }
.pack-body::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #ffffff08 0 2px, transparent 2px 6px); pointer-events: none; }
.pack-game { font: 800 clamp(11px, 1.2vw, 14px) var(--display); text-transform: uppercase; letter-spacing: .12em; color: #fff; text-shadow: 0 1px 4px #0008; }
.pack-art {
  flex: 1; width: 100%; margin: 8% 0; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 3px #ffffff55, 0 8px 20px #0008; background: #0003;
}
.pack-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.5); }
.pack-set { font: 800 clamp(15px, 1.7vw, 20px) var(--display); color: #fff; text-align: center; text-shadow: 0 2px 8px #000a; line-height: 1.05; }
.pack-meta { font-size: 11px; color: #ffffffcc; margin-top: 4px; }
.crimp {
  position: absolute; left: 0; right: 0; height: 100%;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 80%, #fff) 0 4px, color-mix(in srgb, var(--c) 60%, #000) 4px 8px);
}
.pack-cut { position: absolute; top: 0; left: 0; right: 0; height: 7.5%; z-index: 2; transition: transform .6s cubic-bezier(.3, .7, .3, 1), opacity .6s; }
.crimp-bottom { top: auto; bottom: 0; height: 4.5%; }

.pack-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 0; }
.pack-big { width: min(300px, 70vw); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }
.pack.shake { animation: shake .12s linear infinite; }
@keyframes shake { 25% { transform: rotate(-2deg) translateX(-3px); } 75% { transform: rotate(2deg) translateX(3px); } }
.pack.torn { animation: none; }
.pack.torn .pack-cut { transform: translate(60px, -120px) rotate(25deg); opacity: 0; }
.pack.torn .pack-body, .pack.torn .crimp-bottom { transition: transform .6s .15s ease-in, opacity .6s .15s; transform: translateY(70%); opacity: 0; }
.hint { font-size: 13px; margin: 0; }

.open-head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.open-head h1 { margin: 0; color: var(--c); }
.open-head p { margin: 0; }
.open-head .back { margin: 0; align-self: center; }
.open-quota { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; color: var(--muted); }

.limit { text-align: center; max-width: 480px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* ---------- Révélation des cartes ---------- */
.reveal { padding: 28px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; perspective: 1400px; }
.flip { cursor: pointer; animation: deal .5s backwards cubic-bezier(.2, .8, .3, 1.2); animation-delay: calc(var(--i) * 55ms); }
@keyframes deal { from { opacity: 0; transform: translateY(-80px) scale(.6) rotate(-8deg); } }
.flip-inner { position: relative; aspect-ratio: 63 / 88; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .3, 1); }
.flip.open .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 4.5% / 3.3%; backface-visibility: hidden; overflow: hidden; }
.face.face-back {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(circle at 50% 50%, #ffffff22 0 22%, transparent 23%),
    repeating-conic-gradient(from 0deg, var(--a) 0 10deg, color-mix(in srgb, var(--a) 70%, #000) 10deg 20deg);
  border: 6px solid color-mix(in srgb, var(--c) 70%, #000);
  color: var(--c); box-shadow: 0 10px 24px #0008;
}
.face.face-back span { font-size: 42px; text-shadow: 0 0 18px var(--c); }
.face.face-back.real { border: 0; background: #000; }
.face.face-back.real img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face.face-back small { font: 800 11px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.flip:not(.open):hover .flip-inner { transform: translateY(-6px) rotate(-1deg); }
.face.front { transform: rotateY(180deg); background: #000; box-shadow: 0 10px 24px #0008; }
.face.front img, .thumb img, .tilt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.new { display: table; margin: 6px auto 0; padding: 2px 10px; border-radius: 99px; background: var(--good); color: #062; font: 800 10px Inter; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 0 14px #5ee6a866; }
.flip-label { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); padding: 8px 2px 0; opacity: 0; transition: opacity .3s .3s; }
.flip-label b { color: var(--text); }
.flip.open .flip-label { opacity: 1; }

/* Tilt + reflet holo */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .12s; }
.flip.open .tilt { transform: rotateY(180deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.shine {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit; mix-blend-mode: soft-light; opacity: 0; transition: opacity .3s;
  background: radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 50%), #ffffffdd 0%, #ffffff40 25%, transparent 55%);
}
.tilt:hover .shine, .scard.live .shine { opacity: .85; }
/* Cartes rares : film holographique arc-en-ciel qui bouge avec la souris */
.tier-3 .shine, .tier-4 .shine, .tier-5 .shine, .thumb.tier-3::after, .thumb.tier-4::after, .thumb.tier-5::after {
  mix-blend-mode: color-dodge; filter: brightness(.6) contrast(1.6) saturate(1.3);
  background:
    radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 50%), #ffffffaa 0%, transparent 42%),
    repeating-linear-gradient(115deg, #ff6b8b 0%, #ffd36b 6%, #7dffb0 12%, #6bc8ff 18%, #b98bff 24%, #ff6b8b 30%);
  background-size: 100% 100%, 400% 400%;
  background-position: center, var(--mx, 50%) var(--my, 50%);
}
.tier-3 .shine { opacity: .35; }
.tier-4 .shine, .tier-5 .shine { opacity: .55; animation: holo 7s linear infinite; }
.tilt:hover .shine, .scard.live .shine { animation: none; }
.tier-3 .tilt:hover .shine, .tier-4 .tilt:hover .shine, .tier-5 .tilt:hover .shine, .scard.live.tier-3 .shine, .scard.live.tier-4 .shine, .scard.live.tier-5 .shine { opacity: .8; }
.tier-5 .shine::after { /* paillettes */
  content: ''; position: absolute; inset: 0; mix-blend-mode: screen; opacity: .6;
  background:
    radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px) 0 0 / 23px 29px,
    radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px) 0 0 / 31px 37px;
  animation: glitter 1.8s steps(6) infinite;
}
@keyframes glitter { 50% { opacity: .15; } }

/* Effets par rareté */
.tier-2 .face.front, .thumb.tier-2 { box-shadow: 0 0 0 2px #8bb8ff88, 0 10px 24px #0008; }
.tier-3 .face.front, .thumb.tier-3 { box-shadow: 0 0 0 2px #c58bff, 0 0 24px #c58bff88; }
.tier-4 .face.front, .thumb.tier-4, .tier-5 .face.front, .thumb.tier-5 { box-shadow: 0 0 0 2px var(--gold), 0 0 34px #ffd36baa; }
.tier-5 .face.front { animation: pulse 1.6s ease-in-out infinite; }
@keyframes holo { from { background-position: center, 0% 0%; } to { background-position: center, 400% 400%; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 60px #ff8bd4; } }
.flip.open.tier-4 .flip-label b, .flip.open.tier-5 .flip-label b { color: var(--gold); }

.confetti { position: fixed; width: 8px; height: 12px; border-radius: 2px; z-index: 60; pointer-events: none; animation: burst 1.3s cubic-bezier(.1, .8, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

.reveal-bar { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 28px; }
.summary { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.summary div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; font-size: 13px; }
.summary b { font-size: 17px; }

/* ---------- Vrais boosters (accueil, pages de jeu) ---------- */
.pack-real { aspect-ratio: 5 / 8.2; display: flex; align-items: flex-end; justify-content: center; }
.pack-real img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 16px 22px #000b); transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .35s; }
.set-tile.tilting .pack-real img, .set-tile:focus-visible .pack-real img {
  transform: translateY(-8px) scale(1.04);
  filter: drop-shadow(0 24px 26px #000b) drop-shadow(0 0 22px color-mix(in srgb, var(--c) 55%, transparent));
}
.pack-real.pack-big { width: auto; height: min(440px, 58vh); aspect-ratio: auto; animation: float 4s ease-in-out infinite; }

/* ---------- Ouverture 3D ---------- */
.scene {
  position: relative; height: min(560px, 63vh); display: grid; place-items: center;
  perspective: 1400px; touch-action: none; user-select: none; margin-top: 12px;
}
.scene::after { /* ombre au sol */
  content: ''; position: absolute; bottom: 2%; left: 50%; width: 260px; height: 34px; transform: translateX(-50%);
  background: radial-gradient(closest-side, #000c, transparent); z-index: 0; transition: opacity .6s;
}
.pack3d-wrap { position: relative; z-index: 2; animation: float 4.5s ease-in-out infinite; transform-style: preserve-3d; }
.pack3d {
  position: relative; height: min(480px, 54vh); transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out; cursor: grab;
}
.p-front { position: relative; height: 100%; transform-style: preserve-3d; backface-visibility: hidden; }
.p-size { display: block; height: 100%; width: auto; visibility: hidden; }
.p-fake { aspect-ratio: 5 / 8.2; }
.p-fake .pack, .p-body .pack, .p-top .pack { width: 100%; height: 100%; }
.p-body, .p-top { position: absolute; inset: 0; }
.p-body img, .p-top img { width: 100%; height: 100%; display: block; }
.p-top { clip-path: polygon(0 0, 100% 0, 100% 12%, 95% 14%, 90% 12%, 85% 14%, 80% 12%, 75% 14%, 70% 12%, 65% 14%, 60% 12%, 55% 14%, 50% 12%, 45% 14%, 40% 12%, 35% 14%, 30% 12%, 25% 14%, 20% 12%, 15% 14%, 10% 12%, 5% 14%, 0% 12%); transform-origin: 0 13%; }
.p-body { clip-path: polygon(0% 12%, 5% 14%, 10% 12%, 15% 14%, 20% 12%, 25% 14%, 30% 12%, 35% 14%, 40% 12%, 45% 14%, 50% 12%, 55% 14%, 60% 12%, 65% 14%, 70% 12%, 75% 14%, 80% 12%, 85% 14%, 90% 12%, 95% 14%, 100% 12%, 100% 100%, 0 100%); }
.p-shine {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .55;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  background: linear-gradient(105deg, transparent 30%, #ffffff66 calc(var(--mx, 50%) - 2%), transparent calc(var(--mx, 50%) + 18%));
}
.p-cut { position: absolute; left: 4%; right: 4%; top: 13%; height: 0; border-top: 2px dashed #ffffff00; transition: border-color .3s; }
.p-cut i { position: absolute; left: 0; top: -2px; height: 3px; width: 0; background: #fff; box-shadow: 0 0 12px #fff, 0 0 24px var(--c); border-radius: 3px; }
.scene:hover .p-cut, .scene.cutting .p-cut { border-top-color: #ffffffaa; }
.p-back { position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden; display: grid; place-items: center; }
.p-back img { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); filter: brightness(.35) saturate(.6); }
.p-back span { position: relative; font-size: 60px; color: var(--c); text-shadow: 0 0 20px var(--c); }

.scene.opening .pack3d-wrap { animation: none; }
.scene.opening .pack3d { animation: pack-wiggle .38s ease-in-out; }
@keyframes pack-wiggle { 30% { transform: rotateZ(-2deg) scale(1.02); } 70% { transform: rotateZ(2deg) scale(1.02); } }
.scene.torn .p-top { animation: rip .75s cubic-bezier(.3, .6, .4, 1) forwards; }
@keyframes rip {
  30% { transform: translate(10px, -26px) rotate(-6deg); }
  100% { transform: translate(220px, -300px) rotate(48deg); opacity: 0; }
}
.scene.torn .p-cut, .scene.torn .p-shine { display: none; }
/* Le booster reste opaque pendant que les cartes sortent, puis tombe. */
.scene.emerge .pack3d-wrap { animation: pack-drop 1.1s ease-in forwards; }
@keyframes pack-drop {
  0%, 45% { transform: translateY(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(105%) rotate(7deg); opacity: 0; }
}
.scene.emerge::after { opacity: 0; }

/* Paquet de cartes */
.stack {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: min(230px, 30vh, 58vw); aspect-ratio: 63 / 88;
  transform: translate(-50%, -50%); perspective: 1200px; opacity: 0; cursor: pointer;
}
.scene.emerge .stack { opacity: 1; animation: stack-rise 1.1s cubic-bezier(.25, .8, .3, 1) forwards; }
@keyframes stack-rise {
  0% { transform: translate(-50%, -30%) scale(.8); }
  50% { transform: translate(-50%, -88%) scale(.84); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.scene.ready .stack { z-index: 3; }
.scene.ready .pack3d-wrap { visibility: hidden; pointer-events: none; } /* booster tombé : ne bloque plus les clics */
/* En 3D, la zone de clic des cartes retournées déborde : seul le cadre du paquet reçoit les clics. */
.scene.opening .pack3d-wrap, .stack * { pointer-events: none; }
.scard {
  position: absolute; inset: 0; z-index: calc(var(--n) - var(--i));
  transform: translate(calc(var(--i) * .7px), calc(var(--i) * 1.4px)); transition: transform .35s, opacity .45s;
}
.scard-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .3, 1); }
.scard .face { box-shadow: 0 8px 18px #0009; }
.scard.top { transform: translateY(-12px) scale(1.03); }
.scard.flipped .scard-inner { transform: rotateY(180deg) scale(1.1); }
.scard.gone { transform: translateY(160%) scale(.25); opacity: 0; pointer-events: none; }
.tier-3 { --glow: #c58bff; } .tier-4 { --glow: #ffd36b; } .tier-5 { --glow: #ff8bd4; }
.scard.charging:not(.flipped) .face-back { animation: charge .45s ease-in-out infinite alternate; }
.scard.charging:not(.flipped) { animation: charge-shake .12s linear infinite; }
@keyframes charge { from { box-shadow: 0 0 10px var(--glow), 0 0 0 2px var(--glow); } to { box-shadow: 0 0 60px var(--glow), 0 0 0 4px #fff; } }
@keyframes charge-shake { 25% { translate: -2px 0; } 75% { translate: 2px 0; } }
.scard-label {
  position: absolute; top: calc(100% + 26px); left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; gap: 12px; align-items: baseline; white-space: nowrap; padding: 8px 16px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line); animation: pop .25s ease-out;
}
.scard-label b { font: 800 18px var(--display); }
.scard-label[hidden] { display: none; }
.scard-label em { font-style: normal; color: var(--good); font-weight: 600; font-size: 13px; }
.scard-label.tier-3 { border-color: #c58bff; } .scard-label.tier-4, .scard-label.tier-5 { border-color: var(--gold); }
.scard-label.tier-4 b, .scard-label.tier-5 b { color: var(--gold); }

.open-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; min-height: 120px; }
.tray { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 64px; }
.tray-card { width: 46px; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 3px; overflow: hidden; cursor: pointer; background: #000; animation: pop .3s ease-out; }
.tray-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-card.tier-3 { box-shadow: 0 0 0 2px #c58bff; } .tray-card.tier-4, .tray-card.tier-5 { box-shadow: 0 0 0 2px var(--gold), 0 0 12px #ffd36b; }
.open.quake { animation: quake .5s; }
@keyframes quake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }

/* ---------- Collection ---------- */
.page { padding-top: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { color: var(--c); margin: 0; }
.binder-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.binder { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: border-color .2s, transform .2s; }
.binder:hover { border-color: var(--c); }
.binder-art { width: 70px; flex: none; aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; }
.binder-art img { width: 100%; height: 100%; object-fit: cover; }
.binder-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.binder-body small { color: var(--c); font-weight: 600; }
.binder-body h3 { margin: 0; font-size: 18px; }

.toolbar { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 7px 14px; border-radius: 8px; font: 500 14px Inter; cursor: pointer; }
.seg button.on { background: var(--soft2); color: var(--text); }
select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: 500 14px Inter; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.thumb { position: relative; padding: 0; border: 0; background: #000; cursor: pointer; aspect-ratio: 63 / 88; border-radius: 4.5% / 3.3%; overflow: hidden; color: var(--text);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.thumb:focus-visible { transform: translateY(-4px) scale(1.02); z-index: 1; }
.thumb.missing { box-shadow: none; background: var(--soft0); outline: 1px dashed var(--soft4); }
.thumb.missing img { filter: grayscale(1) brightness(.5); opacity: .25; }
.count { position: absolute; top: 6px; right: 6px; background: #000c; padding: 1px 8px; border-radius: 99px; font: 700 12px Inter; }
.thumb-info { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 6px; padding: 18px 8px 6px; font-size: 11px; text-align: left;
  background: linear-gradient(transparent, #000d); opacity: 0; transition: opacity .2s; }
.thumb-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb:hover .thumb-info, .thumb:focus-visible .thumb-info { opacity: 1; }

/* ---------- Modale ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: #05060cdd; backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-inner { display: flex; gap: 32px; align-items: center; max-width: 820px; animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal .tilt { position: relative; width: min(360px, 80vw); aspect-ratio: 63 / 88; border-radius: 4.5% / 3.3%; overflow: hidden; box-shadow: 0 30px 60px #000; }
.modal-info h2 { margin-top: 0; font-size: 28px; }
.modal-price { font: 800 34px var(--display); color: var(--gold); margin: 8px 0; }

/* ---------- Stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.kpis div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpis span { color: var(--muted); font-size: 13px; display: block; }
.kpis b { font: 800 28px var(--display); }
.chart { width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.chart .area { fill: #ffd36b1a; }
.chart circle { fill: var(--gold); }
.chart text { fill: var(--muted); font-size: 12px; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table td a:hover { color: var(--gold); }
.danger-zone { margin-top: 40px; text-align: center; }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
  .topbar nav { order: 3; width: 100%; justify-content: space-between; }
  .value-pill span { display: none; }
  .open-head { grid-template-columns: 1fr; gap: 8px; }
  .open-quota { align-items: flex-start; }
  .set-row { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .modal-inner { flex-direction: column; gap: 16px; text-align: center; }
  .scene { height: min(520px, 66vh); }
  .pack3d { height: min(440px, 54vh); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Nom du set (en français) sous le visuel du booster */
.set-tile .set-name { margin: 10px 0 6px; font-size: .92rem; font-weight: 700; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Compte ---------- */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.account-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px;
}
.account-pill:hover, .account-pill.on { border-color: var(--line2); }
.account-pill.in { padding: 4px 12px 4px 4px; }
.account-pill.warn { border-color: #e5484d88; }
.avatar {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ff8bd4); color: #1a1030; font: 800 13px var(--display);
}
.avatar.big { width: 64px; height: 64px; font-size: 28px; }
.narrow { max-width: 560px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; }
.panel h2, .panel h3 { margin: 0 0 6px; }
.account-card { display: flex; align-items: center; gap: 16px; }
.account-card p { margin: 0; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.auth-form input, .deck-name, .toolbar input[type=search] {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: 500 15px Inter;
}
.auth-form input:focus, .deck-name:focus, .toolbar input[type=search]:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.auth-form p { margin: 0; }
.auth-links { font-size: 14px; color: var(--muted); }
.auth-links a { color: var(--gold); }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.bad { color: #ff7a7f; }

/* ---------- Decks ---------- */
.game-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.game-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.game-tabs a.on { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.rules-line { font-size: 14px; }
.deck-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 28px; }
.deck-tile { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: border-color .2s, transform .2s; }
a.deck-tile:hover { border-color: var(--c); }
.deck-cover { width: 74px; flex: none; aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; background: #000; }
.deck-cover img { width: 100%; height: 100%; object-fit: cover; }
.deck-body { display: grid; align-content: start; gap: 6px; min-width: 0; }
.deck-body h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.deck-body p { margin: 0; font-size: 13px; }
.deck-body .btn { justify-self: start; margin-top: 4px; }
.badge { justify-self: start; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: #5ee6a822; color: var(--good); }
.badge.ko { background: #ffb34722; color: #ffc46b; }
.deck-tile.reco { flex-direction: column; }
.reco-cards { display: flex; height: 120px; padding-left: 26px; }
.reco-cards img { height: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 6px; margin-left: -26px; box-shadow: -4px 0 10px #0008; transition: transform .2s; }
.reco-cards img:hover { transform: translateY(-6px); }
.cdot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; box-shadow: inset 0 0 0 1px #0004; }

.deck-name { font: 800 26px var(--display); flex: 1; min-width: 220px; }
.btn.danger:hover { border-color: #e5484d; color: #ff7a7f; }
.deck-layout { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; margin-top: 10px; }
.deck-side {
  position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.deck-side h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; }
.deck-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deck-summary div { background: var(--bg2); border-radius: 10px; padding: 8px 10px; }
.deck-summary span { display: block; font-size: 12px; color: var(--muted); }
.deck-summary b { font: 800 20px var(--display); }
.deck-check { margin-top: 10px; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.deck-check.ok { background: #5ee6a81a; color: var(--good); font-weight: 600; }
.deck-check.ko { background: #ffb3471a; color: #ffd59a; }
.deck-check ul { margin: 6px 0 0; padding-left: 18px; }
.small { font-size: 13px; }
.deck-line { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.deck-line img, .basic-img { width: 28px; height: 39px; object-fit: cover; border-radius: 3px; flex: none; background: var(--bg2); display: grid; place-items: center; }
.dl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-name .cost { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 50%; background: var(--bg2); margin-right: 5px; font-weight: 700; }
.dl-n { font-weight: 700; }
.deck-line button, .basics button {
  border: 1px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 7px; cursor: pointer; font: 600 13px Inter;
}
.deck-line button { width: 24px; height: 24px; padding: 0; }
.deck-line button:hover, .basics button:hover { border-color: var(--gold); }
.deck-line.leader { background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 8px; padding: 4px 6px; }
.basics { display: flex; flex-wrap: wrap; gap: 6px; }
.basics button { padding: 5px 9px; }
.curve { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; height: 80px; align-items: end; }
.curve div { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; font-size: 11px; color: var(--muted); }
.curve i { align-self: end; display: block; background: var(--c); border-radius: 3px 3px 0 0; min-height: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.deck-pool .toolbar { margin: 0 0 12px; }
.deck-pool .seg { flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.pool-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.pool-card { position: relative; }
.pool-card .thumb { width: 100%; }
.pool-card.blocked .thumb { opacity: .45; cursor: not-allowed; }
.pool-card.in .thumb { outline: 2px solid var(--gold); outline-offset: 2px; }
.pc-own { position: absolute; top: 6px; left: 6px; background: #000c; border-radius: 999px; padding: 1px 8px; font-size: 12px; pointer-events: none; }
.pc-own b { color: var(--gold); }
.pc-info {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: #000c; color: var(--text); font: italic 700 13px Georgia, serif; cursor: pointer;
}
.more-line { text-align: center; }

@media (max-width: 720px) {
  .top-right { gap: 6px; }
  .account-pill .who { display: none; }
  .deck-layout { grid-template-columns: 1fr; }
  .deck-side { position: static; max-height: none; }
  .pool-grid { grid-template-columns: repeat(3, 1fr); }
  .deck-name { font-size: 20px; }
}

/* ---------- Pokédex / Sets / Cartes ---------- */
.kpis b small { font-size: 16px; color: var(--muted); font-weight: 600; }
.kpis .progress { display: block; margin-top: 10px; }
.toolbar select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 12px; font: 500 14px Inter; max-width: 100%;
}
.seg { flex-wrap: wrap; }
.result-count { align-self: center; font-size: 14px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.dex-entry {
  display: grid; justify-items: center; gap: 2px; padding: 10px 10px 12px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, transform .2s;
}
.dex-entry:hover { transform: translateY(-2px); border-color: var(--c); }
.dex-entry img { width: 96px; height: 96px; image-rendering: pixelated; filter: grayscale(1) brightness(.35); opacity: .7; }
.dex-entry.caught img { filter: none; opacity: 1; }
.dex-entry.caught { border-color: #ffcb0555; background: linear-gradient(180deg, #ffcb0512, var(--panel)); }
.dex-entry.nocard { opacity: .45; }
.dex-no { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dex-name { font-size: 14px; line-height: 1.2; }
.dex-count { font-size: 12px; color: var(--muted); }
.dex-entry.caught .dex-count { color: var(--gold); font-weight: 600; }
.dex-entry .progress { width: 100%; height: 4px; margin-top: 4px; }
.mon-head { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; margin: 6px 0 10px; }
.mon-head h1 { margin: 0 0 8px; color: var(--c); }
.mon-head p { margin: 0; }
.mon-art { width: 240px; height: 240px; object-fit: contain; filter: drop-shadow(0 16px 30px #0009); }
.mon-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px !important; }
.card-cell { display: grid; gap: 6px; }
.card-cell small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cards-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.serie { display: flex; align-items: baseline; gap: 10px; margin-top: 30px; }
.serie small { font-size: 14px; color: var(--muted); font-weight: 500; }
.set-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); gap: 10px; }
.set-line {
  display: grid; grid-template-columns: 110px 1fr 96px; gap: 14px; align-items: center; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s;
}
.set-line:hover { border-color: var(--c); }
.set-line.done { border-color: #5ee6a866; }
.set-logo { height: 52px; display: grid; place-items: center; overflow: hidden; }
.set-logo img { max-width: 100%; max-height: 52px; object-fit: contain; }
.set-logo.pack img { max-height: 64px; }
.set-logo.pack { height: 64px; }
.set-meta { display: grid; gap: 2px; min-width: 0; }
.set-meta b { font-size: 15px; line-height: 1.25; }
.set-meta small { font-size: 12px; }
.set-prog { display: grid; gap: 6px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.set-line.done .set-prog span:first-child { color: var(--good); font-weight: 700; }

@media (max-width: 720px) {
  .topbar nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .topbar nav a { flex: none; padding: 6px 10px; }
  .dex-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dex-entry img { width: 72px; height: 72px; }
  .mon-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .mon-art { width: 180px; height: 180px; }
  .mon-nav { justify-content: center; }
  .set-list { grid-template-columns: 1fr; }
  .set-line { grid-template-columns: 80px 1fr 84px; gap: 10px; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .toolbar select { flex: 1; }
}

/* ---------- Tuiles « logo » (One Piece, façon opecards.fr) ---------- */
.set-row.logos { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 18px; }
.logo-tile {
  gap: 8px; padding: 0 0 14px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.logo-tile:hover { border-color: var(--c); }
.logo-tile > :not(.lt-logo) { margin-inline: 14px; }
.lt-logo {
  aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 14px 18px;
  background: radial-gradient(circle at 50% 40%, #fff, #e9ecf5);
}
.lt-logo img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .3s; }
.logo-tile:hover .lt-logo img { transform: scale(1.05); }
.lt-count { margin-top: 4px; text-align: center; background: #22262f; color: #fff; border-radius: 8px; padding: 5px; font-size: 14px; font-weight: 600; }
.logo-tile h3 { margin-top: 4px; margin-bottom: 0; font-size: 16px; line-height: 1.3; }
.lt-code { color: var(--muted); font-style: italic; font-size: 13px; margin-top: -4px; }
.flag-fr {
  display: inline-block; width: 18px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 4px;
  background: linear-gradient(90deg, #002395 33.3%, #fff 33.3% 66.6%, #ed2939 66.6%);
}
.set-logo.light { background: radial-gradient(circle, #fff, #e9ecf5); border-radius: 10px; padding: 4px 8px; height: 60px; }
.set-logo.light img { max-height: 52px; }
.set-row > * { min-width: 0; }
@media (max-width: 720px) {
  .set-row.logos { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .logo-tile { padding-bottom: 10px; gap: 6px; }
  .logo-tile > :not(.lt-logo) { margin-inline: 9px; }
  .lt-logo { padding: 8px 10px; }
  .lt-count { font-size: 12px; padding: 3px; }
  .logo-tile h3 { font-size: 13px; }
  .lt-code { font-size: 11px; }
  .logo-tile .set-tile-info { font-size: 11px; }
}
.set-row.logos .more-tile { aspect-ratio: auto; }
.lt-logo { min-height: 0; overflow: hidden; }
/* Sans logo français : bande du titre du booster (nom du set + logo One Piece). */
.lt-logo.pack { padding: 0; background: #11131c; position: relative; }
.lt-logo.pack img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: 50% 74%; }
.flag-en {
  display: inline-block; width: 18px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 4px;
  background:
    linear-gradient(#c8102e, #c8102e) center / 100% 2px no-repeat,
    linear-gradient(#c8102e, #c8102e) center / 2px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 4px no-repeat,
    linear-gradient(#fff, #fff) center / 4px 100% no-repeat,
    #012169;
}

/* ---------- Cartes sport dessinées (ui.js → cardArt) ---------- */
span.sc {
  position: relative; display: block; width: 100%; height: 100%; aspect-ratio: 63 / 88; overflow: hidden;
  border-radius: inherit; container-type: inline-size; background: #111; color: #fff; text-align: left;
  font-family: Inter, system-ui, sans-serif; --frame: linear-gradient(160deg, #fdfdfd, #d9dce3);
}
span.sc > .sc-bg {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(115deg, transparent 0 7cqw, #ffffff0d 7cqw 14cqw),
    radial-gradient(120% 75% at 50% 28%, color-mix(in srgb, var(--t1) 70%, #fff 30%), var(--t1) 55%, color-mix(in srgb, var(--t1) 55%, #000) 100%);
}
span.sc > img.sc-wm {
  position: absolute; left: 10%; top: 10%; width: 80%; height: 55%; object-fit: contain;
  opacity: .16; filter: grayscale(1) brightness(3);
}
span.sc > img.sc-photo {
  position: absolute; left: 0; bottom: 21%; width: 100%; height: 70%; object-fit: cover; object-position: 50% 18%;
  filter: drop-shadow(0 2cqw 3cqw #0007);
}
span.sc > .sc-none {
  position: absolute; left: 20%; bottom: 21%; width: 60%; height: 58%; opacity: .35;
  background: radial-gradient(circle at 50% 28%, #fff 0 17%, transparent 17.5%), radial-gradient(ellipse 50% 42% at 50% 100%, #fff 0 99%, transparent 100%);
}
span.sc > .sc-top { position: absolute; top: 5cqw; right: 6cqw; display: flex; flex-direction: column-reverse; align-items: center; gap: 1.5cqw; z-index: 2; }
span.sc > .sc-top b { font: 800 12cqw/1 var(--display); text-shadow: 0 1cqw 3cqw #000a; }
span.sc > .sc-top img { width: 16cqw; height: 16cqw; object-fit: contain; filter: drop-shadow(0 1cqw 2cqw #0008); }
span.sc > .sc-foot {
  position: absolute; left: 0; right: 0; bottom: 0; height: 23%; padding: 2cqw 7cqw 4cqw; z-index: 2;
  display: grid; align-content: center; gap: 1.2cqw;
  background: linear-gradient(180deg, color-mix(in srgb, var(--t1) 65%, #000), #05060a);
  border-top: 1.2cqw solid var(--t2);
}
span.sc > .sc-foot b { font: 800 8.4cqw/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
span.sc > .sc-foot small { font-size: 5cqw; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
span.sc > .sc-rc, span.sc > .sc-serial {
  position: absolute; bottom: 25%; z-index: 2; font: 800 5.6cqw/1 var(--display); padding: 1.2cqw 2.4cqw; border-radius: 1.4cqw;
}
span.sc > .sc-rc { right: 6cqw; background: #e5484d; box-shadow: 0 1cqw 3cqw #0007; }
span.sc > .sc-serial { left: 6cqw; background: #000c; color: #ffd36b; border: .5cqw solid currentColor; }
/* Cadre : bordure intérieure aux couleurs de la rareté */
span.sc::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  padding: 3.2cqw; background: var(--frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
span.sc-young { --frame: linear-gradient(160deg, #fff, #ffd5d6, #fff); }
span.sc-silver { --frame: linear-gradient(135deg, #f5f7fa, #8d97a8, #ffffff, #aab3c2, #e9edf3); }
span.sc-blue { --frame: linear-gradient(135deg, #7fb2ff, #1252d6, #9ec5ff, #0b3aa8); }
span.sc-gold { --frame: linear-gradient(135deg, #fff1a8, #c8971e, #ffe58a, #8f6a10, #ffd75e); }
span.sc-black { --frame: linear-gradient(135deg, #2b2b2b, #000, #4a4a4a, #000); }
span.sc-black > .sc-bg { filter: brightness(.3) saturate(.5); }
span.sc-black > .sc-foot { background: #000; border-top-color: #ffd36b; }
span.sc-black > .sc-foot b { color: #ffd36b; }
/* Effet « prizm » sur les parallèles */
span.sc-silver > .sc-bg::after, span.sc-blue > .sc-bg::after, span.sc-gold > .sc-bg::after, span.sc-black > .sc-bg::after {
  content: ''; position: absolute; inset: 0; mix-blend-mode: color-dodge; opacity: .55;
  background: conic-gradient(from 30deg at 50% 40%, #ff6b6b33, #ffd93d44, #6bff9a33, #4dabff44, #c56bff33, #ff6b6b33);
}
span.sc-blue > .sc-bg::after { background: conic-gradient(from 0deg at 50% 40%, #3e8bff66, #9ec5ff33, #3e8bff66); }
span.sc-gold > .sc-bg::after { background: conic-gradient(from 0deg at 50% 40%, #ffd75e77, #fff1a833, #c8971e66, #ffd75e77); }
/* Carte sport pas encore possédée : toute la carte grisée, pas seulement la photo */
.thumb.missing span.sc { filter: grayscale(1) brightness(.45); opacity: .3; }
.thumb.missing span.sc img { filter: none; opacity: 1; }

/* ---------- Combat ---------- */
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; margin: 10px 0 22px; }
.pick {
  display: grid; gap: 4px; text-align: left; padding: 12px 14px; cursor: pointer; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font: 500 14px Inter;
}
.pick b { font-size: 15px; }
.pick small { color: var(--muted); }
.pick .record { color: var(--gold); }
.pick.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.pick:disabled { opacity: .45; cursor: not-allowed; }
.battle-go { text-align: center; margin: 10px 0; }
.battle-go .btn { font-size: 17px; padding: 14px 28px; }
.edot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #0005; vertical-align: -1px; }

/* ---------- Bouton jour / nuit ---------- */
.theme-btn {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 50%; font-size: 17px; line-height: 1;
}
.theme-btn:hover { border-color: var(--line2); }

/* ---------- Thème jour ---------- */
:root[data-theme="light"] {
  --bg: #f3f4fa;
  --bg2: #e8eaf4;
  --panel: #ffffff;
  --line: #d8dcea;
  --line2: #b5bbd6;
  --text: #161a2e;
  --muted: #5d6488;
  --gold: #b07400;
  --good: #11875a;
  --c: #b07400;
  --soft0: #0000000a; --soft: #00000010; --soft2: #00000012; --soft3: #0000001c; --soft4: #00000026;
  --topbar: #ffffffd9;
  --glow1: #b9a6ff40; --glow2: #8fd0ff38; --glow3: #ffb3d930;
  --hero: linear-gradient(90deg, #e09a00, #e0449c, #3f6fe0, #e09a00);
  color-scheme: light;
}
:root[data-theme="light"] .brand img { filter: drop-shadow(0 2px 4px #0003); }
/* textes à la couleur du jeu : plus foncés sur fond clair */
:root[data-theme="light"] :is(.game-title, .game-head h2, .see-all, .set-group h2, .open-head h1, .page-head h1, .binder-body small, .mon-head h1, .more-tile) {
  color: color-mix(in srgb, var(--c) 62%, #1a1206);
}

/* ---------- Favoris ---------- */
.fav-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: #000b; color: #ffd36b; font-size: 14px; line-height: 1; box-shadow: 0 0 0 1px #ffd36b88;
}
.fav-badge[hidden] { display: none; }
.thumb-info, .count { color: #fff; }
.thumb-set { position: absolute; left: 0; right: 0; top: 0; padding: 6px 8px 14px 34px; font-size: 10px; color: #fff; text-align: left;
  background: linear-gradient(#000c, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-actions { justify-content: flex-start; margin-top: 8px; }
.fav-btn.on { border-color: #ffd36b; color: var(--gold); background: color-mix(in srgb, #ffd36b 14%, var(--panel)); }
.refill { white-space: nowrap; }
.game-title { color: var(--c); }
/* La fenêtre de carte reste sombre, même en thème jour. */
.modal { --text: #eef0ff; --muted: #8f96bd; --panel: #171c33; --line: #262d4d; --line2: #3a4374; --gold: #ffd36b; color: var(--text); color-scheme: dark; }
.favorites .thumb.missing img { filter: grayscale(.7); opacity: .55; }

/* =====================================================================
   Refonte : fond animé, effets, 3D (fx.js) et sons (sfx.js)
   ===================================================================== */

/* ---------- Fond : aurore + étoiles (canvas) ---------- */
html, body { overflow-x: clip; }
#bg-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#fx-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }
body::before {
  content: ''; position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 32% at 18% 22%, var(--glow1), transparent 70%),
    radial-gradient(34% 30% at 82% 28%, var(--glow2), transparent 70%),
    radial-gradient(40% 34% at 50% 92%, var(--glow3), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora { 50% { transform: translate(4%, -3%) rotate(5deg) scale(1.08); } 100% { transform: translate(-3%, 4%) rotate(-4deg); } }
main, .footer { position: relative; z-index: 1; }
.footer { border-top: 0; background: linear-gradient(transparent, #0000002a); }

/* ---------- Barre du haut ---------- */
.topbar { border-bottom: 0; box-shadow: 0 12px 30px -24px #000; }
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; opacity: .55;
  background: linear-gradient(90deg, transparent, var(--gold), #ff8bd4, #8bb8ff, transparent);
}
.topbar nav a { transition: color .2s, background .2s, box-shadow .2s; }
.topbar nav a.on { background: linear-gradient(135deg, #ffd36b2a, #ff8bd42a); box-shadow: inset 0 0 0 1px #ffd36b44, 0 0 18px -6px #ff8bd4; }
.theme-btn { transition: transform .2s, border-color .2s; }
.theme-btn:hover { transform: rotate(-12deg) scale(1.08); }
.theme-btn.off { opacity: .55; }
.value-pill { transition: box-shadow .3s; }
.value-pill:hover { box-shadow: 0 0 22px -4px #ffd36b88; }

/* ---------- Entrée des pages et apparition au défilement ---------- */
/* « backwards » : aucune transformation ne reste après l'animation (sinon les éléments fixed seraient pris dans la page). */
#app > section { animation: page-in .55s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes page-in { from { opacity: 0; translate: 0 18px; } }
.rv:not(.rv-in) { opacity: 0; }
.rv-in { animation: rv-in .6s cubic-bezier(.2, .8, .2, 1) var(--rv-d, 0ms) backwards; }
@keyframes rv-in { from { opacity: 0; translate: 0 26px; scale: .97; } }

/* ---------- Boutons ---------- */
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { position: relative; overflow: hidden; isolation: isolate; }
.btn.primary::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, #ffffff90 50%, transparent 70%);
  translate: -120% 0; transition: translate .7s ease;
}
.btn.primary:hover::after { translate: 120% 0; }
.btn.primary:hover { box-shadow: 0 14px 40px -10px var(--c), 0 0 0 1px #ffffff30 inset; }
.btn.big { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
[data-open].btn { animation: cta 2.2s ease-in-out infinite; }
@keyframes cta { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 22%, transparent), 0 12px 40px -8px var(--c); } }

/* ---------- Accueil : titre, statistiques et carrousel 3D ---------- */
.hero { padding-top: 48px; }
.hero em { background-size: 300% auto; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: 300% 0; } }
.hero-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: center; margin-top: 10px; }
.hero-side { display: grid; gap: 20px; }
.hero-stats { margin-top: 0; }
.hero-stats div {
  position: relative; overflow: hidden; flex: 1; min-width: 160px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 85%, #fff 6%), var(--panel));
  box-shadow: 0 18px 40px -26px #000;
}
.hero-stats div::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--hero); opacity: .7; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta .btn.primary { --c: #ffd36b; }

.showcase {
  position: relative; height: 360px; perspective: 1100px; display: grid; place-items: center; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.sc3d-stage {
  --R: 270px; transform-style: preserve-3d;
  transform: translateY(-14px) rotateX(calc(-9deg + var(--rx, 0deg) * .6)) rotateY(calc(var(--ry, 0deg) * 1.4));
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}
.ring { position: relative; width: 140px; aspect-ratio: 63 / 88; transform-style: preserve-3d; animation: ring-spin 40s linear infinite; }
.showcase:hover .ring { animation-play-state: paused; }
@keyframes ring-spin { from { transform: rotateY(0deg); } to { transform: rotateY(-360deg); } }
.sc3d { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(var(--R)); }
.sc3d-front, .sc3d-back {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 4.5% / 3.3%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 22px 40px -14px #000d;
}
.sc3d-front { object-fit: cover; transition: filter .3s, transform .3s; }
.sc3d-back { transform: rotateY(180deg); background: #1a1f3a center / cover; filter: brightness(.75); }
.sc3d:hover .sc3d-front { filter: brightness(1.15) drop-shadow(0 0 16px #ffd36b); transform: translateZ(20px); }
.showcase-floor {
  position: absolute; bottom: 26px; left: 50%; width: 76%; height: 70px; translate: -50% 0; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--gold) 30%, transparent), transparent);
}
@media (max-width: 900px) {
  .hero-main { grid-template-columns: 1fr; }
  .showcase { height: 280px; }
  .sc3d-stage { --R: 190px; }
  .ring { width: 104px; }
}

/* ---------- Sections des jeux ---------- */
.game-head { position: relative; border-bottom: 0; }
.game-head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 25%, transparent) 45%, transparent);
}
.game-head h2 { text-shadow: 0 0 26px color-mix(in srgb, var(--c) 45%, transparent); }

/* ---------- Inclinaison 3D au survol (fx.js pose --rx/--ry/--mx/--my) ---------- */
:is(.set-tile, .binder, .deck-tile, .thumb).tilting {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
  transition: transform .08s linear, border-color .2s, box-shadow .3s; z-index: 2;
}
:is(.binder, .deck-tile).tilting { transform: perspective(900px) rotateX(calc(var(--rx) * .4)) rotateY(calc(var(--ry) * .4)) translateY(-3px); }
.binder, .deck-tile { transition: transform .45s cubic-bezier(.2, .8, .2, 1), border-color .2s; }
.thumb.tilting { transform: perspective(700px) rotateX(var(--rx)) rotateY(var(--ry)) scale(1.06); box-shadow: 0 24px 40px -14px #000d; }
.thumb::after {
  content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  mix-blend-mode: soft-light;
  background: radial-gradient(farthest-corner circle at var(--mx, 50%) var(--my, 50%), #ffffffdd 0%, #ffffff30 28%, transparent 55%);
}
.thumb.tilting::after { opacity: .9; }
.thumb.missing::after { display: none; }
.thumb .count, .thumb .thumb-info, .thumb .fav-badge, .thumb .thumb-set { z-index: 2; }
.logo-tile.tilting { box-shadow: 0 24px 40px -20px #000c, 0 0 0 1px var(--c); }

/* ---------- Fenêtre d'une carte ---------- */
.modal:not([hidden]) { animation: fade .3s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-inner { animation: modal-in .55s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes modal-in { from { opacity: 0; transform: perspective(900px) rotateY(-28deg) translateY(30px) scale(.85); } }

/* ---------- Effets plein écran ---------- */
.fx-flash {
  position: fixed; inset: 0; z-index: 79; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle at 50% 45%, #fff, var(--fc) 35%, transparent 80%);
  animation: fx-flash var(--fd) ease-out forwards;
}
@keyframes fx-flash { from { opacity: var(--fo); } to { opacity: 0; } }
.fx-ring {
  position: fixed; z-index: 79; pointer-events: none; width: var(--fs); height: var(--fs);
  margin: calc(var(--fs) / -2) 0 0 calc(var(--fs) / -2); border-radius: 50%;
  border: 3px solid var(--fc); box-shadow: 0 0 30px var(--fc), inset 0 0 30px var(--fc);
  animation: fx-ring var(--fd) cubic-bezier(.1, .7, .3, 1) forwards;
}
@keyframes fx-ring { from { transform: scale(.1); opacity: 1; } to { transform: scale(1); opacity: 0; } }

/* ---------- Ouverture : rayons, aura, lumière qui jaillit ---------- */
.scene .rays, .scene .aura { position: absolute; left: 50%; top: 46%; translate: -50% -50%; pointer-events: none; z-index: 0; }
.scene .rays {
  width: 980px; height: 980px; border-radius: 50%; opacity: .3; transition: opacity .8s;
  background: repeating-conic-gradient(color-mix(in srgb, var(--beam, var(--c)) 35%, transparent) 0 5deg, transparent 5deg 16deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 12%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 12%, transparent 72%);
  animation: spin 50s linear infinite;
}
.scene .aura {
  width: 560px; height: 560px; border-radius: 50%; opacity: .45; transition: opacity .8s;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--beam, var(--c)) 45%, transparent), transparent);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes spin { to { rotate: 360deg; } }
@keyframes breathe { 50% { scale: 1.12; } }
.scene.torn .rays { opacity: .9; animation-duration: 14s; }
.scene.torn .aura { opacity: .95; }
.scene.beam-5 .rays {
  background: repeating-conic-gradient(#ff6b8b66 0 5deg, transparent 5deg 12deg, #ffd36b66 12deg 17deg, transparent 17deg 24deg,
    #7dffb066 24deg 29deg, transparent 29deg 36deg, #6bc8ff66 36deg 41deg, transparent 41deg 48deg);
}

/* Arrivée du booster : il tombe en tournoyant puis flotte. */
.pack3d-wrap { animation: pack-in 1s cubic-bezier(.2, .9, .25, 1.12) backwards, float 4.5s 1s ease-in-out infinite; }
@keyframes pack-in { from { opacity: 0; transform: translateY(-90px) rotateY(-540deg) scale(.4); } 55% { opacity: 1; } }
.scene.opening.beam-4 .pack3d, .scene.opening.beam-5 .pack3d { animation: pack-wiggle-big .38s ease-in-out; }
@keyframes pack-wiggle-big { 20% { transform: rotateZ(-4deg) scale(1.04); } 50% { transform: rotateZ(4deg) scale(1.05); } 80% { transform: rotateZ(-3deg) scale(1.04); } }
.p-light { position: absolute; left: 0; right: 0; top: 13%; height: 0; pointer-events: none; transform: translateZ(-2px); }
.p-light::before { /* lueur dans l'ouverture */
  content: ''; position: absolute; left: 0; right: 0; top: -40px; height: 80px; opacity: 0;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #fff 0%, color-mix(in srgb, var(--beam, #fff) 70%, transparent) 35%, transparent 75%);
}
/* Faisceau : dégradé radial dans toutes les directions, sa base est cachée derrière le booster. */
.p-light i {
  position: absolute; left: -35%; right: -35%; bottom: -30px; height: 720px; transform-origin: 50% 100%; transform: scaleY(0); opacity: 0;
  background:
    radial-gradient(ellipse 16% 100% at 50% 100%, #ffffffee 0%, #ffffff55 40%, transparent 80%),
    radial-gradient(ellipse 42% 100% at 50% 100%, color-mix(in srgb, var(--beam, #fff) 80%, transparent) 0%, color-mix(in srgb, var(--beam, #fff) 30%, transparent) 40%, transparent 75%);
}
.scene.beam-5 .p-light i {
  background:
    radial-gradient(ellipse 16% 100% at 50% 100%, #ffffffee 0%, #ffffff55 40%, transparent 80%),
    linear-gradient(90deg, #ff6b8b, #ffd36b, #7dffb0, #6bc8ff, #b98bff);
  -webkit-mask-image: radial-gradient(ellipse 42% 100% at 50% 100%, #000 5%, #0008 40%, transparent 75%);
  mask-image: radial-gradient(ellipse 42% 100% at 50% 100%, #000 5%, #0008 40%, transparent 75%);
}
.scene.torn .p-light::before { animation: lip .5s ease-out forwards; }
.scene.torn .p-light i { animation: beam-up 1s cubic-bezier(.2, .8, .3, 1) forwards, beam-flicker .18s 1s steps(2) infinite alternate; }
@keyframes beam-flicker { to { opacity: .65; } }
@keyframes lip { to { opacity: 1; } }
@keyframes beam-up { 0% { transform: scaleY(0) scaleX(.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: scaleY(1) scaleX(1); opacity: .85; } }

/* ---------- Paquet de cartes : rayons derrière la carte, carte qui suit la souris ---------- */
.stack { width: min(250px, 34vh, 60vw); }
.stack-rays {
  position: absolute; left: 50%; top: 50%; width: 320%; aspect-ratio: 1; translate: -50% -50%; z-index: 0; opacity: 0;
  border-radius: 50%; transition: opacity .5s; --rc: #ffffff33;
  background: repeating-conic-gradient(var(--rc) 0 5deg, transparent 5deg 15deg), radial-gradient(closest-side, var(--rc), transparent 65%);
  -webkit-mask-image: radial-gradient(closest-side, #000 22%, transparent 72%);
  mask-image: radial-gradient(closest-side, #000 22%, transparent 72%);
  animation: spin 20s linear infinite;
}
.stack[data-glow="2"] .stack-rays { --rc: #8bb8ff40; opacity: .6; }
.stack[data-glow="3"] .stack-rays, .stack[data-charge="3"] .stack-rays { --rc: #c58bff66; opacity: .9; }
.stack[data-glow="4"] .stack-rays, .stack[data-charge="4"] .stack-rays { --rc: #ffd36b77; opacity: 1; }
.stack[data-glow="5"] .stack-rays, .stack[data-charge="5"] .stack-rays {
  opacity: 1; animation-duration: 9s;
  background: repeating-conic-gradient(#ff6b8b77 0 5deg, transparent 5deg 12deg, #ffd36b77 12deg 17deg, transparent 17deg 24deg,
    #7dffb077 24deg 29deg, transparent 29deg 36deg, #6bc8ff77 36deg 41deg, transparent 41deg 48deg);
}
.stack[data-charge] .stack-rays { animation-duration: 3s; }
.scard.flipped .scard-inner { transform: rotateX(0deg) rotateY(180deg) scale(1.1); }
.scard.flipped.live .scard-inner { transform: rotateX(var(--tx, 0deg)) rotateY(calc(180deg + var(--ty, 0deg))) scale(1.1); transition: transform .12s ease-out; }
.scard.flipped .face.front { box-shadow: 0 30px 60px -20px #000, 0 0 0 1px #ffffff22; }
.scard.flipped.tier-3 .face.front { box-shadow: 0 0 0 2px #c58bff, 0 0 40px #c58bffaa, 0 30px 60px -20px #000; }
.scard.flipped.tier-4 .face.front { box-shadow: 0 0 0 2px var(--gold), 0 0 60px #ffd36bbb, 0 30px 60px -20px #000; }
.scard-label { backdrop-filter: blur(8px); background: color-mix(in srgb, var(--panel) 80%, transparent); box-shadow: 0 14px 30px -14px #000; }
.scard-label.tier-3 { box-shadow: 0 0 24px -4px #c58bff; }
.scard-label.tier-4 { box-shadow: 0 0 30px -4px #ffd36b; }
.scard-label.tier-5 { box-shadow: 0 0 34px -2px #ff8bd4; border-color: #ff8bd4; }
.scard-label.tier-5 b { background: var(--hero); background-size: 300% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 3s linear infinite; }

/* ---------- Récapitulatif ---------- */
.flip { position: relative; }
.flip-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.flip-tags .new { margin: 0; }
.best-tag {
  white-space: nowrap; padding: 2px 10px; border-radius: 99px; font: 800 10px Inter; text-transform: uppercase; letter-spacing: .06em; color: #1a1030;
  background: linear-gradient(90deg, #ffd36b, #ff8bd4); box-shadow: 0 4px 16px -2px #ff8bd4aa;
}
.flip.best .face.front { outline: 2px solid #ffffff55; outline-offset: 3px; }
.summary div { position: relative; }
.summary small { font-weight: 700; }
.count-up.done { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); color: var(--gold); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* ---------- Thème jour ---------- */
:root[data-theme="light"] .scene .rays { opacity: .18; }
:root[data-theme="light"] .scene.torn .rays { opacity: .5; }
:root[data-theme="light"] .topbar nav a.on { background: linear-gradient(135deg, #e09a0018, #e0449c18); box-shadow: inset 0 0 0 1px #e09a0040; }

/* ---------- Ouverture : encore plus de spectacle ---------- */
/* Les cartes jaillissent du booster en éventail, puis retombent en paquet. */
.scene.emerge .stack { animation: none; transform: translate(-50%, -50%); }
.scene.emerge:not(.ready) .scard { animation: fan-out .95s cubic-bezier(.2, .75, .25, 1) backwards; animation-delay: calc(var(--i) * 30ms); }
@keyframes fan-out {
  0% { transform: translateY(40%) scale(.55); opacity: 0; }
  12% { opacity: 1; }
  45% { transform: translate(calc((var(--i) - var(--n) / 2) * 34px), -78%) rotate(calc((var(--i) - var(--n) / 2) * 9deg)) scale(.82); }
  100% { transform: translate(calc(var(--i) * .7px), calc(var(--i) * 1.4px)); }
}
/* Grosse carte : l'écran s'assombrit et la caméra s'approche pendant la charge. */
.open { position: relative; }
.open::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle at 50% 45%, transparent 18%, #000000d0 70%);
}
.open.focus::before { opacity: 1; }
.open .stage { position: relative; z-index: 1; }
.scene { transition: scale .9s cubic-bezier(.2, .8, .2, 1); }
.open.focus .scene { scale: 1.07; }
/* Carte or / arc-en-ciel : révélée en tournoyant. */
.scard.flipped.spin .scard-inner { animation: spin-reveal 1.15s cubic-bezier(.15, .75, .2, 1); }
@keyframes spin-reveal {
  from { transform: rotateX(0deg) rotateY(-360deg) scale(.9); }
  55% { transform: rotateX(0deg) rotateY(140deg) scale(1.28); }
  to { transform: rotateX(0deg) rotateY(180deg) scale(1.1); }
}
/* Éclat horizontal (lens flare) */
.fx-flare {
  position: fixed; z-index: 79; pointer-events: none; width: 140vw; height: 6px; left: -20vw; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #fff, var(--fc) 30%, transparent 70%); mix-blend-mode: screen;
  animation: fx-flare var(--fd) ease-out forwards;
}
.fx-flare::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, #fff 0, var(--fc) 18%, transparent 60%);
}
@keyframes fx-flare { 0% { transform: scaleX(.1); opacity: 0; } 15% { opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

/* =====================================================================
   Combat façon Rubis Oméga / Saphir Alpha (battle/battle.js)
   ===================================================================== */
.page.battle.rosa { max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; padding-top: 14px; }
.bwrap { display: grid; gap: 10px; width: 100%; max-width: 980px; margin: 0 auto; }
.bpreview { position: sticky; top: 76px; display: grid; gap: 8px; }
.bpreview img { width: 100%; border-radius: 12px; box-shadow: 0 12px 30px #000a; }
.bpreview p { margin: 0; font-size: 13px; color: var(--muted); }
.bpreview .atk-text { color: var(--text); }
.edot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #0005; vertical-align: -1px; }
.energy-card { display: grid; place-items: center; width: 100%; height: 100%; border-radius: inherit; font: 800 11px Inter; color: #fff; text-shadow: 0 1px 2px #000;
  background: radial-gradient(circle at 50% 42%, var(--t) 0 34%, color-mix(in srgb, var(--t) 40%, #111) 35%); }

/* ---------- Terrain (écran du haut) ---------- */
.arena {
  position: relative; height: clamp(360px, 62vh, 600px); border-radius: 18px; overflow: hidden; isolation: isolate; user-select: none;
  box-shadow: 0 30px 60px -30px #000, 0 0 0 1px #ffffff1a; color: #1a1f33;
  --sky1: #4fa8ff; --sky2: #d4f0ff; --far1: #5aa86a; --far2: #2f7048; --g1: #86d35f; --g2: #3d8a2c; --pad1: #b0e889; --pad2: #62ad44; --rim: #3f8a2e;
  animation: arena-in 1.1s cubic-bezier(.6, 0, .2, 1) backwards;
}
@keyframes arena-in { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(80% at 50% 50%); } }
.t-forest { --sky1: #3f8f6b; --sky2: #c4ecd0; --far1: #2f6b45; --far2: #1d4a30; --g1: #63b24c; --g2: #2c6b28; --pad1: #94d46c; --pad2: #4a9636; --rim: #2c6b28; }
.t-beach { --sky1: #2f9cff; --sky2: #dcf5ff; --far1: #2b8fd6; --far2: #1a6fb0; --g1: #f7e2ab; --g2: #d6ae62; --pad1: #fff3cc; --pad2: #e8c681; --rim: #c49a52; }
.t-volcano { --sky1: #4a1414; --sky2: #ff8a4d; --far1: #3a1a14; --far2: #24100c; --g1: #74402d; --g2: #2e1712; --pad1: #ab603f; --pad2: #6b2f1d; --rim: #ff6a2a; }
.t-night { --sky1: #0f0b2e; --sky2: #4b3a8f; --far1: #2a2160; --far2: #160f3a; --g1: #4f4c80; --g2: #1d1a3d; --pad1: #8475cf; --pad2: #3d3480; --rim: #b49cff; }
.t-cave { --sky1: #1e1915; --sky2: #5e4f41; --far1: #4a3d33; --far2: #2a221c; --g1: #8f7a63; --g2: #463a2e; --pad1: #b8a081; --pad2: #7a6450; --rim: #5a4a3a; }
.t-sky { --sky1: #ff9f3f; --sky2: #ffeab8; --far1: #cf8f50; --far2: #8a5a2b; --g1: #ead38f; --g2: #a88a4a; --pad1: #fff2b8; --pad2: #d9b860; --rim: #a8843a; }
.sky { position: absolute; inset: 0 0 42% 0; background: linear-gradient(var(--sky1), var(--sky2)); }
.t-night .sky::after, .t-volcano .sky::after {
  content: ''; position: absolute; inset: 0; opacity: .8;
  background: radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px) 0 0 / 70px 50px, radial-gradient(circle at 60% 70%, #fff 0 1px, transparent 2px) 0 0 / 110px 80px;
}
.t-volcano .sky::after { opacity: .5; background: radial-gradient(circle at 30% 60%, #ffb347 0 1px, transparent 2px) 0 0 / 60px 70px; animation: embers 6s linear infinite; }
@keyframes embers { to { background-position: 0 -140px; } }
.cloud {
  position: absolute; width: 150px; height: 40px; border-radius: 40px; background: #ffffffd0; left: -200px;
  box-shadow: 40px -16px 0 6px #ffffffd0, 84px -2px 0 0 #ffffffb8; animation: cloud 70s linear infinite;
}
.c1 { top: 8%; } .c2 { top: 20%; scale: .7; animation-duration: 95s; animation-delay: -40s; } .c3 { top: 4%; scale: .5; animation-duration: 130s; animation-delay: -90s; }
@keyframes cloud { to { translate: 1400px 0; } }
.t-night .cloud, .t-cave .cloud, .t-volcano .cloud { display: none; }
.far {
  position: absolute; left: -6%; right: -6%; top: 34%; height: 22%;
  background:
    radial-gradient(60% 100% at 18% 100%, var(--far1) 60%, transparent 61%),
    radial-gradient(48% 90% at 62% 100%, var(--far2) 60%, transparent 61%),
    radial-gradient(40% 75% at 96% 100%, var(--far1) 60%, transparent 61%);
}
.t-beach .far { background: linear-gradient(transparent 52%, #3aa0e8 52%, #7fd0ff 100%); }
.t-cave .far { top: 0; height: 60%; background: radial-gradient(120% 90% at 50% 0%, transparent 40%, #00000080 75%), repeating-linear-gradient(95deg, #00000018 0 40px, transparent 40px 90px); }
.world { position: absolute; inset: 0; transform-origin: 55% 60%; transition: transform .75s cubic-bezier(.2, .8, .2, 1); animation: sway 11s ease-in-out infinite; }
@keyframes sway { 50% { translate: -1.2% .4%; rotate: .35deg; } }
.ground { position: absolute; left: -15%; right: -15%; top: 52%; bottom: -15%; background: radial-gradient(120% 90% at 50% 0%, var(--g1), var(--g2)); box-shadow: 0 -10px 24px -8px #0003; }
.ground::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, #ffffff0a 0 3%, transparent 3% 7%); }
.pad {
  position: absolute; border-radius: 50%; translate: -50% -50%;
  background: radial-gradient(closest-side, var(--pad1) 0 60%, var(--pad2) 62% 85%, var(--rim) 87% 100%);
  box-shadow: 0 10px 20px -8px #0007, inset 0 5px 10px #ffffff30;
}
.t-volcano .pad, .t-night .pad { box-shadow: 0 10px 20px -8px #0007, 0 0 30px -6px var(--rim); }
.pad.foe { left: 70%; top: 53%; width: 34%; height: 11%; }
.pad.me { left: 27%; top: 86%; width: 54%; height: 17%; }

/* Cartes debout sur les plateformes */
.fighter { position: absolute; aspect-ratio: 63 / 88; translate: -50% 0; transform-origin: 50% 100%; cursor: pointer; z-index: 2; }
.fighter.foe { left: 70%; bottom: 46%; height: 35%; }
.fighter.me { left: 27%; bottom: 14%; height: 50%; z-index: 3; }
.bcard {
  position: relative; width: 100%; height: 100%; border-radius: 5% / 3.6%; overflow: hidden; transform-origin: 50% 100%;
  box-shadow: 0 16px 26px -10px #000b, 0 0 0 2px #ffffff55;
  transform: perspective(700px) rotateY(var(--fy, 0deg)) rotateX(5deg); animation: idle 3.4s ease-in-out infinite;
}
.fighter.foe .bcard { --fy: -16deg; }
.fighter.me .bcard { --fy: 17deg; animation-delay: -1.7s; }
@keyframes idle { 50% { translate: 0 -2.5%; } }
.bcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bshine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; background: linear-gradient(115deg, transparent 35%, #ffffff70 50%, transparent 65%); background-size: 250% 100%; animation: shine-sweep 5s linear infinite; }
@keyframes shine-sweep { from { background-position: 150% 0; } to { background-position: -150% 0; } }
.fshadow { position: absolute; left: 50%; bottom: -7%; width: 120%; height: 16%; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, #000a, transparent); }
.fighter.target .bcard { box-shadow: 0 0 0 4px #ffd36b, 0 0 34px #ffd36b; }
.fighter.target::after {
  content: ''; position: absolute; left: 50%; top: -24px; translate: -50% 0; border: 10px solid transparent; border-top: 13px solid #ffd36b;
  filter: drop-shadow(0 2px 3px #000a); animation: bob .6s infinite alternate;
}
/* États spéciaux : la carte est tournée comme sur une vraie table */
.fighter.st-sleep .bcard { rotate: -90deg; scale: .74; }
.fighter.st-paralysis .bcard { rotate: 90deg; scale: .74; }
.fighter.st-confusion .bcard { rotate: 180deg; }
.fighter.st-poison .bcard::after, .fighter.st-burn .bcard::after { content: ''; position: absolute; inset: 0; mix-blend-mode: color; animation: st-pulse 1.2s ease-in-out infinite alternate; }
.fighter.st-poison .bcard::after { background: #9b4dff; }
.fighter.st-burn .bcard::after { background: #ff5a1a; }
@keyframes st-pulse { from { opacity: .1; } to { opacity: .45; } }
/* Animations */
.fighter.sendout { animation: sendout .75s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes sendout { 0% { scale: 0; opacity: 0; filter: brightness(8) saturate(0); } 45% { opacity: 1; filter: brightness(5) saturate(0); } 100% { scale: 1; filter: none; } }
.fighter.evolve .bcard { animation: evolve 1.2s ease-in-out; }
@keyframes evolve { 0%, 100% { filter: none; } 15%, 75% { filter: brightness(9) saturate(0); } 25%, 45%, 65% { scale: 1.12; } 35%, 55% { scale: .92; } }
.fighter.me.lunge .bcard { animation: lunge-me .5s ease-in-out; }
.fighter.foe.lunge .bcard { animation: lunge-foe .5s ease-in-out; }
@keyframes lunge-me { 40% { translate: 22% -16%; scale: 1.06; } }
@keyframes lunge-foe { 40% { translate: -22% 14%; scale: 1.08; } }
.fighter.hit .bcard, .mini.hit { animation: hit-blink .65s; }
@keyframes hit-blink {
  0%, 30%, 60%, 100% { opacity: 1; translate: 0; filter: none; }
  15%, 45%, 75% { opacity: .2; translate: -5% 0; filter: brightness(3); }
  22%, 52% { translate: 5% 0; }
}
.fighter.faint { animation: faint 1s ease-in forwards; }
@keyframes faint { 30% { filter: grayscale(1) brightness(1.6); } to { translate: -50% 35%; opacity: 0; filter: grayscale(1) brightness(.4); } }
.mini.faint { animation: mini-faint .9s ease-in forwards; }
@keyframes mini-faint { to { translate: 0 60%; opacity: 0; filter: grayscale(1); } }
.fighter .dmg-pop { font-size: 34px; top: 25%; }
.dmg-pop {
  position: absolute; left: 50%; top: 30%; z-index: 3; pointer-events: none; translate: -50% 0;
  font: 800 22px var(--display); color: #fff; text-shadow: 0 0 10px #e5484d, 0 2px 0 #000, 0 0 2px #000;
  animation: dmg-pop 1.1s forwards;
}
@keyframes dmg-pop { from { transform: translateY(10px) scale(.5); opacity: 0; } 20% { transform: translateY(-6px) scale(1.35); opacity: 1; } to { transform: translateY(-40px); opacity: 0; } }
/* Caméra */
.arena.intro .world { transform: scale(1.7) translate(-14%, 9%); transition: none; }
.arena.cam-me .world { transform: scale(1.14) translate(9%, -7%); }
.arena.cam-foe .world { transform: scale(1.24) translate(-12%, 7%); }
.arena.quake .world { animation: quake .5s; }

/* ---------- Boîtes de PV, Banc, messages ---------- */
.hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.hud > * { pointer-events: auto; }
.side { position: absolute; display: flex; gap: 8px; }
.side.foe { left: 3%; top: 4%; flex-direction: column; align-items: flex-start; }
.side.me { right: 3%; bottom: 18%; align-items: flex-end; }
.hpbox {
  position: relative; width: 280px; padding: 7px 12px 8px; border-radius: 14px; font-size: 12px; color: #1a1f33;
  background: linear-gradient(180deg, #ffffffef, #e6ebf5ef); box-shadow: 0 10px 24px -10px #000a, inset 0 -3px 0 #0000001a;
}
.hpbox.foe { border-top-left-radius: 4px; }
.hpbox.me { border-bottom-right-radius: 4px; }
.hb-top { display: flex; align-items: center; gap: 6px; }
.hb-name { flex: 1; min-width: 0; font: 800 15px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { font: 800 10px Inter; padding: 1px 6px; border-radius: 4px; color: #fff; }
.st-poison { background: #9b4dff; } .st-burn { background: #e5484d; } .st-sleep { background: #7a8091; } .st-paralysis { background: #d9a400; } .st-confusion { background: #ff5fb0; }
.hb-prizes { display: flex; gap: 2px; }
.hb-prizes i { width: 10px; height: 10px; border-radius: 50%; background: #c9ced9; box-shadow: inset 0 0 0 1px #0002; }
.hb-prizes i.on { background: linear-gradient(#e5484d 0 44%, #222 44% 56%, #fff 56%); box-shadow: inset 0 0 0 1px #0006; }
.hb-bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.hb-bar span { font: 800 9px Inter; color: #ffb02e; background: #2a2f45; padding: 1px 4px; border-radius: 3px; }
.bar { flex: 1; height: 8px; border-radius: 6px; background: #2a2f45; overflow: hidden; box-shadow: inset 0 1px 2px #0008; }
.bar i { display: block; height: 100%; border-radius: inherit; transition: width .85s cubic-bezier(.3, .6, .3, 1); }
.hp-ok i { background: linear-gradient(#8cff9c, #27b347); }
.hp-mid i { background: linear-gradient(#ffe777, #eaa900); }
.hp-low i { background: linear-gradient(#ff958a, #e0261f); }
.hb-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; min-height: 17px; }
.hb-en { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.hb-en .edot { width: 11px; height: 11px; }
.edot.pop { animation: pop-dot .55s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop-dot { from { scale: 0; } 50% { scale: 1.9; } }
.hb-num { font: 800 14px var(--display); font-variant-numeric: tabular-nums; }
.hb-meta { font-size: 10px; color: #5a6280; margin-top: 1px; }
.benchrow { display: flex; gap: 5px; }
.arena { container-type: inline-size; }
@container (max-width: 820px) {
  .side.me { flex-direction: column; }
  .pad.foe { top: 49%; }
  .fighter.foe { bottom: 50%; height: 32%; }
}
.mini {
  position: relative; display: block; width: 42px; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 4px; overflow: hidden;
  background: #0006; cursor: pointer; box-shadow: 0 4px 10px -4px #000a, 0 0 0 1.5px #ffffff80; transition: transform .2s;
}
.mini:hover { transform: translateY(-3px) scale(1.08); }
.mini.empty { background: #ffffff22; box-shadow: inset 0 0 0 1.5px #ffffff50; cursor: default; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mbar { position: absolute; left: 2px; right: 2px; bottom: 2px; height: 4px; border-radius: 3px; background: #000b; overflow: hidden; }
.mbar i { display: block; height: 100%; transition: width .85s; }
.mbar.hp-ok i { background: #3ddc6a; } .mbar.hp-mid i { background: #f0c000; } .mbar.hp-low i { background: #ff4a3d; }
.men { position: absolute; top: 2px; right: 2px; font: 800 9px Inter; background: #000c; color: #fff; border-radius: 6px; padding: 0 4px; }
.mini.target { box-shadow: 0 0 0 3px #ffd36b, 0 0 16px #ffd36b; transform: translateY(-3px); }
.mini.enter { animation: mini-in .5s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes mini-in { from { scale: 0; opacity: 0; } }
.stadium-tag { position: absolute; top: 4%; right: 3%; padding: 4px 10px; border-radius: 99px; background: #000a; color: #fff; font: 700 12px Inter; }
.msgbox {
  position: absolute; left: 2%; right: 2%; bottom: 3%; z-index: 6; min-height: 54px; height: 13%; display: flex; align-items: center;
  padding: 8px 44px 8px 18px; border-radius: 12px; cursor: pointer; color: #fff; font: 600 16px/1.35 Inter;
  background: linear-gradient(#2d3354f4, #161a2ef4); border: 2px solid #ffffff38; box-shadow: 0 10px 30px -10px #000, inset 0 1px 0 #ffffff22;
}
.msgbox p { margin: 0; }
.msgbox i { position: absolute; right: 14px; bottom: 6px; font-style: normal; color: #ffd36b; opacity: 0; display: grid; }
.msgbox.done i { opacity: 1; animation: bob .6s infinite alternate; }
@keyframes bob { to { translate: 0 3px; } }
.overlay { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.tbanner {
  position: absolute; left: 0; right: 0; top: 38%; translate: 0 -50%; padding: 12px 0; text-align: center; color: #fff;
  background: linear-gradient(90deg, transparent, #0b0d17e0 18%, #0b0d17e0 82%, transparent); animation: tban 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
.tbanner small { display: block; color: #ffd36b; font: 700 12px Inter; letter-spacing: .2em; text-transform: uppercase; }
.tbanner b { font: 800 30px var(--display); }
.tbanner.me b { color: #7fd4ff; } .tbanner.foe b { color: #ff9a9a; }
@keyframes tban { 0% { opacity: 0; transform: scaleY(0); } 15% { opacity: 1; transform: none; } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(12%); } }
.tshow { position: absolute; left: 50%; top: 44%; height: 68%; aspect-ratio: 63 / 88; translate: -50% -50%; animation: tshow 1.1s cubic-bezier(.2, .9, .3, 1) both; }
.tshow img { width: 100%; height: 100%; border-radius: 5% / 3.6%; box-shadow: 0 0 0 3px #fff, 0 0 50px #ffffff90, 0 30px 60px #000; }
@keyframes tshow { 0% { opacity: 0; transform: perspective(800px) rotateY(-90deg) scale(.6); } 30% { opacity: 1; transform: none; } 80% { opacity: 1; transform: scale(1.03); } 100% { opacity: 0; transform: translateY(-20%) scale(.8); } }
.bover { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; color: #fff; background: radial-gradient(circle, #0b0d17a0, #0b0d17ee); animation: fade .6s; }
.bover h2 { font-size: 56px; margin: 0; }
.bover.win h2 { color: #ffd36b; text-shadow: 0 0 30px #ffd36b; }
.bover p { margin: 0; color: #c9cde6; }

/* ---------- Console (écran du bas) ---------- */
.console {
  min-height: 176px; padding: 14px; border-radius: 18px; color: #eef0ff; --muted: #8f96bd;
  background: linear-gradient(180deg, #1d2442, #12162a); border: 1px solid #ffffff14; box-shadow: 0 20px 40px -24px #000;
}
.cview { position: relative; display: grid; gap: 10px; animation: cview-in .3s ease-out; }
@keyframes cview-in { from { opacity: 0; translate: 0 8px; } }
.cfast { position: absolute; top: -2px; right: 0; padding: 4px 10px; border-radius: 99px; border: 1px solid #ffffff22; background: #ffffff0d; color: #8f96bd; font: 700 12px Inter; cursor: pointer; }
.cfast.on { color: #ffd36b; border-color: #ffd36b66; }
.cprompt { font: 700 16px Inter; padding-right: 110px; min-height: 22px; }
.cprompt small { color: #8f96bd; font-weight: 500; margin-left: 6px; }
.cprompt.wait { color: #8f96bd; padding: 30px 0; text-align: center; }
.dots3 i { font-style: normal; animation: blink3 1.2s infinite; }
.dots3 i:nth-child(2) { animation-delay: .2s; } .dots3 i:nth-child(3) { animation-delay: .4s; }
@keyframes blink3 { 50% { opacity: 0; } }
.cnote { color: #8f96bd; font-size: 13px; margin: 0; }
.cmain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px; border: 0; border-radius: 16px;
  cursor: pointer; color: #fff; font: 800 17px var(--display); text-decoration: none; text-shadow: 0 1px 2px #0006;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cb, #3a4374) 88%, #fff), var(--cb, #3a4374) 60%, color-mix(in srgb, var(--cb, #3a4374) 80%, #000));
  box-shadow: inset 0 -5px 0 #0003, inset 0 2px 0 #ffffff40, 0 8px 18px -10px var(--cb, #000); transition: transform .12s, filter .15s;
}
.cbtn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.cbtn:active { transform: translateY(1px); }
.cbtn:disabled { opacity: .45; cursor: default; transform: none; filter: none; }
.cbtn small { font: 600 11px Inter; opacity: .9; }
.cbtn .ci { font-size: 22px; line-height: 1; }
.cbtn.fight { --cb: #e5484d; } .cbtn.bag { --cb: #e39b12; } .cbtn.team { --cb: #2c9d63; } .cbtn.run { --cb: #3e7bff; }
.cbtn.back { --cb: #4a5275; flex-direction: row; font-size: 14px; padding: 9px 16px; }
.cbtn.big { grid-column: 1 / -1; padding: 16px; font-size: 24px; }
.crow { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.moves { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.move {
  display: grid; gap: 4px; padding: 10px 14px; border: 0; border-radius: 14px; text-align: left; cursor: pointer; color: #fff; text-shadow: 0 1px 2px #0009;
  background: linear-gradient(135deg, color-mix(in srgb, var(--t) 80%, #fff 20%), color-mix(in srgb, var(--t) 72%, #000));
  box-shadow: inset 0 -4px 0 #0003, inset 0 2px 0 #ffffff40, 0 8px 18px -10px var(--t); transition: transform .12s, filter .15s;
}
.move:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.move.off { filter: grayscale(.85) brightness(.55); cursor: not-allowed; }
.mv-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mv-head b { font: 800 16px var(--display); }
.mv-head em { font: 800 19px var(--display); font-style: normal; }
.mv-cost { display: flex; gap: 3px; }
.mv-text { font-size: 11px; line-height: 1.3; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.handrow { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 10px; scrollbar-width: thin; }
.console .hcard {
  position: relative; flex: none; width: 78px; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 6px; background: #000; cursor: pointer;
  opacity: .45; transition: transform .15s, opacity .15s, box-shadow .15s;
}
.console .hcard img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 6px; }
.console .hcard.playable { opacity: 1; box-shadow: 0 0 0 2px #5ee6a8aa; }
.console .hcard.playable:hover { transform: translateY(-8px) scale(1.06); }
.console .hcard.sel { opacity: 1; box-shadow: 0 0 0 3px #ffd36b; transform: translateY(-6px); }
.hlabel { position: absolute; left: 50%; bottom: -8px; translate: -50% 0; padding: 1px 7px; border-radius: 99px; background: #5ee6a8; color: #063; font: 800 9px Inter; white-space: nowrap; }
.hbadge { position: absolute; top: -8px; left: 50%; translate: -50% 0; padding: 1px 7px; border-radius: 99px; background: #ffd36b; color: #1a1030; font: 800 10px Inter; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tpick {
  display: flex; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; text-align: left; cursor: pointer; color: #fff; font: 500 13px Inter;
  border-radius: 12px; border: 1px solid #ffffff1f; background: #ffffff0a; transition: border-color .15s, background .15s;
}
.tpick:hover { border-color: #ffd36b; background: #ffd36b14; }
.tpick.foe { border-color: #e5484d66; }
.tpick img { width: 40px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4px; flex: none; }
.tpick span { display: grid; min-width: 0; }
.tpick small { color: #8f96bd; font-size: 11px; }
@media (max-width: 960px) {
  .page.battle.rosa { grid-template-columns: 1fr; }
  .bpreview { display: none; }
}
@media (max-width: 720px) {
  .arena { height: 400px; border-radius: 14px; }
  .hpbox { width: 190px; padding: 5px 8px 6px; }
  .side { gap: 5px; }
  .hb-name { font-size: 13px; }
  .hb-meta { display: none; }
  .mini { width: 30px; }
  .fighter.me { height: 44%; left: 25%; }
  .fighter.foe { height: 31%; left: 74%; }
  .pad.foe { left: 74%; }
  .msgbox { font-size: 14px; padding: 6px 34px 6px 12px; }
  .cmain { grid-template-columns: 1fr 1fr; }
  .cmain .cbtn.run { grid-column: 1 / -1; }
  .moves { grid-template-columns: 1fr; }
  .cprompt { font-size: 14px; }
  .console .hcard { width: 64px; }
}

/* ---------- Icônes (icons.js, Lucide) ---------- */
.ic { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }
.btn .ic, .cbtn .ic, .seg .ic { vertical-align: -.2em; }
.theme-btn .ic { width: 17px; height: 17px; }
.theme-btn .t-light, .theme-btn .t-dark, :root[data-theme-pref="light"] .theme-btn .t-auto, :root[data-theme-pref="dark"] .theme-btn .t-auto { display: none; }
:root[data-theme-pref="light"] .theme-btn .t-light, :root[data-theme-pref="dark"] .theme-btn .t-dark { display: block; }
.fav-badge .ic { width: 13px; height: 13px; }
.face.face-back .ic { width: 42px; height: 42px; filter: drop-shadow(0 0 14px var(--c)); }
.p-back span .ic { width: 60px; height: 60px; }
/* Flèches des liens « retour » et « voir plus » */
.back::before, .see-all::after, .accent.arrow::after {
  content: ''; display: inline-block; width: 1em; height: 1em; vertical-align: -.15em; background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat;
}
.back::before { margin-right: 6px; --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E"); }
.see-all::after, .accent.arrow::after { margin-left: 5px; --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E"); }

/* =====================================================================
   Combat : Dresseurs et attaques spectaculaires
   ===================================================================== */
.cbtn .ci .ic { width: 24px; height: 24px; }
.hb-tool { display: inline-grid; color: #5a6280; }
.hb-tool .ic { width: 13px; height: 13px; }
/* Choix du niveau : portraits des Dresseurs */
.pick-trainers { display: flex; margin-bottom: 4px; }
.mini-portrait {
  width: 40px; height: 48px; margin-right: -8px; border-radius: 10px; overflow: hidden; flex: none;
  background: linear-gradient(160deg, #ffffff22, #ffffff08); box-shadow: 0 0 0 2px var(--panel);
}
.mini-portrait svg { width: 100%; height: 100%; display: block; }

/* Le Dresseur sur sa plateforme, avant d'envoyer sa carte */
.trainer-stand {
  position: absolute; left: 70%; bottom: 46%; height: 40%; aspect-ratio: 200 / 240; translate: 60% 0; opacity: 0; z-index: 2;
  transition: translate .7s cubic-bezier(.2, .9, .3, 1), opacity .5s;
  -webkit-mask-image: linear-gradient(#000 70%, transparent 98%); mask-image: linear-gradient(#000 70%, transparent 98%);
}
.trainer-stand svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 14px #0007); }
.arena.trainer-in .trainer-stand { translate: -50% 0; opacity: 1; }
.arena.trainer-out .trainer-stand { translate: 80% 0; opacity: 0; transition-duration: .45s; }
/* Écran de face-à-face */
.vs { position: absolute; inset: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: #0b0d17; }
.vs-side { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; color: #fff; text-align: center; }
.vs-side.me { background: linear-gradient(135deg, #2f6fe0, #10204a); clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%); animation: vs-left .55s cubic-bezier(.2, .9, .3, 1) both; }
.vs-side.foe {
  margin-left: -12%; background: linear-gradient(225deg, var(--tc), color-mix(in srgb, var(--tc) 35%, #0b0d17)); clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
  animation: vs-right .55s .1s cubic-bezier(.2, .9, .3, 1) both;
}
.vs-side svg { width: min(220px, 60%); height: auto; filter: drop-shadow(0 12px 18px #0008); }
.vs-side b { font: 800 clamp(18px, 3.4vw, 30px) var(--display); text-shadow: 0 3px 0 #0006; }
.vs-side small { color: #ffffffb0; font: 700 12px Inter; letter-spacing: .14em; text-transform: uppercase; }
.vs-side::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, #ffffff10 0 2px, transparent 2px 22px); animation: vs-lines 1.2s linear infinite; }
.vs-mark {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; font: 800 clamp(48px, 9vw, 96px) var(--display); color: #ffd36b;
  -webkit-text-stroke: 3px #1b1530; text-shadow: 0 6px 0 #1b1530, 0 0 40px #ffd36b; animation: vs-mark .5s .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
.vs.out { animation: vs-out .45s ease-in forwards; }
@keyframes vs-left { from { translate: -100% 0; } }
@keyframes vs-right { from { translate: 100% 0; } }
@keyframes vs-lines { to { background-position: 44px 0; } }
@keyframes vs-mark { from { scale: 4; opacity: 0; } }
@keyframes vs-out { to { opacity: 0; scale: 1.15; } }
/* Bulle du Dresseur */
.tspeech {
  position: absolute; right: 3%; top: 4%; z-index: 9; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 99px;
  background: #ffffffee; color: #1a1f33; font: 800 14px var(--display); box-shadow: 0 10px 24px -10px #000a; animation: tspeech .4s cubic-bezier(.2, .9, .3, 1.3);
}
.tspeech .tp { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--rim) 40%, #fff); flex: none; }
.tspeech .tp svg { width: 100%; height: 100%; display: block; scale: 1.35; translate: 0 12%; }
.tspeech.out { animation: tspeech .3s reverse forwards; }
@keyframes tspeech { from { opacity: 0; translate: 30px 0; scale: .8; } }
/* Fin de partie : le Dresseur et sa réplique */
.bover-portrait { width: 130px; margin: 0 auto -6px; filter: drop-shadow(0 10px 20px #000a); animation: mini-in .6s cubic-bezier(.2, .9, .3, 1.3); }
.bover-portrait svg { width: 100%; height: auto; display: block; }
.bover blockquote { margin: 6px auto 0; max-width: 420px; padding: 8px 14px; border-radius: 12px; background: #ffffff14; color: #eef0ff; font-size: 14px; }
.bover blockquote b { color: #ffd36b; margin-right: 4px; }
.bover h2 .ic { width: .8em; height: .8em; }

/* Carte ex / V / VMAX : aura permanente */
.fighter.ex .bcard { box-shadow: 0 16px 26px -10px #000b, 0 0 0 2px #ffffffaa, 0 0 26px 4px #ffd36baa; }
.fighter.ex::before {
  content: ''; position: absolute; inset: -12% -16%; z-index: -1; border-radius: 40%; pointer-events: none;
  background: conic-gradient(from 0deg, #ff6b8b55, #ffd36b77, #7dffb055, #6bc8ff77, #b98bff55, #ff6b8b55); filter: blur(14px);
  animation: spin 4s linear infinite;
}

/* Caméra : coupe franche, assombrissement, distorsion Psy, bandes cinéma */
.arena.cut .world { transition: none; }
.arena.dim .world { filter: brightness(.45) saturate(.7); transition: filter .2s; }
.arena.warp .world { animation: warp 1s ease-in-out; }
@keyframes warp { 30% { filter: hue-rotate(80deg) saturate(1.6); scale: 1.03; } 60% { filter: hue-rotate(-60deg) saturate(1.4); scale: .99; } }
.arena::before, .arena::after {
  content: ''; position: absolute; left: 0; right: 0; height: 0; z-index: 15; background: #000; transition: height .35s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
}
.arena::before { top: 0; } .arena::after { bottom: 0; }
.arena.cinema::before, .arena.cinema::after { height: 11%; }

/* Plan rapproché d'une attaque surpuissante */
.cutin { position: absolute; inset: 0; z-index: 14; overflow: hidden; animation: fade .2s; }
.ci-lines {
  position: absolute; inset: -50%; animation: spin 2.5s linear infinite;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 80%, #fff) 0 2deg, transparent 2deg 9deg), radial-gradient(circle, transparent 18%, #000c 70%);
}
.ci-band {
  position: absolute; left: -5%; right: -5%; top: 50%; height: 46%; translate: 0 -50%; rotate: -6deg; display: flex; align-items: center; gap: 4%; padding: 0 10%;
  background: linear-gradient(90deg, #0b0d17ee, color-mix(in srgb, var(--tc) 70%, #0b0d17) 60%, #0b0d17ee); box-shadow: 0 0 0 4px #fff, 0 0 40px var(--tc);
  animation: ci-band 1.4s cubic-bezier(.2, .9, .3, 1) both;
}
.ci-band img { height: 118%; aspect-ratio: 63 / 88; border-radius: 4%; box-shadow: 0 0 0 3px #fff, 0 20px 40px #000; animation: ci-card 1.4s cubic-bezier(.15, .9, .3, 1) both; }
.ci-band b {
  font: 800 clamp(26px, 5.5vw, 58px)/1 var(--display); color: #fff; text-transform: uppercase; letter-spacing: .02em;
  -webkit-text-stroke: 2px #1b1530; text-shadow: 0 5px 0 #1b1530, 0 0 30px var(--tc); animation: ci-name 1.4s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes ci-band { from { scale: 1 0; } 12% { scale: 1 1; } 88% { scale: 1 1; opacity: 1; } to { scale: 1.1 0; opacity: 0; } }
@keyframes ci-card { from { translate: -120% 0; } 25%, 80% { translate: 0 0; } to { translate: 40% 0; } }
@keyframes ci-name { from { translate: 60% 0; opacity: 0; } 30%, 85% { translate: 0 0; opacity: 1; } to { translate: -20% 0; opacity: 0; } }

/* Effets posés sur le terrain */
.fx-beam {
  position: absolute; height: var(--w); margin-top: calc(var(--w) / -2); transform-origin: 0 50%; z-index: 4; pointer-events: none; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--bc) 15%, #fff 50%, var(--bc) 85%, transparent);
  box-shadow: 0 0 20px var(--bc), 0 0 40px var(--bc); mix-blend-mode: screen; animation: fx-beam var(--d, .75s) ease-out forwards;
}
@keyframes fx-beam { 0% { scale: 0 .4; opacity: 1; } 35% { scale: 1 1; } 70% { scale: 1 1.25; opacity: 1; } 100% { scale: 1 0; opacity: 0; } }
.fx-slash {
  position: absolute; width: 260px; height: 6px; margin: -3px 0 0 -130px; z-index: 4; pointer-events: none; border-radius: 99px;
  background: linear-gradient(90deg, transparent, #fff 40%, var(--bc), transparent); box-shadow: 0 0 18px var(--bc), 0 0 6px #fff;
  animation: fx-slash .65s cubic-bezier(.2, .9, .3, 1) forwards;
}
@keyframes fx-slash { 0% { scale: 0 1; opacity: 1; } 40% { scale: 1 1.3; } 100% { scale: 1.1 .2; opacity: 0; } }
.fx-flame {
  position: absolute; width: 170px; margin-left: -85px; translate: 0 -100%; transform-origin: 50% 100%; z-index: 4; pointer-events: none; border-radius: 50% 50% 30% 30%;
  background: radial-gradient(ellipse 50% 70% at 50% 100%, #fff 0%, #ffe08a 18%, #ff8c2a 45%, #ff3d1a 65%, transparent 75%);
  filter: blur(3px); mix-blend-mode: screen; animation: fx-flame 1.4s ease-out forwards;
}
@keyframes fx-flame { 0% { scale: .3 0; opacity: 0; } 20% { scale: 1 1.1; opacity: 1; } 40% { scale: .9 .95; } 60% { scale: 1.05 1.05; opacity: 1; } 100% { scale: .8 1.3; opacity: 0; } }
.fx-pow {
  position: absolute; width: 170px; height: 150px; margin: -75px 0 0 -85px; z-index: 6; pointer-events: none; display: grid; place-items: center;
  background: #ffd36b; clip-path: polygon(50% 0, 61% 30%, 95% 12%, 74% 42%, 100% 55%, 70% 64%, 82% 100%, 52% 74%, 22% 98%, 30% 66%, 0 60%, 26% 44%, 6% 14%, 38% 30%);
  animation: fx-pow .95s cubic-bezier(.3, 1.6, .5, 1) forwards;
}
.fx-pow b { font: 800 30px var(--display); color: #e5302a; -webkit-text-stroke: 1.5px #1b1530; rotate: -8deg; }
@keyframes fx-pow { 0% { scale: 0; rotate: -30deg; } 25% { scale: 1.15; rotate: 0deg; } 75% { scale: 1; opacity: 1; } 100% { scale: 1.3; opacity: 0; } }
.fx-text, .ko-stamp { position: absolute; z-index: 7; pointer-events: none; translate: -50% -50%; white-space: nowrap; }
.fx-text b {
  display: block; font: 800 clamp(22px, 4vw, 34px) var(--display); color: #ffd36b; -webkit-text-stroke: 2px #1b1530; text-shadow: 0 4px 0 #1b1530, 0 0 24px #ffb347;
  animation: fx-text 1.3s cubic-bezier(.2, .9, .3, 1.3) forwards;
}
@keyframes fx-text { 0% { scale: 0; } 20% { scale: 1.2; } 30%, 80% { scale: 1; translate: 0 0; opacity: 1; } 100% { translate: 0 -30px; opacity: 0; } }
.ko-stamp b {
  display: block; padding: 4px 16px; border: 5px solid #e5302a; border-radius: 12px; rotate: -12deg;
  font: 800 clamp(34px, 6vw, 54px) var(--display); color: #e5302a; background: #ffffffd8; box-shadow: 0 10px 30px #0008;
  animation: ko-stamp 1.3s cubic-bezier(.3, 1.5, .5, 1) forwards;
}
@keyframes ko-stamp { 0% { scale: 3; opacity: 0; } 18% { scale: 1; opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: .9; } }

/* ---------- Combat : sprites des Dresseurs et décors peints (npm run battle-assets) ---------- */
.tsprite { width: 100%; height: 100%; object-fit: contain; display: block; }
.arena.has-bg .sky, .arena.has-bg .far, .arena.has-bg .ground { display: none; }
.backdrop { position: absolute; inset: -8%; background: center 32% / cover no-repeat; }
.arena.has-bg .pad {
  background: radial-gradient(closest-side, #ffffff3a 0 58%, #00000033 64% 84%, #ffffff66 87% 100%);
  box-shadow: 0 12px 22px -8px #0007;
}
.trainer-stand.sprite { height: 44%; aspect-ratio: 192 / 256; bottom: 45%; -webkit-mask-image: none; mask-image: none; }
.trainer-stand.sprite img { filter: drop-shadow(0 10px 12px #0007); }
.player-stand {
  position: absolute; left: 26%; bottom: 3%; height: 56%; aspect-ratio: 192 / 256; z-index: 3; translate: -170% 0; opacity: 0;
  transition: translate .7s cubic-bezier(.2, .9, .3, 1), opacity .5s;
}
.player-stand img { filter: drop-shadow(0 12px 14px #0008); }
.arena.trainer-in .player-stand { translate: -50% 0; opacity: 1; }
.arena.trainer-out .player-stand { translate: -180% 0; opacity: 0; transition-duration: .45s; }
.mini-portrait .tsprite { object-fit: cover; object-position: 50% 6%; scale: 1.5; translate: 0 14%; }
.vs-side .tsprite { width: min(210px, 52%); height: auto; filter: drop-shadow(0 14px 18px #0008); }
.tspeech .tp .tsprite { object-fit: cover; object-position: 50% 0; scale: 1.3; transform-origin: 50% 18%; }
.bover-portrait .tsprite { height: auto; }
.bcredit { margin: 0; text-align: right; font-size: 11px; color: var(--muted); }
