/* =========================================================
   station6Wind.css
   תחנה 6, שלב ג' - מבחן הרוח. אבן היסוד (מסלול 7 הסמלים) במרכז,
   ארבעה מנגנוני נעילה בפינות (station6-corner-lock.png + סמל SVG
   נפרד מעליו - מנורה/קשת/גפן/כוכב, לא כיווני רוח), שכבת רוח עדינה.
   ========================================================= */

.wind-phase-subinstruction {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: clamp(0.78rem, 0.96vw, 0.9rem);
  color: #f0e6d2;
  opacity: 0.85;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.wind-stage {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  padding: clamp(78px, 12vh, 104px) clamp(16px, 5vw, 60px) clamp(70px, 11vh, 96px);
}

.wind-corner-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wind-corner-unit[data-corner="corner1"] { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; }
.wind-corner-unit[data-corner="corner2"] { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
.wind-corner-unit[data-corner="corner3"] { grid-column: 1; grid-row: 3; justify-self: start; align-self: end; }
.wind-corner-unit[data-corner="corner4"] { grid-column: 2; grid-row: 3; justify-self: end; align-self: end; }

/* *** אזור-לחיצה נמדד בפועל בבדיקה חיה: 96x76px - נמוך מ-90x90
   הנדרש בגובה. תוקן לגודל מובטח לפחות 90x90 בכל רזולוציה. ***/
.wind-corner-btn {
  position: relative;
  width: clamp(90px, 7.4vw, 118px);
  height: clamp(90px, 9vh, 118px);
  padding: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wind-corner-btn:hover,
.wind-corner-btn:focus-visible {
  border-color: var(--color-gold);
  box-shadow: 0 0 14px rgba(232, 194, 122, 0.55);
  outline: none;
}

.wind-corner-contact-shadow {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 70%;
  height: 14%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 75%);
  z-index: -1;
}

.wind-corner-lock-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  transition: filter 300ms ease;
}

/* *** מנגנוני הפינות מציגים רק מספרים 1-4 (לא סמלים) - הצגת הסמלים
   עליהם הייתה מאפשרת התאמה ישירה בלי לפענח את הסיבוב. הפינות
   ממוספרות עם כיוון השעון: 1=ימין-למעלה, 2=ימין-למטה, 3=שמאל-למטה,
   4=שמאל-למעלה. ***/
.wind-corner-number {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 10px rgba(232, 194, 122, 0.5);
}

.wind-corner-label {
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 0.8vw, 0.78rem);
  color: var(--color-parchment-dim);
}

.wind-corner-btn.is-target .wind-corner-lock-img {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 16px rgba(255, 210, 120, 0.85));
  animation: station6BadgePulse 700ms ease-in-out infinite;
}

.wind-corner-btn.is-locked .wind-corner-lock-img {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 12px rgba(140, 220, 160, 0.75));
}

.wind-corner-symbol.is-hint-focus {
  animation: station6BadgePulse 900ms ease-in-out infinite;
}

/* ===================== אבן היסוד + מסלול שבעת הסמלים ===================== */

.wind-center-unit {
  grid-column: 1 / span 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.wind-foundation-stone-wrap {
  position: relative;
  width: clamp(140px, 15vw, 200px);
}

.wind-foundation-stone-wrap img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5));
}

/* *** ספירה לאחור (3,2,1,התחילו!) - היחיד שרשאי להקדים טיימר אמיתי.
   ממוקמת מעל אבן היסוד, לא-חוסמת (pointer-events:none). ***/
.wind-countdown-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  color: var(--color-gold);
  text-shadow: 0 0 18px rgba(232, 194, 122, 0.9), 0 3px 10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 5;
  animation: windCountdownPulse 900ms ease-out;
}

.wind-countdown-badge[hidden] {
  display: none;
}

@keyframes windCountdownPulse {
  0% { transform: scale(0.6); opacity: 0; }
  30% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* *** כיוון קריאה מפורש - "אל תסתמך על RTL" (דרישה מפורשת): חץ +
   תווית גלויים תמיד, והמסלול עצמו נכפה ל-LTR ויזואלי בלי קשר לכיוון
   הדף הכללי. ***/
.wind-path-row {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}

.wind-path-direction-label {
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 0.8vw, 0.78rem);
  color: var(--color-gold);
}

.wind-path-direction-arrow {
  font-size: 1.1rem;
  color: var(--color-gold);
}

.wind-path-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(10, 8, 4, 0.5);
  border: 1px solid rgba(183, 169, 140, 0.3);
  direction: ltr;
}

.wind-progress-label {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(0.8rem, 0.96vw, 0.92rem);
  color: #fff8ea;
}

.wind-start-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* *** קו-רוח קצר שנע מהפינה שנלחצה נכון אל עבר אבן היסוד - משוב
   חזותי ללחיצה נכונה, מעבר להדלקת הסמל במסלול. ***/
.wind-connect-line {
  position: fixed;
  pointer-events: none;
  z-index: 40;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(232, 194, 122, 0), rgba(232, 194, 122, 0.95), rgba(232, 194, 122, 0));
  transform-origin: 0 50%;
  animation: windConnectLineFade 500ms ease-out forwards;
}

@keyframes windConnectLineFade {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}

.wind-path-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #b7a98c;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(183, 169, 140, 0.4);
}

.wind-path-step svg {
  width: 60%;
  height: 60%;
}

/* *** סמל שהושלם מקבל אור כחול-זהוב + סימון קטן (דרישה מפורשת). ***/
.wind-path-step.is-done {
  color: #cfe0ff;
  border-color: #e8c27a;
  box-shadow: 0 0 8px rgba(140, 180, 255, 0.6), 0 0 4px rgba(232, 194, 122, 0.5);
  position: relative;
}

.wind-path-step.is-done::after {
  content: "\2713";
  position: absolute;
  bottom: -6px;
  right: -4px;
  font-size: 0.6rem;
  color: #cfe0ff;
  background: rgba(10, 8, 4, 0.85);
  border-radius: 50%;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* *** הסמל הנוכחי מקבל מסגרת פועמת - לא צביעה שמזהה אותו כ"נכון",
   רק מציין שזה השלב הפעיל כרגע (השחקן עדיין צריך לפענח לאן). ***/
.wind-path-step.is-current {
  color: #f0e6d2;
  border-color: var(--color-gold);
  animation: windCipherCurrentPulse 1200ms ease-in-out infinite;
}

@keyframes windCipherCurrentPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(232, 194, 122, 0.5); }
  50% { box-shadow: 0 0 16px rgba(232, 194, 122, 0.95); }
}

.wind-path-step.is-hint-focus {
  animation: station6BadgePulse 900ms ease-in-out infinite;
}

/* ===================== מפתח הצופן הבסיסי (על אבן היסוד) =====================
   ארבעה סמלים, כל אחד עם מספר-הפינה הבסיסי שלו, ממוקמים בארבע
   פינות האבן - גדול מספיק לראות גם את הסמל וגם את מספרו. ***/
.windcipher-key {
  position: absolute;
  inset: 6%;
  pointer-events: none;
  z-index: 3;
}

.windcipher-key-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #f0e6d2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.windcipher-key-item svg {
  width: clamp(18px, 2vw, 26px);
  height: clamp(18px, 2vw, 26px);
}

.windcipher-key-item-number {
  font-family: var(--font-heading);
  font-size: clamp(0.62rem, 0.78vw, 0.74rem);
  color: var(--color-gold);
  background: rgba(10, 8, 4, 0.7);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.windcipher-key-item.is-hint-focus svg {
  animation: station6BadgePulse 1000ms ease-in-out infinite;
}

.windcipher-key-pos-0 { top: 2%; right: 2%; }
.windcipher-key-pos-1 { bottom: 2%; right: 2%; }
.windcipher-key-pos-2 { bottom: 2%; left: 2%; }
.windcipher-key-pos-3 { top: 2%; left: 2%; }

/* ===================== הוראת סיבוב (לוח כהה, ניגודיות גבוהה) ===================== */

.windcipher-rotation-instruction {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(0.86rem, 1.05vw, 1rem);
  color: #fff8ea;
  background: rgba(8, 6, 3, 0.8);
  border: 1px solid rgba(210, 170, 110, 0.4);
  border-radius: 8px;
  padding: 6px 16px;
  min-height: 1.3em;
}

/* ===================== רמז 2: טבעות-סיבוב סביב האבן ===================== */

.windcipher-rotation-ring {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 2px dashed rgba(232, 194, 122, 0.7);
  pointer-events: none;
  z-index: 4;
}

/* ===================== רמז 3 / הדגמה: ghost נע מהמקור ליעד ===================== */

.windcipher-ghost {
  position: fixed;
  z-index: 45;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(232, 194, 122, 0.35);
  border: 2px solid var(--color-gold);
  pointer-events: none;
  transition: left 900ms ease-in-out, top 900ms ease-in-out;
}

/* ===================== מד רוח (זמן הסבב) ===================== */

.wind-meter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 70%);
}

.wind-meter-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(183, 169, 140, 0.3);
  overflow: hidden;
}

.wind-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c98b4a, #e8c27a);
  transition: width 100ms linear;
}

/* ===================== שכבת רוח עדינה (בזמן המרוץ בלבד) ===================== */

.wind-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: url("../assets/station6/station6-wind-overlay.png");
  background-size: cover;
  background-position: center;
  opacity: 0.4;
  mix-blend-mode: screen;
  transition: opacity 900ms ease;
}

.wind-overlay-layer.is-weakening {
  opacity: 0.08;
}

/* ===================== כפתור המשך/התחלה, גלוי רק כשהמרוץ אינו רץ ===================== */

.wind-continue-btn[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .wind-corner-btn.is-target .wind-corner-lock-img,
  .wind-path-step.is-hint-focus,
  .wind-path-step.is-current,
  .windcipher-key-item.is-hint-focus svg,
  .wind-countdown-badge {
    animation: none !important;
  }
  .wind-overlay-layer,
  .windcipher-ghost {
    transition: none !important;
  }
}
