@font-face {
  font-family: "AxiformaBlack";
  src: url("./fonts/Axiforma-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

.screen{
  height: 100vh;
  overflow: hidden;
}

body {
  background-image: url("assets/bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100vh;
}

.site-logo {
  position: absolute;
  top: 70px;
  left: 90px;
  width: 150px;
  height: auto;
  z-index: 1000;
}

@media(max-width: 600px) {
  .site-logo {
    width: 80px;
    top: 20px;
    left: 20px;
  }
}

.play-btn {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);

  padding: 40px 100px;
  font-size: 60px;

  font-family: "AxiformaBlack", sans-serif;
  font-weight: 900;

  background-color: #f0fe75;
  color: #000;
  border: none;
  border-radius: 30px;
  cursor: pointer;

  box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  transition: all 0.3s ease;

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

  line-height: 1;

  padding-top: 30px;
  padding-bottom: 20px;

  animation: floatBtn 2.5s ease-in-out infinite;
}

@keyframes floatBtn {
  0% { transform: translateX(-50%) scale(1);}
  50% { transform: translateX(-50%) scale(1.08);}
  100% { transform: translateX(-50%) scale(1);}
}

.mute-btn {
  position: absolute;
  top: 90px;
  right: 120px;

  font-size: 50px;
  background: rgb(255, 255, 255);
  color: white;
  border: none;
  border-radius: 50%;
  width: 90px;
  height: 90px;

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

  cursor: pointer;
  backdrop-filter: blur(5px);

  transition: all 0.3s ease;
}

.sound-icon {
  width: 90px;
  height: 90px;
}

.game-title {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: min(640px, 70vw);
  max-width: 90%;

  animation: titleFloat 4s ease-in-out infinite;
}

/* На низком окне — заголовок чуть выше и чуточку меньше,
   чтобы не перекрывать кнопку ИГРАТЬ и не обрезаться сверху. */
@media (max-height: 800px){
  .game-title {
    top: 32%;
    width: min(600px, 68vw);
  }
}
@media (max-height: 700px){
  .game-title {
    top: 29%;
    width: min(560px, 64vw);
  }
}

@keyframes titleFloat {
  0% { transform: translate(-50%, -50%) translateY(0px); }
  50% { transform: translate(-50%, -50%) translateY(-12px); }
  100% { transform: translate(-50%, -50%) translateY(0px); }
}

/* анимация улёта влево */
.fly-right {
  animation: flyRight 1.1s cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes flyRight {
  to {
    left: 120%;
    opacity: 0;
  }
}

@font-face{
  font-family: "Axiforma-Black";
  src: url("fonts/Axiforma-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
}

/* “доска” по центру */
.board{
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 160px 40px 40px 40px;
}

/* сетка 2 колонки (92% от холста — при масштабе расстояние до крестов не меняется) */
.cards-grid{
  width: min(1100px, 92%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 48px;
  margin-top: 8px;
  justify-self: center;
}

/* Вопрос над сеткой карточек */
.question{
  width: min(1100px, 92%);

  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  font-family: "AxiformaBlack", sans-serif;
  font-weight: 900;
  font-size: 30px;
  line-height: 1.2;

  margin-bottom: 30px;
  margin-top: -50px;

  color: #ffffff;
  text-transform: uppercase;
  text-shadow: #0000005e 0px 5px 5px;
}

/* контейнер карточки */
.card{
  height: 150px;
  perspective: 1200px;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  animation: popIn 0.8s ease forwards;
}

.card:nth-child(1){ animation-delay: 0.05s; }
.card:nth-child(2){ animation-delay: 0.15s; }
.card:nth-child(3){ animation-delay: 0.25s; }
.card:nth-child(4){ animation-delay: 0.35s; }
.card:nth-child(5){ animation-delay: 0.45s; }
.card:nth-child(6){ animation-delay: 0.55s; }

@keyframes popIn{
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* внутренняя часть переворота */
.card-inner{
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
}

/* переворот */
.card.is-flipped .card-inner{
  transform: rotateX(180deg);
}

/* стороны */
.card-face{
  position: absolute;
  inset: 0;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  font-family: "Axiforma-Black", sans-serif;
}

/* лицевая сторона */
.card-front{
  background: linear-gradient(90deg, #f0fe75, #f0fe75);
  color: #fff5fd;
  font-size: 90px;
  text-shadow: 1px 6px 6px rgba(0, 0, 0, 0.794);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.68);
}

/* обратная сторона */
.card-back{
  transform: rotateX(180deg);
  background: linear-gradient(90deg, #cc2ba4, #e9e9e9);
  color: #ffffff;
  font-size: 48px;
  padding: 0 18px;
  box-shadow: 0 18px 35px rgba(0,0,0,0.35);
}

.card-back-content{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.card-word{
  flex: 1 1 auto;
  text-align: left;
  font-size: 40px;
  color: #f6f7f9;
  padding-left: 14px;
  letter-spacing: 0.6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 0.95;
  text-transform: uppercase;
}

.card-sep{
  width: 6px;
  height: 56%;
  margin: 0 18px;
  border-radius: 4px;
  background: linear-gradient(180deg,#ffffff55,#00000022);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
  flex: 0 0 6px;
}

.card-score{
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  min-width: 72px;
  background: linear-gradient(180deg,#bfe8ee,#83ecf9);
  color: #ffffff;
  font-size: 40px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  text-shadow: #00000096 0px 3px 6px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

/* кресты */
.crosses{
  position: absolute;
  top: 489px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0px;
  cursor: pointer;
}

.left-crosses{ left: 60px; }
.right-crosses{ right: 60px; }

/* Чем уже окно — тем ближе кресты к карточкам (не обрезаются) */
@media (min-width: 1101px) and (max-width: 1500px){
  .left-crosses{ left: 40px; }
  .right-crosses{ right: 40px; }
}
@media (min-width: 1101px) and (max-width: 1300px){
  .left-crosses{ left: 28px; }
  .right-crosses{ right: 28px; }
}
@media (min-width: 1101px) and (max-width: 1300px){
  .left-crosses{ left: 18px; }
  .right-crosses{ right: 18px; }
}
@media (min-width: 1101px) and (max-height: 800px){
  .left-crosses{ left: 28px; }
  .right-crosses{ right: 28px; }
}
@media (min-width: 1101px) and (max-height: 700px){
  .left-crosses{ left: 18px; }
  .right-crosses{ right: 18px; }
}

.cross{
  width: 200px;
  height: auto;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Кресты используют базовые размеры и масштабируются
   вместе со всей сценой через transform у .ui-wrap */

.cross:hover{ transform: scale(1.05); }

/* nav-кнопки скрываются вместе с gameScreen (display:none на родителе) */

/* show класс */
.nav-btn.show{
  opacity: 1;
}

/* анимации выхода/входа */
.cards-grid.is-exiting{
  animation: cardsOut 0.55s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes cardsOut{
  to{ transform: translateY(60px); opacity: 0; }
}

.cards-grid.is-entering{
  animation: cardsIn 0.55s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes cardsIn{
  from{ transform: translateY(-30px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}

.cards-grid{ will-change: transform, opacity; }

/* темы */
.theme-purple .card-front{
  background: linear-gradient(90deg, #d36135, #d36135);
  color: #ffffff;
  text-shadow: 1px 6px 6px rgba(0, 0, 0, 0.794);
}

.theme-blue .card-front{
  background: linear-gradient(90deg, #00d7ff, #00d7ff);
  color: #ffffff;
  text-shadow: 1px 6px 6px rgba(0, 0, 0, 0.794);
}

.theme-ka .card-front{
  background: linear-gradient(90deg, #b361c7, #b361c7);
  color: #ffffff;
  text-shadow: 1px 6px 6px rgba(0, 0, 0, 0.794);
}

.theme-green .card-front{
  background:#90ef5c;
  color: #ffffff;
  text-shadow: 1px 6px 6px rgba(0, 0, 0, 0.794);
}

/* =========================================
   NAV BUTTONS (FIXED)
   ========================================= */

/* HARD FIX: стрелки никогда не станут огромными */
#nextBtn, #backBtn{
  width: clamp(60px, 8vw, 120px) !important;
  height: auto !important;
  max-width: 120px !important;
  max-height: 120px !important;
}

/* базовые стили и позиционирование ОТ ЦЕНТРА */
.nav-btn{
  position: absolute;
  bottom: 50px;
  left: 50%;
  width: 120px;
  cursor: pointer;
  z-index: 9999;
  opacity: 1;

  --tx: 0px;
  --hoverScale: 1;

  transform: translateX(-50%) translateX(var(--tx)) scale(var(--hoverScale));
  transition: opacity 0.4s ease, transform 0.2s ease;
}

/* Чем меньше окно — тем выше кнопки Next/Back (не обрезаются снизу) */
@media (min-width: 1101px) and (max-width: 1500px){
  .nav-btn{ bottom: 65px; }
}
@media (min-width: 1101px) and (max-width: 1300px){
  .nav-btn{ bottom: 82px; }
}
@media (min-width: 1101px) and (max-width: 1300px){
  .nav-btn{ bottom: 95px; }
}
@media (min-width: 1101px) and (max-height: 800px){
  .nav-btn{ bottom: 85px; }
}
@media (min-width: 1101px) and (max-height: 700px){
  .nav-btn{ bottom: 100px; }
}

/* разнести от центра */
.back-btn{ --tx: -260px; }
.next-btn{ --tx:  260px; }


/* hover */
.nav-btn:hover{
  --hoverScale: 1.08;
}

/* прочее */
.small-text .card-word { font-size: 35px; }

.no-wrap .card-word {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 32px;
}

.small-text .card-front{
  background: linear-gradient(90deg, #ff97e5, #ff97e5);
  color: #ffffff;
  text-shadow: 1px 6px 6px rgba(0, 0, 0, 0.794);
}

.small .card-word{ font-size: 34px; }

/* финальный экран.
   Фон берём из body, чтобы не было \"ступенек\"/полос
   из‑за масштабирования .ui-wrap. */
#endScreen{
  position: absolute;
  inset: 0;
  z-index: 3000;
  text-align: center;
  background: transparent;
}

.end-qr{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 700px;
  max-width: 85vw;

  animation:
    qrFadeIn 0.8s cubic-bezier(.2,.9,.2,1) forwards,
    qrPulse 2.5s ease-in-out infinite;
  animation-delay: 0s, 0.9s;
}

/* FIX: у тебя был сломан keyframes */
@keyframes qrFadeIn{
  from{
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85);
  }
  to{
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes qrPulse{
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.05); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* текст */
.end-text{
  position: absolute;
  top: 190px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "AxiformaBlack", sans-serif;
  font-weight: 200px;
  font-size: 40px;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.1;
  text-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.end-sub{
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "AxiformaBlack", sans-serif;
  font-weight: 900;
  font-size: 56px;
  color: #fff;
  text-transform: uppercase;
  text-shadow:
    0 2px 2px rgba(153, 20, 115, 0.95),
    0 6px 10px rgba(153, 20, 115, 0.60),
    0 14px 30px rgba(153, 20, 115, 0.35);
}

.fly-away{
  animation: flyAway 0.55s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes flyAway{
  to{
    transform: translateY(80px);
    opacity: 0;
  }
}

@keyframes endPop{
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes endPopText{
  to{ opacity: 1; transform: translateY(0); }
}

body.is-end #backBtn{
  left: 50%;
  --tx: 0px;
  bottom: 10px;
}

body.is-end #nextBtn{
  display: none;
}

#muteBtn{
  z-index: 9999;
  position: absolute;
}

.hidden { display: none; }

.game-block {
  display: none;
}
.game-block.active {
  display: block;
}

/* На ноутбуках/десктопах все экраны вопросов лежат друг на друга,
   чтобы следующий вопрос не \"подглядывал\" снизу. */
@media (min-width: 1101px){
  .game-block{
    position: absolute;
    inset: 0;
  }
}

.hidden{ display: none !important; }

/* ==============================================
   UI WRAP — единый масштаб для всех экранов
   Дизайн сделан под 1728px (MacBook 16 Pro Max)
   scale = viewport_width / 1728
   ============================================== */

#gameScreen{
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#startScreen{
  overflow: hidden;
}

/* -----------------------------------------------
   ui-wrap — дизайн-пространство 1728×1000px.
   Вся игра живёт внутри этого холста и
   масштабируется как единое целое.
   ----------------------------------------------- */
.ui-wrap{
  width: 1728px;
  height: 1000px;
  overflow: hidden;
  position: absolute;
  left: 50%;
  margin-left: -864px; /* центрируем по горизонтали */
  top: 0;
  transform-origin: center top;
}

/* ========== МАСШТАБ С 1700px (числа, не vw/vh — scale() принимает только число) ==========
   Кресты, карточки и вопрос уменьшаются по ширине и высоте. Вставьте весь файл в style.css на Beget. */
@media (min-width: 1101px) and (max-width: 1700px){
  #gameScreen .ui-wrap{
    transform: scale(0.98);
    will-change: transform;
  }
}
@media (min-width: 1101px) and (max-width: 1600px){
  #gameScreen .ui-wrap{
    transform: scale(0.92);
  }
}
@media (min-width: 1101px) and (max-width: 1500px){
  #gameScreen .ui-wrap{
    transform: scale(0.86);
  }
}
@media (min-width: 1101px) and (max-width: 1400px){
  #gameScreen .ui-wrap{
    transform: scale(0.80);
  }
}
@media (min-width: 1101px) and (max-width: 1300px){
  #gameScreen .ui-wrap{
    transform: scale(0.74);
  }
}
@media (min-width: 1101px) and (max-width: 1200px){
  #gameScreen .ui-wrap{
    transform: scale(0.68);
  }
}
@media (min-width: 1101px) and (max-width: 1100px){
  #gameScreen .ui-wrap{
    transform: scale(0.62);
  }
}
/* Низкое окно: дополнительно уменьшаем по высоте (последние в каскаде — побеждают при малой высоте) */
@media (min-width: 1101px) and (max-height: 900px){
  #gameScreen .ui-wrap{
    transform: scale(0.80);
  }
}
@media (min-width: 1101px) and (max-height: 800px){
  #gameScreen .ui-wrap{
    transform: scale(0.70);
  }
}
@media (min-width: 1101px) and (max-height: 700px){
  #gameScreen .ui-wrap{
    transform: scale(0.60);
  }
}

/* ==============================================
   СТАРТ-ЭКРАН — адаптация заголовка и кнопки ИГРАТЬ
   на ноутбуках с меньшим экраном
   ============================================== */

@media (max-width: 1600px){
  .play-btn{
    font-size: 52px;
    padding: 32px 88px;
    bottom: 110px;
  }
}

@media (max-width: 1440px){
  .play-btn{
    font-size: 46px;
    padding: 28px 78px;
    bottom: 100px;
  }
}

@media (max-width: 1280px){
  .play-btn{
    font-size: 42px;
    padding: 24px 70px;
    bottom: 90px;
  }
}

@media (max-width: 768px){
  .play-btn{
    font-size: 36px;
    padding: 18px 50px;
    bottom: 70px;
    border-radius: 20px;
  }
  .game-title{
    width: 90%;
  }
}

@media (max-width: 480px){
  .play-btn{
    font-size: 28px;
    padding: 14px 40px;
    bottom: 50px;
    border-radius: 16px;
  }
}

/* ==============================================
   ПЛАНШЕТЫ / ПОРТРЕТНЫЕ НОУТБУКИ (601px – 1100px)
   Нет крестов, карточки в одну колонку, стрелки внизу.
   Выше 1100px используется масштабируемый лейаут с крестами.
   ============================================== */

@media (min-width: 601px) and (max-width: 1100px){

  /* Отключаем scale — используем свой лейаут */
  .ui-wrap{
    width: 100% !important;
    transform: none !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    position: relative !important;
    left: 0 !important;
    margin-left: 0 !important;
  }

  #gameScreen{
    height: 100svh;
    overflow: hidden;
  }

  /* Лого */
  .site-logo{
    width: 80px;
    top: 20px;
    left: 20px;
  }

  /* Звук */
  .mute-btn{
    width: 65px;
    height: 65px;
    top: 20px;
    right: 20px;
  }
  .sound-icon{
    width: 65px;
    height: 65px;
  }

  /* Доска */
  .board{
    padding: 100px 24px 110px;
    min-height: 100svh;
    align-items: center;
  }

  /* Вопрос */
  .question{
    width: 100%;
    font-size: 22px;
    height: auto;
    margin-top: 0;
    margin-bottom: 18px;
    line-height: 1.3;
  }

  /* Карточки — одна колонка */
  .cards-grid{
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card{
    height: 92px;
  }

  .card-face{
    border-radius: 20px;
  }

  .card-front{
    font-size: 56px;
  }

  .card-back{
    padding: 0 16px;
  }

  .card-word{
    font-size: 28px;
    padding-left: 10px;
  }

  .small-text .card-word{ font-size: 24px; }
  .small .card-word      { font-size: 24px; }
  .no-wrap .card-word    { font-size: 22px; }

  .card-sep{
    margin: 0 12px;
  }

  .card-score{
    width: 64px;
    height: 64px;
    min-width: 60px;
    font-size: 28px;
    border-radius: 10px;
  }

  /* Кресты — скрыть */
  .crosses{
    display: none;
  }

  /* Порядок карточек 1→2→3→4→5→6 в одну колонку */
  .cards-grid .card:nth-child(1){ order: 1; }
  .cards-grid .card:nth-child(2){ order: 4; }
  .cards-grid .card:nth-child(3){ order: 2; }
  .cards-grid .card:nth-child(4){ order: 5; }
  .cards-grid .card:nth-child(5){ order: 3; }
  .cards-grid .card:nth-child(6){ order: 6; }

  /* Стрелки навигации */
  #nextBtn, #backBtn{
    width: 90px !important;
    max-width: 90px !important;
  }

  .nav-btn{
    position: fixed;
    bottom: 18px;
    z-index: 9999;
  }

  /* Финальный экран на планшете (601–1100px ширина):
     Жёстко центрируем QR, текст сверху и снизу. */
  #endScreen{
    position: fixed;
    inset: 0;
    z-index: 9000;
    text-align: center;
  }

  .end-text{
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
  }

  .end-qr{
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(360px, 70vw);
  }

  .end-sub{
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
  }
}

/* ==============================================
   МОБИЛЬНЫЙ ПОРТРЕТ (телефоны ≤ 600px)
   Отдельный лейаут — scale здесь не работает
   ============================================== */

.rotate-hint{ display: none; }

@media (max-width: 600px){

  /* Сбрасываем масштабирование ui-wrap */
  .ui-wrap{
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    transform: none !important;
    position: relative !important;
    left: 0 !important;
    margin-left: 0 !important;
  }

  #gameScreen{
    height: 100svh;
    overflow: hidden;
  }

  /* Лого */
  .site-logo{
    width: 55px;
    top: 14px;
    left: 14px;
  }

  /* Звук */
  .mute-btn{
    width: 48px !important;
    height: 48px !important;
    top: 14px;
    right: 14px;
    font-size: 0;
  }
  .sound-icon{
    width: 36px !important;
    height: 36px !important;
  }

  /* Доска */
  .board{
    padding: 74px 14px 120px;
    min-height: 100svh;
    align-items: center;
  }

  /* Вопрос */
  .question{
    width: 100%;
    font-size: 15px;
    height: auto;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.3;
  }

  /* Сетка карточек — одна колонка */
  .cards-grid{
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Карточки — уменьшены чтобы не перекрывались стрелками */
  .card{
    height: 64px;
  }

  .card-face{
    border-radius: 14px;
  }

  .card-front{
    font-size: 38px;
  }

  .card-back{
    padding: 0 10px;
  }

  .card-word{
    font-size: 16px;
    line-height: 1.0;
    padding-left: 8px;
  }

  .small-text .card-word{ font-size: 13px; }
  .small .card-word{ font-size: 13px; }
  .no-wrap .card-word{ font-size: 12px; }

  .card-sep{
    margin: 0 8px;
    width: 4px;
    flex: 0 0 4px;
  }

  .card-score{
    width: 42px;
    height: 42px;
    min-width: 38px;
    font-size: 20px;
    border-radius: 8px;
  }

  /* Убираем большую тень — она "перетекает" между карточками из-за z-index по DOM-порядку */
  .card-front{
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  }
  .card-back{
    box-shadow: 0 3px 8px rgba(0,0,0,0.20);
  }

  /* Кресты — прячем, они мешают на узком экране */
  .crosses{
    display: none;
  }

  /* Порядок карточек 1→2→3→4→5→6 в одну колонку */
  .cards-grid .card:nth-child(1){ order: 1; }
  .cards-grid .card:nth-child(2){ order: 4; }
  .cards-grid .card:nth-child(3){ order: 2; }
  .cards-grid .card:nth-child(4){ order: 5; }
  .cards-grid .card:nth-child(5){ order: 3; }
  .cards-grid .card:nth-child(6){ order: 6; }

  /* Финальный экран на телефоне */
  #endScreen{
    position: fixed;
    inset: 0;
    z-index: 9000;
  }

  .end-text{
    font-size: 22px;
    top: 100px;
    white-space: normal;
    width: 85%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
  }

  .end-qr{
    width: min(280px, 75vw);
    top: 50%;
  }

  .end-sub{
    font-size: 28px;
    bottom: 100px;
  }

  /* Кнопки навигации — фиксированы к низу экрана */
  #nextBtn, #backBtn{
    width: 72px !important;
    max-width: 72px !important;
  }

  .nav-btn{
    position: fixed;
    bottom: 22px;
    z-index: 9999;
  }

  .back-btn{ --tx: -110px; }
  .next-btn{ --tx:  110px; }
}

/* ==============================================
   ТЕЛЕФОН ГОРИЗОНТАЛЬНО — разрешаем скролл
   ============================================== */

@media (max-width: 900px) and (orientation: landscape){
  html, body{
    overflow: auto;
    height: auto;
  }

  #gameScreen{
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .board{
    min-height: auto;
    padding-bottom: 100px;
  }

  /* Стрелки фиксированы к экрану при скролле */
  .nav-btn{
    position: fixed;
    bottom: 14px;
    z-index: 9999;
  }
}

/* (специальной логики для низких ноутбуков больше нет —
   интерфейс целиком подстраивается за счёт масштабирования
   .ui-wrap и уменьшения размеров текста/карт на брейкпоинтах) */