/* =========================================================
   station3.css
   סגנון משותף לתחנה 3 ("סוד המעיין"): מסך הפתיחה, שכבת הרקע
   המשותפת לשלושת השלבים (חדר המים), כותרת/הוראת שלב גנרית,
   הודעת רמז גנרית, מד הלחץ (housing+needle), מסך המעבר הכהה,
   ומסכי הסיום/הפרס (בנויים על גבי מחלקות תחנה 1/2 קיימות).
   ========================================================= */

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

.station3-intro-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(90, 200, 210, 0.1) 0%, rgba(90, 200, 210, 0) 65%),
    url("../assets/station3/station3-water-chamber-background.png");
  background-size: cover;
  background-position: center 40%;
  filter: brightness(0.5) saturate(0.9);
}

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

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

/* ===================== שכבת רקע משותפת לשלושת השלבים ===================== */
/* חדר המים הקולנועי ממלא את כל השטח מתחת לסרגל העליון - object
   cover, בלי שוליים ריקים, עם דעיכה עדינה רק במקום שנדרשת קריאות
   לממשק (לא מלבן כהה גורף אחד). */

.station3-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/station3/station3-water-chamber-background.png");
  background-size: cover;
  background-position: center 42%;
}

.station3-dim-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* הכהיה חלקית בלבד סביב אזורי הממשק (שמאל/מרכז-קדמי/ימין) - לא
     מלבן אחיד אחד - כדי שהרקע הקולנועי יישאר קריא ובולט. */
  background:
    radial-gradient(ellipse 34% 55% at 19% 38%, rgba(4, 6, 8, 0.5) 0%, rgba(4, 6, 8, 0) 72%),
    radial-gradient(ellipse 40% 40% at 50% 92%, rgba(4, 6, 8, 0.4) 0%, rgba(4, 6, 8, 0) 75%),
    radial-gradient(ellipse 34% 55% at 84% 45%, rgba(4, 6, 8, 0.42) 0%, rgba(4, 6, 8, 0) 72%);
}

/* הבזק כניסה קולנועי: כהה מלא -> נעלם בהדרגה, חושף את אור
   האבוקות/המים. מוצג רק בכניסה חיה ראשונה לשלב א׳ (station3Aqueduct.js). */
.station3-entrance-veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #050403;
  opacity: 1;
  pointer-events: none;
  transition: opacity 1400ms ease;
}

.station3-entrance-veil.is-lifted {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .station3-entrance-veil {
    transition: opacity 1ms linear;
  }
}

/* ===================== כותרת/הוראה גנרית לשלב ===================== */

.station3-phase-title {
  position: absolute;
  z-index: 2;
  top: clamp(8px, 1.6vh, 18px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  text-align: center;
  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(232, 194, 122, 0.2);
}

.station3-phase-instruction {
  position: absolute;
  z-index: 2;
  top: clamp(42px, 6.4vh, 66px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(640px, 92%);
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 1.05vw, 0.98rem);
  line-height: 1.55;
  color: var(--color-parchment-dim);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.station3-hint-message[hidden] {
  display: none;
}

.station3-hint-message {
  position: absolute;
  z-index: 3;
  top: clamp(98px, 15.5vh, 128px);
  left: 50%;
  transform: translateX(-50%);
  width: min(460px, 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, 9, 10, 0.6);
  border: 1px solid rgba(120, 200, 210, 0.25);
  padding: 8px 16px;
  border-radius: 8px;
}

/* ===================== מד הלחץ (housing קבוע + מחט מסתובבת) ===================== */

.pressure-gauge-wrap {
  position: absolute;
  z-index: 3;
  width: clamp(78px, 8.5vw, 130px);
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
}

.pressure-gauge-housing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* עוגן סיבוב בגודל 0 בדיוק במרכז ה-housing - כל סיבוב (rotate)
   מופעל רק כאן, כך שהוא תמיד מדויק סביב מרכז המד בלי קשר לגודל/
   יחס-הממדים השונה של תמונת המחט עצמה. */
.pressure-gauge-pivot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: rotate(var(--needle-angle, -85deg));
  transition: transform 260ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .pressure-gauge-pivot {
    transition: transform 1ms linear;
  }
}

.pressure-gauge-pivot.is-unstable {
  animation: gaugeUnstableShake 220ms ease-in-out infinite;
}

@keyframes gaugeUnstableShake {
  0%, 100% { transform: rotate(calc(var(--needle-angle, 0deg) - 3deg)); }
  50% { transform: rotate(calc(var(--needle-angle, 0deg) + 3deg)); }
}

/* המחט עצמה: ה-pivot הגרפי בתוך נכס התמונה נמדד בפועל ב-74% מגובהה
   (ראו scripts/needle-profile.ps1) - ה-translate ממקם בדיוק את
   אותה נקודה על עוגן הסיבוב, ללא קשר לגודל התצוגה שנקבע ל-img. */
.pressure-gauge-needle-img {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(56px, 6.4vw, 96px);
  height: auto;
  transform: translate(-50%, -74%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .pressure-gauge-pivot.is-unstable {
    animation: none !important;
  }
}

.pressure-gauge-wrap.is-gold-zone .pressure-gauge-housing {
  filter: drop-shadow(0 0 8px rgba(232, 194, 122, 0.4)) drop-shadow(0 0 20px rgba(232, 194, 122, 0.75));
}

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

/* *** תוקן: היה רקע-חדר-מים מטושטש כאן (לא עקבי עם שאר מסכי
   התגמול) - עכשיו אותו רקע כחול-עמוק+זהב המשותף לכל שש מסכי
   התגמול (ראו ההערה המרכזית ב-reward.css). *** */
.station3-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%);
}

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

.station3-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(120, 210, 220, 0.28) 0%, rgba(120, 210, 220, 0.1) 55%, rgba(120, 210, 220, 0) 78%);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
  animation: stationBadgeIn 500ms ease;
}

.station3-seal-badge img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(140, 220, 230, 0.5));
}

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