/* The pack opening simulator (/packs/, site/packs/packs.js). */
.pk-sets { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 18px; }
.pk-sets a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.pk-sets a[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: #111; }

.pk-app { scroll-margin-top: 150px; background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--c1) 35%, transparent), transparent 70%), var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 22px 16px 16px; margin-bottom: 30px; }
.pk-stage { min-height: 470px; display: flex; align-items: center; justify-content: center; }
.pk-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; min-height: 46px; }
.pk-stats { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.pk-msg { color: var(--muted); text-align: center; }
.pk-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* The sealed pack */
.pk-pack { position: relative; width: 250px; height: 440px; border: 0; padding: 0; cursor: pointer; border-radius: 10px 10px 14px 14px; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent 30%, transparent 62%, rgba(255, 255, 255, 0.22) 75%, transparent 88%), linear-gradient(170deg, var(--c1), var(--c2));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; transition: transform 0.2s; }
.pk-pack:hover { transform: translateY(-4px) rotate(-1deg); }
.pk-pack:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.pk-pack::before, .pk-pack::after { content: ''; position: absolute; left: 0; right: 0; height: 12px;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0 6px, rgba(255, 255, 255, 0.15) 6px 12px); }
.pk-pack::before { top: 0; border-radius: 10px 10px 0 0; }
.pk-pack::after { bottom: 0; border-radius: 0 0 14px 14px; }
.pk-tear { position: absolute; top: 0; left: 0; right: 0; height: 58px; border-radius: 10px 10px 0 0;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.25), transparent), linear-gradient(170deg, var(--c1), color-mix(in srgb, var(--c1) 70%, var(--c2)));
  clip-path: polygon(0 0, 100% 0, 100% 80%, 92% 100%, 84% 82%, 76% 100%, 68% 82%, 60% 100%, 52% 82%, 44% 100%, 36% 82%, 28% 100%, 20% 82%, 12% 100%, 4% 82%, 0 100%); }
.pk-logo { width: 78%; max-height: 120px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.pk-logo-text { font: 700 26px var(--pixel); text-shadow: 0 3px 8px rgba(0, 0, 0, 0.6); padding: 0 16px; text-align: center; }
.pk-hint { font-weight: 700; font-size: 15px; background: rgba(0, 0, 0, 0.35); padding: 8px 14px; border-radius: 999px; animation: pkPulse 1.6s ease-in-out infinite; }
.pk-pack.torn .pk-tear { animation: pkTear 0.45s ease-in forwards; }
.pk-pack.torn { animation: pkShake 0.3s; }
@keyframes pkTear { to { transform: translate(60px, -90px) rotate(28deg); opacity: 0; } }
@keyframes pkShake { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes pkPulse { 50% { opacity: 0.65; } }

/* One card, big */
.pk-card { position: relative; border: 0; padding: 0; background: none; cursor: pointer; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pkIn 0.25s ease-out; }
.pk-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 12px; }
.pk-card img { width: min(300px, 76vw); height: auto; aspect-ratio: 245 / 342; border-radius: 12px; background: var(--card); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55); }
.pk-cap { font-size: 15px; }
.pk-count { position: absolute; top: -12px; right: -6px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.pk-badge { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: 800; font-size: 13px; letter-spacing: 0.02em; padding: 6px 12px; border-radius: 999px; background: var(--gold); color: #111; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); animation: pkPop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pkIn { from { transform: translateX(40px) rotate(4deg); opacity: 0; } }
@keyframes pkPop { from { transform: translateX(-50%) scale(0.3); } }

/* The better the card, the brighter it glows */
.pk-card.rev img, .pk-mini.rev img { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(180, 220, 255, 0.5); }
.pk-card.tier-1 img { box-shadow: 0 0 26px rgba(255, 255, 255, 0.45), 0 14px 34px rgba(0, 0, 0, 0.55); }
.pk-card.tier-2 img { box-shadow: 0 0 34px rgba(245, 197, 66, 0.7), 0 14px 34px rgba(0, 0, 0, 0.55); }
.pk-card.tier-3 img { box-shadow: 0 0 40px rgba(120, 200, 255, 0.85), 0 14px 34px rgba(0, 0, 0, 0.55); }
.pk-card.tier-4 img, .pk-card.tier-5 img { animation: pkGlow 1.4s ease-in-out infinite alternate; }
.pk-card.tier-5 .pk-badge { background: linear-gradient(90deg, #ff6b6b, #ffd93b, #6bff95, #6bc5ff, #c56bff); }
@keyframes pkGlow { from { box-shadow: 0 0 30px rgba(245, 197, 66, 0.7), 0 14px 34px rgba(0, 0, 0, 0.55); } to { box-shadow: 0 0 70px rgba(255, 120, 220, 0.95), 0 14px 34px rgba(0, 0, 0, 0.55); } }

/* The whole pack, or the hits of ten */
.pk-summary { width: 100%; }
.pk-total { text-align: center; font-size: 17px; margin: 0 0 16px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.pk-mini { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.pk-mini img { width: 100%; height: auto; aspect-ratio: 245 / 342; border-radius: 7px; background: var(--card); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
.pk-mini.tier-2 img, .pk-mini.tier-3 img { box-shadow: 0 0 16px rgba(245, 197, 66, 0.7); }
.pk-mini.tier-4 img, .pk-mini.tier-5 img { box-shadow: 0 0 22px rgba(255, 120, 220, 0.9); }
.pk-mini figcaption { display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; color: var(--muted); }
.pk-mini figcaption b { color: var(--text); font-size: 12.5px; }
.pk-price { color: var(--gold); font-weight: 700; }

@media (max-width: 560px) {
  .pk-app { padding: 16px 10px 12px; }
  .pk-stage { min-height: 430px; }
  .pk-pack { width: 220px; height: 390px; }
  .pk-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-pack, .pk-card, .pk-badge, .pk-hint, .pk-card img { animation: none !important; transition: none; }
  .pk-pack.torn .pk-tear { animation: none; opacity: 0; }
}
