/* Desktop / laptop: fit to viewport height, no page scroll */
@media (min-width: 769px) {
  html,
  body {
    overflow: hidden;
    height: 100dvh;
  }

  .main {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .video-block {
    height: 100dvh;
    max-height: 100dvh;
  }

  .video-block video {
    max-height: 100dvh;
  }
}

@media (max-width: 768px) and (max-height: 720px) {

  html,
  body {
    overflow-y: auto;
  }

  .main {
    min-height: 1225px;
  }
}

@media (max-height: 768px) and (max-width: 768px) {
  .video-block video {
    object-fit: contain;
  }

  .spin-section {
    top: max(400px, 45dvh);
    bottom: auto;
  }
}

@media (max-width: 1280px) {
  .spin-section {
    left: 32%;
  }

  .video-block {
    right: -4%;
  }
}

@media (max-width: 1124px) {
  :root {
    --wheel-size: 670px;
    --wheel-inner-size: 610px;
    --arrow-size: 245px;
    --button-size: 280px;
  }
}

@media (max-width: 1024px) {
  html,
  body {
    overflow-x: hidden;
  }

  .main {
    background-image: url(../assets/img/bg-mob.png) !important;
    height: 100dvh;
    min-height: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  :root {
    --wheel-size: min(670px, 92vw);
    --wheel-inner-size: calc(var(--wheel-size) * 842 / 942);
    --arrow-size: calc(var(--wheel-size) * 350 / 942);
    --button-size: calc(var(--wheel-size) * 470 / 942);
  }

  .title {
    font-size: 5vw;
  }

  .title-block {
    margin-top: 130px;
  }

  .language-select {
    right: 60px;
    top: 40px;
  }

  .spin-section {
    top: max(320px, 40dvh);
    left: 50%;
    transform: translate(-50%, 0);
    max-width: 100vw;
    overflow: visible;
  }

  .video-block {
    width: 100%;
    min-height: 350px;
    height: 45dvh;
    right: 25%;
    left: unset;
  }

  .speen-button {
    bottom: -80px;
  }
}

@media (max-width: 850px) {
  :root {
    --wheel-size: min(610px, 90vw);
    --wheel-inner-size: calc(var(--wheel-size) * 842 / 942);
    --arrow-size: calc(var(--wheel-size) * 350 / 942);
    --button-size: calc(var(--wheel-size) * 470 / 942);
  }
}

@media (max-width: 768px) {
  main.main > .logo {
    position: absolute;
    left: 5vw;
    top: 5vw;
    max-width: 195px;
    z-index: 100;
    transform: none;
    width: 27vw;
    height: auto;
  }

  :root {
    --wheel-size: min(500px, 88vw);
    --wheel-inner-size: calc(var(--wheel-size) * 842 / 942);
    --arrow-size: calc(var(--wheel-size) * 350 / 942);
    --button-size: calc(var(--wheel-size) * 470 / 942);
  }

  .popup-btn {
    font-size: 22px;
    max-width: 210px;
    height: 48px;
  }

  .bonus-popup__block {
    padding: 35px 0 42px 0;
  }
}

@media (max-width: 580px) {
  :root {
    --wheel-size: min(375px, 88vw);
    --wheel-inner-size: calc(var(--wheel-size) * 842 / 942);
    --arrow-size: calc(var(--wheel-size) * 350 / 942);
    --button-size: calc(var(--wheel-size) * 470 / 942);
  }

  .video-block {
    right: 0;
    left: 0;
  }

  .language-select {
    right: 20px;
    top: 30px;
  }

  .active-lang button {
    font-size: 20px;
  }

  .lang-list button {
    font-size: 18px;
  }

  .speen-button {
    bottom: -35px;
  }

  .won-popup__block {
    padding: 40px 0;
  }
}

@media (max-width: 550px) {

  html,
  body {
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .main {
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    max-width: 100%;
  }

  .spin-section {
    position: static;
    margin: -8vw auto 0;
    top: auto;
    left: auto;
    bottom: auto;
    transform: none;
    padding-bottom: 45px;
    box-sizing: content-box;
    width: var(--wheel-size);
    max-width: 100vw;
  }

  .video-block {
    position: static;
    inset: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    align-self: stretch;
  }

  .video-block video {
    object-position: center top;
    object-fit: cover;
    width: 100%;
  }
}

@media (max-width: 550px) and (min-height: 750px) {
  .main {
    flex-direction: column-reverse;
    justify-content: center;
  }

  .video-block {
    position: static;
    inset: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    align-self: stretch;
  }

  .video-block video {
    object-position: center top;
  }
}

@media (max-width: 529px) and (max-height: 749px) {
  :root {
    --wheel-size: min(335px, 86vw);
    --wheel-inner-size: calc(var(--wheel-size) * 842 / 942);
    --arrow-size: calc(var(--wheel-size) * 350 / 942);
    --button-size: calc(var(--wheel-size) * 470 / 942);
  }

  .main {
    justify-content: flex-start;
    flex-direction: column;
  }

  .spin-section {
    margin: -4vw auto 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    padding-bottom: 12px;
    max-width: 100vw;
  }

  .video-block {
    min-height: 280px;
    height: 38dvh;
  }

  .speen-button {
    bottom: -28px;
  }
}

@media (max-width: 440px) {
  .language-select {
    right: 7px;
    top: 16px;
    border-radius: 8px;
  }

  .active-lang {
    padding: 2px 10px;
  }

  .lang-list {
    top: 42px;
  }

  .first-title {
    font-size: 6vw;
  }
}

@media (max-width: 375px) {
  :root {
    --wheel-size: min(100vw, 100%);
    --wheel-inner-size: calc(var(--wheel-size) * 0.894);
    --arrow-size: calc(var(--wheel-size) * 0.372);
    --button-size: calc(var(--wheel-size) * 0.499);
  }
}

/* Desktop: full wheel size */
@media (min-width: 1025px) {
  :root {
    --wheel-size: min(942px, calc(100dvh - 140px));
  }
}

/* Wide tablets (e.g. 1024×1366): wheel 20% smaller */
@media (min-width: 821px) and (max-width: 1024px) {
  :root {
    --wheel-size: min(754px, calc((100dvh - 140px) * 0.8));
  }
}

/* Narrow tablets (e.g. 820×1180): wheel 20% smaller + width/height cap */
@media (min-width: 769px) and (max-width: 820px) {
  :root {
    --wheel-size: min(536px, 74vw, calc((100dvh - 140px) * 0.8));
  }
}

/* Wheel parts scale with --wheel-size */
@media (min-width: 769px) {
  :root {
    --wheel-inner-size: calc(var(--wheel-size) * 842 / 942);
    --arrow-size: calc(var(--wheel-size) * 350 / 942);
    --button-size: calc(var(--wheel-size) * 470 / 942);
    --segment-font-size: clamp(14px, calc(var(--wheel-size) * 40 / 942), 40px);
  }

  .speen-button {
    bottom: calc(var(--wheel-size) * -150 / 942);
  }
}