/* Главная IMISTORE SHOP (01.12): первый экран работает как касса. Слева игры и пакеты, справа крупная карточка
   выбранной игры, над ней выглядывает монстрик из логотипа. Цвет акцента (--accent) идёт от выбранной игры только
   в мелких деталях; действие всегда красное. */

.stage { position: relative; padding: clamp(18px, 3vw, 44px) 0 clamp(18px, 2.4vw, 30px); isolation: isolate; overflow: hidden; }
/* Подложка: кадр самой игры, крупно и едва заметно, растворяется к низу. Не «свечение», а продолжение карточки. */
.stage__back { position: absolute; inset: -40px -40px 0; z-index: -1; background-size: cover; background-position: center 30%;
    opacity: .2; filter: blur(34px) saturate(1.25); -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 88%);
    mask-image: linear-gradient(180deg, #000 20%, transparent 88%); transition: opacity .35s ease; }
.stage__back.is-swap { opacity: 0; }

.stage__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr;
    grid-template-areas: "text art" "console art"; column-gap: clamp(22px, 3.6vw, 56px); row-gap: 22px; align-items: start; }
.stage__text { grid-area: text; padding-top: clamp(0px, 1.6vw, 22px); }
.stage__text h1 { font-size: clamp(36px, 4.5vw, 62px); line-height: .98; letter-spacing: -.045em; }
.stage__text h1 em { font-style: normal; color: var(--red); }
.stage__text > p { margin-top: 16px; max-width: 36ch; color: var(--ink-2); font-size: clamp(15px, 1.3vw, 17px); text-wrap: pretty; }
.stage__facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--dim); font-size: 13px; }
.stage__facts li { display: inline-flex; align-items: center; gap: 7px; }
.stage__facts svg { color: var(--red); }

/* ---------- карточка игры ---------- */
.stage__art { grid-area: art; position: relative; align-self: center; padding-top: 86px; }
.feature { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 26px; overflow: hidden;
    background: var(--surface-2); isolation: isolate;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 2px 8px rgba(0, 0, 0, .55), 0 40px 70px -38px rgba(0, 0, 0, .95);
    transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .25s; }
.feature:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 2px 8px rgba(0, 0, 0, .55), 0 44px 80px -36px rgba(0, 0, 0, .95); }
.feature__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
    opacity: 0; transform: scale(1.06); transition: opacity .45s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.feature__img.is-on { opacity: 1; transform: scale(1); }
.feature::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 46%, rgba(0, 0, 0, .82)); }
.feature__cap { position: absolute; left: clamp(14px, 1.8vw, 24px); right: 84px; bottom: clamp(14px, 1.8vw, 22px); display: flex; align-items: center; gap: 14px; }
.feature__cap img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18), 0 8px 18px rgba(0, 0, 0, .5); }
.feature__cap b { display: block; font: 700 clamp(18px, 2vw, 27px)/1.1 'Unbounded', 'Onest', sans-serif; letter-spacing: -.03em; }
.feature__cap small { display: block; margin-top: 4px; color: #e6dfe1; font-size: 13.5px; }
.feature__go { position: absolute; right: clamp(14px, 1.8vw, 22px); bottom: clamp(14px, 1.8vw, 22px); width: 48px; height: 48px;
    display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 22px -8px rgba(229, 9, 20, .9); transition: transform .2s cubic-bezier(.2, .7, .2, 1); }
.feature:hover .feature__go { transform: translateX(3px); }
/* полоска автосмены: идёт только пока человек сам ничего не выбирал */
.feature__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--red); transform-origin: left; transform: scaleX(0); }
.stage.is-auto .feature__bar { animation: stage-bar var(--auto, 6s) linear infinite; }
@keyframes stage-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- монстрик из логотипа ---------- */
.peek { --pw: clamp(112px, 10.6vw, 156px); position: absolute; z-index: 3; right: clamp(56px, 6vw, 96px); top: calc(104px - var(--pw) * .69); width: var(--pw); pointer-events: none;
    /* прячется за кромкой карточки: всё ниже нижнего края блока обрезано, рога сверху - нет */
    clip-path: inset(-60% -30% 0 -30%); }
.stage__art .feature { z-index: 1; }
.peek__hands { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); }
.stage__pause { position: absolute; z-index: 2; right: 14px; top: 100px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(10, 10, 10, .7); color: #fff; }
.stage__pause:hover { background: var(--red); }
.stage__pause[hidden] { display: none; }
.peek svg { display: block; width: 100%; height: auto; overflow: visible; transform: translateY(var(--peek-y, 4px)); transition: transform .55s cubic-bezier(.25, 1.35, .45, 1); }
/* между появлениями (раз в 20 с, home.js) монстрика не видно; рога торчат выше блока - уводим с запасом */
.peek.is-away svg { transform: translateY(165%); transition: transform .45s cubic-bezier(.55, 0, .85, .35); }
.peek__eyes { transform-box: fill-box; transform-origin: 50% 55%; animation: peek-blink 5.4s linear infinite; }
.peek__pupils { transition: transform .18s ease-out; }
.peek__mouth { transform-box: fill-box; transform-origin: 50% 20%; }
.peek.is-chomp svg { --peek-y: -10px; }
.peek.is-chomp .peek__mouth { animation: peek-chomp .55s cubic-bezier(.3, .6, .3, 1) 2; }
.peek.is-chomp .peek__horn--l { transform: rotate(-7deg); }
.peek.is-chomp .peek__horn--r { transform: rotate(7deg); }
.peek__horn { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .25s; }
@keyframes peek-blink { 0%, 92%, 100% { transform: scaleY(1); } 94%, 96% { transform: scaleY(.08); } }
@keyframes peek-chomp { 0%, 100% { transform: scaleY(1); } 45% { transform: scaleY(1.55); } 70% { transform: scaleY(.45); } }

/* ---------- пульт: игры, пакеты, купить ---------- */
.console { grid-area: console; align-self: end; }
.console__games { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0 2px; }
.gpick { position: relative; width: 56px; height: 56px; padding: 0; border-radius: 16px; transition: transform .16s cubic-bezier(.2, .7, .2, 1); }
.gpick img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; filter: saturate(.6) brightness(.72); transition: filter .18s; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.gpick:hover { transform: translateY(-3px); }
.gpick:hover img { filter: none; }
.gpick.is-on img { filter: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--red); }
/* у выбранной игры вырастают рожки, как у логотипа */
.gpick::before, .gpick::after { content: ""; position: absolute; top: -11px; width: 12px; height: 12px; background: linear-gradient(0deg, #FF3A44, #5A040A);
    clip-path: polygon(100% 100%, 20% 100%, 0 0, 55% 35%, 88% 66%); transform: scale(0); transform-origin: 80% 100%; transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.gpick::before { left: 5px; }
.gpick::after { right: 5px; transform: scale(0) scaleX(-1); transform-origin: 20% 100%; }
.gpick.is-on::before { transform: scale(1); }
.gpick.is-on::after { transform: scale(1) scaleX(-1); }

.console__packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; min-height: 132px; align-content: start; }
.cpack { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px; text-align: left; border-radius: 12px;
    background: color-mix(in srgb, var(--surface-2) 82%, transparent); box-shadow: inset 0 0 0 1px var(--line);
    transition: box-shadow .16s, background-color .16s, transform .12s; }
.cpack:hover { box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface-3); }
.cpack:active { transform: scale(.98); }
.cpack b { font-weight: 600; font-size: 14.5px; }
.cpack span { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cpack.is-on { background: rgba(229, 9, 20, .14); box-shadow: inset 0 0 0 2px var(--red); }
.cpack.is-on span { color: #fff; font-weight: 600; }

.console__buy { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; margin-top: 14px; }
.console__go { min-width: min(280px, 100%); justify-content: center; }
.console__go b { font-variant-numeric: tabular-nums; }
.console__all { color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 10px 2px; border-bottom: 1px solid var(--line-strong); transition: color .15s, border-color .15s; }
.console__all:hover { color: #fff; border-color: var(--red); }

/* ---------- полки разделов (когда подключены Steam, карты, Roblox) ---------- */
.shelves { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 6px; }
.shelf { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 132px; padding: 16px 18px;
    border-radius: 18px; overflow: hidden; isolation: isolate; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.shelf__art { position: absolute; inset: 0; z-index: -1; }
.shelf__art img { width: 100%; height: 100%; object-fit: cover; opacity: .72; transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
.shelf__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 10, 10, .92) 20%, rgba(10, 10, 10, .3)); }
.shelf:hover .shelf__art img { transform: scale(1.06); opacity: .9; }
.shelf b { display: block; font: 700 17px/1.15 'Unbounded', 'Onest', sans-serif; letter-spacing: -.02em; }
.shelf small { display: block; margin-top: 5px; color: var(--ink-2); font-size: 13px; }
.shelf__go { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .1); transition: background-color .18s; }
.shelf:hover .shelf__go { background: var(--red); }

/* ---------- афиши игр ---------- */
.posters { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.poster { grid-column: span 3; position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 4 / 3.1;
    border-radius: 18px; overflow: hidden; isolation: isolate; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
/* верхний ряд крупнее: сетка не выглядит клеткой из одинаковых карточек */
.poster--half { grid-column: span 6; aspect-ratio: 16 / 8.4; }
.poster--third { grid-column: span 4; aspect-ratio: 16 / 10; }
.poster__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .55s cubic-bezier(.2, .7, .2, 1); }
.poster::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, .86)); }
.poster:hover .poster__bg { transform: scale(1.07); }
.poster__body { display: flex; align-items: center; gap: 11px; padding: 0 14px 14px; min-width: 0; }
.poster__body img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .16); }
.poster__body b { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.2; }
.poster__body small { display: block; color: #cfc7ca; font-size: 12.5px; }
.poster__price { position: absolute; top: 12px; right: 12px; padding: 6px 10px; border-radius: 9px; background: rgba(10, 10, 10, .78); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.poster:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }

/* ---------- горизонтальные ряды ---------- */
.sec__head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sec__all { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.sec__all:hover { color: #fff; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 232px); gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; padding: 2px 2px 12px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.row-scroll > * { scroll-snap-align: start; }
.row-scroll--hits { grid-auto-columns: minmax(214px, 244px); }
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .art, .tile > :first-child { border-radius: 14px; overflow: hidden; margin-bottom: 6px; }
.tile b { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.tile > span:last-child { color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------- как это работает: настоящая последовательность ---------- */
.path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: p; }
.path li { position: relative; padding: 58px clamp(14px, 2.4vw, 34px) 0 0; counter-increment: p; }
.path li::before { content: counter(p); position: absolute; left: 0; top: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px 11px 11px 3px;
    background: linear-gradient(172deg, #FF3640, var(--red) 46%, #A0060E); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 0 #5C0308; font: 700 14px 'Unbounded', sans-serif; }
.path li:not(:last-child)::after { content: ""; position: absolute; left: 48px; right: 12px; top: 18px; height: 1px; background: linear-gradient(90deg, var(--line-strong), var(--line)); }
.path h3 { margin-bottom: 8px; }
.path p { color: var(--ink-2); font-size: 14.5px; max-width: 34ch; text-wrap: pretty; }
.path a { color: #fff; border-bottom: 1px solid var(--red); }

.faq-wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(16px, 3vw, 40px); align-items: start; }
.faq-wrap .sec__head { margin: 0; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1080px) {
    .poster--third { grid-column: span 4; aspect-ratio: 4 / 3.1; }
}
@media (max-width: 900px) {
    .stage__in { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "art" "console"; row-gap: 14px; }
    .stage__art { padding-top: 62px; }
    .peek { --pw: 100px; top: calc(78px - var(--pw) * .69); }
    .stage__pause { top: 74px; right: 10px; }
    .peek { right: 22px; }
    .feature { aspect-ratio: 16 / 10; border-radius: 20px; }
    .console__games { flex-wrap: nowrap; overflow-x: auto; padding: 14px 4px 6px; margin: 0 -4px; scrollbar-width: none; scroll-snap-type: x proximity; }
    .console__games::-webkit-scrollbar { display: none; }
    .gpick { flex: none; scroll-snap-align: start; }
    .console__packs { margin-top: 10px; }
    .console__go { flex: 1 1 100%; }
    .console__all { margin: 0 auto; }
    .path { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .path li { padding: 0 0 0 54px; }
    .path li:not(:last-child)::after { left: 18px; right: auto; top: 46px; bottom: -14px; width: 1px; height: auto; }
    .faq-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .stage__text h1 { font-size: clamp(34px, 11.4vw, 48px); }
    .stage__facts { display: none; }
    .posters { gap: 10px; }
    .poster, .poster--half, .poster--third { grid-column: span 6; aspect-ratio: 1 / 1.02; }
    .posters--odd .poster:first-child { grid-column: span 12; aspect-ratio: 16 / 9; }
    .poster__body { gap: 8px; padding: 0 10px 10px; }
    .poster__body img { width: 34px; height: 34px; border-radius: 9px; }
    .poster__body b { font-size: 13.5px; }
    .poster__price { top: 8px; right: 8px; font-size: 12px; padding: 5px 8px; }
    .cpack { flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 13px; }
    .console__packs { min-height: 0; }
    .row-scroll { grid-auto-columns: 66%; }
}

@media (prefers-reduced-motion: reduce) {
    .peek__eyes, .peek.is-chomp .peek__mouth, .stage.is-auto .feature__bar { animation: none; }
    .peek.is-away svg { transform: translateY(4px); }
    .feature, .feature__img, .poster__bg, .shelf__art img, .gpick, .gpick::before, .gpick::after, .stage__back, .peek svg { transition: none; }
    .feature__bar { display: none; }
}

/* телефон: кнопка «Купить» должна быть видна на первом экране, не под нижней панелью */
@media (max-width: 640px) {
    .stage { padding-top: 12px; }
    .stage__in { row-gap: 8px; }
    .stage__text h1 { font-size: clamp(30px, 9.4vw, 42px); }
    .stage__text > p { margin-top: 8px; font-size: 13.5px; }
    .stage__art { padding-top: 46px; }
    .peek { --pw: 82px; top: calc(60px - var(--pw) * .69); }
    .stage__pause { top: 56px; }
    .feature { aspect-ratio: 16 / 8.2; }
    .feature__cap img { width: 42px; height: 42px; border-radius: 12px; }
    .feature__go { width: 40px; height: 40px; }
    .console__games { padding-top: 12px; }
    .gpick { width: 48px; height: 48px; border-radius: 14px; }
    .cpack { padding: 8px 12px; }
    .console__buy { margin-top: 10px; gap: 4px; }
}
@media (max-width: 380px) {
    .stage__text > p { display: none; }
}
