/* ============================================================
   הטלפון: אותו משחק ואותו עיצוב של המחשב, לרוחב בלבד.
   index.html מסמן html.phone ונותן לדפדפן רוחב של מסך מחשב, והדפדפן מקטין את הכול לגודל הטלפון.
   כאן יש רק מה שמגע צריך, ומסך "סובב את הטלפון". הלוגיקה ב-js/mobile.js.
   ============================================================ */

.prompt-touch, .rotate-notice { display: none; }

/* ---------- בסיס ---------- */
html.phone { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* בלי הגדלת טקסט אוטומטית בסיבוב המסך */
html.phone, html.phone body {
  overscroll-behavior: none;                       /* בלי "משוך לרענון" */
  touch-action: manipulation;                      /* בלי זום בהקשה כפולה */
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html.phone body { position: fixed; inset: 0; width: 100%; }        /* בלי גלילה של הדף עצמו (גם ב-iOS) */
html.phone input, html.phone textarea { -webkit-user-select: text; user-select: text; }   /* ב-iOS שדה עם user-select: none לא מקבל הקלדה */

/* אין מקלדת ושלט: בלי רמזי מקשים */
html.phone .hints, html.phone .key, html.phone .tb-chips, html.phone #mk-chips, html.phone .gal-sh { display: none !important; }

/* ---------- גדלים לטלפון: טקסט פיקסלי קצת גדול יותר (גודל הגופן הרגיל מוגדל ב-js/mobile.js) ---------- */
html.phone body { font-size: 19px; }
:where(html.phone) .px { width: calc(var(--u) * var(--w) * var(--px-k, 1.2)); height: calc(var(--u) * var(--h) * var(--px-k, 1.2)); }
html.phone :is(.gal-title, .sm-title) { --px-k: 1; }       /* כותרות גדולות מספיק */

/* ---------- גדלים לטלפון: כפתורים נוחים לאצבע ---------- */
html.phone .gal-top { height: 62px; }
html.phone .gal-back { height: 56px; padding: 0 1.7vw; }
html.phone :is(.btn-claim, .pk-btn, .hub-enter, .set-toggle, .set-step, .mk-ghost, .mk-go, .ar-ghost, .ar-play, .shop-tab, .shop-sec, .gal-tab, .sq-tab, .sq-cell, .tb-tab, .modal-close) { min-height: 56px; }
html.phone :is(.mt-opt, .mt-tac-opt, .mt-btn) { min-height: 62px; }   /* תשובות במשחק: הכי חשוב שיהיה קל ללחוץ */
html.phone .mt-ch-prompt { --px-k: 1.05; }                 /* שאלה ארוכה נכנסת בשורה אחת */
html.phone .mt-ch-prompt .px { max-width: 100%; height: auto; }
html.phone .set-step { min-width: 56px; }
html.phone .ar-rw-arrow { min-width: 46px; min-height: 46px; }

/* כשסרגל הכתובת של הדפדפן גוזל גובה, כל המשחק מוקטן כדי שלא ייחתך (js/mobile.js) */
html.phone.fit-h #app {
  inset: auto;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  transform: scale(var(--fit, 1));
  transform-origin: top center;
}

/* ---------- מסך פתיחה: "גע במסך" במקום "לחץ על מקש" ---------- */
html.phone .prompt { display: none; }
html.phone .prompt-touch {
  --u: 3px;
  display: flex;
  position: absolute;
  bottom: 8vh;
  animation:
    prompt-in .9s var(--ease-out) 1.5s both,
    blink 1.8s ease-in-out 2.4s infinite;
}
html.phone #splash.leaving .prompt-touch { animation: prompt-out .35s ease-in forwards; }

/* ---------- פעולות על שחקן שנבחר (במחשב: קליק ימני ומקשים) ---------- */
html.phone .m-actions {
  position: absolute;                              /* במקום שורת המידע שמעל המגרש, כדי לא להסתיר אף משבצת באף מערך */
  left: 50%;
  top: 13vh;
  translate: -50% 0;
  z-index: 30;
  display: flex;
  gap: .5vw;
  padding: 0 .4vw;
  background: rgba(6, 16, 31, .94);
  box-shadow: inset 0 0 0 3px #1c4fa8, 0 6px 18px rgba(0, 0, 0, .5);
  animation: m-actions-in .3s var(--ease-out);
}
@keyframes m-actions-in { from { opacity: 0; transform: translateX(10px); } }
html.phone #myteam.m-sel .sq-bar { visibility: hidden; }
html.phone #draft .m-actions { left: auto; right: 3vw; top: 12vh; translate: none; }   /* בדראפט: מעל נתוני הקבוצה שבלוח הצד */
html.phone .m-actions[hidden] { display: none; }
html.phone .m-actions { --px-k: 1.05; }
html.phone .m-actions .pk-btn { white-space: nowrap; padding: 1vh .8vw; }

/* ---------- משימות: בעמודה "קל" יש משימה נוספת שקיימת רק בטלפון (הוספה למסך הבית). היא נגללת, וקצה השישית מציץ למטה ---------- */
html.phone .mi-list:has(> :nth-child(6)) { grid-template-rows: none; grid-auto-rows: 18.4%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
html.phone .mi-list:has(> :nth-child(6))::-webkit-scrollbar { display: none; }
html.phone .mi-tile { padding-block: 5px; }                /* הטקסט הגדול נכנס גם במשימה עם תיאור של שלוש שורות */
html.phone .mi-main { gap: 2px; }
html.phone .mi-prog { min-height: 11px; }
html.phone .mi-level { --px-k: 1; }                        /* כותרת העמודה חולקת שורה עם הטיימר */
html.phone .mi-colhead { padding-inline: .5vw; }
html.phone .mi-timer { font-size: 15px; }
html.phone .mi-reward { width: clamp(78px, 5.6vw, 96px); padding-inline: 1px; }
/* משימה שהושלמה: הפרס עולה למעלה וכפתור "קבל" מתחתיו, בלי לכסות את הסכום */
html.phone .mi-tile.ready .mi-reward { justify-content: flex-start; gap: 0; padding-top: 2px; }
html.phone .mi-tile.ready .mi-coin { height: 2.6vh; }
html.phone .mi-tile.ready .mi-pack { height: 5.2vh; }
html.phone .mi-claim { --px-k: 1; bottom: 6px; left: calc(.9vw + 6px); padding: .25vh .6vw; }
html.phone .mi-title { --px-k: 1.12; }
html.phone .mi-desc { --px-k: 1.05; gap: 0; }

/* ---------- דראפט: הלוחות במסך הכניסה קצת רחבים יותר, כדי שהטקסט הגדול ייכנס ---------- */
html.phone .dr-hub-main { width: min(50vw, 96vh); padding-inline: 1.8vw; }
html.phone .dr-rewards { width: min(30vw, 56vh); }

/* ---------- מדריך הפלייסטיילים: פחות עמודות, כדי ששמות ארוכים ייכנסו ---------- */
html.phone .psg-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 58vh), 1fr)); }

/* ---------- שוק ונבחרת השבוע: הרמזים בתחתית נראים ככפתורים. "אישור" מיותר במגע, נוגעים בפריט עצמו ---------- */
html.phone .mk-fi {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.3vw;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .24);
}
html.phone .mk-fi:first-child { display: none; }

/* ---------- טלפון לאורך: חובה לסובב ---------- */
@media (orientation: portrait) {
  html.phone .rotate-notice {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7vw;
    background:
      radial-gradient(ellipse 70% 55% at 20% 12%, rgba(40, 96, 220, .4), transparent 70%),
      linear-gradient(160deg, #0b1734, #060d20 50%, #03060f);
  }
  html.phone .rotate-notice img { width: 62vw; }
  html.phone .rotate-notice .px { --u: .55vw; }
}
html.phone .rotate-phone {
  position: relative;
  width: 17vw;
  height: 28vw;
  border: .9vw solid #fff;
  box-shadow: 0 0 0 .9vw #1c4fa8;
  animation: rotate-hint 2.4s ease-in-out infinite;
}
html.phone .rotate-phone::after { content: ""; position: absolute; left: 50%; bottom: 5%; width: 24%; height: .8vw; translate: -50% 0; background: #fff; }
@keyframes rotate-hint {
  0%, 25% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}
