:root {
  /* מונע מהדפדפן "לכהות" אלמנטים מובנים (שדות קלט, תפריטים נפתחים, פסי גלילה) לפי
     מצב כהה של המכשיר - האתר תמיד נראה באותם צבעים בהירים, בלי קשר להגדרות המשתמש */
  color-scheme: light;
  --bg: #dceefa;
  --stripe-bg: #c9e4f6;
  --panel-bg: #ffffff;
  --ink: #10233b;
  --muted: #6d87a3;
  --border: #cfe2f2;
  --accent-red: #e2402b;
  --pitch-green-1: #3f8f52;
  --pitch-green-2: #4a9c5d;
  --pitch-line: rgba(255, 255, 255, 0.55);
}

* { box-sizing: border-box; }

/* עוזר כללי - להסתרת כל אלמנט, בלי צורך בכלל ".x.hidden" ייעודי לכל קומפוננטה */
.hidden { display: none !important; }

/* בתצוגת מחשב, מקטינים את כל המסכים (כולל דף הנחיתה) ל-67% כדי שהכל ייכנס
   למסך בלי גלילה, במקום שהמשתמש יצטרך לזום-אאוט ידנית */
@media (min-width: 900px) {
  #landing-screen, #home-screen, #draft-screen, #result-screen,
  #vs-setup-screen, #vs-handoff-screen, #vs-result-screen { zoom: 0.67; }
}

/* בתצוגת מובייל, מקטינים ל-75% כדי שיותר מהמסך (כולל רוחב הרשימה) ייכנס בלי גלילה אופקית.
   שאר חוקי המובייל (שדורסים כללים ללא media query) נמצאים בסוף הקובץ, אחרי ההגדרות
   הבסיסיות שלהם - ב-CSS, כלל מאוחר יותר במקור מנצח כלל מוקדם יותר באותה ספציפיות,
   גם אם המוקדם נמצא בתוך media query שתואם. */
@media (max-width: 899px) {
  #landing-screen, #home-screen, #draft-screen, #result-screen,
  #vs-setup-screen, #vs-handoff-screen, #vs-result-screen { zoom: 0.75; }
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Heebo", "Segoe UI", Arial, Helvetica, sans-serif;
}

.screen {
  display: flex;
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
  flex-wrap: wrap;
}

.screen.hidden { display: none; }

/* --- דף נחיתה --- */
.screen.landing {
  min-height: calc(100vh - 48px);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.landing-content {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  margin-top: -20px;
}


.landing-badge {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.landing-title {
  font-size: clamp(30px, 5.2vw, 50px);
  font-weight: 900;
  margin: 0;
  line-height: 1.25;
}

.landing-sub {
  font-size: clamp(18px, 2.8vw, 24px);
  color: #3f5a76;
  font-weight: 500;
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}

.landing-cta {
  width: auto;
  padding: 22px 56px;
  margin-top: 14px;
  font-size: 24px;
}

/* --- פאנל בקרה --- */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  width: 300px;
  flex-shrink: 0;
}

.panel-section { margin-bottom: 20px; }
.panel-section.hidden { display: none; }

.panel-title {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 10px;
}

.draft-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.draft-panel-header .panel-title {
  margin-bottom: 0;
}

.roster-sort-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.roster-sort-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

.team-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.style-grid { grid-template-columns: 1fr 1fr 1fr; }
.difficulty-grid { grid-template-columns: 1fr 1fr; }
.same-pool-grid { grid-template-columns: 1fr 1fr; }

#career-transfer-count-grid {
  direction: ltr;
  gap: 14px;
}

#career-transfer-count-grid .opt-btn {
  text-align: center;
  border-width: 2px;
  border-color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 20px;
}

.opt-btn {
  padding: 12px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.opt-btn:hover { border-color: var(--ink); }

.opt-btn.selected {
  background: var(--ink);
  color: var(--panel-bg);
  border-color: var(--ink);
}

.opt-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.opt-btn:disabled:hover { border-color: var(--border); }

#career-change-formation-modal .modal-content {
  max-width: 480px;
}

.career-change-formation-hint {
  padding: 10px 18px 0;
  text-align: center;
}

#career-change-formation-modal .panel-section {
  padding: 0 18px;
}

.cta-btn {
  width: 100%;
  padding: 16px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: var(--accent-red);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.cta-btn:hover { filter: brightness(1.05); }
.cta-btn.hidden { display: none; }

.result-share-btn { background: var(--ink); }

.share-options {
  margin-top: 10px;
  text-align: center;
}

.share-options.hidden { display: none; }

.share-options-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
  line-height: 1.5;
}

.share-options-row {
  display: flex;
  gap: 8px;
}

.share-option-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.share-option-btn:hover { filter: brightness(1.08); }

.share-whatsapp { background: #25d366; }
.share-facebook { background: #1877f2; }
.share-twitter { background: #14171a; }

/* --- מגרש --- */
.pitch-wrap {
  flex: 1;
  min-width: 300px;
  display: flex;
  justify-content: center;
}

.pitch-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  transition: max-width 0.25s ease;
}

.pitch-display-label {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.pitch-display-select {
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
}

/* אותו עיצוב בדיוק כמו pitch-display-label, רק בצד הנגדי של אותה שורה */
.foreign-count-label {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.pitch-display-select option {
  color: var(--ink);
  background: var(--bg);
}

.draft-body.complete .pitch-stage {
  max-width: 780px;
}

.pitch {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 560 / 720;
  transition: max-width 0.25s ease, aspect-ratio 0.25s ease;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--pitch-green-1) 0,
      var(--pitch-green-1) 10%,
      var(--pitch-green-2) 10%,
      var(--pitch-green-2) 20%
    );
  border: 3px solid var(--pitch-line);
  border-radius: 6px;
  overflow: hidden;
}

.pitch::before {
  /* קו אמצע + מעגל מרכזי - קישוט בלבד, לא אמור לחסום קליקים על סלוטים */
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  border-top: 2px solid var(--pitch-line);
  pointer-events: none;
}

.pitch::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 120px; height: 120px;
  border: 2px solid var(--pitch-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px dashed var(--pitch-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.08);
  user-select: none;
}

.pitch-slot:hover { background: rgba(0, 0, 0, 0.22); }

.pitch-slot.filled {
  border-style: solid;
  border-color: #fff;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.pitch-slot.filled .slot-number {
  color: #14202b;
  font-size: 22px;
  font-weight: 800;
}

.pitch-slot.ghost {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0.5;
}

.pitch-slot.ghost .slot-number {
  color: #14202b;
  font-size: 22px;
  font-weight: 800;
}

.pitch-slot.filled .slot-name-tag,
.pitch-slot.ghost .slot-name-tag {
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: #14202b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pitch-slot.filled.selected {
  box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.55);
}

.slot-remove-btn {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(20, 32, 43, 0.55);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.slot-remove-btn:hover {
  background: rgba(20, 32, 43, 0.8);
}

.pitch-slot.eligible {
  border-style: solid;
  border-color: var(--accent-red);
  background: var(--accent-red);
  box-shadow: 0 0 0 5px rgba(226, 64, 43, 0.28);
  animation: pulse-eligible 1.1s ease-in-out infinite;
}

@keyframes pulse-eligible {
  0%, 100% { box-shadow: 0 0 0 5px rgba(226, 64, 43, 0.28); }
  50% { box-shadow: 0 0 0 9px rgba(226, 64, 43, 0.12); }
}

.pitch-slot .slot-pos {
  position: absolute;
  top: -18px;
  font-size: 10px;
  color: var(--pitch-line);
  font-weight: 700;
}

.pitch-slot .slot-name {
  font-size: 11px;
  line-height: 1.2;
  padding: 0 4px;
  word-break: break-word;
}

/* --- מסך הרכב --- */
.screen.draft-screen {
  flex-direction: column;
  align-items: stretch;
}

.draft-body {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

/* כשההרכב מלא (11/11) אין יותר מה לבחור מהרשימה - מסתירים אותה, מרחיבים את
   המגרש (יותר רחב, פחות גבוה) וממקדים בכפתור הסיום */
.draft-body.complete .draft-panel {
  display: none;
}

.draft-body.complete .pitch-wrap {
  flex: 1 1 100%;
}

.draft-body.complete .pitch {
  max-width: 780px;
  aspect-ratio: 780 / 560;
}

.draft-panel {
  display: flex;
  flex-direction: column;
  max-height: 720px;
  width: 460px;
}

.roster-team-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: -4px 0 10px;
}

.roster-team-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-red);
}

.roster-team-emoji {
  font-size: 18px;
}

.roster-team-actions {
  display: flex;
  gap: 8px;
}

.team-action-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel-bg);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.team-action-btn:hover:not(:disabled) { filter: brightness(1.15); }

.career-give-up-btn {
  background: var(--accent-red);
}

.team-action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.panel-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -4px 0 12px;
  line-height: 1.5;
}

/* רק בתצוגת מחשב - טיפה מגדילים את הטקסט ההסברי מתחת ל"בחירת שחקן" במסך הדראפט,
   ואת הכיתוב על שלושת כפתורי דף הנחיתה (שנראים קטנים בגלל ה-zoom:0.67 של המסך) */
@media (min-width: 900px) {
  .draft-panel .panel-hint { font-size: 14px; }
  .landing-cta { font-size: 30px; }
  /* כותרות תפריטים ("מערכים"/"סגנון"/"רמת קושי"/"שם שחקן 1" וכו') בכל המסכים -
     טיפה גדול יותר וכהה יותר, לא רק במסך הבית */
  .panel-title { font-size: 15px; color: var(--ink); }
  label.vs-input-label { font-size: 15px; color: var(--ink); }
  /* כפתור "בחר שחקנים" - אותו יחס הגדלה כמו שאר האלמנטים במסך הזה */
  #start-btn { font-size: 22px; padding: 18px; }
  /* "החלף קבוצה"/"החלף עונה" - יש מקום פנוי מתחת לשם הקבוצה, אז מגדילים בלי לדחוף
     את שאר האתר למטה */
  .team-action-btn { font-size: 15px; padding: 10px 12px; }
}

.roster-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.draft-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-title { font-weight: 700; font-size: 16px; }

.draft-score {
  font-weight: 700;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
}

.back-btn {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.home-back-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 5px 10px;
  font-size: 12px;
  z-index: 50;
}

.career-titles-badge {
  position: fixed;
  top: 54px;
  right: 16px;
  z-index: 49;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  box-shadow: 0 2px 8px rgba(16, 35, 59, 0.12);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  gap: 3px;
  /* תצוגה בלבד - אין שום דבר ללחוץ עליו כאן, ולא רוצים שיחסום קליקים על מה
     שמתחתיו (למשל סלוטים על המגרש) כשהוא גדל בגלל הכותרת/התוויות */
  pointer-events: none;
}

.career-titles-header {
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 2px;
}

.career-titles-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.career-titles-row span {
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.career-titles-label {
  display: block;
  font-style: normal;
  font-size: 8.5px;
  color: var(--muted);
  font-weight: 700;
}

/* מצב "בזרימה": במסכי checkpoint/חלון-העברות/סיום קריירה בדסקטופ, במקום
   לרחף בפינה - יושב במקום קבוע בזרימה הרגילה, בין הפס שאומר איזו עונה זו לבין
   הכרטיס עם התוכן, עם פירוט טקסטואלי מה כל אימוג'י אומר */
.career-titles-badge.career-titles-inline {
  position: static;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 16px;
  box-shadow: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
}

.career-titles-inline .career-titles-row {
  justify-content: space-evenly;
  gap: 16px;
}

.career-titles-inline .career-titles-row span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.career-titles-inline .career-titles-label {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

/* בניגוד ל-.home-back-btn (שעל מסך הטקטיקה יורד לזרימה רגילה במובייל כדי לא לחפוף
   לכרטיס), כאן תמיד רוצים אותו קבוע בפינה, גם במובייל - זה מסך "landing" בלי כרטיס */
.vs-choice-back-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 5px 10px;
  font-size: 12px;
  z-index: 50;
}

/* home-back-btn חי בתוך מסכים שמוקטנים ב-zoom:0.67 בדסקטופ (למעלה בקובץ) - בלי
   פיצוי הוא נראה זעיר בהרבה מ-vs-choice-back-btn (שחי במסכים לא-מוקטנים). מגדילים
   את הערכים הפנימיים פי 1/0.67 כדי שהגודל שנראה בפועל על המסך יהיה זהה לשניהם */
@media (min-width: 900px) {
  .home-back-btn { padding: 7px 15px; font-size: 18px; }
}

#finish-btn {
  max-width: 780px;
  margin: 18px auto 0;
  font-size: 22px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(226, 64, 43, 0.4);
}

/* --- מסך תוצאה --- */
.result-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
  padding: 0 24px;
}

.result-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  flex: 1 1 420px;
  max-width: 500px;
  margin: 0;
  text-align: center;
}

.result-score {
  font-size: 56px;
  font-weight: 900;
  color: var(--accent-red);
  margin: 8px 0 24px;
}

.result-outcome {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}

.result-position {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}

.result-note {
  font-size: 15px;
  color: var(--muted);
}

.result-lineup {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 14px;
}

.result-lineup .row {
  display: flex;
  gap: 8px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.result-lineup .row span:first-child {
  flex: 0 0 28px;
  color: var(--muted);
  font-weight: 700;
}

.result-lineup .row span:last-child {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.result-lineup-team {
  color: var(--muted);
  font-size: 12px;
}

/* --- אתגר יומי --- */
.daily-mode-banner {
  width: 100%;
  text-align: center;
  background: #123f66;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.daily-mode-banner-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
}

.daily-mode-banner-desc {
  font-weight: 400;
  font-size: 13px;
  color: #cfe0f0;
  line-height: 1.5;
}

.daily-result-header {
  margin-bottom: -8px;
}

.daily-result-title {
  font-size: 18px;
  font-weight: 800;
  color: #123f66;
}

.daily-guest-cta {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
}

.daily-guest-rank-msg {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.daily-guest-cta-row {
  display: flex;
  gap: 10px;
}

.daily-guest-cta-row .cta-btn {
  margin-top: 0;
}

.daily-leaderboard-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  flex: 1 1 280px;
  max-width: 320px;
  text-align: right;
}

.daily-leaderboard-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px;
}

.daily-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.daily-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg);
}

.daily-leaderboard-row .rank {
  flex: 0 0 26px;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.daily-leaderboard-row .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-leaderboard-row .score {
  font-weight: 800;
  color: var(--accent-red);
  font-variant-numeric: tabular-nums;
}

.daily-leaderboard-row.own {
  background: #123f66;
  color: #fff;
}

.daily-leaderboard-row.own .rank,
.daily-leaderboard-row.own .score {
  color: #fff;
}

.daily-leaderboard-empty {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

.daily-leaderboard-row-extra {
  margin-top: 6px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.daily-back-btn {
  background: #123f66;
  margin-top: 16px;
}

.daily-invite-btn {
  background: #25d366;
  margin-top: 10px;
}

.daily-no-lineup-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* --- מודל בחירת שחקן --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--panel-bg);
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.modal-close {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}

.modal-player-list {
  overflow-y: auto;
  padding: 0;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.roster-section-label {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--stripe-bg);
  border-bottom: 1px solid var(--border);
}

.player-row:nth-child(even) { background: var(--stripe-bg); }

.player-row:hover { background: #cee6f7; }

.player-row.disabled,
.player-row.used {
  opacity: 0.4;
  cursor: not-allowed;
}
.player-row.disabled:hover,
.player-row.used:hover { background: none; }

.player-row.selected {
  background: var(--accent-red) !important;
  color: #fff;
}
.player-row.selected .player-number,
.player-row.selected .player-positions {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.5);
}

.career-switch-team-list {
  max-height: 360px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
}

.career-switch-team-row {
  justify-content: flex-start;
}

.career-switch-team-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.player-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.player-number {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 26px;
}

.player-row .player-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-positions {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #9db8d1;
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.player-row .player-rating {
  font-weight: 800;
  background: var(--ink);
  color: var(--panel-bg);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
}

.daily-challenge-wrap {
  position: relative;
  align-self: stretch;
  margin-top: -8px;
}

.daily-challenge-btn {
  background: #1f6fb2;
  opacity: 0.55;
  cursor: default;
}

.daily-challenge-btn:not(:disabled) {
  opacity: 1;
  cursor: pointer;
}

.daily-challenge-chip {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: #123f66;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

.daily-challenge-chip.hidden { display: none; }

/* --- מצב "אתה נגד חבר" --- */
.landing-cta-secondary {
  background: var(--ink);
  margin-top: -8px;
}

/* --- כפתור קריירה בדף הנחיתה - צבע ירוק אזמרגד נבדל משאר הכפתורים --- */
.landing-cta-career {
  background: #1a8754;
  margin-top: -8px;
}

.vs-setup-panel {
  width: 100%;
  max-width: 420px;
  margin: 40px auto 0;
}

/* מסך "אתה נגד חבר" - אותו מכשיר: הגדלה כללית של האזור והכפתורים, כי שני
   השחקנים משתמשים באותו טלפון ורוצים לגעת בנוחות בלי לפספס */
#vs-setup-screen .vs-setup-panel {
  max-width: 480px;
  padding: 26px;
}
#vs-setup-screen .panel-title { font-size: 15px; }
#vs-setup-screen .panel-hint { font-size: 15px; }
#vs-setup-screen .vs-input-label { font-size: 16px; margin-bottom: 8px; }
#vs-setup-screen .vs-name-input { font-size: 18px; padding: 16px 16px; }
#vs-setup-screen .difficulty-grid .opt-btn { padding: 18px 8px; font-size: 17px; }
#vs-setup-screen .cta-btn { font-size: 21px; padding: 20px; }

.vs-room-code-display {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--accent-red);
  background: var(--panel-bg);
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 18px 32px;
  direction: ltr;
}

.vs-input-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.vs-name-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

.vs-name-input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.vs-name-input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

.vs-setup-error {
  color: var(--accent-red);
  font-size: 13px;
  font-weight: 700;
  margin: -8px 0 12px;
  text-align: center;
}

.vs-setup-error.hidden { display: none; }

.career-setup-title {
  text-align: center;
  color: #1c3450;
}

.career-season-banner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 16px;
  text-align: center;
  background: #123f66;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
}

.career-checkpoint-panel {
  width: 100%;
  max-width: 760px;
  margin: 8px auto 0;
  text-align: center;
}

/* הודעות "מה קרה בקיץ" (פציעה/שיפור) - מוצג בין ארון הגביעים לפאנל חלון
   ההעברות, כדי שהמשתמש יידע על שינוי ברייטינג *לפני* שהוא רואה את ההרכב.
   רקע לבן (לא var(--bg) - זה תכלת על תכלת, בלתי קריא על רקע העמוד) */
.career-pending-stories {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.career-pending-stories .career-result-line {
  background: var(--panel-bg);
}

.career-end-mode-toggle {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto 14px;
}

.career-end-mode-toggle .opt-btn {
  flex: 1;
}

.career-checkpoint-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}

.career-checkpoint-buttons-row .cta-btn {
  width: auto;
  min-width: 160px;
  flex: 1 1 160px;
  margin: 0;
}

.career-checkpoint-buttons-row .cta-btn.career-btn-nivcheret {
  background: #1d4ed8;
}

.career-checkpoint-buttons-row .cta-btn.career-btn-switch-team {
  background: #0f9d6b;
}

/* במובייל (סדר-ערימה אנכי) הסדר-הרצוי שונה מדסקטופ (שם ה-DOM-order כבר נותן
   ימין-לשמאל נכון ב-RTL): "לעונה הבאה" ראשון, "החלף קבוצה" שני, "עבור
   לנבחרת ישראל" אחרון - בלי לשנות את ה-DOM, רק order בפלקס */
@media (max-width: 899px) {
  .career-checkpoint-buttons-row .cta-btn.career-btn-nivcheret { order: 3; }
  .career-checkpoint-buttons-row .cta-btn.career-btn-switch-team { order: 2; }
  .career-checkpoint-buttons-row .cta-btn:not(.career-btn-nivcheret):not(.career-btn-switch-team) { order: 1; }
}

.career-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.career-league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

.career-league-table th,
.career-league-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.career-league-table thead th {
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
}

.career-league-table td:nth-child(2) {
  text-align: right;
}

.career-league-table tbody tr:last-child td {
  border-bottom: none;
}

.career-table-you td {
  background: rgba(226, 64, 43, 0.12);
  font-weight: 800;
}

.career-gd-num {
  direction: ltr;
  unicode-bidi: isolate;
}

.career-table-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  vertical-align: middle;
}

.career-banner-ball {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-inline-start: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  vertical-align: middle;
}

.career-table-details summary {
  cursor: pointer;
  font-weight: 800;
  padding: 10px 0;
  list-style: none;
}

.career-table-details summary::-webkit-details-marker {
  display: none;
}

.career-table-details summary::after {
  content: " ▾";
}

.career-table-details[open] summary::after {
  content: " ▴";
}

.career-table-details .career-table-wrap {
  margin-top: 8px;
}

/* טבלת ליגה/שלב-בתים פתוחה בתצוגה טלפונית לרוחב - תופסת את כל המסך (רק היא)
   עד שהמשתמש מחזיר את הטלפון לאורך. מוחל דינמית ע"י updateCareerTableLandscapeFullscreen
   ב-app.js (לא רק CSS - צריך גם לדעת אם ה-<details> בכלל פתוח כרגע) */
.landscape-fullscreen {
  position: fixed !important;
  inset: 0;
  z-index: 500;
  margin: 0 !important;
  background: var(--bg);
  overflow: auto;
  padding: 14px;
  border-radius: 0 !important;
  border: none !important;
}

.landscape-fullscreen > summary,
.landscape-fullscreen > .euro-strip {
  display: none;
}

.landscape-fullscreen .career-table-wrap {
  height: 100%;
}

.landscape-fullscreen .career-league-table {
  font-size: 16px;
}

.euro-card {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.euro-strip {
  cursor: pointer;
  list-style: none;
  background: #123a66;
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.euro-strip::-webkit-details-marker {
  display: none;
}

.euro-strip .pos-pill {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.euro-strip .chev {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.euro-strip-el {
  background: #d9720b;
  color: #000;
}

.euro-strip-el .chev {
  color: rgba(0, 0, 0, 0.6);
}

.euro-strip-el .pos-pill {
  background: rgba(0, 0, 0, 0.12);
}

.euro-strip-ecl {
  background: #2f9e44;
  color: #fff;
}

.euro-card[open] .euro-strip .chev {
  transform: rotate(180deg);
}

.euro-card .career-table-wrap {
  border: none;
  border-radius: 0;
}

.career-checkpoint-body {
  margin: 18px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.career-result-line {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  text-align: center;
}

.career-color-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.career-resume-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.career-setup-new-btn-color { background: #2b6cb0; }
.career-resume-real-btn-color { background: #0d9488; }

.career-setup-intro,
#career-setup-resume-hint {
  color: #1c3450;
}

/* משווים את גודל "המשך קריירה אחרונה" (cta-btn) לשני הכפתורים לצידו (team-action-btn) -
   כולל margin-top:0 כדי שהמרווח בין כל שלושת הכפתורים יהיה אחיד (מגיע מה-gap של
   career-resume-stack, לא מ-margin פרטי של cta-btn) */
#career-setup-continue-btn {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 0;
}

.career-picker-dropdown-row {
  display: flex;
  gap: 14px;
}

.career-picker-dropdown-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.career-picker-dropdown-field .vs-input-label {
  text-align: center;
  color: #1c3450;
}

.career-picker-combo {
  position: relative;
}

.career-picker-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 40;
}

.career-picker-options.hidden {
  display: none;
}

.career-picker-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.career-picker-option:last-child {
  border-bottom: none;
}

.career-picker-option:hover,
.career-picker-option.active {
  background: var(--stripe-bg);
}

.career-picker-options-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
}

.career-color-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.career-color-field input[type="color"] {
  width: 56px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.vs-turn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.vs-turn-name {
  font-weight: 900;
  font-size: 20px;
}

.vs-turn-badge.hidden { display: none; }

/* בדסקטופ יש רק את התגית שמעל המגרש - העטיפה הזו מיועדת למובייל בלבד (שם, ע"פ
   בקשת המשתמש, התגית צריכה לשבת מעל פאנל הטקטיקה, ממורכזת, לא מעל המגרש) */
.vs-turn-badge-mobile-wrap { display: none; }

.pitch-wrap-vs {
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.vs-result-card { max-width: 640px; }

.vs-result-scores {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.vs-result-score-card {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.vs-result-score-card.winner {
  border-color: var(--accent-red);
}

.vs-result-player-name {
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-result-player-score {
  font-size: 34px;
  font-weight: 900;
  color: var(--accent-red);
}

.vs-result-winner-tag {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-red);
  margin-top: 6px;
}

.vs-result-lineups {
  display: flex;
  gap: 16px;
  text-align: right;
  margin-bottom: 24px;
}

.vs-result-lineup-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.vs-result-lineup-col .row {
  display: flex;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
  gap: 6px;
}

.vs-result-lineup-col .row span:first-child {
  flex: 0 0 24px;
  color: var(--muted);
  font-weight: 700;
}

.vs-result-lineup-col .row span:last-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- "לא מסכים עם ציון?" --- */
.feedback-triggers {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 40;
}

.feedback-triggers-sep { color: var(--border); font-size: 13px; }

.contest-rating-trigger {
  border: none;
  background: none;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.contest-rating-trigger:hover { filter: brightness(1.4); }

/* --- חשבון / הרשמה --- */
.account-bar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.account-bar-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.achievements-btn {
  font-size: 15px;
  padding: 9px 18px;
  white-space: nowrap;
}

@media (min-width: 900px) {
  /* בדסקטופ: הכפתור נמתח לרוחב מדויק של שתי הכפתורים+המרווח שמעליו, לא רק
     עוטף את הטקסט שלו */
  .account-bar { align-items: stretch; }
  .achievements-btn {
    font-size: 18px;
    padding: 11px 22px;
    width: 100%;
    box-sizing: border-box;
  }
}

.landing-stats {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 40;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 16px;
  color: var(--ink);
  text-align: center;
  line-height: 1.7;
}

.landing-stats-title {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 2px;
}

.landing-stats-mobile-label {
  display: none;
}

.landing-stats-row b {
  font-variant-numeric: tabular-nums;
  color: var(--accent-red);
}

.account-link {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--ink);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.account-link:hover { border-color: var(--ink); }

.account-user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--ink);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.account-user-icon { font-size: 16px; }

.account-menu-wrap { position: relative; }

.pwa-install-btn {
  font-size: 15px;
  padding: 9px 18px;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .pwa-install-btn {
    font-size: 18px;
    padding: 11px 22px;
  }
}

@media (max-width: 899px) {
  .account-bar {
    top: 10px;
    right: 8px;
    gap: 6px;
  }
  .account-bar-top {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
  .account-link,
  .account-user-pill {
    font-size: 14px;
    padding: 7px 14px;
  }
  .achievements-btn {
    font-size: 14px;
    padding: 7px 14px;
  }
  .pwa-install-btn {
    font-size: 13px;
    padding: 6px 12px;
  }
}

.pwa-install-modal-text {
  white-space: pre-line;
  line-height: 1.8;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 60;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
}

.account-dropdown-item:hover { background: var(--bg); }

.landing-welcome {
  font-size: 26px;
  color: var(--muted);
  margin: 0;
}

.landing-welcome b { color: var(--ink); font-size: 30px; }

.auth-toggle-mode {
  margin-top: 4px;
  text-align: center;
}

.auth-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.auth-bottom-row .auth-toggle-mode {
  margin-top: 0;
  font-size: 14px;
}

.contest-rating-form {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contest-rating-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.contest-reason-textarea {
  resize: vertical;
  font-family: inherit;
  min-height: 130px;
}

.contest-rating-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.contest-rating-cancel { flex: 1; background: var(--muted); }
.contest-rating-actions .cta-btn { flex: 1; margin-top: 0; }

#career-sign-player-modal .modal-header {
  position: relative;
  justify-content: center;
  padding: 10px 18px;
}

#career-sign-player-modal .modal-header span {
  flex: 1;
  text-align: center;
}

#career-sign-player-modal .modal-close {
  position: absolute;
  left: 14px;
}

#career-sign-player-question {
  text-align: center;
  padding: 10px 18px 0;
  margin: 0 0 12px;
  color: #1c3450;
  font-size: 14px;
  font-weight: 600;
}

.career-sign-player-actions {
  padding: 0 18px 12px;
  margin-top: 0;
}

.career-sign-player-actions button {
  padding: 10px;
  font-size: 13px;
}

#career-swap-confirm-modal .modal-header {
  position: relative;
  justify-content: center;
  padding: 10px 18px;
}

#career-swap-confirm-modal .modal-header span {
  flex: 1;
  text-align: center;
}

#career-swap-confirm-modal .modal-close {
  position: absolute;
  left: 14px;
}

#generic-confirm-modal .modal-header {
  position: relative;
  justify-content: center;
  padding: 10px 18px;
}

#generic-confirm-modal .modal-header span {
  flex: 1;
  text-align: center;
}

#generic-confirm-modal .modal-close {
  position: absolute;
  left: 14px;
}

#generic-confirm-question {
  color: var(--ink);
}

#career-swap-confirm-question {
  text-align: center;
  padding: 10px 18px 0;
  margin: 0 0 12px;
  color: #1c3450;
  font-size: 14px;
  font-weight: 600;
}

.contest-rating-thanks {
  color: var(--accent-red);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  margin: 4px 0 0;
}

.contest-rating-thanks.hidden { display: none; }

/* --- מסך פרופיל --- */
.screen.profile-screen {
  flex-direction: column;
  align-items: stretch;
  max-width: 780px;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
}

.profile-header-title {
  font-weight: 800;
  font-size: 18px;
  text-align: center;
}

.profile-header-spacer {
  visibility: hidden;
}

.profile-loading {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 40px 0;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.profile-stats-grid {
  display: grid;
  gap: 12px;
}

.profile-stats-top { grid-template-columns: repeat(2, 1fr); }

.profile-stats-bottom {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 4px;
}

/* נבחרת ישראל בלבד - שורה של 2 אריחים (לא 3 כמו profile-stats-bottom), אותה
   מסגרת חזותית בדיוק כמו שאר סקציית "קריירה" */
.profile-stats-nivcheret {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 4px;
}

.profile-nivcheret-best-title {
  margin-top: 14px;
}

.profile-nivcheret-best-strip {
  background: var(--panel-bg);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(16, 35, 59, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-nivcheret-best-select {
  flex: 0 0 auto;
  max-width: 180px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--stripe-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
}

.profile-nivcheret-best-label {
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.profile-stat-tile {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
}

.profile-stat-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-red);
}

.profile-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

.profile-section { display: flex; flex-direction: column; gap: 10px; }

.profile-vs-line {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.top-players-list {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.top-players-list .row {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.top-players-list .row:last-child { border-bottom: none; }
.top-players-list .row:nth-child(odd) { background: var(--stripe-bg); }

.top-players-list .rank {
  color: var(--muted);
  font-weight: 700;
  width: 26px;
  flex-shrink: 0;
}

.top-players-list .name { flex: 1; font-weight: 700; text-align: center; }

.top-players-list .count {
  font-weight: 800;
  color: var(--ink);
  background: var(--bg);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
}

.profile-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
}

.history-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
}

.history-row:last-child { border-bottom: none; }
.history-row:nth-child(odd) { background: var(--stripe-bg); }

.history-date {
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  width: 72px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.history-mode {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--muted);
  width: 52px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.5;
}

.history-mid {
  /* רוחב קבוע (לא לפי תוכן) - אחרת "3-5-2" ו-"4-2-3-1" נותנים רוחב שונה לעמודה,
     וזה מזיז את המרכוז של "מקום X" ליד גם אם קצה התיבה שלה קבוע */
  flex: 0 0 108px;
  display: flex;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}

.history-mid span:first-child { flex-shrink: 0; }
.history-mid span:last-child { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.history-rating {
  font-weight: 900;
  font-size: 16px;
  color: var(--accent-red);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  /* רוחב קבוע (כולל מקום לתגית הישג הרחבה ביותר) כדי ש"מקום X" הממורכז לא יזוז
     תלוי אם יש כתר/כוכב/גביע/מדליה בשורה הספציפית הזו או לא */
  min-width: 92px;
}

.history-badges { font-size: 13px; }

/* מקום בטבלה - רק בתצוגת מחשב (בתצוגת מובייל אין מספיק מקום בשורה). ממורכז בשטח
   הפנוי שנשאר בין ההרכב לרייטינג - קבוע במקומו כי לרייטינג יש רוחב מינימלי קבוע */
.history-position {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}

/* --- דריסות מובייל --- (בסוף הקובץ בכוונה, כדי שינצחו את הכללים הבסיסיים למעלה) */
@media (max-width: 899px) {
  /* מצמצמים את גובה רשימת השחקנים כך שרק כ-8 שורות נראות בתצוגה הראשונית (בלי גלילה),
     במקום 12 - המגרש למטה נשאר באותו גודל, פשוט צריך לגלול אליו קצת יותר */
  .roster-list { max-height: 375px; flex: 0 0 auto; }

  /* בדף הנחיתה במובייל תיבת הסטטיסטיקה בפינה הופכת לפס מלא לרוחב תחתית המסך (כל
     השורות זו לצד זו באותה שורה) - "חסר שחקן?"/"לא מסכים עם ציון?" יושבים מעליו */
  .landing-stats {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 16px;
    padding: 16px 16px;
    font-size: 18px;
  }
  .landing-stats-title { display: none; }
  .landing-stats-mobile-label {
    display: inline;
    color: var(--muted);
    font-weight: 800;
  }
  .feedback-triggers { bottom: 66px; }

  /* מסגרות-webview מצומצמות (למשל דפדפן פנימי של טוויטר בלחיצה על לינק) מדווחות
     גובה מסך קטן בהרבה ממה שיש בפועל - שני הבלוקים המוצמדים למטה (landing-stats
     + feedback-triggers) אז נוחתים ממש על כפתורי הפעולה של דף הנחיתה במקום
     מתחתם, כי ה-offset הקבוע שלהם בפיקסלים לא מתאים לגובה כזה. כשהגובה קטן
     כל-כך - חוזרים לזרימה רגילה של המסמך (אחרי הכפתורים, עם גלילה) במקום הצמדה
     קבועה לתחתית המסך, כדי שלעולם לא יתנגשו עם שום דבר */
  @media (max-height: 560px) {
    .landing-stats,
    .feedback-triggers {
      position: static;
      transform: none;
      width: auto;
      margin: 16px auto 0;
    }
    .landing-stats { border: 1px solid var(--border); border-radius: 10px; max-width: 340px; }
  }

  /* "מקום בטבלה" בהיסטוריה - רק בתצוגת מחשב, אין מספיק מקום בשורה במובייל */
  .history-position { display: none; }

  /* מסך המערכים: כפתור "לעמוד הראשי" חוזר לזרימה הרגילה (לא מוצמד/מרחף) כדי שלא
     ידבק לכרטיס הבחירה - קטן ומוצמד לימין (כמו קודם), רק לא חופף יותר לכרטיס.
     והכרטיס עצמו ממלא את כל הרוחב במקום להיות מוצמד לימין */
  #home-screen { gap: 8px; }
  .home-back-btn {
    position: static;
    flex: 0 0 auto;
    width: fit-content;
    /* מפוצה על ה-zoom:0.75 של המסך (למעלה) כדי להיראות באותו גודל בפועל
       כמו vs-choice-back-btn, שלא נמצא במסך מוקטן */
    padding: 7px 13px;
    font-size: 16px;
    margin: 0;
  }
  .panel { width: 100%; }

  /* במובייל התגית "תור: X" יושבת מעל פאנל הטקטיקה, ממורכזת (לא מעל המגרש כמו בדסקטופ) */
  #vs-turn-badge { display: none; }
  .vs-turn-badge-mobile-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  /* מסך בחירת שחקן (draft-header): במובייל מחליפים בין המיקום של "תור: X" לציון
     הממוצע - הציון עובר לשורה הראשונה (איפה שהתגית הייתה), והתגית עוברת לשורה
     שלה בנפרד וממורכזת (איפה שהציון היה, אבל לא צמודה לימין כמוהו) */
  .draft-score { order: 3; }
  .draft-vs-turn-badge-wrap {
    order: 4;
    flex-basis: 100%;
    display: flex;
    justify-content: center;
  }

  /* כשההרכב מלא, היחס הרחב/נמוך שמוגדר לדסקטופ גוזר את השורה התחתונה במובייל
     (הרוחב קטן בהרבה מ-780px אז הגובה יוצא נמוך מדי) - נותנים לו יחס גבוה יותר */
  .draft-body.complete .pitch {
    aspect-ratio: 560 / 520;
    max-width: 100%;
  }

  /* מסך בחירת "אתה נגד חבר": יש הרבה מקום ריק מעל שלוש האופציות במובייל בגלל
     המירכוז האנכי הרגיל - מרימים משמעותית יותר (רק במובייל, לא בדסקטופ) */
  #vs-choice-screen .landing-content {
    margin-top: -160px;
  }
}

/* --- מסך הישגים --- */
.achievements-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px 40px;
  width: 100%;
}

.achievements-section { margin-bottom: 26px; }

.achievements-section-head {
  background: #123f66;
  color: #fff;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.achievements-count {
  opacity: 0.85;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.achievements-overall {
  background: #fff;
  border: 1px solid var(--border, #cfe2f2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.achievements-overall-label {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.achievements-overall-track {
  height: 10px;
  border-radius: 999px;
  background: #e6f1fa;
  overflow: hidden;
}

.achievements-overall-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2402b, #f4a340);
  transition: width 0.3s ease;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

@media (max-width: 480px) {
  .achievements-grid { grid-template-columns: repeat(2, 1fr); }
}

.achievement-tile {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.achievement-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 35, 59, 0.1); }

.achievement-tile-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: #f2f6fb;
  border: 2px solid var(--border);
}

.achievement-tile.done .achievement-tile-icon {
  background: linear-gradient(160deg, #fff4e2, #ffe0d3);
  border-color: #c9922b;
}

.achievement-tile.locked .achievement-tile-icon { filter: grayscale(1) opacity(0.45); }

.achievement-tile-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 2.4em;
  display: flex;
  align-items: center;
  color: var(--ink);
}

.achievement-tile.locked .achievement-tile-name { color: var(--muted); }

.achievement-tile-status { font-size: 11px; font-weight: 700; }
.achievement-tile.done .achievement-tile-status { color: #1a8a4a; }
.achievement-tile.locked .achievement-tile-status { color: var(--muted); }

.achievement-tile-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.achievement-tile-progress-fill { height: 100%; background: var(--accent-red); border-radius: 999px; }

.achievement-detail-content { align-items: center; text-align: center; padding-bottom: 20px; }

.achievement-detail-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: 18px auto 10px;
  background: linear-gradient(160deg, #fff4e2, #ffe0d3);
  border: 2px solid #c9922b;
}

.achievement-detail-icon.locked { background: #f2f6fb; border-color: var(--border); filter: grayscale(1) opacity(0.5); }

.achievement-detail-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 6px;
  padding: 0 18px;
}

.achievement-detail-progress-wrap { width: 100%; max-width: 260px; margin: 4px auto 18px; }
.achievement-detail-progress-track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.achievement-detail-progress-fill { height: 100%; background: var(--accent-red); border-radius: 999px; }
.achievement-detail-progress-label { font-size: 12px; font-weight: 800; color: var(--accent-red); margin-top: 6px; }
.achievement-detail-done-label { font-size: 13px; font-weight: 800; color: #1a8a4a; margin-bottom: 18px; }

/* טוסט השלמת הישג - נגלה מלמעלה, נעלם אוטומטית אחרי כ-1.5 שניות. בסגנון
   כדורי (pill) עם אימוג'י, בדומה לתבנית "מועדון חדש התווסף" ברפרנס שהמשתמש
   הראה - מותאם לצבעי האתר (ולא ירוק) */
.achievement-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16, 35, 59, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.achievement-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.achievement-toast-icon { font-size: 18px; }
