/* «Что готовим» — три игрушки вместо фото с рваными краями:
   01 чуду режется пальцем, 02 хинкал макается в соус, 03 стол собирается под число гостей.
   Всё в координатах исходных фото 900×1200: left = x/9 %, top = y/12 %. Анимации — play.js (Motion). */

.plays .terrace { align-items: center; }
.play { position: relative; margin: 0; aspect-ratio: 3 / 4; border-radius: 30px; overflow: hidden; isolation: isolate;
  box-shadow: 0 30px 60px -30px rgb(34 28 26 / .55), 0 0 0 1px rgb(201 149 76 / .35), inset 0 0 0 8px rgb(244 236 223 / .08);
  user-select: none; -webkit-user-select: none; background: #7c1824; }
.play::after { content: ""; position: absolute; inset: 10px; border-radius: 22px; pointer-events: none; z-index: 20;
  border: 1.5px solid rgb(243 217 176 / .55); box-shadow: inset 0 0 60px rgb(40 8 12 / .35); }
.play__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play__hint { position: absolute; left: 50%; bottom: 22px; z-index: 21; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px; border-radius: 999px; background: rgb(29 36 39 / .78); color: #f4ecdf; font: 500 14px/1.2 var(--body);
  white-space: nowrap; backdrop-filter: blur(6px); pointer-events: none; transition: opacity .4s; }
.play.is-used .play__hint { opacity: 0; }
.play__hand { width: 22px; height: 22px; border-radius: 50%; background: #f3d9b0; box-shadow: 0 0 0 5px rgb(243 217 176 / .25); }
.play__buy { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.play__buy b { font: 700 26px/1 var(--disp); color: var(--garnet); }
.btn--sm { padding: 12px 20px; font-size: 15px; }
.play__count { margin-top: 12px; font-weight: 500; color: var(--garnet); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- 01. чуду: три карточки-арки, переворачиваются ---------- */
.terrace--tales { grid-template-columns: 1fr !important; margin-left: 0 !important; gap: 26px; }
.terrace--tales .terrace__text { max-width: 720px; }
.tales__hint { margin-top: 10px; font-weight: 500; color: var(--garnet); }
.tales { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1040px; width: 100%; margin: 0 auto; gap: clamp(14px, 2.5vw, 30px); perspective: 1400px; }
.tale { position: relative; aspect-ratio: 3 / 4.1; cursor: pointer; outline: none; transform: rotate(var(--tilt, 0deg)); }
.tale:focus-visible .tale__in { box-shadow: 0 0 0 3px var(--gold); }
.tale__in { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; border-radius: 999px 999px 26px 26px; }
.tale__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 999px 999px 26px 26px;
  display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden;
  box-shadow: 0 26px 44px -26px rgb(34 28 26 / .6), inset 0 0 0 1px rgb(201 149 76 / .45); }
/* лицо: бордовая арка с орнаментной рамкой, тарелка «выглядывает» из арки */
.tale__front { background: radial-gradient(90% 60% at 50% 30%, #a3283a, var(--garnet) 60%, #6a1220); color: #f4ecdf; padding: 10% 8% 8%; }
.tale__front::before { content: ""; position: absolute; inset: 10px; border-radius: 999px 999px 18px 18px; pointer-events: none;
  border: 1.5px dashed rgb(243 217 176 / .6); }
.tale__plate { width: 84%; aspect-ratio: 1; margin-top: 4%; }
.tale__plate img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 16px rgb(0 0 0 / .45)); }
.tale__name { margin-top: auto; font: 700 clamp(20px, 2.2vw, 28px)/1.1 var(--disp); color: #f3d9b0; }
.tale__sub { font-size: 14px; opacity: .8; margin-top: 4px; }
.tale__turn { margin-top: 12px; padding: 7px 14px; border-radius: 999px; background: rgb(243 217 176 / .16); font: 500 13px/1 var(--body);
  letter-spacing: .08em; text-transform: uppercase; }
.tale__turn i { display: inline-block; font-style: normal; margin-left: 4px; }
/* оборот: лён, орнамент сверху, их текст */
.tale__back { transform: rotateY(180deg); background: #fbf6ec; color: var(--ink); padding: 16% 9% 8%; justify-content: flex-start; }
.tale__orn { width: 60%; height: 16px; flex: none; margin-bottom: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='16'%3E%3Cpath d='M14 1 26 8 14 15 2 8Z' fill='none' stroke='%238c1c2b' stroke-width='1.6'/%3E%3Cpath d='M14 5 19 8 14 11 9 8Z' fill='%23c9954c'/%3E%3C/svg%3E") center / auto 100% repeat-x; }
.terrace .tale__text { max-width: none; font-size: clamp(14px, 1.25vw, 16px); line-height: 1.5; color: #3d3430; }
.tale__text .w { display: inline-block; }
.tale__sizes { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding-top: 8px; }
.tale__sizes:first-of-type { margin-top: auto; }
.tale__sizes .chip { padding: 8px 12px; font-size: 13px; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px #e2d6c3; }
.tale__sizes .chip.is-on { background: var(--garnet); color: #fff; box-shadow: none; }
.terrace .tale__buy { max-width: none; font-size: inherit; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tale__price { font: 700 22px/1 var(--disp); color: var(--garnet); }
.tales__foot { font: 400 clamp(18px, 2vw, 24px)/1.4 var(--disp); color: var(--slate); max-width: 760px; }
.tales__foot span { display: block; margin-top: 4px; font: 500 12px/1 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
@media (hover: hover) {
  .tale:hover .tale__turn i { transform: rotate(180deg); transition: transform .5s; }
}
/* телефон: карточки лентой со свайпом */
@media (max-width: 760px) {
  .tales { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 14px 16px 30px; margin: 0 calc(var(--pad) * -1);
    scrollbar-width: none; }
  .tales::-webkit-scrollbar { display: none; }
  .tale { flex: 0 0 80%; scroll-snap-align: center; aspect-ratio: 3 / 4.9; }
  .tale__back { padding: 13% 7% 7%; }
  .terrace .tale__text { font-size: 14px; line-height: 1.45; }
  .tale__sizes .chip { padding: 7px 10px; }
}

/* ---------- 02. хинкал ---------- */
.pieces { position: absolute; inset: 0; z-index: 3; }
.piece { position: absolute; display: block; touch-action: none; cursor: grab; will-change: transform;
  filter: drop-shadow(0 8px 8px rgb(60 40 20 / .28)); }
.piece:active { cursor: grabbing; }
.piece img { width: 100%; height: auto; display: block; transform: rotate(var(--r, 0deg)); pointer-events: none; }
.piece.is-drag { z-index: 10; filter: drop-shadow(0 22px 18px rgb(60 40 20 / .38)); }
/* обмакнутый кусочек: снизу красный соус */
.piece::after { content: ""; position: absolute; inset: 40% 8% 4%; border-radius: 45%; opacity: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 80%, rgb(190 40 24 / .85), rgb(190 40 24 / .35) 55%, transparent 75%); mix-blend-mode: multiply; }
.piece.is-dipped::after { opacity: 1; transition: opacity .25s; }
.sauce { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.sauce ellipse { fill: none; stroke: rgb(255 214 190 / .85); stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.hinkal__steam { inset: 1% 5% 72% 55%; z-index: 2; }
.play__done { position: absolute; inset: auto 16px 16px; z-index: 22; display: grid; gap: 6px; justify-items: center; text-align: center;
  padding: 18px; border-radius: 22px; background: rgb(29 36 39 / .86); color: #f4ecdf; backdrop-filter: blur(8px); }
.play__done[hidden] { display: none; }
.play__done b { font: 700 24px/1.1 var(--disp); color: #f3d9b0; }
.play__done-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.play__done .btn--ghost { color: #f4ecdf; }

/* ---------- 03. стол ---------- */
.terrace--feast { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
.feast { position: relative; aspect-ratio: 10 / 7; }
.feast__rug { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 30px 40px rgb(34 28 26 / .35)); }
.feast__field { fill: var(--garnet); }
.feast__stitch { fill: none; stroke: #f3d9b0; stroke-width: 3; stroke-dasharray: 10 7; }
.feast__stitch--2 { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 3 6; }
.feast__plates { position: absolute; inset: 9% 7%; }
.fplate { position: absolute; width: 23%; aspect-ratio: 1; transform: translate(-50%, -50%); will-change: transform; }
.fplate img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 10px rgb(0 0 0 / .4)); }
.fplate__n { position: absolute; right: 2%; top: 4%; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center;
  background: #f3d9b0; color: var(--garnet); font: 700 15px/1 var(--body); box-shadow: 0 4px 10px rgb(0 0 0 / .35); }
.fplate__n:empty { display: none; }
.feast__people { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 8px;
  padding: 8px 18px; border-radius: 999px; background: var(--slate); color: #f4ecdf; white-space: nowrap; z-index: 3; }
.feast__people span { color: #f4ecdf; opacity: .85; }
.feast__people b { font: 800 26px/1 var(--stone); color: #f3d9b0; }
.feast__range { display: block; margin-top: 18px; }
.feast__range input { width: 100%; accent-color: var(--garnet); height: 34px; }
.feast__list { margin-top: 8px; color: var(--muted); font-size: 16px; min-height: 3em; }

@media (max-width: 900px) {
  .terrace--feast { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .play { border-radius: 24px; width: min(100%, 58svh); margin-inline: auto; }
  .play__hint { font-size: 13px; bottom: 16px; }
  .fplate { width: 26%; }
  .fplate__n { min-width: 24px; height: 24px; font-size: 13px; }
  .feast__people b { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .chudu__steam, .hinkal__steam { display: none; }
}
