/* צבעים במקום אחד, מעט צבעים: שמנת, אדום יין ודיו כהה. זהב רק כנגיעה */
:root {
  --bg: #FBF6EE;
  --ink: #2B1A1A;
  --muted: #8A7670;
  --accent: #A3132E;
  --accent-dark: #6E0C1F;
  --gold: #B8925A;
  --cream: #FBF6EE;

  /* טקסט רגיל בגופן של הטלפון, וכותרות, ברכות ותוויות בכתב יד שמתאים לציור */
  --font: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-hand: 'Playpen Sans Hebrew', system-ui, sans-serif;

  --tabbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button { font: inherit; color: inherit; }

.app {
  max-width: 560px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.press { transition: transform .12s var(--ease); }
.press:active { transform: scale(.94); }

/* ---------- מסך פתיחה ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.splash-logo { width: min(220px, 60vw); height: auto; opacity: 0; }
.splash-hello {
  margin: 28px 0 8px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1.1;
}
.splash-hello .w { display: inline-block; opacity: 0; }
.splash-hello .name { color: var(--accent); }
.splash-line { margin: 0; font-size: 19px; color: var(--muted); max-width: 26ch; opacity: 0; }

/* ---------- סרגל עליון ---------- */

.topbar {
  position: relative;
  z-index: 5;
  flex: none;
  padding: calc(env(safe-area-inset-top) + 6px) 16px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-btn { width: 40px; height: 40px; flex: none; }
.logo-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.topbar-logo { height: 42px; width: auto; display: block; }

.avatar {
  border-radius: 50%;
  border: 2px solid var(--ink);
  padding: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.avatar svg { width: 20px; height: 20px; }
.avatar-lg { width: 64px; height: 64px; flex: none; cursor: default; }
.avatar-lg svg { width: 30px; height: 30px; }

/* ---------- המסכים והחלקה ---------- */

.pager { flex: 1; overflow: hidden; position: relative; touch-action: pan-y; }
.track { display: flex; height: 100%; will-change: transform; }
.panel {
  flex: 0 0 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 4px 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px);
}

/* אלמנטים שנכנסים אחד אחרי השני אחרי מסך הפתיחה */
.rise { opacity: 0; transform: translateY(18px); }
.risen .rise { animation: rise .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- מסך הבית ---------- */

.today-date { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.hi { font-size: 46px; font-weight: 800; letter-spacing: -1px; line-height: 1.05; margin: 2px 0 30px; }
.hi .name { color: var(--accent); }

.section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--muted);
  margin: 0 0 10px;
}

/* כרטיס כניסה לפעילות, עם חורים בצדדים וקו מחורר */
.ticket-wrap { position: relative; margin: 0 4px 44px; transform: rotate(-2deg); }
.ticket {
  --cut: 31%;
  position: relative;
  display: grid;
  grid-template-columns: 69% 31%;
  background: var(--accent);
  color: var(--cream);
  border-radius: 18px;
  min-height: 172px;
  -webkit-mask:
    radial-gradient(circle 13px at var(--cut) 0, #0000 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 13px at var(--cut) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
          mask:
    radial-gradient(circle 13px at var(--cut) 0, #0000 97%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle 13px at var(--cut) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
}
.ticket::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: var(--cut);
  border-left: 2px dashed rgba(251, 246, 238, .45);
}
.ticket-main { padding: 18px 20px 22px; }
.ticket-kicker { font-size: 13px; opacity: .8; }
.ticket-title { font-size: 26px; font-weight: 800; line-height: 1.1; margin: 4px 0 8px; }
.ticket-meta { font-size: 15px; opacity: .9; }
.ticket-stub { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 22px; text-align: center; }
.ticket-days { font-size: 54px; font-weight: 800; line-height: .9; }
.ticket-days-label { font-size: 14px; opacity: .85; }

.stamp {
  position: absolute;
  bottom: 18px;
  right: 37%;
  padding: 6px 14px;
  border: 3px solid var(--cream);
  border-radius: 10px;
  color: var(--cream);
  font-size: 22px;
  font-weight: 900;
  transform: rotate(-14deg);
  opacity: 0;
  pointer-events: none;
}
.stamp.on { animation: stamp .45s var(--spring) forwards; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-14deg) scale(2.4); }
  to { opacity: .95; transform: rotate(-14deg) scale(1); }
}
.ticket.thud { animation: thud .35s var(--ease); }
@keyframes thud { 30% { transform: scale(.96); } }

/* כפתור "אני באה" כמו מדבקה עגולה על פינת הכרטיס */
.join {
  position: absolute;
  bottom: -38px;
  left: 12px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--cream);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  transform: rotate(8deg);
  cursor: pointer;
  box-shadow: 0 5px 0 #000;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .25s;
}
.join:active { transform: rotate(8deg) translateY(4px); box-shadow: 0 1px 0 #000; }
.join.done { background: var(--gold); box-shadow: 0 5px 0 #7d6034; }

/* היום שלי: ציר זמן, בלי קופסה */
.timeline { list-style: none; margin: 0 0 40px; padding: 0 22px 0 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  right: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--ink);
  opacity: .15;
}
.timeline li { position: relative; padding: 0 0 18px; }
.timeline li::before {
  content: "";
  position: absolute;
  right: -21px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
}
.timeline li:first-child::before { background: var(--accent); }
.tl-when { font-size: 13px; color: var(--muted); }
.tl-what { font-size: 19px; font-weight: 700; }

/* המבצע: מספר גדול וקו גלי שמתמלא */
.mission { margin-bottom: 20px; }
.mission-num { font-size: 64px; font-weight: 800; line-height: 1; color: var(--accent); letter-spacing: -2px; }
.mission-num small { font-size: 22px; color: var(--muted); letter-spacing: 0; font-weight: 700; }
.mission-name { font-size: 19px; font-weight: 700; margin: 2px 0 10px; }
.wave { display: block; width: 100%; height: 26px; overflow: visible; }
.wave path { fill: none; stroke-width: 6; stroke-linecap: round; }
.wave .bg { stroke: var(--ink); opacity: .1; }
.wave .fg { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.6s var(--ease) .3s; }

/* ---------- החדר המצויר ---------- */

#panel-home { padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.scene { position: relative; width: 100%; aspect-ratio: 768 / 1376; overflow: hidden; cursor: pointer; }
.scene-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene .layer { position: absolute; height: auto; pointer-events: none; will-change: transform; }
/* הברכה כתובה כאילו צוירה על התקרה: גופן כתב יד, צבע הדיו החום של קווי הציור, קצת עקומה */
.scene-greet { position: absolute; top: 3%; left: 0; right: 0; text-align: center; z-index: 2; pointer-events: none; }
.scene-date { font-family: var(--font-hand); font-weight: 500; font-size: 15px; color: #8A6A55; }
.scene-hi {
  font-family: var(--font-hand); font-weight: 800; font-size: 36px; line-height: 1.15; color: #4A2C1A;
  transform: rotate(-1.5deg); display: inline-block;
}
.scene-hi .name { color: #8E1B2E; }
.cord { position: absolute; overflow: visible; pointer-events: none; }
.cord line { transform-origin: 7px 0; transform-box: view-box; }
.door-gap { position: absolute; background: #2A1A10; border-radius: 2px; }

.night { position: absolute; background: #24305C; mix-blend-mode: multiply; opacity: 0; transition: opacity .6s; pointer-events: none; }
.night.on { opacity: 1; }
.night i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #FFFFFF; }
/* אור קוזי: החדר מחשיך, עם חום עדין. ליד המנורה קצת יותר אור, והפינות כהות יותר */
.cozy {
  position: absolute; inset: 0; z-index: 1; mix-blend-mode: multiply; opacity: 0; transition: opacity 1s; pointer-events: none;
  background: radial-gradient(ellipse 75% 55% at 88% 54%, #E2C4A2 0%, #A88C78 55%, #6E5C55 100%);
}
.cozy.on { opacity: 1; }
.switch { position: absolute; pointer-events: none; overflow: visible; }
.switch rect { transition: y .15s; }
.glow {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(ellipse at 60% 25%, rgba(255, 220, 130, .55), rgba(255, 220, 130, 0) 65%);
}
.glow.on { opacity: 1; }
.tick { position: absolute; overflow: visible; pointer-events: none; }
.tick path { fill: none; stroke: #4A2C1A; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.tick.draw path { animation: drawtick .45s ease-out forwards; }
@keyframes drawtick { to { stroke-dashoffset: 0; } }

.tip {
  position: absolute; z-index: 5; transform: translate(-50%, -100%);
  background: var(--ink); color: var(--cream); font-size: 14px; font-weight: 700;
  padding: 5px 12px; border-radius: 12px; white-space: nowrap; pointer-events: none; opacity: 0;
}
.tip.show { animation: tip 1.3s var(--ease) forwards; }
@keyframes tip {
  0% { opacity: 0; transform: translate(-50%, -80%) scale(.8); }
  15%, 75% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -115%) scale(1); }
}

/* מסכים שעוד לא נבנו */
.screen-title { font-size: 40px; font-weight: 800; letter-spacing: -.5px; margin: 14px 0 8px; }
.soon { color: var(--muted); font-size: 18px; max-width: 26ch; }

/* ---------- סרגל תחתון ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  max-width: 560px;
  margin: 0 auto;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 2px solid rgba(43, 26, 26, .08);
  display: flex;
}
.tab-indicator {
  position: absolute;
  top: 0;
  right: 0;
  height: 3px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
}
.tab-indicator span { width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 11px;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color .2s;
}
/* אייקונים מצוירים: הטאב הפעיל בצבע מלא ומורם קצת, השאר דהויים */
.tab-img { width: 30px; height: 30px; object-fit: contain; opacity: .55; filter: saturate(.5); transition: transform .35s var(--spring), opacity .25s, filter .25s; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] .tab-img { opacity: 1; filter: none; transform: translateY(-2px) scale(1.15); }

/* ---------- חגיגה ---------- */

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(251, 246, 238, .82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.celebrate[hidden] { display: none; }
.celebrate-box { text-align: center; }
.celebrate-big { font-size: 44px; font-weight: 900; color: var(--accent); letter-spacing: -1px; line-height: 1.05; }
.celebrate-box p { margin: 10px 0 0; font-size: 19px; }
.celebrate-box .celebrate-small { font-size: 15px; color: var(--muted); }
.celebrate.show .celebrate-big { animation: boing .6s var(--spring); }
.celebrate.show p { animation: rise .5s var(--ease) both .2s; }
@keyframes boing { from { transform: scale(.3) rotate(-6deg); opacity: 0; } }

/* ---------- קריצת הלחיים ---------- */

.cheers {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 50px);
  left: 50%;
  width: 180px;
  height: 110px;
  margin-left: -90px;
  pointer-events: none;
  z-index: 30;
  border-radius: 28px;
  opacity: 0;
}
.cheers.on { background: #fff; box-shadow: 0 10px 30px rgba(43, 26, 26, .14); }
.cheers > * { position: absolute; }
.cheers .glass { width: 38px; top: 18px; }
.cheers .drop { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); top: 22px; left: 87px; }
.cheers .word { width: 100%; top: 74px; text-align: center; font-size: 22px; font-weight: 800; color: var(--accent); }

/* ---------- חלון הפרופיל ---------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(43, 26, 26, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 21;
  width: min(86vw, 360px);
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 16px) 20px calc(env(safe-area-inset-bottom) + 20px);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
}
.drawer-open .drawer { transform: translateX(0); }
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-close {
  display: flex;
  margin-inline-start: auto;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.drawer-close svg { width: 24px; height: 24px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 20px; }
.profile-name { font-size: 24px; font-weight: 800; }
.profile-sub { color: var(--muted); font-size: 15px; }

/* ---------- פס עדכון גרסה ---------- */

.update-bar {
  flex: none;
  margin: 4px 16px 8px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.update-bar[hidden] { display: none; }
.update-bar button {
  font-weight: 700;
  background: var(--cream);
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}

/* כל הטקסטים "המצוירים" באותו כתב יד: ברכות, כותרות, תוויות וחגיגות */
.tip, .splash-hello, .splash-line, .screen-title, .celebrate-big, .cheers .word, .profile-name, .tab span { font-family: var(--font-hand); }

/* ---------- גלריה ---------- */

#panel-gallery {
  background: url(scene/cork.jpg) center top / 100% auto repeat-y, #D29A62;
  border-top: 7px solid #C9975E;
  box-shadow: inset 0 6px 0 #8E623C;
}
.gal-title { color: #4A2C1A; text-align: center; margin-top: 18px; }
.gal-empty { text-align: center; color: #5A3A26; font-family: var(--font-hand); }

/* פסי נייר דבק לסינון */
.tapes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 22px; }
.tape {
  font-family: var(--font-hand); font-size: 14px; font-weight: 600; border: 0; cursor: pointer;
  padding: 6px 14px; color: #6E3A2A; background: #F3DCCB; transform: rotate(var(--r));
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 97% 96%, 3% 100%, 0 50%);
  transition: transform .2s, background .2s;
}
.tape.on { background: #A3132E; color: #FBF6EE; transform: rotate(var(--r)) scale(1.06); }

/* אלבומים: ערימת פולרואידים נעוצה */
.albums { display: grid; grid-template-columns: 1fr 1fr; gap: 34px 18px; padding: 8px 6px 20px; }
.album, .album-new {
  position: relative; border: 0; background: none; cursor: pointer; padding: 0; height: 196px;
  transform: rotate(var(--r, -2deg)); font-family: var(--font-hand); color: #4A2C1A;
}
.album .stack {
  position: absolute; left: 6%; right: 6%; top: 0; height: 150px; background: #FFFCF6;
  padding: 7px 7px 22px; border: 1.5px solid #4A2C1A; border-radius: 3px; box-shadow: 0 3px 4px rgba(60, 30, 10, .25);
}
.album .stack img { width: 100%; height: 100%; object-fit: cover; display: block; border: 1px solid rgba(74, 44, 26, .4); }
.album .s2 { transform: rotate(-8deg); }
.album .s1 { transform: rotate(6deg); }
.album .s0 { transform: rotate(-1deg); }
.album-name { position: absolute; top: 158px; left: 0; right: 0; font-size: 15px; font-weight: 700; text-align: center; line-height: 1.1; }
.album-count { position: absolute; top: 178px; left: 0; right: 0; font-size: 12px; text-align: center; color: #5A3A26; }
.pin {
  position: absolute; top: -8px; left: 50%; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%; z-index: 4;
  border: 1.5px solid #4A2C1A; box-shadow: 1px 2px 0 rgba(60, 30, 10, .3);
}
.album-new {
  height: 150px; margin-top: 4px; background: #FFF6D9; border: 1.5px dashed #4A2C1A; border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 4px rgba(60, 30, 10, .2); --r: 2deg;
}
.album-new b { font-size: 34px; line-height: 1; color: #A3132E; }

/* בתוך אלבום */
.gal-back { font-family: var(--font-hand); font-weight: 600; font-size: 15px; background: #FFF6D9; border: 1.5px solid #4A2C1A; border-radius: 12px; padding: 4px 12px; margin-top: 12px; cursor: pointer; color: #4A2C1A; }
.album-head { text-align: center; margin: 16px 0 4px; }
.washi {
  display: inline-block; font-family: var(--font-hand); font-weight: 800; font-size: 22px; color: #4A2C1A;
  background: #E9C26E; padding: 6px 20px; transform: rotate(-2deg);
  clip-path: polygon(2% 0, 98% 5%, 100% 50%, 98% 95%, 2% 100%, 0 50%);
}
.album-sub { text-align: center; font-family: var(--font-hand); color: #4A2C1A; margin: 6px 0 12px; }
.add-photos {
  display: block; width: max-content; margin: 0 auto 18px; cursor: pointer; font-family: var(--font-hand); font-weight: 700;
  background: #A3132E; color: #FBF6EE; padding: 8px 18px; border-radius: 14px; box-shadow: 0 4px 0 #6E0C1F;
}
.add-photos input { display: none; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; padding: 0 2px 20px; }
.pol {
  position: relative; border: 1.3px solid #4A2C1A; background: #FFFCF6; padding: 4px 4px 13px; border-radius: 2px; cursor: pointer;
  transform: rotate(var(--r)); box-shadow: 0 2px 3px rgba(60, 30, 10, .25); transition: transform .15s;
}
.pol:active { transform: rotate(var(--r)) scale(.94); }
.pol img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pol .liked { position: absolute; bottom: 0; left: 5px; color: #8A6A55; font-family: var(--font-hand); font-weight: 700; font-size: 11px; line-height: 13px; }
.pol .liked.mine { color: #A3132E; }

/* חלון יצירת אלבום */
.sheet-back { position: fixed; inset: 0; z-index: 40; background: rgba(43, 26, 26, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet {
  background: #FFFCF6; border: 1.5px solid #4A2C1A; border-radius: 6px; padding: 24px 20px 18px; width: min(340px, 100%);
  display: flex; flex-direction: column; gap: 14px; font-family: var(--font-hand); color: #4A2C1A; transform: rotate(-1deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}
.sheet .washi { align-self: center; margin-top: -38px; }
.sheet label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.sheet input, .sheet select { font: inherit; font-family: var(--font); border: 1.5px solid #4A2C1A; border-radius: 10px; padding: 8px 10px; background: #fff; }
.sheet-btns { display: flex; gap: 10px; justify-content: flex-end; }
.btn-main, .btn-soft { font-family: var(--font-hand); font-weight: 700; border-radius: 12px; padding: 7px 18px; cursor: pointer; border: 1.5px solid #4A2C1A; }
.btn-main { background: #A3132E; color: #FBF6EE; }
.btn-soft { background: #FBF6EE; color: #4A2C1A; }

/* תמונה בגדול */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(43, 26, 26, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px; }
.viewer[hidden] { display: none; }
.viewer-card { user-select: none; -webkit-user-select: none; cursor: grab; touch-action: none; background: #FFFCF6; border: 2px solid #4A2C1A; padding: 12px 12px 42px; width: min(320px, 82vw); transform: rotate(-1.5deg); position: relative; touch-action: pan-y; }
.viewer-card img { width: 100%; max-height: 62vh; object-fit: contain; display: block; background: #f3eee4; }
.viewer-card span { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-family: var(--font-hand); color: #4A2C1A; font-size: 14px; }
.viewer-btns { display: flex; gap: 12px; }
.v-btn { font-family: var(--font-hand); font-weight: 700; font-size: 15px; border: 1.5px solid #4A2C1A; border-radius: 14px; padding: 9px 18px; background: #FBF6EE; color: #4A2C1A; cursor: pointer; }
.v-btn.on { color: #A3132E; }
.v-btn.main { background: #A3132E; color: #FBF6EE; }
.viewer-close {
  position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #FBF6EE; background: rgba(0, 0, 0, .2); color: #FBF6EE; font-size: 20px; cursor: pointer;
}
.viewer-nav { position: absolute; top: 45%; background: none; border: 0; color: #FBF6EE; font-size: 40px; cursor: pointer; padding: 10px 14px; }
.viewer-nav.prev { right: 0; }
.viewer-nav.next { left: 0; }
.toast {
  position: fixed; bottom: calc(var(--tabbar-h) + 24px); left: 50%; transform: translateX(-50%); z-index: 60;
  background: #2B1A1A; color: #FBF6EE; font-family: var(--font-hand); padding: 9px 16px; border-radius: 14px; white-space: nowrap;
  animation: tip 2.6s var(--ease) forwards;
}

/* ---------- גלריה: מראה מצויר ביד, כמו החדר ----------
   הקווים הישרים מקבלים "רעד" עדין (פילטר hand), והנייר מקבל גרעיניות של גואש */

#panel-gallery {
  background: url(scene/paper.png) 0 0 / 200px, url(scene/cork.jpg) center top / 100% auto repeat-y, #D29A62;
  background-blend-mode: multiply, normal, normal;
}

/* מסגרות הפולרואיד: הקו נמצא בשכבה נפרדת, כך שרק הוא רועד והתמונה נשארת חדה */
.album .stack, .pol, .viewer-card, .album-new, .sheet { border-color: transparent !important; background-image: url(scene/paper-light.png); background-size: 180px; }
.album .stack::after, .pol::after, .viewer-card::after, .album-new::after, .sheet::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1.8px solid #4A2C1A; border-radius: 4px; filter: url(#hand);
}
.album-new::after { border-style: dashed; }
.album .stack img, .pol img { border: 0 !important; }
.album .stack img { outline: 1px solid rgba(74, 44, 26, .45); }
.pol img { box-shadow: inset 0 0 0 1px rgba(74, 44, 26, .4); }

/* נייר דבק ופתקים: קצוות קרועים ורועדים, גרעיניות, וצבע לא אחיד כמו גואש */
.tape, .washi { filter: url(#hand); background-image: url(scene/paper-light.png), linear-gradient(100deg, rgba(255,255,255,.18), rgba(0,0,0,.04) 60%, rgba(255,255,255,.12)); background-size: 120px, 100% 100%; }

/* נעצים: עגולים עם ברק וצל, וקו מצויר */
.pin {
  filter: url(#hand);
  background-image: radial-gradient(circle at 35% 30%, rgba(255,255,255,.65) 0 18%, rgba(255,255,255,0) 30%), radial-gradient(circle at 60% 70%, rgba(0,0,0,.18), rgba(0,0,0,0) 60%) !important;
  border-width: 1.8px !important;
}
/* גם הכפתורים בגלריה מקבלים קו מצויר ונייר */
.gal-back, .add-photos, .v-btn, .btn-main, .btn-soft { position: relative; border-color: transparent !important; background-image: url(scene/paper-light.png); background-size: 140px; }
.gal-back::after, .add-photos::after, .v-btn::after, .btn-main::after, .btn-soft::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border: 1.8px solid #4A2C1A; border-radius: inherit; filter: url(#hand);
}

/* ---------- גלריה: חלקים מצוירים מ-Gemini (מחליפים את הקווים מקוד) ---------- */

/* מסגרת פולרואיד מצוירת: התמונה מאחור, בחלון, והמסגרת מעליה */
.fr { position: relative; display: block; aspect-ratio: var(--ar); }
.fr .ph { position: absolute; left: var(--wl); top: var(--wt); width: var(--ww); height: var(--wh); object-fit: cover; display: block; background: #F3EBDD; }
.fr::after { content: ""; position: absolute; inset: 0; background: var(--f) center / 100% 100% no-repeat; pointer-events: none; }

/* ביטול המסגרות הקודמות שנבנו בקוד */
.album .stack, .pol, .viewer-card { background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; filter: drop-shadow(0 3px 3px rgba(60, 30, 10, .28)); }
.album .stack::after, .pol::after, .viewer-card::after { content: none !important; }
.album .stack.fr::after, .pol .fr::after, .viewer-card .fr::after { content: "" !important; }

/* ערימת האלבום */
.album .stack { position: absolute; left: 8%; right: 8%; top: 0; height: auto; }
.album-name { top: 168px; }
.album-count { top: 188px; }
.album, .album-new { height: 210px; }

/* רשת התמונות באלבום */
.pol { position: relative; }
.pol .liked { bottom: 3%; left: 9%; z-index: 2; }

/* תמונה בגדול */
.viewer-card { width: min(330px, 84vw); }
.viewer-card .fr .ph { object-fit: contain; }
.viewer-card span#viewer-cap { bottom: 7%; z-index: 2; }

/* נעץ מצויר */
img.pin { position: absolute; top: -12px; left: 50%; width: 26px; height: 26px; margin-left: -13px; z-index: 4; border: 0 !important; background: none !important; filter: drop-shadow(1px 2px 1px rgba(60, 30, 10, .35)) !important; }

/* פתק "אלבום חדש" מצויר */
.album-new { background: url(scene/kit/note.png) center / 100% 100% no-repeat !important; border: 0 !important; box-shadow: none !important; height: 160px; filter: drop-shadow(0 3px 3px rgba(60, 30, 10, .25)); }
.album-new::after { content: none !important; }

/* פסי הסינון: נייר דבק מצויר בארבעה צבעים */
.tape { clip-path: none !important; filter: drop-shadow(0 1px 1px rgba(60, 30, 10, .2)) !important; background: url(scene/kit/tape1.png) center / 100% 100% no-repeat !important; color: #4A2C1A !important; padding: 7px 16px; opacity: .7; }
.tape:nth-child(2) { background-image: url(scene/kit/tape2.png) !important; }
.tape:nth-child(3) { background-image: url(scene/kit/tape3.png) !important; }
.tape:nth-child(4) { background-image: url(scene/kit/tape4.png) !important; }
.tape.on { opacity: 1; font-weight: 800; transform: rotate(var(--r)) scale(1.12) translateY(-2px); }

/* כותרת האלבום על נייר דבק חרדל מצויר */
.washi { clip-path: none !important; filter: drop-shadow(0 1px 1px rgba(60, 30, 10, .2)) !important; background: url(scene/kit/tape2.png) center / 100% 100% no-repeat !important; padding: 8px 26px; }
.tapes { gap: 4px; flex-wrap: nowrap; }
.tape { padding: 6px 10px !important; font-size: 13px; white-space: nowrap; }
/* התמונה תמיד בתוך חלון המסגרת (גובר על הכללים הישנים) */
.fr .ph, .album .stack .ph, .pol .fr .ph, .viewer-card .fr .ph {
  position: absolute !important; left: var(--wl) !important; top: var(--wt) !important;
  width: var(--ww) !important; height: var(--wh) !important; max-height: none !important; outline: 0 !important; box-shadow: none !important; aspect-ratio: auto !important;
}
.fr::before { content: ""; position: absolute; left: var(--wl); top: var(--wt); width: var(--ww); height: var(--wh); background: #F3EBDD; }

/* ---------- ביטול התיקון הקודם: בלי קווים כהים רועדים ובלי גרעיניות חזקה על השעם ---------- */
#panel-gallery { background: url(scene/cork.jpg) center top / 100% auto repeat-y, #D29A62 !important; background-blend-mode: normal !important; }
.gal-back::after, .add-photos::after, .v-btn::after, .btn-main::after, .btn-soft::after, .sheet::after { content: none !important; }
.gal-back, .add-photos, .v-btn, .btn-main, .btn-soft { background-image: none !important; border-color: transparent !important; }
.gal-back, .v-btn, .btn-soft { background-color: #FFF6D9 !important; box-shadow: 0 3px 0 rgba(74, 44, 26, .25); }
.sheet { border-color: transparent !important; background-image: none !important; }

/* תמונה בגדול: הכרטיס תמיד נכנס במסך, והאיקס תמיד מעליו */
.viewer-close { z-index: 5; }
.viewer-card { z-index: 1; width: min(330px, 84vw, calc((100dvh - 230px) * 292 / 340)) !important; }
/* המסגרת בכרטיס התמונה הגדולה נשארת במקומה (כלל ישן מיקם כל span בכרטיס) */
.viewer-card span.fr { position: relative !important; inset: auto !important; display: block; }
/* בערימת האלבום הפולרואיד עצמו הוא המסגרת המצוירת: בלי קו כהה נוסף מעליו */
.fr::after, .album .stack.fr::after { border: 0 !important; filter: none !important; border-radius: 0 !important; }
.album .stack.fr, .pol, .viewer-card { outline: 0 !important; }
/* הכיתוב יושב ברצועת הנייר שמתחת לתמונה, ונמדד לפי רוחב האלבום כדי שלא יעלה על התמונה בשום מסך */
.album, .album-new { height: auto; aspect-ratio: 1 / 1.03; container-type: inline-size; }
.album-name, .album-count { left: 12%; right: 12%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-name { top: 79cqw; font-size: clamp(12px, 6.4cqw, 15px); line-height: 1.15; }
.album-count { top: 88.5cqw; font-size: clamp(10px, 5cqw, 12px); line-height: 1.15; }

/* ---------- החלון לפי השעה ---------- */
.sky { position: absolute; pointer-events: none; -webkit-mask: url(scene/sky-mask.png) 0 0 / 100% 100% no-repeat; mask: url(scene/sky-mask.png) 0 0 / 100% 100% no-repeat; }
.sky-tint { mix-blend-mode: multiply; opacity: 0; transition: opacity 3s; }
/* בבוקר ובשקיעה הצבע נצבע מעל השמיים (לא מכפיל), אחרת הכחול הופך אפור */
.sky-tint[data-for="morning"] { mix-blend-mode: normal; background: linear-gradient(rgba(255, 214, 196, 0) 42%, rgba(255, 200, 186, .5) 72%, rgba(255, 190, 160, .78)); }
.sky-tint[data-for="sunset"] { mix-blend-mode: normal; background: linear-gradient(rgba(206, 160, 206, .72), rgba(246, 170, 140, .76) 55%, rgba(255, 204, 140, .82)); }
.sky-tint[data-for="night"] { background: linear-gradient(#1E2650, #3A4A82); }
.scene[data-phase="morning"] .sky-tint[data-for="morning"],
.scene[data-phase="sunset"] .sky-tint[data-for="sunset"],
.scene[data-phase="night"] .sky-tint[data-for="night"] { opacity: 1; }
.sky-fx { overflow: hidden; }
.sky-fx i, .sky-fx .moon { opacity: 0; transition: opacity 3s; }
.scene[data-phase="night"] .sky-fx i { opacity: .9; animation: twinkle 3.4s ease-in-out var(--d, 0s) infinite; }
.scene[data-phase="night"] .sky-fx .moon { opacity: 1; }
.sky-fx i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #FFF8E6; }
.sky-fx .moon { position: absolute; right: 16%; top: 14%; width: 14%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset -5px 2px 0 0 #FBF0CF; transform: rotate(-20deg); }
@keyframes twinkle { 50% { opacity: .35; } }
/* ציפורים חולפות מימין לשמאל, מנפנפות לאט */
.bird { position: absolute; right: -14%; width: 13%; animation: fly 3.8s cubic-bezier(.4,0,.6,1) forwards; }
.bird.small { width: 9%; animation-delay: .35s; right: -20%; }
.bird svg { display: block; overflow: visible; animation: flap .5s ease-in-out infinite alternate; transform-origin: center 60%; }
.bird path { fill: none; stroke: #4A2C1A; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes fly { to { transform: translate(-900%, -60%); } }
@keyframes flap { to { transform: scaleY(-.5); } }
.bird.small { animation-name: fly2; }
@keyframes fly2 { to { transform: translate(-1300%, -40%); } }
/* לחיצה בלילה: הירח זוהר והכוכבים מנצנצים אחד אחרי השני */
.sky-fx .moon { transition: opacity 3s, filter 1.2s; }
.sky-fx.wave .moon { filter: drop-shadow(0 0 6px rgba(255, 244, 210, .95)); }
.scene[data-phase="night"] .sky-fx.wave i { animation: wave 2.4s ease-in-out calc(var(--x) * 1.2s) 1; }
@keyframes wave { 0%, 100% { transform: scale(1); opacity: .9; } 40% { transform: scale(2.2); opacity: 1; box-shadow: 0 0 6px 2px rgba(255, 248, 230, .8); } }

/* חץ חזרה לבית, בכל מסך חוץ מהבית */
.home-back { position: absolute; top: 12px; right: 12px; z-index: 6; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #FFFCF6; box-shadow: 0 2px 6px rgba(60, 30, 10, .22); display: grid; place-items: center; cursor: pointer; padding: 0; }
.home-back svg { width: 20px; height: 20px; }
.home-back path { fill: none; stroke: #4A2C1A; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.panel:has(.gal-album) .home-back { display: none; }
.panel { position: relative; }

/* ---------- החת"ת היומי: חצי מסך שעולה מהספר ---------- */
.ch-back { position: fixed; inset: 0; z-index: 45; background: rgba(43, 26, 26, .42); opacity: 0; transition: opacity .3s; }
.ch-back.on { opacity: 1; }
.ch-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; max-width: 560px; margin: 0 auto;
  height: 64dvh; display: flex; flex-direction: column; background: #FFFBF4; border-radius: 22px 22px 0 0;
  box-shadow: 0 -6px 22px rgba(60, 30, 10, .2); padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform .35s var(--ease), height .35s var(--ease); color: #4A2C1A;
}
.ch-sheet.on { transform: translateY(0); }
.ch-sheet.reading { height: 88dvh; }
.ch-grip { padding: 10px 0 6px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.ch-grip span { width: 44px; height: 5px; border-radius: 3px; background: #DCCBB5; }
.ch-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 10px; }
.ch-sheet.reading .ch-head { display: none; }
.ch-title { font-size: 20px; }
.ch-date { font-family: var(--font-hand); font-size: 13px; color: #8A6A55; margin-top: 8px; padding-right: 6px; }
/* הרצף: תווית על נייר דבק ורוד, כמו הכותרת. כשיום נגמר היא "נדבקת" מחדש */
.ch-streak { display: flex; align-items: baseline; gap: 6px; padding: 9px 18px 8px; transform: rotate(3deg);
  background: url(scene/kit/tape1.png) center / 100% 100% no-repeat; filter: drop-shadow(0 1px 1px rgba(60, 30, 10, .2)); }
.ch-streak b { font-family: var(--font-hand); font-weight: 800; font-size: 28px; line-height: 1; color: #5E1420; }
.ch-streak span { font-family: var(--font-hand); font-weight: 700; font-size: 13px; color: #5E1420; white-space: nowrap; }
.ch-streak.zero { visibility: hidden; }   /* "0 ימים ברצף" לא מראים: הרצף מופיע מהיום הראשון */
.ch-streak.grow { animation: ch-stick .8s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes ch-stick { 0% { transform: rotate(-6deg) scale(1.35); opacity: 0; } 55% { transform: rotate(4deg) scale(.96); opacity: 1; } 100% { transform: rotate(3deg) scale(1); } }
.ch-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 18px; }
.ch-wait { text-align: center; font-family: var(--font-hand); color: #8A6A55; margin-top: 30px; display: grid; gap: 12px; justify-items: center; }
/* רשימת החלקים: תיבות סימון כמו על הלוח בחדר */
.ch-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1.5px solid rgba(74, 44, 26, .1); }
.ch-row:last-child { border-bottom: 0; }
.ch-box { width: 30px; height: 30px; flex: none; border: 2px solid #4A2C1A; border-radius: 8px; background: #fff; padding: 3px; cursor: pointer; }
.ch-box svg { width: 100%; height: 100%; overflow: visible; display: block; }
.ch-box path { fill: none; stroke: #A3132E; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .4s ease-out; }
.ch-row.done .ch-box path { stroke-dashoffset: 0; }
.ch-open { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; background: none; border: 0; padding: 0; text-align: right; cursor: pointer; color: inherit; }
.ch-name { font-family: var(--font-hand); font-weight: 700; font-size: 17px; color: #4A2C1A; }
.ch-sub { font-size: 13px; color: #8A6A55; }
.ch-arrow { font-size: 22px; color: #B9A592; }
.ch-row.done .ch-name { color: #8A6A55; }
/* קריאה: הטקסט גדול וברור */
.ch-reader-head { position: sticky; top: 0; z-index: 1; background: #FFFBF4; display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; border-bottom: 1.5px solid rgba(74, 44, 26, .1); }
.ch-backbtn { font-family: var(--font-hand); font-weight: 600; font-size: 14px; background: #FFF6D9; border: 1.5px solid #4A2C1A; border-radius: 12px; padding: 4px 12px; cursor: pointer; color: #4A2C1A; flex: none; }
.ch-text { padding-top: 10px; }
.ch-verse { font-size: 19px; line-height: 1.95; color: #2B1A1A; margin: 0 0 6px; }
.ch-verse b { font-family: var(--font-hand); font-size: 13px; color: #A3132E; margin-left: 4px; }
.ch-rashi { font-size: 15px; line-height: 1.85; color: #6B5A4A; margin: 0 0 14px; padding-right: 10px; border-right: 2px solid #E8D6C0; }
.ch-rashi span { font-family: var(--font-hand); font-weight: 700; color: #A3132E; margin-left: 4px; }
.ch-chapter { font-family: var(--font-hand); font-weight: 700; font-size: 17px; margin: 16px 0 6px; color: #4A2C1A; }
.ch-para { font-size: 18px; line-height: 1.9; color: #2B1A1A; margin: 0 0 12px; }
.ch-link { display: inline-block; text-decoration: none; margin-top: 4px; }
.ch-said { position: sticky; bottom: 0; width: 100%; margin-top: 16px; font-size: 17px; padding: 12px; box-shadow: 0 -10px 14px #FFFBF4; }
.ch-said.done { background: #6E8F4E; }

/* ספר המצוות: משפט בכל שורה */
.ch-line { font-size: 17px; line-height: 1.8; color: #2B1A1A; margin: 0 0 10px; }

/* ---------- מגדל פופים: אותו חצי מסך של החת"ת ---------- */
/* הכותרת במשחק = חזרה לתפריט, עם חץ */
.gm-title { border: 0; cursor: default; }
.gm-title.back { cursor: pointer; }
.gm-title.back::before { content: '›'; font-weight: 800; margin-left: 6px; }
/* בלי הגדלה בלחיצה כפולה בשום מקום בחלון המשחק */
:where(.gm-sheet, .gm-sheet *) { touch-action: manipulation; }
.gm-stage { position: relative; flex: 1; touch-action: none; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
.gm-stage canvas { position: absolute; inset: 0; }
.gm-score { position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-family: var(--font-hand); font-weight: 800; font-size: 40px; color: #4A2C1A; opacity: .85; pointer-events: none; }
.gm-score.pop { animation: ch-stick .5s cubic-bezier(.3, 1.3, .5, 1); }
.gm-msg { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
  background: #FFFBF4; border: 1.5px solid #4A2C1A; border-radius: 16px; padding: 14px 22px; text-align: center; display: grid; gap: 4px; box-shadow: 0 4px 14px rgba(60, 30, 10, .18); min-width: 200px; }
.gm-msg.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gm-msg b { font-family: var(--font-hand); font-weight: 800; font-size: 24px; color: #A3132E; }
.gm-msg span { font-family: var(--font-hand); font-weight: 600; font-size: 15px; color: #4A2C1A; }
.gm-msg small { font-size: 12px; color: #8A6A55; margin-top: 4px; }
.gm-best { visibility: visible !important; }
/* קומבו: "×2" ליד הניקוד, קופץ פנימה ונעלם */
.gm-combo { position: absolute; top: 14px; left: calc(50% + 34px); font-family: var(--font-hand); font-weight: 800; font-size: 22px; color: #A3132E; opacity: 0; pointer-events: none; }
.gm-combo.on { animation: gm-combo 1.1s ease-out forwards; }
@keyframes gm-combo { 0% { opacity: 0; transform: scale(.4) rotate(-10deg); } 18% { opacity: 1; transform: scale(1.25) rotate(4deg); } 35% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.gm-combo { direction: ltr; }

/* בחירת משחק בכרטיס */
.gm-msg:has(button) { pointer-events: auto; }
.gm-pick { display: grid; gap: 2px; text-align: right; background: #FFF6D9; border: 1.5px solid #4A2C1A; border-radius: 14px; padding: 10px 14px; margin-top: 8px; cursor: pointer; color: #4A2C1A; }
.gm-pick strong { font-family: var(--font-hand); font-weight: 800; font-size: 18px; color: #A3132E; }
.gm-pick span { font-size: 13px; color: #6B4A36; }
.gm-best.gm-hide { visibility: hidden !important; }
.gm-msg:has(.gm-pick) { min-width: 250px; }

/* ---------- פעילויות: כרטיסים מצוירים, רצועת שבוע, חותמות ---------- */
.act-list, .act-page { padding-bottom: 20px; }
/* רצועת השבוע: על רצועת הנייר הקרועה */
.act-week { display: flex; justify-content: space-around; align-items: flex-start; margin: 2px -4px 16px; padding: 10px 14px 22px;
  background: url(scene/act/strip.png) center / 100% 100% no-repeat; font-family: var(--font-hand); color: #4A2C1A; }
.act-day { display: grid; justify-items: center; gap: 1px; min-width: 32px; padding: 3px 0 4px; border-radius: 12px; position: relative; }
.act-day span { font-size: 11px; color: #8A6A55; }
.act-day b { font-size: 16px; font-weight: 700; }
.act-day.today { background: #4A2C1A; color: #FBF6EE; }
.act-day.today span { color: #E9D8C2; }
.act-day.has::after { content: ""; position: absolute; bottom: -7px; width: 6px; height: 6px; border-radius: 50%; background: #A3132E; }
.act-group { font-family: var(--font-hand); font-weight: 700; font-size: 15px; color: #8A6A55; margin: 14px 4px 6px; }
/* כרטיס פעילות: התמונה המצוירת, הספח (מימין) עם התאריך, והתוכן משמאלו */
.act-ticket { position: relative; display: block; width: 100%; aspect-ratio: 301 / 150; margin: 0 0 12px; cursor: pointer;
  background: url(scene/act/ticket-pink.png) center / 100% 100% no-repeat; transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 2px 3px rgba(60, 30, 10, .18)); color: #4A2C1A; -webkit-tap-highlight-color: transparent; }
.act-ticket.green { background-image: url(scene/act/ticket-green.png); }
.act-ticket.yellow { background-image: url(scene/act/ticket-yellow.png); }
.act-ticket.past { opacity: .62; filter: grayscale(.35) drop-shadow(0 2px 3px rgba(60, 30, 10, .12)); }
.act-stub { position: absolute; right: 3%; top: 8%; bottom: 8%; width: 20%; display: grid; place-content: center; justify-items: center; text-align: center; font-family: var(--font-hand); color: #3A2418; }
.act-stub span { font-size: 12px; font-weight: 600; }
.act-stub b { font-size: 30px; font-weight: 800; line-height: 1; margin: 1px 0; }
.act-main { position: absolute; right: 27%; left: 10%; top: 13%; bottom: 12%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; }
.act-title { font-family: var(--font-hand); font-weight: 800; font-size: 18px; line-height: 1.15; }
.act-meta { font-size: 12.5px; color: #7A5A45; }
.act-go { margin-top: 6px; font-family: var(--font-hand); font-weight: 700; font-size: 14px; background: #A3132E; color: #FBF6EE; border: 1.5px solid #4A2C1A; border-radius: 14px; padding: 4px 14px; cursor: pointer; }
.act-chip { margin-top: 6px; font-family: var(--font-hand); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 12px; }
.act-chip.count { background: #FFF1C9; border: 1.5px dashed #B98A3E; color: #6B4A16; }
.act-chip.album { background: #FFF6D9; border: 1.5px solid #4A2C1A; }
/* חותמות מדיו בורדו, עם הכיתוב בתוכן */
.act-stamp { position: absolute; display: grid; place-items: center; background: url(scene/act/stampRect.png) center / 100% 100% no-repeat; pointer-events: none; }
.act-stamp i { font-style: normal; font-family: var(--font-hand); font-weight: 800; color: #7E1830; text-align: center; line-height: 1.05; }
.act-stamp.small { left: 7%; top: 16%; width: 30%; aspect-ratio: 256 / 177; transform: rotate(-8deg); opacity: .9; }
.act-stamp.small i { font-size: 13px; transform: rotate(-10deg); }
/* מדבקת "חדש!" */
.act-new { position: absolute; top: -10px; left: -6px; width: 46px; aspect-ratio: 1; display: grid; place-items: center; background: url(scene/act/new.png) center / contain no-repeat; transform: rotate(-14deg); }
.act-new i { font-style: normal; font-family: var(--font-hand); font-weight: 800; font-size: 12px; color: #4A2C1A; }
/* עמוד פעילות */
.act-page .gal-back { margin-bottom: 14px; }
.act-ticket.big { cursor: default; }
.act-ticket.big .act-title { font-size: 22px; }
.act-desc { font-size: 16px; line-height: 1.7; color: #4A2C1A; margin: 4px 4px 14px; }
.act-rows { display: grid; gap: 10px; margin: 0 4px 18px; }
.act-row { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.55; color: #2B1A1A; }
.act-row img { width: 30px; height: 30px; object-fit: contain; flex: none; margin-top: 1px; }
.act-row span { display: block; font-family: var(--font-hand); font-weight: 700; font-size: 13px; color: #8A6A55; }
.act-cta { display: grid; justify-items: center; margin-top: 6px; }
.act-big { font-size: 20px; padding: 12px 40px; border-radius: 22px; box-shadow: 0 3px 0 #6E0E20; }
.act-note { font-family: var(--font-hand); color: #8A6A55; }
.act-in { display: grid; justify-items: center; gap: 4px; font-family: var(--font-hand); color: #4A2C1A; }
.act-in .act-stamp { position: relative; width: 150px; aspect-ratio: 1; background-image: url(scene/act/stampRound.png); transform: rotate(-10deg); }
.act-in .act-stamp i { font-size: 17px; }
.act-in b { font-size: 22px; font-weight: 800; color: #A3132E; }
.act-in small { font-size: 13px; color: #8A6A55; }
/* חלון ההרשמה: מחזיקים את הכפתור עד שמתמלא */
.hold-sheet { height: auto; max-height: 70dvh; }
.hold-body { padding: 4px 22px 26px; display: grid; gap: 14px; justify-items: center; text-align: center; color: #4A2C1A; }
.hold-what { display: grid; gap: 4px; }
.hold-what b { font-family: var(--font-hand); font-weight: 800; font-size: 22px; }
.hold-what span { font-size: 14px; color: #7A5A45; }
.hold-stop { display: grid; gap: 6px; font-family: var(--font-hand); font-weight: 700; font-size: 15px; width: 100%; }
.hold-stop select { font: inherit; font-family: var(--font); font-weight: 400; border: 1.5px solid #4A2C1A; border-radius: 12px; padding: 9px 10px; background: #fff; }
.hold-warn { font-size: 13px; color: #8A6A55; margin: 0; }
.hold-btn { position: relative; width: 100%; max-width: 320px; height: 58px; border-radius: 29px; border: 2px solid #4A2C1A; background: #FFF6D9; overflow: hidden; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hold-fill { position: absolute; inset: 0 0 0 auto; width: 0; background: #A3132E; }
.hold-label { position: relative; font-family: var(--font-hand); font-weight: 800; font-size: 18px; color: #4A2C1A; mix-blend-mode: normal; }
.hold-btn.holding { transform: scale(.98); }
.hold-btn.holding .hold-label { color: #FBF6EE; text-shadow: 0 0 6px rgba(74, 44, 26, .5); }
/* החותמת הגדולה שנוחתת אחרי ההרשמה */
.act-celebrate { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(43, 26, 26, .25); }
.act-stamp.huge { position: relative; width: min(64vw, 260px); aspect-ratio: 1; background-image: url(scene/act/stampRound.png); }
.act-stamp.huge i { font-size: clamp(24px, 8vw, 34px); }
.act-celebrate.show .act-stamp.huge { animation: act-stamp .55s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes act-stamp { 0% { transform: scale(2.4) rotate(8deg); opacity: 0; } 60% { transform: scale(.94) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-10deg); } }
.panel:has(.act-page) .home-back { display: none; }
.act-celebrate[hidden] { display: none; }
/* המילוי בחרדל, כדי שהכיתוב החום ייקרא לאורך כל ההחזקה; כשמסיימים הכפתור נצבע בורדו */
.hold-fill { background: #E2B85C; }
.hold-btn.holding .hold-label { color: #4A2C1A; text-shadow: none; }
.hold-btn.done { background: #A3132E; }
.hold-btn.done .hold-fill { background: #A3132E; }
.hold-btn.done .hold-label { color: #FBF6EE; }
/* הכיתוב בתוך החותמת העגולה: קטן מספיק כדי לשבת בתוך הטבעת הפנימית, בלי שהקו יחצה אותו */
.act-in .act-stamp i { font-size: 15px; line-height: 1.1; }
.act-stamp.huge i { font-size: clamp(20px, 6.2vw, 27px); line-height: 1.05; color: #7E1830; }
/* "להזכיר לי שעה לפני": תיבת סימון מצוירת כמו בחת"ת */
.hold-remind { display: flex; align-items: center; gap: 10px; font-family: var(--font-hand); font-weight: 700; font-size: 16px; cursor: pointer; }
.hold-remind input { position: absolute; opacity: 0; pointer-events: none; }
.hold-box { width: 26px; height: 26px; border: 2px solid #4A2C1A; border-radius: 7px; background: #fff; padding: 3px; display: grid; }
.hold-box svg { width: 100%; height: 100%; overflow: visible; }
.hold-box path { fill: none; stroke: #A3132E; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s; }
.hold-remind input:checked + .hold-box path { stroke-dashoffset: 0; }
.act-ticket { aspect-ratio: 904 / 431; }
.update-bar.loading button { display: none; }

/* ---------- כניסה והרשמה ---------- */
.auth { position: fixed; inset: 0; z-index: 70; background: #FBF6EE url(scene/paper-light.png); background-size: 180px; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.auth[hidden] { display: none; }
.auth-card { width: 100%; max-width: 360px; display: grid; justify-items: center; gap: 14px; color: #4A2C1A; }
.auth-logo { width: 190px; margin-bottom: 4px; }
.auth-form { width: 100%; display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 5px; font-family: var(--font-hand); font-weight: 700; font-size: 15px; }
.auth-form input, .auth-form select { font: inherit; font-family: var(--font); font-weight: 400; font-size: 16px; border: 1.5px solid #4A2C1A; border-radius: 12px; padding: 10px 12px; background: #fff; color: #2B1A1A; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-row label[hidden] { display: none; }
.auth-err { min-height: 1.2em; margin: 0; font-size: 14px; color: #A3132E; text-align: center; }
.auth-btn { width: 100%; font-size: 18px; padding: 11px; }
.auth-link { background: none; border: 0; font-family: var(--font-hand); font-weight: 700; font-size: 15px; color: #A3132E; text-decoration: underline; cursor: pointer; }
.auth-text { font-family: var(--font-hand); font-size: 18px; text-align: center; line-height: 1.6; margin: 0; }
#logout-btn { margin-top: 18px; }

/* ---------- ניהול ---------- */
.adm-sheet { height: 88dvh; }
.adm-x { margin-inline-start: auto; background: none; border: 0; font-size: 20px; color: #4A2C1A; cursor: pointer; }
.adm-tabs { margin: 0 0 6px; padding: 0 16px; }
.adm-list { display: grid; gap: 4px; }
.adm-row { display: flex; align-items: center; gap: 8px; padding: 10px 2px; border-bottom: 1.5px solid rgba(74, 44, 26, .1); transition: opacity .3s, transform .3s; }
.adm-row.gone { opacity: 0; transform: translateX(20px); }
.adm-who { flex: 1; display: grid; }
.adm-who b { font-family: var(--font-hand); font-weight: 700; font-size: 16px; color: #4A2C1A; }
.adm-who span { font-size: 13px; color: #8A6A55; }
.adm-row .btn-main, .adm-row .btn-soft { padding: 5px 12px; font-size: 14px; }
.adm-form textarea { font: inherit; font-family: var(--font); font-weight: 400; font-size: 16px; border: 1.5px solid #4A2C1A; border-radius: 12px; padding: 10px 12px; background: #fff; resize: vertical; }
.adm-form .auth-row[hidden], .adm-form label[hidden] { display: none; }
.adm-check { display: flex !important; align-items: center; gap: 8px; }
.adm-check input { width: 20px; height: 20px; }
.adm-act { border: 1.5px solid rgba(74, 44, 26, .18); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.adm-act summary { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; cursor: pointer; list-style: none; }
.adm-act summary::-webkit-details-marker { display: none; }
.adm-act summary b { font-family: var(--font-hand); font-weight: 700; font-size: 16px; color: #4A2C1A; }
.adm-act summary span { grid-column: 1; font-size: 13px; color: #8A6A55; }
.adm-act summary em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: normal; font-family: var(--font-hand); font-weight: 700; color: #A3132E; }
.adm-act ol { margin: 10px 0 6px; padding-inline-start: 22px; line-height: 1.8; }
.adm-act small { color: #8A6A55; }
.adm-del { margin-top: 6px; background: none; border: 0; color: #A3132E; font-size: 13px; text-decoration: underline; cursor: pointer; }
#admin-btn { margin-top: 18px; width: 100%; }
.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .sheet-row[hidden], .sheet-row label[hidden] { display: none; }
.gal-del { display: block; margin: 26px auto 6px; background: none; border: 0; color: #A3132E; font-family: var(--font-hand); font-weight: 700; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* כפתור "לשמירה בטלפון": כלל הרקע הבהיר של הכפתורים כיסה גם אותו, והטקסט הבהיר נעלם */
.v-btn.main { background-color: #A3132E !important; color: #FBF6EE !important; }
.auth-who { margin: 0 0 2px; }
.auth-form .auth-row[hidden] { display: none; }
.auth-who .tape { font-size: 16px !important; padding: 8px 24px !important; }
.auth-bday { grid-template-columns: 1fr 1.4fr; }

/* ---------- טבלת שיאים במשחקונים ---------- */
button.gm-best { border: 0; font: inherit; cursor: pointer; }
.gm-lb-btn { margin-top: 10px; background: #A3132E; color: #FBF6EE; border: 0; border-radius: 14px; padding: 8px 18px; font-family: var(--font-hand); font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 rgba(74, 44, 26, .25); }
.gm-lb { position: absolute; inset: 8px 10px; z-index: 5; background: #FFFCF6; border-radius: 18px; box-shadow: 0 6px 22px rgba(60, 30, 10, .25); padding: 12px 14px; overflow-y: auto; cursor: default; display: flex; flex-direction: column; animation: gm-lb-in .25s ease-out; }
.gm-lb[hidden] { display: none; }
@keyframes gm-lb-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.gm-lb-head { display: flex; align-items: center; justify-content: space-between; }
.gm-lb-head b { font-family: var(--font-hand); font-weight: 800; font-size: 20px; color: #A3132E; }
.gm-lb-head button { background: none; border: 0; font-size: 18px; color: #4A2C1A; cursor: pointer; padding: 4px 8px; }
.gm-lb-tabs { margin: 6px 0 10px; }
.gm-lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gm-lb-list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 12px; font-family: var(--font-hand); font-weight: 700; font-size: 16px; color: #4A2C1A; }
.gm-lb-list li:nth-child(odd) { background: #FBF3E4; }
.gm-lb-list li.me { background: #FCE3E3; outline: 1.5px solid #A3132E; }
.gm-lb-list .p { text-align: center; font-size: 18px; }
.gm-lb-list small { font-weight: 600; font-size: 12px; color: #8A6A55; }
.gm-lb-list b { font-size: 18px; color: #A3132E; }
.gm-lb-note { text-align: center; font-family: var(--font-hand); font-weight: 600; color: #6B4A36; margin: 18px 0; }
.gm-lb-me { text-align: center; font-family: var(--font-hand); font-weight: 800; color: #A3132E; margin: 10px 0 0; }

/* עריכה: שינוי שם אלבום, ועריכת פעילות בניהול */
.album-edit { background: none; border: 0; font-size: 18px; color: #4A2C1A; cursor: pointer; padding: 4px 8px; vertical-align: middle; }
.album-rename { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 0 16px; }
.album-rename input { flex: 1; max-width: 240px; font: inherit; font-family: var(--font-hand); font-weight: 700; font-size: 18px; border: 1.5px solid #4A2C1A; border-radius: 12px; padding: 8px 12px; background: #fff; color: #2B1A1A; text-align: center; }
.album-rename .btn-main { padding: 9px 16px; font-size: 15px; }
.adm-act-btns { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.adm-act-btns .adm-edit { padding: 6px 14px; font-size: 14px; }
.adm-act-btns .adm-del { margin-top: 0; }
