/* =========================================================
   reward.css
   רצף חשיפת החותמת (סוף חידת המסלול), מסך הסיום הנקי של תחנה 1,
   ומסך המעבר הזמני לתחנה 2.
   ========================================================= */

/* ===================== החשכה עדינה של המפה בזמן החשיפה ===================== */

.seal-reveal-dim-overlay {
  position: absolute;
  inset: 0;
  z-index: 1; /* מעל תמונת המפה (ללא z-index), מתחת ל-SVG (z-index:2) */
  background: rgba(6, 5, 3, 0);
  transition: background 600ms ease;
  pointer-events: none;
}

.seal-reveal-dim-overlay.is-active {
  background: rgba(6, 5, 3, 0.6);
}

/* נקודת האור הנעה לאורך קווי המסלול (route-connector-line) -
   נוצרת/מוסרת דינמית ב-JS (animateLightPulseAlongPath). */
.seal-reveal-light-dot {
  fill: #fff6da;
  filter: drop-shadow(0 0 8px rgba(255, 230, 150, 0.95)) drop-shadow(0 0 18px rgba(255, 200, 100, 0.6));
}

/* ===================== הבזק + מדליון החותמת ===================== */

.seal-reveal-overlay[hidden] {
  display: none;
}

.seal-reveal-overlay:not([hidden]) {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.seal-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 1) 0%, rgba(255, 214, 130, 0.55) 35%, rgba(255, 214, 130, 0) 70%);
  opacity: 0;
}

.seal-flash.is-flashing {
  animation: sealFlashBurst 700ms ease-out forwards;
}

@keyframes sealFlashBurst {
  0% {
    opacity: 0;
    width: 10px;
    height: 10px;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    width: 900px;
    height: 900px;
  }
}

.seal-medallion {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.85) rotate(5deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 550ms ease, transform 550ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.seal-medallion.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.seal-medallion-halo {
  width: clamp(190px, 13.5vw, 270px);
  height: clamp(190px, 13.5vw, 270px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(232, 194, 122, 0.32) 0%, rgba(232, 194, 122, 0.12) 55%, rgba(232, 194, 122, 0) 78%);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.6));
}

.seal-medallion-halo img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 214, 130, 0.55));
}

.seal-reveal-title,
.seal-reveal-subtitle {
  margin: 0;
  text-align: center;
  font-family: var(--font-heading);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.seal-reveal-title {
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  color: var(--color-gold);
}

.seal-reveal-subtitle {
  font-size: clamp(0.9rem, 1.15vw, 1.05rem);
  color: var(--color-parchment);
}

/* דעיכת מסך המסלול כולו ברגע שהחותמת כבר "נחתה" בתיק ועומדים
   לעבור למסך הסיום הנקי (בלי מפה). */
.scene.finale-fade-out {
  opacity: 0;
  transition: opacity 500ms ease;
}

/* עותק חותמת מרחף בזמן טיסה אל כפתור תיק המסע - כל שאר המאפיינים
   (מיקום/גודל/transform התחלתיים) נקבעים inline ב-JS. */
.seal-fly-clone {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  transition: transform 700ms cubic-bezier(0.3, 0.7, 0.4, 1), opacity 700ms ease;
}

/* פעימת קבלה עדינה על כפתור תיק המסע - בלי לגעת בסמל הגיאומטרי
   הפנימי שלו (רק box-shadow על הכפתור עצמו). */
.topbar-btn.inventory-pulse {
  animation: inventoryPulseGlow 650ms ease-out;
}

@keyframes inventoryPulseGlow {
  0% {
    box-shadow: 0 0 0 rgba(232, 194, 122, 0);
  }
  40% {
    box-shadow: 0 0 18px 4px rgba(232, 194, 122, 0.7);
  }
  100% {
    box-shadow: 0 0 0 rgba(232, 194, 122, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .seal-flash.is-flashing,
  .scene.finale-fade-out,
  .seal-fly-clone,
  .topbar-btn.inventory-pulse {
    animation: none !important;
    transition: none !important;
  }
  .seal-medallion {
    transition: opacity 1ms linear !important;
  }
}

/* ===================== מסכי תגמול/סיום (אחד לכל תחנה) =====================
   *** תוקן: לפני כן לכל תחנה היה רקע-תמונה מטושטש משלה (חום/גוון
   שונה בכל תחנה) - נראה כמו "מסך חום נפרד" לא עקבי, ולפעמים אף
   כפל את הצגת החותמת עצמה. עכשיו כל שש מסכי התגמול/הסיום (סעיפים
   1-6 למטה) חולקים בדיוק את אותו רקע כחול-עמוק עם עיטור זהב עדין,
   באותה שפה חזותית של מסכי-ההסבר של התחנות - מסך אחד נקי ועקבי. ***/

.station1-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%);
}

.station1-finale-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vh, 26px);
  padding: 0 24px;
  text-align: center;
}

/* מסגרת-זהב עדינה (העיטור המבוקש) - ממוסגרת סביב תוכן המסך כולו,
   מאחורי התג/הטקסט (z-index שלילי בתוך הקשר-הערמה של התוכן). */
.station1-finale-content::before {
  content: "";
  position: absolute;
  inset: 3.5%;
  z-index: -1;
  border: 1px solid rgba(232, 194, 122, 0.28);
  border-radius: 4px;
  box-shadow: inset 0 0 60px rgba(232, 194, 122, 0.05);
  pointer-events: none;
}

.reward-seal-name[hidden] {
  display: none;
}

.reward-seal-name {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 700;
  color: var(--color-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 16px rgba(232, 194, 122, 0.3);
  letter-spacing: 0.02em;
  animation: scrollFragmentIn 500ms ease;
}

/* פעימת קבלה על מונה החותמות שבסרגל העליון, ברגע שהחותמת "נוחתת"
   שם - מקבילה ל-.topbar-btn.inventory-pulse הקיימת, על אלמנט
   שאינו topbar-btn. */
.topbar-stamps.seal-counter-pulse {
  border-radius: 6px;
  animation: inventoryPulseGlow 650ms ease-out;
}

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

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

.station1-seal-badge img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 214, 130, 0.45));
}

@keyframes stationBadgeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scroll-fragment[hidden] {
  display: none;
}

.scroll-fragment {
  width: min(520px, 88vw);
  background: linear-gradient(160deg, rgba(44, 36, 22, 0.92) 0%, rgba(26, 20, 12, 0.95) 100%);
  border: 1.5px solid rgba(216, 164, 91, 0.5);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  padding: 16px 26px;
  animation: scrollFragmentIn 550ms ease;
}

@keyframes scrollFragmentIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-fragment-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  color: var(--color-bronze-light);
  font-size: clamp(0.82rem, 1vw, 0.92rem);
  letter-spacing: 0.02em;
}

.scroll-fragment-text {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--color-parchment);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.6;
}

.station1-complete-message[hidden],
.continue-station-btn[hidden] {
  display: none;
}

.station1-complete-message {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.65;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
  animation: scrollFragmentIn 500ms ease;
}

.continue-station-btn {
  padding: 11px 34px;
  font-family: var(--font-heading);
  font-size: clamp(0.92rem, 1.15vw, 1.08rem);
  font-weight: 700;
  color: var(--color-gold);
  background: rgba(169, 102, 47, 0.4);
  border: 1.5px solid rgba(216, 164, 91, 0.65);
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  animation: scrollFragmentIn 500ms ease;
}

.continue-station-btn:hover {
  border-color: var(--color-gold);
  box-shadow: 0 0 16px rgba(232, 194, 122, 0.5);
}

.continue-station-btn[disabled] {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .station1-seal-badge,
  .reward-seal-name,
  .scroll-fragment,
  .station1-complete-message,
  .continue-station-btn,
  .topbar-stamps.seal-counter-pulse {
    animation: none !important;
  }
}

/* ===================== מסך מעבר זמני לתחנה 2 ===================== */
/* *** תוקן: קודם רקע כהה-אלגנטי גנרי הנבנה כולו ב-CSS (מרקם
   אבן/קלף), במקום הנכס האמיתי - נכס הרקע הייעודי לשוק כבר קיים
   בפועל (station2-market-background.png, בשימוש גם ב-station2Market
   /Journey/Guild) והוא רק לא היה מחובר למסך הפתיחה. עכשיו באותה
   תבנית bg+dim הנהוגה במסכי הפתיחה של תחנות 3-6. ***/

.station2-intro-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(232, 194, 122, 0.14) 0%, rgba(232, 194, 122, 0) 60%),
    url("../assets/station2/station2-market-background.png");
  background-size: cover;
  background-position: center;
  /* *** תוקן: brightness(0.5) + שכבת-הכהיה מלאה-מסך (.station2-intro-dim
     הישנה) ביחד הפכו את שולחן הסוחר הגדול שבתמונה (שהוא חלק
     מהתמונה עצמה, לא רכיב נפרד) ל"מלבן חום כמעט בגודל המסך" -
     בדיוק ההפך מהכוונה "שמרו את רקע השוק גלוי וברור". עכשיו כמעט
     בלי הכהיה - השוק נשאר בהיר וברור, וכהות מקומית קטנה נשארת רק
     למעלה, מאחורי כרטיס הכותרת/הטקסט (ראו .station2-intro-dim). ***/
  filter: brightness(0.88) saturate(1.02);
}

.station2-intro-dim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 65% 40% at 50% 18%, rgba(10, 8, 4, 0.32) 0%, rgba(10, 8, 4, 0) 72%);
}

/* מסך הפתיחה של תחנה 2 בלבד - כרטיס קומפקטי בחלק העליון (לא
   ממורכז על פני כל גובה המסך), כדי שלא "יתנגש" חזותית עם שולחן
   הסוחר הגדול שבתמונה. תחנות 3-6 ממשיכות להשתמש במחלקה המשותפת
   .station2-intro-content כרגיל דרך ה-selector הכללי למעלה - לא
   נוגעים בה, העקיפה כאן ממוקדת אך ורק ל-#screen-station2-intro. */
#screen-station2-intro .station2-intro-content {
  justify-content: flex-start;
  padding-top: 7%;
  max-width: min(760px, 88%);
  margin: 0 auto;
}

/* רקע כהה-אלגנטי גנרי הנבנה כולו ב-CSS (מרקם אבן/קלף) - עדיין
   בשימוש במסך ה-placeholder הגנרי של תחנה 7 (שאין לה נכס רקע
   ייעודי משלה עדיין), לא נמחק כשתחנה 2 קיבלה את הרקע האמיתי שלה. */
.station2-intro-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #17110a;
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 2px, transparent 2px, transparent 64px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0px, rgba(0, 0, 0, 0.16) 2px, transparent 2px, transparent 96px),
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(169, 102, 47, 0.16) 0%, rgba(169, 102, 47, 0) 60%),
    linear-gradient(160deg, #241a10 0%, #140e08 100%);
  background-blend-mode: multiply, multiply, normal, normal;
}

.station2-intro-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.2vh, 22px);
  padding: 0 26px;
  text-align: center;
  animation: scrollFragmentIn 500ms ease;
}

.enter-station-btn {
  padding: 11px 34px;
  font-family: var(--font-heading);
  font-size: clamp(0.92rem, 1.15vw, 1.08rem);
  font-weight: 700;
  color: var(--color-gold);
  background: rgba(8, 6, 4, 0.4);
  border: 1.5px solid rgba(216, 164, 91, 0.6);
  border-radius: 5px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
}

/* להבדיל מ-.open-chest-btn[disabled] (שדועך ונעלם לגמרי) - כאן
   הכפתור נשאר גלוי אך מושבת-חזותית, עם הכיתוב הקטן מתחתיו
   (station2-coming-soon) כמו שנדרש. */
.enter-station-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.station2-coming-soon {
  margin: 0;
  font-family: var(--font-body);
  font-style: italic;
  color: var(--color-parchment-dim);
  font-size: clamp(0.8rem, 1vw, 0.92rem);
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .station2-intro-content {
    animation: none !important;
  }
}

/* ===================== הבזק מעבר קצר בין תחנות ===================== */

.station-transition-flash {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(232, 194, 122, 0.25) 0%, rgba(10, 7, 4, 0.94) 65%);
  opacity: 0;
}

.station-transition-flash.is-active {
  animation: stationTransitionFlash 550ms ease;
}

@keyframes stationTransitionFlash {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .station-transition-flash.is-active {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* ===================== תא חותמת לחיץ בתיק המסע ===================== */

.inventory-stamp-slot.is-filled {
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.inventory-stamp-slot.is-filled:hover,
.inventory-stamp-slot.is-filled:focus-visible {
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(232, 194, 122, 0.5);
  outline: none;
}

/* ===================== תצוגה מוגדלת של חותמת ===================== */

.seal-lightbox-overlay[hidden] {
  display: none;
}

.seal-lightbox-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 5, 3, 0.75);
}

.seal-lightbox-card {
  position: relative;
  width: min(360px, 86vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: linear-gradient(160deg, #2c2416 0%, #1a140c 100%);
  border: 2px solid rgba(216, 164, 91, 0.6);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  padding: 34px 26px 26px;
}

.seal-lightbox-card img {
  width: 62%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(255, 214, 130, 0.5));
}

.seal-lightbox-caption {
  margin: 0;
  text-align: center;
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-size: clamp(0.9rem, 1.1vw, 1.02rem);
  line-height: 1.55;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.seal-lightbox-close {
  position: absolute;
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  color: var(--color-parchment);
  font-size: 1.1rem;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
}

.seal-lightbox-close:hover {
  color: var(--color-gold);
}
