/* Marketplace adjustments after mobile.css and marketplace.css.
   Keep the desktop composition and the existing dark/violet surfaces. */
.home-page .mgames { display: none; }

/* The first mobile screen is a direct game picker, available before any JS. */
@media (max-width: 1099px) {
  .home-page .mgames { display: block; padding-block: 12px 10px; }
  .home-page .mgames__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  .home-page .mgames__title { margin: 0; color: var(--txt); font: 800 21px/1.2 var(--font-body, sans-serif); letter-spacing: -.03em; }
  .home-page .mgames__all { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 8px; color: #c8b6ff; font-size: 13px; font-weight: 700; text-decoration: none; }
  .home-page .mgames__all svg { flex: none; }
  .home-page .mgames__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 12px; list-style: none; margin: 0; padding: 0; }
  .home-page .mgames__grid > li { min-width: 0; }
  .home-page .mgames__link { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 5px 2px; border-radius: 15px; color: var(--txt); text-decoration: none; }
  .home-page .mgames__icon { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border: 1px solid #ffffff18; border-radius: 18px; overflow: hidden; background: #211a31; font: 800 21px/1 var(--font-body, sans-serif); color: #d3c3ff; }
  .home-page .mgames__icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .home-page .mgames__name { width: 100%; min-height: 2.6em; color: var(--txt); font: 700 13px/1.3 var(--font-body, sans-serif); text-align: center; overflow-wrap: anywhere; }
  .home-page .mgames__link:focus-visible,
  .home-page .mgames__all:focus-visible { outline: 2px solid #b89aff; outline-offset: 2px; }
  .home-page .mgames__link:active { background: #9673ee18; }
  .home-page:has(.mgames__link) #hx-trend { display: none; }
  .home-page:has(.mgames__link) [data-home-discovery] :is(.ld-heading, .ld-tabs, .ld-panels) { display: none; }
  .home-page:has(.mgames__link) [data-home-discovery]:not(:has(.ld-news)) { display: none; }
  .home-page .mgames + .hb.home-banners { margin-top: 6px; }
}

@media (max-width: 760px) {
  .home-page .mgames { padding-top: 8px; }
  .home-page .mgames__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .home-page .mgames__name { font-size: 12px; }
  .home-page .mgames__title { font-size: 20px; }
}

@media (max-width: 380px) {
  .home-page .mgames__icon { width: 56px; height: 56px; border-radius: 16px; }
  .home-page .mgames__all { padding-inline: 3px; font-size: 12px; }
}

@media (max-width: 340px) {
  .home-page .mgames__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-page .mgames__title { font-size: 19px; }
}

@media (max-width: 1099px) {
  /* Touch controls retain their labels and have room for a fingertip. */
  .home-page .hx-link,
  .home-page .tg-chip,
  .home-page .tg__all,
  .market-page .ct-back,
  .catalog-page .ct-apps__kind,
  .catalog-page .ct-pill,
  .catalog-page .ct-chip,
  .catalog-page .ct-dd__ok,
  .catalog-page .ct-dd__reset,
  .catalog-page .ct-reset,
  .game-page .gh-head__sell,
  .game-page .gh-side__a,
  .game-page .gh-side__a.is-empty,
  .game-page .gh-ask__btns a { min-height: 44px; box-sizing: border-box; }
  .home-page .hx-link,
  .home-page .tg__all { display: inline-flex; align-items: center; justify-content: center; }
  .home-page .hx-head > *,
  .market-page .ct-head > *,
  .game-page .gh-head > * { min-width: 0; }
  .home-page .hx-head { flex-wrap: wrap; }
  .home-page .hx-head .hx-h2 { overflow-wrap: anywhere; }
  .home-page .hx-section { padding-block: 26px; }
  .home-page .hx-section + .hx-section { padding-top: 20px; }
  .home-page :is(.ref-cta__btn, .hx-help__btn) { min-height: 44px; }
  .home-page .tg-card__chips { max-width: 100%; }
  .home-page .tg-chip { white-space: normal; line-height: 1.3; }

  /* Visible banner controls also work on a tablet without hover. */
  .hb .hb-arrow { width: 44px; height: 44px; opacity: .95; }
  .hb .hb-autoplay { right: 8px; bottom: 4px; }
  .hb .hb-dot { height: 44px; }
  .hb .hb-dots { bottom: 0; }
  .hb .hb-button,
  .hb .hb-slide--poster .hb-button { min-height: 44px; font-size: 12px; }
  .hb .hb-slide__copy { padding-bottom: 54px; }
  .hb .hb-slide--poster .hb-slide__copy { padding-bottom: 54px; }

  /* Search/filter controls must not set the width of the page. */
  .catalog-page :is(.ct-tools, .ct-apps, .ct-apps__grp, .ct-bar__right, .ct-sort, .ct-filters) { min-width: 0; }
  .catalog-page :is(.ct-fbtn, .ct-fsel, .ct-sort select) { max-width: 100%; }
  .catalog-page .ct-fchip__t { min-width: 0; }
  .catalog-page .ct-apps__input { padding-right: 54px; }
  .catalog-page .ct-apps__clear { width: 44px; height: 44px; right: 3px; }
  .catalog-page .ct-apps__kinds { flex-wrap: wrap; }
  .catalog-page .ct-app__name,
  .catalog-page .ct-app--art .ct-app__name { overflow-wrap: anywhere; }
  .catalog-page .ct-card__title,
  .catalog-page .ct-row__title,
  .catalog-page .ct-row__attrs { overflow-wrap: anywhere; }
  .catalog-page .ct-card__attrs li { max-width: 100%; flex-wrap: wrap; }
  .catalog-page .ct-card__attrs b { min-width: 0; overflow-wrap: anywhere; }
  .catalog-page .ct-card__foot { flex-wrap: wrap; }
  .catalog-page .ct-card__buy { min-height: 44px; margin-left: auto; }
  .catalog-page .ct-card .lcard__fav { width: 44px; height: 44px; }
  .catalog-page .ct-view__b { min-width: 44px; height: 44px; }
  .catalog-page .ct-pages__n,
  .catalog-page .ct-pages__nav { min-width: 44px; min-height: 44px; }
  .catalog-page #lots-grid { scroll-margin-top: calc(var(--nav-h, 64px) + 16px); }
  .catalog-page .ct-dd__row input,
  .catalog-page .ct-chips__q { min-height: 46px; font-size: 16px; }
  .catalog-page .msheet .ct-fchip__t { max-width: none; flex: 1; }
  .catalog-page .msheet :is(.ct-chip, .ct-dd__ok, .ct-dd__reset, .ct-reset) { min-height: 44px; }

  /* Game card content may grow for long category names and descriptions. */
  .game-page .gh .gh-card { height: auto; }
  .game-page .gh .gh-card__body { grid-template-rows: minmax(48px, auto) 1fr auto; }
  .game-page .gh .gh-card__title { overflow-wrap: normal; }
  .game-page .gh .gh-card__foot { flex-wrap: wrap; }
  .game-page .gh .gh-card__btn { min-height: 44px; margin-left: auto; }
  .game-page .gh-intro { overflow-wrap: anywhere; }

  /* Product content and related cards keep readable widths on touch devices. */
  #product-root :is(.pdp, .pdp__grid, .pdp__side, .pdp-buy, .pdp-card, .pdp-gal) { min-width: 0; }
  #product-root .pdp-game { max-width: none; }
  #product-root .pdp-game__title { overflow-wrap: anywhere; }
  #product-root .pdp-crumbs { gap: 4px 8px; }
  #product-root .pdp-crumbs a { display: inline-flex; align-items: center; min-height: 36px; overflow-wrap: anywhere; }
  #product-root .pdp-gal__nav { width: 44px; height: 44px; margin-top: -22px; }
  #product-root .pdp-gal__thumbs { gap: 8px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; padding: 3px 2px 5px; }
  #product-root .pdp-gal__thumb { width: 80px; min-height: 50px; scroll-snap-align: start; }
  #product-root :is(.pdp-share, .pdp-qty__btn) { width: 44px; height: 44px; }
  #product-root .pdp-chip { min-height: 36px; box-sizing: border-box; max-width: 100%; overflow-wrap: anywhere; }
  #product-root .pdp-qty__ctl input { min-height: 44px; font-size: 16px; }
  #product-root .pdp-promo summary { min-height: 44px; }
  #product-root .pdp-buy__actions .btn-ghost { min-height: 48px; white-space: normal; line-height: 1.35; }
  #product-root .pdp-attrs div { min-width: 0; }
  #product-root .pdp-attrs :is(dt, dd) { overflow-wrap: anywhere; }
  #product-root .pdp-reviews__all { display: inline-flex; align-items: center; min-height: 44px; white-space: normal; }
  #product-root .pdp-more { margin-top: 32px; }
  #product-root .pdp-more .hx-head { flex-wrap: wrap; gap: 12px; }
  #product-root .pdp-more .hx-link { max-width: 100%; min-height: 44px; white-space: normal; }
  #product-root .pdp-more .lots-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  :is(.home-page, #product-root) .lcard { min-width: 0; }
  :is(.home-page, #product-root) .lcard__body { min-width: 0; }
  :is(.home-page, #product-root) .lcard__fav { width: 44px; height: 44px; right: 6px; top: 6px; opacity: 1; transform: none; }
  :is(.home-page, #product-root) .lcard__game { left: 8px; top: 9px; max-width: calc(100% - 64px); }
  /* Shared price spans set their own nowrap; constrain the children as well. */
  :is(.home-page, .catalog-page, #product-root) .lot-price { max-width: 100%; }
  :is(.home-page, .catalog-page, #product-root) .lot-price__before { max-width: 100%; }
  :is(.home-page, .catalog-page, #product-root) :is(.lot-price__current, .lot-price__before s) { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}

@media (min-width: 761px) and (max-width: 1099px) {
  .home-page .hx-help__text { max-width: none; }
  .catalog-page .ct-sort select,
  .catalog-page .ct-fsel,
  .catalog-page .ct-apps__input,
  .catalog-page .ct-search input { font-size: 16px; }
  .catalog-page .ct-bar__right { gap: 10px; }
  .catalog-page .ct-view__t { display: none; }
  .catalog-page .ct-sort > span { display: none; }
  .catalog-page .ct-card__seller { flex-wrap: wrap; }
  .catalog-page .ct-card__nick { max-width: calc(100% - 38px); }
  .catalog-page .ct-row,
  .catalog-page .ct-lhead { grid-template-columns: minmax(0, 1fr) 160px 110px; gap: 14px; padding-inline: 16px; }
  .game-page .gh .gh-cards { gap: 14px; }
  .game-page .gh .gh-card { min-height: 334px; padding-top: 142px; }
  .game-page .gh .gh-card__hero { height: 142px; }
  .game-page .gh .gh-card__body { padding-inline: 15px; }
  .game-page .gh .gh-card__title { font-size: 19px; }
  #product-root .pdp__grid { gap: 20px; }
  #product-root .pdp-buy,
  #product-root .pdp-card { padding: 22px; }
  #product-root .pdp__side { top: calc(var(--nav-h, 64px) + 16px); }
}

@media (min-width: 761px) and (max-width: 980px) {
  .catalog-page .ct-card__cols { grid-template-columns: minmax(0, 1fr); }
  .catalog-page .ct-card__side { align-items: stretch; }
  .catalog-page .ct-card.is-premium .ct-card__foot { flex-direction: row; align-items: center; }
  #product-root .pdp-gal__main { height: clamp(280px, 42vw, 360px); aspect-ratio: auto; }
  #product-root .pdp__grid { gap: 16px; }
  #product-root .pdp-buy__title { font-size: 25px; }
}

@media (max-width: 760px) {
  .home-page .hx-section { padding-block: 22px; }
  .home-page .hx-head { align-items: center; gap: 10px; margin-bottom: 16px; }
  .home-page .hx-h2 { font-size: 21px; }
  .home-page main .lots-grid.hx-lots { --cols: 2; gap: 10px; }
  .home-page .tg__grid[data-cols] { scroll-snap-type: x proximity; }
  .home-page .tg__grid[data-cols] .tg-card__main { max-width: 67%; }
  .home-page .tg__all { display: inline-flex; }
  .home-page .tg__foot { margin-top: 6px; }
  .home-page .hx-step p,
  .home-page .hx-help__text,
  .home-page .ref-cta__text { font-size: 13px; }

  .hb .hb-slide { height: 264px; }
  .hb .hb-slide__copy { gap: 8px; padding-top: 20px; padding-bottom: 58px; }
  .hb .hb-slide--poster .hb-slide__copy { gap: 10px; padding-top: 20px; padding-bottom: 58px; }
  .hb .hb-slide--poster .hb-slide__title { font-size: clamp(33px, 8.5vw, 42px); }
  .hb .hb-slide--poster.hb-slide--long .hb-slide__title { font-size: clamp(31px, 8vw, 38px); }
  .hb .hb-slide__text { font-size: 12px; }
  .hb .hb-arrow { top: auto; bottom: 4px; right: 52px; transform: none; }
  .hb .hb-arrow--prev { left: 6px; right: auto; }
  .hb .hb-autoplay { right: 6px; }
  .hb .hb-dots { left: 52px; right: 102px; width: auto; transform: none; gap: 6px; bottom: 4px; }
  .hb .hb-dot,
  .hb .hb-dot[aria-selected="true"] { height: 44px; }

  .catalog-page .ct { padding-top: 14px; }
  .catalog-page .ct-crumbs { margin-bottom: 12px; }
  .catalog-page .ct-back { height: 44px; }
  .catalog-page .ct-title { font-size: clamp(23px, 6vw, 27px); line-height: 1.25; }
  .catalog-page .ct-desc { font-size: 14px; }
  .catalog-page .ct-trust li,
  .game-page .gh .ct-trust li { font-size: 12px; }
  .catalog-page .ct-trust,
  .game-page .gh .ct-trust { padding-bottom: 3px; }
  .catalog-page .ct-apps { gap: 20px; }
  .catalog-page .ct-apps__kinds { flex-wrap: nowrap; }
  .catalog-page .ct-apps__kind { min-height: 44px; }
  .catalog-page .ct-apps__status { margin: -5px 0; font-size: 12px; }
  .catalog-page .ct-app__name,
  .catalog-page .ct-app--art .ct-app__name { font-size: 14px; min-height: 34px; }
  .catalog-page .ct-app__meta,
  .catalog-page .ct-app--art .ct-app__meta { font-size: 11px; }
  .catalog-page .ct .ct-mnav .cat-chip { height: 44px; font-size: 13px; }
  .catalog-page .ct-bar { gap: 10px; }
  .catalog-page .ct-bar__right { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .catalog-page .ct-mfbtn { height: 48px; padding-inline: 12px; justify-content: center; font-size: 14px; }
  .catalog-page .ct-mfbtn__t { display: inline; }
  .catalog-page .ct-view { padding: 1px; }
  .catalog-page .ct-view__b { height: 44px; padding-inline: 12px; }
  .catalog-page .ct-sort { grid-column: 1 / -1; width: 100%; }
  .catalog-page .ct-sort select { height: 48px; min-height: 48px; min-width: 0; width: 100%; }
  .catalog-page .ct-bar__right:has(.ct-view[hidden]) { grid-template-columns: auto minmax(0, 1fr); }
  .catalog-page .ct-bar__right:has(.ct-view[hidden]) .ct-sort { grid-column: 2; }
  .catalog-page .ct-card { gap: 10px 12px; }
  .catalog-page .ct-card__title,
  .catalog-page .ct-card.is-stats .ct-card__title { font-size: 14px; line-height: 1.4; }
  .catalog-page .ct-card__desc { font-size: 13px; }
  .catalog-page .ct-card .lcard__fav { top: 16px; left: 62px; width: 44px; height: 44px; }
  .catalog-page .ct-card.is-premium .lcard__fav { position: relative; top: auto; left: auto; }
  .catalog-page .ct-card__buy { font-size: 13px; }
  .catalog-page .ct-card__attrs li { font-size: 12px; }
  .catalog-page .ct-card__rev { font-size: 11px; }
  .catalog-page .ct-row { padding: 15px; }
  .catalog-page .ct-row__price { max-width: 160px; }
  .catalog-page .ct-row__price > b { font-size: 16px; white-space: normal; overflow-wrap: anywhere; }

  .game-page .gh-head { margin-top: 14px; gap: 12px; }
  .game-page .gh-intro { font-size: 13px; }
  .game-page .gh-side { margin-top: 18px; padding-bottom: 12px; }
  .game-page .gh-side__a,
  .game-page .gh-side__a.is-empty { font-size: 13px; }
  .game-page .gh .gh-card__pts li { font-size: 12px; }

  #product-root .pdp { padding-top: 14px; padding-bottom: 24px; }
  #product-root .pdp-game { margin-bottom: 12px; gap: 10px; }
  #product-root .pdp-game__title { font-size: 21px; line-height: 1.25; }
  #product-root .pdp__grid { gap: 14px; }
  #product-root .pdp-buy,
  #product-root .pdp-card { padding: 18px; border-radius: 18px; }
  #product-root .pdp-buy__title { font-size: 22px; line-height: 1.3; }
  #product-root .pdp-gal__main { aspect-ratio: 4 / 3; max-height: 360px; }
  #product-root .pdp-attrs { gap: 8px; }
  #product-root .pdp-attrs div { padding: 10px; }
  #product-root .pdp-attrs dd { font-size: 14px; }
  #product-root .pdp-buy__sum { font-size: 30px; }
  #product-root .pdp-promo__row { flex-wrap: wrap; }
  #product-root .pdp-promo__row input { flex: 1 1 140px; }
  #product-root .pdp-promo__row .btn-ghost { flex: 1 1 auto; min-height: 44px; }
  #product-root .pdp-reviews__head .pdp-card__h { display: block; line-height: 1.4; overflow-wrap: anywhere; }
  #product-root .pdp-more .lots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :is(.home-page, #product-root) .lcard__body { padding: 11px 10px 12px; gap: 7px; }
  :is(.home-page, #product-root) .lcard__cat { font-size: 10.5px; letter-spacing: .035em; overflow-wrap: anywhere; }
  :is(.home-page, #product-root) .lcard__title { font-size: 14px; line-height: 1.4; min-height: 2.8em; }
  :is(.home-page, #product-root) .lcard__foot { flex-direction: column; align-items: stretch; gap: 9px; padding-top: 9px; }
  :is(.home-page, #product-root) .lcard__seller { gap: 5px; font-size: 11px; }
  :is(.home-page, #product-root) .lcard__name { display: block; min-width: 0; max-width: none; flex: 1; }
  :is(.home-page, #product-root) .lcard__rating { display: inline; font-size: 11px; }
  :is(.home-page, #product-root) .lcard__ava { width: 22px; height: 22px; }
  :is(.home-page, #product-root) .lcard__price { font-size: 17px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  :is(.home-page, #product-root) .lcard__price.lot-price { align-items: flex-start; }
  :is(.home-page, #product-root) .lcard__price .lot-price__before { justify-content: flex-start; }
}

/* The existing horizontal offer card is only suitable in a single column. */
@media (min-width: 641px) and (max-width: 760px) {
  .catalog-page .ct-card:not(.is-premium) { display: flex; flex-direction: column; }
  .catalog-page .ct-card:not(.is-premium) .ct-card__media { width: 100%; aspect-ratio: 16 / 10; }
  .catalog-page .ct-card:not(.is-premium) .lcard__fav { position: relative; top: auto; left: auto; }
  .catalog-page .ct-card__seller { flex-wrap: wrap; margin-top: auto; }
}

@media (max-width: 520px) {
  .game-page .gh .gh-card { min-height: 224px; }
  .game-page .gh .gh-card__body { padding: 16px; grid-template-rows: minmax(44px, auto) 1fr auto; gap: 10px; }
  .game-page .gh .gh-card__title { font-size: 18px; }
  .game-page .gh .gh-card__pts { width: 59%; }
  .game-page .gh .gh-card__pts li { line-height: 1.45; }
  .game-page .gh .gh-card__foot .gh-card__btn { min-width: 120px; }
  .game-page .gh-ask__btns { display: grid; grid-template-columns: minmax(0, 1fr); }
  .game-page .gh-ask__btns a { justify-content: center; text-align: center; }
  .home-page .hx-faq summary { font-size: 14px; }
  #product-root .pdp-seller { padding: 16px; gap: 10px; }
}

@media (max-width: 380px) {
  .home-page main .lots-grid.hx-lots { --cols: 2; }
  .home-page .hx-head .hx-link { padding-inline: 10px; }
  .home-page .hx-head { align-items: flex-start; }
  .catalog-page .ct-card__seller { flex-wrap: wrap; }
  :is(.home-page, #product-root) .lcard__rating { font-size: 10px; }
  :is(.home-page, #product-root) .lcard__body { padding-inline: 9px; }
}

@media (max-width: 1099px) and (hover: none) {
  .catalog-page .ct-app:hover,
  .catalog-page .ct-app:hover .ct-app__hero,
  .game-page .gh .gh-card:hover,
  .game-page .gh .gh-card:hover .gh-card__hero,
  .home-page .tg-card:hover .tg-card__hero { transform: none; }
  #product-root .pdp-gal__main--zoom:hover > img { transform: none; }
}
