/* מתכוננים לחג — עיצוב ראשי
   פלטה: זהב, כסף, שחור וורוד — יוקרתית ומכובדת (בהנחיית המשתמש, 9.11 23:58)
   כל צמדי הטקסט/רקע נבדקו לניגודיות AA (יחס 4.5+) */
:root{
  --black:#23262b;          /* פחם/אנטרציט — כותרות, טקסט ראשי, רקעי "לילה" */
  --black-2:#3a3e45;        /* גוון פחם שני לגרדיאנטים */
  --ink:#2b2e33;            /* טקסט גוף */
  --ink-soft:#6d6f73;       /* טקסט משני אפור-כסוף */
  --gold:#c2a668;           /* זהב שמפניה מושתק — ראשי */
  --gold-bright:#cfb47e;    /* שמפניה בהירה לגרדיאנט כפתורים */
  --gold-deep:#7d6a3f;      /* זהב כהה לטקסט על לבן */
  --gold-text:#5f5230;      /* טקסט על רקע זהב-רך */
  --gold-soft:#ede3cd;      /* זהב רך */
  --gold-pale:#f8f3e8;      /* רקע זהב חיוור */
  --silver:#d5d2c9;         /* כסף לקווים */
  --silver-pale:#efede5;    /* רקע כסופי לצ'יפים */
  --rose:#b76e79;           /* ורוד מושתק */
  --rose-deep:#96555f;      /* ורוד כהה לטקסט */
  --rose-pale:#f7ecec;      /* רקע ורוד חיוור */
  --bg:#f9f6ef; --card:#fffefb; --line:#e8e4d8;
  --parch:#f4efe2; --ok:#1e7a45; --bad:#b3261e;
  --jewel:#1c6a4e;          /* מרק אזמרגד — הדגשה במינון קטן */
  --jewel-deep:#143c2c;     /* אזמרגד עמוק לגרדיאנטים */
  --jewel-pale:#e9f2ec;     /* רקע מרק חיוור */
  --radius:18px; --shadow:0 2px 14px rgba(35,38,43,.07);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent}
html{scroll-behavior:smooth}
body{margin:0; font-family:'Heebo',system-ui,sans-serif; background:var(--bg); color:var(--ink);
  font-size:16px; line-height:1.65; min-height:100vh}
.bg-ornament{position:fixed; inset:0; pointer-events:none; z-index:0;
  background:radial-gradient(600px 320px at 85% -60px, rgba(194,166,104,.09), transparent 70%),
             radial-gradient(500px 280px at 10% 110%, rgba(183,110,121,.05), transparent 70%)}
button{font-family:inherit; cursor:pointer; border:none}
h1,h2,h3{margin:0; line-height:1.35}
.hidden{display:none!important}

/* פס עליון */
.topbar{position:sticky; top:0; z-index:20; background:rgba(249,246,239,.92); backdrop-filter:blur(10px);
  border-bottom:2px solid var(--gold); }
.topbar-inner{max-width:520px; margin:0 auto; padding:10px 16px; display:flex; align-items:center; gap:10px}
.brand-icon{width:34px; height:34px; color:var(--gold-deep); flex-shrink:0}
.brand-icon svg{width:100%; height:100%}
.brand-text{display:flex; flex-direction:column; line-height:1.2}
.brand-name{font-weight:800; font-size:18px; color:var(--black)}
.brand-sub{font-size:11.5px; color:var(--ink-soft)}

.app{position:relative; z-index:1; max-width:520px; margin:0 auto; padding:14px 16px 96px}

/* כפתורים */
.btn{display:flex; align-items:center; justify-content:center; gap:8px; width:100%;
  padding:13px 18px; border-radius:999px; font-size:16px; font-weight:700;
  background:linear-gradient(135deg,var(--gold-bright),var(--gold)); color:var(--black);
  box-shadow:0 4px 14px rgba(194,166,104,.3); transition:transform .12s, box-shadow .12s}
.btn:active{transform:scale(.98)}
.btn-ghost{background:#fff; color:var(--gold-deep); border:1.5px solid var(--silver); box-shadow:none; font-weight:600}
.btn-small{padding:9px 16px; font-size:14px; width:auto}
.btn[disabled]{opacity:.45; pointer-events:none}

/* כרטיסים */
.card{background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; margin-bottom:14px}
.card-title{font-size:17px; font-weight:700; color:var(--black); margin-bottom:6px}
.muted{color:var(--ink-soft); font-size:13.5px}

/* כרטיס מועד ראשי — שחור יוקרתי עם זהב */
.hero{position:relative; overflow:hidden; border-radius:22px; padding:20px; color:#f7f2e6;
  background:linear-gradient(150deg,#1b1e22,var(--black) 55%,var(--jewel-deep));
  box-shadow:0 8px 24px rgba(27,30,34,.35); margin-bottom:14px}
.hero::after{content:''; position:absolute; inset:0; pointer-events:none; opacity:.5;
  background:radial-gradient(240px 140px at 90% 0%, rgba(237,227,205,.14), transparent 70%)}
.hero-top{display:flex; align-items:center; gap:10px; position:relative}
.hero-icon{width:40px; height:40px; color:var(--gold-soft)}
.hero-icon svg{width:100%; height:100%}
.hero-name{font-size:21px; font-weight:800}
.hero-heb{font-size:13px; opacity:.85}
.hero-count{position:relative; margin:14px 0 4px; display:flex; align-items:baseline; gap:8px}
.hero-count b{font-size:44px; font-weight:800; line-height:1; color:var(--gold-soft)}
.hero-count span{font-size:15px; opacity:.9}
.hero-dates{position:relative; font-size:13px; opacity:.85}
.hero .btn{margin-top:14px; position:relative; background:#fffefa; color:var(--gold-deep); box-shadow:0 4px 12px rgba(0,0,0,.25)}

/* התקדמות */
.progress{height:8px; border-radius:99px; background:var(--silver-pale); overflow:hidden; margin:10px 0 6px}
.progress > i{display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--gold),var(--jewel)); transition:width .3s}
.progress-label{display:flex; justify-content:space-between; font-size:12.5px; color:var(--ink-soft)}

/* רשימת חלקים */
.part-row{display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:12px 14px; margin-bottom:9px; width:100%; text-align:right; transition:border-color .15s}
.part-row:active{border-color:var(--gold)}
.part-row.locked{opacity:.65}
.part-icon{width:38px; height:38px; border-radius:12px; background:var(--jewel-pale); color:var(--jewel);
  display:flex; align-items:center; justify-content:center; flex-shrink:0}
.part-icon svg{width:20px; height:20px}
.part-row.done .part-icon{background:#e9f5ec; color:var(--ok)}
.part-info{flex:1; min-width:0}
.part-name{font-weight:600; font-size:15px}
.part-desc{font-size:12.5px; color:var(--ink-soft)}
.part-check{width:24px; height:24px; border-radius:50%; border:2px solid var(--line); display:flex; align-items:center; justify-content:center; color:#fff; flex-shrink:0}
.part-row.done .part-check{background:var(--ok); border-color:var(--ok)}
.part-check svg{width:14px; height:14px}

/* מסך חלק */
.part-head{margin-bottom:14px}
.chip{display:inline-flex; align-items:center; gap:6px; background:var(--silver-pale); color:var(--black);
  font-size:12px; font-weight:600; padding:4px 12px; border-radius:99px; margin-inline-end:6px; margin-bottom:6px}
.chip.gold{background:var(--gold-soft); color:var(--gold-text)}
.quotebox{background:var(--parch); border-right:4px solid var(--gold); border-radius:12px;
  padding:14px 16px; margin:14px 0; font-family:'Frank Ruhl Libre',serif; font-size:17.5px; line-height:1.8}
.quotebox .src{display:block; margin-top:8px; font-family:'Heebo',sans-serif; font-size:12px; color:var(--ink-soft)}
.biur-note{color:var(--rose-deep); font-size:13px}
.section-h{font-size:16.5px; font-weight:800; color:var(--black); margin:18px 0 8px}
.bodytext{margin:10px 0; font-size:15.5px}
.nice-list{margin:10px 0; padding:0; list-style:none}
.nice-list li{position:relative; padding-inline-start:20px; margin-bottom:8px; font-size:15px}
.nice-list li::before{content:''; position:absolute; right:2px; top:.62em; width:7px; height:7px; border-radius:50%; background:var(--gold)}
.summarybox{background:#f5f1e6; border-radius:14px; padding:14px 16px; margin:16px 0}
.summarybox h4{margin:0 0 10px; font-size:14.5px; color:var(--black)}
.summary-item{display:flex; gap:10px; margin-bottom:10px; font-size:14px}
.summary-item:last-child{margin-bottom:0}
.summary-num{width:22px; height:22px; border-radius:50%; background:var(--jewel); color:#fff;
  font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0}

/* חידון */
.quiz-q{font-size:17px; font-weight:700; margin:6px 0 14px}
.quiz-opt{display:block; width:100%; text-align:right; background:#fff; border:1.5px solid var(--line);
  border-radius:14px; padding:12px 14px; margin-bottom:9px; font-size:15px}
.quiz-opt.selected{border-color:var(--rose); background:var(--rose-pale)}
.quiz-opt.correct{border-color:var(--ok); background:#e9f5ec}
.quiz-opt.wrong{border-color:var(--bad); background:#fdecec}
.quiz-explain{font-size:13.5px; background:var(--rose-pale); border-radius:10px; padding:10px 12px; margin:4px 0 12px; color:var(--ink)}
.quiz-progress{font-size:13px; color:var(--ink-soft); margin-bottom:10px}

/* הגדרות */
.set-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 2px; border-bottom:1px solid var(--line)}
.set-row:last-child{border-bottom:none}
.set-info{flex:1}
.set-name{font-weight:600; font-size:15px}
.set-desc{font-size:12.5px; color:var(--ink-soft)}
.switch{position:relative; width:46px; height:26px; flex-shrink:0}
.switch input{opacity:0; width:100%; height:100%; position:absolute; margin:0; cursor:pointer}
.switch i{position:absolute; inset:0; background:var(--silver); border-radius:99px; transition:.2s; pointer-events:none}
.switch i::after{content:''; position:absolute; top:3px; right:3px; width:20px; height:20px; border-radius:50%; background:#fff; transition:.2s; box-shadow:0 1px 4px rgba(0,0,0,.2)}
.switch input:checked + i{background:var(--gold)}
.switch input:checked + i::after{transform:translateX(-20px)}
input[type="time"]{font-family:inherit; font-size:15px; padding:6px 10px; border:1.5px solid var(--line); border-radius:10px; background:#fff; color:var(--ink)}
.day-chips{display:flex; gap:6px; flex-wrap:wrap; margin-top:8px}
.day-chip{padding:5px 11px; border-radius:99px; border:1.5px solid var(--line); background:#fff; font-size:13px; color:var(--ink-soft)}
.day-chip.on{background:var(--black); border-color:var(--black); color:var(--gold-soft)}
.seg{display:flex; background:var(--silver-pale); border-radius:99px; padding:3px}
.seg button{padding:7px 14px; border-radius:99px; background:transparent; font-size:13.5px; font-weight:600; color:var(--ink-soft)}
.seg button.on{background:var(--black); color:var(--gold-soft)}

/* מועדים */
.moed-row{display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:13px 14px; margin-bottom:10px; width:100%; text-align:right}
.moed-icon{width:40px; height:40px; border-radius:12px; background:var(--jewel-pale); color:var(--jewel); display:flex; align-items:center; justify-content:center; flex-shrink:0}
.moed-icon svg{width:22px; height:22px}
.moed-status{font-size:11.5px; font-weight:700; padding:3px 10px; border-radius:99px; flex-shrink:0}
.st-joined{background:#e9f5ec; color:var(--ok)}
.st-open{background:var(--gold-soft); color:var(--gold-text)}
.st-soon{background:var(--rose-pale); color:var(--rose-deep)}
.st-future{background:#eee; color:#888}

/* הישגים */
.stat-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px}
.stat{background:#fff; border-radius:14px; box-shadow:var(--shadow); padding:14px; text-align:center}
.stat b{display:block; font-size:26px; color:var(--jewel); font-weight:800}
.stat span{font-size:12.5px; color:var(--ink-soft)}
.badge-row{display:flex; gap:10px; flex-wrap:wrap}
.badge{display:flex; flex-direction:column; align-items:center; gap:6px; width:72px; padding:10px 4px; border-radius:14px; background:#fff; box-shadow:var(--shadow); font-size:11px; text-align:center; color:var(--ink-soft)}
.badge .badge-ic{width:34px; height:34px; border-radius:50%; background:var(--jewel-pale); color:var(--jewel); display:flex; align-items:center; justify-content:center}
.badge .badge-ic svg{width:18px; height:18px}
.badge.earned{background:linear-gradient(150deg,#fffbe9,#f7ecc8); color:var(--gold-text)}
.badge.earned .badge-ic{background:var(--jewel); color:#fff}

/* ניווט תחתון */
.bottomnav{position:fixed; bottom:0; left:0; right:0; z-index:30; background:#fff; border-top:1px solid var(--line);
  display:flex; justify-content:center; box-shadow:0 -2px 12px rgba(0,0,0,.05); padding-bottom:env(safe-area-inset-bottom)}
.bottomnav-inner{display:flex; width:100%; max-width:520px}
.navbtn{flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; padding:9px 0 7px; background:none; color:var(--ink-soft); font-size:11px; font-weight:600}
.navbtn svg{width:22px; height:22px}
.navbtn.on{color:var(--jewel)}
.navbtn.on svg{stroke-width:2.2}

/* אונבורדינג */
.welcome-hero{text-align:center; padding:26px 10px 10px}
.welcome-hero .big-icon{width:84px; height:84px; margin:0 auto 10px; color:var(--gold-deep)}
.welcome-hero .big-icon svg{width:100%; height:100%}
.welcome-hero h1{font-size:26px; color:var(--black); font-weight:800}
.join-row{display:flex; align-items:center; gap:12px; background:#fff; border:2px solid var(--line); border-radius:16px; padding:14px; margin-bottom:10px; width:100%; text-align:right}
.join-row.on{border-color:var(--gold); background:var(--gold-pale)}

/* ערב חג — לילה חם בשחור-זהב */
.evening-card{border-radius:18px; padding:16px; margin-bottom:14px; color:#f7f2e6;
  background:linear-gradient(140deg,#1b1e22,#23262b 55%,var(--jewel-deep)); box-shadow:0 6px 18px rgba(27,30,34,.35)}
.evening-card .muted{color:#dfd9c6}
.gold-dot{color:var(--gold-soft); font-weight:800}

/* שונות */
.section-title{font-size:15px; font-weight:800; color:var(--black); margin:20px 0 10px}
.divider-note{text-align:center; font-size:12px; color:var(--ink-soft); margin:16px 0 4px}
.empty-note{background:var(--gold-pale); border-radius:14px; padding:18px; text-align:center; color:var(--ink-soft); font-size:14px}
.toast{position:fixed; bottom:86px; left:50%; transform:translateX(-50%); background:var(--black); color:#f7f2e6;
  padding:10px 20px; border-radius:99px; font-size:14px; z-index:50; box-shadow:0 6px 18px rgba(0,0,0,.25); animation:toastin .25s}
@keyframes toastin{from{opacity:0; transform:translate(-50%,8px)} to{opacity:1; transform:translate(-50%,0)}}
.backbar{display:flex; align-items:center; gap:8px; margin-bottom:12px}
.backbtn{display:flex; align-items:center; gap:4px; background:none; color:var(--gold-deep); font-size:14px; font-weight:700; padding:4px 6px}
.backbtn svg{width:18px; height:18px}

/* תיקוני גודל אייקונים */
.chip svg{width:14px; height:14px}
.btn svg{width:18px; height:18px; flex-shrink:0}
.backbtn svg{width:16px; height:16px}
