/* Лавка алхимика — вёрстка.

   Один стиль на всю игру: тёмное дерево, медь и золото, прямые углы, двойные
   рамки — как обивка сундука. Скруглений нет нигде: они спорят с пиксельным
   артом.

   Про шрифт. Пиксельных гарнитур с кириллицей на Google Fonts всего три —
   Pixelify Sans, Handjet и Tiny5; у остальных (Silkscreen, Jersey, VT323,
   Micro 5, Doto) кириллицы нет вовсе, браузер молча подставляет системную.
   Стоит Tiny5: у Pixelify Sans двойка, пятёрка и восьмёрка почти неразличимы,
   а цена и остаток сырья — то, что читают чаще всего.

   Пиксельный шрифт отдан крупному — вывеска, заголовки, кнопки, казна, — а
   описания набраны обычным гротеском: в мелком кегле любой пиксельный
   разваливается. Жирного начертания у Tiny5 нет, поэтому вес не задираем:
   синтетический bold замазывает пиксельную сетку.

   Спрайты 16-32px, поэтому image-rendering: pixelated обязателен — иначе
   браузер размажет их билинейным фильтром. */

:root {
  --bg: #1c1614;
  --panel: #2b211c;
  --panel2: #3a2c24;
  --wood: #6b4f28;
  --wood-lt: #a8834a;
  --wood-dk: #3a2810;
  --line: #4a382c;
  --ink: #f2e4c8;
  --sub: #b09876;
  --gold: #e8b52c;
  --green: #6fbf5a;
  --red: #c0554a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: #120e0c;
  color: var(--ink);
  font: 15px/1.35 "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  overscroll-behavior: none;
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh;
}

/* Телефонная колонка: на десктопе игра не растягивается во весь экран. */
#app {
  position: relative; overflow: hidden;
  width: min(100vw, 420px);
  height: 100dvh; max-height: 940px;
  background: var(--bg);
  box-shadow: 0 0 0 3px #4a382c, 0 0 40px rgba(0, 0, 0, .7);
}

.px { image-rendering: pixelated; width: 32px; height: 32px; display: block; }
.px.in { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; }
.px.big { width: 56px; height: 56px; }

/* ══ общие детали ═════════════════════════════════════════════════════════
   Панель = доска: тёмный контур снаружи, светлая фаска изнутри. */
h2 {
  margin: 16px 0 8px; font-size: 15px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 8px;
}
h2::before, h2::after { content: ""; height: 2px; background: var(--wood); flex: 1; }
/* Подзаголовок внутри h2 набираем обычным: пиксельный в мелком не читается. */
h2 .sub {
  text-transform: none; letter-spacing: 0; color: var(--sub); flex: none;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
.sub { color: var(--sub); font-size: 13px; }

.card {
  background: var(--panel); border: 3px solid var(--wood);
  box-shadow: inset 0 0 0 1px #17110f;
  padding: 12px; margin-bottom: 10px;
}
.card.empty, .empty {
  color: var(--sub); font-size: 13.5px; text-align: center;
  padding: 14px; background: #241c18;
  border: 3px dashed var(--line); margin-bottom: 10px;
}
.note { font-size: 13.5px; }

button {
  font: inherit; color: var(--ink); cursor: pointer;
  background: linear-gradient(var(--panel2), #2b201a);
  border: 3px solid var(--wood); border-radius: 0;
  box-shadow: inset 0 2px 0 #57433a, inset 0 -2px 0 #1d1512;
  padding: 9px 12px; min-height: 44px;
}
button:disabled { opacity: .4; box-shadow: none; }
button:active:not(:disabled) { box-shadow: inset 0 2px 0 #1d1512; transform: translateY(1px); }
button.big {
  flex: 1;
  background: linear-gradient(var(--wood-lt), var(--wood));
  border-color: var(--wood-dk); color: #2b1c08;
  font-weight: 700; font-size: 17px;
  box-shadow: inset 0 2px 0 #c9a366, inset 0 -3px 0 #4a3618;
}
button.flat { background: none; color: var(--sub); border-color: var(--line); box-shadow: none; }
.row { display: flex; gap: 8px; width: 100%; }

/* ══ комната ══════════════════════════════════════════════════════════════ */
#room {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  padding: calc(6px + env(safe-area-inset-top)) 8px calc(62px + env(safe-area-inset-bottom)) 8px;
  background: #33261f;
}
#room[hidden], #view[hidden] { display: none; }

.topbar { display: flex; gap: 8px; align-items: stretch; }
.corner {
  width: 50px; flex: none; padding: 4px;
  display: grid; place-items: center;
  background: linear-gradient(#3f2f26, #2b201a);
}
.corner .px { width: 34px; height: 34px; }

/* Вывеска — доска над прилавком, она же вход в улучшения. */
.sign {
  flex: 1; min-width: 0; padding: 5px 8px;
  display: grid; place-items: center;
  background: linear-gradient(#9c7742, var(--wood));
  border-color: var(--wood-dk);
  box-shadow: inset 0 2px 0 #c9a366, inset 0 -3px 0 #4a3618;
}
.signname {
  font-size: 20px; font-weight: 700; color: #2b1c08;
  text-shadow: 0 1px 0 #c9a366; letter-spacing: .5px;
}
.signsub { font-size: 12px; color: #4a3618; }

.hud { display: flex; align-items: center; gap: 7px; margin: 7px 4px 8px; }
.hud .cur {
  display: flex; align-items: center; gap: 4px; flex: none;
  font-weight: 700; font-size: 16px; letter-spacing: 0;
}
.hud .bar { flex: 1; }
.bar {
  height: 17px; position: relative; overflow: hidden;
  background: #17110f; border: 2px solid var(--wood-dk);
}
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#8fe06a, #4a9c3a); }
.bar span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; color: #f2e4c8; text-shadow: 0 1px 0 #000;
}
.bar.small { height: 15px; margin-top: 5px; }

/* ── стена: плашки и окно ─────────────────────────────────────────────── */
.scene { display: flex; gap: 8px; height: 34%; min-height: 180px; }
.plates { display: flex; flex-direction: column; gap: 8px; width: 52px; flex: none; }
.plate {
  flex: 1; position: relative; padding: 2px;
  display: grid; place-items: center;
  background: linear-gradient(#3f2f26, #2b201a);
  border: 3px solid var(--wood);
}
.plate .px { width: 30px; height: 30px; }
.buffplate { opacity: .3; filter: grayscale(1); }
.buffplate.on { opacity: 1; filter: none; border-color: var(--green); }

/* Окно: рама из бруса, за стеклом улица. Переплёта нет — он резал вид. */
.window {
  flex: 1; min-width: 0; padding: 5px;
  background: linear-gradient(#7a5a30, #4a3618);
  border: 4px solid #2f2110;
  box-shadow: inset 0 0 0 2px #a8834a;
}
/* Небо ступенями, а не одной заливкой: у горизонта оно всегда светлее.
   Дальше трава, бордюр и мостовая — по ней и ходят прохожие. */
.glass {
  position: relative; height: 100%; overflow: hidden;
  /* Мостовая — сетка из двух гребёнок: ряды поперёк и швы вдоль. Одними
     вертикальными полосами дорога читалась как забор, положенный плашмя. */
  background:
    repeating-linear-gradient(0deg,
      rgba(0, 0, 0, .18) 0 1px, rgba(0, 0, 0, 0) 1px 9px) 0 100%/100% 40% no-repeat,
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, .14) 0 1px, rgba(0, 0, 0, 0) 1px 13px) 0 100%/100% 40% no-repeat,
    linear-gradient(#5aa6df 0 16%, #86c8e8 16% 34%, #b6e0ee 34% 42%,
                    #6fb85a 42% 50%, #5da84c 50% 58%,
                    #7a6a52 58% 60.5%, #6b6157 60.5% 100%);
}
.scen { position: absolute; }
/* Домики стоят ровно на линии горизонта — лентой во всю ширину окна. */
.town  { left: 0; width: 100%; bottom: 58%; }
.cloud1 { left: 6%;  top: 7%;  width: 34px; height: 17px; animation: drift 95s linear infinite; }
.cloud2 { left: 52%; top: 19%; width: 26px; height: 13px; animation: drift 150s linear infinite; }
@keyframes drift { from { transform: translateX(-160%); } to { transform: translateX(420%); } }

.tree1 { left: 2%;   bottom: 44%; width: 46px; height: 46px; }
.tree2 { right: 4%;  bottom: 46%; width: 38px; height: 38px; }
.bush1 { left: 28%;  bottom: 42%; width: 22px; height: 22px; }
.bush2 { right: 24%; bottom: 41%; width: 18px; height: 18px; }
.bush3 { left: 56%;  bottom: 43%; width: 20px; height: 20px; }

.walker {
  position: absolute; bottom: 9%; left: -20%;
  width: 28px; height: 28px;
  animation: walk 7s linear forwards;
}
.walker.high { bottom: 58%; }
@keyframes walk { to { left: 115%; } }
@keyframes walkBack { from { left: 115%; } to { left: -20%; } }

/* ── комната: стена, пол, котёл, окошки и антураж ──────────────────────────
   Раньше это была одна плашка вертикальных досок сверху донизу — она читалась
   как стена, и котёл висел в ней без опоры. Теперь верхняя половина стена,
   нижняя пол, между ними плинтус, и предметам есть на чём стоять. */
.floor {
  flex: 1; position: relative; margin-top: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 10px 0;
  background: #2a1d14;
  border-top: 4px solid #4a3624;
  overflow: hidden;
}
/* Порядок слоёв задаём явно. Без него окошки под котлом уходили под доски
   пола: у картинки котла есть filter, и она поднималась над ними сама, а
   окошки — нет, и пропадали. */
.wall, .boards, .hearth { position: absolute; pointer-events: none; z-index: 0; }
.deco, .kettle, .slots, .fxlayer { position: relative; z-index: 1; }

/* Стена — доски стоймя, к потолку темнее: свет в лавке идёт снизу, от очага. */
.wall {
  inset: 0 0 70% 0;
  background:
    linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .05) 75%),
    repeating-linear-gradient(90deg, #33251a 0 26px, #2c2016 26px 28px);
}
/* Плинтус: без этой полосы стена и пол сливались в одно коричневое пятно. */
.wall::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(#8a6636 0 3px, #6b4f2c 3px, #3f2c18);
  box-shadow: 0 4px 6px rgba(0, 0, 0, .5);
}
/* Пол — доски поперёк, и чем ближе к зрителю, тем шире и светлее. Настоящей
   перспективы тут нет, но комната сразу перестаёт быть плоской. */
.boards {
  inset: 30% 0 0 0;
  /* Поперёк досок ещё и стыки вдоль: без них ряды читались как полки, а не
     как половицы. Шаг крупный — мельче он рябит на пиксельной сетке. */
  background:
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, .18) 0 2px, rgba(0, 0, 0, 0) 2px 98px),
    linear-gradient(
    #4a3421 0 5.5%,    #23170f 5.5% 6.6%,
    #523a25 6.6% 15%,  #23170f 15% 16.2%,
    #5a4029 16.2% 27%, #23170f 27% 28.4%,
    #62462d 28.4% 42%, #23170f 42% 43.6%,
    #6a4c31 43.6% 60%, #23170f 60% 61.8%,
    #735236 61.8% 100%);
}
/* Свет от очага: тёплое пятно на полу, которое чуть дышит. Анимация живёт в
   CSS, поэтому её не срывает обновление цифр в комнате. */
.hearth {
  left: 50%; top: 30%; width: 320px; height: 300px;
  transform: translate(-50%, -6%);
  background: radial-gradient(50% 50% at 50% 52%,
    rgba(255, 184, 88, .42) 0, rgba(255, 138, 40, .18) 44%, rgba(255, 120, 30, 0) 72%);
  animation: hearth 3.4s ease-in-out infinite alternate;
}
@keyframes hearth { from { opacity: .7; } to { opacity: 1; } }

/* Тень под каждым предметом: без неё утварь висела в воздухе. */
.deco { position: absolute; pointer-events: none;
        filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .5)); }
/* На стене. Паутина без тени — она и так еле видна. */
.web1   { left: -2px;  top: -2px;   width: 26px; height: 26px; opacity: .45; filter: none; }
.web2   { right: -2px; top: -2px;   width: 22px; height: 22px; opacity: .4;
          transform: scaleX(-1); filter: none; }
.rack   { left: 5px;   top: 22px;   width: 58px; height: 58px; }
.shelf  { right: 7px;  top: 28px;   width: 60px; height: 30px; }
.herbL  { left: 34%;   top: 2px;    width: 36px; height: 36px; }
.herbR  { right: 31%;  top: 6px;    width: 30px; height: 30px; transform: scaleX(-1); }
.portrait { left: 30px; top: 84px;  width: 36px; height: 42px; }
/* На полу */
.mortar { left: 14px;  top: 38%;    width: 38px; height: 38px; }
.candle { right: 16px; top: 39%;    width: 32px; height: 32px; }
.sack   { left: 10px;  bottom: 12px; width: 44px; height: 44px; }
.barrel { right: 12px; bottom: 12px; width: 44px; height: 44px; }

.kettle { background: none; border: none; box-shadow: none; padding: 0; min-height: 0; }
.kettle .px { width: 164px; height: 164px;
              filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .3)); }
.kettle:active .px { transform: translateY(2px); }

.slots { display: flex; gap: 8px; }
.slots .slot {
  width: 48px; height: 48px; font-size: 20px; color: #7a6550;
  background: #17110f; border: 3px solid #5a4430;
  box-shadow: inset 0 0 0 1px #241c18;
  display: grid; place-items: center; padding: 0; min-height: 0;
}
.slots .slot.full { border-color: var(--gold); background: #241c18; }
.slots .slot .px { width: 30px; height: 30px; }

/* ══ вкладки-списки ═══════════════════════════════════════════════════════ */
#view {
  position: absolute; inset: 0 0 58px 0; z-index: 1;
  overflow-y: auto; padding: 12px;
}

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile {
  display: grid; justify-items: center; gap: 2px; position: relative;
  padding: 8px 4px; background: var(--panel);
  border: 3px solid var(--wood); box-shadow: inset 0 0 0 1px #17110f;
  min-height: 0;
}
.tile.used { opacity: .35; }
.tile b { position: absolute; top: 1px; right: 4px; font-size: 13px; color: var(--gold); }
.tile span { font-size: 11px; line-height: 1.15; color: var(--sub); text-align: center; }

.otop, .dealtop { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.otop .px, .dealtop .px { flex: none; }
.pay { font-size: 14px; color: var(--gold); margin-bottom: 8px; }
.buff { font-size: 13px; color: var(--green); }
.near { font-size: 13px; color: var(--gold); }
.unknown {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  background: #17110f; border: 2px solid var(--wood);
  color: var(--sub); font-weight: 700;
}
.rec { padding: 10px 12px; }
.rec.locked { opacity: .85; }
.deal { border-color: var(--gold); }

.picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.picker.one { grid-template-columns: 1fr; gap: 0; }
.loc { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; min-height: 0; }
.loc span { font-size: 11px; line-height: 1.15; text-align: center; color: var(--sub); }
.dur {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; margin-top: 6px; white-space: nowrap;
}
.dur span { color: var(--sub); font-size: 13px; }

.list { display: grid; gap: 6px; }
.line {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 3px solid var(--wood);
  box-shadow: inset 0 0 0 1px #17110f; padding: 8px 10px;
}
.line .ln { flex: 1; min-width: 0; }
.line b { font-weight: 700; font-size: 15px; }
.line button { padding: 7px 10px; font-size: 14px; min-height: 40px; }

.up button.big { width: 100%; margin-top: 8px; }
.up .unknown { font-size: 16px; color: var(--gold); }
.ach.got { opacity: .6; }
.ach button.big { width: 100%; margin-top: 8px; }

/* ══ нижняя панель ════════════════════════════════════════════════════════ */
#nav {
  /* Панель всегда поверх затемнения: из открытой шторки можно уйти на другую
     вкладку одним тапом, а не двумя. */
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 12;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(#9c7742, var(--wood));
  border-top: 4px solid var(--wood-dk);
  box-shadow: inset 0 2px 0 #c9a366;
  padding-bottom: env(safe-area-inset-bottom);
}
#nav button {
  position: relative; background: none; border: none; box-shadow: none;
  padding: 8px 2px; display: grid; place-items: center; min-height: 0;
}
#nav button .px { width: 30px; height: 30px; }
#nav button.on {
  background: linear-gradient(#c9a366, #a8834a);
  box-shadow: inset 0 3px 0 #ffe066;
}
.dot {
  position: absolute; top: 2px; right: 50%; margin-right: -20px;
  min-width: 17px; height: 17px; padding: 0 2px;
  background: var(--red); color: #fff; border: 2px solid #6b1f18;
  font-size: 11px; font-style: normal; line-height: 12px; text-align: center;
}
.plate .dot { top: 3px; right: 3px; margin: 0; }

/* ══ шторка снизу ═════════════════════════════════════════════════════════ */
#shade { position: absolute; inset: 0; z-index: 8; background: rgba(0, 0, 0, .6); }
#sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  max-height: 78%; overflow-y: auto;
  background: var(--bg);
  border-top: 4px solid var(--wood);
  box-shadow: inset 0 3px 0 #a8834a;
  /* Панель навигации лежит поверх шторки, поэтому нижний ряд карточек надо
     увести из-под неё — иначе последняя строка обрезается. */
  padding: 12px 12px calc(70px + env(safe-area-inset-bottom));
}
.sheettop {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 3px solid var(--wood);
}
.sheettop > div { flex: 1; }
.sheettop b { font-size: 18px; color: var(--gold); }
.x {
  padding: 4px 12px; min-height: 0; background: none;
  border: none; box-shadow: none; color: var(--sub); font-size: 18px;
}

/* ══ тост ═════════════════════════════════════════════════════════════════ */
.toast {
  position: absolute; left: 12px; right: 12px; bottom: 72px; z-index: 10;
  padding: 12px 14px;
  background: var(--panel2); border: 3px solid var(--wood);
  box-shadow: inset 0 0 0 1px #17110f;
  font-size: 15px; text-align: center;
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: .18s;
}
.toast.show { transform: none; opacity: 1; }
.toast.good { border-color: var(--green); }
.toast.bad { border-color: var(--red); }


/* ── пиксельный шрифт: только крупное ────────────────────────────────────── */
/* Пиксельным набираем только слова — вывеску и заголовки. Числа (казна,
   цены, счётчики) остаются обычным гротеском: в Tiny5 восьмёрка нарисована
   перекрестием, и «18405» читается как «1✳405», а цену читают чаще всего. */
.signname, h2, .sheettop b {
  font-family: "Tiny5", "Trebuchet MS", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: .5px;
}
.signname { font-size: 23px; }
h2 { font-size: 16px; }
.sheettop b { font-size: 20px; }
button.big { font-size: 17px; font-weight: bold; }
.hud .cur { font-size: 17px; }


/* ══ обучение ═════════════════════════════════════════════════════════════ */
/* Сам контейнер прозрачен для кликов — иначе он накрывал бы и вырез.
   Ловят только четыре затемняющих прямоугольника. */
#tutmask { position: absolute; inset: 0; z-index: 13; pointer-events: none; }
#tutmask[hidden] { display: none; }
#tutmask i { position: absolute; background: rgba(0, 0, 0, .68); pointer-events: auto; }

#tutbar {
  position: absolute; left: 8px; right: 8px; bottom: 66px; z-index: 14;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; font-size: 14.5px; line-height: 1.3;
  background: linear-gradient(#3f2f26, #2b201a);
  border: 3px solid var(--gold);
  box-shadow: inset 0 0 0 1px #17110f, 0 4px 0 rgba(0, 0, 0, .4);
}
#tutbar[hidden] { display: none; }
/* Сама полоса нажатия пропускает: где бы она ни встала, под ней остаётся
   живая игра. Ловят нажатия только её кнопки. */
#tutbar { pointer-events: none; }
#tutbar .big, #tutbar .tutx { pointer-events: auto; }
#tutbar span { flex: 1; }
#tutbar .big { flex: none; min-height: 38px; padding: 6px 12px; font-size: 15px; }
/* Крестик: полоса стоит поверх комнаты, и на шагах без явной цели её нечем
   было убрать — она ложилась на окошки под котлом. */
#tutbar .tutx {
  flex: none; align-self: flex-start;
  width: 28px; height: 28px; min-height: 0; padding: 0;
  font-size: 20px; line-height: 1; color: var(--sub);
  background: none; border: none; box-shadow: none;
}
#tutbar .tutx:active { color: var(--gold); }

/* Подсветка цели: рамка и мигающее свечение, клики не блокируем. */
.tutfocus {
  outline: 3px solid var(--gold); outline-offset: 1px;
  animation: tutpulse 1.1s ease-in-out infinite;
}
@keyframes tutpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 181, 44, .7); }
  50%      { box-shadow: 0 0 0 7px rgba(232, 181, 44, 0); }
}


/* ══ эффекты варки ════════════════════════════════════════════════════════
   Всё летит из одной точки — из зева котла, — поэтому частицы позиционируются
   от центра слоя, а слой лежит поверх пола и не ловит нажатия. */
.fxlayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.fxlayer i, .fxlayer img { position: absolute; }

.fxbub {
  left: 50%; top: 46%;
  image-rendering: pixelated;
  animation: fxUp 1.2s ease-out forwards;
}
@keyframes fxUp {
  0%   { transform: translate(-50%, 0) scale(1); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), -110px) scale(.4); opacity: 0; }
}

.fxspark {
  left: 50%; top: 46%; width: 6px; height: 6px;
  background: #ffe066; box-shadow: 0 0 6px #ffb43c;
  animation: fxFly 1s ease-out forwards;
}
@keyframes fxFly {
  0%   { transform: translate(-50%, -50%) scale(1.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity: 0; }
}

.fxflask {
  left: 50%; top: 42%; width: 40px; height: 40px;
  animation: fxRise 1.3s cubic-bezier(.2, .9, .3, 1) forwards;
}
.fxflask.big { width: 64px; height: 64px; }
@keyframes fxRise {
  0%   { transform: translate(-50%, 10px) scale(.4); opacity: 0; }
  25%  { opacity: 1; }
  70%  { transform: translate(-50%, -74px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -96px) scale(1); opacity: 0; }
}

.fxsmoke {
  left: 50%; top: 44%; width: 17px; height: 17px;
  background: #17130f;
  animation: fxSmoke 1.3s ease-out forwards;
}
@keyframes fxSmoke {
  0%   { transform: translate(-50%, 0) scale(.5); opacity: .9; }
  100% { transform: translate(calc(-50% + var(--dx)), -96px) scale(2.9); opacity: 0; }
}

.fxflash {
  inset: 0; left: 0; top: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 46%, rgba(255, 244, 190, .95) 0,
              rgba(255, 208, 90, .55) 30%, rgba(255, 200, 60, 0) 88%);
  animation: fxFlash .6s ease-out forwards;
}
@keyframes fxFlash { from { opacity: 1; } to { opacity: 0; } }

.kettle.shake { animation: fxShake .5s ease-in-out; }
@keyframes fxShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1deg); }
  45% { transform: translateX(5px) rotate(1deg); }
  70% { transform: translateX(-3px); }
}


/* Что приносят из места сбора — иконками на кнопке и списком на втором шаге. */
.loc .pool { display: flex; gap: 2px; justify-content: center; }
.loc .pool .px { width: 15px; height: 15px; }
.haul {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin: 6px 0 2px; font-size: 13px; color: var(--sub);
}
.haul span { display: flex; align-items: center; gap: 3px; }
.haul .px { width: 18px; height: 18px; }

/* Строка «обновятся через…» под заголовком заданий дня. */
.dayline { text-align: center; font-size: 13px; color: var(--sub); margin: -2px 0 8px; }
.dayline b { color: var(--gold); }

.quest.got { opacity: .6; }
.quest button.big { width: 100%; margin-top: 8px; }
.quest .haul { color: var(--gold); }


/* ══ имя лавки и витрина обликов ══════════════════════════════════════════ */
.nameinput {
  width: 100%; margin-top: 8px; padding: 9px 10px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #241c18; border: 3px solid var(--wood);
  box-shadow: inset 0 0 0 1px #17110f; border-radius: 0;
  /* 16px и выше — иначе телефон при фокусе сам приближает страницу. */
}
.nameinput:focus { outline: none; border-color: var(--gold); }

.namemsg { margin-top: 6px; font-size: 13px; color: #e08a6a; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.avgrid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 8px 0;
}
.avcard {
  display: grid; justify-items: center; gap: 2px;
  padding: 8px 2px; background: var(--panel);
  border: 3px solid var(--wood); box-shadow: inset 0 0 0 1px #17110f;
}
/* Выбранный облик обведён золотом — так видно, кто ты сейчас. */
.avcard.on { border-color: var(--gold); }
.avcard b { font-size: 11px; line-height: 1.15; text-align: center; color: var(--ink); }
.avcard span { font-size: 11px; color: var(--sub); }
.avcard .avprice { color: var(--gold); white-space: nowrap; }
/* Недоступный облик глушим, но не прячем: цена — это цель, а не запрет. */
.avcard:disabled { opacity: .45; }
