:root {
  --ink: #1C1A17;
  --ink-2: #26221D;
  --ink-3: #322C25;
  --gold: #B8893A;
  --gold-hi: #E5C98B;
  --wood: #6B4A2B;
  --cream: #FBF7EE;
  --cream-2: #F3EADA;
  --muted: #B9AD98;
  --c1: #B8893A;
  --c2: #8A5A33;
  --c3: #5F6B3A;
  --c4: #7A3B2E;
  --flame: #FFD48A;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: 'Heebo', system-ui, sans-serif;
  font-size: 18px;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: 'Frank Ruhl Libre', serif; margin: 0; line-height: 1.15; }
button { font-family: inherit; }

.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vw 45vh at 50% 105%, rgba(229, 201, 139, .20), transparent 70%),
    radial-gradient(40vw 40vh at 85% -10%, rgba(184, 137, 58, .12), transparent 70%);
  transition: opacity 1s;
}
body.st-final .glow { opacity: 1.6; }
#sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* כותרת עליונה */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px clamp(18px, 4vw, 56px) 0;
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand h1 { font-size: clamp(24px, 2.6vw, 38px); color: var(--gold-hi); font-weight: 700; }
.brand-sub { color: var(--muted); font-size: 16px; letter-spacing: .02em; }
.top-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.dial {
  display: flex; align-items: center; gap: 8px;
  background: rgba(184, 137, 58, .14); border: 1px solid rgba(229, 201, 139, .35);
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: clamp(18px, 1.8vw, 24px);
  direction: ltr;
}
.dial svg { width: 20px; height: 20px; fill: var(--gold-hi); }
.online {
  display: flex; align-items: center; gap: 4px;
  color: var(--cream-2); font-size: 17px;
  background: rgba(255, 255, 255, .05); padding: 8px 16px; border-radius: 999px;
}
.online b { font-size: 20px; }
.pulse {
  width: 10px; height: 10px; border-radius: 50%; background: #8FBF6A; margin-left: 6px;
  box-shadow: 0 0 0 0 rgba(143, 191, 106, .6); animation: pulse 1.8s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(143, 191, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(143, 191, 106, 0); } }

/* במה */
#stage {
  position: relative; z-index: 2; flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 20px clamp(18px, 4vw, 56px) 24px;
}
.screen { display: none; width: 100%; max-width: 1280px; text-align: center; animation: rise .6s cubic-bezier(.2, .8, .2, 1); }
.screen.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .08em; margin: 0 0 10px; font-size: 18px; }
.big { font-size: clamp(32px, 4.6vw, 68px); font-weight: 900; color: var(--cream); }

.phone-hero {
  margin: 26px auto 8px; direction: ltr;
  font-family: 'Frank Ruhl Libre', serif; font-weight: 900;
  font-size: clamp(48px, 9vw, 132px); line-height: 1;
  color: var(--gold-hi);
  text-shadow: 0 0 40px rgba(229, 201, 139, .35);
  letter-spacing: .02em;
}
.phone-hero.empty { font-size: clamp(20px, 2vw, 26px); color: var(--muted); font-family: 'Heebo', sans-serif; font-weight: 500; text-shadow: none; }

.steps {
  list-style: none; padding: 0; margin: 34px auto 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 980px;
}
.steps li {
  display: flex; align-items: center; gap: 14px; text-align: right;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(229, 201, 139, .16);
  border-radius: 18px; padding: 16px 18px;
}
.steps b { display: block; font-size: 20px; }
.steps small { color: var(--muted); font-size: 16px; }
.step-n {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #3A322A, #2A241F);
  border: 1px solid rgba(229, 201, 139, .35); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35);
  font-weight: 800; font-size: 22px; color: var(--gold-hi);
}

.joined { margin-top: 30px; }
.joined-count { color: var(--cream-2); font-size: 20px; }
.joined-count b { color: var(--gold-hi); font-size: 28px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; max-width: 1000px; margin-inline: auto; }
.chip {
  background: rgba(229, 201, 139, .12); border: 1px solid rgba(229, 201, 139, .25);
  border-radius: 999px; padding: 6px 14px; font-size: 16px; animation: pop .4s ease;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* שאלה */
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.q-num, .answered {
  min-width: 170px; font-weight: 700; color: var(--gold-hi); font-size: 20px;
  background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 10px 18px;
}
.answered b { font-size: 26px; }
.timer { position: relative; width: 108px; height: 108px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 8; }
.t-fg { fill: none; stroke: var(--gold-hi); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 276.5; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.low .t-fg { stroke: #E0805A; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; font-weight: 800; }
.timer.low b { animation: beat 1s infinite; }
@keyframes beat { 50% { transform: scale(1.12); } }

.q-text {
  font-size: clamp(30px, 4vw, 60px); font-weight: 700; color: var(--cream);
  max-width: 1150px; margin: 0 auto 30px; text-wrap: balance;
}
.answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ans {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 18px; text-align: right;
  min-height: 104px; padding: 16px 22px; border-radius: 20px;
  background: color-mix(in srgb, var(--c) 30%, var(--ink-2));
  border: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
  font-size: clamp(22px, 2.4vw, 34px); font-weight: 700;
  transition: opacity .5s, transform .5s, filter .5s, border-color .5s, background .5s;
}
.ans .key {
  flex: none; width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--ink);
  background: linear-gradient(180deg, var(--cream), var(--cream-2));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), 0 4px 14px rgba(0, 0, 0, .3);
}
.ans .txt { position: relative; z-index: 1; flex: 1; }
.ans .bar {
  position: absolute; inset-block: 0; right: 0; width: 0;
  background: color-mix(in srgb, var(--c) 45%, transparent);
  transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}
.ans .cnt { position: relative; z-index: 1; font-size: 26px; color: var(--cream-2); min-width: 50px; text-align: left; opacity: 0; transition: opacity .6s .6s; }
.st-reveal .ans .cnt { opacity: 1; }
.st-reveal .ans.wrong { opacity: .38; filter: saturate(.4); }
.st-reveal .ans.right {
  border-color: var(--gold-hi); transform: scale(1.03);
  box-shadow: 0 0 0 4px rgba(229, 201, 139, .25), 0 0 60px rgba(229, 201, 139, .35);
}
.ans.right::after {
  content: ''; position: absolute; top: 50%; left: 18px; width: 38px; height: 38px; transform: translateY(-50%);
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23E5C98B'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%231C1A17' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.st-reveal .ans.right .cnt { margin-left: 46px; }
.st-question .ans.right::after { display: none; }

.note { margin: 24px auto 0; max-width: 1000px; font-size: clamp(19px, 1.7vw, 24px); color: var(--cream-2); background: rgba(255, 255, 255, .04); border-right: 4px solid var(--gold); padding: 14px 20px; border-radius: 12px; text-align: right; }
.fastest { margin: 14px 0 0; color: var(--gold-hi); font-size: 20px; font-weight: 700; }

/* טבלה */
.board { list-style: none; padding: 0; margin: 28px auto 0; max-width: 860px; display: grid; gap: 10px; }
.board li {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(229, 201, 139, .14);
  border-radius: 16px; padding: 8px 20px; font-size: 23px;
  animation: slide .5s both;
}
.board li:nth-child(1) { background: rgba(184, 137, 58, .22); border-color: rgba(229, 201, 139, .5); }
.board .pl { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(229, 201, 139, .15); color: var(--gold-hi); font-weight: 800; flex: none; }
.board .nm { flex: 1; text-align: right; font-weight: 700; }
.board .sc { font-weight: 800; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.board.small li { font-size: 19px; padding: 8px 16px; }
.board.small li:nth-child(1) { background: rgba(255, 255, 255, .045); border-color: rgba(229, 201, 139, .14); }
.board.small .pl { width: 34px; height: 34px; }
@keyframes slide { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.empty-board { color: var(--muted); font-size: 20px; margin-top: 24px; }

/* פודיום */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin: 30px auto 10px; }
.pod { width: clamp(150px, 18vw, 230px); text-align: center; animation: rise .8s both; }
.pod .who { font-size: clamp(20px, 2vw, 28px); font-weight: 800; margin-bottom: 4px; }
.pod .pts { color: var(--gold-hi); font-weight: 700; margin-bottom: 10px; }
.pod .block {
  border-radius: 16px 16px 6px 6px; display: grid; place-items: center;
  font-family: 'Frank Ruhl Libre', serif; font-weight: 900; font-size: 64px; color: var(--ink);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  box-shadow: 0 0 50px rgba(229, 201, 139, .3);
}
.pod.p1 .block { height: 220px; }
.pod.p2 .block { height: 160px; background: linear-gradient(180deg, #E9DFCC, #BDAE93); }
.pod.p3 .block { height: 120px; background: linear-gradient(180deg, #D9B48A, #9C6B45); }
.pod.p1 { animation-delay: .9s; } .pod.p2 { animation-delay: .5s; } .pod.p3 { animation-delay: .1s; }

/* חנוכייה */
.menorah-wrap {
  position: relative; z-index: 1; margin: 0 auto 56px;
  width: min(460px, 70vw, 34vh); pointer-events: none; opacity: .95;
  transition: width .6s, opacity .6s;
}
body.st-question .menorah-wrap, body.st-reveal .menorah-wrap, body.st-board .menorah-wrap { width: min(260px, 40vw, 20vh); opacity: .85; }
.menorah { width: 100%; height: auto; overflow: visible; }
.menorah .metal { fill: url(#gm); }
.menorah .wick { stroke: #3A2E22; stroke-width: 2; }
.menorah .flame { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0; transform: scale(.2); transition: opacity .6s, transform .6s cubic-bezier(.3, 1.6, .5, 1); }
.menorah .lit .flame { opacity: 1; transform: scale(1); animation: flicker 2.4s infinite ease-in-out; }
.menorah .halo { opacity: 0; transition: opacity .8s; }
.menorah .lit .halo { opacity: 1; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.05, .95) rotate(-2deg); }
  50% { transform: scale(.96, 1.06) rotate(1.5deg); }
  75% { transform: scale(1.03, .98) rotate(-1deg); }
}

/* שורת מנחה */
.host {
  position: fixed; z-index: 5; bottom: 0; inset-inline: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px clamp(12px, 3vw, 36px);
  background: rgba(20, 18, 15, .92); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(229, 201, 139, .18);
  transform: translateY(calc(100% - 8px)); transition: transform .3s;
}
.host:hover, .host:focus-within, .host.pin { transform: none; }
.host-status { color: var(--muted); font-size: 16px; }
.host-btns, .host-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.host button, .host a {
  font-size: 17px; font-weight: 700; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  border: 1px solid rgba(229, 201, 139, .4); background: transparent; color: var(--cream); text-decoration: none;
}
.host button.primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.host button.primary:hover { background: var(--gold-hi); }
.host .ghost { font-weight: 500; border-color: rgba(255, 255, 255, .15); color: var(--cream-2); }
.kbd { font-size: 13px; opacity: .7; margin-right: 6px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .top { padding-top: 14px; flex-direction: column; align-items: flex-start; }
  .top-info { justify-content: flex-start; }
  #stage { align-items: flex-start; }
  .menorah-wrap { margin-bottom: 150px; }
  .steps { grid-template-columns: 1fr; }
  .answers { grid-template-columns: 1fr; }
  .ans { min-height: 76px; }
  .ans .key { width: 48px; height: 48px; font-size: 26px; }
  .q-head { flex-wrap: wrap; justify-content: center; }
  .q-num, .answered { min-width: 0; font-size: 16px; }
  .timer { width: 84px; height: 84px; order: -1; width: 100%; }
  .timer svg { width: 84px; height: 84px; display: block; margin: 0 auto; }
  .timer b { font-size: 30px; }
  .board li { font-size: 19px; }
  .pod .block { font-size: 40px; }
  .pod.p1 .block { height: 150px; } .pod.p2 .block { height: 110px; } .pod.p3 .block { height: 80px; }
  .host { transform: none; }
}
