/* =========================================================
   station6Walls.css
   תחנה 6, שלב א' - קירות הסוכה, כשרשרת-חיבורים אופקית (בנייה
   מחדש שנייה - אובחן על המסך בפועל: הגרסה הקודמת עם תרשים-שלד +
   תגי-חיבור מרחפים מעל/מתחת לא הייתה קריאה כחידת-דומינו). מסלול
   אחד ברור: התחלה (ימין) -> 4 מקומות -> סיום (שמאל), עם חצים
   מכווני-קריאה שגם משמשים כמחוון-חיבור חי (זהב=מתאים,
   אדום-ברונזה=לא מתאים). כל קלף (במגש ובמקום) נושא שני מחברים
   הצמודים ממש לדפנות הימנית/שמאלית שלו. פריסת המסך כולה ב-CSS
   Grid בארבע שורות (כותרת/שרשרת/מגש/כפתורים) - לא position:absolute
   נפרד לכל אלמנט.
   ========================================================= */

.walls-screen-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  row-gap: clamp(8px, 1.3vh, 14px);
  align-content: center;
  padding: clamp(12px, 2vh, 22px) clamp(12px, 3vw, 40px);
}

/* ===================== שורה 1: כותרת + הוראה ===================== */

.walls-header-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(900px, 96%);
  margin: 0 auto;
}

.walls-header-top-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.walls-phase-title {
  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(220, 180, 110, 0.25);
}

/* *** ניגודיות גבוהה (דרישה מפורשת): לבן-שמנת על רקע כהה מספיק,
   לא זהב בהיר ודק ישירות על הרקע. ***/
.walls-phase-instruction {
  margin: 0;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(0.98rem, 1.3vw, 1.15rem);
  line-height: 1.45;
  color: #fff8ea;
  background: rgba(8, 6, 3, 0.74);
  border: 1px solid rgba(210, 170, 110, 0.35);
  border-radius: 10px;
  padding: 10px 18px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

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

/* ===================== שורה 2: שרשרת החיבורים ===================== */

.walls-chain-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.8vw, 10px);
  flex-wrap: nowrap;
  width: min(1200px, 98%);
  margin: 0 auto;
}

/* *** קצוות השרשרת: ללא שום צורה או תג (דרישה מפורשת - הצגת עוגן
   התחלה/סיום קודם חשפה חלק מהפתרון). כיסוי-עץ ניטרלי בלבד, נטול
   מידע, רק כדי שהשרשרת תיראה נכנסת אל תוך מסגרת הסוכה בשני הקצוות. ***/
.walls-chain-endcap {
  flex: 0 0 auto;
  width: clamp(14px, 1.4vw, 22px);
  height: clamp(70px, 9vh, 100px);
  border-radius: 6px;
  background: linear-gradient(180deg, #4a3520 0%, #2e2013 100%);
  border: 1.5px solid rgba(183, 169, 140, 0.35);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
}

/* ===================== לוח רמזי הבנאים ===================== */

.walls-clue-board {
  width: min(920px, 97%);
  margin: 0 auto;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(8, 6, 3, 0.68);
  border: 1px solid rgba(210, 170, 110, 0.4);
}

.walls-clue-board-title {
  margin: 0 0 4px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(0.86rem, 1.05vw, 1rem);
  color: var(--color-gold);
}

.walls-clue-list {
  margin: 0;
  padding-inline-start: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.walls-clue-list li {
  font-family: var(--font-body);
  font-size: clamp(0.76rem, 0.92vw, 0.88rem);
  line-height: 1.4;
  color: #f5ecd8;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.walls-clue-list li.is-hint-focus {
  background: rgba(232, 194, 122, 0.16);
  color: var(--color-gold);
  animation: station6BadgePulse 1200ms ease-in-out infinite;
}

.walls-clue-board.is-error-focus {
  animation: station6BadgePulse 900ms ease-in-out infinite;
  border-color: var(--color-gold);
}

/* חץ-כיוון-קריאה שהוא גם מחוון-חיבור חי (רק בין קירות סמוכים -
   ראו station6Walls.js: אין יותר חצים/מחוונים בקצוות השרשרת) */
.walls-chain-connector {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(24px, 2.4vw, 38px);
  height: clamp(30px, 3vw, 40px);
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  line-height: 1;
  color: rgba(183, 169, 140, 0.55);
  transition: color 0.25s ease, text-shadow 0.25s ease, transform 0.2s ease;
}

/* *** רק התאמה מקבלת זוהר - אי-התאמה נשארת ניטרלית ולא נבדלת
   חזותית מ"עדיין לא ידוע" (דרישה מפורשת: לא לחשוף טעות מיד). ***/
.walls-chain-connector.is-match {
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(232, 194, 122, 0.85);
  transform: scale(1.2);
}

.walls-chain-connector.is-error-focus {
  animation: station6BadgePulse 900ms ease-in-out infinite;
}

.walls-chain-slot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.walls-chain-slot-number {
  font-family: var(--font-body);
  font-size: clamp(0.66rem, 0.78vw, 0.76rem);
  color: var(--color-parchment-dim);
  opacity: 0.75;
}

.wall-slot {
  position: relative;
  width: clamp(90px, 7.2vw, 128px);
  height: clamp(120px, 15vh, 172px);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(30, 22, 12, 0.85) 0%, rgba(14, 10, 6, 0.9) 100%);
  border: 1.5px dashed rgba(183, 169, 140, 0.4);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wall-slot.is-filled {
  border-style: solid;
  border-color: rgba(216, 164, 91, 0.55);
  cursor: default;
}

.wall-slot.is-hint-focus {
  border-color: var(--color-gold);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(232, 194, 122, 0.55);
}

.wall-placed-btn {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  padding: 12px;
  cursor: pointer;
}

.wall-placed-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

.wall-contact-shadow {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 68%;
  height: 12%;
  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;
}

.wall-placed-btn:disabled {
  cursor: default;
}

/* *** מחברים פיזיים יחידים - ממש במרכז הדופן הימנית/שמאלית של
   הקלף עצמו (לא בפינות, לא מעל/מתחת). כדי שהזיהוי לא יישען על צבע
   בלבד: הימני (כניסה) מעוצב כ"שקע" ברונזה חרוט-פנימה (inset), השמאלי
   (יציאה) כ"מפתח" ברונזה בולט (raised) - שני סגנונות-תבליט שונים
   בנוסף לצורה עצמה (עיגול/משולש/ריבוע), כך שכשני קלפים סמוכים
   מונחים, המחברים הפונים זה לזה כמעט נוגעים על פני החץ שביניהם. ***/
.wall-card-badge {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: clamp(38px, 2.6vw, 44px) !important;
  height: clamp(38px, 2.6vw, 44px) !important;
  z-index: 2;
  border-width: 2px !important;
  border-color: rgba(120, 86, 46, 0.9) !important;
}

.wall-card-badge-entry {
  right: -10px;
  background: radial-gradient(circle at 50% 45%, #4a3320 0%, #2a1c0f 70%) !important;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.85), inset 0 -1px 2px rgba(210, 170, 110, 0.25) !important;
}

.wall-card-badge-exit {
  left: -10px;
  background: radial-gradient(circle at 42% 38%, #c69a5c 0%, #8a6430 70%) !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 224, 170, 0.5) !important;
}

/* ===================== שורה 3: מגש שישה קירות ===================== */

.walls-tray-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.walls-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 1.6vw, 24px);
  flex-wrap: wrap;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(10, 8, 4, 0.5);
  border: 1px solid rgba(183, 169, 140, 0.3);
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.45);
  max-width: 96%;
  max-height: 100%;
  overflow-y: auto;
}

.wall-token {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(30, 22, 12, 0.65);
  border: 1.5px solid rgba(183, 169, 140, 0.4);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

/* *** לפחות 150-180 פיקסל גובה ב-1920x1080 (נמדד בפועל) כדי שצבע
   הקיר ומחברי העיגול/משולש/ריבוע יהיו ברורים לעין. ***/
.wall-token img {
  height: clamp(130px, 16.5vh, 180px);
  width: auto;
  display: block;
  pointer-events: none;
}

.wall-token:hover:not(:disabled),
.wall-token:focus-visible {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(232, 194, 122, 0.4);
}

.wall-token.is-selected {
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(232, 194, 122, 0.6);
  transform: translateY(-3px);
}

.wall-token.is-hint-focus {
  animation: station6BadgePulse 1100ms ease-in-out infinite;
  border-color: var(--color-gold);
}

.wall-token.is-dragging-placeholder {
  opacity: 0.3;
}

/* ===================== שורה 4: כפתורי פעולה ===================== */

.walls-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: min(760px, 94%);
  margin: 0 auto;
}

/* ===================== חלונית "איך משחקים?" + הדגמה ===================== */

.walls-intro-card {
  width: min(560px, 90vw);
}

.walls-demo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 6px;
}

.walls-demo-card {
  position: relative;
  width: 54px;
  height: 66px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(60, 45, 28, 0.9), rgba(30, 20, 10, 0.95));
  border: 1.5px solid rgba(183, 169, 140, 0.5);
}

/* *** ארבעת עיטורי-הפינה בקלף האמיתי (שונים זה מזה, לא קשורים
   לחידה) - מוצגים כאן עמומים ומטושטשים בכוונה, בניגוד לתג האמיתי
   במרכז הדופן שמודגש, כדי להמחיש חזותית "זה קישוט, זה המחבר". ***/
.walls-demo-corner {
  position: absolute;
  font-size: 11px;
  line-height: 1;
  color: rgba(183, 169, 140, 0.55);
  opacity: 0.6;
}

.walls-demo-corner-tl { top: 3px; right: 3px; }
.walls-demo-corner-tr { top: 3px; left: 3px; }
.walls-demo-corner-bl { bottom: 3px; right: 3px; }
.walls-demo-corner-br { bottom: 3px; left: 3px; }

.walls-demo-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
}

.walls-demo-badge-right {
  right: -12px;
}

.walls-demo-badge-left {
  left: -12px;
}

.walls-demo-badge.is-shape-circle {
  border-radius: 50%;
  background: #e8c27a;
  border: 1.5px solid rgba(20, 14, 8, 0.6);
}

.walls-demo-badge.is-shape-square {
  border-radius: 3px;
  background: #e8c27a;
  border: 1.5px solid rgba(20, 14, 8, 0.6);
}

.walls-demo-badge.is-shape-triangle {
  width: 0;
  height: 0;
  top: calc(50% - 5px);
  border-top: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid #e8c27a;
  background: none;
  border-radius: 0;
}

.walls-demo-link {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.walls-demo-link-ok {
  color: #8fdc8f;
  text-shadow: 0 0 8px rgba(143, 220, 143, 0.6);
}

.walls-demo-link-bad {
  color: #ff9080;
  text-shadow: 0 0 8px rgba(255, 144, 128, 0.6);
}

.walls-demo-gap {
  width: 18px;
}

.walls-demo-caption {
  margin: 2px 0 10px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-parchment-dim);
}

/* ===================== שכבת גרירה + תמונת-שכפול נגררת ===================== */

.walls-drag-layer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.wall-drag-clone {
  position: fixed;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}

.wall-drag-clone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .wall-token.is-hint-focus,
  .walls-chain-connector.is-error-focus {
    animation: none !important;
  }
}
