/* דף הנחיתה - "חדר המצב". עצמאי במכוון (מנותק מ-SPA של המשחק).
   הטוקנים למטה הם העתק של :root מ-client/src/styles/tokens.css - מקור האמת הוא DESIGN.md.
   אם משנים טוקן שם, לעדכן גם כאן. */
:root {
  --bg-base: #26282D;
  --bg-raised: #2E3138;
  --bg-sunken: #1C1E22;
  --bg-dark: #101215;

  --accent: #00E5D0;
  --accent-dim: #0A8C80;
  --accent-deep: #043D38;
  --on-accent: #12141A;

  --danger: #FF3B47;
  --danger-dim: #7A1D24;
  --success: #00FF88;
  --success-dim: #0A6B3C;
  --warning: #FFB020;

  --text-primary: #E4E7EC;
  --text-secondary: #8A94A6;
  --text-muted: #5E6572;

  --border: #383B42;
  --border-strong: #4A4E57;
  --border-accent: #00E5D0;

  --font-terminal: 'Cousine', monospace;
  --font-unit: 'Heebo', sans-serif;
  --font-software: 'Rubik', sans-serif;

  --radius-none: 0;
  --radius-sm: 2px;
  --radius-round: 50%;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  --fs-hero: 48px;
  --fs-title: 28px;
  --fs-heading: 20px;
  --fs-body: 16px;
  --fs-label: 14px;
  --fs-caption: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-unit);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* רקע מבצעי עדין: גריד תכלת דהוי + זוהר רך משתי הפינות העליונות. שכבה 1, לא צעקני. */
  background-image:
    radial-gradient(100% 70% at 85% -10%, rgba(0, 229, 208, 0.10), transparent 55%),
    radial-gradient(90% 60% at 10% -5%, rgba(255, 59, 71, 0.06), transparent 55%),
    linear-gradient(rgba(56, 59, 66, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 59, 66, 0.22) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px, 46px 46px;
}

h1, h2, h3 { line-height: 1.4; font-weight: 700; }

/* ---- שכבת קווי סריקה (scanlines) + סריקה נעה ---- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 229, 208, 0.025) 0 1px, transparent 1px 3px);
  opacity: 0.6;
}
.scanlines::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(180deg, transparent, rgba(0, 229, 208, 0.05), transparent);
  animation: scan 7s linear infinite;
}
@keyframes scan {
  0% { transform: translateY(-160px); }
  100% { transform: translateY(102vh); }
}

/* ---- סרגל סטטוס עליון ---- */
.statusbar {
  flex: none;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: rgba(28, 30, 34, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  padding: 8px var(--space-md);
  font-size: var(--fs-caption);
  letter-spacing: 1px;
  color: var(--text-muted);
}
.statusbar__title { color: var(--accent-dim); }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status--alert { color: var(--danger); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.dot--live {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: blink 1.4s ease-in-out infinite;
}
.dot--alert {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
  animation: blink-alert 1.1s steps(1, end) infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes blink-alert { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.2; } }

/* ---- פריסה: רצועת Hero בשתי עמודות ---- */
.page {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg);
}

.hero-band {
  width: 100%;
  max-width: 1060px;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-xl);
  align-items: start;
  align-content: center;
}

/* ---- Hero (עמודה ימנית) ---- */
.hero { text-align: start; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.brand__mark {
  width: 56px;
  height: 56px;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(0, 229, 208, 0.45));
}
.brand__sweep {
  transform-box: view-box;
  transform-origin: 12px 12px;
  animation: sweep 4s linear infinite;
  opacity: 0.9;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.brand__core { animation: pulse-core 2s ease-in-out infinite; }
@keyframes pulse-core { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.brand__name {
  font-family: var(--font-terminal);
  color: var(--accent);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 1px;
  word-spacing: -6px;
}

.hero__lead {
  font-size: var(--fs-title);
  font-weight: 500;
  color: var(--text-primary);
  max-width: 22ch;
  margin-bottom: var(--space-lg);
}

/* ---- פרטים יבשים ---- */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
}

.fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-label);
  color: var(--text-secondary);
  white-space: nowrap;
}
.fact svg { width: 16px; height: 16px; color: var(--accent-dim); flex: none; }

.fact--free {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  animation: free-glow 2.4s ease-in-out infinite;
}
.fact--free svg { color: var(--on-accent); }
@keyframes free-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 208, 0); }
  50% { box-shadow: 0 0 16px 1px rgba(0, 229, 208, 0.55); }
}

/* ---- אווירה (מסוף מבצעי) ---- */
.atmosphere {
  color: var(--text-secondary);
  border-inline-start: 2px solid var(--accent-dim);
  padding-inline-start: var(--space-md);
  max-width: 46ch;
}
.atmosphere p + p { margin-top: var(--space-sm); }
/* "פנטום" - כתב אלכסוני זוויתי חשדני (לא אדום). הילה עדינה = תחושת רוח-רפאים. */
.atmosphere .phantom {
  display: inline-block;
  font-family: var(--font-terminal);
  font-weight: 700;
  color: var(--text-primary);
  transform: skewX(-14deg);
  letter-spacing: 1px;
  padding-inline: 2px;
  text-shadow: 0 0 8px rgba(0, 229, 208, 0.35);
}
.atmosphere__clock {
  font-family: var(--font-terminal);
  color: var(--text-primary);
  letter-spacing: 1px;
}
.caret {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  margin-inline-start: 4px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: caret 1.1s steps(1, end) infinite;
}
@keyframes caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ---- כרטיס / טופס (עמודה שמאלית) ---- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
}
/* פינות "כוונת" מבצעיות על כרטיס הטופס */
.form-card {
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.form-card::before,
.form-card::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.form-card::before { top: -1px; inset-inline-end: -1px; border-inline-start: none; border-bottom: none; }
.form-card::after { bottom: -1px; inset-inline-start: -1px; border-inline-end: none; border-top: none; }

.form__title {
  font-size: var(--fs-heading);
  margin-bottom: var(--space-xs);
}
.form__sub {
  color: var(--text-secondary);
  font-size: var(--fs-label);
  margin-bottom: var(--space-lg);
}

.field-group { margin-bottom: var(--space-md); }

.field-group label {
  display: block;
  font-size: var(--fs-label);
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field-group .optional { color: var(--text-muted); }

.field {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: var(--fs-body);
  font-family: inherit;
  width: 100%;
  min-height: 44px;
}
.field:focus { outline: none; border-color: var(--border-accent); }
.field::placeholder { color: var(--text-muted); }

/* שדה שגוי - אדום + הודעת עזר (צבע לא כמסר יחיד) */
.field-group.invalid .field { border-color: var(--danger); }
.field-error {
  display: none;
  color: var(--danger);
  font-size: var(--fs-caption);
  margin-top: 6px;
}
.field-group.invalid .field-error { display: block; }

.btn {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-family: inherit;
  font-weight: 500;
  font-size: var(--fs-label);
  min-height: 44px;
  width: 100%;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:not(:disabled) { animation: btn-glow 2.6s ease-in-out infinite; }
.btn:disabled { background: var(--bg-sunken); color: var(--text-muted); cursor: not-allowed; animation: none; }
@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 208, 0); }
  50% { box-shadow: 0 0 18px 1px rgba(0, 229, 208, 0.5); }
}

.consent {
  margin-top: var(--space-md);
  font-size: var(--fs-caption);
  color: var(--text-muted);
  text-align: center;
}
.consent a { color: var(--accent-dim); }

/* ---- מסך אישור ---- */
.confirm { text-align: center; }
.confirm__check {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  color: var(--success);
  filter: drop-shadow(0 0 12px rgba(0, 255, 136, 0.4));
}
.confirm__title { font-size: var(--fs-title); margin-bottom: var(--space-md); }
.confirm__email {
  font-family: var(--font-terminal);
  color: var(--accent);
  font-size: var(--fs-heading);
  letter-spacing: 1px;
  word-break: break-all;
  display: block;
  margin: var(--space-sm) 0 var(--space-lg);
}
.confirm__note { color: var(--text-secondary); font-size: var(--fs-label); }
.confirm__note a { color: var(--accent-dim); }

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 2;
  flex: none;
  width: 100%;
  max-width: 1060px;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  font-size: var(--fs-caption);
  color: var(--text-muted);
}
/* שורה אחת דקה: שם + טלפון + מייל + קישורים משפטיים + זכויות */
.footer__line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px var(--space-sm);
}
.footer__line a { color: var(--accent-dim); text-decoration: none; }
.footer__line a:hover { color: var(--accent); }
.footer__brand { color: var(--text-secondary); font-weight: 500; }
.footer__line .sep { color: var(--text-muted); }
.footer__rights { color: var(--text-muted); }

.hidden { display: none !important; }

/* ---- כפתור מוזיקת רקע (צף) ---- */
.sound-toggle {
  position: fixed;
  z-index: 20;
  bottom: 14px;
  inset-inline-start: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.sound-toggle:hover { border-color: var(--border-accent); }
.sound-toggle:active { transform: scale(0.94); }
.sound-toggle svg { width: 20px; height: 20px; }
.sound-toggle .ico-off { display: none; }
/* מצב מושתק - אייקון "כבוי" בצבע מעומעם */
.sound-toggle.muted { color: var(--text-muted); }
.sound-toggle.muted .ico-on { display: none; }
.sound-toggle.muted .ico-off { display: block; }
@media (prefers-reduced-motion: reduce) {
  .sound-toggle { transition: none; }
}

/* ---- טאבלט וצר יותר: עמודה אחת (מאפשר גלילה - תוכן מוערם גבוה מהמסך) ---- */
@media (max-width: 860px) {
  body { height: auto; min-height: 100dvh; overflow: visible; }
  .page { justify-content: flex-start; }
  .hero-band {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    max-width: 560px;
    align-content: start;
  }
  .hero { text-align: center; }
  .brand { justify-content: center; }
  .hero__lead { max-width: none; margin-inline: auto; }
  .facts { justify-content: center; }
  .atmosphere {
    text-align: start;
    margin-inline: auto;
  }
}

@media (max-width: 480px) {
  .brand__name { font-size: 32px; }
  .brand__mark { width: 46px; height: 46px; }
  .hero__lead { font-size: var(--fs-heading); }
  .page { padding: var(--space-lg) var(--space-md); }
  .statusbar { letter-spacing: 0.5px; }
}

/* ---- מסך נמוך (למשל לפטופ קצר / נייד לרוחב): לשחרר את הנעילה כדי לא לחתוך תוכן ---- */
@media (max-height: 640px) {
  body { height: auto; min-height: 100dvh; overflow: visible; }
  .page { justify-content: flex-start; }
  .hero-band { align-content: start; }
}

/* ---- כיבוד prefers-reduced-motion: לעצור את כל ההנפשות ---- */
@media (prefers-reduced-motion: reduce) {
  .btn, .fact--free, .dot--live, .dot--alert, .brand__sweep, .brand__core, .caret, .scanlines::after {
    animation: none !important;
  }
  .caret { opacity: 1; }
}
