/* Плеер квиза: старт-экран, ведущий, конец. Вид — по макету docs/superpowers/epics/quiz-hub/mockups/
   (player.html, decisions.md); токены --q-* и кнопки .q-btn/.q-icon — ui/ui.css. */

/* ---------- слайды дек ---------- */
.deck {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
}

.deck > .slide {
  position: absolute;
  inset: 0;
}

.deck > .slide[hidden] {
  display: none;
}

.deck > .slide:not([hidden]) {
  animation: q-fade var(--q-base) var(--q-ease) both;
}

@keyframes q-fade {
  from {
    opacity: 0;
  }
}

/* Базовые стили рантайма дек claude.ai (как scripts/quiz/covers.mjs): без полей у p/h1,
   поток поверх фоновых блоков с абсолютным положением, таблицы ответов. */
.deck > .slide > section {
  position: relative;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  box-sizing: border-box;
}

.deck > .slide section * {
  margin: 0;
  box-sizing: border-box;
}

.deck > .slide > section > *:not([style*="position:absolute"]) {
  position: relative;
}

.deck > .slide table {
  border-collapse: collapse;
}

/* без JS (или до запуска плеера) — первый слайд в окне */
.quiz-player:not([data-ready]) {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--q-stage);
}

html[data-screen="host"],
html[data-screen="host"] body {
  overflow: hidden;
}

/* ссылка кита «Все мини-приложения» в потоке страницы — на сцене ведущего не нужна (есть «✕») */
html[data-screen="host"] .mini-footer {
  display: none;
}

.quiz-player [hidden] {
  display: none !important;
}

/* ---------- общее ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 var(--q-gutter);
  font: 500 13px/1 var(--q-mono);
  color: var(--q-muted);
}

.top a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition: color var(--q-fast) var(--q-ease);
}

.top a:hover {
  color: var(--q-fg);
}

.top .sp {
  flex: 1;
}

.top b {
  font: 700 15px/1 var(--q-display);
  color: var(--q-fg);
}

.top svg {
  width: 18px;
  height: 18px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.badges li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1;
  padding: 6px 9px 6px 7px;
  border-radius: 999px;
  border: 1px solid var(--q-line);
}

.badges svg {
  width: 14px;
  height: 14px;
  color: var(--q-accent-hi);
}

/* ---------- старт ---------- */
.start {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 0 32px;
}

.start__grid {
  display: grid;
  gap: 20px;
  padding: 0 var(--q-gutter);
}

.start__cover {
  position: relative;
  margin: 0;
  border-radius: var(--q-radius-lg);
  overflow: hidden;
  outline: 1px solid var(--q-line);
  outline-offset: -1px;
  aspect-ratio: 16 / 9;
  background: var(--q-surface);
}

.start__cover .deck > .slide:not([hidden]) {
  animation: none;
}

.start__info {
  display: grid;
  gap: 14px;
  align-content: start;
}

.start h1 {
  font: 700 clamp(2rem, 4.4vw, 3.4rem) / 1 var(--q-display);
}

.start__meta {
  font: 500 14px/1.4 var(--q-mono);
}

.modes {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.mode {
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 16px;
  min-height: 76px;
  border-radius: var(--q-radius-lg);
  border: 1px solid var(--q-line);
  background: var(--q-raised);
  text-decoration: none;
  color: var(--q-fg);
  transition:
    border-color var(--q-fast) var(--q-ease),
    background-color var(--q-fast) var(--q-ease),
    transform var(--q-fast) var(--q-ease);
}

.mode:hover {
  border-color: var(--q-accent);
}

.mode:active {
  transform: scale(0.99);
}

.mode i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--q-accent);
  color: var(--q-accent-fg);
}

.mode i svg {
  width: 24px;
  height: 24px;
}

.mode b {
  font: 700 19px/1.15 var(--q-display);
}

.mode span {
  grid-column: 2;
  color: var(--q-muted);
  font-size: 15px;
  line-height: 1.35;
}

.mode em {
  grid-row: 1 / span 2;
  grid-column: 3;
  font-style: normal;
  color: var(--q-muted);
  font-size: 20px;
}

.dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding-top: 6px;
}

.dl a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  color: var(--q-fg);
  text-decoration: underline;
  text-decoration-color: var(--q-accent);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.dl a svg {
  width: 18px;
  height: 18px;
  color: var(--q-accent-hi);
}

.dli {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.dl small {
  font: 500 13px/1.3 var(--q-mono);
  color: var(--q-muted);
}

.dl .dl-note {
  flex-basis: 100%;
  color: var(--q-muted);
  font-size: 14px;
  margin-top: -6px;
}

.credits {
  font-size: 13px;
  color: var(--q-muted);
}

@media (min-width: 900px) {
  .start__grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 1fr);
    gap: 40px;
    align-items: start;
    padding-top: 24px;
  }

  .modes {
    margin-top: 14px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .start .top {
    min-height: 44px;
  }

  .start__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    padding-top: 0;
  }

  .start h1 {
    font-size: 26px;
  }

  .start__info {
    gap: 8px;
  }

  .mode {
    min-height: 60px;
    padding: 8px 12px;
    grid-template-columns: 36px 1fr 16px;
  }

  .mode i {
    width: 36px;
    height: 36px;
  }

  .mode b {
    font-size: 16px;
  }

  .mode span {
    font-size: 13px;
  }

  .modes {
    margin-top: 2px;
    gap: 8px;
  }

  .dl {
    padding-top: 0;
  }

  .dl .dl-note,
  .start .credits {
    display: none;
  }
}

@media (min-width: 1800px) {
  .start {
    max-width: 1720px;
  }

  .start h1 {
    font-size: 4.2rem;
  }

  .mode {
    min-height: 96px;
  }

  .mode b {
    font-size: 24px;
  }

  .mode span {
    font-size: 18px;
  }
}

/* ---------- ведущий ---------- */
.host-stage {
  position: fixed;
  inset: 0;
  height: 100dvh;
  background: var(--q-stage);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}

.host-frame {
  position: absolute;
  overflow: hidden;
  background: #0d0f13;
}

.media-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.media-layer > * {
  pointer-events: auto;
}

.media-layer video {
  position: absolute;
  object-fit: cover;
  background: oklch(0.1 0.005 255);
  border-radius: 1%;
}

.play {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: var(--q-fg);
}

.play > span {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--q-accent);
  color: var(--q-accent-fg);
  box-shadow: 0 0 0 8px oklch(0.63 0.19 30 / 0.25);
  transition: transform var(--q-fast) var(--q-ease);
}

.play:hover > span {
  transform: scale(1.06);
}

.play:active > span {
  transform: scale(0.98);
}

.play svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

.play small {
  position: absolute;
  bottom: -34px;
  font: 600 13px/1 var(--q-text);
  background: var(--q-chrome);
  padding: 7px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.play--error small {
  color: var(--q-accent-hi);
}

.loading {
  position: absolute;
  display: grid;
  place-items: center;
  background: oklch(0.12 0.008 255 / 0.55);
  border-radius: 1%;
}

.loading i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid oklch(1 0 0 / 0.2);
  border-top-color: var(--q-accent);
  animation: q-spin 0.8s linear infinite;
}

@keyframes q-spin {
  to {
    transform: rotate(1turn);
  }
}

.plaque {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--q-chrome);
  font: 600 15px/1 var(--q-text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.plaque::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--q-accent);
}

.plaque--ans::before {
  background: var(--q-ok);
}

.counter {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--q-chrome);
  font: 500 14px/1 var(--q-mono);
  white-space: nowrap;
}

.chrome-top {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.chrome-top > * {
  pointer-events: auto;
}

.chrome-top .sp {
  flex: 1;
}

.chrome-top .q-icon {
  flex: none;
  width: 44px;
  height: 44px;
}

.arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px;
  height: 72px;
  border-radius: 12px;
  border: 0;
  background: var(--q-chrome);
  color: var(--q-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity var(--q-fast) var(--q-ease);
}

.arrow:hover {
  opacity: 1;
}

.arrow svg {
  width: 26px;
  height: 26px;
}

.arrow--l {
  left: 12px;
}

.arrow--r {
  right: 12px;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: oklch(1 0 0 / 0.08);
}

.progress i {
  display: block;
  height: 100%;
  background: var(--q-accent);
  transition: width var(--q-base) var(--q-ease);
}

.chrome-top,
.arrow {
  transition: opacity var(--q-base) var(--q-ease);
}

/* ПК и ТВ: хром прячется через 2,5 с без мыши и клавиш */
.host-stage.is-idle {
  cursor: none;
}

.host-stage.is-idle .chrome-top,
.host-stage.is-idle .arrow {
  opacity: 0;
  pointer-events: none;
}

.portrait-bar,
.hint {
  display: none;
}

@media (min-width: 1800px) {
  .plaque {
    min-height: 44px;
    font-size: 18px;
    padding: 0 18px;
  }

  .counter {
    min-height: 44px;
    font-size: 17px;
  }
}

/* низкое окно (телефон боком): плашка перекрывает кикер слайда — прячем, как у соло; номер есть на слайде */
@media (max-height: 400px) {
  .host-stage .plaque {
    display: none;
  }
}

/* маленький портрет (320×568): подсказке «Поверни телефон» нет места между слайдом и кнопками */
@media (orientation: portrait) and (max-height: 600px) {
  .host-stage .hint {
    display: none !important;
  }
}

/* портрет: шапка, слайд по ширине, большие кнопки внизу, подсказка повернуть */
@media (orientation: portrait) {
  .host-stage .arrow,
  .host-stage [data-fs] {
    display: none;
  }

  .chrome-top {
    top: max(10px, env(safe-area-inset-top));
  }

  .portrait-bar {
    display: grid;
    position: absolute;
    left: var(--q-gutter);
    right: var(--q-gutter);
    bottom: calc(16px + max(var(--kit-stack, 0px), env(safe-area-inset-bottom)));
    grid-template-columns: 1fr 2fr;
    gap: 10px;
  }

  .portrait-bar .q-btn {
    min-height: 56px;
    font-size: 17px;
  }

  .hint {
    display: flex;
    position: absolute;
    left: var(--q-gutter);
    right: var(--q-gutter);
    gap: 12px;
    align-items: center;
    padding: 12px 8px 12px 14px;
    border-radius: var(--q-radius-lg);
    background: var(--q-surface);
    border: 1px solid var(--q-line);
  }

  .hint svg.rot {
    width: 32px;
    height: 32px;
    flex: none;
    color: var(--q-accent-hi);
    animation: q-tilt 2.4s var(--q-ease) infinite;
  }

  .hint p {
    flex: 1;
    font-size: 15px;
    line-height: 1.35;
  }

  .hint b {
    display: block;
    font-weight: 600;
  }

  .hint .q-icon {
    background: transparent;
    width: 44px;
    height: 44px;
    flex: none;
  }
}

@keyframes q-tilt {
  0%,
  30% {
    transform: rotate(0);
  }

  55%,
  85% {
    transform: rotate(-90deg);
  }

  100% {
    transform: rotate(0);
  }
}

/* ---------- конец у ведущего ---------- */
.end {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px var(--q-gutter);
}

.end__in {
  display: grid;
  gap: 20px;
  max-width: 760px;
  width: 100%;
}

.end h1 {
  font: 700 clamp(2rem, 4.6vw, 3.6rem) / 1.05 var(--q-display);
  text-wrap: balance;
}

.q-kicker {
  font: 500 12px/1.2 var(--q-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--q-accent-hi);
}

.after {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- кнопки шеринга (QuizShare) ---------- */
.share {
  display: grid;
  gap: 10px;
}

.share .q-btn {
  min-height: 56px;
  font-size: 17px;
}

.share-link {
  min-height: var(--q-tap);
  width: 100%;
  border-radius: var(--q-radius);
  border: 1px solid var(--q-line);
  background: var(--q-surface);
  color: var(--q-fg);
  padding: 0 14px;
  font: 15px var(--q-mono);
}

.end .share {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ---------- соло ---------- */
html[data-screen="solo"] .mini-footer,
html[data-screen="result"] .mini-footer {
  display: none;
}

.solo {
  --solo-wide: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.solo-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) var(--q-gutter) 8px 6px;
  border-bottom: 1px solid var(--q-line);
  background: var(--q-bg);
}

.solo-head .q-icon {
  flex: none;
  background: transparent;
}

.solo-head .score {
  flex: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.solo-head .score p {
  font: 500 14px/1.2 var(--q-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.solo-head .score b {
  color: var(--q-ok);
  font-weight: 600;
}

.bar {
  height: 4px;
  border-radius: 2px;
  background: var(--q-raised);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--q-accent);
  transition: width var(--q-base) var(--q-ease);
}

.solo-body {
  display: grid;
  align-content: start;
}

.solo-slide {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px var(--q-gutter) 0;
}

.plaque-row {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.solo-slide .plaque {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0 6px;
}

.solo-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--q-radius);
  outline: 1px solid var(--q-line);
  outline-offset: -1px;
  background: #0d0f13;
  cursor: zoom-in;
  touch-action: manipulation;
}

.zoom-btn {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--q-chrome);
  font: 600 14px/1 var(--q-text);
  cursor: pointer;
  transition: transform var(--q-fast) var(--q-ease);
}

.zoom-btn:active {
  transform: scale(0.98);
}

.zoom-btn svg {
  width: 16px;
  height: 16px;
}

/* дека переезжает между рамкой и крупным видом и встаёт последней — слой медиа держим поверх */
.solo-frame .media-layer {
  z-index: 1;
}

/* «▶» на маленьком слайде соло (телефон) — круг 52 px без подписи */
@media (orientation: portrait), (max-height: 500px) {
  .solo-frame .play > span {
    width: 52px;
    height: 52px;
    box-shadow: 0 0 0 6px oklch(0.63 0.19 30 / 0.25);
  }

  .solo-frame .play svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
  }

  .solo-frame .play small {
    display: none;
  }
}

.panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px var(--q-gutter) calc(104px + max(var(--kit-stack, 0px), env(safe-area-inset-bottom)));
}

.panel .lede {
  max-width: 60ch;
  color: var(--q-muted);
  font-size: 15px;
}

.panel .lede.mark-hint {
  font-size: 14px;
}

.answers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.answers:empty {
  display: none;
}

.ans {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr 32px;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 12px 12px 12px 14px;
  text-align: left;
  border-radius: var(--q-radius);
  border: 1px solid var(--q-line);
  background: var(--q-surface);
  color: var(--q-fg);
  cursor: pointer;
  transition:
    background-color var(--q-fast) var(--q-ease),
    border-color var(--q-fast) var(--q-ease);
  animation: q-rise var(--q-base) var(--q-ease) both;
  animation-delay: calc(var(--k, 0) * 35ms);
}

.ans .no {
  align-self: start;
  padding-top: 3px;
  font: 600 15px/1 var(--q-mono);
  color: var(--q-accent-hi);
}

.ans .tx {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ans .nt {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--q-muted);
}

.ans .ck {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--q-line);
  color: transparent;
  transition:
    background-color var(--q-fast) var(--q-ease),
    border-color var(--q-fast) var(--q-ease),
    color var(--q-fast) var(--q-ease);
}

.ans .ck svg {
  width: 18px;
  height: 18px;
}

.ans[aria-pressed="true"] {
  background: var(--q-ok-bg);
  border-color: oklch(0.8 0.14 150 / 0.5);
}

.ans[aria-pressed="true"] .ck {
  background: var(--q-ok);
  border-color: var(--q-ok);
  color: var(--q-accent-fg);
  animation: q-pop var(--q-fast) var(--q-ease);
}

.ans--given {
  cursor: default;
  background: transparent;
  border-style: dashed;
}

.ans--given .tx {
  color: var(--q-muted);
  font-weight: 500;
}

.ans--given .ck {
  border: 0;
}

@keyframes q-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes q-pop {
  from {
    transform: scale(0.8);
  }
}

/* главная кнопка прибита к низу (над плашками кита) */
.cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  gap: 10px;
  padding: 12px var(--q-gutter) calc(12px + max(var(--kit-stack, 0px), env(safe-area-inset-bottom)));
  background: linear-gradient(to top, var(--q-bg) 70%, transparent);
}

.cta .q-btn {
  min-height: 56px;
  font-size: 17px;
}

.cta [data-cta] {
  flex: 1;
}

.q-btn--back {
  flex: none;
  width: 56px;
  padding: 0;
}

/* альбом (ПК, ТВ, телефон боком): слайд слева на сцене, панель ответов справа.
   В макете порог был ≥ 700 px, но телефон боком 667×375 тогда получал портретную раскладку со слайдом выше окна. */
@media (orientation: landscape) {
  .solo {
    --solo-wide: 1;
    height: calc(100dvh - var(--kit-stack, 0px));
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  html[data-screen="solo"],
  html[data-screen="solo"] body {
    overflow: hidden;
  }

  .solo-body {
    grid-template-columns: minmax(0, 1fr) clamp(280px, 30vw, var(--q-panel));
    min-height: 0;
    align-content: stretch;
  }

  .solo-slide {
    padding: 16px;
    align-content: center;
    justify-items: center;
    min-height: 0;
    overflow: hidden;
    background: var(--q-stage);
  }

  .solo-frame {
    cursor: default;
  }

  .zoom-btn {
    display: none;
  }

  .panel {
    min-height: 0;
    overflow: auto;
    padding: 20px;
    border-left: 1px solid var(--q-line);
  }

  /* кнопка прилипает к низу панели: длинный список прокручивается под ней */
  .cta {
    position: sticky;
    bottom: -20px;
    margin: 4px -20px -20px;
    padding: 12px 20px 20px;
    background: linear-gradient(to top, var(--q-bg) 75%, transparent);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .solo-head {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .solo-slide {
    padding: 8px;
  }

  .solo-slide .plaque-row {
    display: none;
  }

  .panel {
    padding: 12px 14px;
  }

  .cta {
    bottom: -12px;
    margin: 2px -14px -12px;
    padding: 10px 14px 12px;
  }

  .ans {
    min-height: 52px;
    padding: 8px 10px;
    grid-template-columns: 28px 1fr 28px;
  }

  .ans .ck {
    width: 28px;
    height: 28px;
  }

  .cta .q-btn {
    min-height: 48px;
  }

  .q-btn--back {
    width: 48px;
  }
}

@media (min-width: 1800px) {
  .ans .tx {
    font-size: 22px;
  }

  .ans .nt {
    font-size: 18px;
  }

  .solo-head .score p {
    font-size: 17px;
  }
}

/* повёрнутый слайд на весь экран (портрет, «Крупнее») */
.zoom {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--q-stage);
  cursor: zoom-out;
  touch-action: none;
  animation: q-fade var(--q-base) var(--q-ease) both;
}

.zoom:focus {
  outline: none;
}

.zoom-box {
  position: absolute;
  left: 50%;
  top: 50%;
  overflow: hidden;
  transform: translate(-50%, -50%);
  outline: 1px solid var(--q-line);
}

/* портрет: слайд повёрнут на 90° */
.zoom--turn .zoom-box {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* низкий альбом (телефон боком, ≤ 360 px): слайд рядом с панелью мелкий — «Крупнее» возвращается */
@media (orientation: landscape) and (max-height: 360px) {
  .solo .zoom-btn {
    display: inline-flex;
  }

  .solo .solo-frame {
    cursor: zoom-in;
  }
}

/* только своя подпись: внутри .zoom лежит дека со своими <p> */
.zoom > p {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font: 600 14px/1 var(--q-text);
  color: var(--q-muted);
}

/* ---------- итог соло ---------- */
.res {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 0 calc(40px + var(--kit-stack, 0px));
}

.res__grid {
  display: grid;
  gap: 22px;
  justify-items: center;
  padding: 0 var(--q-gutter);
}

.res h1 {
  font: 700 clamp(2.2rem, 6vw, 4.4rem) / 1 var(--q-display);
  text-align: center;
}

.res h1 em {
  font-style: normal;
  color: var(--q-accent-hi);
  font-variant-numeric: tabular-nums;
}

.res .of {
  margin-top: 6px;
  color: var(--q-muted);
  text-align: center;
}

.rimg {
  margin: 0;
  width: min(68vw, 300px);
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: var(--q-surface);
  outline: 1px solid var(--q-line);
  box-shadow: 0 30px 60px -30px oklch(0 0 0 / 0.7);
}

.rimg img {
  display: block;
  width: 100%;
  height: 100%;
}

.rimg img:not([src]) {
  visibility: hidden;
}

.ask {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 520px;
}

.ask h2 {
  font: 700 clamp(1.3rem, 2.4vw, 1.8rem) / 1.2 var(--q-display);
  text-wrap: balance;
}

.res .after {
  justify-content: center;
}

.res-err {
  color: var(--q-accent-hi);
  font-weight: 600;
}

@media (min-width: 900px) {
  .res__grid {
    grid-template-columns: auto minmax(0, 520px);
    justify-content: center;
    align-items: center;
    justify-items: start;
    column-gap: 64px;
    padding-top: 28px;
  }

  .res__grid .rimg {
    grid-row: 1 / span 3;
    width: min(36vw, 440px);
  }

  .res h1,
  .res .of {
    text-align: left;
  }

  .res h1 {
    font-size: clamp(2.4rem, 3.6vw, 4rem);
  }

  .res .after {
    justify-content: flex-start;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .res .top {
    min-height: 44px;
  }

  .res__grid {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
    justify-items: start;
    padding-top: 0;
  }

  .res__grid .rimg {
    grid-row: 1 / span 3;
    width: 220px;
  }

  .res h1 {
    font-size: 30px;
    text-align: left;
  }

  .res .of {
    text-align: left;
  }

  /* три кнопки в ряд, на узком экране переносятся (иначе горизонтальный скролл на ≤ 689 px) */
  .res .share {
    display: flex;
    flex-wrap: wrap;
  }

  .res .share .q-btn {
    flex: 1 1 auto;
    min-height: 48px;
    font-size: 15px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .res .after {
    justify-content: flex-start;
  }
}

@media (min-width: 1800px) {
  .res {
    max-width: 1600px;
  }

  .res__grid .rimg {
    width: 520px;
  }
}

/* встроенный браузер соцсети: картинка итога на весь экран, сохранить — долгим нажатием */
.img-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 64px var(--q-gutter) calc(24px + var(--kit-stack, 0px));
  background: oklch(0.1 0.006 255 / 0.96);
}

.img-view img {
  max-width: 100%;
  max-height: calc(100dvh - 150px);
  border-radius: 12px;
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
}

.img-view p {
  font: 600 16px/1.3 var(--q-text);
}

.img-view .q-icon {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 10px;
}
