html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: #141414;
  color: #ffffff;
}

#lang-switcher {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 1200;
  display: flex;
  gap: 6px;
}

#lang-switcher button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

#lang-switcher button.active {
  background: #c0392b;
  border-color: #c0392b;
}

#GamePhaser {
  padding: 0 8px 90px;
}

canvas {
  display: block;
  background: #000000;
  margin: 0 auto;
  width: min(calc(100vw - 16px), 800px);
  height: auto;
  max-height: 82vh;
  touch-action: none;
}

#mobile-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding:
    0 calc(16px + env(safe-area-inset-right))
    calc(10px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
  pointer-events: none;
  touch-action: none;
}

#mobile-controls.hidden {
  display: none;
}

#move-pad {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#move-knob {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(0, 0, 0, 0.25);
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -28px;
  margin-top: -28px;
  transition: transform 0.04s linear;
}

#fire-button {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(189, 40, 40, 0.85);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#fire-button:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  .jumbotron,
  footer.container-fluid {
    display: none;
  }

  body.mobile-play {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  body.mobile-play #GamePhaser {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    padding: 0;
    margin: 0;
  }

  body.mobile-play canvas {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none;
    max-height: none;
    margin: 0;
  }

  #lang-switcher {
    top: 8px;
    right: 8px;
  }

  #GamePhaser {
    padding-top: 8px;
  }
}

@media (hover: hover) and (pointer: fine) {
  #mobile-controls {
    display: none !important;
  }
}
