/* ============================================================
   סופר נהוראי — TEASER / COUNTDOWN
   Same night-street game-HUD palette as the main site, stripped
   down to one mysterious full-screen moment. No logo — an
   anonymous gold crown, embers, a lone streetlight, a countdown.
   ============================================================ */

:root {
  --bg: #0c0c14;
  --bg2: #12121a;
  --panel: #171722;
  --panel2: #1e1e2b;
  --ink: #fdf6e3;
  --ink-dim: #b7b2a4;
  --gold: #e8c84a;
  --gold-deep: #b8963a;
  --green: #5fcf6e;
  --red: #e0593f;
  --neon: #ff2bd6;
  --line: rgba(232, 200, 74, 0.22);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --font: 'Rubik', 'Heebo', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* the [hidden] attribute must always win over our display rules below */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  font-family: var(--font);
  background: radial-gradient(120% 90% at 50% -10%, #16121f 0%, var(--bg) 60%);
  color: var(--ink);
  min-height: 100%;
  overflow-x: hidden;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* vignette over everything */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: radial-gradient(115% 85% at 50% 42%, transparent 48%, rgba(0,0,0,0.62) 100%);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: radial-gradient(90% 70% at 50% 34%, #1a1526 0%, var(--bg) 72%);
  transition: opacity .5s ease, transform .6s cubic-bezier(.7,-0.2,.3,1.4);
}
#loader.done { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.loader-inner { display: grid; justify-items: center; gap: 20px; width: min(340px, 78vw); }
.loader-crown {
  font-size: 64px; line-height: 1;
  filter: drop-shadow(0 0 26px rgba(232,200,74,.6));
  animation: floaty 1.4s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.05); } }
.loader-label { font-weight: 900; letter-spacing: .05em; color: var(--gold); font-size: 15px; }
.loader-bar {
  width: 100%; height: 15px; border-radius: 10px;
  background: #0a0a11; border: 2px solid var(--line);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.6); overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold) 60%, #fff4c2);
  border-radius: 8px; box-shadow: 0 0 14px rgba(232,200,74,.7);
  transition: width .5s cubic-bezier(.5,0,.2,1);
}
.loader-pct { font-size: 13px; color: var(--ink-dim); font-weight: 700; }

/* ============================================================
   ATMOSPHERE: embers, skyline, streetlight, scanlines
   ============================================================ */
#embers {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
}

.skyline {
  position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; z-index: 2;
  pointer-events: none;
}
.sky-layer {
  position: absolute; left: -6%; right: -6%; bottom: 0;
  background-repeat: repeat-x; background-position: bottom;
  will-change: transform;
}
/* procedural building silhouettes via layered gradients */
.sky-layer.back {
  height: 34vh; opacity: .55;
  background:
    linear-gradient(to top, #0a0a12 0%, #0a0a12 30%, transparent 30%) 0 100%/120px 100%,
    linear-gradient(90deg, transparent 0 8px, #0d0d17 8px 42px, transparent 42px 60px, #0b0b14 60px 96px, transparent 96px 120px) 0 100%/120px 22vh;
  filter: blur(.4px);
}
.sky-layer.mid {
  height: 26vh; opacity: .92;
  background:
    linear-gradient(90deg, #0e0e1a 0 40px, transparent 40px 56px, #101020 56px 108px, transparent 108px 128px, #0d0d18 128px 190px, transparent 190px 210px) 0 100%/210px 26vh;
}
/* faint gold window dots on the mid layer */
.sky-layer.mid::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background:
    radial-gradient(circle, rgba(232,200,74,.5) 1.4px, transparent 2px) 12px 40%/210px 44px,
    radial-gradient(circle, rgba(232,200,74,.28) 1.2px, transparent 2px) 70px 62%/210px 60px;
}

.streetlight {
  position: absolute; bottom: 0; left: 16%;
  width: 60px; height: 30vh; will-change: transform;
}
.streetlight .pole { position: absolute; bottom: 0; left: 28px; width: 4px; height: 30vh; background: linear-gradient(to top, #14141f, #1c1c2a); }
.streetlight .lamp {
  position: absolute; top: 0; left: 8px; width: 44px; height: 16px; border-radius: 40% 40% 30% 30%;
  background: radial-gradient(circle at 50% 30%, #fff4c2, var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 0 40px 12px rgba(232,200,74,.45), 0 0 90px 30px rgba(232,200,74,.18);
  animation: flicker 5s infinite;
}
.streetlight .pool {
  position: absolute; bottom: 0; left: -30px; width: 120px; height: 40px;
  background: radial-gradient(ellipse at 50% 100%, rgba(232,200,74,.22), transparent 70%);
}
@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: .6; } 98% { opacity: .9; } 99% { opacity: .5; }
}

.secret-star {
  position: absolute; top: 12%; right: 22%; width: 14px; height: 14px; z-index: 3;
  border-radius: 50%; background: rgba(255,255,255,.14); pointer-events: auto;
  transition: background .3s, box-shadow .3s, transform .3s;
}
.secret-star:hover { background: rgba(232,200,74,.9); box-shadow: 0 0 16px 4px rgba(232,200,74,.7); transform: scale(1.3); }
.secret-star.found { background: var(--gold); box-shadow: 0 0 20px 6px rgba(232,200,74,.8); animation: twinkle 1.2s infinite; }
@keyframes twinkle { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.scanlines {
  position: fixed; inset: 0; z-index: 41; pointer-events: none; opacity: .05;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.6) 2px 3px);
  mix-blend-mode: overlay;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.teaser {
  position: relative; z-index: 10;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(18px, 3.4vh, 34px);
  padding: 40px 20px 64px; text-align: center;
}

/* ---- crown emblem ---- */
.emblem {
  position: relative; width: clamp(96px, 16vw, 148px); aspect-ratio: 120/96;
  display: grid; place-items: center; filter: drop-shadow(0 12px 22px rgba(0,0,0,.6));
  animation: floaty 4s ease-in-out infinite;
}
.emblem .crown { width: 100%; height: 100%; }
.emblem-glow {
  position: absolute; inset: -30% -18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,200,74,.42), transparent 66%);
  filter: blur(4px); animation: pulseGlow 3.2s ease-in-out infinite;
}
@keyframes pulseGlow { 0%,100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.08); } }
.emblem:active { transform: scale(.94); }
.emblem.wassah { animation: crownShake .5s ease; }
@keyframes crownShake { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-7deg)} 75%{transform:rotate(7deg)} }

/* ---- kicker (typed cryptic line) ---- */
.kicker {
  min-height: 1.4em; font-weight: 900; letter-spacing: .01em;
  font-size: clamp(15px, 4.6vw, 22px); color: var(--ink);
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.kicker .caret { color: var(--gold); animation: blink 1s steps(2) infinite; margin-inline-start: 2px; }
@keyframes blink { 0%,50%{opacity:1} 51%,100%{opacity:0} }

/* ---- countdown ---- */
.countdown {
  display: flex; align-items: flex-start; justify-content: center; gap: clamp(4px, 1.4vw, 12px);
  direction: ltr; margin-top: 2px;
}
.cell { display: grid; justify-items: center; gap: 8px; }
.num {
  min-width: clamp(58px, 15vw, 104px);
  padding: clamp(10px, 2vw, 20px) clamp(6px, 1.4vw, 14px);
  font-weight: 900; font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 9vw, 66px); line-height: 1; color: #1a1400;
  background: linear-gradient(180deg, #ffe680, var(--gold) 55%, var(--gold-deep));
  border: 2px solid #fff2b8; border-radius: 16px;
  box-shadow: 0 8px 0 var(--gold-deep), 0 16px 30px rgba(232,200,74,.24), inset 0 2px 8px rgba(255,255,255,.5);
}
.num.pop { animation: pop .4s cubic-bezier(.5,-0.4,.4,1.5); }
@keyframes pop { 0%{transform:translateY(-6px) scale(1.06)} 60%{transform:translateY(2px) scale(.98)} 100%{transform:none} }
.lbl { font-size: clamp(10px, 2.6vw, 13px); font-weight: 700; color: var(--ink-dim); letter-spacing: .12em; direction: rtl; }
.colon {
  font-size: clamp(24px, 7vw, 48px); font-weight: 900; color: var(--gold);
  line-height: clamp(58px, 12vw, 104px); opacity: .8; animation: blink 1.1s steps(2) infinite;
}

/* ---- signup ---- */
.signup { display: grid; justify-items: center; gap: 12px; width: min(460px, 100%); margin-top: 6px; }
.signup-lead { font-weight: 900; font-size: clamp(15px, 4.2vw, 19px); color: var(--gold); }
.signup-row { display: flex; gap: 10px; width: 100%; }
.fld {
  flex: 1; min-width: 0; padding: 14px 16px; font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--panel); border: 2px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.fld::placeholder { color: #6f6a5e; }
.fld:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,200,74,.16); }
.fld.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224,89,63,.18); }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px; font-weight: 900; font-size: 17px; color: #1a1400;
  background: linear-gradient(180deg, #ffe680, var(--gold) 55%, var(--gold-deep));
  border-radius: 999px; border: 2px solid #fff2b8;
  box-shadow: 0 8px 0 var(--gold-deep), 0 16px 30px rgba(232,200,74,.28);
  transition: transform .12s ease, box-shadow .12s ease; white-space: nowrap;
}
.pill:hover { transform: translateY(-2px); box-shadow: 0 10px 0 var(--gold-deep), 0 20px 38px rgba(232,200,74,.4); }
.pill:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--gold-deep), 0 8px 16px rgba(232,200,74,.3); }
.pill[disabled] { opacity: .6; pointer-events: none; }
.pill.pulse { animation: pillPulse 2.2s ease-in-out infinite; }
@keyframes pillPulse {
  0%,100% { box-shadow: 0 8px 0 var(--gold-deep), 0 0 0 0 rgba(232,200,74,.5); }
  50% { box-shadow: 0 8px 0 var(--gold-deep), 0 0 0 14px rgba(232,200,74,0); }
}

.signup-msg { min-height: 1.2em; font-weight: 700; font-size: 14px; }
.signup-msg.ok { color: var(--green); }
.signup-msg.bad { color: var(--red); }
.signup-fine { font-size: 11px; color: #6f6a5e; }
.signup.sent .signup-row, .signup.sent #joinBtn, .signup.sent .signup-fine { display: none; }

/* ---- zero state ---- */
.zero { display: grid; justify-items: center; gap: 16px; }
.zero-title { font-weight: 900; font-size: clamp(22px, 6vw, 34px); color: var(--gold); text-shadow: 0 0 26px rgba(232,200,74,.5); }

/* ---- footer ---- */
.foot {
  position: fixed; bottom: 12px; left: 0; right: 0; z-index: 11; text-align: center;
  font-size: 12px; color: #55524a; letter-spacing: .4em;
}

/* ============================================================
   SECRET OVERLAY (easter eggs)
   ============================================================ */
.secret {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(4,4,8,.82); backdrop-filter: blur(3px);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.secret-card {
  display: grid; justify-items: center; gap: 16px; text-align: center;
  width: min(400px, 88vw); padding: 34px 26px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 2px solid var(--gold); border-radius: 20px;
  box-shadow: var(--shadow), 0 0 60px rgba(232,200,74,.2);
}
.secret-emo { font-size: 56px; filter: drop-shadow(0 0 20px rgba(232,200,74,.6)); animation: floaty 2s ease-in-out infinite; }
.secret-line { font-weight: 900; font-size: 18px; color: var(--ink); line-height: 1.5; }
.secret-close { padding: 10px 22px; font-weight: 800; color: var(--ink-dim); border: 2px solid var(--line); border-radius: 999px; }
.secret-close:hover { color: var(--ink); border-color: var(--gold); }

/* sparkle particles (JS-spawned) */
.spark { position: fixed; z-index: 210; pointer-events: none; font-size: 18px; will-change: transform, opacity; }

/* glitch flash */
.glitch { animation: glitch .5s steps(2) 2; }
@keyframes glitch { 0%{filter:none;transform:none} 20%{filter:hue-rotate(90deg) saturate(2);transform:translate(-3px,2px)} 40%{filter:invert(.15);transform:translate(3px,-2px)} 60%{filter:hue-rotate(-60deg);transform:translate(-2px,0)} 100%{filter:none;transform:none} }

/* ---- phones: fit 4 countdown cells, stack the form ---- */
@media (max-width: 480px) {
  .teaser { padding: 32px 16px 60px; gap: 22px; }
  .countdown { gap: 3px; }
  .num { min-width: 52px; font-size: 30px; padding: 11px 4px; border-radius: 12px; box-shadow: 0 6px 0 var(--gold-deep), 0 12px 22px rgba(232,200,74,.22), inset 0 2px 8px rgba(255,255,255,.5); }
  .colon { font-size: 22px; line-height: 54px; }
  .lbl { font-size: 9px; letter-spacing: .05em; }
  .signup-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
