/* Stable Discover builder: source markup owns the layout; scripts only handle behavior. */
.discover-page .finder-section {
  padding-top: 8px !important;
}

.discover-page #finder > .section-heading {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 18px !important;
  margin-bottom: 12px !important;
  overflow: visible !important;
}

.discover-page .builder-intro {
  max-width: 680px !important;
  margin: 6px 0 0 !important;
  color: #98a6ba !important;
  font-size: .9rem !important;
  line-height: 1.45 !important;
}

.discover-page .finder-heading-actions {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  margin: 0 !important;
}

.discover-page .builder-heading-controls {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px !important;
  border: 1px solid #334158 !important;
  border-radius: 13px !important;
  background: #111925 !important;
}

.discover-page .builder-heading-controls .builder-collapse-toggle,
.discover-page .builder-heading-controls #resetFilters {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 9px !important;
  white-space: nowrap !important;
  font: inherit !important;
  font-size: .8rem !important;
  font-weight: 850 !important;
  cursor: pointer !important;
}

.discover-page .builder-heading-controls .builder-collapse-toggle {
  background: #1b2738 !important;
  color: #e8eef8 !important;
}

.discover-page .builder-heading-controls #resetFilters {
  background: transparent !important;
  color: #aab6c8 !important;
  text-decoration: none !important;
}

.discover-page .builder-heading-controls button:hover,
.discover-page .builder-heading-controls button:focus-visible {
  background: #25354b !important;
  color: #fff !important;
}

.discover-page .finder-panel[hidden] {
  display: none !important;
}

.discover-page .is-builder-collapsed .builder-intro {
  display: none !important;
}

.discover-page .finder-panel {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 12px !important;
}

.discover-page .builder-step {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid #314058 !important;
  border-radius: 13px !important;
  background: #141d2a !important;
  overflow: visible !important;
}

.discover-page .builder-step--players,
.discover-page .builder-step--vibe {
  grid-column: span 3 !important;
}

.discover-page .builder-step--genre,
.discover-page .builder-step--time,
.discover-page .builder-step--device {
  grid-column: span 2 !important;
}

.discover-page .builder-step legend {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  width: auto !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  color: #eef3fb !important;
  font-size: .92rem !important;
  font-weight: 800 !important;
}

.discover-page .builder-step legend > span {
  display: inline-grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 8px !important;
  border-radius: 9px !important;
  background: linear-gradient(135deg, #43c8ef, #7257f5) !important;
  color: #0d1420 !important;
  font-size: .72rem !important;
  font-weight: 900 !important;
}

.discover-page .builder-step .choice-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  overflow: visible !important;
  padding: 0 !important;
}

.discover-page .builder-step .choice-row button {
  min-height: 42px !important;
  padding: 7px 13px !important;
  border-radius: 10px !important;
}

.discover-page .builder-step--genre .genre-control {
  display: grid !important;
  gap: 6px !important;
  width: 100% !important;
  margin: 0 !important;
}

.discover-page .builder-step--genre .genre-control > span {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.discover-page .builder-step--genre select {
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  border: 1px solid #50617b !important;
  border-radius: 10px !important;
  background: #101824 !important;
  color: #f4f7fc !important;
  font: inherit !important;
  font-weight: 750 !important;
}

.discover-page .requirements-fieldset {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid #314058 !important;
  border-radius: 13px !important;
  background: #111a27 !important;
}

.discover-page .requirements-heading {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  transform: none !important;
}

.discover-page .requirements-heading h3 {
  position: static !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #eef3fb !important;
  font-size: .92rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.discover-page .requirements-badge {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  min-width: auto !important;
  min-height: 26px !important;
  margin: 0 !important;
  padding: 0 9px !important;
  border: 1px solid #33445e !important;
  border-radius: 999px !important;
  background: #223047 !important;
  color: #aebbd0 !important;
  font-size: .65rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  transform: none !important;
}

.discover-page .requirements-fieldset .preference-toggle-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.discover-page .requirements-fieldset .toggle-control {
  min-width: 0 !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border: 1px solid #2d3b50 !important;
  border-radius: 11px !important;
  background: #151f2d !important;
}

.discover-page .requirements-fieldset .toggle-control small {
  display: none !important;
}

.discover-page .finder-actions {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 9px !important;
  margin: 0 !important;
}

.discover-page .finder-actions button {
  min-height: 48px !important;
  border-radius: 12px !important;
}

/* Collections are browsing controls, not lobby requirements. */
.discover-page .results-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  gap: 12px !important;
  margin: 0 0 12px !important;
}

.discover-page .collection-filter-wrap {
  display: grid !important;
  gap: 7px !important;
  min-width: 0 !important;
}

.discover-page .collection-filter-label {
  color: #98a6ba !important;
  font-size: .72rem !important;
  font-weight: 850 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

.discover-page .collection-filter-wrap .discovery-filter {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: min(620px, 100%) !important;
}

.discover-page .collection-filter-wrap .discovery-filter button {
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 7px 11px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
}

.discover-page .results-toolbar .results-filter-controls {
  display: flex !important;
  justify-content: flex-end !important;
  width: auto !important;
}

@media (max-width: 980px) {
  .discover-page .builder-step--players,
  .discover-page .builder-step--vibe,
  .discover-page .builder-step--genre,
  .discover-page .builder-step--time {
    grid-column: span 3 !important;
  }

  .discover-page .builder-step--device {
    grid-column: 1 / -1 !important;
  }

  .discover-page .requirements-fieldset .preference-toggle-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .discover-page .requirements-fieldset .toggle-control:last-child {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 760px) {
  .discover-page #finder > .section-heading {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 9px !important;
  }

  .discover-page .builder-intro {
    font-size: .78rem !important;
    line-height: 1.4 !important;
  }

  .discover-page .finder-heading-actions,
  .discover-page .builder-heading-controls {
    width: 100% !important;
  }

  .discover-page .builder-heading-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 3px !important;
    border-radius: 11px !important;
  }

  .discover-page .builder-heading-controls .builder-collapse-toggle {
    width: 100% !important;
  }

  .discover-page .builder-heading-controls #resetFilters {
    min-width: 78px !important;
    padding-inline: 9px !important;
  }

  .discover-page .finder-panel {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    padding: 7px !important;
  }

  .discover-page .builder-step--players,
  .discover-page .builder-step--vibe,
  .discover-page .builder-step--genre,
  .discover-page .builder-step--time,
  .discover-page .builder-step--device,
  .discover-page .requirements-fieldset,
  .discover-page .finder-actions {
    grid-column: 1 !important;
  }

  .discover-page .builder-step,
  .discover-page .requirements-fieldset {
    padding: 9px !important;
    border-radius: 11px !important;
  }

  .discover-page .builder-step legend {
    margin-bottom: 7px !important;
    font-size: .83rem !important;
  }

  .discover-page .builder-step legend > span {
    min-width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
  }

  .discover-page .requirements-heading {
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  .discover-page .requirements-heading h3 {
    font-size: .83rem !important;
  }

  .discover-page .requirements-badge {
    min-height: 24px !important;
    padding-inline: 8px !important;
    font-size: .6rem !important;
  }

  .discover-page .builder-step .choice-row {
    display: grid !important;
    gap: 6px !important;
  }

  .discover-page .builder-step--players .choice-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .discover-page .builder-step--vibe .choice-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .discover-page .builder-step--time .choice-row,
  .discover-page .builder-step--device .choice-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .discover-page .builder-step .choice-row button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 7px 6px !important;
    font-size: .76rem !important;
    white-space: normal !important;
  }

  .discover-page .requirements-fieldset .preference-toggle-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .discover-page .requirements-fieldset .toggle-control,
  .discover-page .requirements-fieldset .toggle-control:last-child {
    grid-column: 1 !important;
    min-height: 46px !important;
  }

  .discover-page .finder-actions {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  .discover-page .finder-actions button {
    width: 100% !important;
    min-height: 48px !important;
  }

  .discover-page .results-toolbar {
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }

  .discover-page .collection-filter-wrap .discovery-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  .discover-page .collection-filter-wrap .discovery-filter button {
    min-height: 44px !important;
    font-size: .78rem !important;
  }

  .discover-page .results-toolbar .results-filter-controls,
  .discover-page .results-toolbar .sort-control {
    width: 100% !important;
  }
}
