html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0d1424;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  /* Требование 1.6.1.8 / 1.6.2.7: лонгтап по полю не выделяет текст
     и не открывает контекстное меню */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

#unity-container.unity-mobile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Игра занимает всё окно: контейнер растянут на весь экран, а игровая
   область внутри него подобрана по пропорциям игры (см. fullscreen.js). */
#unity-container.unity-desktop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#unity-fullscreen-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1424;
}

/* Игровая область: здесь живут холст и начальный экран. Пропорции
   сохраняются, размер задаёт fullscreen.js — с учётом окна, полного
   экрана и ограничения по весу рендера. */
#unity-game-box {
  position: relative;
  width: 100%;
  height: 100%;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #0d1424;
}

/* Начальный экран: полноэкранная картинка в стиле главного меню
   и полоса загрузки. Прячется, когда движок Unity запустился. */
#unity-splash {
  position: absolute;
  inset: 0;
  /* Картинка тянется ровно на размер холста игры: у них одинаковое
     соотношение сторон, поэтому на компьютере это точное совпадение, а на
     телефоне пейзаж остаётся пропорциональным, а не обрезается по краям
     (иначе при переходе в меню картинка смещалась бы). */
  background: #0d1424 url("splash.png") center/100% 100% no-repeat;
  z-index: 10;
}

/* Заставка убирается без затухания: кадр заставки и кадр меню совпадают,
   поэтому полупрозрачное наложение только двоило бы картинку. */
#unity-splash.hidden {
  opacity: 0;
  pointer-events: none;
}

#unity-splash-percent {
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 14%;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
  color: rgba(224, 235, 255, 0.85);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

#unity-splash-bar {
  position: absolute;
  left: 32%;
  right: 32%;
  bottom: 9%;
  height: 16px;
  border-radius: 999px;
  background: rgba(5, 9, 17, 0.75);
  overflow: hidden;
}

#unity-splash-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: #2eb8fa;
  transition: width 0.2s linear;
}

/* Кнопка полноэкранного режима живёт в углу экрана поверх игры.
   Подвал не должен перехватывать клики по игре, поэтому кликает только
   сама кнопка. */
#unity-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  pointer-events: none;
}

#unity-fullscreen-button {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 40;
  border: 2px solid rgba(224, 235, 255, 0.4);
  border-radius: 10px;
  background: rgba(13, 20, 36, 0.5);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

#unity-fullscreen-button:hover {
  opacity: 1;
}

/* Иконка «развернуть во весь экран» — рамка в углу кнопки */
#unity-fullscreen-button::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  right: 9px;
  bottom: 9px;
  border: 2px solid rgba(224, 235, 255, 0.7);
  border-radius: 2px;
}

/* В полноэкранном режиме кнопка не нужна */
body.in-fullscreen #unity-fullscreen-button {
  display: none;
}

/* Подсказка: полный экран включится по первому нажатию */
#fullscreen-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(13, 20, 36, 0.7);
  color: rgba(224, 235, 255, 0.85);
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 45;
  transition: opacity 0.5s ease;
}

#unity-warning {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: none;
  z-index: 20;
}

/* Подсказка о повороте устройства */
#rotate-hint {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d1424;
  color: #e8f2ff;
  z-index: 100;
  text-align: center;
}

#rotate-hint .rotate-icon {
  font-size: 72px;
  animation: rotateAnim 1.8s ease-in-out infinite;
}

#rotate-hint .rotate-text {
  font-size: 22px;
  line-height: 1.5;
}

@keyframes rotateAnim {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}
