/* מסך "הפתיחה בעוד" — נועל את כל האתר עד שרמי יחליט לפתוח (ר' js/coming-soon.js).
   כברירת מחדל כל תוכן הדף מוסתר; רק #cs-gate מוצג. html.cs-open = מכשיר שהוזן בו קוד ההפקה. */
html:not(.cs-open), html:not(.cs-open) body { overflow: hidden !important; height: 100%; }
html:not(.cs-open) body > *:not(#cs-gate):not(noscript) { display: none !important; }
html.cs-open #cs-gate { display: none !important; }

#cs-gate {
  --cs-bg: #e3d9c4;          /* גוון הקרם של שולי התמונה — התמונה נבלעת ברקע */
  --cs-ink: #12285c;
  --cs-gold: #b8862b;
  position: fixed; inset: 0; z-index: 2147483000;
  background: radial-gradient(ellipse at 50% 45%, #ebe4d1 0%, var(--cs-bg) 55%, #d6c9b0 100%);
  color: var(--cs-ink);
  font-family: 'Assistant', 'Rubik', Arial, sans-serif;
  direction: rtl;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; justify-items: center;
  gap: clamp(12px, 2.5vw, 40px);
  padding: clamp(12px, 3vh, 36px) clamp(16px, 3vw, 48px);
  box-sizing: border-box;
  overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none;
}
#cs-gate *, #cs-gate *::before, #cs-gate *::after { box-sizing: border-box; }

.cs-title {
  margin: 0; text-align: center;
  font-family: 'Rubik', sans-serif; font-weight: 900; line-height: 1.05;
  font-size: clamp(28px, 3.2vw, 52px);
}
.cs-title small { display: block; white-space: nowrap; font-family: 'Assistant', sans-serif; font-weight: 700; font-size: .36em; letter-spacing: .5px; color: var(--cs-gold); margin-bottom: .35em; }

.cs-figure { position: relative; margin: 0; line-height: 0; }
.cs-figure img {
  display: block; width: auto; height: auto;
  max-height: calc(100vh - 2 * clamp(12px, 3vh, 36px)); max-height: calc(100dvh - 2 * clamp(12px, 3vh, 36px));
  max-width: min(58vw, 1475px);
  /* שוליים רכים (5% בכל צד) — התמונה נבלעת ברקע בלי קו מסגרת; לא חיתוך: כל התמונה מוצגת */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
          mask-composite: intersect;
}
/* אזור לחיצה מעל המנעול שבתמונה — כניסה להפקה */
.cs-lock {
  position: absolute; left: 43%; top: 55%; width: 17%; height: 25%; min-width: 44px; min-height: 44px;
  border: 0; border-radius: 40%; background: transparent; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.cs-lock:focus-visible { outline: 3px solid var(--cs-gold); outline-offset: 3px; }

/* משמאל לימין: ימים, שעות, דקות, שניות (רמי, 02/10/2026). מחשב: 2×2 בצד התמונה; טלפון: שורה אחת */
.cs-countdown { display: grid; grid-template-columns: repeat(2, auto); gap: clamp(10px, 1.4vw, 20px) clamp(8px, 1vw, 16px); direction: ltr; }
.cs-unit { display: flex; flex-direction: column; align-items: center; }
.cs-num {
  font-family: 'Rubik', sans-serif; font-weight: 900; font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 3.6vw, 58px); line-height: 1;
  background: rgba(255,255,255,.55); border: 2px solid rgba(184,134,43,.55); border-radius: 14px;
  padding: .18em .22em; min-width: 1.9em; text-align: center;
  box-shadow: 0 6px 18px rgba(18,40,92,.12);
}
.cs-label { margin-top: 6px; font-weight: 700; font-size: clamp(13px, 1.1vw, 17px); }
.cs-soon { margin: 10px 0 0; text-align: center; font-weight: 700; font-size: clamp(15px, 1.3vw, 20px); color: var(--cs-gold); }
.cs-side { display: flex; flex-direction: column; align-items: center; }
/* "ההרשמה תיפתח ב-01/11/2026" — התאריך לא נשבר באמצע; "בעוד" מעל המונה (רמי, 02/10/2026) */
.cs-date { display: block; white-space: nowrap; font-size: .66em; margin-top: .2em; }
.cs-in { margin: 0 0 clamp(8px, 1.2vh, 14px); font-family: 'Rubik', sans-serif; font-weight: 900; line-height: 1; font-size: clamp(26px, 2.8vw, 44px); color: var(--cs-ink); }
/* "מספר האנשים המתעניינים X" — שורה אחת, ימין למטה, קטן מהכותרת */
.cs-interest {
  position: absolute; right: clamp(16px, 3vw, 48px); bottom: clamp(12px, 2.5vh, 28px); margin: 0;
  font-family: 'Rubik', sans-serif; font-weight: 700; font-size: clamp(16px, 1.6vw, 24px); line-height: 1.2;
  color: var(--cs-ink); white-space: nowrap;
}
.cs-interest[hidden] { display: none; }
.cs-interest-num { color: var(--cs-gold); font-weight: 900; }
.cs-foot { display: none; margin: 0; text-align: center; font-weight: 700; font-size: 16px; color: var(--cs-ink); opacity: .8; }

/* חלונית הקוד */
.cs-dialog-backdrop { position: fixed; inset: 0; background: rgba(18,40,92,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 1; }
.cs-dialog-backdrop.open { display: flex; }
.cs-dialog {
  position: relative; width: min(340px, 100%); background: #fbf7ee; color: var(--cs-ink);
  border-radius: 18px; padding: 26px 22px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); text-align: center;
}
.cs-dialog h2 { margin: 0 0 14px; font-family: 'Rubik', sans-serif; font-size: 20px; }
.cs-dialog input {
  width: 100%; font-size: 18px; padding: 11px 12px; border-radius: 10px; border: 2px solid #cdbf9f;
  text-align: center; direction: ltr; background: #fff; color: var(--cs-ink); -webkit-user-select: text; user-select: text;
}
.cs-dialog input:focus { outline: none; border-color: var(--cs-gold); }
.cs-dialog button[type="submit"] {
  margin-top: 12px; width: 100%; min-height: 44px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--cs-ink); color: #fff; font-family: 'Rubik', sans-serif; font-weight: 700; font-size: 17px;
}
.cs-close { position: absolute; top: 6px; left: 6px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; color: var(--cs-ink); cursor: pointer; }
.cs-error { min-height: 1.4em; margin: 8px 0 0; color: #b3261e; font-weight: 700; }

/* מסך צר / טלפון: כותרת וספירה מעל התמונה */
@media (max-aspect-ratio: 5/4), (max-width: 820px) {
  #cs-gate { grid-template-columns: 1fr; grid-template-rows: auto auto auto; align-content: center; gap: clamp(10px, 2.2vh, 22px); }
  #cs-gate { gap: clamp(14px, 3.6vh, 40px); }
  .cs-figure img { max-width: 100%; max-height: 52vh; max-height: 52dvh; }
  .cs-title { font-size: clamp(30px, 9vw, 52px); }
  .cs-in { font-size: clamp(24px, 7vw, 36px); margin-bottom: 6px; }
  .cs-date { display: inline; font-size: 1em; margin-top: 0; }
  .cs-title small { font-size: .4em; }
  .cs-unit { min-width: 0; }
  .cs-num { font-size: clamp(30px, 10vw, 52px); }
  .cs-label { font-size: clamp(14px, 4vw, 18px); }
  .cs-foot { display: block; order: 4; }
  .cs-countdown { grid-template-columns: repeat(4, auto); gap: clamp(6px, 2.4vw, 14px); }
}

/* בלי JavaScript — רק התמונה */
.cs-noscript { position: fixed; inset: 0; z-index: 2147483000; background: #e4dbc6; display: flex; align-items: center; justify-content: center; }
.cs-noscript img { max-width: 100%; max-height: 100%; }

@media (prefers-reduced-motion: no-preference) {
  .cs-num { transition: transform .25s ease; }
}

.cs-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-aspect-ratio: 5/4), (max-width: 820px) {
  .cs-side-title { order: 1; }
  .cs-side-count { order: 2; }
  .cs-figure { order: 3; }
}
