/* Pitch Rivals: the Shop (shop.js): card packs only, and the pack opening. The packs' wrappers are drawn here until the
   owner's art is in (assets/packs/pack_<tier>.webp in the atlas as pack_training / pack_matchday / pack_derby) */
.shp { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center; background: rgba(2, 8, 23, 0.72); }
.shp[hidden] { display: none; }
.shp-sheet { position: relative; width: 100%; max-width: 560px; max-height: 92%; overflow: auto; background: #0b1730; color: #e8f1ff; border-top: 3px solid #ffd21f; border-radius: 18px 18px 0 0; padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); font-family: "Barlow Condensed", "Arial Narrow", sans-serif; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55); }
.shp-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.shp-top b { font: 900 italic 28px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.06em; color: #ffd21f; }
.shp-coins { flex: 1 1 auto; font: 800 18px/1 "Barlow Condensed", sans-serif; }
.shp-x { min-width: 44px; min-height: 40px; border: 1px solid #335; border-radius: 10px; background: #0f1b31; color: #e8f1ff; font-size: 18px; cursor: pointer; }
.shp-note { margin: 12px 2px 0; color: #9fb3d6; font: 500 13px/1.35 "Barlow Condensed", sans-serif; }
/* the website's store (web only: shop.js inApp) */
.shp-more { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; border: 2px solid #f7c94866; background: linear-gradient(90deg, #3a2a08, #12284a); color: #ffe9a8; font: 600 16px/1.2 "Barlow Condensed", sans-serif; text-decoration: none; }
.shp-more img { width: 28px; height: 28px; }
.shp-more b { color: #ffd21f; font-weight: 800; margin-left: auto; }
.shp-pks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shp-pk { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 10px; border: 2px solid #2a4570; border-radius: 14px; background: radial-gradient(120% 80% at 50% 0%, #1d3a6b, #0d1c38 70%); color: #e8f1ff; font: inherit; cursor: pointer; }
.shp-pk .pkw { width: 78%; max-width: 110px; margin-bottom: 4px; transition: transform 0.15s; }
.shp-pk:hover .pkw, .shp-pk:focus-visible .pkw { transform: translateY(-3px) rotate(-2deg); }
.shp-pks:has(> :nth-child(4)) { grid-template-columns: repeat(2, 1fr); }   /* (four or five packs: two a row) */
.shp-pks:has(> :nth-child(4)) .pkw { max-width: 96px; }
.shp-pk[data-pack="legend"] { border-color: #ffd21f; background: radial-gradient(120% 80% at 50% 0%, #2b3f8a, #0d1c38 70%); }
.shp-pk[data-pack="event"] { border-color: #b06bff; background: radial-gradient(120% 80% at 50% 0%, #4a2380, #0d1c38 70%); }
.shp-pk > b { font: 900 16px/1 "Barlow Condensed", sans-serif; text-align: center; }
.shp-pk > small { min-height: 2.4em; font: 600 11px/1.2 "Barlow Condensed", sans-serif; color: #b9c8e6; text-align: center; }
.shp-pk > em { margin-top: auto; padding: 4px 10px; border-radius: 10px; background: #ffd21f; color: #1a1400; font: 900 15px/1 "Barlow Condensed", sans-serif; font-style: normal; }
.shp-pk[data-pack="training"] { border-color: #39d98a; }
.shp-pk[data-pack="training"] > em { background: #39d98a; color: #04301a; }
.shp-pk.done { opacity: 0.55; cursor: default; }
.shp-pk.poor > em { background: #3a4660; color: #c4cee3; }
.shp .shake { animation: shpshake 0.35s; }
@keyframes shpshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* a pack's wrapper (the owner's art, tools/cut_packs.py): the picture masked to its own shape (so the shine stays on the
   foil), a drop shadow on the holder, and the top strip (13%: the dashed tear line) as a piece of its own that tears off */
.pkw { position: relative; display: block; aspect-ratio: 5 / 7; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55)); }
.pk { position: absolute; inset: 0; display: block; overflow: hidden; background: var(--pk) center / 100% 100% no-repeat;
  -webkit-mask: var(--pk) center / 100% 100% no-repeat; mask: var(--pk) center / 100% 100% no-repeat; }
.pk-shine { position: absolute; inset: -40% -60%; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%); transform: translateX(-60%); animation: pkshine 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes pkshine { 0%, 55% { transform: translateX(-60%); } 85%, 100% { transform: translateX(60%); } }
.pk-tear { position: absolute; left: 0; right: 0; top: 0; height: 13%; z-index: 2; opacity: 0; pointer-events: none;
  background: var(--pk) top / 100% 769.2% no-repeat; -webkit-mask: var(--pk) top / 100% 769.2% no-repeat; mask: var(--pk) top / 100% 769.2% no-repeat; }
/* the opening (shop.js reveal): over everything but the toasts */
.pko { position: fixed; inset: 0; z-index: 9500; display: flex; flex-direction: column; align-items: center; justify-content: safe center; overflow-x: hidden; overflow-y: auto; gap: 12px; padding: 16px; color: #fff; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; outline: none; animation: pkoin 0.25s ease; }
.pko.bye { opacity: 0; transition: opacity 0.2s; }
@keyframes pkoin { from { opacity: 0; } to { opacity: 1; } }
.pko-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(70% 55% at 50% 45%, #1d4a8a, #050d1f 75%); }
.pko.t-derby .pko-bg { background: radial-gradient(70% 55% at 50% 45%, #8a3a12, #12050a 75%); }
.pko.t-training .pko-bg { background: radial-gradient(70% 55% at 50% 45%, #5a4320, #0d0904 75%); }
.pko-rays { position: absolute; left: 50%; top: 45%; width: 180vmax; height: 180vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(rgba(255, 255, 255, 0.07) 0 9deg, transparent 9deg 18deg); animation: pkorays 30s linear infinite; }
@keyframes pkorays { to { transform: translate(-50%, -50%) rotate(360deg); } }
.pko-title { text-align: center; }
.pko-gift { display: inline-block; margin: 0 0 8px; padding: 5px 14px; border-radius: 999px; background: linear-gradient(90deg, #39d98a, #19d6f0); color: #04202b; font: 800 15px/1.2 "Barlow Condensed", sans-serif; letter-spacing: 0.03em; max-width: 92vw; }   /* (gifts.js: an admin's gift) */
.pko-title b { display: block; font: 900 italic clamp(26px, 7vw, 40px)/1 "Barlow Condensed", sans-serif; color: #ffd21f; letter-spacing: 0.04em; text-transform: uppercase; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); }
.pko-title small { display: block; margin-top: 4px; font: 600 15px/1.2 "Barlow Condensed", sans-serif; color: #cfe0ff; }
.pko-stage { position: relative; display: flex; align-items: center; justify-content: center; height: min(46vh, 340px); width: 100%; transition: height 0.4s ease; }
.pko-pack { width: min(52vw, 220px); cursor: pointer; animation: pkobob 1.6s ease-in-out infinite; }
@keyframes pkobob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-10px) rotate(1.5deg); } }
.pko.shake .pko-pack { animation: pkoshake 0.56s linear; }
@keyframes pkoshake { 0% { transform: rotate(0) scale(1); } 15% { transform: rotate(-7deg) scale(1.04); } 30% { transform: rotate(7deg) scale(1.06); } 45% { transform: rotate(-8deg) scale(1.08); } 60% { transform: rotate(8deg) scale(1.1); } 80% { transform: rotate(-4deg) scale(1.12); } 100% { transform: rotate(0) scale(1.14); } }
.pko.torn .pko-pack { animation: none; transform: scale(1.14); }
.pko.torn .pkw:not(.locker) .pk { clip-path: inset(12.6% 0 0 0); }   /* (the strip's gone from the pack: it's the piece flying off) */
.pko.torn .pk-tear { animation: pkotear 0.6s ease-out forwards; }
@keyframes pkotear { 0% { opacity: 1; transform: none; } 20% { opacity: 1; transform: translate(4%, -20%) rotate(4deg); } 100% { transform: translate(45%, -280%) rotate(30deg); opacity: 0; } }
/* the Legend Locker: no strip; the door swings open on a glow */
.pkw.locker::before { content: ""; position: absolute; inset: 7% 8% 5% 10%; border-radius: 6px; background: radial-gradient(circle at 50% 45%, #fff6c8, #ffc41f 35%, #6a3b00 80%); opacity: 0; transition: opacity 0.3s; }
.pko.torn .pkw.locker::before { opacity: 1; }
.pko.torn .pkw.locker .pk { transform-origin: 8% 50%; transform: perspective(800px) rotateY(-78deg); transition: transform 0.55s cubic-bezier(0.3, 1.3, 0.5, 1); }
.pko.t-legend .pko-bg { background: radial-gradient(70% 55% at 50% 45%, #2b3f8a, #05081a 75%); }
.pko.t-event .pko-bg { background: radial-gradient(70% 55% at 50% 45%, #5a2390, #0c0518 75%); }
.pko.torn .pko-pack::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.95), transparent 60%); animation: pkoflash 0.5s ease-out forwards; }
@keyframes pkoflash { from { opacity: 1; } to { opacity: 0; } }
.pko.out .pko-pack { transition: transform 0.45s ease-in, opacity 0.45s; transform: translateY(70%) scale(0.9); opacity: 0; pointer-events: none; }   /* (gone, but still there: it sat over COLLECT and took its taps) */
.pko.fanned .pko-stage { height: 0; }
.pko-burst { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.pko-burst i { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 2px; background: #fff3a0; opacity: 0; }
.pko-burst i.gold { background: #ffd21f; width: 10px; height: 10px; }
.pko-burst.go i { animation: pkoburst 0.8s ease-out var(--d) forwards; }
@keyframes pkoburst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(260deg); } }
/* the cards: out of the pack face down, fanned out, then turned over */
.pko-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; perspective: 900px; }
.pkc { width: min(28vw, 132px); aspect-ratio: 3 / 4.2; opacity: 0; transform: translateY(60px) scale(0.6); transition: transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) calc(var(--i) * 0.08s), opacity 0.3s calc(var(--i) * 0.08s); }
.pko-cards.n5 .pkc { width: min(29vw, 118px); }
.pko.fanned .pkc { opacity: 1; transform: none; }
.pkc-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.3, 1.3, 0.5, 1); }
.pkc.up .pkc-in { transform: rotateY(180deg); }
.pkc-back, .pkc-face { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.pkc-back { background: url("assets/packs/card_back.webp") center / 100% 100% no-repeat; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5); }   /* (the owner's card back) */
.pkc-logo { display: none; }
.pkc-face { transform: rotateY(180deg); background: #0b1730; border: 3px solid #8fb4ff; display: flex; flex-direction: column; box-shadow: 0 0 22px var(--glow, rgba(143, 180, 255, 0.5)); }
.pkc.r-common .pkc-face { border-color: #b0bec5; --glow: rgba(176, 190, 197, 0.4); }
.pkc.r-rare .pkc-face { border-color: #4fc3f7; --glow: rgba(79, 195, 247, 0.6); }
.pkc.r-epic .pkc-face { border-color: #b06bff; --glow: rgba(176, 107, 255, 0.7); }
.pkc.r-legend .pkc-face { border-color: #ffd21f; --glow: rgba(255, 210, 31, 0.8); }
.pkc-face img, .pkc-noart { width: 100%; height: 64%; object-fit: cover; background: #1a2b4a; }
.pkc-rar { position: absolute; left: 6px; top: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(5, 13, 31, 0.8); font: 800 10px/1.3 "Barlow Condensed", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.pkc-nm { padding: 4px 6px 0; font: 900 clamp(12px, 3.4vw, 16px)/1 "Barlow Condensed", sans-serif; text-align: center; }
.pkc-use { margin-top: auto; padding: 4px 6px 6px; text-align: center; color: #7dff9e; font: 900 italic clamp(14px, 4vw, 19px)/1 "Barlow Condensed", sans-serif; }
.pkc-use small { display: block; color: #9fb3d6; font: 600 11px/1.2 "Barlow Condensed", sans-serif; font-style: normal; }
.pkc-new { position: absolute; left: -26px; top: 12px; width: 110px; padding: 2px 0; transform: rotate(-38deg); background: #ff3d57; color: #fff; font: 900 11px/1.3 "Barlow Condensed", sans-serif; letter-spacing: 0.06em; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.pkc.new.up .pkc-in { animation: pkcnew 0.9s ease 0.5s; }
@keyframes pkcnew { 0%, 100% { filter: none; } 40% { filter: brightness(1.6) drop-shadow(0 0 18px #ffd21f); } }
.pko-btns { position: relative; z-index: 3; min-height: 56px; }
.pko-go { min-width: 200px; min-height: 52px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #ffe066, #f5a623); color: #3a2200; font: 900 italic 22px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.06em; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); cursor: pointer; animation: pkoin 0.3s ease; }
.pko.rm *, .pko.rm { animation: none !important; transition: none !important; }

/* the SHOP button on the Match Deck page (clash.js deckPage5, on its 1080-wide stage) and a card's uses there */
.mk5 .mk-shop { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 4px solid #fff; border-radius: 26px; background: linear-gradient(180deg, #ffe066, #f5a623); color: #3a2200; font: 900 italic 40px/1 "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: 0.04em; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); cursor: pointer; }
.mk5 .mk-shop small { font: 800 17px/1.1 "Barlow Condensed", sans-serif; font-style: normal; letter-spacing: 0.05em; }
.mk5 .mk-card .mk-uses { position: absolute; right: 8px; top: 40px; padding: 4px 12px; border-radius: 99px; background: rgba(8, 14, 28, 0.88); border: 3px solid #ffd21f; color: #ffd21f; font: 900 italic 26px/1 "Barlow Condensed", sans-serif; }
.mk5 .mk-card .mk-uses.out { border-color: #ff5a5a; color: #ff8a80; }
/* the Pitch Rivals screen (clash.js): the Card Shop row under the deck */
.prh-shop { display: flex; align-items: center; gap: 10px; width: 100%; margin: 10px 0 4px; padding: 10px 12px; border: 2px solid #f5a623; border-radius: 14px; background: linear-gradient(90deg, #2a1d00, #13203a); color: #fff; text-align: left; font: inherit; cursor: pointer; }
.prh-shop i { font-style: normal; font-size: 28px; }
.prh-shop span { flex: 1 1 auto; min-width: 0; }
.prh-shop b { display: block; font: 900 18px/1.1 "Barlow Condensed", sans-serif; color: #ffd21f; }
.prh-shop small { display: block; font: 500 12px/1.25 "Barlow Condensed", sans-serif; color: #d6dff0; }
.prh-shop em { padding: 6px 12px; border-radius: 10px; background: #ffd21f; color: #3a2200; font: 900 italic 16px/1 "Barlow Condensed", sans-serif; }
/* the SHOP button on Home (game.js showMenu: on its 853-wide stage, beside the wallet) */
.h3-stage .h3-shop { left: 408px; top: 186px; width: 150px; height: 72px; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid #fff; border-radius: 22px; background: linear-gradient(180deg, #ffe066, #f5a623); color: #3a2200; font: 900 italic 34px/1 "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: 0.04em; box-shadow: 0 5px 12px rgba(0, 0, 0, 0.5); }
.h3-stage .h3-shop small { font: 800 15px/1 "Barlow Condensed", sans-serif; font-style: normal; letter-spacing: 0.08em; }
.h3-stage .h3-shop:active { transform: scale(0.95); }
