/** RC13: scope to existing storefront chrome/home only. Authoritative tokens unchanged.
 * Brand layer required because the established palette contains layered !important declarations.
 * No styles for Cart, Checkout, order processing, HansaPay, account, or product layouts.
 */
@layer gamespsn-brand {
  /* Existing desktop header: no new height and Telegram exactly between Account and Cart. */
  body.gl-brand-2026 .gl-storefront-header .gl-header-actions {display:flex;align-items:center;gap:8px;min-width:0;}
  body.gl-brand-2026 .gl-storefront-header .gl-header-telegram {
    min-width:0;white-space:nowrap;gap:7px;
    background:rgba(255,255,255,.08)!important;
    border-color:rgba(248,246,255,.32)!important;
    color:var(--paper)!important;
    -webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px);
    transition:background-color .18s ease,border-color .18s ease;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-header-telegram:is(:hover,:focus-visible) {
    background:rgba(255,255,255,.15)!important;border-color:rgba(248,246,255,.66)!important;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-header-telegram svg {width:19px;height:19px;flex-shrink:0;}
  body.gl-brand-2026 .gl-storefront-header .gl-telegram-label-short {display:none;}
  body.gl-brand-2026 .gl-storefront-header .gl-nav-row>.gl-mobile-telegram-support {display:none;}
  @media (min-width:801px) and (max-width:1150px) {
    body.gl-brand-2026 .gl-storefront-header .gl-header-row {grid-template-columns:minmax(145px,185px) minmax(160px,1fr) auto;gap:clamp(10px,1.3vw,18px);}
    body.gl-brand-2026 .gl-storefront-header .gl-telegram-label-long {display:none;}
    body.gl-brand-2026 .gl-storefront-header .gl-telegram-label-short {display:inline;}
    body.gl-brand-2026 .gl-storefront-header .gl-header-action {padding-inline:8px;}
  }
  /* Premium light search dropdown: existing JS endpoint/listbox and search form. */
  body.gl-brand-2026 .gl-storefront-header:focus-within {z-index:700;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-form {overflow:visible;isolation:auto;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-results {
    box-sizing:border-box;background:var(--surface-product)!important;color:var(--ink)!important;
    border:1px solid rgba(50,1,188,.22)!important;border-radius:13px;
    box-shadow:0 16px 34px rgba(23,8,72,.18)!important;
    max-height:min(490px,calc(100dvh - 175px));overflow-y:auto;overscroll-behavior:contain;
    scrollbar-color:rgba(98,3,227,.36) transparent;scrollbar-width:thin;
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
    padding:6px;z-index:900;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-results::-webkit-scrollbar {width:5px;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-results::-webkit-scrollbar-thumb {background:rgba(98,3,227,.30);border-radius:8px;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-section-title {
    color:var(--brand-purple-deep)!important;font-size:10px;letter-spacing:.08em;
    padding:8px 10px 5px;font-weight:800;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-result {
    display:flex;align-items:center;gap:11px;min-height:0;padding:8px 10px;
    border-radius:9px;text-decoration:none;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-result img {
    box-sizing:border-box;display:block;width:45px;height:51px;flex:0 0 45px;
    object-fit:contain;border:1px solid var(--line-light);border-radius:7px;
    background:var(--surface-secondary)!important;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-result>span {display:flex;flex-direction:column;gap:4px;min-width:0;flex:1;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-result strong {
    color:var(--ink)!important;font-size:12px;line-height:1.4;white-space:normal;
    overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
    overflow:hidden;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-result .gl-search-price {
    display:flex;align-items:center;flex-wrap:wrap;gap:3px 7px;
    font-size:12px;font-weight:750;color:var(--brand-purple-deep)!important;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-price del {font-size:11px;color:var(--muted-light)!important;font-weight:450;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-price ins {color:var(--brand-purple-deep)!important;text-decoration:none;font-weight:800;}
  body.gl-brand-2026 .gl-storefront-header .gl-search-results :is(.gl-search-result,.gl-search-category):is(:hover,:focus-visible,.gl-search-active) {
    background:var(--surface-secondary)!important;
    outline-color:var(--brand-purple-primary);text-decoration:none;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-results :is(.gl-search-empty,.gl-search-loading,.gl-search-notice) {
    margin:0;padding:14px 12px;font-size:12px;line-height:1.5;color:var(--muted-light)!important;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-all {
    display:flex;align-items:center;justify-content:center;position:sticky;bottom:-6px;
    z-index:1;min-height:41px;margin:5px 0 -6px;
    padding:9px 11px;background:var(--surface-product)!important;
    color:var(--brand-purple-deep)!important;font-size:12px;font-weight:750;
    border-top:1px solid var(--line-light)!important;
  }
  body.gl-brand-2026 .gl-storefront-header .gl-search-all:is(:hover,:focus-visible) {background:var(--surface-secondary)!important;}
  /* Mobile menu is the sole Telegram surface, no fourth header icon. */
  @media (max-width:800px) {
    body.gl-brand-2026 .gl-storefront-header .gl-header-telegram {display:none!important;}
    body.gl-brand-2026 .gl-storefront-header .gl-site-nav {
      background:linear-gradient(145deg,var(--brand-purple-deep),var(--brand-purple-primary) 70%,var(--brand-violet-bright))!important;
      border-color:rgba(248,246,255,.25)!important;
      scrollbar-width:thin;scrollbar-color:rgba(248,246,255,.38) transparent;
      max-height:calc(100dvh - 145px);
    }
    body.gl-brand-2026 .gl-storefront-header .gl-nav-row {padding-block:10px;}
    body.gl-brand-2026 .gl-storefront-header .gl-nav-links {gap:2px;}
    body.gl-brand-2026 .gl-storefront-header .gl-nav-links>li>a {
      min-height:46px;border-bottom:0!important;border-radius:9px;
      color:var(--paper)!important;display:flex;align-items:center;
      padding:10px 13px;
    }
    body.gl-brand-2026 .gl-storefront-header .gl-nav-links>li>a:is(:hover,:focus-visible),
    body.gl-brand-2026 .gl-storefront-header .gl-nav-links>.current-menu-item>a {
      background:rgba(255,255,255,.09)!important;color:var(--paper)!important;text-decoration:none;
    }
    body.gl-brand-2026 .gl-storefront-header .gl-nav-row>.gl-mobile-telegram-support {
      display:flex;align-items:center;gap:11px;min-height:54px;box-sizing:border-box;
      margin:12px 0 3px;padding:9px 12px;border-top:1px solid rgba(248,246,255,.25);
      border-radius:10px;border-left:1px solid rgba(248,246,255,.21);border-right:1px solid rgba(248,246,255,.21);border-bottom:1px solid rgba(248,246,255,.21);
      background:rgba(255,255,255,.09);color:var(--paper)!important;text-decoration:none!important;
    }
    body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-support:is(:hover,:focus-visible) {background:rgba(255,255,255,.15)!important;}
    body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-icon {
      display:inline-flex;align-items:center;justify-content:center;flex:0 0 36px;
      width:36px;height:36px;border-radius:8px;background:var(--brand-purple-primary);color:var(--paper);
    }
    body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-text {display:flex;flex:1;flex-direction:column;gap:2px;min-width:0;}
    body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-text strong {font-size:13px;color:var(--paper)!important;}
    body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-text small {font-size:11px;color:var(--surface-secondary)!important;}
    body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-external {font-size:18px;color:var(--surface-secondary);}
    body.gl-brand-2026 .gl-storefront-header .gl-search-results {max-height:min(390px,calc(100dvh - 195px));border-radius:11px;}
  }
  /* GTA VI stays cinematic; no blanket translucent panel over characters. */
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-hero::after {
    background:linear-gradient(90deg,rgba(50,1,188,.76),rgba(97,3,227,.22) 54%,rgba(152,8,254,.08))!important;
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-platform-choice {
    background:rgba(248,246,255,.08)!important;border-color:rgba(248,246,255,.46)!important;
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-platform-choice[aria-pressed=true] {
    background:var(--brand-purple-primary)!important;border-color:var(--paper)!important;
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-actions .gl-btn-outline {
    background:rgba(248,246,255,.08)!important;border-color:rgba(248,246,255,.55)!important;
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-platform-mark {
    background:rgba(248,246,255,.10)!important;border-color:rgba(248,246,255,.36)!important;
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-bottom-promo-copy {
    background:rgba(248,246,255,.06);border-radius:var(--gl-radius,12px);
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-benefits {box-shadow:0 5px 18px rgba(23,8,72,.10)!important;}
  /* Never change the RC12 trust strip borders, home grid or opaque game-card surfaces. */
  @media (max-width:590px) {
    body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-hero::after {
      background:linear-gradient(0deg,rgba(50,1,188,1) 11%,rgba(50,1,188,.97) 45%,rgba(97,3,227,.30) 73%,rgba(152,8,254,.06))!important;
    }
    body.gl-brand-2026.gl-official-home #main.gl-home .gl-bottom-promo-copy {background:transparent;backdrop-filter:none;}
  }
  @media (prefers-reduced-motion:reduce) {
    body.gl-brand-2026 .gl-storefront-header .gl-header-telegram,
    body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-platform-choice,
    body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-actions .gl-btn-outline {transition:none!important;}
  }
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  body.gl-brand-2026 .gl-storefront-header .gl-header-telegram,
  body.gl-brand-2026 .gl-storefront-header .gl-mobile-telegram-support {
    background:rgba(248,246,255,.13)!important;
  }
  body.gl-brand-2026.gl-official-home #main.gl-home .gl-gta-platform-choice {background:var(--brand-purple-deep)!important;}
}
