/* Towny Reborn · page navigation */
#tr-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #ff2bbd;
  border-radius: 14px;
  background: #111722;
  color: #ff7cd8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .35);
  cursor: pointer;
  touch-action: manipulation;
  transition: color .15s, border-color .15s, background .15s;
}
#tr-back-to-top[hidden] { display: none !important; }
#tr-back-to-top svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#tr-back-to-top:hover {
  color: #70ff35;
  border-color: #70ff35;
  background: #182124;
}
#tr-back-to-top:focus-visible { outline: 3px solid #70ff35; outline-offset: 4px; }
body:has(.trw-lightbox.is-open) #tr-back-to-top { visibility: hidden; }
.trwiki h3[id] { scroll-margin-top: 95px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  #tr-back-to-top { transition: none; }
}
