/* ---------- פלייסטיילים בארנה (js/arena-styles.js, 20.11.2026) ----------
   האנימציה שמראה שפלייסטייל הופעל: המסך מתכהה, שני פסי אור חוצים, האייקון (בצבע של סוג הקלף) נוחת עם הבזק,
   קרני אור מסתובבות, שתי טבעות הדף וניצוצות פיקסל, הקלף של השחקן נכנס מהצד, ואז השם, השחקן ושורת היתרון.
   ירוק = השחקן שלך, אדום = של היריב. 2.4 שניות (FX_MS), ורק אחריה מופיע האתגר */
.ps-fx {
  --c: 61, 255, 176;
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  animation: ps-in .25s ease-out both;
}
.ps-fx.them { --c: 255, 106, 85; }
.ps-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(var(--c), .2), rgba(2, 6, 12, .9) 70%);
}
.ps-fx.out { animation: ps-out .34s ease-in forwards; }
@keyframes ps-in { from { opacity: 0; } }
@keyframes ps-out { to { opacity: 0; transform: scale(1.05); } }

.ps-streak {
  position: absolute;
  left: -60%;
  top: 38%;
  width: 220%;
  height: 11vh;
  rotate: -14deg;
  background: linear-gradient(90deg, transparent 30%, rgba(var(--c), .35) 44%, rgba(255, 255, 255, .9) 50%, rgba(var(--c), .35) 56%, transparent 70%);
  animation: ps-streak .75s cubic-bezier(.3, .6, .2, 1) both;
}
.ps-streak.s2 { top: 54%; height: 4vh; rotate: -14deg; animation-delay: .12s; opacity: .7; }
@keyframes ps-streak { from { translate: -60% 0; opacity: 0; } 30% { opacity: 1; } to { translate: 60% 0; opacity: 0; } }

.ps-stage { position: relative; display: flex; align-items: center; gap: 3vw; direction: rtl; max-width: 96vw; }

.ps-card { width: min(11vw, 19vh); filter: drop-shadow(0 0 2.4vh rgba(var(--c), .55)); animation: ps-card .55s .08s cubic-bezier(.2, .9, .3, 1.15) both; }
.ps-card > .card { width: 100%; }
@keyframes ps-card { from { opacity: 0; transform: translateX(10vw) perspective(60vh) rotateY(-50deg) scale(.7); } }
.ps-fx.them .ps-card { animation-name: ps-card-l; }
@keyframes ps-card-l { from { opacity: 0; transform: translateX(-10vw) perspective(60vh) rotateY(50deg) scale(.7); } }

.ps-core { position: relative; width: min(24vh, 20vw); aspect-ratio: 87 / 75; display: grid; place-items: center; }
.ps-rays {
  position: absolute;
  inset: -55%;
  background: repeating-conic-gradient(from 0deg, rgba(var(--c), .38) 0 7deg, transparent 7deg 20deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  animation: ps-spin 5s linear infinite, ps-rays .5s .2s ease-out both;
}
@keyframes ps-spin { to { rotate: 360deg; } }
@keyframes ps-rays { from { opacity: 0; scale: .3; } }
.ps-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: .6vh solid rgba(var(--c), .95);
  box-shadow: 0 0 2vh rgba(var(--c), .8);
  opacity: 0;
  animation: ps-ring .8s .3s ease-out both;
}
.ps-ring.r2 { border-color: rgba(255, 255, 255, .9); animation-delay: .45s; }
@keyframes ps-ring { from { scale: .3; opacity: 1; } to { scale: 2.6; opacity: 0; } }
.ps-icon {
  position: relative;
  width: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 1.6vh rgba(var(--c), .95)) drop-shadow(0 .6vh 0 rgba(0, 0, 0, .5));
  animation: ps-slam .55s .12s cubic-bezier(.2, 1.5, .4, 1) both, ps-float 1.6s .7s ease-in-out infinite alternate;
}
@keyframes ps-slam { from { opacity: 0; scale: 2.8; rotate: -18deg; filter: blur(6px) brightness(3); } 60% { opacity: 1; } }
@keyframes ps-float { to { translate: 0 -.8vh; } }
.ps-flash {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff, rgba(var(--c), .6) 40%, transparent);
  opacity: 0;
  animation: ps-flash .5s .38s ease-out both;
}
@keyframes ps-flash { 0% { opacity: 0; scale: .4; } 25% { opacity: 1; } 100% { opacity: 0; scale: 1.4; } }
.ps-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.1vh;
  height: 1.1vh;
  background: #fff;
  box-shadow: 0 0 1vh rgba(var(--c), 1);
  opacity: 0;
  rotate: var(--a);
  animation: ps-spark .75s .42s ease-out both;
}
.ps-spark:nth-child(odd) { background: rgb(var(--c)); width: .8vh; height: .8vh; }
@keyframes ps-spark { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(var(--d)); } }

.ps-text { display: flex; flex-direction: column; align-items: flex-start; gap: .7vh; min-width: min(26vw, 46vh); }
.ps-tag { font: 400 clamp(8px, 1.4vh, 14px) "Pixel", monospace; letter-spacing: .3em; color: rgb(var(--c)); animation: ps-up .4s .3s both; }
.ps-name {
  font: 400 clamp(11px, min(4.6vh, 2.6vw), 50px) "Pixel", monospace;   /* גם השם הארוך ביותר (PRECISION HEADER) נכנס ברוחב */
  color: #fff;
  text-shadow: 0 0 2vh rgba(var(--c), .9), .4vh .4vh 0 rgba(0, 0, 0, .6);
  white-space: nowrap;
  animation: ps-name .55s .32s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes ps-name { from { opacity: 0; letter-spacing: .5em; filter: blur(4px); } }
.ps-who { display: flex; align-items: baseline; gap: .8vw; animation: ps-up .4s .5s both; }
.ps-player { font: 800 clamp(13px, 2.6vh, 28px) var(--ar-wide); color: #fff; }
.ps-team { font: 700 clamp(11px, 1.9vh, 20px) var(--ar-font); color: rgba(var(--c), .95); }
.ps-line {
  font: 800 clamp(12px, 2.3vh, 25px) var(--ar-font);
  color: #0a0f14;
  background: rgb(var(--c));
  padding: .5vh 1.2vw .5vh 2.4vw;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 3% 100%);
  animation: ps-up .4s .62s both;
}
@keyframes ps-up { from { opacity: 0; transform: translateY(1.4vh); } }

/* תג על הקלף בדו-קרב: הפלייסטייל פעיל עכשיו */
.sk-card { position: relative; }
.ps-badge {
  position: absolute;
  top: -1.4vh;
  left: -1.4vh;
  width: 42%;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 1.2vh rgba(61, 255, 176, .95));
  animation: ps-badge .5s cubic-bezier(.2, 1.5, .4, 1) both, ps-pulse 1.2s .5s ease-in-out infinite alternate;
  z-index: 3;
}
.ps-badge.them { filter: drop-shadow(0 0 1.2vh rgba(255, 106, 85, .95)); }
@keyframes ps-badge { from { scale: 2; opacity: 0; } }
@keyframes ps-pulse { to { scale: 1.12; } }

/* ---------- דו-קרבות חדשים של פלייסטיילים (js/match.js runSkill) ---------- */
/* header (Precision Header / Whipped Pass): טבעת שמתכווצת אל הכדור. לוחצים כשהיא נוגעת בכדור */
.sk-head { position: relative; width: 26vh; height: 26vh; display: grid; place-items: center; }
.sk-head-ball {
  width: 9vh;
  height: 9vh;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #d8dde6 55%, #8b93a3);
  box-shadow: 0 0 0 .5vh rgba(255, 213, 74, .9), 0 0 3vh rgba(255, 213, 74, .6);
}
.sk-head-ring { position: absolute; left: 50%; top: 50%; width: 9vh; height: 9vh; translate: -50% -50%; border-radius: 50%; border: .7vh solid #3dffb0; box-shadow: 0 0 2vh rgba(61, 255, 176, .7); }
.sk-head-ring.bot { border-color: #ff8a75; box-shadow: 0 0 2vh rgba(255, 138, 117, .7); opacity: 0; }
.sk-head-ring.bot.show { opacity: 1; transition: opacity .25s; }

/* race (Rapid): שני רצים במסלול, מי שמגיע ראשון לכדור */
.sk-race { position: relative; width: min(56vw, 100vh); display: flex; flex-direction: column; gap: 1.2vh; }
.sk-lane { position: relative; height: 4.4vh; border-radius: 99px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 .3vh rgba(255, 255, 255, .14); }
.sk-lane::after { content: ""; position: absolute; right: 1vh; top: 50%; width: 3vh; height: 3vh; translate: 0 -50%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c9ced8 60%, #8b93a3); }
.sk-runner { position: absolute; top: 50%; left: 0; width: 3.6vh; height: 3.6vh; translate: 0 -50%; border-radius: 1vh; background: #3dffb0; box-shadow: 0 0 2vh rgba(61, 255, 176, .7); }
.sk-lane.them .sk-runner { background: #ff8a75; box-shadow: 0 0 2vh rgba(255, 138, 117, .7); }

/* trick (Trickster): רצף חצים, לוחצים לפי הסדר */
.sk-trick { display: flex; gap: 1.2vh; direction: ltr; }
.sk-arrow {
  width: 9vh;
  height: 9vh;
  display: grid;
  place-items: center;
  font: 900 6vh/1 var(--ar-wide);
  color: #fff;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 .4vh rgba(255, 255, 255, .25);
}
.sk-arrow.now { background: rgba(255, 213, 74, .25); box-shadow: inset 0 0 0 .5vh #ffd54a; animation: ar-pop .3s cubic-bezier(.34, 1.56, .64, 1); }
.sk-arrow.ok { background: #1aa874; box-shadow: inset 0 0 0 .4vh #3dffb0; }
.sk-arrow.bad { animation: sk-shake .3s; background: #a8321c; }
@keyframes sk-shake { 25% { translate: -.8vh 0; } 75% { translate: .8vh 0; } }
.sk-trick-pad { direction: ltr; grid-template-columns: repeat(4, 1fr); }
.sk-trick-pad .mt-opt { font: 900 4vh/1 var(--ar-wide); color: #fff; }
.sk-race .sk-runner { transition: left .08s linear; }
.sk-race + .sk-counts { margin-top: .4vh; }

/* footwork: חץ רמז מעל השער (לאן הבועט נשען) */
.sk-lean { position: absolute; top: -5.5vh; font: 900 4.4vh/1 var(--ar-wide); color: #3dffb0; text-shadow: 0 0 1.6vh rgba(61, 255, 176, .9); animation: ps-pulse .6s ease-in-out infinite alternate; }
.sk-lean.L { left: 12%; } .sk-lean.C { left: 50%; translate: -50% 0; } .sk-lean.R { right: 12%; }

/* block: מחסום בצד הסגור של השער (פסים צהובים-שחורים בסגנון הפיקסלים), והכפתור של הצד הזה כבוי */
.sk-block {
  position: absolute;
  bottom: 1.2vh;
  width: 26%;
  height: 46%;
  z-index: 1;
  border: .5vh solid #111;
  background: repeating-linear-gradient(135deg, #ffc51f 0 1.3vh, #141414 1.3vh 2.6vh);
  box-shadow: 0 0 0 .3vh #ffc51f, 0 .8vh 0 rgba(0, 0, 0, .45);
  animation: sk-block-in .35s steps(4) both;
}
.sk-block::before, .sk-block::after { content: ""; position: absolute; top: 100%; width: .9vh; height: 1.2vh; background: #111; }
.sk-block::before { left: 14%; } .sk-block::after { right: 14%; }
.sk-block.L { left: 4%; } .sk-block.C { left: 37%; } .sk-block.R { right: 4%; }
@keyframes sk-block-in { from { translate: 0 -4vh; opacity: 0; } }
.sk-dirs .mt-opt.blocked { opacity: .35; background: repeating-linear-gradient(135deg, rgba(255, 197, 31, .25) 0 1vh, transparent 1vh 2vh); }
.sk-dirs .mt-opt.blocked .px { filter: grayscale(1); }

html.mobile .ps-stage { flex-direction: column; gap: 1.6vh; }
html.mobile .ps-card { width: 28vw; }
html.mobile .ps-core { width: 30vw; }
html.mobile .ps-text { align-items: center; min-width: 0; }
html.mobile .ps-name { font-size: min(5.4vw, 4.6vh); }
html.mobile .sk-race, html.mobile .sk-trick-pad { width: 80vw; }
html.mobile .sk-arrow { width: 15vw; height: 15vw; font-size: 9vw; }

@media (prefers-reduced-motion: reduce) {
  .ps-rays, .ps-icon, .ps-badge { animation: none !important; }
}
