/* ============================================================
   Кото-Кафе: Здоровий Баланс — стилі
   Дві окремі теми: сонячна тераса (light) / вечірня тераса (dark)
   ============================================================ */

/* ---------- 1. Токени ---------- */

:root {
  color-scheme: light dark;

  /* сонячна тераса */
  --bg: #fff4e3;
  --bg-2: #ffe9cc;
  --surface: #ffffff;
  --surface-2: #fff9f0;
  --ink: #26201a;
  --ink-2: #55483c;
  --muted: #6b5d51;
  --line: #e8d9c4;
  --shadow: 0 6px 0 rgba(38, 32, 26, .12);
  --shadow-soft: 0 8px 24px rgba(38, 32, 26, .10);

  --lemon: #e8a00c;
  --lemon-ink: #2a1c00;
  --sea: #1f6e92;
  --terra: #b84a36;
  --leaf: #3d8a5c;
  --grape: #7c5aa6;

  /* -soft — заливка зони, -ink — текст на цій заливці (AA ≥ 4.5:1) */
  --c-veg: #3d8a5c;
  --c-veg-soft: #e2f2e8;
  --c-veg-ink: #2a6a45;
  --c-carb: #c8860e;
  --c-carb-soft: #fbf0d8;
  --c-carb-ink: #8a5a05;
  --c-pro: #b84a36;
  --c-pro-soft: #fae5e0;
  --c-pro-ink: #93331f;
  --c-fat: #6c8f22;
  --c-fat-soft: #eff5dc;
  --c-fat-ink: #4c6510;
  --c-treat: #7c5aa6;
  --c-treat-soft: #f0e9f8;
  --c-treat-ink: #5c3a85;

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --tap: 44px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* вечірня тераса */
    --bg: #101b27;
    --bg-2: #0a1119;
    --surface: #1a2836;
    --surface-2: #223345;
    --ink: #f2e8da;
    --ink-2: #cdc1b1;
    --muted: #a4988c;
    --line: #2e4157;
    --shadow: 0 6px 0 rgba(0, 0, 0, .45);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, .5);

    --lemon: #ffc857;
    --lemon-ink: #241a00;
    --sea: #6bb8d6;
    --terra: #e9927a;
    --leaf: #79c795;
    --grape: #b699e0;

    --c-veg: #79c795;
    --c-veg-soft: #173324;
    --c-veg-ink: #79c795;
    --c-carb: #f0b442;
    --c-carb-soft: #35290f;
    --c-carb-ink: #f0b442;
    --c-pro: #e9927a;
    --c-pro-soft: #35201b;
    --c-pro-ink: #e9927a;
    --c-fat: #b6d05e;
    --c-fat-soft: #262f12;
    --c-fat-ink: #b6d05e;
    --c-treat: #b699e0;
    --c-treat-soft: #251d38;
    --c-treat-ink: #b699e0;
  }
}

:root[data-theme="dark"] {
  --bg: #101b27;
  --bg-2: #0a1119;
  --surface: #1a2836;
  --surface-2: #223345;
  --ink: #f2e8da;
  --ink-2: #cdc1b1;
  --muted: #a4988c;
  --line: #2e4157;
  --shadow: 0 6px 0 rgba(0, 0, 0, .45);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .5);

  --lemon: #ffc857;
  --lemon-ink: #241a00;
  --sea: #6bb8d6;
  --terra: #e9927a;
  --leaf: #79c795;
  --grape: #b699e0;

  --c-veg: #79c795;
  --c-veg-soft: #173324;
  --c-veg-ink: #79c795;
  --c-carb: #f0b442;
  --c-carb-soft: #35290f;
  --c-carb-ink: #f0b442;
  --c-pro: #e9927a;
  --c-pro-soft: #35201b;
  --c-pro-ink: #e9927a;
  --c-fat: #b6d05e;
  --c-fat-soft: #262f12;
  --c-fat-ink: #b6d05e;
  --c-treat: #b699e0;
  --c-treat-soft: #251d38;
  --c-treat-ink: #b699e0;
}

/* ---------- 2. База ---------- */

* { box-sizing: border-box; }

/* класи на кшталт .btn задають display і перебивають атрибут hidden */
[hidden] { display: none !important; }

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

body {
  background: var(--bg);
  background-image:
    radial-gradient(120% 60% at 50% 0%, var(--bg-2) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  height: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;

  /* Головна причина «екран зумиться при тапах» на телефоні: подвійний тап
     за замовчуванням = zoom. `manipulation` вимикає саме його й лишає
     гортання та pinch — тобто той, кому треба збільшити текст, це зможе,
     а гра від подвійного тапу по кнопці більше не стрибає.
     Ставимо на корінь: браузер бере найсуворіше значення по дереву, тож
     тераса зі своїм `none` лишається як була. */
  touch-action: manipulation;
}

/* Протяг угору = перезавантаження сторінки. У грі, де палець постійно
   веде вгору, це найдорожчий баг з усіх: злітає незбережена зміна.
   `overscroll-behavior: none` треба саме на КОРЕНІ — на body браузер його
   вже не читає, якщо корінь дозволяє ланцюжок далі. Плюс те саме на
   кожному внутрішньому скролері, щоб дотяг до краю не «протікав» нагору. */
html {
  touch-action: manipulation;
  overscroll-behavior: none;
  height: 100%;
  overflow: hidden;
}

/* Усе, по чому б'ють пальцем часто, — окремо й явно: у грі є місця, де
   треба настукати дев'ять разів поспіль (плита), і жоден із цих тапів
   не має права перетворитись на зум. */
button, .btn, .ing, .chip, .quiz-opt, .intro-opt, .fam-opt,
.shop-tabs button, .icon-btn, .world-action, .panel__back,
.stove__pan, .lesson__next, .lesson__skip {
  touch-action: manipulation;
}

/* Панелі гортаються вертикально, стрічки продуктів — горизонтально.
   Явні значення заразом прибирають подвійний тап і всередині них. */
.panel { touch-action: pan-y; }
/* Шторка більше не гортається сама — гортається тільки вердикт усередині
   неї. Тому `pan-y` живе саме там, а не на панелі. */
.sheet__panel { touch-action: manipulation; }
#verdictPhase { touch-action: pan-y; }

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }

button { font: inherit; color: inherit; }

:where(button, a, input, [tabindex]):focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 3. Каркас: гра на весь екран ---------- */

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* HUD поверх сцени */
.hud-top {
  position: absolute; z-index: 12;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 8px; right: 8px;
  display: flex; align-items: flex-start; gap: 8px;
  pointer-events: none;
}
.hud-left {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0; max-width: calc(100% - 96px);
}
/* смужка рівня і вайб — один ряд: удвох вони займають ту саму висоту,
   що раніше займала сама смужка */
.hud-row { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.hud-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.hud-btns { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; }

/* смужка «до наступного рівня» — головний видимий прогрес */
.hud-progress {
  position: relative;
  display: block;
  flex: 1 1 auto; min-width: 0;
  max-width: 190px;
  padding: 4px 10px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
}
.hud-progress i {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--lemon) 55%, transparent), var(--lemon));
  transition: width .5s cubic-bezier(.2, .9, .3, 1);
}
.hud-progress span {
  position: relative;
  font-size: .68rem; font-weight: 900;
  white-space: nowrap;
}
.hud-progress.is-ready { border-color: var(--leaf); animation: readyPulse 1.3s ease-in-out infinite; }
.hud-progress.is-ready i { background: linear-gradient(90deg, color-mix(in srgb, var(--leaf) 55%, transparent), var(--leaf)); }

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
  50% { box-shadow: 0 2px 8px rgba(0, 0, 0, .18), 0 0 0 5px color-mix(in srgb, var(--leaf) 30%, transparent); }
}

/* вайб зали — поруч зі смужкою рівня, тією ж мовою */
.vibe-chip {
  display: flex; align-items: center; gap: 5px;
  flex: none; width: 66px;
  padding: 3px 8px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  pointer-events: auto;
}
.vibe-chip__e { font-size: .95rem; line-height: 1; }
.vibe-chip__bar {
  flex: 1; height: 7px;
  border-radius: 999px; overflow: hidden;
  background: var(--surface-2);
}
.vibe-chip__bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease, background-color .5s; }
.vibe-chip--cold  .vibe-chip__bar i { background: var(--sea); }
.vibe-chip--meh   .vibe-chip__bar i { background: var(--muted); }
.vibe-chip--ok    .vibe-chip__bar i { background: var(--leaf); }
.vibe-chip--good  .vibe-chip__bar i { background: var(--lemon); }
.vibe-chip--party .vibe-chip__bar i { background: var(--terra); }
.vibe-chip--party { animation: readyPulse 1.6s ease-in-out infinite; }

/* онбординг */
.tutor {
  position: absolute; z-index: 14;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  width: min(360px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: var(--r-l);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 2px solid var(--lemon);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .3);
  pointer-events: none;
}
.tutor.pop { animation: ctaPop .35s cubic-bezier(.2, 1.5, .4, 1); }
.tutor__step { font-size: .62rem; font-weight: 900; color: var(--muted); letter-spacing: .08em; }
.tutor__text { font-size: .92rem; font-weight: 800; line-height: 1.3; }

/* рівні в книзі шефа */
.lvl-grid { display: grid; gap: 6px; margin-top: 8px; }
.lvl-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 8px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .78rem;
}
.lvl-row span { font-size: 1rem; letter-spacing: 1px; }
.lvl-row i { font-style: normal; font-size: .68rem; font-weight: 800; color: var(--muted); }
.lvl-row.is-now { border-color: var(--lemon); background: color-mix(in srgb, var(--lemon) 16%, var(--surface-2)); }
.lvl-row.is-now i { color: var(--ink); }
.lvl-row.is-done { opacity: .6; }
.lvl-row.is-done i { color: var(--leaf); }

.stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  font-weight: 800;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat b { font-weight: 900; }
.stat--lvl { background: var(--lemon); color: var(--lemon-ink); border-color: transparent; }
.stat.bump { animation: bump .45s cubic-bezier(.2, 1.6, .4, 1); }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  cursor: pointer;
  font-size: 1.05rem;
}
.icon-btn:active { transform: scale(.92); }

/* Чіпи зміни й доби стоять у ПОТОЦІ колонки, а не абсолютом поверх неї:
   абсолютні вони лягали просто на смужку рівня й на бульбашку Кішки. */
.hud-chip {
  align-self: flex-start;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  font-size: .8rem; font-weight: 800;
  pointer-events: none;
}

/* репліка Кішки — вгорі зліва, щоб не воювала з кнопками внизу */
.hud-say {
  max-width: 100%;
  display: flex; gap: 8px; align-items: flex-start;
  pointer-events: none;
  transition: opacity .35s;
}
.hud-say .cat__face { width: 48px; height: 48px; }
.hud-say .cat__img { width: 55px; margin-bottom: -5px; }
.hud-say .cat__bubble { font-size: .84rem; padding: 8px 10px; }
.hud-say .cat__bubble::before { top: 14px; }
.hud-say.is-quiet { opacity: 0; }

.hud-hint {
  position: absolute; z-index: 11;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 148px);
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  font-size: .72rem; font-weight: 700; color: var(--muted);
  pointer-events: none;
  animation: floaty 2.6s ease-in-out infinite;
}

/* повноекранні панелі поверх тераси */
.panel {
  position: absolute; inset: 0; z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  backdrop-filter: blur(14px);
  animation: panelIn .28s cubic-bezier(.2, .9, .3, 1);
}
.panel__inner {
  max-width: 480px;
  margin-inline: auto;
  padding: calc(env(safe-area-inset-top) + 56px) 12px calc(env(safe-area-inset-bottom) + 24px);
}
.panel__inner > h1 { margin-bottom: 8px; }
.panel__back {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 8px); left: 10px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 1.3rem; font-weight: 900;
  cursor: pointer;
}
.panel__back:active { transform: translateY(2px); box-shadow: none; }

@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 4. Загальні блоки ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 14px;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 18px;
  border: 0;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn--primary { background: var(--lemon); color: var(--lemon-ink); border-color: transparent; }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--block { display: flex; width: 100%; }
.btn--big { font-size: 1.05rem; min-height: 56px; }

.muted { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }

/* ---------- 5. Кішка-Шеф ---------- */

.cat {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  position: relative;
}

.cat__face {
  flex: none;
  width: 60px; height: 60px;
  display: grid; place-items: end center;
  background: radial-gradient(circle at 50% 120%, var(--lemon) 0%, color-mix(in srgb, var(--lemon) 45%, var(--surface)) 100%);
  border: 2px solid var(--lemon);
  border-radius: 50%;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.cat__img {
  width: 68px;
  margin-bottom: -6px;
  pointer-events: none;
}
/* Вдягнене на мордочці в панелях. У кружечок влазить тільки голова —
   решта слотів там або поза кадром, або просто на морді, а емодзі поверх
   намальованої кішки виглядає як наліпка, а не як костюм. Тому в кружечку
   рендериться ЛИШЕ головний убір; повний образ показує гардероб. */
.cat__wear {
  position: absolute;
  font-size: 1.15rem;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
.cat__wear--head { top: 1px; left: 50%; transform: translateX(-50%); }
.cat__wear--eyes,
.cat__wear--body,
.cat__wear--paws,
.cat__wear--feet { display: none; }
.cat__face.talk { animation: nod .6s ease; }

.cat__bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 10px 12px;
  font-size: .92rem;
  font-weight: 600;
  position: relative;
}
.cat__bubble::before {
  content: "";
  position: absolute; left: -7px; top: 16px;
  width: 12px; height: 12px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

/* ---------- 6. Кафе (хаб) ---------- */

.terrace {
  position: relative;
  border-radius: var(--r-l);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--sea) 30%, var(--surface)) 0%,
      color-mix(in srgb, var(--sea) 12%, var(--surface)) 45%,
      var(--surface) 100%);
  padding: 16px;
  min-height: 190px;
  margin-bottom: 12px;
}
.terrace__sun {
  position: absolute; top: 14px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--lemon);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--lemon) 22%, transparent);
}
.terrace__name { font-weight: 900; font-size: 1.1rem; }
.terrace__decor {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; font-size: 1.7rem; line-height: 1.1;
  position: relative;
}
.terrace__empty { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.terrace__tables {
  position: absolute; bottom: 12px; left: 16px;
  font-size: 1.5rem; letter-spacing: 2px;
}

.rule-hand { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rule-hand__item {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  font-size: .8rem;
  font-weight: 700;
}
.rule-hand__item .e { font-size: 1.3rem; }
.rule-hand__item small { display: block; font-weight: 600; color: var(--muted); }
.rh-veg { background: var(--c-veg-soft); }
.rh-carb { background: var(--c-carb-soft); }
.rh-pro { background: var(--c-pro-soft); }
.rh-fat { background: var(--c-fat-soft); }

/* ---------- 7. Зміна ---------- */

.guest {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 12px;
  margin-bottom: 10px;
}
.guest__face {
  flex: none; width: 60px; height: 60px;
  display: grid; place-items: end center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 115%, var(--surface-2) 0%, var(--surface) 100%);
  border: 2px solid var(--line);
  overflow: hidden;
}
.guest__face img { width: 62px; margin-bottom: -5px; }
.guest__name { font-weight: 900; font-size: .9rem; }
.guest__line { font-size: .95rem; font-weight: 700; }
.guest__hint { font-size: .78rem; color: var(--muted); }

.patience {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 12px;
}
.patience__fill {
  height: 100%;
  background: var(--leaf);
  transition: width .25s linear, background-color .3s;
}
.patience__fill.warn { background: var(--lemon); }
.patience__fill.crit { background: var(--terra); animation: pulse .6s infinite; }

.plate-row {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.plate {
  position: relative;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: var(--surface);
  border: 6px solid var(--surface-2);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  flex: none;
}
.plate.shake { animation: shake .4s ease; }
.plate.cheer { animation: cheer .5s ease; }

.zone {
  position: absolute;
  display: flex; flex-wrap: wrap; gap: 2px;
  align-content: center; justify-content: center;
  padding: 6px;
  font-size: 1.4rem;
}
/* підпис зсунуто від центру зони до центру тарілки: не ріже коло і не лізе під фішки */
.zone__tag {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  font-size: .56rem; font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
  opacity: .8;
  pointer-events: none;
}
.zone--veg {
  left: 0; top: 0; width: 50%; height: 100%;
  background: var(--c-veg-soft);
  border-right: 2px dashed color-mix(in srgb, var(--c-veg) 45%, transparent);
}
.zone--veg .zone__tag { top: 68%; color: var(--c-veg-ink); }
.zone--carb {
  right: 0; top: 0; width: 50%; height: 50%;
  background: var(--c-carb-soft);
  border-bottom: 2px dashed color-mix(in srgb, var(--c-carb) 45%, transparent);
}
.zone--carb .zone__tag { top: 80%; color: var(--c-carb-ink); }
.zone--pro {
  right: 0; bottom: 0; width: 50%; height: 50%;
  background: var(--c-pro-soft);
}
.zone--pro .zone__tag { top: 20%; color: var(--c-pro-ink); }

/* «Умова +1» — на самій зоні тарілки, поверх уже викладеної бази.
   Показувати приріст можна ТІЛЬКИ так: коли база лежить перед очима. */
.zone.is-need, .saucer.is-need {
  outline: 3px dashed currentColor;
  outline-offset: -4px;
  animation: needPulse 1.4s ease-in-out infinite;
}
.zone__need {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  min-width: 22px; padding: 1px 6px;
  border-radius: 999px;
  background: var(--terra); color: #fff;
  font-size: .68rem; font-weight: 900; line-height: 1.5;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.saucer .zone__need { top: -2px; right: -2px; }

.saucers { display: flex; flex-direction: column; gap: 10px; }
.saucer {
  width: 86px; height: 86px;
  border-radius: 50%;
  border: 5px solid var(--surface-2);
  background: var(--surface);
  display: flex; flex-wrap: wrap; gap: 1px;
  align-content: center; justify-content: center;
  font-size: 1.05rem;
  position: relative;
}
.saucer .chip { min-width: 26px; min-height: 26px; font-size: 1.05rem; }
.saucer small {
  position: absolute; bottom: -2px; left: 0; right: 0;
  text-align: center; font-size: .55rem; font-weight: 900;
  text-transform: uppercase; opacity: .8;
}
.saucer--fat { background: var(--c-fat-soft); }
.saucer--fat small { color: var(--c-fat-ink); }
.saucer--treat { background: var(--c-treat-soft); }
.saucer--treat small { color: var(--c-treat-ink); }

.chip {
  border: 0; background: none; padding: 0; cursor: pointer;
  line-height: 1;
  min-width: 30px; min-height: 30px;
  display: grid; place-items: center;
  position: relative; z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3));
  animation: pop .25s ease;
}

/* Одна категорія за раз — сітка, що заповнює вільну висоту й НЕ гортається.
   Найбільша категорія на 4 рівні — 16 овочів; у чотирьох рядах по п'ять
   вони вміщаються навіть на 375×667.

   Селектор навмисно по ID, а не по класу `.tray`: той самий клас висить і
   на Коморі кухні, і сітка складала її п'ять груп у 58-пікселеві колонки —
   заголовки категорій налазили один на одного. */
#tray {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  /* Ряд НЕ розтягується на всю вільну висоту: у категорії «Свято» їх усього
     п'ять, і одна фішка заввишки в пів екрана виглядає як помилка. Висота
     їде від екрана, щоб на 375×667 чотири ряди овочів усе одно вмістились
     без жодного скролу. */
  grid-auto-rows: clamp(46px, 8dvh, 64px);
  gap: 5px;
  align-content: start;
  overflow: hidden;
}
#tray .tray__empty { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; font-weight: 700; }
/* Комора — звичайний потік зі стрічками, панель кухні гортається сама */
#kitchenTray { display: block; }

.ing {
  min-width: 0; min-height: 0;
  padding: 4px 2px 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: var(--r-m);
  border: 2px solid transparent;
  background: var(--surface);
  cursor: pointer;
  font-size: clamp(1.1rem, 5.5vw, 1.5rem);
  box-shadow: var(--shadow);
  transition: transform .08s ease;
  overflow: hidden;
}
.ing:active { transform: translateY(3px); box-shadow: none; }
.ing { position: relative; }
.ing.is-new::after {
  content: "нове";
  position: absolute; top: 0; right: 0;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--terra); color: #fff;
  font-size: .5rem; font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.ing small {
  font-size: .53rem; font-weight: 800; color: var(--ink-2);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ing--veg { border-color: var(--c-veg); background: var(--c-veg-soft); }
.ing--carb { border-color: var(--c-carb); background: var(--c-carb-soft); }
.ing--protein { border-color: var(--c-pro); background: var(--c-pro-soft); }
.ing--fat { border-color: var(--c-fat); background: var(--c-fat-soft); }
.ing--treat { border-color: var(--c-treat); background: var(--c-treat-soft); }

.shift-hud {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; font-weight: 800; color: var(--muted);
  margin-bottom: 6px;
}

/* ---------- 8. Оцінка ---------- */

.verdict { text-align: center; padding: 8px 0; }
.verdict__stars { font-size: 2rem; letter-spacing: 4px; }
.verdict__title { font-weight: 900; font-size: 1.15rem; margin-top: 4px; }
.verdict__coins { font-weight: 900; color: var(--lemon); font-size: 1.1rem; }

.breakdown { display: grid; gap: 6px; margin: 10px 0; }
.breakdown__row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 7px 10px; border-radius: var(--r-s);
  background: var(--surface-2); font-size: .85rem; font-weight: 700;
}
.breakdown__row .ok { color: var(--leaf); font-weight: 900; }
.breakdown__row .bad { color: var(--terra); font-weight: 900; }
.breakdown__num { font-variant-numeric: tabular-nums; color: var(--muted); }

.meter-8020 { margin-top: 10px; }
.meter-8020__bar {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: var(--c-veg-soft); border: 1px solid var(--line);
  display: flex;
}
.meter-8020__base { background: var(--c-veg); }
.meter-8020__treat { background: var(--c-treat); }
.meter-8020__legend {
  display: flex; justify-content: space-between;
  font-size: .72rem; font-weight: 800; color: var(--muted); margin-top: 4px;
}

/* ---------- 9. Школа Шефа ---------- */

.quiz-stage {
  position: relative;
  height: 260px;
  display: grid; place-items: center;
  margin-bottom: 8px;
}
.quiz-card {
  width: 100%; max-width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-soft);
  padding: 22px 16px;
  text-align: center;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.quiz-card__emoji { font-size: 4rem; line-height: 1; }
.quiz-card__name { font-weight: 900; font-size: 1.15rem; margin-top: 8px; }
.quiz-card.gone-left { animation: flyLeft .3s ease forwards; }
.quiz-card.gone-right { animation: flyRight .3s ease forwards; }

.swipe-hint { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 900; color: var(--muted); }
.swipe-tag {
  position: absolute; top: 16px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 900; opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}
.swipe-tag--left {
  left: 8px; background: var(--c-veg-soft);
  color: var(--c-veg-ink); border: 2px solid var(--c-veg-ink);
}
.swipe-tag--right {
  right: 8px; background: var(--c-treat-soft);
  color: var(--c-treat-ink); border: 2px solid var(--c-treat-ink);
}

.quiz-progress { display: flex; gap: 3px; margin-bottom: 10px; }
.quiz-progress i {
  flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line);
}
.quiz-progress i.ok { background: var(--leaf); border-color: transparent; }
.quiz-progress i.no { background: var(--terra); border-color: transparent; }

.quiz-feedback {
  min-height: 52px;
  border-radius: var(--r-m);
  padding: 8px 10px;
  font-size: .86rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.quiz-feedback.ok { background: var(--c-veg-soft); border-color: var(--c-veg); }
.quiz-feedback.no { background: var(--c-pro-soft); border-color: var(--c-pro); }

/* ---------- 10. Магазин ---------- */

.shop-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.shop-tabs button {
  flex: 1; min-height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: .8rem; font-weight: 800; cursor: pointer;
}
.shop-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }

.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.shop-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.shop-item__e { font-size: 2rem; }
.shop-item__n { font-size: .8rem; font-weight: 800; }
.shop-item__d { font-size: .68rem; color: var(--muted); min-height: 2.2em; }
.shop-item .btn { padding: 8px 12px; min-height: 36px; font-size: .8rem; width: 100%; }
.shop-item.owned { opacity: .7; }

/* ---------- 11. Квест і стрік ---------- */

.streak-week { display: flex; gap: 4px; justify-content: space-between; margin: 10px 0; }
.streak-week i {
  flex: 1; aspect-ratio: 1; border-radius: var(--r-s);
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .9rem; font-style: normal;
}
.streak-week i.done { background: var(--lemon); border-color: transparent; }

.quest-photo {
  width: 100%; aspect-ratio: 4/3;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 2px dashed var(--line);
  display: grid; place-items: center;
  overflow: hidden; position: relative;
  margin-bottom: 10px;
}
.quest-photo img { width: 100%; height: 100%; object-fit: cover; }
.quest-photo__scan {
  position: absolute; left: 0; right: 0; height: 3px;
  background: var(--sea);
  box-shadow: 0 0 14px 3px var(--sea);
  animation: scan 1.1s linear infinite;
}
.quest-photo__hint { color: var(--muted); font-size: .85rem; padding: 12px; text-align: center; }

.chip-tag {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .7rem; font-weight: 800; margin-right: 4px;
}

/* ---------- 12. Тости і модалка ---------- */

.toast-host {
  position: fixed; left: 0; right: 0; bottom: 84px;
  z-index: 50; display: flex; flex-direction: column;
  align-items: center; gap: 6px; pointer-events: none;
  padding: 0 12px;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 9px 14px; border-radius: 999px;
  font-weight: 800; font-size: .85rem;
  animation: toastIn .3s ease;
  max-width: 100%;
}

dialog {
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  color: var(--ink);
  padding: 18px;
  max-width: 380px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-soft);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }

/* ---------- 13. Анімації ---------- */

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
@keyframes bump { 0%, 100% { transform: none; } 40% { transform: scale(1.22); } }
@keyframes nod { 0%, 100% { transform: none; } 30% { transform: rotate(-7deg) translateY(-3px); } 60% { transform: rotate(6deg); } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes cheer { 0%, 100% { transform: none; } 45% { transform: scale(1.07) rotate(-2deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flyLeft { to { transform: translateX(-140%) rotate(-18deg); opacity: 0; } }
@keyframes flyRight { to { transform: translateX(140%) rotate(18deg); opacity: 0; } }
@keyframes scan { 0% { top: 0; } 100% { top: 100%; } }

/* ---------- 14. Прохідна тераса ---------- */

.world-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
  background: #9ed6e2;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  contain: paint;
}

.world {
  position: absolute; left: 0; top: 0;
  width: 1750px; height: 939px;
  transform-origin: 0 0;
  will-change: transform;
}
/* Кольорокорекція ЗАПЕЧЕНА в сам файл (Pillow: Color 1.18, Contrast 1.04,
   Brightness 1.03). CSS-фільтр тут висів постійно на поверхні 1750×939, а
   вона зсувається кожен кадр разом із камерою — тобто браузер перефільтровував
   усю сцену 60 разів на секунду. Це була найдорожча річ у грі. */
.world__ground {
  position: absolute; left: 0; top: 0;
  width: 1750px; height: 939px; display: block;
}

/* диско-підлога — вмикається музикою з музичного автомата */
.world__disco {
  position: absolute; left: 0; top: 300px;
  width: 1750px; height: 639px;
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
  mix-blend-mode: hard-light;
  background:
    repeating-conic-gradient(
      #ff4d7d 0deg 90deg, #ffd93d 90deg 180deg,
      #4ddb9a 180deg 270deg, #4db2ff 270deg 360deg);
  background-size: 160px 160px;
}
.is-disco .world__disco { opacity: .5; animation: discoShift 1.6s steps(4) infinite; }
.is-disco .world__ground { filter: saturate(1.5) contrast(1.1) brightness(1.06); }
.is-disco .world__tint { background: radial-gradient(70% 50% at 50% 50%, rgba(255, 60, 160, .28), rgba(60, 20, 140, .42)); }

/* спалах на весь екран — для гегів і подій */
.world__flash {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(60% 45% at 50% 45%, var(--flash-c, #fff), transparent 72%);
}
.world__flash.go { animation: flashPop .55s ease-out; }
.world__actors { position: absolute; left: 0; top: 0; width: 1750px; height: 939px; }

.world__sea-shimmer {
  position: absolute; left: -160px; top: 70px;
  width: 2560px; height: 210px;
  background: repeating-linear-gradient(101deg,
      transparent 0 64px, rgba(255, 255, 255, .3) 64px 78px, transparent 78px 156px);
  opacity: .45;
  pointer-events: none;
  animation: seaDrift 11s linear infinite;
}

.world__gulls i {
  position: absolute;
  width: 26px; height: 12px;
  background:
    radial-gradient(circle at 100% 100%, transparent 68%, rgba(255,255,255,.92) 69% 78%, transparent 79%) left / 50% 100% no-repeat,
    radial-gradient(circle at 0 100%, transparent 68%, rgba(255,255,255,.92) 69% 78%, transparent 79%) right / 50% 100% no-repeat;
  animation: gullFly 26s linear infinite;
}
.world__gulls i:nth-child(1) { top: 54px; animation-duration: 24s; }
.world__gulls i:nth-child(2) { top: 96px; animation-duration: 33s; animation-delay: -9s; scale: .8; }
.world__gulls i:nth-child(3) { top: 132px; animation-duration: 29s; animation-delay: -17s; scale: .65; }

/* у координатах СВІТУ, не екрана */
.world__tint {
  position: absolute; left: 0; top: 0;
  width: 1750px; height: 939px;
  pointer-events: none;
}
/* віньєтка ледь помітна: сильніша знову міняла б колір того, хто скраю кадру */
.world__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(140% 110% at 50% 45%, transparent 72%, rgba(50, 22, 0, .14) 100%);
}

/* спрайт: точка прив'язки — під лапами */
.sp { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 100%; }
/* `will-change` тут піднімав ОКРЕМИЙ композиторський шар на кожен спрайт —
   під півсотні шарів на телефоні з'їдають пам'ять GPU й дають ті самі ривки,
   від яких мали б рятувати. Анімація ходьби промотує вузол сама, поки йде. */
.sp__body {
  position: absolute; left: 0; bottom: 0;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}
/* Тінь малює окремий вузол `.sp__shadow`. Другий шар тіні через
   `drop-shadow` висів на КОЖНОМУ спрайті — на повній терасі це 58 фільтрів
   поверх кадру, який рухається. Прибрано; візуально різниці майже немає. */
.sp__img { display: block; height: var(--h); width: auto; }
.sp__emoji { display: block; font-size: calc(var(--h) * .82); line-height: 1; }
/* М'який край дає радіальний градієнт, а не `filter: blur()`: сорок вісім
   розмиттів у кадрі — це сорок вісім окремих проходів композитора. */
.sp__shadow {
  position: absolute; left: 0; bottom: -3px;
  width: calc(var(--h) * .5); height: calc(var(--h) * .17);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(85, 38, 10, .34) 0%, rgba(85, 38, 10, .22) 55%, transparent 78%);
}

.sp.is-focus .sp__shadow { background: var(--lemon); opacity: .9; animation: focusPulse 1s ease-in-out infinite; }
/* Підсвітка лишається тільки на тому, на що дивишся, — це один спрайт,
   а не всі сорок вісім. */
.sp.is-focus .sp__img { filter: drop-shadow(0 0 9px var(--lemon)); }
.sp.pop-in { animation: popIn .45s cubic-bezier(.2, 1.5, .4, 1); }

.sp__bubble {
  position: absolute; left: 0; bottom: calc(var(--h) + 14px);
  width: 48px; height: 48px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  animation: floaty 2.6s ease-in-out infinite;
}
.sp__bubble::after {
  content: ""; position: absolute; bottom: -7px; left: 50%;
  width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
  background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line);
}
.sp__ring {
  position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(var(--leaf) var(--r, 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 63%);
  mask: radial-gradient(circle, transparent 61%, #000 63%);
}
.sp__bubble.is-crit .sp__ring { background: conic-gradient(var(--terra) var(--r, 0deg), transparent 0); }
.sp__bubble.is-crit { animation: floaty 2.6s ease-in-out infinite, critPulse .6s infinite; }
.sp__need { font-size: 1.45rem; line-height: 1; }

.sp__emote {
  position: absolute; left: 0; bottom: calc(var(--h) + 8px);
  transform: translateX(-50%);
  font-size: 2rem;
  animation: emoteUp 1.2s ease-out forwards;
}

/* дерев'яні вивіски — фіксовані кольори намальованого об'єкта */
.sign {
  position: absolute; left: 0; top: 0;
  width: 108px; margin-left: -54px; margin-top: -104px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 6px 6px;
  background: linear-gradient(180deg, #ecd0a3, #c99a63);
  border: 3px solid #7d5230;
  border-radius: 10px;
  box-shadow: 0 6px 0 rgba(70, 38, 10, .4);
  color: #34200d; font-weight: 900; font-size: .74rem;
}
.sign::after {
  content: ""; position: absolute; bottom: -28px; left: 50%;
  width: 13px; height: 28px; transform: translateX(-50%);
  background: #7d5230; border-radius: 0 0 3px 3px;
}
.sign__e { font-size: 1.55rem; line-height: 1.1; }
.sign.is-focus { outline: 3px solid var(--lemon); outline-offset: 3px; animation: focusPulse 1s ease-in-out infinite; }
.sign.is-new::before {
  content: "!";
  position: absolute; top: -12px; right: -10px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--terra); color: #fff;
  font-size: .9rem; font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  animation: floaty 1.4s ease-in-out infinite;
}

.dust {
  position: absolute; left: 0; top: 0;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: rgba(255, 244, 227, .8);
  pointer-events: none;
  animation: dustPuff .55s ease-out forwards;
}

/* HUD світу */
.world-hud {
  position: absolute; left: 10px; right: 10px; top: 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  pointer-events: none;
}
.world-hud__chip, .world-hud__hint {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  max-width: 100%;
}
.world-hud__chip { font-size: .82rem; }
.world-hud__hint { font-size: .7rem; color: var(--muted); }

/* Стос кнопок унизу. Дві причини, чому «Зібрати виноград» не натискалась:
   (1) `bottom: 10px` без `env(safe-area-inset-bottom)` — на телефоні з жестовою
   смугою кнопка опинялась просто під нею, і тап з'їдала система;
   (2) у `column-reverse` перший у DOM (`#worldAction`) лягав НАЙНИЖЧЕ, тобто
   контекстна дія займала найгірше місце зі стосу.
   Тепер дія стоїть НАГОРІ стосу, а кнопки зміни ховаються, поки є що зробити:
   коли ти стоїш біля винограду, «Денна зміна» — це шум. */
.world-cta {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 10px;
}
.world-cta > * { pointer-events: auto; max-width: 100%; }
#worldAction { order: 2; }
.world-cta.has-action .world-action--start,
.world-cta.has-action .world-action--evening,
.world-cta.has-action .world-action--show { display: none; }

.world-action {
  border: 0;
  border-radius: 999px;
  min-height: 50px;
  padding: 10px 20px;
  background: var(--lemon);
  color: var(--lemon-ink);
  font-weight: 900;
  font-size: .95rem;
  box-shadow: 0 5px 0 rgba(80, 45, 0, .35);
  cursor: pointer;
  animation: ctaPop .28s cubic-bezier(.2, 1.5, .4, 1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.world-action:active { transform: translateY(3px); box-shadow: none; }

/* ---------- 15. Шторка замовлення ---------- */

.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet__scrim {
  position: absolute; inset: 0;
  background: rgba(25, 12, 0, .5);
  opacity: 0; transition: opacity .25s;
}
.sheet.is-open .sheet__scrim { opacity: 1; }

/* Шторка — це ЕКРАН, а не сувій. Панель заввишки рівно у в'юпорт і не
   гортається сама; гортатись усередині неї має право тільки вердикт, де
   справді буває багато тексту. Раніше тут було три вкладені скрол-контейнери
   (панель → таця → стрічка категорії), палець ловив не той, а протяг угору
   на верхньому краю ще й перезавантажував сторінку. */
.sheet__panel {
  position: absolute; left: 50%; bottom: 0;
  width: 100%; max-width: 480px;
  height: 100dvh; max-height: 100dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  transform: translate(-50%, 100%);
  background: var(--bg);
  border-radius: var(--r-l) var(--r-l) 0 0;
  border-top: 1px solid var(--line);
  padding: 4px 12px calc(env(safe-area-inset-bottom) + 10px);
  transition: transform .3s cubic-bezier(.2, .9, .3, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
}
.sheet__panel > * { flex: none; }

#orderPhase {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 6px;
}
#verdictPhase {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
}

/* Вкладка категорії. П'ять штук в один ряд — вибір видно цілком, гортати
   нічого не треба. */
.tray-tabs {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; flex: none;
}
.tray-tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 2px 4px;
  border-radius: var(--r-m);
  border: 2px solid var(--line);
  background: var(--surface);
  font-size: .58rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .02em;
  cursor: pointer; line-height: 1.1;
  touch-action: manipulation;
}
.tray-tabs button i { font-style: normal; font-size: 1.05rem; line-height: 1; }
.tray-tabs button[aria-selected="true"] { border-color: currentColor; }
.tray-tabs button.tab--veg   { color: var(--c-veg-ink); }
.tray-tabs button.tab--carb  { color: var(--c-carb-ink); }
.tray-tabs button.tab--pro   { color: var(--c-pro-ink); }
.tray-tabs button.tab--fat   { color: var(--c-fat-ink); }
.tray-tabs button.tab--treat { color: var(--c-treat-ink); }
.tray-tabs button[aria-selected="true"].tab--veg   { background: var(--c-veg-soft); }
.tray-tabs button[aria-selected="true"].tab--carb  { background: var(--c-carb-soft); }
.tray-tabs button[aria-selected="true"].tab--pro   { background: var(--c-pro-soft); }
.tray-tabs button[aria-selected="true"].tab--fat   { background: var(--c-fat-soft); }
.tray-tabs button[aria-selected="true"].tab--treat { background: var(--c-treat-soft); }
/* категорія, якої гостю бракує, підсвічується сама — це і є «умова +1» */
.tray-tabs button.is-need { animation: needPulse 1.4s ease-in-out infinite; }
@keyframes needPulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 32%, transparent); }
}
.sheet.is-open .sheet__panel { transform: translate(-50%, 0); }
.sheet__panel.shake { animation: shake .4s ease; }
.sheet__grip { width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 4px auto 8px; }

.queue { display: flex; gap: 6px; align-items: center; min-height: 36px; margin-bottom: 4px; overflow-x: auto; }
.queue__item {
  position: relative; flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: end center;
}
.queue__item img { width: 40px; }
.queue__item i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--leaf); }
.queue__item.is-crit i { background: var(--terra); }
.queue__item.is-crit { animation: critPulse .6s infinite; }
.queue__none { font-size: .72rem; color: var(--muted); font-weight: 700; }

.zone-ok { animation: zoneOk .9s ease; }
.zone-bad { animation: zoneBad .9s ease; }

.ing__e { display: block; line-height: 1; }
.shop-item__art { width: 62px; height: 62px; object-fit: contain; }

/* ---------- 16. Ефекти поверх усього ---------- */

.fx-host { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.fx-coin, .fx-fly { position: absolute; left: 0; top: 0; font-size: 1.7rem; line-height: 1; will-change: transform; }
.fx-confetti { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 2px; }

/* ---------- 17. Анімації світу ---------- */

@keyframes seaDrift { to { transform: translateX(-156px); } }
@keyframes gullFly {
  from { transform: translateX(-60px); }
  to   { transform: translateX(1520px); }
}
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes focusPulse { 0%, 100% { opacity: .9; } 50% { opacity: .45; } }
@keyframes critPulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.35); } }
@keyframes emoteUp {
  from { opacity: 0; translate: 0 6px; scale: .6; }
  30%  { opacity: 1; scale: 1.15; }
  to   { opacity: 0; translate: 0 -46px; scale: 1; }
}
@keyframes dustPuff {
  from { opacity: .8; scale: .35; }
  to   { opacity: 0; scale: 1.7; }
}
@keyframes popIn { from { scale: .25; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes ctaPop { from { scale: .8; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes zoneOk {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--c-veg); }
  30%      { box-shadow: inset 0 0 0 5px var(--leaf); }
}
@keyframes zoneBad {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--terra); }
  30%      { box-shadow: inset 0 0 0 5px var(--terra); }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .world__tint {
    /* РІВНОМІРНО. Градієнт по екрану міняв колір персонажа залежно від того,
       де він опинився в кадрі — кішка «сіріла», коли йшла вгору. */
    background: rgba(24, 42, 82, .20);
  }
  :root:not([data-theme="light"]) .world__sea-shimmer { opacity: .2; }
}
:root[data-theme="dark"] .world__tint {
  background:
    radial-gradient(58% 42% at 60% 52%, rgba(255, 196, 110, .30), transparent 72%),
    linear-gradient(180deg, rgba(20, 40, 86, .40), rgba(52, 28, 70, .26));
}
:root[data-theme="dark"] .world__sea-shimmer { opacity: .2; }

/* ---------- 18. Приколи на терасі ---------- */

/* ---------- 19. Замовлення, меню, руки ---------- */

.order-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.order-card__dish { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.order-card__dish span { font-size: 1.5rem; }
.order-card__hands { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.hand-bit {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .74rem; font-weight: 800;
  white-space: nowrap;
}
.hand-bit--veg   { background: var(--c-veg-soft);   color: var(--c-veg-ink); }
.hand-bit--carb  { background: var(--c-carb-soft);  color: var(--c-carb-ink); }
.hand-bit--pro   { background: var(--c-pro-soft);   color: var(--c-pro-ink); }
.hand-bit--fat   { background: var(--c-fat-soft);   color: var(--c-fat-ink); }
.hand-bit--treat { background: var(--c-treat-soft); color: var(--c-treat-ink); }

/* картки пояснення руки */
.hand-card {
  display: flex; gap: 10px; align-items: center;
  padding: 10px;
  border-radius: var(--r-m);
  margin-top: 8px;
  border: 1px solid var(--line);
}
.hand-card img { width: 118px; height: auto; max-height: 92px; object-fit: contain; flex: none; }
/* тільки заголовок картки блоковий — <b> усередині тексту має лишатись рядковим */
.hand-card > div > b { display: block; font-size: .92rem; margin-bottom: 2px; }
.hand-card p { font-size: .78rem; color: var(--ink-2); margin: 0; line-height: 1.35; }
.hand-card--veg  { background: var(--c-veg-soft); }
.hand-card--carb { background: var(--c-carb-soft); }
.hand-card--pro  { background: var(--c-pro-soft); }
.hand-card--fat  { background: var(--c-fat-soft); }

/* меню */
.menu-grid { display: grid; gap: 6px; margin-top: 8px; }
.menu-item {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.menu-item__e { font-size: 1.6rem; }
.menu-item b { display: block; font-size: .84rem; }
.menu-item small { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.menu-item.locked { opacity: .5; }
.menu-item__tag {
  position: absolute; top: 6px; right: 8px;
  font-style: normal; font-size: .85rem;
}

/* колекція атрибутів Короля */
.attr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.attr-item {
  padding: 10px 4px; text-align: center;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .62rem; font-weight: 800;
}
.attr-item .e { display: block; font-size: 1.8rem; line-height: 1.2; }
.attr-item.locked { opacity: .45; }

/* фанат світиться — щоб було видно, що це рідкісний гість */
.sp--fan .sp__img { filter: drop-shadow(0 0 10px #ffd0f0) drop-shadow(0 4px 4px rgba(70, 30, 0, .28)); }

.world-action--evening { background: linear-gradient(180deg, #7b7ce0, #4d4fb0); color: #f2f0ff; box-shadow: 0 5px 0 rgba(20, 16, 70, .45); }
.world-action--show { background: linear-gradient(180deg, #ff7ab8, #d63c8a); color: #fff4fa; box-shadow: 0 5px 0 rgba(90, 10, 55, .45); }

.hud-track {
  position: absolute; z-index: 12;
  top: calc(env(safe-area-inset-top) + 92px); right: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  font-size: .72rem; font-weight: 800;
  pointer-events: none;
  max-width: 44%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* монета на терасі: вилітає з гостя, підстрибує й чекає, поки її заберуть */
.coin {
  position: absolute; left: 0; top: 0;
  font-size: 1.9rem; line-height: 1;
  margin: -18px 0 0 -18px;
  pointer-events: none;
  /* `text-shadow` замість `drop-shadow`: тінь та сама, але це не фільтр,
     тобто не окремий прохід композитора на кожну з трьох десятків монет. */
  text-shadow: 0 3px 3px rgba(70, 30, 0, .45);
  animation: coinToss .45s var(--d, 0s) cubic-bezier(.2, 1.4, .4, 1) both,
             coinIdle 1.5s var(--d, 0s) ease-in-out infinite .45s;
}
@keyframes coinToss {
  from { translate: calc(var(--fx) * -1) calc(var(--fy) * -1 - 40px); scale: .3; opacity: 0; }
  60%  { opacity: 1; }
  to   { translate: 0 0; scale: 1; opacity: 1; }
}
@keyframes coinIdle { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

/* купка від Мобі — підсвічена, бо це задача, а не декор */
.floor-fx.mess { animation: floorPlop .4s cubic-bezier(.2, 1.6, .4, 1), messNudge 2s ease-in-out infinite .4s; }
@keyframes messNudge { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }

/* те, що лишається на підлозі: калюжа, хмарка, крихти */
.floor-fx {
  position: absolute; left: 0; top: 0;
  font-size: 2.4rem; line-height: 1;
  margin: -22px 0 0 -22px;
  pointer-events: none;
  animation: floorPlop .4s cubic-bezier(.2, 1.6, .4, 1);
}
.floor-fx.fade { animation: floorFade .8s ease forwards; }

/* смердюча хмара */
.stink {
  position: absolute; left: 0; top: 0;
  width: 120px; height: 90px;
  margin: -70px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 60%, rgba(150, 220, 120, .78), rgba(120, 200, 90, .1) 70%);
  filter: blur(3px);
  pointer-events: none;
  animation: stinkRise 2.4s ease-out forwards;
}

/* репліка гега над персонажем */
.float-text {
  position: absolute; left: 0; top: 0;
  transform: translateX(-50%);
  font-weight: 900;
  font-size: 1.05rem;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  pointer-events: none;
  animation: floatUp 1.8s ease-out forwards;
}
.float-text--gain { color: var(--lemon-ink); background: var(--lemon); border-color: transparent; }
.float-text--gross { color: #2c5c1f; background: #c9e9a8; border-color: #8fc46a; }

/* блиск навколо кота-короля */
.sp__sparkle {
  position: absolute; left: 0; bottom: 0;
  font-size: 1.1rem;
  pointer-events: none;
  animation: sparkleUp 1s ease-out forwards;
}

/* колекція конфузів у книзі шефа */
.gag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.gag-item {
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface-2);
  padding: 8px 6px;
  text-align: center;
  font-size: .64rem; font-weight: 800;
}
.gag-item .e { display: block; font-size: 1.7rem; line-height: 1.2; }
.gag-item.locked { opacity: .45; }
.gag-item.locked .e { filter: grayscale(1); }

/* кнопка «Відкрити зміну» — окремий, зеленіший акцент */
.world-action--start {
  background: linear-gradient(180deg, #62c98a, #3d9e63);
  color: #06240f;
  box-shadow: 0 5px 0 rgba(10, 60, 25, .4);
}

/* музичний автомат світиться, коли грає */
.is-disco .sp--jukebox .sp__img { filter: drop-shadow(0 0 14px #ff70b8) drop-shadow(0 4px 4px rgba(70, 30, 0, .28)); }
.sp--glove .sp__body { animation: glovePulse 1.6s ease-in-out infinite; }

/* зламаний Мобі столик */
.sp--table.is-broken .sp__body { transform: translateX(-50%) rotate(-13deg); filter: grayscale(.45); }
.sp--table.is-broken .sp__shadow { opacity: .4; }

@keyframes discoShift { to { background-position: 160px 160px; } }
@keyframes flashPop { 0% { opacity: 0; } 25% { opacity: .85; } 100% { opacity: 0; } }
@keyframes floorPlop { from { scale: .2; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes floorFade { to { opacity: 0; scale: 1.3; } }
@keyframes stinkRise {
  from { opacity: 0; translate: 0 0; scale: .4; }
  25%  { opacity: .95; }
  to   { opacity: 0; translate: 0 -70px; scale: 1.5; }
}
@keyframes floatUp {
  from { opacity: 0; translate: 0 0; scale: .6; }
  20%  { opacity: 1; scale: 1.15; }
  to   { opacity: 0; translate: 0 -68px; scale: 1; }
}
@keyframes sparkleUp {
  from { opacity: 1; translate: 0 0; scale: .5; }
  to   { opacity: 0; translate: var(--sx, 12px) -54px; scale: 1.2; }
}
@keyframes glovePulse { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .quest-photo__scan, .world__sea-shimmer, .world__gulls, .world__disco { display: none; }
}


/* ---------- 20. Режими зміни ----------
   Мають перебивати тон теми, тому стоять останніми і специфічніші за
   `:root:not([data-theme="light"]) .world__tint`. */

.world-wrap.is-evening .world__tint {
  background:
    radial-gradient(30% 22% at 63% 43%, rgba(255, 196, 110, .42), transparent 70%),
    radial-gradient(22% 16% at 20% 62%, rgba(255, 170, 90, .30), transparent 72%),
    rgba(22, 34, 88, .52);
}
/* Вечір робиться ТОНОМ (`world__tint` уже лежить під шаром акторів), а не
   фільтром по всій сцені: фільтр коштував той самий повний перемальовок. */
.world-wrap.is-evening .world { filter: none; }
.world-wrap.is-evening .world__sea-shimmer { opacity: .12; }

.world-wrap.is-show .world__tint {
  background: radial-gradient(26% 20% at 50% 62%, rgba(255, 240, 200, .55), rgba(40, 10, 70, .60) 75%);
}
.world-wrap.is-show .world { filter: none; }

/* ---------- 21. Меню гри й форма Кішки ---------- */

.panel--menu .panel__inner { padding-top: calc(env(safe-area-inset-top) + 24px); }

.menu-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.menu-hero img { width: 92px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }

.menu-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 14px;
}
.menu-stat {
  padding: 8px 4px; text-align: center;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.menu-stat span { display: block; font-size: 1.1rem; }
.menu-stat b { display: block; font-size: .95rem; font-variant-numeric: tabular-nums; }
.menu-stat small { display: block; font-size: .56rem; color: var(--muted); line-height: 1.2; }

.form-bar {
  height: 14px; margin: 10px 0 6px;
  border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.form-bar i { display: block; height: 100%; transition: width .6s cubic-bezier(.2, .9, .3, 1); }
.form-bar i.is-dull  { background: linear-gradient(90deg, #8b8378, #a8a094); }
.form-bar i.is-ok    { background: linear-gradient(90deg, color-mix(in srgb, var(--lemon) 60%, transparent), var(--lemon)); }
.form-bar i.is-shine { background: linear-gradient(90deg, var(--lemon), var(--leaf)); }
.form-now { font-size: .8rem; color: var(--ink-2); }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.form-item {
  padding: 8px 4px; text-align: center;
  border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .72rem; font-weight: 800;
}
.form-item img { width: 100%; max-width: 72px; height: 86px; object-fit: contain; }
.form-item small { display: block; font-weight: 700; color: var(--muted); font-size: .6rem; }
.form-item.is-now { border-color: var(--lemon); background: color-mix(in srgb, var(--lemon) 16%, var(--surface-2)); }

/* коли Кішка в найкращій формі — на терасі за нею тягнеться блиск */
.world-wrap.is-shine .sp--player .sp__img {
  filter: drop-shadow(0 0 10px rgba(255, 224, 140, .85)) drop-shadow(0 4px 4px rgba(70, 30, 0, .28));
}

/* родина — окремий вигляд, це не звичайні гості */
.sp--family .sp__img { filter: drop-shadow(0 0 9px #ffe9a8) drop-shadow(0 4px 4px rgba(70, 30, 0, .28)); }

/* ---------- 22. Школа: сортування по БЖВ ---------- */

.quiz-q {
  text-align: center;
  font-size: .92rem; font-weight: 900;
  margin: 4px 0 8px;
}

.quiz-opts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px; margin-bottom: 10px;
}
.quiz-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 62px; padding: 8px 4px;
  border-radius: var(--r-m);
  border: 2px solid var(--line);
  background: var(--surface);
  font-size: .7rem; font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease;
}
.quiz-opt:active { transform: translateY(3px); box-shadow: none; }
.quiz-opt[disabled] { cursor: default; opacity: .55; box-shadow: none; }
.quiz-opt__e { font-size: 1.35rem; line-height: 1; }

.quiz-opt--veg    { border-color: var(--c-veg);   background: var(--c-veg-soft);   color: var(--c-veg-ink); }
.quiz-opt--carb   { border-color: var(--c-carb);  background: var(--c-carb-soft);  color: var(--c-carb-ink); }
.quiz-opt--pro    { border-color: var(--c-pro);   background: var(--c-pro-soft);   color: var(--c-pro-ink); }
.quiz-opt--fat    { border-color: var(--c-fat);   background: var(--c-fat-soft);   color: var(--c-fat-ink); }
.quiz-opt--treat  { border-color: var(--c-treat); background: var(--c-treat-soft); color: var(--c-treat-ink); }

.quiz-opt.is-right { opacity: 1; border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 40%, transparent); }
.quiz-opt.is-wrong { opacity: 1; border-color: var(--terra); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 40%, transparent); }

.quiz-card.shake { animation: shake .4s ease; }

/* варіанти «для чого» — свої кольори, щоб не зливались із зонами тарілки */
.quiz-opt--energy { border-color: #d98324; background: color-mix(in srgb, #d98324 16%, var(--surface)); }
.quiz-opt--muscle { border-color: #c0504d; background: color-mix(in srgb, #c0504d 16%, var(--surface)); }
.quiz-opt--brain  { border-color: #8a5fbf; background: color-mix(in srgb, #8a5fbf 16%, var(--surface)); }
.quiz-opt--eyes   { border-color: #2f8fa8; background: color-mix(in srgb, #2f8fa8 16%, var(--surface)); }
.quiz-opt--party  { border-color: #cf5f9b; background: color-mix(in srgb, #cf5f9b 16%, var(--surface)); }

/* ---------- 23. Сцена візиту родини ---------- */

.panel--family .panel__inner { padding-top: calc(env(safe-area-inset-top) + 20px); }

.fam-cast { display: flex; justify-content: center; gap: 4px; margin-bottom: 6px; }
.fam-cast img { height: 92px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3)); }

.fam-title {
  text-align: center; font-weight: 900; font-size: 1.15rem;
  margin-bottom: 12px;
}

.fam-bubble {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 2px solid var(--lemon);
  margin-bottom: 12px;
}
.fam-bubble.shake { animation: shake .4s ease; }
.fam-bubble img { width: 46px; flex: none; }
.fam-bubble b { display: block; font-size: .8rem; color: var(--muted); }
.fam-bubble p { margin: 0; font-size: .95rem; font-weight: 700; line-height: 1.3; }

.fam-tray {
  display: flex; justify-content: center; gap: 10px;
  font-size: 2.4rem; margin-bottom: 10px;
  padding: 10px;
  border-radius: var(--r-m);
  background: var(--c-treat-soft);
  border: 1px solid var(--line);
}

.fam-opts { display: grid; gap: 8px; }
.fam-opt {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-m);
  border: 2px solid var(--line);
  background: var(--surface);
  text-align: left;
  font-size: .88rem; font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.fam-opt:active { transform: translateY(3px); box-shadow: none; }
.fam-opt[disabled] { opacity: .55; box-shadow: none; cursor: default; }
.fam-opt--dish b { display: block; font-size: .95rem; }
.fam-opt--dish small { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }

.fam-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .86rem; font-weight: 700; line-height: 1.35;
}
.fam-feedback.ok { background: var(--c-veg-soft); border-color: var(--c-veg); }
.fam-feedback.no { background: var(--c-pro-soft); border-color: var(--c-pro); }
#famNext { margin-top: 12px; }

/* ---------- 24. Помічники й буйство Мобі ---------- */

/* куплені кошенята: менші за гостей і з блакитним обідком, щоб не плутались */
.sp--helper .sp__img {
  filter: drop-shadow(0 0 8px rgba(120, 200, 255, .8)) drop-shadow(0 3px 3px rgba(70, 30, 0, .25));
}
.sp__badge {
  position: absolute;
  left: 50%; top: -14px;
  transform: translateX(-50%);
  font-size: 1rem; line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
  pointer-events: none;
}

/* Мобі вразнос: червоне світіння і трясця, щоб його було видно через пів тераси */
.sp--rage .sp__img {
  filter: drop-shadow(0 0 14px #ff4d4d) drop-shadow(0 4px 4px rgba(70, 30, 0, .3));
}
.sp--rage .sp__body { animation: rageShake .28s linear infinite; }
.sp--rage .sp__shadow { background: var(--terra); opacity: .8; }

@keyframes rageShake {
  0%, 100% { translate: -1px 0; }
  50%      { translate: 1px -2px; }
}

/* ---------- 25. Картка механіки й сітка «Що є в грі» ---------- */

/* спливає раз на механіку, поверх тераси, але нижче за панелі */
.hint-card {
  position: absolute; z-index: 15;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  width: min(380px, calc(100% - 24px));
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 12px 14px;
  border-radius: var(--r-l);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 2px solid var(--sea);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .34);
}
.hint-card.pop { animation: ctaPop .34s cubic-bezier(.2, 1.5, .4, 1); }
.hint-card__e { font-size: 2rem; line-height: 1; align-self: center; }
.hint-card__body b { display: block; font-size: .95rem; }
.hint-card__body p { margin: 2px 0 0; font-size: .8rem; color: var(--ink-2); line-height: 1.35; }
.hint-card__ok { grid-column: 1 / -1; min-height: 38px; padding: 6px 14px; margin-top: 2px; }

.feat-grid { display: grid; gap: 6px; margin-top: 8px; }
.feat-item {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.feat-item__e { font-size: 1.5rem; line-height: 1; }
.feat-item b { display: block; font-size: .82rem; }
.feat-item p { margin: 2px 0 0; font-size: .7rem; color: var(--muted); line-height: 1.3; }
.feat-item.locked { opacity: .5; }
.feat-item.locked .feat-item__e { filter: grayscale(1); }

/* ---------- 26. Мірка на самому продукті ----------
   ✋ і 🖐️ на 20 px не розрізняються, а «жменя» і «долоня» звучать однаково.
   Тому в таці стоїть намальована рука, та сама, що й у Книзі шефа. */

.ing__hand {
  position: absolute; top: -7px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 22px; object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.ing__hand--treat {
  display: grid; place-items: center;
  font-size: .5rem; font-weight: 900;
  color: var(--c-treat-ink);
}

.tray__hand {
  width: 26px; height: 18px; object-fit: contain;
  vertical-align: -3px; margin-right: 2px;
}

/* оманливі продукти в Книзі шефа */
.tricky-grid { display: grid; gap: 6px; margin-top: 8px; }
.tricky-item {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
}
.tricky-item--veg   { background: var(--c-veg-soft); }
.tricky-item--carb  { background: var(--c-carb-soft); }
.tricky-item--pro   { background: var(--c-pro-soft); }
.tricky-item--fat   { background: var(--c-fat-soft); }
.tricky-item--treat { background: var(--c-treat-soft); }
.tricky-item__e { font-size: 1.7rem; line-height: 1; }
.tricky-item b { display: block; font-size: .8rem; }
.tricky-item p { margin: 2px 0 0; font-size: .7rem; color: var(--ink-2); line-height: 1.3; }
.tricky-item__hand { text-align: center; flex: none; }
.tricky-item__hand img { display: block; width: 48px; height: 34px; object-fit: contain; }
.tricky-item__hand small { font-size: .55rem; font-weight: 900; color: var(--muted); }

/* ---------- 27. Екран завантаження ----------
   Тримає гру, поки не приїде весь арт. Без нього гості й руки
   довантажувались уже посеред зміни. */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-content: center; justify-items: center;
  gap: 10px;
  background: var(--bg);
  transition: opacity .4s ease;
}
.boot.is-gone { opacity: 0; pointer-events: none; }
.boot__cat { width: 130px; animation: floaty 2.2s ease-in-out infinite; }
.boot__title { font-size: 1.5rem; font-weight: 900; letter-spacing: -.01em; }
.boot__bar {
  width: min(240px, 60vw); height: 10px;
  border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.boot__bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--lemon), var(--leaf));
  transition: width .25s ease;
}
.boot__note { font-size: .78rem; font-weight: 700; color: var(--muted); }

/* ---------- 28. Замовлення: потреба замість рецепта ---------- */

.order-card__need { display: flex; align-items: center; gap: 8px; }
.order-card__need > span { font-size: 1.7rem; line-height: 1; }
.order-card__need b { display: block; font-size: .95rem; }
.order-card__need small { display: block; font-size: .8rem; font-weight: 800; color: var(--sea); }

/* база стоїть перед очима щоразу однакова — саме її треба запам'ятати */
.base-plate {
  margin-top: 8px; padding: 7px 9px;
  border-radius: var(--r-s);
  background: var(--surface);
  border: 1px dashed var(--line);
}
.base-plate__t {
  font-size: .58rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 4px;
}
.order-card__tip {
  width: 100%; min-height: 34px; margin-top: 8px;
  padding: 6px 10px; font-size: .78rem;
}
.tip-why {
  font-size: .78rem; font-weight: 700; line-height: 1.35;
  color: var(--ink-2); margin: 8px 0 4px;
}

.verdict__why {
  margin: 4px 0 10px; padding: 9px 11px;
  border-radius: var(--r-m);
  background: var(--c-veg-soft);
  border: 1px solid var(--c-veg);
  font-size: .82rem; line-height: 1.4;
}

/* ---------- 29. Вітрина колекції та яхта ---------- */

/* полиці вітрини: порожні місця видно так само добре, як зайняті —
   колекція має показувати, чого ще нема */
.vitrine__shelf {
  position: absolute;
  left: 50%; bottom: 34%;
  transform: translateX(-50%);
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 2px 6px;
  font-size: 1.05rem; line-height: 1;
  pointer-events: none;
  text-align: center;
}
.vitrine__shelf span { opacity: .25; filter: grayscale(1); }
.vitrine__shelf span.is-got { opacity: 1; filter: none; }
.sp--vitrine.is-focus .vitrine__shelf span.is-got { animation: floaty 1.8s ease-in-out infinite; }

/* яхта стоїть у морі — тіні на воді бути не може */
.sp--yacht .sp__shadow { display: none; }
.sp--yacht .sp__img { filter: drop-shadow(0 2px 3px rgba(20, 60, 90, .3)); }

/* категорія, яку потреба гостя зсунула від бази — щоб око чіплялось саме за неї */
.hand-bit.is-moved {
  outline: 2px solid currentColor;
  outline-offset: 1px;
  font-weight: 900;
}

/* ---------- 30. Дорослий щабель Школи ---------- */

/* картка-симптом читається як питання, а не як продукт */
.quiz-card--nutri .quiz-card__emoji { font-size: 2.6rem; }
.quiz-card--nutri .quiz-card__name { font-size: .98rem; line-height: 1.3; font-weight: 800; }

.quiz-opt--protein { border-color: var(--c-pro);   background: var(--c-pro-soft);   color: var(--c-pro-ink); }
.quiz-opt--iron    { border-color: #b3474f; background: color-mix(in srgb, #b3474f 16%, var(--surface)); }
.quiz-opt--calcium { border-color: #7a8ca3; background: color-mix(in srgb, #7a8ca3 18%, var(--surface)); }
.quiz-opt--vitc    { border-color: #e08a1e; background: color-mix(in srgb, #e08a1e 18%, var(--surface)); }
.quiz-opt--omega   { border-color: #2f8fa8; background: color-mix(in srgb, #2f8fa8 16%, var(--surface)); }
.quiz-opt--fiber   { border-color: #8a7a3f; background: color-mix(in srgb, #8a7a3f 18%, var(--surface)); }

/* шість варіантів замість п'яти — фідбек із їжею стає вищим */
.quiz-feedback { min-height: 62px; }

/* значок стану гостя — той самий персонаж, але сьогодні він на бігу */
.sp__mood {
  position: absolute;
  left: 50%; top: -6px;
  transform: translateX(-50%);
  font-size: .95rem; line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
  pointer-events: none;
  z-index: 3;
}

/* ---------- 31. «Як влаштована гра» — лендінг у меню ---------- */

.panel--about .panel__inner { max-width: 560px; }

.lp-hero {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.lp-hero img { width: 104px; flex: none; filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .3)); }
.lp-hero h1 { font-size: 1.7rem; }
.lp-hero__sub {
  margin: 0; font-size: .82rem; font-weight: 900;
  letter-spacing: .1em; text-transform: uppercase; color: var(--lemon);
}
.lp-hero__pitch { margin: 6px 0 0; font-size: .88rem; line-height: 1.4; color: var(--ink-2); }

.lp-nums {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 18px;
}
.lp-num {
  padding: 10px 4px; text-align: center;
  border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.lp-num b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.lp-num small { display: block; font-size: .58rem; color: var(--muted); line-height: 1.2; }

.lp-sec {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.lp-sec--hero { border-top: 0; }
.lp-kicker {
  display: inline-block; margin-bottom: 4px;
  font-size: .6rem; font-weight: 900; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sea);
}
.lp-sec h2 { font-size: 1.15rem; margin-bottom: 8px; }
.lp-sec p { font-size: .86rem; line-height: 1.45; color: var(--ink-2); }
.lp-note {
  margin-top: 10px; padding: 9px 11px;
  border-radius: var(--r-m);
  background: var(--surface-2); border-left: 3px solid var(--lemon);
  font-size: .8rem;
}

.lp-base { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.lp-base__cell { padding: 10px 4px; text-align: center; border-radius: var(--r-m); }
.lp-base__cell b { display: block; font-size: 1.4rem; }
.lp-base__cell small { font-size: .6rem; font-weight: 800; }
.lp-base__cell--veg   { background: var(--c-veg-soft);  color: var(--c-veg-ink); }
.lp-base__cell--carb  { background: var(--c-carb-soft); color: var(--c-carb-ink); }
.lp-base__cell--pro   { background: var(--c-pro-soft);  color: var(--c-pro-ink); }
.lp-base__cell--fat   { background: var(--c-fat-soft);  color: var(--c-fat-ink); }

.lp-needs { display: grid; gap: 4px; margin-top: 10px; }
.lp-need {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: var(--r-s);
  background: var(--surface-2); font-size: .82rem;
}
.lp-need__m { font-size: 1.05rem; }
.lp-need__t { font-weight: 800; }
.lp-need__a { color: var(--muted); }

.lp-steps { margin: 6px 0 0; padding-left: 20px; }
.lp-steps li { font-size: .86rem; line-height: 1.45; color: var(--ink-2); margin-bottom: 5px; }

.lp-levels { display: grid; gap: 6px; margin-top: 10px; }
.lp-level {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 11px; border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.lp-level > span { color: var(--lemon); letter-spacing: 1px; font-size: .8rem; }
.lp-level b { display: block; font-size: .84rem; }
.lp-level small { font-size: .68rem; color: var(--muted); }
.lp-level i { font-style: normal; font-size: .7rem; font-weight: 900; color: var(--muted); }

.lp-forms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.lp-form { margin: 0; text-align: center; }
.lp-form img { width: 100%; max-width: 78px; height: 96px; object-fit: contain; }
.lp-form b { display: block; font-size: .74rem; }
.lp-form small { font-size: .6rem; color: var(--muted); }

.lp-cast { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.lp-guest { margin: 0; text-align: center; }
.lp-guest img { width: 100%; max-width: 62px; height: 72px; object-fit: contain; }
.lp-guest b { display: block; font-size: .64rem; }
.lp-guest small { font-size: .62rem; letter-spacing: 1px; }

.lp-cards { display: grid; gap: 8px; }
.lp-card {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 10px; border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.lp-card img { width: 56px; height: 72px; object-fit: contain; }
.lp-card b { display: block; font-size: .84rem; margin-bottom: 2px; }
.lp-card p { margin: 0; font-size: .74rem; line-height: 1.35; }

.lp-school { display: grid; gap: 6px; margin: 10px 0; }
.lp-tier {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center;
  padding: 9px 11px; border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.lp-tier > span {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--lemon); color: var(--lemon-ink);
  font-weight: 900; font-size: .78rem;
}
.lp-tier b { display: block; font-size: .84rem; }
.lp-tier p { margin: 2px 0 0; font-size: .72rem; color: var(--muted); line-height: 1.3; }

.lp-why { margin: 6px 0 0; padding-left: 18px; }
.lp-why li { font-size: .8rem; line-height: 1.45; color: var(--ink-2); margin-bottom: 7px; }

.lp-foot {
  margin: 18px 0 12px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .72rem; color: var(--muted); text-align: center; line-height: 1.5;
}

/* ---------- 32. Доба і врожай ---------- */

/* Чіп доби стоїть у тій самій колонці, що й решта HUD. Старе центрування
   через `left:50%; translateX(-50%)` лишилось від абсолютної версії й
   викидало його за лівий край екрана. */
.hud-chip--day { max-width: none; }

/* дозрілий врожай на рослині — щоб було видно, що туди варто дійти */
.sp__ripe {
  position: absolute;
  left: 50%; top: -10px;
  transform: translateX(-50%);
  font-size: 1.1rem; line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--lemon);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  pointer-events: none;
  animation: floaty 1.7s ease-in-out infinite;
  z-index: 3;
}

/* ---------- 33. Кухня і кулінарна книга ---------- */

.pot {
  min-height: 74px;
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; justify-content: center;
  padding: 12px;
  border-radius: var(--r-l);
  background: var(--surface-2);
  border: 2px dashed var(--line);
  margin-bottom: 8px;
  font-size: 1.9rem;
}
.pot__empty { font-size: .8rem; font-weight: 700; color: var(--muted); }
.pot .chip { min-width: 40px; min-height: 40px; font-size: 1.9rem; }

.kitchen-hint {
  min-height: 20px; margin-bottom: 8px;
  font-size: .8rem; font-weight: 700; color: var(--ink-2);
}

.cookbook { display: grid; gap: 6px; margin-top: 8px; }
.cook-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.cook-item__e { font-size: 1.5rem; line-height: 1; }
.cook-item b { display: block; font-size: .82rem; }
.cook-item small { font-size: 1rem; letter-spacing: 2px; }
.cook-item i { font-style: normal; font-size: .72rem; font-weight: 900; color: var(--lemon); }
.cook-item.locked { opacity: .5; }

/* знахідка у вердикті — окремим блоком, щоб не плуталась із оцінкою */
.combo-hits { display: grid; gap: 6px; margin: 8px 0; }
.combo-hit {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 9px 11px; border-radius: var(--r-m);
  background: var(--c-treat-soft); border: 1px solid var(--c-treat);
}
.combo-hit__e { font-size: 1.5rem; line-height: 1; }
.combo-hit b { display: block; font-size: .82rem; }
.combo-hit p { margin: 2px 0 0; font-size: .74rem; color: var(--ink-2); line-height: 1.3; }
.combo-hit i { font-style: normal; font-size: .74rem; font-weight: 900; color: var(--lemon); }

/* ---------- 34. Шторка замовлення в один екран ----------
   Було: черга, картка гостя, картка замовлення з базою, смужка терпіння,
   тарілка, таця, кнопка — усе окремими блоками, і воно не вміщалось.
   Стало: один рядок «хто і що треба», далі тарілка й таця. */

.ask {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 8px; align-items: center;
  padding: 7px 9px; margin-bottom: 6px;
  border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line);
}
.ask .guest__face { width: 46px; height: 46px; border-width: 1px; }
.ask .guest__face img { width: 48px; margin-bottom: -4px; }
.ask__body { min-width: 0; }
.ask__top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ask__top .guest__name { font-size: .84rem; }
.ask__need {
  font-size: .8rem; font-weight: 900; color: var(--sea);
  white-space: nowrap;
}
.ask .guest__line {
  font-size: .76rem; font-weight: 600; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ask__base { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.ask__base-t { font-size: .58rem; font-weight: 900; text-transform: uppercase; color: var(--muted); }
.ask__base .hand-bit { font-size: .66rem; padding: 2px 6px; }
.ask__tip {
  width: 38px; height: 38px; flex: none;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 1.1rem; cursor: pointer;
}
.ask__tip:active { transform: scale(.92); }
.ask__hint {
  margin-bottom: 6px; padding: 8px 10px;
  border-radius: var(--r-m);
  background: var(--c-carb-soft); border: 1px solid var(--c-carb);
}
.ask__hint .tip-why { margin: 0 0 4px; font-size: .76rem; }

/* тарілка компактніша: у неї немає причини займати пів екрана.
   Розмір іде від висоти екрана — на 667 px тарілка мусить стиснутись,
   інакше на продукти лишається два ряди. */
.sheet .plate {
  width: min(150px, 21dvh); height: min(150px, 21dvh);
  border-width: 5px;
}
.sheet .saucer { width: min(66px, 9.4dvh); height: min(66px, 9.4dvh); border-width: 4px; }
.sheet .plate-row { gap: 8px; margin-bottom: 4px; }
.sheet .patience { margin-bottom: 4px; }
.sheet .zone { font-size: 1.05rem; }
.sheet .zone__tag { font-size: .5rem; }
.sheet .queue { min-height: 28px; margin-bottom: 2px; }
.sheet .queue__item { width: 28px; height: 28px; }
.sheet .queue__item img { width: 32px; }
.sheet .ask { margin-bottom: 4px; }
.sheet #btnServe { margin-top: 2px; }

/* ---------- 35. Dev ---------- */
.dev-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dev-row .btn { flex: 1 1 auto; min-height: 40px; padding: 8px 12px; font-size: .78rem; }

/* ---------- 36. Урок-мінігра ----------
   Живе поверх усього, бо вчить і всередині шторки замовлення. */
.lesson {
  position: fixed; z-index: 80;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  width: min(420px, calc(100% - 20px));
  padding: 11px 13px;
  border-radius: var(--r-l);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border: 2px solid var(--lemon);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .42);
}
.lesson.pop { animation: ctaPop .32s cubic-bezier(.2, 1.5, .4, 1); }
.lesson__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.lesson__e { font-size: 1.25rem; line-height: 1; }
.lesson__head b { font-size: .84rem; }
.lesson__step {
  margin-left: auto; font-size: .62rem; font-weight: 900;
  color: var(--lemon-ink); background: var(--lemon);
  padding: 2px 7px; border-radius: 999px;
}
.lesson__text { margin: 0; font-size: .88rem; font-weight: 700; line-height: 1.35; }
.lesson__why {
  margin-top: 7px; padding: 7px 9px;
  border-radius: var(--r-s);
  background: var(--c-veg-soft); border-left: 3px solid var(--c-veg);
  font-size: .76rem; line-height: 1.35; color: var(--ink-2);
}
.lesson__btns { display: flex; gap: 6px; margin-top: 8px; }
.lesson__next { flex: 1; min-height: 38px; padding: 6px 14px; }
.lesson__skip { min-height: 38px; padding: 6px 12px; font-size: .74rem; }

/* те, на що урок показує пальцем */
.is-taught {
  outline: 3px solid var(--lemon);
  outline-offset: 3px;
  border-radius: var(--r-s);
  animation: focusPulse 1.1s ease-in-out infinite;
}

/* поки Мобі буянить — тераса нервує помітно */
.world-wrap.is-rage .world__tint { background: rgba(180, 40, 40, .16); }
.world-wrap.is-rage .sp--guest .sp__bubble { animation: critPulse .5s infinite; }

/* ---------- 37. Плита ----------
   Три візуальні дії: різати пальцем по дошці, мазати пальцем по тісту,
   ловити момент на вогні. Палець тут малює, тому `touch-action: none`
   на самій дошці — інакше жест поїде гортати панель. */
.stove { margin-top: 10px; }
.stove__task { font-size: .86rem; line-height: 1.35; margin-bottom: 8px; }

.stove__board {
  position: relative;
  min-height: 168px;
  display: grid; place-items: center;
  padding: 12px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 2px solid var(--line);
  margin-bottom: 8px;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}

/* смужка виконання спільна для всіх трьох дій */
.stove__meter {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  margin-bottom: 8px;
}
.stove__meter i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--lemon), var(--leaf));
  transition: width .18s ease;
}

/* --- дошка: кожен рух пальця розколює продукт --- */
.stove__board.cut { cursor: crosshair; align-content: center; gap: 10px; }
.cut__row {
  display: flex; justify-content: center; gap: 4px;
  padding: 6px 0;
  border-bottom: 2px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.cut__row.is-chop { animation: chop .18s ease; }
@keyframes chop { 0%,100% { transform: none; } 45% { transform: translateY(3px) scaleY(.9); } }
.cut__pc {
  font-size: 2rem; line-height: 1;
  animation: slicePop .3s cubic-bezier(.2,1.5,.4,1) both;
  animation-delay: calc(var(--q) * .03s);
}
@keyframes slicePop { from { scale: .3; opacity: 0; } to { scale: 1; opacity: 1; } }

/* --- тісто: пальцем замальовуєш сухі плями --- */
.stove__board.spread { padding: 10px; }
.spread__base {
  width: 100%; max-width: 300px; aspect-ratio: 8 / 5;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(5, 1fr);
  border-radius: var(--r-m);
  background: repeating-linear-gradient(45deg, #e8d3ad 0 8px, #e2c9a0 8px 16px);
  border: 3px solid #c9ab78;
  overflow: hidden;
}
.spread__base i { display: block; transition: background .18s, box-shadow .18s; }
.spread__base i.on {
  background: radial-gradient(circle at 50% 50%, #d9534a, #b8402f);
  box-shadow: inset 0 0 6px rgba(120, 30, 20, .5);
}

/* --- вогонь: колір їжі і є індикатор --- */
.stove__board.fry { padding: 10px; }
.fry__pan {
  width: 100%; max-width: 260px; aspect-ratio: 3 / 2;
  border-radius: 50% 50% 46% 46%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #4a4a52, #2e2e35);
  border: 5px solid #23232a;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, .5);
  animation: sizzle .32s ease-in-out infinite;
}
@keyframes sizzle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.fry__food {
  display: flex; gap: 8px; padding: 10px 14px;
  border-radius: 999px;
  background: var(--fry, #f6efdd);
  box-shadow: 0 0 18px 4px color-mix(in srgb, var(--fry, #f6efdd) 55%, transparent);
  font-size: 2rem; line-height: 1;
  transition: background .12s;
}
.fry__food.is-burnt { animation: burnt .3s ease-in-out infinite; }
@keyframes burnt { 0%,100% { filter: none; } 50% { filter: brightness(.7) saturate(.5); } }

/* ---------- 37b. Смужка влучання ----------
   Стара версія була тонкою рискою з ледь помітною обводкою зони, і після
   «Стоп» на екрані не мінялось НІЧОГО — гравець просто не знав, попав чи
   ні. Тепер видно три речі одночасно: де зона, де спинилась стрілка і що
   це означає словом. Віджет спільний для плити й шоколадного автомата. */
.tbar {
  position: relative; width: 100%; height: 30px;
  border-radius: 999px; overflow: visible;
  border: 2px solid var(--line);
  margin-bottom: 10px;
  transition: box-shadow .2s;
}
.tbar--fry { background: linear-gradient(90deg, #f6efdd, #e8a33c 72%, #4a2c14); }
.tbar--temper { background: linear-gradient(90deg, #6fa8dc, #f0e3c8 62%, #c75c4a); }
.tbar__band { position: absolute; top: 0; bottom: 0; }
.tbar__band--good { background: color-mix(in srgb, var(--lemon) 45%, transparent); }
.tbar__band--ok {
  background: color-mix(in srgb, var(--leaf) 62%, transparent);
  box-shadow: inset 0 0 0 2px var(--leaf);
}
.tbar__tick {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  margin-left: -1px;
  background: color-mix(in srgb, var(--leaf) 90%, #000);
}
.tbar__needle {
  position: absolute; top: -7px; bottom: -7px; width: 5px;
  margin-left: -2px;
  background: var(--ink);
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--surface);
}
/* де саме спинилась — лишається стояти, поки не почнеться наступний крок */
.tbar__mark {
  position: absolute; top: -11px; bottom: -11px; width: 5px;
  margin-left: -2px;
  background: var(--terra);
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--surface);
  animation: pop .3s cubic-bezier(.2, 1.6, .4, 1);
}
.tbar.is-ok .tbar__mark { background: var(--leaf); }
.tbar__verdict {
  position: absolute; left: 50%; top: -30px;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .78rem; font-weight: 900;
  white-space: nowrap;
  animation: pop .3s cubic-bezier(.2, 1.6, .4, 1);
}
.tbar__verdict.is-ok { background: var(--leaf); color: #fff; }
.tbar__verdict.is-mid { background: var(--lemon); color: var(--lemon-ink); }
.tbar__verdict.is-no { background: var(--terra); color: #fff; }
.tbar.is-ok { box-shadow: 0 0 0 4px color-mix(in srgb, var(--leaf) 40%, transparent); }
.tbar.is-mid { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lemon) 40%, transparent); }
.tbar.is-no { box-shadow: 0 0 0 4px color-mix(in srgb, var(--terra) 35%, transparent); }

/* ---------- 38. Вступний урок ---------- */
.panel--intro .panel__inner { max-width: 460px; padding-top: calc(env(safe-area-inset-top) + 22px); }
.intro__bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.intro__bar i { display: block; height: 100%; background: var(--lemon); transition: width .4s ease; }
.intro__step { font-size: .6rem; font-weight: 900; color: var(--muted); margin: 6px 0 10px; letter-spacing: .08em; }
.intro__stage { display: grid; place-items: center; min-height: 168px; margin-bottom: 10px; }
.intro__big { font-size: 4.4rem; line-height: 1; animation: floaty 2.4s ease-in-out infinite; }
.intro__guest { height: 168px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.3)); animation: floaty 2.6s ease-in-out infinite; }
.intro__title { font-size: 1.25rem; margin-bottom: 6px; }
/* Абзаци у вступі розділені порожнім рядком у самому тексті — щоб питання
   не зліплювалось із правилом в одну стіну, яку дитина пропускає. */
.intro__text { font-size: .9rem; line-height: 1.45; color: var(--ink-2); white-space: pre-line; }

/* тарілка, що збирається на очах */
.intro-plate {
  width: 168px; height: 168px; border-radius: 50%;
  overflow: hidden; display: grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  border: 6px solid var(--surface-2); background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.intro-plate__q { display: grid; place-items: center; font-size: 1.9rem; opacity: .22; transition: opacity .35s, transform .35s; }
.intro-plate__q.is-on { opacity: 1; animation: pop .34s ease; }
.intro-plate__q--veg { background: var(--c-veg-soft); }
.intro-plate__q--carb { background: var(--c-carb-soft); }
.intro-plate__q--pro { background: var(--c-pro-soft); }
.intro-plate__q--fat { background: var(--c-fat-soft); }

.intro__opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 12px; }
.intro-opt {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 62px; padding: 9px 6px;
  border-radius: var(--r-m); border: 2px solid var(--line);
  background: var(--surface); font-size: .76rem; font-weight: 800;
  cursor: pointer; box-shadow: var(--shadow);
}
.intro-opt:active { transform: translateY(3px); box-shadow: none; }
.intro-opt[disabled] { cursor: default; box-shadow: none; }
.intro-opt__e { font-size: 1.5rem; line-height: 1; }
.intro-opt--veg { border-color: var(--c-veg); background: var(--c-veg-soft); }
.intro-opt--carb { border-color: var(--c-carb); background: var(--c-carb-soft); }
.intro-opt--pro { border-color: var(--c-pro); background: var(--c-pro-soft); }
.intro-opt--fat { border-color: var(--c-fat); background: var(--c-fat-soft); }
.intro-opt.is-right { border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 40%, transparent); }
.intro-opt.is-wrong { border-color: var(--terra); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 40%, transparent); }

.intro__fb {
  margin-top: 10px; padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .82rem; line-height: 1.4;
}
.intro__fb.ok { background: var(--c-veg-soft); border-color: var(--c-veg); }
.intro__fb.no { background: var(--c-pro-soft); border-color: var(--c-pro); }
#introNext { margin-top: 12px; }

/* ---------- 39. Колекція Короля ---------- */
.king-case {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.king-item {
  padding: 14px 8px; text-align: center;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 2px solid var(--line);
}
.king-item__e { display: block; font-size: 2.4rem; line-height: 1.1; }
.king-item b { display: block; font-size: .82rem; margin-top: 4px; }
.king-item small { display: block; font-size: .64rem; color: var(--muted); margin-top: 2px; }
.king-item.locked { opacity: .5; }
.king-item:not(.locked) {
  border-color: var(--lemon);
  background: color-mix(in srgb, var(--lemon) 14%, var(--surface-2));
}

/* переклад Владікового терміна на людську */
.fam-plain__t {
  display: block; font-size: .6rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin-bottom: 3px;
}
.fam-plain { font-weight: 600; }

/* прилавок підсвічується так само, як усе, до чого можна підійти */
.sp--counter.is-focus .sp__img {
  filter: drop-shadow(0 0 10px var(--lemon)) drop-shadow(0 4px 4px rgba(70, 30, 0, .28));
}

/* ---------- 41. Вайб зали в самій сцені ----------
   Було `filter: saturate()` на всій сцені — і це коштувало повного
   перемальовування поверхні 1750×939 щокадру, бо камера рухається постійно.
   Заради ледь помітної зміни насиченості це найдорожчий ефект у грі.
   Тепер вайб живе тоном (`world__tint` лежить ПІД шаром акторів, тому колір
   кішки від нього не залежить) — і коштує нуль. */
/* Вайб фарбує тон ТІЛЬКИ у звичайну денну зміну: увечері, під час буйства
   й на виступі свій тон, і він важливіший. Без цього `:not()` вайб стояв би
   у файлі нижче за вечір і мовчки його перебивав — рівно та пастка зі
   специфічністю, через яку вечір колись уже не вмикався. */
.world-wrap.is-vibe-cold:not(.is-evening):not(.is-show):not(.is-rage)  .world__tint { background: rgba(40, 70, 120, .12); }
.world-wrap.is-vibe-meh:not(.is-evening):not(.is-show):not(.is-rage)   .world__tint { background: rgba(60, 60, 70, .06); }
.world-wrap.is-vibe-good:not(.is-evening):not(.is-show):not(.is-rage)  .world__tint { background: rgba(255, 200, 120, .07); }
.world-wrap.is-vibe-party:not(.is-evening):not(.is-show):not(.is-rage) .world__tint { background: rgba(255, 180, 90, .12); }

/* ---------- 42. Тап по предметах ----------
   Усе, з чим можна щось зробити, мусить ловити палець: вивіска, купка від
   Мобі, дозріла рослина, прилавок. Доти тап працював тільки по гостях, і
   до Магазину зі Школою треба було доводити кішку пальцем впритул —
   найдовша дія в грі при тому, що вивіска видима й очевидно натискається. */
.sign { cursor: pointer; }
.floor-fx.mess { pointer-events: auto; cursor: pointer; }
.sp--prop .sp__body, .sp--jukebox .sp__body { pointer-events: auto; cursor: pointer; }
/* Тінь і бейдж «дозріло» — не мішені, вони лише малюють. */
.sp__shadow, .sp__ripe, .sp__badge, .sp__bubble, .sp__mood { pointer-events: none; }

/* Що можна тапнути — видно ще до підходу: легкий підйом і підсвітка при
   натисканні. Без цього предмет читається як намальований фон. */
.sp--prop .sp__body:active, .sp--jukebox .sp__body:active { filter: brightness(1.12); }

/* ---------- 43. Гардероб ---------- */
.wardrobe-hero {
  display: flex; gap: 12px; align-items: center;
  padding: 12px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.wardrobe-hero__cat { width: 92px; height: 92px; }
.wardrobe-hero__cat .cat__img { width: 104px; margin-bottom: -8px; }
.wardrobe-hero__cat .cat__wear { font-size: 1.7rem; }
.wardrobe-hero__cat .cat__wear--eyes,
.wardrobe-hero__cat .cat__wear--body { font-size: 1.45rem; }
.wardrobe-hero__cat .cat__wear--paws,
.wardrobe-hero__cat .cat__wear--feet { font-size: 1.2rem; }
.wardrobe-hero b { font-size: 1.05rem; }
.wardrobe-hero p { margin: 2px 0 8px; font-size: .78rem; }

.wset {
  padding: 10px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 2px solid var(--line);
  margin-bottom: 10px;
}
.wset.is-done { border-color: var(--lemon); }
.wset.is-on { border-color: var(--leaf); background: color-mix(in srgb, var(--leaf) 10%, var(--surface)); }
.wset__head { display: flex; gap: 10px; align-items: center; }
.wset__head > div { flex: 1; min-width: 0; }
.wset__head b { display: block; font-size: .95rem; }
.wset__head small { display: block; font-size: .66rem; color: var(--muted); line-height: 1.3; }
.wset__e { font-size: 1.7rem; line-height: 1; }
.wset__perk {
  margin: 6px 0 8px;
  font-size: .72rem; font-weight: 800; color: var(--ink-2);
}
.wset:not(.is-done) .wset__perk { color: var(--muted); }
.wset__items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.witem {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px 6px;
  border-radius: var(--r-m);
  border: 2px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
}
.witem__e { font-size: 1.5rem; line-height: 1; }
.witem b { font-size: .58rem; font-weight: 800; line-height: 1.15; }
.witem small { font-size: .54rem; color: var(--muted); }
.witem.is-worn { border-color: var(--leaf); background: color-mix(in srgb, var(--leaf) 16%, var(--surface-2)); }
.witem.is-worn small { color: var(--leaf); font-weight: 900; }
.witem.locked { opacity: .45; cursor: default; }
.witem:not(.locked):active { transform: translateY(2px); }

/* ---------- 44. Вдягнене на спрайті ----------
   Шар усередині `.sp__body`, тому їде разом із дзеркаленням і кроком.

   ГОЛОВНЕ ПРАВИЛО: жоден аксесуар не лягає на МОРДУ. Кішка намальована, і
   емодзі поверх її обличчя читається як наліпка на портреті, а не як одяг —
   перша версія саме так і виглядала. Тому речі стоять по силуету: убір над
   головою, окуляри збоку від голови, тіло нижче морди, лапи за межею
   силуету, взуття внизу біля лап. Розміри у відсотках від висоти спрайта
   (`--h`), інакше масштаб плавав би між персонажами. */
.sp__wear {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: calc(var(--h) * .20);
  line-height: 1;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4));
}
.sp__wear--head { top: calc(var(--h) * -.05); }
/* окуляри й маска — збоку від голови, не на морді */
.sp__wear--eyes { top: calc(var(--h) * .02); left: 84%; font-size: calc(var(--h) * .14); }
.sp__wear--body { top: calc(var(--h) * .60); font-size: calc(var(--h) * .15); }
.sp__wear--paws { top: calc(var(--h) * .58); left: 10%; font-size: calc(var(--h) * .14); }
.sp__wear--feet { bottom: calc(var(--h) * -.03); left: 76%; font-size: calc(var(--h) * .13); }

/* Зібраний образ світиться, а не обвішує кішку ще одним значком. */
.sp--player.has-look .sp__body::after {
  content: "";
  position: absolute; left: 50%; bottom: -6px;
  width: calc(var(--h) * .62); height: calc(var(--h) * .18);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--lemon) 70%, transparent), transparent 70%);
  pointer-events: none;
  animation: floaty 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .sp--player.has-look .sp__body::after { animation: none; }
}

/* ---------- 45. Вечірня подача ----------
   Два кроки, три картки на крок. Картка страви показує СКЛАД групами —
   саме за ним її і треба впізнавати, інакше вибір перетворюється на
   вгадування назви. */
#eveningPhase { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; }
.eve-step { font-size: .84rem; line-height: 1.35; }
.eve-step b { font-weight: 900; }
.eve-opts { display: flex; flex-direction: column; gap: 6px; }

.eve-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-m);
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer; text-align: left;
  box-shadow: var(--shadow);
  touch-action: manipulation;
}
.eve-opt:disabled { opacity: .55; }
.eve-opt:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.eve-opt__e { font-size: 1.7rem; line-height: 1; flex: none; }
.eve-opt__body { flex: 1; min-width: 0; }
.eve-opt__body b { display: block; font-size: .88rem; }
.eve-opt__body small { display: block; font-size: .66rem; color: var(--muted); }
.eve-opt__comp { display: flex; gap: 3px; flex: none; }
.eve-comp {
  min-width: 20px; padding: 1px 0;
  border-radius: 6px;
  font-size: .66rem; font-weight: 900; text-align: center;
}
.eve-comp--veg   { background: var(--c-veg-soft);   color: var(--c-veg-ink); }
.eve-comp--carb  { background: var(--c-carb-soft);  color: var(--c-carb-ink); }
.eve-comp--pro   { background: var(--c-pro-soft);   color: var(--c-pro-ink); }
.eve-comp--fat   { background: var(--c-fat-soft);   color: var(--c-fat-ink); }
.eve-comp--treat { background: var(--c-treat-soft); color: var(--c-treat-ink); }

.eve-fb {
  padding: 8px 10px;
  border-radius: var(--r-m);
  font-size: .78rem; font-weight: 700; line-height: 1.35;
}
.eve-fb.ok { background: color-mix(in srgb, var(--leaf) 18%, var(--surface)); border: 1px solid var(--leaf); }
.eve-fb.no { background: color-mix(in srgb, var(--terra) 16%, var(--surface)); border: 1px solid var(--terra); }

/* ---------- 46. Лендінг: вечір, вайб, образи ---------- */
.lp-eve { display: grid; gap: 6px; margin-top: 10px; }
.lp-vibes, .lp-looks { display: grid; gap: 6px; margin-top: 10px; }
.lp-vibe, .lp-look {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.lp-vibe > span, .lp-look__e { font-size: 1.5rem; line-height: 1; flex: none; }
.lp-vibe > div, .lp-look > div { flex: 1; min-width: 0; }
.lp-vibe b, .lp-look b { display: block; font-size: .85rem; }
.lp-vibe small, .lp-look small { display: block; font-size: .68rem; color: var(--muted); }
.lp-look p { margin: 3px 0 0; font-size: .8rem; letter-spacing: .06em; }
.lp-vibe i { font-style: normal; font-size: .7rem; font-weight: 900; color: var(--muted); }

/* ---------- 47. Таця кухні ----------
   Кухня лишилась зі стрічками по категоріях, і це правильно: там панель
   гортається вертикально сама по собі, а вибір із 2–4 продуктів — це не
   робота під таймером. Шторка замовлення пішла на вкладки, кухня ні. */
#kitchenTray .tray__group { margin-bottom: 8px; }
#kitchenTray .tray__label {
  display: flex; align-items: baseline; gap: 6px;
  font-size: .72rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 4px;
}
#kitchenTray .tray__items {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}
#kitchenTray .tray__items > .ing {
  flex: none;
  scroll-snap-align: start;
  min-width: var(--tap); min-height: var(--tap);
  padding: 6px 10px 4px;
  font-size: 1.5rem;
}
#kitchenTray .ing small { font-size: .58rem; }

/* Що на Кішці зараз — рядком поруч із портретом. Стос емодзі просто на
   мордочці виглядав як наліпки, а не як костюм. */
.wardrobe-hero__on { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.worn-bit {
  display: grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 5px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 1.05rem; line-height: 1;
}
.worn-bit--none { font-size: .68rem; color: var(--muted); font-weight: 700; }

/* ---------- 48. Заставка «ось що вийшло» ----------
   Спільна для плити й шоколадного автомата. Доти результат мінігри був
   двома рядками під кнопкою — тобто нагороди фактично не було видно, і
   ставало незрозуміло, навіщо взагалі та мінігра. */
.done {
  position: fixed; inset: 0; z-index: 85;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(25, 12, 0, .55);
  backdrop-filter: blur(6px);
}
.done__box {
  width: min(340px, 100%);
  padding: 18px 16px 16px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 3px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  text-align: center;
}
.done.is-win .done__box { border-color: var(--lemon); }
.done.pop .done__box { animation: ctaPop .4s cubic-bezier(.2, 1.5, .4, 1); }
.done__kicker {
  font-size: .62rem; font-weight: 900; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.done__art { display: grid; place-items: center; min-height: 96px; margin: 8px 0; }
.done__big { font-size: 4.2rem; line-height: 1; animation: floaty 2.4s ease-in-out infinite; }
.done__tray {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
  max-width: 240px;
  padding: 10px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 2px solid var(--line);
}
.done__tray span { font-size: 1.5rem; line-height: 1; animation: pop .3s ease backwards; }
.done__tray span:nth-child(2n) { animation-delay: .06s; }
.done__tray span:nth-child(3n) { animation-delay: .12s; }
.done__name { display: block; font-size: 1.1rem; }
.done__stars { color: var(--lemon); letter-spacing: 3px; font-size: 1.15rem; margin: 2px 0 6px; }
.done__say { font-size: .82rem; color: var(--ink-2); margin-bottom: 10px; }
.done__loots { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-bottom: 12px; }
.done__loot {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .74rem; font-weight: 800;
}

/* ---------- 49. Шоколадний автомат ---------- */
.pr-task { font-size: .86rem; line-height: 1.35; margin-bottom: 8px; }
.pr-stage {
  position: relative;
  min-height: 172px;
  display: grid; place-items: center;
  padding: 12px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 2px solid var(--line);
  margin-bottom: 10px;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
.pr-cool { font-size: 3.4rem; opacity: .5; }

/* казан: колір іде за температурою, тому видно, що смужка щось означає */
.pr-pot {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 3.2rem;
  border: 8px solid #7a5230;
  background: radial-gradient(circle at 50% 45%,
    color-mix(in srgb, #e8a33c var(--warm, 0%), #3a2011) 0%, #2a1509 78%);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, .5);
}

/* форма: дванадцять комірок, які спершу вкриваєш, потім начиняєш */
.pr-mould {
  width: 100%; max-width: 290px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 12px;
  border-radius: var(--r-m);
  background: linear-gradient(160deg, #b9bec6, #8d949e);
  border: 3px solid #6d747d;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, .35);
}
.pr-mould i {
  aspect-ratio: 1;
  border-radius: 30% 30% 42% 42%;
  background: #6f757e;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  font-size: 0; line-height: 1;
  transition: background .2s, box-shadow .2s, font-size .2s;
}
.pr-mould i.is-shell,
.pr-mould.is-shell-all i {
  background: radial-gradient(circle at 40% 32%, #6b4423, #3a2011);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 255, 255, .12);
}
.pr-mould.is-shell-all i { font-size: .95rem; opacity: .35; }
.pr-mould.is-shell-all i.is-full {
  opacity: 1;
  font-size: 1.3rem;
  background: radial-gradient(circle at 40% 32%, #8a5a2e, #4a2a14);
  animation: pop .25s cubic-bezier(.2, 1.6, .4, 1);
}
/* шоколад холоне — форма синіє, і поспішати стає видно, а не написано */
.pr-stage.is-cold .pr-mould { filter: hue-rotate(175deg) saturate(.6); }

.flavor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.flavor {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 10px;
  border-radius: var(--r-m);
  border: 2px solid var(--line);
  background: var(--surface-2);
  cursor: pointer; text-align: left;
  touch-action: manipulation;
}
.flavor__e { font-size: 1.4rem; line-height: 1; }
.flavor b { font-size: .8rem; }
.flavor small { font-size: .62rem; color: var(--muted); line-height: 1.2; }
.flavor.is-on { border-color: var(--lemon); background: color-mix(in srgb, var(--lemon) 16%, var(--surface-2)); }
.flavor.locked { opacity: .5; cursor: default; }

.box-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.box-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.box-item span { font-size: 1.25rem; line-height: 1; }
.box-item b { flex: 1; font-size: .7rem; }
.box-item i { font-style: normal; font-weight: 900; font-size: .82rem; color: var(--leaf); }

/* квіти на перилах — фон, а не предмет на підлозі: без тіні й без колізій */
.sp--rail .sp__shadow { display: none; }

/* Монета, у яку долучився номінал іншої: видно, що вона стала дорожчою. */
.coin.is-fat { animation: coinFat .45s cubic-bezier(.2, 1.6, .4, 1), coinIdle 1.5s ease-in-out infinite .45s; }
@keyframes coinFat { 0% { scale: 1; } 45% { scale: 1.45; } 100% { scale: 1.12; } }

/* ---------- 50. ДЕСЕСТРИ ----------
   Одна картка в кадрі, одне рішення, свайп. Усе інше на екрані — тільки
   те, що впливає на це рішення: скільки лишилось часу, скільки комбо. */
.panel--des .panel__inner { max-width: 420px; padding-top: calc(env(safe-area-inset-top) + 20px); }

.des-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.des-count { font-size: .72rem; font-weight: 900; color: var(--muted); }
.des-score { font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.des-combo { font-size: 1.1rem; font-weight: 900; color: var(--lemon); min-width: 42px; text-align: center; }
.des-combo.is-hot { color: var(--terra); animation: comboPop .3s ease; }
@keyframes comboPop { 0% { scale: 1; } 50% { scale: 1.35; } 100% { scale: 1; } }

.des-stage {
  position: relative;
  display: grid; place-items: center;
  height: 250px;
  margin-bottom: 10px;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
/* кільце часу: conic-gradient по одній змінній — без жодного фільтра */
.des-ring {
  position: absolute; width: 214px; height: 214px;
  border-radius: 50%;
  background: conic-gradient(var(--leaf) calc(var(--p, 1) * 360deg), var(--surface-2) 0);
  transition: background .05s linear;
}
.des-ring.is-low { background: conic-gradient(var(--terra) calc(var(--p, 1) * 360deg), var(--surface-2) 0); }

.des-card {
  position: relative;
  width: 190px; height: 190px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  border-radius: 22px;
  background: var(--surface);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
  cursor: grab;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1), border-color .15s;
}
.des-card:active { cursor: grabbing; }
.des-card__e { font-size: 3.6rem; line-height: 1; }
.des-card b { font-size: .86rem; line-height: 1.2; }
.des-card.lean-ok { border-color: var(--leaf); }
.des-card.lean-no { border-color: var(--terra); }
.des-card.is-hit { border-color: var(--leaf); opacity: 0; }
.des-card.is-miss { border-color: var(--terra); opacity: 0; }

.des-hint {
  position: absolute; top: 8px;
  font-size: .64rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .06em; opacity: .55;
}
.des-hint--no { left: 0; color: var(--terra); }
.des-hint--ok { right: 0; color: var(--leaf); }

.des-why {
  padding: 9px 11px; margin-bottom: 10px;
  border-radius: var(--r-m);
  font-size: .78rem; line-height: 1.35;
  animation: pop .25s ease;
}
.des-why.ok { background: color-mix(in srgb, var(--leaf) 16%, var(--surface)); border: 1px solid var(--leaf); }
.des-why.no { background: color-mix(in srgb, var(--terra) 14%, var(--surface)); border: 1px solid var(--terra); }

.des-bubble { margin-bottom: 12px; }
.des-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.des-btn { min-height: 54px; font-size: .92rem; font-weight: 900; }
.des-btn--no { border-color: var(--terra); color: var(--terra); }
.des-btn--ok { border-color: var(--leaf); color: var(--leaf); }
.des-best { text-align: center; margin-top: 10px; }

/* ---------- 51. Логотип ДЕСЕСТРИ ----------
   В одному слові сидять два. ДЕ + СЕСТРИ — і воно ж читається як ДЕСЕРТИ:

     Д Е [С Е С Т Р И]      ← СЕСТРИ підсвічені постійно
     Д Е  С Е (С) Р Т И     ← зайва «С» стискається, «Т» і «Р» міняються
                              місцями — і на дві секунди це ДЕСЕРТИ

   Той самий прийом, що з коренем СПІЛЬ у логотипі СУСПІЛЬСТВА: слово саме
   показує, з чого воно складене. Анімація — `transform` плюс ширина однієї
   літери; екран статичний (світ на паузі), тож це нічого не коштує. */
.deslogo {
  display: flex; justify-content: center; align-items: baseline;
  margin: 4px 0 2px;
  font-weight: 900;
  font-size: clamp(1.9rem, 11vw, 2.8rem);
  line-height: 1;
  color: var(--muted);
}
.deslogo__l { display: block; }
/* СЕСТРИ — інший колір, тому їх видно окремим словом без жодних пояснень */
.deslogo .is-sis { color: var(--terra); }

/* зайва «С»: та, якої в слові ДЕСЕРТИ немає */
.deslogo__drop {
  display: inline-block;
  overflow: hidden;
  width: .58em;
  text-align: center;
  animation: desDrop 7s cubic-bezier(.7, 0, .3, 1) infinite;
}
@keyframes desDrop {
  0%, 40%   { width: .58em; opacity: 1; }
  50%, 88%  { width: 0;     opacity: 0; }
  98%, 100% { width: .58em; opacity: 1; }
}

/* «Т» і «Р» міняються місцями. Комірки однакової ширини — інакше обмін
   зсувом не збігся б рівно. */
.deslogo__sw {
  display: inline-block;
  width: .6em;
  text-align: center;
  animation: 7s cubic-bezier(.7, 0, .3, 1) infinite;
}
.deslogo__sw--t { animation-name: desSwapT; }
.deslogo__sw--r { animation-name: desSwapR; }
@keyframes desSwapT {
  0%, 40%   { transform: translateX(0); }
  50%, 88%  { transform: translateX(.6em); }
  98%, 100% { transform: translateX(0); }
}
@keyframes desSwapR {
  0%, 40%   { transform: translateX(0); }
  50%, 88%  { transform: translateX(-.6em); }
  98%, 100% { transform: translateX(0); }
}

/* Вишенька сидить на останній літері, як на тістечку. Прив'язана до самої
   літери, а не до відсотка від центру: ширина слова їде від кегля. */
.deslogo__l:last-of-type { position: relative; }
.deslogo__cherry {
  position: absolute;
  left: 50%; top: -.42em;
  transform: translateX(-50%);
  font-size: .4em;
  animation: floaty 2.6s ease-in-out infinite;
  pointer-events: none;
}
.deslogo__sub {
  text-align: center;
  margin: 0 0 14px;
  font-size: .68rem; font-weight: 900;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}

/* Слово не має смикатись у того, хто просив спокою. */
@media (prefers-reduced-motion: reduce) {
  .deslogo__drop, .deslogo__sw, .deslogo__cherry { animation: none; }
}

.des-legend { display: grid; gap: 6px; margin: 10px 0; }
.des-legend__row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 2px solid var(--line);
}
.des-legend__row > span { font-size: 1.6rem; line-height: 1; }
.des-legend__row b { display: block; font-size: .84rem; }
.des-legend__row small { display: block; font-size: .68rem; color: var(--muted); line-height: 1.25; }
.des-legend__row--ok { border-color: var(--leaf); }
.des-legend__row--no { border-color: var(--terra); }
.des-rule { font-size: .74rem; margin-bottom: 10px; }
