html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  /* בלי הגדלת כתב אוטומטית של דפדפני הטלפון: הגודל נקבע ב-JS לפי המסגרת */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Frank Ruhl Libre", "David Libre", "David", "Times New Roman", serif;
}

#stage {
  position: relative;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* מסגרת אחת על הרקע. הגופן נקבע ב-JS כך שהתוכן ימלא אותה. */
.slot {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  line-height: 1.25;
  direction: rtl;
  font-weight: 700;
}

/* חלון שהתוכן בו מתחיל למעלה (slot.top ב-js/layouts.js), כדי שיתיישר עם הכותרות שלידו. */
.slot.from-top {
  align-items: flex-start;
}

/* צבעי הנושא של רקע: theme ב-js/layouts.js מגדיר את --ink, --accent ו---rule. בלי theme, הצבעים הרגילים. */
.tone-light {
  color: var(--ink, #3b2412);
}

.tone-dark {
  color: #fdf3dc;
  text-shadow: 0 0.05em 0.15em rgba(0, 0, 0, 0.6);
}

.block {
  width: 100%;
  padding: 0.3em 0.5em;
  box-sizing: border-box;
}

.heading {
  font-weight: 700;
  font-size: 1.35em;
  margin-bottom: 0.35em;
}

.tone-light .heading {
  color: var(--accent, #7a1f12);
}

.tone-dark .heading {
  color: #f3cf7a;
}

.sub {
  font-size: 0.8em;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
  padding: 0.12em 0;
  border-bottom: 0.03em solid currentColor;
  border-bottom-color: var(--rule, rgba(120, 80, 40, 0.25));
  white-space: nowrap;
}

.row:last-child {
  border-bottom: none;
}

/* כתב גדול: שם ארוך יורד לשורה שנייה במקום לצמצם את הכתב. */
.wrap-big .row {
  white-space: normal;
  align-items: baseline;
}

.wrap-big .row .name {
  flex: 1 1 0;
  min-width: 0;
}

/* כיתוב קטן ליד שם התפילה, למשל "רק בחורף". */
.row .cap {
  font-size: 0.7em;
  font-weight: 700;
  opacity: 0.8;
}

.time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

/* שורה בלי שעה, למשל שיעור "בין מנחה לערבית". */
.time.text {
  direction: rtl;
  font-weight: 700;
}

/* המניין הבא (js/app.js, markNext): פס מודגש מאחורי השורה. בלי שינוי בגודל השורה, כדי שהחלונית לא תזוז. */
.row.next {
  border-radius: 0.25em;
  box-shadow: 0 0 0 0.12em rgba(201, 150, 40, 0.55);
}

.tone-light .row.next {
  background: rgba(240, 196, 90, 0.5);
  color: var(--accent, #7a1f12);
}

.tone-dark .row.next {
  background: rgba(243, 207, 122, 0.28);
  color: #ffe9b0;
}

/* כותרת של יום בטבלת חג ("ערב ראש השנה", "יום א׳"). */
.row.day-label {
  font-weight: 700;
  font-size: 0.85em;
  justify-content: center;
  border-bottom: none;
  padding-top: 0.3em;
}

/* חלוקה לשחרית, מנחה וערבית: רווח וקו זהב לפני כל חלק חוץ מהראשון. */
.row.section-start {
  margin-top: 0.4em;
  border-top: 0.14em solid #c9962e;
}

.row:has(+ .row.section-start) {
  border-bottom: none;
}

.tone-light .row.day-label {
  color: var(--accent, #7a1f12);
}

.tone-dark .row.day-label {
  color: #f3cf7a;
}

/* לוגו בית הכנסת ליד השם בשלט הכותרת */
.title.with-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}

.title-logo {
  height: 2em;
  width: auto;
  max-width: 35%;
  object-fit: contain;
  flex: none;
}

.title .heading {
  margin-bottom: 0.05em;
  white-space: nowrap;
}

.title .sub {
  white-space: nowrap;
}

.clock .now {
  font-size: 2em;
  font-weight: 700;
  line-height: 1.05;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.clock .sub {
  white-space: nowrap;
}

.notes .note {
  padding: 0.15em 0;
}

/* הודעות לפי לוח השנה: שם ההוספה בולט, ומתחתיו הסבר קצר. */
.luach .luach-title {
  font-weight: 800;
  padding-bottom: 0;
}

.tone-light .luach .luach-title {
  color: var(--accent, #7a1f12);
}

.tone-dark .luach .luach-title {
  color: #f3cf7a;
}

/* החלון ממלא את המסגרת: כותרת, הודעות לוח השנה, ובשאר הגובה ההודעות של הגבאי. */
.luach {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.luach .notes-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.luach .notes-viewport.scrolling {
  justify-content: flex-start;
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}

.luach .luach-text {
  font-size: 0.8em;
  opacity: 0.85;
  padding-top: 0;
}

/* הלכות: שם המנהג מעל כל הלכה. */
.halachot .label {
  margin-top: 0.5em;
  font-weight: 700;
  opacity: 0.85;
}

.halachot .note {
  line-height: 1.35;
}

/* כתב גדול: המקור בקטן מתחת להלכה. */
.halachot .label-after {
  margin-top: 0.8em;
  font-size: 0.5em;
  font-weight: 500;
  opacity: 0.8;
}

/* הלכה יומית: ההלכה, והמקור בקטן. */
.halacha-day .note {
  line-height: 1.4;
  font-weight: 500;
}

.halacha-day .source {
  margin-top: 0.4em;
  opacity: 0.85;
}

/* בפסים העליון והתחתון של רקע ההלכה הטקסט ממלא את הפס. */
.halacha-day.part-heading,
.halacha-day.part-source {
  padding: 0 0.3em;
}

.halacha-day.part-heading .heading {
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.halacha-day.part-source .source {
  margin: 0;
  white-space: nowrap;
  font-size: 1em;
}

/* שעון מחוגים, פרשה, הפטרה, תאריך וזמני שבת. */
.shabbat-clock .analog {
  display: block;
  /* בחלון צר השעון מצטמצם לרוחב החלון, אחרת הוא גולש ונראה לא ממורכז. */
  width: min(9em, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 0.3em;
  filter: drop-shadow(0 0.08em 0.2em rgba(0, 0, 0, 0.55));
}

/* שעון מחוגים בחלון שעון רגיל (בלי פרשה) */
.clock .analog {
  display: block;
  width: min(6em, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 0.2em;
  filter: drop-shadow(0 0.08em 0.2em rgba(0, 0, 0, 0.45));
}

/* שעון דיגיטלי מעוצב (js/clocks.js): ברוחב החלון, גובהו לפי היחס של העיצוב */
.dclock {
  display: block;
  width: min(100%, 11em);
  height: auto;
  margin: 0 auto 0.3em;
  filter: drop-shadow(0 0.06em 0.15em rgba(0, 0, 0, 0.5));
}

.clock .dclock {
  width: min(100%, 6.5em);
}

.analog .numeral {
  font-family: "Frank Ruhl Libre", serif;
  font-weight: 700;
  font-size: 21px;
  fill: #3b2412;
}

/* שעון דיגיטלי בחלון המרכזי: הפריט הגדול בחלונית, כמו שעון המחוגים */
.shabbat-clock .now {
  font-size: 2.4em;
  line-height: 1.05;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

/* בחלון צר (slot.top) שם הפרשה נשאר בשורה אחת, והכתב מצטמצם אם צריך. */
.slot.from-top .shabbat-clock .parasha {
  white-space: nowrap;
}

.shabbat-clock .parasha {
  font-size: 1.5em;
  margin: 0.2em 0 0.1em;
}

.shabbat-clock .hebdate {
  white-space: nowrap;
  margin-bottom: 0.4em;
}

.shabbat-clock .haftara {
  white-space: nowrap;
  margin-bottom: 0.4em;
}

/* גלריית תמונות: התמונה ממלאת את מה שנשאר מתחת לכותרת. */
.gallery {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.slot.photo-fill,
.slot.photo-fill .block {
  padding: 0;
}

.gallery.fill {
  position: relative;
  overflow: hidden;
}

.gallery.fill .gallery-blur {
  opacity: 1;
  filter: blur(22px) saturate(1.15) brightness(0.8);
}

.gallery.fill img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center 30%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gallery.fill.whole img {
  object-fit: contain;
}

.gallery-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 0.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-blur {
  position: absolute;
  inset: -8%;
  background: center / cover no-repeat;
  filter: blur(18px) saturate(1.1) brightness(0.92);
  opacity: 0.55;
}

.gallery img {
  position: relative;
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
  border-radius: 0.45em;
  border: 2px solid var(--rule, rgba(150, 105, 35, 0.45));
  box-shadow: 0 0.3em 1em rgba(0, 0, 0, 0.25);
}

.memorial {
  font-weight: 700;
  color: #3b2412;
  padding: 0.3em 1.4em;
}

/* העלים הגדולים מעוגלים בצדדים, לכן הטקסט מתרחק מהקצוות. */
.memorial.big {
  padding: 0.3em 2em;
}

.memorial.big .name {
  font-size: 1.1em;
}

.memorial .sub {
  font-weight: 700;
  color: #7a1f12;
  margin-top: 0.3em;
}

/* החלפת השמות בעלים הקטנים */
.kind-memorial {
  transition: opacity 0.6s;
}

.kind-memorial.fading {
  opacity: 0;
}

/* כפתור עריכה: עיפרון והמילה "עריכה". מוסתר עד שנוגעים במסך */
#admin-link {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 60;
  height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 26px;
  font: 700 20px/1 "Frank Ruhl Libre", serif;
  text-decoration: none;
  direction: rtl;
  background: rgba(30, 20, 10, 0.82);
  color: #f3cf7a;
  border: 2px solid #f3cf7a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

#admin-link.show {
  opacity: 1;
  pointer-events: auto;
}

body.preview #admin-link {
  display: none;
}

/* תפריט בחירת הרקע: מופיע רק כשהעכבר מעליו, כדי לא להפריע על המסך. */
#picker {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  opacity: 0;
  font-size: 16px;
  transition: opacity 0.2s;
}

#picker:hover,
#picker:focus {
  opacity: 1;
}

/* ---- התרעות פיקוד העורף והודעות קצין ביטחון (js/alerts.js) ---- */

.alerts-strip {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  direction: rtl;
}

.alerts-row {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.3em 1em;
  background: linear-gradient(180deg, #d4161f, #9e0f15);
  border-bottom: 0.35vh solid rgba(255, 214, 120, 0.85);
  color: #fff;
  font-size: 4vh;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.alerts-row::before {
  content: "";
  flex: none;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0.15em rgba(255, 255, 255, 0.3);
  animation: tz-pulse 1.6s ease-in-out infinite;
}

.alerts-row .text {
  flex: 1;
}

.alerts-row .meta {
  font-size: 0.7em;
  opacity: 0.9;
  white-space: nowrap;
}

/* שורה אחת; כשהיא ארוכה מהמקום היא מתגלגלת (marquee ב-js/alerts.js). */
.line {
  position: relative;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.line .track {
  display: inline-block;
}

.line.rolling {
  direction: ltr;
  /* קצוות מתעמעמים, כדי שמילה שנכנסת או יוצאת לא תיראה חתוכה */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.line.rolling .track {
  direction: rtl;
  will-change: transform;
}

@keyframes tz-roll {
  from {
    transform: translateX(var(--from));
  }
  to {
    transform: translateX(var(--to));
  }
}

/* חלון ברבע מגובה המסך (alerts.panelSize), למטה או למעלה (alerts.panel), והלוגו
   בצד ימין. כל הגדלים יחסיים לגובה החלון (--panel). */
.alerts-full {
  --panel: 25vh;
  position: fixed;
  inset: auto 0 0 0;
  height: var(--panel);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: calc(var(--panel) * 0.12);
  padding: calc(var(--panel) * 0.05) calc(var(--panel) * 0.12);
  box-sizing: border-box;
  direction: rtl;
  color: #fff;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.55);
  /* פס זהב דק בקצה העליון */
  border-top: calc(var(--panel) * 0.025) solid rgba(255, 214, 120, 0.9);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.alerts-full.at-top {
  inset: 0 0 auto 0;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
  border-top: 0;
  border-bottom: calc(var(--panel) * 0.025) solid rgba(255, 214, 120, 0.9);
}

.alerts-full[hidden] {
  display: none;
}

.alerts-full.danger {
  background:
    radial-gradient(120% 160% at 85% 50%, rgba(255, 255, 255, 0.14), transparent 55%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 2vh, transparent 2vh 4vh),
    linear-gradient(180deg, #d81920, #9a0e14);
}

.alerts-full.ended {
  background:
    radial-gradient(120% 160% at 85% 50%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(180deg, #1c9a4b, #0f6b31);
  border-color: rgba(255, 255, 255, 0.6);
}

.alerts-full .logo {
  flex: none;
  display: grid;
  place-items: center;
  /* הסמלים בחצי מגובה החלון */
  width: calc(var(--panel) * 0.5);
  height: calc(var(--panel) * 0.5);
  /* ריבוע חסום במעגל, כדי שהפינות של הלוגו לא ייחתכו */
  padding: calc(var(--panel) * 0.075);
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 calc(var(--panel) * 0.02) rgba(255, 255, 255, 0.45),
    0 calc(var(--panel) * 0.03) calc(var(--panel) * 0.08) rgba(0, 0, 0, 0.35);
  animation: tz-ring 2s ease-out infinite;
}

.alerts-full.ended .logo {
  animation: none;
}

/* לוגו צג חומה בהודעות קצין ביטחון, משמאל, על תג לבן */
.alerts-full .brand {
  flex: none;
  height: calc(var(--panel) * 0.5);
  padding: calc(var(--panel) * 0.05) calc(var(--panel) * 0.08);
  box-sizing: border-box;
  border-radius: calc(var(--panel) * 0.08);
  background: #fff;
  box-shadow:
    0 0 0 calc(var(--panel) * 0.02) rgba(255, 255, 255, 0.45),
    0 calc(var(--panel) * 0.03) calc(var(--panel) * 0.08) rgba(0, 0, 0, 0.35);
}

.alerts-full .brand img {
  display: block;
  height: 100%;
  width: auto;
}

.alerts-full .logo.round {
  padding: 0;
}

.alerts-full .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.alerts-full .logo.text {
  padding: calc(var(--panel) * 0.04);
  color: #b91c1c;
  font-size: calc(var(--panel) * 0.08);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

/* שלוש שורות: פרטים למעלה, הכותרת בדיוק במרכז גובה החלון, והטקסט למטה. */
.alerts-full .content {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  display: grid;
  /* minmax(0, ...): העמודה לא גדלה לרוחב הטקסט, והשורה שרחבה ממנה מתגלגלת */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto 1fr;
  text-align: right;
}

.alerts-full .content > .meta {
  align-self: start;
}

.alerts-full .content > .body {
  align-self: start;
}

.alerts-full .title {
  font-size: calc(var(--panel) * 0.28);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.alerts-full .body {
  font-size: calc(var(--panel) * 0.19);
  font-weight: 600;
  line-height: 1.25;
  color: #fff3e6;
}

.alerts-full.officer .title {
  font-size: calc(var(--panel) * 0.3);
}

.alerts-full.officer .body {
  font-size: calc(var(--panel) * 0.2);
}

.alerts-full .meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: calc(var(--panel) * 0.1);
  text-shadow: none;
}

/* הפרטים למעלה כתגיות שקופות; נקודה מהבהבת ליד "עכשיו" */
.alerts-full .meta .line,
.alerts-full .when {
  padding: 0.12em 0.7em;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.alerts-full.danger .when::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-inline-end: 0.4em;
  border-radius: 50%;
  background: #fff;
  vertical-align: 0.05em;
  animation: tz-pulse 1.6s ease-in-out infinite;
}

@keyframes tz-pulse {
  50% {
    opacity: 0.25;
  }
}

@keyframes tz-ring {
  0% {
    outline: calc(var(--panel) * 0.02) solid rgba(255, 255, 255, 0.55);
    outline-offset: 0;
  }
  100% {
    outline: calc(var(--panel) * 0.02) solid rgba(255, 255, 255, 0);
    outline-offset: calc(var(--panel) * 0.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .alerts-full .logo,
  .alerts-full .when::before,
  .alerts-row::before {
    animation: none;
  }
}

.alerts-full .meta .line {
  flex: 0 1 auto;
}

.alerts-full .when {
  white-space: nowrap;
}

.alerts-full .test {
  padding: 0.1em 0.8em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.8em;
  white-space: nowrap;
}

.alerts-login {
  position: fixed;
  z-index: 200;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  width: min(90vw, 22em);
  padding: 1.5em;
  border-radius: 12px;
  background: #fff;
  direction: rtl;
  font-size: 18px;
}

.alerts-login h2 {
  margin: 0 0 0.3em;
  font-size: 1.2em;
}

.alerts-login input,
.alerts-login button {
  font: inherit;
  padding: 0.4em 0.6em;
}

.alerts-login .msg {
  margin: 0;
  min-height: 1.3em;
}

/* בתוך עורך המסך: בלי תפריט בחירת המסך. */
body.preview #picker {
  display: none;
}

/* חלונית מתגלגלת (זמני היום): השורות עולות לאט בלולאה, עם עותק שני כדי שלא יהיה רווח. */
.rows-viewport {
  overflow: hidden;
  height: calc(var(--rows, 5) * 1.55em);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}

.rows-viewport .row:last-child {
  border-bottom: 0.03em solid var(--rule, rgba(120, 80, 40, 0.25));
}

/* הלכה ארוכה: גוללת לאט, עם עצירה קצרה בהתחלה ובסוף (fitHalacha). */
.hscroll {
  overflow: hidden;
  width: 100%;
}

@keyframes halacha-scroll {
  0%, 12% { transform: translateY(0); }
  88%, 100% { transform: translateY(var(--dist)); }
}

@keyframes rows-up {
  from { transform: translateY(0); }
  to { transform: translateY(-100%); }
}

/* פרנס היום: שמות גדולים במסגרת האמצעית, ממורכזים. */
.sponsor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
}

.sponsor .sponsor-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  width: 100%;
}

.sponsor .sponsor-note {
  font-size: 1em;
  line-height: 1.2;
  opacity: 0.85;
}

.sponsor .sponsor-one {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  max-width: 100%;
}

.sponsor .sponsor-name {
  font-size: 2.6em;
  font-weight: 800;
  line-height: 1.15;
  max-width: 100%;
}

/* פס הודעות נמוך בלי כותרת: הכותרת והטקסט גדולים יותר, והכיווץ האוטומטי מקטין אם צריך. */
.luach.strip .luach-pinned {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0 2em;
}

.luach.strip .luach-title {
  font-size: 2.6em;
}

.luach.strip .luach-text {
  font-size: 1.9em;
}

/* להבות נרות חיות (לוח ההנצחה): להבה שמרצדת קצת וזוהר שפועם סביבה. */
.flame,
.flame-glow {
  position: absolute;
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: flame-flicker 1.2s ease-in-out infinite;
}

.flame {
  background: radial-gradient(ellipse at 50% 70%, #fff 0%, #fff4c2 25%, #ffc84a 52%, #ff8a1c 78%, #e0480a 100%);
  clip-path: polygon(50% 0%, 61% 18%, 78% 44%, 90% 70%, 80% 92%, 50% 100%, 20% 92%, 10% 70%, 22% 44%, 39% 18%);
  filter: blur(0.5px);
}

.flame-glow {
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 190, 80, 0.45) 0%, rgba(255, 140, 40, 0.18) 45%, rgba(255, 120, 20, 0) 70%);
  mix-blend-mode: screen;
  animation-name: flame-glow;
}

/* להבת נר נעה (תמונה מונפשת) */
.candle-flame {
  position: absolute;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 0 0.4vw rgba(255, 170, 60, 0.7));
}

@keyframes flame-flicker {
  0% { transform: scale(1, 1) rotate(0deg); }
  20% { transform: scale(0.92, 1.07) rotate(-2.5deg); }
  40% { transform: scale(1.06, 0.95) rotate(2deg); }
  60% { transform: scale(0.95, 1.1) rotate(-1.5deg); }
  80% { transform: scale(1.04, 0.97) rotate(1.2deg); }
  100% { transform: scale(1, 1) rotate(0deg); }
}

@keyframes flame-glow {
  0%, 100% { opacity: 0.8; }
  30% { opacity: 1; }
  60% { opacity: 0.65; }
}

/* לוגו צג חומה ומספר הטלפון, בגוון של הרקע (הצבע מ-js/layouts.js, הצורה מהמסכה) */
.brand-mark {
  position: absolute;
  transform: translateX(-50%);
  aspect-ratio: 2001 / 281;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.brand-ink {
  width: 100%;
  height: 100%;
  -webkit-mask: url("../logos/tzag-choma-mask-2.png") center / contain no-repeat;
  mask: url("../logos/tzag-choma-mask-2.png") center / contain no-repeat;
}

/* דף אינטרנט: ממלא את החלונית. בהקטנה הדף רחב יותר ומוקטן בחזרה לגודל החלונית. */
.web {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.web-view {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* לחצני הנגן: פס כהה דק מתחת לסרטון. */
.player-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  height: 2.2em;
  font-size: max(14px, 2vh);
  background: #111;
  direction: ltr;
}

.player-bar .pk {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.1em;
  line-height: 1;
  padding: 0.2em 0.35em;
  cursor: pointer;
  border-radius: 0.2em;
}

.player-bar .pk svg {
  display: block;
  width: 1.3em;
  height: 1.3em;
  fill: currentColor;
}

.player-bar .pk:hover,
.player-bar .pk:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

/* כפתור החזרה: מואר כשהוא דלוק. */
.player-bar .pk[title^="חזרה"] {
  opacity: 0.45;
}

.player-bar .pk.on {
  opacity: 1;
  color: #e9c46a;
}

.player-bar .pv {
  width: 6em;
  accent-color: #e9c46a;
}

.web iframe.touch {
  pointer-events: auto;
}

.web iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  transform-origin: 0 0;
  background: #fff;
  pointer-events: none;
}

/* ברכת מזל טוב (js/simcha.js): כותרת בין שני קווים מוזהבים, שם מודגש וברכה. */
.simcha-rotate {
  height: 100%;
}

.simcha {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25em;
  height: 100%;
  text-align: center;
}

.simcha-title {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1.7em;
  font-weight: 900;
  line-height: 1.1;
  color: var(--accent, #9a6a1c);
}

.tone-dark .simcha-title {
  color: #f3cf7a;
}

.simcha-title::before,
.simcha-title::after {
  content: "";
  width: 1.6em;
  height: 0.08em;
  border-radius: 1em;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

.simcha-main {
  font-weight: 800;
  line-height: 1.3;
}

.simcha-bless {
  font-size: 0.8em;
  opacity: 0.85;
  line-height: 1.35;
}
