/* Compact homepage rules layered over the main Roblox-style portal theme. */
.home-page .hero {
  min-height: 0;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1.08fr);
  gap: clamp(28px, 4vw, 52px);
  padding: clamp(34px, 4.5vw, 58px);
}

.home-page .hero h1 {
  max-width: 650px;
  font-size: clamp(3rem, 4.7vw, 5.05rem);
}

.home-page .hero-deck {
  margin-block: 20px;
}

.home-page .hero-showcase {
  align-self: center;
}

.home-page .featured-tile {
  min-height: 230px;
}

.home-page .finder-section,
.home-page .results-section,
.home-page .collections-section,
.home-page .faq-section {
  padding-block: clamp(52px, 6vw, 78px);
}

.home-page .finder-compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.home-page .finder-compact-grid fieldset {
  height: 100%;
}

.home-page .mood-more {
  margin-top: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.home-page .mood-more summary {
  padding: 11px 13px;
  color: var(--portal-cyan);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.home-page .mood-more .choice-row {
  padding: 0 12px 12px;
}

.home-page .results-count {
  margin: 20px 0 10px;
  color: var(--portal-muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.home-page .game-card {
  border-radius: 12px;
}

.home-page .game-art {
  aspect-ratio: 16 / 9;
}

.home-page .game-guide-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-page .game-body {
  padding: 16px;
}

.home-page .game-body h3 {
  margin-bottom: 7px;
  font-size: 1.28rem;
  line-height: 1.12;
}

.home-page .game-body > p {
  display: -webkit-box;
  min-height: 2.8em;
  margin-bottom: 12px;
  overflow: hidden;
  color: #aeb8c8;
  font-size: 0.88rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-page .game-meta {
  gap: 0;
  margin-bottom: 0;
}

.home-page .game-meta span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8996a9;
  font-size: 0.68rem;
  box-shadow: none;
}

.home-page .game-meta span:not(:last-child)::after {
  content: "·";
  margin-inline: 7px;
  color: #536176;
}

.home-page .game-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 15px 0 0;
  border: 0;
}

.home-page .details-link,
.home-page .game-card-actions .play-link {
  min-height: 40px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 900;
}

.home-page .details-link {
  flex: 1;
  background: var(--portal-cyan);
  color: #07131a;
  text-align: center;
}

.home-page .details-link:hover {
  background: #83ebf6;
}

.home-page .game-card-actions .play-link {
  flex: 0 0 auto;
  border-color: var(--portal-line);
  background: #1c2533;
  color: #eaf0f7;
}

.home-page .game-card-actions .play-link:hover {
  border-color: rgba(184, 255, 57, 0.5);
  background: rgba(184, 255, 57, 0.1);
  color: var(--portal-lime);
}

.home-page .match-badge {
  padding: 6px 8px;
  font-size: 0.64rem;
}

.home-page .save-button {
  width: 40px;
  height: 40px;
}

.home-page .editor-shelf {
  display: grid;
  gap: 10px;
}

.home-page .editor-shelf > a {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 94px;
  overflow: hidden;
  padding: 17px 20px;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: var(--portal-surface);
  color: var(--portal-text);
  text-decoration: none;
}

.home-page .editor-shelf > a::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--portal-cyan);
}

.home-page .editor-shelf > a:nth-child(2)::before {
  background: var(--portal-lime);
}

.home-page .editor-shelf > a:nth-child(3)::before {
  background: var(--portal-purple);
}

.home-page .editor-shelf > a:hover {
  border-color: rgba(82, 231, 255, 0.45);
  background: #1b2431;
}

.home-page .editor-shelf > a > span {
  color: var(--portal-cyan);
  font-family: "Archivo Black", sans-serif;
}

.home-page .editor-shelf > a:nth-child(2) > span {
  color: var(--portal-lime);
}

.home-page .editor-shelf > a:nth-child(3) > span {
  color: #b9a7ff;
}

.home-page .editor-shelf strong {
  display: block;
  font-family: "Archivo Black", sans-serif;
  font-size: 1rem;
  line-height: 1.15;
}

.home-page .editor-shelf p {
  margin: 5px 0 0;
  color: var(--portal-muted);
  font-size: 0.82rem;
}

.home-page .editor-shelf b,
.home-page .text-link {
  color: var(--portal-cyan);
}

.home-page .text-link {
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 1100px) {
  .home-page .game-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-page .hero {
    grid-template-columns: 1fr;
    padding: 38px 30px;
  }

  .home-page .hero-copy {
    max-width: 720px;
  }

  .home-page .hero h1 {
    max-width: 720px;
  }
}

@media (max-width: 767px) {
  .home-page .hero {
    gap: 22px;
    padding: 25px 16px 18px;
  }

  .home-page .hero h1 {
    font-size: clamp(2.25rem, 10.5vw, 3.25rem);
  }

  .home-page .featured-tile {
    min-height: 0;
  }

  .home-page .finder-section,
  .home-page .results-section,
  .home-page .collections-section,
  .home-page .faq-section {
    padding-block: 52px;
  }

  .home-page .finder-compact-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .home-page .game-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 14px 0 0;
  }

  .home-page .editor-shelf > a {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 0;
    padding: 15px 13px;
  }

  .home-page .editor-shelf > a > b {
    display: none;
  }
}

/* v30 filter alignment and static hero media. */
.home-page .hero-thumb img + b {
  display: none;
}

.home-page .mood-expand {
  flex: 0 0 46px;
  width: 46px;
  min-width: 46px;
  padding-inline: 0;
  border-color: rgba(82, 231, 255, 0.5);
  color: var(--portal-cyan);
  font-size: 1.3rem;
  line-height: 1;
}

.home-page .mood-expand:hover,
.home-page .mood-expand[aria-expanded="true"] {
  background: rgba(82, 231, 255, 0.12);
}

.home-page .mood-extra {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.home-page .mood-extra[hidden] {
  display: none;
}

.home-page .optional-fieldset {
  padding-bottom: 20px;
}

.home-page .optional-fieldset .preference-details {
  margin-top: 12px;
  border: 1px solid var(--portal-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.home-page .optional-fieldset .preference-details > summary {
  padding: 14px 16px;
}

.home-page .optional-fieldset .preference-details .toggle-grid {
  grid-template-columns: repeat(3, 1fr);
  padding: 0 14px 15px;
}

.home-page .hidden-gems-filter {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid rgba(184, 255, 57, 0.38);
  border-radius: 8px;
  background: rgba(184, 255, 57, 0.08);
  color: var(--portal-lime);
  font-size: 0.8rem;
  font-weight: 900;
  cursor: pointer;
}

.home-page .hidden-gems-filter input {
  width: 18px;
  height: 18px;
  accent-color: var(--portal-lime);
}

@media (max-width: 767px) {
  .home-page .mood-expand {
    flex-basis: 46px;
  }

  .home-page .optional-fieldset .preference-details .toggle-grid {
    grid-template-columns: 1fr;
    padding-inline: 10px;
  }

  .home-page .results-toolbar {
    flex-wrap: wrap;
  }

  .home-page .hidden-gems-filter {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* v31 compact builder and mobile catalog. */
.home-page .finder-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home-page .finder-panel::before {
  display: none;
}

.home-page .finder-panel > fieldset,
.home-page .finder-compact-grid > fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid #2b3544;
  border-radius: 10px;
  background: #151c27;
  box-shadow: none;
}

.home-page .finder-panel > fieldset:nth-of-type(1) {
  grid-column: 1;
}

.home-page .finder-panel > fieldset:nth-of-type(2) {
  grid-column: 2;
}

.home-page .finder-panel > .optional-fieldset {
  grid-column: 1 / -1;
  padding-bottom: 16px;
}

.home-page .finder-compact-grid {
  grid-column: 1 / -1;
  gap: 14px;
}

.home-page .finder-actions {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.home-page .finder-panel legend {
  padding-right: 8px;
  background: #151c27;
}

.home-page .finder-panel legend span {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 7px 18px rgba(82, 109, 255, 0.22);
}

.home-page .finder-panel .choice-row {
  gap: 8px;
  margin-top: 14px;
}

.home-page .finder-panel .choice-row button {
  min-height: 44px;
  padding: 9px 14px;
}

.home-page .optional-fieldset .preference-details {
  margin-top: 10px;
  border-color: #303b4b;
  background: #111821;
}

.home-page .optional-fieldset .preference-details > summary {
  min-height: 54px;
  padding: 12px 14px;
}

.home-page .optional-fieldset .preference-details .toggle-grid {
  gap: 9px;
}

.home-page .optional-fieldset .toggle-control {
  min-height: 54px;
  padding: 12px;
}

.home-page .mood-extra {
  margin-top: 8px;
  border-color: #303b4b;
  background: #111821;
}

@media (max-width: 900px) {
  .home-page .finder-panel {
    grid-template-columns: 1fr;
  }

  .home-page .finder-panel > fieldset:nth-of-type(1),
  .home-page .finder-panel > fieldset:nth-of-type(2),
  .home-page .finder-panel > .optional-fieldset,
  .home-page .finder-compact-grid,
  .home-page .finder-actions {
    grid-column: 1;
  }
}

@media (max-width: 767px) {
  .home-page .finder-section,
  .home-page .results-section,
  .home-page .collections-section,
  .home-page .faq-section {
    padding-block: 38px;
  }

  .home-page .section-heading {
    margin-bottom: 17px;
  }

  .home-page .finder-panel {
    gap: 10px;
  }

  .home-page .finder-panel > fieldset,
  .home-page .finder-compact-grid > fieldset {
    padding: 14px 12px;
    border-radius: 9px;
  }

  .home-page .finder-compact-grid {
    gap: 10px;
  }

  .home-page .finder-panel legend {
    font-size: 0.93rem;
  }

  .home-page .finder-panel legend span {
    width: 29px;
    height: 29px;
    border-radius: 7px;
  }

  .home-page .finder-panel .choice-row {
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    margin-top: 11px;
    padding: 1px 1px 5px;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .home-page .finder-panel .choice-row button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 13px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .home-page .mood-extra {
    margin-top: 7px;
    padding: 8px;
  }

  .home-page .optional-fieldset .preference-details > summary {
    min-height: 50px;
    padding: 10px 12px;
  }

  .home-page .optional-fieldset .preference-details summary strong {
    font-size: 0.86rem;
  }

  .home-page .optional-fieldset .preference-details summary small {
    font-size: 0.7rem;
  }

  .home-page .finder-actions {
    gap: 8px;
  }

  .home-page .find-button,
  .home-page .roulette-button {
    min-height: 48px;
  }

  .home-page .game-grid {
    gap: 11px;
  }

  .home-page .game-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 154px;
    border-radius: 10px;
  }

  .home-page .game-art {
    min-height: 100%;
    aspect-ratio: auto;
    border-right: 1px solid var(--portal-line);
    border-bottom: 0;
  }

  .home-page .game-body {
    min-width: 0;
    padding: 11px;
  }

  .home-page .game-genre {
    margin-bottom: 4px;
    font-size: 0.58rem;
  }

  .home-page .game-body h3 {
    margin-bottom: 7px;
    font-size: 1rem;
    line-height: 1.08;
  }

  .home-page .game-body > p {
    display: none;
  }

  .home-page .game-meta {
    flex-wrap: wrap;
    row-gap: 3px;
  }

  .home-page .game-meta span {
    font-size: 0.6rem;
  }

  .home-page .game-meta span:last-child {
    display: none;
  }

  .home-page .game-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    margin-top: auto;
    padding-top: 9px;
  }

  .home-page .details-link,
  .home-page .game-card-actions .play-link {
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 0.7rem;
  }

  .home-page .game-card-actions .play-link {
    font-size: 0;
  }

  .home-page .game-card-actions .play-link span {
    font-size: 0.9rem;
  }

  .home-page .match-badge {
    top: 6px;
    left: 6px;
    max-width: calc(100% - 46px);
    padding: 5px 6px;
    font-size: 0.55rem;
  }

  .home-page .save-button {
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .home-page .results-count {
    margin-top: 14px;
  }
}

@media (max-width: 359px) {
  .home-page .game-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

/* v32 phone-only legend placement and single-row controls. */
@media (max-width: 767px) {
  .home-page .finder-panel > fieldset,
  .home-page .finder-compact-grid > fieldset {
    padding: 8px 10px 12px;
  }

  .home-page .finder-panel legend {
    position: relative;
    z-index: 1;
    width: auto;
    margin: 0 0 10px;
    padding: 0;
    background: transparent;
    transform: translateY(8px);
  }

  .home-page .finder-panel legend span {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
  }

  .home-page .finder-panel .choice-row,
  .home-page .finder-panel .choice-row.choice-wrap {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    margin-top: 0;
    padding: 8px 1px 4px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .home-page .finder-panel .choice-row::-webkit-scrollbar {
    display: none;
  }

  .home-page .finder-panel .choice-row button {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 7px 12px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .home-page .finder-panel .mood-extra {
    padding: 7px;
  }

  .home-page .finder-panel .mood-extra[hidden] {
    display: none;
  }

  .home-page .optional-fieldset .preference-details {
    margin-top: 6px;
  }
}

/* v34: keep all three lobby preferences visible without an extra disclosure. */
.home-page .optional-fieldset > .preference-toggle-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
  padding: 0;
}

.home-page .optional-fieldset > .preference-toggle-grid .toggle-control {
  min-width: 0;
  min-height: 54px;
  padding: 12px;
}

@media (max-width: 767px) {
  .home-page .optional-fieldset > .preference-toggle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
  }

  .home-page .optional-fieldset > .preference-toggle-grid .toggle-control {
    flex-direction: column;
    gap: 6px;
    justify-content: center;
    min-height: 86px;
    padding: 8px 5px;
    text-align: center;
  }

  .home-page .optional-fieldset > .preference-toggle-grid .toggle-ui {
    width: 36px;
    height: 22px;
  }

  .home-page .optional-fieldset > .preference-toggle-grid .toggle-ui::after {
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
  }

  .home-page .optional-fieldset > .preference-toggle-grid input:checked + .toggle-ui::after {
    transform: translateX(16px);
  }

  .home-page .optional-fieldset > .preference-toggle-grid strong {
    font-size: 0.7rem;
    line-height: 1.15;
  }

  .home-page .optional-fieldset > .preference-toggle-grid small {
    display: none;
  }
}

/* v36 search discovery: compact on desktop, swipeable on phones. */
.home-page .popular-searches {
  width: min(100% - 48px, 1180px);
  margin: 34px auto 12px;
  padding: 22px;
  border: 1px solid var(--portal-line);
  border-radius: 14px;
  background: #121925;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.home-page .popular-searches-heading {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.home-page .popular-searches-heading h2 {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
}

.home-page .popular-searches-heading > a {
  flex: 0 0 auto;
  color: var(--portal-cyan);
  font-size: 0.78rem;
  font-weight: 900;
}

.home-page .popular-search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-page .popular-search-grid > a {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid #303b4b;
  border-radius: 9px;
  background: #182130;
  color: #f3f6fb;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.home-page .popular-search-grid > a::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--portal-cyan);
  opacity: 0.08;
  transform: rotate(18deg);
}

.home-page .popular-search-grid > a:nth-child(3n + 2)::after {
  background: var(--portal-lime);
}

.home-page .popular-search-grid > a:nth-child(3n)::after {
  background: #8b6cff;
}

.home-page .popular-search-grid > a:hover,
.home-page .popular-search-grid > a:focus-visible {
  border-color: rgba(82, 231, 255, 0.58);
  background: #1c2939;
  transform: translateY(-2px);
}

.home-page .popular-search-grid small,
.home-page .popular-search-grid strong,
.home-page .popular-search-grid span {
  position: relative;
  z-index: 1;
  display: block;
}

.home-page .popular-search-grid small {
  color: var(--portal-lime);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-page .popular-search-grid strong {
  margin-top: 8px;
  font-family: "Archivo Black", sans-serif;
  font-size: 0.93rem;
  line-height: 1.05;
}

.home-page .popular-search-grid span {
  margin-top: 7px;
  color: #9eacbe;
  font-size: 0.7rem;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .home-page .popular-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .home-page .popular-searches {
    width: min(100% - 28px, 1180px);
    margin-top: 20px;
    padding: 15px 14px;
  }

  .home-page .popular-searches-heading {
    align-items: center;
    margin-bottom: 11px;
  }

  .home-page .popular-searches-heading h2 {
    font-size: 1.18rem;
  }

  .home-page .popular-searches-heading > a {
    font-size: 0.7rem;
  }

  .home-page .popular-search-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 1px 1px 6px;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .home-page .popular-search-grid::-webkit-scrollbar {
    display: none;
  }

  .home-page .popular-search-grid > a {
    flex: 0 0 min(74vw, 255px);
    min-height: 102px;
    scroll-snap-align: start;
  }
}


/* v37: keep featured and situational guide discovery in one clean section. */
.home-page .popular-searches {
  display: block;
}

.home-page .popular-search-grid > a {
  display: block;
  min-width: 0;
}

.home-page .popular-searches-heading h3 {
  margin: 2px 0 0;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  line-height: 1.1;
}

.home-page .collections-section .popular-searches {
  width: 100%;
  margin: 28px 0 0;
  padding: 18px;
  background: #121925;
  box-shadow: none;
}

@media (max-width: 767px) {
  .home-page .collections-section .popular-searches {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
  }

  .home-page .popular-searches-heading h3 {
    font-size: 1.12rem;
  }

  .home-page .popular-search-grid > a {
    display: block;
    flex-basis: min(74vw, 245px);
  }
}
