/* GameScripter Studio V36 — responsive foundation
   Mobile-first, fluid type/layout, safe areas, tablet/desktop/4K/8K scaling. */

:root {
  --gs-page-gutter: clamp(1rem, 2.2vw, 2.25rem);
  --gs-shell-max: 90rem;
  --gs-section-space: clamp(3.75rem, 6vw, 7.5rem);
  --gs-fluid-radius: clamp(1rem, 1.2vw, 1.6rem);
}

html {
  min-width: 320px;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
}
*, *::before, *::after { min-width: 0; }
img, picture, video, canvas, svg, iframe { max-inline-size: 100%; }
img, video { height: auto; }
iframe { border: 0; }
pre, code, .table-responsive { max-width: 100%; overflow-x: auto; }
p, h1, h2, h3, h4, h5, h6, a, button, span, strong, small { overflow-wrap: anywhere; }

/* Fluid page shell instead of a fixed 1240/1380px canvas. */
.container,
.gs-navbar .container,
.gs-terms-container,
.gs-3d-container,
.faq-container {
  width: min(calc(100% - (var(--gs-page-gutter) * 2)), var(--gs-shell-max)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

/* Safe-area support for notched phones. */
body { padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
header.sticky-top { padding-top: env(safe-area-inset-top); }
.nexus-footer { padding-bottom: env(safe-area-inset-bottom); }

/* Global vertical rhythm. */
.py-20 { padding-block: var(--gs-section-space) !important; }
.gs-categories,
.gs-products,
.gs-catalog-showcase,
.gs-legal-home,
.gs-platform-section { padding-block: var(--gs-section-space) !important; }
.component, section, main, aside, article, .row, [class*="col-"] { max-width: 100%; }

/* Header: prevent crowding and keep controls touch-friendly. */
.gs-navbar { min-height: clamp(4rem, 5vw, 4.9rem); }
.gs-navbar .container { min-height: inherit; }
.gs-brand { flex: 0 1 auto; max-width: min(18rem, 32vw); }
.gs-brand img { width: clamp(2.25rem, 2.4vw, 2.8rem); height: clamp(2.25rem, 2.4vw, 2.8rem); }
.gs-brand-name { overflow: hidden; max-width: min(13rem, 20vw); text-overflow: ellipsis; }
.gs-main-nav { flex-wrap: nowrap; }
.gs-main-nav .nav-link,
.gs-platform-mega-trigger { white-space: nowrap; }
.gs-nav-icon,
.gs-menu-toggle,
.gs-selector-shell,
.gs-currency-selector .choices__inner { min-width: 2.75rem; min-height: 2.75rem !important; }
.gs-platform-mega-menu { max-height: min(78vh, 52rem); overflow-y: auto; overscroll-behavior: contain; }

/* Hero: scale by available space, not a fixed 790px height. */
.gs-hero,
.gs-media-hero {
  min-height: clamp(38rem, 72vh, 56rem) !important;
  padding-block: clamp(4.5rem, 7vw, 8rem) clamp(3.75rem, 6vw, 7rem) !important;
}
.gs-media-hero-copy,
.gs-hero-copy { max-width: min(100%, 48rem); }
.gs-media-hero-copy h1,
.gs-hero h1 {
  max-width: 100%;
  font-size: clamp(2.65rem, 5.35vw, 7rem) !important;
  line-height: .94;
  text-wrap: balance;
}
.gs-media-hero-copy > p,
.gs-hero-copy > p { max-width: 42rem; font-size: clamp(.95rem, .75vw + .72rem, 1.22rem); }
.gs-media-collage {
  width: 100%;
  min-height: clamp(28rem, 36vw, 37rem) !important;
  grid-template-rows: minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(7rem, .72fr) !important;
}
.gs-media-tile-copy { max-width: calc(100% - 2rem); }
.gs-media-tile-copy strong { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.gs-media-glow-one, .gs-media-hero-glow-one { width: min(31rem, 38vw); height: min(31rem, 38vw); }
.gs-media-glow-two, .gs-media-hero-glow-two { width: min(22rem, 28vw); height: min(22rem, 28vw); }

/* Live activity adapts to its own space. */
.gs-live-activity { container-type: inline-size; }
.gs-live-line b,
.gs-live-rating span { max-width: min(32ch, 100%) !important; }
@container (max-width: 760px) {
  .gs-live-activity { grid-template-columns: 1fr; }
  .gs-live-activity-meta { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

/* Product and gallery grids. */
.gs-catalog-showcase-grid,
.gs-dashboard-category-grid,
.gs-category-bento,
.gs-legal-home-grid { grid-auto-flow: row; }
.gs-catalog-showcase-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gs-catalog-showcase-item,
.product-card,
.gs-product-card { width: 100%; min-width: 0; }
.product-card img,
.gs-product-image img { width: 100%; object-fit: cover; }

/* Catalog workspace: fluid cart width and predictable card columns. */
.gs-catalog-page { width: 100%; }
.gs-catalog-hero { padding: clamp(1.25rem, 2.5vw, 2.2rem); }
.gs-catalog-hero h1 { font-size: clamp(2.35rem, 5vw, 5.4rem) !important; }
.gs-catalog-workspace.has-cart,
.gs-catalog-page.has-live-cart .gs-catalog-workspace.has-cart {
  grid-template-columns: minmax(0, 1fr) clamp(20rem, 23vw, 25rem) !important;
  gap: clamp(1rem, 1.7vw, 1.75rem) !important;
}
.gs-catalog-results { container-type: inline-size; }
.gs-catalog-results .row.products { --bs-gutter-x: clamp(.9rem, 1.3vw, 1.4rem); }
.gs-catalog-results .row.products > [class*="col-"] { width: 33.333333% !important; }
.gs-catalog-cart-dock,
.gs-catalog-page.has-live-cart .gs-catalog-cart-dock {
  top: calc(clamp(4rem, 5vw, 4.9rem) + .85rem) !important;
  max-height: calc(100dvh - clamp(5.8rem, 7vw, 7rem)) !important;
  overflow: hidden;
}
.gs-dock-items { min-height: 0; max-height: min(19rem, 34dvh) !important; }
.gs-dock-item { grid-template-columns: 3.25rem minmax(0,1fr) 2.25rem; }
.gs-dock-head b { white-space: nowrap; }
.gs-dock-checkout { min-height: 3rem; }

/* Selector stays usable with long translated text. */
.gs-catalog-selector { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
.gs-selector-options button { min-width: 0; }
.gs-selector-options button span { min-width: 0; }
.gs-selector-options strong,
.gs-selector-options small { white-space: normal; }

/* Forms, modals and account pages. */
.modal-dialog { width: min(calc(100% - 2rem), var(--bs-modal-width, 50rem)); margin-inline: auto; }
.modal-content { max-height: calc(100dvh - 2rem); overflow: auto; }
.gs-auth-modal .modal-dialog { width: min(calc(100% - 2rem), 58rem); max-width: none; }
.gs-auth-shell { min-height: min(38rem, calc(100dvh - 2rem)); }
input, select, textarea, button { max-width: 100%; }
input, select, textarea { font-size: max(16px, 1em); }

/* Footer and legal pages. */
.nexus-footer .container { width: min(calc(100% - (var(--gs-page-gutter) * 2)), var(--gs-shell-max)) !important; }
.nexus-footer-brand { max-width: 100%; }
.gs-terms-hero,
.gs-policy-card,
.gs-legal-home-card { overflow: hidden; }

/* Tablet / compact desktop. */
@media (max-width: 1199.98px) {
  .gs-catalog-workspace.has-cart,
  .gs-catalog-page.has-live-cart .gs-catalog-workspace.has-cart {
    grid-template-columns: 1fr !important;
  }
  .gs-catalog-cart-column { order: -1 !important; }
  .gs-catalog-cart-dock,
  .gs-catalog-page.has-live-cart .gs-catalog-cart-dock {
    position: relative !important;
    top: auto !important;
    max-height: none !important;
  }
  .gs-dock-items { max-height: 15rem !important; }
  .gs-catalog-results .row.products > [class*="col-"] { width: 50% !important; }
  .gs-catalog-showcase-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Bootstrap's lg navbar is too tight around 1024px; use a compact desktop layout. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .gs-navbar .container { width: calc(100% - 2rem) !important; }
  .gs-brand-name { max-width: 8.5rem; }
  .gs-main-nav .nav-link,
  .gs-platform-mega-trigger { padding-inline: .48rem !important; font-size: .75rem !important; }
  .gs-global-tools { gap: .25rem; margin-inline-start: .35rem; }
  .gs-global-tools .choices { min-width: 4.9rem; }
}

/* Tablet. */
@media (max-width: 991.98px) {
  :root { --gs-page-gutter: clamp(.9rem, 3vw, 1.5rem); }
  header.sticky-top { position: relative !important; top: auto !important; }
  .gs-navbar .navbar-collapse {
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .gs-platform-mega-menu { max-height: none; overflow: visible; }
  .gs-media-hero,
  .gs-hero { min-height: auto !important; }
  .gs-media-hero .row,
  .gs-hero .row { row-gap: clamp(2rem, 5vw, 3.5rem); }
  .gs-media-hero-copy,
  .gs-hero-copy { max-width: 44rem; margin-inline: auto; text-align: center; }
  .gs-media-hero-copy > p,
  .gs-hero-copy > p,
  .gs-hero-search { margin-inline: auto; }
  .gs-media-hero-points,
  .gs-media-hero .gs-hero-actions,
  .gs-media-hero-stats,
  .gs-hero-actions,
  .gs-hero-stats { justify-content: center; }
  .gs-media-collage { max-width: 48rem; margin-inline: auto; transform: none !important; }
  .gs-catalog-selector { grid-template-columns: 1fr; }
  .gs-selector-arrow { transform: rotate(90deg); min-height: 1.5rem; }
  html[dir="rtl"] .gs-selector-arrow { transform: rotate(90deg); }
  .gs-catalog-toolbar { grid-template-columns: 1fr auto; }
  .gs-live-activity { grid-template-columns: 1fr; }
  .gs-live-activity-meta { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .gs-catalog-showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phones. */
@media (max-width: 767.98px) {
  :root { --gs-page-gutter: clamp(.75rem, 4vw, 1rem); --gs-section-space: clamp(3.25rem, 12vw, 4.75rem); }
  .gs-navbar { min-height: 4.25rem; }
  .gs-navbar .container { width: calc(100% - 1rem) !important; }
  .gs-brand { max-width: calc(100% - 9.25rem); gap: .55rem; }
  .gs-brand-name { max-width: 9.2rem; font-size: .9rem; }
  .gs-brand img { width: 2.4rem; height: 2.4rem; }
  .gs-nav-icon,
  .gs-menu-toggle { width: 2.75rem; height: 2.75rem; }
  .gs-cart-count { top: -.35rem; right: -.35rem; }

  .gs-media-hero,
  .gs-hero { padding-block: 3.5rem 3.25rem !important; }
  .gs-media-hero-copy h1,
  .gs-hero h1 { font-size: clamp(2.45rem, 13vw, 4.2rem) !important; letter-spacing: -.055em; }
  .gs-media-hero-points { gap: .45rem; }
  .gs-media-hero-points span { padding: .5rem .65rem; font-size: .7rem; }
  .gs-hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .gs-button { width: 100%; min-height: 3rem; }
  .gs-media-hero-stats,
  .gs-hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
  .gs-media-hero-stats > div,
  .gs-hero-stats > div { min-width: 0 !important; padding: .75rem !important; border: 0 !important; }

  .gs-media-collage {
    grid-template-columns: repeat(2, minmax(0,1fr));
    grid-template-rows: clamp(13rem, 62vw, 17rem) clamp(8rem, 38vw, 10rem) clamp(7.25rem, 31vw, 9rem) !important;
    min-height: 0 !important;
    gap: .55rem;
    padding: .55rem;
  }
  .gs-media-tile-main { grid-column: 1 / -1; grid-row: 1; }
  .gs-media-tile:nth-of-type(2) { grid-column: 1; grid-row: 2; }
  .gs-media-tile:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  .gs-media-tile:nth-of-type(4) { grid-column: 1; grid-row: 3; }
  .gs-media-channel-card { grid-column: 2; grid-row: 3; }
  .gs-media-play { width: 2.25rem; height: 2.25rem; }
  .gs-media-tile-copy { left: .7rem; right: .7rem; bottom: .65rem; }
  .gs-media-channel-card { padding: .7rem; }
  .gs-media-channel-card strong { font-size: .72rem; }
  .gs-media-channel-card a { font-size: .62rem; }

  .gs-live-activity { margin-top: 2rem; padding: .8rem; border-radius: 1rem; }
  .gs-live-activity-item { grid-template-columns: 2.6rem minmax(0,1fr); gap: .65rem; padding: .65rem; }
  .gs-live-avatar { width: 2.6rem; height: 2.6rem; }
  .gs-live-verified { grid-column: 2; }
  .gs-live-activity-meta { font-size: .6rem; }

  .gs-catalog-hero { align-items: flex-start; flex-direction: column; }
  .gs-catalog-live { justify-content: flex-start; }
  .gs-catalog-selector { padding: .75rem; }
  .gs-selector-step { padding: .75rem; }
  .gs-selector-options { grid-template-columns: 1fr; }
  .gs-selector-summary { align-items: stretch; flex-direction: column; }
  .gs-selector-summary a { width: 100%; justify-content: center; }
  .gs-catalog-toolbar { grid-template-columns: 1fr; }
  .gs-catalog-search-form { grid-template-columns: auto minmax(0,1fr); padding: .6rem .75rem; }
  .gs-catalog-search-form button { grid-column: 1 / -1; width: 100%; }
  .gs-catalog-filter-button { width: 100%; }
  .gs-catalog-results .row.products > [class*="col-"] { width: 100% !important; }
  .gs-dock-head { grid-template-columns: auto minmax(0,1fr) auto; }
  .gs-dock-item { grid-template-columns: 3rem minmax(0,1fr) 2.25rem; }
  .gs-dock-rewards { padding: .8rem; }
  .gs-dock-trust { flex-wrap: wrap; gap: .5rem; }
  .gs-catalog-showcase-grid,
  .gs-dashboard-category-grid,
  .gs-legal-home-grid { grid-template-columns: 1fr; }

  .gs-auth-shell { display: block; min-height: 0; }
  .gs-auth-visual { display: none; }
  .gs-auth-panel { min-height: 0 !important; padding: 1.35rem 1rem !important; }
  .gs-auth-modal .modal-dialog { width: calc(100% - 1rem); margin: .5rem auto; }
  .modal-dialog { width: calc(100% - 1rem); margin: .5rem auto; }
  .modal-content { max-height: calc(100dvh - 1rem); }

  .nexus-footer .row { row-gap: 1.5rem; }
  .nexus-footer-brand { justify-content: center; text-align: center; }
}

/* Very narrow phones. */
@media (max-width: 379.98px) {
  .gs-brand-name { max-width: 6.5rem; }
  .gs-brand { max-width: calc(100% - 8.7rem); }
  .gs-navbar .d-flex.gap-2 { gap: .3rem !important; }
  .gs-nav-icon,
  .gs-menu-toggle { width: 2.55rem; height: 2.55rem; }
  .gs-media-hero-copy h1,
  .gs-hero h1 { font-size: clamp(2.2rem, 12.5vw, 3.25rem) !important; }
  .gs-media-collage { grid-template-rows: 12rem 7.5rem 7rem !important; }
  .gs-media-channel-card > span { font-size: .58rem; }
  .gs-media-channel-card strong { font-size: .65rem; }
  .gs-live-line { font-size: .72rem; }
  .gs-live-line strong { font-size: .76rem; }
}

/* Short landscape phones/tablets: avoid a full-viewport hero and tall menus. */
@media (max-height: 620px) and (orientation: landscape) {
  .gs-hero,
  .gs-media-hero { min-height: auto !important; padding-block: 3rem !important; }
  .gs-navbar .navbar-collapse { max-height: calc(100dvh - 5rem); }
  .gs-platform-mega-menu { max-height: 70dvh; }
  .modal-content { max-height: calc(100dvh - 1rem); }
}

/* Large desktop / QHD. */
@media (min-width: 1600px) {
  :root { --gs-shell-max: 98rem; }
  .gs-catalog-showcase-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* 4K layouts: use the extra width without stretching lines too far. */
@media (min-width: 2200px) {
  :root { --gs-shell-max: 118rem; --gs-page-gutter: 2.5rem; }
  html { font-size: 17px; }
  .gs-media-hero .row { --bs-gutter-x: 5rem; }
  .gs-media-collage { min-height: 39rem !important; }
  .gs-catalog-results .row.products > [class*="col-"] { width: 25% !important; }
  .gs-catalog-workspace.has-cart,
  .gs-catalog-page.has-live-cart .gs-catalog-workspace.has-cart { grid-template-columns: minmax(0,1fr) 26rem !important; }
  .gs-catalog-showcase-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .gs-dashboard-category-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

/* 8K / presentation walls: readable scaling with a capped content measure. */
@media (min-width: 3840px) {
  :root { --gs-shell-max: 142rem; --gs-page-gutter: 3rem; }
  html { font-size: 19px; }
  .gs-media-hero-copy h1,
  .gs-hero h1 { max-width: 10.5ch; font-size: clamp(5.5rem, 4.2vw, 9rem) !important; }
  .gs-media-collage { min-height: 43rem !important; }
  .gs-catalog-results .row.products > [class*="col-"] { width: 20% !important; }
  .gs-catalog-showcase-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
}

@media (min-width: 6000px) {
  :root { --gs-shell-max: 160rem; }
  html { font-size: 21px; }
}

/* Touch devices do not need hover-only motion. */
@media (hover: none) {
  .gs-media-tile:hover,
  .product-card:hover,
  .gs-dashboard-category-card:hover,
  .gs-platform-card:hover,
  .gs-button:hover,
  .gs-nav-icon:hover { transform: none !important; }
}

/* Accessibility and motion safety. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
