:root {
  --purple: #c5abfd;
  --black: #282828;
  --white: #f5f2e6;
  --green: #d6f92e;
  --blue: #70d4fc;
  --pink: #fc9bcb;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, sans-serif;
  color: var(--black);
}
body {
  background: var(--purple);
}
.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(16px, 4vw, 64px);
}
.scene {
  width: 100%;
  display: none;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  position: relative;
}
.scene.is-active {
  display: flex;
  animation: fade 0.3s ease both;
}
.scene__content {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  padding: 22px 0;
}

.btn {
  display: inline-block;
  border: 2px solid var(--black);
  border-radius: 999px;
  padding: 13px 29px;
  background: var(--green);
  text-decoration: none;
  font-weight: 700;
  color: var(--black);
  margin-top: 12px;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:focus-visible,
.choice-card:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
.choice-cards {
  display: flex;
  gap: clamp(8px, 2vw, 24px);
  justify-content: center;
  align-items: center;
  margin: 24px auto 18px;
}
.choice-card {
  display: block;
  width: 250px;
  aspect-ratio: 383 / 564;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: visible;
  transition: 0.3s all ease;
}

.choice-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* .choice-card.is-selected {
  outline: 4px solid var(--white);
  transform: scale(1.04);
} */
.reaction {
  min-height: 70px;
  margin: 14px auto 0;
  padding: 14px 20px;
  max-width: 660px;
  border: 2px solid var(--black);
  border-radius: 20px;
  background: var(--white);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.4;
}
.reaction[hidden],
.btn[hidden] {
  display: none;
}
.answers {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.answer {
  background: var(--white);
  min-width: 155px;
}
.answer:first-child {
  background: var(--green);
}
.collected {
  position: absolute;
  left: 22px;
  bottom: 14px;
  display: flex;
  gap: 4px;
  transform: rotate(-7deg);
  pointer-events: none;
}
.collected__card {
  display: grid;
  place-items: center;
  border: 2px solid var(--black);
  border-radius: 9px;
  width: 58px;
  height: 78px;
  background: var(--white);
  font-size: 11px;
  text-align: center;
  padding: 4px;
  box-shadow: 2px 3px var(--black);
}
.footer-note {
  position: relative;
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
  padding-top: 8px;
}
.is-muted {
  color: #555;
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes shake {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(5deg);
  }
  75% {
    transform: rotate(-3deg);
  }
}

.scene--story {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story__card {
  position: relative;
  z-index: 2;

  width: 310px;
  flex-shrink: 0;

  transform: rotate(-11deg);
}

.story__card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
}
.choice-card img {
  width: 247px;
  height: 371px;
  border-radius: 20px;
}
.story__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 571px;
  min-height: 355px;

  margin-left: -25px;
  padding: 28px 34px 24px;

  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 24px;
}

.story__content .title_h1 {
  text-align: center;
}

.story__content .text_m {
  width: 100%;
  max-width: 460px;
}

.story__next {
  padding: 16px 32px;
  width: 149px;
  height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--green);
  border: 3px solid var(--black);
  border-radius: 100px;

  color: var(--black);
  cursor: pointer;
}

.story__next:hover {
  filter: brightness(0.96);
}

.scene--choice {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.choice {
  position: relative;
  width: 100%;
  height: 100%;
}

.choice__title {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);

  margin: 0;
  padding: 20px 40px;

  width: max-content;
  max-width: 90%;

  background: var(--white);
  border: 3px solid var(--green);
  border-radius: 24px;
  text-align: center;

  z-index: 2;
}

/* Карточки */

.choice__cards {
  position: absolute;
  inset: 0;
}

.choice-card {
  position: absolute;
  top: 50%;
  left: 50%;

  width: clamp(160px, 18vw, 260px);
  aspect-ratio: 383 / 564;

  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;

  transition: filter 0.25s ease;
}

.choice-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.choice-card--1 {
  transform: translate(-164%, -25%) rotate(-11deg);
  z-index: 1;
}

.choice-card--2 {
  transform: translate(-50%, -25%) rotate(-2deg);
  z-index: 2;
}

.choice-card--3 {
  transform: translate(60%, -25%) rotate(5deg);
  z-index: 1;
}
.choice__bubble {
  position: absolute;

  top: 26%;
  right: -13%;

  width: 55vw;
  aspect-ratio: 480 / 160;

  background-image: url("../assets/bubble.svg");
  background-size: 100% 100%;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 40px 20px;

  z-index: 20;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.choice__bubble.is-visible {
  opacity: 1;
  visibility: visible;
  /* margin-left: -40px; */
}

.choice__bubble .text_m {
  margin-top: 0%;
  max-width: 275px;
}
.choice-card.is-shaking {
  animation: choiceShake 0.45s ease;
}
.episode__collected img:nth-of-type(2), .episode__collected img:nth-of-type(4) {
    display: block;
    height: auto;
    transform: rotate(-5deg);
    width: 95px;
}

@keyframes choiceShake {
  0%,
  100% {
    rotate: 0deg;
  }
  25% {
    rotate: -5deg;
  }
  50% {
    rotate: 5deg;
  }
  75% {
    rotate: -3deg;
  }
}
.choice-card.is-selected {
  z-index: 15;
  scale: 1.12;
  transition: scale 0.3s ease;
}
.choice__cards {
  position: absolute;
  inset: 0;
  z-index: auto;
}

.choice-card.is-selected {
  z-index: 15;
  scale: 1.12;
}

.scene:not(.is-active) {
  display: none;
}

.scene.is-active {
  display: flex;
}
.choice::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.choice:has(.choice-card.is-selected)::before {
  opacity: 1;
  visibility: visible;
}

.choice__cards:has(.is-selected) {
  z-index: 11;
}

.choice-card.is-selected {
  z-index: 15;
  scale: 1.12;
}

.choice__bubble {
  z-index: 20;
}
@media (max-width: 600px) {
  .page {
    padding: 18px 15px;
  }
  .choice-cards {
    gap: 7px;
  }
  .choice__bubble .text_m {
    font-size: 16px;
  }
  .choice-card {
    width: min(29vw, 145px);
    border-radius: 13px;
  }
  .collected {
    left: 12px;
    bottom: 38px;
  }
  .collected__card {
    width: 40px;
    height: 56px;
    font-size: 9px;
  }
  .choice__bubble {
  position: absolute;

  top: 26%;
  right: -13%;

  width: 55vw;
  aspect-ratio: 480 / 160;

  background-image: url("../assets/bubble.svg");
  background-size: 200%;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;

  /* padding: 40px 20px; */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 20;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}
.choice__bubble .text_m {
  max-width: 275px;
}
  .reaction {
    padding: 10px 12px;
    min-height: 50px;
  }
  .btn {
    padding: 11px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
