/*
 * Nostalgeek Mobile Responsive V1
 * Final mobile hardening layer loaded LAST on every public surface.
 * Scope: layout only. No data, pricing, route or product-engine changes.
 */

@media (max-width: 760px) {
  html,body{
    width:100%!important;
    max-width:100%!important;
    overflow-x:clip!important;
  }
  body{min-width:0!important}
  *,*::before,*::after{box-sizing:border-box}
  img,video,iframe,svg{max-width:100%;height:auto}
  main,section,article,aside,header,footer,nav,form,
  .wrap,.panel,.card,.empty,.modal-card,
  .home-panel,.home-v1-hero,.home-popular,.home-latest,.home-platforms,
  .news-feature,.news-side-card,.news-latest-card,.news-archive-card,
  .platform-hub-shell,.platform-hub-hero,.platform-hub-story,
  .product-page-cockpit,.product-cockpit,.cote-experience,
  .deal-radar-card,.activity-card{
    min-width:0!important;
    max-width:100%;
  }
  h1,h2,h3,h4,p,strong,a,button,span,small{
    max-width:100%;
  }
  h1,h2,h3,h4{
    word-break:normal!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
  }
  .wrap,
  main.wrap,
  body:has(#home.active) main.wrap,
  body:has(#platform-hub.active) main.wrap{
    width:100%!important;
    max-width:100%!important;
    padding-left:12px!important;
    padding-right:12px!important;
  }

  /* Header: no horizontal carousel. Real collapsible mobile menu. */
  .top{width:100%!important}
  .top .nav{
    position:relative!important;
    display:grid!important;
    width:100%!important;
    min-height:58px!important;
    grid-template-columns:minmax(0,1fr) auto auto!important;
    grid-template-rows:auto!important;
    align-items:center!important;
    gap:6px!important;
    padding-top:7px!important;
    padding-bottom:7px!important;
  }
  .brandBtn{
    grid-column:1!important;
    grid-row:1!important;
    justify-self:start!important;
    min-width:0!important;
    overflow:hidden;
  }
  .brand{font-size:1.05rem!important;white-space:nowrap!important;letter-spacing:-.025em!important}
  .brand-lockup small,.stage-badge{display:none!important}
  .account{
    grid-column:2!important;
    grid-row:1!important;
    justify-self:end!important;
    min-height:38px!important;
    margin:0!important;
    padding:7px 9px!important;
    white-space:nowrap!important;
    font-size:10.5px!important;
  }
  #navToggle{
    display:inline-flex!important;
    grid-column:3!important;
    grid-row:1!important;
    min-height:38px!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
    padding:7px 9px!important;
    border-radius:10px!important;
    white-space:nowrap!important;
    font-size:10.5px!important;
  }
  #primaryNav{
    position:absolute!important;
    top:calc(100% + 6px)!important;
    right:0!important;
    left:0!important;
    z-index:50!important;
    display:none!important;
    width:auto!important;
    max-width:none!important;
    margin:0!important;
    padding:7px!important;
    overflow:visible!important;
    border:1px solid rgba(49,92,246,.14)!important;
    border-radius:14px!important;
    background:rgba(255,253,248,.985)!important;
    box-shadow:0 18px 40px rgba(30,43,82,.18)!important;
    white-space:normal!important;
  }
  #primaryNav.is-open{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:4px!important;
  }
  #primaryNav>a,
  #primaryNav>button{
    width:100%!important;
    min-height:42px!important;
    justify-content:flex-start!important;
    padding:9px 10px!important;
    font-size:11px!important;
    white-space:normal!important;
    text-align:left!important;
  }

  /* Search and generic page heads. */
  .site-search,.discovery-shell{width:100%!important;max-width:100%!important}
  .site-search .search,.discovery-search{
    display:grid!important;
    width:100%!important;
    max-width:100%!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:7px!important;
  }
  .site-search input,.discovery-search input{
    min-width:0!important;
    min-height:46px!important;
    font-size:16px!important;
  }
  .site-search .primary,.discovery-search .primary{
    min-height:46px!important;
    padding-inline:12px!important;
    white-space:nowrap!important;
  }
  .section{padding:16px 0!important}
  .section-head,
  .home-section-title,
  .platform-hub-section-head{
    align-items:flex-start!important;
    flex-direction:column!important;
    gap:10px!important;
  }
  .section-head>.primary{
    width:100%!important;
    min-height:44px!important;
  }
  .home-section-title>.ghost{
    width:auto!important;
    min-height:40px!important;
    align-self:flex-start!important;
    padding:9px 12px!important;
  }
  .section h2,.home-section-title h2{
    font-size:clamp(24px,8vw,32px)!important;
    line-height:1.06!important;
  }

  /* HOME — editorial cards must never become narrow two-column tiles. */
  .home-v1-hero{
    grid-template-columns:1fr!important;
    gap:14px!important;
    padding:16px!important;
  }
  .home-v1-hero h1{
    max-width:100%!important;
    font-size:clamp(29px,8vw,35px)!important;
    line-height:1.02!important;
    letter-spacing:-.035em!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
    text-wrap:balance;
  }
  .home-v1-hero p{font-size:14px!important;line-height:1.5!important}
  .home-v1-hero>.primary{width:100%!important;min-width:0!important}
  .home-popular-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .home-popular-card{min-width:0!important}
  .home-news-lead,
  .home-news-latest,
  .home-panel .news-side-stack{
    width:100%!important;
    grid-template-columns:1fr!important;
    gap:11px!important;
  }
  .home-panel .news-feature{
    width:100%!important;
    height:auto!important;
    max-height:none!important;
    grid-template-columns:1fr!important;
  }
  .home-panel .news-feature .news-visual,
  .home-panel .news-feature .news-visual.has-image{
    width:calc(100% - 20px)!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:16/9!important;
    margin:10px!important;
  }
  .home-panel .news-feature-copy{padding:14px 16px 17px!important}
  .home-panel .news-side-card,
  .home-panel .news-latest-card,
  .home-panel .news-latest-card:nth-child(3n+1),
  .home-panel .news-latest-card:nth-child(3n+2),
  .home-panel .news-latest-card:nth-child(3n){
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    min-height:124px!important;
    grid-template-columns:112px minmax(0,1fr)!important;
    grid-template-rows:1fr!important;
    overflow:hidden!important;
  }
  .home-panel .news-side-card .news-visual,
  .home-panel .news-side-card .news-visual.has-image,
  .home-panel .news-side-card .news-visual:not(.has-image),
  .home-panel .news-latest-card .news-visual,
  .home-panel .news-latest-card .news-visual.has-image,
  .home-panel .news-latest-card .news-visual:not(.has-image){
    width:100px!important;
    min-width:100px!important;
    height:104px!important;
    min-height:104px!important;
    aspect-ratio:auto!important;
    align-self:center!important;
    justify-self:center!important;
    margin:10px 2px 10px 10px!important;
    border-radius:11px!important;
  }
  .home-panel .news-side-card>div:last-child,
  .home-panel .news-latest-card>div:last-child{
    min-width:0!important;
    overflow:hidden!important;
    padding:12px 13px!important;
  }
  .home-panel .news-side-card h3,
  .home-panel .news-latest-card h3{
    display:-webkit-box!important;
    min-width:0!important;
    margin:5px 0 7px!important;
    overflow:hidden!important;
    font-size:14px!important;
    line-height:1.2!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:3!important;
  }
  .home-panel .news-side-card .news-meta,
  .home-panel .news-latest-card .news-meta{
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .home-panel .news-side-card .text-button,
  .home-panel .news-latest-card .text-button{
    display:inline-flex!important;
    max-width:100%!important;
    white-space:normal!important;
  }
  .home-platform-strip{grid-template-columns:1fr!important;gap:9px!important}
  .home-platform-chip{width:100%!important;min-width:0!important}

  /* Magazine archive. */
  .magazine-subnav,.collection-subnav{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }
  .news-archive{
    display:grid!important;
    width:100%!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  .news-archive-card{width:100%!important;min-width:0!important}
  .news-archive-card h3,
  .news-archive-card h2{
    word-break:normal!important;
    overflow-wrap:break-word!important;
  }

  /* Catalogue / collection / marketplace / activity. */
  .catalog-tools,
  .catalog-tools-v2{
    width:100%!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  .catalog-tools-v2 #catalogQ,
  .catalog-tools-v2 #catalogLoad{grid-column:auto!important}
  .catalog-tools select,.catalog-tools input,.catalog-tools button{
    width:100%!important;
    min-height:46px!important;
  }
  #catalogGrid,
  #marketGrid,
  #vaultGrid,
  #wishlistGrid,
  #matchesGrid,
  .activity-grid,
  .platform-grid{
    width:100%!important;
    grid-template-columns:1fr!important;
    gap:11px!important;
  }
  #catalogGrid .game-card{width:100%!important;min-width:0!important;padding:11px!important}
  #catalogGrid .visual{
    height:min(50vw,220px)!important;
    margin:-11px -11px 10px!important;
  }
  #catalogGrid .visual.fallback{height:110px!important}
  #catalogGrid h3{min-height:0!important;font-size:16px!important}
  #catalogGrid .price{font-size:20px!important}
  #catalogGrid .right{display:block!important;max-width:48%!important}
  #catalogGrid .actions{
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  #catalogGrid .actions .estimate{grid-column:1/-1!important}
  #catalogGrid .actions button,
  #catalogGrid .actions a{min-height:44px!important;font-size:10px!important}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .activity-controls{width:100%!important}
  .activity-controls>*{min-height:44px!important}

  /* Bons plans. */
  .deal-radar-grid{grid-template-columns:1fr!important;gap:11px!important}
  .deal-radar-card{
    width:100%!important;
    grid-template-columns:88px minmax(0,1fr)!important;
    gap:11px!important;
    padding:12px!important;
    overflow:hidden!important;
  }
  .deal-radar-card .deal-cover{width:88px!important;height:120px!important}
  .deal-radar-body,.deal-radar-card h3,.deal-radar-top{
    min-width:0!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
  }
  .deal-radar-price{grid-template-columns:1fr!important}
  .deal-radar-saving{grid-template-columns:1fr!important}
  .deal-radar-link{width:100%!important;min-height:44px!important}

  /* Platform hubs — compact console-first composition. */
  .platform-hub-shell{gap:16px!important}
  .platform-hub-hero{
    grid-template-columns:1fr!important;
    min-height:0!important;
    overflow:hidden!important;
    border-radius:19px!important;
  }
  .platform-hub-hero-copy{padding:18px 17px 8px!important}
  .platform-hub-back{margin-bottom:14px!important}
  .platform-hub-kicker{font-size:.66rem!important}
  .platform-hub-hero h1{
    margin:7px 0 8px!important;
    font-size:clamp(32px,10vw,42px)!important;
    line-height:1!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
  }
  .platform-hub-headline{font-size:15px!important;line-height:1.45!important}
  .platform-hub-facts{gap:6px!important;margin-top:14px!important}
  .platform-hub-facts span{padding:7px 9px!important;font-size:.7rem!important}
  .platform-hub-hero-visual{
    min-height:172px!important;
    margin:8px 14px 14px!important;
    padding:12px 16px!important;
    overflow:hidden!important;
    border:1px solid var(--platform-border)!important;
    border-radius:16px!important;
    background:linear-gradient(145deg,var(--platform-soft),var(--platform-surface))!important;
  }
  .platform-hub-hero-visual::after{
    width:min(58%,190px)!important;
    opacity:.7!important;
  }
  .platform-hub-console{
    width:min(100%,300px)!important;
    max-height:168px!important;
    filter:drop-shadow(0 12px 18px rgba(31,43,78,.16))!important;
  }
  .platform-hub-console-fallback{
    width:92px!important;
    aspect-ratio:1!important;
    border-radius:22px!important;
    font-size:1.45rem!important;
  }
  .platform-hub-console-fallback[hidden]{display:none!important}
  .platform-hub-story{grid-template-columns:1fr!important}
  .platform-hub-story-main,.platform-hub-timeline{padding:18px!important;border-radius:16px!important}
  .platform-hub-games{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  .platform-hub-game .visual{min-height:138px!important}
  .platform-hub-deals,.platform-hub-pulse-grid,.platform-hub-anecdote-grid{grid-template-columns:1fr!important}
  .platform-hub-cta{align-items:flex-start!important;flex-direction:column!important;padding:18px!important}
  .platform-hub-cta .primary{width:100%!important}

  /* Modals and price/product cockpit. */
  .modal{padding:8px!important}
  .modal-card{
    width:100%!important;
    max-width:100%!important;
    max-height:calc(100dvh - 16px)!important;
    border-radius:15px!important;
  }
  #modalBody{padding:14px!important}
  .product-cockpit-hero{
    grid-template-columns:84px minmax(0,1fr)!important;
    gap:12px!important;
  }
  .product-cockpit-hero>.visual{width:84px!important;height:116px!important}
  .product-cockpit-actions{display:grid!important;grid-template-columns:1fr 1fr!important}
  .product-cockpit-actions>*{width:100%!important;min-height:44px!important}
  .cote-offer-filters,.product-page .cote-offer-filters{grid-template-columns:1fr!important}
  .cote-offer-card,.product-page .cote-offer-card{
    grid-template-columns:1fr!important;
    min-width:0!important;
  }
  .cote-offer-actions,.product-page .cote-offer-actions{
    grid-column:1!important;
    grid-row:auto!important;
    width:100%!important;
  }
  .cote-offer-actions .primary,.product-page .cote-offer-actions .primary{
    width:100%!important;
    min-height:44px!important;
    justify-content:center!important;
  }
  .cote-offer-meta,.product-page .cote-offer-meta{
    grid-column:1!important;
    grid-row:auto!important;
  }

  /* Dedicated product route. */
  .product-page .top .nav{
    grid-template-columns:minmax(0,1fr) auto!important;
  }
  .product-page .top .nav>nav{display:none!important}
  .product-back-link{
    grid-column:2!important;
    justify-self:end!important;
    margin:0!important;
    min-height:40px!important;
    padding:8px 9px!important;
    font-size:11px!important;
    white-space:nowrap!important;
  }
  .product-page-shell{padding-top:12px!important}
  .product-page-cockpit{width:100%!important;padding:10px!important;border-radius:18px!important}
  .product-breadcrumb{
    max-width:100%!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
  }

  /* Public editorial listing + article routes. */
  .seo-article-page .top .nav{
    grid-template-columns:minmax(0,1fr) auto!important;
  }
  .seo-section-nav{
    grid-column:1/-1!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    overflow-x:auto!important;
    padding-bottom:2px;
    white-space:nowrap;
  }
  .seo-back{
    grid-column:2!important;
    justify-self:end!important;
    margin:0!important;
    white-space:nowrap!important;
  }
  .seo-section-shell,.seo-article-shell{
    width:100%!important;
    max-width:100%!important;
    padding-top:18px!important;
    padding-bottom:36px!important;
  }
  .seo-section-grid,.seo-related-grid{grid-template-columns:1fr!important}
  .seo-section-card,.seo-article{width:100%!important;min-width:0!important}
  .seo-section-card h2,
  .seo-article h1{
    word-break:normal!important;
    overflow-wrap:break-word!important;
  }
  .seo-article h1{font-size:clamp(2rem,10vw,2.7rem)!important}
  .seo-article-lead{font-size:1.05rem!important;line-height:1.55!important}
  .seo-article-body{font-size:1rem!important;line-height:1.7!important}
  .news-source-box .source-link{width:100%!important;white-space:normal!important}

  .footer{padding-bottom:max(28px,env(safe-area-inset-bottom))!important}
}

@media (max-width: 420px) {
  .top .nav{grid-template-columns:minmax(0,1fr) auto auto!important;gap:4px!important}
  .brand{font-size:.98rem!important}
  .account,#navToggle{padding-inline:7px!important;font-size:9.8px!important}
  #primaryNav.is-open{grid-template-columns:1fr!important}
  .site-search .search,.discovery-search{grid-template-columns:1fr!important}
  .site-search .primary,.discovery-search .primary{width:100%!important}
  .home-popular-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .home-panel .news-side-card,
  .home-panel .news-latest-card,
  .home-panel .news-latest-card:nth-child(3n+1),
  .home-panel .news-latest-card:nth-child(3n+2),
  .home-panel .news-latest-card:nth-child(3n){
    grid-template-columns:96px minmax(0,1fr)!important;
  }
  .home-panel .news-side-card .news-visual,
  .home-panel .news-side-card .news-visual.has-image,
  .home-panel .news-side-card .news-visual:not(.has-image),
  .home-panel .news-latest-card .news-visual,
  .home-panel .news-latest-card .news-visual.has-image,
  .home-panel .news-latest-card .news-visual:not(.has-image){
    width:86px!important;
    min-width:86px!important;
    height:96px!important;
    min-height:96px!important;
    margin-left:8px!important;
  }
  .stats{grid-template-columns:1fr!important}
  #catalogGrid .actions{grid-template-columns:1fr!important}
  #catalogGrid .actions .estimate{grid-column:auto!important}
  .deal-radar-card{grid-template-columns:1fr!important}
  .deal-radar-card .deal-cover{
    width:min(150px,55vw)!important;
    height:auto!important;
    aspect-ratio:3/4;
    margin:auto;
  }
  /* Platform Hubs V2 deliberately keeps two discovery columns from 360px upward. */
  .product-cockpit-hero{grid-template-columns:1fr!important}
  .product-cockpit-hero>.visual{
    width:min(150px,52vw)!important;
    height:auto!important;
    aspect-ratio:3/4;
    justify-self:center!important;
  }
  .product-cockpit-actions{grid-template-columns:1fr!important}
  .cote-market-grid{grid-template-columns:1fr!important}
}

@media (max-width: 330px) {
  .platform-hub-shell .platform-hub-games{grid-template-columns:1fr!important}
}


/* Mobile composition corrections — September 30 screenshots */
@media (max-width: 600px){
  .site-search .search,
  .discovery-search{
    grid-template-columns:1fr!important;
  }
  .site-search .primary,
  .discovery-search .primary{
    width:100%!important;
    min-height:44px!important;
  }
  #primaryNav>a,
  #primaryNav>button{
    min-width:0!important;
    min-height:40px!important;
    overflow:visible!important;
    text-overflow:clip!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
  }
  .home-section-title{
    align-items:flex-start!important;
  }
}


/* Magazine mobile readability V1 — title is the CTA, copy stays readable. */
@media (max-width: 760px){
  .home-panel .news-feature .news-open-link,
  .home-panel .news-feature .news-open:not(.news-title-link),
  .home-panel .news-side-card .news-open-link,
  .home-panel .news-side-card .news-open:not(.news-title-link),
  .home-panel .news-latest-card .news-open-link,
  .home-panel .news-latest-card .news-open:not(.news-title-link){
    display:none!important;
  }

  .home-panel .news-feature-copy{
    gap:0!important;
    justify-content:flex-start!important;
  }
  .home-panel .news-feature-copy p,
  .home-panel .news-latest-card p,
  .news-archive-card p{
    color:#4f5c73!important;
    opacity:1!important;
    text-shadow:none!important;
  }
  .home-panel .news-feature-copy p{
    display:-webkit-box!important;
    margin:10px 0 12px!important;
    overflow:hidden!important;
    font-size:14px!important;
    line-height:1.55!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:4!important;
  }
  .home-panel .news-feature .news-meta,
  .home-panel .news-side-card .news-meta,
  .home-panel .news-latest-card .news-meta,
  .news-archive-card .news-meta{
    margin-top:8px!important;
    color:#667085!important;
    opacity:1!important;
    font-size:10.5px!important;
    line-height:1.45!important;
    white-space:normal!important;
    text-overflow:clip!important;
  }
  .home-panel .news-feature h1,
  .home-panel .news-side-card h3,
  .home-panel .news-latest-card h3,
  .news-archive-card h3{
    color:#18233f!important;
  }
  .home-panel .news-feature .news-title-link,
  .home-panel .news-side-card .news-title-link,
  .home-panel .news-latest-card .news-title-link,
  .news-archive-card .news-title-link{
    color:inherit!important;
    text-decoration:none!important;
  }
  .home-panel .news-feature .news-title-link:active,
  .home-panel .news-side-card .news-title-link:active,
  .home-panel .news-latest-card .news-title-link:active,
  .news-archive-card .news-title-link:active{
    color:#315cf6!important;
  }

  .news-archive-copy{
    display:flex!important;
    min-width:0!important;
    flex-direction:column!important;
    gap:0!important;
    padding-bottom:18px!important;
  }
}

/* Platform Hubs V2 — final mobile history containment contract.
   This layer is intentionally last: expanded editorial content must never
   increase the document width on 360–650px viewports. */
@media (max-width: 650px){
  .platform-hub-history,
  .platform-hub-history>summary,
  .platform-hub-history>summary>span,
  .platform-hub-history .platform-hub-story,
  .platform-hub-history .platform-hub-story-main,
  .platform-hub-history .platform-hub-timeline,
  .platform-hub-history .platform-hub-story-copy,
  .platform-hub-history .platform-hub-story-section,
  .platform-hub-history .platform-hub-identity-grid,
  .platform-hub-history .platform-hub-identity-item,
  .platform-hub-history .platform-hub-anecdotes,
  .platform-hub-history .platform-hub-anecdote-grid,
  .platform-hub-history .platform-hub-anecdote,
  .platform-hub-history .platform-hub-sources,
  .platform-hub-history .platform-hub-sources div{
    min-width:0!important;
    max-width:100%!important;
  }
  .platform-hub-history .platform-hub-story{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .platform-hub-history .platform-hub-identity-grid{
    grid-template-columns:minmax(0,1fr)!important;
  }
  .platform-hub-history .platform-hub-timeline li{
    min-width:0!important;
    grid-template-columns:minmax(0,62px) minmax(0,1fr)!important;
  }
  .platform-hub-history .platform-hub-anecdote summary{
    min-width:0!important;
  }
  .platform-hub-history .platform-hub-anecdote summary strong,
  .platform-hub-history .platform-hub-identity-item strong,
  .platform-hub-history .platform-hub-story-section :is(h3,p),
  .platform-hub-history .platform-hub-timeline li>span:last-child,
  .platform-hub-history .platform-hub-sources a{
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    white-space:normal!important;
  }
  .platform-hub-history-toggle{
    min-width:0!important;
    max-width:100%!important;
    flex-wrap:wrap!important;
  }
}

