html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0d12;
  color: #e8e2d0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Phones: no pull-to-refresh / bounce, no text selection or long-press menu, no grey tap flash. */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Unity's phone keyboard box (WebGLInput.mobileKeyboardSupport) and the desktop text overlay must stay editable —
   iOS Safari cannot focus an input under user-select: none. */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

#unity-container {
  position: fixed;
  inset: 0;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #0b0d12;
  outline: none;
  touch-action: none; /* every touch goes to the game: no browser pan / pinch zoom / double-tap zoom */
}

#jx-rotate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: #0b0d12;
  font-size: 17px;
  text-align: center;
}

#jx-rotate[hidden] {
  display: none;
}

#jx-rotate-icon {
  font-size: 56px;
  line-height: 1;
  color: #f2d27a;
}

#jx-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 32px));
  text-align: center;
}

#jx-title {
  font-size: 22px;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

#jx-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

#jx-bar-full {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #b8862f, #f2d27a);
  transition: width 0.2s ease-out;
}

#jx-status {
  margin-top: 10px;
  font-size: 13px;
  opacity: 0.75;
}

/* "Install as an app" card (index.html → beforeinstallprompt). Top right on a computer, bottom on a phone; under the
   rotate-your-phone cover and the error box. */
#jx-install {
  position: absolute;
  z-index: 9;
  top: 16px;
  right: 16px;
  width: min(360px, calc(100% - 32px));
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(242, 210, 122, 0.45);
  border-radius: 10px;
  background: rgba(16, 18, 24, 0.94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  animation: jx-install-in 0.25s ease-out;
}

#jx-install[hidden] {
  display: none;
}

@keyframes jx-install-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

#jx-install-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

#jx-install-body {
  min-width: 0;
}

#jx-install-title {
  font-size: 15px;
  font-weight: 700;
  color: #f2d27a;
}

#jx-install-text {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: #d9d3c2;
}

#jx-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

#jx-install-actions button {
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#jx-install-yes {
  background: linear-gradient(90deg, #b8862f, #f2d27a);
  color: #1a1205;
}

#jx-install-yes:hover {
  filter: brightness(1.08);
}

#jx-install-later {
  background: transparent;
  color: #e8e2d0;
}

#jx-install-later:hover {
  background: rgba(255, 255, 255, 0.08);
}

#jx-install-actions button:focus-visible {
  outline: 2px solid #f2d27a;
  outline-offset: 2px;
}

.jx-mobile #jx-install {
  top: auto;
  right: auto;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  animation: none;
}

#jx-error {
  position: absolute;
  z-index: 11; /* above the rotate-your-phone cover */
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 6px;
  background: rgba(150, 30, 30, 0.92);
  color: #fff;
  font-size: 14px;
  white-space: pre-wrap;
}
