/* ============ Ouverture de pack « suspense » ============ */
.op-overlay {
  position: fixed; inset: 0; z-index: 200; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #4b3a8f 0%, #2a1f5c 45%, #150f33 100%); color: #fff; opacity: 0; transition: opacity .35s, filter .4s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.op-overlay.in { opacity: 1; }
.op-overlay.god { background: radial-gradient(ellipse at 50% 45%, #fff1c2 0%, #ff9ccc 35%, #7b5cff 70%, #2a1f5c 100%); }
.op-overlay::after { content: ''; position: absolute; inset: 0; background: rgba(5, 2, 20, .0); transition: background .6s; pointer-events: none; }
.op-overlay.dim::after { background: rgba(5, 2, 20, .55); }
.op-overlay.beat { animation: op-beat .5s ease-out; }
.op-overlay.shake { animation: op-shake .55s; }
@keyframes op-beat { 0% { filter: none; } 15% { filter: brightness(1.35) saturate(1.3); } 100% { filter: none; } }
@keyframes op-shake { 0%, 100% { transform: none; } 15% { transform: translate(-8px, 4px); } 30% { transform: translate(7px, -5px); } 45% { transform: translate(-5px, -3px); } 60% { transform: translate(4px, 5px); } 80% { transform: translate(-2px, 1px); } }

.op-stars { position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image: radial-gradient(2px 2px at 10% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 70%, #fff, transparent),
  radial-gradient(2px 2px at 70% 30%, #fff, transparent), radial-gradient(1px 1px at 85% 80%, #fff, transparent), radial-gradient(1.5px 1.5px at 50% 50%, #fff, transparent),
  radial-gradient(1px 1px at 20% 90%, #fff, transparent), radial-gradient(2px 2px at 90% 10%, #fff, transparent), radial-gradient(1px 1px at 60% 15%, #fff, transparent);
  animation: op-twinkle 4s ease-in-out infinite alternate; }
@keyframes op-twinkle { to { opacity: .3; } }

.op-top { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; display: flex; gap: 8px; z-index: 30; }
.op-ico { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.2rem; cursor: pointer; backdrop-filter: blur(6px); }
.op-stage { position: relative; z-index: 10; width: 100%; max-width: 1000px; display: flex; flex-direction: column; align-items: center; padding: 20px; }
.op-hint { margin-top: 22px; font-weight: 900; letter-spacing: .02em; opacity: .9; min-height: 1.4em; text-align: center; animation: op-pulse-text 1.6s ease-in-out infinite; cursor: pointer; }
@keyframes op-pulse-text { 50% { opacity: .45; } }

/* ----- le pack ----- */
.op-pack { position: relative; width: min(58vw, 240px); aspect-ratio: 3 / 4.3; cursor: pointer; animation: op-float 3s ease-in-out infinite; --glow: #fff; }
@keyframes op-float { 50% { transform: translateY(-10px) rotate(1deg); } }
.op-pack-body, .op-pack-top { position: absolute; left: 0; right: 0; border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #ff9ccc 0%, #b48cff 50%, #6ec3ff 100%); box-shadow: inset 0 0 0 4px rgba(255,255,255,.5); }
.op-pack-body { top: 12%; bottom: 0; border-top-left-radius: 4px; border-top-right-radius: 4px; box-shadow: 0 25px 60px rgba(0,0,0,.45), inset 0 0 0 4px rgba(255,255,255,.5); }
.op-pack-top { top: 0; height: 13%; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; background: linear-gradient(90deg, #ffd6ec, #e3d9ff, #d6f0ff);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.6) 0 6px, transparent 6px 12px), linear-gradient(90deg, #ffb3d9, #c9b3ff, #b3e0ff); }
.op-pack-body::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 14px, transparent 14px 28px); }
.op-pack-body::after { content: ''; position: absolute; top: 0; left: -70%; width: 45%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: sheen 3s infinite; }
.op-pack-logo { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: var(--font-title); font-weight: 700; font-size: 1.7rem; line-height: 1.05;
  text-shadow: 0 3px 12px rgba(0,0,0,.25); z-index: 2; }
.op-pack-logo span { font-size: 3.6rem; display: block; margin-bottom: 8px; }
.op-cracks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.op-cracks path { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; filter: drop-shadow(0 0 3px #fff); stroke-dasharray: 120; stroke-dashoffset: 120; transition: stroke-dashoffset .35s; }
.op-pack[data-level="1"] .c1, .op-pack[data-level="2"] .c1, .op-pack[data-level="2"] .c2, .op-pack[data-level="3"] path { stroke-dashoffset: 0; }
.op-pack-glow { position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, var(--glow) 0%, transparent 65%); opacity: 0; z-index: -1; transition: opacity .6s; filter: blur(10px); }
.op-pack.glowing .op-pack-glow { opacity: .85; animation: op-glow-pulse .8s ease-in-out infinite; }
.op-pack.rainbow .op-pack-glow { background: conic-gradient(#ff7eb6, #ffd56b, #4fd1b5, #6ec3ff, #a865ff, #ff7eb6); animation: op-spin 1.4s linear infinite; border-radius: 50%; }
@keyframes op-glow-pulse { 50% { transform: scale(1.12); opacity: 1; } }
@keyframes op-spin { to { transform: rotate(360deg); } }
.op-pack.hit { animation: op-hit .35s; }
.op-pack[data-level="2"].hit { animation: op-hit2 .4s; }
.op-pack[data-level="3"].hit, .op-pack.charging { animation: op-hit3 .12s linear infinite; }
@keyframes op-hit { 30% { transform: scale(.93) rotate(-3deg); } 60% { transform: scale(1.04) rotate(2deg); } }
@keyframes op-hit2 { 20% { transform: scale(.9) rotate(5deg); } 45% { transform: scale(1.07) rotate(-5deg); } 70% { transform: rotate(3deg); } }
@keyframes op-hit3 { 25% { transform: translate(-4px, 2px) rotate(-2deg) scale(1.03); } 75% { transform: translate(4px, -2px) rotate(2deg) scale(1.05); } }
.op-pack.torn { animation: none; }
.op-pack.torn .op-pack-top { animation: op-top-off .7s cubic-bezier(.2, .7, .3, 1) forwards; }
.op-pack.torn .op-pack-body { animation: op-body-down .7s .15s ease-in forwards; }
@keyframes op-top-off { to { transform: translate(120px, -260px) rotate(55deg); opacity: 0; } }
@keyframes op-body-down { to { transform: translateY(140%) scale(.85); opacity: 0; } }
.op-flash { position: absolute; inset: 0; z-index: 25; pointer-events: none; animation: op-flash .45s ease-out forwards; }
@keyframes op-flash { from { opacity: 1; } to { opacity: 0; } }
.op-particle { position: fixed; z-index: 260; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); animation: op-particle 1s cubic-bezier(.15, .8, .3, 1) forwards;
  box-shadow: 0 0 8px currentColor; }
@keyframes op-particle { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; } }

/* ----- la pile de cartes ----- */
.op-count { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; opacity: .85; min-height: 1.6em; }
.op-count.last { color: #ffd56b; font-size: 1.6rem; animation: op-pulse-text 1s ease-in-out infinite; text-shadow: 0 0 18px rgba(255, 213, 107, .7); }
.op-pile { position: relative; margin-bottom: 44px; width: min(68vw, 300px); aspect-ratio: 5 / 7; perspective: 1400px; }
.op-card { position: absolute; inset: 0; transform: translate(calc(var(--k) * 3px), calc(var(--k) * -4px)) rotate(calc(var(--k) * 1.2deg)); transition: transform .35s; --aura: #fff; }
.op-card.deal { animation: op-deal .55s cubic-bezier(.2, 1.3, .4, 1) backwards; }
@keyframes op-deal { from { transform: translateY(70vh) rotate(-25deg) scale(.6); opacity: 0; } }
.op-card.top { cursor: pointer; transform: none; }
.op-card.top:not(.flipped):not(.charging):hover { transform: translateY(-6px) scale(1.02); }
.op-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.3, .5, 1); }
.op-card.flipped .op-flip { transform: rotateY(180deg); }
.op-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.op-front { transform: rotateY(180deg); }
.op-face .tcg, .op-face .tcg-back { height: 100%; }
.op-aura { position: absolute; inset: -14%; border-radius: 30%; background: radial-gradient(circle, var(--aura) 0%, transparent 62%); filter: blur(14px); opacity: 0; transition: opacity .4s; z-index: -1; }
.op-rays { position: absolute; left: 50%; top: 50%; width: 260%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0; z-index: -2; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 120, .55) 0deg 7deg, transparent 7deg 20deg); border-radius: 50%;
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 65%); mask: radial-gradient(circle, #000 15%, transparent 65%); }
.op-card.charging { animation: op-charge .09s linear infinite; }
.op-card.charging .op-aura { opacity: 1; animation: op-glow-pulse .5s ease-in-out infinite; }
.op-card.charging.r-legendary .op-aura { animation-duration: .26s; }
.op-card.charging .op-back .tcg-back { box-shadow: 0 0 0 4px var(--aura), 0 0 40px var(--aura); }
.op-card.charging.is-shiny .op-aura { background: conic-gradient(#ff7eb6, #ffd56b, #4fd1b5, #6ec3ff, #a865ff, #ff7eb6); animation: op-spin 1s linear infinite; border-radius: 50%; }
@keyframes op-charge { 25% { transform: translate(-3px, 1px) rotate(-1deg); } 75% { transform: translate(3px, -1px) rotate(1deg); } }
.op-card.revealed-rare .op-aura, .op-card.revealed-epic .op-aura { opacity: .9; }
.op-card.revealed-legendary .op-aura { opacity: 1; background: radial-gradient(circle, #ffd56b 0%, transparent 65%); }
.op-card.revealed-legendary .op-rays { opacity: 1; animation: op-spin-c 9s linear infinite; }
@keyframes op-spin-c { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.op-card.revealed-legendary { animation: op-legend-pop .7s cubic-bezier(.2, 1.6, .4, 1); }
.op-card.revealed-epic { animation: op-pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes op-legend-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes op-pop { 50% { transform: scale(1.07); } }
.op-banner { position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%) scale(.5); display: flex; gap: 6px; opacity: 0; transition: all .35s cubic-bezier(.2, 1.6, .4, 1); white-space: nowrap; }
.op-banner.show { opacity: 1; transform: translateX(-50%) scale(1); }
.op-banner b { padding: 5px 12px; border-radius: 99px; font-size: .8rem; font-weight: 900; letter-spacing: .04em; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.op-banner b.new { background: #ff5d73; }
.op-banner b.shy { background: linear-gradient(90deg, #ff7eb6, #ffbe3d, #4fd1b5, #6ec3ff, #a865ff); }
.op-card.away { transform: translate(-130vw, 10vh) rotate(-35deg) !important; transition: transform .38s ease-in; }
.op-collected { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 12; }
.op-mini { width: 46px; animation: op-mini-in .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes op-mini-in { from { transform: translateX(-60px) scale(.3); opacity: 0; } }
.op-mini.r-legendary { filter: drop-shadow(0 0 8px #ffb21e); }
.op-mini.r-epic { filter: drop-shadow(0 0 6px #a865ff); }
.op-god { font-family: var(--font-title); font-size: clamp(2.6rem, 10vw, 5rem); margin: 0 0 20px; text-align: center; color: #fff;
  text-shadow: 0 0 30px #fff, 0 0 60px #ff7eb6; animation: op-legend-pop .8s cubic-bezier(.2, 1.6, .4, 1), op-pulse-text 1s 1s infinite; }

/* ----- récapitulatif ----- */
.op-sum-title { font-family: var(--font-title); font-size: 2rem; margin: 0 0 18px; }
.op-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 170px)); gap: clamp(8px, 2vw, 18px); justify-content: center; width: 100%; }
@media (max-width: 700px) { .op-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.op-sum-card { position: relative; display: block; animation: op-deal .5s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.op-sum-card .new-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 5; background: #ff5d73; color: #fff; font-size: .68rem; font-weight: 900; padding: 3px 9px; border-radius: 99px; }
.op-overlay .btn:not(.primary) { background: rgba(255, 255, 255, .92); }
@media (prefers-reduced-motion: reduce) { .op-card.charging, .op-pack.charging { animation: none; } }
