html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  /* Отключаем дабл-тап зум и лишние жесты на мобилках */
  touch-action: manipulation;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

button:focus {
  outline: none;
}

#game-root {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #000;
  overflow: hidden;
}

#game-canvas {
  position: relative;
  width: 1080px;
  height: 1920px;
  background-color: #000;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

.swipe-bubble {
  position: absolute;
  bottom: -20%;
  transform: translateX(-50%);
  background: #fff;
  color: #000;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
  animation: bubble-up 2.5s linear forwards;
}

@keyframes bubble-up {
  from {
    bottom: -20%;
    opacity: 1;
  }
  to {
    bottom: 110%;
    opacity: 1;
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}

.screen--active {
  display: block;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1000;
  text-align: center;
  padding: 16px;
}

.overlay__content {
  max-width: 320px;
}

.overlay--orientation {
  /* будет управляться через JS */
}

.overlay--loader {
  display: flex;
  z-index: 900;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  margin: 0 auto 12px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.game-stub {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.game-stub__title {
  font-size: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.game-stub__back {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #000;
  font-size: 16px;
  cursor: pointer;
}

.game-stub__back:active {
  transform: scale(0.96);
}

.second-screen {
  position: relative;
  background-color: #121c2e;
}

.second-layout {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(50%);
  width: 100%;
  /* Высота считается автоматически по ширине через aspect-ratio,
     чтобы сетка масштабировалась пропорционально */
  aspect-ratio: 1080 / 1023;


  position: absolute;
  left: 0;
  right: 0;
  top: 30%;
  transform: translateY(10%);
  width: 100%;
  aspect-ratio: 1080 / 1223;
}

.second-topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 10.97%; /* ≈ 112.5 / 1023, под иконки 2.5x */
  display: flex;
  align-items: center;
  padding: 0 2.5926%; /* те же 28px отступа, что и у портретов */
  box-sizing: border-box;
}

.second-topbar-left,
.second-topbar-right {
  display: flex;
  gap: 1.157%; /* ~12.5 / 1080, 2.5x шире */
  flex: 1;
}

.second-topbar-left {
  justify-content: flex-start;
}

.second-topbar-right {
  justify-content: flex-end;
}

.second-topbar-icon {
  width: 10.4167%; /* 112.5 / 1080 ≈ 2.5x больше */
  aspect-ratio: 1 / 1;
}

.second-progress-row {
  position: absolute;
  left: 0;
  right: 0;
  top: 10.97%; /* сразу под иконками */
  height: 0.78%; /* ≈ 8 / 1023, толще прогресс-бар */
  display: flex;
}

.second-progress {
  flex: 1;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.second-progress__inner {
  height: 100%;
  width: 0;
  background: #ffffff;
}

.second-progress--left .second-progress__inner {
  background: #ff4b4b; /* красный для левого игрока */
}

.second-progress--right .second-progress__inner {
  margin-left: auto;
  background: #3bd46a; /* зелёный для правого игрока */
}

.second-slot {
  position: absolute;
  object-fit: cover;
}

.second-bottom-img {
  width: -webkit-fill-available;
  height: -webkit-fill-available;
  max-height: 100%;
  max-width: 100%;

  object-fit: cover;
  pointer-events: none;
}

.second-bottom-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  cursor: pointer;
}

.second-bottom-hit--left {
  left: 0;
}

.second-bottom-hit--right {
  right: 0;
}

.second-slot--left {
  left: 2.5926%; /* 28 / 1080 */
  top: 12.5%; /* под более высокой полоской и прогрессом */
  width: 47.4074%; /* 512 / 1080 */
  /* Соотношение сторон картинки 512x569 */
  aspect-ratio: 512 / 569;
}

.second-slot--right {
  right: 2.5926%; /* симметричный отступ справа */
  top: 12.5%;
  width: 47.4074%;
  aspect-ratio: 512 / 569;
}

.second-slot--bottom {
  left: 2.5926%; /* 28 / 1080 */
  bottom: 0;
  width: 94.8148%; /* 1024 / 1080 */
  /* Соотношение сторон нижнего блока 1024x454 */
  aspect-ratio: 1024 / 454;
}

@media (orientation: landscape) {
  /* На всякий случай: игра всё равно будет заблокирована через оверлей */
}


