
      /* Bottom inset for viewport-anchored UI (the tab bar, the filter sheet,
         the auth-gate card). Deliberately a literal 0, not
         env(safe-area-inset-bottom): the safe-area insets only start
         reporting real values once a document opts in with
         `viewport-fit=cover` on its viewport meta, and no template here does,
         so on Chrome and on iOS Safari that env() has always resolved to 0.
         Firefox for Android reports its own bottom toolbar / gesture area
         through the inset anyway, without the opt-in, so it was the only
         browser adding anything -- roughly 50px of dead padding under the tab
         bar, which is why the bar looked far taller there than anywhere else.
         Add `viewport-fit=cover` to the viewport metas and this one line goes
         back to env(safe-area-inset-bottom, 0px); the three consumers below
         need no other change. */
      :root { --gg-safe-bottom: 0px; }
      header.site-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 24px;
        background: #0f0f0f;
        border-bottom: 1px solid #222;
        overflow: visible;
      }
      body.has-content-card > header.site-header {
        z-index: 3500 !important;
      }
      body.has-fixed-header > header.site-header {
        z-index: 3500 !important;
      }
      .brand {
        font-size: 20px;
        font-weight: 700;
        letter-spacing: 0.3px;
        color: #fff;
      }
      .brand .brand-accent {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        color: transparent;
      }
      nav.main-nav {
        display: flex;
        gap: 18px;
        align-items: center;
      }
      .nav-link {
        color: #cfd3d8;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
        letter-spacing: 0.2px;
      }
      .nav-link:hover {
        color: #fff;
      }
      .nav-link.active {
        color: #fff;
        text-decoration: underline;
        text-underline-offset: 6px;
        text-decoration-thickness: 2px;
      }
      .user-menu .username {
        color: #cfd3d8;
        text-decoration: none;
        font-weight: 600;
        font-size: 13px;
      }
      .user-menu .logout-btn {
        background: #1a1a1a;
        border-color: #2b2b2b;
        color: #e5e7eb;
      }
      .user-menu .logout-btn:hover {
        background: #232323;
        border-color: #3a3a3a;
      }
      .feedback-btn {
        font-weight: 600;
      }
      .download-app-btn {
        font-weight: 600;
      }
      @media (max-width: 768px) {
        .download-app-btn {
          display: none !important;
        }
        .header-bg-btn {
          display: none !important;
        }
      }
      @media (hover: none) and (pointer: coarse) {
        .header-bg-btn {
          display: none !important;
        }
      }
      .feedback-modal {
        position: fixed;
        inset: 0;
        background: rgba(6, 8, 12, 0.82);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 1200;
        padding: 16px;
      }
      .feedback-card {
        width: min(520px, 100%);
        background: #111;
        border: 1px solid #2a2a2a;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 18px 36px rgba(0,0,0,0.45);
      }
      .feedback-card h3 {
        margin: 0 0 6px 0;
        font-size: 20px;
        color: #fff;
      }
      .feedback-card p {
        margin: 0 0 16px 0;
        color: #9aa0a6;
        font-size: 13px;
      }
      .feedback-row {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 12px;
      }
      .feedback-row label {
        color: #cfd3d8;
        font-size: 12px;
        letter-spacing: 0.2px;
      }
      .feedback-row input,
      .feedback-row select,
      .feedback-row textarea {
        background: #0f0f0f;
        border: 1px solid #2a2a2a;
        border-radius: 10px;
        padding: 8px 10px;
        color: #e5e7eb;
        font-size: 13px;
      }
      .feedback-row textarea {
        min-height: 120px;
        resize: vertical;
      }
      .feedback-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        margin-top: 8px;
      }
      .feedback-actions .btn {
        padding: 8px 14px;
      }
      .feedback-status {
        font-size: 13px;
        margin-top: 10px;
        color: #9aa0a6;
        min-height: 18px;
      }
      .header-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #1a1a1a;
        border: 1px solid #2b2b2b;
        color: #e5e7eb;
        padding: 6px 10px;
        font-size: 13px;
        line-height: 1.2;
      }
      .header-btn:hover {
        background: #232323;
        border-color: #3a3a3a;
      }
      .header-btn.primary {
        background: #2b2b2b;
        border-color: #3a3a3a;
        color: #fff;
      }
      .header-btn.primary:hover {
        background: #3a3a3a;
        border-color: #4a4a4a;
      }
      .header-bg-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .header-bg-btn svg {
        width: 18px;
        height: 18px;
      }
      #headerBackgroundModal .background-game-card {
        max-width: 720px;
      }
      #headerBackgroundModal .background-modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 12px;
      }
      .header-search {
        display: flex;
        gap: 8px;
        align-items: center;
        position: relative;
      }
      .header-search input {
        width: 280px;
        background: #151515;
        color: #e5e7eb;
        border: 1px solid #2a2a2a;
        padding: 6px 10px;
        border-radius: 10px;
        font-size: 13px;
      }
      /* The UA focus ring is near-white and reads as a glare against #151515 --
         and the mobile toggle focuses this input on open, so it fired every
         time the overlay appeared. Use the site's soft purple ring instead. */
      .header-search input:focus {
        outline: none;
        border-color: #715ab8;
        box-shadow: 0 0 0 3px var(--gg-accent-soft, rgba(113, 90, 184, 0.15));
      }
      .header-search .btn {
        background: #1a1a1a;
        border: 1px solid #2b2b2b;
        color: #e5e7eb;
      }
      .header-search .btn:hover {
        background: #232323;
        border-color: #3a3a3a;
      }
      .header-search-results {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 480px;
        background: #121212;
        border: 1px solid #2a2a2a;
        border-radius: 12px;
        max-height: 400px;
        overflow-y: auto;
        z-index: 5000;
        box-shadow: 0 10px 24px rgba(0,0,0,0.5);
      }
      .notification-wrap {
        position: relative;
      }
      .notification-bell {
        position: relative;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .notification-badge {
        position: absolute;
        top: -4px;
        right: -2px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: #f59e0b;
        color: #111;
        font-size: 10px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
      }
      .notification-dropdown {
        position: absolute;
        right: 0;
        top: calc(100% + 10px);
        width: 320px;
        max-height: 400px;
        background: #111;
        border: 1px solid #2a2a2a;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(0,0,0,0.5);
        display: none;
        flex-direction: column;
        overflow: hidden;
        z-index: 1200;
      }
      .notification-dropdown.open {
        display: flex;
      }
      .notification-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        border-bottom: 1px solid #232323;
        font-size: 12px;
        color: #cfd3d8;
      }
      .notification-dismiss-all {
        background: transparent;
        border: 0;
        color: #f59e0b;
        font-size: 12px;
        cursor: pointer;
        padding: 0;
      }
      .notification-dismiss-all:hover {
        color: #fbbf24;
      }
      .notification-list {
        overflow-y: auto;
      }
      .notification-item {
        display: flex;
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid #1f1f1f;
        text-decoration: none;
        color: #e5e7eb;
        cursor: pointer;
      }
      .notification-item:hover {
        background: #1b1b1b;
      }
      .notification-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
        background: #333;
        flex-shrink: 0;
      }
      .notification-avatar.placeholder {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 700;
        color: #aaa;
      }
      .notification-content {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
        min-width: 0;
      }
      .notification-message {
        font-size: 13px;
        color: #e5e7eb;
      }
      .notification-time {
        font-size: 11px;
        color: #8a8a8a;
      }
      .notification-dismiss {
        background: transparent;
        border: 0;
        color: #8a8a8a;
        cursor: pointer;
        font-size: 14px;
        padding: 0 4px;
        margin-left: auto;
      }
      .notification-dismiss:hover {
        color: #f2b45f;
      }
      .notification-empty {
        padding: 16px;
        text-align: center;
        color: #9aa0a6;
        font-size: 12px;
      }
      @media (max-width: 520px) {
        header.site-header {
          flex-wrap: wrap;
          gap: 10px;
          row-gap: 8px !important;
          padding: 6px 12px 12px !important;
        }
        .brand-nav-wrap {
          flex-wrap: wrap;
          width: 100%;
          gap: 0 !important;
        }
        nav.main-nav {
          display: grid !important;
          flex: 0 0 100%;
          width: 100%;
          overflow-x: visible;
          padding-bottom: 0;
          grid-auto-flow: column;
          grid-auto-columns: minmax(0, 1fr);
          align-items: center;
          gap: 0;
        }
        .nav-link {
          background: transparent;
          border: 0;
          color: #e5e7eb;
          padding: 2px 2px;
          min-height: auto;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          font-size: clamp(10px, 2.9vw, 12px);
          white-space: nowrap;
          min-width: 0;
          text-align: center;
        }
        .nav-link.active {
          text-decoration: underline;
          text-underline-offset: 6px;
          text-decoration-thickness: 2px;
        }
        .user-menu {
          position: absolute;
          top: 6px !important;
          right: 12px;
          width: auto;
          justify-content: flex-end;
          gap: 6px;
        }
        .user-menu .btn {
          padding: 7px 10px;
          font-size: 12px;
        }
        .user-menu .username {
          margin-right: 4px;
          font-size: 12px;
        }
        .header-search {
          width: 100%;
        }
        .header-search input {
          width: 100%;
        }
        .header-search-results {
          width: calc(100vw - 24px) !important;
          max-width: 480px;
          transform: none;
        }
        .notification-bell {
          width: 28px;
          height: 28px;
          border-radius: 7px;
        }
        .header-bg-btn {
          width: 28px;
          height: 28px;
          border-radius: 7px;
        }
        .header-bg-btn svg {
          width: 16px;
          height: 16px;
        }
        .notification-bell svg {
          width: 18px;
          height: 18px;
        }
        .notification-dropdown {
          position: fixed;
          top: calc(var(--header-h, 64px) + 10px);
          width: min(360px, calc(100vw - 24px));
          left: 50%;
          right: auto;
          transform: translateX(-50%);
        }
      }

      /* Mobile chrome: collapse the header to a single row + bottom tab bar */
      .mobile-search-toggle,
      .avatar-menu,
      .mobile-tabbar { display: none; }

      @media (max-width: 640px) {
        header.site-header {
          flex-wrap: nowrap !important;
          gap: 10px;
          row-gap: 10px !important;
          padding: 10px 14px !important;
        }
        .brand-nav-wrap {
          width: auto !important;
          flex: 0 1 auto !important;
          flex-wrap: nowrap !important;
          gap: 0 !important;
        }
        .brand { font-size: 19px; }
        /* Hide the desktop nav row, inline search, and overflow buttons */
        header.site-header .main-nav,
        header.site-header .header-search,
        .feedback-btn,
        .download-app-btn,
        .header-bg-btn,
        .user-menu .username,
        .user-menu .logout-btn { display: none !important; }

        .user-menu {
          position: static !important;
          top: auto !important;
          right: auto !important;
          margin-left: auto;
          gap: 10px !important;
          align-items: center;
        }

        /* Uniform circular controls */
        .mobile-search-toggle,
        .notification-bell,
        .user-menu .avatar-small {
          width: 38px !important;
          height: 38px !important;
          min-width: 38px;
          padding: 0 !important;
          border-radius: 999px !important;
          display: inline-flex !important;
          align-items: center;
          justify-content: center;
          box-sizing: border-box;
          line-height: 1;
        }
        .mobile-search-toggle,
        .notification-bell {
          background: #242424 !important;
          border: 1px solid #3a3a3a !important;
          color: #cfd3d8 !important;
        }
        .mobile-search-toggle svg,
        .notification-bell svg {
          width: 19px !important;
          height: 19px !important;
          display: block;
          stroke-width: 1.7;
        }
        .user-menu .avatar-small {
          background: linear-gradient(135deg, #715ab8, #764ba2) !important;
          border: none !important;
          color: #fff !important;
          font-size: 15px !important;
        }

        /* Notification badge repositioned for the circular bell */
        .notification-wrap { position: relative; display: inline-flex; }
        .notification-badge {
          position: absolute;
          top: -3px;
          right: -3px;
          min-width: 17px;
          height: 17px;
          padding: 0 4px;
          border-radius: 999px;
          background: #f56565;
          color: #fff;
          font-size: 10px;
          border: 2px solid #161616;
          box-sizing: border-box;
        }

        /* Search overlay row shown when the toggle is tapped */
        body.mobile-search-open header.site-header .header-search {
          display: flex !important;
          position: absolute;
          top: 100%;
          left: 0;
          right: 0;
          padding: 10px 14px;
          gap: 8px;
          background: #161616;
          border-bottom: 1px solid #2a2a2a;
        }
        body.mobile-search-open header.site-header .header-search input { width: 100%; }

        .mobile-search-toggle { border: 1px solid #3a3a3a; background: #242424; cursor: pointer; }

        /* Signed-out row: search circle + Login + Sign Up. Match the 38px
           control height and keep the labels on one line so the three
           controls read as one group instead of a ragged stack. */
        .user-menu .auth-btn {
          height: 38px;
          padding: 0 12px !important;
          border-radius: 999px !important;
          display: inline-flex;
          align-items: center;
          white-space: nowrap;
          font-size: 13px;
        }

        /* Avatar overflow menu (Feedback / Logout) */
        .avatar-menu {
          position: fixed;
          top: calc(var(--header-h, 58px) + 8px);
          right: 12px;
          width: 190px;
          background: #1a1a1a;
          border: 1px solid #2a2a2a;
          border-radius: 12px;
          box-shadow: 0 16px 36px rgba(0,0,0,0.5);
          padding: 6px;
          z-index: 3600;
        }
        body.avatar-menu-open .avatar-menu { display: block; }
        .avatar-menu a,
        .avatar-menu button {
          display: flex;
          align-items: center;
          gap: 11px;
          width: 100%;
          text-align: left;
          background: transparent;
          border: 0;
          color: #e5e7eb;
          font: inherit;
          font-size: 14px;
          padding: 10px 12px;
          border-radius: 8px;
          text-decoration: none;
          cursor: pointer;
        }
        .avatar-menu svg {
          width: 17px;
          height: 17px;
          flex-shrink: 0;
          color: #9aa0a6;
        }
        .avatar-menu a:hover,
        .avatar-menu button:hover { background: #242424; }
        .avatar-menu a:hover svg,
        .avatar-menu button:hover svg { color: #cfd3d8; }

        /* Bottom tab bar */
        .mobile-tabbar {
          display: flex;
          position: fixed;
          left: 0;
          right: 0;
          bottom: 0;
          z-index: 3400;
          background: rgba(15, 15, 15, 0.96);
          /* No backdrop-filter. The plate is 96% opaque, so the blur has
             almost nothing to act on -- against a deliberately hostile
             backdrop (hard-edged 6px stripes) blurring changes the bar by at
             most 8/255 per channel -- but it costs a full-width render surface
             that the compositor re-blurs on every frame of every scroll, since
             this bar is on screen the entire time. */
          border-top: 1px solid #2a2a2a;
          padding: 6px 4px calc(8px + var(--gg-safe-bottom, 0px));
        }
        .mobile-tabbar a {
          flex: 1;
          display: flex;
          flex-direction: column;
          align-items: center;
          gap: 3px;
          text-decoration: none;
          color: #9aa0a6;
          font-size: 10px;
          font-weight: 600;
        }
        .mobile-tabbar a svg { width: 22px; height: 22px; }
        .mobile-tabbar a.active { color: #c0b1f1; }
        .mobile-tabbar a .tab-icon {
          padding: 3px 14px;
          border-radius: 10px;
          display: flex;
        }
        .mobile-tabbar a.active .tab-icon { background: rgba(113, 90, 184, 0.15); }
        .mobile-tabbar .tab-badge {
          position: absolute;
          transform: translate(14px, -4px);
          min-width: 15px;
          height: 15px;
          padding: 0 4px;
          border-radius: 999px;
          background: #f56565;
          color: #fff;
          font-size: 9px;
          font-weight: 700;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          line-height: 1;
        }
        body:has(.mobile-tabbar) { padding-bottom: 72px; }
      }

      /* Sign-up prompt for the gated tabs. Sits above the tab bar (z-index
         3400) so the sheet is not half-covered by the bar that opened it. */
      .auth-gate-modal {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 3600;
        background: rgba(0, 0, 0, 0.62);
        align-items: flex-end;
        justify-content: center;
        padding: 16px;
      }
      .auth-gate-modal.visible { display: flex; }
      .auth-gate-card {
        width: 100%;
        max-width: 420px;
        background: #1a1a1a;
        border: 1px solid #2a2a2a;
        border-radius: 16px;
        padding: 22px 20px 16px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
        margin-bottom: calc(76px + var(--gg-safe-bottom, 0px));
      }
      .auth-gate-card h3 {
        margin: 0 0 8px;
        font-size: 19px;
        color: #e5e7eb;
      }
      .auth-gate-card p {
        margin: 0 0 18px;
        font-size: 14px;
        line-height: 1.5;
        color: #9aa0a6;
      }
      .auth-gate-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
      .auth-gate-btn {
        display: block;
        padding: 12px 16px;
        border-radius: 12px;
        text-align: center;
        text-decoration: none;
        font-weight: 600;
        font-size: 15px;
        color: #e5e7eb;
        background: #242424;
        border: 1px solid #3a3a3a;
      }
      .auth-gate-btn.primary {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border-color: transparent;
        color: #fff;
      }
      .auth-gate-dismiss {
        display: block;
        width: 100%;
        margin-top: 12px;
        padding: 8px;
        background: none;
        border: 0;
        color: #9aa0a6;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
      }
      /* The bar is phone-only, so the prompt it opens is too. */
      @media (min-width: 641px) {
        .auth-gate-modal.visible { display: none; }
      }
    