/* ===== APPARITION D'ARCEUS (rareté cachée « Dieu », js/views/capsules-god.js) ===== */
/* étapes ajoutées sur .cap-ov : co-god → g-l1 → g-quake → g-l2 → g-crack → g-bang/g-shake → g-l3 → g-pillar → g-desc → g-fill → co-reveal */
.god-layer { position: absolute; inset: 0; pointer-events: none; }
.god-void { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity 1.2s ease; }
.cap-ov.co-god .god-void { opacity: 1; }
.cap-ov.g-bang .god-void { opacity: .85; transition-duration: 2s; }
.god-nebula { position: absolute; inset: -10%; opacity: 0; transition: opacity 2.4s ease .2s;
  background: radial-gradient(ellipse 45% 35% at 50% 45%, rgba(255,215,106,.32), transparent 70%),
    radial-gradient(ellipse 40% 30% at 30% 30%, rgba(124,92,255,.35), transparent 70%),
    radial-gradient(ellipse 40% 30% at 72% 65%, rgba(52,213,255,.22), transparent 70%); }
.cap-ov.g-bang .god-nebula { opacity: 1; }
.god-stars { position: absolute; inset: 0; opacity: 0; transform: scale(.6); transition: opacity 1.6s ease, transform 3s cubic-bezier(.15,.8,.3,1); }
.god-stars i { position: absolute; left: 0; top: 0; width: 1px; height: 1px; border-radius: 50%; }
.cap-ov.g-bang .god-stars { opacity: 1; transform: scale(1); animation: godTwinkle 3s 2s ease-in-out infinite; }
@keyframes godTwinkle { 50% { filter: brightness(.6); } }

/* texte du mythe */
.god-text { position: absolute; left: 0; right: 0; top: calc(5% + env(safe-area-inset-top)); text-align: center; padding: 0 20px; }
.god-text p { position: absolute; left: 20px; right: 20px; margin: 0; font-family: Fredoka, Inter, sans-serif; font-size: 1.15rem; letter-spacing: .04em; color: #f6e7b8;
  text-shadow: 0 0 12px rgba(255,215,106,.6); opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform .9s ease; }
.cap-ov.g-l1 .gl1, .cap-ov.g-l2 .gl2, .cap-ov.g-l3 .gl3 { opacity: 1; transform: none; }
.cap-ov.g-l2 .gl1, .cap-ov.g-l3 .gl2 { opacity: 0; transform: translateY(-8px); }
.cap-ov .gl3 { font-size: 1.4rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff3c4; }
.cap-ov.g-fill .gl3 { opacity: 0; }

/* la capsule devient dorée et tremble comme un cœur */
.cap-ov.co-god .cap-ball { filter: drop-shadow(0 0 18px rgba(255,215,106,.7)); transition: filter 1.5s; }
.cap-ov.co-god .capsule .cap-glow { fill: #fff6d6; opacity: 1; filter: drop-shadow(0 0 8px #ffd76a); }
.cap-ov.g-quake .cap-ball .capsule { animation: godQuake .55s ease-in-out; transform-origin: 50% 90%; }
@keyframes godQuake { 0%, 100% { transform: none; } 15% { transform: translateX(-9px) rotate(-9deg) scale(1.04); } 35% { transform: translateX(8px) rotate(8deg); } 55% { transform: translateX(-6px) rotate(-5deg) scale(1.06); } 75% { transform: translateX(4px) rotate(3deg); } }
.cap-ov.g-crack .cap-ball { filter: drop-shadow(0 0 30px #ffd76a) drop-shadow(0 0 70px rgba(255,246,214,.8)) brightness(1.25); }
.cap-ov.g-crack .cap-ball .capsule { animation: godBuzz .08s linear infinite; }
@keyframes godBuzz { 50% { transform: translate(1.5px, -1px); } }

/* rayons qui s'échappent des fissures */
.god-cracks { position: absolute; width: 640px; height: 640px; left: 50%; top: 50%; margin: -320px 0 0 -320px; z-index: 2; opacity: 0; transform: scale(.2);
  background: repeating-conic-gradient(from 8deg, rgba(255,246,214,.95) 0deg 2.5deg, transparent 2.5deg 21deg, rgba(255,215,106,.7) 21deg 23deg, transparent 23deg 40deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 66%); mask: radial-gradient(circle, #000 8%, transparent 66%); }
.cap-ov.g-crack .god-cracks { opacity: 1; transform: scale(1) rotate(25deg); transition: opacity .4s, transform 1.4s cubic-bezier(.3,.6,.4,1); }
.cap-ov.g-bang .god-cracks { opacity: 0; transform: scale(2.4) rotate(40deg); transition: opacity .7s, transform .7s ease-out; }

/* big bang : la capsule disparaît dans un éclair, onde de choc, l'écran tremble */
.cap-ov.g-bang .cap-ball { animation: godGone .35s ease-in forwards; }
@keyframes godGone { to { transform: scale(1.8); opacity: 0; filter: brightness(4); } }
.cap-ov.g-bang .cap-flash { animation: godFlash 1.5s ease-out; }
@keyframes godFlash { 0% { opacity: 0; } 8% { opacity: 1; background: #fff; } 40% { opacity: .7; background: #fff6d6; } 100% { opacity: 0; background: #ffd76a; } }
.god-shock { position: absolute; left: 50%; top: 45%; width: 120px; height: 120px; margin: -60px; border-radius: 50%; border: 3px solid #fff3c4; box-shadow: 0 0 30px #ffd76a, inset 0 0 30px #ffd76a; opacity: 0; }
.cap-ov.g-bang .god-shock { animation: godShock 1.3s cubic-bezier(.1,.7,.3,1) forwards; }
.cap-ov.g-bang .god-shock.s2 { animation-delay: .22s; border-color: #b9a6ff; box-shadow: 0 0 30px #7c5cff; }
@keyframes godShock { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(9); } }
.cap-ov.g-shake .cap-scene { animation: godShake .9s ease-out; }
@keyframes godShake { 0%, 100% { transform: none; } 10% { transform: translate(-14px, 8px); } 25% { transform: translate(12px, -10px); } 40% { transform: translate(-9px, -6px); } 55% { transform: translate(7px, 6px); } 75% { transform: translate(-3px, 2px); } }

/* l'anneau aux 17 plaques */
.god-ring { position: absolute; width: 440px; height: 440px; left: 50%; top: 50%; margin: -220px 0 0 -220px; z-index: 1; opacity: 0; transform: scale(.1) rotate(-120deg); }
.god-ring svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 10px rgba(255,215,106,.8)); }
.cap-ov.g-l3 .god-ring { opacity: 1; transform: none; transition: opacity .8s, transform 1.8s cubic-bezier(.2,.9,.3,1); }
.cap-ov.g-l3 .god-ring svg { animation: capSpin 24s linear infinite; }
.god-ring.tilt { width: 520px; height: 520px; margin: -260px 0 0 -260px; }
.cap-ov.g-l3 .god-ring.tilt { opacity: .45; transform: rotateX(72deg); }
.cap-ov.g-l3 .god-ring.tilt svg { animation-direction: reverse; animation-duration: 16s; }
.cap-ov.g-fill .god-ring svg { filter: drop-shadow(0 0 18px #ffd76a) drop-shadow(0 0 40px rgba(255,246,214,.7)); }
/* une fois Arceus révélé, l'anneau recule pour laisser la place au texte */
.cap-ov.co-god.co-reveal .god-ring { opacity: .5; transform: scale(.86); transition: opacity 1s, transform 1s; }
.cap-ov.co-god.co-reveal .god-ring.tilt { opacity: .25; transform: scale(.86) rotateX(72deg); }

/* colonne de lumière */
.god-pillar { position: absolute; left: 50%; top: -5%; bottom: 0; width: 220px; margin-left: -110px; opacity: 0; transform: scaleX(0);
  background: linear-gradient(90deg, transparent, rgba(255,246,214,.55) 30%, rgba(255,255,255,.9) 50%, rgba(255,246,214,.55) 70%, transparent);
  -webkit-mask: linear-gradient(#000 40%, transparent 85%); mask: linear-gradient(#000 40%, transparent 85%); filter: blur(6px); }
.cap-ov.g-pillar .god-pillar { opacity: 1; transform: scaleX(1); transition: opacity .5s, transform .7s cubic-bezier(.2,.9,.3,1); }
.cap-ov.g-fill .god-pillar { opacity: .25; transform: scaleX(1.6); transition: opacity 1.4s, transform 1.4s; }

/* poussière dorée qui monte */
.god-motes i { position: absolute; bottom: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #ffe7a3; box-shadow: 0 0 8px #ffd76a; opacity: 0; }
.cap-ov.g-l3 .god-motes i { animation: godMote var(--du) var(--dl) linear infinite; }
@keyframes godMote { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-105vh); } }

/* Arceus : silhouette qui descend, puis ses couleurs */
.cap-ov.co-god .cap-mon { width: 300px; height: 300px; }
.cap-ov.co-god .cap-mon img { filter: brightness(0) drop-shadow(0 0 2px #fff6d6) drop-shadow(0 0 26px #ffd76a); }
.cap-ov.g-desc .cap-mon { animation: godDescend 2.4s cubic-bezier(.25,.8,.35,1) forwards; }
@keyframes godDescend { 0% { opacity: 0; transform: translateY(-55vh) scale(.7); } 20% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.cap-ov.g-fill .cap-mon img { filter: brightness(1) drop-shadow(0 0 14px #ffe7a3) drop-shadow(0 0 40px rgba(255,215,106,.75)); transition: filter 1.1s ease-out; }
.cap-ov.g-fill .cap-flash { animation: godFlash2 1s ease-out; }
@keyframes godFlash2 { 0% { opacity: 0; } 12% { opacity: .9; background: #fff6d6; } 100% { opacity: 0; background: #ffd76a; } }
.cap-ov.co-god.co-reveal .cap-mon { opacity: 1; transform: none; animation: godFloat 4s ease-in-out infinite; }
@keyframes godFloat { 50% { transform: translateY(-8px); } }
.cap-ov.co-god .cap-halo { width: 320px; height: 320px; }

/* titre : « ??? » brouillé puis « Dieu des Pokémon » */
.god-banner { position: relative; z-index: 2; padding: 4px 14px; border-radius: 999px; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); font-size: 1.25rem; letter-spacing: .3em; color: #fff3c4; text-shadow: 0 0 10px #ffd76a, 0 0 28px #ffd76a; }
.god-banner.glitch { animation: godGlitch .1s steps(2) infinite; }
@keyframes godGlitch { 0% { transform: translate(2px, -1px) skewX(8deg); text-shadow: -3px 0 #ff4fa3, 3px 0 #34d5ff; } 100% { transform: translate(-2px, 1px) skewX(-6deg); text-shadow: 3px 0 #ff4fa3, -3px 0 #34d5ff; } }
.god-banner.done { animation: godTitle 1.2s ease-out; background: linear-gradient(90deg, #fff6d6, #ffd76a, #fff6d6); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes godTitle { 0% { transform: scale(1.5); filter: brightness(2.5); } 100% { transform: none; filter: none; } }
.tier-pill.secret { color: #fff3c4; background: linear-gradient(135deg, rgba(255,215,106,.28), rgba(124,92,255,.22)); border-color: rgba(255,231,163,.7); box-shadow: 0 0 10px rgba(255,215,106,.35); }

@media (max-width: 760px) {
  .cap-ov.co-god .cap-mon { width: 250px; height: 250px; }
  .god-ring { width: 340px; height: 340px; margin: -170px 0 0 -170px; }
  .god-ring.tilt { width: 400px; height: 400px; margin: -200px 0 0 -200px; }
  .god-text p { font-size: 1rem; }
  .cap-ov .gl3 { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cap-ov.g-quake .cap-ball .capsule, .cap-ov.g-crack .cap-ball .capsule, .cap-ov.g-shake .cap-scene, .god-banner.glitch { animation: none; }
}

/* ===== LES 18 FORMES D'ARCEUS (supabase-v22.sql) ===== */
/* la poussière et la nébuleuse prennent la couleur du type tiré (--gt) */
.cap-ov.co-god .god-motes i { background: var(--gt, #ffe7a3); box-shadow: 0 0 8px var(--gt, #ffd76a); }
.cap-ov.co-god .god-nebula { background: radial-gradient(ellipse 45% 35% at 50% 45%, color-mix(in srgb, var(--gt, #ffd76a) 38%, transparent), transparent 70%),
  radial-gradient(ellipse 40% 30% at 30% 30%, rgba(124,92,255,.35), transparent 70%), radial-gradient(ellipse 40% 30% at 72% 65%, rgba(52,213,255,.22), transparent 70%); }
.cap-forms { color: #f6e7b8; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.form-grid .evo-cell { width: auto; }
.form-cell.miss { cursor: default; }
.dex-cell .dforms { position: absolute; bottom: 24px; right: 6px; font-size: .64rem; font-weight: 800; color: #fff3c4; background: rgba(0,0,0,.6); border: 1px solid rgba(255,231,163,.6); padding: 0 5px; border-radius: 999px; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
  .form-grid .evo-img { width: 50px; height: 50px; }
}

/* ===== APPARITIONS SPÉCIALES (js/views/capsules-fx.js) ===== */
/* Carapuce : tourbillon d'eau, lunettes de soleil qui tombent du ciel, « Escouade Carapuce » */
.fx-water { position: absolute; width: 560px; height: 560px; left: 50%; top: 50%; margin: -280px 0 0 -280px; z-index: 0; border-radius: 50%; opacity: 0; transform: scale(.4);
  background: repeating-conic-gradient(from 0deg, rgba(52,160,255,.55) 0deg 8deg, transparent 8deg 22deg, rgba(150,217,255,.35) 22deg 26deg, transparent 26deg 40deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 66%); mask: radial-gradient(circle, #000 0%, transparent 66%); }
.cap-ov.fx-squirtle.co-reveal .fx-water { opacity: 1; transform: none; transition: opacity .5s, transform .7s cubic-bezier(.2,.9,.3,1); animation: capSpin 9s linear infinite reverse; }
.cap-ov.fx-squirtle.co-reveal .cap-rays { opacity: 0 !important; }
.fx-shades { position: absolute; left: 19%; top: 13.5%; width: 37%; transform: translateY(-70vh) rotate(-30deg); opacity: 0; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.fx-shades svg { display: block; width: 100%; height: auto; }
.cap-ov.fx-drop .fx-shades { animation: fxShadesDrop .48s cubic-bezier(.5,0,.7,.3) forwards; }
@keyframes fxShadesDrop { 0% { opacity: 1; transform: translateY(-70vh) rotate(-30deg); } 100% { opacity: 1; transform: translateY(0) rotate(-7deg); } }
.cap-ov.fx-on .fx-shades { opacity: 1; animation: fxShadesLand .35s ease-out forwards; }
@keyframes fxShadesLand { 0% { transform: translateY(0) rotate(-7deg); } 40% { transform: translateY(5px) rotate(-5deg) scaleY(.9); } 100% { transform: translateY(0) rotate(-7deg); } }
/* éclat qui traverse le verre droit */
.fx-glint { position: absolute; left: 66%; top: 18%; width: 22px; height: 22px; opacity: 0; background: radial-gradient(circle, #fff 0 18%, transparent 20%), linear-gradient(90deg, transparent 46%, #fff 50%, transparent 54%), linear-gradient(0deg, transparent 46%, #fff 50%, transparent 54%); }
.cap-ov.fx-on .fx-glint { animation: fxGlint .9s .15s ease-out; }
@keyframes fxGlint { 0% { opacity: 0; transform: scale(.2) rotate(0); } 35% { opacity: 1; transform: scale(1.4) rotate(45deg); } 100% { opacity: 0; transform: scale(.6) rotate(90deg); } }
/* il hoche la tête quand les lunettes arrivent */
.cap-ov.fx-on .cap-mon img { animation: fxNod .4s ease-out; }
@keyframes fxNod { 40% { transform: translateY(6px) rotate(2deg); } }
.cap-ov.fx-on .cap-scene { animation: capShake .35s; }
/* petite danse (lunettes comprises : on fait bouger toute la case) */
.cap-ov.fx-dance .cap-mon { opacity: 1; transform: none; animation: fxDance 1.15s ease-in-out; }
@keyframes fxDance {
  0%, 100% { transform: none; }
  12% { transform: translateX(-16px) rotate(-9deg); } 25% { transform: translateY(-14px); }
  37% { transform: translateX(16px) rotate(9deg); } 50% { transform: none; }
  62% { transform: translateX(-12px) rotate(-7deg) scaleY(.94); } 75% { transform: translateY(-12px) rotate(0); }
  87% { transform: translateX(10px) rotate(6deg); } }
/* gouttes d'eau */
.fx-drops { position: absolute; left: 50%; top: 50%; z-index: 5; }
.fx-drops i { position: absolute; width: 7px; height: 10px; margin: -5px -3px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #8fd3ff; box-shadow: 0 0 6px #34a0ff; opacity: 0; }
.cap-ov.fx-on .fx-drops i { animation: fxDrop .8s var(--dl) ease-out forwards; }
@keyframes fxDrop { 0% { opacity: 1; transform: rotate(var(--a)) translateX(20px); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) translateY(30px); } }
/* bannière tamponnée */
.fx-squad { color: #fff; letter-spacing: .14em; font-size: 1.2rem; padding: 3px 14px; border-radius: 8px; background: linear-gradient(135deg, #1f6fe0, #34a0ff); box-shadow: 0 4px 0 #0d3f8f, 0 0 22px rgba(52,160,255,.6); text-shadow: 0 2px 0 rgba(0,0,0,.35); transform: rotate(-3deg); animation: fxStamp .4s cubic-bezier(.2,1.6,.4,1) both !important; }
@keyframes fxStamp { 0% { opacity: 0; transform: scale(2.4) rotate(-12deg); } 100% { opacity: 1; transform: scale(1) rotate(-3deg); } }

/* Souvenirs : écran plein « Nouvelle apparition ! », imposé (on ne peut que toucher pour lancer) */
.fx-call { position: fixed; inset: 0; z-index: 3100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, #2a2363 0%, #0b0d1c 72%); animation: fxCallIn .4s ease-out; -webkit-user-select: none; user-select: none; }
@keyframes fxCallIn { from { opacity: 0; } }
.fx-call-glow { position: absolute; left: 50%; top: 40%; width: 420px; height: 420px; margin: -210px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,215,106,.22) 0deg 8deg, transparent 8deg 22deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 65%); mask: radial-gradient(circle, #000 10%, transparent 65%); animation: capSpin 16s linear infinite; }
.fx-call-mons { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 340px; }
.fx-call-mons img { width: 92px; height: 92px; object-fit: contain; filter: brightness(0) drop-shadow(0 0 10px rgba(255,215,106,.9)); animation: fxCallMon 1.6s ease-in-out infinite alternate; pointer-events: none; }
.fx-call-mons img:nth-child(2n) { animation-delay: -.8s; }
@keyframes fxCallMon { to { transform: translateY(-8px) scale(1.05); filter: brightness(0) drop-shadow(0 0 18px rgba(255,215,106,1)); } }
.fx-call-title { position: relative; font-family: Fredoka, Inter, sans-serif; font-size: 1.8rem; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(90deg, #fff6d6, #ffd76a, #ff9ccf, #9ad8ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(255,215,106,.5)); }
.fx-call-text { position: relative; margin: 0; max-width: 340px; color: #dfe3f5; line-height: 1.5; }
.fx-call-text b { color: #fff; }
.fx-call-tap { position: relative; margin-top: 10px; padding: 12px 22px; border-radius: 999px; font-weight: 700; color: #1b1534; background: linear-gradient(90deg, #ffd76a, #ff9ccf); box-shadow: 0 0 24px rgba(255,180,120,.6); animation: fxCallPulse 1.1s ease-in-out infinite; }
@keyframes fxCallPulse { 50% { transform: scale(1.06); box-shadow: 0 0 36px rgba(255,180,120,.9); } }

/* Capsule de la semaine : ouverture légèrement différente (fond teinté du thème, ses symboles s'envolent) */
.cap-ov.co-week .cap-ov-bg { background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--wk2) 42%, #0b0d1c) 0%, color-mix(in srgb, var(--wk2) 12%, #0b0d1c) 45%, #0b0d1c 75%); }
.cap-ov.co-week .cap-ball { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--wk1) 70%, transparent)); }
.cap-burst .wk-ic { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; font-size: 26px; line-height: 28px; text-align: center; opacity: 0; font-style: normal; }
.cap-ov.co-burst .cap-burst .wk-ic { animation: wkIcon 1.2s var(--dl) cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes wkIcon { 0% { opacity: 1; transform: rotate(var(--a)) translateX(10px) rotate(calc(var(--a) * -1)) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) rotate(calc(var(--a) * -1 + var(--rt))) scale(1.1); } }
