/* ===== הנר התשיעי ===== */
:root {
  --bg: #0b0912;
  --bg-2: #15101f;
  --ink: #f5ecd9;
  --ink-soft: #c9bda6;
  --muted: #8f8471;
  --gold: #f0c46a;
  --gold-deep: #b88a3a;
  --line: rgba(240, 196, 106, .18);
  --panel: rgba(24, 18, 32, .92);
  --serif: 'Frank Ruhl Libre', 'David', 'Times New Roman', serif;
  --sans: 'Assistant', 'Segoe UI', 'Arial', sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse 80% 55% at 50% 30%, #241729 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, #1c1220 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* חום שמתפשט ברגע הסיום */
.warmth {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 38%, rgba(255, 186, 90, .2), rgba(255, 140, 50, .06) 45%, transparent 75%);
  opacity: 0; transition: opacity 5s ease;
}
body:has(#stage.warm) .warmth { opacity: 1; }

/* ---------- במה ---------- */
#stage {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(6px, 1.6vh, 22px);
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  text-align: center;
}

.blk { opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.blk.in { opacity: 1; transform: none; }

.title {
  margin: 0;
  font-family: var(--serif); font-weight: 900; letter-spacing: .01em;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(240, 196, 106, .25);
  font-size: clamp(22px, 3.2vw, 40px);
  transition: font-size 1.2s var(--ease), opacity .8s var(--ease), transform .9s var(--ease);
}
[data-view="opening"] .title { font-size: clamp(46px, 7.5vw, 120px); line-height: 1.05; text-shadow: 0 0 2.4vw rgba(240, 196, 106, .45), 0 .2vw .6vw rgba(0, 0, 0, .6); }

/* ---------- חנוכייה מצולמת: רקע מלא של המסך ---------- */
/* הסצנה מכסה את המסך (כמו object-fit: cover) ושומרת יחס 16:9, כדי שהלהבות יישבו בדיוק על הפתילים */
.menorah-wrap { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; transform: none !important; transition: opacity 1.2s var(--ease); }
.menorah.photo {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: max(100vw, 177.78vh); aspect-ratio: 16 / 9;
  container-type: inline-size; --lit: 0;
  transition: filter 1.6s ease, scale 1.6s var(--ease);
}
/* מסך לאורך (טלפון): כל החנוכייה ברוחב המסך */
@media (max-aspect-ratio: 1/1) { .menorah.photo { width: 100vw; top: 34%; } }
.menorah .frame { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: filter 3s ease;
  filter: brightness(calc(.78 + var(--lit) * .025)) saturate(.95); }
.menorah.bathed .frame { filter: brightness(.98) saturate(1); }
.menorah .shade { position: absolute; inset: 0; transition: opacity 1.6s ease;
  background: radial-gradient(ellipse at 50% 32%, transparent 25%, rgba(4, 6, 14, .55) 100%), rgba(6, 10, 30, .22);
  opacity: calc(1 - var(--lit) / 9 * .8); }
.menorah .warm-light { position: absolute; inset: 0; mix-blend-mode: screen; transition: opacity 1.6s ease;
  background: radial-gradient(ellipse 45% 40% at 50% 26%, rgba(255, 170, 70, .45), transparent 70%); opacity: calc(var(--lit) / 9); }

/* מסכים עם הרבה תוכן: החנוכייה ברקע, מעומעמת */
[data-view="lobby"] .menorah.photo, [data-view="teams"] .menorah.photo, [data-view="ready"] .menorah.photo { filter: brightness(.42) blur(2px); scale: 1.04; }
[data-view="wicks"] .menorah.photo { filter: brightness(.5) blur(1.5px); scale: 1.03; }
[data-view="opening"] .menorah.photo { filter: brightness(.85); }
/* תקריב של השמש (img/opening.jpg): הרקע מהכניסה לחדר ועד סרטון הפתיחה. אחרי הסרטון (opening ואילך) — החנוכייה */
.opening-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 2.2s ease, filter 1.6s ease; }
[data-view="lobby"] .opening-bg, [data-view="teams"] .opening-bg, [data-view="ready"] .opening-bg,
[data-view="prelude"] .opening-bg, [data-view="candles"] .opening-bg, [data-view="film"] .opening-bg,
#stage[data-room="none"][data-view="opening"] .opening-bg { opacity: 1; }
/* במסכי החדר יש הרבה תוכן: הרקע מעט מעומעם */
[data-view="lobby"] .opening-bg, [data-view="teams"] .opening-bg, [data-view="ready"] .opening-bg { filter: brightness(.55) blur(1px); }
/* קיר הנרות: רקע כהה מאוד, כדי שהנרות יבלטו (ממשיך את המסך השחור שבסוף "חג האורות") */
[data-view="candles"] .opening-bg { filter: brightness(.28) blur(2px); }
[data-view="intro"] .menorah.photo { filter: brightness(.45) blur(1.5px); scale: 1.03; }

/* פס בצבע הקבוצה על הטבעת שמתחת לכוסית, כמו אמייל צבעוני בפליז */
.menorah .band { position: absolute; translate: -50% -50%; border-radius: 50%; background: var(--c, transparent); mix-blend-mode: color; opacity: .95; transition: background 1s; }
.menorah .band.glow-band { mix-blend-mode: soft-light; opacity: .8; }

/* נר = נקודה על בסיס הלהבה (על הפתיל) */
.menorah .candle { position: absolute; width: 0; height: 0; }
.menorah .flame-grow {
  position: absolute; left: 0; bottom: 0; width: 1.75cqw; height: 4.6cqw; translate: -50% 0;
  transform-origin: 50% 100%; transform: scale(.12, .04); opacity: 0;
  transition: transform 1.7s cubic-bezier(.2, .8, .2, 1), opacity .9s ease;
}
.menorah .shamash .flame-grow { width: 2cqw; height: 5.4cqw; transition: transform 2.8s cubic-bezier(.16, 1, .3, 1), opacity 1.6s ease; }
.menorah .candle.lit .flame-grow { transform: scale(1); opacity: 1; }
.menorah .flame-flicker { position: absolute; inset: 0; transform-origin: 50% 100%; }
.menorah .candle.lit .flame-flicker { animation: flicker var(--fd, 2.4s) ease-in-out infinite alternate; animation-delay: calc(var(--fo, 0) * -2s); }
.menorah .flame-flicker i { position: absolute; inset: 0; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse 48% 62% at 50% 70%, #fffdf2 0 18%, #ffe9a6 34%, #ffb648 58%, #ff7a1e 78%, rgba(255, 80, 20, 0) 100%);
  filter: blur(.08cqw); }
.menorah .flame-flicker u { position: absolute; left: 50%; bottom: 2%; width: 56%; height: 26%; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 70%, rgba(90, 140, 255, .75), rgba(60, 90, 220, 0) 70%); z-index: 1; }
/* הפתיל השרוף בתוך הלהבה */
.menorah .flame-grow em { position: absolute; left: 50%; bottom: 0; width: 14%; height: 34%; translate: -50% 0; border-radius: 40% 40% 20% 20%;
  background: linear-gradient(#1a0d05, #5a3a22 70%, #d9c8a8); opacity: 0; transition: opacity .4s .3s; z-index: 2; }
.menorah .candle.lit .flame-grow em { opacity: .9; }
@keyframes flicker {
  0%   { transform: scale(1, 1) skewX(0deg); }
  22%  { transform: scale(.96, 1.05) skewX(1.8deg); }
  48%  { transform: scale(1.03, .96) skewX(-1.2deg); }
  71%  { transform: scale(.98, 1.04) skewX(.9deg); }
  100% { transform: scale(1.01, .98) skewX(-1.5deg); }
}

/* הילה סביב הנר */
.menorah .glow-wrap { position: absolute; left: 0; top: -2.2cqw; width: 0; height: 0; }
.menorah .glow { position: absolute; left: 0; top: 0; width: 12cqw; height: 12cqw; translate: -50% -50%; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 190, 90, .5), rgba(255, 150, 50, .14) 40%, transparent 70%);
  opacity: 0; transition: opacity 2.4s ease .35s; }
.menorah .glow.lit { opacity: 1; animation: breathe 3.6s ease-in-out infinite alternate; }
.menorah .shamash .glow { width: 18cqw; height: 18cqw; transition: opacity 3s ease .6s; }
@keyframes breathe { from { scale: .96; } to { scale: 1.06; } }

/* ---------- השמש: הדלקה מובחנת ---------- */
.menorah .spark { position: absolute; left: 0; top: -3cqw; width: 9cqw; height: 9cqw; translate: -50% -50%; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff, rgba(255, 242, 196, .8) 25%, rgba(255, 207, 112, 0) 70%); }
.menorah .shamash.igniting .spark { animation: spark 1.6s ease-out both; }
@keyframes spark {
  0% { opacity: 0; transform: scale(.2); }
  18% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.8); }
}
/* סיום: זוהר זהוב סביב הצורה של החנוכייה בלבד (לא על כל התמונה).
   halo = עותק מטושטש ומואר של החנוכייה בלי רקע, מאחורי עותק חד. הזוהר מתפשט מהשמש החוצה (clip-path). */
.menorah .halo, .menorah .cutout { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.menorah .halo {
  mix-blend-mode: screen; opacity: 0;
  filter: blur(1.1cqw) brightness(2.4) sepia(1) saturate(3.2) hue-rotate(-12deg);
  clip-path: circle(0% at 50.8% 21%);
  transition: opacity 2.4s ease, clip-path 4.5s cubic-bezier(.2, .7, .2, 1);
}
.menorah .halo.wide { filter: blur(3.2cqw) brightness(2) sepia(1) saturate(3) hue-rotate(-12deg); }
.menorah.bathed .halo { opacity: .85; clip-path: circle(120% at 50.8% 21%); }
.menorah.bathed .halo.wide { opacity: .55; }
.menorah .cutout { opacity: 0; transition: opacity 2s ease; filter: brightness(1.04); }
.menorah.bathed .cutout { opacity: 1; }
.menorah .bathe { display: none; }
/* גל אור שעובר מהשמש החוצה לנרות */
.menorah.bathed .glow-wrap:not(.shamash-glow-wrap) .glow { animation: wave 2s ease-out both; animation-delay: calc(var(--dist) * .22s + .3s); }
@keyframes wave {
  0% { scale: 1; filter: brightness(1); }
  40% { scale: 1.4; filter: brightness(1.3); }
  100% { scale: 1.06; filter: brightness(1.08); }
}

/* פריסת התוכן מעל התמונה: כותרת למעלה, מקרא למטה */
#stage[data-view="game"], #stage[data-view="finale-pre"], #stage[data-view="finale"], #stage[data-view="opening"] {
  justify-content: space-between; padding-top: 1.6vh; padding-bottom: 3.5vh;
}
[data-view="game"] .title, [data-view="finale-pre"] .title, [data-view="finale"] .title {
  font-size: min(5.6vw, 10vh); line-height: 1.1; text-shadow: 0 0 2.2vw rgba(240, 196, 106, .45), 0 .2vw .6vw rgba(0, 0, 0, .6);
}

/* ---------- פתיחה ---------- */
.opening-text { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2.6vh, 30px); max-width: 860px; }
.story { font-family: var(--serif); font-size: clamp(19px, 2.4vw, 32px); line-height: 1.55; color: var(--ink); text-shadow: 0 2px 10px rgba(0, 0, 0, .85), 0 0 30px rgba(0, 0, 0, .6); }
.story p { margin: 0 0 .25em; }
.story.telling p { opacity: 0; animation: storyIn 1.4s var(--ease) forwards; animation-delay: calc(var(--n) * 1.5s + .6s); }
.story.telling p:last-child { color: var(--gold); }
.story.told p:last-child { color: var(--gold); }
@keyframes storyIn { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

.btn {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  border-radius: 999px; padding: .6em 1.5em; cursor: pointer;
  transition: background .3s, border-color .3s, transform .2s, box-shadow .3s;
}
.btn:hover { background: rgba(255, 255, 255, .08); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(180deg, #f4cf7b, #c9953d); color: #23170a; border-color: transparent;
  font-weight: 700; box-shadow: 0 0 0 0 rgba(240, 196, 106, .0), 0 8px 30px rgba(240, 160, 60, .25);
}
.btn-primary:hover { background: linear-gradient(180deg, #f8da90, #d4a24a); transform: translateY(-1px); }
.btn-lg { font-size: clamp(20px, 2.2vw, 28px); padding: .55em 1.9em; }
.btn-ghost { color: var(--ink-soft); }

/* ---------- משחק ---------- */
.legend {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  font-size: clamp(15px, 1.6vw, 22px); color: var(--ink-soft);
}
.legend li { display: inline-flex; flex-direction: column; align-items: center; gap: .3em; padding: .35em 1.1em .45em; border-radius: 12px;
  background: rgba(8, 10, 22, .55); backdrop-filter: blur(6px); color: var(--ink); font-weight: 600; }
.legend li::after { content: ''; width: 100%; height: 4px; border-radius: 99px; background: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent); }

/* משפט מעבר אחרי 8 נרות (מעל המקרא) */
.all-lit {
  position: absolute; inset-inline: 16px; bottom: 15vh; margin: 0 auto; max-width: 1200px; text-wrap: balance;
  font-family: var(--serif); font-weight: 700; font-size: clamp(24px, 3.6vw, 54px); line-height: 1.3;
  color: #ffe9b8; text-shadow: 0 2px 12px rgba(0, 0, 0, .9), 0 0 30px rgba(255, 190, 90, .35);
  transition: opacity 2s ease, transform 2s var(--ease);
}

/* ---------- משימת הנר התשיעי (בקוד: wicks) ---------- */
.wicks { width: min(100%, 1240px); display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.4vh, 16px);
  background: rgba(8, 10, 22, .55); backdrop-filter: blur(8px); border-radius: 22px; padding: clamp(12px, 2vh, 24px) clamp(12px, 2vw, 28px); }
.wicks h2 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 4vw, 54px); color: var(--gold); }
.instruction { margin: 0; font-size: clamp(17px, 2vw, 26px); color: var(--ink-soft); }
.cube-groups { display: grid; gap: clamp(10px, 2vw, 28px); width: 100%; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); margin-top: 4px; }
.cube-groups[data-teams="2"] { --cols: 2; }
.cube-group {
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-top: 3px solid var(--c);
  background: rgba(255, 255, 255, .025); border-radius: 14px; padding: 10px 10px 14px;
}
.cube-group h3 { margin: 0 0 10px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: clamp(15px, 1.5vw, 20px); font-weight: 600; color: var(--ink-soft); }
.cubes { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 1vw, 12px); }
.cube {
  --s: clamp(46px, 5.6vw, 82px);
  position: relative; width: var(--s); height: var(--s);
  border-radius: 12px;
  background: linear-gradient(145deg, #2a2233, #17121e);
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -6px 12px rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .35);
  display: grid; place-items: center;
  transition: background 1.2s ease, box-shadow 1.4s ease, transform .6s var(--ease);
}
.cube-stamp { font-family: var(--serif); font-weight: 700; font-size: calc(var(--s) * .36); color: #6e6478; transition: color 1s ease, transform 1s var(--ease); line-height: 1; }
.cube-digit {
  position: absolute; bottom: 4px; inset-inline-start: 7px; font-weight: 700; font-size: calc(var(--s) * .22);
  color: #2b1b06; opacity: 0; transform: scale(.6); transition: opacity .8s ease .5s, transform .8s var(--ease) .5s;
}
.cube-mark { position: absolute; top: 6px; inset-inline: 22%; height: 3px; border-radius: 99px; background: var(--c); opacity: .8; }
.cube.lit {
  background: radial-gradient(circle at 50% 40%, #ffe7a8, #f2b950 60%, #c98a2c);
  box-shadow: 0 0 22px rgba(255, 190, 90, .55), 0 0 60px rgba(255, 160, 60, .22), inset 0 -6px 12px rgba(120, 60, 0, .3);
  transform: translateY(-2px);
}
.cube.lit .cube-stamp { color: #3a2408; transform: translateY(-3px); }
.cube.lit .cube-digit { opacity: 1; transform: none; }
#stage.cubes-complete .cube.lit { animation: cubesDone 1s ease-in-out both; animation-delay: calc(var(--k) * 60ms); }
@keyframes cubesDone { 50% { box-shadow: 0 0 40px rgba(255, 210, 120, .9), 0 0 90px rgba(255, 170, 70, .45); transform: translateY(-5px) scale(1.06); } }

.hint { margin: 4px 0 0; font-family: var(--serif); font-style: italic; font-size: clamp(17px, 2vw, 26px); color: var(--gold); max-width: 820px; }
.demo-note { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- סיום ---------- */
.finale-line {
  margin: 0; max-width: 1200px; text-wrap: balance;
  font-family: var(--serif); font-weight: 700; font-size: clamp(24px, 4vw, 56px); line-height: 1.3;
  color: #ffe9b8; text-shadow: 0 0 30px rgba(255, 190, 90, .35);
  transition: opacity 2.6s ease, transform 2.6s var(--ease);
}

/* ---------- חדר: הרשמה ---------- */
[data-view="lobby"] .title { font-size: clamp(34px, 6vw, 84px); }
.lobby { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 22px); width: min(100%, 1200px); }
.join-card {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 44px);
  background: rgba(8, 10, 22, .5); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(12px, 2vw, 24px) clamp(16px, 3vw, 36px);
}
.qr { width: clamp(150px, 22vh, 280px); height: auto; aspect-ratio: 1; border-radius: 12px; background: #fff8e8; padding: 6px; }
.join-text { text-align: start; }
.join-prompt { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(22px, 3vw, 42px); color: var(--gold); }
.join-url { margin: 6px 0; font-size: clamp(16px, 2vw, 28px); color: var(--ink); text-align: start; word-break: break-all; }
.room-code-line { margin: 0; color: var(--ink-soft); font-size: clamp(14px, 1.5vw, 20px); }
.room-code-line b { color: var(--ink); letter-spacing: .12em; font-size: 1.3em; }
.count { margin: 0; font-size: clamp(18px, 2vw, 28px); color: var(--ink-soft); }
.count b { color: var(--gold); font-size: 1.5em; font-family: var(--serif); }
.names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; max-width: 1100px; }
.names li {
  padding: .3em .9em; border-radius: 999px; font-size: clamp(16px, 1.8vw, 24px);
  background: rgba(240, 196, 106, .1); border: 1px solid rgba(240, 196, 106, .25);
}
.names li.new { animation: nameIn .9s var(--ease) both; }
@keyframes nameIn { from { opacity: 0; transform: translateY(10px) scale(.9); box-shadow: 0 0 0 rgba(255, 200, 100, 0); } 50% { box-shadow: 0 0 24px rgba(255, 200, 100, .5); } to { opacity: 1; transform: none; } }

/* ---------- חדר: קבוצות ---------- */
.room-teams { width: min(100%, 1400px); display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vh, 18px); }
.room-teams h2 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 4.4vw, 60px); color: var(--gold); }
.teams-sub { margin: 0; color: var(--ink-soft); font-size: clamp(16px, 1.8vw, 24px); min-height: 1em; }
.teams-sub:empty { display: none; }
.team-cols { display: grid; gap: clamp(10px, 2vw, 26px); width: 100%; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.team-cols[data-teams="2"] { --cols: 2; }
.team-col {
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-top: 4px solid var(--c);
  border-radius: 16px; background: rgba(8, 10, 22, .5); backdrop-filter: blur(8px); padding: 12px 12px 16px;
}
.team-col h3 { margin: 0 0 10px; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--serif); font-size: clamp(20px, 2.2vw, 32px); }
.team-col h3 small { font-family: var(--sans); font-size: .6em; color: var(--muted); font-weight: 400; }
.team-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.team-col li { font-size: clamp(16px, 1.8vw, 24px); padding: .25em .5em; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.team-col li.new { animation: nameIn .7s var(--ease) both; }
.team-col li.slot { background: none; border: 1px dashed color-mix(in srgb, var(--c) 35%, transparent); min-height: 1.9em; }
.waiting { margin: 0; color: var(--ink-soft); font-size: clamp(15px, 1.6vw, 22px); }
.waiting:empty { display: none; }
.waiting b { font-weight: 600; color: var(--ink); margin-inline: .3em; }
@media (max-width: 640px) {
  .join-card { flex-direction: column; text-align: center; }
  .join-text { text-align: center; }
  .team-cols { --cols: 2; }
}

/* ---------- שכבות מדיה ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 16px; background: rgba(8, 6, 12, .94);
}
.media-slot img, .media-slot video {
  display: block; max-width: min(94vw, 1500px); max-height: calc(100dvh - 120px); border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
/* סרטון הפתיחה ומדיית הסיום: מסך מלא, בלי מסגרת */
#intro, #finale-media { padding: 0; background: #000; }
#intro .media-slot video, #intro .media-slot img, #finale-media .media-slot video, #finale-media .media-slot img { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; object-fit: cover; border-radius: 0; box-shadow: none; }
.overlay-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* רמז למסך מלא (נעלם אחרי כמה שניות / לחיצה) */
.fs-hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; margin: 0;
  background: rgba(20, 15, 28, .85); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 8px 16px; border-radius: 999px; font-size: 15px; cursor: pointer;
}
body.is-preview { cursor: default; }

/* ---------- בקרה מעוגנת ---------- */
.demo-toggle {
  position: fixed; bottom: 12px; inset-inline-start: 12px; z-index: 20;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(20, 15, 28, .7); color: var(--ink-soft); cursor: pointer; opacity: .55;
}
.demo-toggle:hover { opacity: 1; }
.demo-dock {
  position: fixed; z-index: 30; bottom: 0; inset-inline-start: 0;
  width: min(420px, 100vw); max-height: 85dvh; overflow: auto;
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 0 14px 0 0;
  padding: 12px 14px 16px;
}
.demo-close { position: absolute; top: 6px; inset-inline-end: 8px; background: none; border: 0; font-size: 24px; color: var(--ink-soft); cursor: pointer; }
body.is-preview .demo-toggle { display: none; }

/* ---------- בקרת הדגמה ---------- */
.control { font-size: 15px; text-align: start; }
.control h2 { margin: 0; font-family: var(--serif); color: var(--gold); font-size: 22px; }
.control h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink-soft); letter-spacing: .02em; }
.control h3 small { font-weight: 400; color: var(--muted); }
.ctl-status { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; }
.ctl-status b { color: var(--ink); }
.ctl-sec { border-top: 1px solid var(--line); padding: 12px 0; }
.control .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.control .lbl { min-width: 70px; color: var(--ink-soft); }
.control button {
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; min-height: 36px;
}
.control button:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.control button:disabled { opacity: .35; cursor: not-allowed; }
.control button[aria-pressed="true"] { background: rgba(240, 196, 106, .22); border-color: var(--gold); color: #fff3d6; }
.control button.danger { border-color: rgba(255, 120, 110, .45); color: #ffb3a8; }
.control button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.seg { display: inline-flex; gap: 4px; }
.control .num { width: 64px; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .25); color: var(--ink); font: inherit; }
.sizes { margin: 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.candle-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.control .c-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-bottom: 3px solid var(--c); }
.control .c-btn[aria-pressed="true"] { background: radial-gradient(circle at 50% 30%, rgba(255, 200, 100, .5), rgba(240, 160, 60, .15)); }
.q-groups { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.q-group { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.q-name { min-width: 62px; color: var(--ink-soft); font-size: 13px; }
.control .q-btn { min-width: 36px; padding: 4px 0; border-bottom: 3px solid var(--c); }
.ctl-foot { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.ctl-foot a { color: var(--gold); }

/* עמוד הבקרה הנפרד */
.control-page { padding: 16px; }
.control-layout { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 20px; max-width: 1500px; margin: 0 auto; align-items: start; }
.control-layout #panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.preview { position: sticky; top: 16px; }
.preview-label { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.preview iframe { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
@media (max-width: 860px) {
  .control-layout { grid-template-columns: 1fr; }
  .preview { position: static; }
}

/* ---------- טלפון ---------- */
@media (max-width: 640px) {
  .cube-groups { --cols: 2; gap: 10px; }
  .cube { --s: clamp(44px, 15vw, 64px); }
  .candle-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ביטול מעברים לרינדור מיידי (טעינה/איפוס) */
.no-anim *, .no-anim *::before, .no-anim *::after { transition: none !important; }
.no-anim .story p { animation: none !important; opacity: 1 !important; }

/* ---------- תנועה מופחתת ---------- */
/* אפשר לעקוף עם ?motion=full בכתובת (למחשב הקרנה שבו כובו אפקטי האנימציה של Windows) */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .blk { transform: none !important; transition: opacity .5s ease; }
  :root:not([data-motion="full"]) .menorah-wrap,
  :root:not([data-motion="full"]) .title { transition-duration: .4s; }
  :root:not([data-motion="full"]) .menorah .flame-grow { transform: none; transition: opacity .8s ease; }
  :root:not([data-motion="full"]) .menorah .shamash .flame-grow { transition: opacity 1.2s ease; }
  :root:not([data-motion="full"]) .menorah.photo { transition-duration: .4s; }
  :root:not([data-motion="full"]) .menorah .candle.lit .flame-flicker,
  :root:not([data-motion="full"]) .menorah .glow.lit,
  :root:not([data-motion="full"]) .menorah.bathed .glow-wrap .glow,
  :root:not([data-motion="full"]) .menorah .shamash.igniting .spark,
  :root:not([data-motion="full"]) #stage.cubes-complete .cube.lit { animation: none !important; }
  :root:not([data-motion="full"]) .menorah .halo { clip-path: none; transition: opacity 1.5s ease; }
  :root:not([data-motion="full"]) .story.telling p { animation: none; opacity: 1; }
  :root:not([data-motion="full"]) .names li.new,
  :root:not([data-motion="full"]) .team-col li.new { animation: none; }
  :root:not([data-motion="full"]) .cube,
  :root:not([data-motion="full"]) .cube-digit,
  :root:not([data-motion="full"]) .cube-stamp { transition-duration: .4s; transform: none !important; }
}

/* ---------- מצבים: קבלת פנים / הדרכה (מעל המשחק) ---------- */
.mode-layer { position: fixed; inset: 0; z-index: 30; background: #07060b; opacity: 0; visibility: hidden; transition: opacity 1.4s ease, visibility 0s linear 1.4s; overflow: hidden; }
.mode-layer.on { opacity: 1; visibility: visible; transition: opacity 1.4s ease, visibility 0s; }
.welcome-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 40%; }
.mode-layer.on .welcome-img { animation: welcome-drift 40s ease-in-out infinite alternate; }
@keyframes welcome-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, 1%); } }
.welcome-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(6, 5, 12, .78) 0%, rgba(6, 5, 12, .25) 26%, transparent 45%); }
.welcome-text { position: absolute; inset: 0 0 auto 0; padding: 4.5vh 6vw 0; text-align: center; }
#welcome-title { margin: 0 auto; max-width: 92vw; text-wrap: balance; overflow-wrap: anywhere; font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 5vw, 92px); line-height: 1.15; color: var(--gold);
  text-shadow: 0 0 40px rgba(240, 196, 106, .35), 0 4px 18px rgba(0, 0, 0, .85); }
#welcome-sub { margin: 1.2vh 0 0; font-family: var(--sans); font-weight: 600; font-size: clamp(18px, 2.4vw, 42px); color: var(--ink); text-shadow: 0 3px 14px rgba(0, 0, 0, .9); }
#welcome-sub:empty { display: none; }
.mode-layer.on .welcome-text > * { animation: welcome-in 1.6s ease both; }
.mode-layer.on #welcome-sub { animation-delay: .5s; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.training-soon { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #1d1628 0%, #07060b 70%); }
#training-soon { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 4.4vw, 76px); color: var(--gold); text-align: center; padding: 0 6vw; }
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) .mode-layer.on .welcome-img, html:not([data-motion="full"]) .mode-layer.on .welcome-text > * { animation: none; }
}

/* טקסט שהוגדר ריק בעמוד ההגדרות — לא מוצג */
.finale-line:empty, .all-lit:empty, #hint:empty { display: none; }

/* גופנים שנבחרו בהגדרות לשמות הקבוצות ול"חדר ההמתנה" (display.js → applyFonts) */
#stage[data-f-teams] .team-col h3 span, #stage[data-f-teams] .legend li span, #stage[data-f-teams] .cube-group h3 span { font-family: var(--f-teams); }
#stage[data-f-waitingroom] #waiting > span { font-family: var(--f-waitingRoom); }

/* ---------- שקפים של מצגת ההדרכה (js/slides.js) — משותף למסך ולעמוד הניהול ---------- */
.slide-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: size; overflow: hidden; background: #07060b; color: var(--ink); font-family: var(--sans); }
.slide { position: absolute; inset: 0; background: radial-gradient(ellipse at 70% 15%, rgba(240, 196, 106, .14), transparent 55%), radial-gradient(ellipse at 20% 100%, #1d1628 0%, #07060b 70%); }
.slide h1, .slide h2 { font-family: var(--serif); color: var(--gold); margin: 0; line-height: 1.15; text-wrap: balance; }
.sl-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 8cqw; gap: 2.4cqh; }
.slide-title h1 { font-size: 7.2cqw; font-weight: 900; text-shadow: 0 0 4cqw rgba(240, 196, 106, .3); }
.sl-sub { margin: 0; font-size: 2.8cqw; color: var(--ink-soft); max-width: 70cqw; line-height: 1.35; }
.sl-h { font-size: 4.6cqw; font-weight: 700; }
.slide-bullets { padding: 9cqh 8cqw; }
.sl-list { list-style: none; margin: 5cqh 0 0; padding: 0; display: flex; flex-direction: column; gap: 3cqh; }
.sl-list li { position: relative; padding-inline-start: 3.2cqw; font-size: 2.9cqw; line-height: 1.3; }
.sl-list li::before { content: ''; position: absolute; inset-inline-start: 0; top: .55em; width: 1.1cqw; height: 1.1cqw; border-radius: 50%; background: var(--gold); box-shadow: 0 0 1.4cqw rgba(240, 196, 106, .7); }
.sl-img, .sl-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.sl-img.fit-contain, .sl-video { object-fit: contain; }
.sl-noimg { display: grid; place-items: center; color: var(--muted); font-size: 2.4cqw; background: #120e18; }
.sl-cap { position: absolute; inset: auto 0 0 0; padding: 14cqh 6cqw 6cqh; background: linear-gradient(to top, rgba(6, 5, 12, .9), rgba(6, 5, 12, .55) 55%, transparent); text-align: center; }
.sl-cap h2 { font-size: 4.4cqw; }
.sl-cap p { margin: 1.2cqh 0 0; font-size: 2.4cqw; color: var(--ink); }
.slide-split { display: grid; grid-template-columns: 1fr 1fr; }
.sl-side { position: relative; }
.sl-text { padding: 10cqh 5cqw 0; }
.slide-split .sl-h { font-size: 4cqw; }
.slide-split .sl-list li { font-size: 2.5cqw; }
.slide-quote blockquote { position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 10cqw; gap: 3cqh; }
.slide-quote blockquote p { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 5.6cqw; line-height: 1.25; color: var(--ink); }
.slide-quote blockquote p::before { content: '״'; display: block; font-size: 12cqw; line-height: .6; color: var(--gold); opacity: .7; }
.slide-quote cite { font-style: normal; font-size: 2.6cqw; color: var(--gold); }
.slide-empty { background: #07060b; }

/* במסך התצוגה: מעבר בין שקפים + כניסה של נקודות */
.slide-deck { position: absolute; inset: 0; display: grid; place-items: center; background: #07060b; }
.slide-deck .slide-frame { position: absolute; width: min(100vw, 177.78vh); opacity: 0; transition: opacity .7s ease; }
.slide-deck .slide-frame.in { opacity: 1; }
.slide-deck .slide-frame.in .sl-list li { animation: sl-li .6s ease both; animation-delay: calc(.25s + var(--i) * .12s); }
@keyframes sl-li { from { opacity: 0; transform: translateX(1.5cqw); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html:not([data-motion="full"]) .slide-deck .slide-frame.in .sl-list li { animation: none; } }

/* ---------- משימת הנר התשיעי: פסיפס תמונת החשמונאים (כשיש משימה אמיתית מהשרת) ---------- */
.wicks.has-mosaic .cube-groups { display: none; }
.mosaic { display: none; position: relative; width: min(100%, calc((100vh - 410px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0e0c0a; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.wicks.has-mosaic .mosaic { display: block; }
.mosaic-tile { position: absolute; display: grid; place-items: center; align-content: center; gap: .3em; border: 1px solid rgba(240,196,106,.22); background-color: #16120d; background-repeat: no-repeat; transition: background-color .8s ease, box-shadow .8s ease; overflow: hidden; }
.mosaic-tile .sym { color: #f0c46a; opacity: .9; width: 38%; max-width: 74px; aspect-ratio: 1; }
.mosaic-tile .sym svg, .mosaic-tile .sym img { width: 100%; height: 100%; display: block; }
.mosaic-tile .nm { font-size: clamp(11px, 1.15vw, 18px); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%; }
.mosaic-tile.extra, .mosaic-tile.solved { background-image: var(--img); }
/* הקרדיט בסוף סרטון הסיום (settings.finaleCredit), כמו שהיה צרוב בסרטון: למטה משמאל */
.finale-credit { position: absolute; left: 2.9vw; bottom: 4vh; margin: 0; z-index: 3; direction: rtl; text-align: right; white-space: pre-line;
  font-family: 'Frank Ruhl Libre', serif; font-weight: 500; font-size: clamp(14px, 1.56vw, 34px); line-height: 1.45; color: #f3e8d2;
  text-shadow: 0 2px 10px rgba(0,0,0,.95), 0 0 24px rgba(0,0,0,.8); background: radial-gradient(ellipse at 50% 60%, rgba(5,6,12,.55), transparent 72%);
  padding: 1.35vw 1.8vw; opacity: 0; transition: opacity 1.6s ease; pointer-events: none; }
.finale-credit.on { opacity: 1; }
.finale-credit:empty { display: none; }
/* אריח עודף (כשהמשתתפים לא מתחלקים שווה): כבר בקווי מתאר, כמו אריח שנפתר — לא בצבע (לבקשתה, 2026-11-26) */
.mosaic-tile.extra { --img: url(../media/mosaic/outline.jpg); border-color: rgba(240,196,106,.35); }
.mosaic-tile.solved { --img: url(../media/mosaic/outline.jpg); border-color: rgba(240,196,106,.35); animation: tileIn 1.2s var(--ease) both; }
.mosaic-tile.solved .sym, .mosaic-tile.solved .nm, .mosaic-tile.extra .sym, .mosaic-tile.extra .nm { display: none; }
@keyframes tileIn { from { filter: brightness(2.2); } to { filter: none; } }
/* הלחיצה המשותפת: התמונה הצבעונית מתמלאת לפי כמות הלוחצים, ובסוף מלאה */
.mosaic-color { position: absolute; inset: 0; background: url(../media/hashmonaim.jpg) center / cover no-repeat; opacity: var(--level, 0); transition: opacity .6s ease; pointer-events: none; }
.mosaic.done .mosaic-color { opacity: 1; transition: opacity 1.4s ease; }
/* מילוי בצבע ב-WebGL (js/mosaicfill.js): "זהב זורם בקווים, ומהם הצבע נספג". בלי WebGL נשארת ההתבהרות (.mosaic-color) */
.mosaic.gl .mosaic-color { display: none; }
.mosaic-gl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .3s; }
/* בלחיצה הקווים מתעמעמים, ונדלקים כשהזהב מגיע אליהם */
.mosaic.gl .mosaic-tile.solved { transition: filter 1.2s ease, background-color .8s ease, box-shadow .8s ease; }
.mosaic.gl.pressing .mosaic-tile.solved { filter: brightness(.45); }
.mosaic.done { box-shadow: 0 0 60px rgba(255, 200, 110, .55); }
.press-meter { font-size: clamp(16px, 1.8vw, 24px); color: var(--gold); min-height: 1.4em; margin: 0; }
:root:not([data-motion="full"]) .mosaic-tile.solved { animation: none; }

/* ברקוד הצטרפות בפינת המסך, בזמן המשחק (המנהלת מפעילה) */
.join-corner { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 25; display: flex; align-items: center; gap: 12px; background: rgba(14, 12, 20, .88); border: 1px solid rgba(240,196,106,.4); border-radius: 16px; padding: 10px 14px 10px 10px; box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: opacity .6s ease, transform .6s var(--ease); }
.join-corner[hidden] { display: flex; opacity: 0; transform: translateY(20px); pointer-events: none; }
.join-corner img { width: clamp(90px, 9vw, 150px); height: auto; border-radius: 8px; background: #fff8e8; }
.join-corner b { display: block; color: var(--gold); font-size: clamp(16px, 1.6vw, 22px); }
.join-corner span { color: var(--ink-soft); font-size: clamp(12px, 1.1vw, 16px); direction: ltr; display: block; }
body:not([data-mode="game"]) .join-corner { display: none; }

.team-col li .lit-flame { font-size: .8em; margin-inline-start: .3em; }

/* משימת הנר התשיעי עם פסיפס: בלי הכותרת "הנר התשיעי", והתמונה כמה שיותר גדולה (לבקשתה, 2026-11-21) */
#stage.mosaic-on[data-view="wicks"] { padding: 10px 12px; gap: 0; }
#stage.mosaic-on[data-view="wicks"] #title { display: none; }
.wicks.has-mosaic { width: 100%; max-width: none; padding: 8px 14px 10px; gap: 6px; }
.wicks.has-mosaic h2 { font-size: clamp(20px, 2.4vw, 38px); }
.wicks.has-mosaic .instruction { font-size: clamp(15px, 1.5vw, 22px); }
.wicks.has-mosaic .mosaic { width: min(100%, calc((100vh - 165px) * 16 / 9)); width: min(100%, calc((100dvh - 165px) * 16 / 9)); }
.wicks.has-mosaic .press-meter { font-size: clamp(14px, 1.4vw, 20px); min-height: 1.2em; }

/* ---------- "חג האורות" והוראות המשחק: טקסט שמופיע שורה אחרי שורה (או סרטון במסך מלא) ---------- */
.told-screen { background: transparent; }
.told-screen.has-video { background: #000; padding: 0; }
.told-screen.has-video .told-text { display: none; }
.told-screen .media-slot:empty { display: none; }
.told-screen .media-slot video { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; object-fit: cover; border-radius: 0; box-shadow: none; }
#prelude:not(.has-video) { background: radial-gradient(ellipse at 50% 55%, rgba(8, 6, 12, .35), rgba(8, 6, 12, .82) 75%); }
#instructions:not(.has-video) { background: rgba(8, 6, 12, .45); }
.told-text { max-width: 980px; display: flex; flex-direction: column; gap: clamp(10px, 2.2vh, 26px); font-family: var(--serif); font-size: clamp(22px, 3vw, 44px); line-height: 1.45; color: var(--ink); text-shadow: 0 2px 12px rgba(0, 0, 0, .9), 0 0 34px rgba(0, 0, 0, .6); }
.told-text p { margin: 0; opacity: 0; }
.told-text p:last-child { color: var(--gold); }
.told-screen.in .told-text p { animation: storyIn 1.6s var(--ease) forwards; animation-delay: calc(var(--n) * 2.6s + .8s); }
.told-screen.instant .told-text p { animation: none; opacity: 1; }
:root:not([data-motion="full"]) .told-screen .told-text p { animation-duration: .4s; animation-delay: calc(var(--n) * .9s); }

/* ---------- כל אחד מדליק את הנר שלו: קיר של נרות עם שמות ---------- */
.candle-wall { width: min(100%, 1500px); display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vh, 18px); }
.candle-wall h2 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(40px, 6.4vw, 100px); line-height: 1.1; color: var(--gold); text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.candles-sub { margin: 0; color: var(--ink-soft); font-size: clamp(16px, 1.8vw, 26px); }
.candles-sub:empty { display: none; }
.wall { list-style: none; margin: clamp(10px, 3vh, 40px) 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: clamp(18px, 3.4vh, 44px) clamp(14px, 2.2vw, 40px); max-width: 1400px; }
.wall li { --h: clamp(64px, 10vh, 120px); display: grid; justify-items: center; gap: 10px; width: clamp(70px, 7vw, 120px); }
.wall li.new { animation: nameIn .9s var(--ease) both; }
.wc { position: relative; width: calc(var(--h) * .2); height: calc(var(--h) * 1.62); }
/* הנר: שעווה בצבע שמנת, פתיל, להבה */
.wc .wax { position: absolute; bottom: 0; inset-inline: 0; height: var(--h); border-radius: 5px 5px 3px 3px;
  background: linear-gradient(90deg, #b9a47c, #f4e8cc 38%, #fff8e6 50%, #d8c59f 78%, #a8946c); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.wc .wick { position: absolute; bottom: var(--h); left: 50%; width: 2px; height: calc(var(--h) * .09); translate: -50% 0; background: #2a2018; border-radius: 1px; }
.wc .flame { position: absolute; bottom: calc(var(--h) * 1.03); left: 50%; width: calc(var(--h) * .3); height: calc(var(--h) * .56); translate: -50% 0;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; transform-origin: 50% 90%;
  background: radial-gradient(ellipse 42% 55% at 50% 72%, #fffdf2 0 22%, #ffe08a 40%, #ffab3d 66%, rgba(255, 120, 30, 0) 74%);
  opacity: 0; transform: scale(.15); transition: opacity .5s ease, transform .9s cubic-bezier(.2, 1.6, .4, 1); filter: drop-shadow(0 0 6px rgba(255, 180, 80, .9)); }
.wc .halo { position: absolute; bottom: calc(var(--h) * .7); left: 50%; width: calc(var(--h) * 1.3); height: calc(var(--h) * 1.3); translate: -50% 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 90, .55), rgba(255, 160, 60, .16) 45%, transparent 70%); opacity: 0; transition: opacity 1.4s ease; pointer-events: none; }
.wall li.lit .flame { opacity: 1; transform: scale(1); animation: wallFlicker 2.8s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.wall li.lit .halo { opacity: 1; }
.wall .wn { font-size: clamp(14px, 1.35vw, 22px); color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 1s ease; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.wall li.lit .wn { color: var(--gold); }
/* החותם מתחת לנר (נחשף בכיול) */
.wall .ws { height: clamp(26px, 3vw, 48px); aspect-ratio: 1; color: var(--gold); opacity: 0; transform: scale(.4); transition: opacity 1.2s ease .6s, transform 1.2s var(--ease) .6s; filter: drop-shadow(0 0 8px rgba(255, 190, 90, .6)); }
.wall .ws svg, .wall .ws img { width: 100%; height: 100%; display: block; }
.wall li.lit .ws:not(:empty) { opacity: 1; transform: none; }
@keyframes wallFlicker { 0% { transform: scale(1) rotate(-1deg); } 35% { transform: scale(1.04, .97) rotate(1.2deg); } 70% { transform: scale(.97, 1.03) rotate(-.6deg); } 100% { transform: scale(1.02) rotate(.8deg); } }
:root:not([data-motion="full"]) .wall li.lit .flame { animation: none; }
.wall-count { margin: clamp(6px, 2vh, 24px) 0 0; font-size: clamp(18px, 2vw, 28px); color: var(--ink-soft); }
/* כניסה למסך (אחרי "חג האורות"): הכותרת לבד, אחר כך שורת המשנה, ואז הנרות אחד אחרי השני והמונה */
.candle-wall.seq h2 { animation: wallTitleIn 2s var(--ease) .5s both; }
.candle-wall.seq .candles-sub { animation: storyIn 1.4s var(--ease) 2s both; }
.candle-wall.seq .wall li { animation: wallCandleIn 1.1s var(--ease) both; animation-delay: calc(3s + min(var(--i, 0), 24) * .16s); }
.candle-wall.seq .wall-count { animation: storyIn 1.2s var(--ease) both; animation-delay: calc(3.6s + min(var(--n, 0), 24) * .16s); }
@keyframes wallTitleIn { from { opacity: 0; transform: scale(.92); filter: blur(6px); letter-spacing: .04em; } to { opacity: 1; transform: none; filter: none; } }
@keyframes wallCandleIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
:root:not([data-motion="full"]) .candle-wall.seq * { animation-duration: .4s !important; animation-delay: 0s !important; }
.wall-count b { color: var(--gold); font-family: var(--serif); font-size: 1.4em; }

/* ---------- כתוביות לסרטונים (display.js: loadSubs) ---------- */
.media-slot.with-subs { position: relative; }
.subs {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  max-width: 82%; width: max-content; z-index: 5; pointer-events: none;
  direction: rtl; text-align: center; white-space: pre-line;
  font-family: 'Heebo', var(--sans), sans-serif; font-weight: 600; line-height: 1.35;
  font-size: clamp(18px, 2.6vw, 46px); color: #fff;
  padding: .22em .7em .28em; border-radius: .35em;
  background: rgba(0, 0, 0, .5); text-shadow: 0 2px 6px rgba(0, 0, 0, .85);
  opacity: 0; transition: opacity .25s ease;
}
.subs.on { opacity: 1; }
body[data-subs="off"] .subs { display: none; }
body[data-subs-size="s"] .subs { font-size: clamp(14px, 2vw, 34px); }
body[data-subs-size="l"] .subs { font-size: clamp(22px, 3.4vw, 60px); }

/* ---------- אוריה על המסך (2026-11-27): קטן בפינה השמאלית התחתונה, הילה זהובה, נכנס ויוצא בעדינות ---------- */
.uriya { position: fixed; left: -0.5vh; bottom: 0; height: 50vh; aspect-ratio: 574 / 720; z-index: 25; pointer-events: none;
  opacity: 0; transition: opacity 1.2s ease; }
.uriya.in { opacity: 1; transition-duration: .6s; }
.uriya.fast { transition-duration: .35s; }
.uriya-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.uriya-halo { position: absolute; left: -20.9%; top: -16.67%; width: 141.8%; height: 133.33%; opacity: .42; }
body.is-preview .uriya { display: none; }

/* הלוגו במקום הכותרת (2026-11-30). הגובה נגזר מגודל הגופן של הכותרת בכל מסך, כך שהוא גדל ומתכווץ כמוה */
.title.has-logo { line-height: 0; text-shadow: none; }
.title-logo { display: inline-block; height: 1.35em; width: auto; max-width: 92vw; filter: drop-shadow(0 .25vw .6vw rgba(0, 0, 0, .55)) drop-shadow(0 0 1.6vw rgba(240, 180, 80, .22)); }

/* לפני פתיחת חדר: הכותרת קצת קטנה יותר ומעט נמוכה מהקצה, ומדי פעם "נושמת" (2026-11-30, לבקשתה) */
#stage[data-room="none"][data-view="opening"] .title { font-size: clamp(40px, 6.4vw, 102px); margin-top: 4.5vh; }
#stage[data-room="none"][data-view="opening"] .title-logo { animation: logo-breathe 11s ease-in-out 3s infinite; }
@keyframes logo-breathe {
  0%, 62%, 100% { transform: scale(1); filter: drop-shadow(0 .25vw .6vw rgba(0, 0, 0, .55)) drop-shadow(0 0 1.6vw rgba(240, 180, 80, .22)); }
  76% { transform: scale(1.045); filter: drop-shadow(0 .25vw .6vw rgba(0, 0, 0, .55)) drop-shadow(0 0 2.6vw rgba(255, 196, 90, .55)) brightness(1.08); }
  88% { transform: scale(.995); }
}
:root:not([data-motion="full"]) #stage[data-room="none"][data-view="opening"] .title-logo { animation: none; }
/* בהרשמה (אחרי פתיחת חדר): הכותרת גדולה יותר ומעט גבוהה יותר */
#stage[data-view="lobby"] .title { font-size: clamp(44px, 7.6vw, 110px); margin-top: -6vh; margin-bottom: 1vh; }

/* החנוכייה בזמן המשימות: בהירה יותר מההתחלה, והזוהר סביב הנרות עדין יותר, בלי "ערפל" שמטשטש את השמש (2026-11-30, לבקשתה) */
.menorah .frame { filter: brightness(calc(.93 + var(--lit) * .008)) saturate(1); }
.menorah .shade { opacity: calc((1 - var(--lit) / 9 * .8) * .45); }
.menorah .glow { width: 8cqw; height: 8cqw; background: radial-gradient(circle, rgba(255, 196, 100, .34), rgba(255, 160, 60, .08) 42%, transparent 68%); }
.menorah .shamash .glow { width: 11cqw; height: 11cqw; }
@keyframes breathe { from { scale: .97; } to { scale: 1.03; } }
/* סיום: זוהר דק סביב הצורה במקום הילה רחבה ובהירה */
.menorah .halo { filter: blur(.45cqw) brightness(1.7) sepia(1) saturate(2.6) hue-rotate(-12deg); }
.menorah .halo.wide { filter: blur(1.6cqw) brightness(1.5) sepia(1) saturate(2.4) hue-rotate(-12deg); }
.menorah.bathed .halo { opacity: .55; }
.menorah.bathed .halo.wide { opacity: .28; }
.menorah.bathed .frame { filter: brightness(1.02) saturate(1.02); }

/* הפסקה במשחק (2026-12-02): שכבה מעל הכול (גם מעל קבלת פנים / הדרכה), המשחק נשמר מתחת */
.pause-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(6, 5, 10, .86);
  backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s; }
.pause-layer.on { opacity: 1; visibility: visible; transition: opacity .9s ease, visibility 0s; }
.pause-box { text-align: center; padding: 0 6vw; }
.pause-icon { font-size: 9vh; line-height: 1; color: var(--gold, #f0c46a); opacity: .85; margin-bottom: 3vh; text-shadow: 0 0 30px rgba(240, 196, 106, .45); }
.pause-text p { margin: 0 0 2vh; font-size: 4.2vh; color: #efe6d4; line-height: 1.35; }
.pause-text p.big { font-family: var(--serif); font-size: 8vh; font-weight: 700; color: var(--gold, #f0c46a); text-shadow: 0 0 40px rgba(240, 196, 106, .35); }
html[data-motion="full"] .pause-layer.on .pause-icon { animation: pause-breathe 3.2s ease-in-out infinite; }
@keyframes pause-breathe { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
