html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  touch-action: none;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: #000;
}

#game-container {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1e1e;
}

canvas {
  display: block;
}

.mobile-controls-panel {
  display: none;
  flex: 0 0 clamp(106px, 12vw, 176px);
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 10;
  position: relative;
  overflow: hidden;
}

.mobile-control-zone {
  position: absolute;
  inset-inline: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(72px, 9vw, 132px);
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9), 0 0 18px rgba(255, 255, 255, 0.2);
}

.mobile-control-zone.up {
  top: 0;
  bottom: 50%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-control-zone.down {
  top: 50%;
  bottom: 0;
}

.mobile-control-zone.fire {
  inset-block: 0;
  color: rgba(255, 96, 80, 0.92);
  font-size: clamp(84px, 11vw, 152px);
}

.mobile-control-zone.fire::before {
  content: "";
  width: min(72%, 148px);
  aspect-ratio: 1;
  background-image: url("/static/assets/aim2.png?v=aim2-1");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.8));
}

.mobile-control-zone.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.mobile-control-zone.fire.active {
  background: rgba(255, 60, 45, 0.2);
  color: #ffb3aa;
}

.mobile-control-zone.ground-left,
.mobile-control-zone.ground-right {
  inset-block: 0;
  font-size: clamp(84px, 11vw, 152px);
  color: rgba(255, 255, 255, 0.9);
}

.air-defense-upgrade-button {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3.8vh, 42px);
  transform: translateX(-50%);
  z-index: 30;
  min-width: clamp(132px, 18vw, 220px);
  height: clamp(44px, 7vh, 68px);
  border: 3px solid #f0d16a;
  border-radius: 8px;
  background: rgba(45, 63, 70, 0.94);
  color: #fff;
  font-size: clamp(18px, 2.8vw, 30px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.72);
}

.air-defense-upgrade-button.active {
  background: rgba(68, 87, 95, 0.98);
  transform: translateX(-50%) translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.72);
}

#orientation-gate {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  z-index: 100;
}

.orientation-card {
  text-align: center;
  padding: 28px;
}

.orientation-icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 18px;
}

.orientation-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
}

.orientation-text {
  font-size: 18px;
  opacity: 0.8;
}

.mobile-device .mobile-controls-panel {
  display: flex;
}

.mobile-device #app-shell {
  display: flex;
}

.mobile-device #orientation-gate {
  display: none;
}

@media (orientation: portrait) {
  .mobile-device #app-shell {
    display: none;
  }

  .mobile-device #orientation-gate {
    display: flex;
  }
}

.orientation-blocked #app-shell {
  display: none;
}

.orientation-blocked #orientation-gate {
  display: flex;
}
