@font-face {
  font-family: Mulish;
  src: url("./fonts/Muli-Bold.woff2") format("woff2");
  font-weight: bold;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: Mulish;
  src: url("./fonts/Muli-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: Cera;
  src: url("./fonts/CeraBasic-Bold.woff2") format("woff2");
  font-weight: bold;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: Cera;
  src: url("./fonts/CeraBasic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}

:root {
  --main-color-bg: #005ad2;
  --main-color-text: #464646;
  --color-shapes: #ff466e;
  --main-font: Mulish;
  --secondary-font: Cera;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  text-decoration: none;
}

body {
  font-family: var(--main-font), "Arial", sans-serif;
  font-weight: 300;
  color: var(--main-color-text);
}
html, body {
  overflow-x: hidden;
  overflow-y: auto;     /* оставить вертикальную прокрутку */
  overscroll-behavior-y: auto; /* разрешаем pull-to-refresh */
}

img {
  display: block;
}

main {
  background-color: var(--main-color-bg);
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* Header */
.header {
  position: absolute;
  width: 100vw;
  display: flex;
  background: white;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
  padding: 0.6vh 0.7vw 0.5vh 0.9vw;
  z-index: 100;
}

.header h1 {
  display: none;
}

.header__logo {
  display: flex;
  gap: 0.45vw;
  align-items: center;
}

.header__logo-main {
  width: 3.2vh;
}

/* Logo positions */
.logo--top {
  position: absolute;
  top: 10vh;
  right: 2vw;
  z-index: 1;
  max-width: 8vw;
  width: 8vw;
}

.logo--bottom {
  position: fixed;
  bottom: 2vh;
  right: 2vw;
  width: 15vw;
  max-width: 15vw;
  z-index: 0;
}

.screen {
  position: relative;
  display: none;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  overscroll-behavior-y: contain; /* не даём тащить вложенные блоки отдельно */
}

.screen--active {
  display: flex;
}

.screen__decor {
  position: absolute;
  top: 16vh;
  right: 0;
  height: 84vh;
  z-index: -1;
}

.shapes {
  top: 6.6vh;
  right: 15.9vw;
  height: 19.9vh;
}
foreignObject {
  pointer-events: all;
}

/* Welcome screen */
.welcome,
.question,
.result,
.advice {
  width: 100vw;
  height: 100vh;
  /* min-width: 390px; */
  display: flex;
  justify-content: center;
}

.welcome__shape,
.result__shape {
  position: relative;
  height: 77%;
  width: auto;
  top: 14%;
  left: -4%;
  aspect-ratio: 929 / 929;
}

.bubble {
  width: 100%;
  height: auto;
  display: block;
}

.welcome__content,
.result__content {
  display: flex;
  flex-direction: column;
  gap: 150px;
}

.welcome__title,
.result__title {
  color: var(--main-color-bg);
  font-family: var(--secondary-font);
  font-size: 83px;
  line-height: 80px;
  font-weight: bold;
  letter-spacing: -0.04vw;
}

.welcome__text,
.result__text {
  font-size: 45px;
  line-height: 50px;
}

.welcome__text,
.result__text:last-child {
  padding-top: 21px;
}

.welcome__button {
  cursor: pointer;
  align-self: flex-end;
  /* position: relative; */
  font-size: 39px;
  color: var(--main-color-bg);
  letter-spacing: -0.02vw;
  line-height: 42px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.welcome__button--arrow {
  /* position: absolute; */
  right: 0;
  bottom: -1vh;
  width: 6vh;
  max-width: 6vh;
  display: inline-block;
  transition: all 0.3s;
}


.question {
  flex-direction: column;
  gap: 2vh;
  margin: 0 auto;
  max-width: 1440px;
  justify-content: center;
}

.question__header {
  background: white;
  padding: 2.7vh 4.2vw;
}

.question__title {
  color: var(--main-color-bg);
  font-family: var(--secondary-font);
  font-size: 4.16vw;
  font-weight: bold;
}

#screen4 .question__title {
  font-size: 3.16vw;
}

.question__options {
  display: flex;
  justify-content: center;
  align-content: center;
  flex-wrap: wrap;
  padding: 0 3.5vw;
  gap: 2vw;
}

.question__option {
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  flex: 1 1 45%;
  max-width: 600px;
  /* width: 100%;
  max-height: 32vh; */
}

.question__option:hover {
  transform: translateY(1%);
}

.question__image {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  -o-object-fit: cover;
  object-fit: cover;
  -o-object-position: top;
  object-position: top;
}

.question__cloud {
  position: absolute;
  bottom: 4%;
  right: 1%;
  width: 41%;
  max-width: 270px;
  /* aspect-ratio: 1/1; */
  color: white;
  font-family: "Mulish";
  font-weight: lighter;
  /* border-radius: 51% 49% 52% 7%;
  padding: 5vh 2vw 6vh 2.5vw; */
  /* max-width: 19vw; */
  font-size: 2.15vh;
  line-height: 2.2vh;
}

.question__bubble-inner {
  x: 10%;
  y: 22%;
  width: 86%;
  height: 72%;
}

.question__content p:first-child {
  font-family: "Mulish";
  font-weight: bold;
  font-size: 154px;
  line-height: normal;
  margin-bottom: 13px;
}

.question__content p:last-child {
  font-family: "Mulish";
  font-weight: lighter;
  font-size: 87px;
  line-height: 100px;
}

.question1 {
  justify-content: space-between;
}

.question1__title {
  padding: 22vh 0 0 4vw;
  max-width: 74%;
  color: white;
  font-family: var(--secondary-font);
  font-weight: bold;
  font-size: 7.2vh;
  letter-spacing: -0.07vw;
  line-height: 7vh;
}

.question1__clouds {
  position: relative;
  top: 3%;
  left: 36%;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  gap: 3vw;
}

.question1__cloud {
  max-width: 350px;
  height: 83%;
  width: auto;
  aspect-ratio: 1 / 1;
  color: white;
  flex-shrink: 0;
  cursor: pointer;
}

.question1__cloud:last-child {
  position: relative;
  top: -26%;
  right: -1%;
}

.question1__bubble-inner {
  x: 19%;
  y: 13%;
  width: 78%;
  height: 78%;
}

.question1__cloud:last-child .question1__bubble-inner {
  x: 14%;
  y: 18%;
  width: 77%;
  height: 78%;
}

.question1__content p:first-child {
  font-family: "Mulish";
  font-weight: bold;
  font-size: 154px;
}

.question1__content p:last-child {
  font-family: "Mulish";
  font-weight: lighter;
  font-size: 102px;
  line-height: 111px;
}

/* Result screen */
.result__content {
  gap: 100px;
}

.result__title {
  font-size: 75px;
  letter-spacing: -0.15vw;
  margin-bottom: 22px;
}

.result__subtitle {
  font-size: 27px;
  font-weight: bold;
}

.result__text {
  font-size: 27px;
  line-height: normal;
}

.result__button {
  display: flex;
  align-self: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 41px;
  letter-spacing: -0.05vw;
  color: var(--color-shapes);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.result__button span {
  display: block;
  padding-top: 15px;
}

.result__button--arrow {
  width: 58px;
  display: inline-block;
  transition: all 0.3s;
}

/* Final advice screen */
.advice {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.4vw;
  padding: 0 4vw;
  align-content: center;
  align-items: center;
}

.advice__photo {
  max-width: 21vw;
}

.advice__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 5vh;
  max-width: 50vw;
  background: white;
  color: var(--main-color-text);
  padding: 2.2vh 2.3vw 1.5vh 2.3vw;
  border-radius: 1vh;
}

.advice__title {
  font-size: 2.28vh;
  font-weight: bold;
}

.advice__text {
  font-size: 2.27vh;
  line-height: 2.75vh;
}

.advice__button {
  text-align: center;
  color: white;
  background-color: var(--color-shapes);
  padding: 1vh 1vw;
  border-radius: 6px 9px 9px 6px;
  font-family: var(--secondary-font);
  font-weight: 400;
  font-size: 1.9vh;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s;
  opacity: 0;
}

.advice__button span:first-child {
  font-weight: bold;
}

.advice__button span:nth-child(2) {
  font-weight: bold;
  text-decoration: underline;
}

/* Back button */
.back-button {
  position: fixed;
  bottom: 3vh;
  left: 3vw;
  background: rgba(255, 255, 255, 0.9);
  color: var(--main-color-bg);
  padding: 12px 20px;
  border: 2px solid var(--main-color-bg);
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 100;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.back-button:hover {
  background: var(--main-color-bg);
  border: 2px solid white;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.back-button::before {
  content: "←";
  font-size: 1.2rem;
}

.back-button--visible {
  display: inline-flex;
}

.landscape-overlay::before {
  content: "Gebruik uw apparaat in staande stand.";
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--main-color-bg);
  color: white;
  font-family: Cera;
  font-size: 4vw;
  font-weight: bold;
  text-align: center;
  z-index: 9999;
  padding-top: 10vh;
}

.landscape-overlay {
  display: none;
  /* 🚫 скрыт по умолчанию */
  position: fixed;
  inset: 0;
  background: var(--main-color-bg);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  color: #fff;
  font-size: 1.2rem;
  text-align: center;
  font-family: sans-serif;
}

.landscape-overlay svg {
  position: absolute;
  top: 30vh;
  left: 45vw;
  width: 80px;
  z-index: 9999;
  height: auto;
  stroke: white;
  fill: none;
  stroke-width: 4;
  margin-bottom: 20px;
  -webkit-animation: rotatePhone 3s infinite;
  animation: rotatePhone 3s infinite;
}

@-webkit-keyframes rotatePhone {
  0% {
    transform: rotate(90deg) scale(1);
  }

  40% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(0deg) scale(1.05);
  }

  60% {
    transform: rotate(0deg) scale(1);
  }

  100% {
    transform: rotate(90deg) scale(1);
  }
}

@keyframes rotatePhone {
  0% {
    transform: rotate(90deg) scale(1);
  }

  40% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(0deg) scale(1.05);
  }

  60% {
    transform: rotate(0deg) scale(1);
  }

  100% {
    transform: rotate(90deg) scale(1);
  }
}

/* ✅ Активируем только при блокировке */
.lock-landscape .landscape-overlay {
  display: flex;
}

/* Mobile styles */

@media (min-width: 1460px) {

  .question__title,
  #screen4 .question__title {
    font-size: 4.16vh;
  }

  #screen4 .question__image {
    border-radius: 50px;
  }
}

@media (max-width: 1300px) {
  .question1__clouds {
    top: 9%;
    left: 16%;
  }

  .question1__cloud {
    height: 70%;
  }
}

/* TODO: mobile */
@media (max-width: 1100px) and (max-height: 1200px) {

  .welcome__shape,
  .result__shape {
    position: relative;
    height: 69%;
    width: auto;
    top: 14%;
    left: -4%;
  }
}

@media (max-width: 1100px) and (max-height: 900px) {
  .question__title {
    font-size: 4.16vw;
    line-height: 100%;
  }
}

@media (max-width: 1100px) {

  .welcome__shape,
  .result__shape {
    position: relative;
    height: 69%;
    width: auto;
    top: 14%;
    left: -4%;
  }

  .question1__title {
    font-size: 5.2vw;
    line-height: normal;
  }
}

@media (max-width: 860px) {
  .header {
    align-items: flex-start;
    padding: 0 0.7vw 0 2.9vw;
  }

  .header__logo {
    gap: 2.7vw;
  }

  .header__logo-main {
    width: 3vh;
  }

  .logo--top {
    top: 7vh;
    width: 10vw;
    max-width: 10vw;
  }

  .logo--bottom {
    width: 20vw;
    max-width: 20vw;
  }

  #screen6.screen--active {
    padding-top: 4vh;
    overflow: hidden;
  }

  .screen__decor {
    width: 45vw;
  }

  .welcome__shape,
  .result__shape {
    position: relative;
    height: 59%;
    width: auto;
    top: 20%;
    left: -10%;
  }

  .welcome__content {
    gap: 5vh;
  }

  .result__shape {
    left: -13%;
  }

  .welcome__bubble-inner {
    x: 22%;
    y: 15%;
    width: 74%;
    height: 80%;
  }

  .result__bubble-inner {
    x: 24%;
    y: 15%;
    width: 66%;
    height: 80%;
  }

  .result__content {
    gap: 60px;
  }

  .question1__title {
    font-size: 6.2vw;
    line-height: 6.6vw;
    max-width: 80%;
    padding-top: 12vh;
  }

  .question1__clouds {
    flex-direction: column;
    align-items: flex-start;
    /* A слева */
    gap: 2rem;
    /* height: auto; */
    top: 0%;
    left: -4%;

  }

  .question1__cloud {
    height: 44%;
  }

  .question1__cloud:last-child {
    top: -26%;
    left: 32%;
    align-self: center;
  }

  .question {
    gap: 1.5vh;
  }

  .question__options {
    flex-direction: column;
    align-content: center;
    align-self: center;
    max-width: 450px;
  }

  .advice {
    padding-top: 4vh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .advice__photo {
    max-width: 41vw;
  }

  .advice__content {
    max-width: 90vw;
  }

  .screen__decor {
    display: none;
  }
}

@media (max-height: 770px) {
  .question1__title {
    padding: 12vh 0 0 4vw;
    font-size: 4.2vh;
    line-height: normal;
  }
  .question__title{
    font-size: 4.2vh
  }

  .question1__clouds {
    top: 11%;
  }

  .question1__cloud {
    height: 70%;
  }
  .question{
    max-width: 1100px;
  }
  /* .screen {
    overflow-y: auto;
  } */
}
@media (max-height:650px) {
  .question{
    max-width: 850px;
  }
}
@media (max-width: 845px) and (max-height: 500px) {
  .question1__title {
    font-size: 4.2vw;
  }
  .question {
    max-width: 600px;
  }
.question__options{
  flex-direction: row;
}
  .question1__clouds {
    top: 18%;
  }

  .logo--top {
    max-width: 15vw;
  }

  .logo--bottom {
    max-width: 20vw;
  }

  .advice__photo {
    max-width: 10vw;
  }
}

@media (max-width: 650px) {
  .welcome__shape {
    left: -13%;
  }

  .back-button span {
    display: none;
  }

  .question1__cloud {
    height: 38%;
  }
}

@media (max-width: 450px) {
  .header {
    align-items: flex-start;
    padding: 0 0.7vw 0 2.9vw;
  }

  .header__logo {
    gap: 2.7vw;
  }

  .header__logo-main {
    width: 3vh;
  }

  .logo--top {
    top: 7vh;
    right: 5.5vw;
  }

  .logo--bottom {
    bottom: 2%;
    right: 5.2vw;
    width: 39.4vw;
  }

  .back-button {
    bottom: 1vh;
    padding: 10px;
  }

  .screen__decor {
    width: 45vw;
  }

  .welcome__shape,
  .result__shape {
    left: -8%;
    height: 50%;
  }

  .question {
    position: relative;
    gap: 1.3vh;
  }

  .question__header {
    padding: 2.4vh 7.8vw;
  }

  .question__title,
  #screen4 .question__title {
    font-size: 7vw;
    line-height: 7.2vw;
  }

  .question1__cloud {
    height: 32%;
  }

  .question1__cloud:last-child {
    top: -7%;
    left: 25%;
  }

  .result__bubble-inner {
    x: 22%;
    width: 63%;
  }
  .result__content{
    gap: 25px;
  }
  .result__title{
    font-size: 65px;
    line-height: normal;
  }
  .advice__photo {
    max-width: 50vw;
  }

  .screen__decor {
    display: none;
  }
}

@media (max-width: 385px) {

      .question1__clouds {
        top: 4%;
    }
    .question1__cloud {
        height: 26%;
    }
    .question1__cloud:last-child {
        top: -10%;
    }
}
@media (max-width: 350px) {

  .welcome__shape,
  .result__shape {
    left: -5%;
    height: 43%;
  }
}


.question__options,
.advice__title,
.advice__text,
.advice__button,
.advice__photo,
.question1__title,
.question__title {
    opacity: 0;
}
#screen0 .welcome__title,
#screen0 .welcome__text,
#screen0 .welcome__button {
    opacity: 1;
}