/* עוגיות של יום ראשון — כוס מדידה: צבע שטוח, קווים דקים, שנתות אדומות */

:root {
  --ground: #f6eee2;
  --dough: #e9dac3;
  --dough-2: #dfcbae;
  --surface: #fbf6ee;
  --ink: #2b1b12;
  --ink-2: #6a4c38;
  --crust: #a06a38;
  --red: #c8321f;
  --red-ink: #ad2a19;
  --red-wash: #f2d6cb;
  --hair: rgba(43, 27, 18, 0.16);
  --hair-strong: rgba(43, 27, 18, 0.32);
  --tick: rgba(43, 27, 18, 0.22);
  --tick-red: rgba(200, 50, 31, 0.38);
  --pill-btn: rgba(246, 238, 226, 0.12);
  --clock: #f29a86;
  --gold: #9a6b14;
  --gold-wash: #f1e2bf;
  --on-ink: #f6eee2;
  --shadow: 0 6px 20px -8px rgba(43, 27, 18, 0.35);

  --f-display: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --f-ui: 'Assistant', system-ui, sans-serif;

  --gutter: 16px;
  --radius: 6px;
  --bar-h: 76px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #1d140e;
    --dough: #2b1d14;
    --dough-2: #3a281b;
    --surface: #24180f;
    --ink: #f1e4d2;
    --ink-2: #c7aa8d;
    --crust: #cf9a62;
    --red: #e8573f;
    --red-ink: #f07a62;
    --red-wash: #4a2117;
    --hair: rgba(241, 228, 210, 0.14);
    --hair-strong: rgba(241, 228, 210, 0.3);
    --tick: rgba(241, 228, 210, 0.24);
    --tick-red: rgba(232, 87, 63, 0.42);
    --pill-btn: rgba(29, 20, 14, 0.12);
    --clock: #b02e1c;
    --gold: #e0b252;
    --gold-wash: #3d2c12;
    --on-ink: #1d140e;
    --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ground: #1d140e;
  --dough: #2b1d14;
  --dough-2: #3a281b;
  --surface: #24180f;
  --ink: #f1e4d2;
  --ink-2: #c7aa8d;
  --crust: #cf9a62;
  --red: #e8573f;
  --red-ink: #f07a62;
  --red-wash: #4a2117;
  --hair: rgba(241, 228, 210, 0.14);
  --hair-strong: rgba(241, 228, 210, 0.3);
  --tick: rgba(241, 228, 210, 0.24);
  --tick-red: rgba(232, 87, 63, 0.42);
  --pill-btn: rgba(29, 20, 14, 0.12);
  --clock: #b02e1c;
  --gold: #e0b252;
  --gold-wash: #3d2c12;
  --on-ink: #1d140e;
  --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 200ms; }
::view-transition-group(*) { animation-duration: 340ms; animation-timing-function: var(--ease); }

/* ---------- בסיס ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  min-height: 100dvh;
}
::selection { background: var(--red); color: var(--on-ink); }
input, textarea { caret-color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }
* { scrollbar-color: var(--dough-2) transparent; scrollbar-width: thin; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
/* שני מראות: .fun-only מופיע רק במראה המשחקי (fun.css), .joke נעלם במצב "הפסיקו לטרלל" */
html:not([data-look='fun']) .fun-only { display: none !important; }
html[data-look='clean'] .joke { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.wrap { width: min(100% - 2 * var(--gutter), 1120px); margin-inline: auto; }

/* כפתור אייקון עגול */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--hair); border-radius: 50%;
  background: transparent;
  transition: background-color 160ms, border-color 160ms, transform 160ms var(--ease);
}
.icon-btn:hover { background: var(--dough); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn[aria-pressed='true'] { color: var(--red); border-color: var(--red); }
.icon-btn[aria-pressed='true'] .i { fill: currentColor; }

/* ---------- שנתות: השפה של כוס המדידה ---------- */
.grad { display: flex; align-items: flex-end; gap: 3px; height: 12px; }
.grad i { width: 2px; height: 6px; background: var(--tick-red); border-radius: 1px; transition: background-color 200ms; }
.grad i:nth-child(odd) { height: 10px; }
.grad i.on { background: var(--red); }

/* ---------- סרגל הסטטוס (עמוד הבית) ---------- */
.status {
  background: var(--ink); color: var(--on-ink);
  font-size: 0.875rem; line-height: 1.2;
}
.status__in { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.status .i { width: 16px; height: 16px; color: var(--red); }
.status__msg { flex: 1; min-width: 0; transition: opacity 220ms; }
.status__msg.is-out { opacity: 0; }
.status__clock { font-weight: 700; color: var(--clock); letter-spacing: 0.02em; }

/* ---------- כותרת עליונה ---------- */
.top { display: flex; align-items: center; gap: 8px; padding-block: 12px; }
.top__spacer { flex: 1; }
.trophy { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding-inline: 12px 14px; border: 1px solid var(--hair); border-radius: 22px; background: transparent; font-weight: 700; font-size: 0.95rem; }
.trophy:hover { background: var(--dough); }

/* ---------- עמוד הבית ---------- */
.masthead { padding-block: 18px 30px; }
.masthead h1 {
  font-size: clamp(2.75rem, 12.5vw, 5.4rem);
  font-weight: 900; line-height: 0.95; letter-spacing: -0.015em;
}
.masthead h1 span { display: block; }
.masthead__sub { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--ink-2); font-size: 1.05rem; }
.masthead__sub .grad { height: 14px; }
.masthead__sub b { color: var(--ink); font-weight: 700; }

.grid {
  list-style: none; margin: 0; padding: 0 0 56px;
  display: grid; gap: 28px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 22px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 40px 20px; } }

.card { position: relative; }
.card__link { display: block; text-decoration: none; }
.card__photo { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; }
.card__link:hover .ph, .card__link:hover img { transform: scale(1.03); }
.card__name { margin-top: 10px; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; line-height: 1.15; }
.card__meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 0.82rem; color: var(--ink-2); }
.card__meta .is-baked { color: var(--red-ink); font-weight: 700; }
.card .fav { position: absolute; top: 8px; inset-inline-end: 8px; width: 38px; height: 38px; background: var(--surface); border-color: transparent; }
.card .fav:hover { background: var(--surface); }

/* תמונה זמנית — עד שעומר שולח תמונות */
.ph {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center;
  background: var(--dough);
  transition: transform 500ms var(--ease);
}
.ph__glyph { font-family: var(--f-display); font-weight: 900; font-size: clamp(4rem, 22vw, 7rem); line-height: 1; color: var(--dough-2); }
.ph__label { position: absolute; bottom: 9px; inset-inline-start: 10px; font-size: 0.72rem; color: var(--ink-2); }
.ph .grad { position: absolute; top: 12px; inset-inline-start: 10px; flex-direction: column; align-items: flex-start; height: auto; gap: 7px; }
.ph .grad i { height: 2px; width: 7px; }
.ph .grad i:nth-child(odd) { width: 13px; height: 2px; }

/* ---------- תחתית ---------- */
.foot { border-top: 1px solid var(--hair); padding-block: 26px 40px; color: var(--ink-2); font-size: 0.9rem; display: grid; gap: 6px; }
.foot__credit { font-family: var(--f-display); font-size: 1.15rem; color: var(--ink); }

/* ---------- עמוד מתכון ---------- */
.rbar { position: sticky; top: 0; z-index: 20; background: var(--ground); border-bottom: 1px solid transparent; transition: border-color 200ms; }
.rbar.is-stuck { border-bottom-color: var(--hair); }
.rbar__in { display: flex; align-items: center; gap: 8px; height: 60px; }
.rbar__title { flex: 1; min-width: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity 200ms; }
.rbar.is-stuck .rbar__title { opacity: 1; }

.hero { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; }
.hero .ph__glyph { font-size: clamp(7rem, 40vw, 12rem); }

.r-head { padding-block: 22px 18px; }
.r-head h1 { font-size: clamp(2.3rem, 9vw, 3.6rem); font-weight: 900; letter-spacing: -0.01em; }
.r-head p { margin-top: 10px; font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; }

.facts { display: flex; border-block: 1px solid var(--hair); margin-bottom: 30px; }
.facts > div { flex: 1; padding: 11px 12px 12px; min-width: 0; }
.facts > div + div { border-inline-start: 1px solid var(--hair); }
.facts dt { font-size: 0.78rem; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-weight: 700; font-size: 1.02rem; line-height: 1.2; }

.r-body { display: grid; gap: 40px; padding-bottom: calc(var(--bar-h) + 48px); }
/* דסקטופ: רשת אחת לראש ולגוף — כותרת ומצרכים בטור הימני, תמונה והכנה בטור השמאלי */
@media (min-width: 900px) {
  .r-top, .r-body { grid-template-columns: minmax(300px, 0.8fr) 1.2fr; column-gap: 56px; }
  .r-top { display: grid; align-items: start; padding-top: 16px; }
  .r-top > .hero { order: 2; aspect-ratio: 16 / 10; }
  .r-top .r-head { padding-top: 6px; }
  .r-body { margin-top: 64px; align-items: start; }
  .r-side { position: sticky; top: 80px; }
}

.sect-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sect-title h2 { font-size: 1.6rem; }
.sect-title small { color: var(--ink-2); font-size: 0.85rem; }

/* מכפיל — כוס מדידה שוכבת */
.cup { margin-bottom: 24px; }
.cup__label { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 8px; }
.cup__label b { color: var(--red-ink); font-size: 1rem; }
.cup__scale {
  position: relative; height: 64px;
  border: 1px solid var(--hair-strong); border-radius: 4px 4px 10px 10px;
  background: var(--surface);
  overflow: hidden;
}
/* הסרגל עצמו מוזח פנימה, כדי שגם ×3 יישב בדיוק על השנתה שלו */
.cup__scale::before { content: ''; position: absolute; inset-block: 0; right: 0; width: 22px; background: var(--red-wash); }
.cup__track { position: absolute; inset-block: 0; inset-inline: 22px; container-type: inline-size; }
.cup__fill {
  position: absolute; inset-block: 0; right: 0;
  width: 100%; transform-origin: right center; transform: scaleX(var(--level));
  background: var(--red-wash);
  transition: transform 420ms var(--ease);
}
/* קו המפלס רק ברצועת השנתות, לא דרך המספרים */
.cup__edge {
  position: absolute; top: 0; height: 18px; right: 0; width: 2px; background: var(--red);
  transform: translateX(calc(var(--level) * -100cqw + 1px));
  transition: transform 420ms var(--ease);
}
.cup__ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.cup__ticks i { width: 1.5px; height: 9px; background: var(--red); opacity: 0.55; }
.cup__ticks i.major { height: 16px; opacity: 1; }
.cup__opts { position: absolute; inset: 0; }
.cup__opt {
  position: absolute; bottom: 6px; transform: translateX(50%);
  min-width: 44px; height: 36px; padding: 0 6px;
  border: 0; background: transparent;
  font-weight: 700; font-size: 1.02rem; color: var(--ink-2);
  border-radius: 6px;
  transition: color 160ms, background-color 160ms;
}
.cup__opt:hover { color: var(--ink); }
.cup__opt[aria-checked='true'] { color: var(--red-ink); }

/* מצרכים */
.ing { list-style: none; margin: 0; padding: 0; }
.ing__group { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; padding: 18px 0 4px; color: var(--ink-2); }
.ing__group:first-child { padding-top: 0; }
.ing__row {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  padding: 11px 0; border-bottom: 1px solid var(--hair);
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.mark { width: 18px; height: 18px; margin-top: 3px; border: 1.75px solid var(--hair-strong); border-radius: 50%; display: grid; place-items: center; transition: background-color 160ms, border-color 160ms; }
.mark .i { width: 13px; height: 13px; stroke-width: 2.5; color: var(--on-ink); opacity: 0; }
.ing__text { line-height: 1.4; }
.amt { font-weight: 700; transition: color 200ms; }
.is-scaled .amt { color: var(--red-ink); }
.amt.flash { animation: flash 600ms var(--ease); }
@keyframes flash { from { background: var(--red-wash); } to { background: transparent; } }
.alt { color: var(--ink-2); font-size: 0.86rem; white-space: nowrap; }
.note { display: block; color: var(--ink-2); font-size: 0.88rem; }
.ing__row.is-done .mark { background: var(--red); border-color: var(--red); }
.ing__row.is-done .mark .i { opacity: 1; }
.ing__row.is-done .ing__text { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.ing__row.is-done .amt { color: inherit; }

/* שלבים — מסילת השנתות */
.steps-wrap { position: relative; padding-inline-start: 38px; }
.srail { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 22px; }
.srail__tube { position: absolute; inset: 0; border: 1.5px solid var(--hair-strong); border-radius: 4px 4px 11px 11px; overflow: hidden; container-type: size; }
.srail__fill { position: absolute; inset: 0; background: var(--red-wash); transform-origin: top; transform: scaleY(var(--sp, 0)); transition: transform 420ms var(--ease); }
.srail__edge { position: absolute; inset-inline: 0; top: 0; height: 2px; background: var(--red); transform: translateY(calc(var(--sp, 0) * 100cqh)); transition: transform 420ms var(--ease); opacity: var(--sp-on, 0); }
.srail__ticks i { position: absolute; inset-inline-start: 0; width: 9px; height: 1.5px; background: var(--red); }
.srail__ticks i.major { width: 15px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding-bottom: 26px; }
.step__num {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.75px solid var(--hair-strong); background: var(--ground);
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 700; font-size: 1.05rem;
  padding: 0; position: relative; z-index: 1;
  transition: background-color 180ms, border-color 180ms, color 180ms;
}
.step.is-done .step__num { background: var(--red); border-color: var(--red); color: var(--on-ink); }
.step__text { font-size: 1.1rem; line-height: 1.5; padding-top: 4px; }
.step.is-done .step__text { color: var(--ink-2); }
.step__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding-inline: 12px 14px;
  border: 1px solid var(--hair-strong); border-radius: 19px; background: transparent;
  font-weight: 700; font-size: 0.95rem;
  transition: background-color 160ms, border-color 160ms;
}
.chip .i { width: 18px; height: 18px; color: var(--red); }
.chip:hover { background: var(--dough); }
.tip { margin-top: 12px; padding: 12px 14px; background: var(--dough); border-radius: var(--radius); font-size: 0.98rem; }
.tip b { display: block; font-family: var(--f-display); font-size: 1rem; margin-bottom: 2px; }

/* אפיתי */
.baked { display: grid; justify-items: center; gap: 10px; padding: 30px 0 10px; text-align: center; border-top: 1px solid var(--hair); }
.baked__btn {
  position: relative;
  height: 54px; padding-inline: 28px; border-radius: 27px;
  border: 2px solid var(--ink); background: transparent;
  font-family: var(--f-display); font-weight: 700; font-size: 1.3rem;
  transition: background-color 160ms, color 160ms, transform 160ms var(--ease);
}
.baked__btn:hover { background: var(--ink); color: var(--ground); }
.baked__btn:active { transform: scale(0.96); }
.baked__count { color: var(--ink-2); font-size: 0.95rem; display: flex; align-items: center; gap: 10px; }
.crumb { position: fixed; z-index: 90; width: 7px; height: 6px; border-radius: 45% 55% 50% 40%; pointer-events: none; }

/* פס תחתון קבוע */
.bottom {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  background: var(--ground); border-top: 1px solid var(--hair);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
}
.bottom__in { width: min(100%, 1120px); margin-inline: auto; display: flex; gap: 10px; }
.primary {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; border: 0; border-radius: 26px;
  background: var(--ink); color: var(--on-ink);
  font-weight: 700; font-size: 1.15rem;
  transition: transform 160ms var(--ease), opacity 160ms;
}
.primary:active { transform: scale(0.98); }
@media (min-width: 900px) { .primary { flex: 0 0 auto; padding-inline: 40px; margin-inline-start: auto; } }

/* ---------- טיימרים צפים ---------- */
.timers {
  position: fixed; z-index: 70; inset-inline: 0;
  bottom: calc(var(--bar-h) + 10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding-inline: var(--gutter);
  pointer-events: none;
}
.page-home .timers { bottom: calc(14px + env(safe-area-inset-bottom)); }
.timer {
  pointer-events: auto;
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  width: min(100%, 420px); height: 52px; padding-inline: 16px 6px;
  background: var(--ink); color: var(--on-ink);
  border-radius: 26px; box-shadow: var(--shadow);
  animation: pill-in 320ms var(--ease);
}
@keyframes pill-in { from { transform: translateY(14px); opacity: 0; } }
.timer__fill { position: absolute; inset: 0; background: var(--red); opacity: 0.35; transform-origin: right; transform: scaleX(0); transition: transform 500ms linear; }
.timer > :not(.timer__fill) { position: relative; }
.timer__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.95rem; }
.timer__time { font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.timer__btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--pill-btn); color: inherit; font-weight: 700; display: grid; place-items: center; padding: 0; }
.timer__btn .i { width: 18px; height: 18px; }
.timer.is-done { background: var(--red); color: #fff; animation: ring 1.2s var(--ease) infinite; }
.timer.is-done .timer__fill { opacity: 0; }
@keyframes ring { 50% { transform: scale(1.025); } }

/* ---------- מצב מטבח ---------- */
.kitchen {
  position: fixed; inset: 0; z-index: 60;
  background: var(--ground);
  display: none;
}
.kitchen.is-open { display: block; animation: k-in 300ms var(--ease); }
@keyframes k-in { from { opacity: 0; transform: translateY(24px); } }
.kitchen__scroll { height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.kitchen__scroll::-webkit-scrollbar { display: none; }
.kslide {
  height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; justify-content: center;
  padding: 84px 40px 120px 84px;
}
.kslide__n { font-family: var(--f-display); font-weight: 900; font-size: clamp(4.5rem, 22vw, 8rem); line-height: 0.9; color: var(--red); }
.kslide__n small { font-size: 0.32em; color: var(--ink-2); font-weight: 700; margin-inline-start: 6px; }
.kslide__t { margin-top: 18px; font-size: clamp(1.5rem, 6.4vw, 2.3rem); font-weight: 600; line-height: 1.32; max-width: 26ch; }
.kslide__ing { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 6px; font-size: 1.15rem; color: var(--ink-2); }
.kslide__ing b { color: var(--ink); }
.kslide__tip { margin-top: 18px; font-size: 1.05rem; color: var(--ink-2); max-width: 34ch; }
.kslide__tip b { color: var(--ink); font-family: var(--f-display); }
.kslide .chip { margin-top: 26px; height: 50px; padding-inline: 18px 20px; font-size: 1.1rem; align-self: flex-start; }
.kslide--done { align-items: flex-start; }
.kslide--done h2 { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 900; }
.kslide--done p { margin-top: 10px; font-size: 1.2rem; color: var(--ink-2); }
.kslide--done .baked__btn { margin-top: 26px; }

.kitchen__top { position: absolute; top: 0; inset-inline: 0; display: flex; align-items: center; gap: 12px; padding: 14px var(--gutter); z-index: 2; background: var(--ground); }
.kitchen__name { flex: 1; min-width: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kitchen__wake { font-size: 0.78rem; color: var(--ink-2); }

/* מסילת התקדמות — הנוזל עולה בכוס */
.krail { position: absolute; z-index: 2; inset-inline-end: 27px; top: 88px; bottom: calc(300px + env(safe-area-inset-bottom)); width: 26px; }
.krail__tube { position: absolute; inset: 0; border: 1.5px solid var(--hair-strong); border-radius: 4px 4px 12px 12px; overflow: hidden; container-type: size; }
.krail__fill { position: absolute; inset: 0; background: var(--red-wash); transform-origin: bottom; transform: scaleY(var(--p, 0)); transition: transform 420ms var(--ease); }
.krail__edge { position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--red); transform: translateY(calc(var(--p, 0) * -100cqh)); transition: transform 420ms var(--ease); }
.krail__ticks { position: absolute; inset: 6px 0; display: flex; flex-direction: column-reverse; justify-content: space-between; }
.krail__ticks i { display: block; height: 1.5px; width: 9px; background: var(--red); }
.krail__ticks i:nth-child(odd) { width: 15px; }

.kitchen__actions { position: absolute; z-index: 2; inset-inline-end: 12px; align-content: end; bottom: calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.kitchen__actions .icon-btn { width: 56px; height: 56px; background: var(--surface); }
.kitchen__actions .icon-btn .i { width: 24px; height: 24px; }
.k-act { display: grid; justify-items: center; gap: 4px; font-size: 0.75rem; color: var(--ink-2); }
.kitchen__hint { position: absolute; z-index: 2; bottom: calc(26px + env(safe-area-inset-bottom)); inset-inline-start: 0; inset-inline-end: 84px; text-align: center; font-size: 0.85rem; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 6px; transition: opacity 200ms; }
.kitchen__hint .i { width: 16px; height: 16px; }
.kitchen.is-last .kitchen__hint { opacity: 0; }
.kitchen.is-open ~ .timers, body.kitchen-open .timers { bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 80; padding-inline: var(--gutter) 84px; }

/* ---------- גיליון תחתון (שיתוף / הפסקה) ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: min(100%, 520px); max-height: 85dvh;
  background: var(--surface); color: var(--ink);
  border-radius: 18px 18px 0 0;
}
.sheet::backdrop { background: rgba(29, 20, 14, 0.5); }
.sheet[open] { animation: sheet-in 320ms var(--ease); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
.sheet__in { padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom)); }
.sheet__in:focus { outline: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet__head h2 { font-size: 1.5rem; }
.sheet__list { display: grid; gap: 0; }
.sheet__opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--hair); background: transparent; text-align: start; font-size: 1.05rem; }
.sheet__opt .i { color: var(--red); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--hair); cursor: pointer; font-size: 1.02rem; line-height: 1.4; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check:has(input:checked) .mark { background: var(--red); border-color: var(--red); }
.check:has(input:checked) .mark .i { opacity: 1; }
.check:has(input:focus-visible) .mark { outline: 2px solid var(--red); outline-offset: 2px; }
.sheet__done { margin-top: 16px; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; color: var(--red-ink); min-height: 1.4em; }

/* ---------- הודעה קצרה ---------- */
.toast {
  position: fixed; z-index: 100; top: 14px; left: 50%; transform: translate(-50%, -20px);
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 22px;
  background: var(--ink); color: var(--on-ink);
  font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms, transform 320ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ================= הישגים ובדיחות ================= */

/* הגופן של קובי */
:root[data-font='segoe'] { --f-display: 'Segoe UI', 'Assistant', sans-serif; --f-ui: 'Segoe UI', 'Assistant', sans-serif; }

/* תג הישג — חוגת שנתות */
.badge { display: block; flex: none; }
.badge__disc { fill: var(--dough); }
.badge__ticks { stroke: var(--tick); stroke-width: 2; stroke-linecap: round; fill: none; }
.badge__glyph { font-family: var(--f-display); font-weight: 900; fill: var(--ink-2); opacity: 0.45; }
.badge.is-on .badge__ticks { stroke: var(--red); }
.badge.is-on .badge__disc { fill: var(--red-wash); }
.badge.is-on .badge__glyph { fill: var(--red-ink); opacity: 1; }
.badge.is-legend.is-on .badge__ticks { stroke: var(--gold); stroke-width: 2.6; }
.badge.is-legend.is-on .badge__disc { fill: var(--gold-wash); }
.badge.is-legend.is-on .badge__glyph { fill: var(--gold); }
.badge.is-hidden .badge__disc { fill: transparent; stroke: var(--hair-strong); stroke-dasharray: 3 4; }

/* הודעת הישג */
.ach-toast {
  position: fixed; z-index: 110; top: 14px; left: 50%;
  display: flex; align-items: center; gap: 12px;
  min-width: min(320px, calc(100% - 32px)); max-width: calc(100% - 32px);
  padding: 10px 18px 10px 12px;
  background: var(--ink); color: var(--on-ink);
  border-radius: 32px; box-shadow: var(--shadow);
  text-decoration: none;
  transform: translate(-50%, -140%); opacity: 0;
  transition: transform 420ms var(--ease), opacity 220ms;
}
.ach-toast.is-on { transform: translate(-50%, 0); opacity: 1; }
.ach-toast small { display: block; font-size: 0.78rem; opacity: 0.75; }
.ach-toast b { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.1; }
.ach-toast .badge__disc { fill: rgba(246, 238, 226, 0.12); }
.ach-toast.is-legend { background: var(--gold); color: #fff; }

/* החץ של דון וקובי */
.arrow-joke {
  position: fixed; z-index: 40; pointer-events: none;
  /* ltr כדי שראש החץ יישב בצד שמאל של הקופסה, מתחת לכפתור */
  direction: ltr; display: grid; justify-items: start; gap: 2px;
  color: var(--red-ink);
  opacity: 0; transform: translateY(8px);
  transition: opacity 260ms, transform 420ms var(--ease);
}
.arrow-joke.is-on { opacity: 1; transform: none; }
.arrow-joke svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.arrow-joke.is-on svg path:first-child { stroke-dasharray: 90; animation: draw 700ms var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 90; } to { stroke-dashoffset: 0; } }
.arrow-joke span { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; background: var(--ground); padding: 2px 6px; border-radius: 4px; }

/* תפריט גופן */
.font-btn { font-family: var(--f-display); font-weight: 900; font-size: 1.05rem; }
.font-menu {
  position: fixed; z-index: 45; width: 210px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; display: none;
}
.font-menu.is-on { display: grid; animation: sheet-in 220ms var(--ease); }
.font-menu button { border: 0; background: transparent; text-align: start; padding: 12px; border-radius: 8px; font-size: 1.02rem; }
.font-menu button:hover { background: var(--dough); }
.font-menu button[aria-checked='true'] { color: var(--red-ink); font-weight: 700; }

/* 67 */
.storm { position: fixed; inset: 0; z-index: 120; background: var(--ground); overflow: hidden; animation: k-in 300ms var(--ease); }
.storm__num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 900; font-size: clamp(9rem, 48vw, 26rem); line-height: 1;
  color: var(--red); pointer-events: none;
  animation: bob 600ms ease-in-out infinite alternate;
}
.storm__pair { position: absolute; display: flex; gap: 6px; transform: scale(var(--s)); transform-origin: center; }
.palm { width: 44px; height: 48px; fill: var(--dough-2); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; animation: weigh 520ms ease-in-out infinite alternate; animation-delay: var(--d); }
.palm + .palm { transform: scaleX(-1); animation-name: weigh-b; }
@keyframes weigh { from { translate: 0 -14px; } to { translate: 0 14px; } }
@keyframes weigh-b { from { translate: 0 14px; } to { translate: 0 -14px; } }
@keyframes bob { from { transform: translateY(-2%); } to { transform: translateY(2%); } }
.storm__close { position: absolute; top: 16px; left: 16px; background: var(--surface); }
.storm-mini {
  position: fixed; z-index: 85; top: 64px; left: 14px;
  font-family: var(--f-display); font-weight: 900; font-size: 1.6rem; color: var(--on-ink);
  background: var(--red); border-radius: 22px; padding: 2px 14px;
  animation: bob 600ms ease-in-out infinite alternate;
}

/* הטבות מקסים: חלון ראווה */
.mx__intro { color: var(--ink-2); margin-bottom: 14px; }
.mx-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mx { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 10px; border: 1.5px dashed var(--hair-strong); border-radius: 12px; }
.mx b { font-family: var(--f-display); font-weight: 900; font-size: 1.15rem; }
.mx span:last-child { font-size: 0.9rem; color: var(--ink-2); line-height: 1.35; }
.mx__art { height: 64px; display: grid; place-items: center; }
.mx__word { font-family: var(--f-display); font-weight: 900; font-size: 1.9rem; }
.mx:not(.is-got) .mx__art { filter: brightness(0); opacity: 0.18; }
.mx.is-got { border-style: solid; border-color: var(--red); }
.mx__count { margin-top: 14px; font-weight: 700; text-align: center; }

/* המילה מלח */
.salt { cursor: pointer; }

/* תחתית: קישורים קטנים */
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.foot__links a, .foot__links button { border: 0; background: none; padding: 6px 0; color: var(--ink-2); font-size: 0.9rem; text-decoration: underline; text-decoration-color: var(--hair-strong); text-underline-offset: 0.25em; }
.foot__links a:hover, .foot__links button:hover { color: var(--ink); }
.foot__tiny { font-size: 0.72rem !important; opacity: 0.8; }
.foot__rights { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: default; text-align: start; }

/* עוגיית השבוע (ימי ראשון) */
.card__week {
  position: absolute; bottom: 8px; inset-inline-start: 8px; z-index: 1;
  background: var(--red); color: var(--on-ink);
  font-weight: 700; font-size: 0.78rem; padding: 3px 10px; border-radius: 12px;
}

/* ================= עמוד ההישגים ================= */
.ach-head { padding-block: 10px 26px; }
.ach-head h1 { font-size: clamp(2.6rem, 11vw, 4.4rem); font-weight: 900; }
.ach-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--ink-2); flex-wrap: wrap; }
.ach-progress b { color: var(--ink); }
.ach-progress .grad { height: 14px; gap: 4px; }

.ach-tools { display: grid; gap: 12px; margin-bottom: 30px; }
@media (min-width: 720px) { .ach-tools { grid-template-columns: repeat(2, 1fr); } }
.tool {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid var(--hair); border-radius: 14px; background: var(--surface);
}
.tool__text { flex: 1; min-width: 0; }
.tool__text b { display: block; font-family: var(--f-display); font-size: 1.2rem; }
.tool__text span { font-size: 0.92rem; color: var(--ink-2); }
.switch { position: relative; width: 52px; height: 30px; flex: none; border: 0; border-radius: 15px; background: var(--dough-2); padding: 0; transition: background-color 200ms; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 260ms var(--ease); }
.switch[aria-checked='true'] { background: var(--red); }
.switch[aria-checked='true']::after { transform: translateX(-22px); }
.tool .primary { flex: 0 0 auto; height: 44px; padding-inline: 20px; font-size: 1rem; }

.ach-grid { list-style: none; margin: 0; padding: 0 0 64px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 16px; }
@media (min-width: 720px) { .ach-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .ach-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ach { display: grid; justify-items: center; text-align: center; gap: 8px; scroll-margin-top: 90px; }
.ach h3 { font-size: 1.12rem; }
.ach p { font-size: 0.9rem; color: var(--ink-2); max-width: 24ch; }
.ach.is-locked h3 { color: var(--ink-2); }
.ach__legend { font-size: 0.72rem; font-weight: 700; color: var(--gold); letter-spacing: 0.02em; }
.ach:target .badge { animation: pulse 900ms var(--ease) 2; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* תעודה */
.cert {
  position: relative; margin-bottom: 36px; padding: 34px 24px 30px; text-align: center;
  background: var(--surface); border: 1.5px solid var(--red); border-radius: 6px;
  outline: 1px solid var(--red); outline-offset: -9px;
}
.cert__ticks { position: absolute; inset-inline: 22px; top: 14px; display: flex; justify-content: space-between; }
.cert__ticks i { width: 1.5px; height: 8px; background: var(--red); }
.cert__ticks i:nth-child(5n+1) { height: 14px; }
.cert small { display: block; color: var(--ink-2); font-size: 0.9rem; margin-top: 10px; }
.cert h2 { font-size: clamp(1.9rem, 8vw, 2.8rem); font-weight: 900; margin-top: 10px; }
.cert p { margin: 12px auto 0; max-width: 36ch; font-size: 1.05rem; }
.cert__sign { margin-top: 26px; display: inline-grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--hair-strong); min-width: 180px; }
.cert__sign b { font-family: var(--f-display); font-size: 1.4rem; }
.cert__sign span { font-size: 0.82rem; color: var(--ink-2); }

a.primary { text-decoration: none; }
.calm__q { font-size: 1.15rem; margin-bottom: 18px; }
.calm__row { display: flex; gap: 10px; align-items: center; }
.calm__row .primary { flex: 1; }
.calm__row .chip { height: 52px; padding-inline: 20px; border-radius: 26px; }

/* המכתב של עומר */
.letter {
  width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--ground); color: var(--ink);
}
.letter[open] { animation: k-in 360ms var(--ease); }
.letter::backdrop { background: var(--ground); }
.letter__in { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: 26px; padding: 40px var(--gutter) calc(40px + env(safe-area-inset-bottom)); }
.letter__in:focus { outline: none; }
.letter__paper {
  position: relative; width: min(100%, 560px);
  padding: 34px 26px 28px; background: var(--surface);
  border-top: 2px solid var(--red);
}
.letter__paper::before { content: ''; position: absolute; top: -2px; inset-inline: 0; height: 12px; background: repeating-linear-gradient(to left, var(--red) 0 1.5px, transparent 1.5px 18px); opacity: 0.6; }
.letter__paper h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); font-weight: 900; margin-bottom: 16px; }
.letter__type p { font-size: 1.14rem; line-height: 1.7; min-height: 1.7em; }
.letter__type p + p { margin-top: 14px; }
.letter__sign { margin-top: 22px; font-family: var(--f-display); font-weight: 900; font-size: 1.6rem; }
.letter__draft { position: absolute; top: 14px; inset-inline-end: 16px; rotate: 8deg; padding: 2px 10px; border: 2px solid var(--red); color: var(--red-ink); font-weight: 700; font-size: 0.85rem; }
.letter__go { flex: 0 0 auto; padding-inline: 40px; margin: 0; }

/* הוספה למסך הבית */
.inst__lead { color: var(--ink-2); font-size: 1.05rem; line-height: 1.5; }
.inst__steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; }
.inst__steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--hair); font-size: 1.05rem; line-height: 1.4; }
.inst__n { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--red); color: var(--red-ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; }
.inst__ico { display: inline-grid; place-items: center; vertical-align: -6px; width: 28px; height: 28px; border-radius: 7px; background: var(--dough); }
.inst__ico .i { width: 20px; height: 20px; color: var(--ink); }
.inst__note { margin-top: 14px; padding: 12px 14px; background: var(--dough); border-radius: var(--radius); font-size: 0.95rem; line-height: 1.45; }
.inst__row { display: flex; gap: 10px; margin-top: 20px; }
.inst__row .chip { height: 52px; padding-inline: 20px; border-radius: 26px; }
@media (min-width: 900px) { .inst__row .primary { flex: 1; margin-inline-start: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
