:root {
  /* палитра владельца (референс Refire): тёмная бирюза, ржавчина, яркая и светлая бирюза + дерево стеллажа */
  --bg: #003135;          /* страница вокруг ларька */
  --surface: #024950;
  --text: #e8f6f8;
  --text-2: #afdde5;
  --text-3: #7fb2ba;
  --line: rgba(175, 221, 229, .2);
  --outline: #1f1d1a;     /* контур, как у мультяшного кассира */
  --accent: #0fa4af;
  --accent-soft: rgba(15, 164, 175, .2);
  --rust: #964734;
  /* яркие акценты из ретро-палитр (горчица, коралл, мята): ценники, вывеска, год, выбранные кнопки */
  --mustard: #f2b632;
  --coral: #ff6f61;
  --mint: #7fd1c1;
  --paper: #fbf8f1;
  --ink: #2a2824;
  --ink-2: #6e695f;
  --rule: rgba(42, 40, 36, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ui: "Nunito", system-ui, sans-serif;
  --display: "Unbounded", "Nunito", system-ui, sans-serif;   /* название, год, вывески */
  --mono: "Martian Mono", ui-monospace, Consolas, monospace;   /* ценники и чек */
  --hand: "Pangolin", "Nunito", system-ui, sans-serif;   /* реплики кассира */
}
/* светлые места (сцена, облачко, чек) пишутся тёмными чернилами */
.stage, .bubble, .receipt { --text: var(--ink); --text-2: var(--ink-2); --text-3: #756f66; --line: rgba(35, 33, 29, .14); --accent-soft: rgba(15, 164, 175, .16); color: var(--ink); }

* { box-sizing: border-box; }
html, body { margin: 0; }
/* полосы прокрутки тонкие и в цвет сайта вместо серых системных */
html { scrollbar-color: rgba(175, 221, 229, .3) transparent; }
html, * { scrollbar-width: thin; }
body { background: radial-gradient(90% 60% at 50% -10%, rgba(15, 164, 175, .28), transparent 70%), radial-gradient(60% 50% at 100% 110%, rgba(255, 111, 97, .12), transparent 70%), var(--bg); background-attachment: fixed; color: var(--text); font: 500 15px/1.5 var(--ui); min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: 1200px; margin: 0 auto; padding: 24px 32px 40px; display: grid; gap: 16px; }
#app[hidden] { display: none; }

/* ---------- шапка: название, год, единицы ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { margin: 0; font: 700 30px/1 var(--display); letter-spacing: .01em; color: #fff4dc; }
.brand span { display: block; margin-top: 8px; font: 600 14px/1.3 var(--ui); letter-spacing: 0; color: var(--mint); }
.bar { display: flex; align-items: center; gap: 12px; }
/* звук: значок динамика, перечёркнут, когда выключен; стоит в шапке рядом с названием */
.top { position: relative; }
.sound { width: 44px; height: 44px; margin-left: auto; margin-right: -4px; display: grid; place-items: center; border: 1.5px solid rgba(175, 221, 229, .16); border-radius: 12px;
  background: #023f45; color: var(--text-2); transition: background-color .15s var(--ease), color .15s var(--ease); }
.sound:hover { color: var(--text); background: #035057; }
.sound svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sound .spk { fill: currentColor; }
.sound .mute { display: none; }
.sound[aria-pressed="false"] .wave { display: none; }
.sound[aria-pressed="false"] .mute { display: inline; }
.sound[aria-pressed="false"] { color: var(--text-3); }
/* кнопки как в игре: плотная рамка и «толщина» снизу, при нажатии проседают */
.years, .modes { display: flex; align-items: center; background: #023f45; border: 1.5px solid rgba(175, 221, 229, .16); border-radius: 14px; }
.years button { width: 42px; height: 44px; border: 0; background: none; font-size: 22px; line-height: 1; border-radius: 12px; color: var(--text-2);
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.years button:disabled { opacity: .35; cursor: default; }
.years button:not(:disabled):hover { background: var(--accent-soft); color: var(--text); }
#year { min-width: 76px; text-align: center; font: 700 20px/1 var(--display); color: var(--text); }
.modes { padding: 4px; gap: 4px; }
.modes button { height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-weight: 700;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.modes button:hover { color: var(--text); background: var(--accent-soft); }
.modes button[aria-checked="true"] { background: var(--accent); color: #00262a; }

/* подсказка под сценой */
.hint { margin: 6px 0 0; text-align: center; font-weight: 600; font-size: 14px; color: var(--mint); opacity: .8; }
.stage[hidden] + .hint { display: none; }
.hint .short { display: none; }

/* ---------- сцена: объёмный ларёк (2.5D, как сгенерированный стеллаж) ---------- */
.stage { container-type: inline-size; position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  border: 3px solid var(--outline); background: var(--surface); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.stage[hidden] { display: none; }
/* стена ларька из тёмно-бирюзовых досок */
.scene { position: absolute; inset: 0; background: repeating-linear-gradient(#035761 0 3.4cqw, #02444b 3.4cqw 3.7cqw); }
.scene.art { background: center / 100% 100% no-repeat var(--bg-img); }
/* тень от козырька на стене и деревянный настил внизу */
.scene::before { content: ""; position: absolute; left: 0; right: 0; top: 12%; height: 7%; background: linear-gradient(rgba(0, 18, 20, .5), transparent); }
.scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3.5%; background: #6f3427; border-top: .3cqw solid var(--outline); }

/* козырёк в объёме: ржавая балка с бликом, скат уходит в тень к стене, по сгибу светлая кромка,
   борт с полукруглыми фестонами, у каждого фестона своя тень снизу. Полоса = фестон = --st */
.awning { --st: 5cqw; --cap: 2.2cqw; --fold: 52%; position: absolute; z-index: 2; left: -1%; right: -1%; top: 0; height: 15%; pointer-events: none;
  filter: drop-shadow(0 .3cqw 0 var(--outline)) drop-shadow(.15cqw 0 0 var(--outline)) drop-shadow(-.15cqw 0 0 var(--outline)) drop-shadow(0 .8cqw 1cqw rgba(0, 12, 14, .35)); }
.awning::before { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(#c1654a 0 .45cqw, var(--rust) .45cqw calc(var(--cap) - .5cqw), #6b3024 calc(var(--cap) - .5cqw) var(--cap), var(--outline) var(--cap) calc(var(--cap) + .3cqw), transparent 0),
    linear-gradient(transparent calc(var(--fold) - .3cqw), var(--outline) 0 var(--fold), rgba(255, 255, 255, .45) 0 calc(var(--fold) + .3cqw), transparent 0),
    linear-gradient(rgba(0, 32, 36, .5) var(--cap), rgba(0, 32, 36, .12) var(--fold), transparent 0),
    radial-gradient(circle calc(var(--st) / 2) at 50% 0, transparent 52%, rgba(0, 30, 34, .2)) bottom / var(--st) calc(var(--st) / 2) repeat-x,
    repeating-linear-gradient(90deg, var(--accent) 0 var(--st), #e8f6f8 0 calc(var(--st) * 2));
  /* верхний прямоугольник маски заходит на фестоны на 1 px: иначе на стыке двух слоёв просвечивает серая линия */
  -webkit-mask: radial-gradient(circle calc(var(--st) / 2) at 50% 0, #000 98%, transparent) bottom / var(--st) calc(var(--st) / 2) repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - var(--st) / 2 + 1px) no-repeat;
          mask: radial-gradient(circle calc(var(--st) / 2) at 50% 0, #000 98%, transparent) bottom / var(--st) calc(var(--st) / 2) repeat-x, linear-gradient(#000 0 0) top / 100% calc(100% - var(--st) / 2 + 1px) no-repeat; }

/* окошко кассира: ниша с деревянными откосами, как боковины стеллажа (верх темнее, бока светлее).
   Снизу откоса нет: столешница кассира (край у спрайта на 0,700) сразу переходит в прилавок ларька */
.win { position: absolute; border: 1.5cqw solid; border-bottom-width: 0; border-color: #8f5a30 #b97a45; border-radius: .5cqw .5cqw 0 0;
  box-shadow: 0 0 0 .3cqw var(--outline), inset 0 0 0 .3cqw var(--outline), inset 0 1.2cqw 0 .3cqw rgba(0, 0, 0, .14); }
.win-r { left: 57.5%; right: 2.5%; top: 26.2%; bottom: 24.2%; background: linear-gradient(#f4efe4 0 72%, #e7dcc8 72%); }
/* прилавок ларька под окошком: светлая столешница того же тона, что у кассира, деревянный торец, тень на стену */
.sill { position: absolute; z-index: 1; left: 56%; right: 1%; top: 75.3%; height: 5.6%; border: .3cqw solid var(--outline); border-radius: .5cqw;
  --u: 1cqw;   /* масштаб слоёв: на телефоне крупнее */
  background:
    linear-gradient(#fbe9c8 0 calc(var(--u) * .95), #e9d2a8 0 calc(var(--u) * 1.2), var(--outline) 0 calc(var(--u) * 1.45), #e3aa70 0 calc(var(--u) * 1.75), transparent 0),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--u) * 6), rgba(0, 0, 0, .13) 0 calc(var(--u) * 6.25)),
    #b97a45;
  box-shadow: 0 .7cqw 1.4cqw rgba(0, 12, 14, .35); }
/* вывеска над стеллажом: год меняется вместе с переключателем */
.sign { position: absolute; z-index: 1; left: 14%; width: 30%; top: 16.5%; height: 7.6%; display: grid; place-items: center; margin: 0;
  border: .3cqw solid var(--outline); border-radius: .7cqw; color: var(--ink);
  background: linear-gradient(#e7b57a 0 12%, #c98f5a 12% 88%, #a8703f 88%); box-shadow: 0 .6cqw 1.2cqw rgba(0, 12, 14, .35); transform-origin: 50% -40%;
  font: 700 clamp(13px, 1.8cqw, 24px)/1 var(--display); letter-spacing: .02em; }
.scene.art .awning, .scene.art .win, .scene.art .sill, .scene.art .sign { display: none; }

/* стеллаж: картинка art/shelf.webp; ряды, ценники и поиск по её разметке.
   В долях картинки: доски 24 / 48,3 / 73,3 % высоты, белые планки 29,2 / 54,3 / 79,4 %, центры планок 15,1 / 37,9 / 61,6 / 84,4 % ширины, цоколь 81–99,6 % */
.shelves { --sw: 53; position: absolute; left: 2.5%; bottom: 3.5%; width: calc(var(--sw) * 1%); aspect-ratio: 1199 / 894;
  isolation: isolate;
  display: grid; grid-template-rows: 7.3% 16.7% 6.2% 18.1% 6.5% 18.5% 1fr; }
/* тень стеллажа: неподвижный слой. Раньше был filter на всём стеллаже, и при наведении на товар
   перерисовывалась его область вместе с соседним окном кассира (видео с clip-path мигало) */
.shelves::before, .shelves::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: url(art/shelf.webp) center / 100% 100% no-repeat; }
.shelves::before { z-index: -2; filter: brightness(0) opacity(.3) blur(.5cqw); transform: translate(.6cqw, .7cqw); }
.shelves::after { z-index: -1; }   /* сам стеллаж поверх своей тени, товары и ценники поверх стеллажа */
.shelf { position: relative; display: grid; grid-template-columns: repeat(4, 23.1%); padding-left: 3.55%; }
.shelf:nth-child(1) { grid-row: 2; --dy: 5.2; }
.shelf:nth-child(2) { grid-row: 4; --dy: 6; }
.shelf:nth-child(3) { grid-row: 6; --dy: 6.1; }
.shelf-plank { display: none; }
.empty { position: absolute; left: 2.5%; width: 53%; top: 55%; margin: 0; text-align: center; font-weight: 700; }
.empty span { padding: .35em .9em; border: 2px solid var(--outline); border-radius: 8px; background: var(--paper); }
.empty[hidden] { display: none; }
/* поиск лежит на цоколе стеллажа */
.pager { position: absolute; left: 5.7%; width: 46.6%; top: 86.4%; display: flex; justify-content: center; align-items: center; gap: 1.1cqw; }
/* стрелки листания: толстый скруглённый шеврон цвета козырька, с контуром, «толщиной» снизу и бликом */
.pager button { flex: none; width: clamp(40px, 4.4cqw, 60px); height: clamp(40px, 4.4cqw, 60px); padding: 0; border: 0; background: none;
  color: #b4553f; transition: transform .08s var(--ease), color .15s var(--ease); }
.pager button svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pager button path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pager button .ol { stroke: var(--outline); stroke-width: 10; }
.pager button .fl { stroke: currentColor; stroke-width: 5.4; }
.pager button .hl { stroke: rgba(255, 236, 214, .7); stroke-width: 1.5; }
.pager button:not(:disabled):hover { color: #cf6a4f; }
.pager button:not(:disabled):active { transform: translateY(1.5px); }
.pager button:disabled { color: #c9ab88; opacity: .6; cursor: default; }
.pager input { flex: 1; min-width: 0; max-width: 62%; height: clamp(36px, 3.6cqw, 48px); padding: 0 1.4cqw; border: .25cqw solid var(--outline); border-radius: 999px;
  background: var(--paper); font: 600 clamp(13px, 1.35cqw, 16px)/1 var(--ui); color: var(--ink); box-shadow: inset 0 .3cqw 0 rgba(0, 0, 0, .1); }
.pager input::placeholder { color: var(--ink-2); }
.pager input:focus-visible { outline: none; border-color: var(--rust); }

.item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; padding: 0; border: 0; background: none; color: var(--ink); }
.item .sprite { width: 86%; aspect-ratio: 1; background-repeat: no-repeat; transition: transform .15s var(--ease); }
.item .sprite:not([style]) { display: none; }
/* пока нет картинок товаров, название лежит светлой плашкой на дереве */
.item .label { max-width: 96%; margin-bottom: 8%; padding: .2cqw .55cqw; border-radius: .4cqw; background: rgba(251, 248, 241, .94);
  font: 700 clamp(7px, .9cqw, 11px)/1.15 var(--ui); text-align: center; overflow-wrap: break-word; hyphens: auto;
  transition: transform .15s var(--ease); }
.item.has-sprite .label { display: none; }
/* товар стоит на доске: высоту задаёт app.js по доле в клетке листа, ширина по пропорциям картинки */
.item.has-sprite .sprite { width: auto; max-width: 100%; filter: drop-shadow(.15cqw .35cqw .3cqw rgba(40, 18, 6, .3)); }
/* ценник ложится на белую планку под доской */
.item .tag { position: absolute; left: 50%; top: calc(100% + var(--sw) * var(--dy) / 134.1 * 1cqw); transform: translate(-50%, -50%);
  display: grid; justify-items: center; width: 94%; padding: .2cqw .35cqw .25cqw; border: .2cqw solid var(--outline); border-radius: .35cqw; background: #fff6d3;
  text-align: center; transition: background-color .15s var(--ease), color .15s var(--ease); }
.t-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 clamp(7px, .8cqw, 11px)/1.15 var(--ui); }
.t-price { font: 500 clamp(8px, 1.05cqw, 13px)/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-price small { font: 700 .78em var(--ui); color: #b23c31; }   /* контраст 5,4 на жёлтом ценнике */
.item:hover .sprite, .item.on .sprite, .item:hover .label, .item.on .label { transform: translateY(-.4cqw); }
.item .sprite { transform-origin: 50% 100%; transition: transform .18s var(--ease), filter .18s var(--ease); }
@media (hover: hover) {
  .item:hover .sprite, .item.on .sprite { transform: translateY(-.3cqw) scale(1.14); filter: drop-shadow(.25cqw .7cqw .6cqw rgba(40, 18, 6, .32)); }
  .item:hover .tag { transform: translate(-50%, -50%) scale(1.06); }
}
.item:hover .tag { background: #ffe79a; }
.item.on .tag { background: var(--rust); color: #fff; }
.item.on .t-price small { color: inherit; }
.item.none .tag { color: var(--text-3); }
/* товар без своей картинки: пакет (продукты), коробка (дом), сумка (вещи и услуги) до генерации листов */
.item.ph .label { display: none; }
.item.ph .sprite { display: block; width: auto; height: 62%; aspect-ratio: 1; background: center / contain no-repeat; filter: drop-shadow(.15cqw .35cqw .3cqw rgba(40, 18, 6, .3)); }
.item.ph-food .sprite { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M14 24h36l-3 34H17z' fill='%23d9a066' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M14 24l5-9h26l5 9' fill='%23c4874f' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M24 32a8 8 0 0 0 16 0' fill='none' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E"); }
.item.ph-home .sprite { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M9 26 32 16l23 10v24L32 61 9 50z' fill='%23c98f5a' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M9 26l23 10 23-10M32 36v25' fill='none' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M20 21l23 10v8' fill='none' stroke='%230fa4af' stroke-width='4'/%3E%3C/svg%3E"); }
.item.ph-kr .sprite { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M24 26v-6a8 8 0 0 1 16 0v6' fill='none' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Crect x='13' y='24' width='38' height='34' rx='4' fill='%23ff6f61' stroke='%231f1d1a' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3Cpath d='M19 32h26' stroke='%23ffd36b' stroke-width='3'/%3E%3C/svg%3E"); }

/* стикер «Акции» на стене: новая яркая деталь (вывеску и кнопки не трогаем) */
.promo-btn { position: absolute; z-index: 2; left: 46.6%; top: 15.6%; width: 7.6cqw; aspect-ratio: 1; padding: 0; border: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32.0,2.0 36.7,8.5 43.5,4.3 45.3,12.0 53.2,10.8 52.0,18.7 59.7,20.5 55.5,27.3 62.0,32.0 55.5,36.7 59.7,43.5 52.0,45.3 53.2,53.2 45.3,52.0 43.5,59.7 36.7,55.5 32.0,62.0 27.3,55.5 20.5,59.7 18.7,52.0 10.8,53.2 12.0,45.3 4.3,43.5 8.5,36.7 2.0,32.0 8.5,27.3 4.3,20.5 12.0,18.7 10.8,10.8 18.7,12.0 20.5,4.3 27.3,8.5' fill='%23c4473b' stroke='%231f1d1a' stroke-width='2.2' stroke-linejoin='round'/%3E%3Ccircle cx='32' cy='32' r='19.5' fill='none' stroke='%23ffd36b' stroke-width='1.4' stroke-dasharray='2 2.4'/%3E%3C/svg%3E") center / contain no-repeat; transform: rotate(-10deg); display: grid; place-items: center;
  filter: drop-shadow(0 .4cqw .7cqw rgba(0, 12, 14, .35)); transition: transform .2s var(--ease); }
.promo-btn span { font: 700 clamp(9px, 1.15cqw, 15px)/1 var(--display); color: #fffaf0; letter-spacing: .01em; text-shadow: 0 1px 0 rgba(90, 20, 10, .5); }
@media (hover: hover) { .promo-btn:hover { transform: rotate(4deg) scale(1.08); } }
.promo-btn:active { transform: rotate(-10deg) scale(.95); }
.promo-btn:focus-visible { outline: 2px solid #fffaf0; outline-offset: 3px; border-radius: 50%; }
/* листовка: бумага поверх сцены, акции купонами с пунктиром «отрежь» */
.promo { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(0, 22, 25, .5); }
.promo[hidden] { display: none; }
.p-sheet { position: relative; width: min(64%, 640px); max-height: 88%; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #d9a066 transparent;   /* бумажная листовка: тонкая полоска цвета дерева, без серого жёлоба */ padding: 1.8cqw 2cqw 1.4cqw;
  background: #fffaf0; border: 3px solid var(--outline); border-radius: 16px; color: var(--ink); font: 500 clamp(13px, 1.25cqw, 16px)/1.45 var(--ui);
  box-shadow: 0 1cqw 3cqw rgba(0, 12, 14, .45); animation: pop .3s cubic-bezier(.34, 1.4, .64, 1) both; }
.promo .close { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-2); border-radius: 50%; }
.promo .close:hover { background: #f1e7d6; color: var(--ink); }
.p-head { margin: 0 44px .5em 0; font: 700 1.5em/1.15 var(--display); color: #c4473b; }
.p-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7em; }
.p-card { padding: .75em .9em .7em; border: 2px dashed #d98a5a; border-radius: 12px; background: #fff1cf; }
.p-top { display: flex; justify-content: space-between; gap: 1em; font-size: .85em; }
.p-co { padding: .05em .55em; border-radius: 999px; background: #0b6f77; color: #fff; }   /* белый на тёмной бирюзе: 5,9 */
.p-date { font-family: var(--mono); color: var(--ink-2); }
.p-title { margin-top: .35em; font: 700 1.12em/1.25 var(--display); }
.p-offer { margin: .3em 0 .4em; }
.p-foot { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; font-size: .82em; color: var(--ink-2); }
.p-foot a { color: inherit; text-underline-offset: 2px; }
.p-note { margin: .6em 0 0; font-size: .82em; color: var(--ink-2); }
.item:focus-visible { outline: none; }
.item:focus-visible .tag { outline: 2px solid var(--rust); outline-offset: 2px; }

/* кассир в окошке: спрайт шире ниши и обрезан по её внутреннему краю.
   В долях спрайта: макушка 17 %, край столешницы 73,1 %, стойка с батончиками и касса 11–89 % ширины */
.clerk { position: absolute; isolation: isolate; transform: translateZ(0); left: 53.85%; bottom: -1%; width: 47.3%; aspect-ratio: 1; pointer-events: none; clip-path: inset(14.3% 11% 30% 10.9%); }
.clerk img, .clerk svg { width: 100%; height: 100%; display: block; }
.clerk img[hidden] { display: none; }
/* живой кассир: ролик ровно на видимый кусок спрайта (x 10,9–89,1 %, y 14,25–70 %), стена окна уже в кадре */
.clerk-vid { position: absolute; left: 10.9%; top: 14.25%; width: 78.2%; height: 55.73%; }
/* рольставни в окошке: металлические ламели и нижняя планка с ручкой. Пока кассир грузится, ставни подрагивают
   (кто-то пытается их поднять); когда готово — уезжают вверх и прячутся */
.shutter-win { position: absolute; z-index: 3; left: 10.9%; top: 14.25%; width: 78.2%; height: 55.73%; overflow: hidden; pointer-events: none; }
.shutter-win[hidden] { display: none; }
.shutter-win .roll { position: absolute; inset: 0;
  background: repeating-linear-gradient(#c9d1d2 0 .9cqw, #aeb8ba .9cqw 1.25cqw, #7d898b 1.25cqw 1.4cqw);
  box-shadow: inset 0 1.2cqw 1.4cqw -0.6cqw rgba(0, 0, 0, .35); animation: rattle-win 1.3s ease-in-out infinite; }
.shutter-win .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 1.6cqw; background: linear-gradient(#a3adaf, #7f8b8d);
  border-top: .25cqw solid var(--outline); }
.shutter-win .bar::after { content: ""; position: absolute; left: 50%; top: 35%; width: 3.2cqw; height: .55cqw; margin-left: -1.6cqw; border-radius: .3cqw; background: #4c5659; }
@keyframes rattle-win { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-5%); } 45% { transform: translateY(-2.5%); } 60% { transform: translateY(-4%); } }
/* подъём отдельной анимацией: переход (transition) после дрожания не запускается и ставни прыгали вверх мгновенно */
.shutter-win.open .roll { animation: roll-up 1.05s cubic-bezier(.55, 0, .25, 1) forwards; }
@keyframes roll-up { 0% { transform: translateY(0); } 12% { transform: translateY(3%); } 100% { transform: translateY(-101%); } }
.clerk-vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: 0; }
.clerk-vid video.on { opacity: 1; }
.clerk .mouth-open { display: none; }
/* экран кассы: зелёный ЖК 93×27 px в кадре 828×590 → в долях .clerk (ролик занимает 10,9 % + 78,2 % по x, 14,25 % + 55,73 % по y) */
.lcd { position: absolute; z-index: 2; left: 78.3%; top: 47%; width: 8.4%; height: 2.35%; overflow: hidden; font-size: .8cqw;   /* cqw сцены: экран = 8,4 % ширины кассира (47,3cqw) */
  display: flex; align-items: center; padding: 0 .3em; }   /* отступ в em: проценты считались бы от ширины кассира */
.lcd-t { font: 500 1em/1 var(--mono); color: #1d3b20; white-space: nowrap; letter-spacing: -.03em; text-shadow: 0 0 1px rgba(29, 59, 32, .45); }
.lcd.price { justify-content: flex-end; }
.lcd.scroll .lcd-t { padding-left: 100%; animation: lcd-run 11s linear infinite; }
@keyframes lcd-run { to { transform: translateX(-100%); } }
.lcd.blink .lcd-t { animation: lcd-blink .5s steps(2, jump-none) 2; }
@keyframes lcd-blink { 50% { opacity: 0; } }
.clerk.talk .mouth-open { display: inline; }
.clerk.talk .mouth-shut { display: none; }
.clerk.blink .eyes { transform: scaleY(.1); transform-origin: 200px 134px; }

/* «весь список» висит табличкой на верёвках под подоконником */
.to-list { position: absolute; z-index: 1; left: 63%; right: 8%; top: 84.4%; padding: 1cqw 1cqw; border: .25cqw solid var(--outline); border-radius: .8cqw;
  background: repeating-linear-gradient(90deg, transparent 0 22%, rgba(90, 50, 20, .1) 22% 22.4%), linear-gradient(#d9a066, #c4874f);
  color: var(--ink); box-shadow: inset 0 .2cqw 0 rgba(255, 232, 200, .55), inset 0 -.2cqw 0 rgba(90, 50, 20, .25);
  font: 700 clamp(11px, 1.2cqw, 15px)/1.15 var(--display); transition: transform .08s var(--ease), filter .15s var(--ease); }
.to-list::before { content: ""; position: absolute; left: 14%; right: 14%; bottom: 100%; height: 2.1cqw;
  border-left: .25cqw solid var(--outline); border-right: .25cqw solid var(--outline); }
.to-list:hover { filter: brightness(1.08); }
.to-list:active { transform: translateY(1px); filter: brightness(.96); }
.to-list .short { display: none; }

/* облачко из рта, как в комиксе: тёплая бумага, рамка толщиной с линии кассира, острый выгнутый хвостик к его рту.
   Тень мягкая через filter, чтобы падала и от хвостика */
.bubble {
  --mx: 78.8%; --my: 53.7%;   /* рот кассира: 53,85% + 0,528 ширины спрайта; верх спрайта 16,9% + 0,437 его высоты (окно на уровне стеллажа) */
  --pp: #fffaf0; --bw: 3px;
  position: absolute; right: calc(100% - var(--mx) + 7.5%); bottom: calc(100% - var(--my) - 11%);
  width: min(46%, 460px); padding: 1.5cqw 1.9cqw 1.3cqw; background: var(--pp); border: var(--bw) solid var(--outline); border-radius: 2.2cqw;
  filter: drop-shadow(0 .8cqw 1.4cqw rgba(0, 24, 28, .34)); font: 500 clamp(13px, 1.3cqw, 16px)/1.5 var(--ui); z-index: 3;
  transform-origin: calc(100% + 4.6cqw) calc(100% - 10.6cqw);
  animation: pop .34s cubic-bezier(.34, 1.5, .64, 1) both;
}
.bubble[hidden] { display: none; }
/* кончик на уровне рта: основание выше середины правого края */
.bubble .tail { position: absolute; left: 100%; bottom: 7.4cqw; width: 5cqw; height: 4cqw; overflow: visible; }
.bubble .tf { fill: var(--pp); }
.bubble .ts { fill: none; stroke: var(--outline); stroke-width: var(--bw); vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
@keyframes pop { from { opacity: 0; transform: scale(.4) rotate(4deg); } 60% { opacity: 1; } }
.bubble .close { position: absolute; right: .7cqw; top: .7cqw; width: 30px; height: 30px; border: 0; background: none; font-size: 20px; line-height: 1;
  color: var(--ink-2); border-radius: 50%; transition: background-color .15s var(--ease), color .15s var(--ease); }
.bubble .close:hover { background: #f1e7d6; color: var(--ink); }
.b-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2em .5em; padding-right: 34px; font: 700 1.12em/1.2 var(--display); }
.b-name span { padding: .15em .55em; border-radius: 999px; background: #ffe3a1; font: 700 .62em/1.2 var(--ui); color: #7a4a00; }
/* реплика рукописным Pangolin: это живая речь, а цифры ниже ровным шрифтом */
.b-say { display: grid; margin: .4em 0 .65em; font: 400 1.18em/1.4 var(--hand); color: #2b2620; }
.b-say > span { grid-area: 1 / 1; text-wrap: pretty; }
.b-say .ghost { visibility: hidden; }
.b-big { font: 700 1.45em/1.1 var(--display); color: #c4473b; }
.b-big.down { color: #0b6f77; }
.b-big::before { content: "▲"; display: inline-block; margin-right: .35em; font-size: .55em; vertical-align: .25em; }
.b-big.down::before { content: "▼"; }
.b-big:empty::before { content: none; }
.b-rows { display: grid; grid-template-columns: auto 1fr; margin: .7em 0 0; font-variant-numeric: tabular-nums; }
.b-rows dt, .b-rows dd { padding: .32em 0; border-top: 1px dashed var(--rule); }
.b-rows dt { font: 700 .82em/1.5 var(--ui); color: var(--ink-2); }
.b-rows dd { margin: 0; text-align: right; font: 400 .86em/1.45 var(--mono); }
.b-rows .was { color: var(--ink-2); }
.b-rows .arr { margin: 0 .35em; color: #b9ab98; font-style: normal; }
.b-rows b { font-weight: 500; color: var(--ink); }
.b-src { margin-top: .5em; padding-top: .5em; border-top: 1px dashed var(--rule); font-size: .78em; color: var(--ink-2); }
.b-src a { color: inherit; text-underline-offset: 2px; }
.b-src a:hover { color: var(--ink); }

/* ---------- полный список ---------- */
.list[hidden] { display: none; }
.list { display: grid; gap: 16px; justify-items: center; }
/* тень от чека: у самого чека маска режет всё за краем */
.list .receipt-wrap { width: min(100%, 760px); filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .4)); }
.list-head { width: min(100%, 760px); display: grid; gap: 12px; }
.back { justify-self: start; height: 42px; padding: 0 18px; border: 1.5px solid rgba(175, 221, 229, .16); border-radius: 12px; background: #023f45; font-weight: 700; }
.back:hover { background: #03606a; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 36px; padding: 0 14px; border: 1.5px solid rgba(175, 221, 229, .16); border-radius: 999px; background: #023f45; color: var(--text-2); font-weight: 700; }
.chips button[aria-checked="true"] { background: var(--accent); color: #00262a; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.sort select { height: 36px; padding: 0 10px; border: 1.5px solid rgba(175, 221, 229, .16); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; }

/* кассовый чек с зубчатым отрывом сверху и снизу */
.receipt { width: 100%; background: var(--paper); color: var(--ink);
  padding: 36px 32px 44px; font: 400 13px/1.55 var(--mono); font-variant-numeric: tabular-nums;
  --tooth: conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom / 16px 9px repeat-x;
  -webkit-mask: linear-gradient(#000 0 0) center / 100% calc(100% - 18px) no-repeat, conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) top / 16px 9px repeat-x, var(--tooth);
          mask: linear-gradient(#000 0 0) center / 100% calc(100% - 18px) no-repeat, conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) top / 16px 9px repeat-x, var(--tooth); }
.r-head { text-align: center; margin-bottom: 12px; }
.r-name { font: 700 22px/1.1 var(--display); }
.r-sub { color: var(--ink-2); }
.r-rule { border: 0; border-top: 1px dashed var(--rule); margin: 12px 0; }
.r-group { margin: 20px 0 6px; font: 800 15px/1.4 var(--ui); }
.r-cols, .r-row { display: grid; grid-template-columns: 1fr 88px 88px 128px; column-gap: 12px; align-items: baseline; }
.r-cols { color: var(--ink-2); font-size: 11px; }
.r-cols span:not(:first-child), .r-row .v { text-align: right; }
.r-line { padding: 5px 8px; margin: 0 -8px; border-radius: 4px; }
.r-line:hover { background: var(--accent-soft); }
.r-line .u { color: var(--ink-2); white-space: nowrap; }
.r-line .then { color: var(--fade, var(--ink)); }
.r-line .d { color: var(--ink-2); }
.r-line.miss .d { font-size: 11px; }
.r-total { font-weight: 500; }
.r-plov { margin-top: 16px; padding: 12px; border: 1px dashed var(--rule); border-radius: 4px; }
.r-note { color: var(--ink-2); font-size: 11.5px; margin-top: 8px; }
.r-note a { color: inherit; }
.r-foot { text-align: center; color: var(--ink-2); margin-top: 16px; }
.r-print { animation: print .2s var(--ease) both; animation-delay: calc(var(--i) * 16ms); }
@keyframes print { from { opacity: 0; transform: translateY(-3px); } }

/* ---------- загрузка и ошибка ---------- */
#loading { position: fixed; inset: 0; display: none; place-items: center; }
/* ларёк закрыт рольставнями: пока грузится, ставни подрагивают (кто-то пытается открыть);
   готово — ставни уезжают вверх и экран тает (класс opening, потом снимается wait) */
#loading { z-index: 20; background: radial-gradient(90% 60% at 50% -10%, rgba(15, 164, 175, .28), transparent 70%), var(--bg); }
body.wait #loading { display: grid; animation: appear .2s .3s both; }   /* только если загрузка дольше 0,3 с */
@keyframes appear { from { opacity: 0; } }
.kiosk { width: min(46vw, 200px); height: auto; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .45)); animation: kiosk-in .35s var(--ease) both; }
@keyframes kiosk-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.shutter { animation: rattle 1.1s ease-in-out infinite; }
@keyframes rattle { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-14%); } 55% { transform: translateY(-9%); } 70% { transform: translateY(-12%); } }
body.opening #loading { opacity: 0; transition: opacity .3s; }
#fail { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 32px; text-align: center; }
#fail[hidden] { display: none; }
#fail p { margin: 0; color: var(--text-2); max-width: 32ch; }
#fail button { padding: 10px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.torn { width: 88px; height: 56px; background: var(--paper); border-top: 2px solid var(--outline);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 88% 100%, 75% 80%, 62% 100%, 50% 82%, 37% 100%, 25% 80%, 12% 100%, 0 82%); }
.nojs { padding: 32px; text-align: center; color: var(--text-2); }

/* ---------- узкий ноутбук и планшет ---------- */
/* ---------- анимации (при «уменьшить движение» выключены правилом в конце) ---------- */
/* загрузка: козырёк опускается с пружинкой, вывеска качается на подвесе */
.scene.intro .awning { animation: awn-drop .8s cubic-bezier(.3, 1.45, .5, 1) both; }
@keyframes awn-drop { from { transform: translateY(-105%); } }
.scene.intro .sign, .sign.swing { animation: swing 1.2s .25s both; }
@keyframes swing { 0% { transform: rotate(0); } 20% { transform: rotate(-3deg); } 45% { transform: rotate(2deg); } 70% { transform: rotate(-.8deg); } 100% { transform: rotate(0); } }
/* товары въезжают лесенкой: при загрузке сверху, при листании со стороны листания */
.shelves.in-d .item { animation: item-drop .45s cubic-bezier(.3, 1.4, .5, 1) calc(.25s + var(--k) * 40ms) both; }
.shelves.in-r .item { animation: item-r .32s var(--ease) calc(var(--k) * 22ms) both; }
.shelves.in-l .item { animation: item-l .32s var(--ease) calc(var(--k) * 22ms) both; }
@keyframes item-drop { from { opacity: 0; transform: translateY(-2.5cqw) scale(.9); } }
@keyframes item-r { from { opacity: 0; transform: translateX(3cqw); } }
@keyframes item-l { from { opacity: 0; transform: translateX(-3cqw); } }
/* новый год или единицы: ценники переворачиваются, как табло */
.shelves.tick .tag { animation: tag-flip .42s var(--ease) calc(var(--k) * 25ms) both; }
@keyframes tag-flip { 0% { transform: translate(-50%, -50%); } 45% { transform: translate(-50%, -50%) perspective(20cqw) rotateX(85deg); } 100% { transform: translate(-50%, -50%); } }
/* год въезжает снизу или сверху по направлению */
#year.up { animation: yr-up .3s var(--ease); }
#year.down { animation: yr-down .3s var(--ease); }
@keyframes yr-up { from { opacity: 0; transform: translateY(45%); } }
@keyframes yr-down { from { opacity: 0; transform: translateY(-45%); } }
/* табличка на верёвках раскачивается от наведения */
@media (hover: hover) { .to-list:hover { animation: sway 1.1s ease-out; } }
.to-list { transform-origin: 50% -2.1cqw; }
@keyframes sway { 20% { transform: rotate(2.2deg); } 45% { transform: rotate(-1.6deg); } 70% { transform: rotate(.7deg); } 100% { transform: rotate(0); } }

@media (max-width: 900px) {
  #app { padding: 16px; }
  .r-cols, .r-row { grid-template-columns: 1fr 72px 72px; }
  .r-row .d, .r-cols .d { grid-column: 1 / -1; text-align: right; }
}

/* ---------- телефон: полки сверху, кассир снизу, год и единицы панелью под пальцем ---------- */
@media (max-width: 640px) {
  #app { padding: 8px 12px 132px; gap: 12px; }
  .brand { font-size: 22px; }
  .brand span { margin-top: 6px; font-size: 13px; }
  .hint { margin-top: -6px; font-size: 13px; line-height: 16px; }   /* над панелью года, а не под ней */
  .hint .long { display: none; }   /* в одну строку, иначе вторая уходит под панель года */
  .hint .short { display: inline; }
  .bar { position: fixed; z-index: 4; left: 8px; right: 8px; bottom: 8px; display: grid; gap: 8px; padding: 8px;
    background: var(--surface); border: 1.5px solid rgba(175, 221, 229, .16); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
  .years, .modes { box-shadow: none; }
  .years { justify-content: space-between; border: 0; background: none; }
  .years button { width: 48px; height: 44px; }
  .modes { border: 0; padding: 0; background: none; }
  .modes button { flex: 1; height: 44px; padding: 0 6px; background: var(--bg); border: 1px solid var(--line); }
  /* телефон как в игре-лавке: кассир крупно сверху в окошке до края столешницы, под ним стеллаж, поиск на цоколе */
  .stage { aspect-ratio: 10 / 17; border-radius: 14px; }
  .awning { height: 7.5%; --st: 7cqw; --cap: 2.6cqw; }
  .scene::before { top: 7%; height: 4%; }
  .scene::after { height: 2.5%; }
  .win { border-width: 2.4cqw; }
  .win-r { left: 3%; right: 3%; top: 9%; bottom: 53.6%; }
  .sill { --u: 2.3cqw; left: 1.5%; right: 1.5%; top: 46.2%; height: 9.6%; }
  .sign { display: none; }
  .clerk { left: -6.8%; width: 113.6%; bottom: 33.56%; clip-path: inset(15.4% 11% 30% 11%); }
  .to-list { left: auto; right: 6%; top: 91.2%; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; font-size: 11px; }
  .to-list::before { display: none; }
  .to-list .long { display: none; }
  .to-list .short { display: inline; }
  .shelves { --sw: 94; left: 3%; bottom: 2.5%; }
  .empty { left: 3%; width: 94%; top: 70%; }
  .pager { left: 6%; width: auto; right: 37.5%; top: 91.2%; justify-content: flex-start; gap: 6px; }
  .pager button, .pager input { height: 44px; }
  .pager button { width: 44px; }
  .pager input { max-width: none; padding: 0 12px; }
  .item { min-height: 44px; }
  .item .label { font-size: clamp(7px, 2.3cqw, 10px); }
  .item .tag { width: 98%; padding: 1px 2px 2px; border-width: 1px; }
  .t-name { font-size: clamp(7px, 2.15cqw, 9px); line-height: 1.05; }
  .t-price { font-size: clamp(8px, 2.45cqw, 10.5px); line-height: 1.1; }
  /* облачко под ртом, поверх прилавка и полок; хвостик вверх */
  .bubble { --mx: 53.2%; --my: 28.8%; --bw: 2.5px; left: 3%; right: 3%; width: auto; top: calc(var(--my) + 38px); bottom: auto; padding: 14px 16px 12px; font-size: 14px;
    transform-origin: 50% -50px; border-radius: 18px; }
  /* тот же хвостик, повёрнутый остриём вверх: основание на верхней рамке, кончик под ртом (53,4 % ширины облачка) */
  .bubble .tail { left: calc(53.4% + 3px); top: -20px; bottom: auto; width: 50px; height: 40px; transform: rotate(-90deg); transform-origin: 0 20px; }
  .bubble .close { width: 44px; height: 44px; right: 2px; top: 2px; }
  .lcd { font-size: 2.05cqw; }   /* кассир на телефоне 113,6cqw шириной */
  .promo-btn { left: 4%; top: 44.6%; width: 15cqw; }
  .promo-btn span { font-size: clamp(9px, 2.6cqw, 13px); }
  .p-sheet { width: 94%; max-height: 92%; padding: 16px 14px 12px; font-size: 14px; }
  .promo .close { width: 44px; height: 44px; right: 2px; top: 2px; }
  .b-name { padding-right: 44px; }
  .back, .chips button, .sort select, #fail button { min-height: 44px; }
  .chips button { padding: 0 14px; }
  .receipt { padding: 28px 16px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
