/* ---------- המסך הראשי והסרגל העליון בסגנון FC27 ---------- */
/* מחשב ושלט בלבד: כל הכללים תחת html:not(.mobile). בטלפון אלה מוסתרים (העיצוב של הטלפון ב-mobile.css, ועדיין בלי FC). */
/* הפריסה מועתקת מהתמונות של FC27 כמו שהיא (לא הפוכה לעברית): סדר הלשוניות משמאל לימין, כותרת וטקסט בצד שמאל של הלוח, חבילות ופרומו מימין. */

html:not(.mobile) {
  --bar-h: clamp(50px, 9.8vh, 112px);     /* גובה הסרגל העליון */
  --fc-font: "Heebo", "Assistant", "Segoe UI", "Arial", system-ui, sans-serif;
  --fc-green: #8be04e;
}

html.mobile #topbar, html.mobile .hub { display: none !important; }

/* ---------- סרגל עליון ---------- */
html:not(.mobile) #topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar-h);
  z-index: 40;
  display: flex;
  align-items: center;
  direction: ltr;
  gap: 1.5vw;
  padding: 1.4vh 2.2vw 0;
  font-family: var(--fc-font);
  background: linear-gradient(180deg, rgba(2, 6, 13, .82), rgba(2, 6, 13, 0));
  transition: transform .55s var(--ease-out), opacity .4s;
}
html:not(.mobile) body:not(.bar-on) #topbar { transform: translateY(-105%); opacity: 0; pointer-events: none; }

.tb-logo { flex: none; height: 6.6vh; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .3s var(--ease-out); }
.tb-logo img { display: block; height: 100%; width: auto; }
body.input-mouse .tb-logo:hover { transform: scale(1.06); }
.tb-logo.bump { animation: bump .5s var(--ease-out); }
.tb-main { flex: none; font-size: clamp(16px, 2.6vh, 30px); font-weight: 800; color: #fff; letter-spacing: .01em; }
.tb-sep { flex: none; width: 1px; height: 5vh; background: rgba(255, 255, 255, .28); }

.tb-nav { position: relative; flex: none; }
.tb-tabs { position: relative; display: flex; align-items: center; gap: clamp(14px, 2.5vw, 56px); }
.tb-tab {
  position: relative;
  padding: .6vh 0;
  border: 0;
  background: none;
  cursor: pointer;
  white-space: nowrap;
  font: 500 clamp(12px, 2.15vh, 26px) var(--fc-font);
  color: rgba(255, 255, 255, .6);
  transition: color .25s, transform .3s var(--ease-out);
}
/* רוחב קבוע: הגופן המודגש (של הלשונית הנבחרת) מוזמן מראש, כדי שהלשוניות לא יזוזו כשהבחירה עוברת */
.tb-label { display: inline-flex; flex-direction: column; align-items: center; }
.tb-label::after { content: attr(data-t); height: 0; overflow: hidden; visibility: hidden; font-weight: 800; }
body.input-mouse .tb-tab:hover { color: #fff; }
.tb-tab.on { color: #fff; font-weight: 800; transform: translateY(-.15vh); }
/* קו שגולש מתחת ללשונית הנבחרת. בסיבוב מקצה לקצה הוא נעלם, קופץ ומופיע (class jump) */
.tb-ind {
  position: absolute;
  left: 0;
  bottom: -.35vh;
  height: .38vh;
  width: 0;
  border-radius: 1vh;
  background: #fff;
  box-shadow: 0 0 1.1vh rgba(255, 255, 255, .7);
  transition: transform .46s var(--ease-out), width .46s var(--ease-out), opacity .3s;
  pointer-events: none;
}
.tb-ind.hide, .tb-ind.jump { opacity: 0; }
.tb-ind.jump { transition: none; }
.tb-dot {
  position: absolute;
  top: -.1vh;
  right: -.9vh;
  width: .95vh;
  height: .95vh;
  border-radius: 50%;
  background: var(--fc-green);
  box-shadow: 0 0 .8vh rgba(139, 224, 78, .8);
}
.tb-dot[hidden] { display: none; }

/* L1 / R1 תלויים על קצה המסך מעל הלשוניות, כמו ב-FC */
.tb-chips { position: absolute; left: 0; top: -4.4vh; display: flex; gap: .5vw; }
.tb-chips i {
  display: grid;
  place-items: center;
  min-width: 2.9vw;
  height: 2.6vh;
  padding: 0 .5vw;
  font: 700 clamp(8px, 1.25vh, 13px) var(--fc-font);
  font-style: normal;
  color: #e8ecf2;
  background: rgba(58, 62, 72, .92);
  border-radius: 0 0 .8vh .8vh;
}
/* לחיצה על L1 / R1: השבב נלחץ ומבליח */
.tb-chips i.press { animation: chip-press .3s var(--ease-out); }
@keyframes chip-press {
  0%   { transform: translateY(-.4vh); background: rgba(58, 62, 72, .92); }
  35%  { transform: translateY(.5vh) scale(.94); background: #fff; color: #10151f; box-shadow: 0 0 1.4vh rgba(255, 255, 255, .8); }
  100% { transform: none; }
}

.tb-coins { margin-left: auto; display: flex; align-items: center; gap: .6vw; font: 500 clamp(13px, 2.15vh, 26px) var(--fc-font); color: rgba(255, 255, 255, .88); }
.tb-coins img { height: 3.6vh; width: auto; }

/* ---------- העמודים הפנימיים ---------- */
/* בתוך עמוד הסרגל מוסתר לגמרי (js/hub.js מסיר את bar-on), והעמוד מקבל את כל המסך עם הכותרת הישנה שלו (חזרה, שם, מטבעות). */
/* כניסה לעמוד: המשך הזום של המסך הראשי (קרוב יותר ואז מתיישב) */
html:not(.mobile) :is(#gallery, #myteam, #sbc, #draft, #shop, #missions, #settings, #market, #totw, #styles).entering { animation: fc-page-in .65s var(--ease-out) both; }
@keyframes fc-page-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }

/* ---------- המסך הראשי ---------- */
/* הכרטיס הישן של הבית (אריחים, חדשות, אייקונים) מוסתר במחשב */
html:not(.mobile) #home > .logo-btn,
html:not(.mobile) #home > .hud-left,
html:not(.mobile) #home > .hud-right,
html:not(.mobile) #home > .home-main,
html:not(.mobile) #home > .news { display: none; }

.hub {
  position: absolute;
  inset: 0;
  direction: ltr;
  font-family: var(--fc-font);
  color: #fff;
}

.hub-main, .hub-promo {
  position: absolute;
  top: 19.8vh;
  height: 59.4vh;
  border-radius: 1.3vh;
  overflow: hidden;
}
.hub-main {
  left: 9vw;
  width: 52.8vw;
  background: linear-gradient(135deg, rgba(135, 172, 218, .5), rgba(104, 118, 190, .58));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 .25vh rgba(150, 225, 240, .55), 0 2vh 5vh rgba(0, 0, 0, .35);
}
.hub-main.can-enter { cursor: pointer; }
.hub-promo {
  left: 64.6vw;
  width: 26.4vw;
  padding: 3.6vh 1.9vw;
  direction: rtl;
  text-align: left;
  background: linear-gradient(180deg, rgba(44, 46, 52, .96), rgba(26, 27, 31, .96));
  box-shadow: 0 2vh 5vh rgba(0, 0, 0, .35);
}
.hp-title { font-size: 4vh; font-weight: 800; line-height: 1.1; }
.hp-body { margin-top: 2.2vh; font-size: 2.35vh; line-height: 1.4; }
.hp-cards {
  direction: ltr;               /* הגבוה ראשון משמאל, כמו בתמונות של FC */
  position: absolute;
  left: 50%;
  bottom: 8vh;
  translate: -50% 0;
  display: grid;
  grid-template-columns: repeat(2, 6.2vw);
  gap: 1.4vh 1.1vw;
}
.hp-cards i {
  display: grid;
  place-items: center;
  aspect-ratio: 728 / 999;
  border-radius: 1.1vh;
  background: linear-gradient(165deg, rgba(88, 92, 104, .75), rgba(48, 50, 58, .8));
  box-shadow: inset 0 0 0 .22vh rgba(255, 255, 255, .22), 0 1vh 2vh rgba(0, 0, 0, .35);
}
.hp-cards > :nth-child(n + 3) { translate: 2.1vw 0; }
.hp-cards b { font-size: 4.4vh; font-weight: 800; color: rgba(255, 255, 255, .42); }

/* ---------- פרומו פעיל (js/hub.js buildPromoPanel) ----------
   צבעי הפרומו (כוכבי העתיד): סגול עמוק, ורוד-מג'נטה ותכלת, כמו הקלף. השכבות מלמטה למעלה:
   רקע (.hp-fx: זוהר, קרני אור מסתובבות, רשת אלכסונית, שם באנגלית שזז, ניצוצות) > כותרת > קרוסלת קלפים > תחתית. מסגרת ניאון רצה סביב הלוח. */
@property --hp-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.hub-promo.has-promo {
  --hp-pink: #ff5fd2;
  --hp-cyan: #6fe4ff;
  --hp-violet: #8b5cff;
  padding: 0;
  cursor: pointer;
  background:
    radial-gradient(120% 60% at 50% 108%, rgba(255, 70, 200, .5), transparent 60%),
    radial-gradient(90% 50% at 85% -5%, rgba(90, 200, 255, .35), transparent 60%),
    linear-gradient(170deg, #3a1597 0%, #22095f 45%, #12053a 100%);
  box-shadow: 0 2vh 5vh rgba(0, 0, 0, .45), 0 0 4vh rgba(140, 80, 255, .25);
  transition: transform .35s var(--ease-out), box-shadow .35s;
}
body.input-mouse .hub-promo.has-promo:hover { transform: translateY(-.5vh); box-shadow: 0 2.6vh 6vh rgba(0, 0, 0, .5), 0 0 6vh rgba(170, 100, 255, .45); }
/* מסגרת ניאון: פס אור שרץ סביב הלוח */
.hub-promo.has-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  padding: .28vh;
  background: conic-gradient(from var(--hp-a), rgba(111, 228, 255, .25), var(--hp-cyan) 8%, #fff 11%, var(--hp-pink) 15%, rgba(255, 95, 210, .2) 24%, rgba(139, 92, 255, .3) 50%, rgba(111, 228, 255, .25) 58%, var(--hp-pink) 66%, #fff 69%, var(--hp-cyan) 72%, rgba(111, 228, 255, .25) 82%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: hp-spin 6s linear infinite;
  pointer-events: none;
}
@keyframes hp-spin { to { --hp-a: 360deg; } }

.hp-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hp-glow {
  position: absolute; left: 50%; top: 60%; width: 34vh; height: 34vh;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 230, .55), rgba(140, 80, 255, .25) 45%, transparent 70%);
  animation: hp-breathe 3.2s ease-in-out infinite;
}
@keyframes hp-breathe { 50% { scale: 1.15; opacity: .75; } }
.hp-rays {
  position: absolute; left: 50%; top: 60%; width: 90vh; height: 90vh;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .09) 0deg 5deg, transparent 5deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 8%, transparent 52%);
  mask: radial-gradient(circle, #000 8%, transparent 52%);
  animation: hp-rot 26s linear infinite;
}
@keyframes hp-rot { to { rotate: 360deg; } }
.hp-grid {
  position: absolute; inset: -20%;
  background: repeating-linear-gradient(115deg, transparent 0 3.2vh, rgba(150, 220, 255, .05) 3.2vh 3.4vh);
  animation: hp-grid 9s linear infinite;
}
@keyframes hp-grid { to { translate: 7.6vh 0; } }
/* השם באנגלית: אותיות חלולות ענקיות שזזות לאט מאחורי הקלפים */
.hp-mark { position: absolute; left: 0; right: 0; top: 47%; rotate: -8deg; }
.hp-mark-run { display: flex; width: max-content; animation: hp-marquee 22s linear infinite; }
.hp-mark span {
  padding-right: 4vh;
  font: italic 900 10vh/1 var(--fc-font);
  letter-spacing: -.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: .18vh rgba(190, 150, 255, .22);
}
@keyframes hp-marquee { to { translate: -50% 0; } }
/* ניצוצות: כוכבים קטנים בעלי ארבע קצוות שעולים ומנצנצים */
.hp-sparks i {
  position: absolute; left: var(--x); bottom: -3vh;
  width: 1.5vh; height: 1.5vh;
  scale: var(--z);
  background: #ffc8f4;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 .6vh var(--hp-pink));
  animation: hp-spark var(--d) linear var(--w) infinite;
}
.hp-sparks i.c { background: #d4f6ff; filter: drop-shadow(0 0 .6vh var(--hp-cyan)); }
@keyframes hp-spark {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  50% { opacity: .35; }
  70% { opacity: 1; }
  100% { transform: translateY(-62vh) rotate(200deg); opacity: 0; }
}

/* כותרת */
.hp-head { position: relative; z-index: 3; padding: 3.1vh 1.9vw 0; }
.hp-kicker { display: flex; align-items: center; gap: .8vw; direction: ltr; }
.hp-live {
  display: inline-flex; align-items: center; gap: .55vh;
  padding: .45vh 1.1vh;
  border-radius: 99px;
  font-size: 1.55vh; font-weight: 800;
  color: #2a0a55;
  background: linear-gradient(90deg, #fff, #ffd2f4);
  box-shadow: 0 0 1.6vh rgba(255, 95, 210, .6);
}
.hp-live i { width: .9vh; height: .9vh; border-radius: 50%; background: #ff2fa8; animation: hp-pulse 1.2s ease-in-out infinite; }
@keyframes hp-pulse { 50% { box-shadow: 0 0 0 .6vh rgba(255, 47, 168, 0); opacity: .6; } 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 47, 168, .7); } }
.hp-en { font: italic 800 1.5vh var(--fc-font); letter-spacing: .32em; color: var(--hp-cyan); text-shadow: 0 0 1.2vh rgba(111, 228, 255, .7); direction: ltr; }
.has-promo .hp-title { margin-top: 1.4vh; font-size: 5.6vh; font-weight: 900; line-height: 1.05; filter: drop-shadow(0 .4vh 0 #1a0650) drop-shadow(0 0 2.2vh rgba(255, 95, 210, .55)); }
.hp-ttl {
  display: inline-block;
  padding: 0 .2vh .4vh;
  color: transparent;
  background: linear-gradient(100deg, #fff 0%, #fff 30%, #9ff0ff 42%, #fff 50%, #ffb0ea 58%, #fff 70%, #fff 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: hp-shine 4.5s ease-in-out infinite;
}
@keyframes hp-shine { 0% { background-position: 100% 0; } 60%, 100% { background-position: 0 0; } }
.hp-line {
  display: block; margin-top: .9vh; width: 62%; height: .35vh; border-radius: 9px;
  background: linear-gradient(90deg, var(--hp-cyan), var(--hp-pink) 60%, transparent);
  box-shadow: 0 0 1.2vh rgba(255, 95, 210, .7);
  transform-origin: left;
}
.has-promo .hp-body { margin-top: 1.3vh; font-size: 2.1vh; line-height: 1.35; color: rgba(240, 228, 255, .9); max-width: 92%; }

/* קרוסלה: הקלף שבאמצע גדול ומואר, שניים בצדדים מוטים ומוחשכים, השאר מוסתרים מאחור */
.hp-stage { position: absolute; z-index: 2; left: 0; right: 0; top: 23.5vh; bottom: 6.2vh; perspective: 90vh; }
.hp-halo {
  position: absolute; left: 50%; top: 46%; width: 30vh; height: 30vh;
  translate: -50% -50%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(111, 228, 255, .0), rgba(111, 228, 255, .55), rgba(255, 95, 210, .0) 30%, rgba(255, 95, 210, .55) 55%, rgba(111, 228, 255, 0) 80%);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 48%, #000 52%, transparent 66%);
  mask: radial-gradient(circle, transparent 46%, #000 48%, #000 52%, transparent 66%);
  animation: hp-rot 5s linear infinite;
}
.hp-floor {
  position: absolute; left: 50%; bottom: -1vh; width: 24vh; height: 3.6vh;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 140, 235, .7), rgba(140, 80, 255, .25) 50%, transparent 72%);
  filter: blur(.4vh);
}
.hp-slide {
  --w: min(19.5vh, 9.4vw);
  position: absolute;
  left: 50%; top: 50%;
  width: var(--w);
  margin: calc(var(--w) * -0.687) 0 0 calc(var(--w) * -0.5);   /* מרכז הקלף (יחס 728x1000) */
  transition: transform .75s cubic-bezier(.22, .9, .3, 1), opacity .6s, filter .6s;
  will-change: transform;
}
.hp-slide[data-o="0"]  { z-index: 5; transform: translateZ(0) scale(1); filter: drop-shadow(0 1.6vh 2vh rgba(10, 0, 40, .6)) drop-shadow(0 0 2.2vh rgba(255, 110, 220, .45)); }
.hp-slide[data-o="1"]  { z-index: 4; transform: translateX(78%) translateZ(-14vh) rotateY(-28deg) scale(.82); filter: brightness(.55) saturate(.9) drop-shadow(0 1vh 1.4vh rgba(0, 0, 0, .5)); }
.hp-slide[data-o="-1"] { z-index: 4; transform: translateX(-78%) translateZ(-14vh) rotateY(28deg) scale(.82); filter: brightness(.55) saturate(.9) drop-shadow(0 1vh 1.4vh rgba(0, 0, 0, .5)); }
.hp-slide[data-o="2"]  { z-index: 3; opacity: 0; transform: translateX(120%) translateZ(-30vh) rotateY(-40deg) scale(.6); }
.hp-slide[data-o="-2"] { z-index: 3; opacity: 0; transform: translateX(-120%) translateZ(-30vh) rotateY(40deg) scale(.6); }
.hp-slide .card { width: 100%; }
/* הקלף שבאמצע מרחף קצת */
.hp-slide[data-o="0"] .card { animation: hp-float 3.2s ease-in-out infinite; }
@keyframes hp-float { 50% { translate: 0 -1.1vh; } }

/* תחתית */
.hp-foot { position: absolute; z-index: 3; left: 1.9vw; right: 1.9vw; bottom: 2.1vh; display: flex; align-items: center; justify-content: space-between; direction: ltr; }
.hp-dots { display: flex; gap: .55vh; }
.hp-dots i { width: .8vh; height: .8vh; border-radius: 9px; background: rgba(255, 255, 255, .3); transition: width .4s var(--ease-out), background .4s; }
.hp-dots i.on { width: 2.6vh; background: linear-gradient(90deg, var(--hp-cyan), var(--hp-pink)); box-shadow: 0 0 1vh rgba(255, 95, 210, .7); }
.hp-go {
  display: inline-flex; align-items: center; gap: .7vh;
  padding: .7vh 1.4vh .7vh 1.1vh;
  border-radius: 99px;
  direction: rtl;
  font-size: 1.75vh; font-weight: 800;
  color: #1c0748;
  background: #fff;
  box-shadow: 0 .5vh 1.4vh rgba(0, 0, 0, .35);
  transition: transform .3s var(--ease-out);
}
.hp-go b { font-size: 2.4vh; line-height: .8; transition: translate .3s var(--ease-out); }
body.input-mouse .hub-promo.has-promo:hover .hp-go { transform: scale(1.06); }
body.input-mouse .hub-promo.has-promo:hover .hp-go b { translate: -.5vh 0; }

/* כניסה (בכל פעם שהמסך הראשי מופיע): תווית יורדת, כותרת נחשפת משמאל, קו נמתח, טקסט, קלפים עפים פנימה */
#home.active .has-promo .hp-kicker { animation: hp-drop .6s var(--ease-out) .35s backwards; }
#home.active .has-promo .hp-title { animation: hp-wipe .8s cubic-bezier(.2, .8, .2, 1) .45s backwards; }
#home.active .has-promo .hp-line { animation: hp-grow .7s var(--ease-out) .75s backwards; }
#home.active .has-promo .hp-body { animation: hp-drop .6s var(--ease-out) .85s backwards; }
#home.active .has-promo .hp-stage { animation: hp-stage-in .9s cubic-bezier(.34, 1.3, .64, 1) .6s backwards; }
#home.active .has-promo .hp-foot { animation: hp-drop .6s var(--ease-out) 1s backwards; }
@keyframes hp-drop { from { opacity: 0; translate: 0 -1.5vh; } }
@keyframes hp-wipe { from { clip-path: inset(0 100% 0 0); opacity: 0; translate: -2vh 0; } to { clip-path: inset(-20% -10% -20% 0); } }
@keyframes hp-grow { from { transform: scaleX(0); } }
@keyframes hp-stage-in { from { opacity: 0; transform: translateY(8vh) scale(.7); } }

@media (prefers-reduced-motion: reduce) {
  .hub-promo.has-promo::before, .hp-glow, .hp-rays, .hp-grid, .hp-mark-run, .hp-sparks i, .hp-halo, .hp-ttl, .hp-live i, .hp-slide[data-o="0"] .card { animation: none; }
  .hp-sparks { display: none; }
}

/* לוח ראשי: טקסט למעלה משמאל (מיושר לשמאל גם בעברית, כמו בתמונה), ציור בצד ימין */
.hm-text { position: absolute; left: 2.2vw; top: 3.9vh; width: 46%; direction: ltr; }
.hm-text > * { direction: rtl; text-align: left; }   /* הבלוקים צמודים לשמאל, והטקסט העברי בתוכם מיושר לשמאל */
.hm-title { font-size: 3.9vh; font-weight: 800; line-height: 1.1; }
.hm-sub { margin-top: 2.6vh; font-size: 1.95vh; font-weight: 700; color: var(--fc-green); }
.hm-body { margin-top: 2.2vh; font-size: 2.4vh; line-height: 1.42; max-width: 22vw; }

/* ---------- החלפת לשונית (L1 / R1) ---------- */
/* הלוח החדש נכנס מהצד ומתיישב, וההעתק של הישן (ghost, נוצר ב-js/hub.js) יוצא לצד השני.
   כיוון: in-r / go-l = עברנו ימינה בסרגל, in-l / go-r = עברנו שמאלה. הטקסט והציור זזים קצת יותר, לתחושת עומק. */
#home.active .hub-main.in-r { animation: hub-in-r .52s var(--ease-out) backwards; }
#home.active .hub-main.in-l { animation: hub-in-l .52s var(--ease-out) backwards; }
#home.active .hub-main.ghost { pointer-events: none; }
#home.active .hub-main.go-l { animation: hub-out-l .4s cubic-bezier(.55, 0, .8, .4) forwards; }
#home.active .hub-main.go-r { animation: hub-out-r .4s cubic-bezier(.55, 0, .8, .4) forwards; }
@keyframes hub-in-r  { from { opacity: 0; transform: translateX(11vw) scale(.95); } }
@keyframes hub-in-l  { from { opacity: 0; transform: translateX(-11vw) scale(.95); } }
@keyframes hub-out-l { to   { opacity: 0; transform: translateX(-11vw) scale(.95); } }
@keyframes hub-out-r { to   { opacity: 0; transform: translateX(11vw) scale(.95); } }
.hub-main.in-r .hm-text { animation: hm-text-r .62s var(--ease-out) backwards; }
.hub-main.in-l .hm-text { animation: hm-text-l .62s var(--ease-out) backwards; }
.hub-main.in-r .hm-art { animation: hm-art-r .72s var(--ease-out) .04s backwards; }
.hub-main.in-l .hm-art { animation: hm-art-l .72s var(--ease-out) .04s backwards; }
@keyframes hm-text-r { from { opacity: 0; transform: translateX(4vw); } }
@keyframes hm-text-l { from { opacity: 0; transform: translateX(-4vw); } }
@keyframes hm-art-r  { from { opacity: 0; transform: translateX(7vw); } }
@keyframes hm-art-l  { from { opacity: 0; transform: translateX(-7vw); } }

/* הגדרות: שני גלגלי שיניים שמסתובבים זה בתוך זה. הגדלים והמיקומים (באחוזים מהסצנה) מחושבים בסקריפט שיצר את התמונות:
   הגדול 12 שיניים, הקטן 8, ולכן הקטן מסתובב פי 1.5 מהר ובכיוון ההפוך (16s מול 10.667s), והשיניים נשארות מתאימות */
.hm-ico-settings { container-type: size; }
.gear-scene { grid-area: 1 / 1; position: relative; width: min(100cqw, 118cqh); aspect-ratio: 1.1802; filter: drop-shadow(0 1.6vh 1.8vh rgba(0, 0, 0, .45)); }
.hm-ico-settings .gear { position: absolute; height: auto; aspect-ratio: 1; object-fit: fill; filter: none; image-rendering: auto; animation: gear-spin 16s linear infinite; }
.hm-ico-settings .gear-big { left: 0; top: 0; width: 69.35%; }
.hm-ico-settings .gear-small { left: 50.75%; top: 41.88%; width: 49.25%; animation-duration: 10.667s; animation-direction: reverse; }
@keyframes gear-spin { to { rotate: 360deg; } }

/* חנות: שלוש חבילות, זהב באמצע ולפנים */
.hm-store .hm-art { position: absolute; right: 2.4%; bottom: 4%; width: 50%; height: 60%; }
.pk3 {
  position: absolute;
  bottom: 0;
  aspect-ratio: 640 / 930;
  filter: drop-shadow(0 1.4vh 1.8vh rgba(0, 0, 0, .5));
}
.pk3 img { display: block; width: 100%; height: 100%; clip-path: var(--pack-clip); }
.pk3::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: var(--pack-clip);
  background: linear-gradient(112deg, rgba(255, 255, 255, .34) 0 16%, transparent 16% 28%, rgba(255, 255, 255, .14) 28% 36%, transparent 36%);
  pointer-events: none;
}
.pk3-gold { left: 50%; translate: -50% 0; height: 92%; z-index: 3; }
.pk3-bronze { left: 4%; height: 78%; z-index: 1; transform: rotate(-3deg); transform-origin: bottom center; }
.pk3-silver { right: 4%; height: 78%; z-index: 2; transform: rotate(3deg); transform-origin: bottom center; }
.hub-main.swap .pk3 { animation: pk3-rise .62s cubic-bezier(.34, 1.4, .64, 1) backwards; }
.hub-main.swap .pk3-gold { animation-name: pk3-rise-gold; animation-delay: .1s; }
.hub-main.swap .pk3-bronze { animation-delay: .22s; }
.hub-main.swap .pk3-silver { animation-delay: .3s; }
@keyframes pk3-rise { from { opacity: 0; translate: 0 5vh; } }
@keyframes pk3-rise-gold { from { opacity: 0; translate: -50% 5vh; } }
.hub-main.can-enter:hover .pk3-gold { transition: transform .4s var(--ease-out); }
body.input-mouse .hub-main.can-enter:hover .pk3-gold { transform: translateY(-1vh); }
body.input-mouse .hub-main.can-enter:hover .pk3-bronze { transform: rotate(-5deg) translateY(-.4vh); }
body.input-mouse .hub-main.can-enter:hover .pk3-silver { transform: rotate(5deg) translateY(-.4vh); }

/* משחקים / משימות / שוק: ציור פיקסלים אחד בצד ימין. התמונות 8x מהרשת המקורית, ולכן מוצגות בהחלקה רגילה (לא pixelated) כדי שהקטנה לא תשבור את הפיקסלים */
.hm-icon { position: absolute; right: 5%; bottom: 6%; width: 46%; height: 74%; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; }
.hm-icon img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 1.4vh 1.6vh rgba(0, 0, 0, .45));
  animation: bob 3.2s ease-in-out infinite;
}
.hm-ico-graph img, .hm-ico-sbc img { width: 96%; height: 96%; }   /* ציורים רחבים (5:4) */
.hm-ico-tasks img { rotate: 3deg; }
.hm-ico-tasks, .hm-ico-gallery { width: 40%; right: 8%; }          /* ציורים גבוהים (4:5) */
/* כדורגל: קופץ ישר למעלה ומסתובב, והצל על הרצפה מתכווץ כשהכדור למעלה.
   הקפיצה היא בתכונה translate (ולא ב-transform) והסיבוב בתכונה rotate: translate מוחל לפני rotate, ולכן הקפיצה תמיד אנכית גם כשהכדור מסובב.
   (כשהקפיצה הייתה ב-transform היא הסתובבה יחד עם הכדור, והכדור נע במעגלים ויצא מהמסגרת.) הגובה: הכדור 58% מהתיבה והקפיצה 62% מגובהו, כלומר הוא נשאר בתוך התיבה */
.hm-ico-ball { width: 40%; right: 8%; }
.hm-ico-ball img { width: auto; height: 58%; aspect-ratio: 1; align-self: end; animation: ball-bounce 1.7s infinite, ball-spin 7s linear infinite; }
.hm-ball-shadow {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: center;
  width: 52%;
  height: 7%;
  translate: 0 45%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  animation: ball-shadow 1.7s infinite;
}
@keyframes ball-bounce {
  0%, 100% { translate: 0 0; animation-timing-function: cubic-bezier(.22, .62, .4, 1); }
  50%      { translate: 0 -62%; animation-timing-function: cubic-bezier(.6, 0, .78, .38); }
}
@keyframes ball-spin { to { rotate: 360deg; } }
@keyframes ball-shadow {
  0%, 100% { transform: scale(1); opacity: 1; animation-timing-function: cubic-bezier(.22, .62, .4, 1); }
  50%      { transform: scale(.55); opacity: .5; animation-timing-function: cubic-bezier(.6, 0, .78, .38); }
}
@media (prefers-reduced-motion: reduce) { .hm-icon img, .hm-ball-shadow { animation: none !important; } }

/* הקבוצה שלי: לוח כהה עם המגרש */
.hm-club {
  background: #0a0f18;
  box-shadow: inset 0 0 0 .2vh rgba(255, 255, 255, .12), 0 2vh 5vh rgba(0, 0, 0, .35);
}
/* רקע: כחול לילה עם זוהר וקרן אור באלכסון, כמו רקע המשחק (css/style.css .bg). עד 14.11.2026 היה כאן האצטדיון הירוק המטושטש */
.hm-club::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 56%, rgba(110, 165, 255, .1) 56.3%, transparent 66%),
    radial-gradient(ellipse 70% 60% at 15% 10%, rgba(40, 96, 220, .35), transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(255, 196, 64, .08), transparent 70%),
    linear-gradient(160deg, #0d1b3d, #070e22 60%, #050a18);
}
.hm-club::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 66% 70%, rgba(30, 70, 170, .35), rgba(6, 10, 18, 0) 62%), linear-gradient(180deg, rgba(6, 10, 18, .3), rgba(6, 10, 18, .6)); }
.hm-club > * { z-index: 1; }
.hm-club .hm-text { width: 30%; }
.hm-name { margin-top: 2.6vh; font-size: 3.1vh; font-weight: 500; line-height: 1.1; word-break: break-word; }
.hm-text > .hm-stars { direction: ltr; margin-top: 2.4vh; }   /* כוכבים משמאל לימין, כמו ב-FC */
.hm-stars i { width: 3.3vh; height: 3.1vh; }
.hm-stars.sq-stars { gap: .5vh; }
.hm-stat { margin-top: 1.4vh; font-size: 2.25vh; font-weight: 500; }
.hm-chem { margin-top: 2.2vh; width: 8.5vw; height: .6vh; border-radius: 1vh; background: rgba(255, 255, 255, .22); overflow: hidden; }
.hm-chem i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: #fff; border-radius: 1vh; }
.hm-chem + .hm-stat { margin-top: .9vh; }

/* המגרש באמצע הלוח לגובה. הדשא מורחב מעבר לקווים (Pitch.draw עם ext, ב-js/hub.js) כדי שהשוער, התווית שלו והחלוצים יישארו עליו, ולכן המרכז הוויזואלי הוא ~54% מגובה המגרש.
   הרוחב מוגבל גם לפי גובה הלוח (59.4vh), כדי שגם במסך רחב מאוד הכול ייכנס בתוך הלוח */
.hm-pitch { position: absolute; right: 3%; top: 50%; translate: 0 -54%; width: min(66%, 84vh); aspect-ratio: 1.95; transition: transform .45s var(--ease-out); }
.hm-pitch-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1.6vh 2vh rgba(0, 0, 0, .5)); }
.hm-slots { position: absolute; inset: 0; }
.hs { position: absolute; left: var(--l); top: var(--t); width: 9%; transform: translate(-50%, -52%) scale(var(--s, 1)); }
.hs-card { position: relative; width: 100%; aspect-ratio: 728 / 999; }
.hs-card .card { position: absolute; inset: 0; }
.hs-pos {
  position: absolute;
  left: 50%;
  top: 100%;
  translate: -50% .3vh;
  padding: .1vh .55vw;
  font: 800 1.2vh var(--fc-font);
  letter-spacing: .03em;
  color: #cfe3ff;
  background: rgba(7, 14, 27, .86);
  border-radius: 99px;
}
.hs-empty .hs-pos { color: #f2b134; }
.hub-main.swap .hs { animation: hs-pop .55s cubic-bezier(.34, 1.56, .64, 1) calc(.1s + var(--i, 0) * 38ms) backwards; }
@keyframes hs-pop { from { opacity: 0; transform: translate(-50%, -52%) scale(.5) translateY(3vh); } }

/* כפתור הכניסה */
.hub-enter {
  position: absolute;
  left: calc(9vw + 26.4vw);
  translate: -50% 0;
  top: 81.8vh;
  display: flex;
  align-items: center;
  gap: 1.1vw;
  height: 6.2vh;
  padding: 0 2.1vw 0 1.3vw;
  border: 0;
  border-radius: .7vh;
  cursor: pointer;
  direction: rtl;
  font: 800 clamp(14px, 2.55vh, 30px) var(--fc-font);
  color: #0d0f14;
  background: #fff;
  box-shadow: 0 1vh 2.4vh rgba(0, 0, 0, .4);
  transition: transform .25s var(--ease-out), box-shadow .25s, opacity .25s;
}
.hub-enter[hidden] { display: none; }
.hub-enter:disabled { opacity: .45; cursor: default; }
body.input-mouse .hub-enter:not(:disabled):hover, .hub-enter.nav-focus { transform: translateY(-.4vh); box-shadow: 0 1.4vh 3vh rgba(0, 0, 0, .45); }
.hub-enter.nav-focus { outline: .35vh solid var(--fc-green); outline-offset: .5vh; animation: none; }
.hub-x { position: relative; flex: none; width: 3.5vh; height: 3.5vh; border-radius: 50%; background: #0d0f14; }
.hub-x::before, .hub-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 52%; height: .4vh; background: #fff; border-radius: 1px; }
.hub-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.hub-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.hub-enter.soon .hub-x { background: #6b7280; }

/* ---------- כניסה לעמוד: זום קצר ---------- */
#home.active.zooming .hub-main { animation: hub-zoom .42s cubic-bezier(.5, 0, .8, .45) forwards; }
#home.active.zooming .hm-pitch { transform: scale(1.22); }
#home.active.zooming .hub-promo { animation: hub-slide .38s cubic-bezier(.5, 0, .8, .45) forwards; }
#home.active.zooming .hub-enter { animation: hub-down .3s ease-in forwards; }
@keyframes hub-zoom { to { transform: scale(1.34); opacity: 0; } }
@keyframes hub-slide { to { transform: translateX(8vw); opacity: 0; } }
@keyframes hub-down { to { transform: translateY(2vh); opacity: 0; } }

/* כניסה ראשונה לבית: הלוחות עולים */
#home.active .hub-main { animation: hub-rise .8s var(--ease-out) .1s backwards; }
#home.active .hub-promo { animation: hub-rise .8s var(--ease-out) .22s backwards; }
#home.active .hub-enter { animation: hub-rise .7s var(--ease-out) .34s backwards; }
@keyframes hub-rise { from { opacity: 0; transform: translateY(4vh) scale(.97); } }
#home.active.zooming .hub-main, #home.active.zooming .hub-promo, #home.active.zooming .hub-enter { animation-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  #home.active.zooming .hub-main, #home.active.zooming .hub-promo, #home.active.zooming .hub-enter { animation-duration: .01s; }
}
