/* Canonical back navigation: keep the accessible text in the DOM while the
   visual control is the large fantasy arrow alone. End-of-match destination
   choices remain labelled because two adjacent arrows would be ambiguous. */
.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn),
.page-panel-head > .back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn) {
  display: inline-grid !important;
  place-items: center !important;
  width: clamp(58px, 6vw, 72px) !important;
  min-width: clamp(58px, 6vw, 72px) !important;
  max-width: clamp(58px, 6vw, 72px) !important;
  height: clamp(58px, 6vw, 72px) !important;
  min-height: clamp(58px, 6vw, 72px) !important;
  max-height: clamp(58px, 6vw, 72px) !important;
  flex: 0 0 clamp(58px, 6vw, 72px) !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline-offset: 2px;
  background: transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transform: none !important;
  -webkit-text-fill-color: transparent !important;
}

.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn)::before {
  content: "" !important;
  display: block !important;
  width: clamp(58px, 6vw, 72px) !important;
  height: clamp(58px, 6vw, 72px) !important;
  flex: 0 0 clamp(58px, 6vw, 72px) !important;
  margin: 0 !important;
  background: url("assets/ui/indietro.png") center / contain no-repeat !important;
  filter: brightness(1.12) saturate(1.06) drop-shadow(0 5px 8px rgba(0, 0, 0, 0.58)) !important;
  transform: translateX(0) scale(1) !important;
  transition: transform 0.18s ease, filter 0.18s ease !important;
}

.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn):hover:not(:disabled),
.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn):focus-visible {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn):hover:not(:disabled)::before,
.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn):focus-visible::before {
  filter: brightness(1.32) saturate(1.16) drop-shadow(0 0 11px rgba(70, 192, 255, 0.46)) drop-shadow(0 6px 9px rgba(0, 0, 0, 0.62)) !important;
  transform: translateX(-4px) scale(1.08) !important;
}

.back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn):focus-visible {
  outline: 2px solid rgba(105, 205, 255, 0.72) !important;
  outline-offset: 1px !important;
}

/* Visibility state still wins over the visual replacement. */
.back-nav-btn.hidden:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn),
#campaignPanel.tutorial-forced #campaignBackHomeBtn {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .back-nav-btn:not(#resultStoryBtn):not(#resultHomeBtn):not(#pveResultHomeBtn):not(#pveResultStoryBtn)::before {
    transition: none !important;
  }
}
