/* Арт Лайки — альбом с наклейками на бумаге печатной игры */

@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-cyrillic.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("../fonts/golos-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* лапка цвета --paper-edge для пустого места на картине */
  --paw-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='8 8 48 48'%3E%3Cg fill='%23E6DCB8'%3E%3Cellipse cx='17' cy='27' rx='5.5' ry='7' transform='rotate(-18 17 27)'/%3E%3Cellipse cx='27' cy='17' rx='5.5' ry='7.5' transform='rotate(-6 27 17)'/%3E%3Cellipse cx='39' cy='17' rx='5.5' ry='7.5' transform='rotate(8 39 17)'/%3E%3Cellipse cx='48' cy='28' rx='5.5' ry='7' transform='rotate(20 48 28)'/%3E%3Cpath d='M32 30c-8 0-14 9-14 15 0 5 4 7 8 6 2.2-.6 4-1.4 6-1.4s3.8.8 6 1.4c4 1 8-1 8-6 0-6-6-15-14-15z'/%3E%3C/g%3E%3C/svg%3E");
  --paper: #FDFAE5;
  --paper-deep: #F5EED2;
  --paper-edge: #E6DCB8;
  --ink: #211B17;
  --ink-2: #5A5047;
  --ink-3: #8A7E70;
  --leash: #962224;
  --leash-hi: #B0302F;
  --leash-wash: rgba(150, 34, 36, 0.08);
  --paw: #F2C888;
  --paw-deep: #E2A45C;
  --white: #FFFFFF;

  --p1: #962224;
  --p2: #2D4B7E;
  --p3: #9A6512;
  --p4: #3E6B3A;

  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  --radius: 8px;
  --radius-lg: 14px;

  --shadow-sticker: 0 1px 1px rgba(70, 45, 20, 0.16), 0 6px 14px -4px rgba(70, 45, 20, 0.22);
  --shadow-lift: 0 2px 2px rgba(70, 45, 20, 0.12), 0 14px 28px -10px rgba(70, 45, 20, 0.32);
  --shadow-flat: 0 1px 0 rgba(70, 45, 20, 0.14);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-flip: cubic-bezier(0.2, 0.75, 0.25, 1);

  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--paper-edge) var(--paper);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

::selection { background: rgba(150, 34, 36, 0.18); color: var(--ink); }

img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--leash);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

.noscript { padding: 40px var(--gutter); font-size: 20px; }

/* ---------- Шапка ---------- */

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px var(--gutter) 8px;
}
.site-header[hidden] { display: none; }
.brand { display: block; flex: none; }
.brand img { width: clamp(108px, 14vw, 156px); height: auto; }

.site-nav { display: flex; gap: clamp(6px, 2vw, 18px); align-items: center; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 12px;
  text-decoration: none; font-weight: 600; font-size: 16px;
  border-radius: 999px;
  transition: background-color 160ms ease;
}
.site-nav a[aria-current="page"] { background: var(--leash-wash); color: var(--leash); }
.nav-count {
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700;
  color: var(--leash); background: var(--white);
  border: 1.5px solid currentColor; border-radius: 999px; padding: 1px 8px;
}
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { background: var(--leash-wash); }
}

/* ---------- Общие элементы ---------- */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.btn {
  --bg: var(--leash); --fg: var(--white);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font-weight: 700; font-size: 17px; letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 8px 18px -10px rgba(150, 34, 36, 0.7);
  transition: transform 160ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--ghost {
  --bg: transparent; --fg: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.btn--quiet {
  --bg: var(--paper-deep); --fg: var(--ink);
  box-shadow: none;
}
.btn--small { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn svg { width: 20px; height: 20px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { --bg: var(--leash-hi); }
  .btn--ghost:hover { --bg: var(--paper-deep); }
  .btn--quiet:hover { --bg: var(--paper-edge); }
}

.link-btn {
  background: none; border: 0; padding: 8px 4px; min-height: 44px;
  font-weight: 600; text-decoration: underline; text-underline-offset: 4px;
  text-decoration-thickness: 1.5px; text-decoration-color: rgba(150, 34, 36, 0.45);
}

/* Наклейки и картины */
.sticker {
  filter: drop-shadow(0 1px 1px rgba(70, 45, 20, 0.2)) drop-shadow(0 5px 7px rgba(70, 45, 20, 0.16));
}
/* .fit — коробка известного размера; .plate — белая рамка, облегающая картину */
.fit {
  container-type: size;
  display: grid; place-items: center;
  width: 100%; height: 100%; min-height: 0;
}
.plate {
  --ar: 1;
  position: relative; display: block;
  width: min(100cqw, 100cqh * var(--ar));
  aspect-ratio: var(--ar);
  background: var(--white);
  padding: clamp(2px, 1.6cqmin, 6px);
  box-shadow: var(--shadow-sticker);
}
.plate > img:not(.stuck) { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--paper-deep); }
.plate .stuck {
  position: absolute; right: -12%; bottom: -12%;
  width: 46%; height: 46%; object-fit: contain;
  transform: rotate(-7deg); z-index: 2; pointer-events: none;
}

/* Картина с пустым местом там, где стояла собака (игры на подбор) */
.plate > .art { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.plate > .art > img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--paper-deep); }
.hole {
  position: absolute; container-type: size;
  background: var(--paper-deep);
  border: 1.5px dashed rgba(150, 34, 36, 0.5); border-radius: 6px;
  box-shadow: inset 0 2px 5px rgba(70, 45, 20, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}
/* лапка в окошке: здесь живёт собака */
.hole::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 38cqmin; height: 38cqmin; translate: -50% -50%;
  background: var(--paw-mark) center / contain no-repeat;
}
.landed { position: absolute; max-width: none; object-fit: fill; pointer-events: none; z-index: 1; }

/* ---------- Главная ---------- */

.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; gap: clamp(16px, 4vw, 56px);
  padding-top: clamp(8px, 3vw, 40px);
}
.hero h1 {
  font-size: clamp(42px, 6.4vw, 88px);
  line-height: 0.98; font-weight: 800; letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--leash); }
.hero-lead {
  margin-top: clamp(16px, 2.4vw, 28px);
  font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2);
  max-width: 34ch; text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(22px, 3vw, 36px); }
.hero-art { position: relative; justify-self: end; width: min(100%, 560px); }
.hero-art img { width: 100%; height: auto; }

.modes { position: relative; margin-top: clamp(28px, 5vw, 64px); }
.home-top { position: relative; }
.leash { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.hero, .modes { position: relative; z-index: 1; }
.hero-art img { position: relative; z-index: 1; }
.modes-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px);
}

.mode {
  position: relative; display: flex; flex-direction: column;
  min-height: 100%;
  padding: 18px 18px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sticker);
  text-decoration: none; color: inherit;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.mode:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .mode:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
}
.mode-scene {
  position: relative; aspect-ratio: 4 / 3;
  border: 1.5px solid rgba(150, 34, 36, 0.45); border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}
.mode h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-top: 16px; }
.mode p { color: var(--ink-2); font-size: 16px; line-height: 1.45; margin-top: 6px; }
.mode--main { outline: 3px solid var(--leash); outline-offset: -3px; }
.mode-go {
  margin-top: auto; padding-top: 16px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--leash);
}
.mode-go svg { width: 18px; height: 18px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .mode:hover .mode-go svg { transform: translateX(4px); }
}

/* мини-сцены режимов */
.ms { position: absolute; }
.ms-card {
  width: 30%; aspect-ratio: 1; border-radius: 7px;
  background: var(--white) url("../assets/ui/paws.webp") center / cover;
  box-shadow: var(--shadow-sticker);
  border: 3px solid var(--white);
}
.ms-card.up { background: var(--white); display: grid; place-items: center; }
.ms-card.up img { width: 82%; height: 82%; object-fit: contain; }
.ms-plate { background: var(--white); padding: 3px; box-shadow: var(--shadow-sticker); }
.ms-plate img { width: 100%; height: 100%; object-fit: cover; }
.ms-plate.is-holed { container-type: size; overflow: hidden; padding: 0; border: 3px solid var(--white); }
.ms-plate .art {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: max(100cqw, 100cqh * var(--ar)); height: max(100cqh, 100cqw / var(--ar));
}
.ms-plate .art img { display: block; }
.ms-plate .hole { border-width: 1px; border-radius: 3px; }
.ms-dog { object-fit: contain; }

.album-strip { margin-top: clamp(48px, 7vw, 96px); }
.album-strip-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.album-strip h2, .section-title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; }
.album-strip-head p { color: var(--ink-2); margin-top: 8px; }
.strip {
  margin-top: 22px;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(108px, 12vw, 148px);
  gap: 14px; overflow-x: auto; padding: 6px 2px 18px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.strip > * { scroll-snap-align: start; }

.about {
  margin-top: clamp(56px, 8vw, 110px);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: clamp(20px, 5vw, 72px);
  align-items: center;
}
.about-art img { width: min(100%, 420px); margin-inline: auto; height: auto; }
.about h2 { font-size: clamp(28px, 3.2vw, 42px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.about p { margin-top: 16px; color: var(--ink-2); max-width: 56ch; font-size: 18px; }
.about .btn { margin-top: 24px; }

.site-footer {
  margin-top: clamp(56px, 8vw, 100px);
  border-top: 1.5px solid var(--paper-edge);
  padding: 22px 0 calc(28px + env(safe-area-inset-bottom));
  color: var(--ink-2); font-size: 14px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer a {
  color: inherit; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; text-decoration-color: rgba(150, 34, 36, 0.45);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .site-footer a:hover { color: var(--leash); text-decoration-color: currentColor; }
}
/* на странице покупки подвала нет — отступ снизу даёт сама страница */
.page-shop { padding-bottom: clamp(40px, 6vw, 80px); }

/* ---------- Гнездо альбома ---------- */

.slot {
  position: relative; display: flex; flex-direction: column;
  border: 0; padding: 0; background: none; text-align: left;
  color: inherit; text-decoration: none;
  transition: transform 180ms var(--ease-out);
}
.slot:active { transform: scale(0.98); }
.slot-frame {
  position: relative; aspect-ratio: 1;
  display: grid; place-items: center;
  border: 1.5px solid rgba(150, 34, 36, 0.4); border-radius: 10px;
  background: var(--paper);
}
.slot-frame .fit { position: absolute; inset: 13%; width: auto; height: auto; }
.slot-dog {
  position: absolute; right: -6%; bottom: -8%;
  width: 52%; height: 52%; object-fit: contain;
  transform: rotate(-6deg);
}
.slot-sil {
  position: absolute; inset: 15%; width: 70%; height: 70%; object-fit: contain;
  filter: brightness(0) opacity(0.09);
}
.slot-num {
  position: absolute; left: 8px; top: 6px;
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--leash);
}
.slot.is-filled .slot-frame { border-style: solid; border-color: rgba(150, 34, 36, 0.22); background: var(--paper-deep); }
.slot-title { margin-top: 12px; font-weight: 700; font-size: 15px; line-height: 1.25; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot-meta { color: var(--ink-2); font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.slot.is-locked .slot-title { color: var(--ink-3); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .slot.is-filled:hover .slot-frame .plate { box-shadow: var(--shadow-lift); }
  .slot.is-filled:hover .slot-dog { transform: rotate(-3deg) translateY(-3px); }
  .slot-frame .plate, .slot-dog { transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out); }
}

/* ---------- Настройка партии ---------- */

.setup {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px); align-items: start;
  padding-top: clamp(12px, 3vw, 36px);
}
.setup-intro h1 { font-size: clamp(38px, 5vw, 68px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.setup-intro p { margin-top: 16px; color: var(--ink-2); font-size: 19px; max-width: 36ch; }
.setup-intro .mode-scene { margin-top: 28px; max-width: 460px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-weight: 600; text-decoration: none; color: var(--ink-2); margin-bottom: 12px;
}
.back-link svg { width: 18px; height: 18px; }

.setup-form {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sticker);
  padding: clamp(20px, 3vw, 34px);
  display: grid; gap: 28px;
}
.field-label { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.field-hint { color: var(--ink-2); font-size: 15px; margin-top: 2px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 56px; min-height: 48px; padding: 0 16px;
  border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--paper-edge);
  font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms var(--ease-out);
}
.seg span small { font-weight: 500; color: var(--ink-2); font-size: 14px; }
.seg input:checked + span { background: var(--ink); color: var(--paper); box-shadow: none; }
.seg input:checked + span small { color: rgba(253, 250, 229, 0.75); }
.seg input:focus-visible + span { outline: 3px solid var(--leash); outline-offset: 2px; }
.seg label:active span { transform: scale(0.96); }

.names { display: grid; gap: 10px; margin-top: 14px; }
.name-row { display: flex; align-items: center; gap: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--c, var(--leash)); }
.name-row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--paper-edge); border-radius: 10px; background: var(--paper);
  font-weight: 600; font-size: 17px;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.name-row input:focus { outline: none; border-color: var(--ink); background: var(--white); }
.setup-go { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Игровой экран ---------- */

.game {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  height: 100dvh; max-width: 1400px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) clamp(10px, 2.4vw, 28px) calc(10px + env(safe-area-inset-bottom));
  gap: 10px;
}
.game-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 48px; }
.game-bar h1 { font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; letter-spacing: -0.015em; text-align: center; }
.game-bar .stat { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); text-align: right; }
.bar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 64px; }
.bar-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px 0 10px; border: 0; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-2); font-weight: 600; font-size: 15px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
.bar-toggle svg { width: 20px; height: 20px; }
.bar-toggle[aria-pressed="true"] { background: var(--leash-wash); color: var(--leash); }
.bar-toggle:active { transform: scale(0.97); }

/* настройки показа */
.opt-list { display: grid; gap: 14px; margin-top: 12px; }
.opt-row .field-hint { margin-top: 2px; padding-left: 60px; max-width: 46ch; }
.pop-wrap { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  width: min(340px, calc(100vw - 24px));
  background: var(--white); border-radius: 14px; padding: 16px;
  box-shadow: 0 2px 4px rgba(70, 45, 20, 0.12), 0 18px 40px -12px rgba(70, 45, 20, 0.4);
  transform-origin: top right;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), display 160ms allow-discrete;
}
.popover .opt-list { margin-top: 0; }
@starting-style { .popover:not([hidden]) { opacity: 0; transform: scale(0.96); } }
.popover[hidden] { display: none; }

/* лупа */
.opt { position: relative; min-height: 0; min-width: 0; }
.opt > .option, .opt > .target { width: 100%; height: 100%; }
.loupe {
  position: absolute; right: 8px; bottom: 8px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center;
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 2px rgba(70, 45, 20, 0.2), 0 6px 14px -6px rgba(70, 45, 20, 0.45);
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.loupe::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.loupe svg { width: 20px; height: 20px; }
.loupe:active { transform: scale(0.94); }
.plate.is-zoomable { cursor: zoom-in; }
.plate.is-zoomable > .loupe { right: -10px; bottom: -10px; }
.prompt-art > .loupe { right: 4%; bottom: 4%; }
@media (hover: hover) and (pointer: fine) {
  .loupe:hover { background: var(--leash); color: var(--white); }
  .bar-toggle:hover { background: var(--paper-edge); }
}

/* просмотр во весь экран */
.no-scroll { overflow: hidden; }
.zoom {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(33, 27, 23, 0.92);
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden; touch-action: none;
}
.zoom-stage { position: relative; min-height: 0; }
/* картинка вписывается в окно любой высоты: абсолютное позиционирование с отступами */
.zoom-img {
  position: absolute; inset: 64px 16px 8px; margin: auto;
  max-width: calc(100% - 32px); max-height: calc(100% - 72px);
  width: auto; height: auto; object-fit: contain;
  cursor: zoom-in; user-select: none; -webkit-user-drag: none; touch-action: none;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}
.zoom-img.sticker { box-shadow: none; }
/* картина с окошком в просмотре: блок с пропорциями картины, вписанный в сцену */
.zoom-stage { container-type: size; }
.zoom-art {
  width: min(100cqw - 32px, (100cqh - 72px) * var(--ar));
  height: min(100cqh - 72px, (100cqw - 32px) / var(--ar));
  max-width: none; max-height: none; overflow: hidden; background: var(--paper-deep);
}
.zoom-art > img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.zoom-art .hole { border-width: 2px; border-radius: 10px; }
.zoom.is-zoomed .zoom-img { cursor: grab; }
.zoom-hint { text-align: center; color: rgba(253, 250, 229, 0.75); font-size: 14px; padding: 6px 16px calc(14px + env(safe-area-inset-bottom)); }
.zoom-close {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px;
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--paper); color: var(--ink);
  transition: transform 160ms var(--ease-out);
}
.zoom-close svg { width: 22px; height: 22px; }
.zoom-close:active { transform: scale(0.94); }

/* крупный план в мемори */
.peek {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(33, 27, 23, 0.55);
  display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  cursor: pointer;
}
.peek-row { min-height: 0; display: flex; gap: 16px; align-items: center; justify-content: center; }
.peek-card {
  position: relative; flex: none;
  width: min(46vw, 760px); height: min(100%, 720px);
  background: var(--white); border-radius: 16px;
  box-shadow: 0 30px 60px -24px rgba(20, 12, 6, 0.55);
}
.peek[data-count="1"] .peek-card { width: min(92vw, 1040px); }
.peek-card > .fit { position: absolute; inset: clamp(14px, 4%, 32px); width: auto; height: auto; }
.peek-dog { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; transition: opacity 300ms ease, filter 300ms ease; }
.peek-dog.is-left { opacity: 0.16; filter: grayscale(1); }
.peek-card .plate .stuck { width: 40%; height: 40%; right: -8%; bottom: -8%; }
.peek-msg {
  justify-self: center; max-width: 760px; width: 100%;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px;
  background: var(--paper); border-radius: 16px; padding: 12px 16px; text-align: center;
  cursor: default;
}
.peek-note { display: grid; gap: 2px; font-size: 16px; }
.peek-yes { color: var(--leash); font-size: 18px; }
.peek-msg { position: relative; overflow: hidden; }
.peek-timer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--leash); opacity: 0.55; transform-origin: left center;
}
@media (max-aspect-ratio: 1/1) {
  .peek-row { flex-direction: column; }
  .peek-card { width: min(100%, 560px); height: calc(50% - 8px); }
  .peek[data-count="1"] .peek-card { height: min(100%, 640px); }
}
.exit {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px 0 10px; border: 0; border-radius: 999px;
  background: var(--paper-deep); font-weight: 600; font-size: 15px;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
.exit svg { width: 18px; height: 18px; }
.exit:active { transform: scale(0.97); }
.exit.is-confirm { background: var(--leash); color: var(--white); }

.players { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.player {
  --c: var(--leash);
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 4px 14px 4px 10px;
  border-radius: 999px; background: var(--paper-deep);
  font-weight: 600; font-size: 15px;
  transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.player b { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 800; min-width: 1ch; }
.player .dot { width: 10px; height: 10px; box-shadow: none; }
.player.is-active { background: var(--c); color: var(--white); box-shadow: 0 6px 14px -8px var(--c); }
.player.is-active .dot { background: var(--white); }
.solo-stats { display: flex; gap: 18px; justify-content: center; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.solo-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }

.caption-bar {
  min-height: 64px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 6px 8px;
}
.caption-bar .hint { color: var(--ink-2); font-size: 15px; }
.caption-line { display: grid; gap: 2px; animation: rise 320ms var(--ease-out); }
.caption-line strong { font-size: 16px; font-weight: 800; }
.caption-line span { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }

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

/* ---------- Мемори ---------- */

.board-wrap { position: relative; min-height: 0; min-width: 0; height: 100%; display: grid; place-items: center; overflow: hidden; }
.board {
  display: flex; flex-wrap: wrap; gap: var(--gap, 10px);
  justify-content: center; align-content: center;
  width: calc(var(--cols, 4) * var(--size, 120px) + (var(--cols, 4) - 1) * var(--gap, 10px));
}
.board .card { flex: none; width: var(--size, 120px); height: var(--card-h, var(--size, 120px)); }

.card {
  position: relative; padding: 0; border: 0; background: none;
  perspective: 900px; border-radius: var(--radius);
  transition: transform 160ms var(--ease-out);
  touch-action: manipulation;
}
.card:active:not(:disabled) { transform: scale(0.96); }
.card:disabled { cursor: default; }
.card-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 300ms var(--ease-flip);
}
.card.is-up .card-inner { transform: rotateY(180deg); }
.card.is-closing .card-inner { transition-duration: 220ms; }
.face {
  position: absolute; inset: 0; border-radius: var(--radius);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.face-back {
  background: var(--white) url("../assets/ui/paws.webp") center / cover;
  border: clamp(2px, calc(var(--size, 120px) * 0.035), 5px) solid var(--white);
  box-shadow: var(--shadow-sticker);
  transition: box-shadow 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.face-front {
  transform: rotateY(180deg);
  background: var(--white);
  box-shadow: var(--shadow-sticker);
  display: grid; place-items: center;
}
.face-front .dog { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.face-front .art { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain;
  filter: drop-shadow(0 1px 1.5px rgba(70, 45, 20, 0.25)); }
@media (hover: hover) and (pointer: fine) {
  .card:not(.is-up):not(:disabled):hover .face-back { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
}

/* пара найдена: собака вклеена в свою картину, её место пустеет */
.card .card-inner { transition: transform 300ms var(--ease-flip), opacity 220ms ease; }
.card.is-empty .card-inner { opacity: 0; }
.card.is-empty::after {
  content: attr(data-num); position: absolute; inset: 6%;
  padding: 4px 7px; text-align: left;
  font-size: 12px; font-weight: 700; color: var(--leash); font-variant-numeric: tabular-nums;
  border: 1.5px solid rgba(150, 34, 36, 0.35); border-radius: var(--radius);
  animation: fade-in 260ms var(--ease-out);
}
.card.is-done .face-front { box-shadow: var(--shadow-flat), inset 0 0 0 3px var(--c, var(--leash)); }
.card .stuck {
  position: absolute; right: 3%; bottom: 3%;
  width: 44%; height: 44%; object-fit: contain; object-position: 100% 100%;
  transform: rotate(-7deg); z-index: 2; pointer-events: none;
}
.card.is-done { cursor: zoom-in; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* летящая наклейка */
.flyer {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  object-fit: contain; transform-origin: 0 0; will-change: transform;
}

/* ---------- Викторины ---------- */

.quiz {
  min-height: 0; height: 100%;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); grid-template-rows: minmax(0, 1fr);
  gap: clamp(14px, 3vw, 40px);
}
.prompt { min-height: 0; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.prompt h2 { font-size: clamp(22px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; }
.prompt-art { position: relative; min-height: 0; height: 100%; display: grid; place-items: center; padding: 0 6% 6% 0; }
.prompt-art .dog-big {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: opacity 300ms ease, filter 300ms ease;
}
.prompt-art .dog-big.is-left { opacity: 0.16; filter: grayscale(1); }

.options {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px); min-height: 0; height: 100%;
}
.option {
  position: relative; display: block;
  width: 100%; height: 100%; min-height: 0;
  border: 1.5px solid rgba(150, 34, 36, 0.4); border-radius: 12px;
  background: var(--paper); padding: 0;
  transition: transform 180ms var(--ease-out), border-color 180ms ease, background-color 180ms ease, opacity 200ms ease;
}
.option:active:not(:disabled) { transform: scale(0.97); }
.option > .fit { position: absolute; inset: max(11%, 26px) 11% 11%; width: auto; height: auto; }
.option > img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; transition: opacity 300ms ease; }
.option > img.is-left { opacity: 0.16; filter: grayscale(1); }
.option.is-right { border-color: var(--leash); background: var(--white); box-shadow: inset 0 0 0 2px var(--leash); }
.option.is-wrong { opacity: 0.45; animation: nope 260ms var(--ease-out); }
.option:disabled { cursor: default; }
.option .mark {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--leash); color: var(--white);
  animation: pop 260ms var(--ease-out);
}
.option .mark svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
  .option:not(:disabled):hover { border-color: var(--leash); background: var(--white); }
}
@keyframes nope {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  60% { transform: translateX(5px); }
}
@keyframes pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }

.next-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; min-height: 64px; }
.next-row .caption-line { text-align: left; }

/* ---------- Все по местам ---------- */

.match { min-height: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(10px, 2vw, 22px); }
.match-paintings, .match-dogs {
  min-height: 0; display: grid; gap: clamp(8px, 1.4vw, 16px);
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr));
}
.match-dogs {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sticker);
  padding: clamp(8px, 1.4vw, 16px);
}
.target {
  position: relative; display: block;
  min-height: 0; height: 100%; padding: 0;
  border: 1.5px solid rgba(150, 34, 36, 0.4); border-radius: 12px; background: var(--paper);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--ease-out);
}
.target > .fit { position: absolute; inset: 26px 14px 14px 12px; width: auto; height: auto; }
.target.is-hot { border-color: var(--leash); background: var(--white); box-shadow: inset 0 0 0 1px var(--leash); }
.target.is-done { border-color: rgba(150, 34, 36, 0.2); background: var(--paper-deep); }
.target.is-wrong { animation: nope 260ms var(--ease-out); }
.target:active:not(:disabled) { transform: scale(0.98); }

.pup {
  position: relative; display: block;
  min-height: 0; height: 100%; padding: 0;
  border: 0; border-radius: 12px; background: transparent;
  touch-action: none;
  transition: transform 180ms var(--ease-out), background-color 160ms ease, opacity 200ms ease;
}
.pup img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.pup.is-picked { background: var(--leash-wash); transform: translateY(-4px) rotate(-3deg); }
.pup.is-gone { opacity: 0; pointer-events: none; }
.pup.is-dragging { opacity: 0.25; }
.drag-ghost { position: fixed; z-index: 70; pointer-events: none; left: 0; top: 0; transform-origin: 50% 50%; will-change: transform; }
.drag-ghost img { width: 100%; height: 100%; object-fit: contain; }
@media (hover: hover) and (pointer: fine) {
  .pup:not(.is-gone):hover { background: var(--leash-wash); }
  .target:hover { border-color: var(--leash); }
}

.nest-num {
  position: absolute; left: 9px; top: 6px; z-index: 1;
  font-size: 13px; font-weight: 700; color: var(--leash); font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ---------- Альбом ---------- */

.album-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; padding-top: clamp(8px, 2vw, 24px); }
.album-head h1 { font-size: clamp(40px, 6vw, 80px); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; }
.album-head p { color: var(--ink-2); font-size: 18px; margin-top: 12px; max-width: 46ch; }
.progress { margin-top: 18px; width: min(100%, 420px); }
.progress-track { height: 10px; border-radius: 999px; background: var(--paper-deep); box-shadow: inset 0 0 0 1px var(--paper-edge); overflow: hidden; }
.progress-fill { height: 100%; width: calc(var(--v, 0) * 100%); background: var(--leash); border-radius: inherit; transition: width 600ms var(--ease-out); }
.progress-label { margin-top: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }

.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 48px; height: 28px; border-radius: 999px; background: var(--paper-edge); position: relative; cursor: pointer; transition: background-color 200ms ease; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 220ms var(--ease-out); }
.switch input:checked { background: var(--leash); }
.switch input:checked::after { transform: translateX(20px); }

.era { margin-top: clamp(36px, 5vw, 64px); }
.era-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1.5px solid var(--paper-edge); }
.era-head h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -0.02em; }
.era-head span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slots { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 15vw, 176px), 1fr)); gap: clamp(18px, 2.4vw, 30px) clamp(14px, 2vw, 24px); }

.hold {
  position: relative; overflow: hidden; isolation: isolate;
  border: 0; border-radius: 999px; min-height: 44px; padding: 0 18px;
  background: var(--paper-deep); color: var(--ink-2); font-weight: 600;
  transition: transform 160ms var(--ease-out);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.hold:active { transform: scale(0.97); }
.hold::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--leash);
  clip-path: inset(0 100% 0 0); transition: clip-path 200ms var(--ease-out);
}
.hold.is-holding::before { clip-path: inset(0 0 0 0); transition: clip-path 1.6s linear; }
.hold.is-holding { color: var(--white); }

/* ---------- Лист (диалог) ---------- */

.sheet {
  width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 18px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(40, 25, 10, 0.45);
  overflow: auto;
  opacity: 1; transform: none;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), overlay 220ms allow-discrete, display 220ms allow-discrete;
}
.sheet::backdrop { background: rgba(33, 27, 23, 0.5); transition: opacity 220ms ease, overlay 220ms allow-discrete, display 220ms allow-discrete; }
@starting-style {
  .sheet[open] { opacity: 0; transform: scale(0.96) translateY(8px); }
  .sheet[open]::backdrop { opacity: 0; }
}
.sheet:not([open]) { opacity: 0; transform: scale(0.98); }
.sheet-close {
  position: sticky; top: 10px; margin: 10px 10px -54px auto; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--paper-deep); display: grid; place-items: center;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.sheet-close:active { transform: scale(0.94); }
.sheet-close svg { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .sheet-close:hover { background: var(--paper-edge); } }

.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); padding: clamp(18px, 3vw, 36px); align-items: center; }
.detail-art { position: relative; display: grid; place-items: center; min-height: 0; }
.detail-art { height: min(68dvh, 620px); width: 100%; }
.detail-text { display: grid; gap: 18px; justify-items: center; text-align: center; }
.detail-dog { width: min(70%, 240px); height: auto; max-height: 30dvh; object-fit: contain; }
.label-card { display: grid; gap: 4px; justify-items: center; }
.label-card h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; }
.label-card .author { font-weight: 700; font-size: 17px; }
.label-card .place { color: var(--ink-2); font-size: 16px; text-wrap: balance; }
.label-card hr { width: 64px; border: 0; border-top: 1.5px solid var(--ink-3); margin: 10px 0; opacity: 0.6; }
.label-card .date { font-size: 15px; font-variant-numeric: tabular-nums; }
.age-badge {
  display: inline-flex; align-items: baseline; gap: 6px; margin-top: 6px;
  background: var(--white); border-radius: 999px; padding: 6px 14px; box-shadow: var(--shadow-sticker);
  font-weight: 600; font-size: 15px;
}
.age-badge b { color: var(--leash); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.detail-nav { display: flex; gap: 10px; justify-content: center; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--paper-deep);
  display: grid; place-items: center;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .icon-btn:not(:disabled):hover { background: var(--paper-edge); } }

.result { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(16px, 3vw, 36px); padding: clamp(20px, 3.4vw, 40px); }
.result-art img { width: 100%; max-width: 320px; height: auto; margin-inline: auto; }
.result h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; text-wrap: balance; }
.result-sub { margin-top: 10px; color: var(--ink-2); font-size: 18px; }
.scores { margin-top: 20px; display: grid; gap: 8px; }
.score-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--white); border-radius: 12px; box-shadow: var(--shadow-flat); font-weight: 600; }
.score-row b { margin-left: auto; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-row.is-win { box-shadow: inset 0 0 0 2px var(--c); }
.score-row .crown { color: var(--c); font-size: 13px; font-weight: 700; }
.new-stickers { margin-top: 18px; }
.new-stickers p { font-weight: 700; }
.new-stickers .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.new-stickers img { width: 52px; height: 52px; object-fit: contain; animation: pop 300ms var(--ease-out) backwards; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Правила ---------- */

.rules { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr); gap: clamp(24px, 5vw, 72px); padding-top: clamp(8px, 2vw, 28px); }
.rules h1 { font-size: clamp(40px, 6vw, 80px); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; }
.rules .lead { margin-top: 18px; font-size: 20px; color: var(--ink-2); max-width: 40ch; }
.rule { margin-top: clamp(32px, 4vw, 48px); max-width: 64ch; }
.rule h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.015em; display: flex; gap: 12px; align-items: baseline; }
.rule p, .rule li { color: var(--ink-2); font-size: 18px; line-height: 1.6; }
.rule p { margin-top: 10px; }
.rule ul { margin: 10px 0 0; padding-left: 22px; }
.rule li + li { margin-top: 6px; }
.rules-art { position: sticky; top: 24px; align-self: start; }
.rules-art img { width: 100%; max-width: 380px; height: auto; margin-inline: auto; }

.play-cta {
  margin-top: clamp(48px, 7vw, 88px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.play-cta p { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; letter-spacing: -0.015em; }
.play-cta { padding-top: 28px; border-top: 1.5px solid var(--paper-edge); }

.empty-note { padding: 80px 0; text-align: center; }
.empty-note h1 { font-size: 40px; font-weight: 800; }
.empty-note p { margin: 12px 0 24px; color: var(--ink-2); }

/* ---------- Настольная версия ---------- */

.site-nav .nav-shop { color: var(--leash); gap: 0; }

/* веер карточек из печатного макета */
.card-fan { position: relative; aspect-ratio: 1.5; width: 100%; }
.fan-card {
  position: absolute; top: 14%; left: 30%;
  width: 40%; aspect-ratio: 1;
  background: var(--paper);
  border: clamp(3px, 0.6vw, 6px) solid var(--white); border-radius: clamp(8px, 1.2vw, 14px);
  box-shadow: var(--shadow-sticker), 0 18px 30px -18px rgba(70, 45, 20, 0.45);
  overflow: hidden;
  transform-origin: 50% 120%;
  transition: transform 260ms var(--ease-out);
}
.fan-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fan-back { background: var(--white) url("../assets/ui/paws.webp") center / cover; }
.fan-card:nth-child(1) { transform: translate(-72%, 8%) rotate(-14deg); }
.fan-card:nth-child(2) { transform: translate(-38%, -2%) rotate(-7deg); }
.fan-card:nth-child(3) { transform: translate(-4%, -6%) rotate(-1deg); }
.fan-card:nth-child(4) { transform: translate(34%, -3%) rotate(6deg); }
.fan-card:nth-child(5) { transform: translate(70%, 6%) rotate(13deg); }
@media (hover: hover) and (pointer: fine) {
  .shop-hero-art:hover .fan-card:nth-child(1) { transform: translate(-78%, 10%) rotate(-17deg); }
  .shop-hero-art:hover .fan-card:nth-child(2) { transform: translate(-42%, -3%) rotate(-9deg); }
  .shop-hero-art:hover .fan-card:nth-child(3) { transform: translate(-4%, -10%) rotate(-1deg); }
  .shop-hero-art:hover .fan-card:nth-child(4) { transform: translate(38%, -4%) rotate(8deg); }
  .shop-hero-art:hover .fan-card:nth-child(5) { transform: translate(76%, 8%) rotate(16deg); }
}

.shop-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: clamp(16px, 4vw, 56px);
  padding-top: clamp(8px, 3vw, 40px);
}
.shop-hero h1 {
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 0.98; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance;
}
.shop-hero h1 em { font-style: normal; color: var(--leash); }
.shop-price { margin-top: 22px; font-size: 18px; color: var(--ink-2); }
.shop-price b { font-size: clamp(28px, 3vw, 36px); font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.shop-hero .hero-actions { margin-top: 18px; }
.shop-note { margin-top: 14px; font-size: 15px; color: var(--ink-3); }
.buy-wrap { display: flex; flex-direction: column; gap: 8px; }
.shop-soon {
  font-size: 15px; color: var(--leash); font-weight: 600;
  animation: fade-in 200ms var(--ease-out);
}
.shop-hero-art { padding: 4% 6%; }

.shop-book, .shop-box, .shop-final, .shop-teaser { margin-top: clamp(48px, 7vw, 96px); }
.shop-head { max-width: 62ch; }
.shop-book h2, .shop-box h2, .shop-final h2 {
  font-size: clamp(26px, 3vw, 38px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance;
}
.shop-head p, .shop-final p { margin-top: 12px; color: var(--ink-2); font-size: 18px; text-wrap: pretty; }

/* лента книжки: прокручивается вбок, справа уходит за край */
.book-strip {
  margin-top: 24px;
  overflow-x: auto; overscroll-behavior-x: contain;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sticker);
  padding: 12px;
  scrollbar-width: thin;
}
.book-strip img {
  display: block; height: clamp(220px, 30vw, 400px); width: auto; max-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
  mask-image: linear-gradient(to right, #000 88%, transparent);
  user-select: none; -webkit-user-drag: none;
}
.book-caption { margin-top: 10px; font-size: 15px; color: var(--ink-3); }

.box-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.box-item {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sticker);
  padding: 18px 18px 22px;
}
.box-art {
  aspect-ratio: 4 / 3; border-radius: 10px; background: var(--paper);
  border: 1.5px solid rgba(150, 34, 36, 0.45);
  overflow: hidden; display: grid; place-items: center;
}
.box-art--cards .card-fan { width: 92%; }
.box-art--book img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; }
.box-art--play img { width: 78%; height: auto; }
.box-item h3 { margin-top: 16px; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.box-item p { margin-top: 6px; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.shop-specs {
  margin-top: 24px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px;
  font-size: 17px;
}
.shop-specs dt { color: var(--ink-3); }
.shop-specs dd { font-weight: 600; }

.shop-final {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-top: clamp(24px, 3vw, 36px); padding-bottom: clamp(24px, 3vw, 36px);
  border-top: 1.5px solid var(--paper-edge); border-bottom: 1.5px solid var(--paper-edge);
}
.shop-final > div { max-width: 52ch; }

/* тизер на главной */
.shop-teaser-card {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(16px, 4vw, 48px);
  padding: clamp(16px, 2.4vw, 28px);
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sticker);
  text-decoration: none; color: inherit;
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.shop-teaser-card:active { transform: scale(0.99); }
.shop-teaser-card .card-fan { max-width: 360px; justify-self: center; }
.shop-teaser h2 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.shop-teaser p { margin-top: 10px; color: var(--ink-2); font-size: 18px; max-width: 40ch; }
@media (hover: hover) and (pointer: fine) {
  .shop-teaser-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
  .shop-teaser-card:hover .mode-go svg { transform: translateX(4px); }
}

/* ---------- Адаптив ---------- */

@media (max-width: 1080px) {
  .modes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; justify-self: center; width: min(88%, 440px); margin-bottom: -8px; }
  .setup, .about, .rules { grid-template-columns: 1fr; }
  .shop-hero { grid-template-columns: minmax(0, 1fr); }
  .shop-hero-art { order: -1; width: min(100%, 460px); justify-self: center; padding: 2% 8% 0; }
  .box-grid { grid-template-columns: minmax(0, 1fr); }
  .box-art { aspect-ratio: 16 / 7; }
  .box-art--play img { width: auto; height: 86%; }
  .shop-teaser-card { grid-template-columns: 1fr; }
  .shop-teaser-card .card-fan { max-width: 300px; }
  .setup-intro .mode-scene { display: none; }
  .rules-art { position: static; order: -1; }
  .rules-art img { max-width: 240px; }
  .about-art { order: -1; }
  .about-art img { max-width: 260px; }
  .quiz { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .detail { grid-template-columns: 1fr; }
  .detail-art { height: 42dvh; }
  .result { grid-template-columns: 1fr; text-align: center; }
  .result-art img { max-width: 200px; }
  .result-actions, .scores { justify-content: center; }
  .new-stickers .row { justify-content: center; }
}

@media (min-width: 900px) and (min-aspect-ratio: 3/2) {
  .match-dogs {
    grid-template-columns: repeat(var(--cols-wide, 3), minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows-wide, 2), minmax(0, 1fr));
  }
  .match { grid-template-rows: minmax(0, 2.4fr) minmax(0, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header { padding-top: 12px; gap: 8px; }
  .brand img { width: 96px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 0 8px; font-size: 14px; gap: 6px; white-space: nowrap; }
  .nav-count { font-size: 12px; padding: 0 6px; }
  .nav-long { display: none; }
  .modes-grid { grid-template-columns: 1fr; }
  .mode { display: grid; grid-template-columns: 40% minmax(0, 1fr); column-gap: 14px; padding: 12px; align-items: center; }
  .mode-scene { grid-row: span 3; }
  .match { grid-template-rows: minmax(0, 1.7fr) minmax(0, 1fr); }
  .match-paintings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows-2, 3), minmax(0, 1fr));
  }
  .target > .fit { inset: 24px 12px 10px 10px; }
  .detail { gap: 10px; padding-top: 52px; }
  .detail-art { height: 36dvh; }
  .detail-text { gap: 10px; }
  .detail-dog { max-height: 16dvh; width: auto; }
  .detail-nav {
    position: sticky; bottom: 0; margin: 0 -18px -18px; padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--paper) 70%, rgba(253, 250, 229, 0));
    width: calc(100% + 36px);
  }
  .mode h2 { margin-top: 0; font-size: 20px; }
  .mode p { font-size: 15px; }
  .mode-go { padding-top: 6px; margin-top: 0; }
  .hero h1 { font-size: clamp(38px, 11vw, 54px); }
  .hero-actions .btn { flex: 1 1 auto; }
  .game { gap: 6px; }
  .game-bar h1 { font-size: 17px; }
  .exit span, .bar-toggle span { display: none; }
  .bar-toggle { padding: 0 12px; }
  .bar-tools { min-width: 44px; gap: 6px; }
  .exit { padding: 0 12px; }
  .player { padding: 2px 12px 2px 8px; font-size: 14px; min-height: 38px; }
  .caption-bar { min-height: 56px; }
  .caption-line strong { font-size: 15px; }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* узкие телефоны: четыре пункта меню должны поместиться рядом с логотипом */
@media (max-width: 430px) {
  .brand img { width: 80px; }
  .site-nav a { padding: 0 6px; }
  .nav-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .card-inner { transition: none; }
  .card .face { transition: opacity 150ms ease; }
  .mode, .slot, .btn, .option, .target, .pup { transition-property: background-color, color, opacity, box-shadow, border-color; }
  .option.is-wrong, .target.is-wrong { animation: none; }
  .caption-line { animation: fade-in 200ms ease; }
  .sheet { transition: opacity 150ms ease; transform: none !important; }
}

.stage { min-height: 0; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
