#game {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#ui {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#touchControls {
  --touch-action-art-filter: brightness(0) invert(0.82);
}

#loading {
  position: fixed;
  top: max(18px, var(--safe-top));
  left: 50%;
  z-index: 20;
  max-width: calc(100vw - var(--safe-left) - var(--safe-right) - 24px);
  padding: 8px 14px;
  transform: translateX(-50%);
  overflow-wrap: anywhere;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

#loading.hidden { display: none; }

/* The visible primary Create button reports model progress even when the empty
   catalog hides Join. Keep this duplicate polite status available to assistive
   technology without covering the narrow renderer switch. */
#lobby:not(.hidden) ~ #loading {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#lobbyLightingQualityToggle {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #c9bba6;
  background: #12100d;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-align: left;
}

#lobbyLightingQualityToggle:hover,
#lobbyLightingQualityToggle.active {
  color: var(--text);
  border-color: var(--accent);
}

#lobbyLightingQualityToggle.active {
  background: #331a06;
  box-shadow: inset 0 0 0 1px rgba(255, 140, 38, 0.22), 0 0 16px rgba(255, 140, 38, 0.08);
}

#lobbyLightingQualityToggle b { color: var(--dim); }
#lobbyLightingQualityToggle.active b { color: var(--accent); }

#arenaDisplayToggles #lightingQualityToggle:hover,
#arenaDisplayToggles #lightingQualityToggle.active {
  border-color: rgba(255, 140, 38, 0.86);
}

#arenaDisplayToggles #lightingQualityToggle.active {
  background: rgba(51, 26, 6, 0.94);
  box-shadow: inset 0 0 0 1px rgba(255, 140, 38, 0.18), 0 0 12px rgba(255, 140, 38, 0.18);
}

#arenaDisplayToggles #lightingQualityToggle.active::after {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(255, 140, 38, 0.9);
}
