/* Сад Миры. Свой вид поверх набора: сад на весь экран, светлые панели, деревянная рамка поля. */

:root {
  --bg-top: #3f7f2c;
  --bg-mid: #2f6a24;
  --bg-bottom: #1f4c19;
  --glow-a: rgba(255, 236, 160, 0.25);
  --glow-b: rgba(120, 200, 90, 0.25);
  --frame: #9a6a3a;
  --frame-lip: #6e4524;
  --pit: #2f5e26;
  --cream: #fff8e8;
  --cream-2: #f3e6c8;
  --wood: #b07a44;
  --wood-dark: #7a4c24;
  --leaf: #4f9a34;
  --leaf-dark: #2f6a1e;
  --ink-dark: #4a3220;
  --gold: #ffcf3a;
  --garden: none;
}

body {
  font-family: 'Nunito', 'Trebuchet MS', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* значок игры нужен набору (экран «Откройте игру в Link»), в саду его не видно */
.home > .logo {
  display: none;
}

.link-gate-logo {
  display: grid;
  grid-template-columns: repeat(2, 56px);
  gap: 4px;
}

.link-gate-logo img {
  width: 56px;
  height: 56px;
}

/* =====================================================================
                                 САД
   ===================================================================== */

.home {
  padding: 0;
  display: none;
  background: #4c8a33;
  overflow: hidden;
}

.in-menu .home {
  display: block;
}

.garden {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.garden-fill {
  position: absolute;
  inset: -40px;
  width: calc(100% + 80px);
  height: calc(100% + 80px);
  object-fit: cover;
  filter: blur(24px) saturate(0.9) brightness(0.85);
}

.garden-fill:not([src]) {
  display: none;
}

.garden-view {
  position: absolute;
}

.garden-view.glide {
  transition: left 0.6s cubic-bezier(0.3, 0.1, 0.2, 1), top 0.6s cubic-bezier(0.3, 0.1, 0.2, 1);
}

.garden-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.garden-img:not([src]) {
  visibility: hidden;
}

.garden-next {
  visibility: hidden;
}

.garden-next.on {
  visibility: visible;
}

.garden-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.garden-layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.garden-layer {
  position: absolute;
  display: block;
}

/* живой 3D-сад: холст под садом-картинкой, проявляется, когда сцена готова */
.garden-3d {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  touch-action: none;
}

.g3d .garden-3d {
  opacity: 1;
}

.g3d .garden-view {
  pointer-events: none;
}

.g3d .garden-fill,
.g3d .garden-img:not(.garden-next.on),
.g3d .garden-layers {
  visibility: hidden;
  transition: visibility 0s 0.5s;
}

.g3-load {
  position: absolute;
  left: 50%;
  top: calc(max(10px, var(--kit-safe-top)) + 50px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 14px 9px;
  border-radius: 14px;
  background: rgba(255, 250, 236, 0.92);
  box-shadow: 0 3px 0 rgba(90, 60, 20, 0.2), 0 6px 14px rgba(0, 0, 0, 0.16);
  color: #6a4a22;
  font-size: 13px;
  font-weight: 800;
  transform: translateX(-50%);
  pointer-events: none;
}

.g3-load[hidden] {
  display: none;
}

.g3-load-track {
  display: block;
  width: 120px;
  height: 6px;
  border-radius: 3px;
  background: #ead9b4;
  overflow: hidden;
}

.g3-load-track b {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #7cc04a, #4f9a34);
  transition: width 0.25s ease;
}

/* вещь появляется: падает сверху и пружинит, как в жанре */
.garden-layer.pop {
  animation: g-place 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
  transform-origin: 50% 85%;
}

/* бабочки над садом */
.garden-life {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* в 3D-саду бабочки летают в самой сцене (garden3d.js) */
.g3d .garden-life {
  display: none;
}

.bfly {
  position: absolute;
  left: 0;
  top: 0;
  width: 6%;
  margin: -3% 0 0 -3%;
  filter: drop-shadow(0 6px 3px rgba(30, 50, 10, 0.28));
}

.bfly img {
  display: block;
  width: 100%;
}

.bfly img.b,
.bfly.f img.a {
  display: none;
}

.bfly.f img.b {
  display: block;
}

/* Мира в саду дышит; от касания подпрыгивает */
.garden-mira {
  animation: mira-idle 3.4s ease-in-out infinite;
}

.garden-mira.hop {
  animation: mira-hop 0.55s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.garden-mira.pop {
  animation: g-place 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes mira-idle {
  0%, 100% { transform: none; }
  50% { transform: scale(1.012, 0.986); }
}

@keyframes mira-hop {
  0% { transform: none; }
  25% { transform: scale(1.04, 0.94); }
  55% { transform: translateY(-6%) scale(0.97, 1.04); }
  80% { transform: scale(1.03, 0.96); }
  100% { transform: none; }
}

.mira-hi {
  position: absolute;
  margin: 0;
  transform: translate(-50%, calc(-100% - 30px));
  max-width: 46%;
  padding: 7px 12px;
  border-radius: 14px;
  background: #fffaf0;
  color: #4a3a22;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 3px 0 rgba(90, 60, 20, 0.25), 0 6px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  white-space: nowrap;
}

.mira-hi.on {
  animation: hi-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.mira-hi::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  margin-left: -7px;
  border: 7px solid transparent;
  border-bottom: 0;
  border-top-color: #fffaf0;
}

@keyframes hi-pop {
  0% { transform: translate(-50%, calc(-100% - 30px)) scale(0.6); }
  100% { transform: translate(-50%, calc(-100% - 30px)) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .garden-mira { animation: none; }
}

@keyframes g-place {
  0% { opacity: 0; transform: translateY(-6%) scale(0.9); }
  45% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* окно выбора вида: внизу, сад остаётся видно */
.look {
  position: absolute;
  left: 50%;
  bottom: max(18px, var(--kit-safe-bottom));
  z-index: 7;
  width: min(calc(100% - 24px), 440px);
  padding: 12px 14px 14px;
  border-radius: 26px;
  background: linear-gradient(180deg, #fffdf6, #f4e8cd);
  box-shadow: 0 0 0 3px #fff, 0 6px 0 3px #c9a874, 0 14px 30px rgba(20, 30, 10, 0.35);
  color: var(--ink-dark);
  transform: translate(-50%, 130%);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.look.open {
  transform: translate(-50%, 0);
}

body.picking .home-bottom,
body.picking .home-side {
  visibility: hidden;
}

.look-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 900;
  text-align: center;
}

.look-row {
  display: flex;
  gap: 10px;
  margin-right: 64px;
}

.look-opt {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  padding: 4px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc, 0 3px 0 #dccaa4;
  -webkit-tap-highlight-color: transparent;
}

.look-opt img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.look-opt.is-on {
  background: #f1ffe2;
  box-shadow: inset 0 0 0 3px #6fc23a, 0 3px 0 #4f9a34;
}

.look-ok {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #8fdc4e, #4ca822);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 4px 0 #2f7a16;
}

.look-ok::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 11px;
  height: 21px;
  border: solid #fff;
  border-width: 0 5px 5px 0;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.task-look {
  flex: none;
  min-width: 70px;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: #fff3d6;
  box-shadow: inset 0 0 0 2px #f0d9a6, 0 3px 0 #dcc08a;
  color: #8a5a1e;
  font-size: 14px;
  font-weight: 900;
}

.spark {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: radial-gradient(circle, #fff 0%, #fff6b0 35%, rgba(255, 220, 90, 0) 70%);
  border-radius: 50%;
  opacity: 0;
  animation: g-spark 1.1s ease-out forwards;
}

@keyframes g-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.3); }
}

/* верхняя строка: жизни, монеты, звёзды */
.home-top {
  position: absolute;
  top: max(10px, var(--kit-safe-top));
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.res {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  min-width: 84px;
  padding: 0 12px 0 34px;
  border-radius: 19px;
  background: linear-gradient(180deg, rgba(255, 252, 240, 0.96), rgba(243, 230, 200, 0.96));
  box-shadow: 0 3px 0 rgba(122, 76, 36, 0.55), 0 6px 14px rgba(20, 40, 10, 0.25);
  color: var(--ink-dark);
}

.res img {
  position: absolute;
  left: -6px;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  filter: drop-shadow(0 2px 2px rgba(60, 30, 10, 0.3));
}

.res b {
  font-size: 17px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.res small {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #8a6a4a;
  font-variant-numeric: tabular-nums;
}

.home-side {
  position: absolute;
  top: calc(max(10px, var(--kit-safe-top)) + 50px);
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.round-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #fffdf4, #f0e2c2);
  box-shadow: 0 3px 0 rgba(122, 76, 36, 0.6), 0 6px 12px rgba(20, 40, 10, 0.25);
  color: var(--wood-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.round-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(122, 76, 36, 0.6);
}

.round-btn .ico {
  width: 22px;
  height: 22px;
  color: var(--wood-dark);
}

/* низ: задания слева, большая кнопка уровня справа */
.home-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(18px, var(--kit-safe-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  z-index: 2;
}

.tasks-btn {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 84px;
  padding: 0;
  border: 0;
  background: none;
}

.tasks-ico {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    url("img/task-beds.webp?v=1") center / 74% no-repeat,
    radial-gradient(circle at 50% 35%, #fffdf2, #efdcb0);
  box-shadow: 0 0 0 4px #fff, 0 5px 0 4px rgba(122, 76, 36, 0.55), 0 10px 18px rgba(20, 40, 10, 0.3);
}

.tasks-btn:active .tasks-ico {
  transform: translateY(3px);
}

.tasks-label {
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--wood-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.tasks-badge {
  position: absolute;
  top: -2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff6a5a, #e23a2c);
  box-shadow: 0 0 0 3px #fff;
  color: #fff;
  font-style: normal;
  font-size: 16px;
  font-weight: 900;
  animation: g-badge 1.2s ease-in-out infinite;
}

@keyframes g-badge {
  50% { transform: scale(1.18); }
}

.play-btn {
  position: relative;
  flex: 0 1 230px;
  min-width: 170px;
  height: 74px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #8fdc4e 0%, #5cb82c 55%, #44a020 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 0 rgba(30, 90, 10, 0.35),
    0 6px 0 #2f7a16,
    0 12px 22px rgba(20, 40, 10, 0.35);
  color: #fff;
  text-shadow: 0 2px 0 rgba(30, 90, 10, 0.55);
}

.play-btn:active {
  transform: translateY(5px);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55), inset 0 -4px 0 rgba(30, 90, 10, 0.35), 0 1px 0 #2f7a16;
}

.play-btn.is-hard {
  background: linear-gradient(180deg, #ff9a6a 0%, #f2643a 55%, #d94a22 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    inset 0 -4px 0 rgba(120, 30, 10, 0.3),
    0 6px 0 #a3341a,
    0 12px 22px rgba(20, 40, 10, 0.35);
  text-shadow: 0 2px 0 rgba(120, 30, 10, 0.5);
}

.play-label {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
}

.play-hard {
  display: block;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.95;
}

.play-hard[hidden] {
  display: none;
}

/* ---------- лист заданий ---------- */

.sheet-shade {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(20, 30, 10, 0);
  transition: background 0.2s;
}

.sheet-shade.open {
  background: rgba(20, 30, 10, 0.4);
}

.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 6;
  width: min(100%, 480px);
  padding: 10px 18px max(22px, var(--kit-safe-bottom));
  border-radius: 26px 26px 0 0;
  background: #fff;
  box-shadow: 0 -8px 30px rgba(20, 30, 10, 0.3);
  color: var(--ink-dark);
  transform: translate(-50%, 105%);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet.open {
  transform: translate(-50%, 0);
}

.sheet-grip {
  width: 44px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 3px;
  background: #e3dccd;
}

.sheet-title {
  margin: 0 40px 10px;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.sheet-prog-wrap {
  position: relative;
  margin: 0 30px 14px 6px;
}

.sheet-gift {
  position: absolute;
  right: -30px;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-56%);
  filter: drop-shadow(0 3px 2px rgba(74, 50, 32, 0.3));
}

.sheet-progress {
  position: relative;
  height: 22px;
  margin: 0;
  border-radius: 11px;
  background: #efe7d6;
  overflow: hidden;
}

.sheet-progress i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, #9be060, #5cb82c);
  transition: width 0.4s;
}

.sheet-progress span {
  position: relative;
  display: block;
  font-size: 13px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
  color: #4a3220;
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px 10px;
  border-radius: 18px;
  background: #faf5ea;
  box-shadow: inset 0 0 0 2px #efe4cc;
}

.task img {
  flex: none;
  width: 58px;
  height: 58px;
}

.task-name {
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.task.is-done {
  opacity: 0.6;
}

.task-ok {
  flex: none;
  width: 32px;
  height: 32px;
  position: relative;
  border-radius: 50%;
  background: #5cb82c;
  box-shadow: 0 2px 0 #3a8a18;
}

/* Галочка: повёрнутый угол из двух сторон рамки. */
.task-ok::after,
.goal.done b::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 8px;
  height: 15px;
  border: solid #fff;
  border-width: 0 4px 4px 0;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.task-do {
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 2px;
  min-width: 92px;
  padding: 6px 12px 7px 8px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #8fdc4e, #4ca822);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 4px 0 #2f7a16;
  color: #fff;
  text-shadow: 0 1px 0 rgba(30, 90, 10, 0.5);
}

.task-do img {
  width: 26px;
  height: 26px;
  grid-row: span 2;
}

.task-do b {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.task-do span {
  grid-column: 2;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.task-do.is-short {
  background: linear-gradient(180deg, #d6cbb4, #b8aa8e);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 4px 0 #8a7c62;
  text-shadow: none;
}

.task-do:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 1px 0 #2f7a16;
}

.sheet-empty {
  margin: 6px 0 8px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 45%, #9a8a6c 45%, #9a8a6c 55%, transparent 55%) center / 16px 16px no-repeat,
    linear-gradient(-45deg, transparent 45%, #9a8a6c 45%, #9a8a6c 55%, transparent 55%) center / 16px 16px no-repeat,
    #f3ecdd;
}

/* ---------- разговор с Мирой ---------- */

.talk {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: flex-end;
  padding: 0 10px max(20px, var(--kit-safe-bottom));
  background: linear-gradient(180deg, rgba(20, 30, 10, 0) 45%, rgba(20, 30, 10, 0.45) 100%);
  cursor: pointer;
}

.talk[hidden] {
  display: none;
}

.talk-face {
  position: absolute;
  left: max(-10px, calc(50% - 250px));
  bottom: calc(max(20px, var(--kit-safe-bottom)) + 108px);
  width: min(52vw, 230px);
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(20, 30, 10, 0.35));
  animation: g-face 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}

@keyframes g-face {
  from { transform: translateY(40px); opacity: 0; }
}

.talk-bubble {
  position: relative;
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 22px 18px 12px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 6px 0 rgba(122, 76, 36, 0.35), 0 14px 30px rgba(20, 30, 10, 0.35);
  color: var(--ink-dark);
}

.talk-name {
  position: absolute;
  top: -14px;
  left: 18px;
  padding: 3px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff8ab0, #e95c8c);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 3px 0 #b83a66;
}

.talk-text {
  min-height: 3.9em;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.32;
}

.talk-text.pop {
  animation: g-text 0.25s ease-out;
}

@keyframes g-text {
  from { opacity: 0; transform: translateY(6px); }
}

.talk-next {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #a8957a;
  text-align: right;
}

/* =====================================================================
                               УРОВЕНЬ
   ===================================================================== */

/* своя стопка слоёв: иначе фон body ложится поверх сада */
.app.level {
  z-index: 0;
  padding-left: 8px;
  padding-right: 8px;
}

/* панель ходов — у верхнего края, инструменты — у нижнего, поле посередине */
.level .stage {
  max-height: none !important;
}

/* за полем — тот же сад, чуть притемнённый; сверху и снизу темнее, чтобы читались панели */
.level::before {
  content: '';
  position: fixed;
  inset: -8px;
  z-index: -2;
  background: var(--garden) center / cover no-repeat, #3f7f2c;
  filter: brightness(0.8) saturate(0.95);
}

.level::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 40, 12, 0.55) 0%, rgba(20, 40, 12, 0) 22%, rgba(20, 40, 12, 0) 74%, rgba(20, 40, 12, 0.6) 100%);
}

.lv-top {
  height: 78px;
  gap: 8px;
  align-items: center;
}

.lv-top .hud-btn {
  flex: none;
  align-self: flex-start;
}

/* счётчик ходов — круглая медаль в венке */
.moves {
  flex: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fffdf4, #f2e3c0 70%);
  box-shadow:
    0 0 0 4px #6fbf3a,
    0 0 0 7px #3f8a20,
    0 6px 0 6px rgba(30, 70, 15, 0.55),
    0 12px 20px rgba(10, 25, 5, 0.4);
  color: var(--ink-dark);
}

.moves b {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.moves small {
  margin-top: 1px;
  font-size: 11px;
  font-weight: 800;
  color: #7a6448;
}

.moves.is-low {
  box-shadow:
    0 0 0 4px #ff9a5a,
    0 0 0 7px #d4501e,
    0 6px 0 6px rgba(120, 40, 10, 0.55),
    0 12px 20px rgba(10, 25, 5, 0.4);
  animation: g-badge 1s ease-in-out infinite;
}

.moves.is-low b {
  color: #c8401a;
}

.goals {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 70px;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 252, 240, 0.98), rgba(243, 230, 200, 0.98));
  box-shadow: inset 0 -3px 0 rgba(190, 150, 90, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.85), 0 5px 0 3px rgba(122, 76, 36, 0.5), 0 10px 18px rgba(10, 25, 5, 0.35);
}

.goals.many {
  gap: 4px;
}

.goal {
  position: relative;
  flex: 0 1 54px;
  width: 54px;
  height: 54px;
  min-width: 0;
}

.goal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.goal b {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(122, 76, 36, 0.45);
  color: var(--ink-dark);
  font-size: 14px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.goal.done b {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: #5cb82c;
  box-shadow: 0 2px 0 #3a8a18;
}

.goal.done b::after {
  width: 5px;
  height: 10px;
  border-width: 0 3px 3px 0;
}

/* поле без рамки: клетки сами рисуют форму, обводка по краю формы */
.level .well {
  --well-pad: 4px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.board {
  width: calc(var(--cols) * var(--cell, 44px));
  height: calc(var(--rows) * var(--cell, 44px));
  --shard: 9px;
}

.cells {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell, 44px));
  grid-auto-rows: var(--cell, 44px);
  filter:
    drop-shadow(0 2.5px 0 rgba(255, 250, 230, 0.9))
    drop-shadow(0 -2.5px 0 rgba(255, 250, 230, 0.9))
    drop-shadow(2.5px 0 0 rgba(255, 250, 230, 0.9))
    drop-shadow(-2.5px 0 0 rgba(255, 250, 230, 0.9))
    drop-shadow(0 6px 10px rgba(10, 25, 5, 0.45));
}

.cells i {
  background: rgba(214, 236, 190, 0.78);
}

.cells i.odd {
  background: rgba(190, 222, 162, 0.78);
}

.cells i.hole {
  background: none;
}

.layer-treasure,
.layer-leaf,
.layer-bed,
.layer-pieces,
.layer-honey,
.layer-vine,
.layer-box,
.layer-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer-fx {
  overflow: visible;
}

/* новые фрукты падают из-за верхнего края поля: над полем их не видно */
.layer-pieces {
  clip-path: inset(0 -40px -40px -40px);
}

.tile,
.piece {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cell, 44px);
  height: var(--cell, 44px);
  background: center / 100% 100% no-repeat;
}

.board .tile {
  border-radius: 0;
  box-shadow: none;
  transition: opacity 0.3s, scale 0.3s;
}

.tile-leaf {
  background-size: 98% 98%;
}

.tile-vine {
  background-size: 104% 104%;
}

.tile-box {
  background-size: 98% 98%;
}

.tile.gone {
  opacity: 0;
  scale: 1.25;
}

.tile-bed.grow {
  animation: g-grow 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}

/* мёд: полупрозрачный, фрукт под ним виден; растекаясь, натекает со стороны соседа */
.tile-honey {
  background-size: 100% 100%;
}

.tile-honey.grow {
  animation: g-honey-push 0.45s ease-in-out;
}

/* Клетки поля стоят через transform: translate, поэтому scale здесь сдвигал бы клетку с места:
   натекание — проявление со стороны соседа (clip-path), толчок — размер картинки внутри клетки. */
.tile-honey.ooze {
  animation: 0.62s cubic-bezier(0.3, 1.2, 0.5, 1) both;
}

.tile-honey.ooze.from-l { animation-name: g-ooze-l; }
.tile-honey.ooze.from-r { animation-name: g-ooze-r; }
.tile-honey.ooze.from-u { animation-name: g-ooze-u; }
.tile-honey.ooze.from-d { animation-name: g-ooze-d; }

@keyframes g-ooze-l {
  from { clip-path: inset(0 92% 0 0 round 40%); opacity: 0.5; }
  60% { opacity: 1; }
  to { clip-path: inset(0 0 0 0 round 0); }
}

@keyframes g-ooze-r {
  from { clip-path: inset(0 0 0 92% round 40%); opacity: 0.5; }
  60% { opacity: 1; }
  to { clip-path: inset(0 0 0 0 round 0); }
}

@keyframes g-ooze-u {
  from { clip-path: inset(0 0 92% 0 round 40%); opacity: 0.5; }
  60% { opacity: 1; }
  to { clip-path: inset(0 0 0 0 round 0); }
}

@keyframes g-ooze-d {
  from { clip-path: inset(92% 0 0 0 round 40%); opacity: 0.5; }
  60% { opacity: 1; }
  to { clip-path: inset(0 0 0 0 round 0); }
}

@keyframes g-honey-push {
  50% { background-size: 107% 95%; }
}

.honey-splat {
  position: absolute;
  border-radius: 46% 54% 50% 50%;
  background: radial-gradient(circle at 40% 38%, rgba(255, 214, 120, 0.9), rgba(214, 130, 20, 0.75) 45%, rgba(170, 90, 10, 0) 72%);
  animation: g-boom 0.45s ease-out forwards;
}

.honey-drip {
  position: absolute;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 40% 35%, #ffd27a, #d0800e 60%, #9a5208);
  animation: g-drip 0.6s ease-in both;
}

@keyframes g-drip {
  from { opacity: 0; translate: 0 0; scale: 0.6 0.6; }
  20% { opacity: 1; scale: 0.9 1.2; }
  to { opacity: 0; translate: 0 140%; scale: 0.7 1.4; }
}

@keyframes g-grow {
  40% { scale: 1.18; filter: brightness(1.25); }
}

/* клад лежит под листьями; найденный — светится и улетает к цели */
.treasure {
  position: absolute;
  object-fit: contain;
  opacity: 0.35;
  filter: saturate(0.4) brightness(0.8);
  transition: opacity 0.4s, filter 0.4s;
}

.treasure.found {
  opacity: 0;
  filter: none;
  animation: g-found 0.9s ease-out;
}

@keyframes g-found {
  0% { opacity: 1; scale: 1; filter: brightness(1.6) drop-shadow(0 0 12px #fff6c0); }
  60% { opacity: 1; scale: 1.15; }
  100% { opacity: 0; scale: 1.3; }
}

.piece {
  background-size: 92% 92%;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.45, 0.05, 0.6, 1.25);
  will-change: transform;
}

.piece.sel {
  filter: brightness(1.15) drop-shadow(0 0 6px rgba(255, 250, 200, 0.95));
}

.piece.pop {
  animation: g-pop 0.26s ease-in forwards;
}

.piece.blow {
  animation: g-blow 0.26s ease-in forwards;
}

.piece.zap {
  animation: g-zap 0.45s ease-in forwards;
}

.piece.born {
  animation: g-born 0.38s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.piece.land {
  animation: g-land 0.22s ease-out;
}

.piece.hint {
  animation: g-hint 1.1s ease-in-out infinite;
}

.piece.sp-rainbow {
  filter: drop-shadow(0 0 6px rgba(255, 255, 220, 0.9));
}

.piece.sp-can {
  background-size: 88% 88%;
}

.piece.shine::after {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 230, 0.9), rgba(255, 255, 230, 0) 65%);
  animation: g-shine 0.6s ease-out forwards;
}

@keyframes g-pop {
  30% { scale: 1.22; filter: brightness(1.3); }
  to { opacity: 0; scale: 0.15; }
}

@keyframes g-blow {
  to { opacity: 0; scale: 1.5; }
}

@keyframes g-zap {
  0% { filter: none; }
  40% { filter: brightness(2.2) drop-shadow(0 0 8px #fff); scale: 1.15; }
  to { opacity: 0; scale: 0.3; }
}

@keyframes g-born {
  from { scale: 0.2; }
}

@keyframes g-land {
  40% { scale: 1.08 0.9; }
}

@keyframes g-hint {
  0%, 60%, 100% { scale: 1; }
  70% { scale: 1.14; }
  80% { scale: 0.96; }
  90% { scale: 1.08; }
}

@keyframes g-shine {
  to { opacity: 0; scale: 1.6; }
}

.boom {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 230, 0.95) 0%, rgba(255, 210, 90, 0.75) 35%, rgba(255, 150, 40, 0) 70%);
  animation: g-boom 0.5s ease-out forwards;
}

.ring {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 240, 180, 0.9), 0 0 14px rgba(255, 220, 120, 0.8);
  animation: g-ring 0.55s ease-out forwards;
}

.cross {
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 200, 80, 0), #fff8d8 30%, #fff8d8 70%, rgba(255, 200, 80, 0));
  box-shadow: 0 0 12px rgba(255, 210, 100, 0.9);
  animation: g-cross 0.42s ease-out forwards;
}

.cross.v {
  background: linear-gradient(180deg, rgba(255, 200, 80, 0), #fff8d8 30%, #fff8d8 70%, rgba(255, 200, 80, 0));
}

.beam {
  position: absolute;
  transform-origin: 0 50%;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff8a8a, #ffd36a, #8fe07a, #7ac4ff, #c49aff);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  opacity: 0;
  animation: g-beam 0.5s ease-out forwards;
}

.sweep {
  position: absolute;
  border-radius: 12px;
  background: rgba(255, 248, 210, 0.75);
  box-shadow: 0 0 16px rgba(255, 240, 170, 0.9);
  animation: g-sweep 0.5s ease-out forwards;
}

.dig {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 95, 50, 0.85), rgba(140, 95, 50, 0) 70%);
  animation: g-boom 0.5s ease-out forwards;
}

@keyframes g-boom {
  from { opacity: 1; transform: scale(0.3); }
  to { opacity: 0; transform: scale(1); }
}

@keyframes g-ring {
  from { opacity: 1; transform: scale(0.2); }
  to { opacity: 0; transform: scale(1.15); }
}

@keyframes g-cross {
  from { opacity: 1; scale: 0.2 1; }
  60% { opacity: 1; scale: 1 1; }
  to { opacity: 0; scale: 1 0.4; }
}

@keyframes g-beam {
  0% { opacity: 1; scale: 0 1; }
  50% { opacity: 1; scale: 1 1; }
  100% { opacity: 0; scale: 1 1; }
}

@keyframes g-sweep {
  from { opacity: 0.9; scale: 0.4; }
  to { opacity: 0; scale: 1; }
}

/* летящее к цели */
.flyer {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.star-fly {
  position: fixed;
  left: -12px;
  top: -12px;
  z-index: 30;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #fffbe0 0%, #ffd84a 45%, rgba(255, 200, 60, 0) 72%);
  box-shadow: 0 0 14px 4px rgba(255, 220, 90, 0.7);
}

/* брызги сока: свой цвет у каждого фрукта, круглые капли */
.layer-fx [class*='shard-'] {
  border-radius: 50%;
}

.shard-strawberry { --tile: #e0433a; --tile-hi: #ff7a66; --tile-lo: #a82a24; }
.shard-blueberry { --tile: #4a68cc; --tile-hi: #7d96e6; --tile-lo: #2c3f8e; }
.shard-pear { --tile: #9ec23a; --tile-hi: #c4dc6a; --tile-lo: #6a8a1e; }
.shard-lemon { --tile: #f0c52e; --tile-hi: #ffe07a; --tile-lo: #c09018; }
.shard-grape { --tile: #8448c0; --tile-hi: #a878e0; --tile-lo: #5a2a8a; }
.shard-orange { --tile: #ee7f1e; --tile-hi: #ffa856; --tile-lo: #b8580e; }
.shard-gold { --tile: #ffd24a; --tile-hi: #fff3b0; --tile-lo: #e0a020; }
.shard-wood { --tile: #c48a4a; --tile-hi: #e8b878; --tile-lo: #8a5a2a; }
.shard-leaf { --tile: #b8783a; --tile-hi: #e0a860; --tile-lo: #7a4a20; }
.shard-honey { --tile: #d88a14; --tile-hi: #ffc860; --tile-lo: #9a5208; }

/* низ: радуга, инструменты, звук */
.lv-foot {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  height: 76px;
}

.charge {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  width: 92px;
  height: 56px;
}

.charge img {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  flex: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}

.charge-bar {
  position: absolute;
  left: 34px;
  right: 0;
  top: 50%;
  height: 16px;
  margin-top: -8px;
  border-radius: 8px;
  background: rgba(20, 40, 10, 0.55);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 250, 230, 0.8);
  overflow: hidden;
}

.charge-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, #ff6a6a, #ffc23a, #7fd650, #4ab0ff, #a06aff);
  transition: width 0.35s;
}

.charge.is-full img {
  animation: g-badge 0.8s ease-in-out infinite;
}

.tools {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.tool {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fffdf4, #ecdcb6 75%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 5px 0 2px #a8804a, 0 9px 14px rgba(10, 25, 5, 0.4);
  cursor: pointer;
  transition: transform 0.12s;
}

.tool img {
  width: 46px;
  height: 46px;
  margin: 6px;
}

.tool:active {
  transform: translateY(3px);
}

.tool.is-on {
  box-shadow: 0 0 0 4px #8fdc4e, 0 0 0 7px #3f8a20, 0 0 18px 6px rgba(160, 240, 110, 0.6);
  animation: g-badge 1s ease-in-out infinite;
}

.tool.is-locked img {
  filter: grayscale(1) opacity(0.45);
}

.tool b,
.boost b {
  position: absolute;
  right: -5px;
  bottom: -3px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff7f6a, #e04b2c);
  box-shadow: 0 2px 0 #9e2c14;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 24px;
  text-align: center;
}

.tool b.plus,
.boost b.plus {
  background: linear-gradient(180deg, #8fdc4e, #4ca822);
  box-shadow: 0 2px 0 #2f7a16;
}

.tool b.lock,
.boost b.lock {
  width: 26px;
  height: 26px;
  padding: 0;
  background: url("img/icon-lock.webp?v=2") center / 100% no-repeat;
  box-shadow: none;
}

.boost b.on {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  background: #5cb82c;
  box-shadow: 0 2px 0 #3a8a18;
}

.boost b.on::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 44%;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* выбран инструмент: подсказка над полем, клетки подсвечены */
.tool-hint {
  position: fixed;
  left: 50%;
  bottom: calc(86px + var(--kit-safe-bottom, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, calc(100% - 24px));
  padding: 10px 10px 10px 16px;
  border-radius: 18px;
  background: #fffdf4;
  box-shadow: 0 0 0 3px #8fdc4e, 0 8px 20px rgba(10, 25, 5, 0.45);
  color: var(--ink-dark);
  transform: translateX(-50%);
  animation: k-fade 0.2s ease-out;
}

.tool-hint div {
  flex: 1 1 auto;
  min-width: 0;
}

.tool-hint b {
  display: block;
  font-size: 15px;
  font-weight: 900;
}

.tool-hint span {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #7a6448;
}

.tool-cancel {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #efe3c8;
}

.tool-cancel::before,
.tool-cancel::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink-dark);
  transform: translate(-50%, -50%) rotate(45deg);
}

.tool-cancel::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.tool-on .cells i:not(.hole) {
  background: rgba(255, 248, 200, 0.82);
}

body.tool-on .cells i.odd {
  background: rgba(250, 236, 170, 0.82);
}

/* совет Миры на уровне */
.lv-tip {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--kit-safe-bottom, 0px));
  z-index: 21;
  display: flex;
  align-items: flex-end;
  width: min(440px, calc(100% - 16px));
  transform: translateX(-50%);
  cursor: pointer;
  animation: g-tip 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.lv-tip img {
  flex: none;
  width: 96px;
  height: 120px;
  object-fit: cover;
  object-position: 50% 0;
  margin-right: -10px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
}

.lv-tip p {
  flex: 1 1 auto;
  margin: 0 0 6px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fffdf4;
  box-shadow: 0 8px 20px rgba(10, 25, 5, 0.45);
  color: var(--ink-dark);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.lv-tip p b {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 10px;
  border-radius: 10px;
  background: #ff7fa8;
  color: #fff;
  font-size: 13px;
}

@keyframes g-tip {
  from { transform: translateX(-50%) translateY(40px); opacity: 0; }
}

/* ---------- окна ---------- */

/* Все окна — светлая панель посреди экрана, заголовок на зелёной ленте. */
.over-full {
  background: rgba(16, 36, 8, 0.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.over-full .card {
  position: relative;
  width: min(340px, 100%);
  padding: 50px 20px 24px;
  margin-top: 26px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fffdf6, #f4e8cf);
  color: var(--ink-dark);
  box-shadow:
    inset 0 -4px 0 rgba(190, 150, 90, 0.25),
    0 0 0 4px #fff,
    0 9px 0 4px #c9a46c,
    0 24px 40px rgba(5, 15, 2, 0.45);
}

.over-full .over-title,
.over-full .over-title.solo {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 8px);
  padding: 10px 22px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #8fdc4e, #4ca822);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 5px 0 #2f7a16;
  color: #fff;
  font-size: 21px;
  font-weight: 900;
  line-height: 26px;
  text-shadow: 0 2px 0 rgba(30, 90, 10, 0.55);
  text-wrap: balance;
}

.over-full.is-hard .over-title {
  background: linear-gradient(180deg, #ffa25c, #e45a22);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 5px 0 #a33a10;
  text-shadow: 0 2px 0 rgba(120, 40, 5, 0.55);
}

.over-full .over-score {
  color: var(--ink-dark);
  text-shadow: 0 4px 0 rgba(190, 150, 90, 0.35);
}

.over-full .over-text {
  color: #7a6448;
}

.over-full .over-note {
  margin-bottom: 4px;
  background: linear-gradient(180deg, #ff9a6a, #e0502a);
  color: #fff;
}

.over-full .btn-ghost {
  background: #efe3c8;
  box-shadow: 0 3px 0 #d5c19a;
  color: var(--ink-dark);
}

.over-full .btn-ghost:active {
  background: #e6d6b4;
}

.dlg-goals {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 16px;
}

.dlg-goal {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
}

.dlg-goal img {
  width: 100%;
  height: 100%;
}

.dlg-goal b {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  background: var(--leaf);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 26px;
  text-align: center;
}

.dlg-reward {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 4px 0 14px;
}

.dlg-reward span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 24px;
  font-weight: 900;
  color: var(--ink-dark);
}

.dlg-reward img {
  width: 44px;
  height: 44px;
}

.dlg-boosts {
  margin: 0 0 14px;
}

/* серия побед: три ступени со значками бустеров, текущая горит */
.dlg-streak {
  margin: 6px 0 14px;
}

.streak-row {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.streak-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 40px;
  border-radius: 14px;
  background: #efe4cc;
  box-shadow: inset 0 0 0 2px #e2d0a8;
}

.streak-seg img {
  width: 31px;
  height: 31px;
  margin: 0 -4px;
  filter: grayscale(1) opacity(0.4);
}

.streak-seg.is-done {
  background: #fbeab4;
  box-shadow: inset 0 0 0 2px #efd27a;
}

.streak-seg.is-done img {
  filter: opacity(0.75);
}

.streak-seg.is-on {
  background: linear-gradient(180deg, #fff4bf, var(--gold));
  box-shadow: 0 3px 0 #d39a1a, inset 0 0 0 2px #fff7d4;
}

.streak-seg.is-on img {
  filter: none;
}

.streak-note {
  margin: 7px 0 0;
  color: var(--ink-dark);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  opacity: 0.75;
}

.streak-note.is-on {
  color: #b2720c;
  opacity: 1;
}

.streak-note.is-lost {
  color: #c8452a;
  opacity: 1;
}

.dlg-cap {
  margin: 0 0 8px;
  color: var(--ink-dark);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  opacity: 0.8;
}

.boost-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.boost {
  position: relative;
  width: 70px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaf0, #f1e3c4);
  box-shadow: 0 4px 0 #c9b083, inset 0 0 0 2px #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.boost:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #c9b083, inset 0 0 0 2px #fff;
}

.boost.is-on {
  background: linear-gradient(180deg, #f4ffe6, #cdeea8);
  box-shadow: 0 4px 0 #6fae3c, inset 0 0 0 3px #8fdc4e;
}

.boost.is-locked .boost-pics img {
  filter: grayscale(1) opacity(0.45);
}

.boost-pics {
  position: absolute;
  inset: 6px;
  display: block;
}

.boost-pics img {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

.boost-pics.n2 img {
  width: 74%;
  height: 74%;
}

.boost-pics.n2 img:first-child {
  left: 0;
  top: 0;
}

.boost-pics.n2 img:last-child {
  left: 26%;
  top: 26%;
}

.dlg-reward-gift {
  flex-wrap: wrap;
  gap: 10px 14px;
}

.dlg-reward-gift span {
  font-size: 20px;
}

.dlg-reward-gift img {
  width: 40px;
  height: 40px;
}

.dlg-gift {
  width: 120px;
  height: 120px;
}

.dlg-pic {
  display: block;
  width: 96px;
  height: 96px;
  margin: 4px auto 6px;
}

@media (max-height: 620px) {
  .lv-top {
    height: 56px;
  }

  .goals {
    height: 56px;
  }

  .goal {
    width: 44px;
    height: 44px;
  }

  .moves {
    width: 56px;
    height: 56px;
  }

  .play-btn {
    height: 64px;
  }

  .tasks-ico {
    width: 62px;
    height: 62px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tasks-badge,
  .moves.is-low {
    animation: none;
  }

  .piece {
    transition-duration: 0ms !important;
  }
}

/* окно победы: большая звезда с лучами */
.win-star {
  position: relative;
  width: 96px;
  height: 96px;
  margin: -6px auto 0;
}

.win-star img {
  position: relative;
  display: block;
  width: 100%;
  animation: win-star-in 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.win-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 214, 90, 0.42) 0 10deg, rgba(255, 214, 90, 0) 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: win-rays 9s linear infinite;
}

@keyframes win-star-in {
  0% { transform: scale(0.2) rotate(-60deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

@keyframes win-rays {
  to { transform: rotate(360deg); }
}

/* звезда летит в счётчик после победы */
.star-home {
  position: fixed;
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  z-index: 60;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(80, 50, 0, 0.35));
}

.res.bump {
  animation: res-bump 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes res-bump {
  50% { transform: scale(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  .win-rays { animation: none; }
}

/* ---------- смена вида прямо в саду ---------- */

/* кнопка «Вид» над вещью, которой коснулись: картинка её вида и подпись, хвостик вниз */
.look-brush {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 13px 4px 4px;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf6, #f3e6c8);
  box-shadow: 0 0 0 3px #fff, 0 4px 0 3px #c9a874, 0 10px 18px rgba(20, 30, 10, 0.3);
  color: #8a5a1e;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  -webkit-tap-highlight-color: transparent;
}

.look-brush[hidden] {
  display: none;
}

.look-brush.on {
  animation: brush-in 0.32s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.look-brush:active {
  filter: brightness(0.95);
}

.look-brush img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
  object-fit: contain;
}

.look-brush::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  margin-left: -8px;
  border: 8px solid transparent;
  border-bottom: 0;
  border-top-color: #f3e6c8;
}

@keyframes brush-in {
  0% { transform: translate(-50%, calc(-100% - 4px)) scale(0.5); opacity: 0; }
  100% { transform: translate(-50%, calc(-100% - 12px)) scale(1); opacity: 1; }
}

/* 2D-сад: вещь качнулась от касания */
.garden-layer.wob {
  animation: g-wob 0.7s ease-out;
  transform-origin: 50% 92%;
}

@keyframes g-wob {
  0% { transform: none; }
  18% { transform: scale(1.04, 0.95); }
  38% { transform: rotate(-2.2deg) scale(0.98, 1.03); }
  58% { transform: rotate(1.6deg); }
  78% { transform: rotate(-0.7deg); }
  100% { transform: none; }
}

/* «Отмена» в окне выбора вида (смена вида позже) */
.look-cancel {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 45%, #9a8a6c 45%, #9a8a6c 55%, transparent 55%) center / 16px 16px no-repeat,
    linear-gradient(-45deg, transparent 45%, #9a8a6c 45%, #9a8a6c 55%, transparent 55%) center / 16px 16px no-repeat,
    #f3ecdd;
}

.look-cancel[hidden] {
  display: none;
}

/* ---------- «Участки» в листе дел ---------- */

.area-strip {
  margin-top: 4px;
}

.area-cap {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.7;
}

.area-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.area-row::-webkit-scrollbar {
  display: none;
}

.area-chip {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 76px;
  padding: 6px 4px 7px;
  border: 0;
  border-radius: 16px;
  background: #faf5ea;
  box-shadow: inset 0 0 0 2px #efe4cc;
  color: var(--ink-dark);
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.area-chip img {
  width: 48px;
  height: 48px;
}

.area-chip span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.area-chip.is-on {
  background: #f1ffe2;
  box-shadow: inset 0 0 0 3px #6fc23a;
}

/* текущий участок (там дела) — зелёная точка */
.area-chip.is-cur::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5cb82c;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- подарок дня ---------- */

.daily-dlg .card {
  padding-top: 44px;
}

.daily-dlg .over-text {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
}

.daily-box {
  position: relative;
  width: 104px;
  height: 92px;
  margin: 0 auto;
}

.daily-gift {
  position: relative;
  display: block;
  width: 92px;
  height: 92px;
  margin: 0 auto;
  animation: daily-idle 1.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 3px rgba(74, 50, 32, 0.3));
}

.daily-rays {
  opacity: 0;
  transition: opacity 0.3s;
}

.daily-box.open .daily-rays {
  opacity: 1;
}

.daily-box.shake .daily-gift {
  animation: daily-shake 0.56s ease-in-out;
}

.daily-box.open .daily-gift {
  animation: daily-open 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes daily-idle {
  0%, 100% { transform: none; }
  50% { transform: translateY(-4px) rotate(-2deg); }
}

@keyframes daily-shake {
  0%, 100% { transform: none; }
  15% { transform: rotate(-9deg) scale(1.04); }
  30% { transform: rotate(8deg) scale(1.06); }
  45% { transform: rotate(-7deg) scale(1.08); }
  60% { transform: rotate(6deg) scale(1.1); }
  80% { transform: scale(1.16, 0.88); }
}

@keyframes daily-open {
  0% { transform: scale(0.6); }
  100% { transform: scale(1); }
}

.daily-got {
  min-height: 38px; /* место под награду заранее: окно не прыгает, когда подарок открылся */
  margin: 2px 0 6px;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.daily-got span {
  font-size: 19px;
}

.daily-got img {
  width: 36px;
  height: 36px;
}

.daily-got .pop {
  animation: daily-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes daily-pop {
  0% { transform: translateY(18px) scale(0.3); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.daily-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 2px 5px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
}

.daily-n {
  font-size: 11px;
  font-weight: 900;
  color: #8a6a4a;
  white-space: nowrap;
}

.daily-pics {
  display: flex;
  align-items: center;
  justify-content: center;
}

.daily-pics > img {
  width: 40px;
  height: 40px;
}

.daily-amt {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink-dark);
}

.daily-day.is-big {
  grid-column: span 2;
  background: linear-gradient(180deg, #fff6dc, #ffe7a8);
  box-shadow: inset 0 0 0 2px #f2cf72;
}

.daily-day.is-big .daily-pics > img {
  width: 46px;
  height: 46px;
}

.daily-mini {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 0 4px;
  margin-left: 2px;
}

.daily-mini span {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--ink-dark);
}

.daily-mini img {
  width: 20px;
  height: 20px;
}

.daily-day.is-today {
  background: linear-gradient(180deg, #fff4bf, var(--gold));
  box-shadow: 0 3px 0 #d39a1a, inset 0 0 0 2px #fff7d4;
  animation: daily-today 1.4s ease-in-out infinite;
}

@keyframes daily-today {
  50% { transform: scale(1.05); }
}

.daily-day.is-done > :not(.daily-n) {
  opacity: 0.4;
}

/* галочка на взятом дне */
.daily-day.is-done::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #5cb82c;
  box-shadow: 0 2px 0 #3a8a18;
}

.daily-day.is-done::before {
  content: '';
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.daily-day.just::after,
.daily-day.just::before {
  animation: daily-check 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes daily-check {
  0% { opacity: 0; scale: 0.2; }
  100% { opacity: 1; scale: 1; }
}

@media (max-height: 620px) {
  .daily-box,
  .daily-gift {
    height: 70px;
  }

  .daily-gift {
    width: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .daily-gift,
  .daily-day.is-today,
  .look-brush.on,
  .garden-layer.wob {
    animation: none;
  }
}

/* ---------- соседи и праздник цветов (тётушка Роза, Тим; финал у озера) ---------- */

/* в разговоре говорит сосед: свой портрет (img/rosa.webp, tim.webp) и цвет ленты с именем */
.talk-face.swap {
  animation: g-face 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.talk.who-rosa .talk-name {
  background: linear-gradient(180deg, #c7a2ec, #9a6fd0);
  box-shadow: 0 3px 0 #6e4aa3;
}

.talk.who-tim .talk-name {
  background: linear-gradient(180deg, #7fd8b0, #3fae84);
  box-shadow: 0 3px 0 #2a7c5c;
}

/* фраза соседа по касанию в 3D: длиннее Миросиных — переносится */
.guest-hi {
  width: max-content;
  max-width: min(62vw, 250px);
  white-space: normal;
  background: #fbf6ff;
}

.guest-hi::after {
  border-top-color: #fbf6ff;
}

.guest-hi.is-tim {
  background: #f1fff8;
}

.guest-hi.is-tim::after {
  border-top-color: #f1fff8;
}

/* праздник: верх и низ дома прячутся, остаётся сад, разговор и звук */
body.festival .home-top,
body.festival .home-bottom {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0s 0.4s;
}

body.festival .mira-hi:not(.guest-hi) {
  display: none;
}

/* праздник в сумерках: бабочки (картинкой поверх сада) спят */
body.festival .garden-life {
  display: none;
}

/* праздник без WebGL: сумерки слоем поверх картинки */
.fest-dusk {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse 60% 26% at 72% 68%, rgba(255, 190, 110, 0.22), rgba(255, 190, 110, 0) 70%),
    linear-gradient(180deg, rgba(16, 20, 60, 0.62) 0%, rgba(44, 34, 84, 0.5) 38%, rgba(70, 40, 50, 0.36) 100%);
  pointer-events: none;
  animation: fest-dusk 2.4s ease-out both;
}

@keyframes fest-dusk {
  from { opacity: 0; }
}

/* салют без WebGL: искры своего цвета разлетаются шаром */
.fw-spark {
  position: absolute;
  z-index: 3;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--c, #ffd27a);
  box-shadow: 0 0 8px 2px var(--c, #ffd27a);
  opacity: 0;
  animation: fw-spark 1.6s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}

@keyframes fw-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  12% { opacity: 1; }
  70% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.7); }
}

/* карточка «Спасибо!»: фон прозрачнее — за ней видно огоньки и салют */
.over-full.fest-over {
  background: rgba(14, 16, 44, 0.38);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.over-full.fest-over .over-title {
  background: linear-gradient(180deg, #ffb2cf, #e9709c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 5px 0 #b8466f;
  text-shadow: 0 2px 0 rgba(140, 40, 80, 0.5);
}

.dlg-fest {
  width: 104px;
  height: 104px;
}

.fest-stats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 16px;
}

.fest-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 86px;
  padding: 8px 4px 7px;
  border-radius: 16px;
  background: #faf2df;
  box-shadow: inset 0 0 0 2px #efe0bf;
}

.fest-stats img {
  width: 34px;
  height: 34px;
}

.fest-stats b {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink-dark);
  font-variant-numeric: tabular-nums;
}

.fest-stats small {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  color: #8a7356;
  text-align: center;
}

/* фишка праздника в «Участках» и строка в листе: розовая; ещё не смотрели — с точкой */
.area-chip.fest-chip {
  background: #fff0f6;
  box-shadow: inset 0 0 0 2px #f6c6da;
}

.task-fest {
  background: #fff0f6;
}

.area-chip.fest-chip.is-new::after,
.task-fest.is-new::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e9709c;
  box-shadow: 0 0 0 2px #fff;
}

.task-fest {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .talk-face.swap,
  .fest-dusk,
  .fw-spark {
    animation: none;
  }
}

/* =====================================================================
   НАХОДКИ (альбом) и РУКА-ПОДСКАЗКА — раздел добавлен вместе с album.py
   ===================================================================== */

/* кнопка «Находки» над «Заданиями» */
.album-btn {
  position: absolute;
  left: 6px;
  bottom: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  padding: 0;
  border: 0;
  background: none;
}

.album-btn[hidden] {
  display: none;
}

.album-ico {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    url("img/album.webp?v=1") center / 84% no-repeat,
    radial-gradient(circle at 50% 35%, #fffdf2, #efdcb0);
  box-shadow: 0 0 0 4px #fff, 0 4px 0 4px rgba(122, 76, 36, 0.55), 0 9px 16px rgba(20, 40, 10, 0.3);
}

.album-btn:active .album-ico {
  transform: translateY(3px);
}

.album-label {
  margin-top: 7px;
  padding: 1px 8px;
  border-radius: 9px;
  background: var(--wood-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.album-btn .tasks-badge {
  top: -6px;
  right: 0;
  width: 22px;
  height: 22px;
  font-size: 14px;
}

body.picking .album-btn,
body.festival .album-btn {
  display: none;
}

@media (max-height: 700px) {
  .album-btn {
    bottom: 106px;
  }

  .album-ico {
    width: 48px;
    height: 48px;
  }
}

/* окно альбома */
.album-dlg .card {
  width: min(380px, 100%);
  padding-left: 14px;
  padding-right: 14px;
}

.album-hint {
  margin: 0 6px 10px;
  color: #7a6448;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.album-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-height: calc(100dvh - 250px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 6px;
}

.album-set {
  position: relative;
  flex: none;
  padding: 9px 10px 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
  text-align: left;
}

.album-set.is-big {
  background: linear-gradient(180deg, #fffaf0, #fff1d2);
}

.album-set.is-ready {
  box-shadow: inset 0 0 0 3px var(--gold), 0 0 14px rgba(255, 196, 40, 0.55);
  animation: album-ready 1.6s ease-in-out infinite;
}

@keyframes album-ready {
  50% { box-shadow: inset 0 0 0 3px var(--gold), 0 0 22px rgba(255, 196, 40, 0.85); }
}

.album-set.is-done {
  background: #f3fbe9;
  box-shadow: inset 0 0 0 2px #cfe8b4;
}

.album-set.just {
  animation: album-just 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes album-just {
  40% { transform: scale(1.04); }
}

.album-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.album-name {
  font-size: 15px;
  font-weight: 900;
}

.album-prog {
  flex: none;
  color: #9a8466;
  font-size: 12px;
  font-weight: 800;
}

.album-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.album-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #fbf5e6, #efe2c4);
}

.album-slot img {
  display: block;
  width: 100%;
  height: 100%;
  filter: brightness(0);
  opacity: 0.13;
}

.album-slot.is-got img {
  filter: none;
  opacity: 1;
}

.album-slot.is-new::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5a48;
  box-shadow: 0 0 0 2px #fff;
}

.album-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  margin-top: 7px;
}

.album-gift {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}

.album-gift small {
  width: 100%;
  color: #c0651c;
  font-size: 11px;
  font-weight: 900;
}

.album-gift span,
.album-pop span {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink-dark);
}

.album-gift img {
  width: 26px;
  height: 26px;
}

.album-claim.btn {
  flex: none;
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0 16px;
  font-size: 15px;
}

.album-claimed {
  color: #4c8a22;
  font-size: 13px;
  font-weight: 900;
}

.album-pop {
  margin: 8px 0 0;
  gap: 12px;
}

.album-pop img {
  width: 34px;
  height: 34px;
}

.album-pop .pop {
  animation: daily-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

/* находка в окне победы: листья вздрагивают и разлетаются, под ними — вещица */
.has-find .win-star {
  width: 64px;
  height: 64px;
}

.has-find .win-star .win-rays {
  display: none;
}

.has-find .dlg-reward {
  margin-bottom: 6px;
}

.find {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 0 2px;
  padding: 8px 8px 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
}

.find-pic {
  position: relative;
  width: 84px;
  height: 84px;
}

.find-rays {
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  animation: find-rays-in 0.5s 0.9s ease-out both, win-rays 9s 0.9s linear infinite;
}

@keyframes find-rays-in {
  from { opacity: 0; transform: scale(0.3); }
}

.find-item,
.find-cover {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.find-item {
  animation: find-item 0.6s 0.85s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

@keyframes find-item {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.find-cover {
  animation: find-cover 1.2s ease-in both;
}

@keyframes find-cover {
  0% { transform: scale(0.4); opacity: 0; }
  20% { transform: none; opacity: 1; }
  35% { transform: rotate(-9deg); }
  45% { transform: rotate(8deg); }
  55% { transform: rotate(-5deg); }
  65% { transform: none; opacity: 1; }
  100% { transform: translate(70px, -60px) rotate(140deg) scale(0.5); opacity: 0; }
}

.find-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 5px;
  margin: 4px 0 6px;
  font-size: 14px;
  line-height: 1.25;
  animation: find-item 0.4s 1s ease-out both;
}

.find-text b {
  font-weight: 900;
}

.find-text span {
  font-weight: 700;
}

.find-coin {
  width: 22px;
  height: 22px;
}

.find-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.find-set img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  filter: brightness(0);
  opacity: 0.16;
}

.find-set img.is-got {
  background: #f6eedc;
  filter: none;
  opacity: 1;
}

.find-set img.is-new {
  background: #fff1b8;
  box-shadow: 0 0 0 2px var(--gold);
  animation: find-item 0.5s 1.1s cubic-bezier(0.3, 1.7, 0.5, 1) both;
}

.find-set small {
  width: 100%;
  margin-top: 2px;
  color: #9a8466;
  font-size: 11px;
  font-weight: 800;
}

.find-done {
  margin: 6px 0 0;
  padding: 3px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff4bf, var(--gold));
  color: var(--ink-dark);
  font-size: 13px;
  font-weight: 900;
}

/* рука-подсказка: поверх поля, сквозь неё можно нажимать */
.coach {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.coach[hidden],
.coach-tip[hidden] {
  display: none;
}

.coach-hand {
  position: absolute;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 6px 6px rgba(20, 30, 10, 0.35));
  transform-origin: 19% 8%;
}

.coach.is-swipe .coach-hand {
  animation: coach-swipe 1.8s ease-in-out infinite;
}

.coach.is-tap .coach-hand {
  animation: coach-tap 1.1s ease-in-out infinite;
}

.coach.is-down .coach-hand {
  rotate: 180deg;
  transform-origin: 50% 50%;   /* поворот вокруг середины: кончик пальца встаёт в 81% 92% (так считает showCoach) */
}

@keyframes coach-swipe {
  0% { transform: translate(0, 0) scale(1.08); opacity: 0; }
  12% { transform: translate(0, 0) scale(1); opacity: 1; }
  25% { transform: translate(0, 0) scale(0.92); }
  65% { transform: translate(var(--dx), var(--dy)) scale(0.92); opacity: 1; }
  80% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; }
}

@keyframes coach-tap {
  0%, 100% { transform: translate(0, 0); }
  45% { transform: translate(5px, 9px) scale(0.92); }
  60% { transform: translate(5px, 9px) scale(0.92); }
}

.coach-tip {
  position: absolute;
  width: min(280px, calc(100vw - 20px));
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
  background: #fffdf6;
  box-shadow: 0 0 0 3px #fff, 0 4px 0 3px rgba(190, 150, 90, 0.45), 0 10px 18px rgba(10, 20, 5, 0.3);
  color: var(--ink-dark);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  animation: find-item 0.35s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .album-set.is-ready,
  .album-set.just,
  .find-rays,
  .find-item,
  .find-text,
  .find-set img.is-new,
  .coach-tip {
    animation: none;
  }

  .find-cover {
    display: none;
  }

  .coach.is-swipe .coach-hand {
    animation-duration: 3s;
  }

  .coach.is-tap .coach-hand {
    animation: none;
  }
}

/* =====================================================================
   СБОР УРОЖАЯ — событие недели (кнопка в саду, окно ступеней, строка в окне победы, записка новой недели)
   ===================================================================== */

/* кнопка слева под счётчиками: фрукт недели в кольце-прогрессе (--p — доля до следующей ступени) */
.event-btn {
  position: absolute;
  top: calc(max(10px, var(--kit-safe-top)) + 52px);
  left: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 76px;
  padding: 0;
  border: 0;
  background: none;
}

.event-btn[hidden] {
  display: none;
}

.event-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(#ffb21e calc(var(--p, 0) * 1turn), rgba(122, 76, 36, 0.22) 0);
  box-shadow: 0 0 0 3px #fff, 0 4px 0 3px rgba(122, 76, 36, 0.55), 0 9px 16px rgba(20, 40, 10, 0.3);
}

.event-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fffdf2, #efdcb0);
}

.event-ring img {
  position: relative;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 2px 2px rgba(60, 30, 10, 0.25));
}

.event-btn.is-ready .event-ring img {
  animation: ev-wiggle 1.6s ease-in-out infinite;
}

@keyframes ev-wiggle {
  0%, 60%, 100% { transform: none; }
  70% { transform: rotate(-12deg) scale(1.08); }
  80% { transform: rotate(10deg) scale(1.08); }
  90% { transform: rotate(-5deg); }
}

.event-btn:active .event-ring {
  transform: translateY(3px);
}

.event-left {
  margin-top: 7px;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--wood-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.event-btn .tasks-badge {
  top: -5px;
  right: 2px;
  width: 22px;
  height: 22px;
  font-size: 14px;
}

body.picking .event-btn,
body.festival .event-btn {
  display: none;
}

@media (max-height: 700px) {
  .event-ring {
    width: 50px;
    height: 50px;
  }

  .event-ring img {
    width: 36px;
    height: 36px;
  }
}

/* окно события */
.event-dlg .card {
  width: min(370px, 100%);
  padding-left: 14px;
  padding-right: 14px;
}

.ev-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: -4px 0 4px;
  text-align: left;
}

.ev-fruit {
  position: relative;
  flex: none;
  width: 70px;
  height: 70px;
}

.ev-fruit img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.ev-rays {
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
}

.ev-about {
  min-width: 0;
}

.ev-about small {
  display: block;
  color: #c0651c;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ev-about b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.15;
}

.ev-about p {
  margin: 2px 0 0;
  color: #7a6448;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.ev-time {
  margin: 4px 0 6px;
  color: #7a6448;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ev-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
}

.ev-bar,
.ev-win-bar {
  position: relative;
  flex: 1;
  height: 14px;
  border-radius: 7px;
  background: #eadbbc;
  box-shadow: inset 0 2px 0 rgba(122, 76, 36, 0.18);
  overflow: hidden;
}

.ev-bar i,
.ev-win-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffd666, #f2a218);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: width 0.6s cubic-bezier(0.3, 1.2, 0.5, 1);
}

.ev-count {
  flex: none;
  min-width: 64px;
  font-size: 14px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ev-tiers {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  max-height: calc(100dvh - 330px);
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3px 3px 5px;
}

.ev-tier {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
  text-align: left;
}

.ev-tier.is-next {
  box-shadow: inset 0 0 0 2px #f0c46a;
}

.ev-tier.is-ready {
  box-shadow: inset 0 0 0 3px var(--gold), 0 0 12px rgba(255, 196, 40, 0.5);
}

.ev-tier.is-done {
  background: #f3fbe9;
  box-shadow: inset 0 0 0 2px #cfe8b4;
}

.ev-tier.is-big {
  background: linear-gradient(180deg, #fffaf0, #fff1d2);
}

.ev-tier.is-big.is-done {
  background: #f3fbe9;
}

.ev-tier.just {
  animation: album-just 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.ev-need {
  flex: none;
  display: flex;
  align-items: center;
  width: 62px;
  height: 30px;
  padding-right: 6px;
  border-radius: 15px;
  background: #f6ecd6;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ev-need img {
  width: 30px;
  height: 30px;
  margin: 0 1px 0 -2px;
}

.ev-tier.is-locked .ev-need {
  color: #9a8466;
}

.ev-gifts {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}

.ev-gifts span {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--ink-dark);
  font-size: 14px;
  font-weight: 900;
}

.ev-gifts img {
  width: 28px;
  height: 28px;
}

.ev-gifts .ev-chip-find b {
  font-size: 12px;
}

.ev-gifts .pop {
  animation: daily-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.ev-tier.is-done .ev-gifts > :not(.pop) {
  opacity: 0.45;
}

.ev-tier .ev-basket {
  flex: none;
  width: 60px;
  height: 60px;
  margin: -8px -4px -8px -6px;
}

.ev-gifts small {
  width: 100%;
  color: #c0651c;
  font-size: 11px;
  font-weight: 900;
}

.ev-end {
  flex: none;
  display: flex;
  justify-content: flex-end;
  min-width: 46px;
}

.ev-claim.btn {
  width: auto;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

/* галочка у взятой ступени */
.ev-ok {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #5cb82c;
  box-shadow: 0 2px 0 #3a8a18;
}

.ev-ok::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* окно победы: «+N к урожаю», фрукты летят в полоску */
.ev-win {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  width: 100%;
  margin: 0 0 10px;
  padding: 5px 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
}

.ev-win-fruit {
  width: 30px;
  height: 30px;
}

.ev-win-add {
  flex: none;
  font-size: 14px;
  font-weight: 900;
}

.ev-win-bar {
  min-width: 50px;
  height: 12px;
}

.ev-win-bar i {
  transition-duration: 0.9s;
}

.ev-win-basket {
  width: 32px;
  height: 32px;
  margin: -4px -2px -4px -2px;
}

.ev-win-ready {
  width: 100%;
  color: #c0651c;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.ev-win.is-ready {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.has-find .ev-win {
  margin-top: 6px;
}

.ev-fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 26px;
  height: 26px;
  pointer-events: none;
}

/* записка новой недели */
.ev-note-gifts {
  flex-wrap: wrap;
  gap: 8px 14px;
}

.ev-note-gifts .pop {
  animation: daily-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.ev-note-gifts .ev-chip-find b {
  font-size: 13px;
}

.ev-note-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 0 14px;
  color: #7a6448;
  font-size: 14px;
  font-weight: 800;
}

.ev-note-new img {
  width: 34px;
  height: 34px;
}

.ev-note-new b {
  color: var(--ink-dark);
  font-weight: 900;
}

@media (max-height: 660px) {
  .ev-fruit {
    width: 56px;
    height: 56px;
  }

  .ev-tiers {
    max-height: calc(100dvh - 300px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-btn.is-ready .event-ring img,
  .ev-tier.just,
  .ev-gifts .pop,
  .ev-note-gifts .pop {
    animation: none;
  }

  .ev-bar i,
  .ev-win-bar i {
    transition: none;
  }
}

/* ---------- Поле: трава (вторая глава, ур. 291+) — голая земля и засеянная клетка под фишками ---------- */
.layer-soil {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tile-soil,
.tile-grass {
  background-size: 100% 100%;
}

/* всходы: трава поднимается от земли волной (задержка клетки — в animation-delay).
   Растёт сама картинка, а не плитка: scale плитки сдвинул бы и её translate */
.tile-grass.sprout {
  background-position: 50% 88%;
  animation: g-sprout 0.56s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

@keyframes g-sprout {
  from { background-size: 72% 6%; opacity: 0; }
  30% { opacity: 1; }
  70% { background-size: 100% 108%; }
  to { background-size: 100% 100%; opacity: 1; }
}

.shard-grass { --tile: #4e9a30; --tile-hi: #a2d060; --tile-lo: #2a5e1c; }
.shard-soil { --tile: #6e4a2c; --tile-hi: #8e6a48; --tile-lo: #3e2412; }

@media (prefers-reduced-motion: reduce) {
  .tile-grass.sprout {
    animation: none;
  }
}

/* рука-подсказка (доводка): подпись без «висячего» слова, у бустера — зеркальная рука и подпись строкой в окне */
.coach-tip {
  text-wrap: balance;
}

.coach.is-flip .coach-hand {
  scale: -1 1;
  transform-origin: 50% 50%;   /* кончик пальца встаёт в 81% 8% (так считает showCoach) */
}

.boost-tip {
  position: relative;
  margin: 24px 4px 0;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff6d6;
  box-shadow: inset 0 0 0 2px #f3d98a;
  color: var(--ink-dark);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  animation: find-item 0.35s 0.5s ease-out both;
}

.boost-tip::before {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--ax, 50%);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #fff6d6;
  box-shadow: -2px -2px 0 0 #f3d98a;
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .boost-tip {
    animation: none;
  }
}

/* =====================================================================
   ДОМ: ЛЕВАЯ КОЛОНКА, ЗАДАНИЯ ДНЯ, НАСТРОЙКИ — раздел добавлен вместе с «Заданиями дня»
   ===================================================================== */

/* левая колонка под счётчиками: «Сбор урожая» (с ур. 15), под ним «Задания дня» (с ур. 10); скрытые не занимают место.
   Внизу слева своя стопка — «Находки» над «Заданиями». Справа — язык, звук, настройки. */
.home-rail {
  position: absolute;
  top: calc(max(10px, var(--kit-safe-top)) + 52px);
  left: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
  pointer-events: none;
}

.home-rail > * {
  pointer-events: auto;
}

.home-rail .event-btn {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
}

body.picking .home-rail,
body.festival .home-rail {
  display: none;
}

/* «Задания дня»: тот же круг, что у урожая, кольцо зелёное — сколько из трёх сделано */
.quest-btn .event-ring {
  background: conic-gradient(#6cc23a calc(var(--p, 0) * 1turn), rgba(122, 76, 36, 0.22) 0);
}

.quest-btn .event-ring img {
  width: 40px;
  height: 40px;
}

.quest-btn.is-all .event-ring img {
  opacity: 0.7;
}

@media (max-height: 700px) {
  .home-rail {
    gap: 6px;
  }

  .quest-btn .event-ring img {
    width: 34px;
    height: 34px;
  }
}

/* окно заданий */
.quest-dlg .card {
  width: min(370px, 100%);
  padding-left: 14px;
  padding-right: 14px;
}

.q-hint {
  margin: -4px 0 2px;
  color: #7a6448;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.q-time {
  margin: 2px 0 8px;
}

.q-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  margin: 0 0 7px;
}

.q-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 60px;
  padding: 7px 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
  text-align: left;
}

.q-row.is-ready {
  box-shadow: inset 0 0 0 3px var(--gold), 0 0 12px rgba(255, 196, 40, 0.5);
}

.q-row.is-done {
  background: #f3fbe9;
  box-shadow: inset 0 0 0 2px #cfe8b4;
}

.q-row.just {
  animation: album-just 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.q-ico {
  flex: none;
  width: 44px;
  height: 44px;
}

.q-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.q-name {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.q-sub {
  color: #9a8466;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.q-prog {
  display: flex;
  align-items: center;
  gap: 6px;
}

.q-bar {
  height: 10px;
}

.q-row.is-ready .q-bar i,
.q-row.is-done .q-bar i {
  background: linear-gradient(180deg, #9be060, #5cb82c);
}

.q-count {
  flex: none;
  min-width: 34px;
  color: #7a6448;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.q-end {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}

.q-gift {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
}

.q-gift span {
  display: flex;
  align-items: center;
  gap: 1px;
  color: var(--ink-dark);
  font-size: 13px;
  font-weight: 900;
}

.q-gift img {
  width: 26px;
  height: 26px;
}

.q-gift .pop {
  animation: daily-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.q-row.is-done .q-gift > :not(.pop) {
  opacity: 0.45;
}

.q-claim.btn {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.q-ok {
  flex: none;
}

/* сундук за все три */
.q-chest {
  margin: 0 0 12px;
  background: linear-gradient(180deg, #fffaf0, #fff1d2);
}

.q-chest-img {
  flex: none;
  width: 52px;
  height: 52px;
  margin: -6px -2px -6px -4px;
}

.q-chest-gifts {
  justify-content: flex-start;
}

.q-chest .q-count {
  min-width: 0;
  font-size: 14px;
}

@media (max-height: 640px) {
  .q-hint {
    display: none;
  }

  .q-row {
    min-height: 54px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .q-ico {
    width: 38px;
    height: 38px;
  }
}

/* шестерёнка */
.set-btn .ico {
  width: 24px;
  height: 24px;
}

/* окно настроек */
.set-dlg .card {
  width: min(340px, 100%);
}

.set-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0 0 14px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 6px 10px 6px 8px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
  color: var(--ink-dark);
  font: inherit;
  text-align: left;
}

.set-row > b {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 900;
}

.set-lang > b {
  padding-left: 4px;
}

.set-switch:active {
  transform: translateY(2px);
}

.set-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f6ecd6;
  color: var(--wood-dark);
}

.set-ico .ico {
  width: 20px;
  height: 20px;
}

.set-switch[aria-checked="false"] .set-ico {
  color: #b09a7a;
}

.set-knob {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: #dccdae;
  box-shadow: inset 0 2px 0 rgba(122, 76, 36, 0.22);
  transition: background 0.2s;
}

.set-knob i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(122, 76, 36, 0.35);
  transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.set-switch[aria-checked="true"] .set-knob {
  background: linear-gradient(180deg, #8fdc4e, #4ca822);
}

.set-switch[aria-checked="true"] .set-knob i {
  transform: translateX(22px);
}

.set-langs {
  flex: none;
  display: flex;
  gap: 6px;
}

.set-langs button {
  min-width: 44px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: #efe3c8;
  box-shadow: 0 3px 0 #d5c19a;
  color: var(--ink-dark);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}

.set-langs button[aria-checked="true"] {
  background: linear-gradient(180deg, #8fdc4e, #4ca822);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 3px 0 #2f7a16;
  color: #fff;
  text-shadow: 0 1px 0 rgba(30, 90, 10, 0.5);
}

.set-langs button:active {
  transform: translateY(2px);
}

.set-tips.btn {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin-top: 2px;
  font-size: 15px;
}

.set-about {
  margin: 2px 0 0;
  color: #9a8466;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .q-row.just,
  .q-gift .pop {
    animation: none;
  }

  .set-knob,
  .set-knob i {
    transition: none;
  }
}

/* ---------- Кормушки (глава 3): клетка с кормушкой, счётчик, зёрна и синички ----------
   Клетка стоит через transform: translate, поэтому всё движение — у вложенных <b>. */
.layer-feed {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tile-feed {
  background: none;
}

.tile-feed b {
  position: absolute;
  display: block;
  background: center / contain no-repeat;
}

.tile-feed .fd-body {
  inset: -5%;
  transform-origin: 50% 90%;
}

/* фрукт кормушки на тёмной задней стенке — цвет читается и без различения цветов */
.tile-feed .fd-fruit {
  left: 32%;
  top: 38%;
  width: 38%;
  height: 38%;
  filter: drop-shadow(0 1px 1px rgba(40, 20, 0, 0.45));
}

.tile-feed .fd-num {
  right: -4%;
  bottom: -4%;
  min-width: 42%;
  height: 40%;
  padding: 0 4%;
  box-sizing: border-box;
  border: 2px solid #8a5a2a;
  border-radius: 999px;
  background: #fffaf0;
  color: #5a3a1a;
  font-size: calc(var(--cell, 44px) * 0.27);
  font-weight: 900;
  line-height: calc(var(--cell, 44px) * 0.4 - 4px);
  text-align: center;
  box-shadow: 0 1px 3px rgba(60, 30, 0, 0.35);
}

.tile-feed .fd-num.tick {
  animation: g-fd-tick 0.32s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.tile-feed .fd-body.peck {
  animation: g-fd-peck 0.28s ease-out;
}

.tile-feed.pop .fd-body {
  animation: g-fd-pop 0.5s ease-in forwards;
}

.tile-feed.pop .fd-fruit,
.tile-feed.pop .fd-num {
  animation: g-fd-fade 0.25s ease-in forwards;
}

@keyframes g-fd-tick {
  0% { scale: 1; }
  45% { scale: 1.35; }
  100% { scale: 1; }
}

@keyframes g-fd-peck {
  0% { translate: 0 0; }
  40% { translate: 0 4%; scale: 1.04 0.95; }
  100% { translate: 0 0; scale: 1; }
}

@keyframes g-fd-pop {
  0% { scale: 1; opacity: 1; }
  30% { scale: 1.15 0.9; opacity: 1; }
  55% { scale: 0.95 1.12; translate: 0 -8%; opacity: 1; }
  100% { scale: 0.4; translate: 0 -20%; opacity: 0; }
}

@keyframes g-fd-fade {
  to { opacity: 0; scale: 0.5; }
}

/* зерно-фрукт, летящее в кормушку, и синички (WAAPI двигает сам элемент в слое эффектов) */
.fd-seed,
.fd-bird {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  background: center / contain no-repeat;
}

.fd-bird b {
  position: absolute;
  inset: 0;
  display: block;
  background: center / contain no-repeat;
  animation: g-fd-flap 0.18s steps(1) infinite;
}

.fd-bird b + b {
  animation-delay: -0.09s;
}

.fd-bird.is-left b {
  scale: -1 1;
}

@keyframes g-fd-flap {
  0% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tile-feed .fd-num.tick,
  .tile-feed .fd-body.peck,
  .tile-feed.pop .fd-body,
  .tile-feed.pop .fd-fruit,
  .tile-feed.pop .fd-num,
  .fd-bird b {
    animation: none;
  }

  .fd-bird b + b {
    opacity: 0;
  }
}

/* =====================================================================
   УГОЛОК ПЕРСИКА — кнопка в левой колонке и окно «Персик» (app.js, раздел «УГОЛОК ПЕРСИКА»)
   ===================================================================== */

/* кнопка: мордочка котёнка в розовом кольце, под «Заданиями дня» */
.pet-btn .event-ring {
  background: conic-gradient(#ff8fb1 0 1turn);
}

.pet-btn .event-ring img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

@media (max-height: 700px) {
  .pet-btn .event-ring img {
    width: 40px;
    height: 40px;
  }
}

/* окно */
.pet-dlg .card {
  width: min(370px, 100%);
  padding-left: 14px;
  padding-right: 14px;
}

.pc-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.pc-stage {
  position: relative;
  width: 100%;
  height: 148px;
  overflow: hidden;
  border-radius: 20px;
  background: radial-gradient(120% 90% at 50% 100%, #d8efbd, #bfe199 55%, #a9d47f);
  box-shadow: inset 0 0 0 2px #fff, inset 0 -8px 0 rgba(80, 130, 40, 0.16);
}

.pc-cat {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 158px;
  height: 158px;
  transform: translateX(-50%);
}

.pc-item {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 62px;
  height: 62px;
}

.pc-try {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border-radius: 9px;
  background: #fff3c4;
  color: #a0631a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pc-coins {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 9px 0 1px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-dark);
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pc-coins img {
  width: 24px;
  height: 24px;
}

.pc-coins.shake {
  color: #d0402c;
  animation: pc-shake 0.42s ease-in-out;
}

@keyframes pc-shake {
  20% { translate: -5px 0; }
  40% { translate: 5px 0; }
  60% { translate: -3px 0; }
  80% { translate: 3px 0; }
}

/* «Погладить»: розовая таблетка под картинкой */
.pc-pat {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 34px;
  margin-top: -2px;
  padding: 0 4px 0 12px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(180deg, #ff9fc0, #f2668f);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #c2456c;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(150, 30, 70, 0.45);
  animation: pc-beat 1.8s ease-in-out infinite;
}

.pc-pat > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-pat:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 1px 0 #c2456c;
}

.pc-pat:disabled {
  animation: none;
  opacity: 0.8;
}

@keyframes pc-beat {
  0%, 70%, 100% { scale: 1; }
  80% { scale: 1.07; }
  90% { scale: 0.98; }
}

.pc-pat-gift {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 7px 0 1px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-dark);
  font-style: normal;
  text-shadow: none;
}

.pc-pat-gift img {
  width: 22px;
  height: 22px;
}

.pc-pat-gift b {
  font-size: 13px;
  font-weight: 900;
}

.pc-pat-done {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: -2px 0 0;
  color: #b0476e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

/* сердечки от «Погладить» */
.pc-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pc-hearts i {
  position: absolute;
  bottom: 38%;
  font-style: normal;
  animation: pc-heart 1.1s ease-out both;
}

.pc-hearts i::before {
  content: '\2665';
  color: #f2557a;
  font-size: 24px;
  text-shadow: 0 2px 0 #fff;
}

.pc-hearts i:nth-child(even)::before {
  color: #ff86a8;
  font-size: 18px;
}

@keyframes pc-heart {
  0% { translate: 0 10px; scale: 0.3; opacity: 0; }
  25% { scale: 1.15; opacity: 1; }
  100% { translate: 0 -70px; scale: 0.9; opacity: 0; }
}

/* вкладки */
.pc-tabs {
  display: flex;
  width: 100%;
  padding: 3px;
  border-radius: 14px;
  background: #efe2c6;
}

.pc-tabs button {
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #8a6a4a;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--ink-dark);
  box-shadow: 0 2px 0 rgba(122, 76, 36, 0.25);
}

.pc-hint {
  margin: -2px 0 -2px;
  color: #7a6448;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}

/* клетки нарядов и вещей */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.pc-grid-item {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pc-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 4px 3px 5px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #efe4cc;
  color: var(--ink-dark);
  font: inherit;
}

.pc-cell:active {
  transform: translateY(2px);
}

.pc-cell img {
  width: 46px;
  height: 46px;
}

.pc-grid-item .pc-cell img {
  width: 58px;
  height: 58px;
}

.pc-cell b {
  display: -webkit-box;
  width: 100%;
  min-height: 2.3em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
  hyphens: auto;
}

.pc-cell small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  max-width: 100%;
  height: 16px;
  margin-top: 2px;
  overflow: hidden;
  color: #7a6448;
  font-size: 10.5px;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pc-cell small.pc-price img {
  width: 16px;
  height: 16px;
}

.pc-cell small.pc-price i {
  color: #a0631a;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.pc-cell.is-sel {
  background: #f3fbe8;
  box-shadow: inset 0 0 0 3px #4ca822;
}

.pc-cell.is-on small {
  color: #3f8f1c;
}

.pc-cell.is-on::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4ca822 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.5L12 5.4' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

/* кнопка выбранного — в ряду кнопок окна рядом с «Закрыть» */
.pet-dlg .over-actions {
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 14px;
}

.pet-dlg .over-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 10px;
  font-size: 16px;
}

.pet-dlg .over-actions .btn > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-dlg .pc-act {
  white-space: nowrap;
}

/* «Закрыть» — по своей подписи, всё остальное место — кнопке действия (подпись и цена не обрезаются) */
.pet-dlg .over-actions .btn:not(.pc-act) {
  flex: 0 0 auto;
  padding: 0 14px;
}

.pet-dlg .over-actions .pc-buy {
  gap: 6px;
  padding: 0 8px;
}

.pc-buy b {
  flex: none;
  font-weight: 900;
}

.pc-buy img {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0 -3px 0 0;
}

.pet-dlg .over-actions .pc-buy > span {
  flex: none;
  overflow: visible;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pc-buy.is-short {
  filter: saturate(0.55);
}

@media (max-height: 700px) {
  .pc-stage {
    height: 124px;
  }

  .pc-cat {
    width: 136px;
    height: 136px;
  }

  .pc-item {
    width: 52px;
    height: 52px;
  }

  .pc-cell img {
    width: 40px;
    height: 40px;
  }

  .pc-grid-item .pc-cell img {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pc-pat,
  .pc-coins.shake {
    animation: none;
  }
}

/* ---------- Шишки (глава 4) ----------
   Клетку .piece двигает только translate; всё покачивание — на внутреннем .cn-body.
   Корзинки-выходы висят под нижней клеткой столбцов-выходов (слой .layer-exit). */
.piece.sp-cone {
  background: none;
}

.piece.sp-cone .cn-body {
  position: absolute;
  inset: 0;
  background: center / 100% 100% no-repeat;
  transform-origin: 50% 85%;
}

.piece.sp-cone.pop,
.piece.sp-cone.blow,
.piece.sp-cone.zap,
.piece.sp-cone.born,
.piece.sp-cone.land,
.piece.sp-cone.hint {
  animation: none;
}

.piece.sp-cone.born .cn-body {
  animation: g-born 0.38s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.piece.sp-cone.land .cn-body {
  animation: cn-land 0.3s ease-out;
}

.piece.sp-cone.hint .cn-body {
  animation: g-hint 1.1s ease-in-out infinite;
}

.piece.sp-cone.cn-out .cn-body {
  animation: cn-out 0.4s ease-in forwards;
}

@keyframes cn-land {
  0% { rotate: 0deg; }
  35% { rotate: -7deg; scale: 1.04 0.95; }
  70% { rotate: 4deg; }
  100% { rotate: 0deg; scale: 1; }
}

@keyframes cn-out {
  0% { translate: 0 0; scale: 1; opacity: 1; }
  100% { translate: 0 60%; scale: 0.45; opacity: 0; }
}

.layer-exit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cone-exit {
  position: absolute;
  width: var(--cell, 44px);
  height: calc(var(--cell, 44px) * 0.6);
}

.cone-exit b {
  position: absolute;
  inset: 0 -2%;
  filter: drop-shadow(0 2px 2px rgba(40, 25, 5, 0.35));
  background: center / 100% 100% no-repeat;
  transform-origin: 50% 0;
}

.cone-exit.got b {
  animation: cn-basket 0.42s ease-out;
}

@keyframes cn-basket {
  30% { scale: 1.12 0.9; }
  65% { scale: 0.96 1.05; }
  100% { scale: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .piece.sp-cone .cn-body,
  .cone-exit b {
    animation: none !important;
  }

  .piece.sp-cone.cn-out .cn-body {
    opacity: 0;
  }
}
