/* =========================================================
   station7Finale.css
   תחנה 7 - סיום המשחק: רקע האולם הייעודי (station7-final-hall-
   background / station7-dawn-background, לא רקע תחנה 6), חלק א'
   (מעגל שש החותמות האמיתיות), פתיחת השער, המגילה השלמה, ומסך הניצחון.
   ========================================================= */

.station7-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("../assets/station7/station7-final-hall-background.png");
  background-size: cover;
  background-position: center center;
}

.station7-bg-dawn {
  background-image: url("../assets/station7/station7-dawn-background.png");
  transition: opacity 2400ms ease;
}

/* ===================== חלק א' - תוספות למעגל שש החותמות ===================== */

.seal-socket-number {
  position: absolute;
  transform: translate(-50%, -190%);
  pointer-events: none;
  z-index: 3;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(0.78rem, 1vw, 0.92rem);
  color: #241a0c;
  background: rgba(232, 194, 122, 0.92);
  border-radius: 50%;
  width: 1.7em;
  height: 1.7em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seals-connect-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 500ms ease, transform 500ms ease;
  filter: drop-shadow(0 0 14px rgba(232, 194, 122, 0.55));
}

.seals-connect-ring.is-visible {
  opacity: 1;
  transform: scale(1);
}

.seal-letter {
  position: absolute;
  transform: translate(-50%, -50%) scale(0.4);
  pointer-events: none;
  z-index: 4;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  color: #fff3d6;
  text-shadow: 0 0 12px rgba(255, 220, 140, 0.95), 0 2px 6px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 400ms ease, transform 400ms ease;
}

.seal-letter.is-revealed {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.seal-letter-flourish {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  color: var(--color-gold);
}

.seal-socket.is-locked {
  box-shadow: 0 0 0 3px rgba(150, 200, 170, 0.75);
  border-radius: 50%;
}

/* ===================== פתיחת השער ===================== */

.gate-screen-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 18px);
  padding: clamp(14px, 3vh, 28px) clamp(12px, 3vw, 40px);
}

.gate-stage {
  position: relative;
  width: min(560px, 70vh, 80%);
  aspect-ratio: 1672 / 941;
  flex: 1;
  min-height: 0;
}

/* כלי כיול debug בלבד (Station7Finale.toggleGateCalibration) - לא
   פעיל בגיימפליי רגיל. מסמן את גבולות gate-stage וקו-המפגש כדי
   לאמת חזותית שהם מיושרים מול השער שבתוך תמונת הרקע. */
.gate-stage.debug-calibration-on {
  outline: 2px dashed #ff2d55;
  outline-offset: -1px;
}

.gate-stage.debug-calibration-on .gate-seam-glow {
  opacity: 1 !important;
  background: repeating-linear-gradient(180deg, #ff2d55 0px, #ff2d55 10px, #ffffff 10px, #ffffff 20px);
  filter: none;
  width: 3px;
}

.gate-seals-ring {
  position: absolute;
  inset: 0;
}

.gate-seal-icon {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(26px, 4.2%, 44px);
  height: clamp(26px, 4.2%, 44px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(120, 100, 70, 0.5);
  opacity: 0.35;
  filter: grayscale(0.8) brightness(0.6);
  transition: opacity 400ms ease, filter 400ms ease, box-shadow 400ms ease;
}

.gate-seal-icon.is-lit {
  opacity: 1;
  filter: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(255, 220, 140, 0.85);
}

/* *** תוקן: ברירת-המחדל הייתה scale(0.15) opacity:0 - "כתם זעיר"
   בלתי-נראה כמעט לפני הפתיחה, בניגוד לדרישה שיהיה "בגודל ברור
   ובמרכז המנגנון" לפני הפתיחה. עכשיו גלוי וברור כברירת מחדל;
   is-grown הוא שלב-הטעינה החזק לפני הפתיחה, ו-is-fading הוא
   הדעיכה ההדרגתית בפועל בזמן פתיחת השער (איר ואז נעלם). ***/
.gate-orb-img {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.55);
  width: 22%;
  opacity: 0.8;
  pointer-events: none;
  transition: transform 1400ms ease, opacity 1400ms ease;
  filter: drop-shadow(0 0 20px rgba(180, 210, 255, 0.55));
}

.gate-orb-img.is-grown {
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 1;
  filter: drop-shadow(0 0 44px rgba(210, 230, 255, 0.9));
}

.gate-orb-img.is-fading {
  transform: translate(-50%, -50%) scale(1.7);
  opacity: 0;
  transition: transform 2200ms ease, opacity 2200ms ease;
}

/* *** תוקן: הוחלפו כנפות-שער כפולות (station7-gate-left/right.png)
   שלא הצליחו להתיישר פיקסלית מול כנפות השער שכבר מצוירות בתוך
   תמונת הרקע (ראו ההערה ב-index.html) - זוהר לאורך קו-המפגש
   המרכזי של השער + רעידה עדינה על כל הבמה, יחד עם ה-crossfade
   הקיים כבר בין station7-final-hall-background ל-station7-dawn-
   background. ***/
.gate-seam-glow {
  position: absolute;
  left: 50%;
  top: 4%;
  bottom: 4%;
  width: 6px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(255, 244, 214, 0) 0%,
    rgba(255, 230, 150, 0.9) 15%,
    rgba(255, 214, 120, 0.95) 50%,
    rgba(255, 230, 150, 0.9) 85%,
    rgba(255, 244, 214, 0) 100%
  );
  opacity: 0;
  filter: blur(2px) drop-shadow(0 0 14px rgba(255, 210, 120, 0.8));
  pointer-events: none;
}

.gate-seam-glow.is-pulsing {
  animation: gateSeamPulse 2200ms ease-out;
}

@keyframes gateSeamPulse {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  60% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
  }
}

.gate-stage.is-shaking {
  animation: gateShake 550ms ease-in-out;
}

@keyframes gateShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}

/* ===================== המגילה השלמה ===================== */

.scroll-screen-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vh, 16px);
  padding: clamp(14px, 3vh, 26px) clamp(12px, 3vw, 40px);
  overflow-y: auto;
}

.scroll-wrap {
  position: relative;
  width: min(760px, 92%);
  aspect-ratio: 1536 / 1024;
}

.scroll-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6));
}

.scroll-fragments-list {
  position: absolute;
  inset: 12% 14%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(4px, 1vh, 10px) clamp(8px, 1.4vw, 16px);
  overflow-y: auto;
}

.scroll-fragment-card {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 450ms ease, transform 450ms ease;
}

.scroll-fragment-card.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-fragment-num {
  flex: none;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: rgba(90, 70, 40, 0.25);
  color: #3a2a14;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-fragment-card-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 0.85vw, 0.8rem);
  line-height: 1.4;
  color: #3a2a14;
}

.scroll-fragment-card.is-pending .scroll-fragment-card-text {
  color: #6b5a40;
  font-style: italic;
}

.scroll-summary-message {
  max-width: 640px;
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(0.86rem, 1.1vw, 1rem);
  line-height: 1.6;
  color: #fff8ea;
  background: rgba(8, 6, 3, 0.75);
  border: 1px solid rgba(232, 194, 122, 0.4);
  border-radius: 10px;
  padding: 10px 18px;
}

/* ===================== מסך ניצחון ===================== */

.victory-screen-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 20px);
  padding: clamp(14px, 3vh, 26px) clamp(12px, 3vw, 40px);
  text-align: center;
}

.victory-stats {
  display: flex;
  gap: clamp(14px, 3vw, 36px);
  font-family: var(--font-body);
  font-size: clamp(0.86rem, 1.1vw, 1rem);
  color: #fff8ea;
  background: rgba(8, 6, 3, 0.6);
  border: 1px solid rgba(232, 194, 122, 0.4);
  border-radius: 10px;
  padding: 8px 20px;
}

.victory-seals-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
  max-width: 720px;
}

.victory-seal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: clamp(70px, 9vw, 96px);
}

.victory-seal-item img {
  width: clamp(48px, 6vw, 64px);
  height: clamp(48px, 6vw, 64px);
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 10px rgba(255, 220, 140, 0.6);
}

.victory-seal-item span {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--color-parchment-dim);
  text-align: center;
  line-height: 1.3;
}

.victory-actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .station7-bg-dawn,
  .gate-orb-img,
  .gate-seam-glow,
  .seals-connect-ring,
  .seal-letter,
  .scroll-fragment-card {
    transition: none !important;
  }
  .gate-seam-glow.is-pulsing,
  .gate-stage.is-shaking {
    animation: none !important;
  }
}
