/* Iron Rebel — bounded flagship-quality device/accessibility layer. */

#game-container {
  width: 100dvw;
  height: 100dvh;
}

.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
}

.back-link:focus-visible,
button:focus-visible {
  outline: 2px solid #ffe14d;
  outline-offset: 3px;
}

#gameCanvas {
  max-width: 100%;
  max-height: 100%;
}

@media (max-width: 520px) and (orientation: portrait) {
  .back-link {
    top: calc(6px + env(safe-area-inset-top));
    left: calc(8px + env(safe-area-inset-left));
    font-size: 11px;
  }

  #top-controls {
    top: calc(6px + env(safe-area-inset-top));
    right: calc(8px + env(safe-area-inset-right));
    gap: 6px;
  }
}

@media (max-height: 430px) and (orientation: landscape) and (pointer: coarse) {
  #joystick-zone {
    width: 104px;
    height: 104px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: calc(12px + env(safe-area-inset-left));
  }

  #joystick-inner {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
  }

  .vbtn {
    width: 60px;
    height: 60px;
  }

  #btn-jump {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  #btn-shoot {
    right: calc(84px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  #btn-weapon {
    right: calc(52px + env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
  }

  #btn-pause-touch {
    top: calc(54px + env(safe-area-inset-top));
    right: calc(10px + env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
