/* =========================================================
   station4.css
   תחנה 4 - "דרך הענן": מסך פתיחה, רקע משותף לשלושת השלבים, כותרת/
   הוראה/הודעת-מצב גנרית לשלב, כפתור "איך משחקים?" + חלונית הסבר,
   ומסכי הסיום/הפרס (מבוססים על מחלקות תחנה 1/3 קיימות).

   *** עיצוב: לקח מפורש מתקלות עבר בתחנות 2-3 - הכותרת/ההוראה/הודעת
   המצב של כל שלב בנויות כאן כפאנל position:absolute *יחיד* עם
   flex-column + gap קבוע, לא כמה אלמנטים עצמאיים עם top/bottom
   נפרדים משלהם (זה בדיוק מה שגרם לחפיפות שתוקנו בעבר). ***
   ========================================================= */

/* ===================== מסך פתיחת תחנה 4 ===================== */

.station4-intro-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 35%, rgba(120, 150, 210, 0.1) 0%, rgba(120, 150, 210, 0) 65%),
    url("../assets/station4/station4-desert-night-background.png");
  background-size: cover;
  background-position: center 38%;
  filter: brightness(0.5) saturate(0.9);
}

.station4-intro-dim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(6, 8, 14, 0.35) 0%, rgba(4, 5, 10, 0.82) 78%);
}

.station4-intro-content {
  position: relative;
  z-index: 1;
}

/* ===================== שכבת רקע משותפת לשלושת השלבים ===================== */

.station4-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/station4/station4-desert-night-background.png");
  background-size: cover;
  background-position: center 40%;
}

.station4-dim-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 34% 50% at 12% 60%, rgba(4, 6, 12, 0.42) 0%, rgba(4, 6, 12, 0) 70%),
    radial-gradient(ellipse 40% 36% at 50% 94%, rgba(4, 6, 12, 0.35) 0%, rgba(4, 6, 12, 0) 72%),
    radial-gradient(ellipse 30% 50% at 90% 55%, rgba(4, 6, 12, 0.4) 0%, rgba(4, 6, 12, 0) 70%);
}

/* ===================== פאנל מידע עליון אחד (כותרת/הוראה/הודעת מצב) ===================== */
/* מיכל position:absolute יחיד עם עוגן אחד - כל התוכן הפנימי זורם
   ב-flex-column + gap קבוע, בלי position/top/bottom נפרד לכל ילד. */

.station4-phase-title {
  position: absolute;
  z-index: 2;
  top: clamp(8px, 1.6vh, 18px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.7vw, 1.5rem);
  color: var(--color-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 16px rgba(120, 150, 220, 0.25);
}

.station4-phase-instruction {
  position: absolute;
  z-index: 2;
  top: clamp(42px, 6.6vh, 68px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(620px, 90%);
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 1.05vw, 0.98rem);
  line-height: 1.5;
  color: var(--color-parchment-dim);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  padding: 3px 14px;
  border-radius: 10px;
  background: radial-gradient(ellipse 92% 160% at 50% 50%, rgba(4, 6, 14, 0.4) 0%, rgba(4, 6, 14, 0) 74%);
}

.station4-status-message[hidden] {
  display: none;
}

.station4-status-message {
  position: absolute;
  z-index: 3;
  top: clamp(84px, 12.6vh, 118px);
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 90%);
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-style: italic;
  color: var(--color-bronze-light);
  font-size: clamp(0.8rem, 1vw, 0.92rem);
  line-height: 1.5;
  background: rgba(6, 8, 14, 0.6);
  border: 1px solid rgba(140, 160, 210, 0.25);
  padding: 8px 16px;
  border-radius: 8px;
}

/* ===================== כפתור "איך משחקים?" ===================== */

.station4-howto-btn {
  position: absolute;
  z-index: 3;
  top: clamp(8px, 1.6vh, 18px);
  right: clamp(10px, 2vw, 26px);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: clamp(0.74rem, 0.9vw, 0.84rem);
  color: var(--color-bronze-light);
  background: rgba(6, 8, 14, 0.55);
  border: 1px solid rgba(140, 160, 210, 0.4);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.station4-howto-btn:hover,
.station4-howto-btn:focus-visible {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* ===================== חלונית "איך משחקים?" (משותפת לשלושת השלבים) ===================== */

.station4-intro-overlay[hidden] {
  display: none;
}

.station4-intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.station4-intro-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 10, 0.72);
}

.station4-intro-card {
  position: relative;
  z-index: 1;
  width: min(440px, 90vw);
  max-height: 82vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(16px, 3vh, 26px) clamp(18px, 3vw, 28px);
  background: linear-gradient(160deg, #171a26 0%, #0c0e16 100%);
  border: 2px solid rgba(140, 160, 220, 0.5);
  border-radius: 14px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.station4-intro-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--color-gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.station4-intro-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(0.84rem, 1.05vw, 0.96rem);
  line-height: 1.6;
  color: var(--color-parchment-dim);
}

.station4-intro-close-btn {
  padding: 9px 26px;
  font-family: var(--font-heading);
  font-size: clamp(0.88rem, 1.05vw, 0.98rem);
  font-weight: 700;
  color: var(--color-gold);
  background: rgba(90, 100, 170, 0.35);
  border: 1.5px solid rgba(150, 165, 220, 0.65);
  border-radius: 6px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.station4-intro-close-btn:hover,
.station4-intro-close-btn:focus-visible {
  border-color: var(--color-gold);
  box-shadow: 0 0 16px rgba(232, 194, 122, 0.4);
}

/* ===================== מסכי סיום/פרס תחנה 4 (מבוססים על מחלקות תחנה 1/3) ===================== */

/* *** תוקן: היה רקע-מדבר מטושטש כאן (לא עקבי עם שאר מסכי
   התגמול) - עכשיו אותו רקע כחול-עמוק+זהב המשותף לכל שש מסכי
   התגמול (ראו ההערה המרכזית ב-reward.css). *** */
.station4-finale-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 65% 55% at 50% 28%, rgba(232, 194, 122, 0.16) 0%, rgba(232, 194, 122, 0) 60%),
    radial-gradient(ellipse 130% 100% at 50% 112%, rgba(16, 30, 58, 0.95) 0%, rgba(5, 8, 18, 1) 70%),
    linear-gradient(165deg, #101d38 0%, #070c18 55%, #04060d 100%);
}

.station4-seal-badge[hidden] {
  display: none;
}

.station4-seal-badge {
  width: clamp(120px, 9vw, 160px);
  height: clamp(120px, 9vw, 160px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(150, 165, 220, 0.28) 0%, rgba(150, 165, 220, 0.1) 55%, rgba(150, 165, 220, 0) 78%);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
  animation: station4SealBadgeIn 900ms ease;
}

.station4-seal-badge img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

@keyframes station4SealBadgeIn {
  0% { opacity: 0; transform: scale(0.7); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .station4-seal-badge {
    animation: none !important;
  }
}
