/* ---------- חנות ---------- */
/* החלקים הכלליים (שורה עליונה, כפתור חזרה, חלון, סרגלים, מספרים) מוגדרים ב-gallery.css */
:root {
  /* חיתוך קצוות החבילה בצורת "חותם" מרוטט */
  --pack-clip: polygon(0.00% 0, 1.67% 1.1%, 3.33% 0, 5.00% 1.1%, 6.67% 0, 8.33% 1.1%, 10.00% 0, 11.67% 1.1%, 13.33% 0, 15.00% 1.1%, 16.67% 0, 18.33% 1.1%, 20.00% 0, 21.67% 1.1%, 23.33% 0, 25.00% 1.1%, 26.67% 0, 28.33% 1.1%, 30.00% 0, 31.67% 1.1%, 33.33% 0, 35.00% 1.1%, 36.67% 0, 38.33% 1.1%, 40.00% 0, 41.67% 1.1%, 43.33% 0, 45.00% 1.1%, 46.67% 0, 48.33% 1.1%, 50.00% 0, 51.67% 1.1%, 53.33% 0, 55.00% 1.1%, 56.67% 0, 58.33% 1.1%, 60.00% 0, 61.67% 1.1%, 63.33% 0, 65.00% 1.1%, 66.67% 0, 68.33% 1.1%, 70.00% 0, 71.67% 1.1%, 73.33% 0, 75.00% 1.1%, 76.67% 0, 78.33% 1.1%, 80.00% 0, 81.67% 1.1%, 83.33% 0, 85.00% 1.1%, 86.67% 0, 88.33% 1.1%, 90.00% 0, 91.67% 1.1%, 93.33% 0, 95.00% 1.1%, 96.67% 0, 98.33% 1.1%, 100% 0, 100% 100%, 98.33% 98.9%, 96.67% 100%, 95.00% 98.9%, 93.33% 100%, 91.67% 98.9%, 90.00% 100%, 88.33% 98.9%, 86.67% 100%, 85.00% 98.9%, 83.33% 100%, 81.67% 98.9%, 80.00% 100%, 78.33% 98.9%, 76.67% 100%, 75.00% 98.9%, 73.33% 100%, 71.67% 98.9%, 70.00% 100%, 68.33% 98.9%, 66.67% 100%, 65.00% 98.9%, 63.33% 100%, 61.67% 98.9%, 60.00% 100%, 58.33% 98.9%, 56.67% 100%, 55.00% 98.9%, 53.33% 100%, 51.67% 98.9%, 50.00% 100%, 48.33% 98.9%, 46.67% 100%, 45.00% 98.9%, 43.33% 100%, 41.67% 98.9%, 40.00% 100%, 38.33% 98.9%, 36.67% 100%, 35.00% 98.9%, 33.33% 100%, 31.67% 98.9%, 30.00% 100%, 28.33% 98.9%, 26.67% 100%, 25.00% 98.9%, 23.33% 100%, 21.67% 98.9%, 20.00% 100%, 18.33% 98.9%, 16.67% 100%, 15.00% 98.9%, 13.33% 100%, 11.67% 98.9%, 10.00% 100%, 8.33% 98.9%, 6.67% 100%, 5.00% 98.9%, 3.33% 100%, 1.67% 98.9%, 0% 100%);
}

.pk-gold   { --pk: #ffd54a; --pk-rgb: 255, 200, 60; }
.pk-silver { --pk: #dbe9fb; --pk-rgb: 190, 215, 245; }
.pk-bronze { --pk: #ffc59a; --pk-rgb: 235, 150, 100; }
.pk-promo  { --pk: #cbc3ff; --pk-rgb: 140, 120, 255; }
.pk-promo2 { --pk: #ffb3c4; --pk-rgb: 255, 80, 120; }
.pk-teal   { --pk: #9ff5ea; --pk-rgb: 60, 220, 200; }
.pk-future { --pk: #c4b2ff; --pk-rgb: 150, 110, 255; }
.pk-arena  { --pk: #9fc2ff; --pk-rgb: 70, 120, 255; }    /* חבילות הארנה (פרסים בלבד) */
.pk-giant  { --pk: #ffc27a; --pk-rgb: 255, 150, 40; }
.pk-totwp  { --pk: #ffe28a; --pk-rgb: 230, 190, 60; }
.pk-red    { --pk: #ffb08a; --pk-rgb: 240, 90, 40; }      /* חבילת 84+ */
.pk-pick   { --pk: #e2c4ff; --pk-rgb: 170, 90, 240; }     /* בחירת שחקן */
.pk-legend { --pk: #fff3d6; --pk-rgb: 240, 215, 150; }    /* אגדות */
.pk-hero   { --pk: #ffb27a; --pk-rgb: 255, 130, 50; }     /* בלתי נשכחים */

#shop {
  justify-content: flex-start;
  align-items: stretch;
  gap: 1.8vh;
  padding: 3vh 2.5vw 2.5vh;
}
#shop.entering { animation: home-in .8s var(--ease-out) both; }
#shop.active .gal-top > * { animation: gal-drop .7s var(--ease-out) backwards; }
#shop.active .gal-top > :nth-child(2) { animation-delay: .1s; }
#shop.active .gal-top > :nth-child(3) { animation-delay: .2s; }

.shop-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.1fr 1.5fr;
  gap: 2vw;
}

.shop-body[hidden], .coach-shop[hidden] { display: none; }

/* ---------- קטגוריות ---------- */
.shop-tabs { flex: none; display: flex; justify-content: center; gap: 1.2vw; margin-top: -.4vh; }
.shop-tab {
  padding: 1.1vh 3vw;
  border: 0;
  cursor: pointer;
  background: rgba(6, 16, 31, .78);
  box-shadow: inset 0 0 0 3px #1c4fa8;
  clip-path: var(--notch);
  transition: transform .25s var(--ease-out), box-shadow .25s, background .25s;
}
.shop-tab .px { --u: max(1.7px, .34vh); }
.shop-tab.on { background: linear-gradient(170deg, rgba(40, 120, 220, .5), rgba(10, 30, 70, .85)); box-shadow: inset 0 0 0 3px #38a8ff; }
body.input-mouse .shop-tab:hover, .shop-tab.nav-focus { transform: translateY(-.4vh); box-shadow: inset 0 0 0 3px #6fb3ff; }
.shop-tab.nav-focus { outline: none; animation: none; box-shadow: inset 0 0 0 3px #ffd54a; }

/* ---------- חלקים בתוך "חבילות": קלאסיות / מיוחדות ---------- */
.shop-secs { flex: none; display: flex; justify-content: center; gap: .9vw; margin-top: -.6vh; }
.shop-secs[hidden] { display: none; }
.shop-sec {
  padding: .7vh 1.8vw;
  border: 0;
  cursor: pointer;
  background: rgba(6, 16, 31, .55);
  box-shadow: inset 0 -3px 0 rgba(60, 110, 200, .5);
  transition: box-shadow .2s, background .2s, transform .2s var(--ease-out);
}
.shop-sec .px { --u: max(1.4px, .28vh); }
.shop-sec.on { background: rgba(20, 60, 130, .6); box-shadow: inset 0 -3px 0 #ffd54a; }
body.input-mouse .shop-sec:not(.on):hover, .shop-sec.nav-focus:not(.on) { box-shadow: inset 0 -3px 0 #6fb3ff; transform: translateY(-.3vh); }
.shop-sec.nav-focus { outline: none; }
.shop-special { grid-template-columns: 1fr; }
.stand[hidden] { display: none; }
/* בלי עמדת פרומו: החבילות הקלאסיות לבד במרכז */
.shop-body.no-promo { grid-template-columns: minmax(0, min(100%, 120vh)); justify-content: center; }
.pk-green  { --pk: #a8f5bc; --pk-rgb: 60, 200, 110; }     /* 81 x5 */
.pk-blue   { --pk: #b4d2ff; --pk-rgb: 70, 130, 240; }     /* 82 x3 */
.stand-special .stand-packs { flex-wrap: wrap; align-content: center; gap: 3vh 2.4cqw; }
.stand-special .pack-slot { --w: min(13.4cqw, 25vh); }   /* שש חבילות בשורה אחת */

/* ---------- עמדה ---------- */
.stand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 2.2vh 1.6vw 2vh;
  overflow: hidden;
  background: linear-gradient(170deg, rgba(22, 48, 104, .64), rgba(5, 12, 27, .92) 62%);
  box-shadow: inset 0 0 0 4px #1c4fa8, inset 0 0 0 7px rgba(120, 180, 255, .14);
  clip-path: var(--notch);
}
.stand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 74%, rgba(110, 175, 255, .2), rgba(110, 175, 255, 0) 58%);
}
.stand-promo {
  background: linear-gradient(170deg, rgba(62, 42, 150, .6), rgba(8, 9, 32, .94) 62%);
  box-shadow: inset 0 0 0 4px #6a55e8, inset 0 0 0 7px rgba(190, 170, 255, .2);
}
.stand-promo::after { background: radial-gradient(ellipse at 50% 74%, rgba(150, 130, 255, .26), rgba(150, 130, 255, 0) 58%); }
#shop.active .stand { animation: stand-in .8s var(--ease-out) backwards; }
#shop.active .stand-classic { animation-delay: .12s; }
@keyframes stand-in { from { opacity: 0; transform: translateY(5vh); } }

.stand-head { flex: none; display: flex; align-items: center; gap: 1.2vw; }
.stand-head .px { --u: max(1.9px, .38vh); }
.stand-tag {
  --u: max(1.5px, .3vh);
  display: flex;
  padding: .8vh .9vw;
  background: #ffd54a;
  box-shadow: 0 .4vh 0 #b8860b;
  animation: tag-pulse 1.4s ease-in-out infinite;
}
@keyframes tag-pulse { 50% { transform: scale(1.1) rotate(-2deg); } }

.promo-timer { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6vh .9vw; margin-top: 1.2vh; }
.promo-timer .px { --u: max(1.4px, .28vh); }
.promo-time { font-size: clamp(11px, 2vh, 20px); color: #ffe27a; white-space: nowrap; }

.stand-packs {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.4cqw;
  container-type: inline-size;
}

/* ---------- חבילה ---------- */
.pack-slot {
  --w: min(28cqw, 27vh);
  flex: none;
  width: var(--w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8vh;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
/* חבילות הפרומו מתחלקות ברוחב העמדה לפי מספרן (--n) */
.stand-promo .pack-slot { --w: min(calc((100cqw - 2.4cqw * (var(--n, 1) - 1)) / var(--n, 1)), 24vh); }   /* 24vh: גם חבילה אחת לא עולה על הטיימר */
#shop.active .pack-slot { animation: pack-drop .9s cubic-bezier(.34, 1.56, .64, 1) calc(.4s + var(--i, 0) * .13s) backwards; }
@keyframes pack-drop { from { opacity: 0; transform: translateY(-16vh) rotate(-7deg) scale(.8); } }

.pack-bob { display: block; width: 100%; animation: pack-float 4.4s ease-in-out calc(var(--i, 0) * -.9s) infinite; }
@keyframes pack-float { 50% { transform: translateY(-1.1vh); } }

.pack {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 640 / 930;
  container-type: inline-size;
  transition: transform .35s var(--ease-out);
}
body.input-mouse .pack-slot:hover .pack,
.pack-slot.nav-focus .pack {
  transform: perspective(900px) translateY(-1.4vh) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.05);
}
.pack-slot:active .pack, .pack-slot.pressed .pack { transform: scale(.97) !important; transition-duration: .08s; }
.pack-slot.nav-focus { outline: none; animation: none; }
.pack-slot.nav-focus .pack-name { filter: drop-shadow(0 0 .6vh #ffd54a); }

/* צל וזוהר מאחורי החבילה (בלי פילטרים, כדי שהחנות תישאר חלקה) */
.pack::before {
  content: "";
  position: absolute;
  inset: 1% 2% 0;
  box-shadow: 0 2.4vh 3.2vh rgba(0, 0, 0, .6);
}
.pack-glow {
  position: absolute;
  inset: -12% -26% -8%;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 52%, rgba(var(--pk-rgb), .5), rgba(var(--pk-rgb), 0) 62%);
  opacity: .5;
  transition: opacity .35s;
}
body.input-mouse .pack-slot:hover .pack-glow,
.pack-slot.nav-focus .pack-glow { opacity: 1; }

.pack-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: var(--pack-clip);
}
.pack-art { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; }

/* קצוות האטימה: פסים דקים כמו בחבילת רדיד */
.pack-crimp {
  position: absolute;
  left: 0;
  right: 0;
  height: 5.5%;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .3) 0 1.5px, rgba(255, 255, 255, .22) 1.5px 3px, transparent 3px 7px);
}
.pack-crimp-top    { top: 0;    box-shadow: inset 0 -1.2cqw 1.6cqw rgba(0, 0, 0, .28); }
.pack-crimp-bottom { bottom: 0; box-shadow: inset 0 1.2cqw 1.6cqw rgba(0, 0, 0, .28); }

.pack-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .5) 50%, transparent 64%);
  transform: translateX(-140%);
  animation: pack-shine 7s ease-in-out calc(1.5s + var(--i, 0) * 1.4s) infinite;
}
@keyframes pack-shine { 0%, 62% { transform: translateX(-140%); } 82%, 100% { transform: translateX(140%); } }
body.input-mouse .pack-slot:hover .pack-shine,
.pack-slot.nav-focus .pack-shine { animation: pack-shine-now .9s var(--ease-out); }
@keyframes pack-shine-now { from { transform: translateX(-140%); } to { transform: translateX(140%); } }

.pack-label { display: flex; flex-direction: column; align-items: center; gap: .9vh; width: 100%; }
.pack-name { --u: max(1.6px, .32vh); display: flex; justify-content: center; width: 100%; }
.pack-name .px { max-width: 100%; height: auto; }
.pack-meta { display: flex; align-items: center; gap: .6vw; direction: ltr; }
.pack-coin { height: 3.6vh; }
.pack-meta .num { font-size: clamp(11px, 2vh, 20px); }

/* ---------- חלון חבילה ---------- */
.modal-pack { width: calc(66vh * .688); flex: none; }
.modal.open .modal-pack { animation: pack-modal-in .8s var(--ease-out) both; }
@keyframes pack-modal-in { from { opacity: 0; transform: perspective(900px) rotateY(-60deg) translateY(6vh) scale(.7); } }
.modal-pack .pack-shine { animation-delay: .6s; }
.pack-info { gap: 1.8vh; min-width: 28vw; }
.pk-title { --u: max(2.4px, .5vh); display: flex; }
.pk-price { display: flex; align-items: center; gap: .8vw; direction: ltr; }
.pk-price img { height: 5vh; }
.pk-price .num { font-size: clamp(14px, 2.8vh, 28px); }
.pk-size { --u: max(1.5px, .3vh); display: flex; }

/* ---------- מחיר כפול: מטבעות או יהלומים ---------- */
/* בחבילה בעמדה: יהלומים בשורה שנייה, מתחת למטבעות (pack-or משמש שבירת שורה) */
.pack-meta:has(.pack-gem) { flex-wrap: wrap; justify-content: center; row-gap: .5vh; }
.pack-or { flex-basis: 100%; height: 0; }
.pk-or { align-self: center; width: 2px; height: 3.6vh; margin: 0 .6vw; background: rgba(150, 200, 255, .4); }
.pack-gem { height: 3vh; }
.pk-price .pk-gem { height: 4.2vh; }
.gem-num { color: #c8f3ff; }
/* כפתור קנייה לכל מטבע: "קנה" ומתחת המחיר */
.pk-buys { display: flex; gap: 1vw; justify-content: center; flex-wrap: wrap; }
.pk-pay { display: inline-flex; flex-direction: column; align-items: center; gap: .7vh; min-width: 11vw; }
.pk-pay-price { display: inline-flex; align-items: center; gap: .45vw; direction: ltr; }
.pk-pay-price img { height: 2.6vh; }
.pk-pay-price .num { font-size: clamp(10px, 1.7vh, 17px); color: #3a2606; }
.btn-claim .pk-pay-price .num { text-shadow: none; }
.btn-buy .pk-pay-price .num { color: #cfd8ea; }
/* כפתור יהלומים: תכלת במקום זהב */
.btn-claim.pay-gems { background: linear-gradient(180deg, #b8f0ff, #42b8f0); box-shadow: inset 0 -.6vh 0 rgba(20, 80, 150, .45), inset 0 0 0 3px #e6fbff; }
.btn-claim.pay-gems .pk-pay-price .num { color: #0b2f55; }
.sm-again .pk-pay-price { margin-top: .5vh; }
.sm-again .pk-pay-price .num { color: #fff; }
.sm-again { display: inline-flex; flex-direction: column; align-items: center; }

/* טבלה אחת לכל השורות: עמודת התוויות ברוחב התווית הארוכה ביותר, כך שתווית ארוכה לא עולה על הפס והפסים מיושרים */
.odds { display: grid; grid-template-columns: max-content minmax(5vw, 1fr) max-content; align-items: center; gap: 1.1vh 1vw; width: 100%; padding: 1.6vh 1.4vw; background: rgba(6, 16, 31, .6); box-shadow: inset 0 0 0 3px #1c4fa8; }
/* הכותרת ושורת ההסבר על כל הרוחב */
.odds > :not(.odds-row) { grid-column: 1 / -1; }
.odds > :first-child { --u: max(1.3px, .25vh); margin-bottom: .3vh; }
.odds > .odds-note { --u: max(1.4px, .28vh); margin-top: .4vh; opacity: .8; }
.odds-row { display: contents; }
.odds-row .px { --u: max(1.4px, .28vh); }
.odds-row .num { font-size: clamp(9px, 1.5vh, 15px); text-align: left; }
.odds-row .bar { height: 1.3vh; }

.btn-buy {
  padding: 1.3vh 2vw;
  border: 0;
  background: rgba(70, 82, 110, .7);
  box-shadow: inset 0 0 0 3px #3b4a6c;
  clip-path: var(--notch);
  opacity: .8;
  cursor: not-allowed;
}
.btn-buy .px { --u: max(1.6px, .32vh); }

/* ---------- מאמנים ---------- */
.coach-shop {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
  padding: 1.8vh 1.6vw 1.4vh;
  overflow-y: auto;
  background: linear-gradient(170deg, rgba(22, 48, 104, .64), rgba(5, 12, 27, .92) 62%);
  box-shadow: inset 0 0 0 4px #1c4fa8, inset 0 0 0 7px rgba(120, 180, 255, .14);
  clip-path: var(--notch);
  scrollbar-width: thin;
  scrollbar-color: #1c4fa8 transparent;
}
#shop.active .coach-shop { animation: stand-in .6s var(--ease-out) backwards; }
.coach-note { flex: none; display: flex; justify-content: center; text-align: center; }
.coach-note .px { --u: max(1.4px, .28vh); }
.coach-grid {
  --cw: min(9.2vw, 19vh);
  display: grid;
  grid-template-columns: repeat(7, var(--cw));
  justify-content: center;
  align-content: start;
  gap: 2vh 1.4vw;
  padding: .6vh 0 1vh;
}
.coach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9vh;
  width: var(--cw);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: #fff;
}
/* אנימציית הכניסה רק כשהרשימה נבנית (המחלקה enter מוסרת אחרי רגע). אם היא קבועה על הפריט, כל מעבר פוקוס
   (שמבטל ומחזיר אותה) היה מריץ אותה מחדש, והמאמן היה נעלם לשנייה וחוזר */
.coach-grid.enter .coach-item { animation: slot-in .55s cubic-bezier(.34, 1.56, .64, 1) calc(.1s + var(--i, 0) * 40ms) backwards; }
.coach-item .card { width: 100%; }
body.input-mouse .coach-item:hover .card-inner,
.coach-item.nav-focus .card-inner { --s: 1.07; --ty: -1.2cqw; }
.coach-item.nav-focus { outline: 3px solid #ffd54a; outline-offset: .6vh; animation: none; }
.coach-item:active .card-inner, .coach-item.pressed .card-inner { --s: .97; }
.coach-meta { display: flex; align-items: center; justify-content: center; gap: .5vw; direction: ltr; min-height: 3.4vh; }
.coach-coin { height: 3vh; }
.coach-meta .num { font-size: clamp(10px, 1.7vh, 17px); }
.coach-owned { --u: max(1.4px, .28vh); display: flex; padding: .4vh .9vw; background: #2f9e44; box-shadow: 0 .3vh 0 #1b6a2c; }
.coach-item.bought .coach-owned { animation: coach-bought .7s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes coach-bought { from { opacity: 0; transform: scale(.3) rotate(-8deg); } }

@media (prefers-reduced-motion: reduce) {
  .coach-grid.enter .coach-item, .coach-shop { animation: none !important; }

  .pack-bob, .pack-shine, .pack-slot, .stand, .stand-tag { animation: none !important; }
}

/* ---------- החבילות שלי ---------- */
.shop-tab { display: flex; align-items: center; gap: .8vw; }   /* התג בתוך הלשונית: ללשונית יש חיתוך (clip-path), אז תג שבולט החוצה היה נחתך */
.tab-badge {
  min-width: 3.4vh;
  height: 3.4vh;
  padding: 0 .6vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font: normal 400 clamp(10px, 1.8vh, 18px) "Pixel", monospace;
  color: #3a2600;
  background: linear-gradient(180deg, #ffe27a, #ffb300);
  box-shadow: 0 .3vh 0 rgba(120, 70, 0, .7), inset 0 0 0 2px #fff3b0;
}
.tab-badge[hidden] { display: none; }

.mypacks-grid {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 3vh 3.4vw;
  padding: 1vh 0 2vh;
}
.mypacks .pack-slot { --w: min(21vh, 15vw); position: relative; }
/* המספר של החבילות מאותו סוג, בפינה הימנית העליונה של החבילה */
.pack-count {
  position: absolute;
  z-index: 2;
  top: -1.4vh;
  right: -1vw;
  min-width: 6.4vh;
  height: 6.4vh;
  padding: 0 1vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font: normal 400 clamp(13px, 2.8vh, 28px) "Pixel", monospace;
  text-shadow: none;
  color: #3a2600;
  background: linear-gradient(180deg, #ffe27a, #ffb300);
  box-shadow: 0 .5vh 0 rgba(120, 70, 0, .75), inset 0 0 0 3px #fff3b0, 0 1vh 2vh rgba(0, 0, 0, .5);
  pointer-events: none;
}
.pack-limit { --u: max(1.4px, .27vh); display: flex; justify-content: center; opacity: .85; }

/* חבילה שאפשר לקנות פעם אחת והיא כבר נקנתה: עמומה */
.pack-slot.sold .pack, .pack-slot.sold .pack-label .pack-name, .pack-slot.sold .pack-meta { filter: grayscale(.85) brightness(.55); }
.pack-slot.sold .pack-shine { display: none; }
