/* browse.css — shared styles for the browse experience (home shell + set.php/sets.php).
   Verbatim copy of index.html's inline <style>; index.html will swap to this link in Phase 3. */
    :root {
      --pointer-x: 50%;
      --pointer-y: 50%;
      --card-scale: 1;
      --card-opacity: 0;
      --rotate-x: 0deg;
      --rotate-y: 0deg;
      --background-x: 50%;
      --background-y: 50%;
      --pointer-from-center: 0;
      --pointer-from-top: 0;
      --pointer-from-left: 0;
      --translate-x: 0px;
      --translate-y: 0px;
    }

    .card {
      width: 300px;
      overflow: hidden;
    }
    .card__front img {
      width: 100%;
      height: auto;
      display: block;
    }

    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
    }

    html {
      -webkit-text-size-adjust: 100%;
      scrollbar-width: none;
      overflow-x: hidden;
    }
    html::-webkit-scrollbar { width: 0; height: 0; }

    body {
      margin: 0;
      padding: 0;
      background: #17171b;
      font-family: system-ui, sans-serif;
      color: #fff;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
    }


    .hero {
      width: 100%;
      min-height: 100dvh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 10vh 6vw 0;
      background: radial-gradient(120% 80% at 50% -10%, #202028 0%, #17171b 46%, #141416 100%);
      overflow: hidden;
      position: relative;
    }
    .hero__inner {
      display: flex; flex-direction: column; align-items: center; gap: 22px;
      max-width: 640px;
    }
    .hero__stage { width: 100%; display: flex; justify-content: center; }
    /* Mirror the card overlay's wrap so the live card-gl render sizes identically. */
    .hero__card {
      position: relative; width: clamp(196px, 42vw, 256px); aspect-ratio: 733 / 1024;
      border-radius: 4.6% / 3.3%; overflow: hidden; clip-path: inset(0 round 4.6% / 3.3%);
      box-shadow: 0 26px 54px -16px rgba(0,0,0,.72);
    }
    .hero__card canvas, .hero__card img {
      position: absolute; inset: 0; width: 100%; height: 100%;
    }
    .hero__art {
      object-fit: contain; transform: scale(0.912);   /* match card-gl's frame fill (camera z=22) */
    }
    @keyframes heroHolo { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
    .hero__headline {
      margin: 0; text-align: center; color: #f3f4f6;
      font: 800 clamp(2.1rem, 6vw, 3.4rem)/1.02 'Inter', system-ui, sans-serif; letter-spacing: -.035em;
    }
    .hero__shine {
      background: linear-gradient(100deg,#ff5db1,#ffd84d,#5dffc7,#4aa8ff,#c05bff,#ff5db1);
      background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
      animation: heroHolo 6s linear infinite;
    }
    .hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
    .hero__btn {
      height: 46px; padding: 0 22px; border-radius: 12px; cursor: pointer; text-decoration: none;
      display: inline-flex; align-items: center; border: 1px solid transparent;
      font: 700 .95rem 'Inter', system-ui, sans-serif;
    }
    .hero__btn--primary { background: #69db7c; color: #0c1a10; box-shadow: 0 8px 24px -8px rgba(105,219,124,.55); }
    .hero__btn--ghost   { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); color: #f3f4f6; }
    .hero__note {
      margin: 4px 0 0; max-width: 42ch; text-align: center;
      font: 500 .84rem/1.5 'Inter', system-ui, sans-serif; color: rgba(255,255,255,.5);
    }
    .hero__note-link { color: #69db7c; font-weight: 700; text-decoration: none; }
    .hero__note-link:hover { text-decoration: underline; }
    @media (prefers-reduced-motion: reduce) {
      .hero__shine { animation: none; }
    }

    /* ── Home page (scrollable: hero → features → discord → footer) ───────── */
    .hm {
      --acc1: #8b5cf6; --acc2: #3b82f6;
      --acc-grad: linear-gradient(135deg, #8b5cf6, #3b82f6);
      --acc-solid: #9aa0ff;
      --acc-tint: rgba(130,120,255,.14);
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }
    .hm-wrap { max-width: 1080px; margin: 0 auto; padding-left: 22px; padding-right: 22px; }
    .hm-hero {
      min-height: calc(100dvh - var(--nav-h));
      display: flex; flex-direction: column; justify-content: center;
      padding: calc(env(safe-area-inset-top) + var(--nav-h) + 28px) 0 56px;
    }
    .hm-hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; width: 100%; }
    .hm-eyebrow { font-size: .84rem; font-weight: 700; letter-spacing: .01em; color: #f3f4f6; }
    .hm-num { color: rgba(255,255,255,.45); font-weight: 600; }
    .hm-h1 { margin: 0; font: 800 clamp(2.8rem,7vw,4.6rem)/.98 'Inter', system-ui, sans-serif; letter-spacing: -.04em; color: #f3f4f6; text-wrap: balance; }
    .hm-shine { background: linear-gradient(100deg,#ff5db1,#ffd84d,#5dffc7,#4aa8ff,#c05bff,#ff5db1); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: hmHolo 6s linear infinite; }
    .hm-lede { margin: 0; max-width: 46ch; color: #9a9da6; font-size: 1.06rem; line-height: 1.55; }
    .hm-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; width: min(380px, 100%); }
    .hm-ctas .hm-btn { flex: 1 1 0; min-width: 140px; justify-content: center; }
    .hm-btn { height: 50px; padding: 0 24px; border-radius: 13px; font: 700 .98rem 'Inter', system-ui, sans-serif; cursor: pointer; display: inline-flex; align-items: center; border: 1px solid transparent; text-decoration: none; }
    .hm-btn--primary { background: var(--acc-grad); color: #fff; box-shadow: 0 10px 28px -10px rgba(110,110,255,.5); }
    .hm-btn--ghost { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.14); color: #f3f4f6; }
    .hm-btn--blurple { background: #5865F2; color: #fff; box-shadow: 0 10px 28px -10px rgba(88,101,242,.7); }
    @keyframes hmHolo { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

    .hm-stage { display: flex; justify-content: center; }
    .hm-card {
      position: relative; width: clamp(248px, 42vw, 360px); aspect-ratio: 733/1024;
      border-radius: 4.6% / 3.3%; overflow: hidden; clip-path: inset(0 round 4.6% / 3.3%);
      box-shadow: 0 40px 80px -24px rgba(0,0,0,.8); background: #17171b;
    }
    .hm-card canvas, .hm-card__art { position: absolute; inset: 0; width: 100%; height: 100%; }
    .hm-card canvas { opacity: 0; transition: opacity .55s ease; pointer-events: none; }  /* non-interactive; faded in when ready */
    .hm-card__art { object-fit: contain; transform: scale(0.912); border-radius: 4.6% / 3.3%; visibility: hidden; }   /* hidden so the uncropped-corner flat art never flashes; rounded + shown only if WebGL fails */

    .hm-section { padding-top: clamp(60px,9vw,100px); padding-bottom: clamp(60px,9vw,100px); }
    .hm-section__head { max-width: 640px; margin-bottom: 40px; }
    .hm-section__head h2 { margin: 0; font: 800 clamp(1.9rem,4.4vw,2.7rem)/1.05 'Inter', system-ui, sans-serif; letter-spacing: -.03em; color: #f3f4f6; text-wrap: balance; }
    .hm-section__head p { margin: 14px 0 0; color: #9a9da6; font-size: 1.05rem; line-height: 1.55; }
    .hm-feat { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
    .hm-feat__card { background: #1a1a20; border: 1px solid rgba(255,255,255,.09); border-radius: 18px; padding: 26px 24px; }
    .hm-feat__ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: var(--acc-tint); color: var(--acc-solid); }
    .hm-feat__ico svg { width: 23px; height: 23px; }
    .hm-feat__card h3 { margin: 0 0 8px; font: 800 1.12rem 'Inter', system-ui, sans-serif; color: #f3f4f6; }
    .hm-feat__card p { margin: 0; color: #9a9da6; font-size: .94rem; line-height: 1.55; }

    .hm-discord__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
    .hm-discord__logo { margin-bottom: 18px; color: #5865F2; line-height: 0; }
    .hm-discord__logo svg { width: 42px; height: 42px; fill: currentColor; }
    .hm-discord__h2 { margin: 0; font: 800 clamp(2rem,4.6vw,3rem)/1.02 'Inter', system-ui, sans-serif; letter-spacing: -.03em; color: #f3f4f6; text-wrap: balance; }
    .hm-discord__sub { margin: 16px 0 26px; color: #9a9da6; font-size: 1.06rem; line-height: 1.55; max-width: 46ch; }
    .hm-perks-label { display: inline-block; margin-bottom: 18px; font: 800 .72rem 'Inter', system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #c9d0ff; }
    .hm-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
    .hm-perks li { display: flex; align-items: flex-start; gap: 13px; font-size: 1rem; }
    .hm-perks li > span:last-child { color: #9a9da6; line-height: 1.5; }
    .hm-perks b { color: #f3f4f6; font-weight: 700; }
    .hm-tick { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--acc-tint); color: var(--acc-solid); display: flex; align-items: center; justify-content: center; }
    .hm-tick svg { width: 16px; height: 16px; }

    /* footer clears the floating bottom-nav on the scrollable home */
    .page-wrapper .site-footer { padding-bottom: calc(40px + 96px + env(safe-area-inset-bottom)); }

    @media (max-width: 860px) {
      .hm-lede { max-width: 52ch; }
      .hm-feat { grid-template-columns: 1fr; }
      .hm-discord__grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
      .hm-discord__logo { margin-left: auto; margin-right: auto; }
      .hm-perks { text-align: left; max-width: 360px; margin: 0 auto; }
    }
    @media (prefers-reduced-motion: reduce) { .hm-shine { animation: none; } }

    /* ── Menu pill ─────────────────────────────────────────────────────────── */
    .hm-menu { position: fixed; inset: 0; z-index: 400; display: none; }
    .hm-menu.open { display: block; }
    .hm-menu__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s ease; }
    .hm-menu.open .hm-menu__backdrop { opacity: 1; }
    .hm-menu__panel {
      position: absolute; top: 50%; left: 50%;
      transform: translate(-50%, -50%) scale(.96); opacity: 0;
      width: min(320px, calc(100vw - 32px));
      background: #1b1b20; border: 1px solid rgba(255,255,255,.12); border-radius: 22px;
      padding: 8px; box-shadow: 0 26px 64px rgba(0,0,0,.62);
      display: flex; flex-direction: column; gap: 2px;
      transition: transform .3s cubic-bezier(.32,.72,0,1), opacity .3s ease;
    }
    .hm-menu.open .hm-menu__panel { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    .hm-menu__item {
      display: flex; align-items: center; gap: 13px; width: 100%;
      padding: 12px 14px; border-radius: 14px; border: 0; background: none; cursor: pointer;
      color: #f3f4f6; font: 600 .96rem 'Inter', system-ui, sans-serif; text-align: left; text-decoration: none;
    }
    .hm-menu__item:hover { background: rgba(255,255,255,.06); }
    .hm-menu__item svg { width: 20px; height: 20px; flex: none; color: #9aa0ff; }
    .hm-menu__sep { height: 1px; background: rgba(255,255,255,.09); margin: 6px 10px; }
    @media (prefers-reduced-motion: reduce) { .hm-menu__panel { transition: none; } }

    /* ── Binder grid inside the profile overlay's Binders tab ──────────────── */
    .acct-binder-head { display: flex; align-items: center; justify-content: space-between; max-width: 430px; margin: 2px auto 8px; }
    .acct-binder-count { font: 600 .82rem/1 'Inter', system-ui, sans-serif; color: rgba(255,255,255,.5); }
    .acct-binder-edit { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
      background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #f3f4f6; cursor: pointer; transition: background .15s ease; }
    .acct-binder-edit:hover { background: rgba(255,255,255,.12); }
    .acct-binder-edit svg { width: 17px; height: 17px; }
    .acct-binder-edit.is-saving { background: var(--acct-accent, #69db7c); border-color: var(--acct-accent, #69db7c); color: #0c1a10; }
    .acct-binder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 0 auto; max-width: 430px; }
    .acct-binder-grid.is-editing { touch-action: none; }
    /* cell aspect matches the actual 300x419 thumbnail so the image fills it exactly (no letterbox/outline). */
    .acct-binder-cell { aspect-ratio: 300 / 419; border-radius: 4.6% / 3.3%; position: relative; }
    .acct-binder-grid.is-editing .acct-binder-cell { border: 1.5px dashed rgba(255,255,255,.13); }
    .acct-binder-grid.is-editing .acct-binder-cell.is-target { border-color: var(--acct-accent, #69db7c); background: rgba(105,219,124,.1); }
    .acct-binder-card { position: absolute; inset: 0; border-radius: 4.6% / 3.3%; overflow: hidden;
      background: #1b1b20; display: block; cursor: pointer; transition: transform .15s ease; }
    .acct-binder-card:hover { transform: translateY(-3px); }
    .acct-binder-card img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; pointer-events: none; }
    .acct-binder-grid.is-editing .acct-binder-card { cursor: grab; touch-action: none; transition: none; }
    .acct-binder-grid.is-editing .acct-binder-card:hover { transform: none; }
    .acct-binder-ghost { position: fixed; z-index: 1000; pointer-events: none; border-radius: 4.6% / 3.3%; overflow: hidden;
      box-shadow: 0 14px 30px rgba(0,0,0,.6); opacity: .96; }
    .acct-binder-ghost img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .acct-binder-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
    .acct-binder-pg { padding: 7px 14px; border-radius: 9px; background: rgba(255,255,255,.05);
      border: 1px solid rgba(255,255,255,.12); color: #fff; font: 700 .8rem 'Inter', system-ui, sans-serif; cursor: pointer; }
    .acct-binder-pg:disabled { opacity: .35; cursor: default; }
    .acct-binder-pager span { font: 600 .78rem 'Inter', system-ui, sans-serif; color: rgba(255,255,255,.5); }
    .binder-loading { text-align: center; padding: 44px 0; color: rgba(255,255,255,.4); font: 600 .9rem 'Inter', system-ui, sans-serif; }
    .card-overlay__cta.is-remove { color: #ff9a9a; border-color: rgba(255,138,138,.4); background: rgba(255,90,90,.08); }


    .search-overlay {
      position: fixed;
      inset: 0;
      z-index: 250;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      pointer-events: none;
    }
    .search-overlay::before {
      content: "";
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      -webkit-backdrop-filter: blur(20px);
      backdrop-filter: blur(20px);
      opacity: 0;
      /* visibility gates the backdrop blur out of the compositor while closed */
      visibility: hidden;
      transition: opacity 0.24s ease, visibility 0s linear 0.24s;
      transform: translateZ(0);
    }
    .search-overlay.open { pointer-events: auto; }
    .search-overlay.open::before {
      opacity: 1;
      visibility: visible;
      transition: opacity 0.3s ease;
    }
    .search-panel {
      position: relative;
      width: 90vw;
      max-width: 600px;
      margin-top: calc(env(safe-area-inset-top) + var(--nav-h) + 12vh);
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 14px;
      padding: 0 16px;
      opacity: 0;
      /* Exit: lift away and fade on one unified ease-in curve so the panel
         leaves cleanly instead of snapping (the open curve reversed felt harsh) */
      transform: translateY(-8px) translateZ(0);
      transition: opacity 0.22s cubic-bezier(0.4, 0, 1, 1),
                  transform 0.22s cubic-bezier(0.4, 0, 1, 1);
    }
    .search-overlay.open .search-panel {
      opacity: 1;
      transform: translateY(0) translateZ(0);
      /* Enter: gentle ease-out settle */
      transition: opacity 0.3s ease,
                  transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    }
    .search-title {
      margin: 0;
      font-family: system-ui, sans-serif;
      font-size: 1.7rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      color: #fff;
    }
    .search-sub {
      margin: 0;
      font-family: system-ui, sans-serif;
      font-size: 1rem;
      color: rgba(255, 255, 255, 0.6);
    }
    .search-hint {
      margin: 6px 0 0;
      font-family: system-ui, sans-serif;
      font-size: 0.82rem;
      letter-spacing: 0.01em;
      color: rgba(255, 255, 255, 0.4);
    }
    /* Card search results */
    .search-results { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 480px; text-align: left; }
    .search-result {
      display: flex; align-items: center; gap: 12px;
      padding: 8px 12px; border-radius: 12px;
      background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
      cursor: pointer; transition: background 0.15s, border-color 0.15s;
      color: #fff; text-decoration: none;
    }
    .search-result:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22); }
    .search-result img { width: 44px; height: 61px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,0.05); }
    .search-result__name { font: 700 0.92rem/1.2 system-ui, sans-serif; }
    .search-result__meta { font: 0.78rem/1 system-ui, sans-serif; color: rgba(255,255,255,0.45); margin-top: 3px; }
    .search-result--empty { color: rgba(255,255,255,0.4); font-size: 0.9rem; padding: 12px; justify-content: center; cursor: default; }
    @media (max-width: 700px) {
      .search-panel { margin-top: calc(env(safe-area-inset-top) + var(--nav-h) + 8vh); gap: 12px; }
      .search-title { font-size: 1.4rem; }
      .search-sub { font-size: 0.92rem; }
      .search-hint { font-size: 0.78rem; }
    }

    @media (max-width: 700px) {
      .hero {
        align-items: center;
        padding: 6vh 20px 0;
        text-align: center;
        min-height: 100dvh;
      }
    }

    .showcase {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 40px;
      padding: calc(env(safe-area-inset-top) + var(--nav-h) + 20px) 40px 120px;
      background: #17171b;
      overflow-y: auto;
      overscroll-behavior: contain;
      transform: translateY(100%);
      transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1);
    }
    .showcase.sheet-open {
      transform: translateY(0);
    }

    @media (min-width: 701px) {
      .page-wrapper { position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #17171b; }
    }

    @media (max-width: 700px) {
      html, body {
        overflow: hidden;
        height: 100%;
      }

      .page-wrapper {
        position: fixed;
        inset: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
      }

      .showcase {
        padding: calc(env(safe-area-inset-top) + var(--nav-h) + 16px) 20px 120px;
        gap: 24px;
      }

    }


    /* Sets index — every set grouped by era, shown at /sets */
    .sets-index {
      width: 100%;
      max-width: 1200px;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      gap: 48px;
      padding: 8px 24px 48px;
    }
    .showcase.has-selected-set .sets-index { display: none; }

    .sets-index__era-title {
      margin: 0 0 18px;
      font-family: system-ui, sans-serif;
      font-size: 1.15rem;
      font-weight: 700;
      letter-spacing: 0.01em;
      color: rgba(255,255,255,0.9);
    }
    .sets-index__grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 16px;
    }
    .set-tile {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 22px 16px 16px;
      border-radius: 14px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      text-decoration: none;
      -webkit-tap-highlight-color: transparent;
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    .set-tile:hover {
      background: rgba(255,255,255,0.08);
      border-color: rgba(255,255,255,0.14);
    }
    .set-tile:active {
      transform: scale(0.97);
    }
    .set-tile img {
      height: 58px;
      max-width: 100%;
      object-fit: contain;
    }
    .set-tile__name {
      font-family: system-ui, sans-serif;
      font-size: 0.82rem;
      font-weight: 600;
      color: rgba(255,255,255,0.85);
      text-align: center;
      line-height: 1.3;
    }
    .set-tile__count {
      font-family: system-ui, sans-serif;
      font-size: 0.72rem;
      color: rgba(255,255,255,0.4);
    }
    @media (max-width: 700px) {
      .sets-index { gap: 36px; padding: 4px 4px 40px; }
      .sets-index__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
      .set-tile { padding: 16px 10px 12px; gap: 9px; }
      .set-tile img { height: 44px; }
      .set-tile__name { font-size: 0.75rem; }
    }

    /* Set page header — back link and card count above the grid */
    /* Poképulse-style set header: breadcrumb, then logo + title + count. */
    .set-header {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 18px;
      width: 100%;
    }
    .set-breadcrumb {
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: system-ui, sans-serif;
      font-size: 0.82rem;
      letter-spacing: 0.01em;
    }
    .set-breadcrumb__link {
      color: rgba(255,255,255,0.5);
      text-decoration: none;
      transition: color 0.15s ease;
    }
    .set-breadcrumb__link:hover { color: rgba(255,255,255,0.9); }
    .set-breadcrumb__sep { color: rgba(255,255,255,0.3); }
    .set-breadcrumb__cur { color: #fff; font-weight: 600; }
    .set-header__row {
      display: flex;
      align-items: center;
      gap: 20px;
    }
    .set-header__meta { display: flex; flex-direction: column; gap: 3px; }
    .set-header__title {
      margin: 0;
      font-family: system-ui, sans-serif;
      font-size: 2.2rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      line-height: 1.05;
      color: #fff;
    }
    /* Official expansion symbol beside the set title. Height-locked, width auto so the
       wide text-badge marks (modern sets) and square pictorial marks both keep aspect. */
    .set-symbol {
      height: 0.62em;
      width: auto;
      max-width: 3.4em;
      vertical-align: baseline;
      margin-left: 0.5em;
      opacity: 0.9;
      object-fit: contain;
    }
    .set-header__sub {
      margin: 0;
      font-family: system-ui, sans-serif;
      font-size: 0.9rem;
      color: rgba(255,255,255,0.45);
      letter-spacing: 0.02em;
    }

    /* ── Per-set filter bar (below the logo, above the cards) ── */
    .set-filter { position: relative; display: flex; gap: 10px; width: 100%; max-width: 1400px; }
    .set-filter__field { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
    .set-filter__icon { position: absolute; left: 13px; width: 18px; height: 18px; color: rgba(255,255,255,0.4); pointer-events: none; }
    .set-filter__input {
      width: 100%; height: 44px; padding: 0 40px;
      background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px; color: #fff; font: 500 16px system-ui, sans-serif;
      outline: none; transition: border-color .15s ease, background .15s ease;
    }
    .set-filter__input::placeholder { color: rgba(255,255,255,0.4); }
    .set-filter__input:focus { border-color: var(--acc1, #8b5cf6); background: rgba(255,255,255,0.06); }
    .set-filter__clear {
      position: absolute; right: 8px; width: 26px; height: 26px; display: grid; place-items: center;
      border: 0; background: rgba(255,255,255,0.08); border-radius: 50%; color: rgba(255,255,255,0.7);
      cursor: pointer; font-size: 12px; line-height: 1;
    }
    .set-filter__clear:hover { background: rgba(255,255,255,0.16); color: #fff; }
    .set-filter__wrap { position: static; flex: 0 0 auto; }
    .set-filter__btn {
      display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px;
      background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px;
      color: rgba(255,255,255,0.85); font: 600 0.9rem system-ui, sans-serif; cursor: pointer;
      white-space: nowrap; transition: background .15s ease, border-color .15s ease;
    }
    .set-filter__btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
    .set-filter__btn svg { width: 16px; height: 16px; }
    .set-filter__btn .chev { transition: transform .18s ease; }
    .set-filter__btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
    /* Wide pop-out panel: breaks out full-width under the whole search + Filters row. */
    .set-filter__menu {
      position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 20;
      display: none; flex-wrap: wrap; align-items: flex-start; gap: 10px 30px;
      background: #16161c; border: 1px solid rgba(255,255,255,0.12); border-radius: 16px;
      padding: 18px 22px 16px; box-shadow: 0 20px 56px rgba(0,0,0,0.55);
      max-height: min(72vh, 560px); overflow-y: auto; overscroll-behavior: contain;
    }
    .set-filter__menu.open { display: flex; }
    .set-filter__sec { flex: 1 1 195px; min-width: 168px; align-self: stretch; }
    .set-filter__mlabel { padding: 0 8px 7px; font: 600 0.72rem system-ui; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,0.4); }
    .set-filter__opt {
      display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 8px;
      background: transparent; color: rgba(255,255,255,0.8); font: 500 0.88rem system-ui, sans-serif; cursor: pointer; text-align: left;
    }
    .set-filter__opt:hover { background: rgba(255,255,255,0.06); }
    .set-filter__opt.on { color: #fff; }
    .set-filter__opt .tick { margin-left: auto; opacity: 0; width: 15px; height: 15px; }
    .set-filter__opt.on .tick { opacity: 1; }
    .set-filter__empty { width: 100%; text-align: center; padding: 44px 0; color: rgba(255,255,255,0.4); font: 500 0.95rem system-ui, sans-serif; }

    /* ── Filter facets (rarity / type / HP / artist) ── */
    .set-filter__badge {
      display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
      padding: 0 5px; border-radius: 9px; background: var(--acc1, #8b5cf6); color: #fff;
      font: 700 0.72rem system-ui, sans-serif; line-height: 1;
    }
    .set-filter__btn.has-active { border-color: color-mix(in srgb, var(--acc1, #8b5cf6) 55%, transparent); color: #fff; }
    .set-filter__chk {
      display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: 8px;
      color: rgba(255,255,255,0.82); font: 500 0.87rem system-ui, sans-serif; cursor: pointer; user-select: none;
    }
    .set-filter__chk:hover { background: rgba(255,255,255,0.06); }
    .set-filter__chk input { position: absolute; opacity: 0; width: 0; height: 0; }
    .set-filter__chkbox {
      flex: 0 0 auto; width: 17px; height: 17px; border-radius: 5px; border: 1.6px solid rgba(255,255,255,0.28);
      position: relative; transition: background .13s ease, border-color .13s ease;
    }
    .set-filter__chk input:checked + .set-filter__chkbox { background: var(--acc1, #8b5cf6); border-color: var(--acc1, #8b5cf6); }
    .set-filter__chk input:checked + .set-filter__chkbox::after {
      content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px;
      border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
    }
    .set-filter__chk input:focus-visible + .set-filter__chkbox { outline: 2px solid var(--acc1, #8b5cf6); outline-offset: 2px; }
    .set-filter__chktext { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
    .set-filter__ct { flex: 0 0 auto; align-self: center; color: rgba(255,255,255,0.35); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
    .set-filter__dot { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; background: #999; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
    .set-filter__dot[data-type="Grass"]{background:#63bb5b}.set-filter__dot[data-type="Fire"]{background:#ff7a3c}
    .set-filter__dot[data-type="Water"]{background:#49a8e5}.set-filter__dot[data-type="Lightning"]{background:#f2cb30}
    .set-filter__dot[data-type="Psychic"]{background:#b46ad0}.set-filter__dot[data-type="Fighting"]{background:#c65f34}
    .set-filter__dot[data-type="Darkness"]{background:#5a5a6b}.set-filter__dot[data-type="Metal"]{background:#8a99a8}
    .set-filter__dot[data-type="Dragon"]{background:#c9a63a}.set-filter__dot[data-type="Fairy"]{background:#e57fb0}
    .set-filter__dot[data-type="Colorless"]{background:#cbc8bd}.set-filter__dot[data-type="Trainer"]{background:#6bb0c2}
    .set-filter__dot[data-type="Energy"]{background:#ab8c5e}
    .set-filter__hprow { display: flex; align-items: center; gap: 8px; padding: 2px 8px 0; }
    .set-filter__hp {
      width: 100%; min-width: 0; height: 38px; padding: 0 10px; border-radius: 9px; text-align: center;
      background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14); color: #fff;
      font: 500 16px system-ui, sans-serif; -moz-appearance: textfield;
    }
    .set-filter__hp::-webkit-outer-spin-button, .set-filter__hp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .set-filter__hp:focus { border-color: var(--acc1, #8b5cf6); outline: none; }
    .set-filter__hpdash { flex: 0 0 auto; color: rgba(255,255,255,0.4); }
    .set-filter__artist {
      width: 100%; margin: 2px 0 0; height: 38px; padding: 0 12px; border-radius: 9px;
      background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14); color: #fff;
      font: 500 16px system-ui, sans-serif;
    }
    .set-filter__artist::placeholder { color: rgba(255,255,255,0.38); }
    .set-filter__artist:focus { border-color: var(--acc1, #8b5cf6); outline: none; }
    .set-filter__foot { flex: 1 1 100%; display: flex; justify-content: flex-end; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 4px; padding-top: 12px; }
    .set-filter__clearall {
      padding: 9px 16px; border: 0; border-radius: 9px; background: rgba(255,255,255,0.05);
      color: var(--acc1, #8b5cf6); font: 600 0.85rem system-ui, sans-serif; cursor: pointer;
    }
    .set-filter__clearall:hover { background: rgba(255,255,255,0.1); }
    @media (max-width: 700px) {
      .set-filter__menu { padding: 16px; gap: 8px 18px; }
      .set-filter__sec { flex-basis: 140px; }
    }

    /* ── Subset divider on a merged parent page (e.g. Radiant Collection) ── */
    .set-subgroup { display: flex; flex-direction: column; gap: 22px; width: 100%; }
    .set-subhead { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 4px; }
    .set-subhead__label { font: 700 1.15rem system-ui, sans-serif; color: #fff; letter-spacing: -0.01em; white-space: nowrap; }
    .set-subhead__count { font: 600 0.8rem system-ui, sans-serif; color: rgba(255,255,255,0.4); }
    .set-subhead__line { flex: 1; height: 1px; background: rgba(255,255,255,0.1); }
    [data-filter-hidden] { display: none !important; }

    .set-section {
      width: 100%;
      max-width: 1400px;
      display: none;
      flex-direction: column;
      align-items: stretch;
      gap: 28px;
      opacity: 0;
      transform: translateZ(0);
      transition: opacity 0.35s ease;
    }
    .set-section.active {
      display: flex;
    }
    .showcase:not(.has-selected-set) .set-section.active {
      display: none;
    }
    .set-section.visible {
      opacity: 1;
    }

    .set-logo {
      height: 64px;
      width: auto;
      object-fit: contain;
      display: block;
    }
    @media (max-width: 700px) {
      .set-logo { height: 52px; }
    }

    .card-group {
      display: block;
      text-decoration: none;
      color: inherit;
      -webkit-tap-highlight-color: transparent;
    }

    .card__rotator {
      cursor: pointer;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
    }

    /* Card name + number over a bottom gradient, clipped to the card's radius. */
    .card__front { position: relative; overflow: hidden; border-radius: var(--card-radius); }
    .card__caption {
      position: absolute;
      left: 0; right: 0; bottom: 0;
      /* override the aspect-ratio/grid/border-radius that .card__rotator * forces
         on every descendant, so this is a short bottom bar, not a card-shaped box. */
      aspect-ratio: auto;
      height: auto;
      border-radius: 0;
      padding: 22px 11px 9px;
      background: linear-gradient(to top,
        rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.62) 42%, rgba(0,0,0,0) 100%);
      display: flex;
      flex-direction: column;
      gap: 1px;
      pointer-events: none;
    }
    .card__caption-name {
      display: block;
      aspect-ratio: auto;
      border-radius: 0;
      font-family: system-ui, sans-serif;
      font-size: 0.78rem;
      font-weight: 600;
      color: #fff;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .card__caption-num {
      display: block;
      aspect-ratio: auto;
      border-radius: 0;
      font-family: system-ui, sans-serif;
      font-size: 0.66rem;
      color: rgba(255,255,255,0.6);
      letter-spacing: 0.02em;
    }

    .card-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 22px;
      padding: 4px 0 64px;
      width: 100%;
      margin: 0 auto;
    }
    .card-grid .card-group {
      width: 100%;
      /* No content-visibility: the cells already have a fixed aspect-ratio so they never shift,
         and virtualization was the source of the scroll/filter glitch (off-screen cards
         re-rendering, and thrashing when the filter display:none-s hundreds of cards). Images
         still lazy-load + fade, so scrolling stays smooth both ways, filtered or not. */
    }
    .card-grid .card {
      width: 100%;
    }
    /* Grid thumbnails are static (the 3D tilt is overlay-only), so force `flat` to avoid
       preserve-3d promoting hundreds of nodes to compositor layers — keeps a big, non-virtualized
       grid light on the GPU while scrolling. */
    .card-grid .card, .card-grid .card__translater,
    .card-grid .card__rotator, .card-grid .card__rotator * { transform-style: flat; }
    /* Placeholder tile + fade-in so thumbnails settle in smoothly instead of popping while scrolling. */
    .card-grid .card__front { background: #1c1c22; }
    .card-grid .card__front img { opacity: 0; transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
    .card-grid .card__front img.is-loaded { opacity: 1; }
    @media (prefers-reduced-motion: reduce) {
      .card-grid .card__front img { transition: none; }
    }

    @media (max-width: 1100px) {
      body { gap: 32px; }
      .set-section { gap: 20px; }
      .card-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
      .set-header__title { font-size: 1.8rem; }
    }

    @media (max-width: 700px) {
      body { gap: 24px; }
      .showcase { gap: 20px; }
      .set-section { gap: 16px; }
      .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 4px 0 32px;
      }
      .card-grid .card-group,
      .card-grid .card {
        width: 100%;
        max-width: none;
      }
      .set-header__row { gap: 14px; }
      .set-header__title { font-size: 1.5rem; }
      .set-logo { height: 46px; }
      .card__caption { padding: 16px 8px 7px; }
      .card__caption-name { font-size: 0.66rem; }
      .card__caption-num { font-size: 0.58rem; }
    }


    /* Flat cards — no tilt, no perspective */
    .card__translater { transform: none !important; }
    .card__rotator {
      transform: none !important;
      -webkit-transform: none !important;
    }

    /* ── Card detail overlay ─────────────────────────────────────────────── */
    .card-overlay {
      position: fixed;
      inset: 0;
      z-index: 600;
      display: flex;
      align-items: center;
      justify-content: center;
      pointer-events: none;
      visibility: hidden;
      transition: visibility 0s linear 0.4s;
    }
    .card-overlay.open {
      pointer-events: auto;
      visibility: visible;
      transition: none;
    }
    .card-overlay__backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0,0,0,0.72);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .card-overlay.open .card-overlay__backdrop {
      opacity: 1;
    }
    .card-overlay__sheet {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      width: 100%;
      max-width: 480px;
      padding: 0 8px 20px;
      opacity: 0;
      transform: translateY(40px);
      transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.25s ease;
    }
    .card-overlay.open .card-overlay__sheet {
      opacity: 1;
      transform: translateY(0);
    }
    .card-overlay__card-wrap {
      position: relative;
      overflow: hidden;
      border-radius: 4.6%/3.3%;
      clip-path: inset(0 round 4.6% / 3.3%);
      box-shadow: 0 24px 60px rgba(0,0,0,0.65);
      flex-shrink: 0;
      /* Wrap owns the size — width relative to parent sheet, not viewport */
      width: 100%;
      max-width: 460px;
      aspect-ratio: 733/1024;
    }
    .card-overlay__card-wrap img,
    .card-overlay__card-wrap canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
    }
    .card-overlay__card-wrap img {
      /* contain (not fill) so the placeholder always keeps the card's aspect ratio —
         never squishes to the container shape — matching the WebGL render. */
      object-fit: contain;
      /* Match the WebGL card's ~91% frame fill (camera z=22) so the flat placeholder
         doesn't visibly shrink when the WebGL canvas takes over. */
      transform: scale(0.912);
      /* Round the flat art's OWN corners (it sits inside the wrap at 91%, so the wrap's clip
         never reaches them) — this hides the raw uncropped rectangle before WebGL renders.
         Radius approximates the card MESH corners (cardfront.json). The mesh corner is a fuller
         "squircle" than a plain CSS ellipse, so we err slightly sharper than the ~3.6%/2.6%
         bounding-box value to stay close to the render and avoid a visible snap. */
      border-radius: 3.0% / 2.2%;
      visibility: hidden; /* toggled via JS — avoids iOS first-paint intrinsic-size flash */
    }
    .card-overlay__info {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      margin-top: -8px;
    }
    .card-overlay__name {
      font-size: 1.25rem;
      font-weight: 600;
      color: #fff;
      text-align: center;
      margin: 0;
      letter-spacing: -0.01em;
    }
    .card-overlay__meta {
      font-size: 0.75rem;
      color: rgba(255,255,255,0.45);
      text-align: center;
      margin: 0;
      letter-spacing: 0.03em;
    }
    /* Consistent set link — never switch to the browser's visited (purple) colour. */
    .card-overlay__meta a,
    .card-overlay__meta a:visited {
      color: #8ab4ff;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .card-overlay__meta a:hover { color: #b3ccff; }
    .card-overlay__close {
      position: fixed;
      /* Clear the iOS status bar / notch — at a flat 16px the button sat under it
         and was untappable on mobile. */
      top: calc(env(safe-area-inset-top, 0px) + 14px);
      right: max(14px, env(safe-area-inset-right, 0px));
      z-index: 10;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.1);
      color: rgba(255,255,255,0.6);
      width: 40px;
      height: 40px;
      border-radius: 50%;
      font-size: 1.2rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      -webkit-tap-highlight-color: transparent;
      opacity: 0;
      transition: background 0.15s ease, color 0.15s ease, opacity 0.25s ease 0.1s;
    }
    .card-overlay.open .card-overlay__close { opacity: 1; }
    .card-overlay__close:hover { background: rgba(255,255,255,0.14); color: #fff; }
    .card-overlay__variants {
      display: none;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
      margin-top: -4px;
    }
    .card-overlay__variants.has-variants { display: flex; }
    .card-overlay__vbtn {
      background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: 20px;
      color: rgba(255,255,255,0.7);
      font-size: 0.72rem;
      font-weight: 500;
      letter-spacing: 0.03em;
      padding: 5px 13px;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }
    .card-overlay__vbtn:hover { background: rgba(255,255,255,0.13); color: #fff; }
    .card-overlay__vbtn.active {
      background: rgba(80,130,255,0.22);
      border-color: rgba(100,150,255,0.55);
      color: #a8c0ff;
    }
    .card-overlay__cta {
      width: 100%;
      max-width: 280px;
      padding: 14px 0;
      background: rgba(255,255,255,0.09);
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: 14px;
      color: #fff;
      font-size: 0.9rem;
      font-weight: 500;
      letter-spacing: 0.01em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: background 0.2s ease, border-color 0.2s ease;
    }
    .card-overlay__cta:hover {
      background: rgba(255,255,255,0.15);
      border-color: rgba(255,255,255,0.22);
    }
    @media (min-width: 601px) {
      /* Game-style centred stack (DOM order): card, then name/set/number, then button. */
      .card-overlay { align-items: center; }
      .card-overlay__sheet {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        max-width: none;
        width: auto;
        padding: 0;
      }
      .card-overlay__info {
        align-items: center;
        gap: 4px;
        margin-top: 0;
      }
      .card-overlay__card-wrap {
        flex: 0 0 auto;
        width: auto;
        max-width: none;   /* override the mobile 460px cap so height drives size */
        /* Leave room for the name + button below while staying large. */
        height: min(62dvh, 720px);
        aspect-ratio: 733/1024;
      }
      .card-overlay__variants { justify-content: center; margin-top: 0; }
      .card-overlay__cta { width: auto; min-width: 240px; max-width: none; }
      .card-overlay__name { font-size: 1.6rem; text-align: center; line-height: 1.15; }
      .card-overlay__meta { font-size: 0.85rem; text-align: center; }
      .card-overlay__close { position: fixed; top: 24px; right: 24px; }
    }

    /* ── Bottom floating navigation ─────────────────────────────────────────── */
    .bottom-nav {
      position: fixed;
      bottom: max(20px, env(safe-area-inset-bottom, 20px));
      left: 50%;
      transform: translateX(-50%);
      z-index: 100;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      pointer-events: none;
    }
    .bottom-nav * { pointer-events: auto; }

    /* The pill: a static floating bar (always visible). */
    .bottom-nav__pill {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 2px;
      background: rgba(16, 16, 20, 0.78);
      border: 1px solid rgba(255,255,255,0.1);
      -webkit-backdrop-filter: blur(28px) saturate(1.4);
      backdrop-filter: blur(28px) saturate(1.4);
      border-radius: 9999px;
      padding: 6px 8px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.06) inset;
      pointer-events: auto;
    }

    .bottom-nav__item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 5px;
      /* Fixed equal width so every hover/active backdrop is the same size (labels of
         different lengths no longer stretch it) and the middle item (Binders) lands
         dead-centre, in line with the (×) FAB below. */
      width: 72px;
      padding: 10px 0;
      border-radius: 9999px;
      background: none;
      border: none;
      color: rgba(255,255,255,0.55);
      font-family: system-ui, sans-serif;
      font-size: 0.68rem;
      font-weight: 500;
      letter-spacing: 0.03em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: background 0.15s ease, color 0.15s ease;
      white-space: nowrap;
    }
    .bottom-nav__item svg { width: 20px; height: 20px; }
    /* Current page: colour the icon (stroke=currentColor) + label with the accent — no backdrop blob. */
    .bottom-nav__item.active { color: var(--acc1, #8b5cf6); }
    /* Hover feedback only on the items you're NOT on (pointer devices). */
    @media (hover: hover) {
      .bottom-nav__item:not(.active):hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
    }
    .bottom-nav__item:active { transform: scale(0.95); }

    /* The (+/×) FAB */
    .bottom-nav__fab {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      background: rgba(255,255,255,0.09);
      border: 1px solid rgba(255,255,255,0.14);
      -webkit-backdrop-filter: blur(20px);
      backdrop-filter: blur(20px);
      color: #fff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      box-shadow: 0 4px 20px rgba(0,0,0,0.4);
      -webkit-tap-highlight-color: transparent;
      transition: background 0.2s ease, transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
      overflow: hidden;
    }
    .bottom-nav__fab:hover { background: rgba(255,255,255,0.15); }
    .bottom-nav__fab svg { width: 22px; height: 22px; position: absolute; transition: opacity 0.2s ease, transform 0.25s ease; }
    .bottom-nav__icon-close { opacity: 0; transform: rotate(-45deg); }
    .bottom-nav__icon-plus  { opacity: 1; transform: rotate(0deg); }
    .bottom-nav.open .bottom-nav__icon-close { opacity: 1; transform: rotate(0deg); }
    .bottom-nav.open .bottom-nav__icon-plus  { opacity: 0; transform: rotate(45deg); }
    .bottom-nav.open .bottom-nav__fab { background: rgba(255,255,255,0.14); }

    @media (max-width: 700px) {
      .bottom-nav__item { width: 62px; padding: 8px 0; font-size: 0.6rem; }
      .bottom-nav__item svg { width: 17px; height: 17px; }
    }


/* ── Motion polish (premium feel, GPU-cheap, accessibility-safe) ──────────── */
.card-grid .card-group { transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.44, 1); }
@media (hover: hover) {
  .card-grid .card-group:hover { transform: translateY(-5px); }
}
.set-tile { transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.44, 1), background 0.2s ease, border-color 0.2s ease; }
@media (hover: hover) {
  .set-tile:hover { transform: translateY(-4px); }
}
/* Respect users who ask for less motion — kills all animation/transition site-wide. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Scroll-lock while an overlay is open. `overflow:hidden` alone doesn't stop iOS
   touch-scroll, so the body is PINNED (position:fixed at its offset via browse.js);
   higher specificity than set.php's `html,body{overflow:visible!important}` so it wins. */
html.is-scroll-locked { overflow: hidden !important; }
html.is-scroll-locked body {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
}
