/* Flow Improv — consistent, comfortable Back to Visual Play action.
   Shared by the React game shell and every standalone Visual Play page.
   Intentionally scoped to the HEADER back link; gameplay and finish actions
   linking to /visual-improv retain their own styling. */
.flow-visual-page .flow-visual-mast > a.flow-visual-back,
.flow-static-mast > a.flow-static-back,
.flow-unified .flow-static-mast > a.flow-static-back,
:is(.mast,.topbar,.header,.nav,.top).flow-static-mast > a[href="/visual-improv"] {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  min-height: 50px !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 12px 18px !important;
  border: 1px solid #d3e1d0 !important;
  border-radius: 15px !important;
  background: #edf3e9 !important;
  color: #3c654c !important;
  font: 700 15px/1.25 'DM Sans', Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: normal !important;
  box-shadow: 0 2px 7px #36513d10 !important;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

.flow-visual-page .flow-visual-mast > a.flow-visual-back svg {
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px !important;
  stroke-width: 2.1;
}

.flow-visual-page .flow-visual-mast > a.flow-visual-back:hover,
.flow-static-mast > a.flow-static-back:hover,
.flow-unified .flow-static-mast > a.flow-static-back:hover {
  background: #e1ebdd !important;
  border-color: #bdd3b8 !important;
  color: #2c553e !important;
  box-shadow: 0 3px 9px #36513d14 !important;
}

.flow-visual-page .flow-visual-mast > a.flow-visual-back:focus-visible,
.flow-static-mast > a.flow-static-back:focus-visible,
.flow-unified .flow-static-mast > a.flow-static-back:focus-visible {
  outline: 3px solid #7a9c80 !important;
  outline-offset: 3px !important;
}

@media (max-width: 767px) {
  .flow-visual-page .flow-visual-mast > a.flow-visual-back,
  .flow-static-mast > a.flow-static-back,
  .flow-unified .flow-static-mast > a.flow-static-back,
  :is(.mast,.topbar,.header,.nav,.top).flow-static-mast > a[href="/visual-improv"] {
    min-height: 54px !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    border-radius: 16px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-visual-page .flow-visual-mast > a.flow-visual-back,
  .flow-static-mast > a.flow-static-back {
    transition: none !important;
  }
}
